| 22 | void Remove_all_statics(); |
| 23 | |
| 24 | void 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()) |
no test coverage detected