From 81a522e03ee05716f06cb541511f165d138e104a Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Wed, 10 Aug 2011 17:20:34 +0200 Subject: DREAMWEB: Improvement of 'printslow' signature --- engines/dreamweb/print.cpp | 11 ++++++----- engines/dreamweb/stubs.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp index 5859722633..e1f446a978 100644 --- a/engines/dreamweb/print.cpp +++ b/engines/dreamweb/print.cpp @@ -28,14 +28,14 @@ namespace DreamGen { void DreamGenContext::printboth() { uint16 x = di; - printboth(ds, &x, bx, al, ah); + printboth(ds.ptr(0, 0), &x, bx, al, ah); di = x; } -void DreamGenContext::printboth(uint16 src, uint16 *x, uint16 y, uint8 c, uint8 nextChar) { +void DreamGenContext::printboth(const void* src, uint16 *x, uint16 y, uint8 c, uint8 nextChar) { uint16 newX = *x; uint8 width, height; - printchar(segRef(src).ptr(0, 0), &newX, y, c, nextChar, &width, &height); + printchar(src, &newX, y, c, nextChar, &width, &height); multidump(*x, y, width, height); *x = newX; } @@ -107,6 +107,7 @@ uint8 DreamGenContext::printslow(uint16 x, uint16 y, uint8 maxWidth, bool center data.byte(kPointerframe) = 1; data.byte(kPointermode) = 3; ds = data.word(kCharset1); + const void* src = ds.ptr(0, 0); do { uint16 offset = x; uint16 charCount = getnumber(es.ptr(si, 0), maxWidth, centered, &offset); @@ -119,7 +120,7 @@ uint8 DreamGenContext::printslow(uint16 x, uint16 y, uint8 maxWidth, bool center push(es); push(ds); c0 = engine->modifyChar(c0); - printboth(ds, &offset, y, c0, c1); + printboth(src, &offset, y, c0, c1); ds = pop(); es = pop(); ++si; @@ -134,7 +135,7 @@ uint8 DreamGenContext::printslow(uint16 x, uint16 y, uint8 maxWidth, bool center c1 = engine->modifyChar(c1); data.word(kCharshift) = 91; uint16 offset2 = offset; - printboth(ds, &offset2, y, c1, c2); + printboth(src, &offset2, y, c1, c2); data.word(kCharshift) = 0; es = pop(); ds = pop(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index b0c0370803..840a47384d 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -44,7 +44,7 @@ void getnextword(); uint8 getnextword(const uint8 *string, uint8 *totalWidth, uint8 *charCount); void printboth(); - void printboth(uint16 src, uint16 *x, uint16 y, uint8 c, uint8 nextChar); + void printboth(const void *src, uint16 *x, uint16 y, uint8 c, uint8 nextChar); void printchar(); void printchar(const void *src, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height); void printdirect(); -- cgit v1.2.3