MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ObjectListLoad

Function ObjectListLoad

src/openrct2/Editor.cpp:71–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 static void ClearMapForEditing(bool fromSave);
70
71 static void ObjectListLoad()
72 {
73 auto* context = GetContext();
74 context->OpenProgress(STR_LOADING_GENERIC);
75
76 // Unload objects first, the repository is re-populated which owns the objects.
77 auto& objectManager = context->GetObjectManager();
78 objectManager.UnloadAll();
79
80 // Scan objects if necessary
81 const auto& localisationService = context->GetLocalisationService();
82 auto& objectRepository = context->GetObjectRepository();
83 objectRepository.LoadOrConstruct(localisationService.GetCurrentLanguage());
84
85 Audio::LoadAudioObjects();
86
87 // Reset loaded objects to just defaults
88 // Load minimum required objects (like surface and edge)
89 for (const auto& entry : kMinimumRequiredObjects)
90 {
91 objectManager.LoadObject(entry);
92 }
93
94 context->CloseProgress();
95 }
96
97 static WindowBase* OpenEditorWindows()
98 {

Callers 3

LoadFunction · 0.85
LoadTrackDesignerFunction · 0.85
LoadTrackManagerFunction · 0.85

Calls 8

GetContextFunction · 0.85
LoadAudioObjectsFunction · 0.85
OpenProgressMethod · 0.80
UnloadAllMethod · 0.80
LoadOrConstructMethod · 0.80
GetCurrentLanguageMethod · 0.80
CloseProgressMethod · 0.80
LoadObjectMethod · 0.45

Tested by

no test coverage detected