Engine: Add vox_undefine().

git-svn-id: https://svn.eduke32.com/eduke32@5914 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-10-25 05:43:50 +00:00
parent 8a995219de
commit b74c0abd8d
2 changed files with 28 additions and 0 deletions

View File

@ -1029,6 +1029,7 @@ void E_LoadTileIntoBuffer(int16_t tilenume, int32_t dasiz, char *buffer);
void E_RenderArtDataIntoBuffer(palette_t * pic, uint8_t const * buf, int32_t bufsizx, int32_t sizx, int32_t sizy);
int32_t qloadkvx(int32_t voxindex, const char *filename);
void vox_undefine(int32_t const);
intptr_t allocatepermanenttile(int16_t tilenume, int32_t xsiz, int32_t ysiz);
void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz, int32_t tilenume2, int32_t sx2, int32_t sy2);
void makepalookup(int32_t palnum, const char *remapbuf, uint8_t r, uint8_t g, uint8_t b, char noFloorPal);

View File

@ -9991,6 +9991,33 @@ int32_t qloadkvx(int32_t voxindex, const char *filename)
return 0;
}
void vox_undefine(int32_t const tile)
{
ssize_t voxindex = tiletovox[tile];
if (voxindex < 0)
return;
#ifdef USE_OPENGL
if (voxmodels[voxindex])
{
voxfree(voxmodels[voxindex]);
voxmodels[voxindex] = NULL;
}
DO_FREE_AND_NULL(voxfilenames[voxindex]);
#endif
for (ssize_t j = 0; j < MAXVOXMIPS; ++j)
{
// CACHE1D_FREE
voxlock[voxindex][j] = 1;
voxoff[voxindex][j] = 0;
}
voxscale[voxindex] = 65536;
tiletovox[tile] = -1;
// TODO: nextvoxid
}
//
// inside
//