Skip to content

Commit 04604ed

Browse files
committed
ADL: Implement hires6 showRoom() var handling
1 parent bb6cd46 commit 04604ed

File tree

7 files changed

+48
-10
lines changed

7 files changed

+48
-10
lines changed

engines/adl/adl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,6 @@ void AdlEngine::initState() {
386386
initGameState();
387387
}
388388

389-
void AdlEngine::printRoomDescription() {
390-
printString(_roomData.description);
391-
}
392-
393389
byte AdlEngine::roomArg(byte room) const {
394390
return room;
395391
}

engines/adl/adl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ friend class Console;
241241

242242
virtual void setupOpcodeTables();
243243
virtual void initState();
244-
virtual void printRoomDescription();
245244
virtual byte roomArg(byte room) const;
246245
virtual void advanceClock() { }
247246

engines/adl/adl_v2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void AdlEngine_v2::showRoom() {
278278
drawItems();
279279

280280
_display->updateHiResScreen();
281-
printRoomDescription();
281+
printString(_roomData.description);
282282

283283
// FIXME: move to main loop?
284284
_linesPrinted = 0;

engines/adl/adl_v2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class AdlEngine_v2 : public AdlEngine {
5151
void drawItems();
5252
void drawItem(Item &item, const Common::Point &pos);
5353
void loadRoom(byte roomNr);
54-
void showRoom();
54+
virtual void showRoom();
5555
void takeItem(byte noun);
5656

5757
virtual void applyDataBlockOffset(byte &track, byte &sector) const { }

engines/adl/hires1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ void HiRes1Engine::showRoom() {
348348

349349
_display->updateHiResScreen();
350350
_messageDelay = false;
351-
printRoomDescription();
351+
printString(_roomData.description);
352352
_messageDelay = true;
353353
}
354354

engines/adl/hires6.cpp

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,51 @@ void HiRes6Engine::initGameState() {
240240
_currVerb = _currNoun = 0;
241241
}
242242

243-
void HiRes6Engine::printRoomDescription() {
243+
void HiRes6Engine::showRoom() {
244+
bool redrawPic = false;
245+
246+
if (getVar(26) == 0xfe)
247+
setVar(26, 0);
248+
else if (getVar(26) != 0xff)
249+
setVar(26, _state.room);
250+
251+
if (_state.room != _roomOnScreen) {
252+
loadRoom(_state.room);
253+
254+
if (getVar(26) < 0x80 && getCurRoom().isFirstTime)
255+
setVar(26, 0);
256+
257+
clearScreen();
258+
259+
if (!_state.isDark)
260+
redrawPic = true;
261+
} else {
262+
if (getCurRoom().curPicture != _picOnScreen || _itemRemoved)
263+
redrawPic = true;
264+
}
265+
266+
if (redrawPic) {
267+
_roomOnScreen = _state.room;
268+
_picOnScreen = getCurRoom().curPicture;
269+
270+
drawPic(getCurRoom().curPicture);
271+
_itemRemoved = false;
272+
_itemsOnScreen = 0;
273+
274+
Common::List<Item>::iterator item;
275+
for (item = _state.items.begin(); item != _state.items.end(); ++item)
276+
item->isOnScreen = false;
277+
}
278+
279+
if (!_state.isDark)
280+
drawItems();
281+
282+
_display->updateHiResScreen();
244283
setVar(2, 0xff);
245-
AdlEngine_v3::printRoomDescription();
284+
printString(_roomData.description);
285+
286+
// FIXME: move to main loop?
287+
_linesPrinted = 0;
246288
}
247289

248290
void HiRes6Engine::applyDataBlockOffset(byte &track, byte &sector) const {

engines/adl/hires6.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class HiRes6Engine : public AdlEngine_v3 {
5858
void init();
5959
void initGameState();
6060
void printRoomDescription();
61+
void showRoom();
6162

6263
// AdlEngine_v2
6364
void printString(const Common::String &str);

0 commit comments

Comments
 (0)