From c707167c94f5c4b8275df0bb9a32943a8efc2f26 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 May 2023 18:28:29 +0200 Subject: [PATCH] - eliminated all uses of tile index constants in Blood. The literal numbers still remain, though. --- source/games/blood/src/animatesprite.cpp | 24 ++++++++++++------------ source/games/blood/src/texidsdef.h | 10 ++++++++++ source/games/blood/src/view.h | 8 -------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index b40f171d6..050da6d40 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -86,23 +86,23 @@ static const int effectDetail[kViewEffectMax] = { struct WEAPONICON { int16_t nTile; uint8_t zOffset; - FTextureID textureID() const { return tileGetTextureID(nTile); } + FTextureID textureID() const { return aTexIds[nTile]; } }; static const WEAPONICON gWeaponIcon[] = { { -1, 0 }, { -1, 0 }, // 1: pitchfork - { kICONFLAREGUN, 6 }, // 2: flare gun - { kICONSHOTGUN, 6 }, // 3: shotgun - { kICONTOMMY, 8 }, // 4: tommy gun - { kICONNAPALM, 6 }, // 5: napalm launcher - { kAmmoIcon5, 11 }, // 6: dynamite - { kAmmoIcon6, 11 }, // 7: spray can - { kICONTESLA, 6 }, // 8: tesla gun - { kICONLEECH, 0 }, // 9: life leech - { kAmmoIcon9, 11 }, // 10: voodoo doll - { kAmmoIcon10, 11 }, // 11: proxy bomb - { kAmmoIcon11, 11 }, // 12: remote bomb + { kTexICONFLAREGUN, 6 }, // 2: flare gun + { kTexICONSHOTGUN, 6 }, // 3: shotgun + { kTexICONTOMMY, 8 }, // 4: tommy gun + { kTexICONNAPALM, 6 }, // 5: napalm launcher + { kTexAmmoIcon5, 11 }, // 6: dynamite + { kTexAmmoIcon6, 11 }, // 7: spray can + { kTexICONTESLA, 6 }, // 8: tesla gun + { kTexICONLEECH, 0 }, // 9: life leech + { kTexAmmoIcon9, 11 }, // 10: voodoo doll + { kTexAmmoIcon10, 11 }, // 11: proxy bomb + { kTexAmmoIcon11, 11 }, // 12: remote bomb { -1, 0 }, }; diff --git a/source/games/blood/src/texidsdef.h b/source/games/blood/src/texidsdef.h index ccb9f281f..369411225 100644 --- a/source/games/blood/src/texidsdef.h +++ b/source/games/blood/src/texidsdef.h @@ -20,6 +20,16 @@ x(BULLETCASE) x(SHELLCASE) x(FLAGHAVE) x(ICONLEECH) +x(ICONFLAREGUN) +x(ICONSHOTGUN) +x(ICONTOMMY) +x(ICONNAPALM) +x(AmmoIcon5) +x(AmmoIcon6) +x(ICONTESLA) +x(AmmoIcon9) +x(AmmoIcon10) +x(AmmoIcon11) x(WATERDRIP) x(BLOODDRIP) x(SPOTPROGRESS) diff --git a/source/games/blood/src/view.h b/source/games/blood/src/view.h index e8820d3f4..f3c20129b 100644 --- a/source/games/blood/src/view.h +++ b/source/games/blood/src/view.h @@ -61,14 +61,6 @@ enum VIEWPOS { VIEWPOS_1 }; -#define x(a, b) k##a = b, -enum -{ -#include "namelist.h" -}; -#undef x - - enum { kFontNum = 5 }; extern FFont* gFont[kFontNum];