Defs: Factor out dummytile creation code into E_CreateDummyTile and account for the case when a dummytile may be overwriting a faketile from tilefromtexture.

git-svn-id: https://svn.eduke32.com/eduke32@5176 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-03 07:04:31 +00:00
parent 40c704babe
commit f7c187875c
3 changed files with 10 additions and 3 deletions

View file

@ -1002,6 +1002,7 @@ int32_t clipmapinfo_load(void);
#endif
int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, int16_t dacursectnum);
void E_CreateDummyTile(int32_t const tile);
void E_CreateFakeTile(int32_t const tile, int32_t tsiz, char const * const buffer);
void E_UndefineTile(int32_t const tile);
void set_tilesiz(int32_t picnum, int16_t dasizx, int16_t dasizy);

View file

@ -866,7 +866,7 @@ static int32_t defsparser(scriptfile *script)
{
set_tilesiz(tile, xsiz, ysiz);
Bmemset(&picanm[tile], 0, sizeof(picanm_t));
faketile[tile>>3] |= pow2char[tile&7];
E_CreateDummyTile(tile);
}
break;
@ -897,7 +897,7 @@ static int32_t defsparser(scriptfile *script)
{
set_tilesiz(i, xsiz, ysiz);
Bmemset(&picanm[i], 0, sizeof(picanm_t));
faketile[i>>3] |= pow2char[i&7];
E_CreateDummyTile(i);
}
break;
@ -2120,7 +2120,7 @@ static int32_t defsparser(scriptfile *script)
{
set_tilesiz(tile, xsiz, ysiz);
Bmemset(&picanm[tile], 0, sizeof(picanm_t));
faketile[tile>>3] |= pow2char[tile&7];
E_CreateDummyTile(tile);
}
#ifdef USE_OPENGL
xscale = 1.0f / xscale;

View file

@ -11838,6 +11838,12 @@ void nextpage(void)
// ART loading
//
void E_CreateDummyTile(int32_t const tile)
{
faketile[tile>>3] |= pow2char[tile&7];
DO_FREE_AND_NULL(faketiledata[tile]);
}
void E_CreateFakeTile(int32_t const tile, int32_t tsiz, char const * const buffer)
{
faketiledata[tile] = (char *)Xrealloc(faketiledata[tile], tsiz + 32);