From c4193d933b7f1721832bf2f301c3478d6d4344f9 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 21 Jan 2016 19:35:11 +0000 Subject: [PATCH] Move C-CON compile stat printing into its own function. git-svn-id: https://svn.eduke32.com/eduke32@5574 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 73 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 5797e1566..12a67af41 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -6157,6 +6157,43 @@ static char const * C_ScriptVersionString(int32_t version) } } +void C_PrintStats(void) +{ + initprintf("%d/%d labels, %d/%d variables, %d/%d arrays\n", g_numLabels, + (int32_t) min((MAXSECTORS * sizeof(sectortype)/sizeof(int32_t)), + MAXSPRITES * sizeof(spritetype)/(1<<6)), + g_gameVarCount, MAXGAMEVARS, g_gameArrayCount, MAXGAMEARRAYS); + + if (g_numQuoteRedefinitions) + initprintf("%d strings, ", g_numQuoteRedefinitions); + + int i, j; + + for (i=MAXQUOTES-1, j=0; i>=0; i--) + { + if (ScriptQuotes[i]) + j++; + } + + if (j) initprintf("%d quotes, ", j); + + for (i=MAXGAMEEVENTS-1, j=0; i>=0; i--) + { + if (apScriptGameEvent[i]) + j++; + } + if (j) initprintf("%d events, ", j); + + for (i=MAXTILES-1, j=0; i>=0; i--) + { + if (g_tile[i].execPtr) + j++; + } + if (j) initprintf("%d actors", j); + + initprintf("\n"); +} + void C_Compile(const char *filenam) { int32_t i; @@ -6315,41 +6352,7 @@ void C_Compile(const char *filenam) freesoundhashnames(); if (g_scriptDebug) - { - initprintf("%d/%d labels, %d/%d variables, %d/%d arrays\n", g_numLabels, - (int32_t) min((MAXSECTORS * sizeof(sectortype)/sizeof(int32_t)), - MAXSPRITES * sizeof(spritetype)/(1<<6)), - g_gameVarCount, MAXGAMEVARS, g_gameArrayCount, MAXGAMEARRAYS); - - if (g_numQuoteRedefinitions) - initprintf("%d strings, ", g_numQuoteRedefinitions); - - int j; - - for (i=MAXQUOTES-1, j=0; i>=0; i--) - { - if (ScriptQuotes[i]) - j++; - } - - if (j) initprintf("%d quotes, ", j); - - for (i=MAXGAMEEVENTS-1, j=0; i>=0; i--) - { - if (apScriptGameEvent[i]) - j++; - } - if (j) initprintf("%d events, ", j); - - for (i=MAXTILES-1, j=0; i>=0; i--) - { - if (g_tile[i].execPtr) - j++; - } - if (j) initprintf("%d actors", j); - - initprintf("\n"); - } + C_PrintStats(); C_InitQuotes(); }