diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreambase.h | 6 | ||||
-rw-r--r-- | engines/dreamweb/print.cpp | 21 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 5 |
3 files changed, 9 insertions, 23 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index db3c6d94c3..f2a1e43f2d 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -48,7 +48,11 @@ public: public: -// TODO: Move functions from stubs.h which do not access any Context member variables to here. + 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); + +// TODO: Move more methods from stubs.h to here. }; diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index 3e6e2df488..99386eec66 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -32,7 +32,7 @@ void DreamGenContext::printBoth(const Frame *charSet, uint16 *x, uint16 y, uint8 *x = newX; } -uint8 DreamGenContext::getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount) { +uint8 DreamBase::getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount) { *totalWidth = 0; *charCount = 0; while(true) { @@ -50,22 +50,13 @@ uint8 DreamGenContext::getNextWord(const Frame *charSet, const uint8 *string, ui firstChar = engine->modifyChar(firstChar); if (firstChar != 255) { uint8 secondChar = *string; - uint8 width = charSet[firstChar - 32 + data.word(kCharshift)].width; + uint8 width = charSet[firstChar - 32 + data.word(DreamGenContext::kCharshift)].width; width = kernChars(firstChar, secondChar, width); *totalWidth += width; } } } -void DreamGenContext::printChar() { - uint16 x = di; - uint8 width, height; - printChar((const Frame *)ds.ptr(0, 0), &x, bx, al, ah, &width, &height); - di = x; - cl = width; - ch = height; -} - void DreamGenContext::printChar(const Frame *charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) { if (c == 255) return; @@ -88,10 +79,6 @@ void DreamGenContext::printChar(const Frame *charSet, uint16 x, uint16 y, uint8 printChar(charSet, &x, y, c, nextChar, width, height); } -void DreamGenContext::printSlow() { - al = printSlow(es.ptr(si, 0), di, bx, dl, (bool)(dl & 1)); -} - uint8 DreamGenContext::printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered) { data.byte(kPointerframe) = 1; data.byte(kPointermode) = 3; @@ -171,7 +158,7 @@ uint8 DreamGenContext::printDirect(const uint8** string, uint16 x, uint16 *y, ui } } -uint8 DreamGenContext::getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16* offset) { +uint8 DreamBase::getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16* offset) { uint8 totalWidth = 0; uint8 charCount = 0; while (true) { @@ -210,7 +197,7 @@ uint8 DreamGenContext::getNumber(const Frame *charSet, const uint8 *string, uint } } -uint8 DreamGenContext::kernChars(uint8 firstChar, uint8 secondChar, uint8 width) { +uint8 DreamBase::kernChars(uint8 firstChar, uint8 secondChar, uint8 width) { if ((firstChar == 'a') || (firstChar == 'u')) { if ((secondChar == 'n') || (secondChar == 't') || (secondChar == 'r') || (secondChar == 'i') || (secondChar == 'l')) return width-1; diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 7b5e33e34a..c60adb4294 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -70,9 +70,7 @@ void seeCommandTail(); void randomNumber(); void quickQuit2(); - uint8 getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount); void printBoth(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar); - void printChar(); void printChar(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height); void printChar(const Frame* charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height); void printDirect(); @@ -86,10 +84,7 @@ void getUnderTimed(); void putUnderTimed(); uint8 printSlow(const uint8 *string, uint16 x, uint16 y, uint8 maxWidth, bool centered); - void printSlow(); void dumpTextLine(); - uint8 getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset); - uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width); void oldToNames(); void namesToOld(); void loadPalFromIFF(); |