mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-13 13:56:49 -04:00
project cleanup (#2895)
* some wii OS fixes * remove old dol2asm comments * remove dol2asm.h * remove function address comments * normalize ATTRIBUTE_ALIGN usage * DECL_WEAK macro * fix gcc attribute weak macro * wrap more mwcc specific things in ifdefs * fixes * fix revo sdk version flags * fixes
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: J2DPicture
|
||||
//
|
||||
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/J2DGraph/J2DPicture.h"
|
||||
@@ -14,7 +9,6 @@
|
||||
#include "JSystem/JSupport/JSURandomInputStream.h"
|
||||
#include "dolphin/gx.h"
|
||||
|
||||
/* 802FC050-802FC118 2F6990 00C8+00 0/0 2/2 0/0 .text __ct__10J2DPictureFv */
|
||||
J2DPicture::J2DPicture() : mPalette(NULL) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mTexture[i] = NULL;
|
||||
@@ -26,15 +20,11 @@ J2DPicture::J2DPicture() : mPalette(NULL) {
|
||||
}
|
||||
|
||||
|
||||
/* 802FC118-802FC1D4 2F6A58 00BC+00 0/0 1/1 0/0 .text
|
||||
* __ct__10J2DPictureFP7J2DPaneP20JSURandomInputStreamP10JKRArchive */
|
||||
J2DPicture::J2DPicture(J2DPane* p_pane, JSURandomInputStream* p_stream, JKRArchive* p_archive)
|
||||
: mPalette(NULL) {
|
||||
private_readStream(p_pane, p_stream, p_archive);
|
||||
}
|
||||
|
||||
/* 802FC1D4-802FC708 2F6B14 0534+00 0/0 1/1 0/0 .text
|
||||
* __ct__10J2DPictureFP7J2DPaneP20JSURandomInputStreamP11J2DMaterial */
|
||||
J2DPicture::J2DPicture(J2DPane* p_pane, JSURandomInputStream* p_stream, J2DMaterial* p_material)
|
||||
: mPalette(NULL) {
|
||||
int position = p_stream->getPosition();
|
||||
@@ -136,7 +126,6 @@ J2DPicture::J2DPicture(J2DPane* p_pane, JSURandomInputStream* p_stream, J2DMater
|
||||
setBlendAlphaRatio(alpha.a, alpha.b);
|
||||
}
|
||||
|
||||
/* 802FC708-802FC800 2F7048 00F8+00 0/0 20/20 1/1 .text __ct__10J2DPictureFPC7ResTIMG */
|
||||
J2DPicture::J2DPicture(ResTIMG const* p_timg) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mTexture[i] = NULL;
|
||||
@@ -153,8 +142,6 @@ J2DPicture::J2DPicture(ResTIMG const* p_timg) {
|
||||
}
|
||||
|
||||
|
||||
/* 802FC800-802FC8E8 2F7140 00E8+00 0/0 5/5 0/0 .text
|
||||
* __ct__10J2DPictureFUxRCQ29JGeometry8TBox2<f>PC7ResTIMGPC7ResTLUT */
|
||||
J2DPicture::J2DPicture(u64 tag, JGeometry::TBox2<f32> const& bounds, ResTIMG const* p_timg,
|
||||
ResTLUT const* p_tlut)
|
||||
: J2DPane(tag, bounds), mPalette(NULL) {
|
||||
@@ -169,8 +156,6 @@ J2DPicture::J2DPicture(u64 tag, JGeometry::TBox2<f32> const& bounds, ResTIMG con
|
||||
initinfo();
|
||||
}
|
||||
|
||||
/* 802FC8E8-802FCCDC 2F7228 03F4+00 1/1 0/0 0/0 .text
|
||||
* private_readStream__10J2DPictureFP7J2DPaneP20JSURandomInputStreamP10JKRArchive */
|
||||
void J2DPicture::private_readStream(J2DPane* parent, JSURandomInputStream* stream,
|
||||
JKRArchive* archive) {
|
||||
J2DScrnBlockHeader header;
|
||||
@@ -245,8 +230,6 @@ void J2DPicture::private_readStream(J2DPane* parent, JSURandomInputStream* strea
|
||||
setBlendRatio(1.0f, 1.0f);
|
||||
}
|
||||
|
||||
/* 802FCCDC-802FCD70 2F761C 0094+00 1/0 0/0 0/0 .text initiate__10J2DPictureFPC7ResTIMGPC7ResTLUT
|
||||
*/
|
||||
void J2DPicture::initiate(const ResTIMG* img, const ResTLUT* lut) {
|
||||
private_initiate(img, lut);
|
||||
if (mTexture[0] == NULL) {
|
||||
@@ -256,8 +239,6 @@ void J2DPicture::initiate(const ResTIMG* img, const ResTLUT* lut) {
|
||||
place(JGeometry::TBox2<f32>(0.0f, 0.0f, mTexture[0]->getWidth(), mTexture[0]->getHeight()));
|
||||
}
|
||||
|
||||
/* 802FCD70-802FCE9C 2F76B0 012C+00 2/2 0/0 0/0 .text
|
||||
* private_initiate__10J2DPictureFPC7ResTIMGPC7ResTLUT */
|
||||
void J2DPicture::private_initiate(const ResTIMG* timg, const ResTLUT* tlut) {
|
||||
if (mTextureNum != 0) {
|
||||
return;
|
||||
@@ -286,7 +267,6 @@ void J2DPicture::private_initiate(const ResTIMG* timg, const ResTLUT* tlut) {
|
||||
}
|
||||
}
|
||||
|
||||
/* 802FCE9C-802FCFF0 2F77DC 0154+00 3/3 0/0 0/0 .text initinfo__10J2DPictureFv */
|
||||
void J2DPicture::initinfo() {
|
||||
mKind = 'PIC1';
|
||||
setTexCoord(NULL, BIND15, MIRROR0, false);
|
||||
@@ -298,7 +278,6 @@ void J2DPicture::initinfo() {
|
||||
}
|
||||
|
||||
|
||||
/* 802FCFF0-802FD098 2F7930 00A8+00 1/0 3/3 0/0 .text __dt__10J2DPictureFv */
|
||||
J2DPicture::~J2DPicture() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if ((int)(field_0x109 & 1 << i) != 0) {
|
||||
@@ -309,7 +288,6 @@ J2DPicture::~J2DPicture() {
|
||||
delete mPalette;
|
||||
}
|
||||
|
||||
/* 802FD098-802FD168 2F79D8 00D0+00 1/0 0/0 0/0 .text prepareTexture__10J2DPictureFUc */
|
||||
bool J2DPicture::prepareTexture(u8 param_0) {
|
||||
for (u8 i = 0; i < param_0; i++) {
|
||||
if (i >= 2) {
|
||||
@@ -329,8 +307,6 @@ bool J2DPicture::prepareTexture(u8 param_0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 802FD168-802FD4B4 2F7AA8 034C+00 1/0 0/0 0/0 .text
|
||||
* insert__10J2DPictureFPC7ResTIMGP10JUTPaletteUcf */
|
||||
bool J2DPicture::insert(ResTIMG const* img, JUTPalette* palette, u8 param_2, f32 param_3) {
|
||||
if (img == NULL || mTextureNum >= 2 || param_2 >= 2 || param_2 > mTextureNum) {
|
||||
return false;
|
||||
@@ -405,13 +381,11 @@ bool J2DPicture::insert(ResTIMG const* img, JUTPalette* palette, u8 param_2, f32
|
||||
}
|
||||
|
||||
|
||||
/* 802FD4B4-802FD524 2F7DF4 0070+00 1/0 0/0 0/0 .text insert__10J2DPictureFPCcP10JUTPaletteUcf */
|
||||
bool J2DPicture::insert(char const* resName, JUTPalette* palette, u8 param_2, f32 param_3) {
|
||||
void* resource = J2DScreen::getNameResource(resName);
|
||||
return insert((ResTIMG*)resource, palette, param_2, param_3);
|
||||
}
|
||||
|
||||
/* 802FD524-802FD6F4 2F7E64 01D0+00 1/0 0/0 0/0 .text insert__10J2DPictureFP10JUTTextureUcf */
|
||||
bool J2DPicture::insert(JUTTexture* texture, u8 param_1, f32 param_2) {
|
||||
if (texture == NULL || mTextureNum >= 2 || param_1 >= 2 || param_1 > mTextureNum) {
|
||||
return false;
|
||||
@@ -448,7 +422,6 @@ bool J2DPicture::insert(JUTTexture* texture, u8 param_1, f32 param_2) {
|
||||
}
|
||||
|
||||
|
||||
/* 802FD6F4-802FD814 2F8034 0120+00 1/0 0/0 0/0 .text remove__10J2DPictureFUc */
|
||||
bool J2DPicture::remove(u8 param_0) {
|
||||
if (mTextureNum <= param_0 || mTextureNum == 1) {
|
||||
return false;
|
||||
@@ -474,8 +447,6 @@ bool J2DPicture::remove(u8 param_0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 802FD814-802FD874 2F8154 0060+00 1/0 0/0 0/0 .text remove__10J2DPictureFP10JUTTexture
|
||||
*/
|
||||
bool J2DPicture::remove(JUTTexture* param_0) {
|
||||
u8 i = 0;
|
||||
for (; i < mTextureNum; i++) {
|
||||
@@ -486,7 +457,6 @@ bool J2DPicture::remove(JUTTexture* param_0) {
|
||||
return remove(i);
|
||||
}
|
||||
|
||||
/* 802FD874-802FD964 2F81B4 00F0+00 1/0 0/0 0/0 .text changeTexture__10J2DPictureFPC7ResTIMGUc */
|
||||
const ResTIMG* J2DPicture::changeTexture(ResTIMG const* img, u8 texIndex) {
|
||||
if (texIndex > mTextureNum || 2 <= texIndex || img == NULL) {
|
||||
return NULL;
|
||||
@@ -510,8 +480,6 @@ const ResTIMG* J2DPicture::changeTexture(ResTIMG const* img, u8 texIndex) {
|
||||
}
|
||||
|
||||
|
||||
/* 802FD964-802FD9BC 2F82A4 0058+00 1/0 0/0 0/0 .text changeTexture__10J2DPictureFPCcUc
|
||||
*/
|
||||
const ResTIMG* J2DPicture::changeTexture(char const* resName, u8 param_1) {
|
||||
void* resource = J2DScreen::getNameResource(resName);
|
||||
return changeTexture((ResTIMG*)resource, param_1);
|
||||
@@ -522,8 +490,6 @@ static bool dummy_weak_order(JUTTexture* tex) {
|
||||
return picture->append(tex, 1.0f);
|
||||
}
|
||||
|
||||
/* 802FD9BC-802FDAC8 2F82FC 010C+00 1/0 0/0 0/0 .text
|
||||
* changeTexture__10J2DPictureFPC7ResTIMGUcP10JUTPalette */
|
||||
const ResTIMG* J2DPicture::changeTexture(ResTIMG const* img, u8 texIndex, JUTPalette* palette) {
|
||||
if (texIndex > mTextureNum || 2 <= texIndex || img == NULL) {
|
||||
return NULL;
|
||||
@@ -547,14 +513,11 @@ const ResTIMG* J2DPicture::changeTexture(ResTIMG const* img, u8 texIndex, JUTPal
|
||||
}
|
||||
|
||||
|
||||
/* 802FDAC8-802FDB28 2F8408 0060+00 1/0 0/0 0/0 .text
|
||||
* changeTexture__10J2DPictureFPCcUcP10JUTPalette */
|
||||
const ResTIMG* J2DPicture::changeTexture(char const* param_0, u8 param_1, JUTPalette* param_2) {
|
||||
void* resource = J2DScreen::getNameResource(param_0);
|
||||
return changeTexture((ResTIMG*)resource, param_1, param_2);
|
||||
}
|
||||
|
||||
/* 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;
|
||||
MTXIdentity(tmp);
|
||||
@@ -562,8 +525,6 @@ void J2DPicture::drawSelf(f32 param_0, f32 param_1) {
|
||||
drawSelf(param_0, param_1, &tmp);
|
||||
}
|
||||
|
||||
/* 802FDB90-802FDBFC 2F84D0 006C+00 1/0 0/0 0/0 .text drawSelf__10J2DPictureFffPA3_A4_f
|
||||
*/
|
||||
void J2DPicture::drawSelf(f32 param_0, f32 param_1, Mtx* param_2) {
|
||||
if (mTexture[0] != NULL && mTextureNum != 0) {
|
||||
drawFullSet(mGlobalBounds.i.x + param_0, mGlobalBounds.i.y + param_1,
|
||||
@@ -571,7 +532,6 @@ void J2DPicture::drawSelf(f32 param_0, f32 param_1, Mtx* param_2) {
|
||||
}
|
||||
}
|
||||
|
||||
/* 802FDBFC-802FDC70 2F853C 0074+00 1/0 0/0 0/0 .text drawFullSet__10J2DPictureFffffPA3_A4_f */
|
||||
void J2DPicture::drawFullSet(f32 param_0, f32 param_1, f32 param_2, f32 param_3, Mtx* param_4) {
|
||||
if (mTexture[0] != NULL && mTextureNum != 0) {
|
||||
drawTexCoord(mBounds.i.x, mBounds.i.y, param_2, param_3, field_0x10a[0].x, field_0x10a[0].y,
|
||||
@@ -580,7 +540,6 @@ void J2DPicture::drawFullSet(f32 param_0, f32 param_1, f32 param_2, f32 param_3,
|
||||
}
|
||||
}
|
||||
|
||||
/* 802FDC70-802FDF88 2F85B0 0318+00 1/0 1/1 0/0 .text draw__10J2DPictureFffffbbb */
|
||||
void J2DPicture::draw(f32 x, f32 y, f32 width, f32 height, bool mirrorX, bool mirrorY,
|
||||
bool rotate90) {
|
||||
if (isVisible() && mTextureNum != 0 && mTexture[0] != NULL) {
|
||||
@@ -641,8 +600,6 @@ void J2DPicture::draw(f32 x, f32 y, f32 width, f32 height, bool mirrorX, bool mi
|
||||
}
|
||||
|
||||
|
||||
/* 802FDF88-802FE380 2F88C8 03F8+00 1/0 0/0 0/0 .text
|
||||
* drawOut__10J2DPictureFRCQ29JGeometry8TBox2<f>RCQ29JGeometry8TBox2<f> */
|
||||
void J2DPicture::drawOut(JGeometry::TBox2<f32> const& posBox,
|
||||
JGeometry::TBox2<f32> const& texRect) {
|
||||
if (isVisible() && mTextureNum != 0 && mTexture[0] != NULL) {
|
||||
@@ -701,8 +658,6 @@ void J2DPicture::drawOut(JGeometry::TBox2<f32> const& posBox,
|
||||
}
|
||||
|
||||
|
||||
/* 802FE380-802FE5D0 2F8CC0 0250+00 1/0 0/0 0/0 .text
|
||||
* drawTexCoord__10J2DPictureFffffssssssssPA3_A4_f */
|
||||
void J2DPicture::drawTexCoord(f32 param_0, f32 param_1, f32 param_2, f32 param_3, s16 param_4,
|
||||
s16 param_5, s16 param_6, s16 param_7, s16 param_8, s16 param_9,
|
||||
s16 param_10, s16 param_11, Mtx* param_12) {
|
||||
@@ -757,7 +712,6 @@ void J2DPicture::drawTexCoord(f32 param_0, f32 param_1, f32 param_2, f32 param_3
|
||||
}
|
||||
|
||||
|
||||
/* 802FE5D0-802FEA60 2F8F10 0490+00 3/3 0/0 0/0 .text setTevMode__10J2DPictureFv */
|
||||
void J2DPicture::setTevMode() {
|
||||
u8 i;
|
||||
for (i = 0; i < mTextureNum; i++) {
|
||||
@@ -842,31 +796,24 @@ void J2DPicture::setTevMode() {
|
||||
}
|
||||
}
|
||||
|
||||
/* 802FEA60-802FEA74 2F93A0 0014+00 1/1 0/0 0/0 .text swap__10J2DPictureFRfRf */
|
||||
void J2DPicture::swap(f32& lhs, f32& rhs) {
|
||||
f32 tmp = lhs;
|
||||
lhs = rhs;
|
||||
rhs = tmp;
|
||||
}
|
||||
|
||||
/* 802FEA74-802FEA9C 2F93B4 0028+00 1/0 0/0 0/0 .text setBlendColorRatio__10J2DPictureFff
|
||||
*/
|
||||
void J2DPicture::setBlendColorRatio(f32 param_0, f32 param_1) {
|
||||
field_0x11c[0] = param_0;
|
||||
field_0x11c[1] = param_1;
|
||||
setBlendKonstColor();
|
||||
}
|
||||
|
||||
/* 802FEA9C-802FEAC4 2F93DC 0028+00 1/0 0/0 0/0 .text setBlendAlphaRatio__10J2DPictureFff
|
||||
*/
|
||||
void J2DPicture::setBlendAlphaRatio(f32 param_0, f32 param_1) {
|
||||
field_0x124[0] = param_0;
|
||||
field_0x124[1] = param_1;
|
||||
setBlendKonstAlpha();
|
||||
}
|
||||
|
||||
/* 802FEAC4-802FEB94 2F9404 00D0+00 4/4 0/0 0/0 .text setBlendKonstColor__10J2DPictureFv
|
||||
*/
|
||||
void J2DPicture::setBlendKonstColor() {
|
||||
int uvar3 = 0;
|
||||
for (u8 i = 1; i < mTextureNum; i++) {
|
||||
@@ -884,8 +831,6 @@ void J2DPicture::setBlendKonstColor() {
|
||||
mBlendKonstColor = uvar3;
|
||||
}
|
||||
|
||||
/* 802FEB94-802FEC64 2F94D4 00D0+00 4/4 0/0 0/0 .text setBlendKonstAlpha__10J2DPictureFv
|
||||
*/
|
||||
void J2DPicture::setBlendKonstAlpha() {
|
||||
int uvar3 = 0;
|
||||
for (u8 i = 1; i < mTextureNum; i++) {
|
||||
@@ -903,8 +848,6 @@ void J2DPicture::setBlendKonstAlpha() {
|
||||
mBlendKonstAlpha = uvar3;
|
||||
}
|
||||
|
||||
/* 802FEC64-802FED44 2F95A4 00E0+00 3/3 0/0 0/0 .text
|
||||
* getNewColor__10J2DPictureFPQ28JUtility6TColor */
|
||||
void J2DPicture::getNewColor(JUtility::TColor* param_0) {
|
||||
param_0[0] = mCornerColor[0];
|
||||
param_0[1] = mCornerColor[1];
|
||||
@@ -919,15 +862,11 @@ void J2DPicture::getNewColor(JUtility::TColor* param_0) {
|
||||
}
|
||||
}
|
||||
|
||||
/* 802FED44-802FED84 2F9684 0040+00 4/4 0/0 0/0 .text
|
||||
* setTexCoord__10J2DPictureFPC10JUTTexture10J2DBinding9J2DMirrorb */
|
||||
void J2DPicture::setTexCoord(JUTTexture const* param_0, J2DBinding param_1, J2DMirror param_2,
|
||||
bool param_3) {
|
||||
setTexCoord(&field_0x10a[0], param_0, param_1, param_2, param_3);
|
||||
}
|
||||
|
||||
/* 802FED84-802FF09C 2F96C4 0318+00 2/2 0/0 0/0 .text
|
||||
* setTexCoord__10J2DPictureFPQ29JGeometry8TVec2<s>PC10JUTTexture10J2DBinding9J2DMirrorb */
|
||||
void J2DPicture::setTexCoord(JGeometry::TVec2<s16>* param_0, JUTTexture const* param_1,
|
||||
J2DBinding binding, J2DMirror mirror, bool rotate90) {
|
||||
bool bindLeft;
|
||||
@@ -1042,7 +981,6 @@ void J2DPicture::setTexCoord(JGeometry::TVec2<s16>* param_0, JUTTexture const* p
|
||||
}
|
||||
|
||||
|
||||
/* 802FF09C-802FF100 2F99DC 0064+00 1/0 0/0 0/0 .text isUsed__10J2DPictureFPC7ResTIMG */
|
||||
bool J2DPicture::isUsed(ResTIMG const* param_0) {
|
||||
for (u8 i = 0; i < mTextureNum; i++) {
|
||||
if (mTexture[i] != NULL && mTexture[i]->getTexInfo() == param_0) {
|
||||
@@ -1053,7 +991,6 @@ bool J2DPicture::isUsed(ResTIMG const* param_0) {
|
||||
return J2DPane::isUsed(param_0);
|
||||
}
|
||||
|
||||
/* 802FF100-802FF1D0 2F9A40 00D0+00 1/0 0/0 0/0 .text getUsableTlut__10J2DPictureFUc */
|
||||
u8 J2DPicture::getUsableTlut(u8 param_0) {
|
||||
u8 var_r8 = 0;
|
||||
|
||||
@@ -1084,7 +1021,6 @@ u8 J2DPicture::getUsableTlut(u8 param_0) {
|
||||
return var_r26;
|
||||
}
|
||||
|
||||
/* 802FF1D0-802FF204 2F9B10 0034+00 1/1 1/1 0/0 .text getTlutID__10J2DPictureFPC7ResTIMGUc */
|
||||
GXTlut J2DPicture::getTlutID(ResTIMG const* img, u8 param_1) {
|
||||
if (img->numColors > 256) {
|
||||
return (GXTlut)((param_1 % 4) + 0x10);
|
||||
|
||||
Reference in New Issue
Block a user