Basic content sanity checks and exit w/o crashing on check failure
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3572 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -477,8 +477,6 @@ main (int argc, char *argv[])
|
|||||||
mem_uninit ();
|
mem_uninit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
log_showBox (false, false);
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -110,7 +110,8 @@ LoadKernel (int argc, char *argv[])
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Load base content. */
|
/* Load base content. */
|
||||||
loadIndices (contentDir);
|
if (loadIndices (contentDir) == 0)
|
||||||
|
return FALSE; // Must have at least one index in content dir
|
||||||
|
|
||||||
/* Load addons demanded by the current configuration. */
|
/* Load addons demanded by the current configuration. */
|
||||||
if (opt3doMusic)
|
if (opt3doMusic)
|
||||||
@@ -139,6 +140,8 @@ LoadKernel (int argc, char *argv[])
|
|||||||
COLORMAP ColorMapTab;
|
COLORMAP ColorMapTab;
|
||||||
|
|
||||||
ColorMapTab = CaptureColorMap (LoadColorMap (STARCON_COLOR_MAP));
|
ColorMapTab = CaptureColorMap (LoadColorMap (STARCON_COLOR_MAP));
|
||||||
|
if (ColorMapTab == NULL)
|
||||||
|
return FALSE; // The most basic resource is missing
|
||||||
SetColorMap (GetColorMapAddress (ColorMapTab));
|
SetColorMap (GetColorMapAddress (ColorMapTab));
|
||||||
DestroyColorMap (ReleaseColorMap (ColorMapTab));
|
DestroyColorMap (ReleaseColorMap (ColorMapTab));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,10 +177,13 @@ while (--ac > 0)
|
|||||||
if (!LoadKernel (0,0))
|
if (!LoadKernel (0,0))
|
||||||
{
|
{
|
||||||
log_add (log_Fatal, "\n *** FATAL ERROR: Could not load basic content ***\n\nUQM requires at least the base content pack to run properly.");
|
log_add (log_Fatal, "\n *** FATAL ERROR: Could not load basic content ***\n\nUQM requires at least the base content pack to run properly.");
|
||||||
log_add (log_Fatal, "This file is typically called uqm-%d.%d.0.uqm. UQM was expecting it", UQM_MAJOR_VERSION, UQM_MINOR_VERSION);
|
log_add (log_Fatal, "This file is typically called uqm-%d.%d.0-content.uqm. UQM was expecting", UQM_MAJOR_VERSION, UQM_MINOR_VERSION);
|
||||||
log_add (log_Fatal, "in the %s/packages directory.", baseContentPath);
|
log_add (log_Fatal, "it in the %s/packages directory.", baseContentPath);
|
||||||
log_add (log_Fatal, "Either your installation did not install the content pack at all, or it\ninstalled it in a different directory.\n\nFix your installation and rerun UQM.\n\n *******************\n");
|
log_add (log_Fatal, "Either your installation did not install the content pack at all, or it\ninstalled it in a different directory.\n\nFix your installation and rerun UQM.\n\n *******************\n");
|
||||||
exit (EXIT_FAILURE);
|
log_showBox (true, true);
|
||||||
|
|
||||||
|
MainExited = TRUE;
|
||||||
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
log_add (log_Info, "We've loaded the Kernel");
|
log_add (log_Info, "We've loaded the Kernel");
|
||||||
|
|
||||||
@@ -300,6 +303,7 @@ while (--ac > 0)
|
|||||||
FreeMasterShipList ();
|
FreeMasterShipList ();
|
||||||
FreeKernel ();
|
FreeKernel ();
|
||||||
|
|
||||||
|
log_showBox (false, false);
|
||||||
MainExited = TRUE;
|
MainExited = TRUE;
|
||||||
|
|
||||||
(void) threadArg; /* Satisfying compiler (unused parameter) */
|
(void) threadArg; /* Satisfying compiler (unused parameter) */
|
||||||
|
|||||||
Reference in New Issue
Block a user