mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
Redesign hooks mechanism (#352)
* Redesign hooks mechanism * Use reference instead of copy
This commit is contained in:
parent
b359d642f4
commit
e56af6a7a3
10 changed files with 62 additions and 228 deletions
|
@ -108,9 +108,7 @@ void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedCon
|
|||
AudioLoad_SetDmaHandler(DmaMgr_DmaHandler);
|
||||
Audio_InitSound();
|
||||
osSendMesg(&audioMgr->unk_C8, NULL, OS_MESG_BLOCK);
|
||||
bind_hook(AUDIO_INIT);
|
||||
init_hook(0);
|
||||
call_hook(0);
|
||||
ModInternal_ExecuteAudioInitHooks();
|
||||
// Removed due to crash
|
||||
//IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->unk_74);
|
||||
hasInitialized = true;
|
||||
|
|
|
@ -2948,14 +2948,6 @@ void KaleidoScope_GrayOutTextureRGBA32(u32* texture, u16 pixelCount) {
|
|||
u16 gray;
|
||||
u16 i;
|
||||
|
||||
bind_hook( GRAYOUT_TEXTURE);
|
||||
init_hook(2,
|
||||
(struct HookParameter){ .name = "texture", .parameter = &texture },
|
||||
(struct HookParameter){ .name = "pixelCount", .parameter = &pixelCount }
|
||||
);
|
||||
if (!call_hook(0))
|
||||
return;
|
||||
|
||||
texture = ResourceMgr_LoadTexByName(texture);
|
||||
|
||||
for (i = 0; i < pixelCount; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue