diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 34e4da750..425b9b249 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -998,6 +998,7 @@ typedef struct artheader_t { int32_t preinitengine(void); // a partial setup of the engine used for launch windows int32_t initengine(void); +int32_t E_PostInit(void); void uninitengine(void); void initspritelists(void); int32_t E_FatalError(char const * const msg); diff --git a/polymer/eduke32/build/include/palette.h b/polymer/eduke32/build/include/palette.h index 19f283906..507e95285 100644 --- a/polymer/eduke32/build/include/palette.h +++ b/polymer/eduke32/build/include/palette.h @@ -39,7 +39,7 @@ extern int32_t globalblend; extern uint32_t g_lastpalettesum; extern palette_t getpal(int32_t col); extern void loadpalette(void); -extern int32_t E_PostInitTables(void); +extern void E_PostLoadPalette(void); extern void setup_blend(int32_t blend, int32_t doreverse); extern uint8_t basepalreset; extern int32_t curbrightness, gammabrightness; diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index bd08093ae..274d76765 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -692,7 +692,7 @@ int app_main(int argc, char const * const * argv) DO_FREE_AND_NULL(g_defModules); g_defModulesNum = 0; - if (E_PostInitTables()) + if (E_PostInit()) M32_FatalEngineError(); CallExtPostInit(); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 1148e2624..0958892e4 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -7753,6 +7753,23 @@ int32_t initengine(void) return 0; } +// +// E_PostInit +// +int32_t E_PostInit(void) +{ + if (!(paletteloaded & PALETTE_MAIN)) + return E_FatalError("No palette found."); + if (!(paletteloaded & PALETTE_SHADE)) + return E_FatalError("No shade table found."); + if (!(paletteloaded & PALETTE_TRANSLUC)) + return E_FatalError("No translucency table found."); + + E_PostLoadPalette(); + + return 0; +} + // // uninitengine // diff --git a/polymer/eduke32/build/src/palette.c b/polymer/eduke32/build/src/palette.c index 287b6b4b4..f748e4255 100644 --- a/polymer/eduke32/build/src/palette.c +++ b/polymer/eduke32/build/src/palette.c @@ -268,7 +268,7 @@ void loadpalette(void) uint32_t PaletteIndexFullbrights[8]; -static void E_PostLoadPalette(void) +void E_PostLoadPalette(void) { globalpal = 0; @@ -319,24 +319,6 @@ static void E_PostLoadPalette(void) } } -// -// E_PostInitTables -// - -int32_t E_PostInitTables(void) -{ - if (!(paletteloaded & PALETTE_MAIN)) - return E_FatalError("No palette found."); - if (!(paletteloaded & PALETTE_SHADE)) - return E_FatalError("No shade table found."); - if (!(paletteloaded & PALETTE_TRANSLUC)) - return E_FatalError("No translucency table found."); - - E_PostLoadPalette(); - - return 0; -} - void E_ReplaceTransparentColorWithBlack(void) { for (bssize_t i=0; i