MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Dispose

Method Dispose

Source/Main/engine.cpp:552–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550Engine* Engine::instance_ = NULL;
551
552void Engine::Dispose() {
553 ModLoading::Instance().DeRegisterCallback(this);
554 ModLoading::Instance().Dispose();
555
556 config.GetRef("menu_show_state") = show_state;
557 config.GetRef("menu_show_performance") = show_performance;
558 config.GetRef("menu_show_log") = show_log;
559 config.GetRef("menu_show_warnings") = show_warnings;
560 config.GetRef("menu_show_save") = show_save;
561 config.GetRef("menu_show_sound") = show_sound;
562 config.GetRef("menu_show_mod_menu") = show_mod_menu;
563 config.GetRef("menu_show_asdebugger_contexts") = show_asdebugger_contexts;
564 config.GetRef("menu_show_asprofiler") = show_asprofiler;
565 config.GetRef("menu_show_mp_debug") = show_mp_debug;
566 config.GetRef("menu_show_mp_info") = show_mp_info;
567 config.GetRef("menu_show_input_debug") = show_input_debug;
568 config.GetRef("menu_show_mp_settings") = show_mp_settings;
569
570 if (scenegraph_) {
571 scenegraph_->map_editor->gui = NULL;
572 scenegraph_->Dispose();
573 delete scenegraph_;
574 scenegraph_ = NULL;
575 }
576 if (scriptable_menu_)
577 delete scriptable_menu_;
578
579 for (auto& g_text_atla : g_text_atlas) {
580 g_text_atla.Dispose();
581 }
582 Models::Instance()->Dispose();
583 ActiveCameras::Get()->SetCameraObject(NULL);
584 particle_types.Dispose();
585 g_text_atlas_renderer.Dispose();
586 Input::Instance()->Dispose();
587 DecalTextures::Dispose();
588 Textures::Instance()->Dispose();
589 Shaders::Instance()->Dispose();
590 DebugDraw::Instance()->Dispose();
591 DisposeTextAtlases();
592 ScriptFileCache::Instance()->Dispose();
593 sound.Dispose();
594 ActiveCameras::Instance()->Dispose();
595 Graphics::Instance()->Dispose();
596 asset_manager.Dispose();
597 IMrefCountTracker.logSanityCheck();
598 Online::Instance()->Dispose();
599#if ENABLE_STEAMWORKS
600 Steamworks::Instance()->Dispose();
601#endif
602 as_network.Dispose();
603 DisposeImGui();
604
605 SDLNet_Quit();
606 SDL_Quit();
607
608 // Save config on shutdown, in case we have some global data stored in the configuration.
609 std::string config_path = GetConfigPath();

Callers 2

ClearLoadedLevelMethod · 0.45
GameMainFunction · 0.45

Calls 12

DisposeTextAtlasesFunction · 0.85
DisposeImGuiFunction · 0.85
GetConfigPathFunction · 0.85
ovr_ShutdownFunction · 0.85
DeRegisterCallbackMethod · 0.80
SetCameraObjectMethod · 0.80
logSanityCheckMethod · 0.80
GetFunction · 0.50
VR_ShutdownFunction · 0.50
GetRefMethod · 0.45
SaveMethod · 0.45

Tested by

no test coverage detected