diff options
Diffstat (limited to 'Runtime')
-rw-r--r-- | Runtime/Graphics/Quad.cpp | 2 | ||||
-rw-r--r-- | Runtime/Graphics/UIQuad.cpp | 6 | ||||
-rw-r--r-- | Runtime/Lua/LuaHelper.cpp | 20 | ||||
-rw-r--r-- | Runtime/Math/Vector2.cpp | 4 | ||||
-rw-r--r-- | Runtime/Math/Vector2.h | 49 |
5 files changed, 42 insertions, 39 deletions
diff --git a/Runtime/Graphics/Quad.cpp b/Runtime/Graphics/Quad.cpp index b98f4f2..f584fe8 100644 --- a/Runtime/Graphics/Quad.cpp +++ b/Runtime/Graphics/Quad.cpp @@ -6,7 +6,7 @@ struct QuadVBOLayout { Vector3 position; - Vector2 uv; + Internal::Vector2 uv; }; void Quad::Draw() diff --git a/Runtime/Graphics/UIQuad.cpp b/Runtime/Graphics/UIQuad.cpp index 5f1a54d..fb5964f 100644 --- a/Runtime/Graphics/UIQuad.cpp +++ b/Runtime/Graphics/UIQuad.cpp @@ -4,8 +4,8 @@ struct UIQuadLayout { - Vector2 position; - Vector2 uv; + Internal::Vector2 position; + Internal::Vector2 uv; }; void UIQuad::Draw() @@ -13,7 +13,7 @@ void UIQuad::Draw() CustomVertexLayout layout; VertexAttributeDescriptor POSITION = VertexAttributeDescriptor(0, 2, VertexAttrFormat_Float, sizeof(UIQuadLayout)); - VertexAttributeDescriptor UV = VertexAttributeDescriptor(sizeof(Vector2), 2, VertexAttrFormat_Float, sizeof(UIQuadLayout)); + VertexAttributeDescriptor UV = VertexAttributeDescriptor(sizeof(Internal::Vector2), 2, VertexAttrFormat_Float, sizeof(UIQuadLayout)); layout.attributes.push_back(POSITION); layout.attributes.push_back(UV); diff --git a/Runtime/Lua/LuaHelper.cpp b/Runtime/Lua/LuaHelper.cpp index 9381b6c..a47d528 100644 --- a/Runtime/Lua/LuaHelper.cpp +++ b/Runtime/Lua/LuaHelper.cpp @@ -2,23 +2,23 @@ using namespace LuaBind;
-template <> +template <>
Rect State::GetValue < Rect >(int idx, const Rect value)
{
Rect rect;
- rect.x = GetField<float>(idx, 1, 0); - rect.y = GetField<float>(idx, 2, 0); - rect.width = GetField<float>(idx, 3, 0); - rect.height = GetField<float>(idx, 4, 0); + rect.x = GetField<float>(idx, 1, 0);
+ rect.y = GetField<float>(idx, 2, 0);
+ rect.width = GetField<float>(idx, 3, 0);
+ rect.height = GetField<float>(idx, 4, 0);
return rect;
}
-template <> -Vector2 State::GetValue < Vector2 >(int idx, const Vector2 value)
+template <>
+Internal::Vector2 State::GetValue < Internal::Vector2 >(int idx, const Internal::Vector2 value)
{
- Vector2 v2; - v2.x = GetField<float>(idx, 1, 0); - v2.y = GetField<float>(idx, 2, 0); + Internal::Vector2 v2;
+ v2.x = GetField<float>(idx, 1, 0);
+ v2.y = GetField<float>(idx, 2, 0);
return v2;
}
diff --git a/Runtime/Math/Vector2.cpp b/Runtime/Math/Vector2.cpp index 2b70b24..185e66f 100644 --- a/Runtime/Math/Vector2.cpp +++ b/Runtime/Math/Vector2.cpp @@ -1,4 +1,4 @@ #include "Vector2.h" -Vector2 Vector2::one = Vector2(1, 1); -Vector2 Vector2::zero = Vector2(0, 0); +Internal::Vector2 Internal::Vector2::one = Internal::Vector2(1, 1); +Internal::Vector2 Internal::Vector2::zero = Internal::Vector2(0, 0); diff --git a/Runtime/Math/Vector2.h b/Runtime/Math/Vector2.h index 5fb230c..27cf312 100644 --- a/Runtime/Math/Vector2.h +++ b/Runtime/Math/Vector2.h @@ -1,30 +1,33 @@ #pragma once -struct Vector2 +namespace Internal { - Vector2(float x=0, float y = 0) - { - this->x = x; - this->y = y; - } - inline void Set(float x, float y) - { - this->x = x; - this->y = y; - } + struct Vector2 + { + Vector2(float x = 0, float y = 0) + { + this->x = x; + this->y = y; + } + inline void Set(float x, float y) + { + this->x = x; + this->y = y; + } - bool operator == (const Vector2& v) const - { - return v.x == x && v.y == y; - } + bool operator == (const Vector2& v) const + { + return v.x == x && v.y == y; + } - bool operator != (const Vector2& v) const - { - return v.x != x || v.y != y; - } + bool operator != (const Vector2& v) const + { + return v.x != x || v.y != y; + } - float x, y; + float x, y; - static Vector2 zero; - static Vector2 one; -};
\ No newline at end of file + static Vector2 zero; + static Vector2 one; + }; +} |