mirror of
https://github.com/zeldaret/tww.git
synced 2026-06-17 23:01:06 -04:00
misc cleanup
This commit is contained in:
@@ -215,7 +215,7 @@ public:
|
||||
virtual void patchTevReg();
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex();
|
||||
virtual void indexToPtr() { return indexToPtr_private(mTexNoOffset); }
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
virtual u32 getType() { return 'TVPT'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTevStageNum(const u8* pNum) { mTevStageNum = *pNum; }
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
virtual void patchTevReg();
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() { return indexToPtr_private(mTexNoOffset); }
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
virtual u32 getType() { return 'TVB4'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 i, const u16* pNo) { mTexNo[i] = *pNo; }
|
||||
@@ -356,7 +356,7 @@ public:
|
||||
virtual void patchTevReg();
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() { return indexToPtr_private(mTexNoOffset); }
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
virtual u32 getType() { return 'TVB2'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 i, const u16* pNo) { mTexNo[i] = *pNo; }
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
virtual void patchTevReg();
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex();
|
||||
virtual void indexToPtr() { return indexToPtr_private(mTexNoOffset); }
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
virtual u32 getType() { return 'TV16'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 i, const u16* pNo) { mTexNo[i] = *pNo; }
|
||||
@@ -509,7 +509,7 @@ public:
|
||||
virtual void patchTevReg();
|
||||
virtual void patchTexNoAndTexCoordScale();
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() { return indexToPtr_private(mTexNoOffset); }
|
||||
virtual void indexToPtr() { indexToPtr_private(mTexNoOffset); }
|
||||
virtual u32 getType() { return 'TVB1'; }
|
||||
virtual s32 countDLSize();
|
||||
virtual void setTexNo(u32 i, const u16* pNo) { mTexNo[i] = *pNo; }
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
/* 802CD050-802CD0FC .text __ct__14J2DGrafContextFffff */
|
||||
J2DGrafContext::J2DGrafContext(f32 x, f32 y, f32 width, f32 height)
|
||||
: mBounds(x, y, x + width, y + height), mScissorBounds(x, y, x + width, y + height) {
|
||||
JUtility::TColor color(-1);
|
||||
setColor(color);
|
||||
setColor(JUtility::TColor());
|
||||
setLineWidth(6);
|
||||
}
|
||||
|
||||
@@ -40,7 +39,7 @@ void J2DGrafContext::setup2D() {
|
||||
GXSetNumTexGens(0);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
GXLoadPosMtxImm(mPosMtx, GX_PNMTX0);
|
||||
Mtx mtx;
|
||||
MTXIdentity(mtx);
|
||||
GXLoadTexMtxImm(mtx, GX_IDENTITY, GX_MTX3x4);
|
||||
@@ -48,12 +47,12 @@ void J2DGrafContext::setup2D() {
|
||||
GX_AF_NONE);
|
||||
GXSetChanCtrl(GX_COLOR1A1, GX_FALSE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_NONE,
|
||||
GX_AF_NONE);
|
||||
GXSetCurrentMtx(0);
|
||||
GXSetCurrentMtx(GX_PNMTX0);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBX8, 0xf);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX1, GX_CLR_RGBA, GX_RGBX8, 0xf);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_U16, 0xf);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX1, GX_TEX_ST, GX_U16, 0xf);
|
||||
GXSetLineWidth(mLineWidth, GX_TO_ZERO);
|
||||
GXClearVtxDesc();
|
||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||
@@ -137,40 +136,40 @@ void J2DGrafContext::setLineWidth(u8 lineWidth) {
|
||||
void J2DGrafContext::fillBox(const JGeometry::TBox2<f32>& box) {
|
||||
GXSetBlendMode((GXBlendMode)mBoxPart.mType, (GXBlendFactor)mBoxPart.mSrcFactor,
|
||||
(GXBlendFactor)mBoxPart.mDstFactor, GX_LO_SET);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
|
||||
GXLoadPosMtxImm(mPosMtx, GX_PNMTX0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
GXPosition3f32(box.i.x, box.i.y, 0);
|
||||
GXPosition3f32(box.i.x, box.i.y, 0.0f);
|
||||
GXColor1u32(mColorTL);
|
||||
GXPosition3f32(box.f.x, box.i.y, 0);
|
||||
GXPosition3f32(box.f.x, box.i.y, 0.0f);
|
||||
GXColor1u32(mColorTR);
|
||||
GXPosition3f32(box.f.x, box.f.y, 0);
|
||||
GXPosition3f32(box.f.x, box.f.y, 0.0f);
|
||||
GXColor1u32(mColorBL);
|
||||
GXPosition3f32(box.i.x, box.f.y, 0);
|
||||
GXPosition3f32(box.i.x, box.f.y, 0.0f);
|
||||
GXColor1u32(mColorBR);
|
||||
GXEnd();
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
}
|
||||
|
||||
/* 802CD858-802CD990 .text drawFrame__14J2DGrafContextFRCQ29JGeometry8TBox2<f> */
|
||||
void J2DGrafContext::drawFrame(const JGeometry::TBox2<f32>& box) {
|
||||
GXSetBlendMode((GXBlendMode)mBoxPart.mType, (GXBlendFactor)mBoxPart.mSrcFactor,
|
||||
(GXBlendFactor)mBoxPart.mDstFactor, GX_LO_SET);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
|
||||
GXLoadPosMtxImm(mPosMtx, GX_PNMTX0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXBegin(GX_LINESTRIP, GX_VTXFMT0, 5);
|
||||
GXPosition3f32(box.i.x, box.i.y, 0);
|
||||
GXPosition3f32(box.i.x, box.i.y, 0.0f);
|
||||
GXColor1u32(mColorTL);
|
||||
GXPosition3f32(box.f.x, box.i.y, 0);
|
||||
GXPosition3f32(box.f.x, box.i.y, 0.0f);
|
||||
GXColor1u32(mColorTR);
|
||||
GXPosition3f32(box.f.x, box.f.y, 0);
|
||||
GXPosition3f32(box.f.x, box.f.y, 0.0f);
|
||||
GXColor1u32(mColorBL);
|
||||
GXPosition3f32(box.i.x, box.f.y, 0);
|
||||
GXPosition3f32(box.i.x, box.f.y, 0.0f);
|
||||
GXColor1u32(mColorBR);
|
||||
GXPosition3f32(box.i.x, box.i.y, 0);
|
||||
GXPosition3f32(box.i.x, box.i.y, 0.0f);
|
||||
GXColor1u32(mColorTL);
|
||||
GXEnd();
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
}
|
||||
|
||||
/* 802CD990-802CDA6C .text line__14J2DGrafContextFQ29JGeometry8TVec2<f>Q29JGeometry8TVec2<f>
|
||||
@@ -178,15 +177,15 @@ void J2DGrafContext::drawFrame(const JGeometry::TBox2<f32>& box) {
|
||||
void J2DGrafContext::line(JGeometry::TVec2<f32> start, JGeometry::TVec2<f32> end) {
|
||||
GXSetBlendMode((GXBlendMode)mLinePart.mType, (GXBlendFactor)mLinePart.mSrcFactor,
|
||||
(GXBlendFactor)mLinePart.mDstFactor, GX_LO_SET);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
|
||||
GXLoadPosMtxImm(mPosMtx, GX_PNMTX0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GXBegin(GX_LINES, GX_VTXFMT0, 2);
|
||||
GXPosition3f32(start.x, start.y, 0);
|
||||
GXColor1u32(mColorTL);
|
||||
GXPosition3f32(end.x, end.y, 0);
|
||||
GXColor1u32(mColorBR);
|
||||
GXEnd();
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
|
||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
|
||||
}
|
||||
|
||||
/* 802CDA6C-802CDADC .text lineTo__14J2DGrafContextFQ29JGeometry8TVec2<f> */
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 802CDB78-802CDBD8 .text __ct__13J2DOrthoGraphFv */
|
||||
J2DOrthoGraph::J2DOrthoGraph() : J2DGrafContext(0, 0, 0, 0) {
|
||||
J2DOrthoGraph::J2DOrthoGraph() : J2DGrafContext(0.0f, 0.0f, 0.0f, 0.0f) {
|
||||
this->setLookat();
|
||||
}
|
||||
|
||||
/* 802CDBD8-802CDCB4 .text __ct__13J2DOrthoGraphFffffff */
|
||||
J2DOrthoGraph::J2DOrthoGraph(f32 x, f32 y, f32 width, f32 height, f32 far, f32 near)
|
||||
: J2DGrafContext(x, y, width, height) {
|
||||
mOrtho = JGeometry::TBox2<f32>(0, 0, width, height);
|
||||
mOrtho = JGeometry::TBox2<f32>(0.0f, 0.0f, width, height);
|
||||
mNear = far;
|
||||
mFar = near;
|
||||
this->setLookat();
|
||||
@@ -38,7 +38,7 @@ void J2DOrthoGraph::setOrtho(const JGeometry::TBox2<f32>& bounds, f32 far, f32 n
|
||||
/* 802CDD48-802CDD84 .text setLookat__13J2DOrthoGraphFv */
|
||||
void J2DOrthoGraph::setLookat() {
|
||||
MTXIdentity(mPosMtx);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
GXLoadPosMtxImm(mPosMtx, GX_PNMTX0);
|
||||
}
|
||||
|
||||
/* 802CDD84-802CDE10 .text
|
||||
|
||||
@@ -17,7 +17,7 @@ J2DPane::J2DPane() : mPaneTree(this) {
|
||||
mVisible = true;
|
||||
mTag = 0;
|
||||
|
||||
mBounds.set(0.f, 0.f, 0.f, 0.f);
|
||||
mBounds.set(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
initiate();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void J2DPane::initiate() {
|
||||
mBasePosition.y = 0.0f;
|
||||
mRotationAxis = ROTATE_Z;
|
||||
mRotation = 0.0f;
|
||||
mCullMode = 0;
|
||||
mCullMode = GX_CULL_NONE;
|
||||
mAlpha = 0xFF;
|
||||
mInheritAlpha = TRUE;
|
||||
mDrawAlpha = 0xFF;
|
||||
@@ -146,7 +146,7 @@ bool J2DPane::insertChild(J2DPane* pPrev, J2DPane* pChild) {
|
||||
}
|
||||
|
||||
/* 802D0078-802D054C .text draw__7J2DPaneFffPC14J2DGrafContextb */
|
||||
void J2DPane::draw(float x, float y, const J2DGrafContext* pCtx, bool clip) {
|
||||
void J2DPane::draw(f32 x, f32 y, const J2DGrafContext* pCtx, bool clip) {
|
||||
J2DGrafContext ctx = *pCtx;
|
||||
|
||||
if (pCtx->getGrafType() != 1)
|
||||
@@ -203,7 +203,7 @@ void J2DPane::draw(float x, float y, const J2DGrafContext* pCtx, bool clip) {
|
||||
}
|
||||
|
||||
/* 802D054C-802D05C8 .text move__7J2DPaneFff */
|
||||
void J2DPane::move(float x, float y) {
|
||||
void J2DPane::move(f32 x, f32 y) {
|
||||
JGeometry::TBox2<f32> bounds;
|
||||
f32 width = mBounds.getWidth(), height = mBounds.getHeight();
|
||||
bounds.set(x, y, x + width, y + height);
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
// Translation Unit: J3DMatBlock.cpp
|
||||
//
|
||||
|
||||
#include "JSystem/J3DGraphBase/J3DTexture.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTransform.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
#include "JSystem/J3DGraphBase/J3DStruct.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTevs.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTexture.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTransform.h"
|
||||
#include "dolphin/gd/GDBase.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
@@ -117,7 +117,7 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
|
||||
compression = JKRCheckCompressed(bufPtr);
|
||||
uncompressedSize = JKRDecompExpandSize(bufPtr);
|
||||
if (command->field_0x18 && command->field_0x18 > uncompressedSize) {
|
||||
if (command->field_0x18 && uncompressedSize > command->field_0x18) {
|
||||
uncompressedSize = command->field_0x18;
|
||||
}
|
||||
}
|
||||
@@ -131,13 +131,13 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
command->mBlock =
|
||||
JKRAram::getAramHeap()->alloc(uncompressedSize, JKRAramHeap::HEAD);
|
||||
if (command->mBlock) {
|
||||
command->mAddress = command->mBlock->mAddress;
|
||||
command->mAddress = command->mBlock->getAddress();
|
||||
}
|
||||
dvdFile->mBlock = command->mBlock;
|
||||
}
|
||||
|
||||
if (command->mBlock) {
|
||||
command->mAddress = command->mBlock->mAddress;
|
||||
command->mAddress = command->mBlock->getAddress();
|
||||
}
|
||||
|
||||
if (command->mAddress == 0) {
|
||||
@@ -150,7 +150,7 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
}
|
||||
|
||||
if (command->mBlock) {
|
||||
command->mAddress = command->mBlock->mAddress;
|
||||
command->mAddress = command->mBlock->getAddress();
|
||||
}
|
||||
|
||||
if (command->mAddress == 0) {
|
||||
@@ -316,10 +316,10 @@ static int decompSZS_subroutine(u8* src, u32 dest) {
|
||||
if (refCurrent == refEnd) {
|
||||
refCurrent = refBuf;
|
||||
}
|
||||
readCount++;
|
||||
src++;
|
||||
readCount++;
|
||||
} else {
|
||||
u32 dist = ((src[0] & 0x0f) << 8) | src[1];
|
||||
u32 dist = src[1] | (src[0] & 0x0f) << 8;
|
||||
s32 numBytes = src[0] >> 4;
|
||||
src += 2;
|
||||
u8* copySource = refCurrent - dist - 1;
|
||||
@@ -327,8 +327,8 @@ static int decompSZS_subroutine(u8* src, u32 dest) {
|
||||
copySource += refEnd - refBuf;
|
||||
}
|
||||
if (numBytes == 0) {
|
||||
numBytes = *src + 0x12;
|
||||
src += 1;
|
||||
numBytes = *(src++);
|
||||
numBytes += 0x12;
|
||||
} else {
|
||||
numBytes += 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user