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

Method remove_objects

ogsr_engine/xrGame/Level_network.cpp:24–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22void Remove_all_statics();
23
24void CLevel::remove_objects()
25{
26 m_is_removing_objects = true;
27
28 u32 m_base, c_base, m_lmaps, c_lmaps;
29 Device.m_pRender->ResourcesGetMemoryUsage(m_base, c_base, m_lmaps, c_lmaps);
30
31 Msg("~ ObjectResources unload...");
32 Msg("~ ObjectResources - base: %d, %d K", c_base, m_base / 1024);
33 Msg("~ ObjectResources - lmap: %d, %d K", c_lmaps, m_lmaps / 1024);
34
35 Game().reset_ui();
36
37 {
38 VERIFY(Server);
39 Server->SLS_Clear(); // generate GE_DESTROY for all game objects
40 }
41
42 snd_Events.clear();
43
44 // process destroy queue
45 for (int i = 0; i < 6; ++i)
46 {
47 // ugly hack for checks that update is twice on frame
48 // we need it since we do updates for checking network messages
49 ++(Device.dwFrame);
50
51 ClientReceive();
52 ProcessGameEvents();
53
54 Objects.Update(true);
55 //Sleep(100);
56 }
57
58
59 BulletManager().Clear();
60 ph_commander().clear();
61 ph_commander_scripts().clear();
62
63 space_restriction_manager().clear();
64
65 ai().script_engine().collect_all_garbage();
66
67 Remove_all_statics();
68
69 stalker_animation_data_storage().clear();
70
71 VERIFY(Render);
72
73 if (!g_prefetch)
74 Render->models_Clear(TRUE);
75 else
76 Render->models_Clear(FALSE);
77
78 Render->clear_static_wallmarks();
79
80#ifdef DEBUG
81 if (!client_spawn_manager().registry().empty())

Callers 1

OnEventMethod · 0.80

Calls 15

MsgFunction · 0.85
Remove_all_staticsFunction · 0.85
xr_deleteFunction · 0.85
Cleanup_R_occlusionFunction · 0.85
SLS_ClearMethod · 0.80
collect_all_garbageMethod · 0.80
models_ClearMethod · 0.80
destroy_particlesMethod · 0.80
stop_emittersMethod · 0.80
set_dof_paramsMethod · 0.80

Tested by

no test coverage detected