From 73e436730d88cd86927f2fa48e0c52cf33663a03 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 22 Jun 2020 21:07:20 +0200 Subject: [PATCH] - fixed interpolation and sprite setup. Both caused quite noticable glitches on the first WW2GI map. --- source/games/duke/src/actors.h | 4 ++-- source/games/duke/src/names.h | 1 + source/games/duke/src/spawn.cpp | 2 +- source/games/duke/src/zz_game.cpp | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/games/duke/src/actors.h b/source/games/duke/src/actors.h index 1d6e99cfd..44a2cbc0d 100644 --- a/source/games/duke/src/actors.h +++ b/source/games/duke/src/actors.h @@ -265,8 +265,8 @@ void G_StopInterpolation(const int32_t *posptr); void Sect_ToggleInterpolation(int sectnum, int setInterpolation); static FORCE_INLINE void Sect_ClearInterpolation(int sectnum) { Sect_ToggleInterpolation(sectnum, 0); } static FORCE_INLINE void Sect_SetInterpolation(int sectnum) { Sect_ToggleInterpolation(sectnum, 1); } -static FORCE_INLINE void clearsectinterpolate(int sectnum) { Sect_ToggleInterpolation(sectnum, 0); } -static FORCE_INLINE void setsectinterpolate(int sectnum) { Sect_ToggleInterpolation(sectnum, 1); } +static FORCE_INLINE void clearsectinterpolate(int sprnum) { Sect_ToggleInterpolation(sprite[sprnum].sectnum, 0); } +static FORCE_INLINE void setsectinterpolate(int sprnum) { Sect_ToggleInterpolation(sprite[sprnum].sectnum, 1); } #if KRANDDEBUG # define ACTOR_INLINE __fastcall diff --git a/source/games/duke/src/names.h b/source/games/duke/src/names.h index bf4f6f156..5f655496c 100644 --- a/source/games/duke/src/names.h +++ b/source/games/duke/src/names.h @@ -617,6 +617,7 @@ enum BLIMP = 3400, FEM9 = 3450, FOOTPRINT = 3701, + FRAMEEFFECT1_13= 3999, POOP = 4094, FRAMEEFFECT1 = 4095, PANNEL3 = 4099, diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 2b64197b1..da96f7a08 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -212,7 +212,7 @@ int initspriteforspawn(int j, int pn, const std::initializer_list &excludes sp->extra = ScriptCode[actorinfo[s].scriptaddress]; t[4] = ScriptCode[actorinfo[s].scriptaddress+1]; t[1] = ScriptCode[actorinfo[s].scriptaddress+2]; - int s3 = ScriptCode[actorinfo[s].scriptaddress]; + int s3 = ScriptCode[actorinfo[s].scriptaddress+3]; if (s3 && sp->hitag == 0) sp->hitag = s3; } diff --git a/source/games/duke/src/zz_game.cpp b/source/games/duke/src/zz_game.cpp index b50305c99..31c7b5137 100644 --- a/source/games/duke/src/zz_game.cpp +++ b/source/games/duke/src/zz_game.cpp @@ -2890,4 +2890,5 @@ void GameInterface::UpdateScreenSize() psaccess ps; actor_t* hittype = actor; + END_DUKE_NS