aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBertrand Augereau2011-07-19 08:57:10 +0200
committerBertrand Augereau2011-07-23 18:23:39 +0200
commit96221b574243fcf6eedf856e1ee3f117ee196a8e (patch)
tree69f798444d760ac3224947bac10b73bd9d21b94d /engines
parentf15661f698f5b6fc359febdda0089cc5a70f9e81 (diff)
downloadscummvm-rg350-96221b574243fcf6eedf856e1ee3f117ee196a8e.tar.gz
scummvm-rg350-96221b574243fcf6eedf856e1ee3f117ee196a8e.tar.bz2
scummvm-rg350-96221b574243fcf6eedf856e1ee3f117ee196a8e.zip
DREAMWEB: Less registers, more params, in the text printing subsystem
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/stubs.cpp16
-rw-r--r--engines/dreamweb/stubs.h2
2 files changed, 10 insertions, 8 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 43930f48fb..c1b5fe11e9 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -239,12 +239,12 @@ void DreamGenContext::setmouse() {
data.word(kOldpointerx) = 0xffff;
}
-uint8 DreamGenContext::getnextword(uint8 *totalWidth, uint8 *charCount) {
+uint8 DreamGenContext::getnextword(const uint8 *string, uint8 *totalWidth, uint8 *charCount) {
*totalWidth = 0;
*charCount = 0;
while(true) {
- uint8 firstChar = es.byte(di);
- ++di;
+ uint8 firstChar = *string;
+ ++string;
++*charCount;
if ((firstChar == ':') || (firstChar == 0)) { //endall
*totalWidth += 6;
@@ -256,7 +256,7 @@ uint8 DreamGenContext::getnextword(uint8 *totalWidth, uint8 *charCount) {
}
firstChar = engine->modifyChar(firstChar);
if (firstChar != 255) {
- uint8 secondChar = es.byte(di);
+ uint8 secondChar = *string;
uint8 width = ds.byte(6*(firstChar - 32 + data.word(kCharshift)));
width = kernchars(firstChar, secondChar, width);
*totalWidth += width;
@@ -266,9 +266,10 @@ uint8 DreamGenContext::getnextword(uint8 *totalWidth, uint8 *charCount) {
void DreamGenContext::getnextword() {
uint8 totalWidth, charCount;
- al = getnextword(&totalWidth, &charCount);
+ al = getnextword(es.ptr(di, 0), &totalWidth, &charCount);
bl = totalWidth;
- bh = charCount;
+ bh = charCount;
+ di += charCount;
}
void DreamGenContext::printchar() {
@@ -345,7 +346,8 @@ uint8 DreamGenContext::getnumber(uint16 maxWidth, bool centered, uint16* offset)
*offset = di;
while (true) {
uint8 wordTotalWidth, wordCharCount;
- uint8 done = getnextword(&wordTotalWidth, &wordCharCount);
+ uint8 done = getnextword(es.ptr(di, 0), &wordTotalWidth, &wordCharCount);
+ di += wordCharCount;
if (done == 1) { //endoftext
ax = totalWidth + wordTotalWidth - 10;
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 89ef9e92d0..ca213b39e4 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -37,7 +37,7 @@
void randomnumber();
void quickquit2();
void getnextword();
- uint8 getnextword(uint8 *totalWidth, uint8 *charCount);
+ uint8 getnextword(const uint8 *string, uint8 *totalWidth, uint8 *charCount);
void printchar();
void printchar(uint16 dst, uint16 src, uint16* x, uint16 y, uint8 c);
void printdirect();