From 5ee4bc5cca72a6d2965bc72e44e124bf0cd95e09 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 19 May 2021 00:07:50 +0200 Subject: [PATCH] - Blood: handle title screens so that mods changing the original one still display it. The rules are: * If CRC of tile 2518 has changed, use that. * If CRC of tile 2046 has changed, use that. * If tile 2518 is not present, use tile 2046 * otherwise use tile 2518. This allows display of Cryptic Passage's title screen while still using the "with Plasma" version for the regular game. --- source/games/blood/src/blood.cpp | 7 ++++++- source/games/blood/src/namelist.h | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/games/blood/src/blood.cpp b/source/games/blood/src/blood.cpp index f65a2acc8..d18842885 100644 --- a/source/games/blood/src/blood.cpp +++ b/source/games/blood/src/blood.cpp @@ -323,7 +323,8 @@ void GameInterface::Ticker() void GameInterface::DrawBackground() { twod->ClearScreen(); - DrawTexture(twod, tileGetTexture(2518, true), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, TAG_DONE); + auto tex = TexMan.CheckForTexture("titlescreen", ETextureType::Any); + DrawTexture(twod, TexMan.GetGameTexture(tex), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, TAG_DONE); } #define x(a, b) registerName(#a, b); @@ -334,6 +335,10 @@ static void SetTileNames() TexMan.AddAlias(name, tileGetTexture(index)); }; #include "namelist.h" + // Oh Joy! Plasma Pak changes the tile number of the title screen, but we preferably want mods that use the original one to display it. + // So let's make this remapping depend on the CRC. + if (tileGetCRC32(2518) == 1170870757 && (tileGetCRC32(2046) != 290208654 || tileWidth(2518) == 0)) registerName("titlescreen", 2046); + else registerName("titlescreen", 2518); } #undef x diff --git a/source/games/blood/src/namelist.h b/source/games/blood/src/namelist.h index 306c39e75..82e41bfab 100644 --- a/source/games/blood/src/namelist.h +++ b/source/games/blood/src/namelist.h @@ -3,7 +3,6 @@ x(MENUBAR, 2038) x(BackTile, 253) x(Monolithscreen, 2050) x(GTIScreen, 2052) -x(TitleScreen, 2518) x(CrosshairTile, 2319) x(LoadScreen, 2049)