From 1878e7c1f8cef670e740a8f63f48afcb98386cdf Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Mon, 1 Sep 2008 23:42:15 -0400 Subject: [PATCH] keys setup to use extern --- src/config/config.cpp | 6 ------ src/config/keys.cpp | 23 +++++------------------ src/config/keys.h | 11 ++++------- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/config/config.cpp b/src/config/config.cpp index 1e15c69..0980076 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -34,16 +34,10 @@ void cfg::init() readConfigs(NULL); // TODO read in config files - - key::init(); - - cout << &key::end << endl; } void cfg::clean() { // TODO save to config files? - - key::clean(); } /// ***** Public Methods ***** diff --git a/src/config/keys.cpp b/src/config/keys.cpp index 6a15f6e..6ac87bb 100644 --- a/src/config/keys.cpp +++ b/src/config/keys.cpp @@ -20,21 +20,8 @@ #include -/// ***** Private Method Headers ***** -/// ***** Private Variables ***** - -/// ***** Initializers/Cleaners ***** -void key::init() -{ - pause = SDLK_p; - end = SDLK_ESCAPE; - - follow = SDLK_f; - - well = SDLK_SPACE; - - cout << &key::end << endl; -} -void key::clean() -{ -} +/// ***** Definitions of the extern keys ***** +SDLKey key::pause = SDLK_p; +SDLKey key::end = SDLK_ESCAPE; +SDLKey key::follow = SDLK_f; +SDLKey key::well = SDLK_SPACE; diff --git a/src/config/keys.h b/src/config/keys.h index 9244a6f..42fd378 100644 --- a/src/config/keys.h +++ b/src/config/keys.h @@ -24,13 +24,10 @@ /// ***** Header Methods ***** namespace key { - void init(); - void clean(); - - static SDLKey pause; - static SDLKey end; - static SDLKey follow; - static SDLKey well; + extern SDLKey pause; + extern SDLKey end; + extern SDLKey follow; + extern SDLKey well; } #endif // KEYS_H -- 2.10.2