X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEngine.cc;h=80a203e6989b368a86cb12c0790568fef0bc7b6c;hp=d7d04a846af6bc54753551d1135d582b481fab06;hb=5250c138b1a692e4e893a8f424d2856e519fd652;hpb=a5f0d391406a68275b41448fc3f49e8d8396c497 diff --git a/src/Moof/Engine.cc b/src/Moof/Engine.cc index d7d04a8..80a203e 100644 --- a/src/Moof/Engine.cc +++ b/src/Moof/Engine.cc @@ -27,15 +27,15 @@ *******************************************************************************/ #include // exit -#include #include #include #include "fastevents.h" -#include #include +#include "Dispatcher.hh" #include "Engine.hh" +#include "Log.hh" #include "Random.hh" #include "Settings.hh" #include "Timer.hh" @@ -53,18 +53,19 @@ public: Engine* outer) : interface(outer) { +#if defined(_WIN32) || defined (_WIN64) || defined(__WIN32__) + if (SDL_Init(SDL_INIT_EVERYTHING) != 0) +#else if (SDL_Init(SDL_INIT_EVERYTHING | SDL_INIT_EVENTTHREAD) != 0) +#endif { - throw Exception(SDL_GetError()); + logError("sdl is complaining: %s", SDL_GetError()); + throw Exception(Exception::SDL_ERROR); } if (FE_Init() != 0) { - throw Exception(FE_GetError()); - } - if (Sound_Init() != 0) - { - //throw Exception(Sound_GetError()); - std::cerr << Sound_GetError() << std::endl; + logError("fast events error: %s", FE_GetError()); + throw Exception(Exception::SDL_ERROR); } alutInit(&argc, argv); @@ -87,7 +88,7 @@ public: printFps = false; settings.get("video.printfps", printFps); - video = VideoPtr(new Video(name, iconFile)); + video = Video::alloc(name, iconFile); video->makeActive(); } @@ -97,7 +98,6 @@ public: video.reset(); alutExit(); - Sound_Quit(); FE_Quit(); SDL_Quit(); } @@ -167,7 +167,7 @@ public: if (printFps) { - std::cout << "FPS: " << fps << std::endl; + logInfo("framerate: %d fps", fps); } } @@ -219,7 +219,7 @@ public: Engine* interface; - VideoPtr video; + VideoP video; bool running; int exitCode;