From a077eb38b01292611f4f6031b75e3e2c1c20f06e Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 16 Aug 2019 08:54:08 +0800 Subject: *misc --- Source/modules/asura-core/Graphics/MatrixStack.h | 26 ++++++++---------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'Source/modules/asura-core/Graphics/MatrixStack.h') 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 MatrixStack -/// +// 保存栈状态,用来恢复之前的状态。栈中的一个矩阵stack[i]的值是stack[0]*..*stack[i-1]的值,并附加一系列transform。 +// +// TODO: template 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; }; -- cgit v1.1-26-g67d0