From 3073f1780d9ddcc678875e44f963e3df0cbe1365 Mon Sep 17 00:00:00 2001 From: sirlemonhead Date: Wed, 20 Nov 2019 18:46:57 +0000 Subject: [PATCH] Show BMG or PIE publisher logos and Exhumed or PowerSlave graphics depending on which DAT/GRP file is used. --- source/exhumed/src/exhumed.cpp | 2 +- source/exhumed/src/exhumed.h | 6 ++++++ source/exhumed/src/menu.cpp | 21 ++++++++++++--------- source/exhumed/src/names.h | 6 +++--- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index e2a138059..5503bb884 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -3203,7 +3203,7 @@ void DoTitle() if (videoGetRenderMode() == REND_CLASSIC) BlackOut(); - overwritesprite(0, 0, kPublisherLogo, 0, 2, kPalNormal); + overwritesprite(0, 0, EXHUMED ? kTileBMGLogo : kTilePIELogo, 0, 2, kPalNormal); videoNextPage(); if (videoGetRenderMode() == REND_CLASSIC) diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 05da3b4f9..8389eec24 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "cache1d.h" +#include "grpscan.h" #define kTimerTicks 120 @@ -204,6 +205,11 @@ extern short bNoSound; extern int bVanilla; +extern int32_t g_gameType; + +#define POWERSLAVE (g_gameType & GAMEFLAG_POWERSLAVE) +#define EXHUMED (g_gameType & GAMEFLAG_EXHUMED) + extern int mouseaiming, aimmode, mouseflip; extern int runkey_mode, auto_run; extern int32_t r_maxfps; diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index 2f0112508..febf638a4 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -301,12 +301,15 @@ void DoEnergyTile() } int nPlasmaTile = kTile4092; +int nLogoTile; #define kPlasmaWidth 320 #define kPlasmaHeight 80 void menu_DoPlasma() { + if (!nLogoTile) + nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; if (waloff[kTile4092] == 0) { tileCreate(kTile4092, kPlasmaWidth, kPlasmaHeight); @@ -316,14 +319,14 @@ void menu_DoPlasma() waloff[kTile4093] = (intptr_t)plasmaBuffer; memset(plasmaBuffer, 96, sizeof(plasmaBuffer)); - nSmokeLeft = 160 - tilesiz[kExhumedLogo].x / 2; - nSmokeRight = nSmokeLeft + tilesiz[kExhumedLogo].x; + nSmokeLeft = 160 - tilesiz[nLogoTile].x / 2; + nSmokeRight = nSmokeLeft + tilesiz[nLogoTile].x; tilesiz[kTile4093].x = kPlasmaWidth; tilesiz[kTile4093].y = kPlasmaHeight; - nSmokeTop = 40 - tilesiz[kExhumedLogo].y / 2; - nSmokeBottom = nSmokeTop + tilesiz[kExhumedLogo].y - 1; + nSmokeTop = 40 - tilesiz[nLogoTile].y / 2; + nSmokeBottom = nSmokeTop + tilesiz[nLogoTile].y - 1; //uint32_t t = time(0) << 16; //uint32_t t2 = time(0) | t; @@ -331,7 +334,7 @@ void menu_DoPlasma() for (int i = 0; i < 5; i++) { - int logoWidth = tilesiz[kExhumedLogo].x; + int logoWidth = tilesiz[nLogoTile].x; #if 1 plasma_C[i] = (nSmokeLeft + rand() % logoWidth) << 16; plasma_B[i] = (menu_RandomLong2() % 327680) + 0x10000; @@ -461,7 +464,7 @@ void menu_DoPlasma() r_ebx += 2; } - tileLoad(kExhumedLogo); + tileLoad(nLogoTile); for (int j = 0; j < 5; j++) { @@ -469,7 +472,7 @@ void menu_DoPlasma() int pC = plasma_C[j]; int badOffset = (pC>>16) < nSmokeLeft || (pC>>16) >= nSmokeRight; - uint8_t *ptr3 = (uint8_t*)(waloff[kExhumedLogo] + ((pC >> 16) - nSmokeLeft) * tilesiz[kExhumedLogo].y); + uint8_t *ptr3 = (uint8_t*)(waloff[nLogoTile] + ((pC >> 16) - nSmokeLeft) * tilesiz[nLogoTile].y); plasma_C[j] += plasma_B[j]; @@ -504,7 +507,7 @@ void menu_DoPlasma() { nSmokeOffset = nSmokeBottom; - ptr3 += tilesiz[kExhumedLogo].y - 1; + ptr3 += tilesiz[nLogoTile].y - 1; while (nSmokeOffset > nSmokeTop) { @@ -525,7 +528,7 @@ void menu_DoPlasma() tileInvalidate(nPlasmaTile,-1,-1); overwritesprite(0, 0, nPlasmaTile, 0, 2, kPalNormal); - overwritesprite(160, 40, kExhumedLogo, 0, 3, kPalNormal); + overwritesprite(160, 40, nLogoTile, 0, 3, kPalNormal); // flip between tile 4092 and 4093 if (nPlasmaTile == kTile4092) { diff --git a/source/exhumed/src/names.h b/source/exhumed/src/names.h index e3d8bf0cf..08b1e1f8d 100644 --- a/source/exhumed/src/names.h +++ b/source/exhumed/src/names.h @@ -3368,7 +3368,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define kTile3346 3346 #define kTile3347 3347 #define kTile3348 3348 -#define kTile3349 3349 +#define kTilePIELogo 3349 #define kTile3350 3350 #define kTile3351 3351 #define kTile3352 3352 @@ -3387,7 +3387,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define kTile3365 3365 // sky #define kTile3366 3366 // sky #define kTile3367 3367 // sky -#define kPublisherLogo 3368 +#define kTileBMGLogo 3368 #define kTile3369 3369 #define kTile3370 3370 #define kTile3371 3371 @@ -3461,7 +3461,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define kTile3439 3439 #define kTile3440 3440 #define kTile3441 3441 -#define kTile3442 3442 +#define kPowerslaveLogo 3442 #define kTile3443 3443 #define kTile3444 3444 #define kTile3445 3445