2009-02-17 15:20:21 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
#include "common/system.h"
|
|
|
|
#include "common/config-manager.h"
|
|
|
|
|
2009-02-15 08:20:53 +00:00
|
|
|
#include "engines/advancedDetector.h"
|
2009-02-15 11:03:21 +00:00
|
|
|
#include "sci/sci.h"
|
2009-07-03 14:22:50 +00:00
|
|
|
#include "sci/debug.h"
|
2009-02-20 21:26:31 +00:00
|
|
|
#include "sci/console.h"
|
2009-05-11 13:31:17 +00:00
|
|
|
|
2009-02-27 02:23:40 +00:00
|
|
|
#include "sci/engine/state.h"
|
2009-02-24 05:51:55 +00:00
|
|
|
#include "sci/engine/kernel.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-03-07 19:23:47 +00:00
|
|
|
#include "sci/gfx/gfx_resource.h"
|
|
|
|
#include "sci/gfx/gfx_tools.h"
|
|
|
|
#include "sci/gfx/operations.h"
|
|
|
|
|
2009-02-20 14:45:28 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2009-06-06 10:21:48 +00:00
|
|
|
class GfxDriver;
|
2009-02-21 10:23:36 +00:00
|
|
|
|
2009-08-16 19:18:19 +00:00
|
|
|
// FIXME: error-prone
|
2009-08-17 15:49:22 +00:00
|
|
|
const char *versionNames[10] = {
|
2009-08-16 19:18:19 +00:00
|
|
|
"Autodetect",
|
|
|
|
"SCI0 Early",
|
|
|
|
"SCI0 Late",
|
2009-07-07 07:44:25 +00:00
|
|
|
"SCI01",
|
2009-08-16 19:18:19 +00:00
|
|
|
"SCI1 EGA",
|
|
|
|
"SCI1 Early",
|
2009-08-17 15:49:22 +00:00
|
|
|
"SCI1 Middle",
|
2009-08-16 19:18:19 +00:00
|
|
|
"SCI1 Late",
|
2009-05-15 09:29:03 +00:00
|
|
|
"SCI1.1",
|
|
|
|
"SCI32"
|
|
|
|
};
|
|
|
|
|
2009-02-17 18:16:48 +00:00
|
|
|
SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc)
|
2009-02-18 20:08:49 +00:00
|
|
|
: Engine(syst), _gameDescription(desc) {
|
2009-02-17 18:16:48 +00:00
|
|
|
// Put your engine in a sane state, but do nothing big yet;
|
|
|
|
// in particular, do not load data from files; rather, if you
|
|
|
|
// need to do such things, do them from init().
|
|
|
|
|
|
|
|
// However this is the place to specify all default directories
|
|
|
|
//File::addDefaultDirectory(_gameDataPath + "sound/");
|
|
|
|
//printf("%s\n", _gameDataPath.c_str());
|
|
|
|
|
2009-02-20 21:26:31 +00:00
|
|
|
_console = NULL;
|
|
|
|
|
2009-02-17 18:16:48 +00:00
|
|
|
// Set up the engine specific debug levels
|
2009-02-20 20:11:12 +00:00
|
|
|
Common::addDebugChannel(kDebugLevelError, "Error", "Script error debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelNodes, "Lists", "Lists and nodes debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelGraphics, "Graphics", "Graphics debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelStrings, "Strings", "Strings debugging");
|
2009-05-30 15:40:49 +00:00
|
|
|
Common::addDebugChannel(kDebugLevelMemory, "Memory", "Memory debugging");
|
2009-02-20 20:11:12 +00:00
|
|
|
Common::addDebugChannel(kDebugLevelFuncCheck, "Func", "Function parameter debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelBresen, "Bresenham", "Bresenham algorithms debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelSound, "Sound", "Sound debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelGfxDriver, "Gfxdriver", "Gfx driver debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelBaseSetter, "Base", "Base Setter debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelParser, "Parser", "Parser debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelMenu, "Menu", "Menu handling debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelSaid, "Said", "Said specs debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelFile, "File", "File I/O debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelTime, "Time", "Time debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelRoom, "Room", "Room number debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelAvoidPath, "Pathfinding", "Pathfinding debugging");
|
2009-03-01 21:48:39 +00:00
|
|
|
Common::addDebugChannel(kDebugLevelDclInflate, "DCL", "DCL inflate debugging");
|
2009-05-30 15:40:49 +00:00
|
|
|
Common::addDebugChannel(kDebugLevelVM, "VM", "VM debugging");
|
|
|
|
Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
|
2009-07-06 10:39:22 +00:00
|
|
|
Common::addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
|
2009-02-17 18:16:48 +00:00
|
|
|
|
2009-07-07 06:53:53 +00:00
|
|
|
_gamestate = 0;
|
|
|
|
|
2009-02-17 18:16:48 +00:00
|
|
|
printf("SciEngine::SciEngine\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
SciEngine::~SciEngine() {
|
|
|
|
// Dispose your resources here
|
|
|
|
printf("SciEngine::~SciEngine\n");
|
|
|
|
|
|
|
|
// Remove all of our debug levels here
|
2009-02-20 21:26:31 +00:00
|
|
|
Common::clearAllDebugChannels();
|
|
|
|
|
2009-07-11 23:45:54 +00:00
|
|
|
delete _kernel;
|
|
|
|
delete _vocabulary;
|
2009-02-20 21:26:31 +00:00
|
|
|
delete _console;
|
2009-07-11 23:45:54 +00:00
|
|
|
delete _resmgr;
|
2009-02-17 18:16:48 +00:00
|
|
|
}
|
|
|
|
|
2009-03-01 04:42:46 +00:00
|
|
|
Common::Error SciEngine::run() {
|
2009-06-26 22:30:52 +00:00
|
|
|
Graphics::PixelFormat gfxmode;
|
2009-08-21 16:03:45 +00:00
|
|
|
#if 0 && defined(ENABLE_RGB_COLOR)
|
2009-07-10 10:45:15 +00:00
|
|
|
initGraphics(320, 200, false, NULL);
|
2009-06-26 22:30:52 +00:00
|
|
|
#else
|
2009-02-17 18:16:48 +00:00
|
|
|
initGraphics(320, 200, false);
|
2009-06-26 22:30:52 +00:00
|
|
|
#endif
|
2009-06-27 10:53:21 +00:00
|
|
|
gfxmode = _system->getScreenFormat();
|
2009-02-17 18:16:48 +00:00
|
|
|
|
|
|
|
// Create debugger console. It requires GFX to be initialized
|
2009-02-21 18:46:03 +00:00
|
|
|
_console = new Console(this);
|
2009-02-17 18:16:48 +00:00
|
|
|
|
|
|
|
// Additional setup.
|
|
|
|
printf("SciEngine::init\n");
|
|
|
|
|
|
|
|
/* bool end = false;
|
|
|
|
Common::EventManager *em = _system->getEventManager();
|
|
|
|
while (!end) {
|
|
|
|
Common::Event ev;
|
|
|
|
if (em->pollEvent(ev)) {
|
|
|
|
if (ev.type == Common::EVENT_KEYDOWN) {
|
|
|
|
end = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_system->delayMillis(10);
|
|
|
|
} */
|
|
|
|
|
|
|
|
// FIXME/TODO: Move some of the stuff below to init()
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-06-04 21:44:39 +00:00
|
|
|
const uint32 flags = getFlags();
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-08-18 09:12:41 +00:00
|
|
|
_resmgr = new ResourceManager();
|
2009-08-16 19:18:19 +00:00
|
|
|
_version = _resmgr->sciVersion();
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-22 01:33:16 +00:00
|
|
|
if (!_resmgr) {
|
2009-02-23 04:31:11 +00:00
|
|
|
printf("No resources found, aborting...\n");
|
2009-02-17 18:16:48 +00:00
|
|
|
return Common::kNoGameDataFoundError;
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-07-11 23:45:54 +00:00
|
|
|
_kernel = new Kernel(_resmgr);
|
|
|
|
_vocabulary = new Vocabulary(_resmgr);
|
2009-08-16 19:18:19 +00:00
|
|
|
script_adjust_opcode_formats(_version);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-08-16 19:18:19 +00:00
|
|
|
_gamestate = new EngineState(_resmgr, _version, flags);
|
2009-05-15 09:04:21 +00:00
|
|
|
|
2009-06-04 21:44:39 +00:00
|
|
|
if (script_init_engine(_gamestate))
|
2009-02-17 18:16:48 +00:00
|
|
|
return Common::kUnknownError;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-06-03 14:09:25 +00:00
|
|
|
if (game_init(_gamestate)) { /* Initialize */
|
2009-05-29 13:07:14 +00:00
|
|
|
warning("Game initialization failed: Aborting...");
|
2009-02-17 18:16:48 +00:00
|
|
|
// TODO: Add an "init failed" error?
|
|
|
|
return Common::kUnknownError;
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-05-14 23:10:04 +00:00
|
|
|
// Set the savegame dir (actually, we set it to a fake value,
|
|
|
|
// since we cannot let the game control where saves are stored)
|
2009-06-03 14:09:25 +00:00
|
|
|
script_set_gamestate_save_dir(_gamestate, "/");
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-04-27 11:12:08 +00:00
|
|
|
GfxState gfx_state;
|
2009-06-06 10:21:48 +00:00
|
|
|
_gamestate->gfx_state = &gfx_state;
|
2009-03-18 11:07:29 +00:00
|
|
|
|
2009-06-03 14:09:25 +00:00
|
|
|
_gamestate->animation_granularity = 4;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-02-21 15:30:47 +00:00
|
|
|
// Default config:
|
2009-02-15 06:10:59 +00:00
|
|
|
gfx_options_t gfx_options;
|
2009-04-01 20:32:45 +00:00
|
|
|
|
|
|
|
#ifdef CUSTOM_GRAPHICS_OPTIONS
|
2009-02-15 06:10:59 +00:00
|
|
|
gfx_options.buffer_pics_nr = 0;
|
|
|
|
gfx_options.pic0_unscaled = 1;
|
|
|
|
gfx_options.pic0_dither_mode = GFXR_DITHER_MODE_D256;
|
|
|
|
gfx_options.pic0_dither_pattern = GFXR_DITHER_PATTERN_SCALED;
|
|
|
|
gfx_options.pic0_brush_mode = GFX_BRUSH_MODE_RANDOM_ELLIPSES;
|
|
|
|
gfx_options.pic0_line_mode = GFX_LINE_MODE_CORRECT;
|
|
|
|
gfx_options.cursor_xlate_filter = GFX_XLATE_FILTER_NONE;
|
|
|
|
gfx_options.view_xlate_filter = GFX_XLATE_FILTER_NONE;
|
|
|
|
gfx_options.pic_xlate_filter = GFX_XLATE_FILTER_NONE;
|
|
|
|
gfx_options.text_xlate_filter = GFX_XLATE_FILTER_NONE;
|
|
|
|
gfx_options.dirty_frames = GFXOP_DIRTY_FRAMES_CLUSTERS;
|
|
|
|
for (int i = 0; i < GFX_RESOURCE_TYPES_NR; i++) {
|
|
|
|
gfx_options.res_conf.assign[i] = NULL;
|
|
|
|
gfx_options.res_conf.mod[i] = NULL;
|
|
|
|
}
|
2009-04-01 20:32:45 +00:00
|
|
|
gfx_options.workarounds = 0;
|
2009-02-21 15:30:47 +00:00
|
|
|
// Default config ends
|
2009-04-01 20:32:45 +00:00
|
|
|
#endif
|
2009-02-15 06:10:59 +00:00
|
|
|
|
Merged revisions 43338-43340,43342,43344-43347,43349-43350,43352-43354,43357-43358,43362,43366,43369,43375,43377,43380,43383-43384,43386,43388,43390,43393,43400,43402,43404,43406-43409,43411,43413-43414 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
........
r43338 | lordhoto | 2009-08-13 10:19:26 +1000 (Thu, 13 Aug 2009) | 1 line
Little optimization in Screen::setPaletteIndex, now it only resets the palette, when the color index really changed.
........
r43339 | lordhoto | 2009-08-13 10:20:37 +1000 (Thu, 13 Aug 2009) | 1 line
Fix key input in credits sequences.
........
r43340 | lordhoto | 2009-08-13 10:21:42 +1000 (Thu, 13 Aug 2009) | 1 line
Fix serious bug in StaticResource::unloadId.
........
r43342 | lordhoto | 2009-08-13 10:26:41 +1000 (Thu, 13 Aug 2009) | 1 line
Do not unload credits data after copying it to a temporary buffer in Kyrandia 1 Amiga, since the credits will be looped and need reload every time.
........
r43344 | strangerke | 2009-08-13 19:56:54 +1000 (Thu, 13 Aug 2009) | 1 line
Initial save handler for Playtoons
........
r43345 | strangerke | 2009-08-13 19:59:44 +1000 (Thu, 13 Aug 2009) | 2 lines
- Add a specific OPCODEFUNC checkData to avoid having a Playtoons workaround in working code
- Replace OPCODEDRAW 0x20,0x23 and 0x25
........
r43346 | strangerke | 2009-08-13 20:00:35 +1000 (Thu, 13 Aug 2009) | 1 line
Suppress no longer needed Playtoons workaround
........
r43347 | strangerke | 2009-08-13 20:08:07 +1000 (Thu, 13 Aug 2009) | 1 line
fix methods
........
r43349 | lordhoto | 2009-08-14 01:55:12 +1000 (Fri, 14 Aug 2009) | 1 line
Implemented support for the "Lore of the Lands" special of Lands of Lore CD.
........
r43350 | lordhoto | 2009-08-14 02:41:07 +1000 (Fri, 14 Aug 2009) | 1 line
Move version string in Modern theme beneath the Logo in high res mode, this saves some space and looks nicer.
........
r43352 | lordhoto | 2009-08-14 02:50:30 +1000 (Fri, 14 Aug 2009) | 1 line
Little fix of new modern theme layout in the launcher for 3x.
........
r43353 | lordhoto | 2009-08-14 03:00:19 +1000 (Fri, 14 Aug 2009) | 1 line
Cleanup.
........
r43354 | lordhoto | 2009-08-14 03:00:40 +1000 (Fri, 14 Aug 2009) | 1 line
Cleanup.
........
r43357 | agent-q | 2009-08-14 07:46:41 +1000 (Fri, 14 Aug 2009) | 1 line
Allow VOCs to stream from disk. Disabled by default, use symbol STREAM_AUDIO_FROM_DISK to enable. See patch #2834001.
........
r43358 | Kirben | 2009-08-14 10:44:36 +1000 (Fri, 14 Aug 2009) | 1 line
The Nintendo DS hack for introduction in Simon the Sorcerer 1 is only required for Windows version (WAV format) now.
........
r43362 | anotherguest | 2009-08-14 16:42:57 +1000 (Fri, 14 Aug 2009) | 1 line
Updated files from 1.0.0 branch
........
r43366 | drmccoy | 2009-08-15 01:22:43 +1000 (Sat, 15 Aug 2009) | 2 lines
Setting gob3 save/load mode of the temporary sprite "intro.$$$" to ignore and remove the TempSpriteHandler.
Gob3 doesn't use it at all and Lost in Time only saves (with an invalid index) and never loads
........
r43369 | joostp | 2009-08-15 02:13:00 +1000 (Sat, 15 Aug 2009) | 2 lines
PSP: create an EBOOT.PBP when building via configure
........
r43375 | joostp | 2009-08-15 02:44:29 +1000 (Sat, 15 Aug 2009) | 2 lines
Fix incorrect memset() call (reported by Peter Bortas).
........
r43377 | joostp | 2009-08-15 02:54:43 +1000 (Sat, 15 Aug 2009) | 2 lines
add psp_clean build rule to clean up EBOOT.PBP and scummvm_stripped.elf
........
r43380 | joostp | 2009-08-15 03:18:03 +1000 (Sat, 15 Aug 2009) | 3 lines
MIPSpro compilation fixes / workarounds (from a patch by Rainer Canavan)
The hashmap.h change is ugly, but so far the only thing found to work. Suggestions for a better "fix" appreciated!
........
r43383 | lordhoto | 2009-08-15 03:49:30 +1000 (Sat, 15 Aug 2009) | 1 line
Little fix for lopping credits in Kyrandia 1 Amiga.
........
r43384 | joostp | 2009-08-15 04:02:17 +1000 (Sat, 15 Aug 2009) | 2 lines
PSP: also create param.sfo when building via configure
........
r43386 | joostp | 2009-08-15 04:34:01 +1000 (Sat, 15 Aug 2009) | 2 lines
PSP: add svn revision + build date to SFO title.
........
r43388 | joostp | 2009-08-15 09:20:46 +1000 (Sat, 15 Aug 2009) | 2 lines
remove double semi-colon -- hopefully this kicks the buildbot back into action =)
........
r43390 | waltervn | 2009-08-15 10:28:59 +1000 (Sat, 15 Aug 2009) | 2 lines
SCI: Added enum for map and volume versions. Removed res_version setting from
detection.cpp (should be detectable). Cleanup.
........
r43393 | dhewg | 2009-08-15 15:39:44 +1000 (Sat, 15 Aug 2009) | 1 line
Fix compilation.
........
r43400 | Kirben | 2009-08-15 20:09:32 +1000 (Sat, 15 Aug 2009) | 1 line
Fix regression, that caused multiple sounds in Simon the Sorcerer 2 to be cut off.
........
r43402 | Kirben | 2009-08-15 20:31:20 +1000 (Sat, 15 Aug 2009) | 1 line
Restore code to clear screen, before playing videos with smaller resolution in the Amiga version of The Feeble Files.
........
r43404 | joostp | 2009-08-15 20:44:58 +1000 (Sat, 15 Aug 2009) | 2 lines
Properly implement PSPFilesystemFactory::makeCurrentDirectoryFileNode()
........
r43406 | dreammaster | 2009-08-15 21:50:59 +1000 (Sat, 15 Aug 2009) | 1 line
Added Dirty Rect handling functionality
........
r43407 | waltervn | 2009-08-15 22:09:47 +1000 (Sat, 15 Aug 2009) | 1 line
SCI: Rename sci_version_t to SciVersion
........
r43408 | waltervn | 2009-08-15 22:17:23 +1000 (Sat, 15 Aug 2009) | 1 line
SCI: Add missing versions to exe version parsing
........
r43409 | eriktorbjorn | 2009-08-16 00:13:48 +1000 (Sun, 16 Aug 2009) | 2 lines
Removed unnecessary semi-colons.
........
r43411 | lordhoto | 2009-08-16 00:59:11 +1000 (Sun, 16 Aug 2009) | 1 line
Added const qualifiers to static data.
........
r43413 | lordhoto | 2009-08-16 01:30:35 +1000 (Sun, 16 Aug 2009) | 1 line
Yet another slight graphic fix for the Kyrandia 1 Amiga credits.
........
r43414 | buddha_ | 2009-08-16 05:04:21 +1000 (Sun, 16 Aug 2009) | 4 lines
Fix for bug #2835581 (KQ3: Game Crash When Leaving Tavern as Fly):
- Use AGI version 0x3149 instead of the previous 0x3086
- Makes ESC pause the game (Identical to original in this respect)
........
svn-id: r43418
2009-08-16 01:03:09 +00:00
|
|
|
if (gfxop_init(_resmgr->sciVersion(), &gfx_state, &gfx_options, _resmgr, gfxmode, 1, 1)) {
|
2009-05-29 13:07:14 +00:00
|
|
|
warning("Graphics initialization failed. Aborting...");
|
2009-02-17 18:16:48 +00:00
|
|
|
return Common::kUnknownError;
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-06-03 14:09:25 +00:00
|
|
|
if (game_init_graphics(_gamestate)) { // Init interpreter graphics
|
2009-05-29 13:07:14 +00:00
|
|
|
warning("Game initialization failed: Error in GFX subsystem. Aborting...");
|
2009-02-17 18:16:48 +00:00
|
|
|
return Common::kUnknownError;
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-06-03 14:09:25 +00:00
|
|
|
if (game_init_sound(_gamestate, 0)) {
|
2009-05-29 13:07:14 +00:00
|
|
|
warning("Game initialization failed: Error in sound subsystem. Aborting...");
|
2009-02-17 18:16:48 +00:00
|
|
|
return Common::kUnknownError;
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-08-16 19:18:19 +00:00
|
|
|
printf("Emulating SCI version %s\n", versionNames[_version]);
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-06-03 14:09:25 +00:00
|
|
|
game_run(&_gamestate); // Run the game
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-06-03 14:09:25 +00:00
|
|
|
game_exit(_gamestate);
|
|
|
|
script_free_engine(_gamestate); // Uninitialize game state
|
|
|
|
script_free_breakpoints(_gamestate);
|
2009-02-22 21:38:46 +00:00
|
|
|
|
2009-06-03 14:09:25 +00:00
|
|
|
delete _gamestate;
|
2009-02-15 06:10:59 +00:00
|
|
|
|
|
|
|
gfxop_exit(&gfx_state);
|
|
|
|
|
2009-02-15 08:20:53 +00:00
|
|
|
return Common::kNoError;
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2009-07-03 14:22:50 +00:00
|
|
|
// Invoked by error() when a severe error occurs
|
2009-05-11 13:31:17 +00:00
|
|
|
GUI::Debugger *SciEngine::getDebugger() {
|
2009-07-07 06:53:53 +00:00
|
|
|
if (_gamestate) {
|
|
|
|
ExecStack *xs = &(_gamestate->_executionStack.back());
|
2009-07-08 10:25:37 +00:00
|
|
|
xs->addr.pc.offset = scriptState.old_pc_offset;
|
|
|
|
xs->sp = scriptState.old_sp;
|
2009-07-07 06:53:53 +00:00
|
|
|
}
|
|
|
|
|
2009-07-08 10:25:37 +00:00
|
|
|
scriptState.runningStep = 0; // Stop multiple execution
|
|
|
|
scriptState.seeking = kDebugSeekNothing; // Stop special seeks
|
2009-07-03 14:22:50 +00:00
|
|
|
|
|
|
|
return _console;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Used to obtain the engine's console in order to print messages to it
|
|
|
|
Console *SciEngine::getSciDebugger() {
|
2009-05-11 13:31:17 +00:00
|
|
|
return _console;
|
|
|
|
}
|
|
|
|
|
2009-02-20 14:45:28 +00:00
|
|
|
const char* SciEngine::getGameID() const {
|
|
|
|
return _gameDescription->desc.gameid;
|
|
|
|
}
|
|
|
|
|
2009-08-15 12:09:47 +00:00
|
|
|
SciVersion SciEngine::getVersion() const {
|
2009-08-16 19:18:19 +00:00
|
|
|
return _version;
|
2009-02-20 14:45:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Common::Language SciEngine::getLanguage() const {
|
|
|
|
return _gameDescription->desc.language;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::Platform SciEngine::getPlatform() const {
|
|
|
|
return _gameDescription->desc.platform;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32 SciEngine::getFlags() const {
|
2009-05-14 09:12:27 +00:00
|
|
|
return _gameDescription->flags;
|
2009-02-20 14:45:28 +00:00
|
|
|
}
|
|
|
|
|
2009-02-20 23:41:15 +00:00
|
|
|
Common::String SciEngine::getSavegameName(int nr) const {
|
2009-07-25 10:26:17 +00:00
|
|
|
return _targetName + Common::String::printf(".%03d", nr);
|
2009-02-20 23:41:15 +00:00
|
|
|
}
|
|
|
|
|
2009-02-27 01:17:24 +00:00
|
|
|
Common::String SciEngine::getSavegamePattern() const {
|
|
|
|
return _targetName + ".???";
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::String SciEngine::wrapFilename(const Common::String &name) const {
|
|
|
|
return _targetName + "-" + name;
|
|
|
|
}
|
|
|
|
|
|
|
|
Common::String SciEngine::unwrapFilename(const Common::String &name) const {
|
|
|
|
Common::String prefix = name + "-";
|
|
|
|
if (name.hasPrefix(prefix.c_str()))
|
|
|
|
return Common::String(name.c_str() + prefix.size());
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2009-06-02 19:03:43 +00:00
|
|
|
void SciEngine::pauseEngineIntern(bool pause) {
|
2009-06-03 14:09:25 +00:00
|
|
|
_gamestate->_sound.sfx_suspend(pause);
|
2009-06-02 19:03:43 +00:00
|
|
|
_mixer->pauseAll(pause);
|
|
|
|
}
|
|
|
|
|
2009-02-20 14:45:28 +00:00
|
|
|
} // End of namespace Sci
|