X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FEngine.cc;h=27406521da79693040a6e8b7bdc9e34dd141528e;hb=8ad81a8282ce6e9e488a453e6bcd05fbc09715dc;hp=d7d04a846af6bc54753551d1135d582b481fab06;hpb=a5f0d391406a68275b41448fc3f49e8d8396c497;p=chaz%2Fyoink diff --git a/src/Moof/Engine.cc b/src/Moof/Engine.cc index d7d04a8..2740652 100644 --- a/src/Moof/Engine.cc +++ b/src/Moof/Engine.cc @@ -53,18 +53,25 @@ 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()); + 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); @@ -87,7 +94,7 @@ public: printFps = false; settings.get("video.printfps", printFps); - video = VideoPtr(new Video(name, iconFile)); + video = Video::alloc(name, iconFile); video->makeActive(); } @@ -219,7 +226,7 @@ public: Engine* interface; - VideoPtr video; + VideoP video; bool running; int exitCode;