diff --git a/examples/Cpp/Animation/Example.cpp b/examples/Cpp/Animation/Example.cpp index 0cc3c7a1cd..32f200c4df 100644 --- a/examples/Cpp/Animation/Example.cpp +++ b/examples/Cpp/Animation/Example.cpp @@ -56,8 +56,8 @@ class Example_Animation : public ExampleBase std::vector balls; - const std::array gridPosFrames - {{ + const Gs::Vector2f gridPosFrames[15] + { Gs::Vector2f{ 0.0f, -3.0f }, Gs::Vector2f{ +1.0f, -3.0f }, Gs::Vector2f{ +2.0f, -3.0f }, @@ -73,7 +73,7 @@ class Example_Animation : public ExampleBase Gs::Vector2f{ -3.0f, +2.0f }, Gs::Vector2f{ -3.0f, +1.0f }, Gs::Vector2f{ -3.0f, 0.0f } - }}; + }; public: @@ -206,7 +206,7 @@ class Example_Animation : public ExampleBase ball.frameInterpolator -= 1.0f; ball.frame++; - if (ball.frame + 1 >= gridPosFrames.size()) + if (ball.frame + 1 >= sizeof(gridPosFrames)/sizeof(gridPosFrames[0])) { ball.position = GetGridPos(0); ball.frame = 0; diff --git a/examples/Cpp/ExampleBase/PerlinNoise.cpp b/examples/Cpp/ExampleBase/PerlinNoise.cpp index 52f6c34e25..7f3f52f453 100644 --- a/examples/Cpp/ExampleBase/PerlinNoise.cpp +++ b/examples/Cpp/ExampleBase/PerlinNoise.cpp @@ -195,9 +195,10 @@ void PerlinNoise::GeneratePermutations(std::uint32_t seed) void PerlinNoise::GenerateGradients() { - auto angleStep = Gs::pi * 2.0f / static_cast(grads_.size()); + constexpr std::size_t gradsSize = sizeof(grads_)/sizeof(grads_[0]); + auto angleStep = Gs::pi * 2.0f / static_cast(gradsSize); - for (std::size_t i = 0; i < grads_.size(); ++i) + for (std::size_t i = 0; i < gradsSize; ++i) { auto a = static_cast(i) * angleStep; grads_[i] = Gs::Vector3f{ std::cos(a), std::sin(a), std::sin(a)*std::cos(a) }; diff --git a/examples/Cpp/ExampleBase/PerlinNoise.h b/examples/Cpp/ExampleBase/PerlinNoise.h index 17a96f6f2a..4e113e78fa 100644 --- a/examples/Cpp/ExampleBase/PerlinNoise.h +++ b/examples/Cpp/ExampleBase/PerlinNoise.h @@ -11,7 +11,6 @@ #include #include -#include #include #include @@ -60,8 +59,8 @@ class PerlinNoise private: - std::array perm_; - std::array grads_; + std::uint32_t perm_[512]; + Gs::Vector3f grads_[256]; }; diff --git a/sources/Renderer/OpenGL/Ext/GLExtensionRegistry.cpp b/sources/Renderer/OpenGL/Ext/GLExtensionRegistry.cpp index 5de26b870f..dab6232574 100644 --- a/sources/Renderer/OpenGL/Ext/GLExtensionRegistry.cpp +++ b/sources/Renderer/OpenGL/Ext/GLExtensionRegistry.cpp @@ -6,14 +6,13 @@ */ #include "GLExtensionRegistry.h" -#include namespace LLGL { -static std::array(GLExt::Count)> g_registeredExtensions { { false } }; +static bool g_registeredExtensions[static_cast(GLExt::Count)] = {}; static void RegisterExtensionInternal(GLExt extension) { diff --git a/sources/Renderer/OpenGL/RenderState/GLStateManager.h b/sources/Renderer/OpenGL/RenderState/GLStateManager.h index 929416f3ab..eb67261af5 100644 --- a/sources/Renderer/OpenGL/RenderState/GLStateManager.h +++ b/sources/Renderer/OpenGL/RenderState/GLStateManager.h @@ -15,7 +15,6 @@ #include #include "../OpenGL.h" #include "../../../Core/Assertion.h" -#include #include #include diff --git a/sources/Renderer/OpenGL/Texture/GLTexImage.cpp b/sources/Renderer/OpenGL/Texture/GLTexImage.cpp index 237d0b7028..2beeb0ce48 100644 --- a/sources/Renderer/OpenGL/Texture/GLTexImage.cpp +++ b/sources/Renderer/OpenGL/Texture/GLTexImage.cpp @@ -13,7 +13,6 @@ #include "../../../Core/Exception.h" #include #include -#include #include diff --git a/sources/Renderer/OpenGL/Texture/GLTexSubImage.cpp b/sources/Renderer/OpenGL/Texture/GLTexSubImage.cpp index 2fc50d3e3a..46b2b1ee15 100644 --- a/sources/Renderer/OpenGL/Texture/GLTexSubImage.cpp +++ b/sources/Renderer/OpenGL/Texture/GLTexSubImage.cpp @@ -11,7 +11,6 @@ #include "../Ext/GLExtensions.h" #include "../Ext/GLExtensionRegistry.h" #include "../../../Core/Assertion.h" -#include #include diff --git a/sources/Renderer/OpenGL/Texture/GLTextureSubImage.cpp b/sources/Renderer/OpenGL/Texture/GLTextureSubImage.cpp index 0bc10df284..03591f3980 100644 --- a/sources/Renderer/OpenGL/Texture/GLTextureSubImage.cpp +++ b/sources/Renderer/OpenGL/Texture/GLTextureSubImage.cpp @@ -9,7 +9,6 @@ #include "../GLTypes.h" #include "../Ext/GLExtensions.h" #include "../../../Core/Assertion.h" -#include #include