fix makefiles for the recent d3 proc hack

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3737 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-02-27 02:04:36 +00:00
parent cb834a8534
commit d7b9d1019a
5 changed files with 103 additions and 152 deletions

View file

@ -517,6 +517,7 @@ COMMON_OBJS = $(COMMON_ASM_OBJS) \
net_wins.o \
zone.o \
qvm.o \
r_d3.o \
gl_q2bsp.o \
glmod_doom.o \
q3common.o \

View file

@ -5,6 +5,7 @@
void RMod_SetParent (mnode_t *node, mnode_t *parent);
#ifndef SERVERONLY
qboolean Mod_LoadMap_Proc(model_t *model, char *data)
{
char token[256];
@ -293,71 +294,6 @@ qboolean Mod_LoadMap_Proc(model_t *model, char *data)
return true;
}
//edict system as opposed to q2 game dll system.
void D3_FindTouchedLeafs (struct model_s *model, struct pvscache_s *ent, vec3_t cullmins, vec3_t cullmaxs)
{
}
qbyte *D3_LeafPVS (struct model_s *model, int num, qbyte *buffer, unsigned int buffersize)
{
return buffer;
}
int D3_LeafnumForPoint (struct model_s *model, vec3_t point)
{
float p;
int c;
mnode_t *node;
node = model->nodes;
while(1)
{
p = DotProduct(point, node->plane->normal) + node->plane->dist;
c = node->childnum[p<0];
if (c <= 0)
return -1-c;
node = model->nodes + c;
}
return 0;
}
unsigned int D3_FatPVS (struct model_s *model, vec3_t org, qbyte *pvsbuffer, unsigned int buffersize, qboolean merge)
{
return 0;
}
void D3_StainNode (struct mnode_s *node, float *parms)
{
}
qboolean D3_Trace (struct model_s *model, int hulloverride, int frame, vec3_t axis[3], vec3_t p1, vec3_t p2, vec3_t mins, vec3_t maxs, struct trace_s *trace)
{
trace->fraction = 0;
VectorCopy(p1, trace->endpos);
trace->allsolid = true;
trace->startsolid = true;
trace->ent = NULL;
return false;
}
unsigned int D3_PointContents (struct model_s *model, vec3_t axis[3], vec3_t p)
{
return FTECONTENTS_SOLID;
}
void D3_LightPointValues (struct model_s *model, vec3_t point, vec3_t res_diffuse, vec3_t res_ambient, vec3_t res_dir)
{
VectorClear(res_diffuse);
VectorClear(res_ambient);
VectorClear(res_dir);
res_dir[2] = 1;
}
qboolean D3_EdictInFatPVS (struct model_s *model, struct pvscache_s *edict, qbyte *pvsbuffer)
{
int i;
for (i = 0; i < edict->num_leafs; i++)
if (pvsbuffer[edict->leafnums[i]>>3] & (1u<<(edict->leafnums[i]&7)))
return true;
return false;
}
static qboolean D3_PolyBounds(vec_t result[4], int count, vec4_t *vlist)
{
@ -516,6 +452,74 @@ void D3_GenerateAreas(model_t *mod)
}
}
#endif
//edict system as opposed to q2 game dll system.
void D3_FindTouchedLeafs (struct model_s *model, struct pvscache_s *ent, vec3_t cullmins, vec3_t cullmaxs)
{
}
qbyte *D3_LeafPVS (struct model_s *model, int num, qbyte *buffer, unsigned int buffersize)
{
return buffer;
}
int D3_LeafnumForPoint (struct model_s *model, vec3_t point)
{
float p;
int c;
mnode_t *node;
node = model->nodes;
while(1)
{
p = DotProduct(point, node->plane->normal) + node->plane->dist;
c = node->childnum[p<0];
if (c <= 0)
return -1-c;
node = model->nodes + c;
}
return 0;
}
unsigned int D3_FatPVS (struct model_s *model, vec3_t org, qbyte *pvsbuffer, unsigned int buffersize, qboolean merge)
{
return 0;
}
void D3_StainNode (struct mnode_s *node, float *parms)
{
}
qboolean D3_Trace (struct model_s *model, int hulloverride, int frame, vec3_t axis[3], vec3_t p1, vec3_t p2, vec3_t mins, vec3_t maxs, struct trace_s *trace)
{
trace->fraction = 0;
VectorCopy(p1, trace->endpos);
trace->allsolid = true;
trace->startsolid = true;
trace->ent = NULL;
return false;
}
unsigned int D3_PointContents (struct model_s *model, vec3_t axis[3], vec3_t p)
{
return FTECONTENTS_SOLID;
}
void D3_LightPointValues (struct model_s *model, vec3_t point, vec3_t res_diffuse, vec3_t res_ambient, vec3_t res_dir)
{
VectorClear(res_diffuse);
VectorClear(res_ambient);
VectorClear(res_dir);
res_dir[2] = 1;
}
qboolean D3_EdictInFatPVS (struct model_s *model, struct pvscache_s *edict, qbyte *pvsbuffer)
{
int i;
for (i = 0; i < edict->num_leafs; i++)
if (pvsbuffer[edict->leafnums[i]>>3] & (1u<<(edict->leafnums[i]&7)))
return true;
return false;
}
qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf)
{
char token[256];
@ -544,12 +548,14 @@ qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf)
/*that's the physics sorted*/
#ifndef SERVERONLY
if (isDedicated)
return true;
COM_StripExtension(mod->name, token, sizeof(token));
buf = FS_LoadMallocFile(va("%s.proc", token));
Mod_LoadMap_Proc(mod, buf);
BZ_Free(buf);
return true;
if (!isDedi
cated)
{
COM_StripExtension(mod->name, token, sizeof(token));
buf = FS_LoadMallocFile(va("%s.proc", token));
Mod_LoadMap_Proc(mod, buf);
BZ_Free(buf);
}
#endif
return true;
}

