more mods to bring the diff of model.c and modle.c.cleint closer before doing the hack job

This commit is contained in:
Bill Currie 2000-05-11 02:07:02 +00:00
parent 2821e93eda
commit a875ed2eed
4 changed files with 88 additions and 78 deletions

View file

@ -66,8 +66,6 @@ refdef_t r_refdef;
mleaf_t *r_viewleaf, *r_oldviewleaf;
texture_t *r_notexture_mip;
int d_lightstylevalue[256]; // 8.8 fraction of base light value

View file

@ -24,6 +24,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "qwsvdef.h"
#ifdef SERVERONLY
#define ERROR SV_Error
#else
#define ERROR Sys_Error
#endif
model_t *loadmodel;
char loadname[32]; // for hunk tags
@ -38,9 +44,8 @@ byte mod_novis[MAX_MAP_LEAFS/8];
model_t mod_known[MAX_MOD_KNOWN];
int mod_numknown;
texture_t r_notexture_mip;
unsigned *model_checksum;
texture_t *r_notexture_mip;
/*
===============
@ -64,7 +69,7 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
mplane_t *plane;
if (!model || !model->nodes)
SV_Error ("Mod_PointInLeaf: bad model");
ERROR ("Mod_PointInLeaf: bad model");
node = model->nodes;
while (1)
@ -166,7 +171,7 @@ model_t *Mod_FindName (char *name)
model_t *mod;
if (!name[0])
SV_Error ("Mod_ForName: NULL name");
ERROR ("Mod_ForName: NULL name");
//
// search the currently loaded models
@ -178,7 +183,7 @@ model_t *Mod_FindName (char *name)
if (i == mod_numknown)
{
if (mod_numknown == MAX_MOD_KNOWN)
SV_Error ("mod_numknown == MAX_MOD_KNOWN");
ERROR ("mod_numknown == MAX_MOD_KNOWN");
strcpy (mod->name, name);
mod->needload = true;
mod_numknown++;
@ -220,7 +225,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
if (!buf)
{
if (crash)
SV_Error ("Mod_NumForName: %s not found", mod->name);
ERROR ("Mod_NumForName: %s not found", mod->name);
return NULL;
}
@ -309,7 +314,7 @@ void Mod_LoadTextures (lump_t *l)
mt->offsets[j] = LittleLong (mt->offsets[j]);
if ( (mt->width & 15) || (mt->height & 15) )
SV_Error ("Texture %s is not 16 aligned", mt->name);
ERROR ("Texture %s is not 16 aligned", mt->name);
pixels = mt->width*mt->height/64*85;
tx = Hunk_AllocName (sizeof(texture_t) +pixels, loadname );
loadmodel->textures[i] = tx;
@ -357,7 +362,7 @@ void Mod_LoadTextures (lump_t *l)
altmax++;
}
else
SV_Error ("Bad animating texture %s", tx->name);
ERROR ("Bad animating texture %s", tx->name);
for (j=i+1 ; j<m->nummiptex ; j++)
{
@ -385,7 +390,7 @@ void Mod_LoadTextures (lump_t *l)
altmax = num+1;
}
else
SV_Error ("Bad animating texture %s", tx->name);
ERROR ("Bad animating texture %s", tx->name);
}
#define ANIM_CYCLE 2
@ -394,7 +399,7 @@ void Mod_LoadTextures (lump_t *l)
{
tx2 = anims[j];
if (!tx2)
SV_Error ("Missing frame %i of %s",j, tx->name);
ERROR ("Missing frame %i of %s",j, tx->name);
tx2->anim_total = max * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE;
@ -406,7 +411,7 @@ void Mod_LoadTextures (lump_t *l)
{
tx2 = altanims[j];
if (!tx2)
SV_Error ("Missing frame %i of %s",j, tx->name);
ERROR ("Missing frame %i of %s",j, tx->name);
tx2->anim_total = altmax * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE;
@ -481,7 +486,7 @@ void Mod_LoadVertexes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -509,7 +514,7 @@ void Mod_LoadSubmodels (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -545,7 +550,7 @@ void Mod_LoadEdges (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);
@ -574,7 +579,7 @@ void Mod_LoadTexinfo (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -600,17 +605,17 @@ void Mod_LoadTexinfo (lump_t *l)
if (!loadmodel->textures)
{
out->texture = &r_notexture_mip; // checkerboard texture
out->texture = r_notexture_mip; // checkerboard texture
out->flags = 0;
}
else
{
if (miptex >= loadmodel->numtextures)
SV_Error ("miptex >= loadmodel->numtextures");
ERROR ("miptex >= loadmodel->numtextures");
out->texture = loadmodel->textures[miptex];
if (!out->texture)
{
out->texture = &r_notexture_mip; // texture not found
out->texture = r_notexture_mip; // texture not found
out->flags = 0;
}
}
@ -666,7 +671,7 @@ void CalcSurfaceExtents (msurface_t *s)
s->texturemins[i] = bmins[i] * 16;
s->extents[i] = (bmaxs[i] - bmins[i]) * 16;
if ( !(tex->flags & TEX_SPECIAL) && s->extents[i] > 256)
SV_Error ("Bad surface extents");
ERROR ("Bad surface extents");
}
}
@ -685,7 +690,7 @@ void Mod_LoadFaces (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -768,7 +773,7 @@ void Mod_LoadNodes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -815,7 +820,7 @@ void Mod_LoadLeafs (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -862,7 +867,7 @@ void Mod_LoadClipnodes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -953,7 +958,7 @@ void Mod_LoadMarksurfaces (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -964,7 +969,7 @@ void Mod_LoadMarksurfaces (lump_t *l)
{
j = LittleShort(in[i]);
if (j >= loadmodel->numsurfaces)
SV_Error ("Mod_ParseMarksurfaces: bad surface number");
ERROR ("Mod_ParseMarksurfaces: bad surface number");
out[i] = loadmodel->surfaces + j;
}
}
@ -981,7 +986,7 @@ void Mod_LoadSurfedges (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -1007,7 +1012,7 @@ void Mod_LoadPlanes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
SV_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*2*sizeof(*out), loadname);
@ -1048,7 +1053,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
i = LittleLong (header->version);
if (i != BSPVERSION)
SV_Error ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i)", mod->name, i, BSPVERSION);
ERROR ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i)", mod->name, i, BSPVERSION);
// swap all the lumps
mod_base = (byte *)header;

View file

@ -25,6 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include "r_local.h"
#ifdef SERVERONLY
#define ERROR SV_Error
#else
#define ERROR Sys_Error
#endif
model_t *loadmodel;
char loadname[32]; // for hunk tags
@ -39,6 +45,9 @@ byte mod_novis[MAX_MAP_LEAFS/8];
model_t mod_known[MAX_MOD_KNOWN];
int mod_numknown;
unsigned *model_checksum;
texture_t *r_notexture_mip;
/*
===============
Mod_Init
@ -67,7 +76,7 @@ void *Mod_Extradata (model_t *mod)
Mod_LoadModel (mod, true);
if (!mod->cache.data)
Sys_Error ("Mod_Extradata: caching failed");
ERROR ("Mod_Extradata: caching failed");
return mod->cache.data;
}
@ -83,7 +92,7 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
mplane_t *plane;
if (!model || !model->nodes)
Sys_Error ("Mod_PointInLeaf: bad model");
ERROR ("Mod_PointInLeaf: bad model");
node = model->nodes;
while (1)
@ -185,7 +194,7 @@ model_t *Mod_FindName (char *name)
model_t *mod;
if (!name[0])
Sys_Error ("Mod_ForName: NULL name");
ERROR ("Mod_ForName: NULL name");
//
// search the currently loaded models
@ -197,7 +206,7 @@ model_t *Mod_FindName (char *name)
if (i == mod_numknown)
{
if (mod_numknown == MAX_MOD_KNOWN)
Sys_Error ("mod_numknown == MAX_MOD_KNOWN");
ERROR ("mod_numknown == MAX_MOD_KNOWN");
strcpy (mod->name, name);
mod->needload = true;
mod_numknown++;
@ -265,7 +274,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
if (!buf)
{
if (crash)
Sys_Error ("Mod_NumForName: %s not found", mod->name);
ERROR ("Mod_NumForName: %s not found", mod->name);
return NULL;
}
@ -367,7 +376,7 @@ void Mod_LoadTextures (lump_t *l)
mt->offsets[j] = LittleLong (mt->offsets[j]);
if ( (mt->width & 15) || (mt->height & 15) )
Sys_Error ("Texture %s is not 16 aligned", mt->name);
ERROR ("Texture %s is not 16 aligned", mt->name);
pixels = mt->width*mt->height/64*85;
tx = Hunk_AllocName (sizeof(texture_t) +pixels, loadname );
loadmodel->textures[i] = tx;
@ -418,7 +427,7 @@ void Mod_LoadTextures (lump_t *l)
altmax++;
}
else
Sys_Error ("Bad animating texture %s", tx->name);
ERROR ("Bad animating texture %s", tx->name);
for (j=i+1 ; j<m->nummiptex ; j++)
{
@ -446,7 +455,7 @@ void Mod_LoadTextures (lump_t *l)
altmax = num+1;
}
else
Sys_Error ("Bad animating texture %s", tx->name);
ERROR ("Bad animating texture %s", tx->name);
}
#define ANIM_CYCLE 2
@ -455,7 +464,7 @@ void Mod_LoadTextures (lump_t *l)
{
tx2 = anims[j];
if (!tx2)
Sys_Error ("Missing frame %i of %s",j, tx->name);
ERROR ("Missing frame %i of %s",j, tx->name);
tx2->anim_total = max * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE;
@ -467,7 +476,7 @@ void Mod_LoadTextures (lump_t *l)
{
tx2 = altanims[j];
if (!tx2)
Sys_Error ("Missing frame %i of %s",j, tx->name);
ERROR ("Missing frame %i of %s",j, tx->name);
tx2->anim_total = altmax * ANIM_CYCLE;
tx2->anim_min = j * ANIM_CYCLE;
tx2->anim_max = (j+1) * ANIM_CYCLE;
@ -542,7 +551,7 @@ void Mod_LoadVertexes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -570,7 +579,7 @@ void Mod_LoadSubmodels (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -606,7 +615,7 @@ void Mod_LoadEdges (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( (count + 1) * sizeof(*out), loadname);
@ -635,7 +644,7 @@ void Mod_LoadTexinfo (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -675,7 +684,7 @@ void Mod_LoadTexinfo (lump_t *l)
else
{
if (miptex >= loadmodel->numtextures)
Sys_Error ("miptex >= loadmodel->numtextures");
ERROR ("miptex >= loadmodel->numtextures");
out->texture = loadmodel->textures[miptex];
if (!out->texture)
{
@ -735,7 +744,7 @@ void CalcSurfaceExtents (msurface_t *s)
s->texturemins[i] = bmins[i] * 16;
s->extents[i] = (bmaxs[i] - bmins[i]) * 16;
if ( !(tex->flags & TEX_SPECIAL) && s->extents[i] > 256)
Sys_Error ("Bad surface extents");
ERROR ("Bad surface extents");
}
}
@ -754,7 +763,7 @@ void Mod_LoadFaces (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -837,7 +846,7 @@ void Mod_LoadNodes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -884,7 +893,7 @@ void Mod_LoadLeafs (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -931,7 +940,7 @@ void Mod_LoadClipnodes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -1022,7 +1031,7 @@ void Mod_LoadMarksurfaces (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -1033,7 +1042,7 @@ void Mod_LoadMarksurfaces (lump_t *l)
{
j = LittleShort(in[i]);
if (j >= loadmodel->numsurfaces)
Sys_Error ("Mod_ParseMarksurfaces: bad surface number");
ERROR ("Mod_ParseMarksurfaces: bad surface number");
out[i] = loadmodel->surfaces + j;
}
}
@ -1050,7 +1059,7 @@ void Mod_LoadSurfedges (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*sizeof(*out), loadname);
@ -1076,7 +1085,7 @@ void Mod_LoadPlanes (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
Sys_Error ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
ERROR ("MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
count = l->filelen / sizeof(*in);
out = Hunk_AllocName ( count*2*sizeof(*out), loadname);
@ -1134,7 +1143,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
i = LittleLong (header->version);
if (i != BSPVERSION)
Sys_Error ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i)", mod->name, i, BSPVERSION);
ERROR ("Mod_LoadBrushModel: %s has wrong version number (%i should be %i)", mod->name, i, BSPVERSION);
// swap all the lumps
mod_base = (byte *)header;
@ -1145,17 +1154,17 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
mod->checksum = 0;
mod->checksum2 = 0;
// checksum all of the map, except for entities
// checksum all of the map, except for entities
for (i = 0; i < HEADER_LUMPS; i++) {
if (i == LUMP_ENTITIES)
continue;
mod->checksum ^= Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
header->lumps[i].filelen);
mod->checksum ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
header->lumps[i].filelen));
if (i == LUMP_VISIBILITY || i == LUMP_LEAFS || i == LUMP_NODES)
continue;
mod->checksum2 ^= Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
header->lumps[i].filelen);
mod->checksum2 ^= LittleLong(Com_BlockChecksum(mod_base + header->lumps[i].fileofs,
header->lumps[i].filelen));
}
// load into heap
@ -1315,7 +1324,7 @@ void * Mod_LoadAliasGroup (void * pin, int *pframeindex, int numv,
{
*poutintervals = LittleFloat (pin_intervals->interval);
if (*poutintervals <= 0.0)
Sys_Error ("Mod_LoadAliasGroup: interval<=0");
ERROR ("Mod_LoadAliasGroup: interval<=0");
poutintervals++;
pin_intervals++;
@ -1366,7 +1375,7 @@ void * Mod_LoadAliasSkin (void * pin, int *pskinindex, int skinsize,
}
else
{
Sys_Error ("Mod_LoadAliasSkin: driver set invalid r_pixbytes: %d\n",
ERROR ("Mod_LoadAliasSkin: driver set invalid r_pixbytes: %d\n",
r_pixbytes);
}
@ -1413,7 +1422,7 @@ void * Mod_LoadAliasSkinGroup (void * pin, int *pskinindex, int skinsize,
{
*poutskinintervals = LittleFloat (pinskinintervals->interval);
if (*poutskinintervals <= 0)
Sys_Error ("Mod_LoadAliasSkinGroup: interval<=0");
ERROR ("Mod_LoadAliasSkinGroup: interval<=0");
poutskinintervals++;
pinskinintervals++;
@ -1483,7 +1492,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
version = LittleLong (pinmodel->version);
if (version != ALIAS_VERSION)
Sys_Error ("%s has wrong version number (%i should be %i)",
ERROR ("%s has wrong version number (%i should be %i)",
mod->name, version, ALIAS_VERSION);
//
@ -1513,21 +1522,21 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
pmodel->skinheight = LittleLong (pinmodel->skinheight);
if (pmodel->skinheight > MAX_LBM_HEIGHT)
Sys_Error ("model %s has a skin taller than %d", mod->name,
ERROR ("model %s has a skin taller than %d", mod->name,
MAX_LBM_HEIGHT);
pmodel->numverts = LittleLong (pinmodel->numverts);
if (pmodel->numverts <= 0)
Sys_Error ("model %s has no vertices", mod->name);
ERROR ("model %s has no vertices", mod->name);
if (pmodel->numverts > MAXALIASVERTS)
Sys_Error ("model %s has too many vertices", mod->name);
ERROR ("model %s has too many vertices", mod->name);
pmodel->numtris = LittleLong (pinmodel->numtris);
if (pmodel->numtris <= 0)
Sys_Error ("model %s has no triangles", mod->name);
ERROR ("model %s has no triangles", mod->name);
pmodel->numframes = LittleLong (pinmodel->numframes);
pmodel->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO;
@ -1545,7 +1554,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
numframes = pmodel->numframes;
if (pmodel->skinwidth & 0x03)
Sys_Error ("Mod_LoadAliasModel: skinwidth not multiple of 4");
ERROR ("Mod_LoadAliasModel: skinwidth not multiple of 4");
pheader->model = (byte *)pmodel - (byte *)pheader;
@ -1555,7 +1564,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
skinsize = pmodel->skinheight * pmodel->skinwidth;
if (numskins < 1)
Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins);
ERROR ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins);
pskintype = (daliasskintype_t *)&pinmodel[1];
@ -1628,7 +1637,7 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
// load the frames
//
if (numframes < 1)
Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d\n", numframes);
ERROR ("Mod_LoadAliasModel: Invalid # of frames: %d\n", numframes);
pframetype = (daliasframetype_t *)&pintriangles[pmodel->numtris];
@ -1733,7 +1742,7 @@ void * Mod_LoadSpriteFrame (void * pin, mspriteframe_t **ppframe)
}
else
{
Sys_Error ("Mod_LoadSpriteFrame: driver set invalid r_pixbytes: %d\n",
ERROR ("Mod_LoadSpriteFrame: driver set invalid r_pixbytes: %d\n",
r_pixbytes);
}
@ -1776,7 +1785,7 @@ void * Mod_LoadSpriteGroup (void * pin, mspriteframe_t **ppframe)
{
*poutintervals = LittleFloat (pin_intervals->interval);
if (*poutintervals <= 0.0)
Sys_Error ("Mod_LoadSpriteGroup: interval<=0");
ERROR ("Mod_LoadSpriteGroup: interval<=0");
poutintervals++;
pin_intervals++;
@ -1812,7 +1821,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
version = LittleLong (pin->version);
if (version != SPRITE_VERSION)
Sys_Error ("%s has wrong version number "
ERROR ("%s has wrong version number "
"(%i should be %i)", mod->name, version, SPRITE_VERSION);
numframes = LittleLong (pin->numframes);
@ -1839,7 +1848,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
// load the frames
//
if (numframes < 1)
Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes);
ERROR ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes);
mod->numframes = numframes;

View file

@ -102,8 +102,6 @@ int reinit_surfcache = 1; // if 1, surface cache is currently empty and
mleaf_t *r_viewleaf, *r_oldviewleaf;
texture_t *r_notexture_mip;
float r_aliastransition, r_resfudge;
int d_lightstylevalue[256]; // 8.8 fraction of base light value