32 Commits

Author SHA1 Message Date
Filippos Karapetis
9af30a2546 SCI: Now saving/loading the list of synonyms (set by kSetSynonyms), like SSCI did
This is a more correct way of fixing bug #3037618 than in rev #55017.
- Changed replaceant/replacement to be uint16's (they're very small positive
values, usually smaller than 4096)
- Changed SynonymList to an Array (so that it can be saved/loaded)
- Removed the PQ2 script patch to Game::replay()
- Added savegame history

svn-id: r55032
2010-12-24 14:47:47 +00:00
Filippos Karapetis
fdd2d980c6 SCI: Bumped up the save game version for rev #54805
Initially, I thought that older ScummVM versions will work with these saved games.
However, they will probably crash when trying to load saved games after rev #54805,
as the heap is reset when loading, and the system strings segment is no longer
initialized (thanks wjp).

svn-id: r54809
2010-12-07 16:49:53 +00:00
Filippos Karapetis
5de2668939 SCI: Some changes regarding the string heap in saved games
- Maintain the state of the string heap space in saved games
- Merged SegManager::reconstructScripts() inside SegManager::saveLoadWithSerializer()
- Disabled a now unnecessary script patch for the cipher puzzle in Castle of Dr. Brain, and performed some cleanup for another disabled patch
- Removed direct access to the _baseObj variable of objects

svn-id: r54133
2010-11-08 00:18:34 +00:00
Martin Kiewitz
548e67f413 SCI: fixing lf
(stupid msvc)

svn-id: r54014
2010-11-01 16:42:54 +00:00
Martin Kiewitz
eefa151d70 SCI: saving/restoring script created windows now
fixes "GfxPorts::kernelSetActive" error
based on code by [md5]

svn-id: r54012
2010-11-01 16:09:33 +00:00
Filippos Karapetis
dca3c8d8bf SCI: Play time related changes
- Added support for savegame play time
- Removed obsolete variables for calculating the play time (EngineState::gameStartTime and Console::_enterTime)
- Renamed some variables to camelCase

svn-id: r53974
2010-10-31 01:45:24 +00:00
Martin Kiewitz
a8df677c04 SCI: save/restore intensity of sysPalette
fixes bug #3072868
should be save for backporting

svn-id: r52875
2010-09-24 09:56:50 +00:00
Filippos Karapetis
9db77be9d4 SCI: Dropped support for the very old savegame versions 12 and 13 (hopefully, the last ones to be dropped)
svn-id: r51197
2010-07-23 08:22:13 +00:00
Filippos Karapetis
3aa4f76ee4 SCI: Now saving the kPalVary state inside savegames
svn-id: r51194
2010-07-23 07:36:55 +00:00
Filippos Karapetis
9add81aaf2 SCI: Dropped support for the very old saved game versions 9 - 11. Rationale: a lot has changed since then, we're still not stable, and this helps clean up the code, thus we're still in a position to drop support for old saved games
svn-id: r50738
2010-07-07 20:12:41 +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
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
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
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
209798474b Updated the save game format for the changes in #49093
svn-id: r49094
2010-05-19 09:39:11 +00:00
Filippos Karapetis
7f4aa161bc Removed duplicate code. Some cleanup
svn-id: r47735
2010-01-31 01:26:06 +00:00
Matthew Hoops
da46fc9b35 Add support for saving/loading Arrays/Strings in SCI32. It's possible to save a game in GK1 now via the console, but not load (yet).
svn-id: r47696
2010-01-30 02:03:59 +00:00
Martin Kiewitz
385c462352 SCI: fixing saved game compatibility
svn-id: r46827
2010-01-01 14:22:07 +00:00
Filippos Karapetis
afc4bc1295 SCI/new music code:
- Resolved a deadlock with the mixer, and added appropriate mutexes (a result of the fact that SCI mixes MIDI and digital audio in the same list)
- Fixed sound playing when loading games, by properly resetting the MIDI driver
- Reverted savegame version to 14 - the changes in versions 15 and 16 don't have any effect on the currently enabled old music code, and the new music code is disabled by default, and is still prone to changes
- Now saving/loading signal, loop and hold for each sound, as well as reverb
- Added stub code for setting reverb and channel hold
- The signal, loop and hold values of each song are cached, like in SSCI and like what happens in Greg's SCI implementation. This allows a clear separation of the engine code from the rest of the engine. Reverted commits 46792 and 46797
- Removed duplicate song list accessing code
- Song cues are now updated in kAnimate for SCI0, like the old music code does, to compensate for the fact that SCI0 didn't poll for music changes via cmdUpdateCues, like what SCI01 and newer do
- Cleanup

svn-id: r46812
2010-01-01 06:41:52 +00:00
Filippos Karapetis
54245f712d SCI/new music code: The loop selector for each music score is no longer cached, but read directly from the sound object
svn-id: r46792
2009-12-31 08:30:30 +00:00
Filippos Karapetis
9f37be314d SCI/new music code:
- Implemented sound muting
- Now saving/loading the master music volume

svn-id: r46643
2009-12-27 14:11:26 +00:00
Filippos Karapetis
809e8c9123 SCI/new music code: Some initial code for saving/loading the sound state
svn-id: r46549
2009-12-25 13:18:48 +00:00
Martin Kiewitz
a2d7505e81 SCI: Saving picPort now (fixes loading saved games in castle of dr. brain)
svn-id: r46292
2009-12-08 20:54:18 +00:00
Filippos Karapetis
1d3118cf42 Implemented some advanced savegame functionality - loading and deleting savegames from the GMM is now possible, and new saved games will also have thumbnails. Saving from the GMM creates corrupted saved games, so it has been disabled for now
svn-id: r44930
2009-10-11 15:51:43 +00:00
Max Horn
2fe6b32968 SCI: Remove EngineState::game_version, it was only used for saving anyway. Also remove syncCStr()
svn-id: r44358
2009-09-25 13:02:11 +00:00
Max Horn
d2a6713a8e SCI: Replace IntMapper Script::_objIndices and Common::Array Script::_objects by a HashMap -- goodbye, class IntMapper
svn-id: r44240
2009-09-21 21:38:43 +00:00
Max Horn
a550e2ea10 SCI: Replace "IntMapper *id_seg_map" in SegManager with a Common::HashMap<int,int>
This simplifies the code considerably. Also changed the savegame format
accordingly, which required me to bump the format version to 10. Old
saves should still load fine.

svn-id: r43986
2009-09-06 13:00:30 +00:00
Filippos Karapetis
ed66cad677 - Simplified the parameters of some functions
- Replaced some EngineState parameters
- The SCI version is now obtained from the resource manager or the segment manager, thereby simplifying several functions
- Plugged 2 leaks in the fallback detector
- Renamed the segment manager and resource manager to "segmentManager" and "resourceManager" in all places, for consistency

svn-id: r43722
2009-08-25 08:38:14 +00:00
Filippos Karapetis
f75c950457 - Replaced SCI_VERSION_FTU_LOFS_ABSOLUTE with the GF_SCI1_LOFSABSOLUTE game flag
- Moved the version defines outside of versions.h

svn-id: r40559
2009-05-14 12:38:50 +00:00
Filippos Karapetis
36a801ad14 EngineState is a struct, not a class
svn-id: r39355
2009-03-12 08:14:55 +00:00
Max Horn
40b313c28e SCI: Moved savegame specific stuff from state.h to a new header savegame.h
svn-id: r39351
2009-03-12 03:26:21 +00:00