- handle Build tiles via explicit callback to the init function.

This commit is contained in:
Christoph Oelckers 2022-10-02 16:54:43 +02:00
parent 8aaab153fa
commit f63d4d8a12
3 changed files with 6 additions and 6 deletions

View file

@ -1183,7 +1183,6 @@ void FTextureManager::AddLocalizedVariants()
// //
//========================================================================== //==========================================================================
FGameTexture *CreateShaderTexture(bool, bool); FGameTexture *CreateShaderTexture(bool, bool);
void InitBuildTiles();
FImageSource* CreateEmptyTexture(); FImageSource* CreateEmptyTexture();
void FTextureManager::Init() void FTextureManager::Init()
@ -1213,7 +1212,7 @@ void FTextureManager::Init()
AddGameTexture(mt); AddGameTexture(mt);
} }
void FTextureManager::AddTextures(void (*progressFunc_)(), void (*checkForHacks)(BuildInfo&)) void FTextureManager::AddTextures(void (*progressFunc_)(), void (*checkForHacks)(BuildInfo&), void (*customtexturehandler)())
{ {
progressFunc = progressFunc_; progressFunc = progressFunc_;
//if (BuildTileFiles.Size() == 0) CountBuildTiles (); //if (BuildTileFiles.Size() == 0) CountBuildTiles ();
@ -1229,9 +1228,9 @@ void FTextureManager::AddTextures(void (*progressFunc_)(), void (*checkForHacks)
build.ResolveAllPatches(); build.ResolveAllPatches();
// Add one marker so that the last WAD is easier to handle and treat // Add one marker so that the last WAD is easier to handle and treat
// Build tiles as a completely separate block. // custom textures as a completely separate block.
FirstTextureForFile.Push(Textures.Size()); FirstTextureForFile.Push(Textures.Size());
InitBuildTiles (); if (customtexturehandler) customtexturehandler();
FirstTextureForFile.Push(Textures.Size()); FirstTextureForFile.Push(Textures.Size());
DefaultTexture = CheckForTexture ("-NOFLAT-", ETextureType::Override, 0); DefaultTexture = CheckForTexture ("-NOFLAT-", ETextureType::Override, 0);

View file

@ -124,7 +124,7 @@ public:
void LoadTextureX(int wadnum, FMultipatchTextureBuilder &build); void LoadTextureX(int wadnum, FMultipatchTextureBuilder &build);
void AddTexturesForWad(int wadnum, FMultipatchTextureBuilder &build); void AddTexturesForWad(int wadnum, FMultipatchTextureBuilder &build);
void Init(); void Init();
void AddTextures(void (*progressFunc_)(), void (*checkForHacks)(BuildInfo&)); void AddTextures(void (*progressFunc_)(), void (*checkForHacks)(BuildInfo&), void (*customtexturehandler)() = nullptr);
void DeleteAll(); void DeleteAll();
void ReplaceTexture (FTextureID picnum, FGameTexture *newtexture, bool free); void ReplaceTexture (FTextureID picnum, FGameTexture *newtexture, bool free);

View file

@ -176,6 +176,7 @@ void I_UpdateWindowTitle();
void S_ParseMusInfo(); void S_ParseMusInfo();
void D_GrabCVarDefaults(); void D_GrabCVarDefaults();
void LoadHexFont(const char* filename); void LoadHexFont(const char* filename);
void InitBuildTiles();
// PRIVATE FUNCTION PROTOTYPES --------------------------------------------- // PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
@ -3211,7 +3212,7 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray<FString>& allwads, TArr
{ {
StartWindow->Progress(); StartWindow->Progress();
if (StartScreen) StartScreen->Progress(1); if (StartScreen) StartScreen->Progress(1);
}, CheckForHacks); }, CheckForHacks, InitBuildTiles);
PatchTextures(); PatchTextures();
TexAnim.Init(); TexAnim.Init();
C_InitConback(TexMan.CheckForTexture(gameinfo.BorderFlat, ETextureType::Flat), true, 0.25); C_InitConback(TexMan.CheckForTexture(gameinfo.BorderFlat, ETextureType::Flat), true, 0.25);