1
0
Fork 0
forked from fte/fteqw

dedicated server should compile properly now, yay.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1212 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-08-10 17:22:49 +00:00
parent cbdd68fe96
commit f4a3068ae2

View file

@ -3477,7 +3477,7 @@ int Mod_TagNumForName(model_t *model, char *name)
return 0; return 0;
} }
#ifndef SERVERONLY
int GLMod_SkinNumForName(model_t *model, char *name) int GLMod_SkinNumForName(model_t *model, char *name)
{ {
int i; int i;
@ -3497,7 +3497,7 @@ int GLMod_SkinNumForName(model_t *model, char *name)
return -1; return -1;
} }
#endif
#ifdef MD3MODELS #ifdef MD3MODELS
@ -3627,7 +3627,11 @@ void GL_LoadQ3Model(model_t *mod, void *buffer)
parent = NULL; parent = NULL;
root = NULL; root = NULL;
#ifndef SERVERONLY
externalskins = GL_BuildSkinFileList(mod->name); externalskins = GL_BuildSkinFileList(mod->name);
#else
externalskins = 0;
#endif
min[0] = min[1] = min[2] = 0; min[0] = min[1] = min[2] = 0;
max[0] = max[1] = max[2] = 0; max[0] = max[1] = max[2] = 0;
@ -4272,8 +4276,10 @@ galiasinfo_t *GLMod_ParseMD5MeshModel(char *buffer)
galiasgroup_t *pose; galiasgroup_t *pose;
galiasinfo_t *inf, *root, *lastsurf; galiasinfo_t *inf, *root, *lastsurf;
float *posedata; float *posedata;
#ifndef SERVERONLY
galiasskin_t *skin; galiasskin_t *skin;
galiastexnum_t *texnum; galiastexnum_t *texnum;
#endif
float x, y, z, qx, qy, qz; float x, y, z, qx, qy, qz;
@ -4386,7 +4392,9 @@ galiasinfo_t *GLMod_ParseMD5MeshModel(char *buffer)
int *numweightslist = NULL; int *numweightslist = NULL;
galisskeletaltransforms_t *trans; galisskeletaltransforms_t *trans;
#ifndef SERVERONLY
float *stcoord; float *stcoord;
#endif
int *indexes; int *indexes;
float w; float w;
@ -4411,18 +4419,20 @@ galiasinfo_t *GLMod_ParseMD5MeshModel(char *buffer)
lastsurf = inf; lastsurf = inf;
} }
skin = Hunk_Alloc(sizeof(*skin));
texnum = Hunk_Alloc(sizeof(*texnum));
inf->ofsbones = (char*)bones - (char*)inf; inf->ofsbones = (char*)bones - (char*)inf;
inf->numbones = numjoints; inf->numbones = numjoints;
inf->groups = 1; inf->groups = 1;
inf->groupofs = (char*)pose - (char*)inf; inf->groupofs = (char*)pose - (char*)inf;
#ifndef SERVERONLY
skin = Hunk_Alloc(sizeof(*skin));
texnum = Hunk_Alloc(sizeof(*texnum));
inf->numskins = 1; inf->numskins = 1;
inf->ofsskins = (char*)skin - (char*)inf; inf->ofsskins = (char*)skin - (char*)inf;
skin->texnums = 1; skin->texnums = 1;
skin->skinspeed = 1; skin->skinspeed = 1;
skin->ofstexnums = (char*)texnum - (char*)skin; skin->ofstexnums = (char*)texnum - (char*)skin;
#endif
EXPECT("{"); EXPECT("{");
for(;;) for(;;)
{ {
@ -4433,8 +4443,10 @@ galiasinfo_t *GLMod_ParseMD5MeshModel(char *buffer)
if (!strcmp(com_token, "shader")) if (!strcmp(com_token, "shader"))
{ {
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);
#ifndef SERVERONLY
// texnum->shader = R_RegisterSkin(com_token); // texnum->shader = R_RegisterSkin(com_token);
texnum->base = Mod_LoadHiResTexture(com_token, "models", true, true, true); texnum->base = Mod_LoadHiResTexture(com_token, "models", true, true, true);
#endif
} }
else if (!strcmp(com_token, "numverts")) else if (!strcmp(com_token, "numverts"))
{ {
@ -4447,9 +4459,11 @@ galiasinfo_t *GLMod_ParseMD5MeshModel(char *buffer)
firstweightlist = Z_Malloc(sizeof(*firstweightlist) * numverts); firstweightlist = Z_Malloc(sizeof(*firstweightlist) * numverts);
numweightslist = Z_Malloc(sizeof(*numweightslist) * numverts); numweightslist = Z_Malloc(sizeof(*numweightslist) * numverts);
#ifndef SERVERONLY
stcoord = Hunk_Alloc(sizeof(float)*2*numverts); stcoord = Hunk_Alloc(sizeof(float)*2*numverts);
inf->ofs_st_array = (char*)stcoord - (char*)inf; inf->ofs_st_array = (char*)stcoord - (char*)inf;
inf->numverts = numverts; inf->numverts = numverts;
#endif
} }
else if (!strcmp(com_token, "vert")) else if (!strcmp(com_token, "vert"))
{ //vert num ( s t ) firstweight numweights { //vert num ( s t ) firstweight numweights
@ -4461,9 +4475,13 @@ galiasinfo_t *GLMod_ParseMD5MeshModel(char *buffer)
EXPECT("("); EXPECT("(");
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);
#ifndef SERVERONLY
stcoord[num*2+0] = atof(com_token); stcoord[num*2+0] = atof(com_token);
#endif
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);
#ifndef SERVERONLY
stcoord[num*2+1] = atof(com_token); stcoord[num*2+1] = atof(com_token);
#endif
EXPECT(")"); EXPECT(")");
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);
firstweightlist[num] = atoi(com_token); firstweightlist[num] = atoi(com_token);
@ -4648,6 +4666,7 @@ galiasgroup_t GLMod_ParseMD5Anim(char *buffer, galiasinfo_t *prototype, void**po
float *posedata; float *posedata;
float tx, ty, tz, qx, qy, qz; float tx, ty, tz, qx, qy, qz;
int fac, flags; int fac, flags;
float f;
EXPECT("MD5Version"); EXPECT("MD5Version");
EXPECT("10"); EXPECT("10");
@ -4725,14 +4744,20 @@ galiasgroup_t GLMod_ParseMD5Anim(char *buffer, galiasinfo_t *prototype, void**po
for (i = 0; i < numframes; i++) for (i = 0; i < numframes; i++)
{ {
EXPECT("("); EXPECT("(");
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);f=atoi(com_token);
buffer = COM_Parse(buffer); if (f < loadmodel->mins[0]) loadmodel->mins[0] = f;
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);f=atoi(com_token);
if (f < loadmodel->mins[1]) loadmodel->mins[1] = f;
buffer = COM_Parse(buffer);f=atoi(com_token);
if (f < loadmodel->mins[2]) loadmodel->mins[2] = f;
EXPECT(")"); EXPECT(")");
EXPECT("("); EXPECT("(");
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);f=atoi(com_token);
buffer = COM_Parse(buffer); if (f > loadmodel->maxs[0]) loadmodel->maxs[0] = f;
buffer = COM_Parse(buffer); buffer = COM_Parse(buffer);f=atoi(com_token);
if (f > loadmodel->maxs[1]) loadmodel->maxs[1] = f;
buffer = COM_Parse(buffer);f=atoi(com_token);
if (f > loadmodel->maxs[2]) loadmodel->maxs[2] = f;
EXPECT(")"); EXPECT(")");
} }
EXPECT("}"); EXPECT("}");