View file

@ -14105,13 +14105,6 @@
<File
RelativePath="..\client\snd_al.c"
>
<FileConfiguration
Name="D3DDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug|x64"
ExcludedFromBuild="true"
@ -14122,7 +14115,6 @@
</FileConfiguration>
<FileConfiguration
Name="GLDebug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
@ -14176,13 +14168,6 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MDebug|x64"
ExcludedFromBuild="true"
@ -26392,6 +26377,10 @@
RelativePath="..\client\r_2d.c"
>
</File>
<File
RelativePath="..\client\r_d3.c"
>
</File>
<File
RelativePath="..\client\r_surf.c"
>

View file

@ -3,7 +3,7 @@
ProjectType="Visual C++"
Version="8.00"
Name="ftequake_SDL"
ProjectGUID="{88BFEE0E-7BC0-43AD-9CCC-6B1A6E4C1364}"
ProjectGUID="{F384725A-62D4-4063-9941-6D8D2D6C2A47}"
RootNamespace="ftequake_SDL"
>
<Platforms>
@ -10972,14 +10972,6 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server SDL|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server SDL|x64"
ExcludedFromBuild="true"
@ -10990,6 +10982,14 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server SDL|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug Dedicated Server SDL|x64"
ExcludedFromBuild="true"
@ -14105,55 +14105,6 @@
<File
RelativePath="..\client\snd_al.c"
>
<FileConfiguration
Name="MinGLDebug_SDL|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLDebug_SDL|x64"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug_SDL|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="D3DDebug_SDL|x64"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease_SDL|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="MinGLRelease_SDL|x64"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLDebug_SDL|x64"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release Dedicated Server SDL|Win32"
ExcludedFromBuild="true"
@ -14218,13 +14169,6 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="GLRelease_SDL|x64"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\client\snd_directx.c"

View file

@ -27,6 +27,7 @@ char loadname[32]; // for hunk tags
qboolean Mod_LoadBrushModel (model_t *mod, void *buffer);
qboolean Mod_LoadQ2BrushModel (model_t *mod, void *buffer);
qboolean D3_LoadMap_CollisionMap(model_t *mod, char *buf);
qboolean Mod_LoadQ1Model (model_t *mod, void *buffer);
qboolean Mod_LoadQ2Model (model_t *mod, void *buffer);
@ -470,6 +471,16 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
#endif
default:
COM_Parse((char*)buf);
#ifdef MAP_PROC
if (!strcmp(com_token, "CM")) //doom3 map.
{
if (!D3_LoadMap_CollisionMap (mod, (char*)buf))
goto couldntload;
break;
}
#endif
Con_Printf (CON_ERROR "Mod_NumForName: %s: format not recognised\n", mod->name);
couldntload:
if (crash)