Skip to content

Commit

Permalink
You can now use the directional keys to scroll the front map. (dkfans…
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamPlenty committed Jul 23, 2022
1 parent c8e14db commit 9b1973d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/front_landview.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "vidmode.h"
#include "vidfade.h"
#include "game_legacy.h"
#include "front_input.h"

#include "keeperfx.hpp"

Expand Down Expand Up @@ -1197,15 +1198,15 @@ void frontmap_draw(void)
void check_mouse_scroll(void)
{
long mx = GetMouseX();
if (mx < 8)
if ( (mx < 8) || ( (is_game_key_pressed(Gkey_MoveLeft, NULL, false)) || (is_key_pressed(KC_LEFT,KMod_DONTCARE)) ) )
{
map_info.velocity_x -= 8;
if (map_info.velocity_x < -48)
map_info.velocity_x = -48;
if (map_info.velocity_x > 48)
map_info.velocity_x = 48;
} else
if (mx >= lbDisplay.PhysicalScreenWidth-8)
if ( (mx >= lbDisplay.PhysicalScreenWidth-8) || ( (is_game_key_pressed(Gkey_MoveRight, NULL, false)) || (is_key_pressed(KC_RIGHT,KMod_DONTCARE)) ) )
{
map_info.velocity_x += 8;
if (map_info.velocity_x < -48)
Expand All @@ -1214,15 +1215,15 @@ void check_mouse_scroll(void)
map_info.velocity_x = 48;
}
long my = GetMouseY();
if (my < 8)
if ( (my < 8) || ( (is_game_key_pressed(Gkey_MoveUp, NULL, false)) || (is_key_pressed(KC_UP,KMod_DONTCARE)) ) )
{
map_info.velocity_y -= 8;
if (map_info.velocity_y < -48)
map_info.velocity_y = -48;
if (map_info.velocity_y > 48)
map_info.velocity_y = 48;
} else
if (my >= lbDisplay.PhysicalScreenHeight-8)
if ( (my >= lbDisplay.PhysicalScreenHeight-8) || ( (is_game_key_pressed(Gkey_MoveDown, NULL, false)) || (is_key_pressed(KC_DOWN,KMod_DONTCARE)) ) )
{
map_info.velocity_y += 8;
if (map_info.velocity_y < -48)
Expand Down

0 comments on commit 9b1973d

Please sign in to comment.