From 3b3bc6bc0172b5faec75c36f7fe92187e2b618ae Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 13 Mar 2013 10:48:19 +0000 Subject: [PATCH] Lunatic: also save min, max actor times; fix release build. git-svn-id: https://svn.eduke32.com/eduke32@3557 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 2 ++ polymer/eduke32/source/gameexec.c | 17 +++++++++++------ polymer/eduke32/source/lunatic/dynsymlist | 2 ++ polymer/eduke32/source/lunatic/lunatic_game.c | 19 +++++++++++++------ polymer/eduke32/source/lunatic/lunatic_game.h | 2 +- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 80d01720a..65ad3aba0 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1182,6 +1182,8 @@ static int32_t G_GetMorale(int32_t p_i, int32_t snum) #if !defined LUNATIC return Gv_GetVarByLabel("PLR_MORALE",-1, p_i, snum); #else + UNREFERENCED_PARAMETER(p_i); + UNREFERENCED_PARAMETER(snum); return -1; #endif } diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 8c08372ac..6d125ffa7 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5172,7 +5172,6 @@ void A_LoadActor(int32_t iActor) void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist) { #ifdef LUNATIC - double t; int32_t killit=0; #endif vmstate_t tempvm = { iActor, iPlayer, lDist, &actor[iActor].t_data[0], @@ -5235,13 +5234,19 @@ void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist) } #ifdef LUNATIC - t = gethitickms(); + { + double t = gethitickms(); + const int32_t picnum = vm.g_sp->picnum; - if (L_IsInitialized(&g_ElState) && El_HaveActor(vm.g_sp->picnum)) - killit = (El_CallActor(&g_ElState, vm.g_sp->picnum, iActor, iPlayer, lDist)==1); + if (L_IsInitialized(&g_ElState) && El_HaveActor(picnum)) + killit = (El_CallActor(&g_ElState, picnum, iActor, iPlayer, lDist)==1); - g_actorTotalMs[vm.g_sp->picnum] += gethitickms()-t; - g_actorCalls[vm.g_sp->picnum]++; + t = gethitickms()-t; + g_actorTotalMs[picnum] += t; + g_actorMinMs[picnum] = min(g_actorMinMs[picnum], t); + g_actorMaxMs[picnum] = max(g_actorMaxMs[picnum], t); + g_actorCalls[picnum]++; + } #else insptr = 4 + (g_tile[vm.g_sp->picnum].execPtr); VM_Execute(1); diff --git a/polymer/eduke32/source/lunatic/dynsymlist b/polymer/eduke32/source/lunatic/dynsymlist index 71a1f3b1e..5b747fea5 100644 --- a/polymer/eduke32/source/lunatic/dynsymlist +++ b/polymer/eduke32/source/lunatic/dynsymlist @@ -72,6 +72,7 @@ s_buildRev; g_sizes_of_what; g_sizes_of; g_elCallDepth; +g_elEventRETURN; g_modDir; kopen4loadfrommod; @@ -131,6 +132,7 @@ luaJIT_BC_bcarray; luaJIT_BC_bcheck; luaJIT_BC_xmath; luaJIT_BC_defs; +luaJIT_BC_v; rand_jkiss_u32; rand_jkiss_dbl; diff --git a/polymer/eduke32/source/lunatic/lunatic_game.c b/polymer/eduke32/source/lunatic/lunatic_game.c index 21899199d..615f17e98 100644 --- a/polymer/eduke32/source/lunatic/lunatic_game.c +++ b/polymer/eduke32/source/lunatic/lunatic_game.c @@ -28,7 +28,7 @@ int32_t g_elEventRETURN; // for timing events and actors uint32_t g_eventCalls[MAXEVENTS], g_actorCalls[MAXTILES]; -double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES]; +double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES], g_actorMinMs[MAXTILES], g_actorMaxMs[MAXTILES]; // Used as Lua registry key to the tweak_traceback_msg() function, set to 1 if // such a function has been registered. @@ -100,12 +100,14 @@ void El_PrintTimes(void) } OSD_Printf(" },\n\n {\n"); - OSD_Printf(" -- actor times, [tile]={ total calls, total time [ms], mean time/call [us] }\n"); + OSD_Printf(" -- actor times, [tile]={ total calls, total time [ms], {min,mean,max} time/call [us] }\n"); for (i=0; i