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

Method Destroy

ogsr_engine/Layers/xrRender/ModelPool.cpp:166–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void CModelPool::Destroy()
167{
168 R_ASSERT(Pool.empty()); // pool should be clear at this point
169
170 // Registry
171 while (!Registry.empty())
172 {
173 const REGISTRY_IT it = Registry.begin();
174 dxRender_Visual* V = (dxRender_Visual*)it->first;
175#ifdef DEBUG
176 Msg("ModelPool: Destroy object: '%s'", *V->dbg_name);
177#endif
178 DeleteInternal(V, TRUE);
179 }
180
181 // Base/Reference
182 xr_vector<ModelDef>::iterator I = Models.begin();
183 const xr_vector<ModelDef>::iterator E = Models.end();
184 for (; I != E; ++I)
185 {
186 I->model->Release();
187 xr_delete(I->model);
188 }
189
190 Models.clear();
191
192 // cleanup motions container
193 g_pMotionsContainer->clean(false);
194
195 if (vis_prefetch_ini)
196 vis_prefetch_ini->save_as();
197
198 m_prefetched.clear();
199}
200
201CModelPool::CModelPool()
202{

Callers

nothing calls this directly

Calls 9

MsgFunction · 0.85
xr_deleteFunction · 0.85
save_asMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
ReleaseMethod · 0.45
clearMethod · 0.45
cleanMethod · 0.45

Tested by

no test coverage detected