X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEngine.cc;h=df6b35a8e92d2fece2439fe9a0499884d07f480c;hp=78233688d60f69dba90c880a0c9e94b9518f0814;hb=f72400af4fa3e7b54dab154b5a2b6503a6f9af18;hpb=bfa6212d09d8735d8fd5e2638188e4a99f21ada4 diff --git a/src/Moof/Engine.cc b/src/Moof/Engine.cc index 7823368..df6b35a 100644 --- a/src/Moof/Engine.cc +++ b/src/Moof/Engine.cc @@ -35,7 +35,6 @@ #include #include -#include "Dispatcher.hh" #include "Engine.hh" #include "Random.hh" #include "Settings.hh" @@ -52,24 +51,28 @@ public: Impl(int argc, char* argv[], const std::string& configFile, const std::string& name, const std::string& iconFile, Engine* outer) : - interface(outer), - settings(argc, argv) + interface(outer) { if (SDL_Init(SDL_INIT_EVERYTHING | SDL_INIT_EVENTTHREAD) != 0) { - throw Exception(SDL_GetError()); + std::cerr << "sdl is complaining: " << SDL_GetError() << std::endl; + throw Exception(Exception::SDL_ERROR); } if (FE_Init() != 0) { - throw Exception(FE_GetError()); + std::cerr << "fast events error: " << FE_GetError() << std::endl; + throw Exception(Exception::SDL_ERROR); } - if (Sound_Init() != 0) + if (Sound_Init() == 0) { - //throw Exception(Sound_GetError()); - std::cerr << Sound_GetError() << std::endl; + std::cerr << "sound initialization failed: " << Sound_GetError() + << std::endl; + throw Exception(Exception::SDL_ERROR); } alutInit(&argc, argv); + Settings& settings = Settings::getInstance(); + settings.parseArgs(argc, argv); settings.loadFromFile(configFile); long randomSeed; @@ -87,7 +90,7 @@ public: printFps = false; settings.get("video.printfps", printFps); - video = VideoPtr(new Video(name, iconFile)); + video = Video::alloc(name, iconFile); video->makeActive(); } @@ -219,9 +222,7 @@ public: Engine* interface; - Settings settings; - Dispatcher dispatcher; - VideoPtr video; + VideoP video; bool running; int exitCode;