Commit Graph
345 Commits
Author SHA1 Message Date
Max Horn aa6be750fb SCI: Invoke resetSegMan from SegManager::saveLoadWithSerializer, not from EngineState::saveLoadWithSerializer
svn-id: r50554
2010-07-01 16:06:04 +00:00
Max Horn c822cd67cb SCI: Make SegManager::_classTable private.
This require a small tweak to the save/load code: I moved the syncing
logic for _classtable from EngineState::saveLoadWithSerializer to
SegManager::saveLoadWithSerializer, which in theory should have no
effect (luckily, _classtable was being synced right after the
segment manager).

svn-id: r50551
2010-07-01 16:05:10 +00:00
Max Horn 3f429d64a2 SCI: Rename some variables to match our naming conventions
svn-id: r50549
2010-07-01 16:04:29 +00:00
Filippos Karapetis bff3e89e48 SCI: Removed the FreeSCI music code
svn-id: r50532
2010-06-30 13:49:05 +00:00
Filippos Karapetis 9f1413b338 When deleting a list node, erase its references to predecessor and successor nodes. Fixes cases where game scripts could reference a list node after it was deleted (e.g. QFG1 intro, Longbow when exiting the cave). Some slight cleanup
svn-id: r50515
2010-06-30 07:18:43 +00:00
Filippos Karapetis 9f1320d5cc SCI: Made the SoundCommandParser a member of the SciEngine class and removed it from the EngineState, since it's static throughout the course of a game
svn-id: r50484
2010-06-29 09:00:08 +00:00
Filippos Karapetis ee6aebc780 Don't initialize graphics again when loading
svn-id: r50464
2010-06-28 22:08:46 +00:00
Max Horn 30218a2c32 SCI: Make Script member vars private; add const qualifiers
Only three Script members remain public (for now)

