DREAMWEB: Move printBoth, printChar, printDirect to DreamBase

This commit is contained in:
Max Horn 2011-12-07 23:45:33 +01:00
parent 460e53172b
commit b07edcb8fe
3 changed files with 17 additions and 11 deletions

View File

@ -57,6 +57,11 @@ public:
// from print.cpp
uint8 getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount);
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 printBoth(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar);
uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered);
uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered);
uint8 getNumber(const Frame *charSet, const uint8 *string, uint16 maxWidth, bool centered, uint16 *offset);
uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width);

View File

@ -24,7 +24,7 @@
namespace DreamGen {
void DreamGenContext::printBoth(const Frame *charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar) {
void DreamBase::printBoth(const Frame *charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar) {
uint16 newX = *x;
uint8 width, height;
printChar(charSet, &newX, y, c, nextChar, &width, &height);
@ -57,7 +57,7 @@ uint8 DreamBase::getNextWord(const Frame *charSet, const uint8 *string, uint8 *t
}
}
void DreamGenContext::printChar(const Frame *charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) {
void DreamBase::printChar(const Frame *charSet, uint16* x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) {
if (c == 255)
return;
@ -75,7 +75,7 @@ void DreamGenContext::printChar(const Frame *charSet, uint16* x, uint16 y, uint8
(*x) += *width;
}
void DreamGenContext::printChar(const Frame *charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) {
void DreamBase::printChar(const Frame *charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height) {
printChar(charSet, &x, y, c, nextChar, width, height);
}
@ -125,16 +125,16 @@ void DreamGenContext::printDirect() {
uint16 initialSi = si;
const uint8 *initialString = es.ptr(si, 0);
const uint8 *string = initialString;
al = printDirect(&string, di, &y, dl, (bool)(dl & 1));
al = DreamBase::printDirect(&string, di, &y, dl, (bool)(dl & 1));
si = initialSi + (string - initialString);
bx = y;
}
uint8 DreamGenContext::printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
uint8 DreamBase::printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
return printDirect(&string, x, &y, maxWidth, centered);
}
uint8 DreamGenContext::printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) {
uint8 DreamBase::printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) {
data.word(kLastxpos) = x;
const Frame *charSet = engine->currentCharset();
while (true) {

View File

@ -67,12 +67,13 @@
void seeCommandTail();
void randomNumber();
void quickQuit2();
void printBoth(const Frame* charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar);
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();
uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered);
uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered);
uint8 printDirect(const uint8** string, uint16 x, uint16 *y, uint8 maxWidth, bool centered) {
return DreamBase::printDirect(string, x, y, maxWidth, centered);
}
uint8 printDirect(const uint8* string, uint16 x, uint16 y, uint8 maxWidth, bool centered) {
return DreamBase::printDirect(string, x, y, maxWidth, centered);
}
void printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth, bool centered);
void printMessage();
void useTimedText();