diff options
author | Alyssa Milburn | 2011-08-22 20:03:05 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-08-22 20:03:05 +0200 |
commit | 84063dc9727a9f55e09d39574027beab695680e6 (patch) | |
tree | d71a9599cb550d9f7949a2d3209574064e054d85 /engines/tinsel | |
parent | c6e89df3d940747a85d447f172e2323c800f5eaf (diff) | |
parent | a39a3eda46aea108a51556f001617ad28d29e520 (diff) | |
download | scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.gz scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.bz2 scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.zip |
Merge remote-tracking branch 'origin/master' into soltys_wip2
Diffstat (limited to 'engines/tinsel')
-rw-r--r-- | engines/tinsel/adpcm.cpp | 2 | ||||
-rw-r--r-- | engines/tinsel/coroutine.cpp | 1 | ||||
-rw-r--r-- | engines/tinsel/detection.cpp | 16 | ||||
-rw-r--r-- | engines/tinsel/detection_tables.h | 26 | ||||
-rw-r--r-- | engines/tinsel/saveload.cpp | 9 | ||||
-rw-r--r-- | engines/tinsel/strres.h | 1 | ||||
-rw-r--r-- | engines/tinsel/tinsel.h | 4 |
7 files changed, 37 insertions, 22 deletions
diff --git a/engines/tinsel/adpcm.cpp b/engines/tinsel/adpcm.cpp index 4ea835586b..ca3150ca3d 100644 --- a/engines/tinsel/adpcm.cpp +++ b/engines/tinsel/adpcm.cpp @@ -61,7 +61,7 @@ void Tinsel_ADPCMStream::readBufferTinselHeader() { int16 Tinsel_ADPCMStream::decodeTinsel(int16 code, double eVal) { double sample; - sample = (double) code; + sample = (double)code; sample *= eVal * _status.predictor; sample += (_status.d0 * _status.K0) + (_status.d1 * _status.K1); diff --git a/engines/tinsel/coroutine.cpp b/engines/tinsel/coroutine.cpp index 998d98b52a..ef0097f043 100644 --- a/engines/tinsel/coroutine.cpp +++ b/engines/tinsel/coroutine.cpp @@ -80,4 +80,3 @@ CoroBaseContext::~CoroBaseContext() { } } // End of namespace Tinsel - diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 9c52305a1c..1fce032633 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -322,9 +322,21 @@ int TinselMetaEngine::getMaximumSaveSlot() const { return 99; } void TinselMetaEngine::removeSaveState(const char *target, int slot) const { Tinsel::setNeedLoad(); - Tinsel::getList(g_system->getSavefileManager(), target); + // Same issue here as with loadGameState(): we need the physical savegame + // slot. Refer to bug #3387551. + int listSlot = -1; + const int numStates = Tinsel::getList(g_system->getSavefileManager(), target); + for (int i = 0; i < numStates; ++i) { + const char *fileName = Tinsel::ListEntry(i, Tinsel::LE_NAME); + const int saveSlot = atoi(fileName + strlen(fileName) - 3); + + if (saveSlot == slot) { + listSlot = i; + break; + } + } - g_system->getSavefileManager()->removeSavefile(Tinsel::ListEntry(slot, Tinsel::LE_NAME)); + g_system->getSavefileManager()->removeSavefile(Tinsel::ListEntry(listSlot, Tinsel::LE_NAME)); Tinsel::setNeedLoad(); Tinsel::getList(g_system->getSavefileManager(), target); } diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h index 116322aa89..bea0938fad 100644 --- a/engines/tinsel/detection_tables.h +++ b/engines/tinsel/detection_tables.h @@ -214,7 +214,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, @@ -236,7 +236,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::IT_ITA, Common::kPlatformPC, - ADGF_DROPLANGUAGE, + ADGF_DROPLANGUAGE | ADGF_CD, GUIO_NONE }, GID_DW1, @@ -261,7 +261,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::FR_FRA, Common::kPlatformPC, - ADGF_DROPLANGUAGE, + ADGF_DROPLANGUAGE | ADGF_CD, GUIO_NONE }, GID_DW1, @@ -285,7 +285,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::DE_DEU, Common::kPlatformPC, - ADGF_DROPLANGUAGE, + ADGF_DROPLANGUAGE | ADGF_CD, GUIO_NONE }, GID_DW1, @@ -308,7 +308,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::IT_ITA, Common::kPlatformPC, - ADGF_DROPLANGUAGE, + ADGF_DROPLANGUAGE | ADGF_CD, GUIO_NONE }, GID_DW1, @@ -331,7 +331,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::ES_ESP, Common::kPlatformPC, - ADGF_DROPLANGUAGE, + ADGF_DROPLANGUAGE | ADGF_CD, GUIO_NONE }, GID_DW1, @@ -351,7 +351,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, @@ -371,7 +371,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::HE_ISR, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, @@ -390,7 +390,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPSX, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, @@ -434,7 +434,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, @@ -456,7 +456,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::EN_ANY, Common::kPlatformMacintosh, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, @@ -475,7 +475,7 @@ static const TinselGameDescription gameDescriptions[] = { AD_ENTRY1s("dw.scn", "6182c7986eaec893c62fb6ea13a9f225", 774556), Common::DE_DEU, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, @@ -496,7 +496,7 @@ static const TinselGameDescription gameDescriptions[] = { }, Common::RU_RUS, Common::kPlatformPC, - ADGF_NO_FLAGS, + ADGF_CD, GUIO_NONE }, GID_DW1, diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 7a973ba4be..4ac172be43 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -154,8 +154,15 @@ static bool syncSaveGameHeader(Common::Serializer &s, SaveGameHeader &hdr) { syncTime(s, hdr.dateTime); int tmp = hdr.size - s.bytesSynced(); + + // NOTE: We can't use SAVEGAME_ID here when attempting to remove a saved game from the launcher, + // as there is no TinselEngine initialized then. This means that we can't check if this is a DW1 + // or DW2 savegame in this case, but it doesn't really matter, as the saved game is about to be + // deleted anyway. Refer to bug #3387551. + bool correctID = _vm ? (hdr.id == SAVEGAME_ID) : (hdr.id == DW1_SAVEGAME_ID || hdr.id == DW2_SAVEGAME_ID); + // Perform sanity check - if (tmp < 0 || hdr.id != SAVEGAME_ID || hdr.ver > CURRENT_VER || hdr.size > 1024) + if (tmp < 0 || !correctID || hdr.ver > CURRENT_VER || hdr.size > 1024) return false; // Skip over any extra bytes s.skip(tmp); diff --git a/engines/tinsel/strres.h b/engines/tinsel/strres.h index a63824a863..f6e86951b6 100644 --- a/engines/tinsel/strres.h +++ b/engines/tinsel/strres.h @@ -96,4 +96,3 @@ SCNHANDLE LanguageFlag(LANGUAGE thisOne); } // End of namespace Tinsel #endif - diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index 30b060766e..e18216cdf7 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -31,9 +31,6 @@ #include "common/random.h" #include "common/util.h" -#include "audio/mididrv.h" -#include "audio/mixer.h" - #include "engines/engine.h" #include "tinsel/debugger.h" #include "tinsel/graphics.h" @@ -53,6 +50,7 @@ namespace Tinsel { class BMVPlayer; class Config; +class MidiDriver; class MidiMusicPlayer; class PCMMusicPlayer; class Scheduler; |