X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Fgame.c;h=491c290d7a68119a44bdada97268118e798e3b91;hb=a0f9dd84ca26309a8ab518caed02a0ce7debd4e2;hp=48d1bfc1b42282897fdfa2c990eb6db6305af736;hpb=1b285de069191476ea03c37904dc7184d73548f4;p=rocksndiamonds.git diff --git a/src/game_em/game.c b/src/game_em/game.c index 48d1bfc1..491c290d 100644 --- a/src/game_em/game.c +++ b/src/game_em/game.c @@ -16,29 +16,33 @@ struct EngineSnapshotInfo_EM engine_snapshot_em; static void readjoy(byte action, struct PLAYER *ply) { - int north = 0, east = 0, south = 0, west = 0; - int snap = 0, drop = 0; + boolean north = FALSE; + boolean east = FALSE; + boolean south = FALSE; + boolean west = FALSE; + boolean snap = FALSE; + boolean drop = FALSE; if (game_em.use_single_button && action & (JOY_BUTTON_1 | JOY_BUTTON_2)) action |= JOY_BUTTON_1 | JOY_BUTTON_2; if (action & JOY_LEFT) - west = 1; + west = TRUE; if (action & JOY_RIGHT) - east = 1; + east = TRUE; if (action & JOY_UP) - north = 1; + north = TRUE; if (action & JOY_DOWN) - south = 1; + south = TRUE; if (action & JOY_BUTTON_1) - snap = 1; + snap = TRUE; if (action & JOY_BUTTON_2) - drop = 1; + drop = TRUE; /* always update drop action */ ply->joy_drop = drop; @@ -83,12 +87,15 @@ void GameActions_EM(byte action[MAX_PLAYERS], boolean warp_mode) game_em.random = game_em.random * 129 + 1; - frame = (frame - 1) & 7; + frame = (frame + 1) % 8; for (i = 0; i < MAX_PLAYERS; i++) readjoy(action[i], &ply[i]); - UpdateEngineValues(screen_x / TILEX, screen_y / TILEY, ply[0].x, ply[0].y); + UpdateEngineValues(CAVE_POS_X(screen_x / TILEX), + CAVE_POS_Y(screen_y / TILEY), + CAVE_POS_X(ply[0].x), + CAVE_POS_Y(ply[0].y)); logic();