aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-06-06 00:10:40 +0000
committerTravis Howell2009-06-06 00:10:40 +0000
commit8ff3a568fa8fe564749080a9af5e20b897933d93 (patch)
tree3136763937adc1fb6bcd30993b00d1476f490b6f /engines/sci/sci.cpp
parentd65bbe1d7a5efbcf04831dbb68a45ca833db1ae1 (diff)
parentda36901b0751b9d4faaae30dce230b67d75e04e6 (diff)
downloadscummvm-rg350-8ff3a568fa8fe564749080a9af5e20b897933d93.tar.gz
scummvm-rg350-8ff3a568fa8fe564749080a9af5e20b897933d93.tar.bz2
scummvm-rg350-8ff3a568fa8fe564749080a9af5e20b897933d93.zip
Merged revisions 41154-41156,41160,41163-41181,41185-41186,41188-41189,41196-41202 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk ........ r41154 | thebluegr | 2009-06-04 18:25:48 +1000 (Thu, 04 Jun 2009) | 1 line Turned debug_weak_validations on by default again, as apparently some games like SQ3 fail in some validations (e.g. when loading). Also, fixed a potential out of bounds access when copying the value of __FILE__ into a buffer (as its value can be quite long in some cases). ........ r41155 | thebluegr | 2009-06-04 18:28:20 +1000 (Thu, 04 Jun 2009) | 1 line Reordered the numpad keys so that they make more sense, and simplified the code which returns the values of shifted function keys ........ r41156 | djwillis | 2009-06-04 18:30:31 +1000 (Thu, 04 Jun 2009) | 1 line Initial import of the GP2XWiz backend (based on the GP2X and SDL backends). Includes configure changes and one #ifdef to SDL backend. Also updates NEWS. ........ r41160 | strangerke | 2009-06-04 19:48:56 +1000 (Thu, 04 Jun 2009) | 1 line gob : _spriteBottom incorrectly saved and restored in Draw_v2::spriteOperation ........ r41163 | fingolfin | 2009-06-04 21:28:05 +1000 (Thu, 04 Jun 2009) | 1 line SCI: Renamed various debug related global variables to have a g_ prefix; and moved any 'extern' decls of them into a new header file ........ r41164 | waltervn | 2009-06-04 21:35:17 +1000 (Thu, 04 Jun 2009) | 2 lines SCI: Support for 16-bit DPCM. ........ r41165 | fingolfin | 2009-06-04 21:44:55 +1000 (Thu, 04 Jun 2009) | 1 line SCI: cleanup ........ r41166 | fingolfin | 2009-06-04 21:45:17 +1000 (Thu, 04 Jun 2009) | 1 line SCI: Moved MemObject code into a separate source file ........ r41167 | fingolfin | 2009-06-04 21:45:34 +1000 (Thu, 04 Jun 2009) | 1 line Code formatting in the gp2xwiz backend ........ r41168 | thebluegr | 2009-06-04 22:47:11 +1000 (Thu, 04 Jun 2009) | 1 line Updated the MSVC project files of the SCI engine ........ r41169 | waltervn | 2009-06-05 00:29:20 +1000 (Fri, 05 Jun 2009) | 2 lines SCI: Message: Added support for escape sequences. ........ r41170 | waltervn | 2009-06-05 01:56:11 +1000 (Fri, 05 Jun 2009) | 2 lines SCI: Added support for early SCI1.1 audio maps. ........ r41171 | waltervn | 2009-06-05 02:18:35 +1000 (Fri, 05 Jun 2009) | 2 lines SCI: Audio: Fixed bug in reading of SOL header. ........ r41172 | fingolfin | 2009-06-05 06:50:51 +1000 (Fri, 05 Jun 2009) | 1 line SCI: Added FIXME comment to not_register() ........ r41173 | fingolfin | 2009-06-05 06:51:09 +1000 (Fri, 05 Jun 2009) | 1 line SCI: cleanup ........ r41174 | fingolfin | 2009-06-05 06:51:24 +1000 (Fri, 05 Jun 2009) | 1 line SCI: Slightly modified kAddAfter so that it does not modify its arguments needlessly ........ r41175 | fingolfin | 2009-06-05 06:51:40 +1000 (Fri, 05 Jun 2009) | 1 line SCI: Added MemObject::isValidOffset method; use it to simplify determine_reg_type ........ r41176 | fingolfin | 2009-06-05 07:42:24 +1000 (Fri, 05 Jun 2009) | 1 line SCI: Renamed _kfuncTable -> _kernelFuncs; and simplified/streamlined the kernel func map in kernel.cpp a bit ........ r41177 | fingolfin | 2009-06-05 07:44:39 +1000 (Fri, 05 Jun 2009) | 1 line SCI: Renamed EngineState::flags and version to _flags and _version (following our conventions); also slightly changed the EngineState constructor to init _version & _flags, and used this to make them constant ........ r41178 | fingolfin | 2009-06-05 07:53:45 +1000 (Fri, 05 Jun 2009) | 1 line oops ........ r41179 | athrxx | 2009-06-05 08:12:13 +1000 (Fri, 05 Jun 2009) | 1 line LOL: implemented Vaelan's cube ........ r41180 | fingolfin | 2009-06-05 08:16:31 +1000 (Fri, 05 Jun 2009) | 1 line SCI: Made some members of class Resource protected; some cleanup ........ r41181 | waltervn | 2009-06-05 09:55:08 +1000 (Fri, 05 Jun 2009) | 3 lines SCI: Fixed some endian bugs related to speech handling. READ_UINT* are not LE, but use native endianness. Thanks to clone2727 for pointing this out. ........ r41185 | Kirben | 2009-06-05 10:57:58 +1000 (Fri, 05 Jun 2009) | 1 line Update sound code in HE80+ games, for sound rate differences. ........ r41186 | waltervn | 2009-06-05 11:12:52 +1000 (Fri, 05 Jun 2009) | 2 lines SCI: Audio: Fixed bug in sample length computation. ........ r41188 | Kirben | 2009-06-05 12:35:38 +1000 (Fri, 05 Jun 2009) | 1 line Fix issues selecting some items in arttime and football. ........ r41189 | Kirben | 2009-06-05 14:16:32 +1000 (Fri, 05 Jun 2009) | 1 line Minor cleanup. ........ r41196 | dreammaster | 2009-06-05 22:20:42 +1000 (Fri, 05 Jun 2009) | 1 line Tweaks to the code that pauses for a mouse press when displaying many text messages ........ r41197 | thebluegr | 2009-06-06 04:05:45 +1000 (Sat, 06 Jun 2009) | 1 line Removed some unused code and performed some cleanup ........ r41198 | thebluegr | 2009-06-06 05:04:14 +1000 (Sat, 06 Jun 2009) | 1 line Moved some more debug commands to ScummVM's coneole and removed some unused code ........ r41199 | athrxx | 2009-06-06 07:34:18 +1000 (Sat, 06 Jun 2009) | 1 line LOL: implemented another opcode ........ r41200 | mthreepwood | 2009-06-06 08:35:13 +1000 (Sat, 06 Jun 2009) | 1 line Make the PlayStation's abbreviation to all lower-case for consistency and change the description from Playstation to Sony PlayStation ........ r41201 | athrxx | 2009-06-06 08:53:36 +1000 (Sat, 06 Jun 2009) | 1 line LOL: minor bug fix ........ r41202 | thebluegr | 2009-06-06 09:08:35 +1000 (Sat, 06 Jun 2009) | 1 line Cleanup ........ svn-id: r41206
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index eb75beab8f..8083ddad73 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -124,11 +124,10 @@ Common::Error SciEngine::run() {
// FIXME/TODO: Move some of the stuff below to init()
- sci_version_t version;
+ const sci_version_t version = getVersion();
+ const uint32 flags = getFlags();
int res_version = getResourceVersion();
- version = getVersion();
-
_resmgr = new ResourceManager(res_version, 256 * 1024);
if (!_resmgr) {
@@ -144,37 +143,34 @@ Common::Error SciEngine::run() {
map_MIDI_instruments(_resmgr);
#endif
- _gamestate = new EngineState();
- _gamestate->resmgr = _resmgr;
- _gamestate->gfx_state = NULL;
- _gamestate->flags = getFlags();
+ _gamestate = new EngineState(_resmgr, version, flags);
// Verify that we haven't got an invalid game detection entry
if (version < SCI_VERSION_1_EARLY) {
// SCI0/SCI01
- if (_gamestate->flags & GF_SCI1_EGA ||
- _gamestate->flags & GF_SCI1_LOFSABSOLUTE ||
- _gamestate->flags & GF_SCI1_NEWDOSOUND) {
+ if (flags & GF_SCI1_EGA ||
+ flags & GF_SCI1_LOFSABSOLUTE ||
+ flags & GF_SCI1_NEWDOSOUND) {
error("This game entry is erroneous. It's marked as SCI0/SCI01, but it has SCI1 flags set");
}
} else if (version >= SCI_VERSION_1_EARLY && version <= SCI_VERSION_1_LATE) {
// SCI1
- if (_gamestate->flags & GF_SCI0_OLD ||
- _gamestate->flags & GF_SCI0_OLDGFXFUNCS ||
- _gamestate->flags & GF_SCI0_OLDGETTIME) {
+ if (flags & GF_SCI0_OLD ||
+ flags & GF_SCI0_OLDGFXFUNCS ||
+ flags & GF_SCI0_OLDGETTIME) {
error("This game entry is erroneous. It's marked as SCI1, but it has SCI0 flags set");
}
} else if (version == SCI_VERSION_1_1 || version == SCI_VERSION_32) {
- if (_gamestate->flags & GF_SCI1_EGA ||
- _gamestate->flags & GF_SCI1_LOFSABSOLUTE ||
- _gamestate->flags & GF_SCI1_NEWDOSOUND) {
+ if (flags & GF_SCI1_EGA ||
+ flags & GF_SCI1_LOFSABSOLUTE ||
+ flags & GF_SCI1_NEWDOSOUND) {
error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI1 flags set");
}
- if (_gamestate->flags & GF_SCI0_OLD ||
- _gamestate->flags & GF_SCI0_OLDGFXFUNCS ||
- _gamestate->flags & GF_SCI0_OLDGETTIME) {
+ if (flags & GF_SCI0_OLD ||
+ flags & GF_SCI0_OLDGFXFUNCS ||
+ flags & GF_SCI0_OLDGETTIME) {
error("This game entry is erroneous. It's marked as SCI1.1/SCI32, but it has SCI0 flags set");
}
@@ -183,7 +179,7 @@ Common::Error SciEngine::run() {
error ("Unknown SCI version in game entry");
}
- if (script_init_engine(_gamestate, version))
+ if (script_init_engine(_gamestate))
return Common::kUnknownError;