port: don't use s32s for texture pointers

This commit is contained in:
fgsfds 2023-08-13 01:12:56 +02:00
parent 0f0e674f71
commit c007bee536
4 changed files with 14 additions and 8 deletions

View File

@ -1336,7 +1336,7 @@ Gfx *explosionRender(struct prop *prop, Gfx *gdl, bool xlupass)
} else {
static u32 var8007e93c = 0xffffffff;
mainOverrideVariable("ecol", &var8007e93c);
colours[0].word = PD_BE32(0xffffffff);
colours[0].word = 0xffffffff;
colours[0].word = var8007e93c;
}

View File

@ -2079,7 +2079,7 @@ void texLoadFromDisplayList(Gfx *gdl, struct texpool *pool, s32 arg2)
while (bytes[GFX_W0_BYTE(0)] != (u8)G_ENDDL) {
// Look for GBI sequence: fd...... abcd....
if (bytes[GFX_W0_BYTE(0)] == G_SETTIMG && bytes[GFX_W1_BYTE(0)] == 0xab && bytes[GFX_W1_BYTE(1)] == 0xcd) {
texLoad((s32 *)((uintptr_t)bytes + 4), pool, arg2);
texLoad((texnum_t *)((uintptr_t)bytes + 4), pool, arg2);
}
bytes += 8;
@ -2123,7 +2123,7 @@ extern u8 EXT_SEG _texturesdataSegmentRomStart;
* z = texture is compressed with zlib
* l = number of levels of detail within the texture
*/
void texLoad(s32 *updateword, struct texpool *pool, bool arg2)
void texLoad(texnum_t *updateword, struct texpool *pool, bool arg2)
{
u8 compbuffer[4 * 1024 + 0x40];
u8 *compptr;
@ -2305,7 +2305,7 @@ void texLoadFromConfigs(struct textureconfig *configs, s32 numconfigs, struct te
void texLoadFromTextureNum(u32 texturenum, struct texpool *pool)
{
s32 texturenumcopy = texturenum;
texnum_t texturenumcopy = texturenum;
texLoad(&texturenumcopy, pool, true);
}

View File

@ -32,7 +32,7 @@ struct tex *texFindInPool(s32 texturenum, struct texpool *pool);
s32 texGetPoolFreeBytes(struct texpool *pool);
u8 *texGetPoolLeftPos(struct texpool *pool);
void texLoadFromDisplayList(Gfx *gdl, struct texpool *pool, s32 arg2);
void texLoad(s32 *updateword, struct texpool *pool, bool arg2);
void texLoad(texnum_t *updateword, struct texpool *pool, bool arg2);
void texLoadFromConfigs(struct textureconfig *configs, s32 numconfigs, struct texpool *pool, s32 arg3);
void texLoadFromTextureNum(u32 arg0, struct texpool *pool);

View File

@ -30,6 +30,12 @@ typedef s32 MenuDialogHandlerResult;
typedef intptr_t MenuItemHandlerResult;
typedef s16 RoomNum;
#ifdef PLATFORM_N64
#define texnum_t s32
#else
#define texnum_t uintptr_t
#endif
// Float version of a graphics matrix, which has higher precision than an Mtx.
// Matrices are stored as Mtxfs then converted to an Mtx when passed to the GPU.
// Mtxs use a union and a long long int to force alignments. Mtxfs are not
@ -3829,7 +3835,7 @@ struct menudata_training {
struct textureconfig {
union {
s32 texturenum;
texnum_t texturenum;
u8 *textureptr;
};
u8 width;
@ -5767,8 +5773,8 @@ struct var8009dd78 {
};
struct texturepair {
s32 texturenum1;
s32 texturenum2;
texnum_t texturenum1;
texnum_t texturenum2;
};
struct collision {