mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 15:21:44 +00:00
Show func in .Sys_Error and .R_Printf
This commit is contained in:
parent
b7cac7f8aa
commit
3a85943118
12 changed files with 264 additions and 143 deletions
|
@ -56,7 +56,7 @@ Mod_PointInLeaf(vec3_t p, model_t *model)
|
||||||
|
|
||||||
if (!model || !model->nodes)
|
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;
|
node = model->nodes;
|
||||||
|
@ -139,7 +139,7 @@ Mod_ForName(char *name, qboolean crash)
|
||||||
|
|
||||||
if (!name[0])
|
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 */
|
/* 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))
|
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];
|
return &mod_inline[i];
|
||||||
|
@ -197,7 +198,8 @@ Mod_ForName(char *name, qboolean crash)
|
||||||
{
|
{
|
||||||
if (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));
|
memset(mod->name, 0, sizeof(mod->name));
|
||||||
|
@ -222,9 +224,8 @@ Mod_ForName(char *name, qboolean crash)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ri.Sys_Error(ERR_DROP,
|
ri.Sys_Error(ERR_DROP, "%s: unknown fileid for %s",
|
||||||
"Mod_NumForName: unknown fileid for %s",
|
__func__, mod->name);
|
||||||
mod->name);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,8 +283,8 @@ Mod_LoadVertexes(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -311,8 +312,8 @@ Mod_LoadSubmodels(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -349,8 +350,8 @@ Mod_LoadEdges(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -379,8 +380,8 @@ Mod_LoadTexinfo(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -505,8 +506,8 @@ Mod_LoadFaces(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -540,7 +541,8 @@ Mod_LoadFaces(lump_t *l)
|
||||||
|
|
||||||
if ((ti < 0) || (ti >= loadmodel->numtexinfo))
|
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;
|
out->texinfo = loadmodel->texinfo + ti;
|
||||||
|
@ -619,8 +621,8 @@ Mod_LoadNodes(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -673,8 +675,8 @@ Mod_LoadLeafs(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -706,7 +708,8 @@ Mod_LoadLeafs(lump_t *l)
|
||||||
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
|
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
|
||||||
if ((firstleafface + out->nummarksurfaces) > loadmodel->nummarksurfaces)
|
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))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -738,7 +741,8 @@ Mod_LoadMarksurfaces(lump_t *l)
|
||||||
|
|
||||||
if ((j < 0) || (j >= loadmodel->numsurfaces))
|
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;
|
out[i] = loadmodel->surfaces + j;
|
||||||
|
@ -755,16 +759,16 @@ Mod_LoadSurfedges(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
|
||||||
if ((count < 1) || (count >= MAX_MAP_SURFEDGES))
|
if ((count < 1) || (count >= MAX_MAP_SURFEDGES))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad surfedges count in %s: %i",
|
ri.Sys_Error(ERR_DROP, "%s: bad surfedges count in %s: %i",
|
||||||
loadmodel->name, count);
|
__func__, loadmodel->name, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
out = Hunk_Alloc(count * sizeof(*out));
|
out = Hunk_Alloc(count * sizeof(*out));
|
||||||
|
@ -791,8 +795,8 @@ Mod_LoadPlanes(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -850,8 +854,8 @@ Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen)
|
||||||
|
|
||||||
if (i != BSPVERSION)
|
if (i != BSPVERSION)
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "Mod_LoadBrushModel: %s has wrong version number (%i should be %i)",
|
ri.Sys_Error(ERR_DROP, "%s: %s has wrong version number (%i should be %i)",
|
||||||
mod->name, i, BSPVERSION);
|
__func__, mod->name, i, BSPVERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* swap all the lumps */
|
/* swap all the lumps */
|
||||||
|
@ -893,7 +897,8 @@ Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen)
|
||||||
|
|
||||||
if (starmod->firstnode >= loadmodel->numnodes)
|
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->maxs, starmod->maxs);
|
||||||
|
|
|
@ -48,7 +48,7 @@ GL3_Mod_PointInLeaf(vec3_t p, gl3model_t *model)
|
||||||
|
|
||||||
if (!model || !model->nodes)
|
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;
|
node = model->nodes;
|
||||||
|
@ -166,8 +166,8 @@ Mod_LoadVertexes(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -195,8 +195,8 @@ Mod_LoadSubmodels(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -233,8 +233,8 @@ Mod_LoadEdges(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -263,8 +263,8 @@ Mod_LoadTexinfo(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -392,8 +392,8 @@ Mod_LoadFaces(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -427,7 +427,8 @@ Mod_LoadFaces(lump_t *l)
|
||||||
|
|
||||||
if ((ti < 0) || (ti >= loadmodel->numtexinfo))
|
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;
|
out->texinfo = loadmodel->texinfo + ti;
|
||||||
|
@ -505,8 +506,8 @@ Mod_LoadNodes(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -559,8 +560,8 @@ Mod_LoadLeafs(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -592,7 +593,8 @@ Mod_LoadLeafs(lump_t *l)
|
||||||
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
|
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
|
||||||
if ((firstleafface + out->nummarksurfaces) > loadmodel->nummarksurfaces)
|
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))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -624,7 +626,7 @@ Mod_LoadMarksurfaces(lump_t *l)
|
||||||
|
|
||||||
if ((j < 0) || (j >= loadmodel->numsurfaces))
|
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;
|
out[i] = loadmodel->surfaces + j;
|
||||||
|
@ -641,16 +643,16 @@ Mod_LoadSurfedges(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
|
||||||
if ((count < 1) || (count >= MAX_MAP_SURFEDGES))
|
if ((count < 1) || (count >= MAX_MAP_SURFEDGES))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad surfedges count in %s: %i",
|
ri.Sys_Error(ERR_DROP, "%s: bad surfedges count in %s: %i",
|
||||||
loadmodel->name, count);
|
__func__, loadmodel->name, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
out = Hunk_Alloc(count * sizeof(*out));
|
out = Hunk_Alloc(count * sizeof(*out));
|
||||||
|
@ -677,8 +679,8 @@ Mod_LoadPlanes(lump_t *l)
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
if (l->filelen % sizeof(*in))
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
|
ri.Sys_Error(ERR_DROP, "%s: funny lump size in %s",
|
||||||
loadmodel->name);
|
__func__, loadmodel->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
count = l->filelen / sizeof(*in);
|
count = l->filelen / sizeof(*in);
|
||||||
|
@ -736,8 +738,8 @@ Mod_LoadBrushModel(gl3model_t *mod, void *buffer, int modfilelen)
|
||||||
|
|
||||||
if (i != BSPVERSION)
|
if (i != BSPVERSION)
|
||||||
{
|
{
|
||||||
ri.Sys_Error(ERR_DROP, "Mod_LoadBrushModel: %s has wrong version number (%i should be %i)",
|
ri.Sys_Error(ERR_DROP, "%s: %s has wrong version number (%i should be %i)",
|
||||||
mod->name, i, BSPVERSION);
|
__func__, mod->name, i, BSPVERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* swap all the lumps */
|
/* swap all the lumps */
|
||||||
|
@ -779,7 +781,8 @@ Mod_LoadBrushModel(gl3model_t *mod, void *buffer, int modfilelen)
|
||||||
|
|
||||||
if (starmod->firstnode >= loadmodel->numnodes)
|
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->maxs, starmod->maxs);
|
||||||
|
@ -831,7 +834,7 @@ Mod_ForName(char *name, qboolean crash)
|
||||||
|
|
||||||
if (!name[0])
|
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 */
|
/* 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))
|
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];
|
return &mod_inline[i];
|
||||||
|
@ -889,7 +893,8 @@ Mod_ForName(char *name, qboolean crash)
|
||||||
{
|
{
|
||||||
if (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));
|
memset(mod->name, 0, sizeof(mod->name));
|
||||||
|
@ -914,9 +919,8 @@ Mod_ForName(char *name, qboolean crash)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ri.Sys_Error(ERR_DROP,
|
ri.Sys_Error(ERR_DROP, "%s: unknown fileid for %s",
|
||||||
"Mod_NumForName: unknown fileid for %s",
|
__func__, mod->name);
|
||||||
mod->name);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -315,8 +315,6 @@ typedef struct surf_s
|
||||||
float nearzi; // nearest 1/z on surface, for mipmapping
|
float nearzi; // nearest 1/z on surface, for mipmapping
|
||||||
qboolean insubmodel;
|
qboolean insubmodel;
|
||||||
float d_ziorigin, d_zistepu, d_zistepv;
|
float d_ziorigin, d_zistepu, d_zistepv;
|
||||||
|
|
||||||
int pad[2]; // to 64 bytes
|
|
||||||
} surf_t;
|
} surf_t;
|
||||||
|
|
||||||
typedef struct edge_s
|
typedef struct edge_s
|
||||||
|
|
|
@ -58,7 +58,6 @@ typedef struct mplane_s
|
||||||
float dist;
|
float dist;
|
||||||
byte type; // for texture axis selection and fast side tests
|
byte type; // for texture axis selection and fast side tests
|
||||||
byte signbits; // signx + signy<<1 + signz<<1
|
byte signbits; // signx + signy<<1 + signz<<1
|
||||||
byte pad[2];
|
|
||||||
} mplane_t;
|
} mplane_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -496,8 +496,8 @@ R_AliasSetupSkin(const entity_t *currententity, const model_t *currentmodel)
|
||||||
skinnum = currententity->skinnum;
|
skinnum = currententity->skinnum;
|
||||||
if ((skinnum >= s_pmdl->num_skins) || (skinnum < 0))
|
if ((skinnum >= s_pmdl->num_skins) || (skinnum < 0))
|
||||||
{
|
{
|
||||||
R_Printf(PRINT_ALL, "R_AliasSetupSkin %s: no such skin # %d\n",
|
R_Printf(PRINT_ALL, "%s %s: no such skin # %d\n",
|
||||||
currentmodel->name, skinnum);
|
__func__, currentmodel->name, skinnum);
|
||||||
skinnum = 0;
|
skinnum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,14 +624,14 @@ R_AliasSetupFrames(const entity_t *currententity, const model_t *currentmodel, d
|
||||||
|
|
||||||
if ( ( thisframe >= pmdl->num_frames ) || ( thisframe < 0 ) )
|
if ( ( thisframe >= pmdl->num_frames ) || ( thisframe < 0 ) )
|
||||||
{
|
{
|
||||||
R_Printf(PRINT_ALL, "R_AliasSetupFrames %s: no such thisframe %d\n",
|
R_Printf(PRINT_ALL, "%s %s: no such thisframe %d\n",
|
||||||
currentmodel->name, thisframe);
|
__func__, currentmodel->name, thisframe);
|
||||||
thisframe = 0;
|
thisframe = 0;
|
||||||
}
|
}
|
||||||
if ( ( lastframe >= pmdl->num_frames ) || ( lastframe < 0 ) )
|
if ( ( lastframe >= pmdl->num_frames ) || ( lastframe < 0 ) )
|
||||||
{
|
{
|
||||||
R_Printf(PRINT_ALL, "R_AliasSetupFrames %s: no such lastframe %d\n",
|
R_Printf(PRINT_ALL, "%s %s: no such lastframe %d\n",
|
||||||
currentmodel->name, lastframe);
|
__func__, currentmodel->name, lastframe);
|
||||||
lastframe = 0;
|
lastframe = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -377,7 +377,7 @@ R_DrawSolidClippedSubmodelPolygons(entity_t *currententity, const model_t *curre
|
||||||
|
|
||||||
for (j=0 ; j<psurf->numedges ; j++)
|
for (j=0 ; j<psurf->numedges ; j++)
|
||||||
{
|
{
|
||||||
lindex = currentmodel->surfedges[psurf->firstedge+j];
|
lindex = currentmodel->surfedges[psurf->firstedge+j];
|
||||||
|
|
||||||
if (lindex > 0)
|
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
|
pbedge[j-1].pnext = NULL; // mark end of edges
|
||||||
|
|
||||||
if ( !( psurf->texinfo->flags & ( SURF_TRANS66 | SURF_TRANS33 ) ) )
|
if ( !( psurf->texinfo->flags & ( SURF_TRANS66 | SURF_TRANS33 ) ) )
|
||||||
|
{
|
||||||
|
// FIXME: Fan broken in borehole
|
||||||
R_RecursiveClipBPoly(currententity, pbedge, topnode, psurf);
|
R_RecursiveClipBPoly(currententity, pbedge, topnode, psurf);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
R_RenderBmodelFace(currententity, pbedge, psurf );
|
R_RenderBmodelFace(currententity, pbedge, psurf );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ Draw_InitLocal (void)
|
||||||
draw_chars = RE_Draw_FindPic ("conchars");
|
draw_chars = RE_Draw_FindPic ("conchars");
|
||||||
if (!draw_chars)
|
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) ||
|
(x + w > vid.width) ||
|
||||||
(y + h > vid.height))
|
(y + h > vid.height))
|
||||||
{
|
{
|
||||||
ri.Sys_Error (ERR_FATAL,"Draw_Pic: bad coordinates");
|
ri.Sys_Error(ERR_FATAL, "%s: bad coordinates", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
height = h;
|
height = h;
|
||||||
|
|
|
@ -97,7 +97,7 @@ R_FindFreeImage (void)
|
||||||
if (i == numr_images)
|
if (i == numr_images)
|
||||||
{
|
{
|
||||||
if (numr_images == MAX_RIMAGES)
|
if (numr_images == MAX_RIMAGES)
|
||||||
ri.Sys_Error(ERR_DROP, "MAX_RIMAGES");
|
ri.Sys_Error(ERR_DROP, "%s: Max images", __func__);
|
||||||
numr_images++;
|
numr_images++;
|
||||||
}
|
}
|
||||||
image = &r_images[i];
|
image = &r_images[i];
|
||||||
|
@ -176,7 +176,7 @@ R_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type)
|
||||||
|
|
||||||
image = R_FindFreeImage();
|
image = R_FindFreeImage();
|
||||||
if (strlen(name) >= sizeof(image->name))
|
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);
|
strcpy (image->name, name);
|
||||||
image->registration_sequence = registration_sequence;
|
image->registration_sequence = registration_sequence;
|
||||||
|
|
||||||
|
@ -556,7 +556,7 @@ R_InitImages (void)
|
||||||
|
|
||||||
if ( !table16to8 )
|
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);
|
d_16to8table = malloc(0x10000);
|
||||||
memcpy(d_16to8table, table16to8, 0x10000);
|
memcpy(d_16to8table, table16to8, 0x10000);
|
||||||
|
|
|
@ -378,8 +378,6 @@ R_ReallocateMapBuffers (void)
|
||||||
|
|
||||||
if (r_outofsurfaces)
|
if (r_outofsurfaces)
|
||||||
{
|
{
|
||||||
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) surfaces\n",
|
|
||||||
// __func__, r_cnumsurfs, r_outofsurfaces);
|
|
||||||
r_cnumsurfs *= 2;
|
r_cnumsurfs *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -414,8 +412,6 @@ R_ReallocateMapBuffers (void)
|
||||||
|
|
||||||
if (r_outofedges)
|
if (r_outofedges)
|
||||||
{
|
{
|
||||||
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) edges\n",
|
|
||||||
// __func__, r_numallocatededges, r_outofedges * 2 / 3);
|
|
||||||
r_numallocatededges *= 2;
|
r_numallocatededges *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,8 +442,6 @@ R_ReallocateMapBuffers (void)
|
||||||
|
|
||||||
if (r_outofverts)
|
if (r_outofverts)
|
||||||
{
|
{
|
||||||
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) finalverts\n",
|
|
||||||
// __func__, r_numallocatedverts, r_outofverts);
|
|
||||||
r_numallocatedverts *= 2;
|
r_numallocatedverts *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,8 +469,6 @@ R_ReallocateMapBuffers (void)
|
||||||
|
|
||||||
if (r_outoftriangles)
|
if (r_outoftriangles)
|
||||||
{
|
{
|
||||||
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) triangles\n",
|
|
||||||
// __func__, r_numallocatedtriangles, r_outoftriangles);
|
|
||||||
r_numallocatedtriangles *= 2;
|
r_numallocatedtriangles *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,8 +634,8 @@ R_DrawEntitiesOnList (void)
|
||||||
modelorg[0] = -r_origin[0];
|
modelorg[0] = -r_origin[0];
|
||||||
modelorg[1] = -r_origin[1];
|
modelorg[1] = -r_origin[1];
|
||||||
modelorg[2] = -r_origin[2];
|
modelorg[2] = -r_origin[2];
|
||||||
VectorCopy( vec3_origin, r_entorigin );
|
VectorCopy(vec3_origin, r_entorigin);
|
||||||
R_DrawBeam( currententity );
|
R_DrawBeam(currententity);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1049,7 +1041,9 @@ RE_RenderFrame (refdef_t *fd)
|
||||||
r_newrefdef = *fd;
|
r_newrefdef = *fd;
|
||||||
|
|
||||||
if (!r_worldmodel && !( r_newrefdef.rdflags & RDF_NOWORLDMODEL ) )
|
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->vieworg, r_refdef.vieworg);
|
||||||
VectorCopy (fd->viewangles, r_refdef.viewangles);
|
VectorCopy (fd->viewangles, r_refdef.viewangles);
|
||||||
|
@ -1077,7 +1071,7 @@ RE_RenderFrame (refdef_t *fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw enemies, barrel etc...
|
// Draw enemies, barrel etc...
|
||||||
// Use Z-Buffer in read mode only.
|
// Use Z-Buffer mostly in read mode only.
|
||||||
R_DrawEntitiesOnList ();
|
R_DrawEntitiesOnList ();
|
||||||
|
|
||||||
if (r_dspeeds->value)
|
if (r_dspeeds->value)
|
||||||
|
@ -1201,19 +1195,21 @@ RE_BeginFrame( float camera_separation )
|
||||||
if ( err == rserr_invalid_mode )
|
if ( err == rserr_invalid_mode )
|
||||||
{
|
{
|
||||||
ri.Cvar_SetValue( "r_mode", sw_state.prev_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 )
|
else if ( err == rserr_invalid_fullscreen )
|
||||||
{
|
{
|
||||||
R_InitGraphics( vid.width, vid.height );
|
R_InitGraphics( vid.width, vid.height );
|
||||||
|
|
||||||
ri.Cvar_SetValue( "vid_fullscreen", 0);
|
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;
|
sw_state.prev_mode = r_mode->value;
|
||||||
}
|
}
|
||||||
else
|
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__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,9 @@ Mod_ForName (char *name, qboolean crash)
|
||||||
int i, modfilelen;
|
int i, modfilelen;
|
||||||
|
|
||||||
if (!name[0])
|
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
|
// inline models are grabbed only from worldmodel
|
||||||
|
@ -111,7 +113,11 @@ Mod_ForName (char *name, qboolean crash)
|
||||||
{
|
{
|
||||||
i = atoi(name+1);
|
i = atoi(name+1);
|
||||||
if (i < 1 || !r_worldmodel || i >= r_worldmodel->numsubmodels)
|
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];
|
return &mod_inline[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +139,7 @@ Mod_ForName (char *name, qboolean crash)
|
||||||
if (i == mod_numknown)
|
if (i == mod_numknown)
|
||||||
{
|
{
|
||||||
if (mod_numknown == MAX_MOD_KNOWN)
|
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++;
|
mod_numknown++;
|
||||||
}
|
}
|
||||||
strcpy (mod->name, name);
|
strcpy (mod->name, name);
|
||||||
|
@ -145,7 +151,11 @@ Mod_ForName (char *name, qboolean crash)
|
||||||
if (!buf)
|
if (!buf)
|
||||||
{
|
{
|
||||||
if (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));
|
memset (mod->name, 0, sizeof(mod->name));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +183,8 @@ Mod_ForName (char *name, qboolean crash)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +207,9 @@ Mod_PointInLeaf (vec3_t p, model_t *model)
|
||||||
mnode_t *node;
|
mnode_t *node;
|
||||||
|
|
||||||
if (!model || !model->nodes)
|
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;
|
node = model->nodes;
|
||||||
while (node->contents == -1)
|
while (node->contents == -1)
|
||||||
|
@ -343,8 +356,13 @@ Mod_LoadVertexes (lump_t *l)
|
||||||
int i, count;
|
int i, count;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc((count+8)*sizeof(*out)); // extra for skybox
|
out = Hunk_Alloc((count+8)*sizeof(*out)); // extra for skybox
|
||||||
/*
|
/*
|
||||||
|
@ -380,8 +398,13 @@ Mod_LoadSubmodels (lump_t *l)
|
||||||
int i, j, count;
|
int i, j, count;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc(count*sizeof(*out));
|
out = Hunk_Alloc(count*sizeof(*out));
|
||||||
|
|
||||||
|
@ -416,7 +439,11 @@ Mod_LoadEdges (lump_t *l)
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc((count + 13) * sizeof(*out)); // extra for skybox
|
out = Hunk_Alloc((count + 13) * sizeof(*out)); // extra for skybox
|
||||||
|
|
||||||
|
@ -444,8 +471,13 @@ Mod_LoadTexinfo (lump_t *l)
|
||||||
char name[MAX_QPATH];
|
char name[MAX_QPATH];
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc((count+6)*sizeof(*out)); // extra for skybox
|
out = Hunk_Alloc((count+6)*sizeof(*out)); // extra for skybox
|
||||||
|
|
||||||
|
@ -563,7 +595,9 @@ CalcSurfaceExtents (msurface_t *s)
|
||||||
if (s->extents[i] < 16)
|
if (s->extents[i] < 16)
|
||||||
s->extents[i] = 16; // take at least one cache block
|
s->extents[i] = 16; // take at least one cache block
|
||||||
if ( !(tex->flags & (SURF_WARP|SURF_SKY)) && s->extents[i] > 256)
|
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;
|
int i, count, surfnum;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc((count+6)*sizeof(*out)); // extra for skybox
|
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->firstedge = LittleLong(in->firstedge);
|
||||||
out->numedges = LittleShort(in->numedges);
|
out->numedges = LittleShort(in->numedges);
|
||||||
if (out->numedges < 3)
|
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;
|
out->flags = 0;
|
||||||
|
|
||||||
planenum = LittleShort(in->planenum);
|
planenum = LittleShort(in->planenum);
|
||||||
|
@ -688,8 +730,13 @@ Mod_LoadNodes (lump_t *l)
|
||||||
mnode_t *out;
|
mnode_t *out;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc(count*sizeof(*out));
|
out = Hunk_Alloc(count*sizeof(*out));
|
||||||
|
|
||||||
|
@ -739,8 +786,13 @@ Mod_LoadLeafs (lump_t *l)
|
||||||
int i, j, count;
|
int i, j, count;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc(count*sizeof(*out));
|
out = Hunk_Alloc(count*sizeof(*out));
|
||||||
|
|
||||||
|
@ -768,7 +820,8 @@ Mod_LoadLeafs (lump_t *l)
|
||||||
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
|
out->firstmarksurface = loadmodel->marksurfaces + firstleafface;
|
||||||
if ((firstleafface + out->nummarksurfaces) > loadmodel->nummarksurfaces)
|
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;
|
msurface_t **out;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc(count*sizeof(*out));
|
out = Hunk_Alloc(count*sizeof(*out));
|
||||||
|
|
||||||
|
@ -800,7 +858,9 @@ Mod_LoadMarksurfaces (lump_t *l)
|
||||||
int j;
|
int j;
|
||||||
j = LittleShort(in[i]);
|
j = LittleShort(in[i]);
|
||||||
if (j >= loadmodel->numsurfaces)
|
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;
|
out[i] = loadmodel->surfaces + j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -817,8 +877,13 @@ Mod_LoadSurfedges (lump_t *l)
|
||||||
int *in, *out;
|
int *in, *out;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc((count+24)*sizeof(*out)); // extra for skybox
|
out = Hunk_Alloc((count+24)*sizeof(*out)); // extra for skybox
|
||||||
|
|
||||||
|
@ -843,8 +908,13 @@ Mod_LoadPlanes (lump_t *l)
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
in = (void *)(mod_base + l->fileofs);
|
in = (void *)(mod_base + l->fileofs);
|
||||||
|
|
||||||
if (l->filelen % sizeof(*in))
|
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);
|
count = l->filelen / sizeof(*in);
|
||||||
out = Hunk_Alloc((count+6)*sizeof(*out)); // extra for skybox
|
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;
|
loadmodel->type = mod_brush;
|
||||||
if (loadmodel != mod_known)
|
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;
|
header = (dheader_t *)buffer;
|
||||||
|
|
||||||
i = LittleLong (header->version);
|
i = LittleLong (header->version);
|
||||||
if (i != BSPVERSION)
|
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
|
// swap all the lumps
|
||||||
mod_base = (byte *)header;
|
mod_base = (byte *)header;
|
||||||
|
@ -940,7 +1013,10 @@ Mod_LoadBrushModel(model_t *mod, void *buffer, int modfilelen)
|
||||||
starmod->nummodelsurfaces = bm->numfaces;
|
starmod->nummodelsurfaces = bm->numfaces;
|
||||||
starmod->firstnode = bm->headnode;
|
starmod->firstnode = bm->headnode;
|
||||||
if (starmod->firstnode >= loadmodel->numnodes)
|
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->maxs, starmod->maxs);
|
||||||
VectorCopy (bm->mins, starmod->mins);
|
VectorCopy (bm->mins, starmod->mins);
|
||||||
|
@ -980,13 +1056,17 @@ Mod_LoadAliasModel(model_t *mod, void *buffer, int modfilelen)
|
||||||
|
|
||||||
version = LittleLong (pinmodel->version);
|
version = LittleLong (pinmodel->version);
|
||||||
if (version != ALIAS_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);
|
ofs_end = LittleLong(pinmodel->ofs_end);
|
||||||
if (ofs_end < 0 || ofs_end > modfilelen)
|
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);
|
mod->extradata = Hunk_Begin(modfilelen);
|
||||||
pheader = Hunk_Alloc(ofs_end);
|
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]);
|
((int *)pheader)[i] = LittleLong (((int *)buffer)[i]);
|
||||||
|
|
||||||
if (pheader->skinheight > MAX_LBM_HEIGHT)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
// 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);
|
sprout->numframes = LittleLong (sprin->numframes);
|
||||||
|
|
||||||
if (sprout->version != SPRITE_VERSION)
|
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)
|
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
|
// byte swap everything
|
||||||
for (i=0 ; i<sprout->numframes ; i++)
|
for (i=0 ; i<sprout->numframes ; i++)
|
||||||
|
|
|
@ -983,7 +983,9 @@ R_ClipAndDrawPoly ( float alpha, int isturbulent, qboolean textured )
|
||||||
if (nump < 3)
|
if (nump < 3)
|
||||||
return;
|
return;
|
||||||
if (nump > MAXWORKINGVERTS)
|
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
|
// transform vertices into viewspace and project
|
||||||
|
|
|
@ -55,6 +55,9 @@ R_TextureAnimation (const entity_t *currententity, mtexinfo_t *tex)
|
||||||
if (!tex->next)
|
if (!tex->next)
|
||||||
return tex->image;
|
return tex->image;
|
||||||
|
|
||||||
|
if (!currententity)
|
||||||
|
return tex->image;
|
||||||
|
|
||||||
c = currententity->frame % tex->numframes;
|
c = currententity->frame % tex->numframes;
|
||||||
while (c)
|
while (c)
|
||||||
{
|
{
|
||||||
|
@ -269,16 +272,22 @@ D_SCAlloc (int width, int size)
|
||||||
surfcache_t *new;
|
surfcache_t *new;
|
||||||
|
|
||||||
if ((width < 0) || (width > 256))
|
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))
|
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
|
// Add header size
|
||||||
size += ((char*)sc_base->data - (char*)sc_base);
|
size += ((char*)sc_base->data - (char*)sc_base);
|
||||||
size = (size + 3) & ~3;
|
size = (size + 3) & ~3;
|
||||||
if (size > sc_size)
|
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 there is not size bytes after the rover, reset to the start
|
||||||
if ( !sc_rover || (byte *)sc_rover - (byte *)sc_base > sc_size - size)
|
if ( !sc_rover || (byte *)sc_rover - (byte *)sc_base > sc_size - size)
|
||||||
|
@ -296,7 +305,9 @@ D_SCAlloc (int width, int size)
|
||||||
// free another
|
// free another
|
||||||
sc_rover = sc_rover->next;
|
sc_rover = sc_rover->next;
|
||||||
if (!sc_rover)
|
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)
|
if (sc_rover->owner)
|
||||||
*sc_rover->owner = NULL;
|
*sc_rover->owner = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue