From 2cbcd49893f0099c8fb0fbee076ac242a2b8c5e0 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 26 Apr 2006 06:12:03 +0000 Subject: If the resource manager fails to initialize itself properly, instead of printing a fatal error, use the new GUIErrorMessage function and return to the launcher. Also, verify that all files that should be present on "CD 0" (i.e. on the hard disk) are present at startup, at least. (Any other missing CLU file is already requested with an "Insert CD" message.) svn-id: r22168 --- engines/sword2/sword2.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'engines/sword2/sword2.cpp') diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 5982e62e4d..13e97dc0d8 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -244,6 +244,15 @@ int Sword2Engine::init() { // Get some falling RAM and put it in your pocket, never let it slip // away + _debugger = NULL; + _sound = NULL; + _fontRenderer = NULL; + _screen = NULL; + _mouse = NULL; + _logic = NULL; + _resman = NULL; + _memory = NULL; + _system->beginGFXTransaction(); initCommonGFX(true); _screen = new Screen(this, 640, 480); @@ -258,6 +267,10 @@ int Sword2Engine::init() { _memory = new MemoryManager(this); _resman = new ResourceManager(this); + + if (!_resman->init()) + return 1; + _logic = new Logic(this); _fontRenderer = new FontRenderer(this); _sound = new Sound(this); -- cgit v1.2.3