Show func in .Sys_Error and .R_Printf

This commit is contained in:
Denis Pauk 2019-01-31 22:09:33 +02:00
parent b7cac7f8aa
commit 3a85943118
12 changed files with 264 additions and 143 deletions

View File

@ -56,7 +56,7 @@ Mod_PointInLeaf(vec3_t p, model_t *model)
if (!model || !model->nodes)
{
ri.Sys_Error(ERR_DROP, "Mod_PointInLeaf: bad model");
ri.Sys_Error(ERR_DROP, "%s: bad model", __func__);
}
node = model->nodes;
@ -139,7 +139,7 @@ Mod_ForName(char *name, qboolean crash)
if (!name[0])
{
ri.Sys_Error(ERR_DROP, "Mod_ForName: NULL name");
ri.Sys_Error(ERR_DROP, "%s: NULL name", __func__);
}
/* inline models are grabbed only from worldmodel */
@ -149,7 +149,8 @@ Mod_ForName(char *name, qboolean crash)
if ((i < 1) || !r_worldmodel || (i >= r_worldmodel->numsubmodels))
{
ri.Sys_Error(ERR_DROP, "bad inline model number");
ri.Sys_Error(ERR_DROP, "%s: bad inline model number",
__func__);
}
return &mod_inline[i];
@ -197,7 +198,8 @@ Mod_ForName(char *name, qboolean crash)
{
if (crash)
{
ri.Sys_Error(ERR_DROP, "Mod_NumForName: %s not found", mod->name);
ri.Sys_Error(ERR_DROP, "%s: %s not found",
__func__, mod->name);
}
memset(mod->name, 0, sizeof(mod->name));
@ -222,9 +224,8 @@ Mod_ForName(char *name, qboolean crash)
break;
default:
ri.Sys_Error(ERR_DROP,
"Mod_NumForName: unknown fileid for %s",
mod->name);
ri.Sys_Error(ERR_DROP, "%s: unknown fileid for %s",
__func__, mod->name);
break;
}
@ -282,8 +283,8 @@ Mod_LoadVertexes(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -311,8 +312,8 @@ Mod_LoadSubmodels(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -349,8 +350,8 @@ Mod_LoadEdges(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -379,8 +380,8 @@ Mod_LoadTexinfo(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -505,8 +506,8 @@ Mod_LoadFaces(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -540,7 +541,8 @@ Mod_LoadFaces(lump_t *l)
if ((ti < 0) || (ti >= loadmodel->numtexinfo))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad texinfo number");
ri.Sys_Error(ERR_DROP, "%s: bad texinfo number",
__func__);
}
out->texinfo = loadmodel->texinfo + ti;
@ -619,8 +621,8 @@ Mod_LoadNodes(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -673,8 +675,8 @@ Mod_LoadLeafs(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -706,7 +708,8 @@ Mod_LoadLeafs(lump_t *l)
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
if ((firstleafface + out->nummarksurfaces) > loadmodel->nummarksurfaces)
{
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: wrong marksurfaces position in %s",loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: wrong marksurfaces position in %s",
__func__, loadmodel->name);
}
}
}
@ -722,8 +725,8 @@ Mod_LoadMarksurfaces(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -738,7 +741,8 @@ Mod_LoadMarksurfaces(lump_t *l)
if ((j < 0) || (j >= loadmodel->numsurfaces))
{
ri.Sys_Error(ERR_DROP, "Mod_ParseMarksurfaces: bad surface number");
ri.Sys_Error(ERR_DROP, "%s: bad surface number",
__func__);
}
out[i] = loadmodel->surfaces + j;
@ -755,16 +759,16 @@ Mod_LoadSurfedges(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
if ((count < 1) || (count >= MAX_MAP_SURFEDGES))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad surfedges count in %s: %i",
loadmodel->name, count);
ri.Sys_Error(ERR_DROP, "%s: bad surfedges count in %s: %i",
__func__, loadmodel->name, count);
}
out = Hunk_Alloc(count * sizeof(*out));
@ -791,8 +795,8 @@ Mod_LoadPlanes(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -850,8 +854,8 @@ Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen)
if (i != BSPVERSION)
{
ri.Sys_Error(ERR_DROP, "Mod_LoadBrushModel: %s has wrong version number (%i should be %i)",
mod->name, i, BSPVERSION);
ri.Sys_Error(ERR_DROP, "%s: %s has wrong version number (%i should be %i)",
__func__, mod->name, i, BSPVERSION);
}
/* swap all the lumps */
@ -893,7 +897,8 @@ Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen)
if (starmod->firstnode >= loadmodel->numnodes)
{
ri.Sys_Error(ERR_DROP, "Inline model %i has bad firstnode", i);
ri.Sys_Error(ERR_DROP, "%s: Inline model %i has bad firstnode",
__func__, i);
}
VectorCopy(bm->maxs, starmod->maxs);

View File

@ -48,7 +48,7 @@ GL3_Mod_PointInLeaf(vec3_t p, gl3model_t *model)
if (!model || !model->nodes)
{
ri.Sys_Error(ERR_DROP, "Mod_PointInLeaf: bad model");
ri.Sys_Error(ERR_DROP, "%s: bad model", __func__);
}
node = model->nodes;
@ -166,8 +166,8 @@ Mod_LoadVertexes(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -195,8 +195,8 @@ Mod_LoadSubmodels(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -233,8 +233,8 @@ Mod_LoadEdges(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -263,8 +263,8 @@ Mod_LoadTexinfo(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -392,8 +392,8 @@ Mod_LoadFaces(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -427,7 +427,8 @@ Mod_LoadFaces(lump_t *l)
if ((ti < 0) || (ti >= loadmodel->numtexinfo))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad texinfo number");
ri.Sys_Error(ERR_DROP, "%s: bad texinfo number",
__func__);
}
out->texinfo = loadmodel->texinfo + ti;
@ -505,8 +506,8 @@ Mod_LoadNodes(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -559,8 +560,8 @@ Mod_LoadLeafs(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -592,7 +593,8 @@ Mod_LoadLeafs(lump_t *l)
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
if ((firstleafface + out->nummarksurfaces) > loadmodel->nummarksurfaces)
{
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: wrong marksurfaces position in %s",loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: wrong marksurfaces position in %s",
__func__, loadmodel->name);
}
}
}
@ -608,8 +610,8 @@ Mod_LoadMarksurfaces(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -624,7 +626,7 @@ Mod_LoadMarksurfaces(lump_t *l)
if ((j < 0) || (j >= loadmodel->numsurfaces))
{
ri.Sys_Error(ERR_DROP, "Mod_ParseMarksurfaces: bad surface number");
ri.Sys_Error(ERR_DROP, "%s: bad surface number", __func__);
}
out[i] = loadmodel->surfaces + j;
@ -641,16 +643,16 @@ Mod_LoadSurfedges(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
if ((count < 1) || (count >= MAX_MAP_SURFEDGES))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad surfedges count in %s: %i",
loadmodel->name, count);
ri.Sys_Error(ERR_DROP, "%s: bad surfedges count in %s: %i",
__func__, loadmodel->name, count);
}
out = Hunk_Alloc(count * sizeof(*out));
@ -677,8 +679,8 @@ Mod_LoadPlanes(lump_t *l)
if (l->filelen % sizeof(*in))
{
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
@ -736,8 +738,8 @@ Mod_LoadBrushModel(gl3model_t *mod, void *buffer, int modfilelen)
if (i != BSPVERSION)
{
ri.Sys_Error(ERR_DROP, "Mod_LoadBrushModel: %s has wrong version number (%i should be %i)",
mod->name, i, BSPVERSION);
ri.Sys_Error(ERR_DROP, "%s: %s has wrong version number (%i should be %i)",
__func__, mod->name, i, BSPVERSION);
}
/* swap all the lumps */
@ -779,7 +781,8 @@ Mod_LoadBrushModel(gl3model_t *mod, void *buffer, int modfilelen)
if (starmod->firstnode >= loadmodel->numnodes)
{
ri.Sys_Error(ERR_DROP, "Inline model %i has bad firstnode", i);
ri.Sys_Error(ERR_DROP, "%s: Inline model %i has bad firstnode",
__func__, i);
}
VectorCopy(bm->maxs, starmod->maxs);
@ -831,7 +834,7 @@ Mod_ForName(char *name, qboolean crash)
if (!name[0])
{
ri.Sys_Error(ERR_DROP, "Mod_ForName: NULL name");
ri.Sys_Error(ERR_DROP, "%s: NULL name", __func__);
}
/* inline models are grabbed only from worldmodel */
@ -841,7 +844,8 @@ Mod_ForName(char *name, qboolean crash)
if ((i < 1) || !gl3_worldmodel || (i >= gl3_worldmodel->numsubmodels))
{
ri.Sys_Error(ERR_DROP, "bad inline model number");
ri.Sys_Error(ERR_DROP, "%s: bad inline model number",
__func__);
}
return &mod_inline[i];
@ -889,7 +893,8 @@ Mod_ForName(char *name, qboolean crash)
{
if (crash)
{
ri.Sys_Error(ERR_DROP, "Mod_NumForName: %s not found", mod->name);
ri.Sys_Error(ERR_DROP, "%s: %s not found",
__func__, mod->name);
}
memset(mod->name, 0, sizeof(mod->name));
@ -914,9 +919,8 @@ Mod_ForName(char *name, qboolean crash)
break;
default:
ri.Sys_Error(ERR_DROP,
"Mod_NumForName: unknown fileid for %s",
mod->name);
ri.Sys_Error(ERR_DROP, "%s: unknown fileid for %s",
__func__, mod->name);
break;
}

View File

@ -315,8 +315,6 @@ typedef struct surf_s
float nearzi; // nearest 1/z on surface, for mipmapping
qboolean insubmodel;
float d_ziorigin, d_zistepu, d_zistepv;
int pad[2]; // to 64 bytes
} surf_t;
typedef struct edge_s

View File

@ -58,7 +58,6 @@ typedef struct mplane_s
float dist;
byte type; // for texture axis selection and fast side tests
byte signbits; // signx + signy<<1 + signz<<1
byte pad[2];
} mplane_t;

View File

@ -496,8 +496,8 @@ R_AliasSetupSkin(const entity_t *currententity, const model_t *currentmodel)
skinnum = currententity->skinnum;
if ((skinnum >= s_pmdl->num_skins) || (skinnum < 0))
{
R_Printf(PRINT_ALL, "R_AliasSetupSkin %s: no such skin # %d\n",
currentmodel->name, skinnum);
R_Printf(PRINT_ALL, "%s %s: no such skin # %d\n",
__func__, currentmodel->name, skinnum);
skinnum = 0;
}
@ -624,14 +624,14 @@ R_AliasSetupFrames(const entity_t *currententity, const model_t *currentmodel, d
if ( ( thisframe >= pmdl->num_frames ) || ( thisframe < 0 ) )
{
R_Printf(PRINT_ALL, "R_AliasSetupFrames %s: no such thisframe %d\n",
currentmodel->name, thisframe);
R_Printf(PRINT_ALL, "%s %s: no such thisframe %d\n",
__func__, currentmodel->name, thisframe);
thisframe = 0;
}
if ( ( lastframe >= pmdl->num_frames ) || ( lastframe < 0 ) )
{
R_Printf(PRINT_ALL, "R_AliasSetupFrames %s: no such lastframe %d\n",
currentmodel->name, lastframe);
R_Printf(PRINT_ALL, "%s %s: no such lastframe %d\n",
__func__, currentmodel->name, lastframe);
lastframe = 0;
}

View File

@ -377,7 +377,7 @@ R_DrawSolidClippedSubmodelPolygons(entity_t *currententity, const model_t *curre
for (j=0 ; j<psurf->numedges ; j++)
{
lindex = currentmodel->surfedges[psurf->firstedge+j];
lindex = currentmodel->surfedges[psurf->firstedge+j];
if (lindex > 0)
{
@ -399,9 +399,14 @@ R_DrawSolidClippedSubmodelPolygons(entity_t *currententity, const model_t *curre
pbedge[j-1].pnext = NULL; // mark end of edges
if ( !( psurf->texinfo->flags & ( SURF_TRANS66 | SURF_TRANS33 ) ) )
{
// FIXME: Fan broken in borehole
R_RecursiveClipBPoly(currententity, pbedge, topnode, psurf);
}
else
{
R_RenderBmodelFace(currententity, pbedge, psurf );
}
}
}

View File

@ -63,7 +63,7 @@ Draw_InitLocal (void)
draw_chars = RE_Draw_FindPic ("conchars");
if (!draw_chars)
{
ri.Sys_Error(ERR_FATAL, "Couldn't load pics/conchars.pcx");
ri.Sys_Error(ERR_FATAL, "%s: Couldn't load pics/conchars.pcx", __func__);
}
}
@ -171,7 +171,7 @@ RE_Draw_StretchPicImplementation (int x, int y, int w, int h, const image_t *pic
(x + w > vid.width) ||
(y + h > vid.height))
{
ri.Sys_Error (ERR_FATAL,"Draw_Pic: bad coordinates");
ri.Sys_Error(ERR_FATAL, "%s: bad coordinates", __func__);
}
height = h;

View File

@ -97,7 +97,7 @@ R_FindFreeImage (void)
if (i == numr_images)
{
if (numr_images == MAX_RIMAGES)
ri.Sys_Error(ERR_DROP, "MAX_RIMAGES");
ri.Sys_Error(ERR_DROP, "%s: Max images", __func__);
numr_images++;
}
image = &r_images[i];
@ -176,7 +176,7 @@ R_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type)
image = R_FindFreeImage();
if (strlen(name) >= sizeof(image->name))
ri.Sys_Error(ERR_DROP, "Draw_LoadPic: \"%s\" is too long", name);
ri.Sys_Error(ERR_DROP, "%s: '%s' is too long", __func__, name);
strcpy (image->name, name);
image->registration_sequence = registration_sequence;
@ -556,7 +556,7 @@ R_InitImages (void)
if ( !table16to8 )
{
ri.Sys_Error(ERR_FATAL, "Couldn't load pics/16to8.dat");
ri.Sys_Error(ERR_FATAL, "%s: Couldn't load pics/16to8.dat", __func__);
}
d_16to8table = malloc(0x10000);
memcpy(d_16to8table, table16to8, 0x10000);

View File

@ -378,8 +378,6 @@ R_ReallocateMapBuffers (void)
if (r_outofsurfaces)
{
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) surfaces\n",
// __func__, r_cnumsurfs, r_outofsurfaces);
r_cnumsurfs *= 2;
}
@ -414,8 +412,6 @@ R_ReallocateMapBuffers (void)
if (r_outofedges)
{
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) edges\n",
// __func__, r_numallocatededges, r_outofedges * 2 / 3);
r_numallocatededges *= 2;
}
@ -446,8 +442,6 @@ R_ReallocateMapBuffers (void)
if (r_outofverts)
{
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) finalverts\n",
// __func__, r_numallocatedverts, r_outofverts);
r_numallocatedverts *= 2;
}
@ -475,8 +469,6 @@ R_ReallocateMapBuffers (void)
if (r_outoftriangles)
{
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) triangles\n",
// __func__, r_numallocatedtriangles, r_outoftriangles);
r_numallocatedtriangles *= 2;
}
@ -642,8 +634,8 @@ R_DrawEntitiesOnList (void)
modelorg[0] = -r_origin[0];
modelorg[1] = -r_origin[1];
modelorg[2] = -r_origin[2];
VectorCopy( vec3_origin, r_entorigin );
R_DrawBeam( currententity );
VectorCopy(vec3_origin, r_entorigin);
R_DrawBeam(currententity);
}
else
{
@ -1049,7 +1041,9 @@ RE_RenderFrame (refdef_t *fd)
r_newrefdef = *fd;
if (!r_worldmodel && !( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) )
ri.Sys_Error (ERR_FATAL,"R_RenderView: NULL worldmodel");
{
ri.Sys_Error(ERR_FATAL, "%s: NULL worldmodel", __func__);
}
VectorCopy (fd->vieworg, r_refdef.vieworg);
VectorCopy (fd->viewangles, r_refdef.viewangles);
@ -1077,7 +1071,7 @@ RE_RenderFrame (refdef_t *fd)
}
// Draw enemies, barrel etc...
// Use Z-Buffer in read mode only.
// Use Z-Buffer mostly in read mode only.
R_DrawEntitiesOnList ();
if (r_dspeeds->value)
@ -1201,19 +1195,21 @@ RE_BeginFrame( float camera_separation )
if ( err == rserr_invalid_mode )
{
ri.Cvar_SetValue( "r_mode", sw_state.prev_mode );
R_Printf( PRINT_ALL, "ref_soft::RE_BeginFrame() - could not set mode\n" );
R_Printf(PRINT_ALL, "%s: could not set mode", __func__);
}
else if ( err == rserr_invalid_fullscreen )
{
R_InitGraphics( vid.width, vid.height );
ri.Cvar_SetValue( "vid_fullscreen", 0);
R_Printf( PRINT_ALL, "ref_soft::RE_BeginFrame() - fullscreen unavailable in this mode\n" );
R_Printf(PRINT_ALL, "%s: fullscreen unavailable in this mode",
__func__);
sw_state.prev_mode = r_mode->value;
}
else
{
ri.Sys_Error( ERR_FATAL, "ref_soft::RE_BeginFrame() - catastrophic mode change failure\n" );
ri.Sys_Error(ERR_FATAL, "%s: Catastrophic mode change failure",
__func__);
}
}
}

