From f78cfb590d9f2e17c7101381e729444027456f40 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 31 Aug 2022 23:30:04 +0200 Subject: [PATCH] - minor cleanup --- source/games/sw/src/game.h | 15 ++------------- source/games/sw/src/player.cpp | 2 +- wadsrc/static/zscript/games/sw/swgame.zs | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 7a0e698fa..558bac9ed 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -239,29 +239,18 @@ inline int GetSpriteSizeZ(const spritetypebase* sp) } -// Z size of top (TOS) and bottom (BOS) part of sprite -inline int GetSpriteSizeToTop(const spritetypebase* sp) -{ - return ((GetSpriteSizeZ(sp) >> 1) + (tileTopOffset(sp->picnum) << 8)); -} - -inline int GetSpriteSizeToBottom(const spritetypebase* sp) -{ - return ((GetSpriteSizeZ(sp) >> 1) - (tileTopOffset(sp->picnum) << 8)); -} - // actual Z for TOS and BOS - handles both WYSIWYG and old style inline int GetSpriteZOfTop(const spritetypebase* sp) { return (sp->cstat & CSTAT_SPRITE_YCENTER) ? - sp->int_pos().Z - GetSpriteSizeToTop(sp) : + sp->int_pos().Z - ((GetSpriteSizeZ(sp) >> 1) + (tileTopOffset(sp->picnum) << 8)) : sp->int_pos().Z - GetSpriteSizeZ(sp); } inline int GetSpriteZOfBottom(const spritetypebase* sp) { return (sp->cstat & CSTAT_SPRITE_YCENTER) ? - sp->int_pos().Z + GetSpriteSizeToBottom(sp) : + sp->int_pos().Z + ((GetSpriteSizeZ(sp) >> 1) - (tileTopOffset(sp->picnum) << 8)) : sp->int_pos().Z; } diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 2279db7d6..704fec34b 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -7036,7 +7036,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYER, LadderSector) //DEFINE_FIELD_X(SWPlayer, PLAYER, ly) DEFINE_FIELD_X(SWPlayer, PLAYER, JumpDuration) DEFINE_FIELD_X(SWPlayer, PLAYER, WadeDepth) -//DEFINE_FIELD_X(SWPlayer, PLAYER, bob_amt) +DEFINE_FIELD_X(SWPlayer, PLAYER, pbob_amt) DEFINE_FIELD_X(SWPlayer, PLAYER, bob_ndx) DEFINE_FIELD_X(SWPlayer, PLAYER, bcnt) DEFINE_FIELD_X(SWPlayer, PLAYER, bob_z) diff --git a/wadsrc/static/zscript/games/sw/swgame.zs b/wadsrc/static/zscript/games/sw/swgame.zs index 009e9a0be..b8fc18944 100644 --- a/wadsrc/static/zscript/games/sw/swgame.zs +++ b/wadsrc/static/zscript/games/sw/swgame.zs @@ -220,7 +220,7 @@ struct SWPlayer native //native int16 LadderSector; native int16 JumpDuration; native int16 WadeDepth; - //native double bob_amt; + native double pbob_amt; native int16 bob_ndx; native int16 bcnt; // bob count native int bob_z, obob_z;