void EngineMain::run(const bpo::variables_map& variables) { Settings::Settings settings; if(!settings.loadUserSettings()) return; size_t resolutionWidth = settings.get<size_t>("Display","resolutionWidth"); size_t resolutionHeight = settings.get<size_t>("Display","resolutionHeight"); bool fullscreen = settings.get<size_t>("Display", "fullscreen"); std::string pathEXE = settings.get<std::string>("Game", "PathEXE"); if (pathEXE == "") { pathEXE = "Diablo.exe"; } Engine::ThreadManager threadManager; FARender::Renderer renderer(resolutionWidth, resolutionHeight, fullscreen); mInputManager = new EngineInputManager(*this); std::thread mainThread(boost::bind(&EngineMain::runGameLoop, this, &variables, pathEXE)); threadManager.run(); renderDone = true; mainThread.join(); }
void EngineMain::run(const bpo::variables_map& variables) { Settings::Settings settings; if(!settings.loadUserSettings()) return; size_t resolutionWidth = settings.get<size_t>("Display","resolutionWidth"); size_t resolutionHeight = settings.get<size_t>("Display","resolutionHeight"); std::string fullscreen = settings.get<std::string>("Display", "fullscreen"); std::string pathEXE = settings.get<std::string>("Game", "PathEXE"); if (pathEXE == "") { pathEXE = "Diablo.exe"; } Engine::ThreadManager threadManager; FARender::Renderer renderer(resolutionWidth, resolutionHeight, fullscreen == "true"); mInputManager = std::make_shared<EngineInputManager>(renderer.getNuklearContext()); mInputManager->registerKeyboardObserver(this); std::thread mainThread(std::bind(&EngineMain::runGameLoop, this, &variables, pathEXE)); threadManager.run(); renderDone = true; mainThread.join(); }
void playLevelMusic(int32_t currentLevel, Engine::ThreadManager& threadManager) { switch(currentLevel) { case 0: { threadManager.playMusic("music/dtowne.wav"); break; } case 1: case 2: case 3: case 4: { threadManager.playMusic("music/dlvla.wav"); break; } case 5: case 6: case 7: case 8: { threadManager.playMusic("music/dlvlb.wav"); break; } case 9: case 10: case 11: case 12: { threadManager.playMusic("music/dlvlc.wav"); break; } case 13: case 14: case 15: case 16: { threadManager.playMusic("music/dlvld.wav"); break; } } }
void run(const bpo::variables_map& variables) { StartupSettings settings; if (!loadSettings(settings)) return; Engine::ThreadManager threadManager; FARender::Renderer renderer(settings.resolutionWidth, settings.resolutionHeight); Input::InputManager input(&keyPress, NULL, &mouseClick, &mouseRelease, &mouseMove, renderer.getRocketContext()); boost::thread mainThread(boost::bind(&runGameLoop, &variables)); threadManager.run(); renderDone = true; mainThread.join(); }