diff options
| author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-28 23:45:34 +0700 |
|---|---|---|
| committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-28 23:45:34 +0700 |
| commit | bd8985065f2377a62f0ee9f4236d5cd9ad99dfe4 (patch) | |
| tree | cee76279026bbba88fededfc9474c8eba67d5c2d /src/GameLoop.cpp | |
| parent | 036ab1d1051b54e71f80fbb791bf69bd7c236f62 (diff) | |
| download | blackshades-bd8985065f2377a62f0ee9f4236d5cd9ad99dfe4.tar.gz | |
Reorganize key mappings
Diffstat (limited to 'src/GameLoop.cpp')
| -rw-r--r-- | src/GameLoop.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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; |
