diff --git a/src/dthinker.cpp b/src/dthinker.cpp index 85c5fb4bc..fa2e17a64 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -43,6 +43,7 @@ static cycle_t ThinkCycles; extern cycle_t BotSupportCycles; +extern cycle_t ActionCycles; extern int BotWTG; IMPLEMENT_CLASS (DThinker) @@ -409,6 +410,7 @@ void DThinker::RunThinkers () ThinkCycles.Reset(); BotSupportCycles.Reset(); + ActionCycles.Reset(); BotWTG = 0; ThinkCycles.Clock(); @@ -575,6 +577,6 @@ DThinker *FThinkerIterator::Next () ADD_STAT (think) { FString out; - out.Format ("Think time = %04.1f ms", ThinkCycles.TimeMS()); + out.Format ("Think time = %04.1f ms, Action = %04.1f ms", ThinkCycles.TimeMS(), ActionCycles.TimeMS()); return out; } diff --git a/src/info.cpp b/src/info.cpp index cbcfe89d6..361ba4bf0 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -50,6 +50,7 @@ #include "templates.h" #include "cmdlib.h" #include "g_level.h" +#include "stats.h" extern void LoadActors (); extern void InitBotStuff(); @@ -58,13 +59,17 @@ extern void ClearStrifeTypes(); TArray PClassActor::AllActorClasses; FRandom FState::pr_statetics; +cycle_t ActionCycles; + bool FState::CallAction(AActor *self, AActor *stateowner) { if (ActionFunc != NULL) { - VMFrameStack stack; + ActionCycles.Clock(); + static VMFrameStack stack; VMValue params[3] = { self, stateowner, VMValue(this, ATAG_STATE) }; stack.Call(ActionFunc, params, countof(params), NULL, 0, NULL); + ActionCycles.Unclock(); return true; } else diff --git a/src/p_user.cpp b/src/p_user.cpp index a8b630c37..c86cf186d 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -2192,8 +2192,8 @@ void P_PlayerThink (player_t *player) if (debugfile && !(player->cheats & CF_PREDICTING)) { - fprintf (debugfile, "tic %d for pl %td: (%d, %d, %d, %u) b:%02x p:%d y:%d f:%d s:%d u:%d\n", - gametic, player-players, player->mo->x, player->mo->y, player->mo->z, + fprintf (debugfile, "tic %d for pl %d: (%d, %d, %d, %u) b:%02x p:%d y:%d f:%d s:%d u:%d\n", + gametic, (int)(player-players), player->mo->x, player->mo->y, player->mo->z, player->mo->angle>>ANGLETOFINESHIFT, player->cmd.ucmd.buttons, player->cmd.ucmd.pitch, player->cmd.ucmd.yaw, player->cmd.ucmd.forwardmove, player->cmd.ucmd.sidemove, player->cmd.ucmd.upmove); diff --git a/src/r_things.cpp b/src/r_things.cpp index 680efeacb..74c32ba0f 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -326,6 +326,11 @@ void R_DrawVisSprite (vissprite_t *vis) fixed_t xiscale; ESPSResult mode; + if (vis->xscale == 0 || vis->yscale == 0) + { // scaled to 0; can't see + return; + } + dc_colormap = vis->Style.colormap; mode = R_SetPatchStyle (vis->Style.RenderStyle, vis->Style.alpha, vis->Translation, vis->FillColor);