Skip to content

Commit

Permalink
xrEngine/Environment_render.cpp: use C++11 range-based for
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Feb 8, 2019
1 parent 35d87ba commit 6b42da4
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions src/xrEngine/Environment_render.cpp
Expand Up @@ -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();
Expand All @@ -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();
}

Expand Down

0 comments on commit 6b42da4

Please sign in to comment.