For DNCOORDS display, add current sprite count and #inserted sprites / last sec.

Only in debugging builds.

git-svn-id: https://svn.eduke32.com/eduke32@3808 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-05-24 13:54:32 +00:00
parent e3a85f4083
commit 487d54793f
3 changed files with 29 additions and 4 deletions

View File

@ -1765,6 +1765,13 @@ static void G_PrintFPS(void)
// yxaspect and viewingrange just before the 'main' drawrooms call
static int32_t dr_yxaspect, dr_viewingrange;
#ifdef DEBUGGINGAIDS
static struct {
uint32_t lastgtic;
uint32_t lastnumins, numins;
} g_spriteStat;
#endif
static void G_PrintCoords(int32_t snum)
{
const int32_t x = 250;
@ -1802,7 +1809,19 @@ static void G_PrintCoords(int32_t snum)
printext256(x,y+54,31,-1,tempbuf,0);
Bsprintf(tempbuf,"GAMETIC= %d",g_moveThingsCount);
printext256(x,y+63,31,-1,tempbuf,0);
#ifdef DEBUGGINGAIDS
Bsprintf(tempbuf,"NUMSPRITES= %d", Numsprites);
printext256(x,y+72,31,-1,tempbuf,0);
if (g_moveThingsCount > g_spriteStat.lastgtic + REALGAMETICSPERSEC)
{
g_spriteStat.lastgtic = g_moveThingsCount;
g_spriteStat.lastnumins = g_spriteStat.numins;
g_spriteStat.numins = 0;
}
Bsprintf(tempbuf,"INSERTIONS/s= %u", g_spriteStat.lastnumins);
printext256(x,y+81,31,-1,tempbuf,0);
y += 2*9;
#endif
y += 7;
Bsprintf(tempbuf,"VR=%.03f YX=%.03f",(double)dr_viewingrange/65536.0,(double)dr_yxaspect/65536.0);
printext256(x,y+72,31,-1,tempbuf,0);
@ -4139,6 +4158,10 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3
G_GameExit("Too many sprites spawned.");
}
#ifdef DEBUGGINGAIDS
g_spriteStat.numins++;
#endif
s = &sprite[i];
Bmemcpy(s, &spr_temp, sizeof(spritetype));

View File

@ -134,6 +134,7 @@ local function sb_get_initial_strbuf()
return {
"local nan, inf = 0/0, 1/0",
"local t, f = true, false",
"local pairs = assert(pairs)",
-- Clear table function:
"local function ct(t)",
" for k in pairs(t) do t[k]=nil end",

View File

@ -1057,14 +1057,15 @@ static void sv_makevarspec()
static char *magic = "blK:vars";
int32_t i, j, numsavedvars=0, per;
if (svgm_vars)
Bfree(svgm_vars);
for (i=0; i<g_gameVarCount; i++)
numsavedvars += (aGameVars[i].dwFlags&SV_SKIPMASK) ? 0 : 1;
Bfree(svgm_vars);
svgm_vars = (dataspec_t *)Bmalloc((numsavedvars+g_gameArrayCount+2)*sizeof(dataspec_t));
if (svgm_vars == NULL)
G_GameExit("OUT OF MEMORY in sv_makevarspec()\n");
svgm_vars[0].flags = DS_STRING;
svgm_vars[0].ptr = magic;
svgm_vars[0].cnt = 1;