mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-17 01:21:12 +00:00
soft: reuse calcTexinfoFacesLeafsSize
This commit is contained in:
parent
672fa8780d
commit
31ace1fa5a
2 changed files with 3 additions and 18 deletions
|
@ -1255,8 +1255,7 @@ calcTexinfoAndFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *tl
|
|||
int texinfo_count = tl->filelen / sizeof(*texinfo_in);
|
||||
|
||||
{
|
||||
// out = Hunk_Alloc(count * sizeof(*out));
|
||||
int baseSize = face_count * sizeof(msurface_t);
|
||||
int baseSize = (face_count + EXTRA_LUMP_FACES) * sizeof(msurface_t);
|
||||
baseSize = (baseSize + 31) & ~31;
|
||||
ret += baseSize;
|
||||
|
||||
|
@ -1330,8 +1329,7 @@ calcTexinfoAndQFacesSize(const byte *mod_base, const lump_t *fl, const lump_t *t
|
|||
int texinfo_count = tl->filelen / sizeof(*texinfo_in);
|
||||
|
||||
{
|
||||
// out = Hunk_Alloc(count * sizeof(*out));
|
||||
int baseSize = face_count * sizeof(msurface_t);
|
||||
int baseSize = (face_count + EXTRA_LUMP_FACES) * sizeof(msurface_t);
|
||||
baseSize = (baseSize + 31) & ~31;
|
||||
ret += baseSize;
|
||||
|
||||
|
|
|
@ -492,20 +492,7 @@ Mod_LoadBrushModel(model_t *mod, const void *buffer, int modfilelen)
|
|||
1, 1, 0);
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_PLANES],
|
||||
sizeof(dplane_t), sizeof(cplane_t), EXTRA_LUMP_PLANES);
|
||||
if (header->ident == IDBSPHEADER)
|
||||
{
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_FACES],
|
||||
sizeof(dface_t), sizeof(msurface_t), EXTRA_LUMP_FACES);
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_LEAFFACES],
|
||||
sizeof(short), sizeof(msurface_t *), 0); // yes, out is indeed a pointer!
|
||||
}
|
||||
else
|
||||
{
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_FACES],
|
||||
sizeof(dqface_t), sizeof(msurface_t), EXTRA_LUMP_FACES);
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_LEAFFACES],
|
||||
sizeof(int), sizeof(msurface_t *), 0); // yes, out is indeed a pointer!
|
||||
}
|
||||
hunkSize += calcTexinfoFacesLeafsSize(mod_base, header);
|
||||
hunkSize += Mod_CalcLumpHunkSize(&header->lumps[LUMP_VISIBILITY],
|
||||
1, 1, 0);
|
||||
if (header->ident == IDBSPHEADER)
|
||||
|
|
Loading…
Reference in a new issue