some various J2D/J3D work (#2043)

* most of J2DPicture done

* fix GXSetTexCoordGen

* some j3d work
This commit is contained in:
TakaRikka
2024-01-22 07:23:54 -08:00
committed by GitHub
parent 5a735a4956
commit 697cd08979
27 changed files with 1096 additions and 377 deletions
-4
View File
@@ -25,10 +25,6 @@ void J2DGrafContext::setPort() {
GXSetViewport(bounds.i.x, bounds.i.y, bounds.getWidth(), bounds.getHeight(), 0.0f, 1.0f);
}
static inline void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) {
GXSetTexCoordGen2(dst, type, src, mtx, GX_FALSE, GX_PTIDENTITY);
}
/* 802E8C44-802E8E20 2E3584 01DC+00 1/0 1/0 0/0 .text setup2D__14J2DGrafContextFv */
void J2DGrafContext::setup2D() {
GXSetNumIndStages(0);
-4
View File
@@ -406,10 +406,6 @@ void J2DTexGenBlock::initialize() {
}
}
static inline void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) {
GXSetTexCoordGen2(dst, type, src, mtx, GX_FALSE, GX_PTIDENTITY);
}
/* 802EB570-802EB620 2E5EB0 00B0+00 0/0 1/1 0/0 .text setGX__14J2DTexGenBlockFv */
void J2DTexGenBlock::setGX() {
GXSetNumTexGens(mTexGenNum);
+1 -1
View File
@@ -342,7 +342,7 @@ void J2DMaterial::setAnimation(J2DAnmTexPattern* anm) {
u16 matID = anm->getUpdateMaterialID(i);
if (index == matID) {
mAnmPointer->field_0x22[anmTbl[i]._4] = i;
mAnmPointer->field_0x22[anmTbl[i].mTexNo] = i;
}
}
}
File diff suppressed because it is too large Load Diff
+26 -25
View File
@@ -208,7 +208,7 @@ SECTION_SDATA2 static f32 lit_1563[1 + 1 /* padding */] = {
// almost
#ifdef NONMATCHING
J2DScreen::J2DScreen()
: J2DPane(NULL, true, 'root', JGeometry::TBox2<f32>(0.0f, 0.0f, 0.0f, 0.0f)), mColor() {
: J2DPane(NULL, true, 'root', JGeometry::TBox2<f32>(0.0f, 0.0f, 640.0f, 480.0f)), mColor() {
field_0x4 = -1;
mScissor = false;
mMaterialNum = 0;
@@ -342,14 +342,12 @@ bool J2DScreen::getScreenInformation(JSURandomInputStream* p_stream) {
/* 802F8990-802F8B98 2F32D0 0208+00 1/1 0/0 0/0 .text
* makeHierarchyPanes__9J2DScreenFP7J2DPaneP20JSURandomInputStreamUlP10JKRArchive */
// goto can probably be replaced
s32 J2DScreen::makeHierarchyPanes(J2DPane* p_basePane, JSURandomInputStream* p_stream, u32 param_2,
JKRArchive* p_archive) {
J2DScrnBlockHeader header;
J2DPane* next_pane = p_basePane;
do {
loop:
while (true) {
J2DScrnBlockHeader header;
p_stream->peek(&header, sizeof(J2DScrnBlockHeader));
switch (header.mTag) {
@@ -360,10 +358,10 @@ s32 J2DScreen::makeHierarchyPanes(J2DPane* p_basePane, JSURandomInputStream* p_s
p_stream->seek(header.mSize, JSUStreamSeekFrom_CUR);
int ret = makeHierarchyPanes(next_pane, p_stream, param_2, p_archive);
if (ret == 0) {
goto loop;
if (ret != 0) {
return ret;
}
return ret;
break;
case 'END1':
p_stream->seek(header.mSize, JSUStreamSeekFrom_CUR);
return 0;
@@ -371,33 +369,36 @@ s32 J2DScreen::makeHierarchyPanes(J2DPane* p_basePane, JSURandomInputStream* p_s
J2DResReference* texRes = getResReference(p_stream, param_2);
mTexRes = texRes;
if (texRes != NULL) {
goto loop;
if (texRes == NULL) {
return 2;
}
return 2;
break;
case 'FNT1':
J2DResReference* fntRes = getResReference(p_stream, param_2);
mFontRes = fntRes;
if (fntRes != NULL) {
goto loop;
if (fntRes == NULL) {
return 2;
}
return 2;
break;
case 'MAT1':
if (createMaterial(p_stream, param_2, p_archive)) {
goto loop;
if (!createMaterial(p_stream, param_2, p_archive)) {
return 2;
}
break;
default:
if (p_archive == NULL) {
next_pane = createPane(header, p_stream, p_basePane, param_2);
} else {
next_pane = createPane(header, p_stream, p_basePane, param_2, p_archive);
}
return 2;
}
if (p_archive == NULL) {
next_pane = createPane(header, p_stream, p_basePane, param_2);
} else {
next_pane = createPane(header, p_stream, p_basePane, param_2, p_archive);
if (next_pane == NULL) {
return 2;
}
break;
}
} while (next_pane != NULL);
return 2;
}
}
/* 802F8B98-802F8ED4 2F34D8 033C+00 1/0 0/0 0/0 .text
-4
View File
@@ -557,10 +557,6 @@ void J2DWindow::drawContentsTexture(f32 param_0, f32 param_1, f32 param_2, f32 p
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
}
static inline void GXSetTexCoordGen(GXTexCoordID dst, GXTexGenType type, GXTexGenSrc src, u32 mtx) {
GXSetTexCoordGen2(dst, type, src, mtx, GX_FALSE, GX_PTIDENTITY);
}
/* 802FBB90-802FBE60 2F64D0 02D0+00 2/2 0/0 0/0 .text
* setTevMode__9J2DWindowFP10JUTTextureQ28JUtility6TColorQ28JUtility6TColor */
void J2DWindow::setTevMode(JUTTexture* param_0, JUtility::TColor param_1,