[Scummvm-git-logs] scummvm master -> 823e7fd1ce50e8a8ed86cb928470a32b8ab8f35a
Strangerke
noreply at scummvm.org
Thu Apr 2 18:11:16 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
823e7fd1ce WAYNESWORLD: Janitorial: Fix indentation (tabs vs spaces/tab+spaces)
Commit: 823e7fd1ce50e8a8ed86cb928470a32b8ab8f35a
https://github.com/scummvm/scummvm/commit/823e7fd1ce50e8a8ed86cb928470a32b8ab8f35a
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2026-04-02T20:10:56+02:00
Commit Message:
WAYNESWORLD: Janitorial: Fix indentation (tabs vs spaces/tab+spaces)
Changed paths:
engines/waynesworld/gamelogic.cpp
engines/waynesworld/gamemap.cpp
engines/waynesworld/graphics.cpp
engines/waynesworld/pathfinding.cpp
engines/waynesworld/waynesworld.cpp
engines/waynesworld/waynesworld.h
diff --git a/engines/waynesworld/gamelogic.cpp b/engines/waynesworld/gamelogic.cpp
index fcee379e93e..6ad597a5389 100644
--- a/engines/waynesworld/gamelogic.cpp
+++ b/engines/waynesworld/gamelogic.cpp
@@ -199,518 +199,518 @@ void GameLogic::initVariables() {
}
int GameLogic::handleVerbPickUp() {
- switch (_vm->_currentRoomNumber) {
- case 0:
- return r0_handleVerbPickUp();
- case 1:
- return r1_handleVerbPickUp();
- case 2:
- return r2_handleVerbPickUp();
- case 3:
- case 23:
- return r3_handleVerbPickUp();
- case 4:
- return r4_handleVerbPickUp();
- case 5:
- return r5_handleVerbPickUp();
- case 6:
- return r6_handleVerbPickUp();
- case 7:
- case 15:
- case 16:
- return r7_handleVerbPickUp();
- case 8:
- case 21:
- case 22:
- return r8_handleVerbPickUp();
- case 9:
- return r9_handleVerbPickUp();
- case 10:
- return r10_handleVerbPickUp();
- case 11:
- return r11_handleVerbPickUp();
- case 12:
- return r12_handleVerbPickUp();
- case 13:
- case 18:
- return r13_handleVerbPickUp();
- case 14:
- case 19:
- case 20:
- return r14_handleVerbPickUp();
- case 30:
- return r30_handleVerbPickUp();
- case 32:
- case 33:
- return r32_handleVerbPickUp();
- case 29:
- return r29_handleVerbPickUp();
- case 34:
- return r34_handleVerbPickUp();
- case 36:
- return r36_handleVerbPickUp();
- case 37:
- return r37_handleVerbPickUp();
+ switch (_vm->_currentRoomNumber) {
+ case 0:
+ return r0_handleVerbPickUp();
+ case 1:
+ return r1_handleVerbPickUp();
+ case 2:
+ return r2_handleVerbPickUp();
+ case 3:
+ case 23:
+ return r3_handleVerbPickUp();
+ case 4:
+ return r4_handleVerbPickUp();
+ case 5:
+ return r5_handleVerbPickUp();
+ case 6:
+ return r6_handleVerbPickUp();
+ case 7:
+ case 15:
+ case 16:
+ return r7_handleVerbPickUp();
+ case 8:
+ case 21:
+ case 22:
+ return r8_handleVerbPickUp();
+ case 9:
+ return r9_handleVerbPickUp();
+ case 10:
+ return r10_handleVerbPickUp();
+ case 11:
+ return r11_handleVerbPickUp();
+ case 12:
+ return r12_handleVerbPickUp();
+ case 13:
+ case 18:
+ return r13_handleVerbPickUp();
+ case 14:
+ case 19:
+ case 20:
+ return r14_handleVerbPickUp();
+ case 30:
+ return r30_handleVerbPickUp();
+ case 32:
+ case 33:
+ return r32_handleVerbPickUp();
+ case 29:
+ return r29_handleVerbPickUp();
+ case 34:
+ return r34_handleVerbPickUp();
+ case 36:
+ return r36_handleVerbPickUp();
+ case 37:
+ return r37_handleVerbPickUp();
default:
break;
- }
+ }
return 0;
}
int GameLogic::handleVerbUse() {
- switch (_vm->_currentRoomNumber) {
- case 0:
- return r0_handleVerbUse();
- case 1:
- return r1_handleVerbUse();
- case 2:
- return r2_handleVerbUse();
- case 3:
- case 23:
- return r3_handleVerbUse();
- case 4:
- return r4_handleVerbUse();
- case 5:
- return r5_handleVerbUse();
- case 6:
- return r6_handleVerbUse();
- case 7:
- case 15:
- case 16:
- return r7_handleVerbUse();
- case 8:
- case 21:
- case 22:
- return r8_handleVerbUse();
- case 10:
- return r10_handleVerbUse();
- case 11:
- return r11_handleVerbUse();
- case 12:
- return r12_handleVerbUse();
- case 9:
- return r9_handleVerbUse();
- case 13:
- case 18:
- return r13_handleVerbUse();
- case 14:
- case 19:
- case 20:
- return r14_handleVerbUse();
- case 24:
- return r24_handleVerbUse();
- case 25:
- case 26:
- case 27:
- return r25_handleVerbUse();
- case 28:
- return r28_handleVerbUse();
- case 29:
- return r29_handleVerbUse();
- case 30:
- return r30_handleVerbUse();
- case 31:
- return r31_handleVerbUse();
- case 32:
- return r32_handleVerbUse();
- case 34:
- return r34_handleVerbUse();
- case 35:
- return r35_handleVerbUse();
- case 36:
- return r36_handleVerbUse();
- case 37:
- return r37_handleVerbUse();
- case 17:
- return r17_handleVerbUse();
- case 38:
- return r38_handleVerbUse();
- case 39:
- return r39_handleVerbUse();
+ switch (_vm->_currentRoomNumber) {
+ case 0:
+ return r0_handleVerbUse();
+ case 1:
+ return r1_handleVerbUse();
+ case 2:
+ return r2_handleVerbUse();
+ case 3:
+ case 23:
+ return r3_handleVerbUse();
+ case 4:
+ return r4_handleVerbUse();
+ case 5:
+ return r5_handleVerbUse();
+ case 6:
+ return r6_handleVerbUse();
+ case 7:
+ case 15:
+ case 16:
+ return r7_handleVerbUse();
+ case 8:
+ case 21:
+ case 22:
+ return r8_handleVerbUse();
+ case 10:
+ return r10_handleVerbUse();
+ case 11:
+ return r11_handleVerbUse();
+ case 12:
+ return r12_handleVerbUse();
+ case 9:
+ return r9_handleVerbUse();
+ case 13:
+ case 18:
+ return r13_handleVerbUse();
+ case 14:
+ case 19:
+ case 20:
+ return r14_handleVerbUse();
+ case 24:
+ return r24_handleVerbUse();
+ case 25:
+ case 26:
+ case 27:
+ return r25_handleVerbUse();
+ case 28:
+ return r28_handleVerbUse();
+ case 29:
+ return r29_handleVerbUse();
+ case 30:
+ return r30_handleVerbUse();
+ case 31:
+ return r31_handleVerbUse();
+ case 32:
+ return r32_handleVerbUse();
+ case 34:
+ return r34_handleVerbUse();
+ case 35:
+ return r35_handleVerbUse();
+ case 36:
+ return r36_handleVerbUse();
+ case 37:
+ return r37_handleVerbUse();
+ case 17:
+ return r17_handleVerbUse();
+ case 38:
+ return r38_handleVerbUse();
+ case 39:
+ return r39_handleVerbUse();
default:
break;
- }
+ }
return 0;
}
void GameLogic::handleVerbTalkTo() {
- switch (_vm->_currentRoomNumber) {
- case 1:
- r1_handleVerbTalkTo();
- break;
- case 2:
- r2_handleVerbTalkTo();
- break;
- case 4:
- r4_handleVerbTalkTo();
- break;
- case 13:
- r13_handleVerbTalkTo();
- break;
- case 9:
- r9_handleVerbTalkTo();
- break;
+ switch (_vm->_currentRoomNumber) {
+ case 1:
+ r1_handleVerbTalkTo();
+ break;
+ case 2:
+ r2_handleVerbTalkTo();
+ break;
+ case 4:
+ r4_handleVerbTalkTo();
+ break;
+ case 13:
+ r13_handleVerbTalkTo();
+ break;
+ case 9:
+ r9_handleVerbTalkTo();
+ break;
case 10:
r10_handleVerbTalkTo();
- break;
- case 19:
- case 20:
- r19_handleVerbTalkTo();
- break;
- case 12:
- r12_handleVerbTalkTo();
- break;
- case 7:
- case 15:
- r7_handleVerbTalkTo();
- break;
- case 3:
- case 23:
- r3_handleVerbTalkTo();
- break;
- case 32:
- r32_handleVerbTalkTo();
- break;
- case 34:
- r34_handleVerbTalkTo();
- break;
- case 35:
- r35_handleVerbTalkTo();
- break;
- case 17:
- r17_handleVerbTalkTo();
- break;
+ break;
+ case 19:
+ case 20:
+ r19_handleVerbTalkTo();
+ break;
+ case 12:
+ r12_handleVerbTalkTo();
+ break;
+ case 7:
+ case 15:
+ r7_handleVerbTalkTo();
+ break;
+ case 3:
+ case 23:
+ r3_handleVerbTalkTo();
+ break;
+ case 32:
+ r32_handleVerbTalkTo();
+ break;
+ case 34:
+ r34_handleVerbTalkTo();
+ break;
+ case 35:
+ r35_handleVerbTalkTo();
+ break;
+ case 17:
+ r17_handleVerbTalkTo();
+ break;
default:
break;
- }
+ }
}
int GameLogic::handleVerbPush() {
- switch (_vm->_currentRoomNumber) {
- case 1:
- return r1_handleVerbPush();
- case 10:
- return r10_handleVerbPush();
- case 9:
- return r9_handleVerbPush();
- case 5:
- return r5_handleVerbPush();
- case 11:
- return r11_handleVerbPush();
- case 7:
- case 15:
- case 16:
- return r7_handleVerbPush();
- case 37:
- return r37_handleVerbPush();
- default:
- break;
- }
+ switch (_vm->_currentRoomNumber) {
+ case 1:
+ return r1_handleVerbPush();
+ case 10:
+ return r10_handleVerbPush();
+ case 9:
+ return r9_handleVerbPush();
+ case 5:
+ return r5_handleVerbPush();
+ case 11:
+ return r11_handleVerbPush();
+ case 7:
+ case 15:
+ case 16:
+ return r7_handleVerbPush();
+ case 37:
+ return r37_handleVerbPush();
+ default:
+ break;
+ }
return 0;
}
int GameLogic::handleVerbPull() {
- switch (_vm->_currentRoomNumber) {
- case 1:
- return r1_handleVerbPull();
- case 6:
- return r6_handleVerbPull();
- case 37:
- return r37_handleVerbPull();
- case 38:
- return r38_handleVerbPull();
- default:
- break;
- }
+ switch (_vm->_currentRoomNumber) {
+ case 1:
+ return r1_handleVerbPull();
+ case 6:
+ return r6_handleVerbPull();
+ case 37:
+ return r37_handleVerbPull();
+ case 38:
+ return r38_handleVerbPull();
+ default:
+ break;
+ }
return 0;
}
int GameLogic::handleVerbOpen() {
- switch (_vm->_currentRoomNumber) {
- case 0:
- return r0_handleVerbOpen();
- case 1:
- return r1_handleVerbOpen();
- case 5:
- return r5_handleVerbOpen();
- case 4:
- return r4_handleVerbOpen();
- case 10:
- return r10_handleVerbOpen();
- case 6:
- return r6_handleVerbOpen();
- case 7:
- case 15:
- case 16:
- return r7_handleVerbOpen();
- case 8:
- case 22:
- return r8_handleVerbOpen();
- case 32:
- return r32_handleVerbOpen();
- case 34:
- return r34_handleVerbOpen();
- case 39:
- return r39_handleVerbOpen();
+ switch (_vm->_currentRoomNumber) {
+ case 0:
+ return r0_handleVerbOpen();
+ case 1:
+ return r1_handleVerbOpen();
+ case 5:
+ return r5_handleVerbOpen();
+ case 4:
+ return r4_handleVerbOpen();
+ case 10:
+ return r10_handleVerbOpen();
+ case 6:
+ return r6_handleVerbOpen();
+ case 7:
+ case 15:
+ case 16:
+ return r7_handleVerbOpen();
+ case 8:
+ case 22:
+ return r8_handleVerbOpen();
+ case 32:
+ return r32_handleVerbOpen();
+ case 34:
+ return r34_handleVerbOpen();
+ case 39:
+ return r39_handleVerbOpen();
default:
break;
- }
+ }
return 0;
}
int GameLogic::handleVerbClose() {
- switch (_vm->_currentRoomNumber) {
- case 1:
- return r1_handleVerbClose();
- case 8:
- case 22:
- return r8_handleVerbClose();
- case 34:
- return r34_handleVerbClose();
+ switch (_vm->_currentRoomNumber) {
+ case 1:
+ return r1_handleVerbClose();
+ case 8:
+ case 22:
+ return r8_handleVerbClose();
+ case 34:
+ return r34_handleVerbClose();
default:
break;
- }
+ }
return 0;
}
void GameLogic::handleVerbExtremeCloseupOf() {
- switch (_vm->_objectNumber) {
- case kObjectIdInventoryPizzathonList:
- displayExtremeCloseupOfPizzathonList();
- break;
- case kObjectIdSign15_1:
- displayExtremeCloseupOfSign15();
- break;
- case kObjectIdInventorySewerMap:
- case kObjectIdMap:
- displayExtremeCloseupOfSewerMap();
- break;
- case kObjectIdPictures22:
- displayExtremeCloseupOfObjectPictures22();
- break;
- case kObjectIdInventoryMemo:
- case kObjectIdMemo:
- displayExtremeCloseupOfMemo();
- break;
- case kObjectIdBillboard7:
- case kObjectIdBillboard14:
- case kObjectIdBillboard19:
- displayExtremeCloseupOfBillboard1();
- break;
- case kObjectIdBillboard_0:
- case kObjectIdBillboard_1:
- case kObjectIdBillboard_2:
- displayExtremeCloseupOfBillboard2();
- break;
- default:
- _vm->displayText("c00", 3, 0, -1, -1, 0);
- break;
- }
+ switch (_vm->_objectNumber) {
+ case kObjectIdInventoryPizzathonList:
+ displayExtremeCloseupOfPizzathonList();
+ break;
+ case kObjectIdSign15_1:
+ displayExtremeCloseupOfSign15();
+ break;
+ case kObjectIdInventorySewerMap:
+ case kObjectIdMap:
+ displayExtremeCloseupOfSewerMap();
+ break;
+ case kObjectIdPictures22:
+ displayExtremeCloseupOfObjectPictures22();
+ break;
+ case kObjectIdInventoryMemo:
+ case kObjectIdMemo:
+ displayExtremeCloseupOfMemo();
+ break;
+ case kObjectIdBillboard7:
+ case kObjectIdBillboard14:
+ case kObjectIdBillboard19:
+ displayExtremeCloseupOfBillboard1();
+ break;
+ case kObjectIdBillboard_0:
+ case kObjectIdBillboard_1:
+ case kObjectIdBillboard_2:
+ displayExtremeCloseupOfBillboard2();
+ break;
+ default:
+ _vm->displayText("c00", 3, 0, -1, -1, 0);
+ break;
+ }
}
int GameLogic::handleVerbGive() {
- switch (_vm->_currentRoomNumber) {
- case 2:
- return r2_handleVerbGive();
- case 6:
- return r6_handleVerbGive();
+ switch (_vm->_currentRoomNumber) {
+ case 2:
+ return r2_handleVerbGive();
+ case 6:
+ return r6_handleVerbGive();
case 9:
return r9_handleVerbGive();
case 10:
- return r10_handleVerbGive();
- case 13:
- return r13_handleVerbGive();
- case 12:
- return r12_handleVerbGive();
+ return r10_handleVerbGive();
+ case 13:
+ return r13_handleVerbGive();
+ case 12:
+ return r12_handleVerbGive();
default:
break;
- }
+ }
return 0;
}
void GameLogic::handleDialogReply(int index, int x, int y) {
- if (index < 537) {
- _vm->displayText("c04r", index, 0, x, y, 0);
- } else {
- _vm->displayText("c04r2", index - 537, 0, x, y, 0);
- }
-
- switch (_vm->_currentRoomNumber) {
- case 2:
- if (index < 300) {
- _vm->playAnimationLoops("btalk", 0, 2, 95, 72, 0, 100, 4);
- } else {
- _vm->playAnimationLoops("wait", 0, 2, 237, 69, 0, 100, 4);
- }
- break;
- case 4:
- _vm->playAnimationLoops("btalk", 1, -2, 146, 45, 0, 100, 4);
- break;
- case 6:
- if (index < 154) {
- _vm->playAnimationLoops("cindi", 4, 2, 143, 55, 0, 100, 4);
- }
- break;
- case 13:
- if (index > 400) {
- _vm->playAnimationLoops("ctalk", 0, 2, 85, 73, 0, 100, 4);
- } else {
- _vm->playAnimationLoops("ptalk", 0, 2, 72, 60, 0, 100, 4);
- }
- break;
- case 9:
- if (index < 192) {
- _vm->playAnimationLoops("talk", 0, 2, 92, 60, 0, 100, 4);
- } else {
- _vm->playAnimationLoops("mtalk", 0, 2, 215, 60, 0, 100, 4);
- }
- break;
- case 10:
- _vm->playAnimationLoops("talk", 0, 8, 153, 30, 1, 100, 4);
- break;
- case 23:
- _vm->playAnimationLoops("talk", 0, 2, 75, 63, 0, 100, 4);
- break;
- case 19:
- _vm->playAnimationLoops("gill", 1, -2, 273, 84, 0, 100, 4);
- break;
- case 20:
- _vm->playAnimationLoops("mtalk", 0, 2, 184, 68, 0, 100, 4);
- break;
- case 12:
- if (index < 236) {
- _vm->playAnimationLoops("lawyer", 6, -2, 55, 84, 0, 100, 4);
- } else if (index < 238) {
- _vm->playAnimationLoops("man1", 0, 2, 108, 83, 0, 100, 4);
- } else if (index < 240) {
- _vm->playAnimationLoops("man3", 0, 2, 168, 84, 0, 100, 4);
- } else if (index < 242) {
- _vm->playAnimationLoops("man4", 0, 2, 190, 84, 0, 100, 4);
- }
- break;
- case 8:
- _vm->playAnimationLoops("mtalk", 0, 2, 195, 69, 0, 100, 4);
- break;
- case 32:
- _vm->playAnimationLoops("jtalk", 0, 2, 262, 84, 0, 100, 4);
- break;
- case 30:
- _vm->playAnimationLoops("ctalk", 0, 2, 183, 107, 0, 100, 4);
- break;
- case 28:
- _vm->playAnimationLoops("reptalk", 0, 6, 26, 51, 1, 100, 4);
- break;
- case 34:
- _vm->playAnimationLoops("talk", 0, 2, 203, 73, 0, 100, 4);
- break;
- case 35:
- _vm->playAnimationLoops("cass", 0, 2, 179, 68, 0, 100, 4);
- break;
- case 17:
+ if (index < 537) {
+ _vm->displayText("c04r", index, 0, x, y, 0);
+ } else {
+ _vm->displayText("c04r2", index - 537, 0, x, y, 0);
+ }
+
+ switch (_vm->_currentRoomNumber) {
+ case 2:
+ if (index < 300) {
+ _vm->playAnimationLoops("btalk", 0, 2, 95, 72, 0, 100, 4);
+ } else {
+ _vm->playAnimationLoops("wait", 0, 2, 237, 69, 0, 100, 4);
+ }
+ break;
+ case 4:
+ _vm->playAnimationLoops("btalk", 1, -2, 146, 45, 0, 100, 4);
+ break;
+ case 6:
+ if (index < 154) {
+ _vm->playAnimationLoops("cindi", 4, 2, 143, 55, 0, 100, 4);
+ }
+ break;
+ case 13:
+ if (index > 400) {
+ _vm->playAnimationLoops("ctalk", 0, 2, 85, 73, 0, 100, 4);
+ } else {
+ _vm->playAnimationLoops("ptalk", 0, 2, 72, 60, 0, 100, 4);
+ }
+ break;
+ case 9:
+ if (index < 192) {
+ _vm->playAnimationLoops("talk", 0, 2, 92, 60, 0, 100, 4);
+ } else {
+ _vm->playAnimationLoops("mtalk", 0, 2, 215, 60, 0, 100, 4);
+ }
+ break;
+ case 10:
+ _vm->playAnimationLoops("talk", 0, 8, 153, 30, 1, 100, 4);
+ break;
+ case 23:
+ _vm->playAnimationLoops("talk", 0, 2, 75, 63, 0, 100, 4);
+ break;
+ case 19:
+ _vm->playAnimationLoops("gill", 1, -2, 273, 84, 0, 100, 4);
+ break;
+ case 20:
+ _vm->playAnimationLoops("mtalk", 0, 2, 184, 68, 0, 100, 4);
+ break;
+ case 12:
+ if (index < 236) {
+ _vm->playAnimationLoops("lawyer", 6, -2, 55, 84, 0, 100, 4);
+ } else if (index < 238) {
+ _vm->playAnimationLoops("man1", 0, 2, 108, 83, 0, 100, 4);
+ } else if (index < 240) {
+ _vm->playAnimationLoops("man3", 0, 2, 168, 84, 0, 100, 4);
+ } else if (index < 242) {
+ _vm->playAnimationLoops("man4", 0, 2, 190, 84, 0, 100, 4);
+ }
+ break;
+ case 8:
+ _vm->playAnimationLoops("mtalk", 0, 2, 195, 69, 0, 100, 4);
+ break;
+ case 32:
+ _vm->playAnimationLoops("jtalk", 0, 2, 262, 84, 0, 100, 4);
+ break;
+ case 30:
+ _vm->playAnimationLoops("ctalk", 0, 2, 183, 107, 0, 100, 4);
+ break;
+ case 28:
+ _vm->playAnimationLoops("reptalk", 0, 6, 26, 51, 1, 100, 4);
+ break;
+ case 34:
+ _vm->playAnimationLoops("talk", 0, 2, 203, 73, 0, 100, 4);
+ break;
+ case 35:
+ _vm->playAnimationLoops("cass", 0, 2, 179, 68, 0, 100, 4);
+ break;
+ case 17:
_vm->playAnimationLoops("g1talk", 0, 2, 54, 81, 0, 100, 4);
- break;
- default:
- // _vm->waitSeconds(2);
- break;
- }
- _vm->waitSeconds(2);
- _vm->_isTextVisible = false;
- _vm->refreshActors();
+ break;
+ default:
+ // _vm->waitSeconds(2);
+ break;
+ }
+ _vm->waitSeconds(2);
+ _vm->_isTextVisible = false;
+ _vm->refreshActors();
}
bool GameLogic::handleDialogSelect(int &replyTextX, int &replyTextY, int &replyTextIndex1, int &replyTextIndex2, int &replyTextIndex3) {
- switch (_vm->_currentRoomNumber) {
- case 0:
- return r0_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 1:
- return r1_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 2:
- return r2_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 4:
- return r4_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 5:
- return r5_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 6:
- return r6_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ switch (_vm->_currentRoomNumber) {
+ case 0:
+ return r0_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 1:
+ return r1_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 2:
+ return r2_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 4:
+ return r4_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 5:
+ return r5_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 6:
+ return r6_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 8:
return r8_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 9:
- return r9_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 10:
- return r10_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 13:
- return r13_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 12:
- return r12_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 15:
- return r15_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ return r9_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 10:
+ return r10_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 13:
+ return r13_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 12:
+ return r12_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 15:
+ return r15_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 17:
return r17_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 19:
case 20:
return r19_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 23:
- return r3_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ return r3_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 28:
return r28_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 30:
- return r30_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 31:
- return r31_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ return r30_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 31:
+ return r31_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 32:
return r32_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
case 34:
- return r34_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- case 35:
- return r35_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ return r34_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
+ case 35:
+ return r35_handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
default:
break;
- }
+ }
return false;
}
void GameLogic::refreshRoomBackground(int roomNum) {
- switch (roomNum) {
- case 0:
- r0_refreshRoomBackground();
- break;
- case 1:
- r1_refreshRoomBackground();
- break;
- case 2:
- r2_refreshRoomBackground();
- break;
- case 3:
- r3_refreshRoomBackground();
- break;
- case 5:
- r5_refreshRoomBackground();
- break;
- case 6:
- r6_refreshRoomBackground();
- break;
- case 4:
- r4_refreshRoomBackground();
- break;
- case 7:
- r7_refreshRoomBackground();
- break;
- case 8:
- r8_refreshRoomBackground();
- break;
+ switch (roomNum) {
+ case 0:
+ r0_refreshRoomBackground();
+ break;
+ case 1:
+ r1_refreshRoomBackground();
+ break;
+ case 2:
+ r2_refreshRoomBackground();
+ break;
+ case 3:
+ r3_refreshRoomBackground();
+ break;
+ case 5:
+ r5_refreshRoomBackground();
+ break;
+ case 6:
+ r6_refreshRoomBackground();
+ break;
+ case 4:
+ r4_refreshRoomBackground();
+ break;
+ case 7:
+ r7_refreshRoomBackground();
+ break;
+ case 8:
+ r8_refreshRoomBackground();
+ break;
case 9:
r9_refreshRoomBackground();
break;
case 10:
- r10_refreshRoomBackground();
- break;
- case 11:
- r11_refreshRoomBackground();
- break;
- case 12:
- r12_refreshRoomBackground();
- break;
+ r10_refreshRoomBackground();
+ break;
+ case 11:
+ r11_refreshRoomBackground();
+ break;
+ case 12:
+ r12_refreshRoomBackground();
+ break;
case 13:
r13_refreshRoomBackground();
break;
@@ -718,8 +718,8 @@ void GameLogic::refreshRoomBackground(int roomNum) {
r14_refreshRoomBackground();
break;
case 16:
- r16_refreshRoomBackground();
- break;
+ r16_refreshRoomBackground();
+ break;
case 17:
r17_refreshRoomBackground();
break;
@@ -727,65 +727,65 @@ void GameLogic::refreshRoomBackground(int roomNum) {
r18_refreshRoomBackground();
break;
case 19:
- r19_refreshRoomBackground();
- break;
- case 20:
- r20_refreshRoomBackground();
- break;
- case 22:
- r22_refreshRoomBackground();
- break;
- case 24:
- r24_refreshRoomBackground();
- break;
- case 25:
- case 26:
- case 27:
- r25_refreshRoomBackground();
- break;
- case 28:
- r28_refreshRoomBackground();
- break;
- case 29:
- r29_refreshRoomBackground();
- break;
- case 30:
- r30_refreshRoomBackground();
- break;
- case 31:
- r31_refreshRoomBackground();
- break;
- case 32:
- r32_refreshRoomBackground();
- break;
- case 33:
- r33_refreshRoomBackground();
- break;
- case 34:
- r34_refreshRoomBackground();
- break;
- case 35:
- r35_refreshRoomBackground();
- break;
- case 36:
- r36_refreshRoomBackground();
- break;
- case 37:
- r37_refreshRoomBackground();
- break;
- case 38:
- r38_refreshRoomBackground();
- break;
- case 39:
- r39_refreshRoomBackground();
- break;
+ r19_refreshRoomBackground();
+ break;
+ case 20:
+ r20_refreshRoomBackground();
+ break;
+ case 22:
+ r22_refreshRoomBackground();
+ break;
+ case 24:
+ r24_refreshRoomBackground();
+ break;
+ case 25:
+ case 26:
+ case 27:
+ r25_refreshRoomBackground();
+ break;
+ case 28:
+ r28_refreshRoomBackground();
+ break;
+ case 29:
+ r29_refreshRoomBackground();
+ break;
+ case 30:
+ r30_refreshRoomBackground();
+ break;
+ case 31:
+ r31_refreshRoomBackground();
+ break;
+ case 32:
+ r32_refreshRoomBackground();
+ break;
+ case 33:
+ r33_refreshRoomBackground();
+ break;
+ case 34:
+ r34_refreshRoomBackground();
+ break;
+ case 35:
+ r35_refreshRoomBackground();
+ break;
+ case 36:
+ r36_refreshRoomBackground();
+ break;
+ case 37:
+ r37_refreshRoomBackground();
+ break;
+ case 38:
+ r38_refreshRoomBackground();
+ break;
+ case 39:
+ r39_refreshRoomBackground();
+ break;
default:
break;
- }
+ }
}
void GameLogic::updateRoomAnimations() {
- switch (_vm->_currentRoomNumber) {
+ switch (_vm->_currentRoomNumber) {
case 1:
r1_updateRoomAnimations();
break;
@@ -831,47 +831,47 @@ void GameLogic::updateRoomAnimations() {
}
void GameLogic::handleRoomEvent(int eventNum) {
- switch (_vm->_currentRoomNumber) {
- case 0:
- switch (eventNum) {
- case 1:
- r0_handleRoomEvent1();
- break;
- case 2:
- r0_handleRoomEvent2();
- break;
- default:
- r0_handleRoomEvent3();
- break;
- }
- break;
- case 1:
- r1_handleRoomEvent(false);
- break;
+ switch (_vm->_currentRoomNumber) {
+ case 0:
+ switch (eventNum) {
+ case 1:
+ r0_handleRoomEvent1();
+ break;
+ case 2:
+ r0_handleRoomEvent2();
+ break;
+ default:
+ r0_handleRoomEvent3();
+ break;
+ }
+ break;
+ case 1:
+ r1_handleRoomEvent(false);
+ break;
case 4:
r4_handleRoomEvent();
break;
case 5:
- r5_handleRoomEvent();
- break;
- case 6:
- switch (eventNum) {
- case 1:
- r6_handleRoomEvent1();
- break;
- case 2:
- r6_handleRoomEvent2();
- break;
- case 3:
- r6_handleRoomEvent3();
- break;
- case 4:
- r6_handleRoomEvent4();
- break;
- default:
+ r5_handleRoomEvent();
+ break;
+ case 6:
+ switch (eventNum) {
+ case 1:
+ r6_handleRoomEvent1();
+ break;
+ case 2:
+ r6_handleRoomEvent2();
+ break;
+ case 3:
+ r6_handleRoomEvent3();
+ break;
+ case 4:
+ r6_handleRoomEvent4();
+ break;
+ default:
break;
- }
- break;
+ }
+ break;
case 8:
switch (eventNum) {
case 1:
@@ -909,11 +909,11 @@ void GameLogic::handleRoomEvent(int eventNum) {
}
break;
case 19:
- r19_handleRoomEvent();
- break;
- case 20:
- r20_handleRoomEvent();
- break;
+ r19_handleRoomEvent();
+ break;
+ case 20:
+ r20_handleRoomEvent();
+ break;
case 24:
if (eventNum == 1) {
r24_handleRoomEvent(92, 72, -43, 90, 38, 0);
@@ -925,61 +925,61 @@ void GameLogic::handleRoomEvent(int eventNum) {
break;
case 28:
if (eventNum == 1)
- r28_handleRoomEvent1();
+ r28_handleRoomEvent1();
else
- r28_handleRoomEvent2();
- break;
- case 29:
- r29_handleRoomEvent();
- break;
- case 30:
- switch (eventNum) {
- case 1:
- r30_handleRoomEvent1();
- break;
- case 2:
- r30_handleRoomEvent2();
- break;
- default:
+ r28_handleRoomEvent2();
+ break;
+ case 29:
+ r29_handleRoomEvent();
+ break;
+ case 30:
+ switch (eventNum) {
+ case 1:
+ r30_handleRoomEvent1();
+ break;
+ case 2:
+ r30_handleRoomEvent2();
+ break;
+ default:
+ break;
+ }
+ break;
+ case 31:
+ switch (eventNum) {
+ case 1:
+ r31_handleRoomEvent1();
+ break;
+ case 2:
+ r31_handleRoomEvent2();
+ break;
+ case 3:
+ r31_handleRoomEvent3();
+ break;
+ case 4:
+ r31_handleRoomEvent4();
+ break;
+ case 5:
+ r31_handleRoomEvent5();
break;
- }
- break;
- case 31:
- switch (eventNum) {
- case 1:
- r31_handleRoomEvent1();
- break;
- case 2:
- r31_handleRoomEvent2();
- break;
- case 3:
- r31_handleRoomEvent3();
- break;
- case 4:
- r31_handleRoomEvent4();
- break;
- case 5:
- r31_handleRoomEvent5();
- break;
default:
break;
- }
- break;
+ }
+ break;
case 32:
r32_handleRoomEvent();
break;
case 35:
- r35_talkToCassandra();
- break;
+ r35_talkToCassandra();
+ break;
case 36:
r36_handleRoomEvent();
break;
case 37:
- r37_climbEnterLadderDown();
- break;
+ r37_climbEnterLadderDown();
+ break;
default:
break;
- }
+ }
}
int GameLogic::getActorScaleFromY(int actorY) {
@@ -1080,162 +1080,162 @@ int GameLogic::getActorScaleFromY(int actorY) {
default:
break;
}
- return CLIP(scale, 20, 100);
+ return CLIP(scale, 20, 100);
}
void GameLogic::setPizzathonStatus(int flagNum) {
- switch (flagNum) {
- case 1:
- _pizzathonListFlags1 |= 0x08;
- break;
- case 2:
- _pizzathonListFlags1 |= 0x40;
- break;
- case 3:
- _pizzathonListFlags1 |= 0x80;
- break;
- case 4:
- _pizzathonListFlags2 |= 0x01;
- break;
- case 5:
- _pizzathonListFlags2 |= 0x02;
- break;
- case 6:
- _pizzathonListFlags1 |= 0x02;
- break;
- case 7:
- _pizzathonListFlags1 |= 0x04;
- break;
- case 8:
- _pizzathonListFlags1 |= 0x10;
- break;
- case 9:
- _pizzathonListFlags1 |= 0x01;
- break;
- case 10:
- _pizzathonListFlags1 |= 0x20;
- break;
+ switch (flagNum) {
+ case 1:
+ _pizzathonListFlags1 |= 0x08;
+ break;
+ case 2:
+ _pizzathonListFlags1 |= 0x40;
+ break;
+ case 3:
+ _pizzathonListFlags1 |= 0x80;
+ break;
+ case 4:
+ _pizzathonListFlags2 |= 0x01;
+ break;
+ case 5:
+ _pizzathonListFlags2 |= 0x02;
+ break;
+ case 6:
+ _pizzathonListFlags1 |= 0x02;
+ break;
+ case 7:
+ _pizzathonListFlags1 |= 0x04;
+ break;
+ case 8:
+ _pizzathonListFlags1 |= 0x10;
+ break;
+ case 9:
+ _pizzathonListFlags1 |= 0x01;
+ break;
+ case 10:
+ _pizzathonListFlags1 |= 0x20;
+ break;
default:
break;
- }
- // _byte_306C8++; Never used but present in savegames
- if ((_pizzathonListFlags1 & 0x08) && (_pizzathonListFlags1 & 0x40) && (_pizzathonListFlags1 & 0x80) &&
- (_pizzathonListFlags2 & 0x01) && (_pizzathonListFlags2 & 0x02) && (_pizzathonListFlags1 & 0x02) &&
- (_pizzathonListFlags1 & 0x04) && (_pizzathonListFlags1 & 0x10) && (_pizzathonListFlags1 & 0x01) &&
- (_pizzathonListFlags1 & 0x20)) {
- _pizzathonListFlags2 |= 0x04;
- }
+ }
+ // _byte_306C8++; Never used but present in savegames
+ if ((_pizzathonListFlags1 & 0x08) && (_pizzathonListFlags1 & 0x40) && (_pizzathonListFlags1 & 0x80) &&
+ (_pizzathonListFlags2 & 0x01) && (_pizzathonListFlags2 & 0x02) && (_pizzathonListFlags1 & 0x02) &&
+ (_pizzathonListFlags1 & 0x04) && (_pizzathonListFlags1 & 0x10) && (_pizzathonListFlags1 & 0x01) &&
+ (_pizzathonListFlags1 & 0x20)) {
+ _pizzathonListFlags2 |= 0x04;
+ }
}
void GameLogic::displayExtremeCloseupOfPizzathonList() {
GxlArchive *lib = _vm->_m05Gxl;
_vm->stopRoomAnimations();
- _vm->_gameState = 5;
- _vm->paletteFadeOut(0, 256, 16);
- // sysMouseDriver(2);
+ _vm->_gameState = 5;
+ _vm->paletteFadeOut(0, 256, 16);
+ // sysMouseDriver(2);
_vm->drawImageToScreen(lib, "list.pcx", 0, 0);
- _vm->playSound("sv14.snd", 1);
- if (_pizzathonListFlags1 & 0x08) {
+ _vm->playSound("sv14.snd", 1);
+ if (_pizzathonListFlags1 & 0x08) {
_vm->drawImageToScreen(lib, "adline.pcx", 72, 22);
- }
- if (_pizzathonListFlags1 & 0x40) {
+ }
+ if (_pizzathonListFlags1 & 0x40) {
_vm->drawImageToScreen(lib, "locline.pcx", 72, 42);
- }
- if (_pizzathonListFlags1 & 0x80) {
+ }
+ if (_pizzathonListFlags1 & 0x80) {
_vm->drawImageToScreen(lib, "volline.pcx", 74, 59);
- }
- if (_pizzathonListFlags2 & 0x01) {
+ }
+ if (_pizzathonListFlags2 & 0x01) {
_vm->drawImageToScreen(lib, "timeline.pcx", 66, 76);
- }
- if (_pizzathonListFlags2 & 0x02) {
+ }
+ if (_pizzathonListFlags2 & 0x02) {
_vm->drawImageToScreen(lib, "totline.pcx", 73, 94);
- }
- if (_pizzathonListFlags1 & 0x02) {
+ }
+ if (_pizzathonListFlags1 & 0x02) {
_vm->drawImageToScreen(lib, "vidline.pcx", 80, 111);
- }
- if (_pizzathonListFlags1 & 0x04) {
+ }
+ if (_pizzathonListFlags1 & 0x04) {
_vm->drawImageToScreen(lib, "ingline.pcx", 72, 129);
- }
- if (_pizzathonListFlags1 & 0x10) {
+ }
+ if (_pizzathonListFlags1 & 0x10) {
_vm->drawImageToScreen(lib, "musline.pcx", 78, 148);
- }
- if (_pizzathonListFlags1 & 0x01) {
+ }
+ if (_pizzathonListFlags1 & 0x01) {
_vm->drawImageToScreen(lib, "magline.pcx", 61, 164);
- }
- if (_pizzathonListFlags1 & 0x20) {
+ }
+ if (_pizzathonListFlags1 & 0x20) {
_vm->drawImageToScreen(lib, "comline.pcx", 68, 180);
- }
- _vm->paletteFadeIn(0, 256, 16);
- // sysMouseDriver(1);
+ }
+ _vm->paletteFadeIn(0, 256, 16);
+ // sysMouseDriver(1);
}
void GameLogic::displayExtremeCloseupOfSign15() {
- _vm->stopRoomAnimations();
- _vm->_gameState = 5;
- // sysMouseDriver(2);
- _vm->paletteFadeOut(0, 256, 16);
- _vm->playSound("sv14.snd", 1);
- _vm->drawRoomImageToScreen("sign.pcx", 0, 0);
- _vm->paletteFadeIn(0, 256, 16);
- // sysMouseDriver(1);
+ _vm->stopRoomAnimations();
+ _vm->_gameState = 5;
+ // sysMouseDriver(2);
+ _vm->paletteFadeOut(0, 256, 16);
+ _vm->playSound("sv14.snd", 1);
+ _vm->drawRoomImageToScreen("sign.pcx", 0, 0);
+ _vm->paletteFadeIn(0, 256, 16);
+ // sysMouseDriver(1);
}
void GameLogic::displayExtremeCloseupOfObjectPictures22() {
- _vm->stopRoomAnimations();
- _vm->_gameState = 5;
- // sysMouseDriver(2);
- _vm->paletteFadeOut(0, 256, 16);
- _vm->playSound("sv14.snd", 1);
+ _vm->stopRoomAnimations();
+ _vm->_gameState = 5;
+ // sysMouseDriver(2);
+ _vm->paletteFadeOut(0, 256, 16);
+ _vm->playSound("sv14.snd", 1);
_vm->drawImageToScreen(_vm->_m05Gxl, "oldmap.pcx", 0, 0);
- _vm->paletteFadeIn(0, 256, 16);
- // sysMouseDriver(1);
+ _vm->paletteFadeIn(0, 256, 16);
+ // sysMouseDriver(1);
}
void GameLogic::displayExtremeCloseupOfMemo() {
_vm->stopRoomAnimations();
- _vm->_gameState = 5;
- // sysMouseDriver(2);
- _vm->paletteFadeOut(0, 256, 16);
- _vm->playSound("sv14.snd", 1);
+ _vm->_gameState = 5;
+ // sysMouseDriver(2);
+ _vm->paletteFadeOut(0, 256, 16);
+ _vm->playSound("sv14.snd", 1);
_vm->drawImageToScreen(_vm->_m05Gxl, "memo.pcx", 0, 0);
- _vm->paletteFadeIn(0, 256, 16);
- // sysMouseDriver(1);
+ _vm->paletteFadeIn(0, 256, 16);
+ // sysMouseDriver(1);
}
void GameLogic::displayExtremeCloseupOfSewerMap() {
_vm->stopRoomAnimations();
- _vm->_gameState = 5;
- // sysMouseDriver(2);
- _vm->paletteFadeOut(0, 256, 16);
- _vm->playSound("sv14.snd", 1);
+ _vm->_gameState = 5;
+ // sysMouseDriver(2);
+ _vm->paletteFadeOut(0, 256, 16);
+ _vm->playSound("sv14.snd", 1);
_vm->drawImageToScreen(_vm->_m05Gxl, "sewermap.pcx", 0, 0);
- _vm->paletteFadeIn(0, 256, 16);
- // sysMouseDriver(1);
+ _vm->paletteFadeIn(0, 256, 16);
+ // sysMouseDriver(1);
}
void GameLogic::displayExtremeCloseupOfBillboard1() {
_vm->stopRoomAnimations();
- _vm->_gameState = 5;
- // sysMouseDriver(2);
- _vm->paletteFadeOut(0, 256, 16);
- _vm->playSound("sv14.snd", 1);
- _vm->_screen->clear(0);
+ _vm->_gameState = 5;
+ // sysMouseDriver(2);
+ _vm->paletteFadeOut(0, 256, 16);
+ _vm->playSound("sv14.snd", 1);
+ _vm->_screen->clear(0);
_vm->drawImageToScreen(_vm->_m05Gxl, "fboard.pcx", 51, 18);
- _vm->paletteFadeIn(0, 256, 16);
- // sysMouseDriver(1);
+ _vm->paletteFadeIn(0, 256, 16);
+ // sysMouseDriver(1);
}
void GameLogic::displayExtremeCloseupOfBillboard2() {
_vm->stopRoomAnimations();
- _vm->_gameState = 5;
- // sysMouseDriver(2);
- _vm->paletteFadeOut(0, 256, 16);
- _vm->playSound("sv14.snd", 1);
- _vm->_screen->clear(0);
+ _vm->_gameState = 5;
+ // sysMouseDriver(2);
+ _vm->paletteFadeOut(0, 256, 16);
+ _vm->playSound("sv14.snd", 1);
+ _vm->_screen->clear(0);
_vm->drawImageToScreen(_vm->_m05Gxl, "pboard.pcx", 51, 18);
- _vm->paletteFadeIn(0, 256, 16);
- // sysMouseDriver(1);
+ _vm->paletteFadeIn(0, 256, 16);
+ // sysMouseDriver(1);
}
int GameLogic::r0_handleVerbPickUp() {
@@ -8014,7 +8014,7 @@ void GameLogic::r37_climbExitLadderUp() {
wclimbSprites[index] = roomLib->loadRoomSurface(tempFilename.c_str());
}
- for (int index = 0; index < 3; index++) {
+ for (int index = 0; index < 3; index++) {
tempFilename = Common::String::format("wgetldr%d", index);
getldrSprites[index] = roomLib->loadRoomSurface(tempFilename.c_str());
}
@@ -8202,7 +8202,7 @@ void GameLogic::r37_climbLadderUp() {
gclimbSprites[index] = roomLib->loadRoomSurface(tempFilename.c_str());
}
- for (int index = 0; index < 3; index++) {
+ for (int index = 0; index < 3; index++) {
tempFilename = Common::String::format("wgetldl%d", index);
wgetldlSprites[index] = roomLib->loadRoomSurface(tempFilename.c_str());
tempFilename = Common::String::format("ggetldl%d", index);
@@ -8626,7 +8626,7 @@ void GameLogic::showEnding() {
GxlArchive *e01Gxl = new GxlArchive("e01");
_vm->paletteFadeOut(0, 256, 64);
- _vm->_screen->clear(0);
+ _vm->_screen->clear(0);
_vm->drawImageToScreen(e01Gxl, "backg.pcx", 0, 0);
_vm->drawImageToScreen(e01Gxl, "tv01.pcx", 180, 74);
_vm->_musicIndex = 1;
diff --git a/engines/waynesworld/gamemap.cpp b/engines/waynesworld/gamemap.cpp
index acec5ec57d6..1e1dbc04e8d 100644
--- a/engines/waynesworld/gamemap.cpp
+++ b/engines/waynesworld/gamemap.cpp
@@ -26,148 +26,148 @@
namespace WaynesWorld {
struct MapItem9 {
- int roomNumber;
- int x0, y0;
- int x1, y1;
+ int roomNumber;
+ int x0, y0;
+ int x1, y1;
};
struct MapItem13 {
- int roomNumber;
- const char *name;
- int animX, animY;
- int tagX, tagY;
+ int roomNumber;
+ const char *name;
+ int animX, animY;
+ int tagX, tagY;
};
struct MapItem17 {
- const char *name;
- int tagX, tagY;
- int roomNumber;
- int wayneX, wayneY;
- int garthX, garthY;
+ const char *name;
+ int tagX, tagY;
+ int roomNumber;
+ int wayneX, wayneY;
+ int garthX, garthY;
};
static const MapItem9 kMapItem9s[] = {
- { 102, 40, 94, 112, 89 },
- { 102, 40, 94, 69, 47 },
- { 102, 40, 94, 157, 66 },
- { 101, 84, 28, 84, 44 },
- { 101, 84, 28, 154, 54 },
- { 101, 84, 28, 85, 72 },
- { 103, 230, 35, 188, 41 },
- { 103, 230, 35, 231, 64 },
- { 104, 224, 80, 223, 70 },
- { 104, 224, 80, 230, 97 },
- { 105, 139, 113, 86, 80 },
- { 105, 139, 113, 126, 118 },
- { 105, 139, 113, 180, 129 },
- { 106, 256, 130, 177, 90 },
- { 106, 256, 130, 265, 98 }
+ { 102, 40, 94, 112, 89 },
+ { 102, 40, 94, 69, 47 },
+ { 102, 40, 94, 157, 66 },
+ { 101, 84, 28, 84, 44 },
+ { 101, 84, 28, 154, 54 },
+ { 101, 84, 28, 85, 72 },
+ { 103, 230, 35, 188, 41 },
+ { 103, 230, 35, 231, 64 },
+ { 104, 224, 80, 223, 70 },
+ { 104, 224, 80, 230, 97 },
+ { 105, 139, 113, 86, 80 },
+ { 105, 139, 113, 126, 118 },
+ { 105, 139, 113, 180, 129 },
+ { 106, 256, 130, 177, 90 },
+ { 106, 256, 130, 265, 98 }
};
static const MapItem13 kMapItem13s[] = {
- { 101, "na", 53, 6, 84, 49 },
- { 102, "wa", 34, 32, 56, 87 },
- { 103, "but", 127, 11, 247, 38 },
- { 104, "stn", 173, 13, 173, 90 },
- { 105, "dt", 70, 69, 125, 135 },
- { 106, "sea", 139, 57, 218, 142 }
+ { 101, "na", 53, 6, 84, 49 },
+ { 102, "wa", 34, 32, 56, 87 },
+ { 103, "but", 127, 11, 247, 38 },
+ { 104, "stn", 173, 13, 173, 90 },
+ { 105, "dt", 70, 69, 125, 135 },
+ { 106, "sea", 139, 57, 218, 142 }
};
static const MapItem17 kMapItem17s[] = {
- { "cab", 61, 18, 3, 58, 108, 44, 102 },
- { "ad", 141, 31, 4, 51, 70, 40, 67 },
- { "cas", 69, 80, 5, 291, 105, 312, 102 },
- { "inv", 49, 52, 1, 23, 111, 15, 102 },
- { "way", 73, 86, 0, 168, 92, 184, 95 },
- { "don", 120, 47, 2, 126, 90, 117, 88 },
- { "cin", 147, 27, 6, 185, 137, 151, 139 },
- { "c35", 208, 72, 7, 157, 122, 180, 122 },
- { "may", 193, 40, 8, 243, 103, 239, 95 },
- { "eug", 241, 82, 9, 250, 96, 263, 93 },
- { "jun", 78, 87, 10, -1, -1, -1, -1 },
- { "cih", 134, 102, 11, 130, 140, 160, 131 },
- { "uno", 142, 137, 12, 289, 114, 294, 110 },
- { "pep", 151, 101, 13, 61, 77, 65, 75 },
- { "gil", 224, 106, 14, 195, 141, 229, 138 }
+ { "cab", 61, 18, 3, 58, 108, 44, 102 },
+ { "ad", 141, 31, 4, 51, 70, 40, 67 },
+ { "cas", 69, 80, 5, 291, 105, 312, 102 },
+ { "inv", 49, 52, 1, 23, 111, 15, 102 },
+ { "way", 73, 86, 0, 168, 92, 184, 95 },
+ { "don", 120, 47, 2, 126, 90, 117, 88 },
+ { "cin", 147, 27, 6, 185, 137, 151, 139 },
+ { "c35", 208, 72, 7, 157, 122, 180, 122 },
+ { "may", 193, 40, 8, 243, 103, 239, 95 },
+ { "eug", 241, 82, 9, 250, 96, 263, 93 },
+ { "jun", 78, 87, 10, -1, -1, -1, -1 },
+ { "cih", 134, 102, 11, 130, 140, 160, 131 },
+ { "uno", 142, 137, 12, 289, 114, 294, 110 },
+ { "pep", 151, 101, 13, 61, 77, 65, 75 },
+ { "gil", 224, 106, 14, 195, 141, 229, 138 }
};
void WaynesWorldEngine::gameMapOpen() {
- _gameMapRoomNumber = _currentRoomNumber;
- _gameMapWayneSpriteX = _wayneSpriteX;
- _gameMapGarthSpriteX = _garthSpriteX;
- unloadStaticRoomObjects();
- _currentRoomNumber = 100;
- _wayneSpriteX = -1;
- _garthSpriteX = -1;
- _currentMapItemIndex = -1;
- _isTextVisible = false;
+ _gameMapRoomNumber = _currentRoomNumber;
+ _gameMapWayneSpriteX = _wayneSpriteX;
+ _gameMapGarthSpriteX = _garthSpriteX;
+ unloadStaticRoomObjects();
+ _currentRoomNumber = 100;
+ _wayneSpriteX = -1;
+ _garthSpriteX = -1;
+ _currentMapItemIndex = -1;
+ _isTextVisible = false;
if (_logic->_r38_flags & 0x08) {
- setWaynePosition(243, 103);
- setGarthPosition(239, 95);
- changeRoom(8);
- return;
- }
+ setWaynePosition(243, 103);
+ setGarthPosition(239, 95);
+ changeRoom(8);
+ return;
+ }
// sysMouseDriver(2);
- paletteFadeOut(0, 256, 16);
+ paletteFadeOut(0, 256, 16);
if ((_logic->_pizzathonListFlags2 & 0x04) && !(_logic->_pizzathonListFlags2 & 0x08)) {
_logic->handlePizzathon();
- _gameState = 0;
- // sysMouseDriver(1);
- drawInterface(_verbNumber);
- paletteFadeIn(0, 256, 4);
- return;
- }
+ _gameState = 0;
+ // sysMouseDriver(1);
+ drawInterface(_verbNumber);
+ paletteFadeIn(0, 256, 4);
+ return;
+ }
- _musicIndex = 2;
- changeMusic();
- _screen->clear(0);
- drawImageToScreen(_m02Gxl, "main_map.pcx", 0, 0);
- _screen->fillSquare(kMapItem9s[_gameMapRoomNumber].x0, kMapItem9s[_gameMapRoomNumber].y0, 3, 109);
- paletteFadeIn(0, 256, 16);
- gameMapPaletteHandlerStart();
- // sysMouseDriver(1);
+ _musicIndex = 2;
+ changeMusic();
+ _screen->clear(0);
+ drawImageToScreen(_m02Gxl, "main_map.pcx", 0, 0);
+ _screen->fillSquare(kMapItem9s[_gameMapRoomNumber].x0, kMapItem9s[_gameMapRoomNumber].y0, 3, 109);
+ paletteFadeIn(0, 256, 16);
+ gameMapPaletteHandlerStart();
+ // sysMouseDriver(1);
}
void WaynesWorldEngine::gameMapFinish() {
- _gameState = 0;
- gameMapPaletteHandlerStop();
- paletteFadeOut(0, 256, 16);
- _musicIndex = 0;
- changeMusic();
- _screen->clear(0);
- drawInterface(_verbNumber);
- changeRoom(_gameMapDestinationRoomNum);
- paletteFadeIn(0, 256, 16);
+ _gameState = 0;
+ gameMapPaletteHandlerStop();
+ paletteFadeOut(0, 256, 16);
+ _musicIndex = 0;
+ changeMusic();
+ _screen->clear(0);
+ drawInterface(_verbNumber);
+ changeRoom(_gameMapDestinationRoomNum);
+ paletteFadeIn(0, 256, 16);
}
void WaynesWorldEngine::gameMapHandleMouseMove(int objectNumber) {
- if (_hoverObjectNumber == objectNumber)
- return;
+ if (_hoverObjectNumber == objectNumber)
+ return;
_hoverObjectNumber = objectNumber;
GxlArchive *lib = _m02Gxl;
- Common::String tagFilename;
- int tagX = -1, tagY = -1;
+ Common::String tagFilename;
+ int tagX = -1, tagY = -1;
- if (_hoverObjectNumber == -1) {
- if (_currentMapItemIndex == 6) {
- gameMapPaletteHandlerStop();
- paletteFadeColor(36, 4, 21, 2, 64);
- gameMapPaletteHandlerStart();
- _currentMapItemIndex = -1;
- } else if (_currentMapItemIndex >= 0 && _currentMapItemIndex <= 5) {
- const MapItem13 &item = kMapItem13s[_currentMapItemIndex];
- tagFilename = Common::String::format("%s_xtag.pcx", item.name);
- tagX = item.tagX;
- tagY = item.tagY;
- } else if (_currentMapItemIndex >= 7 && _currentMapItemIndex <= 21) {
- const MapItem17 &item = kMapItem17s[_currentMapItemIndex - 7];
- tagFilename = Common::String::format("%s_xtag.pcx", item.name);
- tagX = item.tagX;
- tagY = item.tagY;
+ if (_hoverObjectNumber == -1) {
+ if (_currentMapItemIndex == 6) {
+ gameMapPaletteHandlerStop();
+ paletteFadeColor(36, 4, 21, 2, 64);
+ gameMapPaletteHandlerStart();
+ _currentMapItemIndex = -1;
+ } else if (_currentMapItemIndex >= 0 && _currentMapItemIndex <= 5) {
+ const MapItem13 &item = kMapItem13s[_currentMapItemIndex];
+ tagFilename = Common::String::format("%s_xtag.pcx", item.name);
+ tagX = item.tagX;
+ tagY = item.tagY;
+ } else if (_currentMapItemIndex >= 7 && _currentMapItemIndex <= 21) {
+ const MapItem17 &item = kMapItem17s[_currentMapItemIndex - 7];
+ tagFilename = Common::String::format("%s_xtag.pcx", item.name);
+ tagX = item.tagX;
+ tagY = item.tagY;
}
} else if (_hoverObjectNumber >= 0 && _hoverObjectNumber <= 5) {
const MapItem13 &item = kMapItem13s[_hoverObjectNumber];
@@ -193,52 +193,52 @@ void WaynesWorldEngine::gameMapHandleMouseMove(int objectNumber) {
}
void WaynesWorldEngine::gameMapHandleMouseClick() {
- bool isDone = false;
+ bool isDone = false;
- if (_hoverObjectNumber == 6) {
- _gameMapDestinationRoomNum = _gameMapRoomNumber;
- _wayneSpriteX = _gameMapWayneSpriteX;
- _garthSpriteX = _gameMapGarthSpriteX;
- isDone = true;
- } else if (_hoverObjectNumber >= 22 && _hoverObjectNumber <= 27) {
- _gameMapFlag = false;
- _currentRoomNumber = 100;
- drawImageToScreen(_m02Gxl, "main_map.pcx", 0, 0);
- _screen->fillSquare(kMapItem9s[_gameMapRoomNumber].x0, kMapItem9s[_gameMapRoomNumber].y0, 3, 109);
- } else if (_hoverObjectNumber >= 0 && _hoverObjectNumber <= 5) {
- const MapItem13 &item = kMapItem13s[_hoverObjectNumber];
- _currentRoomNumber = item.roomNumber;
- _currentMapItemIndex = -1;
- gameMapSelectItem(item.name, item.animX, item.animY);
- } else if (_hoverObjectNumber >= 7 && _hoverObjectNumber <= 21) {
- const MapItem17 &item = kMapItem17s[_hoverObjectNumber - 7];
- _gameMapDestinationRoomNum = item.roomNumber;
- _wayneSpriteX = item.wayneX;
- _wayneSpriteY = item.wayneY;
- _garthSpriteX = item.garthX;
- _garthSpriteY = item.garthY;
- isDone = true;
- }
+ if (_hoverObjectNumber == 6) {
+ _gameMapDestinationRoomNum = _gameMapRoomNumber;
+ _wayneSpriteX = _gameMapWayneSpriteX;
+ _garthSpriteX = _gameMapGarthSpriteX;
+ isDone = true;
+ } else if (_hoverObjectNumber >= 22 && _hoverObjectNumber <= 27) {
+ _gameMapFlag = false;
+ _currentRoomNumber = 100;
+ drawImageToScreen(_m02Gxl, "main_map.pcx", 0, 0);
+ _screen->fillSquare(kMapItem9s[_gameMapRoomNumber].x0, kMapItem9s[_gameMapRoomNumber].y0, 3, 109);
+ } else if (_hoverObjectNumber >= 0 && _hoverObjectNumber <= 5) {
+ const MapItem13 &item = kMapItem13s[_hoverObjectNumber];
+ _currentRoomNumber = item.roomNumber;
+ _currentMapItemIndex = -1;
+ gameMapSelectItem(item.name, item.animX, item.animY);
+ } else if (_hoverObjectNumber >= 7 && _hoverObjectNumber <= 21) {
+ const MapItem17 &item = kMapItem17s[_hoverObjectNumber - 7];
+ _gameMapDestinationRoomNum = item.roomNumber;
+ _wayneSpriteX = item.wayneX;
+ _wayneSpriteY = item.wayneY;
+ _garthSpriteX = item.garthX;
+ _garthSpriteY = item.garthY;
+ isDone = true;
+ }
- if (isDone) {
- gameMapFinish();
- loadPalette(_m01Gxl, "wstand0.pcx");
- }
+ if (isDone) {
+ gameMapFinish();
+ loadPalette(_m01Gxl, "wstand0.pcx");
+ }
}
void WaynesWorldEngine::gameMapSelectItem(const char *prefix, int animX, int animY) {
- // sysMouseDriver(2);
- for (int frameNum = 0; frameNum < 12; frameNum++) {
- Common::String filename = Common::String::format("%s_zm%d.pcx", prefix, frameNum);
- drawImageToScreen(_m02Gxl, filename.c_str(), animX, animY);
- waitMillis(50);
- }
+ // sysMouseDriver(2);
+ for (int frameNum = 0; frameNum < 12; frameNum++) {
+ Common::String filename = Common::String::format("%s_zm%d.pcx", prefix, frameNum);
+ drawImageToScreen(_m02Gxl, filename.c_str(), animX, animY);
+ waitMillis(50);
+ }
drawImageToScreen(_m02Gxl, "zmbtn.pcx", 125, 188);
- if (kMapItem9s[_gameMapRoomNumber].roomNumber == _currentRoomNumber) {
- _screen->fillSquare(kMapItem9s[_gameMapRoomNumber].x1, kMapItem9s[_gameMapRoomNumber].y1, 3, 109);
- }
- // sysMouseDriver(1);
- _gameMapFlag = true;
+ if (kMapItem9s[_gameMapRoomNumber].roomNumber == _currentRoomNumber) {
+ _screen->fillSquare(kMapItem9s[_gameMapRoomNumber].x1, kMapItem9s[_gameMapRoomNumber].y1, 3, 109);
+ }
+ // sysMouseDriver(1);
+ _gameMapFlag = true;
}
void WaynesWorldEngine::gameMapPaletteHandlerStart() {
diff --git a/engines/waynesworld/graphics.cpp b/engines/waynesworld/graphics.cpp
index 96d6707c7b0..24a1a40d0b9 100644
--- a/engines/waynesworld/graphics.cpp
+++ b/engines/waynesworld/graphics.cpp
@@ -173,16 +173,16 @@ void GFTFont::loadFromFile(const char *filename) {
_charTable[i] = fd.readUint16LE();
fd.seek(charDataOfs);
_fontData = new byte[_formWidth * 8 * _formHeight];
- for (int y = 0; y < _formHeight; y++) {
- int x = 0;
- for (int formPos = 0; formPos < _formWidth; formPos++) {
- const byte charByte = fd.readByte();
- for (int bitNum = 0; bitNum < 8; bitNum++) {
- _fontData[x + y * _formWidth * 8] = ((charByte & (1 << (7 - bitNum))) != 0) ? 1 : 0;
- x++;
- }
- }
- }
+ for (int y = 0; y < _formHeight; y++) {
+ int x = 0;
+ for (int formPos = 0; formPos < _formWidth; formPos++) {
+ const byte charByte = fd.readByte();
+ for (int bitNum = 0; bitNum < 8; bitNum++) {
+ _fontData[x + y * _formWidth * 8] = ((charByte & (1 << (7 - bitNum))) != 0) ? 1 : 0;
+ x++;
+ }
+ }
+ }
}
void GFTFont::drawText(Graphics::Surface *surface, const char *text, int x, int y, byte color) {
@@ -193,35 +193,35 @@ void GFTFont::drawText(Graphics::Surface *surface, const char *text, int x, int
}
void GFTFont::drawWrappedText(Graphics::Surface *surface, const char *text, int x, int y, int maxWidth, byte color) {
- const char *textP = text;
- const char *lineStartP = text, *lastSpaceP = nullptr;
- const int textX = x;
- int lineWidth = 0;
- while (*textP) {
- if (textP > text && textP[-1] == 32)
- lastSpaceP = textP - 1;
- const int charWidth = getCharWidth(*textP);
- if (lineWidth + charWidth > maxWidth) {
+ const char *textP = text;
+ const char *lineStartP = text, *lastSpaceP = nullptr;
+ const int textX = x;
+ int lineWidth = 0;
+ while (*textP) {
+ if (textP > text && textP[-1] == 32)
+ lastSpaceP = textP - 1;
+ const int charWidth = getCharWidth(*textP);
+ if (lineWidth + charWidth > maxWidth) {
const char *lineEndP = lastSpaceP ? lastSpaceP : textP + 1;
for (const char *p = lineStartP; p < lineEndP; p++) {
x += drawChar(surface, (byte)*p, x, y, color);
}
- lineStartP = lastSpaceP + 1;
- textP = lastSpaceP + 1;
- lineWidth = 0;
+ lineStartP = lastSpaceP + 1;
+ textP = lastSpaceP + 1;
+ lineWidth = 0;
x = textX;
- y += _formHeight;
- } else if (textP[1] == 0) {
+ y += _formHeight;
+ } else if (textP[1] == 0) {
const char *lineEndP = textP + 1;
for (const char *p = lineStartP; p < lineEndP; p++) {
x += drawChar(surface, (byte)*p, x, y, color);
}
break;
} else {
- lineWidth += charWidth;
- textP++;
- }
- }
+ lineWidth += charWidth;
+ textP++;
+ }
+ }
}
int GFTFont::drawChar(Graphics::Surface *surface, byte ch, int x, int y, byte color) {
@@ -354,10 +354,10 @@ void Screen::saveScreenshot() {
ScreenEffect::ScreenEffect(WaynesWorldEngine *vm, Graphics::Surface *surface, int x, int y, int grainWidth, int grainHeight)
: _vm(vm), _surface(surface), _x(x), _y(y), _grainWidth(grainWidth), _grainHeight(grainHeight), _blockCtr(0) {
- _blockCountW = _surface->w / _grainWidth + (_surface->w % _grainWidth > 0 ? 1 : 0);
+ _blockCountW = _surface->w / _grainWidth + (_surface->w % _grainWidth > 0 ? 1 : 0);
_blockCountH = _surface->h / _grainHeight + (_surface->h % _grainHeight > 0 ? 1 : 0);
- const int blockCount = _blockCountW * _blockCountH;
- const int duration = blockCount / 5; // Approximate time this effect should take in ms
+ const int blockCount = _blockCountW * _blockCountH;
+ const int duration = blockCount / 5; // Approximate time this effect should take in ms
_timePerSlice = 50; // Time after which the screen should be updated
_blocksPerSlice = blockCount / (duration / _timePerSlice);
}
diff --git a/engines/waynesworld/pathfinding.cpp b/engines/waynesworld/pathfinding.cpp
index f30b7a64102..76cf03f4f95 100644
--- a/engines/waynesworld/pathfinding.cpp
+++ b/engines/waynesworld/pathfinding.cpp
@@ -30,467 +30,467 @@ bool WaynesWorldEngine::walkIsPixelWalkable(int x, int y) {
}
bool WaynesWorldEngine::walkAdjustDestPoint(int &x, int &y) {
- if (walkIsPixelWalkable(x, y))
- return true;
- for (int incr = 1; incr < 200; incr++) {
- for (int xc = 0; xc <= incr; xc++) {
- if (y + incr < 150) {
- if (walkIsPixelWalkable(x + xc, y + incr)) {
- x += xc;
- y += incr;
- return true;
- }
- if (walkIsPixelWalkable(x - xc, y + incr)) {
- x -= xc;
- y += incr;
- return true;
- }
- } else if (y - incr >= 0) {
- if (walkIsPixelWalkable(x + xc, y - incr)) {
- x += xc;
- y -= incr;
- return true;
- }
- if (walkIsPixelWalkable(x - xc, y - incr)) {
- x -= xc;
- y -= incr;
- return true;
- }
- }
- }
- for (int yc = 0; yc <= incr - 1; yc++) {
- if (x + incr < 320) {
- if (walkIsPixelWalkable(x + incr, y + yc)) {
- x += incr;
- y += yc;
- return true;
- }
- if (walkIsPixelWalkable(x + incr, y - yc)) {
- x += incr;
- y -= yc;
- return true;
- }
- } else if (x + incr >= 0) {
- if (walkIsPixelWalkable(x - incr, y + yc)) {
- x -= incr;
- y += yc;
- return true;
- }
- if (walkIsPixelWalkable(x - incr, y - yc)) {
- x -= incr;
- y -= yc;
- return true;
- }
- }
- }
- }
- return false;
+ if (walkIsPixelWalkable(x, y))
+ return true;
+ for (int incr = 1; incr < 200; incr++) {
+ for (int xc = 0; xc <= incr; xc++) {
+ if (y + incr < 150) {
+ if (walkIsPixelWalkable(x + xc, y + incr)) {
+ x += xc;
+ y += incr;
+ return true;
+ }
+ if (walkIsPixelWalkable(x - xc, y + incr)) {
+ x -= xc;
+ y += incr;
+ return true;
+ }
+ } else if (y - incr >= 0) {
+ if (walkIsPixelWalkable(x + xc, y - incr)) {
+ x += xc;
+ y -= incr;
+ return true;
+ }
+ if (walkIsPixelWalkable(x - xc, y - incr)) {
+ x -= xc;
+ y -= incr;
+ return true;
+ }
+ }
+ }
+ for (int yc = 0; yc <= incr - 1; yc++) {
+ if (x + incr < 320) {
+ if (walkIsPixelWalkable(x + incr, y + yc)) {
+ x += incr;
+ y += yc;
+ return true;
+ }
+ if (walkIsPixelWalkable(x + incr, y - yc)) {
+ x += incr;
+ y -= yc;
+ return true;
+ }
+ } else if (x + incr >= 0) {
+ if (walkIsPixelWalkable(x - incr, y + yc)) {
+ x -= incr;
+ y += yc;
+ return true;
+ }
+ if (walkIsPixelWalkable(x - incr, y - yc)) {
+ x -= incr;
+ y -= yc;
+ return true;
+ }
+ }
+ }
+ }
+ return false;
}
void WaynesWorldEngine::walkCalcOtherActorDest(int flag, int &x, int &y) {
- int direction;
- if (flag == 1) {
- direction = walkCalcDirection(x - _garthSpriteX, y - _garthSpriteY);
- } else {
- direction = walkCalcDirection(x - _wayneSpriteX, y - _wayneSpriteY);
- }
-
- const int actorScale = getActorScaleFromY(y);
- const int actorDistance = (actorScale * 20) / 100;
- switch (direction) {
- case 0:
- y += actorDistance;
- // fallthrough
- case 1:
- x += actorDistance;
- break;
-
- case 2:
- x += actorDistance;
- // fallthrough
- case 3:
- y -= actorDistance;
- break;
-
- case 4:
- y -= actorDistance;
- // fallthrough
- case 5:
- x -= actorDistance;
- break;
-
- case 6:
- x -= actorDistance;
- // fallthrough
- case 7:
- y += actorDistance;
- break;
-
- default:
- break;
- }
- walkAdjustDestPoint(x, y);
+ int direction;
+ if (flag == 1) {
+ direction = walkCalcDirection(x - _garthSpriteX, y - _garthSpriteY);
+ } else {
+ direction = walkCalcDirection(x - _wayneSpriteX, y - _wayneSpriteY);
+ }
+
+ const int actorScale = getActorScaleFromY(y);
+ const int actorDistance = (actorScale * 20) / 100;
+ switch (direction) {
+ case 0:
+ y += actorDistance;
+ // fallthrough
+ case 1:
+ x += actorDistance;
+ break;
+
+ case 2:
+ x += actorDistance;
+ // fallthrough
+ case 3:
+ y -= actorDistance;
+ break;
+
+ case 4:
+ y -= actorDistance;
+ // fallthrough
+ case 5:
+ x -= actorDistance;
+ break;
+
+ case 6:
+ x -= actorDistance;
+ // fallthrough
+ case 7:
+ y += actorDistance;
+ break;
+
+ default:
+ break;
+ }
+ walkAdjustDestPoint(x, y);
}
int WaynesWorldEngine::walkCalcPath(int flag, int sourceX, int sourceY, int destX, int destY, int pointsCount) {
- if (pointsCount >= 300)
- return 299;
+ if (pointsCount >= 300)
+ return 299;
- if (walkIsLineWalkable(sourceX, sourceY, destX, destY))
- return walkAddWalkLine(flag, sourceX, sourceY, destX, destY, pointsCount);
+ if (walkIsLineWalkable(sourceX, sourceY, destX, destY))
+ return walkAddWalkLine(flag, sourceX, sourceY, destX, destY, pointsCount);
- int nextSourceX, nextSourceY;
+ int nextSourceX, nextSourceY;
- walkGetNextPoint(sourceX, sourceY, destX, destY, nextSourceX, nextSourceY);
+ walkGetNextPoint(sourceX, sourceY, destX, destY, nextSourceX, nextSourceY);
- bool walkable = walkFindPoint(flag, sourceX, sourceY, nextSourceX, nextSourceY, destX, destY, pointsCount);
- while (!walkable) {
- walkGetNextPoint(sourceX, sourceY, nextSourceX, nextSourceY, nextSourceX, nextSourceY);
- if (ABS(sourceX - nextSourceX) < 3 && ABS(sourceY - nextSourceY) < 3) {
- return pointsCount;
- }
- walkable = walkFindPoint(flag, sourceX, sourceY, nextSourceX, nextSourceY, destX, destY, pointsCount);
- }
+ bool walkable = walkFindPoint(flag, sourceX, sourceY, nextSourceX, nextSourceY, destX, destY, pointsCount);
+ while (!walkable) {
+ walkGetNextPoint(sourceX, sourceY, nextSourceX, nextSourceY, nextSourceX, nextSourceY);
+ if (ABS(sourceX - nextSourceX) < 3 && ABS(sourceY - nextSourceY) < 3) {
+ return pointsCount;
+ }
+ walkable = walkFindPoint(flag, sourceX, sourceY, nextSourceX, nextSourceY, destX, destY, pointsCount);
+ }
- pointsCount = walkAddWalkLine(flag, sourceX, sourceY, nextSourceX, nextSourceY, pointsCount);
+ pointsCount = walkAddWalkLine(flag, sourceX, sourceY, nextSourceX, nextSourceY, pointsCount);
- sourceX = nextSourceX;
- sourceY = nextSourceY;
- pointsCount = walkCalcPath(flag, sourceX, sourceY, destX, destY, pointsCount);
+ sourceX = nextSourceX;
+ sourceY = nextSourceY;
+ pointsCount = walkCalcPath(flag, sourceX, sourceY, destX, destY, pointsCount);
- return pointsCount;
+ return pointsCount;
}
bool WaynesWorldEngine::walkFindPoint(int flag, int &sourceX, int &sourceY, int &nextSourceX, int &nextSourceY, int destX, int destY, int pointsCount) {
- bool walkable = false;
-
- if (walkIsLineWalkable(sourceX, sourceY, nextSourceX, nextSourceY))
- return true;
-
- float slopeX;
-
- if (sourceX == nextSourceX) {
- slopeX = 0.0f;
- } else if (sourceY == nextSourceY) {
- slopeX = 100.0f;
- } else {
- slopeX = -(float(sourceX - nextSourceX) / float(sourceY - nextSourceY));
- }
-
- int scan1X = sourceX, scan1Y = sourceY;
- int scan2X = nextSourceX, scan2Y = nextSourceY;
- bool scan1Done = false;
- int scan1Incr = 0;
-
- while (!walkable && !scan1Done) {
- scan1Done = true;
- int scan1Sign = -1;
- while (scan1Sign < 2 && !walkable) {
- if (ABS(slopeX) >= 1.0f) {
- const float slopeY = 1.0f / slopeX;
- scan1Y = sourceY + scan1Incr * scan1Sign;
- scan1X = sourceX + (scan1Y - sourceY) * slopeY;
- } else {
- scan1X = sourceX + scan1Incr * scan1Sign;
- scan1Y = sourceY + (scan1X - sourceX) * slopeX;
- }
- if (scan1X >= 0 && scan1X < 320 && scan1Y >= 0 && scan1Y < 150) {
- scan1Done = false;
- bool scan2Done = false;
- int scan2Incr = 0;
- while (!walkable && !scan2Done) {
- scan2Done = true;
- int scan2Sign = -1;
- while (scan2Sign < 2 && !walkable) {
- if (ABS(slopeX) >= 1.0f) {
- float slopeY = 1.0f / slopeX;
- scan2Y = nextSourceY + scan2Incr * scan2Sign;
- scan2X = nextSourceX + (scan2Y - nextSourceY) * slopeY;
- } else {
- scan2X = nextSourceX + scan2Incr * scan2Sign;
- scan2Y = nextSourceY + (scan2X - nextSourceX) * slopeX;
- }
- if (scan2X >= 0 && scan2X < 320 && scan2Y >= 0 && scan2Y < 150) {
- scan2Done = false;
- walkable = walkIsLineWalkable(scan1X, scan1Y, scan2X, scan2Y) && walkTestPoint(scan1X, scan1Y, scan2X, scan2Y, destX, destY);
- }
- scan2Sign += 2;
- }
- scan2Incr += 4;
- }
- }
- scan1Sign += 2;
- }
- scan1Incr += 4;
- }
-
- if (scan1Done)
- return false;
-
- if (sourceX != scan1X || sourceY != scan1Y) {
- if (!walkTestPoint(sourceX, sourceY, scan1X, scan1Y, destX, destY)) {
- return false;
+ bool walkable = false;
+
+ if (walkIsLineWalkable(sourceX, sourceY, nextSourceX, nextSourceY))
+ return true;
+
+ float slopeX;
+
+ if (sourceX == nextSourceX) {
+ slopeX = 0.0f;
+ } else if (sourceY == nextSourceY) {
+ slopeX = 100.0f;
+ } else {
+ slopeX = -(float(sourceX - nextSourceX) / float(sourceY - nextSourceY));
+ }
+
+ int scan1X = sourceX, scan1Y = sourceY;
+ int scan2X = nextSourceX, scan2Y = nextSourceY;
+ bool scan1Done = false;
+ int scan1Incr = 0;
+
+ while (!walkable && !scan1Done) {
+ scan1Done = true;
+ int scan1Sign = -1;
+ while (scan1Sign < 2 && !walkable) {
+ if (ABS(slopeX) >= 1.0f) {
+ const float slopeY = 1.0f / slopeX;
+ scan1Y = sourceY + scan1Incr * scan1Sign;
+ scan1X = sourceX + (scan1Y - sourceY) * slopeY;
+ } else {
+ scan1X = sourceX + scan1Incr * scan1Sign;
+ scan1Y = sourceY + (scan1X - sourceX) * slopeX;
+ }
+ if (scan1X >= 0 && scan1X < 320 && scan1Y >= 0 && scan1Y < 150) {
+ scan1Done = false;
+ bool scan2Done = false;
+ int scan2Incr = 0;
+ while (!walkable && !scan2Done) {
+ scan2Done = true;
+ int scan2Sign = -1;
+ while (scan2Sign < 2 && !walkable) {
+ if (ABS(slopeX) >= 1.0f) {
+ float slopeY = 1.0f / slopeX;
+ scan2Y = nextSourceY + scan2Incr * scan2Sign;
+ scan2X = nextSourceX + (scan2Y - nextSourceY) * slopeY;
+ } else {
+ scan2X = nextSourceX + scan2Incr * scan2Sign;
+ scan2Y = nextSourceY + (scan2X - nextSourceX) * slopeX;
+ }
+ if (scan2X >= 0 && scan2X < 320 && scan2Y >= 0 && scan2Y < 150) {
+ scan2Done = false;
+ walkable = walkIsLineWalkable(scan1X, scan1Y, scan2X, scan2Y) && walkTestPoint(scan1X, scan1Y, scan2X, scan2Y, destX, destY);
+ }
+ scan2Sign += 2;
+ }
+ scan2Incr += 4;
+ }
+ }
+ scan1Sign += 2;
+ }
+ scan1Incr += 4;
+ }
+
+ if (scan1Done)
+ return false;
+
+ if (sourceX != scan1X || sourceY != scan1Y) {
+ if (!walkTestPoint(sourceX, sourceY, scan1X, scan1Y, destX, destY)) {
+ return false;
}
- pointsCount = walkAddWalkLine(flag, sourceX, sourceY, scan1X, scan1Y, pointsCount);
- sourceX = scan1X;
- sourceY = scan1Y;
- }
+ pointsCount = walkAddWalkLine(flag, sourceX, sourceY, scan1X, scan1Y, pointsCount);
+ sourceX = scan1X;
+ sourceY = scan1Y;
+ }
- nextSourceX = scan2X;
- nextSourceY = scan2Y;
+ nextSourceX = scan2X;
+ nextSourceY = scan2Y;
- return true;
+ return true;
}
bool WaynesWorldEngine::walkTestPoint(int sourceX, int sourceY, int nextSourceX, int nextSourceY, int destX, int destY) {
- return ABS(destY - nextSourceY) < ABS(destY - sourceY) || ABS(destX - nextSourceX) < ABS(destX - sourceX);
+ return ABS(destY - nextSourceY) < ABS(destY - sourceY) || ABS(destX - nextSourceX) < ABS(destX - sourceX);
}
bool WaynesWorldEngine::walkIsLineWalkable(int sourceX, int sourceY, int destX, int destY) {
- bool walkable = true;
- if (sourceX == destX) {
- const int incr = sourceY > destY ? -4 : 4;
- for (int yc = sourceY; yc * incr < destY * incr && walkable; yc += incr) {
- if (!walkIsPixelWalkable(sourceX, yc)) {
- walkable = false;
- }
- }
- } else if (ABS(sourceY - destY) >= ABS(sourceX - destX)) {
- const float slopeY = float(sourceX - destX) / float(sourceY - destY);
- const int incr = sourceY > destY ? -4 : 4;
- for (int yc = sourceY; yc * incr < destY * incr && walkable; yc += incr) {
- if (!walkIsPixelWalkable(sourceX + (yc - sourceY) * slopeY, yc)) {
- walkable = false;
- }
- }
- } else {
- const float slopeX = float(sourceY - destY) / float(sourceX - destX);
- const int incr = sourceX > destX ? -4 : 4;
- for (int xc = sourceX; xc * incr < destX * incr && walkable; xc += incr) {
- if (!walkIsPixelWalkable(xc, sourceY + (xc - sourceX) * slopeX)) {
- walkable = false;
- }
- }
- }
- if (!walkIsPixelWalkable(destX, destY)) {
- walkable = false;
- }
- return walkable;
+ bool walkable = true;
+ if (sourceX == destX) {
+ const int incr = sourceY > destY ? -4 : 4;
+ for (int yc = sourceY; yc * incr < destY * incr && walkable; yc += incr) {
+ if (!walkIsPixelWalkable(sourceX, yc)) {
+ walkable = false;
+ }
+ }
+ } else if (ABS(sourceY - destY) >= ABS(sourceX - destX)) {
+ const float slopeY = float(sourceX - destX) / float(sourceY - destY);
+ const int incr = sourceY > destY ? -4 : 4;
+ for (int yc = sourceY; yc * incr < destY * incr && walkable; yc += incr) {
+ if (!walkIsPixelWalkable(sourceX + (yc - sourceY) * slopeY, yc)) {
+ walkable = false;
+ }
+ }
+ } else {
+ const float slopeX = float(sourceY - destY) / float(sourceX - destX);
+ const int incr = sourceX > destX ? -4 : 4;
+ for (int xc = sourceX; xc * incr < destX * incr && walkable; xc += incr) {
+ if (!walkIsPixelWalkable(xc, sourceY + (xc - sourceX) * slopeX)) {
+ walkable = false;
+ }
+ }
+ }
+ if (!walkIsPixelWalkable(destX, destY)) {
+ walkable = false;
+ }
+ return walkable;
}
void WaynesWorldEngine::walkGetNextPoint(int sourceX, int sourceY, int destX, int destY, int &nextX, int &nextY) {
- nextX = (sourceX + destX) / 2;
- nextY = (sourceY + destY) / 2;
+ nextX = (sourceX + destX) / 2;
+ nextY = (sourceY + destY) / 2;
}
int WaynesWorldEngine::walkCalcDirection(int deltaX, int deltaY) {
- int direction = 0;
- if (deltaY < 0) {
- if (deltaX < 0) {
- if (deltaX * 2 > deltaY) {
- direction = 0;
- } else if (deltaY * 2 > deltaX) {
- direction = 2;
- } else {
- direction = 1;
- }
- } else {
- if (deltaX * -2 > deltaY) {
- direction = 0;
- } else if (deltaY * -2 < deltaX) {
- direction = 6;
- } else {
- direction = 7;
- }
- }
- } else {
- if (deltaX < 0) {
- if (deltaX * -2 < deltaY) {
- direction = 4;
- } else if (deltaY * -2 > deltaX) {
- direction = 2;
- } else {
- direction = 3;
- }
- } else {
- if (deltaX * 2 < deltaY) {
- direction = 4;
- } else if (deltaY * 2 < deltaX) {
- direction = 6;
- } else {
- direction = 5;
- }
- }
- }
- return direction;
+ int direction = 0;
+ if (deltaY < 0) {
+ if (deltaX < 0) {
+ if (deltaX * 2 > deltaY) {
+ direction = 0;
+ } else if (deltaY * 2 > deltaX) {
+ direction = 2;
+ } else {
+ direction = 1;
+ }
+ } else {
+ if (deltaX * -2 > deltaY) {
+ direction = 0;
+ } else if (deltaY * -2 < deltaX) {
+ direction = 6;
+ } else {
+ direction = 7;
+ }
+ }
+ } else {
+ if (deltaX < 0) {
+ if (deltaX * -2 < deltaY) {
+ direction = 4;
+ } else if (deltaY * -2 > deltaX) {
+ direction = 2;
+ } else {
+ direction = 3;
+ }
+ } else {
+ if (deltaX * 2 < deltaY) {
+ direction = 4;
+ } else if (deltaY * 2 < deltaX) {
+ direction = 6;
+ } else {
+ direction = 5;
+ }
+ }
+ }
+ return direction;
}
int WaynesWorldEngine::walkAddWalkLine(int flag, int x1, int y1, int x2, int y2, int pointsCount) {
- WalkPoint *walkPoints = flag == 0 ? _wayneWalkPoints : _garthWalkPoints;
- const int newDirection = walkCalcDirection(x1 - x2, y1 - y2);
+ WalkPoint *walkPoints = flag == 0 ? _wayneWalkPoints : _garthWalkPoints;
+ const int newDirection = walkCalcDirection(x1 - x2, y1 - y2);
// debug("walkAddWalkLine() %d, %d, %d, %d", x1, y1, x2, y2);
- if (pointsCount == 0 || walkPoints[pointsCount - 1].x != x1 || walkPoints[pointsCount - 1].y != y1) {
- walkPoints[pointsCount].x = x1;
- walkPoints[pointsCount].y = y1;
- walkPoints[pointsCount].direction = newDirection;
- pointsCount++;
- }
-
- if (x1 == x2) {
- const int incr = y1 > y2 ? -4 : 4;
- for (int yc = y1; yc * incr < y2 * incr; yc += incr) {
- walkPoints[pointsCount].x = x1;
- walkPoints[pointsCount].y = yc;
- walkPoints[pointsCount].direction = newDirection;
- pointsCount++;
- }
- } else if (ABS(y1 - y2) >= ABS(x1 - x2)) {
- const float slopeY = float(x1 - x2) / float(y1 - y2);
- const int incr = y1 > y2 ? -4 : 4;
- for (int yc = y1; yc * incr < y2 * incr; yc += incr) {
- walkPoints[pointsCount].x = x1 + (yc - y1) * slopeY;
- walkPoints[pointsCount].y = yc;
- walkPoints[pointsCount].direction = newDirection;
- pointsCount++;
- }
- } else {
- const float slopeX = float(y1 - y2) / float(x1 - x2);
- const int incr = x1 > x2 ? -4 : 4;
- for (int xc = x1; xc * incr < x2 * incr; xc += incr) {
- walkPoints[pointsCount].x = xc;
- walkPoints[pointsCount].y = y1 + (xc - x1) * slopeX;
- walkPoints[pointsCount].direction = newDirection;
- pointsCount++;
- }
- }
-
- walkPoints[pointsCount].x = x2;
- walkPoints[pointsCount].y = y2;
- walkPoints[pointsCount].direction = newDirection;
- pointsCount++;
-
- return pointsCount;
+ if (pointsCount == 0 || walkPoints[pointsCount - 1].x != x1 || walkPoints[pointsCount - 1].y != y1) {
+ walkPoints[pointsCount].x = x1;
+ walkPoints[pointsCount].y = y1;
+ walkPoints[pointsCount].direction = newDirection;
+ pointsCount++;
+ }
+
+ if (x1 == x2) {
+ const int incr = y1 > y2 ? -4 : 4;
+ for (int yc = y1; yc * incr < y2 * incr; yc += incr) {
+ walkPoints[pointsCount].x = x1;
+ walkPoints[pointsCount].y = yc;
+ walkPoints[pointsCount].direction = newDirection;
+ pointsCount++;
+ }
+ } else if (ABS(y1 - y2) >= ABS(x1 - x2)) {
+ const float slopeY = float(x1 - x2) / float(y1 - y2);
+ const int incr = y1 > y2 ? -4 : 4;
+ for (int yc = y1; yc * incr < y2 * incr; yc += incr) {
+ walkPoints[pointsCount].x = x1 + (yc - y1) * slopeY;
+ walkPoints[pointsCount].y = yc;
+ walkPoints[pointsCount].direction = newDirection;
+ pointsCount++;
+ }
+ } else {
+ const float slopeX = float(y1 - y2) / float(x1 - x2);
+ const int incr = x1 > x2 ? -4 : 4;
+ for (int xc = x1; xc * incr < x2 * incr; xc += incr) {
+ walkPoints[pointsCount].x = xc;
+ walkPoints[pointsCount].y = y1 + (xc - x1) * slopeX;
+ walkPoints[pointsCount].direction = newDirection;
+ pointsCount++;
+ }
+ }
+
+ walkPoints[pointsCount].x = x2;
+ walkPoints[pointsCount].y = y2;
+ walkPoints[pointsCount].direction = newDirection;
+ pointsCount++;
+
+ return pointsCount;
}
bool WaynesWorldEngine::walkTo(int actor1_destX, int actor1_destY, int direction, int actor2_destX, int actor2_destY) {
- WalkPoint *actor1Points, *actor2Points;
- int flag1, flag2;
- int actor1X, actor1Y, actor2X, actor2Y;
- int actor2WalkDestX, actor2WalkDestY;
-
- _isTextVisible = false;
-
- if (isActorWayne()) {
- actor1Points = _wayneWalkPoints;
- actor2Points = _garthWalkPoints;
- flag1 = 0;
- flag2 = 1;
- actor1X = _wayneSpriteX;
- actor1Y = _wayneSpriteY;
- actor2X = _garthSpriteX;
- actor2Y = _garthSpriteY;
- } else {
- actor1Points = _garthWalkPoints;
- actor2Points = _wayneWalkPoints;
- flag1 = 1;
- flag2 = 0;
- actor1X = _garthSpriteX;
- actor1Y = _garthSpriteY;
- actor2X = _wayneSpriteX;
- actor2Y = _wayneSpriteY;
- }
-
- if (!walkAdjustDestPoint(actor1_destX, actor1_destY))
- return false;
-
- if ((actor1X == actor1_destX && actor1Y == actor1_destY) || actor1X == -1) {
- refreshActors();
- return true;
- }
-
- if (actor2X == -1) {
- // Other actor is not visible
- actor2WalkDestX = actor2X;
- actor2WalkDestY = actor2Y;
- } else if (actor2_destX == -1) {
- // Other actor follows first actor
- actor2WalkDestX = actor1_destX;
- actor2WalkDestY = actor1_destY;
- walkCalcOtherActorDest(flag2, actor2WalkDestX, actor2WalkDestY);
- } else {
- // Other actor has coordinates specified
- actor2WalkDestX = actor2_destX;
- actor2WalkDestY = actor2_destY;
- walkAdjustDestPoint(actor2WalkDestX, actor2WalkDestY);
- }
-
- const int actor1PointsCount = walkCalcPath(flag1, actor1X, actor1Y, actor1_destX, actor1_destY, 0);
+ WalkPoint *actor1Points, *actor2Points;
+ int flag1, flag2;
+ int actor1X, actor1Y, actor2X, actor2Y;
+ int actor2WalkDestX, actor2WalkDestY;
+
+ _isTextVisible = false;
+
+ if (isActorWayne()) {
+ actor1Points = _wayneWalkPoints;
+ actor2Points = _garthWalkPoints;
+ flag1 = 0;
+ flag2 = 1;
+ actor1X = _wayneSpriteX;
+ actor1Y = _wayneSpriteY;
+ actor2X = _garthSpriteX;
+ actor2Y = _garthSpriteY;
+ } else {
+ actor1Points = _garthWalkPoints;
+ actor2Points = _wayneWalkPoints;
+ flag1 = 1;
+ flag2 = 0;
+ actor1X = _garthSpriteX;
+ actor1Y = _garthSpriteY;
+ actor2X = _wayneSpriteX;
+ actor2Y = _wayneSpriteY;
+ }
+
+ if (!walkAdjustDestPoint(actor1_destX, actor1_destY))
+ return false;
+
+ if ((actor1X == actor1_destX && actor1Y == actor1_destY) || actor1X == -1) {
+ refreshActors();
+ return true;
+ }
+
+ if (actor2X == -1) {
+ // Other actor is not visible
+ actor2WalkDestX = actor2X;
+ actor2WalkDestY = actor2Y;
+ } else if (actor2_destX == -1) {
+ // Other actor follows first actor
+ actor2WalkDestX = actor1_destX;
+ actor2WalkDestY = actor1_destY;
+ walkCalcOtherActorDest(flag2, actor2WalkDestX, actor2WalkDestY);
+ } else {
+ // Other actor has coordinates specified
+ actor2WalkDestX = actor2_destX;
+ actor2WalkDestY = actor2_destY;
+ walkAdjustDestPoint(actor2WalkDestX, actor2WalkDestY);
+ }
+
+ const int actor1PointsCount = walkCalcPath(flag1, actor1X, actor1Y, actor1_destX, actor1_destY, 0);
int actor2PointsCount = 0;
- if (actor2X != actor2WalkDestX || actor2Y != actor2WalkDestY) {
- actor2PointsCount = walkCalcPath(flag2, actor2X, actor2Y, actor2WalkDestX, actor2WalkDestY, 0);
- }
-
- if (actor1PointsCount + 20 < actor2PointsCount) {
- actor2PointsCount = actor1PointsCount + 20;
- }
-
- for (int pointIndex = 0, walkIncr = 0; pointIndex < actor1PointsCount || pointIndex < actor2PointsCount; pointIndex += 2, walkIncr += 2) {
- int scale;
- if (_scrollRemaining > 0) {
- scrollRoom();
- }
- if (pointIndex < actor2PointsCount && pointIndex < actor1PointsCount) {
- scale = drawActors(actor1Points[pointIndex].direction, 0, 0, (walkIncr % 8) / 2, _wayneWalkPoints[pointIndex].x - _scrollPosition, _wayneWalkPoints[pointIndex].y, _garthWalkPoints[pointIndex].x - _scrollPosition, _garthWalkPoints[pointIndex].y);
- } else if (pointIndex < actor1PointsCount) {
- if (flag1 == 0) {
- scale = drawActors(actor1Points[pointIndex].direction, 0, 1, (walkIncr % 8) / 2, _wayneWalkPoints[pointIndex].x - _scrollPosition, _wayneWalkPoints[pointIndex].y, _garthSpriteX, _garthSpriteY);
- } else {
- scale = drawActors(actor1Points[pointIndex].direction, 1, 0, (walkIncr % 8) / 2, _wayneSpriteX, _wayneSpriteY, _garthWalkPoints[pointIndex].x - _scrollPosition, _garthWalkPoints[pointIndex].y);
- }
- } else {
- if (flag2 == 0) {
- scale = drawActors(actor2Points[pointIndex].direction, 0, 1, (walkIncr % 8) / 2, _wayneWalkPoints[pointIndex].x - _scrollPosition, _wayneWalkPoints[pointIndex].y, _garthSpriteX, _garthSpriteY);
- } else {
- scale = drawActors(actor2Points[pointIndex].direction, 1, 0, (walkIncr % 8) / 2, _wayneSpriteX, _wayneSpriteY, _garthWalkPoints[pointIndex].x - _scrollPosition, _garthWalkPoints[pointIndex].y);
- }
- }
- debug(5, "scale:%d", scale);
- // if (_inventoryItemsCount == 0 && _scrollPosition == 0) {
- // waitMillis(10000 / (scale * scale) * 10);
- // }
- waitMillis(100); // TODO Fix this
- if (_scrollRemaining > 0) {
+ if (actor2X != actor2WalkDestX || actor2Y != actor2WalkDestY) {
+ actor2PointsCount = walkCalcPath(flag2, actor2X, actor2Y, actor2WalkDestX, actor2WalkDestY, 0);
+ }
+
+ if (actor1PointsCount + 20 < actor2PointsCount) {
+ actor2PointsCount = actor1PointsCount + 20;
+ }
+
+ for (int pointIndex = 0, walkIncr = 0; pointIndex < actor1PointsCount || pointIndex < actor2PointsCount; pointIndex += 2, walkIncr += 2) {
+ int scale;
+ if (_scrollRemaining > 0) {
+ scrollRoom();
+ }
+ if (pointIndex < actor2PointsCount && pointIndex < actor1PointsCount) {
+ scale = drawActors(actor1Points[pointIndex].direction, 0, 0, (walkIncr % 8) / 2, _wayneWalkPoints[pointIndex].x - _scrollPosition, _wayneWalkPoints[pointIndex].y, _garthWalkPoints[pointIndex].x - _scrollPosition, _garthWalkPoints[pointIndex].y);
+ } else if (pointIndex < actor1PointsCount) {
+ if (flag1 == 0) {
+ scale = drawActors(actor1Points[pointIndex].direction, 0, 1, (walkIncr % 8) / 2, _wayneWalkPoints[pointIndex].x - _scrollPosition, _wayneWalkPoints[pointIndex].y, _garthSpriteX, _garthSpriteY);
+ } else {
+ scale = drawActors(actor1Points[pointIndex].direction, 1, 0, (walkIncr % 8) / 2, _wayneSpriteX, _wayneSpriteY, _garthWalkPoints[pointIndex].x - _scrollPosition, _garthWalkPoints[pointIndex].y);
+ }
+ } else {
+ if (flag2 == 0) {
+ scale = drawActors(actor2Points[pointIndex].direction, 0, 1, (walkIncr % 8) / 2, _wayneWalkPoints[pointIndex].x - _scrollPosition, _wayneWalkPoints[pointIndex].y, _garthSpriteX, _garthSpriteY);
+ } else {
+ scale = drawActors(actor2Points[pointIndex].direction, 1, 0, (walkIncr % 8) / 2, _wayneSpriteX, _wayneSpriteY, _garthWalkPoints[pointIndex].x - _scrollPosition, _garthWalkPoints[pointIndex].y);
+ }
+ }
+ debug(5, "scale:%d", scale);
+ // if (_inventoryItemsCount == 0 && _scrollPosition == 0) {
+ // waitMillis(10000 / (scale * scale) * 10);
+ // }
+ waitMillis(100); // TODO Fix this
+ if (_scrollRemaining > 0) {
warning("STUB - Missing scrolling in WalkTo");
- // TODO
- // if (updateGame()) {
- // return true;
- // }
- }
- }
-
- if (direction == -1) {
- if (actor1PointsCount > 0) {
- direction = actor1Points[actor1PointsCount - 1].direction;
- } else {
- direction = 0;
- }
- }
-
- if (isActorWayne()) {
- drawActors(direction, 1, 1, 0, actor1_destX - _scrollPosition, actor1_destY, actor2WalkDestX - _scrollPosition, actor2WalkDestY);
- } else {
- drawActors(direction, 1, 1, 0, actor2WalkDestX - _scrollPosition, actor2WalkDestY, actor1_destX - _scrollPosition, actor1_destY);
- }
-
- // Finish background scrolling
- while (_scrollRemaining > 0) {
- scrollRoom();
- drawActors(_actorSpriteValue, 1, 1, 0, _wayneSpriteX, _wayneSpriteY, _garthSpriteX, _garthSpriteY);
- waitMillis(50);
- }
-
- return true;
+ // TODO
+ // if (updateGame()) {
+ // return true;
+ // }
+ }
+ }
+
+ if (direction == -1) {
+ if (actor1PointsCount > 0) {
+ direction = actor1Points[actor1PointsCount - 1].direction;
+ } else {
+ direction = 0;
+ }
+ }
+
+ if (isActorWayne()) {
+ drawActors(direction, 1, 1, 0, actor1_destX - _scrollPosition, actor1_destY, actor2WalkDestX - _scrollPosition, actor2WalkDestY);
+ } else {
+ drawActors(direction, 1, 1, 0, actor2WalkDestX - _scrollPosition, actor2WalkDestY, actor1_destX - _scrollPosition, actor1_destY);
+ }
+
+ // Finish background scrolling
+ while (_scrollRemaining > 0) {
+ scrollRoom();
+ drawActors(_actorSpriteValue, 1, 1, 0, _wayneSpriteX, _wayneSpriteY, _garthSpriteX, _garthSpriteY);
+ waitMillis(50);
+ }
+
+ return true;
}
} // End of namespace WaynesWorld
diff --git a/engines/waynesworld/waynesworld.cpp b/engines/waynesworld/waynesworld.cpp
index a78b5875bec..e6dbee1d1e1 100644
--- a/engines/waynesworld/waynesworld.cpp
+++ b/engines/waynesworld/waynesworld.cpp
@@ -337,10 +337,10 @@ void WaynesWorldEngine::updateEvents() {
break;
case Common::EVENT_MOUSEMOVE:
// Restrict mouse move to the mouse allowed zone
- _mouseX = CLIP<int>(event.mouse.x, _mouseZone.left, _mouseZone.right - 1);
- _mouseY = CLIP<int>(event.mouse.y, _mouseZone.top, _mouseZone.bottom - 1);
+ _mouseX = CLIP<int>(event.mouse.x, _mouseZone.left, _mouseZone.right - 1);
+ _mouseY = CLIP<int>(event.mouse.y, _mouseZone.top, _mouseZone.bottom - 1);
g_system->warpMouse(_mouseX, _mouseY);
- break;
+ break;
case Common::EVENT_LBUTTONDOWN:
// Only consider the event if the mouse is in the mouse zone
clickPt = event.mouse;
@@ -350,10 +350,10 @@ void WaynesWorldEngine::updateEvents() {
_mouseClickY = clickPt.y;
//_mouseClickButtons |= kLeftButtonDown;
}
- break;
+ break;
case Common::EVENT_LBUTTONUP:
//_mouseClickButtons &= ~kLeftButtonDown;
- break;
+ break;
case Common::EVENT_RBUTTONDOWN:
// Only consider the event if the mouse is in the mouse zone
clickPt = event.mouse;
@@ -363,10 +363,10 @@ void WaynesWorldEngine::updateEvents() {
_mouseClickY = event.mouse.y;
//_mouseClickButtons |= kRightButtonDown;
}
- break;
+ break;
case Common::EVENT_RBUTTONUP:
//_mouseClickButtons &= ~kRightButtonDown;
- break;
+ break;
case Common::EVENT_QUIT:
_escPressed = true;
quitGame();
@@ -418,7 +418,7 @@ bool WaynesWorldEngine::isPointAtWayne(int x, int y) {
const int x2 = _wayneSpriteX + (_wayneActorScale * 13) / 100;
const int y1 = _wayneSpriteY - (_wayneActorScale * 48) / 100;
const int y2 = _wayneSpriteY;
- return x >= x1 && y >= y1 && x <= x2 && y <= y2;
+ return x >= x1 && y >= y1 && x <= x2 && y <= y2;
}
bool WaynesWorldEngine::isPointAtGarth(int x, int y) {
@@ -426,81 +426,81 @@ bool WaynesWorldEngine::isPointAtGarth(int x, int y) {
const int x2 = _garthSpriteX + (_garthActorScale * 13) / 100;
const int y1 = _garthSpriteY - (_garthActorScale * 48) / 100;
const int y2 = _garthSpriteY;
- return x >= x1 && y >= y1 && x <= x2 && y <= y2;
+ return x >= x1 && y >= y1 && x <= x2 && y <= y2;
}
void WaynesWorldEngine::updateMouseMove() {
- // Game Menu
- if (_gameState == 4)
- return;
-
- // Dialog
- if (_gameState == 2) {
- int newDialogChoiceIndex = -10;
- if (_mouseY > 186) {
- newDialogChoiceIndex = -15;
- } else if (_mouseY > 177) {
- newDialogChoiceIndex = -14;
- } else if (_mouseY > 168) {
- newDialogChoiceIndex = -13;
- } else if (_mouseY > 159) {
- newDialogChoiceIndex = -12;
- } else if (_mouseY > 150) {
- newDialogChoiceIndex = -11;
- }
- if (_selectedDialogChoice != newDialogChoiceIndex) {
- drawDialogChoices(newDialogChoiceIndex);
- }
- return;
- }
-
- // Unused ticket
- if (_gameState == 3) {
- unusedTicketHandleMouseMove();
- return;
- }
-
- // Inventory
- if (_gameState == 0 && _inventoryItemsCount > 0 && _mouseX < 312) {
- const int inventorySlotIndex = _mouseY / 20 * 12 + _mouseX / 26;
- if (inventorySlotIndex < _inventoryItemsCount) {
- const int inventoryObjectId = _inventoryItemsObjectMap[inventorySlotIndex];
- int inventoryItemQuantity;
- if (isActorWayne()) {
- inventoryItemQuantity = getWayneInventoryItemQuantity(inventoryObjectId);
- } else {
- inventoryItemQuantity = getGarthInventoryItemQuantity(inventoryObjectId);
- }
- const char *roomObjectName = getRoomObjectName(inventoryObjectId);
+ // Game Menu
+ if (_gameState == 4)
+ return;
+
+ // Dialog
+ if (_gameState == 2) {
+ int newDialogChoiceIndex = -10;
+ if (_mouseY > 186) {
+ newDialogChoiceIndex = -15;
+ } else if (_mouseY > 177) {
+ newDialogChoiceIndex = -14;
+ } else if (_mouseY > 168) {
+ newDialogChoiceIndex = -13;
+ } else if (_mouseY > 159) {
+ newDialogChoiceIndex = -12;
+ } else if (_mouseY > 150) {
+ newDialogChoiceIndex = -11;
+ }
+ if (_selectedDialogChoice != newDialogChoiceIndex) {
+ drawDialogChoices(newDialogChoiceIndex);
+ }
+ return;
+ }
+
+ // Unused ticket
+ if (_gameState == 3) {
+ unusedTicketHandleMouseMove();
+ return;
+ }
+
+ // Inventory
+ if (_gameState == 0 && _inventoryItemsCount > 0 && _mouseX < 312) {
+ const int inventorySlotIndex = _mouseY / 20 * 12 + _mouseX / 26;
+ if (inventorySlotIndex < _inventoryItemsCount) {
+ const int inventoryObjectId = _inventoryItemsObjectMap[inventorySlotIndex];
+ int inventoryItemQuantity;
+ if (isActorWayne()) {
+ inventoryItemQuantity = getWayneInventoryItemQuantity(inventoryObjectId);
+ } else {
+ inventoryItemQuantity = getGarthInventoryItemQuantity(inventoryObjectId);
+ }
+ const char *roomObjectName = getRoomObjectName(inventoryObjectId);
Common::String objectName;
- if (inventoryItemQuantity == 1) {
+ if (inventoryItemQuantity == 1) {
objectName = roomObjectName;
- } else {
+ } else {
objectName = Common::String::format("%d %ss", inventoryItemQuantity, roomObjectName);
- }
- drawVerbLine(_verbNumber, inventoryObjectId, objectName.c_str());
- return;
- }
- }
-
- // Wayne and Garth
- if (_gameState == 0 && isActorWayne() && isPointAtGarth(_mouseX, _mouseY)) {
- drawVerbLine(_verbNumber, -3, "Garth");
- } else if (_gameState == 0 && isActorGarth() && isPointAtWayne(_mouseX, _mouseY)) {
- drawVerbLine(_verbNumber, -2, "Wayne");
- } else {
- // Room objects
- const int objectIdAtPoint = findRoomObjectIdAtPoint(_mouseX, _mouseY);
- if (_gameState == 0) {
- if (objectIdAtPoint != -1) {
- drawVerbLine(_verbNumber, objectIdAtPoint, getRoomObjectName(objectIdAtPoint));
- } else {
- drawVerbLine(_verbNumber, -1, 0);
- }
- } else if (_gameState == 1) {
- gameMapHandleMouseMove(objectIdAtPoint);
- }
- }
+ }
+ drawVerbLine(_verbNumber, inventoryObjectId, objectName.c_str());
+ return;
+ }
+ }
+
+ // Wayne and Garth
+ if (_gameState == 0 && isActorWayne() && isPointAtGarth(_mouseX, _mouseY)) {
+ drawVerbLine(_verbNumber, -3, "Garth");
+ } else if (_gameState == 0 && isActorGarth() && isPointAtWayne(_mouseX, _mouseY)) {
+ drawVerbLine(_verbNumber, -2, "Wayne");
+ } else {
+ // Room objects
+ const int objectIdAtPoint = findRoomObjectIdAtPoint(_mouseX, _mouseY);
+ if (_gameState == 0) {
+ if (objectIdAtPoint != -1) {
+ drawVerbLine(_verbNumber, objectIdAtPoint, getRoomObjectName(objectIdAtPoint));
+ } else {
+ drawVerbLine(_verbNumber, -1, 0);
+ }
+ } else if (_gameState == 1) {
+ gameMapHandleMouseMove(objectIdAtPoint);
+ }
+ }
}
@@ -520,47 +520,47 @@ void WaynesWorldEngine::handleMapPalette() {
}
void WaynesWorldEngine::handleMouseClick() {
- if (_mouseClickButtons & kLeftButtonClicked) {
- handleMouseLeftClick();
- }
- if (_mouseClickButtons & kRightButtonClicked) {
- handleMouseRightClick();
- }
- if (_mouseClickButtons & kKeyPressed) {
+ if (_mouseClickButtons & kLeftButtonClicked) {
+ handleMouseLeftClick();
+ }
+ if (_mouseClickButtons & kRightButtonClicked) {
+ handleMouseRightClick();
+ }
+ if (_mouseClickButtons & kKeyPressed) {
warning("handleMouseClick - STUB handleKeyInput");
- }
+ }
}
void WaynesWorldEngine::handleMouseLeftClick() {
- switch (_gameState) {
- case 0: // Normal Game mode
- if (_mouseClickY < 150) {
- _objectNumber = _hoverObjectNumber;
- if (_objectNumber != -1) {
- walkToObject();
- handleVerb(1);
- } else {
- walkTo(_mouseClickX, _mouseClickY, -1, -1, -1);
- }
- } else if (_mouseClickX > 2 && _mouseClickX < 315 && _mouseClickY > 164) {
- selectVerbNumber(_mouseClickX);
- }
- break;
- case 1:
- gameMapHandleMouseClick();
- break;
- case 2: // Dialog Mode
- handleDialogMouseClick();
- break;
- case 3:
- unusedTicketHandleMouseClick();
- break;
- case 4:
+ switch (_gameState) {
+ case 0: // Normal Game mode
+ if (_mouseClickY < 150) {
+ _objectNumber = _hoverObjectNumber;
+ if (_objectNumber != -1) {
+ walkToObject();
+ handleVerb(1);
+ } else {
+ walkTo(_mouseClickX, _mouseClickY, -1, -1, -1);
+ }
+ } else if (_mouseClickX > 2 && _mouseClickX < 315 && _mouseClickY > 164) {
+ selectVerbNumber(_mouseClickX);
+ }
+ break;
+ case 1:
+ gameMapHandleMouseClick();
+ break;
+ case 2: // Dialog Mode
+ handleDialogMouseClick();
+ break;
+ case 3:
+ unusedTicketHandleMouseClick();
+ break;
+ case 4:
_logic->handleGameMenu();
break;
- case 5:
- extremeCloseUpHandleMouseClick();
- break;
+ case 5:
+ extremeCloseUpHandleMouseClick();
+ break;
default:
warning("handleMouseLeftClick - Unhandled game state %d", _gameState);
@@ -569,47 +569,47 @@ void WaynesWorldEngine::handleMouseLeftClick() {
}
void WaynesWorldEngine::handleMouseRightClick() {
- switch (_gameState) {
- case 0:
- if (_mouseClickX > 2 && _mouseClickX < 268 && _mouseClickY > 164) {
- selectVerbNumber2(_mouseClickX);
- } else if (_hoverObjectNumber != -1) {
- _objectNumber = _hoverObjectNumber;
- walkToObject();
- handleVerb(2);
- }
- break;
- case 1:
- gameMapHandleMouseClick();
- break;
- case 2:
- handleDialogMouseClick();
- break;
- case 3:
- unusedTicketHandleMouseClick();
- break;
- case 4:
+ switch (_gameState) {
+ case 0:
+ if (_mouseClickX > 2 && _mouseClickX < 268 && _mouseClickY > 164) {
+ selectVerbNumber2(_mouseClickX);
+ } else if (_hoverObjectNumber != -1) {
+ _objectNumber = _hoverObjectNumber;
+ walkToObject();
+ handleVerb(2);
+ }
+ break;
+ case 1:
+ gameMapHandleMouseClick();
+ break;
+ case 2:
+ handleDialogMouseClick();
+ break;
+ case 3:
+ unusedTicketHandleMouseClick();
+ break;
+ case 4:
_logic->handleGameMenu();
- break;
- case 5:
- extremeCloseUpHandleMouseClick();
- break;
+ break;
+ case 5:
+ extremeCloseUpHandleMouseClick();
+ break;
- default:
+ default:
warning("handleMouseRightClick - Unhandled game state %d", _gameState);
break;
- }
+ }
}
void WaynesWorldEngine::loadPalette(GxlArchive* lib, const char *filename) {
- Image::PCXDecoder *imageDecoder = lib->loadImage(filename);
+ Image::PCXDecoder *imageDecoder = lib->loadImage(filename);
if (imageDecoder->getPalette().empty()) {
warning("loadPalette() Could not load palette from '%s'", filename);
} else {
memcpy(_palette2, imageDecoder->getPalette().data(), Graphics::PALETTE_SIZE);
g_system->getPaletteManager()->setPalette(_palette2, 0, 256);
}
- delete imageDecoder;
+ delete imageDecoder;
}
void WaynesWorldEngine::paletteFadeIn(int index, int count, int stepsSize) {
@@ -679,23 +679,23 @@ void WaynesWorldEngine::paletteFadeColor(int index, byte r, byte g, byte b, int
}
void WaynesWorldEngine::drawImageToSurfaceIntern(GxlArchive *lib, const char *filename, WWSurface *destSurface, int x, int y, bool transparent) {
- Image::PCXDecoder *imageDecoder = lib->loadImage(filename);
+ Image::PCXDecoder *imageDecoder = lib->loadImage(filename);
if (transparent) {
destSurface->drawSurfaceTransparent(imageDecoder->getSurface(), x, y);
} else {
destSurface->drawSurface(imageDecoder->getSurface(), x, y);
}
- delete imageDecoder;
+ delete imageDecoder;
}
void WaynesWorldEngine::drawImageToScreenIntern(GxlArchive *lib, const char *filename, int x, int y, bool transparent) {
- Image::PCXDecoder *imageDecoder = lib->loadImage(filename);
+ Image::PCXDecoder *imageDecoder = lib->loadImage(filename);
if (transparent) {
_screen->drawSurfaceTransparent(imageDecoder->getSurface(), x, y);
} else {
_screen->drawSurface(imageDecoder->getSurface(), x, y);
}
- delete imageDecoder;
+ delete imageDecoder;
}
void WaynesWorldEngine::drawImageToScreen(GxlArchive* lib, const char *filename, int x, int y) {
@@ -703,7 +703,7 @@ void WaynesWorldEngine::drawImageToScreen(GxlArchive* lib, const char *filename,
}
void WaynesWorldEngine::drawImageToSurface(GxlArchive *lib, const char *filename, WWSurface *destSurface, int x, int y) {
- drawImageToSurfaceIntern(lib, filename, destSurface, x, y, false);
+ drawImageToSurfaceIntern(lib, filename, destSurface, x, y, false);
}
void WaynesWorldEngine::drawRoomImageToBackground(const char *filename, int x, int y) {
@@ -715,11 +715,11 @@ void WaynesWorldEngine::drawRoomImageToBackgroundTransparent(const char *filenam
}
void WaynesWorldEngine::drawRoomImageToScreen(const char *filename, int x, int y) {
- drawImageToScreenIntern(_roomGxl, filename, x, y, false);
+ drawImageToScreenIntern(_roomGxl, filename, x, y, false);
}
void WaynesWorldEngine::drawRoomImageToSurface(const char *filename, WWSurface *destSurface, int x, int y) {
- drawImageToSurfaceIntern(_roomGxl, filename, destSurface, x, y, false);
+ drawImageToSurfaceIntern(_roomGxl, filename, destSurface, x, y, false);
}
void WaynesWorldEngine::drawSpiralEffect(Graphics::Surface *surface, int x, int y, int grainWidth, int grainHeight) {
@@ -764,37 +764,37 @@ Common::String WaynesWorldEngine::loadString(const char *filename, int index, in
}
void WaynesWorldEngine::drawCurrentTextToSurface(WWSurface *destSurface, int x, int y) {
- drawCurrentText(x, y, destSurface);
+ drawCurrentText(x, y, destSurface);
}
void WaynesWorldEngine::drawCurrentText(int x, int y, WWSurface *destSurface) {
- int textCenterX, textY = 0, textColor, actorY = 0;
- const int textWidth = _fontWWInv->getTextWidth(_currentText.c_str());
- if (x != -1) {
- textCenterX = x;
- textY = y;
- textColor = 15;
- } else if (isActorWayne()) {
- textCenterX = _wayneSpriteX;
- actorY = _wayneSpriteY;
- textColor = 4;
- } else {
- textCenterX = _garthSpriteX;
- actorY = _garthSpriteY;
- textColor = 119;
- }
- int textX = textCenterX - 75;
- if (textX < 0) {
- textX = 5;
- } else if (textX + 150 > 319) {
- textX -= textX - 165;
- }
- if (x == -1) {
- textY = (actorY - 48) - (textWidth / 150 + 1) * 15;
- if (textY < 0) {
- textY = actorY + 15;
- }
- }
+ int textCenterX, textY = 0, textColor, actorY = 0;
+ const int textWidth = _fontWWInv->getTextWidth(_currentText.c_str());
+ if (x != -1) {
+ textCenterX = x;
+ textY = y;
+ textColor = 15;
+ } else if (isActorWayne()) {
+ textCenterX = _wayneSpriteX;
+ actorY = _wayneSpriteY;
+ textColor = 4;
+ } else {
+ textCenterX = _garthSpriteX;
+ actorY = _garthSpriteY;
+ textColor = 119;
+ }
+ int textX = textCenterX - 75;
+ if (textX < 0) {
+ textX = 5;
+ } else if (textX + 150 > 319) {
+ textX -= textX - 165;
+ }
+ if (x == -1) {
+ textY = (actorY - 48) - (textWidth / 150 + 1) * 15;
+ if (textY < 0) {
+ textY = actorY + 15;
+ }
+ }
if (destSurface) {
_fontWWInv->drawWrappedText(destSurface, _currentText.c_str(), textX, textY, 150, 0);
_fontWW->drawWrappedText(destSurface, _currentText.c_str(), textX, textY, 150, textColor);
@@ -802,28 +802,28 @@ void WaynesWorldEngine::drawCurrentText(int x, int y, WWSurface *destSurface) {
_screen->drawWrappedText(_fontWWInv, _currentText.c_str(), textX, textY, 150, 0);
_screen->drawWrappedText(_fontWW, _currentText.c_str(), textX, textY, 150, textColor);
}
- _isTextVisible = true;
- _currentTextX = x;
- _currentTextY = y;
+ _isTextVisible = true;
+ _currentTextX = x;
+ _currentTextY = y;
}
void WaynesWorldEngine::displayText(const char *filename, int index, int flag, int x, int y, int drawToVirtual) {
- _currentText = loadString(filename, index, flag);
- drawCurrentText(x, y, nullptr);
+ _currentText = loadString(filename, index, flag);
+ drawCurrentText(x, y, nullptr);
}
void WaynesWorldEngine::displayTextLines(const char *filename, int baseIndex, int x, int y, int count) {
- int ticks = 3000;
- if (count < 0) {
- ticks = -count;
- count = 1;
- }
- for (int textIndex = 0; textIndex < count; textIndex++) {
- displayText(filename, baseIndex + textIndex, 0, x, y, 0);
- _isTextVisible = false;
- waitMillis(ticks);
- refreshActors();
- }
+ int ticks = 3000;
+ if (count < 0) {
+ ticks = -count;
+ count = 1;
+ }
+ for (int textIndex = 0; textIndex < count; textIndex++) {
+ displayText(filename, baseIndex + textIndex, 0, x, y, 0);
+ _isTextVisible = false;
+ waitMillis(ticks);
+ refreshActors();
+ }
}
void WaynesWorldEngine::playSound(const char *filename, int flag) {
@@ -858,55 +858,55 @@ void WaynesWorldEngine::stopMusic() {
}
void WaynesWorldEngine::drawInterface(int verbNum) {
- if (isActorWayne()) {
- drawImageToScreen(_m00Gxl, "winter.pcx", 0, 151);
- } else {
- drawImageToScreen(_m00Gxl, "ginter.pcx", 0, 151);
- }
- selectVerbNumber2(_verbNumber2 * 24 + 3);
- _verbNumber = verbNum;
- selectVerbNumber(_verbNumber * 24 + 3);
+ if (isActorWayne()) {
+ drawImageToScreen(_m00Gxl, "winter.pcx", 0, 151);
+ } else {
+ drawImageToScreen(_m00Gxl, "ginter.pcx", 0, 151);
+ }
+ selectVerbNumber2(_verbNumber2 * 24 + 3);
+ _verbNumber = verbNum;
+ selectVerbNumber(_verbNumber * 24 + 3);
}
void WaynesWorldEngine::selectVerbNumber2(int x) {
- // sysMouseDriver(2);
- _screen->frameRect(_verbNumber2 * 24 + 3, 165, _verbNumber2 * 24 + 3 + 23, 198, 0);
- _verbNumber2 = (x - 3) / 24;
- _screen->frameRect(_verbNumber2 * 24 + 3, 165, _verbNumber2 * 24 + 3 + 23, 198, 10);
- // sysMouseDriver(1);
+ // sysMouseDriver(2);
+ _screen->frameRect(_verbNumber2 * 24 + 3, 165, _verbNumber2 * 24 + 3 + 23, 198, 0);
+ _verbNumber2 = (x - 3) / 24;
+ _screen->frameRect(_verbNumber2 * 24 + 3, 165, _verbNumber2 * 24 + 3 + 23, 198, 10);
+ // sysMouseDriver(1);
}
void WaynesWorldEngine::selectVerbNumber(int x) {
const int selectedButtonIndex = (x - 3) / 24;
- _firstObjectNumber = -1;
- if (selectedButtonIndex > 10) {
- if (_mouseClickY > 182) {
- if (x < 290) {
- drawInventory();
- refreshActors();
- } else {
+ _firstObjectNumber = -1;
+ if (selectedButtonIndex > 10) {
+ if (_mouseClickY > 182) {
+ if (x < 290) {
+ drawInventory();
+ refreshActors();
+ } else {
_logic->r0_handleRoomEvent1();
- }
- }
- } else if (selectedButtonIndex == 0) {
- changeActor();
- } else {
- _verbNumber = selectedButtonIndex;
- drawVerbLine(_verbNumber, -4, nullptr);
- if (_verbNumber == 8 && _inventoryItemsCount == 0) {
- drawInventory();
- refreshActors();
- }
- }
+ }
+ }
+ } else if (selectedButtonIndex == 0) {
+ changeActor();
+ } else {
+ _verbNumber = selectedButtonIndex;
+ drawVerbLine(_verbNumber, -4, nullptr);
+ if (_verbNumber == 8 && _inventoryItemsCount == 0) {
+ drawInventory();
+ refreshActors();
+ }
+ }
}
void WaynesWorldEngine::changeActor() {
if (_currentRoomNumber == 31)
return;
toggleActor();
- drawInterface(_verbNumber);
- _isTextVisible = false;
- refreshInventory(true);
+ drawInterface(_verbNumber);
+ _isTextVisible = false;
+ refreshInventory(true);
}
void WaynesWorldEngine::drawVerbLine(int verbNumber, int objectNumber, const char *objectName) {
@@ -962,69 +962,69 @@ void WaynesWorldEngine::drawVerbLine(int verbNumber, int objectNumber, const cha
}
void WaynesWorldEngine::rememberFirstObjectName(int objectId) {
- if (objectId == -2) {
- _firstObjectName = "Wayne";
- } else if (objectId == -3) {
- _firstObjectName = "Garth";
- } else if (objectId <= kLastInventoryObjectId) {
- int inventoryItemQuantity = 0;
- if (isActorWayne()) {
- inventoryItemQuantity = getWayneInventoryItemQuantity(objectId);
- } else {
- inventoryItemQuantity = getGarthInventoryItemQuantity(objectId);
- }
- if (inventoryItemQuantity == 1) {
- _firstObjectName = getRoomObjectName(objectId);
- } else {
- _firstObjectName = Common::String::format("%d %s", inventoryItemQuantity, getRoomObjectName(objectId));
- }
- } else {
- _firstObjectName = getRoomObjectName(objectId);
- }
+ if (objectId == -2) {
+ _firstObjectName = "Wayne";
+ } else if (objectId == -3) {
+ _firstObjectName = "Garth";
+ } else if (objectId <= kLastInventoryObjectId) {
+ int inventoryItemQuantity = 0;
+ if (isActorWayne()) {
+ inventoryItemQuantity = getWayneInventoryItemQuantity(objectId);
+ } else {
+ inventoryItemQuantity = getGarthInventoryItemQuantity(objectId);
+ }
+ if (inventoryItemQuantity == 1) {
+ _firstObjectName = getRoomObjectName(objectId);
+ } else {
+ _firstObjectName = Common::String::format("%d %s", inventoryItemQuantity, getRoomObjectName(objectId));
+ }
+ } else {
+ _firstObjectName = getRoomObjectName(objectId);
+ }
}
void WaynesWorldEngine::redrawInventory() {
- // NOTE This seems to hide the inventory
- _inventoryItemsCount = 1;
- drawInventory();
- refreshActors();
+ // NOTE This seems to hide the inventory
+ _inventoryItemsCount = 1;
+ drawInventory();
+ refreshActors();
}
void WaynesWorldEngine::refreshInventory(bool doRefresh) {
- // NOTE This seems to show the inventory
- if (_inventoryItemsCount != 0) {
- drawInventory();
- drawInventory();
- }
- if (doRefresh) {
- refreshActors();
- }
+ // NOTE This seems to show the inventory
+ if (_inventoryItemsCount != 0) {
+ drawInventory();
+ drawInventory();
+ }
+ if (doRefresh) {
+ refreshActors();
+ }
}
void WaynesWorldEngine::drawInventory() {
- if (_inventoryItemsCount != 0) {
- _inventoryItemsCount = 0;
- return;
- }
- int iconX = 0;
- int iconY = 0;
- _inventorySprite->clear(0);
- for (int inventoryItemIndex = 0; inventoryItemIndex < kInventorySize; inventoryItemIndex++) {
- const int objectRoomNumber = getObjectRoom(inventoryItemIndex + kFirstInventoryObjectId);
- if ((isActorWayne() && objectRoomNumber == 99 && _wayneInventory[inventoryItemIndex] > 0) ||
- (isActorGarth() && objectRoomNumber == 99 && _garthInventory[inventoryItemIndex] > 0)) {
- Common::String filename = Common::String::format("icon%02d.pcx", inventoryItemIndex + 1);
+ if (_inventoryItemsCount != 0) {
+ _inventoryItemsCount = 0;
+ return;
+ }
+ int iconX = 0;
+ int iconY = 0;
+ _inventorySprite->clear(0);
+ for (int inventoryItemIndex = 0; inventoryItemIndex < kInventorySize; inventoryItemIndex++) {
+ const int objectRoomNumber = getObjectRoom(inventoryItemIndex + kFirstInventoryObjectId);
+ if ((isActorWayne() && objectRoomNumber == 99 && _wayneInventory[inventoryItemIndex] > 0) ||
+ (isActorGarth() && objectRoomNumber == 99 && _garthInventory[inventoryItemIndex] > 0)) {
+ Common::String filename = Common::String::format("icon%02d.pcx", inventoryItemIndex + 1);
debug("filename: [%s]", filename.c_str());
- drawImageToSurface(_m03Gxl, filename.c_str(), _inventorySprite, iconX, iconY);
- iconX += 26;
- if (iconX > 300) {
- iconX = 0;
- iconY += 20;
- }
- _inventoryItemsObjectMap[_inventoryItemsCount] = inventoryItemIndex + kFirstInventoryObjectId;
- _inventoryItemsCount++;
- }
- }
+ drawImageToSurface(_m03Gxl, filename.c_str(), _inventorySprite, iconX, iconY);
+ iconX += 26;
+ if (iconX > 300) {
+ iconX = 0;
+ iconY += 20;
+ }
+ _inventoryItemsObjectMap[_inventoryItemsCount] = inventoryItemIndex + kFirstInventoryObjectId;
+ _inventoryItemsCount++;
+ }
+ }
}
void WaynesWorldEngine::setWayneInventoryItemQuantity(int objectId, int quantity) {
@@ -1044,19 +1044,19 @@ int WaynesWorldEngine::getGarthInventoryItemQuantity(int objectId) {
}
void WaynesWorldEngine::loadMainActorSprites() {
- // _inventorySprite = new WWSurface(312, 52);
+ // _inventorySprite = new WWSurface(312, 52);
_wayneReachRightSprite = _m01Gxl->loadSurface("wreachr.pcx");
_wayneReachLeftSprite = _m01Gxl->loadSurface("wreachl.pcx");
_garthReachRightSprite = _m01Gxl->loadSurface("greachr.pcx");
_garthReachLeftSprite = _m01Gxl->loadSurface("greachl.pcx");
- for (int direction = 0; direction < 8; direction++) {
+ for (int direction = 0; direction < 8; direction++) {
_wayneSprites[direction] = _m01Gxl->loadSurface(Common::String::format("wstand%d.pcx", direction).c_str());
_garthSprites[direction] = _m01Gxl->loadSurface(Common::String::format("gstand%d.pcx", direction).c_str());
for (int frameNum = 0; frameNum < 4; frameNum++) {
_wayneWalkSprites[direction][frameNum] = _m01Gxl->loadSurface(Common::String::format("wwalk%d%d.pcx", direction, frameNum).c_str());
_garthWalkSprites[direction][frameNum] = _m01Gxl->loadSurface(Common::String::format("gwalk%d%d.pcx", direction, frameNum).c_str());
}
- }
+ }
}
void WaynesWorldEngine::unloadMainActorSprites() {
@@ -1064,14 +1064,14 @@ void WaynesWorldEngine::unloadMainActorSprites() {
delete _wayneReachLeftSprite;
delete _garthReachRightSprite;
delete _garthReachLeftSprite;
- for (int direction = 0; direction < 8; direction++) {
+ for (int direction = 0; direction < 8; direction++) {
delete _wayneSprites[direction];
delete _garthSprites[direction];
for (int frameNum = 0; frameNum < 4; frameNum++) {
delete _wayneWalkSprites[direction][frameNum];
delete _garthWalkSprites[direction][frameNum];
}
- }
+ }
}
int WaynesWorldEngine::getActorScaleFromY(int actorY) {
@@ -1080,80 +1080,80 @@ int WaynesWorldEngine::getActorScaleFromY(int actorY) {
void WaynesWorldEngine::drawActorReachObject(int objectId, int spriteIndex) {
const int direction = getObjectDirection(objectId);
- if (isActorWayne()) {
- drawActors(direction, 2, 1, spriteIndex, _wayneSpriteX, _wayneSpriteY, _garthSpriteX, _garthSpriteY);
- } else {
- drawActors(direction, 1, 2, spriteIndex, _wayneSpriteX, _wayneSpriteY, _garthSpriteX, _garthSpriteY);
- }
+ if (isActorWayne()) {
+ drawActors(direction, 2, 1, spriteIndex, _wayneSpriteX, _wayneSpriteY, _garthSpriteX, _garthSpriteY);
+ } else {
+ drawActors(direction, 1, 2, spriteIndex, _wayneSpriteX, _wayneSpriteY, _garthSpriteX, _garthSpriteY);
+ }
}
int WaynesWorldEngine::drawActors(int direction, int wayneKind, int garthKind, int spriteIndex, int wayneX, int wayneY, int garthX, int garthY) {
- updateRoomAnimations();
-
- if (_wayneSpriteX == -1 && _garthSpriteX == -1) {
- WWSurface *tempBackground = new WWSurface(320, 150);
- tempBackground->drawSurface(_backgroundSurface, 0, 0);
- if (_inventoryItemsCount > 0) {
- tempBackground->drawSurfaceTransparent(_inventorySprite, 0, 0);
- }
- _screen->drawSurface(tempBackground, 0, 0);
- delete tempBackground;
- return 100;
- }
-
- int wayneHeight = 0, wayneWidth = 0;
- int garthHeight = 0, garthWidth = 0;
- WWSurface *wayneSprite = nullptr;
- WWSurface *garthSprite = nullptr;
-
- if (_wayneSpriteX != -1) {
- _wayneActorScale = getActorScaleFromY(wayneY);
- wayneHeight = (100 - _wayneActorScale) * 48 / 90;
- wayneWidth = _wayneActorScale * 13 / 100;
- const int scaledWayneWidth = _wayneActorScale * 27 / 100;
- const int scaledWayneHeight = _wayneActorScale * 48 / 100;
- wayneSprite = new WWSurface(scaledWayneWidth, scaledWayneHeight);
- if (wayneKind == 0) {
- wayneSprite->scaleSurface(_wayneWalkSprites[direction][spriteIndex]);
- } else if (wayneKind == 1) {
- wayneSprite->scaleSurface(_wayneSprites[direction]);
- } else if (wayneKind == 2) {
- if (direction < 5) {
- wayneSprite->scaleSurface(_wayneReachRightSprite);
- } else {
- wayneSprite->scaleSurface(_wayneReachLeftSprite);
- }
- }
- if (_scrollPosition == 0) {
- drawStaticRoomObjects(_currentRoomNumber, wayneX, wayneY, wayneHeight, wayneWidth, wayneSprite);
- }
- }
-
- if (_garthSpriteX != -1) {
- _garthActorScale = getActorScaleFromY(garthY);
- garthHeight = (100 - _garthActorScale) * 48 / 100;
- garthWidth = _garthActorScale * 13 / 100;
- const int scaledGarthWidth = _garthActorScale * 27 / 100;
- const int scaledGarthHeight = _garthActorScale * 48 / 100;
- garthSprite = new WWSurface(scaledGarthWidth, scaledGarthHeight);
- if (garthKind == 0) {
- garthSprite->scaleSurface(_garthWalkSprites[direction][spriteIndex]);
- } else if (garthKind == 1) {
- garthSprite->scaleSurface(_garthSprites[direction]);
- } else if (garthKind == 2) {
- if (direction < 5) {
- garthSprite->scaleSurface(_garthReachRightSprite);
- } else {
- garthSprite->scaleSurface(_garthReachLeftSprite);
- }
- }
- if (_scrollPosition == 0) {
- drawStaticRoomObjects(_currentRoomNumber, garthX, garthY, garthHeight, garthWidth, garthSprite);
- }
- }
-
- WWSurface *tempBackground = new WWSurface(320, 150);
- tempBackground->drawSurface(_backgroundSurface, 0, 0);
+ updateRoomAnimations();
+
+ if (_wayneSpriteX == -1 && _garthSpriteX == -1) {
+ WWSurface *tempBackground = new WWSurface(320, 150);
+ tempBackground->drawSurface(_backgroundSurface, 0, 0);
+ if (_inventoryItemsCount > 0) {
+ tempBackground->drawSurfaceTransparent(_inventorySprite, 0, 0);
+ }
+ _screen->drawSurface(tempBackground, 0, 0);
+ delete tempBackground;
+ return 100;
+ }
+
+ int wayneHeight = 0, wayneWidth = 0;
+ int garthHeight = 0, garthWidth = 0;
+ WWSurface *wayneSprite = nullptr;
+ WWSurface *garthSprite = nullptr;
+
+ if (_wayneSpriteX != -1) {
+ _wayneActorScale = getActorScaleFromY(wayneY);
+ wayneHeight = (100 - _wayneActorScale) * 48 / 90;
+ wayneWidth = _wayneActorScale * 13 / 100;
+ const int scaledWayneWidth = _wayneActorScale * 27 / 100;
+ const int scaledWayneHeight = _wayneActorScale * 48 / 100;
+ wayneSprite = new WWSurface(scaledWayneWidth, scaledWayneHeight);
+ if (wayneKind == 0) {
+ wayneSprite->scaleSurface(_wayneWalkSprites[direction][spriteIndex]);
+ } else if (wayneKind == 1) {
+ wayneSprite->scaleSurface(_wayneSprites[direction]);
+ } else if (wayneKind == 2) {
+ if (direction < 5) {
+ wayneSprite->scaleSurface(_wayneReachRightSprite);
+ } else {
+ wayneSprite->scaleSurface(_wayneReachLeftSprite);
+ }
+ }
+ if (_scrollPosition == 0) {
+ drawStaticRoomObjects(_currentRoomNumber, wayneX, wayneY, wayneHeight, wayneWidth, wayneSprite);
+ }
+ }
+
+ if (_garthSpriteX != -1) {
+ _garthActorScale = getActorScaleFromY(garthY);
+ garthHeight = (100 - _garthActorScale) * 48 / 100;
+ garthWidth = _garthActorScale * 13 / 100;
+ const int scaledGarthWidth = _garthActorScale * 27 / 100;
+ const int scaledGarthHeight = _garthActorScale * 48 / 100;
+ garthSprite = new WWSurface(scaledGarthWidth, scaledGarthHeight);
+ if (garthKind == 0) {
+ garthSprite->scaleSurface(_garthWalkSprites[direction][spriteIndex]);
+ } else if (garthKind == 1) {
+ garthSprite->scaleSurface(_garthSprites[direction]);
+ } else if (garthKind == 2) {
+ if (direction < 5) {
+ garthSprite->scaleSurface(_garthReachRightSprite);
+ } else {
+ garthSprite->scaleSurface(_garthReachLeftSprite);
+ }
+ }
+ if (_scrollPosition == 0) {
+ drawStaticRoomObjects(_currentRoomNumber, garthX, garthY, garthHeight, garthWidth, garthSprite);
+ }
+ }
+
+ WWSurface *tempBackground = new WWSurface(320, 150);
+ tempBackground->drawSurface(_backgroundSurface, 0, 0);
#if 0 // DEBUG Draw room mask to background
for (int yc = 0; yc < 150; yc++) {
@@ -1163,57 +1163,57 @@ int WaynesWorldEngine::drawActors(int direction, int wayneKind, int garthKind, i
}
#endif
- if (wayneY <= garthY) {
- if (_wayneSpriteX != -1) {
- tempBackground->drawSurfaceTransparent(wayneSprite, wayneX - wayneWidth, wayneY + wayneHeight - 48);
- }
- if (_garthSpriteX != -1) {
- tempBackground->drawSurfaceTransparent(garthSprite, garthX - garthWidth, garthY + garthHeight - 48);
- }
- } else {
- if (_garthSpriteX != -1) {
- tempBackground->drawSurfaceTransparent(garthSprite, garthX - garthWidth, garthY + garthHeight - 48);
- }
- if (_wayneSpriteX != -1) {
- tempBackground->drawSurfaceTransparent(wayneSprite, wayneX - wayneWidth, wayneY + wayneHeight - 48);
- }
- }
-
- if (_scrollPosition != 0) {
- // drawStaticRoomObjects2(tempBackground);
+ if (wayneY <= garthY) {
+ if (_wayneSpriteX != -1) {
+ tempBackground->drawSurfaceTransparent(wayneSprite, wayneX - wayneWidth, wayneY + wayneHeight - 48);
+ }
+ if (_garthSpriteX != -1) {
+ tempBackground->drawSurfaceTransparent(garthSprite, garthX - garthWidth, garthY + garthHeight - 48);
+ }
+ } else {
+ if (_garthSpriteX != -1) {
+ tempBackground->drawSurfaceTransparent(garthSprite, garthX - garthWidth, garthY + garthHeight - 48);
+ }
+ if (_wayneSpriteX != -1) {
+ tempBackground->drawSurfaceTransparent(wayneSprite, wayneX - wayneWidth, wayneY + wayneHeight - 48);
+ }
+ }
+
+ if (_scrollPosition != 0) {
+ // drawStaticRoomObjects2(tempBackground);
warning("CHECKME - drawActors - drawStaticRoomObjects2(tempBackground);");
- }
+ }
- if (_inventoryItemsCount > 0) {
- tempBackground->drawSurfaceTransparent(_inventorySprite, 0, 0);
- }
+ if (_inventoryItemsCount > 0) {
+ tempBackground->drawSurfaceTransparent(_inventorySprite, 0, 0);
+ }
- if (_isTextVisible) {
- drawCurrentTextToSurface(tempBackground, _currentTextX, _currentTextY);
- }
+ if (_isTextVisible) {
+ drawCurrentTextToSurface(tempBackground, _currentTextX, _currentTextY);
+ }
- _screen->drawSurface(tempBackground, 0, 0);
+ _screen->drawSurface(tempBackground, 0, 0);
- _wayneSpriteX = wayneX;
- _wayneSpriteY = wayneY;
- _garthSpriteX = garthX;
- _garthSpriteY = garthY;
- _actorSpriteValue = direction;
- _wayneKind = wayneKind;
- _garthKind = garthKind;
- _actorSpriteIndex = spriteIndex;
+ _wayneSpriteX = wayneX;
+ _wayneSpriteY = wayneY;
+ _garthSpriteX = garthX;
+ _garthSpriteY = garthY;
+ _actorSpriteValue = direction;
+ _wayneKind = wayneKind;
+ _garthKind = garthKind;
+ _actorSpriteIndex = spriteIndex;
- if (_wayneSpriteX != -1) {
- delete wayneSprite;
- }
+ if (_wayneSpriteX != -1) {
+ delete wayneSprite;
+ }
- if (_garthSpriteX != -1) {
- delete garthSprite;
- }
+ if (_garthSpriteX != -1) {
+ delete garthSprite;
+ }
- delete tempBackground;
+ delete tempBackground;
- return _wayneActorScale;
+ return _wayneActorScale;
}
void WaynesWorldEngine::refreshActors() {
@@ -1221,23 +1221,23 @@ void WaynesWorldEngine::refreshActors() {
}
void WaynesWorldEngine::pickupObject(int objectId, byte &flags, byte flagsSet, int inventoryObjectId) {
- drawActorReachObject(objectId, 0);
- for (int index = 0; index < 20; index++) {
- waitMillis(50);
- updateRoomAnimations();
- }
- _garthKind = 1;
- _wayneKind = 1;
- moveObjectToNowhere(objectId);
- flags |= flagsSet;
- moveObjectToRoom(inventoryObjectId, 99);
- refreshInventory(false);
- loadRoomBackground();
+ drawActorReachObject(objectId, 0);
+ for (int index = 0; index < 20; index++) {
+ waitMillis(50);
+ updateRoomAnimations();
+ }
+ _garthKind = 1;
+ _wayneKind = 1;
+ moveObjectToNowhere(objectId);
+ flags |= flagsSet;
+ moveObjectToRoom(inventoryObjectId, 99);
+ refreshInventory(false);
+ loadRoomBackground();
}
void WaynesWorldEngine::playAnimation(const char *prefix, int startIndex, int count, int x, int y, int flag, uint ticks) {
Common::String filename;
- // sysMouseDriver(2);
+ // sysMouseDriver(2);
if (count > 0) {
for (int index = startIndex; index < startIndex + count; index++) {
updateRoomAnimations();
@@ -1255,12 +1255,12 @@ void WaynesWorldEngine::playAnimation(const char *prefix, int startIndex, int co
waitMillis(ticks);
}
}
- if (flag) {
+ if (flag) {
filename = Common::String::format("%s%d.pcx", prefix, startIndex);
- drawRoomImageToScreen(filename.c_str(), x, y);
- drawRoomImageToBackground(filename.c_str(), x, y);
- }
- // sysMouseDriver(1)
+ drawRoomImageToScreen(filename.c_str(), x, y);
+ drawRoomImageToBackground(filename.c_str(), x, y);
+ }
+ // sysMouseDriver(1)
}
void WaynesWorldEngine::playAnimationLoops(const char *prefix, int startIndex, int count, int x, int y, int flag, uint ticks, int loopCount) {
@@ -1270,13 +1270,13 @@ void WaynesWorldEngine::playAnimationLoops(const char *prefix, int startIndex, i
}
void WaynesWorldEngine::setWaynePosition(int x, int y) {
- _wayneSpriteX = x;
- _wayneSpriteY = y;
+ _wayneSpriteX = x;
+ _wayneSpriteY = y;
}
void WaynesWorldEngine::setGarthPosition(int x, int y) {
- _garthSpriteX = x;
- _garthSpriteY = y;
+ _garthSpriteX = x;
+ _garthSpriteY = y;
}
bool WaynesWorldEngine::isActorWayne() {
@@ -1304,7 +1304,7 @@ void WaynesWorldEngine::toggleActor() {
}
void WaynesWorldEngine::openRoomLibrary(int roomNum) {
- _roomName = Common::String::format("r%02d", roomNum);
+ _roomName = Common::String::format("r%02d", roomNum);
delete _roomGxl;
_roomGxl = new GxlArchive(_roomName);
@@ -1321,25 +1321,25 @@ void WaynesWorldEngine::loadRoomBackground() {
loadPalette(_roomGxl, "backg.pcx");
g_system->getPaletteManager()->setPalette(_palette2, 0, 256);
- drawRoomImageToSurface("backg.pcx", _backgroundSurface, 0, 0);
- refreshRoomBackground(_currentRoomNumber);
- refreshActors();
+ drawRoomImageToSurface("backg.pcx", _backgroundSurface, 0, 0);
+ refreshRoomBackground(_currentRoomNumber);
+ refreshActors();
}
void WaynesWorldEngine::changeRoom(int roomNum) {
- if (_currentRoomNumber != -1) {
- // GxlCloseLib is included in openRoomLibrary, no need to call it here
- unloadStaticRoomObjects();
- }
- openRoomLibrary(roomNum);
- if (_wayneSpriteX != -1) {
- loadRoomMask(roomNum);
- loadStaticRoomObjects(roomNum);
- }
- _actorSpriteValue = 0;
- _currentRoomNumber = roomNum;
- _roomChangeCtr++;
- loadRoomBackground();
+ if (_currentRoomNumber != -1) {
+ // GxlCloseLib is included in openRoomLibrary, no need to call it here
+ unloadStaticRoomObjects();
+ }
+ openRoomLibrary(roomNum);
+ if (_wayneSpriteX != -1) {
+ loadRoomMask(roomNum);
+ loadStaticRoomObjects(roomNum);
+ }
+ _actorSpriteValue = 0;
+ _currentRoomNumber = roomNum;
+ _roomChangeCtr++;
+ loadRoomBackground();
}
void WaynesWorldEngine::refreshRoomBackground(int roomNum) {
@@ -1347,19 +1347,19 @@ void WaynesWorldEngine::refreshRoomBackground(int roomNum) {
}
void WaynesWorldEngine::handleRoomEvent() {
- if (_roomEventNum != 0) {
- const int eventNum = _roomEventNum;
+ if (_roomEventNum != 0) {
+ const int eventNum = _roomEventNum;
_roomEventNum = 0;
_logic->handleRoomEvent(eventNum);
}
}
void WaynesWorldEngine::changeRoomScrolling() {
- int roomNumber = -1;
- _scrollPosition = 0;
- _scrollWidth = 0;
- _scrollRemaining = 0;
- switch (_currentRoomNumber) {
+ int roomNumber = -1;
+ _scrollPosition = 0;
+ _scrollWidth = 0;
+ _scrollRemaining = 0;
+ switch (_currentRoomNumber) {
case 8:
if (isActorWayne()) {
_garthSpriteX = 319;
@@ -1371,32 +1371,32 @@ void WaynesWorldEngine::changeRoomScrolling() {
roomNumber = 21;
break;
case 14:
- roomNumber = 19;
- break;
- case 19:
- roomNumber = 14;
- break;
- case 21:
- if (_hoverObjectNumber == kObjectIdFoyer) {
- if (isActorWayne()) {
- _garthSpriteX = 5;
- _garthSpriteY = 130;
- } else {
- _wayneSpriteX = 5;
- _wayneSpriteY = 130;
- }
- roomNumber = 8;
- } else {
- if (isActorWayne()) {
- _garthSpriteX = 319;
- _garthSpriteY = 131;
- } else {
- _wayneSpriteX = 319;
- _wayneSpriteY = 131;
- }
- roomNumber = 22;
- }
- break;
+ roomNumber = 19;
+ break;
+ case 19:
+ roomNumber = 14;
+ break;
+ case 21:
+ if (_hoverObjectNumber == kObjectIdFoyer) {
+ if (isActorWayne()) {
+ _garthSpriteX = 5;
+ _garthSpriteY = 130;
+ } else {
+ _wayneSpriteX = 5;
+ _wayneSpriteY = 130;
+ }
+ roomNumber = 8;
+ } else {
+ if (isActorWayne()) {
+ _garthSpriteX = 319;
+ _garthSpriteY = 131;
+ } else {
+ _wayneSpriteX = 319;
+ _wayneSpriteY = 131;
+ }
+ roomNumber = 22;
+ }
+ break;
case 22:
if (isActorWayne()) {
_garthSpriteX = 2;
@@ -1408,100 +1408,100 @@ void WaynesWorldEngine::changeRoomScrolling() {
roomNumber = 21;
break;
case 32:
- roomNumber = 33;
- break;
- case 33:
- roomNumber = 32;
- break;
+ roomNumber = 33;
+ break;
+ case 33:
+ roomNumber = 32;
+ break;
- default:
+ default:
break;
- }
- unloadStaticRoomObjects();
- openRoomLibrary(roomNumber);
- loadRoomMask(roomNumber);
- loadStaticRoomObjects(roomNumber);
- _currentRoomNumber = roomNumber;
+ }
+ unloadStaticRoomObjects();
+ openRoomLibrary(roomNumber);
+ loadRoomMask(roomNumber);
+ loadStaticRoomObjects(roomNumber);
+ _currentRoomNumber = roomNumber;
}
void WaynesWorldEngine::loadScrollSprite() {
- if (_currentRoomNumber == 14 && _hoverObjectNumber == kObjectIdLoadingDock) {
- _backgroundScrollSurface = new WWSurface(112, 150);
- drawRoomImageToSurface("scroll.pcx", _backgroundScrollSurface, 0, 0);
- if ((_logic->_r1_flags1 & 0x10) && !(_logic->_pizzathonListFlags1 & 0x04)) {
- drawRoomImageToSurface("gill0.pcx", _backgroundScrollSurface, 65, 84);
- }
- _scrollRemaining = 112;
- _scrollWidth = 112;
- _doScrollRight = true;
- } else if (_currentRoomNumber == 19 && _hoverObjectNumber == kObjectIdStore) {
- _backgroundScrollSurface = new WWSurface(112, 150);
+ if (_currentRoomNumber == 14 && _hoverObjectNumber == kObjectIdLoadingDock) {
+ _backgroundScrollSurface = new WWSurface(112, 150);
+ drawRoomImageToSurface("scroll.pcx", _backgroundScrollSurface, 0, 0);
+ if ((_logic->_r1_flags1 & 0x10) && !(_logic->_pizzathonListFlags1 & 0x04)) {
+ drawRoomImageToSurface("gill0.pcx", _backgroundScrollSurface, 65, 84);
+ }
+ _scrollRemaining = 112;
+ _scrollWidth = 112;
+ _doScrollRight = true;
+ } else if (_currentRoomNumber == 19 && _hoverObjectNumber == kObjectIdStore) {
+ _backgroundScrollSurface = new WWSurface(112, 150);
GxlArchive *r14Gxl = new GxlArchive("r14");
drawImageToSurface(r14Gxl, "backg.pcx", _backgroundScrollSurface, 0, 0);
delete r14Gxl;
_scrollRemaining = 112;
- _scrollWidth = 112;
- _doScrollRight = false;
- } else if (_currentRoomNumber == 8 && _hoverObjectNumber == kObjectIdHallway8) {
- stopRoomAnimations();
- _backgroundScrollSurface = new WWSurface(320, 150);
+ _scrollWidth = 112;
+ _doScrollRight = false;
+ } else if (_currentRoomNumber == 8 && _hoverObjectNumber == kObjectIdHallway8) {
+ stopRoomAnimations();
+ _backgroundScrollSurface = new WWSurface(320, 150);
GxlArchive *r21Gxl = new GxlArchive("r21");
drawImageToSurface(r21Gxl, "backg.pcx", _backgroundScrollSurface, 0, 0);
delete r21Gxl;
_scrollRemaining = 320;
- _scrollWidth = 320;
- _doScrollRight = false;
- } else if (_currentRoomNumber == 21 && _hoverObjectNumber == kObjectIdFoyer) {
- _backgroundScrollSurface = new WWSurface(320, 150);
+ _scrollWidth = 320;
+ _doScrollRight = false;
+ } else if (_currentRoomNumber == 21 && _hoverObjectNumber == kObjectIdFoyer) {
+ _backgroundScrollSurface = new WWSurface(320, 150);
GxlArchive *r08Gxl = new GxlArchive("r08");
drawImageToSurface(r08Gxl, "backg.pcx", _backgroundScrollSurface, 0, 0);
delete r08Gxl;
_scrollRemaining = 320;
- _scrollWidth = 320;
- _doScrollRight = true;
- } else if (_currentRoomNumber == 21 && _hoverObjectNumber == kObjectIdOffice21) {
- _backgroundScrollSurface = new WWSurface(320, 150);
+ _scrollWidth = 320;
+ _doScrollRight = true;
+ } else if (_currentRoomNumber == 21 && _hoverObjectNumber == kObjectIdOffice21) {
+ _backgroundScrollSurface = new WWSurface(320, 150);
GxlArchive *r22Gxl = new GxlArchive("r22");
drawImageToSurface(r22Gxl, "backg.pcx", _backgroundScrollSurface, 0, 0);
delete r22Gxl;
_scrollRemaining = 320;
- _scrollWidth = 320;
- _doScrollRight = false;
- } else if (_currentRoomNumber == 22 && _hoverObjectNumber == kObjectIdHallway22) {
- _backgroundScrollSurface = new WWSurface(320, 150);
+ _scrollWidth = 320;
+ _doScrollRight = false;
+ } else if (_currentRoomNumber == 22 && _hoverObjectNumber == kObjectIdHallway22) {
+ _backgroundScrollSurface = new WWSurface(320, 150);
GxlArchive *r21Gxl = new GxlArchive("r21");
drawImageToSurface(r21Gxl, "backg.pcx", _backgroundScrollSurface, 0, 0);
delete r21Gxl;
_scrollRemaining = 320;
- _scrollWidth = 320;
- _doScrollRight = true;
- } else if (_currentRoomNumber == 32 && _hoverObjectNumber == kObjectIdOffice) {
- if (!(_logic->_r32_flags & 0x04)) {
- displayTextLines("c04r", 452, 300, 20, 1);
- _scrollPosition = 0;
- } else {
- walkTo(150, 140, 6, 160, 140);
- stopRoomAnimations();
- _backgroundScrollSurface = new WWSurface(168, 150);
+ _scrollWidth = 320;
+ _doScrollRight = true;
+ } else if (_currentRoomNumber == 32 && _hoverObjectNumber == kObjectIdOffice) {
+ if (!(_logic->_r32_flags & 0x04)) {
+ displayTextLines("c04r", 452, 300, 20, 1);
+ _scrollPosition = 0;
+ } else {
+ walkTo(150, 140, 6, 160, 140);
+ stopRoomAnimations();
+ _backgroundScrollSurface = new WWSurface(168, 150);
GxlArchive *r33Gxl = new GxlArchive("r33");
drawImageToSurface(r33Gxl, "backg.pcx", _backgroundScrollSurface, 0, 0);
delete r33Gxl;
_scrollRemaining = 168;
- _scrollWidth = 168;
- _doScrollRight = false;
- }
- } else if (_currentRoomNumber == 33 && _hoverObjectNumber == kObjectIdHallway33) {
- _backgroundScrollSurface = new WWSurface(168, 150);
- drawRoomImageToSurface("scroll.pcx", _backgroundScrollSurface, 0, 0);
- if (_logic->_r32_flags & 0x02) {
- drawRoomImageToSurface("noplunge.pcx", _backgroundScrollSurface, 141, 94);
- }
- _scrollRemaining = 168;
- _scrollWidth = 168;
- _doScrollRight = true;
- } else {
- _scrollPosition = 0;
- }
+ _scrollWidth = 168;
+ _doScrollRight = false;
+ }
+ } else if (_currentRoomNumber == 33 && _hoverObjectNumber == kObjectIdHallway33) {
+ _backgroundScrollSurface = new WWSurface(168, 150);
+ drawRoomImageToSurface("scroll.pcx", _backgroundScrollSurface, 0, 0);
+ if (_logic->_r32_flags & 0x02) {
+ drawRoomImageToSurface("noplunge.pcx", _backgroundScrollSurface, 141, 94);
+ }
+ _scrollRemaining = 168;
+ _scrollWidth = 168;
+ _doScrollRight = true;
+ } else {
+ _scrollPosition = 0;
+ }
}
void WaynesWorldEngine::scrollRoom() {
@@ -1692,435 +1692,435 @@ void WaynesWorldEngine::initRoomObjects() {
}
void WaynesWorldEngine::moveObjectToRoom(int objectId, int roomNum) {
- _roomObjects[objectId].roomNumber = roomNum;
- if (objectId <= kLastInventoryObjectId) {
- const int inventoryIndex = objectId - kFirstInventoryObjectId;
- if (isActorWayne()) {
- _wayneInventory[inventoryIndex]++;
- } else {
- _garthInventory[inventoryIndex]++;
- }
- }
+ _roomObjects[objectId].roomNumber = roomNum;
+ if (objectId <= kLastInventoryObjectId) {
+ const int inventoryIndex = objectId - kFirstInventoryObjectId;
+ if (isActorWayne()) {
+ _wayneInventory[inventoryIndex]++;
+ } else {
+ _garthInventory[inventoryIndex]++;
+ }
+ }
}
void WaynesWorldEngine::moveObjectToNowhere(int objectId) {
- if (objectId <= kLastInventoryObjectId) {
- const int inventoryIndex = objectId - kFirstInventoryObjectId;
- if (isActorWayne()) {
- _wayneInventory[inventoryIndex]--;
- } else {
- _garthInventory[inventoryIndex]--;
- }
- if (_wayneInventory[inventoryIndex] == 0 && _garthInventory[inventoryIndex] == 0) {
- _roomObjects[objectId].roomNumber = -2;
- }
- } else {
- _roomObjects[objectId].roomNumber = -2;
- }
+ if (objectId <= kLastInventoryObjectId) {
+ const int inventoryIndex = objectId - kFirstInventoryObjectId;
+ if (isActorWayne()) {
+ _wayneInventory[inventoryIndex]--;
+ } else {
+ _garthInventory[inventoryIndex]--;
+ }
+ if (_wayneInventory[inventoryIndex] == 0 && _garthInventory[inventoryIndex] == 0) {
+ _roomObjects[objectId].roomNumber = -2;
+ }
+ } else {
+ _roomObjects[objectId].roomNumber = -2;
+ }
}
const RoomObject *WaynesWorldEngine::getRoomObject(int objectId) {
- return &_roomObjects[objectId];
+ return &_roomObjects[objectId];
}
const char *WaynesWorldEngine::getRoomObjectName(int objectId) {
- return _roomObjects[objectId].name;
+ return _roomObjects[objectId].name;
}
int WaynesWorldEngine::getObjectRoom(int objectId) {
- return _roomObjects[objectId].roomNumber;
+ return _roomObjects[objectId].roomNumber;
}
int WaynesWorldEngine::getObjectDirection(int objectId) {
- return _roomObjects[objectId].direction;
+ return _roomObjects[objectId].direction;
}
int WaynesWorldEngine::findRoomObjectIdAtPoint(int x, int y) {
- for (int index = 0; index < kRoomObjectsCount; index++) {
- const RoomObject *roomObject = getRoomObject(index);
- if (roomObject->roomNumber == _currentRoomNumber &&
- x >= roomObject->x1 && x <= roomObject->x2 &&
- y >= roomObject->y1 && y <= roomObject->y2) {
- return index;
- }
- }
- return -1;
+ for (int index = 0; index < kRoomObjectsCount; index++) {
+ const RoomObject *roomObject = getRoomObject(index);
+ if (roomObject->roomNumber == _currentRoomNumber &&
+ x >= roomObject->x1 && x <= roomObject->x2 &&
+ y >= roomObject->y1 && y <= roomObject->y2) {
+ return index;
+ }
+ }
+ return -1;
}
void WaynesWorldEngine::walkToObject() {
- loadScrollSprite();
- if (_hoverObjectNumber == -2) {
- walkTo(_garthSpriteX, _garthSpriteY, _actorSpriteValue, -1, -1);
- } else if (_hoverObjectNumber == -3) {
- walkTo(_wayneSpriteX, _wayneSpriteY, _actorSpriteValue, -1, -1);
- } else if (_hoverObjectNumber > kLastInventoryObjectId) {
- const RoomObject *roomObject = getRoomObject(_hoverObjectNumber);
- walkTo(roomObject->walkX, roomObject->walkY, roomObject->direction, -1, -1);
- } else {
- refreshActors();
- }
+ loadScrollSprite();
+ if (_hoverObjectNumber == -2) {
+ walkTo(_garthSpriteX, _garthSpriteY, _actorSpriteValue, -1, -1);
+ } else if (_hoverObjectNumber == -3) {
+ walkTo(_wayneSpriteX, _wayneSpriteY, _actorSpriteValue, -1, -1);
+ } else if (_hoverObjectNumber > kLastInventoryObjectId) {
+ const RoomObject *roomObject = getRoomObject(_hoverObjectNumber);
+ walkTo(roomObject->walkX, roomObject->walkY, roomObject->direction, -1, -1);
+ } else {
+ refreshActors();
+ }
}
void WaynesWorldEngine::startDialog() {
- redrawInventory();
- _gameState = 2;
- drawDialogChoices(-9);
+ redrawInventory();
+ _gameState = 2;
+ drawDialogChoices(-9);
}
void WaynesWorldEngine::setDialogChoices(int choice1, int choice2, int choice3, int choice4, int choice5) {
- _dialogChoices[0] = choice1;
- _dialogChoices[1] = choice2;
- _dialogChoices[2] = choice3;
- _dialogChoices[3] = choice4;
- _dialogChoices[4] = choice5;
+ _dialogChoices[0] = choice1;
+ _dialogChoices[1] = choice2;
+ _dialogChoices[2] = choice3;
+ _dialogChoices[3] = choice4;
+ _dialogChoices[4] = choice5;
}
void WaynesWorldEngine::drawDialogChoices(int choiceIndex) {
- // sysMouseDriver(2);
- if (choiceIndex == -9) {
- // Redraw all and clear the background
- _screen->fillRect(0, 151, 319, 199, 0);
- }
- byte choiceTextColor = isActorWayne() ? 11 : 10;
- byte selectedTextColor = 13;
- for (int index = 0; index < 5 && _dialogChoices[index] != -1; index++) {
- const byte textColor = index + choiceIndex + 11 == 0 ? selectedTextColor : choiceTextColor;
- Common::String dialogText = loadString("c04", _dialogChoices[index], 0);
+ // sysMouseDriver(2);
+ if (choiceIndex == -9) {
+ // Redraw all and clear the background
+ _screen->fillRect(0, 151, 319, 199, 0);
+ }
+ byte choiceTextColor = isActorWayne() ? 11 : 10;
+ byte selectedTextColor = 13;
+ for (int index = 0; index < 5 && _dialogChoices[index] != -1; index++) {
+ const byte textColor = index + choiceIndex + 11 == 0 ? selectedTextColor : choiceTextColor;
+ Common::String dialogText = loadString("c04", _dialogChoices[index], 0);
_screen->drawText(_fontBit5x7, dialogText.c_str(), 3, 152 + index * 9, textColor);
- }
- // sysMouseDriver(1);
- _selectedDialogChoice = choiceIndex;
+ }
+ // sysMouseDriver(1);
+ _selectedDialogChoice = choiceIndex;
}
void WaynesWorldEngine::handleDialogMouseClick() {
int replyTextIndex1, replyTextIndex2, replyTextIndex3;
- int replyTextX, replyTextY;
+ int replyTextX, replyTextY;
- if (_selectedDialogChoice == -10)
- return;
+ if (_selectedDialogChoice == -10)
+ return;
- // _selectedDialogChoice goes from -11 (first entry) to -15 (fifth entry)
- _selectedDialogChoice = _dialogChoices[-_selectedDialogChoice - 11];
- if (_selectedDialogChoice == -1)
- return;
+ // _selectedDialogChoice goes from -11 (first entry) to -15 (fifth entry)
+ _selectedDialogChoice = _dialogChoices[-_selectedDialogChoice - 11];
+ if (_selectedDialogChoice == -1)
+ return;
- _isTextVisible = false;
- refreshActors();
+ _isTextVisible = false;
+ refreshActors();
const int continueDialog = _logic->handleDialogSelect(replyTextX, replyTextY, replyTextIndex1, replyTextIndex2, replyTextIndex3);
- if (replyTextIndex1 != -1) {
- _logic->handleDialogReply(replyTextIndex1, replyTextX, replyTextY);
- if (replyTextIndex2 != -1) {
- _logic->handleDialogReply(replyTextIndex2, replyTextX, replyTextY);
- if (replyTextIndex3 != -1) {
- _logic->handleDialogReply(replyTextIndex3, replyTextX, replyTextY);
- }
- }
- }
-
- if (_gameState == 0) {
- drawInterface(_verbNumber);
+ if (replyTextIndex1 != -1) {
+ _logic->handleDialogReply(replyTextIndex1, replyTextX, replyTextY);
+ if (replyTextIndex2 != -1) {
+ _logic->handleDialogReply(replyTextIndex2, replyTextX, replyTextY);
+ if (replyTextIndex3 != -1) {
+ _logic->handleDialogReply(replyTextIndex3, replyTextX, replyTextY);
+ }
+ }
+ }
+
+ if (_gameState == 0) {
+ drawInterface(_verbNumber);
} else if (continueDialog != 0 || replyTextIndex1 != -1) {
- drawDialogChoices(-9);
- }
+ drawDialogChoices(-9);
+ }
}
void WaynesWorldEngine::handleVerb(int verbFlag) {
const int verbNum = verbFlag == 1 ? _verbNumber : _verbNumber2;
- switch (verbNum) {
- case 1:
- handleVerbPickUp();
- break;
- case 2:
- handleVerbLookAt();
- break;
- case 3:
- handleVerbUse();
- break;
- case 4:
- handleVerbTalkTo();
- break;
- case 5:
- handleVerbPush();
- break;
- case 6:
- handleVerbPull();
- break;
- case 7:
- handleVerbExtremeCloseupOf();
- break;
- case 8:
- handleVerbGive();
- break;
- case 9:
- handleVerbOpen();
- break;
- case 10:
- handleVerbClose();
- break;
+ switch (verbNum) {
+ case 1:
+ handleVerbPickUp();
+ break;
+ case 2:
+ handleVerbLookAt();
+ break;
+ case 3:
+ handleVerbUse();
+ break;
+ case 4:
+ handleVerbTalkTo();
+ break;
+ case 5:
+ handleVerbPush();
+ break;
+ case 6:
+ handleVerbPull();
+ break;
+ case 7:
+ handleVerbExtremeCloseupOf();
+ break;
+ case 8:
+ handleVerbGive();
+ break;
+ case 9:
+ handleVerbOpen();
+ break;
+ case 10:
+ handleVerbClose();
+ break;
default:
break;
- }
+ }
- if (_scrollWidth != 0) {
- changeRoomScrolling();
- }
+ if (_scrollWidth != 0) {
+ changeRoomScrolling();
+ }
}
void WaynesWorldEngine::handleVerbPickUp() {
_isTextVisible = false;
- if (_objectNumber <= kLastInventoryObjectId) {
- refreshActors();
- }
-
- int actionTextIndex = _logic->handleVerbPickUp();
-
- if (_objectNumber == -3) {
- actionTextIndex = 29;
- } else if (_objectNumber == -2) {
- actionTextIndex = 30;
- }
-
- if (actionTextIndex != -1) {
- displayText("c01", actionTextIndex, 0, -1, -1, 0);
- }
-
- switch (actionTextIndex) {
- case 0:
- case 10:
- case 44:
- case 54:
- playSound("sv32.snd", 1);
- break;
+ if (_objectNumber <= kLastInventoryObjectId) {
+ refreshActors();
+ }
+
+ int actionTextIndex = _logic->handleVerbPickUp();
+
+ if (_objectNumber == -3) {
+ actionTextIndex = 29;
+ } else if (_objectNumber == -2) {
+ actionTextIndex = 30;
+ }
+
+ if (actionTextIndex != -1) {
+ displayText("c01", actionTextIndex, 0, -1, -1, 0);
+ }
+
+ switch (actionTextIndex) {
+ case 0:
+ case 10:
+ case 44:
+ case 54:
+ playSound("sv32.snd", 1);
+ break;
case 7:
playSound("sv18.snd", 1);
playSound("sv28.snd", 1);
break;
case 13:
- playSound("sv19.snd", 1);
- break;
- case 50:
- playSound("sv33.snd", 1);
- break;
- case 51:
- case 59:
- playSound("sv31.snd", 1);
- break;
- case 53:
- playSound("ss07.snd", 1);
- break;
- case 55:
- playSound("sv29.snd", 1);
- break;
- case 56:
- playSound("sv38.snd", 1);
- break;
+ playSound("sv19.snd", 1);
+ break;
+ case 50:
+ playSound("sv33.snd", 1);
+ break;
+ case 51:
+ case 59:
+ playSound("sv31.snd", 1);
+ break;
+ case 53:
+ playSound("ss07.snd", 1);
+ break;
+ case 55:
+ playSound("sv29.snd", 1);
+ break;
+ case 56:
+ playSound("sv38.snd", 1);
+ break;
default:
break;
- }
+ }
}
void WaynesWorldEngine::handleVerbLookAt() {
- _isTextVisible = false;
- if (_objectNumber <= kLastInventoryObjectId) {
- refreshActors();
- }
- if (_objectNumber == kObjectIdComputer) {
- moveObjectToRoom(kObjectIdCindi, 103);
- }
- if (_objectNumber == kObjectIdInventoryUnusedTicket) {
- lookAtUnusedTicket();
- } else {
+ _isTextVisible = false;
+ if (_objectNumber <= kLastInventoryObjectId) {
+ refreshActors();
+ }
+ if (_objectNumber == kObjectIdComputer) {
+ moveObjectToRoom(kObjectIdCindi, 103);
+ }
+ if (_objectNumber == kObjectIdInventoryUnusedTicket) {
+ lookAtUnusedTicket();
+ } else {
int textIndex;
if (_objectNumber == -2 || _objectNumber == -3) {
textIndex = 0;
} else {
textIndex = _objectNumber - 27;
}
- if (isActorWayne()) {
- displayText("c02w", textIndex, 1, -1, -1, 1);
- } else {
- displayText("c02g", textIndex, 1, -1, -1, 1);
- }
- }
+ if (isActorWayne()) {
+ displayText("c02w", textIndex, 1, -1, -1, 1);
+ } else {
+ displayText("c02g", textIndex, 1, -1, -1, 1);
+ }
+ }
}
void WaynesWorldEngine::handleVerbUse() {
_isTextVisible = false;
- if (_objectNumber <= kLastInventoryObjectId) {
- refreshActors();
- }
-
- // See if the object has to be used with another object
- if (_firstObjectNumber == -1 && (
- _objectNumber == kObjectIdInventoryPlungers ||
- _objectNumber == kObjectIdInventoryExtensionCord ||
- _objectNumber == kObjectIdInventorySuckCut ||
- _objectNumber == kObjectIdSuckCut ||
- _objectNumber == kObjectIdInventoryRope ||
- _objectNumber == kObjectIdInventoryHockeyStick ||
- _objectNumber == kObjectIdInventoryDrumstick ||
- _objectNumber == kObjectIdInventoryCheesePizza ||
- _objectNumber == kObjectIdInventoryChain ||
- _objectNumber == kObjectIdChain_1 ||
- _objectNumber == kObjectIdInventoryTube ||
- _objectNumber == kObjectIdInventoryLunchBox ||
- _objectNumber == kObjectIdInventoryPassCard ||
- _objectNumber == kObjectIdInventorySetOfKeys ||
- _objectNumber == kObjectIdInventorySquirtGun ||
- _objectNumber == kObjectIdInventoryBeakerOfAcid ||
- _objectNumber == kObjectIdInventoryFreshDonut ||
- _objectNumber == kObjectIdInventoryDayOldDonut)) {
- _firstObjectNumber = _objectNumber;
- rememberFirstObjectName(_objectNumber);
- return;
- }
-
- if (_firstObjectNumber == kObjectIdInventoryBeakerOfAcid && _objectNumber == kObjectIdInventorySquirtGun) {
- _logic->_r39_flags |= 0x01;
- moveObjectToNowhere(kObjectIdInventoryBeakerOfAcid);
- refreshInventory(true);
- return;
- }
-
- int actionTextIndex = _logic->handleVerbUse();
-
- if (_firstObjectNumber == kObjectIdInventoryPlungers && _objectNumber != kObjectIdLampPost) {
- actionTextIndex = 44;
- } else if (_firstObjectNumber == kObjectIdInventoryExtensionCord && _objectNumber != kObjectIdOutlet11) {
- actionTextIndex = 45;
- } else if (_firstObjectNumber == kObjectIdInventorySuckCut && _objectNumber != kObjectIdExtensionCord_1) {
- actionTextIndex = 48;
- } else if (_firstObjectNumber == kObjectIdSuckCut && _objectNumber != kObjectIdFountain11_0 && _objectNumber != kObjectIdFountain11_1) {
- actionTextIndex = 48;
- }
-
- if (_objectNumber == -3) {
- actionTextIndex = 31;
- } else if (_objectNumber == -2) {
- if (_currentRoomNumber == 38 && (_logic->_r35_flags & 0x01)) {
- _logic->r38_atrap();
- actionTextIndex = -1;
- } else {
- actionTextIndex = 32;
- }
- }
-
- _firstObjectNumber = -1;
-
- if (actionTextIndex != -1) {
- displayText("c03", actionTextIndex, 0, -1, -1, 0);
- }
-
- switch (actionTextIndex) {
- case 0:
- playSound("sv18.snd", 1);
- break;
- case 67:
- playSound("ss07.snd", 1);
- break;
- case 68:
- playSound("sv32.snd", 1);
- break;
- case 69:
- playSound("sv47.snd", 1);
- break;
- case 70:
- playSound("sv39.snd", 1);
- break;
- case 71:
- playSound("sv38.snd", 1);
- break;
+ if (_objectNumber <= kLastInventoryObjectId) {
+ refreshActors();
+ }
+
+ // See if the object has to be used with another object
+ if (_firstObjectNumber == -1 && (
+ _objectNumber == kObjectIdInventoryPlungers ||
+ _objectNumber == kObjectIdInventoryExtensionCord ||
+ _objectNumber == kObjectIdInventorySuckCut ||
+ _objectNumber == kObjectIdSuckCut ||
+ _objectNumber == kObjectIdInventoryRope ||
+ _objectNumber == kObjectIdInventoryHockeyStick ||
+ _objectNumber == kObjectIdInventoryDrumstick ||
+ _objectNumber == kObjectIdInventoryCheesePizza ||
+ _objectNumber == kObjectIdInventoryChain ||
+ _objectNumber == kObjectIdChain_1 ||
+ _objectNumber == kObjectIdInventoryTube ||
+ _objectNumber == kObjectIdInventoryLunchBox ||
+ _objectNumber == kObjectIdInventoryPassCard ||
+ _objectNumber == kObjectIdInventorySetOfKeys ||
+ _objectNumber == kObjectIdInventorySquirtGun ||
+ _objectNumber == kObjectIdInventoryBeakerOfAcid ||
+ _objectNumber == kObjectIdInventoryFreshDonut ||
+ _objectNumber == kObjectIdInventoryDayOldDonut)) {
+ _firstObjectNumber = _objectNumber;
+ rememberFirstObjectName(_objectNumber);
+ return;
+ }
+
+ if (_firstObjectNumber == kObjectIdInventoryBeakerOfAcid && _objectNumber == kObjectIdInventorySquirtGun) {
+ _logic->_r39_flags |= 0x01;
+ moveObjectToNowhere(kObjectIdInventoryBeakerOfAcid);
+ refreshInventory(true);
+ return;
+ }
+
+ int actionTextIndex = _logic->handleVerbUse();
+
+ if (_firstObjectNumber == kObjectIdInventoryPlungers && _objectNumber != kObjectIdLampPost) {
+ actionTextIndex = 44;
+ } else if (_firstObjectNumber == kObjectIdInventoryExtensionCord && _objectNumber != kObjectIdOutlet11) {
+ actionTextIndex = 45;
+ } else if (_firstObjectNumber == kObjectIdInventorySuckCut && _objectNumber != kObjectIdExtensionCord_1) {
+ actionTextIndex = 48;
+ } else if (_firstObjectNumber == kObjectIdSuckCut && _objectNumber != kObjectIdFountain11_0 && _objectNumber != kObjectIdFountain11_1) {
+ actionTextIndex = 48;
+ }
+
+ if (_objectNumber == -3) {
+ actionTextIndex = 31;
+ } else if (_objectNumber == -2) {
+ if (_currentRoomNumber == 38 && (_logic->_r35_flags & 0x01)) {
+ _logic->r38_atrap();
+ actionTextIndex = -1;
+ } else {
+ actionTextIndex = 32;
+ }
+ }
+
+ _firstObjectNumber = -1;
+
+ if (actionTextIndex != -1) {
+ displayText("c03", actionTextIndex, 0, -1, -1, 0);
+ }
+
+ switch (actionTextIndex) {
+ case 0:
+ playSound("sv18.snd", 1);
+ break;
+ case 67:
+ playSound("ss07.snd", 1);
+ break;
+ case 68:
+ playSound("sv32.snd", 1);
+ break;
+ case 69:
+ playSound("sv47.snd", 1);
+ break;
+ case 70:
+ playSound("sv39.snd", 1);
+ break;
+ case 71:
+ playSound("sv38.snd", 1);
+ break;
default:
break;
- }
+ }
}
void WaynesWorldEngine::handleVerbTalkTo() {
- int actionTextIndex;
- _dialogChoices[0] = -1;
-
- if (_objectNumber == -3 || _objectNumber == -2) {
- const bool room1Special = !(_logic->_r1_flags1 & 0x10) && isActorWayne() && _currentRoomNumber == 1 && (_logic->_r1_flags2 & 0x01);
- if (room1Special) {
- actionTextIndex = 14;
- } else {
- actionTextIndex = getRandom(5) + 16;
- if (_objectNumber == -2)
- actionTextIndex += 5;
- }
- displayText("c11", actionTextIndex, 0, -1, -1, 0);
- waitSeconds(2);
+ int actionTextIndex;
+ _dialogChoices[0] = -1;
+
+ if (_objectNumber == -3 || _objectNumber == -2) {
+ const bool room1Special = !(_logic->_r1_flags1 & 0x10) && isActorWayne() && _currentRoomNumber == 1 && (_logic->_r1_flags2 & 0x01);
+ if (room1Special) {
+ actionTextIndex = 14;
+ } else {
+ actionTextIndex = getRandom(5) + 16;
+ if (_objectNumber == -2)
+ actionTextIndex += 5;
+ }
+ displayText("c11", actionTextIndex, 0, -1, -1, 0);
+ waitSeconds(2);
// Not in the original but without it the old text will be drawn as well
_isTextVisible = false;
- if (room1Special) {
- actionTextIndex = 15;
- } else {
- actionTextIndex += 10;
- }
+ if (room1Special) {
+ actionTextIndex = 15;
+ } else {
+ actionTextIndex += 10;
+ }
toggleActor();
- loadRoomBackground();
- displayText("c11", actionTextIndex, 0, -1, -1, 0);
+ loadRoomBackground();
+ displayText("c11", actionTextIndex, 0, -1, -1, 0);
toggleActor();
- waitSeconds(2);
- _isTextVisible = false;
- loadRoomBackground();
- if (room1Special) {
- _logic->r1_handleRoomEvent(true);
- }
- return;
- }
+ waitSeconds(2);
+ _isTextVisible = false;
+ loadRoomBackground();
+ if (room1Special) {
+ _logic->r1_handleRoomEvent(true);
+ }
+ return;
+ }
_logic->handleVerbTalkTo();
- if (_dialogChoices[0] != -1) {
- startDialog();
- }
+ if (_dialogChoices[0] != -1) {
+ startDialog();
+ }
}
void WaynesWorldEngine::handleVerbPush() {
_isTextVisible = false;
- if (_objectNumber <= kLastInventoryObjectId) {
- refreshActors();
- }
+ if (_objectNumber <= kLastInventoryObjectId) {
+ refreshActors();
+ }
const int actionTextIndex = _logic->handleVerbPush();
- if (actionTextIndex != -1) {
- displayText("c05", actionTextIndex, 0, -1, -1, 0);
- }
-
- switch (actionTextIndex) {
- case 0:
- playSound("sv02.snd", 1);
- break;
- case 4:
- playSound("sv47.snd", 1);
- break;
+ if (actionTextIndex != -1) {
+ displayText("c05", actionTextIndex, 0, -1, -1, 0);
+ }
+
+ switch (actionTextIndex) {
+ case 0:
+ playSound("sv02.snd", 1);
+ break;
+ case 4:
+ playSound("sv47.snd", 1);
+ break;
default:
break;
- }
+ }
}
void WaynesWorldEngine::handleVerbPull() {
_isTextVisible = false;
- if (_objectNumber <= kLastInventoryObjectId) {
- refreshActors();
- }
+ if (_objectNumber <= kLastInventoryObjectId) {
+ refreshActors();
+ }
const int actionTextIndex = _logic->handleVerbPull();
- if (actionTextIndex != -1) {
- displayText("c06", actionTextIndex, 0, -1, -1, 0);
- }
+ if (actionTextIndex != -1) {
+ displayText("c06", actionTextIndex, 0, -1, -1, 0);
+ }
if (actionTextIndex == 0)
- playSound("sv31.snd", 1);
+ playSound("sv31.snd", 1);
}
@@ -2130,60 +2130,60 @@ void WaynesWorldEngine::handleVerbExtremeCloseupOf() {
void WaynesWorldEngine::handleVerbGive() {
if (_firstObjectNumber == -1) {
- _firstObjectNumber = _objectNumber;
- rememberFirstObjectName(_objectNumber);
- return;
- }
-
- if (_firstObjectNumber >= kFirstInventoryObjectId && _firstObjectNumber <= kLastInventoryObjectId &&
- (_objectNumber == -2 || _objectNumber == -3)) {
- if (_firstObjectNumber == kObjectIdInventoryDrumstick || _firstObjectNumber == kObjectIdInventoryGuitar) {
- displayText("c08", 2, 0, -1, -1, 0);
- } else {
- const int inventoryIndex = _firstObjectNumber - kFirstInventoryObjectId;
- if (_objectNumber == -3) {
- _garthInventory[inventoryIndex] += _wayneInventory[inventoryIndex];
- _wayneInventory[inventoryIndex] = 0;
- } else {
- _wayneInventory[inventoryIndex] += _garthInventory[inventoryIndex];
- _garthInventory[inventoryIndex] = 0;
- }
- refreshInventory(true);
- displayText("c08", 1, 0, -1, -1, 0);
- }
- _firstObjectNumber = -1;
- return;
- }
+ _firstObjectNumber = _objectNumber;
+ rememberFirstObjectName(_objectNumber);
+ return;
+ }
+
+ if (_firstObjectNumber >= kFirstInventoryObjectId && _firstObjectNumber <= kLastInventoryObjectId &&
+ (_objectNumber == -2 || _objectNumber == -3)) {
+ if (_firstObjectNumber == kObjectIdInventoryDrumstick || _firstObjectNumber == kObjectIdInventoryGuitar) {
+ displayText("c08", 2, 0, -1, -1, 0);
+ } else {
+ const int inventoryIndex = _firstObjectNumber - kFirstInventoryObjectId;
+ if (_objectNumber == -3) {
+ _garthInventory[inventoryIndex] += _wayneInventory[inventoryIndex];
+ _wayneInventory[inventoryIndex] = 0;
+ } else {
+ _wayneInventory[inventoryIndex] += _garthInventory[inventoryIndex];
+ _garthInventory[inventoryIndex] = 0;
+ }
+ refreshInventory(true);
+ displayText("c08", 1, 0, -1, -1, 0);
+ }
+ _firstObjectNumber = -1;
+ return;
+ }
const int actionTextIndex = _logic->handleVerbGive();
- _firstObjectNumber = -1;
+ _firstObjectNumber = -1;
- if (actionTextIndex != -1) {
- displayText("c08", actionTextIndex, 0, -1, -1, 0);
- }
+ if (actionTextIndex != -1) {
+ displayText("c08", actionTextIndex, 0, -1, -1, 0);
+ }
}
void WaynesWorldEngine::handleVerbOpen() {
_isTextVisible = false;
- if (_objectNumber <= kLastInventoryObjectId) {
- refreshActors();
- }
+ if (_objectNumber <= kLastInventoryObjectId) {
+ refreshActors();
+ }
const int actionTextIndex = _logic->handleVerbOpen();
- if (actionTextIndex != -1) {
- displayText("c09", actionTextIndex, 0, -1, -1, 0);
- }
-
- switch (actionTextIndex) {
- case 0:
- playSound("sv28.snd", 1);
- break;
- case 1:
- playSound("sv38.snd", 1);
- break;
+ if (actionTextIndex != -1) {
+ displayText("c09", actionTextIndex, 0, -1, -1, 0);
+ }
+
+ switch (actionTextIndex) {
+ case 0:
+ playSound("sv28.snd", 1);
+ break;
+ case 1:
+ playSound("sv38.snd", 1);
+ break;
case 5:
playSound("sv31.snd", 1);
break;
@@ -2194,38 +2194,38 @@ void WaynesWorldEngine::handleVerbOpen() {
playSound("sv47.snd", 1);
break;
case 10:
- playSound("sv28.snd", 1);
- break;
- case 11:
- playSound("sv21.snd", 1);
- break;
+ playSound("sv28.snd", 1);
+ break;
+ case 11:
+ playSound("sv21.snd", 1);
+ break;
default:
break;
- }
+ }
}
void WaynesWorldEngine::handleVerbClose() {
_isTextVisible = false;
- if (_objectNumber <= kLastInventoryObjectId) {
- refreshActors();
- }
+ if (_objectNumber <= kLastInventoryObjectId) {
+ refreshActors();
+ }
const int actionTextIndex = _logic->handleVerbClose();
- if (actionTextIndex != -1) {
- displayText("c10", actionTextIndex, 0, -1, -1, 0);
- }
+ if (actionTextIndex != -1) {
+ displayText("c10", actionTextIndex, 0, -1, -1, 0);
+ }
- switch (actionTextIndex) {
- case 0:
- playSound("sv47.snd", 1);
- break;
- case 1:
- playSound("sv21.snd", 1);
- break;
- default:
+ switch (actionTextIndex) {
+ case 0:
+ playSound("sv47.snd", 1);
break;
- }
+ case 1:
+ playSound("sv21.snd", 1);
+ break;
+ default:
+ break;
+ }
}
@@ -2234,66 +2234,66 @@ void WaynesWorldEngine::lookAtUnusedTicket() {
_mouseX = _mouseY = 10;
g_system->warpMouse(_mouseX, _mouseY);
- // sysMouseDriver(2);
- _gameState = 3;
- _logic->_didScratchTicket = false;
- stopRoomAnimations();
- if (!(_logic->_r10_flags & 0x80)) {
- _roomAnimations[19] = _r10Gxl->loadSurface("win.pcx");
- } else {
+ // sysMouseDriver(2);
+ _gameState = 3;
+ _logic->_didScratchTicket = false;
+ stopRoomAnimations();
+ if (!(_logic->_r10_flags & 0x80)) {
+ _roomAnimations[19] = _r10Gxl->loadSurface("win.pcx");
+ } else {
_roomAnimations[19] = _r10Gxl->loadSurface("nowin.pcx");
- }
- paletteFadeOut(0, 256, 64);
- _screen->clear(0);
- playSound("sv14.snd", 0);
- drawImageToScreen(_r10Gxl, "ticket.pcx", 0, 13);
- paletteFadeIn(0, 256, 64);
- // sysMouseDriver(1);
+ }
+ paletteFadeOut(0, 256, 64);
+ _screen->clear(0);
+ playSound("sv14.snd", 0);
+ drawImageToScreen(_r10Gxl, "ticket.pcx", 0, 13);
+ paletteFadeIn(0, 256, 64);
+ // sysMouseDriver(1);
}
void WaynesWorldEngine::unusedTicketHandleMouseMove() {
- if (_mouseX > 157 && _mouseY > 38 && _mouseX < 297 && _mouseY < 129) {
- _logic->_didScratchTicket = true;
- // Reveal partial image
- const int scratchX = _mouseX - 158;
- const int scratchY = _mouseY - 39;
+ if (_mouseX > 157 && _mouseY > 38 && _mouseX < 297 && _mouseY < 129) {
+ _logic->_didScratchTicket = true;
+ // Reveal partial image
+ const int scratchX = _mouseX - 158;
+ const int scratchY = _mouseY - 39;
Graphics::Surface scratchSurface = _roomAnimations[19]->getSubArea(Common::Rect(scratchX, scratchY, scratchX + 4, scratchY + 4));
_screen->drawSurface(&scratchSurface, _mouseX - 2, _mouseY - 2);
- }
+ }
}
void WaynesWorldEngine::unusedTicketHandleMouseClick() {
- int objectId = kObjectIdInventoryLosingTicket;
- int textIndex = 1;
- _gameState = 0;
- delete _roomAnimations[19];
+ int objectId = kObjectIdInventoryLosingTicket;
+ int textIndex = 1;
+ _gameState = 0;
+ delete _roomAnimations[19];
_roomAnimations[19] = nullptr;
- if (!((_logic->_r10_flags & 0x80))) {
- objectId = kObjectIdInventoryWinningTicket;
- textIndex = 0;
- }
- if (_logic->_didScratchTicket) {
- moveObjectToRoom(objectId, 99);
- moveObjectToNowhere(29);
- refreshInventory(false);
- _logic->_r10_flags |= 0x80;
- } else {
- textIndex = 2;
- }
- changeRoom(_currentRoomNumber);
- drawInterface(_verbNumber);
- displayText("c00", textIndex, 0, -1, -1, 0);
+ if (!((_logic->_r10_flags & 0x80))) {
+ objectId = kObjectIdInventoryWinningTicket;
+ textIndex = 0;
+ }
+ if (_logic->_didScratchTicket) {
+ moveObjectToRoom(objectId, 99);
+ moveObjectToNowhere(29);
+ refreshInventory(false);
+ _logic->_r10_flags |= 0x80;
+ } else {
+ textIndex = 2;
+ }
+ changeRoom(_currentRoomNumber);
+ drawInterface(_verbNumber);
+ displayText("c00", textIndex, 0, -1, -1, 0);
}
void WaynesWorldEngine::extremeCloseUpHandleMouseClick() {
- _gameState = 0;
- // sysMouseDriver(2);
- paletteFadeOut(0, 256, 16);
- _screen->clear(0);
- paletteFadeIn(0, 256, 16);
- drawInterface(_verbNumber);
- loadRoomBackground();
- // sysMouseDriver(1);
+ _gameState = 0;
+ // sysMouseDriver(2);
+ paletteFadeOut(0, 256, 16);
+ _screen->clear(0);
+ paletteFadeIn(0, 256, 16);
+ drawInterface(_verbNumber);
+ loadRoomBackground();
+ // sysMouseDriver(1);
}
void WaynesWorldEngine::gxCloseLib(GxlArchive *lib) {
diff --git a/engines/waynesworld/waynesworld.h b/engines/waynesworld/waynesworld.h
index 87994df6e0f..f1e88823e66 100644
--- a/engines/waynesworld/waynesworld.h
+++ b/engines/waynesworld/waynesworld.h
@@ -42,7 +42,7 @@ namespace WaynesWorld {
class GxlArchive;
enum {
- GF_GUILANGSWITCH = (1 << 0) // If GUI language switch is required for menus
+ GF_GUILANGSWITCH = (1 << 0) // If GUI language switch is required for menus
};
class Screen;
@@ -60,11 +60,11 @@ struct SavegameHeader {
};
struct RoomObject {
- int roomNumber;
- const char *name;
- int x1, y1, x2, y2;
- int direction;
- int walkX, walkY;
+ int roomNumber;
+ const char *name;
+ int x1, y1, x2, y2;
+ int direction;
+ int walkX, walkY;
};
struct StaticRoomObjectMapEntry {
@@ -77,7 +77,7 @@ struct StaticRoomObject {
};
struct WalkPoint {
- int x, y, direction;
+ int x, y, direction;
};
struct AnimationTimer {
More information about the Scummvm-git-logs
mailing list