From 599c0f486262c1d3677c94f0122dab604e324084 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sun, 17 Jul 2011 16:02:47 +0200 Subject: DREAMWEB: Gave a proper signature to gextnextword --- engines/dreamweb/stubs.cpp | 30 ++++++++++++++++-------------- engines/dreamweb/stubs.h | 1 + 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'engines') diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index a2bfd5b96a..646c7e8909 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -217,36 +217,38 @@ void DreamGenContext::setmouse() { data.word(kOldpointerx) = 0xffff; } -void DreamGenContext::getnextword() { - uint8 totalWidth = 0; - bh = 0; +uint8 DreamGenContext::getnextword(uint8 *totalWidth, uint8 *charCount) { + *totalWidth = 0; + *charCount = 0; while(true) { uint8 firstChar = es.byte(di); ++di; - ++bh; + ++*charCount; if ((firstChar == ':') || (firstChar == 0)) { //endall - totalWidth += 6; - bl = totalWidth; - al = 1; - return; + *totalWidth += 6; + return 1; } if (firstChar == 32) { //endword - totalWidth += 6; - bl = totalWidth; - al = 0; - return; + *totalWidth += 6; + return 0; } firstChar = engine->modifyChar(firstChar); if (firstChar != 255) { uint8 secondChar = es.byte(di); uint8 width = ds.byte(6*(firstChar - 32 + data.word(kCharshift))); width = kernchars(firstChar, secondChar, width); - totalWidth += width; - bl = totalWidth; + *totalWidth += width; } } } +void DreamGenContext::getnextword() { + uint8 totalWidth, charCount; + al = getnextword(&totalWidth, &charCount); + bl = totalWidth; + bh = charCount; +} + uint8 DreamGenContext::kernchars(uint8 firstChar, uint8 secondChar, uint8 width) { if ((firstChar == 'a') || (al == 'u')) { if ((secondChar == 'n') || (secondChar == 't') || (secondChar == 'r') || (secondChar == 'i') || (secondChar == 'l')) diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 70c1cfda13..7f82ba5a54 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -15,6 +15,7 @@ void randomnumber(); void quickquit2(); void getnextword(); + uint8 getnextword(uint8 *totalWidth, uint8 *charCount); void kernchars(); uint8 kernchars(uint8 firstChar, uint8 secondChar, uint8 width); Sprite* spritetable(); -- cgit v1.2.3