mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-04 16:49:42 -04:00
setup dolphin VEC/MTX function defines (#1903)
* setup VEC function defines * setup MTX function defines
This commit is contained in:
@@ -56,7 +56,7 @@ void J2DGrafContext::setup2D() {
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
Mtx mtx;
|
||||
PSMTXIdentity(mtx);
|
||||
MTXIdentity(mtx);
|
||||
GXLoadTexMtxImm(mtx, GX_IDENTITY, GX_MTX3x4);
|
||||
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE,
|
||||
GX_AF_NONE);
|
||||
|
||||
@@ -50,7 +50,7 @@ void J2DOrthoGraph::setOrtho(JGeometry::TBox2<f32> const& bounds, f32 far, f32 n
|
||||
|
||||
/* 802E9840-802E987C 2E4180 003C+00 1/0 0/0 0/0 .text setLookat__13J2DOrthoGraphFv */
|
||||
void J2DOrthoGraph::setLookat() {
|
||||
PSMTXIdentity(mPosMtx);
|
||||
MTXIdentity(mPosMtx);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ void J2DPane::draw(f32 x, f32 y, J2DGrafContext const* p_grafCtx, bool isOrthoGr
|
||||
f32 width = parent->mGlobalBounds.i.x - parent->mBounds.i.x;
|
||||
f32 height = parent->mGlobalBounds.i.y - parent->mBounds.i.y;
|
||||
mGlobalBounds.addPos(width, height);
|
||||
PSMTXConcat(parent->mGlobalMtx, mPositionMtx, mGlobalMtx);
|
||||
MTXConcat(parent->mGlobalMtx, mPositionMtx, mGlobalMtx);
|
||||
|
||||
if (unkBool) {
|
||||
if (isOrthoGraf) {
|
||||
@@ -308,7 +308,7 @@ void J2DPane::draw(f32 x, f32 y, J2DGrafContext const* p_grafCtx, bool isOrthoGr
|
||||
} else {
|
||||
mGlobalBounds.addPos(x, y);
|
||||
makeMatrix(mTranslateX + x, mTranslateY + y);
|
||||
PSMTXCopy(mPositionMtx, mGlobalMtx);
|
||||
MTXCopy(mPositionMtx, mGlobalMtx);
|
||||
mClipRect = mGlobalBounds;
|
||||
mColorAlpha = mAlpha;
|
||||
}
|
||||
@@ -528,15 +528,15 @@ void J2DPane::makeMatrix(f32 param_0, f32 param_1, f32 param_2, f32 param_3) {
|
||||
f32 tmpX = mRotateOffsetX - param_2;
|
||||
f32 tmpY = mRotateOffsetY - param_3;
|
||||
Mtx rotX, rotY, rotZ, rotMtx, mtx, tmp;
|
||||
PSMTXTrans(mtx, -tmpX, -tmpY, 0);
|
||||
PSMTXRotRad(rotX, 'x', DEG_TO_RAD(mRotateX));
|
||||
PSMTXRotRad(rotY, 'y', DEG_TO_RAD(mRotateY));
|
||||
PSMTXRotRad(rotZ, 'z', DEG_TO_RAD(-mRotateZ));
|
||||
PSMTXConcat(rotZ, rotX, tmp);
|
||||
PSMTXConcat(rotY, tmp, rotMtx);
|
||||
PSMTXScaleApply(mtx, mPositionMtx, mScaleX, mScaleY, 1);
|
||||
PSMTXConcat(rotMtx, mPositionMtx, tmp);
|
||||
PSMTXTransApply(tmp, mPositionMtx, param_0 + tmpX, param_1 + tmpY, 0);
|
||||
MTXTrans(mtx, -tmpX, -tmpY, 0);
|
||||
MTXRotRad(rotX, 'x', DEG_TO_RAD(mRotateX));
|
||||
MTXRotRad(rotY, 'y', DEG_TO_RAD(mRotateY));
|
||||
MTXRotRad(rotZ, 'z', DEG_TO_RAD(-mRotateZ));
|
||||
MTXConcat(rotZ, rotX, tmp);
|
||||
MTXConcat(rotY, tmp, rotMtx);
|
||||
MTXScaleApply(mtx, mPositionMtx, mScaleX, mScaleY, 1);
|
||||
MTXConcat(rotMtx, mPositionMtx, tmp);
|
||||
MTXTransApply(tmp, mPositionMtx, param_0 + tmpX, param_1 + tmpY, 0);
|
||||
}
|
||||
|
||||
/* 802F7680-802F76F8 2F1FC0 0078+00 1/0 7/3 0/0 .text setCullBack__7J2DPaneF11_GXCullMode
|
||||
|
||||
@@ -662,7 +662,7 @@ void J2DPicture::changeTexture(char const* param_0, u8 param_1, JUTPalette* para
|
||||
/* 802FDB28-802FDB90 2F8468 0068+00 1/0 1/0 0/0 .text drawSelf__10J2DPictureFff */
|
||||
void J2DPicture::drawSelf(f32 param_0, f32 param_1) {
|
||||
Mtx tmp;
|
||||
PSMTXIdentity(tmp);
|
||||
MTXIdentity(tmp);
|
||||
|
||||
drawSelf(param_0, param_1, &tmp);
|
||||
}
|
||||
@@ -732,7 +732,7 @@ void J2DPicture::drawTexCoord(f32 param_0, f32 param_1, f32 param_2, f32 param_3
|
||||
|
||||
getNewColor(black);
|
||||
setTevMode();
|
||||
PSMTXConcat((MtxP)param_12,mGlobalMtx,outputMtx);
|
||||
MTXConcat((MtxP)param_12,mGlobalMtx,outputMtx);
|
||||
|
||||
GXLoadPosMtxImm(outputMtx,0);
|
||||
GXClearVtxDesc();
|
||||
|
||||
@@ -305,7 +305,7 @@ void J2DTextBox::draw(f32 posX, f32 posY) {
|
||||
if (mStringPtr != NULL) {
|
||||
print.print(0.0f, 0.0f, mAlpha, "%s", mStringPtr);
|
||||
}
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,7 @@ void J2DTextBox::draw(f32 posX, f32 posY, f32 param_2, J2DTextBoxHBinding hBind)
|
||||
print.printReturn(mStringPtr, param_2, 0.0f, hBind, VBIND_TOP, 0.0f, -mFontSizeY,
|
||||
mAlpha);
|
||||
}
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
@@ -421,7 +421,7 @@ bool J2DTextBox::setConnectParent(bool connected) {
|
||||
/* 803008E8-80300950 2FB228 0068+00 1/0 1/0 0/0 .text drawSelf__10J2DTextBoxFff */
|
||||
void J2DTextBox::drawSelf(f32 param_0, f32 param_1) {
|
||||
Mtx identity;
|
||||
PSMTXIdentity(identity);
|
||||
MTXIdentity(identity);
|
||||
|
||||
drawSelf(param_0, param_1, &identity);
|
||||
}
|
||||
@@ -434,7 +434,7 @@ void J2DTextBox::drawSelf(f32 param_0, f32 param_1, Mtx* p_mtx) {
|
||||
J2DPrint print(mFont, mCharSpacing, mLineSpacing, mCharColor, mGradientColor, mBlackColor,
|
||||
mWhiteColor);
|
||||
print.setFontSize(mFontSizeX, mFontSizeY);
|
||||
PSMTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
MTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
|
||||
GXLoadPosMtxImm(m, GX_PNMTX0);
|
||||
GXSetNumIndStages(0);
|
||||
|
||||
@@ -211,7 +211,7 @@ void J2DTextBoxEx::drawSelf(f32 param_0, f32 param_1, Mtx* p_mtx) {
|
||||
|
||||
if (mMaterial != NULL) {
|
||||
mMaterial->setGX();
|
||||
PSMTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
MTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
|
||||
GXLoadPosMtxImm(m, GX_PNMTX0);
|
||||
GXClearVtxDesc();
|
||||
@@ -288,7 +288,7 @@ void J2DTextBoxEx::draw(f32 posX, f32 posY) {
|
||||
GXSetTevDirect((GXTevStageID)i);
|
||||
}
|
||||
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
@@ -346,7 +346,7 @@ void J2DTextBoxEx::draw(f32 posX, f32 posY, f32 param_2, J2DTextBoxHBinding hBin
|
||||
GXSetTevDirect((GXTevStageID)i);
|
||||
}
|
||||
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user