MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / main

Function main

src/OD2/main.cpp:180–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180int main(const int argc, char **argv) {
181 Abyss::Common::Log::info("Starting up...");
182
183 try {
184 auto &engine = Abyss::AbyssEngine::getInstance();
185
186 if (!engine.processCommandLineArguments(argc, argv))
187 return 0;
188
189 engine.setWindowTitle("OpenDiablo II");
190
191 engine.initializeFiles();
192 loadPalettes();
193 loadFonts();
194 loadDataTables();
195 loadButtonDefs();
196
197 engine.addCursorImage("Default", OD2::Common::ResourcePaths::MousePointers::CursorDefault,
198 OD2::Common::PaletteManager::getInstance().getPalette("Static"));
199 engine.setCursorImage("Default");
200 engine.getMouseState().setVisible(true);
201 engine.setScene(std::make_unique<OD2::Scenes::MainMenu::MainMenu>());
202
203 Abyss::Common::Log::info("Startup complete");
204 //engine.setMasterVolumeLevel(0.0f);
205
206 engine.run();
207 } catch (const std::exception &exception) {
208 Abyss::Common::Log::error("{}", exception.what());
209 // SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Abyss Engine", exception.what(), nullptr);
210 return 1;
211 } catch (...) {
212 Abyss::Common::Log::error("Unknown exception");
213 // SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Abyss Engine", "Unknown exception", nullptr);
214 return 2;
215 }
216
217 return 0;
218}

Callers

nothing calls this directly

Calls 14

infoFunction · 0.85
loadPalettesFunction · 0.85
loadFontsFunction · 0.85
loadDataTablesFunction · 0.85
loadButtonDefsFunction · 0.85
errorFunction · 0.85
setWindowTitleMethod · 0.80
initializeFilesMethod · 0.80
addCursorImageMethod · 0.80
setCursorImageMethod · 0.80
setVisibleMethod · 0.80

Tested by

no test coverage detected