Files

39 lines
1.1 KiB
C++
Raw Permalink Normal View History

2021-04-01 02:07:58 +02:00
#include "JSystem/J3DGraphAnimator/J3DShapeTable.h"
2021-03-28 22:49:05 +02:00
2021-10-11 09:38:53 -07:00
void J3DShapeTable::hide() {
u16 shapeNum = mShapeNum;
for (u16 i = 0; i < shapeNum; i++) {
mShapeNodePointer[i]->onFlag(1);
}
2021-03-28 22:49:05 +02:00
}
2021-10-11 09:38:53 -07:00
void J3DShapeTable::show() {
u16 shapeNum = mShapeNum;
for (u16 i = 0; i < shapeNum; i++) {
mShapeNodePointer[i]->offFlag(1);
}
2021-03-28 22:49:05 +02:00
}
2021-10-11 09:38:53 -07:00
void J3DShapeTable::initShapeNodes(J3DDrawMtxData* pMtxData, J3DVertexData* pVtxData) {
u16 shapeNum = mShapeNum;
for (u16 i = 0; i < shapeNum; i++) {
J3DShape* shapeNode = mShapeNodePointer[i];
2021-03-28 22:49:05 +02:00
2021-10-11 09:38:53 -07:00
shapeNode->setDrawMtxDataPointer(pMtxData);
shapeNode->setVertexDataPointer(pVtxData);
shapeNode->makeVcdVatCmd();
}
}
void J3DShapeTable::sortVcdVatCmd() {
u16 shapeNum = mShapeNum;
for (u16 next = 0; next < shapeNum; next++) {
for (u16 prev = 0; prev < next; prev++) {
if (mShapeNodePointer[next]->isSameVcdVatCmd(mShapeNodePointer[prev])) {
void* nodeVatCmd = mShapeNodePointer[prev]->getVcdVatCmd();
mShapeNodePointer[next]->setVcdVatCmd(nodeVatCmd);
}
}
}
2021-03-28 22:49:05 +02:00
}