/////////////////////////////////////////////////////////////////////
| 3106 | |
| 3107 | ////////////////////////////////////////////////////////////////////////// |
| 3108 | void CEntitySystem::ToggleLayerVisibility(const char* layer, bool isEnabled, bool includeParent) |
| 3109 | { |
| 3110 | IEntityLayer* pLayer = FindLayer(layer); |
| 3111 | if (pLayer) |
| 3112 | { |
| 3113 | const bool bChange = pLayer->IsEnabled() != isEnabled; |
| 3114 | if (bChange) |
| 3115 | { |
| 3116 | // call the Enable() with a special set of parameters for faster operation (LiveCreate specific) |
| 3117 | pLayer->Enable(isEnabled, false, false); |
| 3118 | |
| 3119 | // load/unload layer paks |
| 3120 | IResourceManager* pResMan = gEnv->pSystem->GetIResourceManager(); |
| 3121 | if (pResMan) |
| 3122 | { |
| 3123 | if (isEnabled) |
| 3124 | { |
| 3125 | if (includeParent && (strlen(pLayer->GetParentName()) > 0)) |
| 3126 | { |
| 3127 | pResMan->LoadLayerPak(pLayer->GetParentName()); |
| 3128 | } |
| 3129 | else |
| 3130 | { |
| 3131 | pResMan->LoadLayerPak(pLayer->GetName()); |
| 3132 | } |
| 3133 | } |
| 3134 | else |
| 3135 | { |
| 3136 | if (includeParent && strlen(pLayer->GetParentName()) > 0) |
| 3137 | { |
| 3138 | pResMan->UnloadLayerPak(pLayer->GetParentName()); |
| 3139 | } |
| 3140 | else |
| 3141 | { |
| 3142 | pResMan->UnloadLayerPak(pLayer->GetName()); |
| 3143 | } |
| 3144 | } |
| 3145 | } |
| 3146 | } |
| 3147 | } |
| 3148 | } |
| 3149 | |
| 3150 | ////////////////////////////////////////////////////////////////////////// |
| 3151 | void CEntitySystem::ToggleLayersBySubstring(const char* pSearchSubstring, const char* pExceptionSubstring, bool isEnable) |
no test coverage detected