Fix arrows keys in swampy

svn-id: r24064
This commit is contained in:
Travis Howell 2006-10-02 07:06:20 +00:00
parent 6bcd0183c0
commit ad9b764531
4 changed files with 45 additions and 5 deletions

View File

@ -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;

View File

@ -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();

View File

@ -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
}

View File

@ -285,6 +285,8 @@ bool AGOSEngine::block1Supported(int i, int y) {
}
void AGOSEngine::checkTiles() {
printf("checkTiles\n");
const byte *tile;
uint i, slot;