Fix a crash in the editor when the basepalette is loaded from def instead of PALETTE.DAT, caused by trying to getclosestcol() without having initialized the colormatching code. Exposed in r5359; previously resulted only in erroneous matching to an all-#000000 palette.

git-svn-id: https://svn.eduke32.com/eduke32@5384 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-10-10 06:57:57 +00:00
parent d58bfb59dd
commit f2a99dec75

View file

@ -674,6 +674,24 @@ int32_t app_main(int32_t argc, const char **argv)
loadpics("tiles000.art", g_maxCacheSize);
Bstrcpy(kensig,"Uses BUILD technology by Ken Silverman");
initcrc();
const char *defsfile = G_DefFile();
if (!loaddefinitionsfile(defsfile))
initprintf("Definitions file \"%s\" loaded.\n",defsfile);
for (i=0; i < g_defModulesNum; ++i)
Bfree(g_defModules[i]);
DO_FREE_AND_NULL(g_defModules);
g_defModulesNum = 0;
if (E_PostInit())
M32_FatalEngineError();
CallExtPostInit();
#ifdef YAX_ENABLE
// init dummy texture for YAX
// must be after loadpics(), which inits BUILD's cache
@ -710,24 +728,6 @@ int32_t app_main(int32_t argc, const char **argv)
}
#endif
Bstrcpy(kensig,"Uses BUILD technology by Ken Silverman");
initcrc();
const char *defsfile = G_DefFile();
if (!loaddefinitionsfile(defsfile))
initprintf("Definitions file \"%s\" loaded.\n",defsfile);
for (i=0; i < g_defModulesNum; ++i)
Bfree(g_defModules[i]);
DO_FREE_AND_NULL(g_defModules);
g_defModulesNum = 0;
if (E_PostInit())
M32_FatalEngineError();
CallExtPostInit();
#ifdef HAVE_CLIPSHAPE_FEATURE
int k = clipmapinfo_load();
if (k>0)