From a0b9f78bd374c1844472c4b8de1b721c2745bc44 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 19 Oct 2006 00:26:55 +0000 Subject: SCUMM: Introduced V12_X_MULTIPLIER and V12_Y_MULTIPLIER to make it a bit easier to find spots where we convert between C64-style coordinates and pixel coordinates (but beware, this probably doesnt't cover all relevant instances) svn-id: r24384 --- engines/scumm/script_v5.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'engines/scumm/script_v5.cpp') diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index b9389f226c..41f963faf3 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1980,9 +1980,12 @@ void ScummEngine_v5::o5_roomOps() { int len = 256, cnt = 0; ptr = (byte *)malloc(len); while (ptr) { - int r = file->read(ptr + cnt, len - cnt); - if ((cnt += r) < len) break; - ptr = (byte *)realloc(ptr, len *= 2); + int r = file->read(ptr + cnt, len - cnt); + cnt += r; + if (cnt < len) + break; + len *= 2; + ptr = (byte *)realloc(ptr, len); } ptr[cnt] = '\0'; loadPtrToResource(rtString, a, ptr); @@ -2615,7 +2618,7 @@ void ScummEngine_v5::o5_walkActorToActor() { return; if (_game.version <= 2) - dist *= 8; + dist *= V12_X_MULTIPLIER; else if (dist == 0xFF) { dist = a->_scalex * a->_width / 0xFF; dist += (a2->_scalex * a2->_width / 0xFF) / 2; -- cgit v1.2.3