aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2007-08-02 22:12:20 +0000
committerSven Hesse2007-08-02 22:12:20 +0000
commita2aec6c753b7d2881a2460e039d5309e6120de62 (patch)
tree4dd9e2e6f774eb36d0e0ae07b941f51621c02e83 /engines/gob
parent59089f95dd2e21065a424405b486e7138cf6b1c6 (diff)
downloadscummvm-rg350-a2aec6c753b7d2881a2460e039d5309e6120de62.tar.gz
scummvm-rg350-a2aec6c753b7d2881a2460e039d5309e6120de62.tar.bz2
scummvm-rg350-a2aec6c753b7d2881a2460e039d5309e6120de62.zip
Saving works now in Lost in Time
svn-id: r28418
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/detection.cpp16
-rw-r--r--engines/gob/gob.cpp14
-rw-r--r--engines/gob/gob.h3
-rw-r--r--engines/gob/saveload.h7
-rw-r--r--engines/gob/saveload_v3.cpp23
5 files changed, 44 insertions, 19 deletions
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index b9d784c63d..7faef57cc1 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -52,9 +52,9 @@ static const PlainGameDescriptor gobGames[] = {
{"ween", "Ween: The Prophecy"},
{"bargon", "Bargon Attack"},
{"ajworld", "A.J's World of Discovery"},
- {"lostintime", "Lost in Time"},
{"gob3", "Goblins Quest 3"},
{"gob3cd", "Goblins Quest 3 CD"},
+ {"lostintime", "Lost in Time"},
{"inca2", "Inca II: Wiracocha"},
{"woodruff", "The Bizarre Adventures of Woodruff and the Schnibble"},
// {"dynasty", "The Last Dynasty"},
@@ -871,7 +871,7 @@ static const GOBGameDescription gameDescriptions[] = {
kPlatformPC,
Common::ADGF_NO_FLAGS
},
- kGameTypeGob3,
+ kGameTypeLostInTime,
kFeaturesAdlib,
"intro"
},
@@ -884,7 +884,7 @@ static const GOBGameDescription gameDescriptions[] = {
kPlatformPC,
Common::ADGF_NO_FLAGS
},
- kGameTypeGob3,
+ kGameTypeLostInTime,
kFeaturesCD,
"intro"
},
@@ -897,7 +897,7 @@ static const GOBGameDescription gameDescriptions[] = {
kPlatformPC,
Common::ADGF_NO_FLAGS
},
- kGameTypeGob3,
+ kGameTypeLostInTime,
kFeaturesCD,
"intro"
},
@@ -910,7 +910,7 @@ static const GOBGameDescription gameDescriptions[] = {
kPlatformPC,
Common::ADGF_NO_FLAGS
},
- kGameTypeGob3,
+ kGameTypeLostInTime,
kFeaturesCD,
"intro"
},
@@ -923,7 +923,7 @@ static const GOBGameDescription gameDescriptions[] = {
kPlatformPC,
Common::ADGF_NO_FLAGS
},
- kGameTypeGob3,
+ kGameTypeLostInTime,
kFeaturesCD,
"intro"
},
@@ -936,7 +936,7 @@ static const GOBGameDescription gameDescriptions[] = {
kPlatformPC,
Common::ADGF_NO_FLAGS
},
- kGameTypeGob3,
+ kGameTypeLostInTime,
kFeaturesCD,
"intro"
},
@@ -949,7 +949,7 @@ static const GOBGameDescription gameDescriptions[] = {
kPlatformPC,
Common::ADGF_NO_FLAGS
},
- kGameTypeGob3,
+ kGameTypeLostInTime,
kFeaturesCD,
"intro"
},
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index f1bec2b8d5..40a505364d 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -310,6 +310,20 @@ bool GobEngine::initGameParts() {
_saveLoad = new SaveLoad_v3(this, _targetName.c_str());
break;
+ case kGameTypeLostInTime:
+ _init = new Init_v3(this);
+ _video = new Video_v2(this);
+ _inter = new Inter_v3(this);
+ _parse = new Parse_v2(this);
+ _mult = new Mult_v2(this);
+ _draw = new Draw_v2(this);
+ _game = new Game_v2(this);
+ _map = new Map_v2(this);
+ _goblin = new Goblin_v3(this);
+ _scenery = new Scenery_v2(this);
+ _saveLoad = new SaveLoad_v3(this, _targetName.c_str(), 4768, 0, 50);
+ break;
+
case kGameTypeWoodruff:
_init = new Init_v3(this);
_video = new Video_v2(this);
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index 9a88571c0e..d573dc3a89 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -85,7 +85,8 @@ enum GameType {
kGameTypeGob3,
kGameTypeWoodruff,
kGameTypeBargon,
- kGameTypeWeen
+ kGameTypeWeen,
+ kGameTypeLostInTime
};
enum Features {
diff --git a/engines/gob/saveload.h b/engines/gob/saveload.h
index b8c9e730dd..8868bc1a12 100644
--- a/engines/gob/saveload.h
+++ b/engines/gob/saveload.h
@@ -136,7 +136,8 @@ class SaveLoad_v3 : public SaveLoad_v2 {
public:
virtual SaveType getSaveType(const char *fileName);
- SaveLoad_v3(GobEngine *vm, const char *targetName);
+ SaveLoad_v3(GobEngine *vm, const char *targetName, uint32 screenshotSize = 19968,
+ uint32 indexOffset = 40, uint32 screenshotOffset = 80);
virtual ~SaveLoad_v3() {}
protected:
@@ -144,6 +145,10 @@ protected:
bool _firstSizeGame;
int8 _saveSlot;
+ uint32 _screenshotSize;
+ uint32 _indexOffset;
+ uint32 _screenshotOffset;
+
virtual uint32 getSaveGameSize();
virtual int32 getSizeGame();
diff --git a/engines/gob/saveload_v3.cpp b/engines/gob/saveload_v3.cpp
index 2f143d683a..249361e222 100644
--- a/engines/gob/saveload_v3.cpp
+++ b/engines/gob/saveload_v3.cpp
@@ -34,9 +34,14 @@
namespace Gob {
-SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName) :
+SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName,
+ uint32 screenshotSize, uint32 indexOffset, uint32 screenshotOffset) :
SaveLoad_v2(vm, targetName) {
+ _screenshotSize = screenshotSize;
+ _indexOffset = indexOffset;
+ _screenshotOffset = screenshotOffset;
+
_saveSlot = -1;
_stagesCount = 3;
@@ -81,7 +86,7 @@ uint32 SaveLoad_v3::getSaveGameSize() {
size = 1040 + (READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4) * 2;
if (_useScreenshots)
- size += 19968;
+ size += _screenshotSize;
return size;
}
@@ -126,7 +131,7 @@ int32 SaveLoad_v3::getSizeScreenshot() {
in = saveMan->openForLoading(setCurSlot(i));
if (in) {
delete in;
- size = (i + 1) * 19968 + 80;
+ size = (i + 1) * _screenshotSize + _screenshotOffset;
break;
}
}
@@ -218,11 +223,11 @@ bool SaveLoad_v3::loadScreenshot(int16 dataVar, int32 size, int32 offset) {
Common::SaveFileManager *saveMan = g_system->getSavefileManager();
Common::InSaveFile *in;
- int slot = (offset - 80) / 19968;
- int slotR = (offset - 80) % 19968;
+ int slot = (offset - _screenshotOffset) / _screenshotSize;
+ int slotR = (offset - _screenshotOffset) % _screenshotSize;
_useScreenshots = true;
- if ((size == 40) && (offset == 40)) {
+ if ((size == 40) && (offset == _indexOffset)) {
char buf[40];
memset(buf, 0, 40);
@@ -335,12 +340,12 @@ bool SaveLoad_v3::saveNotes(int16 dataVar, int32 size, int32 offset) {
}
bool SaveLoad_v3::saveScreenshot(int16 dataVar, int32 size, int32 offset) {
- int slot = (offset - 80) / 19968;
- int slotR = (offset - 80) % 19968;
+ int slot = (offset - _screenshotOffset) / _screenshotSize;
+ int slotR = (offset - _screenshotOffset) % _screenshotSize;
_useScreenshots = true;
- if ((offset < 80) && (size > 0)) {
+ if ((offset < _screenshotOffset) && (size > 0)) {
return true;