From 23ba7b15505e35858376b3c3a6ae4e1034b33c5c Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 7 Apr 2019 20:56:31 +0000 Subject: [PATCH] Tiny performance cleanup in G_ShowView git-svn-id: https://svn.eduke32.com/eduke32@7491 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gameexec.cpp | 10 +++++----- source/duke3d/src/gameexec.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 45f5949f7..f6bafd129 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -1170,7 +1170,7 @@ static int G_StartTrackSlotWrap(int const volumeNum, int const levelNum) int G_StartTrack(int const levelNum) { return G_StartTrackSlot(ud.volume_number, levelNum); } #endif -LUNATIC_EXTERN void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int sect, int x1, int y1, int x2, int y2, bool unbiasedp) +LUNATIC_EXTERN void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int sect, int ix1, int iy1, int ix2, int iy2, bool unbiasedp) { if (g_screenCapture) return; @@ -1181,10 +1181,10 @@ LUNATIC_EXTERN void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int sect, i return; } - if (x1 > x2) - swaplong(&x1, &x2); - if (y1 > y2) - swaplong(&y1, &y2); + int x1 = min(ix1, ix2); + int x2 = max(ix1, ix2); + int y1 = min(iy1, iy2); + int y2 = max(iy1, iy2); if (!unbiasedp) { diff --git a/source/duke3d/src/gameexec.h b/source/duke3d/src/gameexec.h index a6a3bb7c4..357e65ece 100644 --- a/source/duke3d/src/gameexec.h +++ b/source/duke3d/src/gameexec.h @@ -123,8 +123,8 @@ static FORCE_INLINE int32_t VM_OnEventWithReturn(int nEventID, int spriteNum, in void G_GetTimeDate(int32_t * pValues); int G_StartTrack(int levelNum); #ifdef LUNATIC -void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int32_t sect, - int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t unbiasedp); +void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int sect, + int ix1, int iy1, int ix2, int iy2, bool unbiasedp); void P_AddWeaponMaybeSwitchI(int32_t snum, int32_t weap); void VM_FallSprite(int32_t i); int32_t VM_ResetPlayer2(int32_t snum, int32_t flags);