aboutsummaryrefslogtreecommitdiff
path: root/src/GameLoop.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-10-29 11:56:11 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-10-29 11:56:11 +0700
commit9953dae353e6166946e21430f63854927d1db2d7 (patch)
treed6c4b6caf4fca5faacd103ba523e23356abfd5c6 /src/GameLoop.cpp
parentbd8985065f2377a62f0ee9f4236d5cd9ad99dfe4 (diff)
downloadblackshades-9953dae353e6166946e21430f63854927d1db2d7.tar.gz
Make the rest keys configurable
Diffstat (limited to 'src/GameLoop.cpp')
-rw-r--r--src/GameLoop.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp
index 8a1af59..cc383c8 100644
--- a/src/GameLoop.cpp
+++ b/src/GameLoop.cpp
@@ -38,12 +38,6 @@ void handleKey(Game* game, int key, int action, int mods)
{
if (action != GLFW_PRESS)
return;
- if (game->menu) {
- if (key == GLFW_KEY_SPACE)
- setMenu(game, false);
- return;
- }
-
auto& player = game->person[0];
if (key == GLFW_KEY_ESCAPE) {
alSourcePause(gSourceID[rainsound]);
@@ -63,9 +57,9 @@ void handleKey(Game* game, int key, int action, int mods)
alSourcef(gSourceID[mainmenusong], AL_MIN_GAIN, 0);
alSourcePlay(gSourceID[game->whichsong]);
alSourcef(gSourceID[game->whichsong], AL_MIN_GAIN, 1);
- } else if (key == GLFW_KEY_L) {
+ } else if (key == keymap.laser_sight) {
game->lasersight ^= 1;
- } else if (key == GLFW_KEY_SPACE) {
+ } else if (key == keymap.dive) {
if (player.playerrotation == player.playerlowrotation
&& player.targetanimation == joganim
&& player.currentanimation == joganim
@@ -74,7 +68,7 @@ void handleKey(Game* game, int key, int action, int mods)
player.targetframe = player.target = 0;
player.aimamount = 0;
}
- } else if (key == GLFW_KEY_R) {
+ } else if (key == keymap.reload) {
if (player.whichgun != grenade
&& player.reloads[player.whichgun] > 0
&& player.reloading <= 0)