Use range loop (if possible)

This commit is contained in:
Filip Gawin
2019-02-01 19:47:07 +01:00
committed by Jordan Woyak
parent 0fa4812c2f
commit 0ede5d1537
15 changed files with 92 additions and 100 deletions

View File

@ -45,9 +45,9 @@ void Init()
void Shutdown()
{
for (int i = 0; i < NUM_OBJECT_BUFFERS; i++)
for (auto& slot : ObjectBuffer)
{
delete[] ObjectBuffer[i];
delete[] slot;
}
}

View File

@ -48,8 +48,8 @@ Renderer::Renderer(std::unique_ptr<SwapChain> swap_chain, float backbuffer_scale
m_swap_chain(std::move(swap_chain))
{
UpdateActiveConfig();
for (size_t i = 0; i < m_sampler_states.size(); i++)
m_sampler_states[i].hex = RenderState::GetPointSamplerState().hex;
for (SamplerState& m_sampler_state : m_sampler_states)
m_sampler_state.hex = RenderState::GetPointSamplerState().hex;
}
Renderer::~Renderer() = default;