View File

@ -102,7 +102,9 @@ Mod_ForName (char *name, qboolean crash)
int i, modfilelen;
if (!name[0])
ri.Sys_Error (ERR_DROP,"Mod_ForName: NULL name");
{
ri.Sys_Error(ERR_DROP, "%s: NULL name", __func__);
}
//
// inline models are grabbed only from worldmodel
@ -111,7 +113,11 @@ Mod_ForName (char *name, qboolean crash)
{
i = atoi(name+1);
if (i < 1 || !r_worldmodel || i >= r_worldmodel->numsubmodels)
ri.Sys_Error (ERR_DROP, "bad inline model number");
{
ri.Sys_Error(ERR_DROP, "%s: bad inline model number",
__func__);
}
return &mod_inline[i];
}
@ -133,7 +139,7 @@ Mod_ForName (char *name, qboolean crash)
if (i == mod_numknown)
{
if (mod_numknown == MAX_MOD_KNOWN)
ri.Sys_Error (ERR_DROP, "mod_numknown == MAX_MOD_KNOWN");
ri.Sys_Error(ERR_DROP, "mod_numknown == MAX_MOD_KNOWN");
mod_numknown++;
}
strcpy (mod->name, name);
@ -145,7 +151,11 @@ Mod_ForName (char *name, qboolean crash)
if (!buf)
{
if (crash)
ri.Sys_Error (ERR_DROP,"Mod_NumForName: %s not found", mod->name);
{
ri.Sys_Error(ERR_DROP, "%s: %s not found",
__func__, mod->name);
}
memset (mod->name, 0, sizeof(mod->name));
return NULL;
}
@ -173,7 +183,8 @@ Mod_ForName (char *name, qboolean crash)
break;
default:
ri.Sys_Error(ERR_DROP,"Mod_NumForName: unknown fileid for %s", mod->name);
ri.Sys_Error(ERR_DROP, "%s: unknown fileid for %s",
__func__, mod->name);
break;
}
@ -196,7 +207,9 @@ Mod_PointInLeaf (vec3_t p, model_t *model)
mnode_t *node;
if (!model || !model->nodes)
ri.Sys_Error (ERR_DROP, "Mod_PointInLeaf: bad model");
{
ri.Sys_Error(ERR_DROP, "%s: bad model", __func__);
}
node = model->nodes;
while (node->contents == -1)
@ -343,8 +356,13 @@ Mod_LoadVertexes (lump_t *l)
int i, count;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count+8)*sizeof(*out)); // extra for skybox
/*
@ -380,8 +398,13 @@ Mod_LoadSubmodels (lump_t *l)
int i, j, count;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc(count*sizeof(*out));
@ -416,7 +439,11 @@ Mod_LoadEdges (lump_t *l)
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count + 13) * sizeof(*out)); // extra for skybox
@ -444,8 +471,13 @@ Mod_LoadTexinfo (lump_t *l)
char name[MAX_QPATH];
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"Mod_LoadTexinfo: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count+6)*sizeof(*out)); // extra for skybox
@ -563,7 +595,9 @@ CalcSurfaceExtents (msurface_t *s)
if (s->extents[i] < 16)
s->extents[i] = 16; // take at least one cache block
if ( !(tex->flags & (SURF_WARP|SURF_SKY)) && s->extents[i] > 256)
ri.Sys_Error (ERR_DROP,"Bad surface extents");
{
ri.Sys_Error(ERR_DROP, "%s: Bad surface extents", __func__);
}
}
}
@ -581,8 +615,13 @@ Mod_LoadFaces (lump_t *l)
int i, count, surfnum;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count+6)*sizeof(*out)); // extra for skybox
@ -596,7 +635,10 @@ Mod_LoadFaces (lump_t *l)
out->firstedge = LittleLong(in->firstedge);
out->numedges = LittleShort(in->numedges);
if (out->numedges < 3)
ri.Sys_Error (ERR_DROP,"Surface with %d edges", out->numedges);
{
ri.Sys_Error(ERR_DROP, "%s: Surface with %d edges",
__func__, out->numedges);
}
out->flags = 0;
planenum = LittleShort(in->planenum);
@ -688,8 +730,13 @@ Mod_LoadNodes (lump_t *l)
mnode_t *out;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc(count*sizeof(*out));
@ -739,8 +786,13 @@ Mod_LoadLeafs (lump_t *l)
int i, j, count;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc(count*sizeof(*out));
@ -768,7 +820,8 @@ Mod_LoadLeafs (lump_t *l)
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
if ((firstleafface + out->nummarksurfaces) > loadmodel->nummarksurfaces)
{
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: wrong marksurfaces position in %s",loadmodel->name);
ri.Sys_Error(ERR_DROP, "%s: wrong marksurfaces position in %s",
__func__, loadmodel->name);
}
}
}
@ -787,8 +840,13 @@ Mod_LoadMarksurfaces (lump_t *l)
msurface_t **out;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc(count*sizeof(*out));
@ -800,7 +858,9 @@ Mod_LoadMarksurfaces (lump_t *l)
int j;
j = LittleShort(in[i]);
if (j >= loadmodel->numsurfaces)
ri.Sys_Error (ERR_DROP,"Mod_ParseMarksurfaces: bad surface number");
{
ri.Sys_Error(ERR_DROP, "%s: bad surface number", __func__);
}
out[i] = loadmodel->surfaces + j;
}
}
@ -817,8 +877,13 @@ Mod_LoadSurfedges (lump_t *l)
int *in, *out;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count+24)*sizeof(*out)); // extra for skybox
@ -843,8 +908,13 @@ Mod_LoadPlanes (lump_t *l)
int count;
in = (void *)(mod_base + l->fileofs);
if (l->filelen % sizeof(*in))
ri.Sys_Error (ERR_DROP,"MOD_LoadBmodel: funny lump size in %s",loadmodel->name);
{
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
__func__, loadmodel->name);
}
count = l->filelen / sizeof(*in);
out = Hunk_Alloc((count+6)*sizeof(*out)); // extra for skybox
@ -894,13 +964,16 @@ Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen)
loadmodel->type = mod_brush;
if (loadmodel != mod_known)
ri.Sys_Error (ERR_DROP, "Loaded a brush model after the world");
ri.Sys_Error(ERR_DROP, "Loaded a brush model after the world");
header = (dheader_t *)buffer;
i = LittleLong (header->version);
if (i != BSPVERSION)
ri.Sys_Error (ERR_DROP,"Mod_LoadBrushModel: %s has wrong version number (%i should be %i)", mod->name, i, BSPVERSION);
{
ri.Sys_Error(ERR_DROP, "%s: %s has wrong version number (%i should be %i)",
__func__, mod->name, i, BSPVERSION);
}
// swap all the lumps
mod_base = (byte *)header;
@ -940,7 +1013,10 @@ Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen)
starmod->nummodelsurfaces = bm->numfaces;
starmod->firstnode = bm->headnode;
if (starmod->firstnode >= loadmodel->numnodes)
ri.Sys_Error (ERR_DROP, "Inline model %i has bad firstnode", i);
{
ri.Sys_Error(ERR_DROP, "%s: Inline model %i has bad firstnode",
__func__, i);
}
VectorCopy (bm->maxs, starmod->maxs);
VectorCopy (bm->mins, starmod->mins);
@ -980,13 +1056,17 @@ Mod_LoadAliasModel(model_t *mod, void *buffer, int modfilelen)
version = LittleLong (pinmodel->version);
if (version != ALIAS_VERSION)
ri.Sys_Error (ERR_DROP, "%s has wrong version number (%i should be %i)",
mod->name, version, ALIAS_VERSION);
{
ri.Sys_Error(ERR_DROP, "%s: %s has wrong version number (%i should be %i)",
__func__, mod->name, version, ALIAS_VERSION);
}
ofs_end = LittleLong(pinmodel->ofs_end);
if (ofs_end < 0 || ofs_end > modfilelen)
ri.Sys_Error (ERR_DROP, "model %s file size(%d) too small, should be %d", mod->name,
modfilelen, ofs_end);
{
ri.Sys_Error(ERR_DROP, "%s: model %s file size(%d) too small, should be %d", mod->name,
__func__, modfilelen, ofs_end);
}
mod->extradata = Hunk_Begin(modfilelen);
pheader = Hunk_Alloc(ofs_end);
@ -996,23 +1076,40 @@ Mod_LoadAliasModel(model_t *mod, void *buffer, int modfilelen)
((int *)pheader)[i] = LittleLong (((int *)buffer)[i]);
if (pheader->skinheight > MAX_LBM_HEIGHT)
ri.Sys_Error (ERR_DROP, "model %s has a skin taller than %d", mod->name,
MAX_LBM_HEIGHT);
{
ri.Sys_Error(ERR_DROP, "%s: model %s has a skin taller than %d", mod->name,
__func__, MAX_LBM_HEIGHT);
}
if (pheader->num_xyz <= 0)
ri.Sys_Error (ERR_DROP, "model %s has no vertices", mod->name);
{
ri.Sys_Error(ERR_DROP, "%s: model %s has no vertices",
__func__, mod->name);
}
if (pheader->num_xyz > MAX_VERTS)
ri.Sys_Error (ERR_DROP, "model %s has too many vertices", mod->name);
{
ri.Sys_Error(ERR_DROP, "%s: model %s has too many vertices",
__func__, mod->name);
}
if (pheader->num_st <= 0)
ri.Sys_Error (ERR_DROP, "model %s has no st vertices", mod->name);
{
ri.Sys_Error(ERR_DROP, "%s: model %s has no st vertices",
__func__, mod->name);
}
if (pheader->num_tris <= 0)
ri.Sys_Error (ERR_DROP, "model %s has no triangles", mod->name);
{
ri.Sys_Error(ERR_DROP, "%s: model %s has no triangles",
__func__, mod->name);
}
if (pheader->num_frames <= 0)
ri.Sys_Error (ERR_DROP, "model %s has no frames", mod->name);
{
ri.Sys_Error(ERR_DROP, "%s: model %s has no frames",
__func__, mod->name);
}
//
// load base s and t vertices (not used in gl version)
@ -1113,12 +1210,16 @@ Mod_LoadSpriteModel(model_t *mod, void *buffer, int modfilelen)
sprout->numframes = LittleLong (sprin->numframes);
if (sprout->version != SPRITE_VERSION)
ri.Sys_Error (ERR_DROP, "%s has wrong version number (%i should be %i)",
mod->name, sprout->version, SPRITE_VERSION);
{
ri.Sys_Error(ERR_DROP, "%s: %s has wrong version number (%i should be %i)",
__func__, mod->name, sprout->version, SPRITE_VERSION);
}
if (sprout->numframes > MAX_MD2SKINS)
ri.Sys_Error (ERR_DROP, "%s has too many frames (%i > %i)",
mod->name, sprout->numframes, MAX_MD2SKINS);
{
ri.Sys_Error(ERR_DROP, "%s: %s has too many frames (%i > %i)",
__func__, mod->name, sprout->numframes, MAX_MD2SKINS);
}
// byte swap everything
for (i=0 ; i<sprout->numframes ; i++)

View File

@ -983,7 +983,9 @@ R_ClipAndDrawPoly ( float alpha, int isturbulent, qboolean textured )
if (nump < 3)
return;
if (nump > MAXWORKINGVERTS)
ri.Sys_Error(ERR_DROP, "R_ClipAndDrawPoly: too many points: %d", nump );
{
ri.Sys_Error(ERR_DROP, "%s: too many points: %d", __func__, nump);
}
}
// transform vertices into viewspace and project

View File

@ -55,6 +55,9 @@ R_TextureAnimation (const entity_t *currententity, mtexinfo_t *tex)
if (!tex->next)
return tex->image;
if (!currententity)
return tex->image;
c = currententity->frame % tex->numframes;
while (c)
{
@ -269,16 +272,22 @@ D_SCAlloc (int width, int size)
surfcache_t *new;
if ((width < 0) || (width > 256))
ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache width %d\n", width);
{
ri.Sys_Error(ERR_FATAL, "%s: bad cache width %d\n", __func__, width);
}
if ((size <= 0) || (size > 0x10000))
ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache size %d\n", size);
{
ri.Sys_Error(ERR_FATAL, "%s: bad cache size %d\n", __func__, size);
}
// Add header size
size += ((char*)sc_base->data - (char*)sc_base);
size = (size + 3) & ~3;
if (size > sc_size)
ri.Sys_Error (ERR_FATAL,"D_SCAlloc: %i > cache size of %i",size, sc_size);
{
ri.Sys_Error(ERR_FATAL, "%s: %i > cache size of %i", __func__, size, sc_size);
}
// if there is not size bytes after the rover, reset to the start
if ( !sc_rover || (byte *)sc_rover - (byte *)sc_base > sc_size - size)
@ -296,7 +305,9 @@ D_SCAlloc (int width, int size)
// free another
sc_rover = sc_rover->next;
if (!sc_rover)
ri.Sys_Error (ERR_FATAL,"D_SCAlloc: hit the end of memory");
{
ri.Sys_Error(ERR_FATAL, "%s: hit the end of memory", __func__);
}
if (sc_rover->owner)
*sc_rover->owner = NULL;