aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/drascula.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/drascula/drascula.cpp')
-rw-r--r--engines/drascula/drascula.cpp68
1 files changed, 43 insertions, 25 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 1b3c4038f0..804881cf9a 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -87,6 +87,7 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
_textmisc = 0;
_textd1 = 0;
_talkSequences = 0;
+ _currentSaveSlot = 0;
_color = 0;
blinking = 0;
@@ -187,6 +188,8 @@ Common::Error DrasculaEngine::run() {
if (!loadDrasculaDat())
return Common::kUnknownError;
+ checkForOldSaveGames();
+
setupRoomsTable();
loadArchives();
@@ -195,6 +198,13 @@ Common::Error DrasculaEngine::run() {
currentChapter = 1; // values from 1 to 6 will start each part of game
loadedDifferentChapter = 0;
+ setTotalPlayTime(0);
+
+ // Check if a save is loaded from the launcher
+ int directSaveSlotLoading = ConfMan.getInt("save_slot");
+ if (directSaveSlotLoading >= 0) {
+ loadGame(directSaveSlotLoading);
+ }
checkCD();
@@ -233,7 +243,6 @@ Common::Error DrasculaEngine::run() {
framesWithoutAction = 0;
term_int = 0;
musicStopped = 0;
- selectionMade = 0;
globalSpeed = 0;
curExcuseLook = 0;
curExcuseAction = 0;
@@ -246,7 +255,6 @@ Common::Error DrasculaEngine::run() {
allocMemory();
_subtitlesDisabled = !ConfMan.getBool("subtitles");
- selectionMade = 0;
if (currentChapter != 3)
loadPic(96, frontSurface, COMPLETE_PAL);
@@ -261,7 +269,7 @@ Common::Error DrasculaEngine::run() {
loadPic(96, frontSurface);
} else if (currentChapter == 4) {
if (loadedDifferentChapter == 0)
- animation_ray();
+ animation_castle();
loadPic(96, frontSurface);
clearRoom();
} else if (currentChapter == 5) {
@@ -295,6 +303,7 @@ Common::Error DrasculaEngine::run() {
strcpy(iconName[i + 1], _textverbs[i]);
assignPalette(defaultPalette);
+
if (!runCurrentChapter()) {
endChapter();
break;
@@ -359,7 +368,7 @@ bool DrasculaEngine::runCurrentChapter() {
trackProtagonist = 1;
objExit = 104;
if (loadedDifferentChapter != 0) {
- if (!loadGame(saveName)) {
+ if (!loadGame(_currentSaveSlot)) {
return true;
}
} else {
@@ -368,6 +377,8 @@ bool DrasculaEngine::runCurrentChapter() {
curY = 56;
gotoObject(65, 145);
}
+
+ // REMINDER: This is a good place to debug animations
} else if (currentChapter == 2) {
addObject(kItemPhone);
trackProtagonist = 3;
@@ -375,7 +386,7 @@ bool DrasculaEngine::runCurrentChapter() {
if (loadedDifferentChapter == 0)
enterRoom(14);
else {
- if (!loadGame(saveName)) {
+ if (!loadGame(_currentSaveSlot)) {
return true;
}
}
@@ -393,7 +404,7 @@ bool DrasculaEngine::runCurrentChapter() {
if (loadedDifferentChapter == 0)
enterRoom(20);
else {
- if (!loadGame(saveName)) {
+ if (!loadGame(_currentSaveSlot)) {
return true;
}
}
@@ -410,7 +421,7 @@ bool DrasculaEngine::runCurrentChapter() {
curX = 235;
curY = 164;
} else {
- if (!loadGame(saveName)) {
+ if (!loadGame(_currentSaveSlot)) {
return true;
}
}
@@ -429,7 +440,7 @@ bool DrasculaEngine::runCurrentChapter() {
if (loadedDifferentChapter == 0) {
enterRoom(45);
} else {
- if (!loadGame(saveName)) {
+ if (!loadGame(_currentSaveSlot)) {
return true;
}
}
@@ -443,7 +454,7 @@ bool DrasculaEngine::runCurrentChapter() {
enterRoom(58);
animation_1_6();
} else {
- if (!loadGame(saveName)) {
+ if (!loadGame(_currentSaveSlot)) {
return true;
}
loadPic("auxdr.alg", drawSurface2);
@@ -596,13 +607,23 @@ bool DrasculaEngine::runCurrentChapter() {
selectVerb(kVerbTalk);
} else if (key == Common::KEYCODE_F6 && !_menuScreen) {
selectVerb(kVerbMove);
- } else if (key == Common::KEYCODE_F9) {
- volumeControls();
- } else if (key == Common::KEYCODE_F10) {
- if (!saveLoadScreen())
+ } else if (key == Common::KEYCODE_F7) {
+ // ScummVM load screen
+ if (!scummVMSaveLoadDialog(false))
return true;
} else if (key == Common::KEYCODE_F8) {
selectVerb(kVerbNone);
+ } else if (key == Common::KEYCODE_F9) {
+ volumeControls();
+ } else if (key == Common::KEYCODE_F10) {
+ if (!ConfMan.getBool("originalsaveload")) {
+ // ScummVM save screen
+ scummVMSaveLoadDialog(true);
+ } else {
+ // Original save/load screen
+ if (!saveLoadScreen())
+ return true;
+ }
} else if (key == Common::KEYCODE_v) {
_subtitlesDisabled = true;
ConfMan.setBool("subtitles", !_subtitlesDisabled);
@@ -628,17 +649,14 @@ bool DrasculaEngine::runCurrentChapter() {
}
if (leftMouseButton != 0 || rightMouseButton != 0 || key != 0)
- if (currentChapter != 3)
- framesWithoutAction = 0;
+ framesWithoutAction = 0;
if (framesWithoutAction == 15000) {
screenSaver();
- if (currentChapter != 3)
- framesWithoutAction = 0;
+ framesWithoutAction = 0;
}
- if (currentChapter != 3)
- framesWithoutAction++;
+ framesWithoutAction++;
}
return false;
@@ -652,8 +670,8 @@ bool DrasculaEngine::verify1() {
removeObject();
else {
for (l = 0; l < numRoomObjs; l++) {
- if (mouseX >= x1[l] && mouseY >= y1[l]
- && mouseX <= x2[l] && mouseY <= y2[l] && doBreak == 0) {
+ if (mouseX >= _objectX1[l] && mouseY >= _objectY1[l]
+ && mouseX <= _objectX2[l] && mouseY <= _objectY2[l] && doBreak == 0) {
if (exitRoom(l))
return true;
if (doBreak == 1)
@@ -666,8 +684,8 @@ bool DrasculaEngine::verify1() {
doBreak = 1;
for (l = 0; l < numRoomObjs; l++) {
- if (mouseX > x1[l] && mouseY > y1[l]
- && mouseX < x2[l] && mouseY < y2[l] && doBreak == 0) {
+ if (mouseX > _objectX1[l] && mouseY > _objectY1[l]
+ && mouseX < _objectX2[l] && mouseY < _objectY2[l] && doBreak == 0) {
roomX = roomObjX[l];
roomY = roomObjY[l];
trackFinal = trackObj[l];
@@ -700,8 +718,8 @@ bool DrasculaEngine::verify2() {
return true;
} else {
for (l = 0; l < numRoomObjs; l++) {
- if (mouseX > x1[l] && mouseY > y1[l]
- && mouseX < x2[l] && mouseY < y2[l] && visible[l] == 1) {
+ if (mouseX > _objectX1[l] && mouseY > _objectY1[l]
+ && mouseX < _objectX2[l] && mouseY < _objectY2[l] && visible[l] == 1) {
trackFinal = trackObj[l];
walkToObject = 1;
gotoObject(roomObjX[l], roomObjY[l]);