MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / ~CLevel

Method ~CLevel

ogsr_engine/xrGame/Level.cpp:131–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131CLevel::~CLevel()
132{
133 xr_delete(g_player_hud);
134 // g_pGameLevel = NULL;
135 Msg("- Destroying level");
136
137 Engine.Event.Handler_Detach(eEntitySpawn, this);
138
139 Engine.Event.Handler_Detach(eEnvironment, this);
140 Engine.Event.Handler_Detach(eChangeTrack, this);
141 Engine.Event.Handler_Detach(eDemoPlay, this);
142 Engine.Event.Handler_Detach(eChangeRP, this);
143
144 if (ph_world)
145 {
146 ph_world->Destroy();
147 xr_delete(ph_world);
148 }
149
150 // destroy PSs
151 for (POIt p_it = m_StaticParticles.begin(); m_StaticParticles.end() != p_it; ++p_it)
152 CParticlesObject::Destroy(*p_it);
153 m_StaticParticles.clear();
154
155 // Unload sounds
156 // unload prefetched sounds
157 sound_registry.clear();
158 sound_registry_defer.clear();
159
160 // unload static sounds
161 for (u32 i = 0; i < static_Sounds.size(); ++i)
162 {
163 static_Sounds[i]->destroy();
164 xr_delete(static_Sounds[i]);
165 }
166 static_Sounds.clear();
167
168 xr_delete(m_level_sound_manager);
169
170 xr_delete(m_space_restriction_manager);
171
172 xr_delete(m_seniority_hierarchy_holder);
173
174 xr_delete(m_client_spawn_manager);
175
176 xr_delete(m_debug_renderer);
177
178 xr_delete(game);
179 xr_delete(game_events);
180
181 // by Dandy
182 // destroy fog of war
183 // xr_delete (m_pFogOfWar);
184 // destroy bullet manager
185 xr_delete(m_pBulletManager);
186
187 //-----------------------------------------------------------
188 xr_delete(m_ph_commander);

Callers

nothing calls this directly

Calls 11

xr_deleteFunction · 0.85
MsgFunction · 0.85
DestroyFunction · 0.85
Handler_DetachMethod · 0.80
DestroyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45
destroyMethod · 0.45
unloadMethod · 0.45

Tested by

no test coverage detected