X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEngine.cc;h=78233688d60f69dba90c880a0c9e94b9518f0814;hp=53fca73e9e883cfab1d18aced70cd125391f26d1;hb=bfa6212d09d8735d8fd5e2638188e4a99f21ada4;hpb=eebb993ca929c3f4c235cad9e01dc4797fcd2945 diff --git a/src/Moof/Engine.cc b/src/Moof/Engine.cc index 53fca73..7823368 100644 --- a/src/Moof/Engine.cc +++ b/src/Moof/Engine.cc @@ -32,6 +32,8 @@ #include #include "fastevents.h" +#include +#include #include "Dispatcher.hh" #include "Engine.hh" @@ -44,10 +46,10 @@ namespace Mf { -class Engine::EngineImpl +class Engine::Impl { public: - EngineImpl(int argc, char* argv[], const std::string& configFile, + Impl(int argc, char* argv[], const std::string& configFile, const std::string& name, const std::string& iconFile, Engine* outer) : interface(outer), @@ -61,18 +63,18 @@ public: { throw Exception(FE_GetError()); } + if (Sound_Init() != 0) + { + //throw Exception(Sound_GetError()); + std::cerr << Sound_GetError() << std::endl; + } + alutInit(&argc, argv); settings.loadFromFile(configFile); long randomSeed; - if (settings.get("engine.rngseed", randomSeed)) - { - setSeed(randomSeed); - } - else - { - setSeed(); - } + if (settings.get("engine.rngseed", randomSeed)) setSeed(randomSeed); + else setSeed(); double ts = 0.01; settings.get("engine.timestep", ts); @@ -89,11 +91,13 @@ public: video->makeActive(); } - ~EngineImpl() + ~Impl() { // the video object must be destroyed before we can shutdown SDL video.reset(); + alutExit(); + Sound_Quit(); FE_Quit(); SDL_Quit(); } @@ -232,8 +236,7 @@ public: Engine::Engine(int argc, char* argv[], const std::string& configFile, const std::string& name, const std::string& iconFile) : - impl_(new Engine::EngineImpl(argc, argv, configFile, name, iconFile, this)) -{} + impl_(new Engine::Impl(argc, argv, configFile, name, iconFile, this)) {} Engine::~Engine() {}