From bd8985065f2377a62f0ee9f4236d5cd9ad99dfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Thu, 28 Oct 2021 23:45:34 +0700 Subject: Reorganize key mappings --- src/GameLoop.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/GameLoop.cpp') diff --git a/src/GameLoop.cpp b/src/GameLoop.cpp index 06d4e90..8a1af59 100644 --- a/src/GameLoop.cpp +++ b/src/GameLoop.cpp @@ -32,9 +32,7 @@ extern float rad2deg; extern Fog fog; extern int environment; extern int slomo; -extern int aimkey; -extern int psychicaimkey; -extern int psychickey; +extern struct Key keymap; void handleKey(Game* game, int key, int action, int mods) { @@ -81,9 +79,9 @@ void handleKey(Game* game, int key, int action, int mods) && player.reloads[player.whichgun] > 0 && player.reloading <= 0) player.ammo = -1; - } else if (key == aimkey) { + } else if (key == keymap.aim) { player.aiming ^= 1; - } else if (key == psychicaimkey) { + } else if (key == keymap.psychic_aim) { // Picking up gun from rag doll if (player.currentanimation == crouchanim && (!player.aiming || player.whichgun == nogun @@ -125,7 +123,7 @@ void handleKey(Game* game, int key, int action, int mods) alSourcef(gSourceID[shootsong], AL_PITCH, 0.5f); alSourcef(gSourceID[zombiesong], AL_PITCH, 0.5f); } - } else if (key == psychickey) { + } else if (key == keymap.psychic) { if (visions ^= 1) { game->flashamount = game->flashr = 1; game->flashg = game->flashb = 0; -- cgit v1.2.3