mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
portx64: fixed a bunch of instances of Wincompatible-pointer-types + filesetup.c: use ALIGN macro
This commit is contained in:
1 parent
a9e82658fd
commit
01cbcd99cb
4 files changed
+13
-14
No files matched your search
@@ -300,7 +300,7 @@ static void convertPrimaryLights(u8 *dst, u32 *dstpos, u8 *src, u32 *srcpos, u32
|
||||
#define BLOCK_LEAF 0
|
||||
#define BLOCK_PARENT 1
|
||||
|
||||
void relinkPtr(uintptr_t** ptr)
|
||||
void relinkPtr(uintptr_t* ptr)
|
||||
{
|
||||
if (!*ptr) return;
|
||||
|
||||
@@ -455,10 +455,10 @@ static u32 convertRoomGfxData(u8 *dst, u8 *src, u32 infsize, u32 src_ofs)
|
||||
for (size_t i = 0; i < numblocks; i++) {
|
||||
struct host_roomblock *block = (struct host_roomblock*)&ptr_dst_roomblocks[i];
|
||||
|
||||
relinkPtr(&block->ptr_next);
|
||||
relinkPtr((uintptr_t*)&block->ptr_next);
|
||||
|
||||
if (block->type == BLOCK_LEAF) {
|
||||
relinkPtr(&block->ptr_gdl);
|
||||
relinkPtr((uintptr_t*)&block->ptr_gdl);
|
||||
u32 offset_vtx = block->ptr_vertices - ptr_src_vertices - src_ofs;
|
||||
u32 offset_col = block->ptr_colours - ptr_src_colors - src_ofs;
|
||||
|
||||
@@ -466,16 +466,16 @@ static u32 convertRoomGfxData(u8 *dst, u8 *src, u32 infsize, u32 src_ofs)
|
||||
block->ptr_colours = ptr_dst_colors + offset_col;
|
||||
}
|
||||
else {
|
||||
relinkPtr(&block->ptr_gdl); // child
|
||||
relinkPtr(&block->ptr_vertices); // coord
|
||||
relinkPtr((uintptr_t*)&block->ptr_gdl); // child
|
||||
relinkPtr((uintptr_t*)&block->ptr_vertices); // coord
|
||||
}
|
||||
}
|
||||
|
||||
// relink ptrs: header
|
||||
relinkPtr(&dst_header->ptr_vertices);
|
||||
relinkPtr(&dst_header->ptr_colours);
|
||||
relinkPtr(&dst_header->ptr_opablocks);
|
||||
relinkPtr(&dst_header->ptr_xlublocks);
|
||||
relinkPtr((uintptr_t*)&dst_header->ptr_vertices);
|
||||
relinkPtr((uintptr_t*)&dst_header->ptr_colours);
|
||||
relinkPtr((uintptr_t*)&dst_header->ptr_opablocks);
|
||||
relinkPtr((uintptr_t*)&dst_header->ptr_xlublocks);
|
||||
|
||||
return curpos_dst;
|
||||
}
|
||||
|
||||
@@ -1138,8 +1138,7 @@ static u32 convertLists(u8 *dst, u8 *src, u32 dstpos, u32 src_ofs)
|
||||
u32 listsize = chraiGetAilistLength(list);
|
||||
memcpy(dst + dstpos, list, listsize);
|
||||
|
||||
// align to the next multiple of 4
|
||||
dstpos += ((listsize + 3) >> 2) << 2;
|
||||
dstpos += ALIGN(listsize, 4);
|
||||
}
|
||||
|
||||
return dstpos;
|
||||
@@ -1177,7 +1176,7 @@ static int convertSetup(u8 *dst, u8 *src, u32 srclen)
|
||||
dst_header->paths = (struct path*) dstpos;
|
||||
dstpos += convertPaths(&dst[dstpos], &src[srcpos]);
|
||||
|
||||
dstpos += convertPads(&dst[(uintptr_t)dst_header->paths], dst, src, dstpos);
|
||||
dstpos += convertPads((struct path*)&dst[(uintptr_t)dst_header->paths], dst, src, dstpos);
|
||||
|
||||
return dstpos;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4192,7 +4192,7 @@ void bgunTickMasterLoad(void)
|
||||
modelInit(&hand->handmodel, player->gunctrl.handmodeldef, hand->handsavedata, false);
|
||||
}
|
||||
|
||||
hand->unk0dcc = (s32 *) player->gunctrl.memloadptr;
|
||||
hand->unk0dcc = (uintptr_t *) player->gunctrl.memloadptr;
|
||||
|
||||
value = bgunCreateModelCmdList(&hand->gunmodel, player->gunctrl.gunmodeldef->rootnode, (uintptr_t *) player->gunctrl.memloadptr);
|
||||
|
||||
|
||||
+1
-1
@@ -2306,7 +2306,7 @@ struct hand {
|
||||
/*0x0dbc*/ u32 fspare7;
|
||||
/*0x0dc0*/ u32 fspare8;
|
||||
/*0x0dc4*/ struct abmag abmag;
|
||||
/*0x0dcc*/ s32 *unk0dcc;
|
||||
/*0x0dcc*/ uintptr_t *unk0dcc;
|
||||
/*0x0dd0*/ uintptr_t *unk0dd0;
|
||||
/*0x0dd4*/ s32 unk0dd4;
|
||||
/*0x0dd8*/ Mtxf *unk0dd8;
|
||||
|
||||
Reference in new issue
Block a user