aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorMax Horn2011-12-06 20:34:58 +0100
committerWillem Jan Palenstijn2011-12-07 10:30:44 +0100
commitfdb8b305e00e14edb4f97dc598e82d975dc29ca1 (patch)
tree4632a25569811cd3243e7030323195bdc129adc7 /engines/dreamweb
parentc0e2dddd271cab2c1301b54992ed879779d06513 (diff)
downloadscummvm-rg350-fdb8b305e00e14edb4f97dc598e82d975dc29ca1.tar.gz
scummvm-rg350-fdb8b305e00e14edb4f97dc598e82d975dc29ca1.tar.bz2
scummvm-rg350-fdb8b305e00e14edb4f97dc598e82d975dc29ca1.zip
DREAMWEB: Move more methods to DreamBase, cleanup
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreambase.h11
-rw-r--r--engines/dreamweb/stubs.h8
-rw-r--r--engines/dreamweb/vgagrafx.cpp23
3 files changed, 20 insertions, 22 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index f2a1e43f2d..4173499203 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -48,10 +48,21 @@ public:
public:
+ // from print.cpp
uint8 getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount);
uint8 getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset);
uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width);
+ // from vgagrafx.cpp
+ void printUnderMon();
+ void cls();
+ void frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y);
+ void frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
+ void frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
+ void frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
+ void doShake();
+ void showPCX(const Common::String &name);
+
// TODO: Move more methods from stubs.h to here.
};
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index c60adb4294..486e2f5727 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -51,22 +51,16 @@
void hangOnCurs();
void multiDump();
void multiDump(uint16 x, uint16 y, uint8 width, uint8 height);
- void frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y);
- void frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
- void frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
- void frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
void workToScreen();
void workToScreenCPP();
uint8 *mapStore();
void multiGet();
void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height);
- void cls();
void printSprites();
void quickQuit();
void readOneBlock();
void readCityPic();
void readDestIcon();
- void printUnderMon();
void seeCommandTail();
void randomNumber();
void quickQuit2();
@@ -487,7 +481,6 @@
void loadGame();
void saveGame();
void zoomOnOff();
- void doShake();
void atmospheres();
void loadPersonal();
void loadNews();
@@ -497,7 +490,6 @@
void hangOne(uint16 delay);
void hangOne();
void showPCX(const Common::String &name);
- void showPCX();
void bibleQuote();
void realCredits();
void intro();
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 3e1d97e5ca..4d9eb0885d 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -106,15 +106,15 @@ void DreamGenContext::workToScreen() {
cx = 0;
}
-void DreamGenContext::printUnderMon() {
+void DreamBase::printUnderMon() {
engine->printUnderMonitor();
}
-void DreamGenContext::cls() {
+void DreamBase::cls() {
engine->cls();
}
-void DreamGenContext::frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) {
+void DreamBase::frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) {
dst += pitch * y + x;
for (uint16 j = 0; j < height; ++j) {
@@ -124,7 +124,7 @@ void DreamGenContext::frameOutNm(uint8 *dst, const uint8 *src, uint16 pitch, uin
}
}
-void DreamGenContext::frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) {
+void DreamBase::frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) {
uint16 stride = pitch - width;
dst += y * pitch + x;
@@ -140,7 +140,7 @@ void DreamGenContext::frameOutBh(uint8 *dst, const uint8 *src, uint16 pitch, uin
}
}
-void DreamGenContext::frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) {
+void DreamBase::frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y) {
uint16 stride = pitch - width;
dst += y * pitch + x;
dst -= width;
@@ -157,8 +157,8 @@ void DreamGenContext::frameOutFx(uint8 *dst, const uint8 *src, uint16 pitch, uin
}
}
-void DreamGenContext::doShake() {
- uint8 &counter = data.byte(kShakecounter);
+void DreamBase::doShake() {
+ uint8 &counter = data.byte(DreamGenContext::kShakecounter);
if (counter == 48)
return;
@@ -227,8 +227,7 @@ void DreamGenContext::showPCX(const Common::String &name) {
// the color components have to be adjusted from 8 to 6 bits.
pcxFile.seek(16, SEEK_SET);
- es = data.word(kBuffers);
- mainGamePal = es.ptr(kMaingamepal, 768);
+ mainGamePal = getSegment(data.word(DreamGenContext::kBuffers)).ptr(DreamGenContext::kMaingamepal, 768);
pcxFile.read(mainGamePal, 48);
memset(mainGamePal + 48, 0xff, 720);
@@ -281,11 +280,7 @@ void DreamGenContext::showPCX(const Common::String &name) {
pcxFile.close();
}
-void DreamGenContext::showPCX() {
- showPCX(getFilename(*this));
-}
-
-void DreamGenContext::frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y) {
+void DreamBase::frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y) {
// NB : These resilience checks were not in the original engine, but did they result in undefined behaviour
// or was something broken during porting to C++?
assert(pitch == 320);