diff --git a/source/graphics/Color.h b/source/graphics/Color.h index 4b5dcfb522..f4a78be66a 100644 --- a/source/graphics/Color.h +++ b/source/graphics/Color.h @@ -71,7 +71,7 @@ struct CColor } // For passing to uniform as vec3/vec4. - std::span AsFloatArray() const + std::span AsFloatArray() const { // Additional check to prevent a weird compiler has a different // alignement for an array and a class members. @@ -82,7 +82,7 @@ struct CColor offsetof(CColor, b) == sizeof(float) * 2u && offsetof(CColor, a) == sizeof(float) * 3u, "CColor should be properly layouted to use AsFloatArray"); - return std::span(&r, 4); + return std::span(&r, 4); } // For passing to CRenderer: diff --git a/source/graphics/Font.cpp b/source/graphics/Font.cpp index cd907b5225..c3b5157619 100644 --- a/source/graphics/Font.cpp +++ b/source/graphics/Font.cpp @@ -528,7 +528,7 @@ void CFont::BlendGlyphBitmapToTextureRGBA(const FT_Bitmap& bitmap, int targetX, for (uint x{0}; x != bitmap.width; ++x) { - const std::span tempDstRow{dstRow + x * m_TextureFormatStride, 4}; + const std::span tempDstRow{dstRow + x * m_TextureFormatStride, 4}; u8 alpha{srcRow[x]}; const float srcAlpha{m_StrokeWidth > 0 ? (*m_GammaCorrectionLUT)[alpha] : alpha/255.0f}; diff --git a/source/maths/Matrix3D.h b/source/maths/Matrix3D.h index 514530aa2c..bb33245384 100644 --- a/source/maths/Matrix3D.h +++ b/source/maths/Matrix3D.h @@ -334,7 +334,7 @@ public: CVector3D RotateTransposed(const CVector3D& vector) const; // Returns 16 element array of floats, e.g. for mat4 uniforms. - std::span AsFloatArray() const + std::span AsFloatArray() const { // Additional check to prevent a weird compiler has a different // alignement for an array and a class members. @@ -344,7 +344,7 @@ public: offsetof(CMatrix3D, _11) == 0 && offsetof(CMatrix3D, _44) == sizeof(float) * 15u, "CMatrix3D should be properly layouted to use AsFloatArray"); - return std::span(_data, 16); + return std::span(_data); } }; diff --git a/source/maths/Vector2D.h b/source/maths/Vector2D.h index e1ea9608b7..3f9743ae43 100644 --- a/source/maths/Vector2D.h +++ b/source/maths/Vector2D.h @@ -164,7 +164,7 @@ public: void operator-=(const CSize2D& size); // Returns 2 element array of floats, e.g. for vec2 uniforms. - std::span AsFloatArray() const + std::span AsFloatArray() const { // Additional check to prevent a weird compiler having a different // alignement for an array and a class members. @@ -173,7 +173,7 @@ public: offsetof(CVector2D, X) == 0 && offsetof(CVector2D, Y) == sizeof(float), "Vector2D should be properly layouted to use AsFloatArray"); - return std::span(&X, 2); + return std::span(&X, 2); } public: diff --git a/source/maths/Vector3D.h b/source/maths/Vector3D.h index b4a8512ef3..d41201c19b 100644 --- a/source/maths/Vector3D.h +++ b/source/maths/Vector3D.h @@ -124,7 +124,7 @@ class CVector3D CVector3D Normalized() const; // Returns 3 element array of floats, e.g. for vec3 uniforms. - std::span AsFloatArray() const + std::span AsFloatArray() const { // Additional check to prevent a weird compiler has a different // alignement for an array and a class members. @@ -134,7 +134,7 @@ class CVector3D offsetof(CVector3D, Y) == sizeof(float) && offsetof(CVector3D, Z) == sizeof(float) * 2u, "Vector3D should be properly layouted to use AsFloatArray"); - return std::span(&X, 3); + return std::span(&X, 3); } }; diff --git a/source/maths/Vector4D.h b/source/maths/Vector4D.h index 10ae5572df..e5aa71ccc4 100644 --- a/source/maths/Vector4D.h +++ b/source/maths/Vector4D.h @@ -126,7 +126,7 @@ public: } // Returns 4 element array of floats, e.g. for vec4 uniforms. - std::span AsFloatArray() const + std::span AsFloatArray() const { // Additional check to prevent a weird compiler has a different // alignement for an array and a class members. @@ -135,7 +135,7 @@ public: offsetof(CVector4D, X) == 0 && offsetof(CVector4D, W) == sizeof(float) * 3u, "CVector4D should be properly layouted to use AsFloatArray"); - return std::span(&X, 4); + return std::span(&X, 4); } float X, Y, Z, W;