summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/Graphics/MatrixStack.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-16 08:54:08 +0800
committerchai <chaifix@163.com>2019-08-16 08:54:08 +0800
commita077eb38b01292611f4f6031b75e3e2c1c20f06e (patch)
tree8f760483d7b0290952bbdb5bcd8f3943102aeb3a /source/modules/asura-core/Graphics/MatrixStack.h
parent6a065c913e9308cc72e1ad0723b6167048f439b6 (diff)
Diffstat (limited to 'source/modules/asura-core/Graphics/MatrixStack.h')
-rw-r--r--source/modules/asura-core/Graphics/MatrixStack.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/source/modules/asura-core/Graphics/MatrixStack.h b/source/modules/asura-core/Graphics/MatrixStack.h
index 8dd56bf..15ae7e5 100644
--- a/source/modules/asura-core/Graphics/MatrixStack.h
+++ b/source/modules/asura-core/Graphics/MatrixStack.h
@@ -8,17 +8,9 @@
namespace_begin(AsuraEngine)
namespace_begin(Graphics)
-///
-/// ջľȡ
-///
-#define ASURA_MAX_MATRIX_STACK_DEPTH 32 // 2KB
-
-///
-/// ջ״ָ̬֮ǰ״̬ջеһstack[i]ֵstack[0]*..*stack[i-1]
-/// ֵһϵtransform
-///
-/// TODO: template<uint _capacity> MatrixStack
-///
+// ջ״ָ̬֮ǰ״̬ջеһstack[i]ֵstack[0]*..*stack[i-1]ֵһϵtransform
+//
+// TODO: template<uint _capacity> MatrixStack
class MatrixStack
{
public:
@@ -30,11 +22,11 @@ public:
bool Push();
bool Pop();
- AEMath::Matrix44& GetTop();
- void GetTop(ASURA_OUT AEMath::Matrix44& mat44);
+ Matrix44& GetTop();
+ void GetTop(ASURA_OUT Matrix44& mat44);
- void LoadMatrix(const AEMath::Matrix44& mat44);
- void MultMatrix(const AEMath::Matrix44& mat44);
+ void LoadMatrix(const Matrix44& mat44);
+ void MultMatrix(const Matrix44& mat44);
void Rotate(float angle);
void Translate(float x, float y);
@@ -47,8 +39,8 @@ public:
private:
- AEMath::Matrix44 m_Stack[ASURA_MAX_MATRIX_STACK_DEPTH];
- uint8 top;
+ Matrix44 m_Stack[32]; // 2kB
+ uint8 m_Top;
};