- Exhumed: Wrapped the logo retrieval code into getter functions and removed the game type macros.

This commit is contained in:
Christoph Oelckers 2020-10-11 13:21:54 +02:00
parent df42230b45
commit f3f6bad1f8
6 changed files with 17 additions and 10 deletions

View file

@ -168,7 +168,7 @@ void menu_DoPlasma()
nextPlasmaTic = pclock + 4; nextPlasmaTic = pclock + 4;
if (!nLogoTile) if (!nLogoTile)
nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; nLogoTile = GameLogo();
if (!PlasmaBuffer) if (!PlasmaBuffer)
{ {
@ -505,7 +505,7 @@ void DoTitle(CompletionFunc completion)
JobDesc jobs[5]; JobDesc jobs[5];
int job = 0; int job = 0;
jobs[job++] = { Create<DImageScreen>(tileGetTexture(EXHUMED ? kTileBMGLogo : kTilePIELogo), DScreenJob::fadein | DScreenJob::fadeout) }; jobs[job++] = { Create<DImageScreen>(tileGetTexture(PublisherLogo()), DScreenJob::fadein | DScreenJob::fadeout) };
jobs[job++] = { Create<DLobotomyScreen>(tileGetTexture(seq_GetSeqPicnum(kSeqScreens, 0, 0)), DScreenJob::fadein | DScreenJob::fadeout) }; jobs[job++] = { Create<DLobotomyScreen>(tileGetTexture(seq_GetSeqPicnum(kSeqScreens, 0, 0)), DScreenJob::fadein | DScreenJob::fadeout) };
jobs[job++] = { PlayMovie("book.mov") }; jobs[job++] = { PlayMovie("book.mov") };
jobs[job++] = { Create<DMainTitle>() }; jobs[job++] = { Create<DMainTitle>() };
@ -1003,7 +1003,7 @@ public:
int ret = skiprequest ? -1 : cont ? 1 : 0; int ret = skiprequest ? -1 : cont ? 1 : 0;
// quit the game if we've finished level 4 and displayed the advert text // quit the game if we've finished level 4 and displayed the advert text
if (ISDEMOVER && currentCinemaPalette == 3 && ret != 1) if (isShareware() && currentCinemaPalette == 3 && ret != 1)
{ {
ExitGame(); ExitGame();
} }

View file

@ -99,7 +99,7 @@ DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedPlasma, Draw)
DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedLogo, Draw) DEFINE_ACTION_FUNCTION(_ListMenuItemExhumedLogo, Draw)
{ {
auto nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; auto nLogoTile = GameLogo();
DrawRel(nLogoTile, 160, 40); DrawRel(nLogoTile, 160, 40);
return 0; return 0;
} }

View file

@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "filesystem.h" #include "filesystem.h"
#include "screenjob.h" #include "screenjob.h"
#include "gamestruct.h" #include "gamestruct.h"
#include "names.h"
BEGIN_PS_NS BEGIN_PS_NS
@ -157,9 +158,15 @@ extern short bDoFlashes;
extern int bVanilla; extern int bVanilla;
#define POWERSLAVE (g_gameType & GAMEFLAG_POWERSLAVE) inline int PublisherLogo()
#define EXHUMED (g_gameType & GAMEFLAG_EXHUMED) {
#define ISDEMOVER (g_gameType & GAMEFLAG_SHAREWARE) return (g_gameType & GAMEFLAG_EXHUMED) ? kTileBMGLogo : kTilePIELogo;
}
inline int GameLogo()
{
return (g_gameType & GAMEFLAG_EXHUMED) ? kExhumedLogo : kPowerslaveLogo;
}
extern double g_frameDelay; extern double g_frameDelay;

View file

@ -114,7 +114,7 @@ void GameInterface::Render()
void GameInterface::DrawBackground() void GameInterface::DrawBackground()
{ {
auto nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; auto nLogoTile = GameLogo();
int dword_9AB5F = (I_GetBuildTime() / 16) & 3; int dword_9AB5F = (I_GetBuildTime() / 16) & 3;
twod->ClearScreen(); twod->ClearScreen();

View file

@ -39,7 +39,7 @@ enum
kDefaultLives = 3, kDefaultLives = 3,
kMaxPlayerLives = 5, kMaxPlayerLives = 5,
kMaxHealth = 800 kMaxHealth = 800
} };
extern int nLocalPlayer; extern int nLocalPlayer;

View file

@ -203,7 +203,7 @@ int LoadSound(const char* name)
looped[retval-1] = loops; looped[retval-1] = loops;
return retval - 1; return retval - 1;
} }
else if (!ISDEMOVER) // demo tries to load sound files it doesn't have else if (!isShareware()) // demo tries to load sound files it doesn't have
{ {
Printf("Unable to open sound '%s'!\n", filename.GetChars()); Printf("Unable to open sound '%s'!\n", filename.GetChars());
} }