diff --git a/src/graphics/graphics_restrictions.cpp b/src/graphics/graphics_restrictions.cpp index db237eefd..f40c976c7 100644 --- a/src/graphics/graphics_restrictions.cpp +++ b/src/graphics/graphics_restrictions.cpp @@ -26,6 +26,7 @@ #include "utils/types.hpp" #include +#include namespace GraphicsRestrictions { @@ -39,7 +40,7 @@ namespace GraphicsRestrictions /** The list of names used in the XML file for the graphics * restriction types. They must be in the same order as the types. */ - const char *m_names_of_restrictions[] = { + std::array m_names_of_restrictions = { "UniformBufferObject", "GeometryShader", "DrawIndirect", @@ -58,10 +59,8 @@ namespace GraphicsRestrictions "AMDVertexShaderLayer", "ExplicitAttribLocation", "TextureFilterAnisotropic", -#if defined(USE_GLES2) "TextureFormatBGRA8888", "ColorBufferFloat", -#endif "DriverRecentEnough", "HighDefinitionTextures", "AdvancedPipeline", @@ -77,12 +76,10 @@ namespace GraphicsRestrictions * GR_COUNT if the name is not found. */ GraphicsRestrictionsType getTypeForName(const std::string &name) { - unsigned int i = 0; - while (m_names_of_restrictions[i] != NULL) + for (unsigned int i = 0; i < m_names_of_restrictions.size(); i++) { if (name == m_names_of_restrictions[i]) return (GraphicsRestrictionsType)i; - i++; } return GR_COUNT; } // getTypeForName diff --git a/src/graphics/graphics_restrictions.hpp b/src/graphics/graphics_restrictions.hpp index c98facfad..7bee7448e 100644 --- a/src/graphics/graphics_restrictions.hpp +++ b/src/graphics/graphics_restrictions.hpp @@ -52,10 +52,8 @@ namespace GraphicsRestrictions GR_AMD_VERTEX_SHADER_LAYER, GR_EXPLICIT_ATTRIB_LOCATION, GR_TEXTURE_FILTER_ANISOTROPIC, -#if defined(USE_GLES2) GR_TEXTURE_FORMAT_BGRA8888, GR_COLOR_BUFFER_FLOAT, -#endif GR_DRIVER_RECENT_ENOUGH, GR_HIGHDEFINITION_TEXTURES, GR_ADVANCED_PIPELINE,