mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
Run code through clang-modernize -loop-convert to create range-based for loops, and manually fix some stuff up.
This commit is contained in:
@ -112,9 +112,9 @@ void SamplerCache::SetParameters(GLuint sampler_id, const Params& params)
|
||||
|
||||
void SamplerCache::Clear()
|
||||
{
|
||||
for (auto it = m_cache.begin(); it != m_cache.end(); ++it)
|
||||
for (auto& p : m_cache)
|
||||
{
|
||||
glDeleteSamplers(1, &it->second.sampler_id);
|
||||
glDeleteSamplers(1, &p.second.sampler_id);
|
||||
}
|
||||
m_cache.clear();
|
||||
}
|
||||
|
@ -88,9 +88,9 @@ TextureCache::TCacheEntry::~TCacheEntry()
|
||||
{
|
||||
if (texture)
|
||||
{
|
||||
for(int i=0; i<8; i++)
|
||||
if(s_Textures[i] == texture)
|
||||
s_Textures[i] = 0;
|
||||
for(auto& gtex : s_Textures)
|
||||
if(gtex == texture)
|
||||
gtex = 0;
|
||||
glDeleteTextures(1, &texture);
|
||||
texture = 0;
|
||||
}
|
||||
@ -449,8 +449,8 @@ TextureCache::TextureCache()
|
||||
|
||||
s_ActiveTexture = -1;
|
||||
s_NextStage = -1;
|
||||
for(int i=0; i<8; i++)
|
||||
s_Textures[i] = -1;
|
||||
for(auto& gtex : s_Textures)
|
||||
gtex = -1;
|
||||
}
|
||||
|
||||
|
||||
@ -459,9 +459,9 @@ TextureCache::~TextureCache()
|
||||
s_ColorMatrixProgram.Destroy();
|
||||
s_DepthMatrixProgram.Destroy();
|
||||
|
||||
for(std::map<u64, VBOCache>::iterator it = s_VBO.begin(); it != s_VBO.end(); it++) {
|
||||
glDeleteBuffers(1, &it->second.vbo);
|
||||
glDeleteVertexArrays(1, &it->second.vao);
|
||||
for(auto& cache : s_VBO) {
|
||||
glDeleteBuffers(1, &cache.second.vbo);
|
||||
glDeleteVertexArrays(1, &cache.second.vao);
|
||||
}
|
||||
s_VBO.clear();
|
||||
}
|
||||
|
@ -186,8 +186,8 @@ void Shutdown()
|
||||
s_rgbToYuyvProgram.Destroy();
|
||||
s_yuyvToRgbProgram.Destroy();
|
||||
|
||||
for (unsigned int i = 0; i < NUM_ENCODING_PROGRAMS; i++)
|
||||
s_encodingPrograms[i].Destroy();
|
||||
for (auto& program : s_encodingPrograms)
|
||||
program.Destroy();
|
||||
|
||||
s_srcTexture = 0;
|
||||
s_dstTexture = 0;
|
||||
|
@ -110,16 +110,16 @@ void GetShaders(std::vector<std::string> &shaders)
|
||||
File::GetUserPath(D_SHADERS_IDX),
|
||||
File::GetSysDirectory() + SHADERS_DIR DIR_SEP,
|
||||
};
|
||||
for (size_t i = 0; i < ArraySize(directories); ++i)
|
||||
for (auto& directory : directories)
|
||||
{
|
||||
if (!File::IsDirectory(directories[i]))
|
||||
if (!File::IsDirectory(directory))
|
||||
continue;
|
||||
|
||||
File::FSTEntry entry;
|
||||
File::ScanDirectoryTree(directories[i], entry);
|
||||
for (u32 j = 0; j < entry.children.size(); j++)
|
||||
File::ScanDirectoryTree(directory, entry);
|
||||
for (auto& file : entry.children)
|
||||
{
|
||||
std::string name = entry.children[j].virtualName.c_str();
|
||||
std::string name = file.virtualName.c_str();
|
||||
if (name.size() < 5)
|
||||
continue;
|
||||
if (strcasecmp(name.substr(name.size() - 5).c_str(), ".glsl"))
|
||||
|
Reference in New Issue
Block a user