- 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.
This commit is contained in:
Christoph Oelckers 2021-05-19 00:07:50 +02:00
parent ffffd2d0d2
commit 5ee4bc5cca
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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)