aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-10-02 07:06:20 +0000
committerTravis Howell2006-10-02 07:06:20 +0000
commitad9b7645318428f33fc5587aa49a87ab2eb034c6 (patch)
treec23aff1c063884e35c2acadff39ea256e53d7759
parent6bcd0183c0934e581b2f5e0f9bb5a26b27229a35 (diff)
downloadscummvm-rg350-ad9b7645318428f33fc5587aa49a87ab2eb034c6.tar.gz
scummvm-rg350-ad9b7645318428f33fc5587aa49a87ab2eb034c6.tar.bz2
scummvm-rg350-ad9b7645318428f33fc5587aa49a87ab2eb034c6.zip
Fix arrows keys in swampy
svn-id: r24064
-rw-r--r--engines/agos/agos.cpp40
-rw-r--r--engines/agos/agos.h2
-rw-r--r--engines/agos/items.cpp6
-rw-r--r--engines/agos/rules.cpp2
4 files changed, 45 insertions, 5 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 211f10b2a2..c7d424dd9b 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -1200,10 +1200,13 @@ startOver:
for (;;) {
if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) && _keyPressed == 35)
displayBoxStars();
- processSpecialKeys();
- if (getGameType() == GType_PP && _keyPressed != 0) {
- _needHitAreaRecalc++;
- return;
+ if (getGameType() == GType_PP) {
+ if (checkArrows() != 0) {
+ _needHitAreaRecalc++;
+ return;
+ }
+ } else {
+ processSpecialKeys();
}
if (_lastHitArea3 == (HitArea *) -1)
goto startOver;
@@ -1767,6 +1770,27 @@ bool AGOSEngine::isSpriteLoaded(uint16 id, uint16 zoneNum) {
return false;
}
+bool AGOSEngine::checkArrows() {
+ switch (_keyPressed) {
+ case 17: // Up
+ _verbHitArea = 302;
+ break;
+ case 18: // Down
+ _verbHitArea = 304;
+ break;
+ case 19: // Right
+ _verbHitArea = 303;
+ break;
+ case 20: // Left
+ _verbHitArea = 301;
+ break;
+ }
+
+ bool result = (_keyPressed != 0);
+ _keyPressed = 0;
+ return result;
+}
+
void AGOSEngine::processSpecialKeys() {
switch (_keyPressed) {
case 17: // Up
@@ -2168,7 +2192,15 @@ void AGOSEngine::delay(uint amount) {
_fastMode ^= 1;
else if (event.kbd.keycode == 'd')
_debugger->attach();
+ }
+
+ if (getGameType() == GType_PP) {
+ if (event.kbd.flags == OSystem::KBD_SHIFT)
+ _variableArray[41] = 0;
+ else
+ _variableArray[41] = 1;
}
+
// Make sure backspace works right (this fixes a small issue on OS X)
if (event.kbd.keycode == 8)
_keyPressed = 8;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 8e51c1615d..c010c74b60 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -740,6 +740,7 @@ protected:
void loadIconData();
void loadIconFile();
+ bool checkArrows();
void processSpecialKeys();
void hitarea_stuff_helper();
@@ -1098,6 +1099,7 @@ public:
void o4_loadHiScores();
void o4_checkHiScores();
void o4_sync();
+ void o4_saveUserGame();
void o4_loadUserGame();
void o4_saveOopsPosition();
void o4_resetGameTime();
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index e40560d93d..4651cbafc5 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -455,7 +455,7 @@ void AGOSEngine::setupPuzzleOpcodes(OpcodeProc *op) {
op[124] = &AGOSEngine::o3_ifTime;
op[127] = NULL;
op[131] = &AGOSEngine::o3_setTime;
- op[132] = &AGOSEngine::o3_saveUserGame;
+ op[132] = &AGOSEngine::o4_saveUserGame;
op[133] = &AGOSEngine::o4_loadUserGame;
op[134] = &AGOSEngine::o3_listSaveGames;
op[161] = &AGOSEngine::o3_screenTextBox;
@@ -2543,6 +2543,10 @@ void AGOSEngine::o4_sync() {
sendSync(a);
}
+void AGOSEngine::o4_saveUserGame() {
+ // 132: save game
+}
+
void AGOSEngine::o4_loadUserGame() {
// 133: load usergame
}
diff --git a/engines/agos/rules.cpp b/engines/agos/rules.cpp
index 157ceec748..2152aa9887 100644
--- a/engines/agos/rules.cpp
+++ b/engines/agos/rules.cpp
@@ -285,6 +285,8 @@ bool AGOSEngine::block1Supported(int i, int y) {
}
void AGOSEngine::checkTiles() {
+ printf("checkTiles\n");
+
const byte *tile;
uint i, slot;