]> git.localhorst.tv Git - l2e.git/blobdiff - src/main.cpp
simplified definition postponing
[l2e.git] / src / main.cpp
index 05f3d8ad231057619d140110c6f6b42b0cc95abc..d790928dc4fb851c7a96b956a92dbff3fdd5a47e 100644 (file)
@@ -1,3 +1,4 @@
+#include "keys.h"
 #include "app/Application.h"
 #include "app/Arguments.h"
 #include "app/Input.h"
@@ -178,7 +179,7 @@ int main(int argc, char **argv) {
 
                if (intp.PostponedDefinitions().size() > 0) {
                        for (vector<Interpreter::PostponedDefinition>::const_iterator i(intp.PostponedDefinitions().begin()), end(intp.PostponedDefinitions().end()); i != end; ++i) {
-                               std::cerr << "missing definition of " << TypeDescription::Get(i->linkedType).TypeName() << " " << i->identifier << std::endl;
+                               std::cerr << "missing definition of " << TypeDescription::Get(i->type).TypeName() << " " << i->identifier << std::endl;
                        }
                        return 3;
                }
@@ -320,22 +321,7 @@ int main(int argc, char **argv) {
                }
 
                Application app(screen, state);
-               app.Buttons().MapKey(SDLK_w, Input::PAD_UP);
-               app.Buttons().MapKey(SDLK_d, Input::PAD_RIGHT);
-               app.Buttons().MapKey(SDLK_s, Input::PAD_DOWN);
-               app.Buttons().MapKey(SDLK_a, Input::PAD_LEFT);
-               app.Buttons().MapKey(SDLK_RIGHT, Input::ACTION_A);
-               app.Buttons().MapKey(SDLK_DOWN, Input::ACTION_B);
-               app.Buttons().MapKey(SDLK_UP, Input::ACTION_X);
-               app.Buttons().MapKey(SDLK_LEFT, Input::ACTION_Y);
-               app.Buttons().MapKey(SDLK_RETURN, Input::START);
-               app.Buttons().MapKey(SDLK_SPACE, Input::SELECT);
-               app.Buttons().MapKey(SDLK_RSHIFT, Input::SHOULDER_RIGHT);
-               app.Buttons().MapKey(SDLK_LSHIFT, Input::SHOULDER_LEFT);
-               app.Buttons().MapKey(SDLK_1, Input::DEBUG_1);
-               app.Buttons().MapKey(SDLK_2, Input::DEBUG_2);
-               app.Buttons().MapKey(SDLK_3, Input::DEBUG_3);
-               app.Buttons().MapKey(SDLK_4, Input::DEBUG_4);
+               MapKeys(app.Buttons());
                app.Run();
 
                return 0;