C4Surface: Make dbg_index unsigned int instead of int*

It seems like an odd decision to add a layer of indirection to this,
especially since it's just a pointer to int instead of a pointer to a
larger structure.
liquid_container
Nicolas Hake 2016-02-08 14:44:25 +01:00
parent 059e9e7060
commit 7b04914fc4
2 changed files with 5 additions and 8 deletions

View File

@ -97,7 +97,7 @@ void C4Surface::Default()
iTexSize=iTexX=iTexY=0;
fIsBackground=false;
#ifdef _DEBUG
dbg_idx = NULL;
dbg_idx = 0;
#endif
}
@ -149,8 +149,7 @@ void C4Surface::Clear()
#endif
FreeTextures();
#ifdef _DEBUG
delete dbg_idx;
dbg_idx = NULL;
dbg_idx = 0;
#endif
}
@ -235,10 +234,8 @@ bool C4Surface::CreateTextures(int Flags)
}
#ifdef _DEBUG
static int dbg_counter = 0;
if (dbg_idx) delete dbg_idx;
dbg_idx = new int;
*dbg_idx = dbg_counter++;
static unsigned int dbg_counter = 0;
dbg_idx = ++dbg_counter;
#endif
// success
return true;

View File

@ -71,7 +71,7 @@ public:
int ClipX,ClipY,ClipX2,ClipY2;
bool fIsBackground; // background surfaces fill unused pixels with black, rather than transparency - must be set prior to loading
#ifdef _DEBUG
int *dbg_idx;
unsigned int dbg_idx;
#endif
#ifndef USE_CONSOLE
unsigned int Format; // used color format in textures