From 08be0411b1bfba715d5c1b50b50a893a27e12f8c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 27 Dec 2011 18:34:23 +0100 Subject: DREAMWEB: Streamline text file handling --- engines/dreamweb/newplace.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'engines/dreamweb/newplace.cpp') diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp index 4d82d7032f..21975eecd5 100644 --- a/engines/dreamweb/newplace.cpp +++ b/engines/dreamweb/newplace.cpp @@ -92,7 +92,8 @@ void DreamBase::selectLocation() { getRidOfTemp(); getRidOfTemp2(); getRidOfTemp3(); - deallocateMem(data.word(kTraveltext)); + + _travelText.clear(); } void DreamBase::showCity() { @@ -120,8 +121,7 @@ void DreamBase::lookAtPlace() { if (_foreignRelease) showFrame(tempGraphics3(), 60, 72+55+21, 4, 0); - uint16 offset = kTextstart + getSegment(data.word(kTraveltext)).word(data.byte(kDestpos) * 2); - const uint8 *string = getSegment(data.word(kTraveltext)).ptr(offset, 0); + const uint8 *string = (const uint8 *)_travelText.getString(data.byte(kDestpos)); findNextColon(&string); uint16 y = (_foreignRelease) ? 84 + 4 : 84; printDirect(&string, 63, &y, 191, 191 & 1); @@ -153,8 +153,7 @@ void DreamBase::locationPic() { if (data.byte(kDestpos) == data.byte(kReallocation)) showFrame(tempGraphics(), 104, 140 + 14, 3, 0); // Currently in this location - uint16 offset = kTextstart + getSegment(data.word(kTraveltext)).word(data.byte(kDestpos) * 2); - const uint8 *string = getSegment(data.word(kTraveltext)).ptr(offset, 0); + const uint8 *string = (const uint8 *)_travelText.getString(data.byte(kDestpos)); DreamBase::printDirect(string, 50, 20, 241, 241 & 1); } -- cgit v1.2.3