aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-07-03 14:49:42 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-07-03 14:49:42 -0400
commit4907843ac7a43d5d3519f9696ae90e0736d96c9d (patch)
treee46b99c162f4fe923e293bd49a64157ce0ce1266 /src/ui.cpp
parentd96c869152527ae0c570de1d1c8552ec64d7fddb (diff)
control updating, WIP DO NOT PULL
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index 2d7f8bc..9644381 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -30,7 +30,7 @@ extern std::vector<NPC *> aipreload;
extern bool gameRunning;
-static SDL_Keycode controlMap[] = {
+static std::array<SDL_Keycode, 7> controlMap = {
SDLK_w, SDLK_s, SDLK_a, SDLK_d, SDLK_LSHIFT, SDLK_LCTRL, SDLK_e
};
@@ -39,6 +39,14 @@ void setControl(unsigned int index, SDL_Keycode key)
controlMap[index] = key;
}
+SDL_Keycode getControl(unsigned int index)
+{
+ if (index >= controlMap.size())
+ return 0;
+
+ return controlMap[index];
+}
+
/**
* Freetype variables
*/