Move clanker transform tagging patch to not conflict with romhacks (#21)

This commit is contained in:
Wiseguy
2025-12-23 21:03:53 -05:00
committed by GitHub
parent 17b88e7a97
commit 0e1970a6cb
+20 -6
View File
@@ -1,16 +1,30 @@
#include "patches.h"
#include "transform_ids.h"
extern void CC_func_80388760(Gfx **gfx, Mtx **mtx, Vtx **vtx);
int overlayManagergetLoadedId(void);
extern struct {
u8 unk0;
u8 unk1;
u8 pad2[2];
void (*init)(void);
void (*update)(void);
void (*release)(void);
void (*draw)(Gfx **, Mtx **, Vtx **);
void (*unk14)(s32, s32);
} sOverlay;
// @recomp: Patched to assign an ID to Clanker.
RECOMP_PATCH void __overlay_cc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
// @recomp Set the current transform ID to Clanker.
RECOMP_PATCH void func_80322E64(Gfx **gfx, Mtx **mtx, Vtx **vtx){
// @recomp If the current level is Clanker's Cavern, set up the model ID for Clanker.
u32 prev_transform_id = cur_drawn_model_transform_id;
cur_drawn_model_transform_id = CLANKER_TRANSFORM_ID_START;
if (overlayManagergetLoadedId() == OVERLAY_2_WHALE) {
cur_drawn_model_transform_id = CLANKER_TRANSFORM_ID_START;
}
CC_func_80388760(gfx, mtx, vtx);
if(sOverlay.draw)
sOverlay.draw(gfx, mtx, vtx);
// @recomp Reset the current transform ID.
cur_drawn_model_transform_id = prev_transform_id;
}
}