From 6b42da4f08159ef7c7861c3ad6838f9a0838f774 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Thu, 7 Feb 2019 01:36:20 +0500 Subject: [PATCH] xrEngine/Environment_render.cpp: use C++11 range-based for --- src/xrEngine/Environment_render.cpp | 35 +++++++++++++---------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/xrEngine/Environment_render.cpp b/src/xrEngine/Environment_render.cpp index e7a5626e68e..a588094ffde 100644 --- a/src/xrEngine/Environment_render.cpp +++ b/src/xrEngine/Environment_render.cpp @@ -66,20 +66,17 @@ void CEnvironment::OnDeviceCreate() m_pRender->OnDeviceCreate(); // weathers + for (auto& cycle : WeatherCycles) { - auto _I = WeatherCycles.begin(); - auto _E = WeatherCycles.end(); - for (; _I != _E; _I++) - for (auto it = _I->second.begin(); it != _I->second.end(); it++) - (*it)->on_device_create(); + for (auto& envDescriptor : cycle.second) + envDescriptor->on_device_create(); } + // effects + for (auto& cycle : WeatherFXs) { - auto _I = WeatherFXs.begin(); - auto _E = WeatherFXs.end(); - for (; _I != _E; _I++) - for (auto it = _I->second.begin(); it != _I->second.end(); it++) - (*it)->on_device_create(); + for (auto& envDescriptor : cycle.second) + envDescriptor->on_device_create(); } Invalidate(); @@ -91,21 +88,19 @@ void CEnvironment::OnDeviceDestroy() m_pRender->OnDeviceDestroy(); // weathers + for (auto& cycle : WeatherCycles) { - auto _I = WeatherCycles.begin(); - auto _E = WeatherCycles.end(); - for (; _I != _E; _I++) - for (auto it = _I->second.begin(); it != _I->second.end(); it++) - (*it)->on_device_destroy(); + for (auto& envDescriptor : cycle.second) + envDescriptor->on_device_destroy(); } + // effects + for (auto& cycle : WeatherFXs) { - auto _I = WeatherFXs.begin(); - auto _E = WeatherFXs.end(); - for (; _I != _E; _I++) - for (auto it = _I->second.begin(); it != _I->second.end(); it++) - (*it)->on_device_destroy(); + for (auto& envDescriptor : cycle.second) + envDescriptor->on_device_destroy(); } + CurrentEnv->destroy(); }