svn-id: r50428
2010-06-28 11:22:20 +00:00
Filippos Karapetis 0a102981f0 Moved the SelectorCache struct inside selector.h, where it belongs, and fixed some header dependencies in the process
svn-id: r50183
2010-06-23 15:23:37 +00:00
Filippos Karapetis c28fa2cf19 Reverted the code which handles objects without a base object when loading, for now. This possibly indicates an issue related to the garbage collector
svn-id: r50142
2010-06-22 15:03:19 +00:00
Filippos Karapetis 53b82298e8 Stop saving the buffer, script and heap sizes of each script in saved games
svn-id: r50137
2010-06-22 08:57:25 +00:00
Martin Kiewitz 996bd693e0 SCI: resume when unable to locate base objects - fixes loading some saved games
svn-id: r50055
2010-06-19 19:04:35 +00:00
Filippos Karapetis db70d66e4a Strict mode: Changed several warnings due to logic bugs into errors. If an error pops up from these ones, please add the game where it occurred and the steps to reproduce the error before turning it into a warning
svn-id: r49973
2010-06-17 23:50:28 +00:00
Martin Kiewitz b25aba1d1e SCI: SciGui/SciGui32 gone for good...
svn-id: r49860
2010-06-15 15:44:24 +00:00
Martin Kiewitz ba2de6dfa4 SCI: putting SciGui::init into SciEngine, removing it from SciGui(32)
svn-id: r49854
2010-06-15 13:34:40 +00:00
Filippos Karapetis e64eb71ce8 Properly reconstruct the running stack when restoring (a regression from commits #49376 and #49525), some formatting
svn-id: r49689
2010-06-15 09:11:26 +00:00
Filippos Karapetis ba3c43498b - Swapped the return value of gamestate_save (false = failed, true = succeeded)
- Removed some duplicate code inside Console::cmdSaveGame()

svn-id: r49688
2010-06-15 08:39:03 +00:00
Filippos Karapetis 0ad3bedf98 Added a signature of the game itself inside saved games (the size of script 0, as well as the offset of the game object, which are unique for each game), to prevent users from loading saved games across different versions of the same game. In the cases where we can't load a saved game, throw a nice GUI dialog instead of a console warning
svn-id: r49687
2010-06-15 08:25:51 +00:00
Filippos Karapetis 0dab9e0e1f Reorganized functions a bit
svn-id: r49685
2010-06-15 07:25:09 +00:00
Filippos Karapetis e93f8902a8 Cleanup of the savegame code:
- Added a saveLoadWithSerializer() method to the reg_t class
- Moved SegManager::reconstructClones() inside savegame.cpp
- Moved SoundCommandParser::syncPlayList() and SoundCommandParser::reconstructPlayList() inside savegame.cpp

svn-id: r49683
2010-06-15 07:20:53 +00:00
Filippos Karapetis cfdbfaa28e SCI: Limit the screen refresh rate to 60fps
svn-id: r49647
2010-06-14 08:36:52 +00:00
Filippos Karapetis b5ebd40d61 The offset of script local variables is now calculated when the script is loaded, thus we no longer need to save it. Merged scriptInitialiseLocals() with scriptInitialiseLocalsZero()
svn-id: r49640
2010-06-13 22:15:30 +00:00
Filippos Karapetis 711f679b7f camelCase changes
svn-id: r49570
2010-06-10 11:43:20 +00:00
Filippos Karapetis 93f33c7dab Resolved a FIXME with getSciLanguage(), by creating a separate setter. Also, some camelCase changes
svn-id: r49568
2010-06-10 11:18:10 +00:00
Filippos Karapetis a635b94823 Pic port saving/loading is only used in SCI0-SCI11
svn-id: r49567
2010-06-10 10:27:13 +00:00
Martin Kiewitz 8a5762c52d SCI: set picport when loading saved games
svn-id: r49565
2010-06-10 10:15:32 +00:00
Filippos Karapetis 5d71ae952f The EngineState is no longer recreated when a game is restored, thus we don't need to refresh pointers to it
svn-id: r49549
2010-06-09 20:12:25 +00:00
Filippos Karapetis 015262a0ee Fixed compilation when the old sound code is used
svn-id: r49540
2010-06-09 14:06:16 +00:00
Filippos Karapetis 536b2614e8 Globals from script 0 are now initialized in script_init_engine(), and are accessed from the relevant variables pointer. Removed direct reference to script 0 from the engine state
svn-id: r49536
2010-06-09 09:17:48 +00:00
Filippos Karapetis 81907a8e6f Don't shrink the stack after reconstructing it, when loading a saved game. Fixes game restoring in some games (e.g. LSL3), a regression from commit #49376
svn-id: r49525
2010-06-08 23:29:35 +00:00
Filippos Karapetis eafc63e572 Cleanup
svn-id: r49521
2010-06-08 21:21:19 +00:00
Filippos Karapetis 9304b5fbeb Merged the restarting_flags, script_abort_flag, and restoring members of the EngineState class into one variable, abortScriptProcessing. The flag kept to signify a game restart has been placed in a boolean, gameWasRestarted
svn-id: r49518
2010-06-08 21:05:46 +00:00
Filippos Karapetis 3d0ac2a676 Merged sync_SegManagerPtr() inside EngineState::saveLoadWithSerializer()
svn-id: r49512
2010-06-08 18:23:38 +00:00
Filippos Karapetis 5ba761a687 Made reconstruct_stack() a member of SegManager
svn-id: r49503
2010-06-08 13:16:30 +00:00
Filippos Karapetis 3c82b6578f Now that EngineState is not deleted when loading games, we can move some more state-related variables to it, and remove several FIXME's about non-const global variables. Also, the entries in the data stack are now deleted when loading (fixes a memory leak - thanks to digitall for this).
svn-id: r49465
2010-06-06 23:00:33 +00:00
Filippos Karapetis 65f3cfcbd8 Stop reconstructing the engine state when restoring, but reset it instead
svn-id: r49376
2010-06-01 15:48:17 +00:00
Filippos Karapetis 9c92bd1b81 The parser vocabulary remains static throughout the game, thus it has been removed from the engine state
svn-id: r49373
2010-06-01 15:11:20 +00:00
Filippos Karapetis e083c20da1 The system strings segment is a fixed segment of the segment manager, which doesn't change during the game, thus move all the system strings code and variables inside the segment manager
svn-id: r49372
2010-06-01 14:41:48 +00:00
Filippos Karapetis 3f4302214c The save/load object init code is now unified with the regular object init code
svn-id: r49346
2010-05-31 11:25:59 +00:00
Filippos Karapetis 693618d89a Slight cleanup
svn-id: r49339
2010-05-31 00:04:38 +00:00
Filippos Karapetis a0ee93ece5 SCI: Script exports and synonyms are now initialized when a script is loaded. Removed a sanity check inside script_instantiate_sci0 for a bug which no longer exists
svn-id: r49336
2010-05-30 21:49:07 +00:00
Filippos Karapetis 1fd3877ec7 Cleanup
svn-id: r49333
2010-05-30 20:18:42 +00:00
Filippos Karapetis 5cdb13b3e8 Made load_script() a member of the Script class
svn-id: r49328
2010-05-30 16:38:08 +00:00
Filippos Karapetis c32e88fe0b Limit access to the _bufSize, _scriptSize and _heapSize members of the Script class
svn-id: r49327
2010-05-30 16:14:31 +00:00
Filippos Karapetis 5f2ff0b1e7 Limit access to the _classTable array (now it's directly accessible only inside saveLoadWithSerializer()
svn-id: r49318
2010-05-29 23:56:37 +00:00
Max Horn 42d6ed880b SCI: Make Script::_exportTable const (yay :-)
svn-id: r49315
2010-05-29 21:42:42 +00:00
Filippos Karapetis a6156a6805 Removed the scriptRelocateExportsSci11() hack. The open spell in QFG1VGA works now (thanks to waltervn for all his help on this)
svn-id: r49311
2010-05-29 15:29:27 +00:00
Max Horn 0197e9f6a1 SCI: Making various object and script related things const
svn-id: r49246
2010-05-26 16:30:10 +00:00
Filippos Karapetis bfaba64c6a Made find_unique_script_block() a member of the Script class
svn-id: r49241
2010-05-26 14:25:51 +00:00
Filippos Karapetis 60dd310688 Cleanup
svn-id: r49227
2010-05-26 06:53:08 +00:00