2023-01-02 13:17:18 -06:00
|
|
|
#include "gx/CGxMatrixStack.hpp"
|
|
|
|
|
|
|
|
|
|
CGxMatrixStack::CGxMatrixStack() {
|
2023-04-15 21:21:27 -05:00
|
|
|
this->m_flags[0] = F_Identity;
|
2023-01-02 13:17:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CGxMatrixStack::Pop() {
|
|
|
|
|
if (this->m_level > 0) {
|
|
|
|
|
this->m_level--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this->m_dirty = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CGxMatrixStack::Push() {
|
|
|
|
|
if (this->m_level < 3) {
|
|
|
|
|
this->m_level++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this->m_mtx[this->m_level] = this->m_mtx[this->m_level - 1];
|
|
|
|
|
this->m_flags[this->m_level] = this->m_flags[this->m_level - 1];
|
|
|
|
|
|
|
|
|
|
this->m_dirty = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
C44Matrix& CGxMatrixStack::Top() {
|
|
|
|
|
this->m_dirty = 1;
|
2023-04-15 21:21:27 -05:00
|
|
|
this->m_flags[this->m_level] &= ~F_Identity;
|
2023-01-02 13:17:18 -06:00
|
|
|
return this->m_mtx[this->m_level];
|
|
|
|
|
}
|
2023-04-15 10:32:07 -05:00
|
|
|
|
|
|
|
|
const C44Matrix& CGxMatrixStack::TopConst() {
|
|
|
|
|
return this->m_mtx[this->m_level];
|
|
|
|
|
}
|