From deef1b593633a8d768bdefee641f4e9a7955507a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 12 May 2020 07:51:45 +0200 Subject: [PATCH] - World Tour commentary stubs. # Conflicts: # source/core/gamecontrol.cpp --- source/games/duke/src/namesdyn.h | 2 +- source/games/duke/src/sectors_d.cpp | 22 ++++++++++++++++++++-- source/games/duke/src/sounds.h | 13 ++++++++----- source/games/duke/src/zz_gamevars.cpp | 3 --- source/games/duke/src/zz_sounds.cpp | 5 +++++ 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/source/games/duke/src/namesdyn.h b/source/games/duke/src/namesdyn.h index 8416638bc..a738310ee 100644 --- a/source/games/duke/src/namesdyn.h +++ b/source/games/duke/src/namesdyn.h @@ -2120,7 +2120,7 @@ BEGIN_DUKE_NS #define MAMAJIBA__STATICRR -8890 #define MAMAJIBB__STATICRR -8895 -extern int16_t DynamicTileMap[MAXTILES]; +extern int16_t DynamicTileMap[]; void G_InitDynamicTiles(void); diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 345dc5ade..18a398edb 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -234,7 +234,8 @@ bool checkhitswitch_d(int snum, int w, int switchtype) if (switchtype == SWITCH_SPRITE) // A wall sprite { - lotag = sprite[w].lotag; if (lotag == 0) return 0; + lotag = sprite[w].lotag; + if (lotag == 0) return 0; hitag = sprite[w].hitag; sx = sprite[w].x; sy = sprite[w].y; @@ -243,7 +244,8 @@ bool checkhitswitch_d(int snum, int w, int switchtype) } else { - lotag = wall[w].lotag; if (lotag == 0) return 0; + lotag = wall[w].lotag; + if (lotag == 0) return 0; hitag = wall[w].hitag; sx = wall[w].x; sy = wall[w].y; @@ -260,6 +262,22 @@ bool checkhitswitch_d(int snum, int w, int switchtype) case ALIENSWITCH: case ALIENSWITCH + 1: break; + case DEVELOPERCOMMENTARY + 1: //Twentieth Anniversary World Tour + if (switchtype == 1) + { + sprite[w].picnum--; + StopCommentary(); + return true; + } + return false; + case DEVELOPERCOMMENTARY: //Twentieth Anniversary World Tour + if (switchtype == 1) + { + if (StartCommentary(lotag, w)) + sprite[w].picnum++; + return true; + } + return false; case ACCESSSWITCH: case ACCESSSWITCH2: if (ps[snum].access_incs == 0) diff --git a/source/games/duke/src/sounds.h b/source/games/duke/src/sounds.h index 8a4df2ade..b6e1e1b0a 100644 --- a/source/games/duke/src/sounds.h +++ b/source/games/duke/src/sounds.h @@ -85,17 +85,20 @@ int S_DefineSound(unsigned index, const char* filename, int ps, int pe, int pr, void S_InitSound(); void S_PlayRRMusic(int newTrack = -1); -inline bool S_IsAmbientSFX(int spriteNum) -{ - return (sprite[spriteNum].picnum == TILE_MUSICANDSFX && sprite[spriteNum].lotag < 999); -} - inline bool S_IsSoundValid(int num) { return (!soundEngine->isValidSoundId(num + 1)); } +// Placeholders. +inline void StopCommentary() +{} + +inline bool StartCommentary(int tag, int sprnum) +{ + return false; +} END_DUKE_NS diff --git a/source/games/duke/src/zz_gamevars.cpp b/source/games/duke/src/zz_gamevars.cpp index 549111e6e..bc0e8f569 100644 --- a/source/games/duke/src/zz_gamevars.cpp +++ b/source/games/duke/src/zz_gamevars.cpp @@ -459,8 +459,6 @@ void Gv_ResetSystemDefaults(void) // call many times... char aszBuf[64]; - //AddLog("ResetWeaponDefaults"); - for (int weaponNum = 0; weaponNum < MAX_WEAPONS; ++weaponNum) { for (int playerNum = 0; playerNum < MAXPLAYERS; ++playerNum) @@ -509,7 +507,6 @@ void Gv_ResetSystemDefaults(void) g_worksLikeVarID = Gv_GetVarIndex("WORKSLIKE"); g_zRangeVarID = Gv_GetVarIndex("ZRANGE"); - //AddLog("EOF:ResetWeaponDefaults"); } // Will set members that were overridden at CON translation time to 1. diff --git a/source/games/duke/src/zz_sounds.cpp b/source/games/duke/src/zz_sounds.cpp index 6b37cfcce..14e15d3ee 100644 --- a/source/games/duke/src/zz_sounds.cpp +++ b/source/games/duke/src/zz_sounds.cpp @@ -172,6 +172,11 @@ int S_DefineSound(unsigned index, const char *filename, int minpitch, int maxpit } +inline bool S_IsAmbientSFX(int spriteNum) +{ + return (sprite[spriteNum].picnum == TILE_MUSICANDSFX && sprite[spriteNum].lotag < 999); +} + //========================================================================== // //