mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Merge pull request #314 from In-line/move_numleafs_check_to_model_load
Move model->numleafs check to Mod_LoadLeafs
This commit is contained in:
commit
47964c847b
@ -47,15 +47,18 @@ unsigned char *Mod_DecompressVis(unsigned char *in, model_t *model)
|
|||||||
{
|
{
|
||||||
return mod_novis;
|
return mod_novis;
|
||||||
}
|
}
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
CM_DecompressPVS(in, decompressed, (model->numleafs + 7) / 8);
|
||||||
|
#else
|
||||||
int row = (model->numleafs + 7) / 8;
|
int row = (model->numleafs + 7) / 8;
|
||||||
// TODO: Move to model loading code
|
|
||||||
if (row < 0 || row > MODEL_MAX_PVS)
|
if (row < 0 || row > MODEL_MAX_PVS)
|
||||||
{
|
{
|
||||||
Sys_Error(__FUNCTION__ ": oversized model->numleafs: %i", model->numleafs);
|
Sys_Error(__FUNCTION__ ": oversized model->numleafs: %i", model->numleafs);
|
||||||
}
|
}
|
||||||
|
|
||||||
CM_DecompressPVS(in, decompressed, row);
|
CM_DecompressPVS(in, decompressed, row);
|
||||||
|
#endif
|
||||||
return decompressed;
|
return decompressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1033,7 +1033,16 @@ void Mod_LoadLeafs(lump_t *l)
|
|||||||
|
|
||||||
loadmodel->leafs = out;
|
loadmodel->leafs = out;
|
||||||
loadmodel->numleafs = count;
|
loadmodel->numleafs = count;
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
{
|
||||||
|
int row = (loadmodel->numleafs + 7) / 8;
|
||||||
|
|
||||||
|
if (row < 0 || row > MODEL_MAX_PVS)
|
||||||
|
{
|
||||||
|
Sys_Error(__FUNCTION__ ": oversized loadmodel->numleafs: %i", loadmodel->numleafs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
for (i = 0; i < count; i++, in++, out++)
|
for (i = 0; i < count; i++, in++, out++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
|
Loading…
Reference in New Issue
Block a user