some J3D/misc cleanup (#2628)

* some j3d cleanup

* begin using uintptr_t

* j3dgraphbase cleanup

* j3dgraphanimator cleanup
This commit is contained in:
TakaRikka
2025-09-04 07:56:59 -07:00
committed by GitHub
parent ee8b843996
commit b45a089e15
290 changed files with 4221 additions and 3605 deletions
+2 -2
View File
@@ -1217,7 +1217,7 @@ void J2DPictureEx::setAnimation(J2DAnmVtxColor* anm) {
if (field_0x158[i] != 0xffff) {
for (u16 j = 0; j < anm_table_num; j++) {
J3DAnmVtxColorIndexData* data = anm->getAnmVtxColorIndexData(0, j);
u16* index = anm->getVtxColorIndexPointer(0) + (u32)data->mpData;
u16* index = anm->getVtxColorIndexPointer(0) + (uintptr_t)data->mpData;
for (u16 k = 0; k < data->mNum; k++) {
if (index[k] == field_0x158[i]) {
field_0x198 = anm;
@@ -1255,7 +1255,7 @@ const J2DAnmTransform* J2DPictureEx::animationPane(J2DAnmTransform const* anm) {
if (field_0x19c & (1 << i)) {
for (u16 j = 0; j < anm_table_num; j++) {
J3DAnmVtxColorIndexData* data = field_0x198->getAnmVtxColorIndexData(0, j);
u16* index = field_0x198->getVtxColorIndexPointer(0) + (u32)data->mpData;
u16* index = field_0x198->getVtxColorIndexPointer(0) + (uintptr_t)data->mpData;
for (u16 k = 0; k < data->mNum; k++) {
if (index[k] == field_0x158[i]) {
field_0x198->getColor(0, j, &mCornerColor[i]);
+6 -6
View File
@@ -237,7 +237,7 @@ f32 J2DPrint::parse(const u8* pString, int length, int param_2, u16* param_3,
b2ByteCharacter = true;
}
if (iCharacter == 0 || ((u32)pString - (u32)pStringStart) > length) {
if (iCharacter == 0 || ((uintptr_t)pString - (uintptr_t)pStringStart) > length) {
if (!param_6 && param_3 != NULL) {
param_3[someIndex] = 0.5f + f31;
}
@@ -284,7 +284,7 @@ f32 J2DPrint::parse(const u8* pString, int length, int param_2, u16* param_3,
f31 = 0.0f;
}
}
} else if (b2ByteCharacter && ((u32)pString - (u32)pStringStart > (u32)length)) {
} else if (b2ByteCharacter && ((uintptr_t)pString - (uintptr_t)pStringStart > (u32)length)) {
if (!param_6 && param_3 != NULL) {
param_3[someIndex] = 0.5f + f31;
}
@@ -560,8 +560,8 @@ s32 J2DPrint::getNumberS32(const u8** ppu8String, s32 defaultValue, s32 errorVal
number = strtol((char*)*ppu8String, &pEnd, base);
} else if (base == 16) {
number = strtoul((char*)*ppu8String, &pEnd, base);
if ((u32)pEnd - (u32)*ppu8String != 8) {
if ((u32)pEnd - (u32)*ppu8String == 6) {
if ((uintptr_t)pEnd - (uintptr_t)*ppu8String != 8) {
if ((uintptr_t)pEnd - (uintptr_t)*ppu8String == 6) {
number = (number << 8) | 0xFF;
} else {
*ppu8String = pStringStart;
@@ -600,8 +600,8 @@ f32 J2DPrint::getNumberF32(const u8** ppu8String, f32 defaultValue, f32 errorVal
number = strtol((char*)*ppu8String, &pEnd, base);
} else if (base == 16) {
number = strtoul((char*)*ppu8String, &pEnd, base);
if ((u32)pEnd - (u32)*ppu8String != 8) {
if ((u32)pEnd - (u32)*ppu8String == 6) {
if ((uintptr_t)pEnd - (uintptr_t)*ppu8String != 8) {
if ((uintptr_t)pEnd - (uintptr_t)*ppu8String == 6) {
number = (number << 8) | 0xFF;
} else {
*ppu8String = pStringStart;
+2 -2
View File
@@ -920,7 +920,7 @@ void J2DWindowEx::setAnimation(J2DAnmVtxColor* param_0) {
for (u16 j = 0; j < uVar3; j++) {
J3DAnmVtxColorIndexData* puVar1 = param_0->getAnmVtxColorIndexData(0, j);
u16* indexPointer = param_0->getVtxColorIndexPointer(0);
u16* indexPointer2 = indexPointer + (u32)puVar1->mpData;
u16* indexPointer2 = indexPointer + (uintptr_t)puVar1->mpData;
for (u16 k = 0; k < puVar1->mNum; k++) {
if (indexPointer2[k] == field_0x168[i]) {
mAnmVtxColor = param_0;
@@ -964,7 +964,7 @@ const J2DAnmTransform* J2DWindowEx::animationPane(J2DAnmTransform const* param_0
for (u16 j = 0; j < uVar3; j++) {
J3DAnmVtxColorIndexData* puVar1 = mAnmVtxColor->getAnmVtxColorIndexData(0, j);
u16* indexPointer = mAnmVtxColor->getVtxColorIndexPointer(0);
u16* indexPointer2 = indexPointer + (u32)puVar1->mpData;
u16* indexPointer2 = indexPointer + (uintptr_t)puVar1->mpData;
for (u16 k = 0; k < puVar1->mNum; k++) {
if (indexPointer2[k] == field_0x168[i]) {
mAnmVtxColor->getColor(0, j, local_38[i]);