//----------------------------------------------------------------------------- void Device::shutdown() { CE_ASSERT(_is_init, "Engine is not initialized"); // Shutdowns the game _lua_environment->call_global("shutdown", 0); _boot_package->unload(); destroy_resource_package(_boot_package); CE_LOGD("Releasing lua system..."); lua_system::shutdown(); CE_DELETE(_allocator, _lua_environment); CE_LOGD("Releasing material manager..."); material_manager::shutdown(); CE_LOGD("Releasing world manager..."); CE_DELETE(_allocator, _world_manager); CE_LOGD("Releasing resource manager..."); CE_DELETE(_allocator, _resource_manager); Bundle::destroy(_allocator, _resource_bundle); _allocator.clear(); _is_init = false; }
void Device::destroy_world(World& w) { for (uint32_t i = 0, n = array::size(_worlds); i < n; ++i) { if (&w == _worlds[i]) { CE_DELETE(default_allocator(), &w); _worlds[i] = _worlds[n - 1]; array::pop_back(_worlds); return; } } CE_ASSERT(false, "Bad world"); }
void SpriteAnimationPlayer::destroy_sprite_animation(SpriteAnimation* anim) { const uint32_t num = array::size(m_animations); for (uint32_t i = 0; i < num; i++) { if (anim == m_animations[i]) { CE_DELETE(default_allocator(), anim); m_animations[i] = m_animations[num - 1]; array::pop_back(m_animations); return; } } }
void shutdown() { CE_DELETE(default_allocator(), _keyboard); CE_DELETE(default_allocator(), _mouse); CE_DELETE(default_allocator(), _touch); }
void DiskFilesystem::close(File* file) { CE_ASSERT_NOT_NULL(file); CE_DELETE(default_allocator(), file); }
void shutdown() { CE_DELETE(default_allocator(), _device); }
//----------------------------------------------------------------------------- void Device::destroy_resource_package(ResourcePackage* package) { CE_DELETE(default_allocator(), package); }
//----------------------------------------------------------------------------- void Filesystem::close(DiskFile* stream) { CE_DELETE(m_allocator, stream); }
void SoundWorld::destroy(Allocator& a, SoundWorld* sw) { CE_DELETE(a, sw); }
void unload(Allocator& a, void* resource) { CE_DELETE(a, (PackageResource*)resource); }
void ShaderManager::unload(Allocator& a, void* res) { CE_DELETE(a, (ShaderResource*)res); }
void shutdown() { CE_DELETE(default_allocator(), _console); }