aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2011-12-20 11:33:09 +0100
committerMax Horn2011-12-23 10:18:02 +0100
commitb2fcdd6c86fb341695d32afded114fecbe5d7590 (patch)
tree5d0156625eb494461eda7ed1b13029954d588116 /engines
parentb6e139d112b08d9280c145ae40f6324be6707efe (diff)
downloadscummvm-rg350-b2fcdd6c86fb341695d32afded114fecbe5d7590.tar.gz
scummvm-rg350-b2fcdd6c86fb341695d32afded114fecbe5d7590.tar.bz2
scummvm-rg350-b2fcdd6c86fb341695d32afded114fecbe5d7590.zip
DREAMWEB: Move rest of saveload.cpp to DreamBase
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreambase.h15
-rw-r--r--engines/dreamweb/newplace.cpp25
-rw-r--r--engines/dreamweb/object.cpp25
-rw-r--r--engines/dreamweb/saveload.cpp23
-rw-r--r--engines/dreamweb/stubs.cpp20
-rw-r--r--engines/dreamweb/stubs.h13
6 files changed, 58 insertions, 63 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 5acdca0ac9..561237ac6e 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -243,14 +243,22 @@ public:
void delCurs();
// from saveload.cpp
- void oldToNames();
+ void loadGame();
+ void doLoad(int slot);
+ void saveGame();
void namesToOld();
+ void oldToNames();
+ void saveLoad();
+ void doSaveLoad();
void showMainOps();
void showDiscOps();
+ void discOps();
void actualSave();
void actualLoad();
void loadPosition(unsigned int slot);
void savePosition(unsigned int slot, const char *descbuf);
+ uint scanForNames();
+ void loadOld();
void showDecisions();
void loadSaveBox();
void showNames();
@@ -469,6 +477,11 @@ public:
template <class T> void checkCoords(const RectWithCallback<T> *rectWithCallbacks);
void newGame();
void deleteTaken();
+ void autoAppear();
+ void loadRoom();
+ void startLoading(const Room &room);
+ void startup();
+ void atmospheres();
// from use.cpp
void placeFreeObject(uint8 index);
diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp
index ba1276b9c6..f1743f0e6d 100644
--- a/engines/dreamweb/newplace.cpp
+++ b/engines/dreamweb/newplace.cpp
@@ -234,7 +234,30 @@ void DreamBase::setLocation(uint8 index) {
data.byte(kRoomscango + index) = 1;
}
-// TODO: Place resetLocation here
+void DreamBase::resetLocation(uint8 index) {
+ if (index == 5) {
+ // delete hotel
+ purgeALocation(5);
+ purgeALocation(21);
+ purgeALocation(22);
+ purgeALocation(27);
+ } else if (index == 8) {
+ // delete TV studio
+ purgeALocation(8);
+ purgeALocation(28);
+ } else if (index == 6) {
+ // delete sarters
+ purgeALocation(6);
+ purgeALocation(20);
+ purgeALocation(25);
+ } else if (index == 13) {
+ // delete boathouse
+ purgeALocation(13);
+ purgeALocation(29);
+ }
+
+ data.byte(kRoomscango + index) = 0;
+}
void DreamGenContext::readDestIcon() {
loadIntoTemp("DREAMWEB.G05");
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 6aa1364002..207f4889db 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -631,31 +631,6 @@ void DreamGenContext::outOfInv() {
delPointer();
}
-void DreamBase::resetLocation(uint8 index) {
- if (index == 5) {
- // delete hotel
- purgeALocation(5);
- purgeALocation(21);
- purgeALocation(22);
- purgeALocation(27);
- } else if (index == 8) {
- // delete TV studio
- purgeALocation(8);
- purgeALocation(28);
- } else if (index == 6) {
- // delete sarters
- purgeALocation(6);
- purgeALocation(20);
- purgeALocation(25);
- } else if (index == 13) {
- // delete boathouse
- purgeALocation(13);
- purgeALocation(29);
- }
-
- data.byte(kRoomscango + index) = 0;
-}
-
void DreamBase::purgeALocation(uint8 index) {
// index == al
for (uint8 i = 0; i < kNumexobjects; ++i) {
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index a0309e1ee0..b12c668d82 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -44,7 +44,7 @@ void syncReelRoutine(Common::Serializer &s, ReelRoutine *reel) {
s.syncAsByte(reel->b7);
}
-void DreamGenContext::loadGame() {
+void DreamBase::loadGame() {
if (data.byte(kCommandtype) != 246) {
data.byte(kCommandtype) = 246;
commandOnly(41);
@@ -57,7 +57,7 @@ void DreamGenContext::loadGame() {
// if -1, open menu to ask for slot to load
// if >= 0, directly load from that slot
-void DreamGenContext::doLoad(int savegameId) {
+void DreamBase::doLoad(int savegameId) {
data.byte(kLoadingorsave) = 1;
if (ConfMan.getBool("dreamweb_originalsaveload") && savegameId == -1) {
@@ -138,7 +138,7 @@ void DreamGenContext::doLoad(int savegameId) {
}
-void DreamGenContext::saveGame() {
+void DreamBase::saveGame() {
if (data.byte(kMandead) == 2) {
blank();
return;
@@ -239,7 +239,7 @@ void DreamBase::oldToNames() {
memcpy(_saveNames, _saveNamesOld, 17*7);
}
-void DreamGenContext::saveLoad() {
+void DreamBase::saveLoad() {
if (data.word(kWatchingtime) || (data.byte(kPointermode) == 2)) {
blank();
return;
@@ -252,7 +252,7 @@ void DreamGenContext::saveLoad() {
doSaveLoad();
}
-void DreamGenContext::doSaveLoad() {
+void DreamBase::doSaveLoad() {
data.byte(kPointerframe) = 0;
data.word(kTextaddressx) = 70;
data.word(kTextaddressy) = 182-8;
@@ -350,7 +350,7 @@ void DreamBase::showDiscOps() {
showFrame(tempGraphics(), kOpsx+176+2, kOpsy+60-4, 5, 0);
}
-void DreamGenContext::discOps() {
+void DreamBase::discOps() {
if (data.byte(kCommandtype) != 249) {
data.byte(kCommandtype) = 249;
commandOnly(43);
@@ -368,8 +368,8 @@ void DreamGenContext::discOps() {
data.byte(kGetback) = 0;
RectWithCallback<DreamGenContext> discOpsList[] = {
- { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamGenContext::loadGame },
- { kOpsx+10,kOpsx+79,kOpsy+10,kOpsy+59,&DreamGenContext::saveGame },
+ { kOpsx+59,kOpsx+114,kOpsy+30,kOpsy+76,&DreamBase::loadGame },
+ { kOpsx+10,kOpsx+79,kOpsy+10,kOpsy+59,&DreamBase::saveGame },
{ kOpsx+176,kOpsx+192,kOpsy+60,kOpsy+76,&DreamBase::getBackToOps },
{ 0,320,0,200,&DreamBase::blank },
{ 0xFFFF,0,0,0,0 }
@@ -589,7 +589,7 @@ void DreamBase::loadPosition(unsigned int slot) {
}
// Count number of save files, and load their descriptions into _saveNames
-unsigned int DreamGenContext::scanForNames() {
+uint DreamBase::scanForNames() {
// Initialize the first 7 slots (like the original code expects)
for (unsigned int slot = 0; slot < 7; ++slot) {
_saveNames[17 * slot + 0] = 2;
@@ -620,12 +620,13 @@ unsigned int DreamGenContext::scanForNames() {
Common::strlcpy(&_saveNames[17 * slotNum + 1], name, 16); // the first character is unused
}
- al = saveList.size() <= 7 ? (uint8)saveList.size() : 7;
+ // FIXME: Can the following be safely removed?
+// al = saveList.size() <= 7 ? (uint8)saveList.size() : 7;
return saveList.size();
}
-void DreamGenContext::loadOld() {
+void DreamBase::loadOld() {
if (data.byte(kCommandtype) != 252) {
data.byte(kCommandtype) = 252;
commandOnly(48);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 894c247e5b..6d8519b577 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -495,7 +495,7 @@ void DreamGenContext::dreamweb() {
while (true) {
- unsigned int count = scanForNames();
+ uint count = scanForNames();
bool startNewGame = true;
@@ -707,7 +707,7 @@ void DreamGenContext::screenUpdate() {
delPointer();
}
-void DreamGenContext::startup() {
+void DreamBase::startup() {
data.byte(kCurrentkey) = 0;
data.byte(kMainmode) = 0;
createPanel();
@@ -1044,7 +1044,7 @@ void DreamBase::clearAndLoad(uint16 seg, uint8 c,
clearAndLoad(buf, c, size, maxSize);
}
-void DreamGenContext::startLoading(const Room &room) {
+void DreamBase::startLoading(const Room &room) {
data.byte(kCombatcount) = 0;
data.byte(kRoomssample) = room.roomsSample;
data.byte(kMapx) = room.mapX;
@@ -2092,7 +2092,7 @@ void DreamBase::zoomIcon() {
showFrame(engine->icons1(), kZoomx, kZoomy-1, 8, 0);
}
-void DreamGenContext::loadRoom() {
+void DreamBase::loadRoom() {
data.byte(kRoomloaded) = 1;
data.word(kTimecount) = 0;
data.word(kMaintimer) = 0;
@@ -2111,10 +2111,6 @@ void DreamGenContext::loadRoom() {
uint8 mapXstart, mapYstart;
uint8 mapXsize, mapYsize;
getDimension(&mapXstart, &mapYstart, &mapXsize, &mapYsize);
- cl = mapXstart;
- ch = mapYstart;
- dl = mapXsize;
- dh = mapYsize;
}
void DreamGenContext::readSetData() {
@@ -2627,7 +2623,7 @@ void DreamGenContext::useMenu() {
workToScreenM();
}
-void DreamGenContext::atmospheres() {
+void DreamBase::atmospheres() {
const Atmosphere *a = &g_atmosphereList[0];
@@ -2651,8 +2647,8 @@ void DreamGenContext::atmospheres() {
// I'm interpreting this as if the cmp reallocation is below the jz
if (data.byte(kMapy) == 0) {
- data.byte(kVolume) = 0; // "fullvol"
- return;
+ data.byte(kVolume) = 0; // "fullvol"
+ return;
}
if (data.byte(kReallocation) == 2 && data.byte(kMapx) == 22 && data.byte(kMapy) == 10)
@@ -3898,7 +3894,7 @@ void DreamGenContext::useButtonA() {
}
}
-void DreamGenContext::autoAppear() {
+void DreamBase::autoAppear() {
if (data.byte(kLocation) == 32) {
// In alley
resetLocation(5);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 61697e828e..c94cb02a3c 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -23,9 +23,7 @@
#define DREAMWEB_STUBS_H
void screenUpdate();
- void startup();
void startup1();
- void saveLoad();
void workToScreen();
void multiGet();
void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height) {
@@ -52,7 +50,6 @@
uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
return DreamBase::printDirect(string, x, y, maxWidth, centered);
}
- void startLoading(const Room &room);
void showFrame();
void showFrame(const Frame *frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height) {
DreamBase::showFrame(frameData, x, y, frameNumber, effectsFlag, width, height);
@@ -131,7 +128,6 @@
void dumpWatch();
void transferText();
void watchCount();
- void loadRoom();
void readSetData();
void useMenu();
void useMon();
@@ -219,15 +215,9 @@
uint8 nextSymbol(uint8 symbol);
void showSymbol();
void enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
- unsigned int scanForNames();
- void doLoad(int slot);
- void loadOld();
void inventory();
void mainScreen();
- void loadGame();
- void saveGame();
void zoomOnOff();
- void atmospheres();
void hangOne(uint16 delay);
void hangOne();
void bibleQuote();
@@ -287,8 +277,6 @@
void madmanRun();
void decide();
void talk();
- void discOps();
- void doSaveLoad();
void useDiary();
void hangOnPQ();
void showGun();
@@ -299,7 +287,6 @@
void monkSpeaking();
void rollEndCredits2();
void useButtonA();
- void autoAppear();
void setupTimedUse();
void entryAnims();
void triggerMessage(uint16 index);