aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
authorMatthew Hoops2011-12-12 15:25:28 -0500
committerMatthew Hoops2011-12-12 15:25:28 -0500
commit00279659b22cbd5db739d5351e83a9fc2a2ae408 (patch)
tree497f06f46820043cbdf1725652b8f0073223e24a /engines/tinsel
parentd932df79bed5aac97e17c0920a5e75cb5ce733ee (diff)
parentd1628feb761acc9f4607f64de3eb620fea53bcc9 (diff)
downloadscummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.gz
scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.bz2
scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.zip
Merge remote branch 'upstream/master' into pegasus
Conflicts: video/qt_decoder.cpp
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/actors.cpp13
-rw-r--r--engines/tinsel/actors.h2
-rw-r--r--engines/tinsel/config.cpp6
-rw-r--r--engines/tinsel/detection_tables.h65
-rw-r--r--engines/tinsel/graphics.cpp6
-rw-r--r--engines/tinsel/music.cpp1
-rw-r--r--engines/tinsel/pcode.cpp2
-rw-r--r--engines/tinsel/pcode.h2
-rw-r--r--engines/tinsel/saveload.cpp7
-rw-r--r--engines/tinsel/savescn.cpp4
10 files changed, 64 insertions, 44 deletions
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
index 4e9847f8b4..acacd89667 100644
--- a/engines/tinsel/actors.cpp
+++ b/engines/tinsel/actors.cpp
@@ -314,10 +314,19 @@ static void ActorRestoredProcess(CORO_PARAM, const void *param) {
// get the stuff copied to process when it was created
const RATP_INIT *r = (const RATP_INIT *)param;
+ bool isSavegame = r->pic->resumeState == RES_SAVEGAME;
CORO_BEGIN_CODE(_ctx);
_ctx->pic = RestoreInterpretContext(r->pic);
+
+ // The newly added check here specially sets the process to RES_NOT when loading a savegame.
+ // This is needed particularly for the Psychiatrist scene in Discworld 1 - otherwise Rincewind
+ // can't go upstairs without leaving the building and returning. If this patch causes problems
+ // in other scenes, an added check for the hCode == 1174490602 could be added.
+ if (isSavegame && TinselV1)
+ _ctx->pic->resumeState = RES_NOT;
+
CORO_INVOKE_1(Interpret, _ctx->pic);
// If it gets here, actor's code has run to completion
@@ -326,8 +335,10 @@ static void ActorRestoredProcess(CORO_PARAM, const void *param) {
CORO_END_CODE;
}
-void RestoreActorProcess(int id, INT_CONTEXT *pic) {
+void RestoreActorProcess(int id, INT_CONTEXT *pic, bool savegameFlag) {
RATP_INIT r = { pic, id };
+ if (savegameFlag)
+ pic->resumeState = RES_SAVEGAME;
g_scheduler->createProcess(PID_TCODE, ActorRestoredProcess, &r, sizeof(r));
}
diff --git a/engines/tinsel/actors.h b/engines/tinsel/actors.h
index e707db77ba..6ebe32505a 100644
--- a/engines/tinsel/actors.h
+++ b/engines/tinsel/actors.h
@@ -156,7 +156,7 @@ struct Z_POSITIONS {
int z;
};
-void RestoreActorProcess(int id, INT_CONTEXT *pic);
+void RestoreActorProcess(int id, INT_CONTEXT *pic, bool savegameFlag);
int SaveActors(PSAVED_ACTOR sActorInfo);
void RestoreActors(int numActors, PSAVED_ACTOR sActorInfo);
diff --git a/engines/tinsel/config.cpp b/engines/tinsel/config.cpp
index fd278db972..050573028a 100644
--- a/engines/tinsel/config.cpp
+++ b/engines/tinsel/config.cpp
@@ -76,6 +76,9 @@ void Config::writeToDisk() {
case TXT_ITALIAN:
lang = Common::IT_ITA;
break;
+ case TXT_US:
+ lang = Common::EN_USA;
+ break;
default:
lang = Common::EN_ANY;
}
@@ -132,6 +135,9 @@ void Config::readFromDisk() {
case Common::IT_ITA:
_language = TXT_ITALIAN;
break;
+ case Common::EN_USA:
+ _language = TXT_US;
+ break;
default:
_language = TXT_ENGLISH;
}
diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h
index bea0938fad..be44b1c462 100644
--- a/engines/tinsel/detection_tables.h
+++ b/engines/tinsel/detection_tables.h
@@ -22,11 +22,6 @@
namespace Tinsel {
-using Common::GUIO_NONE;
-using Common::GUIO_NOSPEECH;
-using Common::GUIO_NOSFX;
-using Common::GUIO_NOMUSIC;
-
static const TinselGameDescription gameDescriptions[] = {
// Note: The following is the (hopefully) definitive list of version details:
@@ -48,7 +43,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NOSPEECH | GUIO_NOSFX | GUIO_NOMUSIC
+ GUIO3(GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMUSIC)
},
GID_DW1,
0,
@@ -67,7 +62,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -87,7 +82,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformMacintosh,
ADGF_DEMO,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -111,7 +106,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO_NOSPEECH
+ GUIO1(GUIO_NOSPEECH)
},
GID_DW1,
0,
@@ -134,7 +129,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO_NOSPEECH
+ GUIO1(GUIO_NOSPEECH)
},
GID_DW1,
0,
@@ -157,7 +152,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO_NOSPEECH
+ GUIO1(GUIO_NOSPEECH)
},
GID_DW1,
0,
@@ -180,7 +175,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_DROPLANGUAGE,
- GUIO_NOSPEECH
+ GUIO1(GUIO_NOSPEECH)
},
GID_DW1,
0,
@@ -196,7 +191,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSPEECH
+ GUIO1(GUIO_NOSPEECH)
},
GID_DW1,
0,
@@ -215,7 +210,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -237,7 +232,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -262,7 +257,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -286,7 +281,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -309,7 +304,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -332,7 +327,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_DROPLANGUAGE | ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -352,7 +347,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -372,7 +367,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::HE_ISR,
Common::kPlatformPC,
ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -391,7 +386,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPSX,
ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -414,7 +409,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPSX,
ADGF_DEMO,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -435,7 +430,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -457,7 +452,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformMacintosh,
ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -476,7 +471,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_CD,
- GUIO_NONE
+ GUIO0()
},
GID_DW1,
0,
@@ -497,7 +492,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_CD,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW1,
0,
@@ -517,7 +512,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
@@ -537,7 +532,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_GRB,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
@@ -557,7 +552,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::EN_USA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
@@ -577,7 +572,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::FR_FRA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
@@ -597,7 +592,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::DE_DEU,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
@@ -618,7 +613,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::IT_ITA,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
@@ -638,7 +633,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
@@ -659,7 +654,7 @@ static const TinselGameDescription gameDescriptions[] = {
Common::RU_RUS,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NONE
+ GUIO1(GUIO_NOASPECT)
},
GID_DW2,
0,
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index 6a5d626de8..545310185c 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -478,9 +478,9 @@ static void t2WrtNonZero(DRAWOBJECT *pObj, uint8 *srcP, uint8 *destP, bool apply
// Non-transparent run length
color += pObj->constant;
if (horizFlipped)
- Common::set_to(tempP - runLength + 1, tempP + 1, color);
+ Common::fill(tempP - runLength + 1, tempP + 1, color);
else
- Common::set_to(tempP, tempP + runLength, color);
+ Common::fill(tempP, tempP + runLength, color);
}
}
@@ -533,7 +533,7 @@ static void WrtConst(DRAWOBJECT *pObj, uint8 *destP, bool applyClipping) {
// Loop through any remaining lines
while (pObj->height > 0) {
- Common::set_to(destP, destP + pObj->width, pObj->constant);
+ Common::fill(destP, destP + pObj->width, pObj->constant);
--pObj->height;
destP += SCREEN_WIDTH;
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index d6478f5cae..f552c49491 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -485,6 +485,7 @@ PCMMusicPlayer::PCMMusicPlayer() {
PCMMusicPlayer::~PCMMusicPlayer() {
_vm->_mixer->stopHandle(_handle);
+ delete _curChunk;
}
void PCMMusicPlayer::startPlay(int id) {
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index ae4c0d3ce1..2ab1e653d4 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -394,7 +394,7 @@ INT_CONTEXT *RestoreInterpretContext(INT_CONTEXT *ric) {
memcpy(ic, ric, sizeof(INT_CONTEXT));
ic->pProc = g_scheduler->getCurrentProcess();
- ic->resumeState = RES_NOT;
+ ic->resumeState = RES_1;
LockCode(ic);
diff --git a/engines/tinsel/pcode.h b/engines/tinsel/pcode.h
index 971a42d7bd..5d16dae432 100644
--- a/engines/tinsel/pcode.h
+++ b/engines/tinsel/pcode.h
@@ -37,7 +37,7 @@ namespace Tinsel {
struct INV_OBJECT;
enum RESUME_STATE {
- RES_NOT, RES_1, RES_2
+ RES_NOT, RES_1, RES_2, RES_SAVEGAME
};
enum {
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 4ac172be43..a0801d8247 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -84,6 +84,8 @@ extern void syncPolyInfo(Common::Serializer &s);
extern int sceneCtr;
+extern bool ASceneIsSaved;
+
//----------------- LOCAL DEFINES --------------------
struct SaveGameHeader {
@@ -438,6 +440,11 @@ static void DoSync(Common::Serializer &s) {
SAVED_DATA *sdPtr = SaveSceneSsData;
for (int i = 0; i < *SaveSceneSsCount; ++i, ++sdPtr)
syncSavedData(s, *sdPtr);
+
+ // Flag that there is a saved scene to return to. Note that in this context 'saved scene'
+ // is a stored scene to return to from another scene, such as from the Summoning Book close-up
+ // in Discworld 1 to whatever scene Rincewind was in prior to that
+ ASceneIsSaved = true;
}
if (!TinselV2)
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index 89d68a611e..39a8033d45 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -83,7 +83,7 @@ extern SRSTATE SRstate;
// FIXME: Avoid non-const global vars
-static bool ASceneIsSaved = false;
+bool ASceneIsSaved = false;
static int savedSceneCount = 0;
@@ -281,7 +281,7 @@ void ResumeInterprets() {
if (TinselV2)
RestoreProcess(&rsd->SavedICInfo[i]);
else
- RestoreActorProcess(rsd->SavedICInfo[i].idActor, &rsd->SavedICInfo[i]);
+ RestoreActorProcess(rsd->SavedICInfo[i].idActor, &rsd->SavedICInfo[i], rsd == &sgData);
break;
case GS_POLYGON: