From f114df8929e4bf4dbe74d106e8c101bb660bc442 Mon Sep 17 00:00:00 2001 From: Roman971 <32455037+Roman971@users.noreply.github.com> Date: Mon, 4 May 2020 21:02:51 +0200 Subject: [PATCH] More actor cleanup Part 2 (#116) * Change all main actor functions to take a 'Actor* thisx' argument * Change all actor callbacks to also take a 'Actor* thisx' argument --- src/code/z_en_a_keep.c | 118 +++++++++--------- src/code/z_en_item00.c | 29 +++-- src/code/z_player_call.c | 40 +++--- .../actors/ovl_Arms_Hook/z_arms_hook.c | 11 +- .../actors/ovl_Arrow_Fire/z_arrow_fire.c | 26 ++-- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 26 ++-- .../actors/ovl_Arrow_Light/z_arrow_light.c | 26 ++-- .../ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c | 38 +++--- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 34 +++-- .../actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c | 22 ++-- .../actors/ovl_Bg_Bombwall/z_bg_bombwall.c | 11 +- .../actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c | 11 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 9 +- .../actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c | 11 +- .../actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c | 26 ++-- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 11 +- .../ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c | 10 +- .../ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c | 11 +- .../ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c | 26 ++-- .../ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c | 39 +++--- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 9 +- .../ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c | 11 +- .../ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c | 11 +- .../ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c | 23 ++-- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 11 +- src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c | 11 +- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 11 +- .../actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c | 11 +- .../ovl_Bg_Haka_Megane/z_bg_haka_megane.c | 30 +++-- .../ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c | 11 +- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c | 9 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 11 +- .../actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c | 11 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 11 +- .../ovl_Bg_Haka_Water/z_bg_haka_water.c | 11 +- .../actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c | 8 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 10 +- .../ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 10 +- .../ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c | 10 +- .../z_bg_hidan_firewall.c | 42 +++---- .../ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c | 31 +++-- .../ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c | 10 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 10 +- .../ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c | 10 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 10 +- .../z_bg_hidan_kowarerukabe.c | 10 +- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 10 +- .../z_bg_hidan_rsekizou.c | 10 +- .../ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c | 10 +- .../ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c | 10 +- .../ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c | 28 +++-- .../ovl_Bg_Ice_Objects/z_bg_ice_objects.c | 10 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 10 +- .../ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c | 10 +- .../ovl_Bg_Ice_Turara/z_bg_ice_turara.c | 10 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 11 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 10 +- .../z_bg_jya_amishutter.c | 24 ++-- .../ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c | 10 +- .../actors/ovl_Bg_Jya_Block/z_bg_jya_block.c | 10 +- .../z_bg_jya_bombchuiwa.c | 10 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 10 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 10 +- .../ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c | 10 +- .../ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c | 10 +- .../ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c | 10 +- .../ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 24 ++-- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 10 +- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 10 +- .../z_bg_jya_zurerukabe.c | 10 +- .../ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c | 10 +- .../z_bg_menkuri_kaiten.c | 31 +++-- .../z_bg_menkuri_nisekabe.c | 23 ++-- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 10 +- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c | 10 +- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c | 10 +- .../actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c | 29 +++-- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 10 +- src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c | 35 +++--- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 8 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 8 +- .../ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c | 8 +- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c | 8 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 8 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c | 8 +- .../z_bg_mori_kaitenkabe.c | 8 +- .../z_bg_mori_rakkatenjo.c | 8 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.c | 10 +- .../ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c | 10 +- .../actors/ovl_Bg_Pushbox/z_bg_pushbox.c | 28 +++-- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 10 +- .../ovl_Bg_Spot00_Break/z_bg_spot00_break.c | 25 ++-- .../z_bg_spot00_hanebasi.c | 10 +- .../ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c | 23 ++-- .../z_bg_spot01_idohashira.c | 10 +- .../z_bg_spot01_idomizu.c | 11 +- .../z_bg_spot01_idosoko.c | 28 +++-- .../z_bg_spot01_objects2.c | 9 +- .../z_bg_spot02_objects.c | 10 +- .../ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c | 10 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c | 27 ++-- .../z_bg_spot06_objects.c | 10 +- .../ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c | 10 +- .../z_bg_spot08_bakudankabe.c | 10 +- .../z_bg_spot08_iceblock.c | 10 +- .../ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c | 26 ++-- .../z_bg_spot11_bakudankabe.c | 10 +- .../ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c | 6 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 24 ++-- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 24 ++-- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 10 +- .../ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c | 24 ++-- .../z_bg_spot16_bombstone.c | 10 +- .../z_bg_spot16_doughnut.c | 10 +- .../z_bg_spot17_bakudankabe.c | 10 +- .../ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c | 38 +++--- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 10 +- .../ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c | 24 ++-- .../ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c | 10 +- .../z_bg_spot18_shutter.c | 10 +- .../actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c | 10 +- .../ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c | 10 +- .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 42 ++++--- .../actors/ovl_Bg_Treemouth/z_bg_treemouth.c | 10 +- .../actors/ovl_Bg_Umajump/z_bg_umajump.c | 23 ++-- .../actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c | 10 +- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 10 +- .../ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c | 10 +- .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c | 10 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 28 +++-- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 10 +- src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 10 +- src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c | 10 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 10 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 10 +- .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 10 +- .../actors/ovl_Boss_Goma/z_boss_goma.c | 10 +- src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 10 +- src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 10 +- src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 10 +- src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 10 +- src/overlays/actors/ovl_Demo_6K/z_demo_6k.c | 8 +- src/overlays/actors/ovl_Demo_Du/z_demo_du.c | 10 +- src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c | 10 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 8 +- src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c | 10 +- .../actors/ovl_Demo_Geff/z_demo_geff.c | 26 ++-- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 10 +- src/overlays/actors/ovl_Demo_Go/z_demo_go.c | 27 ++-- src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c | 10 +- src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c | 10 +- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 10 +- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 10 +- .../actors/ovl_Demo_Kekkai/z_demo_kekkai.c | 10 +- src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c | 10 +- src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c | 11 +- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c | 10 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 31 +++-- .../actors/ovl_Door_Gerudo/z_door_gerudo.c | 10 +- .../actors/ovl_Door_Killer/z_door_killer.c | 8 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 10 +- .../actors/ovl_Door_Toki/z_door_toki.c | 21 ++-- .../actors/ovl_Door_Warp1/z_door_warp1.c | 10 +- .../actors/ovl_Efc_Erupc/z_efc_erupc.c | 10 +- src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c | 10 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 10 +- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 10 +- src/overlays/actors/ovl_En_Am/z_en_am.c | 10 +- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 66 +++++----- .../actors/ovl_En_Anubice/z_en_anubice.c | 10 +- .../ovl_En_Anubice_Fire/z_en_anubice_fire.c | 10 +- .../ovl_En_Anubice_Tag/z_en_anubice_tag.c | 27 ++-- .../actors/ovl_En_Arow_Trap/z_en_arow_trap.c | 18 ++- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 10 +- .../ovl_En_Attack_Niw/z_en_attack_niw.c | 10 +- src/overlays/actors/ovl_En_Ba/z_en_ba.c | 10 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 10 +- .../actors/ovl_En_Bdfire/z_en_bdfire.c | 10 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 10 +- src/overlays/actors/ovl_En_Bili/z_en_bili.c | 10 +- src/overlays/actors/ovl_En_Bird/z_en_bird.c | 25 ++-- .../actors/ovl_En_Blkobj/z_en_blkobj.c | 10 +- src/overlays/actors/ovl_En_Bom/z_en_bom.c | 10 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 10 +- .../ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c | 8 +- .../actors/ovl_En_Bom_Chu/z_en_bom_chu.c | 10 +- src/overlays/actors/ovl_En_Bombf/z_en_bombf.c | 10 +- src/overlays/actors/ovl_En_Boom/z_en_boom.c | 27 ++-- src/overlays/actors/ovl_En_Box/z_en_box.c | 10 +- src/overlays/actors/ovl_En_Brob/z_en_brob.c | 10 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 10 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 10 +- src/overlays/actors/ovl_En_Bw/z_en_bw.c | 10 +- src/overlays/actors/ovl_En_Bx/z_en_bx.c | 10 +- .../actors/ovl_En_Changer/z_en_changer.c | 8 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 10 +- src/overlays/actors/ovl_En_Cow/z_en_cow.c | 87 +++++++------ src/overlays/actors/ovl_En_Crow/z_en_crow.c | 10 +- src/overlays/actors/ovl_En_Cs/z_en_cs.c | 10 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 10 +- .../z_en_daiku_kakariko.c | 10 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 10 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 10 +- src/overlays/actors/ovl_En_Dh/z_en_dh.c | 10 +- src/overlays/actors/ovl_En_Dha/z_en_dha.c | 10 +- .../ovl_En_Diving_Game/z_en_diving_game.c | 10 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 10 +- .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 8 +- .../actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c | 10 +- .../actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c | 8 +- .../actors/ovl_En_Dodojr/z_en_dodojr.c | 10 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 10 +- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 48 +++---- src/overlays/actors/ovl_En_Door/z_en_door.c | 10 +- src/overlays/actors/ovl_En_Ds/z_en_ds.c | 39 +++--- src/overlays/actors/ovl_En_Du/z_en_du.c | 10 +- .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 10 +- src/overlays/actors/ovl_En_Eg/z_en_eg.c | 22 ++-- src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 10 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 10 +- .../actors/ovl_En_Encount1/z_en_encount1.c | 6 +- .../actors/ovl_En_Encount2/z_en_encount2.c | 8 +- .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 10 +- .../actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c | 10 +- src/overlays/actors/ovl_En_Fd/z_en_fd.c | 10 +- .../actors/ovl_En_Fd_Fire/z_en_fd_fire.c | 10 +- .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c | 10 +- .../actors/ovl_En_Fire_Rock/z_en_fire_rock.c | 10 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 10 +- src/overlays/actors/ovl_En_Fish/z_en_fish.c | 10 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 10 +- src/overlays/actors/ovl_En_Fr/z_en_fr.c | 8 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 10 +- src/overlays/actors/ovl_En_Fw/z_en_fw.c | 10 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 10 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 8 +- .../ovl_En_Ganon_Mant/z_en_ganon_mant.c | 10 +- .../ovl_En_Ganon_Organ/z_en_ganon_organ.c | 30 ++--- src/overlays/actors/ovl_En_Gb/z_en_gb.c | 10 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 10 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 10 +- src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 10 +- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 10 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 8 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 8 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 10 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 10 +- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 10 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 10 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 10 +- src/overlays/actors/ovl_En_Guest/z_en_guest.c | 8 +- src/overlays/actors/ovl_En_Hata/z_en_hata.c | 10 +- .../actors/ovl_En_Heishi1/z_en_heishi1.c | 10 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 10 +- .../actors/ovl_En_Heishi3/z_en_heishi3.c | 10 +- .../actors/ovl_En_Heishi4/z_en_heishi4.c | 10 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 10 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 10 +- .../actors/ovl_En_Honotrap/z_en_honotrap.c | 10 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 10 +- .../z_en_horse_game_check.c | 10 +- .../ovl_En_Horse_Ganon/z_en_horse_ganon.c | 44 ++++--- .../z_en_horse_link_child.c | 10 +- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 10 +- .../ovl_En_Horse_Zelda/z_en_horse_zelda.c | 10 +- src/overlays/actors/ovl_En_Hs/z_en_hs.c | 10 +- src/overlays/actors/ovl_En_Hs2/z_en_hs2.c | 10 +- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 10 +- .../actors/ovl_En_Ice_Hono/z_en_ice_hono.c | 10 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 10 +- src/overlays/actors/ovl_En_In/z_en_in.c | 10 +- .../actors/ovl_En_Insect/z_en_insect.c | 10 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 10 +- src/overlays/actors/ovl_En_It/z_en_it.c | 34 ++--- src/overlays/actors/ovl_En_Jj/z_en_jj.c | 10 +- src/overlays/actors/ovl_En_Js/z_en_js.c | 10 +- .../actors/ovl_En_Jsjutan/z_en_jsjutan.c | 10 +- .../actors/ovl_En_Kakasi/z_en_kakasi.c | 10 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 8 +- .../actors/ovl_En_Kakasi3/z_en_kakasi3.c | 10 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 10 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 10 +- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 10 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 8 +- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 10 +- src/overlays/actors/ovl_En_Light/z_en_light.c | 10 +- .../actors/ovl_En_Lightbox/z_en_lightbox.c | 24 ++-- .../actors/ovl_En_M_Fire1/z_en_m_fire1.c | 37 +++--- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 10 +- src/overlays/actors/ovl_En_Ma1/z_en_ma1.c | 65 +++++----- src/overlays/actors/ovl_En_Ma2/z_en_ma2.c | 72 ++++++----- src/overlays/actors/ovl_En_Ma3/z_en_ma3.c | 68 +++++----- src/overlays/actors/ovl_En_Mag/z_en_mag.c | 10 +- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 10 +- src/overlays/actors/ovl_En_Md/z_en_md.c | 10 +- src/overlays/actors/ovl_En_Mk/z_en_mk.c | 10 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 10 +- src/overlays/actors/ovl_En_Mm2/z_en_mm2.c | 10 +- src/overlays/actors/ovl_En_Ms/z_en_ms.c | 34 ++--- src/overlays/actors/ovl_En_Mu/z_en_mu.c | 10 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 10 +- src/overlays/actors/ovl_En_Niw/z_en_niw.c | 10 +- .../actors/ovl_En_Niw_Girl/z_en_niw_girl.c | 10 +- .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 8 +- .../actors/ovl_En_Nutsball/z_en_nutsball.c | 53 ++++---- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 10 +- src/overlays/actors/ovl_En_Ny/z_en_ny.c | 10 +- src/overlays/actors/ovl_En_OE2/z_en_oe2.c | 21 ++-- .../z_en_okarina_effect.c | 21 +++- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 8 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 10 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 8 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 10 +- src/overlays/actors/ovl_En_Part/z_en_part.c | 10 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 10 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 10 +- .../actors/ovl_En_Po_Field/z_en_po_field.c | 10 +- .../actors/ovl_En_Po_Relay/z_en_po_relay.c | 10 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 10 +- src/overlays/actors/ovl_En_Poh/z_en_poh.c | 8 +- .../actors/ovl_En_Pu_box/z_en_pu_box.c | 24 ++-- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 10 +- src/overlays/actors/ovl_En_Reeba/z_en_reeba.c | 10 +- .../ovl_En_River_Sound/z_en_river_sound.c | 10 +- src/overlays/actors/ovl_En_Rl/z_en_rl.c | 10 +- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 10 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 58 +++++---- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 40 +++--- src/overlays/actors/ovl_En_Sa/z_en_sa.c | 10 +- src/overlays/actors/ovl_En_Sb/z_en_sb.c | 10 +- .../ovl_En_Scene_Change/z_en_scene_change.c | 27 ++-- src/overlays/actors/ovl_En_Sda/z_en_sda.c | 10 +- .../actors/ovl_En_Shopnuts/z_en_shopnuts.c | 10 +- src/overlays/actors/ovl_En_Si/z_en_si.c | 10 +- .../actors/ovl_En_Siofuki/z_en_siofuki.c | 10 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 10 +- src/overlays/actors/ovl_En_Skj/z_en_skj.c | 10 +- .../actors/ovl_En_Skjneedle/z_en_skjneedle.c | 10 +- src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 10 +- src/overlays/actors/ovl_En_St/z_en_st.c | 10 +- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 8 +- .../actors/ovl_En_Stream/z_en_stream.c | 10 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 10 +- .../ovl_En_Syateki_Itm/z_en_syateki_itm.c | 8 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 10 +- .../ovl_En_Syateki_Niw/z_en_syateki_niw.c | 10 +- src/overlays/actors/ovl_En_Ta/z_en_ta.c | 10 +- .../ovl_En_Takara_Man/z_en_takara_man.c | 10 +- src/overlays/actors/ovl_En_Tana/z_en_tana.c | 36 +++--- src/overlays/actors/ovl_En_Test/z_en_test.c | 10 +- src/overlays/actors/ovl_En_Tg/z_en_tg.c | 10 +- src/overlays/actors/ovl_En_Tite/z_en_tite.c | 10 +- src/overlays/actors/ovl_En_Tk/z_en_tk.c | 114 +++++++++-------- src/overlays/actors/ovl_En_Torch/z_en_torch.c | 7 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 10 +- src/overlays/actors/ovl_En_Toryo/z_en_toryo.c | 10 +- src/overlays/actors/ovl_En_Tp/z_en_tp.c | 10 +- src/overlays/actors/ovl_En_Tr/z_en_tr.c | 10 +- src/overlays/actors/ovl_En_Trap/z_en_trap.c | 10 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 50 ++++---- src/overlays/actors/ovl_En_Vali/z_en_vali.c | 10 +- src/overlays/actors/ovl_En_Vase/z_en_vase.c | 16 ++- .../actors/ovl_En_Vb_Ball/z_en_vb_ball.c | 10 +- .../actors/ovl_En_Viewer/z_en_viewer.c | 10 +- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 10 +- .../actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c | 8 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 104 ++++++++------- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 8 +- .../actors/ovl_En_Weiyer/z_en_weiyer.c | 10 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 10 +- .../ovl_En_Wonder_Item/z_en_wonder_item.c | 8 +- .../ovl_En_Wonder_Talk/z_en_wonder_talk.c | 8 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 8 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 10 +- src/overlays/actors/ovl_En_Xc/z_en_xc.c | 10 +- .../ovl_En_Yabusame_Mark/z_en_yabusame_mark.c | 8 +- .../actors/ovl_En_Yukabyun/z_en_yukabyun.c | 10 +- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 10 +- src/overlays/actors/ovl_En_Zl1/z_en_zl1.c | 10 +- src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 10 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 10 +- src/overlays/actors/ovl_En_Zl4/z_en_zl4.c | 10 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 10 +- src/overlays/actors/ovl_En_fHG/z_en_fhg.c | 10 +- .../actors/ovl_End_Title/z_end_title.c | 10 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 10 +- .../actors/ovl_Item_B_Heart/z_item_b_heart.c | 10 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 8 +- .../actors/ovl_Item_Inbox/z_item_inbox.c | 25 ++-- .../actors/ovl_Item_Ocarina/z_item_ocarina.c | 10 +- .../actors/ovl_Item_Shield/z_item_shield.c | 10 +- .../actors/ovl_Magic_Dark/z_magic_dark.c | 10 +- .../actors/ovl_Magic_Fire/z_magic_fire.c | 10 +- .../actors/ovl_Magic_Wind/z_magic_wind.c | 10 +- src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 10 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 10 +- .../ovl_Obj_Blockstop/z_obj_blockstop.c | 20 +-- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 63 +++++----- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 26 ++-- .../actors/ovl_Obj_Dekujr/z_obj_dekujr.c | 10 +- .../actors/ovl_Obj_Elevator/z_obj_elevator.c | 26 ++-- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 10 +- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c | 10 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 10 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 10 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 10 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 10 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 10 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 10 +- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 15 ++- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 6 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 8 +- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 6 +- .../actors/ovl_Obj_Mure3/z_obj_mure3.c | 8 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 10 +- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 20 ++- .../actors/ovl_Obj_Switch/z_obj_switch.c | 10 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 10 +- .../ovl_Obj_Timeblock/z_obj_timeblock.c | 10 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 8 +- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 12 +- .../ovl_Object_Kankyo/z_object_kankyo.c | 10 +- .../actors/ovl_Oceff_Spot/z_oceff_spot.c | 10 +- .../actors/ovl_Oceff_Storm/z_oceff_storm.c | 10 +- .../actors/ovl_Oceff_Wipe/z_oceff_wipe.c | 10 +- .../actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c | 10 +- .../actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c | 10 +- .../actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c | 10 +- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 8 +- 429 files changed, 3689 insertions(+), 2523 deletions(-) diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index ba371daa20..9dc0e35bf1 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -31,6 +31,13 @@ typedef struct { #define FLAGS 0x00000010 +#define THIS ((EnAObj*)thisx) + +void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx); +void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx); +void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8001D204(EnAObj* this, GlobalContext* globalCtx); void func_8001D25C(EnAObj* this, GlobalContext* globalCtx); void func_8001D360(EnAObj* this, GlobalContext* globalCtx); @@ -42,11 +49,6 @@ void func_8001D310(EnAObj* this, s16 params); void func_8001D480(EnAObj* this, s16 params); void func_8001D5C8(EnAObj* this, s16 params); -void EnAObj_Init(EnAObj* this, GlobalContext* globalCtx); -void EnAObj_Destroy(EnAObj* this, GlobalContext* globalCtx); -void EnAObj_Update(EnAObj* this, GlobalContext* globalCtx); -void EnAObj_Draw(EnAObj* this, GlobalContext* globalCtx); - const ActorInit En_A_Obj_InitVars = { ACTOR_EN_A_OBJ, ACTORTYPE_PROP, @@ -68,119 +70,118 @@ void EnAObj_SetupAction(EnAObj* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void EnAObj_Init(EnAObj* this, GlobalContext* globalCtx) { - u32 sp34; +void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { + u32 sp34 = 0; s32 pad; - EnAObj* this2 = this; + EnAObj* this = THIS; f32 sp28; - sp34 = 0; sp28 = 6.0f; - this->textId = (this->dyna.actor.params >> 8) & 0xFF; - this->dyna.actor.params &= 0xFF; + this->textId = (thisx->params >> 8) & 0xFF; + thisx->params &= 0xFF; - switch (this->dyna.actor.params) { + switch (thisx->params) { case A_OBJ_BLOCK_SMALL: - Actor_SetScale(&this->dyna.actor, 0.025f); + Actor_SetScale(thisx, 0.025f); break; case A_OBJ_BLOCK_LARGE: - Actor_SetScale(&this->dyna.actor, 0.05f); + Actor_SetScale(thisx, 0.05f); break; case A_OBJ_BLOCK_HUGE: case A_OBJ_CUBE_SMALL: case A_OBJ_UNKNOWN_6: - Actor_SetScale(&this->dyna.actor, 0.1f); + Actor_SetScale(thisx, 0.1f); break; case A_OBJ_BLOCK_SMALL_ROT: - Actor_SetScale(&this->dyna.actor, 0.005f); + Actor_SetScale(thisx, 0.005f); break; case A_OBJ_BLOCK_LARGE_ROT: default: - Actor_SetScale(&this->dyna.actor, 0.01f); + Actor_SetScale(thisx, 0.01f); break; } - if (this->dyna.actor.params >= 9) { + if (thisx->params >= 9) { sp28 = 12.0f; } - ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28); - this->dyna.actor.posRot2.pos = this->dyna.actor.posRot.pos; + thisx->posRot2.pos = thisx->posRot.pos; this->dyna.dynaPolyId = -1; this->dyna.unk_160 = 0; this->dyna.unk_15C = 0; - this->dyna.actor.unk_FC = 1200.0f; - this->dyna.actor.unk_F8 = 200.0f; + thisx->unk_FC = 1200.0f; + thisx->unk_F8 = 200.0f; - switch (this->dyna.actor.params) { + switch (thisx->params) { case A_OBJ_BLOCK_LARGE: case A_OBJ_BLOCK_HUGE: - this2->dyna.dynaPolyId = 1; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->dyna.actor, ACTORTYPE_BG); - func_8001D5C8(this2, this->dyna.actor.params); + this->dyna.dynaPolyId = 1; + Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG); + func_8001D5C8(this, thisx->params); break; case A_OBJ_BLOCK_SMALL_ROT: case A_OBJ_BLOCK_LARGE_ROT: - this2->dyna.dynaPolyId = 3; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->dyna.actor, ACTORTYPE_BG); - func_8001D310(this2, this->dyna.actor.params); + this->dyna.dynaPolyId = 3; + Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG); + func_8001D310(this, thisx->params); break; case A_OBJ_UNKNOWN_6: // clang-format off - this->dyna.actor.flags |= 0x1; this2->dyna.dynaPolyId = 5; this2->unk_178 = 10.0f; + thisx->flags |= 0x1; this->dyna.dynaPolyId = 5; this->unk_178 = 10.0f; // clang-format on - this->dyna.actor.gravity = -2.0f; - func_8001D234(this2, this->dyna.actor.params); + thisx->gravity = -2.0f; + func_8001D234(this, thisx->params); break; case A_OBJ_GRASS_CLUMP: case A_OBJ_TREE_STUMP: - this2->dyna.dynaPolyId = 0; - func_8001D234(this2, this->dyna.actor.params); + this->dyna.dynaPolyId = 0; + func_8001D234(this, thisx->params); break; case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: - this->dyna.actor.textId = (this2->textId & 0xFF) | 0x300; + thisx->textId = (this->textId & 0xFF) | 0x300; // clang-format off - this->dyna.actor.flags |= 0x1 | 0x8; this->dyna.actor.unk_4C = 500.0f; + thisx->flags |= 0x1 | 0x8; thisx->unk_4C = 500.0f; // clang-format on - this2->unk_178 = 45.0f; - func_8001D234(this2, this->dyna.actor.params); - Collider_InitCylinder(globalCtx, &this2->collider); - Collider_SetCylinder(globalCtx, &this2->collider, &this->dyna.actor, &D_80115440); - this->dyna.actor.colChkInfo.mass = 0xFF; - this->dyna.actor.unk_1F = 0; + this->unk_178 = 45.0f; + func_8001D234(this, thisx->params); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &D_80115440); + thisx->colChkInfo.mass = 0xFF; + thisx->unk_1F = 0; break; case A_OBJ_KNOB: - this->dyna.actor.gravity = -1.5f; - func_8001D480(this2, this->dyna.actor.params); + thisx->gravity = -1.5f; + func_8001D480(this, thisx->params); break; default: - this->dyna.actor.gravity = -2.0f; - func_8001D234(this2, this->dyna.actor.params); + thisx->gravity = -2.0f; + func_8001D234(this, thisx->params); break; } - if (this->dyna.actor.params < 5) { - this->dyna.actor.colChkInfo.mass = 0xFF; + if (thisx->params < 5) { + thisx->colChkInfo.mass = 0xFF; } if (this->dyna.dynaPolyId != -1) { DynaPolyInfo_Alloc(D_8011546C[this->dyna.dynaPolyId], &sp34); - this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp34); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, sp34); } } -void EnAObj_Destroy(EnAObj* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; +void EnAObj_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnAObj* this = THIS; DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); switch (this->dyna.actor.params) { case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: - Collider_DestroyCylinder(globalCtx, collider); + Collider_DestroyCylinder(globalCtx, &this->collider); } } @@ -308,8 +309,8 @@ void func_8001D608(EnAObj* this, GlobalContext* globalCtx) { this->dyna.unk_150 = 0.0f; } -void EnAObj_Update(EnAObj* this, GlobalContext* globalCtx) { - Collider* collider; +void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) { + EnAObj* this = THIS; this->actionFunc(this, globalCtx); Actor_MoveForward(&this->dyna.actor); @@ -328,14 +329,13 @@ void EnAObj_Update(EnAObj* this, GlobalContext* globalCtx) { switch (this->dyna.actor.params) { case A_OBJ_SIGNPOST_OBLONG: case A_OBJ_SIGNPOST_ARROW: - collider = (Collider*)&this->collider; Collider_CylinderUpdate(&this->dyna.actor, &this->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } } -void EnAObj_Draw(EnAObj* this, GlobalContext* globalCtx) { - s32 type = this->dyna.actor.params; +void EnAObj_Draw(Actor* thisx, GlobalContext* globalCtx) { + s32 type = thisx->params; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; @@ -347,7 +347,7 @@ void EnAObj_Draw(EnAObj* this, GlobalContext* globalCtx) { type = A_OBJ_KNOB; } - if (this->dyna.actor.params == A_OBJ_KNOB) { + if (thisx->params == A_OBJ_KNOB) { gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 1, 0x3C, 0x3C, 0x3C, 0x32); } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index bd135bbbb9..931ef11b0c 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -45,10 +45,12 @@ typedef struct { #define FLAGS 0x00000000 -void EnItem00_Init(EnItem00* this, GlobalContext* globalCtx); -void EnItem00_Destroy(EnItem00* this, GlobalContext* globalCtx); -void EnItem00_Update(EnItem00* this, GlobalContext* globalCtx); -void EnItem00_Draw(EnItem00* this, GlobalContext* globalCtx); +#define THIS ((EnItem00*)thisx) + +void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx); +void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx); +void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx); void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx); void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx); @@ -85,8 +87,8 @@ void EnItem00_SetupAction(EnItem00* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void EnItem00_Init(EnItem00* this, GlobalContext* globalCtx) { - s32 pad1; +void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { + EnItem00* this = THIS; s32 pad2; f32 sp34; f32 sp30; @@ -312,9 +314,10 @@ void EnItem00_Init(EnItem00* this, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -void EnItem00_Destroy(EnItem00* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnItem00* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { @@ -480,8 +483,8 @@ extern s32 D_80157D90; extern u32 D_80157D90_; // these must be defined separately for EnItem00_Update to match extern s16 D_80157D94; -void EnItem00_Update(EnItem00* this, GlobalContext* globalCtx) { - s32 pad; +void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { + EnItem00* this = THIS; s16* params; s32 getItemId; s16 sp3A; @@ -700,8 +703,8 @@ void func_8001F080(EnItem00* this, GlobalContext* globalCtx); void func_8001F1F4(EnItem00* this, GlobalContext* globalCtx); void func_8001F334(EnItem00* this, GlobalContext* globalCtx); -void EnItem00_Draw(EnItem00* this, GlobalContext* globalCtx) { - s32 pad; +void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnItem00* this = THIS; f32 unkFloat; if (!(this->unk_156 & this->unk_158)) { diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index 6b82381957..f352be4245 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -1,19 +1,19 @@ #include -void (*sPlayerCallInitFunc)(void*, GlobalContext*); -void (*sPlayerCallDestroyFunc)(void*, GlobalContext*); -void (*sPlayerCallUpdateFunc)(void*, GlobalContext*); -void (*sPlayerCallDrawFunc)(void*, GlobalContext*); +void (*sPlayerCallInitFunc)(Actor* thisx, GlobalContext* globalCtx); +void (*sPlayerCallDestroyFunc)(Actor* thisx, GlobalContext* globalCtx); +void (*sPlayerCallUpdateFunc)(Actor* thisx, GlobalContext* globalCtx); +void (*sPlayerCallDrawFunc)(Actor* thisx, GlobalContext* globalCtx); -void func_80846CD8(Player*, GlobalContext*); -void func_8084AB54(Player*, GlobalContext*); -void func_80849EA8(Player*, GlobalContext*); -void func_8084A5C4(Player*, GlobalContext*); +void func_80846CD8(Actor* thisx, GlobalContext* globalCtx); +void func_8084AB54(Actor* thisx, GlobalContext* globalCtx); +void func_80849EA8(Actor* thisx, GlobalContext* globalCtx); +void func_8084A5C4(Actor* thisx, GlobalContext* globalCtx); -void PlayerCall_Init(Player* player, GlobalContext* globalCtx); -void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx); -void PlayerCall_Update(Player* player, GlobalContext* globalCtx); -void PlayerCall_Draw(Player* player, GlobalContext* globalCtx); +void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx); +void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx); +void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx); +void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Player_InitVars = { ACTOR_PLAYER, @@ -34,23 +34,23 @@ void PlayerCall_InitFuncPtrs() { sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(func_8084A5C4); } -void PlayerCall_Init(Player* player, GlobalContext* globalCtx) { +void PlayerCall_Init(Actor* thisx, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); PlayerCall_InitFuncPtrs(); - sPlayerCallInitFunc(player, globalCtx); + sPlayerCallInitFunc(thisx, globalCtx); } -void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx) { +void PlayerCall_Destroy(Actor* thisx, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); - sPlayerCallDestroyFunc(player, globalCtx); + sPlayerCallDestroyFunc(thisx, globalCtx); } -void PlayerCall_Update(Player* player, GlobalContext* globalCtx) { +void PlayerCall_Update(Actor* thisx, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); - sPlayerCallUpdateFunc(player, globalCtx); + sPlayerCallUpdateFunc(thisx, globalCtx); } -void PlayerCall_Draw(Player* player, GlobalContext* globalCtx) { +void PlayerCall_Draw(Actor* thisx, GlobalContext* globalCtx) { KaleidoScopeCall_LoadPlayer(); - sPlayerCallDrawFunc(player, globalCtx); + sPlayerCallDrawFunc(thisx, globalCtx); } diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 87507f5d1e..6c5b4a5bdd 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -2,10 +2,13 @@ #define FLAGS 0x00000030 -void ArmsHook_Init(ArmsHook* this, GlobalContext* globalCtx); -void ArmsHook_Destroy(ArmsHook* this, GlobalContext* globalCtx); -void ArmsHook_Update(ArmsHook* this, GlobalContext* globalCtx); -void ArmsHook_Draw(ArmsHook* this, GlobalContext* globalCtx); +#define THIS ((ArmsHook*)thisx) + +void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx); +void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ArmsHook_Update(Actor* thisx, GlobalContext* globalCtx); +void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx); + void ArmsHook_SetupAction(ArmsHook* this, ActorFunc actionFunc); void func_80864FC4(ArmsHook* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 74a4c5e8ff..4f57b8ca4a 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -10,10 +10,12 @@ #define FLAGS 0x02000010 -void ArrowFire_Init(ArrowFire* this, GlobalContext* globalCtx); -void ArrowFire_Destroy(ArrowFire* this, GlobalContext* globalCtx); -void ArrowFire_Update(ArrowFire* this, GlobalContext* globalCtx); -void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx); +#define THIS ((ArrowFire*)thisx) + +void ArrowFire_Init(Actor* thisx, GlobalContext* globalCtx); +void ArrowFire_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ArrowFire_Update(Actor* thisx, GlobalContext* globalCtx); +void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx); void ArrowFire_Charge(ArrowFire* this, GlobalContext* globalCtx); void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx); @@ -41,7 +43,9 @@ void ArrowFire_SetupAction(ArrowFire* this, ActorFunc* actionFunc) { this->actionFunc = actionFunc; } -void ArrowFire_Init(ArrowFire* this, GlobalContext* globalCtx) { +void ArrowFire_Init(Actor* thisx, GlobalContext* globalCtx) { + ArrowFire* this = THIS; + Actor_ProcessInitChain(&this->actor, initChain); this->radius = 0; this->unk_158 = 1.0f; @@ -52,7 +56,7 @@ void ArrowFire_Init(ArrowFire* this, GlobalContext* globalCtx) { this->unk_15C = 0.0f; } -void ArrowFire_Destroy(ArrowFire* this, GlobalContext* globalCtx) { +void ArrowFire_Destroy(Actor* thisx, GlobalContext* globalCtx) { func_800876C8(globalCtx); // Translates to: "Disappearance" LOG_STRING("消滅", "../z_arrow_fire.c", 421); @@ -177,7 +181,9 @@ void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx) { } } -void ArrowFire_Update(ArrowFire* this, GlobalContext* globalCtx) { +void ArrowFire_Update(Actor* thisx, GlobalContext* globalCtx) { + ArrowFire* this = THIS; + if (globalCtx->msgCtx.msgMode == 0xD || globalCtx->msgCtx.msgMode == 0x11) { Actor_Kill(&this->actor); } else { @@ -185,9 +191,9 @@ void ArrowFire_Update(ArrowFire* this, GlobalContext* globalCtx) { } } -void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx) { - s32 pad1; - s32 pad2; +void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) { + ArrowFire* this = THIS; + s32 pad; u32 stateFrames; GraphicsContext* gfxCtx; Actor* tranform; diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index fdd0fd71d3..49d1c65190 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -10,10 +10,12 @@ #define FLAGS 0x02000010 -void ArrowIce_Init(ArrowIce* this, GlobalContext* globalCtx); -void ArrowIce_Destroy(ArrowIce* this, GlobalContext* globalCtx); -void ArrowIce_Update(ArrowIce* this, GlobalContext* globalCtx); -void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx); +#define THIS ((ArrowIce*)thisx) + +void ArrowIce_Init(Actor* thisx, GlobalContext* globalCtx); +void ArrowIce_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ArrowIce_Update(Actor* thisx, GlobalContext* globalCtx); +void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx); void ArrowIce_Charge(ArrowIce* this, GlobalContext* globalCtx); void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx); @@ -41,7 +43,9 @@ void ArrowIce_SetupAction(ArrowIce* this, ActorFunc* actionFunc) { this->actionFunc = actionFunc; } -void ArrowIce_Init(ArrowIce* this, GlobalContext* globalCtx) { +void ArrowIce_Init(Actor* thisx, GlobalContext* globalCtx) { + ArrowIce* this = THIS; + Actor_ProcessInitChain(&this->actor, initChain); this->radius = 0; this->unk_160 = 1.0f; @@ -52,7 +56,7 @@ void ArrowIce_Init(ArrowIce* this, GlobalContext* globalCtx) { this->unk_164 = 0.0f; } -void ArrowIce_Destroy(ArrowIce* this, GlobalContext* globalCtx) { +void ArrowIce_Destroy(Actor* thisx, GlobalContext* globalCtx) { func_800876C8(globalCtx); // Translates to: "Disappearance" LOG_STRING("消滅", "../z_arrow_ice.c", 415); @@ -177,7 +181,9 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) { } } -void ArrowIce_Update(ArrowIce* this, GlobalContext* globalCtx) { +void ArrowIce_Update(Actor* thisx, GlobalContext* globalCtx) { + ArrowIce* this = THIS; + if (globalCtx->msgCtx.msgMode == 0xD || globalCtx->msgCtx.msgMode == 0x11) { Actor_Kill(&this->actor); } else { @@ -185,9 +191,9 @@ void ArrowIce_Update(ArrowIce* this, GlobalContext* globalCtx) { } } -void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx) { - s32 pad1; - s32 pad2; +void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) { + ArrowIce* this = THIS; + s32 pad; Actor* tranform; u32 stateFrames; GraphicsContext* gfxCtx; diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 2ed10662a7..f0e4747a46 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -10,10 +10,12 @@ #define FLAGS 0x02000010 -void ArrowLight_Init(ArrowLight* this, GlobalContext* globalCtx); -void ArrowLight_Destroy(ArrowLight* this, GlobalContext* globalCtx); -void ArrowLight_Update(ArrowLight* this, GlobalContext* globalCtx); -void ArrowLight_Draw(ArrowLight* this, GlobalContext* globalCtx); +#define THIS ((ArrowLight*)thisx) + +void ArrowLight_Init(Actor* thisx, GlobalContext* globalCtx); +void ArrowLight_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ArrowLight_Update(Actor* thisx, GlobalContext* globalCtx); +void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx); void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx); void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx); @@ -41,7 +43,9 @@ void ArrowLight_SetupAction(ArrowLight* this, ActorFunc* actionFunc) { this->actionFunc = actionFunc; } -void ArrowLight_Init(ArrowLight* this, GlobalContext* globalCtx) { +void ArrowLight_Init(Actor* thisx, GlobalContext* globalCtx) { + ArrowLight* this = THIS; + Actor_ProcessInitChain(&this->actor, initChain); this->radius = 0; this->unk_160 = 1.0f; @@ -52,7 +56,7 @@ void ArrowLight_Init(ArrowLight* this, GlobalContext* globalCtx) { this->unk_164 = 0.0f; } -void ArrowLight_Destroy(ArrowLight* this, GlobalContext* globalCtx) { +void ArrowLight_Destroy(Actor* thisx, GlobalContext* globalCtx) { func_800876C8(globalCtx); // Translates to: "Disappearance" LOG_STRING("消滅", "../z_arrow_light.c", 403); @@ -177,7 +181,9 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) { } } -void ArrowLight_Update(ArrowLight* this, GlobalContext* globalCtx) { +void ArrowLight_Update(Actor* thisx, GlobalContext* globalCtx) { + ArrowLight* this = THIS; + if (globalCtx->msgCtx.msgMode == 0xD || globalCtx->msgCtx.msgMode == 0x11) { Actor_Kill(&this->actor); } else { @@ -185,9 +191,9 @@ void ArrowLight_Update(ArrowLight* this, GlobalContext* globalCtx) { } } -void ArrowLight_Draw(ArrowLight* this, GlobalContext* globalCtx) { - s32 pad1; - s32 pad2; +void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) { + ArrowLight* this = THIS; + s32 pad; u32 stateFrames; GraphicsContext* gfxCtx; Actor* tranform; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 13045fbc43..91de07b591 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgBdanObjects_Init(BgBdanObjects* this, GlobalContext* globalCtx); -void BgBdanObjects_Destroy(BgBdanObjects* this, GlobalContext* globalCtx); -void BgBdanObjects_Update(BgBdanObjects* this, GlobalContext* globalCtx); -void BgBdanObjects_Draw(BgBdanObjects* this, GlobalContext* globalCtx); +#define THIS ((BgBdanObjects*)thisx) + +void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx); +void BgBdanObjects_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgBdanObjects_Update(Actor* thisx, GlobalContext* globalCtx); +void BgBdanObjects_Draw(Actor* thisx, GlobalContext* globalCtx); void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx); void func_8086C1A0(BgBdanObjects* this, GlobalContext* globalCtx); @@ -94,9 +96,9 @@ void BgBdanObjects_SetContactRu1(BgBdanObjects* this, s32 arg1) { } } -void BgBdanObjects_Init(BgBdanObjects* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; - s16 pad; +void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { + BgBdanObjects* this = THIS; + s32 pad; s32 localC = 0; Actor_ProcessInitChain(this, initChain); @@ -152,8 +154,8 @@ void BgBdanObjects_Init(BgBdanObjects* this, GlobalContext* globalCtx) { this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, this, localC); } -void BgBdanObjects_Destroy(BgBdanObjects* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgBdanObjects_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgBdanObjects* this = THIS; DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); if (thisx->params == 0) { @@ -428,23 +430,27 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) { } } -void BgBdanObjects_Update(BgBdanObjects* this, GlobalContext* globalCtx) { - Actor_SetHeight(&this->dyna.actor, 50.0f); +void BgBdanObjects_Update(Actor* thisx, GlobalContext* globalCtx) { + BgBdanObjects* this = THIS; + + Actor_SetHeight(thisx, 50.0f); this->actionFunc(this, globalCtx); } -void BgBdanObjects_Draw(BgBdanObjects* this, GlobalContext* globalCtx) { - if (this->dyna.actor.params == 0) { +void BgBdanObjects_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgBdanObjects* this = THIS; + + if (thisx->params == 0) { if (this->actionFunc == (ActorFunc)func_8086C054) { - if (((this->dyna.actor.initPosRot.pos.y + -79.0f) - 5.0f) < this->dyna.actor.posRot.pos.y) { + if (((thisx->initPosRot.pos.y + -79.0f) - 5.0f) < thisx->posRot.pos.y) { Matrix_Translate(0.0f, -50.0f, 0.0f, MTXMODE_APPLY); } } } - if (this->dyna.actor.params == 2) { + if (thisx->params == 2) { Gfx_DrawDListXlu(globalCtx, &D_060038E8); } else { - Gfx_DrawDListOpa(globalCtx, D_8086CDA0[this->dyna.actor.params]); + Gfx_DrawDListOpa(globalCtx, D_8086CDA0[thisx->params]); } } diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index b9cbf81d8f..143f262aab 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx); -void BgBdanSwitch_Destroy(BgBdanSwitch* this, GlobalContext* globalCtx); -void BgBdanSwitch_Update(BgBdanSwitch* this, GlobalContext* globalCtx); -void BgBdanSwitch_Draw(BgBdanSwitch* this, GlobalContext* globalCtx); +#define THIS ((BgBdanSwitch*)thisx) + +void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx); +void BgBdanSwitch_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx); +void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx); void func_8086D5C4(BgBdanSwitch* this); void func_8086D5E0(BgBdanSwitch* this, GlobalContext* globalCtx); @@ -122,8 +124,9 @@ void func_8086D0EC(BgBdanSwitch* this) { this->actor.shape.unk_08 = 1.2f / this->unk_1D0; } -void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { + BgBdanSwitch* this = THIS; + s32 pad; s16 type; s32 flag; @@ -186,7 +189,9 @@ void BgBdanSwitch_Init(BgBdanSwitch* this, GlobalContext* globalCtx) { osSyncPrintf("(巨大魚ダンジョン 専用スイッチ)(arg_data 0x%04x)\n", this->actor.params); } -void BgBdanSwitch_Destroy(BgBdanSwitch* this, GlobalContext* globalCtx) { +void BgBdanSwitch_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgBdanSwitch* this = THIS; + switch (this->actor.params & 0xFF) { case BLUE: case YELLOW_HEAVY: @@ -202,6 +207,7 @@ void BgBdanSwitch_Destroy(BgBdanSwitch* this, GlobalContext* globalCtx) { void func_8086D4B4(BgBdanSwitch* this, GlobalContext* globalCtx) { s32 pad; s32 type; + if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { type = this->actor.params & 0xFF; Flags_SetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F); @@ -458,10 +464,10 @@ void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) { } } -void BgBdanSwitch_Update(BgBdanSwitch* this, GlobalContext* globalCtx) { - s32 pad; +void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { + BgBdanSwitch* this = THIS; s32 type; - s32 pad2; + s32 temp; if (this->unk_1DA > 0) { this->unk_1DA -= 1; @@ -476,9 +482,9 @@ void BgBdanSwitch_Update(BgBdanSwitch* this, GlobalContext* globalCtx) { if (!func_8008E988(globalCtx) && this->unk_1D8 > 0) { this->unk_1D8 -= 1; } - pad = this->collider.base.acFlags; + temp = this->collider.base.acFlags; this->collider.base.acFlags &= 0xFFFD; - this->unk_1DC = pad; + this->unk_1DC = temp; this->collider.list[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); @@ -491,7 +497,9 @@ void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, UNK_TYPE arg2) Gfx_DrawDListOpa(globalCtx, arg2); } -void BgBdanSwitch_Draw(BgBdanSwitch* this, GlobalContext* globalCtx) { +void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgBdanSwitch* this = THIS; + switch (this->actor.params & 0xFF) { case YELLOW_HEAVY: case YELLOW: diff --git a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c index db76729198..14987b9f6e 100644 --- a/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c +++ b/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.c @@ -12,9 +12,11 @@ #define FLAGS 0x00000010 -void BgBomGuard_Init(BgBomGuard* this, GlobalContext* globalCtx); -void BgBomGuard_Destroy(BgBomGuard* this, GlobalContext* globalCtx); -void BgBomGuard_Update(BgBomGuard* this, GlobalContext* globalCtx); +#define THIS ((BgBomGuard*)thisx) + +void BgBomGuard_Init(Actor* thisx, GlobalContext* globalCtx); +void BgBomGuard_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgBomGuard_Update(Actor* thisx, GlobalContext* globalCtx); void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx); @@ -36,12 +38,12 @@ void BgBomGuard_SetupAction(BgBomGuard* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void BgBomGuard_Init(BgBomGuard* this, GlobalContext* globalCtx) { +void BgBomGuard_Init(Actor* thisx, GlobalContext* globalCtx) { + BgBomGuard* this = THIS; s32 pad[2]; - Actor* thisx = &this->dyna.actor; s32 local_c = 0; - DynaPolyInfo_SetActorMove(&this->dyna.actor, 0); + DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_Alloc(&D_06001C40, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); @@ -55,7 +57,9 @@ void BgBomGuard_Init(BgBomGuard* this, GlobalContext* globalCtx) { BgBomGuard_SetupAction(this, func_8086E638); } -void BgBomGuard_Destroy(BgBomGuard* this, GlobalContext* globalCtx) { +void BgBomGuard_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgBomGuard* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -83,6 +87,8 @@ void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) { } } -void BgBomGuard_Update(BgBomGuard* this, GlobalContext* globalCtx) { +void BgBomGuard_Update(Actor* thisx, GlobalContext* globalCtx) { + BgBomGuard* this = THIS; + this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index 30088b4b31..2cec5ee7c6 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -8,10 +8,13 @@ #define FLAGS 0x00400000 -void BgBombwall_Init(BgBombwall* this, GlobalContext* globalCtx); -void BgBombwall_Destroy(BgBombwall* this, GlobalContext* globalCtx); -void BgBombwall_Update(BgBombwall* this, GlobalContext* globalCtx); -void BgBombwall_Draw(BgBombwall* this, GlobalContext* globalCtx); +#define THIS ((BgBombwall*)thisx) + +void BgBombwall_Init(Actor* thisx, GlobalContext* globalCtx); +void BgBombwall_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgBombwall_Update(Actor* thisx, GlobalContext* globalCtx); +void BgBombwall_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8086E7D0(BgBombwall* this, GlobalContext* globalCtx); void func_8086EAC0(BgBombwall* this, GlobalContext* globalCtx); void func_8086EB5C(BgBombwall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c index 6e913211dc..d6570d91ac 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void BgBowlWall_Init(BgBowlWall* this, GlobalContext* globalCtx); -void BgBowlWall_Destroy(BgBowlWall* this, GlobalContext* globalCtx); -void BgBowlWall_Update(BgBowlWall* this, GlobalContext* globalCtx); -void BgBowlWall_Draw(BgBowlWall* this, GlobalContext* globalCtx); +#define THIS ((BgBowlWall*)thisx) + +void BgBowlWall_Init(Actor* thisx, GlobalContext* globalCtx); +void BgBowlWall_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgBowlWall_Update(Actor* thisx, GlobalContext* globalCtx); +void BgBowlWall_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8086F260(BgBowlWall* this, GlobalContext* globalCtx); void func_8086F440(BgBowlWall* this, GlobalContext* globalCtx); void func_8086F464(BgBowlWall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index bdff3d9a1b..48db87e892 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -8,9 +8,12 @@ #define FLAGS 0x00000010 -void BgBreakwall_Init(BgBreakwall* this, GlobalContext* globalCtx); -void BgBreakwall_Destroy(BgBreakwall* this, GlobalContext* globalCtx); -void BgBreakwall_Update(BgBreakwall* this, GlobalContext* globalCtx); +#define THIS ((BgBreakwall*)thisx) + +void BgBreakwall_Init(Actor* thisx, GlobalContext* globalCtx); +void BgBreakwall_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgBreakwall_Update(Actor* thisx, GlobalContext* globalCtx); + void BgBreakwall_SetupAction(BgBreakwall* this, ActorFunc actionFunc); void func_80870290(BgBreakwall* this, GlobalContext* globalCtx); void func_80870394(BgBreakwall* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c index f8b31013f9..05197584ce 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void BgDdanJd_Init(BgDdanJd* this, GlobalContext* globalCtx); -void BgDdanJd_Destroy(BgDdanJd* this, GlobalContext* globalCtx); -void BgDdanJd_Update(BgDdanJd* this, GlobalContext* globalCtx); -void BgDdanJd_Draw(BgDdanJd* this, GlobalContext* globalCtx); +#define THIS ((BgDdanJd*)thisx) + +void BgDdanJd_Init(Actor* thisx, GlobalContext* globalCtx); +void BgDdanJd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgDdanJd_Update(Actor* thisx, GlobalContext* globalCtx); +void BgDdanJd_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_80870B88(BgDdanJd* this, GlobalContext* globalCtx); void func_80870D2C(BgDdanJd* this, GlobalContext* globalCtx); void func_80870F00(BgDdanJd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index e86a762b88..35ca5354ff 100644 --- a/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -8,11 +8,13 @@ #define FLAGS 0x00000010 -void BgDdanKd_Init(BgDdanKd* this, GlobalContext* globalCtx); -void BgDdanKd_Destroy(BgDdanKd* this, GlobalContext* globalCtx); -void BgDdanKd_Update(BgDdanKd* this, GlobalContext* globalCtx); -void BgDdanKd_Draw(BgDdanKd* this, GlobalContext* globalCtx); -void BgDdanKd_SetupAction(BgDdanKd* this, ActorFunc actionFunc); +#define THIS ((BgDdanKd*)thisx) + +void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx); +void BgDdanKd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgDdanKd_Update(Actor* thisx, GlobalContext* globalCtx); +void BgDdanKd_Draw(Actor* thisx, GlobalContext* globalCtx); + void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx); void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx); void func_80871838(BgDdanKd* this, GlobalContext* globalCtx); @@ -53,9 +55,9 @@ void BgDdanKd_SetupAction(BgDdanKd* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void BgDdanKd_Init(BgDdanKd* this, GlobalContext* globalCtx) { +void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx) { + BgDdanKd* this = THIS; s32 pad; - s32 pad2; s32 sp24 = 0; this->previousCollidingExplosion = NULL; @@ -76,7 +78,9 @@ void BgDdanKd_Init(BgDdanKd* this, GlobalContext* globalCtx) { } } -void BgDdanKd_Destroy(BgDdanKd* this, GlobalContext* globalCtx) { +void BgDdanKd_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgDdanKd* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); Collider_DestroyCylinder(globalCtx, &this->collider); } @@ -164,10 +168,12 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { void func_80871838(BgDdanKd* this, GlobalContext* globalCtx) { } -void BgDdanKd_Update(BgDdanKd* this, GlobalContext* globalCtx) { +void BgDdanKd_Update(Actor* thisx, GlobalContext* globalCtx) { + BgDdanKd* this = THIS; + this->actionFunc(this, globalCtx); } -void BgDdanKd_Draw(BgDdanKd* this, GlobalContext* globalCtx) { +void BgDdanKd_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_060048A8); } diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 51353d45d7..70f76d2819 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void BgDodoago_Init(BgDodoago* this, GlobalContext* globalCtx); -void BgDodoago_Destroy(BgDodoago* this, GlobalContext* globalCtx); -void BgDodoago_Update(BgDodoago* this, GlobalContext* globalCtx); -void BgDodoago_Draw(BgDodoago* this, GlobalContext* globalCtx); +#define THIS ((BgDodoago*)thisx) + +void BgDodoago_Init(Actor* thisx, GlobalContext* globalCtx); +void BgDodoago_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx); +void BgDodoago_Draw(Actor* thisx, GlobalContext* globalCtx); + void BgDodoago_SetupAction(BgDodoago* this, ActorFunc actionFunc); // void func_80871A08(Vec3f* vec, GlobalContext* globalCtx); // Not 100% sure void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index a91082e766..533e34df76 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -8,9 +8,12 @@ #define FLAGS 0x02000030 -void BgDyYoseizo_Init(BgDyYoseizo* this, GlobalContext* globalCtx); -void BgDyYoseizo_Destroy(BgDyYoseizo* this, GlobalContext* globalCtx); -void BgDyYoseizo_Update(BgDyYoseizo* this, GlobalContext* globalCtx); +#define THIS ((BgDyYoseizo*)thisx) + +void BgDyYoseizo_Init(Actor* thisx, GlobalContext* globalCtx); +void BgDyYoseizo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx); + void func_80872960(BgDyYoseizo* this, GlobalContext* globalCtx, s16 arg2); void func_80872C58(BgDyYoseizo* this, GlobalContext* globalCtx); void func_80872D20(BgDyYoseizo* this, GlobalContext* globalCtx); @@ -34,6 +37,7 @@ void func_80874BE0(BgDyYoseizo* this, GlobalContext* globalCtx); // func_80874D9C void func_80874EAC(BgDyYoseizo* this, GlobalContext* globalCtx); void func_808751A0(BgDyYoseizo* this, GlobalContext* globalCtx); + /* const ActorInit Bg_Dy_Yoseizo_InitVars = { ACTOR_BG_DY_YOSEIZO, diff --git a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index ea33ff9853..ef655839ab 100644 --- a/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void BgGanonOtyuka_Init(BgGanonOtyuka* this, GlobalContext* globalCtx); -void BgGanonOtyuka_Destroy(BgGanonOtyuka* this, GlobalContext* globalCtx); -void BgGanonOtyuka_Update(BgGanonOtyuka* this, GlobalContext* globalCtx); -void BgGanonOtyuka_Draw(BgGanonOtyuka* this, GlobalContext* globalCtx); +#define THIS ((BgGanonOtyuka*)thisx) + +void BgGanonOtyuka_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGanonOtyuka_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGanonOtyuka_Update(Actor* thisx, GlobalContext* globalCtx); +void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_80875A0C(BgGanonOtyuka* this, GlobalContext* globalCtx); void func_80875C88(BgGanonOtyuka* this, GlobalContext* globalCtx); void func_808760DC(BgGanonOtyuka* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 17775e6118..65824aaff7 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -10,10 +10,12 @@ #define FLAGS 0x00000000 -void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx); -void BgGateShutter_Destroy(BgGateShutter* this, GlobalContext* globalCtx); -void BgGateShutter_Update(BgGateShutter* this, GlobalContext* globalCtx); -void BgGateShutter_Draw(BgGateShutter* this, GlobalContext* globalCtx); +#define THIS ((BgGateShutter*)thisx) + +void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGateShutter_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGateShutter_Update(Actor* thisx, GlobalContext* globalCtx); +void BgGateShutter_Draw(Actor* thisx, GlobalContext* globalCtx); void func_8087828C(BgGateShutter* this, GlobalContext* globalCtx); void func_80878300(BgGateShutter* this, GlobalContext* globalCtx); @@ -35,12 +37,12 @@ const ActorInit Bg_Gate_Shutter_InitVars = { extern UNK_TYPE D_06001CD0; extern UNK_TYPE D_06001DA8; -void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx) { +void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) { + BgGateShutter* this = THIS; s32 pad[2]; - Actor* thisx = &this->dyna.actor; s32 local_c = 0; - DynaPolyInfo_SetActorMove(thisx, 0); + DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_Alloc(&D_06001DA8, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); this->somePosX = thisx->posRot.pos.x; @@ -60,7 +62,9 @@ void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx) { this->actionFunc = (ActorFunc)func_8087828C; } -void BgGateShutter_Destroy(BgGateShutter* this, GlobalContext* globalCtx) { +void BgGateShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgGateShutter* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -115,14 +119,16 @@ void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx) { } } -void BgGateShutter_Update(BgGateShutter* this, GlobalContext* globalCtx) { +void BgGateShutter_Update(Actor* thisx, GlobalContext* globalCtx) { + BgGateShutter* this = THIS; + if (this->unk_178 != 0) { this->unk_178 -= 1; } this->actionFunc(this, globalCtx); } -void BgGateShutter_Draw(BgGateShutter* this, GlobalContext* globalCtx) { +void BgGateShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index a17ee1752d..3ac50ca8a2 100644 --- a/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void BgGjyoBridge_Init(BgGjyoBridge* this, GlobalContext* globalCtx); -void BgGjyoBridge_Destroy(BgGjyoBridge* this, GlobalContext* globalCtx); -void BgGjyoBridge_Update(BgGjyoBridge* this, GlobalContext* globalCtx); -void BgGjyoBridge_Draw(BgGjyoBridge* this, GlobalContext* globalCtx); +#define THIS ((BgGjyoBridge*)thisx) + +void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGjyoBridge_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGjyoBridge_Update(Actor* thisx, GlobalContext* globalCtx); +void BgGjyoBridge_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_808787A4(BgGjyoBridge* this, GlobalContext* globalCtx); void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx); void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, GlobalContext* globalCtx); @@ -37,31 +40,31 @@ extern UNK_TYPE D_06000600; extern UNK_TYPE D_06000DB8; extern UNK_TYPE D_02002640; -void BgGjyoBridge_Init(BgGjyoBridge* this, GlobalContext* globalCtx) { +void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) { + BgGjyoBridge* this = THIS; s32 pad; - DynaCollisionContext* dynaCollisionContext; s32 local_c; local_c = 0; - Actor_ProcessInitChain(&this->dyna, &initChain); - DynaPolyInfo_SetActorMove(this, 0); + Actor_ProcessInitChain(thisx, &initChain); + DynaPolyInfo_SetActorMove(&this->dyna, 0); DynaPolyInfo_Alloc(&D_06000DB8, &local_c); - dynaCollisionContext = &globalCtx->colCtx.dyna; - - this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, dynaCollisionContext, this, local_c); + this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); if (gSaveContext.eventChkInf[4] & 0x2000) { this->actionFunc = func_808787A4; } else { this->dyna.actor.draw = NULL; - func_8003EBF8(globalCtx, dynaCollisionContext, this->dyna.dynaPolyId); + func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); this->actionFunc = BgGjyoBridge_TriggerCutscene; } } -void BgGjyoBridge_Destroy(BgGjyoBridge* this, GlobalContext* globalCtx) { +void BgGjyoBridge_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgGjyoBridge* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -85,18 +88,20 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, GlobalContext* globalCtx) { if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.actorActions[2] != NULL) && (globalCtx->csCtx.actorActions[2]->action == 2)) { - this->dyna.actor.draw = &BgGjyoBridge_Draw; + this->dyna.actor.draw = BgGjyoBridge_Draw; func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); gSaveContext.eventChkInf[4] |= 0x2000; } } -void BgGjyoBridge_Update(BgGjyoBridge* this, GlobalContext* globalCtx) { +void BgGjyoBridge_Update(Actor* thisx, GlobalContext* globalCtx) { + BgGjyoBridge* this = THIS; + this->actionFunc(this, globalCtx); } -void BgGjyoBridge_Draw(BgGjyoBridge* this, GlobalContext* globalCtx) { - s32 pad; +void BgGjyoBridge_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgGjyoBridge* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index e38cf5e99f..998582e2b3 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 +#define THIS ((BgGndDarkmeiro*)thisx) + +void BgGndDarkmeiro_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGndDarkmeiro_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGndDarkmeiro_Update(Actor* thisx, GlobalContext* globalCtx); + void func_80878C30(BgGndDarkmeiro* this, GlobalContext* globalCtx); -void BgGndDarkmeiro_Init(BgGndDarkmeiro* this, GlobalContext* globalCtx); -void BgGndDarkmeiro_Destroy(BgGndDarkmeiro* this, GlobalContext* globalCtx); -void BgGndDarkmeiro_Update(BgGndDarkmeiro* this, GlobalContext* globalCtx); void func_80878F28(BgGndDarkmeiro* this, GlobalContext* globalCtx); void func_80878F34(BgGndDarkmeiro* this, GlobalContext* globalCtx); void func_80879128(BgGndDarkmeiro* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c index 7732ca669e..38c67472d5 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void BgGndFiremeiro_Init(BgGndFiremeiro* this, GlobalContext* globalCtx); -void BgGndFiremeiro_Destroy(BgGndFiremeiro* this, GlobalContext* globalCtx); -void BgGndFiremeiro_Update(BgGndFiremeiro* this, GlobalContext* globalCtx); -void BgGndFiremeiro_Draw(BgGndFiremeiro* this, GlobalContext* globalCtx); +#define THIS ((BgGndFiremeiro*)thisx) + +void BgGndFiremeiro_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGndFiremeiro_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGndFiremeiro_Update(Actor* thisx, GlobalContext* globalCtx); +void BgGndFiremeiro_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_808795AC(BgGndFiremeiro* this, GlobalContext* globalCtx); void func_80879668(BgGndFiremeiro* this, GlobalContext* globalCtx); void func_80879808(BgGndFiremeiro* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c index cf6eccf41b..90527a5b4c 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void BgGndIceblock_Init(BgGndIceblock* this, GlobalContext* globalCtx); -void BgGndIceblock_Destroy(BgGndIceblock* this, GlobalContext* globalCtx); -void BgGndIceblock_Update(BgGndIceblock* this, GlobalContext* globalCtx); -void BgGndIceblock_Draw(BgGndIceblock* this, GlobalContext* globalCtx); +#define THIS ((BgGndIceblock*)thisx) + +void BgGndIceblock_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGndIceblock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGndIceblock_Update(Actor* thisx, GlobalContext* globalCtx); +void BgGndIceblock_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087A0C8(BgGndIceblock* this, GlobalContext* globalCtx); void func_8087A184(BgGndIceblock* this, GlobalContext* globalCtx); void func_8087A248(BgGndIceblock* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index f472ffceaa..23b0778cff 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgGndNisekabe_Init(BgGndNisekabe* this, GlobalContext* globalCtx); -void BgGndNisekabe_Destroy(BgGndNisekabe* this, GlobalContext* globalCtx); -void BgGndNisekabe_Update(BgGndNisekabe* this, GlobalContext* globalCtx); -void BgGndNisekabe_Draw(BgGndNisekabe* this, GlobalContext* globalCtx); +#define THIS ((BgGndNisekabe*)thisx) + +void BgGndNisekabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGndNisekabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGndNisekabe_Update(Actor* thisx, GlobalContext* globalCtx); +void BgGndNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Gnd_Nisekabe_InitVars = { ACTOR_BG_GND_NISEKABE, @@ -27,15 +29,19 @@ const ActorInit Bg_Gnd_Nisekabe_InitVars = { static u32 segmentAddr[] = { 0x06009230, 0x0600A390, 0x0600B4A0 }; -void BgGndNisekabe_Init(BgGndNisekabe* this, GlobalContext* globalCtx) { +void BgGndNisekabe_Init(Actor* thisx, GlobalContext* globalCtx) { + BgGndNisekabe* this = THIS; + Actor_SetScale(&this->actor, 0.1); this->actor.unk_F4 = 3000.0; } -void BgGndNisekabe_Destroy(BgGndNisekabe* this, GlobalContext* globalCtx) { +void BgGndNisekabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void BgGndNisekabe_Update(BgGndNisekabe* this, GlobalContext* globalCtx) { +void BgGndNisekabe_Update(Actor* thisx, GlobalContext* globalCtx) { + BgGndNisekabe* this = THIS; + if (globalCtx->actorCtx.unk_03 != 0) { this->actor.flags |= 0x80; } else { @@ -43,7 +49,8 @@ void BgGndNisekabe_Update(BgGndNisekabe* this, GlobalContext* globalCtx) { } } -void BgGndNisekabe_Draw(BgGndNisekabe* this, GlobalContext* globalCtx) { +void BgGndNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgGndNisekabe* this = THIS; u32 index = this->actor.params & 0xFF; if ((this->actor.flags & 0x80) == 0x80) { diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index 57a60b06a7..dcfa67394b 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void BgGndSoulmeiro_Init(BgGndSoulmeiro* this, GlobalContext* globalCtx); -void BgGndSoulmeiro_Destroy(BgGndSoulmeiro* this, GlobalContext* globalCtx); -void BgGndSoulmeiro_Update(BgGndSoulmeiro* this, GlobalContext* globalCtx); -void BgGndSoulmeiro_Draw(BgGndSoulmeiro* this, GlobalContext* globalCtx); +#define THIS ((BgGndSoulmeiro*)thisx) + +void BgGndSoulmeiro_Init(Actor* thisx, GlobalContext* globalCtx); +void BgGndSoulmeiro_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgGndSoulmeiro_Update(Actor* thisx, GlobalContext* globalCtx); +void BgGndSoulmeiro_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx); void func_8087B284(BgGndSoulmeiro* this, GlobalContext* globalCtx); void func_8087B350(BgGndSoulmeiro* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index 5b33fa964e..5a64ef29e7 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void BgHaka_Init(BgHaka* this, GlobalContext* globalCtx); -void BgHaka_Destroy(BgHaka* this, GlobalContext* globalCtx); -void BgHaka_Update(BgHaka* this, GlobalContext* globalCtx); -void BgHaka_Draw(BgHaka* this, GlobalContext* globalCtx); +#define THIS ((BgHaka*)thisx) + +void BgHaka_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHaka_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHaka_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHaka_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087B758(BgHaka* this, Player* player); void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx); void func_8087B938(BgHaka* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index 93af9e2fe1..7c9e06aa09 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void BgHakaGate_Init(BgHakaGate* this, GlobalContext* globalCtx); -void BgHakaGate_Destroy(BgHakaGate* this, GlobalContext* globalCtx); -void BgHakaGate_Update(BgHakaGate* this, GlobalContext* globalCtx); -void BgHakaGate_Draw(BgHakaGate* this, GlobalContext* globalCtx); +#define THIS ((BgHakaGate*)thisx) + +void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaGate_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaGate_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaGate_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087C114(BgHakaGate* this, GlobalContext* globalCtx); void func_8087C120(BgHakaGate* this, GlobalContext* globalCtx); void func_8087C158(BgHakaGate* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 613144d30d..b3c77d151d 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -2,10 +2,13 @@ #define FLAGS 0x00000010 -void BgHakaHuta_Init(BgHakaHuta* this, GlobalContext* globalCtx); -void BgHakaHuta_Destroy(BgHakaHuta* this, GlobalContext* globalCtx); -void BgHakaHuta_Update(BgHakaHuta* this, GlobalContext* globalCtx); -void BgHakaHuta_Draw(BgHakaHuta* this, GlobalContext* globalCtx); +#define THIS ((BgHakaHuta*)thisx) + +void BgHakaHuta_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaHuta_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaHuta_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaHuta_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087D0AC(BgHakaHuta* this, GlobalContext* globalCtx); // void func_8087D268(BgHakaHuta* this, GlobalContext* globalCtx, u16 arg2); not sure about this one // void func_8087D5B8(BgHakaHuta* this, GlobalContext* globalCtx); not sure about this one diff --git a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c index 024541f2fe..9bae9f1411 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c +++ b/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.c @@ -8,14 +8,16 @@ #define FLAGS 0x000000B0 -void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx); -void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx); -void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx); +#define THIS ((BgHakaMegane*)thisx) + +void BgHakaMegane_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaMegane_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaMegane_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaMegane_Draw(Actor* thisx, GlobalContext* globalCtx); void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx); void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx); void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx); -void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Megane_InitVars = { ACTOR_BG_HAKA_MEGANE, @@ -45,11 +47,11 @@ static UNK_TYPE dlists[] = { extern UNK_TYPE D_06001250; -void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgHakaMegane_Init(Actor* thisx, GlobalContext* globalCtx) { + BgHakaMegane* this = THIS; Actor_ProcessInitChain(thisx, initChain); - DynaPolyInfo_SetActorMove(thisx, 0); + DynaPolyInfo_SetActorMove(&this->dyna, 0); if (thisx->params < 3) { this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_HAKACH_OBJECTS); @@ -64,7 +66,9 @@ void BgHakaMegane_Init(BgHakaMegane* this, GlobalContext* globalCtx) { } } -void BgHakaMegane_Destroy(BgHakaMegane* this, GlobalContext* globalCtx) { +void BgHakaMegane_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgHakaMegane* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -74,7 +78,7 @@ void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { this->dyna.actor.objBankIndex = this->objBankIndex; - this->dyna.actor.draw = (ActorFunc)func_8087DC94; + this->dyna.actor.draw = BgHakaMegane_Draw; Actor_SetObjectDependency(globalCtx, &this->dyna.actor); if (globalCtx->roomCtx.curRoom.showInvisActors) { this->actionFunc = (ActorFunc)func_8087DBF0; @@ -104,12 +108,14 @@ void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) { void func_8087DC64(BgHakaMegane* this, GlobalContext* globalCtx) { } -void BgHakaMegane_Update(BgHakaMegane* this, GlobalContext* globalCtx) { +void BgHakaMegane_Update(Actor* thisx, GlobalContext* globalCtx) { + BgHakaMegane* this = THIS; + this->actionFunc(this, globalCtx); } -void func_8087DC94(BgHakaMegane* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgHakaMegane_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgHakaMegane* this = THIS; if ((thisx->flags & 0x80) == 0x80) { Gfx_DrawDListXlu(globalCtx, dlists[thisx->params]); diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 81d94e03ff..f91ab1682c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -2,10 +2,13 @@ #define FLAGS 0x00000000 -void BgHakaMeganeBG_Init(BgHakaMeganeBG* this, GlobalContext* globalCtx); -void BgHakaMeganeBG_Destroy(BgHakaMeganeBG* this, GlobalContext* globalCtx); -void BgHakaMeganeBG_Update(BgHakaMeganeBG* this, GlobalContext* globalCtx); -void BgHakaMeganeBG_Draw(BgHakaMeganeBG* this, GlobalContext* globalCtx); +#define THIS ((BgHakaMeganeBG*)thisx) + +void BgHakaMeganeBG_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaMeganeBG_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaMeganeBG_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaMeganeBG_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087E258(BgHakaMeganeBG* this, GlobalContext* globalCtx); void func_8087E288(BgHakaMeganeBG* this, GlobalContext* globalCtx); void func_8087E2D8(BgHakaMeganeBG* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 16ca21ec21..54afef404b 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -8,9 +8,12 @@ #define FLAGS 0x00000011 -void BgHakaSgami_Init(BgHakaSgami* this, GlobalContext* globalCtx); -void BgHakaSgami_Destroy(BgHakaSgami* this, GlobalContext* globalCtx); -void BgHakaSgami_Update(BgHakaSgami* this, GlobalContext* globalCtx); +#define THIS ((BgHakaSgami*)thisx) + +void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaSgami_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaSgami_Update(Actor* thisx, GlobalContext* globalCtx); + void func_8087E7E4(BgHakaSgami* this, GlobalContext* globalCtx); void func_8087E858(BgHakaSgami* this, GlobalContext* globalCtx); void func_8087EDC0(BgHakaSgami* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index f1866233ab..344b1bfd2c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void BgHakaShip_Init(BgHakaShip* this, GlobalContext* globalCtx); -void BgHakaShip_Destroy(BgHakaShip* this, GlobalContext* globalCtx); -void BgHakaShip_Update(BgHakaShip* this, GlobalContext* globalCtx); -void BgHakaShip_Draw(BgHakaShip* this, GlobalContext* globalCtx); +#define THIS ((BgHakaShip*)thisx) + +void BgHakaShip_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaShip_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaShip_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaShip_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087F27C(BgHakaShip* this, GlobalContext* globalCtx); void func_8087F2D8(BgHakaShip* this, GlobalContext* globalCtx); void func_8087F364(BgHakaShip* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 070fdb5eb0..91f08e35bd 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void BgHakaTrap_Init(BgHakaTrap* this, GlobalContext* globalCtx); -void BgHakaTrap_Destroy(BgHakaTrap* this, GlobalContext* globalCtx); -void BgHakaTrap_Update(BgHakaTrap* this, GlobalContext* globalCtx); -void BgHakaTrap_Draw(BgHakaTrap* this, GlobalContext* globalCtx); +#define THIS ((BgHakaTrap*)thisx) + +void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaTrap_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaTrap_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx); void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx); void func_808802D8(BgHakaTrap* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 6044a682b2..ef6efe8e88 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000010 -void BgHakaTubo_Init(BgHakaTubo* this, GlobalContext* globalCtx); -void BgHakaTubo_Destroy(BgHakaTubo* this, GlobalContext* globalCtx); -void BgHakaTubo_Update(BgHakaTubo* this, GlobalContext* globalCtx); -void BgHakaTubo_Draw(BgHakaTubo* this, GlobalContext* globalCtx); +#define THIS ((BgHakaTubo*)thisx) + +void BgHakaTubo_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaTubo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaTubo_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaTubo_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_808813A0(BgHakaTubo* this, GlobalContext* globalCtx); void func_80881608(BgHakaTubo* this, GlobalContext* globalCtx); void func_80881904(BgHakaTubo* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c index 4246a3983f..a461fd8297 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c +++ b/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void BgHakaWater_Init(BgHakaWater* this, GlobalContext* globalCtx); -void BgHakaWater_Destroy(BgHakaWater* this, GlobalContext* globalCtx); -void BgHakaWater_Update(BgHakaWater* this, GlobalContext* globalCtx); -void BgHakaWater_Draw(BgHakaWater* this, GlobalContext* globalCtx); +#define THIS ((BgHakaWater*)thisx) + +void BgHakaWater_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaWater_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaWater_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHakaWater_Draw(Actor* thisx, GlobalContext* globalCtx); + // ? func_80881D94(BgHakaWater* this, GlobalContext* globalCtx) // not entirely sure on this one void func_80881EDC(BgHakaWater* this, GlobalContext* globalCtx); void func_80881F98(BgHakaWater* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index f7eee3786a..e36ca9e443 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000010 -void BgHakaZou_Init(BgHakaZou* this, GlobalContext* globalCtx); -void BgHakaZou_Destroy(BgHakaZou* this, GlobalContext* globalCtx); -void BgHakaZou_Update(BgHakaZou* this, GlobalContext* globalCtx); +#define THIS ((BgHakaZou*)thisx) + +void BgHakaZou_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHakaZou_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHakaZou_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Haka_Zou_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index bc489a25fb..482433525b 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHeavyBlock_Init(BgHeavyBlock* this, GlobalContext* globalCtx); -void BgHeavyBlock_Destroy(BgHeavyBlock* this, GlobalContext* globalCtx); -void BgHeavyBlock_Update(BgHeavyBlock* this, GlobalContext* globalCtx); -void BgHeavyBlock_Draw(BgHeavyBlock* this, GlobalContext* globalCtx); +#define THIS ((BgHeavyBlock*)thisx) + +void BgHeavyBlock_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHeavyBlock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHeavyBlock_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHeavyBlock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Heavy_Block_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index c9fb8a9b07..5f225262bd 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgHidanCurtain_Init(BgHidanCurtain* this, GlobalContext* globalCtx); -void BgHidanCurtain_Destroy(BgHidanCurtain* this, GlobalContext* globalCtx); -void BgHidanCurtain_Update(BgHidanCurtain* this, GlobalContext* globalCtx); -void BgHidanCurtain_Draw(BgHidanCurtain* this, GlobalContext* globalCtx); +#define THIS ((BgHidanCurtain*)thisx) + +void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanCurtain_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanCurtain_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanCurtain_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Curtain_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 8c6c467ad6..95fad0ade1 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHidanDalm_Init(BgHidanDalm* this, GlobalContext* globalCtx); -void BgHidanDalm_Destroy(BgHidanDalm* this, GlobalContext* globalCtx); -void BgHidanDalm_Update(BgHidanDalm* this, GlobalContext* globalCtx); -void BgHidanDalm_Draw(BgHidanDalm* this, GlobalContext* globalCtx); +#define THIS ((BgHidanDalm*)thisx) + +void BgHidanDalm_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanDalm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanDalm_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanDalm_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Dalm_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 66e44f757c..cc24fdb6bb 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -8,16 +8,19 @@ #define FLAGS 0x00000000 -void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); +#define THIS ((BgHidanFirewall*)thisx) + +void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFirewall_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFirewall_Draw(Actor* thisx, GlobalContext* globalCtx); + s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx); extern Gfx D_0600DA80[]; @@ -50,15 +53,11 @@ UNK_PTR D_80886D04[] = { 0x06015D20, 0x06016120, 0x06016520, 0x06016920, 0x06016D20, 0x06017120, 0x06017520, 0x06017920, }; -void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx) { +void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx) { + BgHidanFirewall* this = THIS; - f32 scale; - - scale = 0.12f; - this->actor.scale.x = scale; - this->actor.scale.z = scale; - - scale = 0.01f; + this->actor.scale.x = 0.12f; + this->actor.scale.z = 0.12f; this->actor.scale.y = 0.01f; this->unk_150 = 0; @@ -73,8 +72,9 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx) { this->actionFunc = (ActorFunc)BgHidanFirewall_Wait; } -void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) { - BgHidanFirewall* thing = this; +void BgHidanFirewall_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgHidanFirewall* this = THIS; + Collider_DestroyCylinder(globalCtx, &this->collider); } @@ -170,9 +170,9 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* this->collider.dim.pos.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret; } -void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) { - s32 pad1; - s32 pad2; +void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx) { + BgHidanFirewall* this = THIS; + s32 pad; this->unk_150 = (this->unk_150 + 1) % 8; @@ -190,8 +190,8 @@ void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) { } } -void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) { - UNK_PTR* temp; +void BgHidanFirewall_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgHidanFirewall* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; @@ -200,9 +200,7 @@ void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 448); gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 0x14); - temp = D_80886D04; - - gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(temp[this->unk_150])); + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80886D04[this->unk_150])); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0x01, 0xFF, 0xFF, 0x00, 0x96); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x00, 0x00, 0xFF); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 458), diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index 8d1a3d9281..7d40b260b2 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgHidanFslift_Init(BgHidanFslift* this, GlobalContext* globalCtx); -void BgHidanFslift_Destroy(BgHidanFslift* this, GlobalContext* globalCtx); -void BgHidanFslift_Update(BgHidanFslift* this, GlobalContext* globalCtx); -void BgHidanFslift_Draw(BgHidanFslift* this, GlobalContext* globalCtx); +#define THIS ((BgHidanFslift*)thisx) + +void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFslift_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFslift_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFslift_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx); void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx); @@ -39,10 +41,11 @@ static InitChainEntry initChain[] = { ICHAIN_F32(unk_F4, 2000, ICHAIN_STOP), }; -void BgHidanFslift_Init(BgHidanFslift* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) { + BgHidanFslift* this = THIS; + s32 pad1; s32 local_c = 0; - Actor* thisx = &this->dyna.actor; + s32 pad2; Actor_ProcessInitChain(thisx, initChain); DynaPolyInfo_SetActorMove(thisx, 1); @@ -58,6 +61,7 @@ void BgHidanFslift_Init(BgHidanFslift* this, GlobalContext* globalCtx) { void func_80886F24(BgHidanFslift* this) { Actor* thisx = &this->dyna.actor; + if (thisx->attachedB != NULL && thisx->attachedB->update != NULL) { thisx->attachedB->posRot.pos.x = thisx->posRot.pos.x; thisx->attachedB->posRot.pos.y = thisx->posRot.pos.y + 40.0f; @@ -67,7 +71,9 @@ void func_80886F24(BgHidanFslift* this) { thisx->attachedB = NULL; } -void BgHidanFslift_Destroy(BgHidanFslift* this, GlobalContext* globalCtx) { +void BgHidanFslift_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgHidanFslift* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -101,6 +107,7 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; + if (Math_ApproxF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); func_80886FB4(this); @@ -112,6 +119,7 @@ void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx) { void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; + if (func_80043590(thisx)) { if (Math_ApproxF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 790.0f, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); @@ -125,8 +133,9 @@ void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx) { func_80886F24(this); } -void BgHidanFslift_Update(BgHidanFslift* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgHidanFslift_Update(Actor* thisx, GlobalContext* globalCtx) { + BgHidanFslift* this = THIS; + this->actionFunc(this, globalCtx); if (func_8004356C(thisx)) { if (this->unk_16A == 0) { @@ -143,6 +152,6 @@ void BgHidanFslift_Update(BgHidanFslift* this, GlobalContext* globalCtx) { } } -void BgHidanFslift_Draw(BgHidanFslift* this, GlobalContext* globalCtx) { +void BgHidanFslift_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_0600B630); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index ad9a6ba9cd..8f52157c63 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgHidanFwbig_Init(BgHidanFwbig* this, GlobalContext* globalCtx); -void BgHidanFwbig_Destroy(BgHidanFwbig* this, GlobalContext* globalCtx); -void BgHidanFwbig_Update(BgHidanFwbig* this, GlobalContext* globalCtx); -void BgHidanFwbig_Draw(BgHidanFwbig* this, GlobalContext* globalCtx); +#define THIS ((BgHidanFwbig*)thisx) + +void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFwbig_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanFwbig_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Fwbig_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 9584112751..7a044ecfd9 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHidanHamstep_Init(BgHidanHamstep* this, GlobalContext* globalCtx); -void BgHidanHamstep_Destroy(BgHidanHamstep* this, GlobalContext* globalCtx); -void BgHidanHamstep_Update(BgHidanHamstep* this, GlobalContext* globalCtx); -void BgHidanHamstep_Draw(BgHidanHamstep* this, GlobalContext* globalCtx); +#define THIS ((BgHidanHamstep*)thisx) + +void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanHamstep_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanHamstep_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanHamstep_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Hamstep_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index 9b59620156..fe421631d7 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgHidanHrock_Init(BgHidanHrock* this, GlobalContext* globalCtx); -void BgHidanHrock_Destroy(BgHidanHrock* this, GlobalContext* globalCtx); -void BgHidanHrock_Update(BgHidanHrock* this, GlobalContext* globalCtx); -void BgHidanHrock_Draw(BgHidanHrock* this, GlobalContext* globalCtx); +#define THIS ((BgHidanHrock*)thisx) + +void BgHidanHrock_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanHrock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanHrock_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanHrock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Hrock_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 67c6a3fdad..dec75fe853 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgHidanKousi_Init(BgHidanKousi* this, GlobalContext* globalCtx); -void BgHidanKousi_Destroy(BgHidanKousi* this, GlobalContext* globalCtx); -void BgHidanKousi_Update(BgHidanKousi* this, GlobalContext* globalCtx); -void BgHidanKousi_Draw(BgHidanKousi* this, GlobalContext* globalCtx); +#define THIS ((BgHidanKousi*)thisx) + +void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanKousi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanKousi_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanKousi_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Kousi_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 012830c6da..14b40e3c79 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHidanKowarerukabe_Init(BgHidanKowarerukabe* this, GlobalContext* globalCtx); -void BgHidanKowarerukabe_Destroy(BgHidanKowarerukabe* this, GlobalContext* globalCtx); -void BgHidanKowarerukabe_Update(BgHidanKowarerukabe* this, GlobalContext* globalCtx); -void BgHidanKowarerukabe_Draw(BgHidanKowarerukabe* this, GlobalContext* globalCtx); +#define THIS ((BgHidanKowarerukabe*)thisx) + +void BgHidanKowarerukabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanKowarerukabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanKowarerukabe_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanKowarerukabe_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Kowarerukabe_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 74a3fe8ee5..82a4be5864 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHidanRock_Init(BgHidanRock* this, GlobalContext* globalCtx); -void BgHidanRock_Destroy(BgHidanRock* this, GlobalContext* globalCtx); -void BgHidanRock_Update(BgHidanRock* this, GlobalContext* globalCtx); -void BgHidanRock_Draw(BgHidanRock* this, GlobalContext* globalCtx); +#define THIS ((BgHidanRock*)thisx) + +void BgHidanRock_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanRock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanRock_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanRock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Rock_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index ec5eccb32c..659775ddb3 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHidanRsekizou_Init(BgHidanRsekizou* this, GlobalContext* globalCtx); -void BgHidanRsekizou_Destroy(BgHidanRsekizou* this, GlobalContext* globalCtx); -void BgHidanRsekizou_Update(BgHidanRsekizou* this, GlobalContext* globalCtx); -void BgHidanRsekizou_Draw(BgHidanRsekizou* this, GlobalContext* globalCtx); +#define THIS ((BgHidanRsekizou*)thisx) + +void BgHidanRsekizou_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanRsekizou_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanRsekizou_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Rsekizou_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index ee97d2477e..845c92a7ec 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHidanSekizou_Init(BgHidanSekizou* this, GlobalContext* globalCtx); -void BgHidanSekizou_Destroy(BgHidanSekizou* this, GlobalContext* globalCtx); -void BgHidanSekizou_Update(BgHidanSekizou* this, GlobalContext* globalCtx); -void BgHidanSekizou_Draw(BgHidanSekizou* this, GlobalContext* globalCtx); +#define THIS ((BgHidanSekizou*)thisx) + +void BgHidanSekizou_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSekizou_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSekizou_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSekizou_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Sekizou_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c index 7cefee112e..e2fae87501 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgHidanSima_Init(BgHidanSima* this, GlobalContext* globalCtx); -void BgHidanSima_Destroy(BgHidanSima* this, GlobalContext* globalCtx); -void BgHidanSima_Update(BgHidanSima* this, GlobalContext* globalCtx); -void BgHidanSima_Draw(BgHidanSima* this, GlobalContext* globalCtx); +#define THIS ((BgHidanSima*)thisx) + +void BgHidanSima_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSima_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSima_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSima_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Hidan_Sima_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c index 0462026179..0941b82a58 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.c @@ -8,13 +8,16 @@ #define FLAGS 0x00000010 -void BgHidanSyoku_Init(BgHidanSyoku* this, GlobalContext* globalCtx); -void BgHidanSyoku_Destroy(BgHidanSyoku* this, GlobalContext* globalCtx); +#define THIS ((BgHidanSyoku*)thisx) + +void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSyoku_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSyoku_Update(Actor* thisx, GlobalContext* globalCtx); +void BgHidanSyoku_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_8088F4B8(BgHidanSyoku* this, GlobalContext* globalCtx); void func_8088F514(BgHidanSyoku* this, GlobalContext* globalCtx); void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx); -void BgHidanSyoku_Update(BgHidanSyoku* this, GlobalContext* globalCtx); -void BgHidanSyoku_Draw(BgHidanSyoku* this, GlobalContext* globalCtx); const ActorInit Bg_Hidan_Syoku_InitVars = { ACTOR_BG_HIDAN_SYOKU, @@ -35,19 +38,22 @@ static InitChainEntry initChain[] = { extern UNK_PTR D_0600A7E0; extern UNK_PTR D_0600E568; -void BgHidanSyoku_Init(BgHidanSyoku* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx) { + BgHidanSyoku* this = THIS; + s32 pad; u32 local_c = 0; Actor_ProcessInitChain(&this->dyna.actor, initChain); - DynaPolyInfo_SetActorMove(&this->dyna.actor, 1); + DynaPolyInfo_SetActorMove(&this->dyna, 1); DynaPolyInfo_Alloc(&D_0600E568, &local_c); this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); this->actionFunc = func_8088F4B8; this->dyna.actor.initPosRot.pos.y += 540.0f; } -void BgHidanSyoku_Destroy(BgHidanSyoku* this, GlobalContext* globalCtx) { +void BgHidanSyoku_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgHidanSyoku* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -102,7 +108,9 @@ void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx) { } } -void BgHidanSyoku_Update(BgHidanSyoku* this, GlobalContext* globalCtx) { +void BgHidanSyoku_Update(Actor* thisx, GlobalContext* globalCtx) { + BgHidanSyoku* this = THIS; + this->actionFunc(this, globalCtx); if (func_8004356C(&this->dyna.actor)) { if (this->unk_168 == 0) { @@ -119,6 +127,6 @@ void BgHidanSyoku_Update(BgHidanSyoku* this, GlobalContext* globalCtx) { } } -void BgHidanSyoku_Draw(BgHidanSyoku* this, GlobalContext* globalCtx) { +void BgHidanSyoku_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_0600A7E0); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c index 201b91d6a3..2ee23e64b7 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c +++ b/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgIceObjects_Init(BgIceObjects* this, GlobalContext* globalCtx); -void BgIceObjects_Destroy(BgIceObjects* this, GlobalContext* globalCtx); -void BgIceObjects_Update(BgIceObjects* this, GlobalContext* globalCtx); -void BgIceObjects_Draw(BgIceObjects* this, GlobalContext* globalCtx); +#define THIS ((BgIceObjects*)thisx) + +void BgIceObjects_Init(Actor* thisx, GlobalContext* globalCtx); +void BgIceObjects_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgIceObjects_Update(Actor* thisx, GlobalContext* globalCtx); +void BgIceObjects_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Ice_Objects_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 95bdefe0a4..c7d0097956 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgIceShelter_Init(BgIceShelter* this, GlobalContext* globalCtx); -void BgIceShelter_Destroy(BgIceShelter* this, GlobalContext* globalCtx); -void BgIceShelter_Update(BgIceShelter* this, GlobalContext* globalCtx); -void BgIceShelter_Draw(BgIceShelter* this, GlobalContext* globalCtx); +#define THIS ((BgIceShelter*)thisx) + +void BgIceShelter_Init(Actor* thisx, GlobalContext* globalCtx); +void BgIceShelter_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgIceShelter_Update(Actor* thisx, GlobalContext* globalCtx); +void BgIceShelter_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Ice_Shelter_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 010011fec0..e99c252046 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgIceShutter_Init(BgIceShutter* this, GlobalContext* globalCtx); -void BgIceShutter_Destroy(BgIceShutter* this, GlobalContext* globalCtx); -void BgIceShutter_Update(BgIceShutter* this, GlobalContext* globalCtx); -void BgIceShutter_Draw(BgIceShutter* this, GlobalContext* globalCtx); +#define THIS ((BgIceShutter*)thisx) + +void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx); +void BgIceShutter_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgIceShutter_Update(Actor* thisx, GlobalContext* globalCtx); +void BgIceShutter_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Ice_Shutter_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index 46a8af1f74..89118bf75e 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgIceTurara_Init(BgIceTurara* this, GlobalContext* globalCtx); -void BgIceTurara_Destroy(BgIceTurara* this, GlobalContext* globalCtx); -void BgIceTurara_Update(BgIceTurara* this, GlobalContext* globalCtx); -void BgIceTurara_Draw(BgIceTurara* this, GlobalContext* globalCtx); +#define THIS ((BgIceTurara*)thisx) + +void BgIceTurara_Init(Actor* thisx, GlobalContext* globalCtx); +void BgIceTurara_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgIceTurara_Update(Actor* thisx, GlobalContext* globalCtx); +void BgIceTurara_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Ice_Turara_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index a4d84374b3..66d2d240ba 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void BgIngate_Init(BgIngate* this, GlobalContext* globalCtx); -void BgIngate_Destroy(BgIngate* this, GlobalContext* globalCtx); -void BgIngate_Update(BgIngate* this, GlobalContext* globalCtx); -void BgIngate_Draw(BgIngate* this, GlobalContext* globalCtx); +#define THIS ((BgIngate*)thisx) + +void BgIngate_Init(Actor* thisx, GlobalContext* globalCtx); +void BgIngate_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgIngate_Update(Actor* thisx, GlobalContext* globalCtx); +void BgIngate_Draw(Actor* thisx, GlobalContext* globalCtx); + void BgIngate_SetupAction(BgIngate* this, ActorFunc actionFunc); void func_80892890(BgIngate* this, GlobalContext* globalCtx); void func_80892990(BgIngate* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index 5ee9c4f40f..3906aafd8a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgJya1flift_Init(BgJya1flift* this, GlobalContext* globalCtx); -void BgJya1flift_Destroy(BgJya1flift* this, GlobalContext* globalCtx); -void BgJya1flift_Update(BgJya1flift* this, GlobalContext* globalCtx); -void BgJya1flift_Draw(BgJya1flift* this, GlobalContext* globalCtx); +#define THIS ((BgJya1flift*)thisx) + +void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJya1flift_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJya1flift_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_1flift_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 6281f09515..1cba043387 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgJyaAmishutter_Init(BgJyaAmishutter* this, GlobalContext* globalCtx); -void BgJyaAmishutter_Destroy(BgJyaAmishutter* this, GlobalContext* globalCtx); -void BgJyaAmishutter_Update(BgJyaAmishutter* this, GlobalContext* globalCtx); -void BgJyaAmishutter_Draw(BgJyaAmishutter* this, GlobalContext* globalCtx); +#define THIS ((BgJyaAmishutter*)thisx) + +void BgJyaAmishutter_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaAmishutter_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaAmishutter_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaAmishutter_Draw(Actor* thisx, GlobalContext* globalCtx); void func_808933BC(BgJyaAmishutter* this); void func_808933CC(BgJyaAmishutter* this); @@ -58,13 +60,17 @@ void func_808932C0(BgJyaAmishutter* this, GlobalContext* globalCtx, u32 collisio } } -void BgJyaAmishutter_Init(BgJyaAmishutter* this, GlobalContext* globalCtx) { +void BgJyaAmishutter_Init(Actor* thisx, GlobalContext* globalCtx) { + BgJyaAmishutter* this = THIS; + func_808932C0(this, globalCtx, &D_0600C4C8, 0); Actor_ProcessInitChain(&this->actor, initChain); func_808933BC(this); } -void BgJyaAmishutter_Destroy(BgJyaAmishutter* this, GlobalContext* globalCtx) { +void BgJyaAmishutter_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgJyaAmishutter* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } @@ -116,10 +122,12 @@ void func_8089350C(BgJyaAmishutter* this) { } } -void BgJyaAmishutter_Update(BgJyaAmishutter* this, GlobalContext* globalCtx) { +void BgJyaAmishutter_Update(Actor* thisx, GlobalContext* globalCtx) { + BgJyaAmishutter* this = THIS; + this->actionFunc(this); } -void BgJyaAmishutter_Draw(BgJyaAmishutter* this, GlobalContext* globalCtx) { +void BgJyaAmishutter_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_0600C0A0); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index 06230fe201..2d8a9d8ef9 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void BgJyaBigmirror_Init(BgJyaBigmirror* this, GlobalContext* globalCtx); -void BgJyaBigmirror_Destroy(BgJyaBigmirror* this, GlobalContext* globalCtx); -void BgJyaBigmirror_Update(BgJyaBigmirror* this, GlobalContext* globalCtx); -void BgJyaBigmirror_Draw(BgJyaBigmirror* this, GlobalContext* globalCtx); +#define THIS ((BgJyaBigmirror*)thisx) + +void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBigmirror_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBigmirror_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Bigmirror_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index d80b9d49e1..6abf8fe6d4 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgJyaBlock_Init(BgJyaBlock* this, GlobalContext* globalCtx); -void BgJyaBlock_Destroy(BgJyaBlock* this, GlobalContext* globalCtx); -void BgJyaBlock_Update(BgJyaBlock* this, GlobalContext* globalCtx); -void BgJyaBlock_Draw(BgJyaBlock* this, GlobalContext* globalCtx); +#define THIS ((BgJyaBlock*)thisx) + +void BgJyaBlock_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBlock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBlock_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBlock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Block_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index b7deadc354..65450ec90a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000001 -void BgJyaBombchuiwa_Init(BgJyaBombchuiwa* this, GlobalContext* globalCtx); -void BgJyaBombchuiwa_Destroy(BgJyaBombchuiwa* this, GlobalContext* globalCtx); -void BgJyaBombchuiwa_Update(BgJyaBombchuiwa* this, GlobalContext* globalCtx); -void BgJyaBombchuiwa_Draw(BgJyaBombchuiwa* this, GlobalContext* globalCtx); +#define THIS ((BgJyaBombchuiwa*)thisx) + +void BgJyaBombchuiwa_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBombchuiwa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBombchuiwa_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBombchuiwa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Bombchuiwa_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 25929e7888..eb9fe9ae24 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgJyaBombiwa_Init(BgJyaBombiwa* this, GlobalContext* globalCtx); -void BgJyaBombiwa_Destroy(BgJyaBombiwa* this, GlobalContext* globalCtx); -void BgJyaBombiwa_Update(BgJyaBombiwa* this, GlobalContext* globalCtx); -void BgJyaBombiwa_Draw(BgJyaBombiwa* this, GlobalContext* globalCtx); +#define THIS ((BgJyaBombiwa*)thisx) + +void BgJyaBombiwa_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Bombiwa_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index c38e5cbebd..75872c5582 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgJyaCobra_Init(BgJyaCobra* this, GlobalContext* globalCtx); -void BgJyaCobra_Destroy(BgJyaCobra* this, GlobalContext* globalCtx); -void BgJyaCobra_Update(BgJyaCobra* this, GlobalContext* globalCtx); -void BgJyaCobra_Draw(BgJyaCobra* this, GlobalContext* globalCtx); +#define THIS ((BgJyaCobra*)thisx) + +void BgJyaCobra_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaCobra_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaCobra_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaCobra_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Cobra_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c index 05e16263ec..f4846124f6 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgJyaGoroiwa_Init(BgJyaGoroiwa* this, GlobalContext* globalCtx); -void BgJyaGoroiwa_Destroy(BgJyaGoroiwa* this, GlobalContext* globalCtx); -void BgJyaGoroiwa_Update(BgJyaGoroiwa* this, GlobalContext* globalCtx); -void BgJyaGoroiwa_Draw(BgJyaGoroiwa* this, GlobalContext* globalCtx); +#define THIS ((BgJyaGoroiwa*)thisx) + +void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaGoroiwa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaGoroiwa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Goroiwa_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c index d64ab25c2d..d62746d451 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c +++ b/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgJyaHaheniron_Init(BgJyaHaheniron* this, GlobalContext* globalCtx); -void BgJyaHaheniron_Destroy(BgJyaHaheniron* this, GlobalContext* globalCtx); -void BgJyaHaheniron_Update(BgJyaHaheniron* this, GlobalContext* globalCtx); -void BgJyaHaheniron_Draw(BgJyaHaheniron* this, GlobalContext* globalCtx); +#define THIS ((BgJyaHaheniron*)thisx) + +void BgJyaHaheniron_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaHaheniron_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaHaheniron_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaHaheniron_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Haheniron_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index a8d88951df..a092d19fc6 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgJyaIronobj_Init(BgJyaIronobj* this, GlobalContext* globalCtx); -void BgJyaIronobj_Destroy(BgJyaIronobj* this, GlobalContext* globalCtx); -void BgJyaIronobj_Update(BgJyaIronobj* this, GlobalContext* globalCtx); -void BgJyaIronobj_Draw(BgJyaIronobj* this, GlobalContext* globalCtx); +#define THIS ((BgJyaIronobj*)thisx) + +void BgJyaIronobj_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaIronobj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaIronobj_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaIronobj_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Ironobj_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index 35c76cdb32..5f46723e87 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgJyaKanaami_Init(BgJyaKanaami* this, GlobalContext* globalCtx); -void BgJyaKanaami_Destroy(BgJyaKanaami* this, GlobalContext* globalCtx); -void BgJyaKanaami_Update(BgJyaKanaami* this, GlobalContext* globalCtx); -void BgJyaKanaami_Draw(BgJyaKanaami* this, GlobalContext* globalCtx); +#define THIS ((BgJyaKanaami*)thisx) + +void BgJyaKanaami_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaKanaami_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80899880(BgJyaKanaami* this); void func_80899894(BgJyaKanaami* this, GlobalContext* globalCtx); @@ -55,7 +57,9 @@ void func_80899740(BgJyaKanaami* this, GlobalContext* globalCtx, u32 collision, } } -void BgJyaKanaami_Init(BgJyaKanaami* this, GlobalContext* globalCtx) { +void BgJyaKanaami_Init(Actor* thisx, GlobalContext* globalCtx) { + BgJyaKanaami* this = THIS; + func_80899740(this, globalCtx, &D_0600F208, 0); Actor_ProcessInitChain(&this->actor, initChain); if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { @@ -66,7 +70,9 @@ void BgJyaKanaami_Init(BgJyaKanaami* this, GlobalContext* globalCtx) { osSyncPrintf("(jya 金網)(arg_data 0x%04x)\n", this->actor.params); } -void BgJyaKanaami_Destroy(BgJyaKanaami* this, GlobalContext* globalCtx) { +void BgJyaKanaami_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgJyaKanaami* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } @@ -111,13 +117,15 @@ void func_80899A08(BgJyaKanaami* this) { this->actor.posRot.rot.x = 0x4000; } -void BgJyaKanaami_Update(BgJyaKanaami* this, GlobalContext* globalCtx) { +void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) { + BgJyaKanaami* this = THIS; + if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); } this->actor.shape.rot.x = this->actor.posRot.rot.x; } -void BgJyaKanaami_Draw(BgJyaKanaami* this, GlobalContext* globalCtx) { +void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_0600F000); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 03d2699dff..205069491b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgJyaLift_Init(BgJyaLift* this, GlobalContext* globalCtx); -void BgJyaLift_Destroy(BgJyaLift* this, GlobalContext* globalCtx); -void BgJyaLift_Update(BgJyaLift* this, GlobalContext* globalCtx); -void BgJyaLift_Draw(BgJyaLift* this, GlobalContext* globalCtx); +#define THIS ((BgJyaLift*)thisx) + +void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaLift_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaLift_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Lift_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 9f516a216b..1cdd8d362f 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgJyaMegami_Init(BgJyaMegami* this, GlobalContext* globalCtx); -void BgJyaMegami_Destroy(BgJyaMegami* this, GlobalContext* globalCtx); -void BgJyaMegami_Update(BgJyaMegami* this, GlobalContext* globalCtx); -void BgJyaMegami_Draw(BgJyaMegami* this, GlobalContext* globalCtx); +#define THIS ((BgJyaMegami*)thisx) + +void BgJyaMegami_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaMegami_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaMegami_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaMegami_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Megami_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 30c03326e8..295c2a86fa 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgJyaZurerukabe_Init(BgJyaZurerukabe* this, GlobalContext* globalCtx); -void BgJyaZurerukabe_Destroy(BgJyaZurerukabe* this, GlobalContext* globalCtx); -void BgJyaZurerukabe_Update(BgJyaZurerukabe* this, GlobalContext* globalCtx); -void BgJyaZurerukabe_Draw(BgJyaZurerukabe* this, GlobalContext* globalCtx); +#define THIS ((BgJyaZurerukabe*)thisx) + +void BgJyaZurerukabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgJyaZurerukabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgJyaZurerukabe_Update(Actor* thisx, GlobalContext* globalCtx); +void BgJyaZurerukabe_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Jya_Zurerukabe_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 88766063df..0846ed149c 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000020 -void BgMenkuriEye_Init(BgMenkuriEye* this, GlobalContext* globalCtx); -void BgMenkuriEye_Destroy(BgMenkuriEye* this, GlobalContext* globalCtx); -void BgMenkuriEye_Update(BgMenkuriEye* this, GlobalContext* globalCtx); -void BgMenkuriEye_Draw(BgMenkuriEye* this, GlobalContext* globalCtx); +#define THIS ((BgMenkuriEye*)thisx) + +void BgMenkuriEye_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriEye_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Menkuri_Eye_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c index aa784a5355..1438092855 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.c @@ -6,15 +6,14 @@ #include "z_bg_menkuri_kaiten.h" -extern u32 D_060038D0; -extern u32 D_060042D8; - #define FLAGS 0x00000030 -void BgMenkuriKaiten_Init(BgMenkuriKaiten* this, GlobalContext* globalCtx); -void BgMenkuriKaiten_Destroy(BgMenkuriKaiten* this, GlobalContext* globalCtx); -void BgMenkuriKaiten_Update(BgMenkuriKaiten* this, GlobalContext* globalCtx); -void BgMenkuriKaiten_Draw(BgMenkuriKaiten* this, GlobalContext* globalCtx); +#define THIS ((BgMenkuriKaiten*)thisx) + +void BgMenkuriKaiten_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriKaiten_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriKaiten_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Kaiten_InitVars = { ACTOR_BG_MENKURI_KAITEN, @@ -32,8 +31,12 @@ static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -void BgMenkuriKaiten_Init(BgMenkuriKaiten* this, GlobalContext* globalCtx) { - s32 pad[2]; +extern u32 D_060038D0; +extern u32 D_060042D8; + +void BgMenkuriKaiten_Init(Actor* thisx, GlobalContext* globalCtx) { + BgMenkuriKaiten* this = THIS; + s32 pad; u32 local_c = 0; Actor_ProcessInitChain(&this->actor, initChain); @@ -42,17 +45,21 @@ void BgMenkuriKaiten_Init(BgMenkuriKaiten* this, GlobalContext* globalCtx) { this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c); } -void BgMenkuriKaiten_Destroy(BgMenkuriKaiten* this, GlobalContext* globalCtx) { +void BgMenkuriKaiten_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgMenkuriKaiten* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -void BgMenkuriKaiten_Update(BgMenkuriKaiten* this, GlobalContext* globalCtx) { +void BgMenkuriKaiten_Update(Actor* thisx, GlobalContext* globalCtx) { + BgMenkuriKaiten* this = THIS; + if (!Flags_GetSwitch(globalCtx, this->actor.params) && func_80043590(&this->actor)) { func_8002F974(&this->actor, 0x2024); this->actor.shape.rot.y += 0x80; } } -void BgMenkuriKaiten_Draw(BgMenkuriKaiten* this, GlobalContext* globalCtx) { +void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_060038D0); } diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index fc3b2b1e45..e61c58ee36 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgMenkuriNisekabe_Init(BgMenkuriNisekabe* this, GlobalContext* globalCtx); -void BgMenkuriNisekabe_Destroy(BgMenkuriNisekabe* this, GlobalContext* globalCtx); -void BgMenkuriNisekabe_Update(BgMenkuriNisekabe* this, GlobalContext* globalCtx); -void BgMenkuriNisekabe_Draw(BgMenkuriNisekabe* this, GlobalContext* globalCtx); +#define THIS ((BgMenkuriNisekabe*)thisx) + +void BgMenkuriNisekabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriNisekabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriNisekabe_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMenkuriNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Nisekabe_InitVars = { ACTOR_BG_MENKURI_NISEKABE, @@ -27,14 +29,18 @@ const ActorInit Bg_Menkuri_Nisekabe_InitVars = { static u32 segmentAddr[] = { 0x06002280, 0x06002BC0 }; -void BgMenkuriNisekabe_Init(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { +void BgMenkuriNisekabe_Init(Actor* thisx, GlobalContext* globalCtx) { + BgMenkuriNisekabe* this = THIS; + Actor_SetScale(&this->actor, 0.1f); } -void BgMenkuriNisekabe_Destroy(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { +void BgMenkuriNisekabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void BgMenkuriNisekabe_Update(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { +void BgMenkuriNisekabe_Update(Actor* thisx, GlobalContext* globalCtx) { + BgMenkuriNisekabe* this = THIS; + if (globalCtx->actorCtx.unk_03 != 0) { this->actor.flags |= 0x80; } else { @@ -42,7 +48,8 @@ void BgMenkuriNisekabe_Update(BgMenkuriNisekabe* this, GlobalContext* globalCtx) } } -void BgMenkuriNisekabe_Draw(BgMenkuriNisekabe* this, GlobalContext* globalCtx) { +void BgMenkuriNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgMenkuriNisekabe* this = THIS; u32 index = this->actor.params & 0xFF; if ((this->actor.flags & 0x80) == 0x80) { diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index d2cb40f96c..7028abdae5 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgMizuBwall_Init(BgMizuBwall* this, GlobalContext* globalCtx); -void BgMizuBwall_Destroy(BgMizuBwall* this, GlobalContext* globalCtx); -void BgMizuBwall_Update(BgMizuBwall* this, GlobalContext* globalCtx); -void BgMizuBwall_Draw(BgMizuBwall* this, GlobalContext* globalCtx); +#define THIS ((BgMizuBwall*)thisx) + +void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMizuBwall_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMizuBwall_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMizuBwall_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mizu_Bwall_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index 8b8671b13c..b52688f22f 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgMizuMovebg_Init(BgMizuMovebg* this, GlobalContext* globalCtx); -void BgMizuMovebg_Destroy(BgMizuMovebg* this, GlobalContext* globalCtx); -void BgMizuMovebg_Update(BgMizuMovebg* this, GlobalContext* globalCtx); -void BgMizuMovebg_Draw(BgMizuMovebg* this, GlobalContext* globalCtx); +#define THIS ((BgMizuMovebg*)thisx) + +void BgMizuMovebg_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMizuMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMizuMovebg_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMizuMovebg_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mizu_Movebg_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index 294bdee593..ad62335052 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgMizuShutter_Init(BgMizuShutter* this, GlobalContext* globalCtx); -void BgMizuShutter_Destroy(BgMizuShutter* this, GlobalContext* globalCtx); -void BgMizuShutter_Update(BgMizuShutter* this, GlobalContext* globalCtx); -void BgMizuShutter_Draw(BgMizuShutter* this, GlobalContext* globalCtx); +#define THIS ((BgMizuShutter*)thisx) + +void BgMizuShutter_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMizuShutter_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMizuShutter_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMizuShutter_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mizu_Shutter_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index a658542dd1..1b7ea15d34 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgMizuUzu_Init(BgMizuUzu* this, GlobalContext* globalCtx); -void BgMizuUzu_Destroy(BgMizuUzu* this, GlobalContext* globalCtx); -void BgMizuUzu_Update(BgMizuUzu* this, GlobalContext* globalCtx); -void BgMizuUzu_Draw(BgMizuUzu* this, GlobalContext* globalCtx); +#define THIS ((BgMizuUzu*)thisx) + +void BgMizuUzu_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMizuUzu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMizuUzu_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMizuUzu_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Mizu_Uzu_InitVars = { ACTOR_BG_MIZU_UZU, @@ -35,10 +37,12 @@ extern u32 D_060074EC; void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx); -void BgMizuUzu_Init(BgMizuUzu* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgMizuUzu_Init(Actor* thisx, GlobalContext* globalCtx) { + BgMizuUzu* this = THIS; + s32 pad; s32 local_c = 0; - Actor* thisx = &this->dyna.actor; + s32 pad2; + Actor_ProcessInitChain(thisx, initChain); DynaPolyInfo_SetActorMove(thisx, 0); DynaPolyInfo_Alloc(&D_060074EC, &local_c); @@ -46,12 +50,15 @@ void BgMizuUzu_Init(BgMizuUzu* this, GlobalContext* globalCtx) { this->actionFunc = func_8089F788; } -void BgMizuUzu_Destroy(BgMizuUzu* this, GlobalContext* globalCtx) { +void BgMizuUzu_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgMizuUzu* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; + if (PLAYER->currentBoots == 1) { func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } else { @@ -61,9 +68,11 @@ void func_8089F788(BgMizuUzu* this, GlobalContext* globalCtx) { thisx->shape.rot.y += 0x1C0; } -void BgMizuUzu_Update(BgMizuUzu* this, GlobalContext* globalCtx) { +void BgMizuUzu_Update(Actor* thisx, GlobalContext* globalCtx) { + BgMizuUzu* this = THIS; + this->actionFunc(this, globalCtx); } -void BgMizuUzu_Draw(BgMizuUzu* this, GlobalContext* globalCtx) { +void BgMizuUzu_Draw(Actor* thisx, GlobalContext* globalCtx) { } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 4920f5f9dc..d61f00c3df 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void BgMizuWater_Init(BgMizuWater* this, GlobalContext* globalCtx); -void BgMizuWater_Destroy(BgMizuWater* this, GlobalContext* globalCtx); -void BgMizuWater_Update(BgMizuWater* this, GlobalContext* globalCtx); -void BgMizuWater_Draw(BgMizuWater* this, GlobalContext* globalCtx); +#define THIS ((BgMizuWater*)thisx) + +void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMizuWater_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMizuWater_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMizuWater_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mizu_Water_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c index e31cec6d6f..20c7634217 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -8,13 +8,16 @@ #define FLAGS 0x00000010 +#define THIS ((BgMjin*)thisx) + +void BgMjin_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMjin_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMjin_Update(Actor* thisx, GlobalContext* globalCtx); +void BgMjin_Draw(Actor* thisx, GlobalContext* globalCtx); + void BgMjin_SetupAction(BgMjin* this, ActorFunc actionFunc); -void BgMjin_Init(BgMjin* this, GlobalContext* globalCtx); -void BgMjin_Destroy(BgMjin* this, GlobalContext* globalCtx); void func_808A0850(BgMjin* this, GlobalContext* globalCtx); void func_808A0920(BgMjin* this, GlobalContext* globalCtx); -void BgMjin_Update(BgMjin* this, GlobalContext* globalCtx); -void BgMjin_Draw(BgMjin* this, GlobalContext* globalCtx); const ActorInit Bg_Mjin_InitVars = { ACTOR_BG_MJIN, @@ -47,8 +50,8 @@ void BgMjin_SetupAction(BgMjin* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void BgMjin_Init(BgMjin* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgMjin_Init(Actor* thisx, GlobalContext* globalCtx) { + BgMjin* this = THIS; s8 objBankIndex; Actor_ProcessInitChain(thisx, initChain); @@ -61,7 +64,9 @@ void BgMjin_Init(BgMjin* this, GlobalContext* globalCtx) { } } -void BgMjin_Destroy(BgMjin* this, GlobalContext* globalCtx) { +void BgMjin_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgMjin* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -80,27 +85,29 @@ void func_808A0850(BgMjin* this, GlobalContext* globalCtx) { this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, local_c); BgMjin_SetupAction(this, &func_808A0920); - this->dyna.actor.draw = &BgMjin_Draw; + this->dyna.actor.draw = BgMjin_Draw; } } void func_808A0920(BgMjin* this, GlobalContext* globalCtx) { } -void BgMjin_Update(BgMjin* this, GlobalContext* globalCtx) { +void BgMjin_Update(Actor* thisx, GlobalContext* globalCtx) { + BgMjin* this = THIS; + this->actionFunc(this, globalCtx); } -void BgMjin_Draw(BgMjin* this, GlobalContext* globalCtx) { - s32 objBankIndex; +void BgMjin_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgMjin* this = THIS; u32 dlist; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; - s32 pad; + s32 objBankIndex; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_mjin.c", 250); - if (this->dyna.actor.params != 0) { - objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[this->dyna.actor.params - 1]); + if (thisx->params != 0) { + objBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectTbl[thisx->params - 1]); if (objBankIndex >= 0) { gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[objBankIndex].segment); } diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 33282f4419..a769f40107 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000010 -void BgMoriBigst_Init(BgMoriBigst* this, GlobalContext* globalCtx); -void BgMoriBigst_Destroy(BgMoriBigst* this, GlobalContext* globalCtx); -void BgMoriBigst_Update(BgMoriBigst* this, GlobalContext* globalCtx); +#define THIS ((BgMoriBigst*)thisx) + +void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriBigst_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriBigst_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Bigst_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 1e56aa0968..4803501e81 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000010 -void BgMoriElevator_Init(BgMoriElevator* this, GlobalContext* globalCtx); -void BgMoriElevator_Destroy(BgMoriElevator* this, GlobalContext* globalCtx); -void BgMoriElevator_Update(BgMoriElevator* this, GlobalContext* globalCtx); +#define THIS ((BgMoriElevator*)thisx) + +void BgMoriElevator_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriElevator_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriElevator_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Elevator_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index ac4fa17732..699edc3400 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000000 -void BgMoriHashigo_Init(BgMoriHashigo* this, GlobalContext* globalCtx); -void BgMoriHashigo_Destroy(BgMoriHashigo* this, GlobalContext* globalCtx); -void BgMoriHashigo_Update(BgMoriHashigo* this, GlobalContext* globalCtx); +#define THIS ((BgMoriHashigo*)thisx) + +void BgMoriHashigo_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriHashigo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriHashigo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Hashigo_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index 8be46e9aac..ffd20f6ea7 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000010 -void BgMoriHashira4_Init(BgMoriHashira4* this, GlobalContext* globalCtx); -void BgMoriHashira4_Destroy(BgMoriHashira4* this, GlobalContext* globalCtx); -void BgMoriHashira4_Update(BgMoriHashira4* this, GlobalContext* globalCtx); +#define THIS ((BgMoriHashira4*)thisx) + +void BgMoriHashira4_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriHashira4_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriHashira4_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Hashira4_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 5adfe957b0..d53d16ff33 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000030 -void BgMoriHineri_Init(BgMoriHineri* this, GlobalContext* globalCtx); -void BgMoriHineri_Destroy(BgMoriHineri* this, GlobalContext* globalCtx); -void BgMoriHineri_Update(BgMoriHineri* this, GlobalContext* globalCtx); +#define THIS ((BgMoriHineri*)thisx) + +void BgMoriHineri_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriHineri_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriHineri_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Hineri_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index 56751d793b..f9899fa54f 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000030 -void BgMoriIdomizu_Init(BgMoriIdomizu* this, GlobalContext* globalCtx); -void BgMoriIdomizu_Destroy(BgMoriIdomizu* this, GlobalContext* globalCtx); -void BgMoriIdomizu_Update(BgMoriIdomizu* this, GlobalContext* globalCtx); +#define THIS ((BgMoriIdomizu*)thisx) + +void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriIdomizu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriIdomizu_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Idomizu_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index c01deefd3c..aecad983b9 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000000 -void BgMoriKaitenkabe_Init(BgMoriKaitenkabe* this, GlobalContext* globalCtx); -void BgMoriKaitenkabe_Destroy(BgMoriKaitenkabe* this, GlobalContext* globalCtx); -void BgMoriKaitenkabe_Update(BgMoriKaitenkabe* this, GlobalContext* globalCtx); +#define THIS ((BgMoriKaitenkabe*)thisx) + +void BgMoriKaitenkabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriKaitenkabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriKaitenkabe_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Kaitenkabe_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 962049ec6e..6cbfe95327 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000030 -void BgMoriRakkatenjo_Init(BgMoriRakkatenjo* this, GlobalContext* globalCtx); -void BgMoriRakkatenjo_Destroy(BgMoriRakkatenjo* this, GlobalContext* globalCtx); -void BgMoriRakkatenjo_Update(BgMoriRakkatenjo* this, GlobalContext* globalCtx); +#define THIS ((BgMoriRakkatenjo*)thisx) + +void BgMoriRakkatenjo_Init(Actor* thisx, GlobalContext* globalCtx); +void BgMoriRakkatenjo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgMoriRakkatenjo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mori_Rakkatenjo_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index b10bb5d67a..fddcb8b5f0 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgPoEvent_Init(BgPoEvent* this, GlobalContext* globalCtx); -void BgPoEvent_Destroy(BgPoEvent* this, GlobalContext* globalCtx); -void BgPoEvent_Update(BgPoEvent* this, GlobalContext* globalCtx); -void BgPoEvent_Draw(BgPoEvent* this, GlobalContext* globalCtx); +#define THIS ((BgPoEvent*)thisx) + +void BgPoEvent_Init(Actor* thisx, GlobalContext* globalCtx); +void BgPoEvent_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgPoEvent_Update(Actor* thisx, GlobalContext* globalCtx); +void BgPoEvent_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Po_Event_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index a468e112c3..83bdf7d54d 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgPoSyokudai_Init(BgPoSyokudai* this, GlobalContext* globalCtx); -void BgPoSyokudai_Destroy(BgPoSyokudai* this, GlobalContext* globalCtx); -void BgPoSyokudai_Update(BgPoSyokudai* this, GlobalContext* globalCtx); -void BgPoSyokudai_Draw(BgPoSyokudai* this, GlobalContext* globalCtx); +#define THIS ((BgPoSyokudai*)thisx) + +void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx); +void BgPoSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgPoSyokudai_Update(Actor* thisx, GlobalContext* globalCtx); +void BgPoSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Po_Syokudai_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index 612eca636a..46b5f89843 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -8,12 +8,15 @@ #define FLAGS 0x00000000 +#define THIS ((BgPushbox*)thisx) + +void BgPushbox_Init(Actor* thisx, GlobalContext* globalCtx); +void BgPushbox_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgPushbox_Update(Actor* thisx, GlobalContext* globalCtx); +void BgPushbox_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_808A8AE0(BgPushbox* this, ActorFunc actionFunc); -void BgPushbox_Init(BgPushbox* this, GlobalContext* globalCtx); -void BgPushbox_Destroy(BgPushbox* this, GlobalContext* globalCtx); void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx); -void BgPushbox_Update(BgPushbox* this, GlobalContext* globalCtx); -void BgPushbox_Draw(BgPushbox* this, GlobalContext* globalCtx); const ActorInit Bg_Pushbox_InitVars = { ACTOR_BG_PUSHBOX, @@ -38,10 +41,11 @@ void func_808A8AE0(BgPushbox* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void BgPushbox_Init(BgPushbox* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgPushbox_Init(Actor* thisx, GlobalContext* globalCtx) { + BgPushbox* this = THIS; + s32 pad; u32 local_c = 0; - Actor* thisx = &this->dyna.actor; + s32 pad2; Actor_ProcessInitChain(thisx, initChain); DynaPolyInfo_SetActorMove(&this->dyna, 0); @@ -51,7 +55,9 @@ void BgPushbox_Init(BgPushbox* this, GlobalContext* globalCtx) { func_808A8AE0(this, &func_808A8BAC); } -void BgPushbox_Destroy(BgPushbox* this, GlobalContext* globalCtx) { +void BgPushbox_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgPushbox* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -66,12 +72,14 @@ void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx) { func_8002E4B4(globalCtx, thisx, 20.0f, 40.0f, 40.0f, 0x1D); } -void BgPushbox_Update(BgPushbox* this, GlobalContext* globalCtx) { +void BgPushbox_Update(Actor* thisx, GlobalContext* globalCtx) { + BgPushbox* this = THIS; + this->actionFunc(this, globalCtx); func_8002DF90(this); } -void BgPushbox_Draw(BgPushbox* this, GlobalContext* globalCtx) { +void BgPushbox_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 3adf87ff98..18d746d505 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgRelayObjects_Init(BgRelayObjects* this, GlobalContext* globalCtx); -void BgRelayObjects_Destroy(BgRelayObjects* this, GlobalContext* globalCtx); -void BgRelayObjects_Update(BgRelayObjects* this, GlobalContext* globalCtx); -void BgRelayObjects_Draw(BgRelayObjects* this, GlobalContext* globalCtx); +#define THIS ((BgRelayObjects*)thisx) + +void BgRelayObjects_Init(Actor* thisx, GlobalContext* globalCtx); +void BgRelayObjects_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgRelayObjects_Update(Actor* thisx, GlobalContext* globalCtx); +void BgRelayObjects_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Relay_Objects_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c index fdf14b45c9..1568a2263e 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgSpot00Break_Init(BgSpot00Break* this, GlobalContext* globalCtx); -void BgSpot00Break_Destroy(BgSpot00Break* this, GlobalContext* globalCtx); -void BgSpot00Break_Update(BgSpot00Break* this, GlobalContext* globalCtx); -void BgSpot00Break_Draw(BgSpot00Break* this, GlobalContext* globalCtx); +#define THIS ((BgSpot00Break*)thisx) + +void BgSpot00Break_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot00Break_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot00Break_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot00Break_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot00_Break_InitVars = { ACTOR_BG_SPOT00_BREAK, @@ -37,8 +39,9 @@ extern D_06000908; // segmented address: 0x06000908 extern D_06000980; // segmented address: 0x06000980 extern D_06000440; // segmented address: 0x06000440 -void BgSpot00Break_Init(BgSpot00Break* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgSpot00Break_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot00Break* this = THIS; + s32 pad; u32 local_c = 0; Actor_ProcessInitChain(&this->actor, initChain); @@ -57,14 +60,18 @@ void BgSpot00Break_Init(BgSpot00Break* this, GlobalContext* globalCtx) { } } -void BgSpot00Break_Destroy(BgSpot00Break* this, GlobalContext* globalCtx) { +void BgSpot00Break_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot00Break* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -void BgSpot00Break_Update(BgSpot00Break* this, GlobalContext* globalCtx) { +void BgSpot00Break_Update(Actor* thisx, GlobalContext* globalCtx) { } -void BgSpot00Break_Draw(BgSpot00Break* this, GlobalContext* globalCtx) { +void BgSpot00Break_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgSpot00Break* this = THIS; + if (this->actor.params == 1) { Gfx_DrawDListOpa(globalCtx, &D_06000980); } else { diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 0c134320a5..cbb58b97fe 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgSpot00Hanebasi_Init(BgSpot00Hanebasi* this, GlobalContext* globalCtx); -void BgSpot00Hanebasi_Destroy(BgSpot00Hanebasi* this, GlobalContext* globalCtx); -void BgSpot00Hanebasi_Update(BgSpot00Hanebasi* this, GlobalContext* globalCtx); -void BgSpot00Hanebasi_Draw(BgSpot00Hanebasi* this, GlobalContext* globalCtx); +#define THIS ((BgSpot00Hanebasi*)thisx) + +void BgSpot00Hanebasi_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot00Hanebasi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot00Hanebasi_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot00_Hanebasi_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c index 13537b6da7..3415cadf77 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgSpot01Fusya_Init(BgSpot01Fusya* this, GlobalContext* globalCtx); -void BgSpot01Fusya_Destroy(BgSpot01Fusya* this, GlobalContext* globalCtx); -void BgSpot01Fusya_Update(BgSpot01Fusya* this, GlobalContext* globalCtx); -void BgSpot01Fusya_Draw(BgSpot01Fusya* this, GlobalContext* globalCtx); +#define THIS ((BgSpot01Fusya*)thisx) + +void BgSpot01Fusya_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Fusya_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Fusya_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Fusya_Draw(Actor* thisx, GlobalContext* globalCtx); void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx); @@ -40,7 +42,9 @@ void BgSpot01Fusya_SetupAction(BgSpot01Fusya* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void BgSpot01Fusya_Init(BgSpot01Fusya* this, GlobalContext* globalCtx) { +void BgSpot01Fusya_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot01Fusya* this = THIS; + Actor_ProcessInitChain(&this->actor, initChain); this->unk_154 = 100.0f; this->unk_158 = 100.0f; @@ -51,12 +55,13 @@ void BgSpot01Fusya_Init(BgSpot01Fusya* this, GlobalContext* globalCtx) { BgSpot01Fusya_SetupAction(this, func_808AAA50); } -void BgSpot01Fusya_Destroy(BgSpot01Fusya* this, GlobalContext* globalCtx) { +void BgSpot01Fusya_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx) { f32 temp; Actor* thisx = &this->actor; + if (gSaveContext.eventChkInf[6] & 0x20) { this->unk_158 = 1800.0f; } @@ -66,11 +71,13 @@ void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx) { Math_SmoothScaleMaxF(&this->unk_154, this->unk_158, this->unk_15C, 100.0f); } -void BgSpot01Fusya_Update(BgSpot01Fusya* this, GlobalContext* globalCtx) { +void BgSpot01Fusya_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot01Fusya* this = THIS; + this->actionFunc(this, globalCtx); } -void BgSpot01Fusya_Draw(BgSpot01Fusya* this, GlobalContext* globalCtx) { +void BgSpot01Fusya_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 695d55d396..1414b3dbb7 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgSpot01Idohashira_Init(BgSpot01Idohashira* this, GlobalContext* globalCtx); -void BgSpot01Idohashira_Destroy(BgSpot01Idohashira* this, GlobalContext* globalCtx); -void BgSpot01Idohashira_Update(BgSpot01Idohashira* this, GlobalContext* globalCtx); -void BgSpot01Idohashira_Draw(BgSpot01Idohashira* this, GlobalContext* globalCtx); +#define THIS ((BgSpot01Idohashira*)thisx) + +void BgSpot01Idohashira_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idohashira_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idohashira_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idohashira_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot01_Idohashira_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c index cafd921ca6..b7e34e1be1 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000020 -void BgSpot01Idomizu_Init(BgSpot01Idomizu* this, GlobalContext* globalCtx); -void BgSpot01Idomizu_Destroy(BgSpot01Idomizu* this, GlobalContext* globalCtx); -void BgSpot01Idomizu_Update(BgSpot01Idomizu* this, GlobalContext* globalCtx); -void BgSpot01Idomizu_Draw(BgSpot01Idomizu* this, GlobalContext* globalCtx); +#define THIS ((BgSpot01Idomizu*)thisx) + +void BgSpot01Idomizu_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idomizu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idomizu_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idomizu_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_808ABB84(BgSpot01Idomizu* this, GlobalContext* globalCtx); /* diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index 793241224b..85340b318c 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void BgSpot01Idosoko_Init(BgSpot01Idosoko* this, GlobalContext* globalCtx); -void BgSpot01Idosoko_Destroy(BgSpot01Idosoko* this, GlobalContext* globalCtx); -void BgSpot01Idosoko_Update(BgSpot01Idosoko* this, GlobalContext* globalCtx); -void BgSpot01Idosoko_Draw(BgSpot01Idosoko* this, GlobalContext* globalCtx); +#define THIS ((BgSpot01Idosoko*)thisx) + +void BgSpot01Idosoko_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idosoko_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idosoko_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Idosoko_Draw(Actor* thisx, GlobalContext* globalCtx); void func_808ABF54(BgSpot01Idosoko* this, GlobalContext* globalCtx); @@ -37,10 +39,12 @@ void BgSpot01Idosoko_SetupAction(BgSpot01Idosoko* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void BgSpot01Idosoko_Init(BgSpot01Idosoko* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgSpot01Idosoko_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot01Idosoko* this = THIS; + s32 pad; s32 local_c = 0; - Actor* thisx = &this->dyna.actor; + s32 pad2; + DynaPolyInfo_SetActorMove(thisx, 1); Actor_ProcessInitChain(thisx, initChain); DynaPolyInfo_Alloc(&D_06003C64, &local_c); @@ -52,20 +56,24 @@ void BgSpot01Idosoko_Init(BgSpot01Idosoko* this, GlobalContext* globalCtx) { } } -void BgSpot01Idosoko_Destroy(BgSpot01Idosoko* this, GlobalContext* globalCtx) { +void BgSpot01Idosoko_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot01Idosoko* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } void func_808ABF54(BgSpot01Idosoko* this, GlobalContext* globalCtx) { } -void BgSpot01Idosoko_Update(BgSpot01Idosoko* this, GlobalContext* globalCtx) { +void BgSpot01Idosoko_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot01Idosoko* this = THIS; + this->actionFunc(this, globalCtx); } extern u32 D_06003B20; -void BgSpot01Idosoko_Draw(BgSpot01Idosoko* this, GlobalContext* globalCtx) { +void BgSpot01Idosoko_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index 534f5ea5d7..d9dddc98a6 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -8,9 +8,12 @@ #define FLAGS 0x00000010 -void BgSpot01Objects2_Init(BgSpot01Objects2* this, GlobalContext* globalCtx); -void BgSpot01Objects2_Destroy(BgSpot01Objects2* this, GlobalContext* globalCtx); -void BgSpot01Objects2_Update(BgSpot01Objects2* this, GlobalContext* globalCtx); +#define THIS ((BgSpot01Objects2*)thisx) + +void BgSpot01Objects2_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Objects2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot01Objects2_Update(Actor* thisx, GlobalContext* globalCtx); + // func_808AC22C void func_808AC2BC(BgSpot01Objects2* this, GlobalContext* globalCtx); void func_808AC474(BgSpot01Objects2* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index 8d5b226a7a..ce9b4e0f01 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void BgSpot02Objects_Init(BgSpot02Objects* this, GlobalContext* globalCtx); -void BgSpot02Objects_Destroy(BgSpot02Objects* this, GlobalContext* globalCtx); -void BgSpot02Objects_Update(BgSpot02Objects* this, GlobalContext* globalCtx); -void BgSpot02Objects_Draw(BgSpot02Objects* this, GlobalContext* globalCtx); +#define THIS ((BgSpot02Objects*)thisx) + +void BgSpot02Objects_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot02Objects_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot02Objects_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot02Objects_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot02_Objects_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index 3fb3d32bd4..7c96ab7176 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void BgSpot03Taki_Init(BgSpot03Taki* this, GlobalContext* globalCtx); -void BgSpot03Taki_Destroy(BgSpot03Taki* this, GlobalContext* globalCtx); -void BgSpot03Taki_Update(BgSpot03Taki* this, GlobalContext* globalCtx); -void BgSpot03Taki_Draw(BgSpot03Taki* this, GlobalContext* globalCtx); +#define THIS ((BgSpot03Taki*)thisx) + +void BgSpot03Taki_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot03Taki_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot03Taki_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot03Taki_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot03_Taki_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index 8f273446b7..77f749eb5c 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgSpot05Soko_Init(BgSpot05Soko* this, GlobalContext* globalCtx); -void BgSpot05Soko_Destroy(BgSpot05Soko* this, GlobalContext* globalCtx); -void BgSpot05Soko_Update(BgSpot05Soko* this, GlobalContext* globalCtx); -void BgSpot05Soko_Draw(BgSpot05Soko* this, GlobalContext* globalCtx); +#define THIS ((BgSpot05Soko*)thisx) + +void BgSpot05Soko_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot05Soko_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot05Soko_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot05Soko_Draw(Actor* thisx, GlobalContext* globalCtx); void func_808AE5A8(BgSpot05Soko* this, GlobalContext* globalCtx); void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx); void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx); @@ -40,9 +42,8 @@ static Gfx* dListTbl[] = { 0x06001190, }; -void BgSpot05Soko_Init(BgSpot05Soko* this, GlobalContext* globalCtx) { - - Actor* thisx = &this->dyna.actor; +void BgSpot05Soko_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot05Soko* this = THIS; u32 pad1; u32 sp24; u32 pad2; @@ -71,7 +72,9 @@ void BgSpot05Soko_Init(BgSpot05Soko* this, GlobalContext* globalCtx) { this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, sp24); } -void BgSpot05Soko_Destroy(BgSpot05Soko* this, GlobalContext* globalCtx) { +void BgSpot05Soko_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot05Soko* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -98,10 +101,12 @@ void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx) { } } -void BgSpot05Soko_Update(BgSpot05Soko* this, GlobalContext* globalCtx) { +void BgSpot05Soko_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot05Soko* this = THIS; + this->actionFunc(this, globalCtx); } -void BgSpot05Soko_Draw(BgSpot05Soko* this, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, dListTbl[this->dyna.actor.params]); +void BgSpot05Soko_Draw(Actor* thisx, GlobalContext* globalCtx) { + Gfx_DrawDListOpa(globalCtx, dListTbl[thisx->params]); } diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 031d04be4e..51753bd5bc 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000200 -void BgSpot06Objects_Init(BgSpot06Objects* this, GlobalContext* globalCtx); -void BgSpot06Objects_Destroy(BgSpot06Objects* this, GlobalContext* globalCtx); -void BgSpot06Objects_Update(BgSpot06Objects* this, GlobalContext* globalCtx); -void BgSpot06Objects_Draw(BgSpot06Objects* this, GlobalContext* globalCtx); +#define THIS ((BgSpot06Objects*)thisx) + +void BgSpot06Objects_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot06Objects_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot06Objects_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot06Objects_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot06_Objects_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c index 56b41bb943..e5edce60f0 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void BgSpot07Taki_Init(BgSpot07Taki* this, GlobalContext* globalCtx); -void BgSpot07Taki_Destroy(BgSpot07Taki* this, GlobalContext* globalCtx); -void BgSpot07Taki_Update(BgSpot07Taki* this, GlobalContext* globalCtx); -void BgSpot07Taki_Draw(BgSpot07Taki* this, GlobalContext* globalCtx); +#define THIS ((BgSpot07Taki*)thisx) + +void BgSpot07Taki_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot07Taki_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot07Taki_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot07Taki_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot07_Taki_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index d7f33f0661..befa82623c 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -8,10 +8,12 @@ #define FLAGS 0x00400000 -void BgSpot08Bakudankabe_Init(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot08Bakudankabe_Destroy(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot08Bakudankabe_Update(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot08Bakudankabe_Draw(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); +#define THIS ((BgSpot08Bakudankabe*)thisx) + +void BgSpot08Bakudankabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot08Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot08Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot08_Bakudankabe_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index 5b5d06ff36..bbd133e5a4 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgSpot08Iceblock_Init(BgSpot08Iceblock* this, GlobalContext* globalCtx); -void BgSpot08Iceblock_Destroy(BgSpot08Iceblock* this, GlobalContext* globalCtx); -void BgSpot08Iceblock_Update(BgSpot08Iceblock* this, GlobalContext* globalCtx); -void BgSpot08Iceblock_Draw(BgSpot08Iceblock* this, GlobalContext* globalCtx); +#define THIS ((BgSpot08Iceblock*)thisx) + +void BgSpot08Iceblock_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot08Iceblock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot08Iceblock_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot08Iceblock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot08_Iceblock_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 4f37e4ebb0..5672e368ca 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgSpot09Obj_Init(BgSpot09Obj* this, GlobalContext* globalCtx); -void BgSpot09Obj_Destroy(BgSpot09Obj* this, GlobalContext* globalCtx); -void BgSpot09Obj_Update(BgSpot09Obj* this, GlobalContext* globalCtx); -void BgSpot09Obj_Draw(BgSpot09Obj* this, GlobalContext* globalCtx); +#define THIS ((BgSpot09Obj*)thisx) + +void BgSpot09Obj_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot09Obj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot09Obj_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot09Obj_Draw(Actor* thisx, GlobalContext* globalCtx); s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx); s32 func_808B1BA0(BgSpot09Obj* this, GlobalContext* globalCtx); @@ -83,6 +85,7 @@ s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) { s32 func_808B1BA0(BgSpot09Obj* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; + if (thisx->params == 3) { Actor_SetScale(thisx, 0.1f); } else { @@ -106,6 +109,7 @@ s32 func_808B1BEC(BgSpot09Obj* this, GlobalContext* globalCtx) { s32 func_808B1C70(BgSpot09Obj* this, GlobalContext* globalCtx) { s32 i; + for (i = 0; i < ARRAY_COUNT(D_808B1FA4); i++) { if (!D_808B1FA4[i](this, globalCtx)) { return 0; @@ -132,8 +136,8 @@ s32 func_808B1D44(BgSpot09Obj* this, GlobalContext* globalCtx) { } } -void BgSpot09Obj_Init(BgSpot09Obj* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgSpot09Obj_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot09Obj* this = THIS; osSyncPrintf("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", thisx->params, gSaveContext.eventChkInf[9] & 0xF); @@ -150,20 +154,20 @@ void BgSpot09Obj_Init(BgSpot09Obj* this, GlobalContext* globalCtx) { } } -void BgSpot09Obj_Destroy(BgSpot09Obj* this, GlobalContext* globalCtx) { +void BgSpot09Obj_Destroy(Actor* thisx, GlobalContext* globalCtx) { DynaCollisionContext* dynaColCtx = &globalCtx->colCtx.dyna; - Actor* thisx = &this->dyna.actor; + BgSpot09Obj* this = THIS; if (thisx->params != 0) { DynaPolyInfo_Free(globalCtx, dynaColCtx, this->dyna.dynaPolyId); } } -void BgSpot09Obj_Update(BgSpot09Obj* this, GlobalContext* globalCtx) { +void BgSpot09Obj_Update(Actor* thisx, GlobalContext* globalCtx) { } -void BgSpot09Obj_Draw(BgSpot09Obj* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgSpot09Obj_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgSpot09Obj* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[3]; diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index 424580534f..02ad575b3f 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void BgSpot11Bakudankabe_Init(BgSpot11Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot11Bakudankabe_Destroy(BgSpot11Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot11Bakudankabe_Update(BgSpot11Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot11Bakudankabe_Draw(BgSpot11Bakudankabe* this, GlobalContext* globalCtx); +#define THIS ((BgSpot11Bakudankabe*)thisx) + +void BgSpot11Bakudankabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot11Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot11Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot11Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot11_Bakudankabe_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index 6cf221ef99..48d2473bc6 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -2,8 +2,10 @@ #define FLAGS 0x00000010 -void BgSpot11Oasis_Init(BgSpot11Oasis* this, GlobalContext* globalCtx); -void BgSpot11Oasis_Update(BgSpot11Oasis* this, GlobalContext* globalCtx); +#define THIS ((BgSpot11Oasis*)thisx) + +void BgSpot11Oasis_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot11Oasis_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot11_Oasis_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index 35c36e624d..67cf1b797b 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgSpot12Gate_Init(BgSpot12Gate* this, GlobalContext* globalCtx); -void BgSpot12Gate_Destroy(BgSpot12Gate* this, GlobalContext* globalCtx); -void BgSpot12Gate_Update(BgSpot12Gate* this, GlobalContext* globalCtx); -void BgSpot12Gate_Draw(BgSpot12Gate* this, GlobalContext* globalCtx); +#define THIS ((BgSpot12Gate*)thisx) + +void BgSpot12Gate_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot12Gate_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot12Gate_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot12Gate_Draw(Actor* thisx, GlobalContext* globalCtx); void func_808B30C0(BgSpot12Gate* this); void func_808B30D8(BgSpot12Gate* this, GlobalContext* globalCtx); @@ -58,8 +60,8 @@ void func_808B2F90(BgSpot12Gate* this, GlobalContext* globalCtx, UNK_TYPE collis } } -void BgSpot12Gate_Init(BgSpot12Gate* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgSpot12Gate_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot12Gate* this = THIS; func_808B2F90(this, globalCtx, &D_060011EC, 0); Actor_ProcessInitChain(thisx, initChain); @@ -71,7 +73,9 @@ void BgSpot12Gate_Init(BgSpot12Gate* this, GlobalContext* globalCtx) { } } -void BgSpot12Gate_Destroy(BgSpot12Gate* this, GlobalContext* globalCtx) { +void BgSpot12Gate_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot12Gate* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -133,13 +137,15 @@ void func_808B3274(BgSpot12Gate* this) { void func_808B3298(BgSpot12Gate* this, GlobalContext* globalCtx) { } -void BgSpot12Gate_Update(BgSpot12Gate* this, GlobalContext* globalCtx) { +void BgSpot12Gate_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot12Gate* this = THIS; + if (this->unk_168 > 0) { this->unk_168 -= 1; } this->actionFunc(this, globalCtx); } -void BgSpot12Gate_Draw(BgSpot12Gate* this, GlobalContext* globalCtx) { +void BgSpot12Gate_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_06001080); } diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index ed35dabb26..158508d55b 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgSpot12Saku_Init(BgSpot12Saku* this, GlobalContext* globalCtx); -void BgSpot12Saku_Destroy(BgSpot12Saku* this, GlobalContext* globalCtx); -void BgSpot12Saku_Update(BgSpot12Saku* this, GlobalContext* globalCtx); -void BgSpot12Saku_Draw(BgSpot12Saku* this, GlobalContext* globalCtx); +#define THIS ((BgSpot12Saku*)thisx) + +void BgSpot12Saku_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot12Saku_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot12Saku_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot12Saku_Draw(Actor* thisx, GlobalContext* globalCtx); void func_808B3550(BgSpot12Saku* this); void func_808B357C(BgSpot12Saku* this, GlobalContext* globalCtx); @@ -56,8 +58,8 @@ void func_808B3420(BgSpot12Saku* this, GlobalContext* globalCtx, UNK_TYPE collis } } -void BgSpot12Saku_Init(BgSpot12Saku* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void BgSpot12Saku_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot12Saku* this = THIS; func_808B3420(this, globalCtx, &D_0600238C, 0); Actor_ProcessInitChain(thisx, initChain); @@ -68,7 +70,9 @@ void BgSpot12Saku_Init(BgSpot12Saku* this, GlobalContext* globalCtx) { } } -void BgSpot12Saku_Destroy(BgSpot12Saku* this, GlobalContext* globalCtx) { +void BgSpot12Saku_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot12Saku* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -125,13 +129,15 @@ void func_808B3714(BgSpot12Saku* this) { void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx) { } -void BgSpot12Saku_Update(BgSpot12Saku* this, GlobalContext* globalCtx) { +void BgSpot12Saku_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot12Saku* this = THIS; + if (this->unk_168 > 0) { this->unk_168 -= 1; } this->actionFunc(this, globalCtx); } -void BgSpot12Saku_Draw(BgSpot12Saku* this, GlobalContext* globalCtx) { +void BgSpot12Saku_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_06002260); } diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index f797bfc94c..5897ccfbc2 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgSpot15Rrbox_Init(BgSpot15Rrbox* this, GlobalContext* globalCtx); -void BgSpot15Rrbox_Destroy(BgSpot15Rrbox* this, GlobalContext* globalCtx); -void BgSpot15Rrbox_Update(BgSpot15Rrbox* this, GlobalContext* globalCtx); -void BgSpot15Rrbox_Draw(BgSpot15Rrbox* this, GlobalContext* globalCtx); +#define THIS ((BgSpot15Rrbox*)thisx) + +void BgSpot15Rrbox_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot15Rrbox_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot15Rrbox_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot15Rrbox_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot15_Rrbox_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index be2931ddf8..0fbce64bce 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx); -void BgSpot15Saku_Destroy(BgSpot15Saku* this, GlobalContext* globalCtx); -void BgSpot15Saku_Update(BgSpot15Saku* this, GlobalContext* globalCtx); -void BgSpot15Saku_Draw(BgSpot15Saku* this, GlobalContext* globalCtx); +#define THIS ((BgSpot15Saku*)thisx) + +void BgSpot15Saku_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot15Saku_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot15Saku_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot15Saku_Draw(Actor* thisx, GlobalContext* globalCtx); void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx); void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx); @@ -32,9 +34,9 @@ const ActorInit Bg_Spot15_Saku_InitVars = { extern u32 D_060003C0; extern u32 D_060004D0; -void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx) { +void BgSpot15Saku_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot15Saku* this = THIS; s32 pad[2]; - Actor* thisx = &this->dyna.actor; s32 local_c = 0; DynaPolyInfo_SetActorMove(thisx, 0); @@ -52,7 +54,9 @@ void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx) { this->actionFunc = func_808B4930; } -void BgSpot15Saku_Destroy(BgSpot15Saku* this, GlobalContext* globalCtx) { +void BgSpot15Saku_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot15Saku* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -83,12 +87,14 @@ void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx) { } } -void BgSpot15Saku_Update(BgSpot15Saku* this, GlobalContext* globalCtx) { +void BgSpot15Saku_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot15Saku* this = THIS; + DECR(this->unk_17C); this->actionFunc(this, globalCtx); } -void BgSpot15Saku_Draw(BgSpot15Saku* this, GlobalContext* globalCtx) { +void BgSpot15Saku_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 7a0504f7a8..0ad4fc413a 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgSpot16Bombstone_Init(BgSpot16Bombstone* this, GlobalContext* globalCtx); -void BgSpot16Bombstone_Destroy(BgSpot16Bombstone* this, GlobalContext* globalCtx); -void BgSpot16Bombstone_Update(BgSpot16Bombstone* this, GlobalContext* globalCtx); -void BgSpot16Bombstone_Draw(BgSpot16Bombstone* this, GlobalContext* globalCtx); +#define THIS ((BgSpot16Bombstone*)thisx) + +void BgSpot16Bombstone_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot16Bombstone_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot16Bombstone_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot16Bombstone_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot16_Bombstone_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index c4a2946dc4..773c6ceca8 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgSpot16Doughnut_Init(BgSpot16Doughnut* this, GlobalContext* globalCtx); -void BgSpot16Doughnut_Destroy(BgSpot16Doughnut* this, GlobalContext* globalCtx); -void BgSpot16Doughnut_Update(BgSpot16Doughnut* this, GlobalContext* globalCtx); -void BgSpot16Doughnut_Draw(BgSpot16Doughnut* this, GlobalContext* globalCtx); +#define THIS ((BgSpot16Doughnut*)thisx) + +void BgSpot16Doughnut_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot16Doughnut_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot16Doughnut_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot16Doughnut_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot16_Doughnut_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index 48961db5da..956e2d202b 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgSpot17Bakudankabe_Init(BgSpot17Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot17Bakudankabe_Destroy(BgSpot17Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot17Bakudankabe_Update(BgSpot17Bakudankabe* this, GlobalContext* globalCtx); -void BgSpot17Bakudankabe_Draw(BgSpot17Bakudankabe* this, GlobalContext* globalCtx); +#define THIS ((BgSpot17Bakudankabe*)thisx) + +void BgSpot17Bakudankabe_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot17Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot17Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot17Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot17_Bakudankabe_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c index 42b3f70c89..73cdef0dc9 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.c @@ -8,14 +8,13 @@ #define FLAGS 0x00000030 -void BgSpot17Funen_Init(BgSpot17Funen* this, GlobalContext* globalCtx); -void BgSpot17Funen_Destroy(BgSpot17Funen* this, GlobalContext* globalCtx); -void BgSpot17Funen_Update(BgSpot17Funen* this, GlobalContext* globalCtx); -void func_808B746C(BgSpot17Funen* this, GlobalContext* globalCtx); -void func_808B7478(BgSpot17Funen* this, GlobalContext* globalCtx); +#define THIS ((BgSpot17Funen*)thisx) -void func_808B7478(BgSpot17Funen* this, GlobalContext* globalCtx); -void func_808B746C(BgSpot17Funen* this, GlobalContext* globalCtx); +void BgSpot17Funen_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot17Funen_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot17Funen_Update(Actor* thisx, GlobalContext* globalCtx); +void func_808B746C(Actor* thisx, GlobalContext* globalCtx); +void func_808B7478(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot17_Funen_InitVars = { ACTOR_BG_SPOT17_FUNEN, @@ -35,32 +34,35 @@ static InitChainEntry initChain[] = { extern Gfx D_06000B40[]; -void BgSpot17Funen_Init(BgSpot17Funen* this, GlobalContext* globalCtx) { +void BgSpot17Funen_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot17Funen* this = THIS; + Actor_ProcessInitChain(&this->actor, initChain); osSyncPrintf("spot17 obj. 噴煙 (arg_data 0x%04x)\n", this->actor.params); } -void BgSpot17Funen_Destroy(BgSpot17Funen* this, GlobalContext* globalCtx) { +void BgSpot17Funen_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void BgSpot17Funen_Update(BgSpot17Funen* this, GlobalContext* globalCtx) { - this->actor.draw = (ActorFunc)func_808B7478; - this->actor.update = (ActorFunc)func_808B746C; +void BgSpot17Funen_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot17Funen* this = THIS; + + this->actor.draw = func_808B7478; + this->actor.update = func_808B746C; } -void func_808B746C(BgSpot17Funen* this, GlobalContext* globalCtx) { +void func_808B746C(Actor* thisx, GlobalContext* globalCtx) { } -void func_808B7478(BgSpot17Funen* this, GlobalContext* globalCtx) { +void func_808B7478(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot17_funen.c", 153); func_80093D84(globalCtx->state.gfxCtx); - Matrix_RotateY( - (s16)(func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) - this->actor.shape.rot.y + 0x8000) * - 9.58738019108e-05f, - MTXMODE_APPLY); + Matrix_RotateY((s16)(func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) - thisx->shape.rot.y + 0x8000) * + 9.58738019108e-05f, + MTXMODE_APPLY); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot17_funen.c", 161), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index af9b3f359e..95244b6333 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void BgSpot18Basket_Init(BgSpot18Basket* this, GlobalContext* globalCtx); -void BgSpot18Basket_Destroy(BgSpot18Basket* this, GlobalContext* globalCtx); -void BgSpot18Basket_Update(BgSpot18Basket* this, GlobalContext* globalCtx); -void BgSpot18Basket_Draw(BgSpot18Basket* this, GlobalContext* globalCtx); +#define THIS ((BgSpot18Basket*)thisx) + +void BgSpot18Basket_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Basket_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Basket_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Basket_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot18_Basket_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c index e94323fc12..1b138797c1 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgSpot18Futa_Init(BgSpot18Futa* this, GlobalContext* globalCtx); -void BgSpot18Futa_Destroy(BgSpot18Futa* this, GlobalContext* globalCtx); -void BgSpot18Futa_Update(BgSpot18Futa* this, GlobalContext* globalCtx); -void BgSpot18Futa_Draw(BgSpot18Futa* this, GlobalContext* globalCtx); +#define THIS ((BgSpot18Futa*)thisx) + +void BgSpot18Futa_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Futa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Futa_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Futa_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot18_Futa_InitVars = { ACTOR_BG_SPOT18_FUTA, @@ -35,8 +37,9 @@ static InitChainEntry initChain[] = { extern u32 DL_SPOT18_FUTA; // 0x6000368 extern u32 DL_SPOT18_FUTA2; // 0x6000150 -void BgSpot18Futa_Init(BgSpot18Futa* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgSpot18Futa_Init(Actor* thisx, GlobalContext* globalCtx) { + BgSpot18Futa* this = THIS; + s32 pad; u32 sp1C = 0; DynaPolyInfo_SetActorMove(&this->actor, 0); @@ -45,11 +48,14 @@ void BgSpot18Futa_Init(BgSpot18Futa* this, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, initChain); } -void BgSpot18Futa_Destroy(BgSpot18Futa* this, GlobalContext* globalCtx) { +void BgSpot18Futa_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgSpot18Futa* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -void BgSpot18Futa_Update(BgSpot18Futa* this, GlobalContext* globalCtx) { +void BgSpot18Futa_Update(Actor* thisx, GlobalContext* globalCtx) { + BgSpot18Futa* this = THIS; s32 iVar1; if (this->actor.attachedA == NULL) { @@ -64,6 +70,6 @@ void BgSpot18Futa_Update(BgSpot18Futa* this, GlobalContext* globalCtx) { } } -void BgSpot18Futa_Draw(BgSpot18Futa* this, GlobalContext* globalCtx) { +void BgSpot18Futa_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &DL_SPOT18_FUTA2); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index da833de334..a24ec69d86 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgSpot18Obj_Init(BgSpot18Obj* this, GlobalContext* globalCtx); -void BgSpot18Obj_Destroy(BgSpot18Obj* this, GlobalContext* globalCtx); -void BgSpot18Obj_Update(BgSpot18Obj* this, GlobalContext* globalCtx); -void BgSpot18Obj_Draw(BgSpot18Obj* this, GlobalContext* globalCtx); +#define THIS ((BgSpot18Obj*)thisx) + +void BgSpot18Obj_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Obj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Obj_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Obj_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot18_Obj_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index 90bfb21963..967bfea161 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void BgSpot18Shutter_Init(BgSpot18Shutter* this, GlobalContext* globalCtx); -void BgSpot18Shutter_Destroy(BgSpot18Shutter* this, GlobalContext* globalCtx); -void BgSpot18Shutter_Update(BgSpot18Shutter* this, GlobalContext* globalCtx); -void BgSpot18Shutter_Draw(BgSpot18Shutter* this, GlobalContext* globalCtx); +#define THIS ((BgSpot18Shutter*)thisx) + +void BgSpot18Shutter_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Shutter_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Shutter_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSpot18Shutter_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Spot18_Shutter_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index 2f7ca07a1c..813ab28625 100644 --- a/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void BgSstFloor_Init(BgSstFloor* this, GlobalContext* globalCtx); -void BgSstFloor_Destroy(BgSstFloor* this, GlobalContext* globalCtx); -void BgSstFloor_Update(BgSstFloor* this, GlobalContext* globalCtx); -void BgSstFloor_Draw(BgSstFloor* this, GlobalContext* globalCtx); +#define THIS ((BgSstFloor*)thisx) + +void BgSstFloor_Init(Actor* thisx, GlobalContext* globalCtx); +void BgSstFloor_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgSstFloor_Update(Actor* thisx, GlobalContext* globalCtx); +void BgSstFloor_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Sst_Floor_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c index 47ced4dbd4..a88b0d1a5e 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c +++ b/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000020 -void BgTokiHikari_Init(BgTokiHikari* this, GlobalContext* globalCtx); -void BgTokiHikari_Destroy(BgTokiHikari* this, GlobalContext* globalCtx); -void BgTokiHikari_Update(BgTokiHikari* this, GlobalContext* globalCtx); -void BgTokiHikari_Draw(BgTokiHikari* this, GlobalContext* globalCtx); +#define THIS ((BgTokiHikari*)thisx) + +void BgTokiHikari_Init(Actor* thisx, GlobalContext* globalCtx); +void BgTokiHikari_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgTokiHikari_Update(Actor* thisx, GlobalContext* globalCtx); +void BgTokiHikari_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Toki_Hikari_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 7b205a9fe0..ba62e69afb 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000010 -void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx); -void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx); -void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx); -void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx); +#define THIS ((BgTokiSwd*)thisx) + +void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx); +void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgTokiSwd_Update(Actor* thisx, GlobalContext* globalCtx); +void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx); + void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc); void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx); void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx); @@ -182,14 +185,14 @@ void BgTokiSwd_SetupAction(BgTokiSwd* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) { - ColliderCylinder* collision; - Actor* thisx = &this->actor; +void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) { + BgTokiSwd* this = THIS; + s32 pad; Actor_ProcessInitChain(thisx, initChain); this->actor.shape.unk_08 = 800.0f; BgTokiSwd_SetupAction(thisx, func_808BAF40); - collision = &this->collider; + if (LINK_IS_ADULT) { thisx->draw = NULL; } @@ -198,15 +201,16 @@ void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) { globalCtx->unk_11D30[0] = 0xFF; } - Collider_InitCylinder(globalCtx, collision); - Collider_SetCylinder(globalCtx, collision, thisx, &colliderInit); - Collider_CylinderUpdate(thisx, collision); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, thisx, &colliderInit); + Collider_CylinderUpdate(thisx, &this->collider); func_80061ED4(&thisx->colChkInfo, 0, &colChkInfoInit); } -void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void BgTokiSwd_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgTokiSwd* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { @@ -268,16 +272,20 @@ void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) { } } -void BgTokiSwd_Update(BgTokiSwd* this, GlobalContext* globalCtx) { +void BgTokiSwd_Update(Actor* thisx, GlobalContext* globalCtx) { + BgTokiSwd* this = THIS; + this->actionFunc(this, globalCtx); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } -void BgTokiSwd_Draw(BgTokiSwd* this, GlobalContext* globalCtx) { - s32 pad[4]; +void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgTokiSwd* this = THIS; + s32 pad[3]; GameState* state; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; + state = &globalCtx->state; gfxCtx = globalCtx->state.gfxCtx; diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 9aa8c720b8..5a3315d244 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void BgTreemouth_Init(BgTreemouth* this, GlobalContext* globalCtx); -void BgTreemouth_Destroy(BgTreemouth* this, GlobalContext* globalCtx); -void BgTreemouth_Update(BgTreemouth* this, GlobalContext* globalCtx); -void BgTreemouth_Draw(BgTreemouth* this, GlobalContext* globalCtx); +#define THIS ((BgTreemouth*)thisx) + +void BgTreemouth_Init(Actor* thisx, GlobalContext* globalCtx); +void BgTreemouth_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgTreemouth_Update(Actor* thisx, GlobalContext* globalCtx); +void BgTreemouth_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Treemouth_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index a44986e8e1..ffebe67325 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void BgUmaJump_Init(BgUmaJump* this, GlobalContext* globalCtx); -void BgUmaJump_Destroy(BgUmaJump* this, GlobalContext* globalCtx); -void BgUmaJump_Update(BgUmaJump* this, GlobalContext* globalCtx); -void BgUmaJump_Draw(BgUmaJump* this, GlobalContext* globalCtx); +#define THIS ((BgUmaJump*)thisx) + +void BgUmaJump_Init(Actor* thisx, GlobalContext* globalCtx); +void BgUmaJump_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgUmaJump_Update(Actor* thisx, GlobalContext* globalCtx); +void BgUmaJump_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Umajump_InitVars = { ACTOR_BG_UMAJUMP, @@ -32,8 +34,9 @@ static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -void BgUmaJump_Init(BgUmaJump* this, GlobalContext* globalCtx) { - s32 pad[2]; +void BgUmaJump_Init(Actor* thisx, GlobalContext* globalCtx) { + BgUmaJump* this = THIS; + s32 pad; u32 sp24 = 0; Actor_ProcessInitChain(&this->actor, initChain); @@ -50,13 +53,15 @@ void BgUmaJump_Init(BgUmaJump* this, GlobalContext* globalCtx) { } } -void BgUmaJump_Destroy(BgUmaJump* this, GlobalContext* globalCtx) { +void BgUmaJump_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgUmaJump* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -void BgUmaJump_Update(BgUmaJump* this, GlobalContext* globalCtx) { +void BgUmaJump_Update(Actor* thisx, GlobalContext* globalCtx) { } -void BgUmaJump_Draw(BgUmaJump* this, GlobalContext* globalCtx) { +void BgUmaJump_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_06001220); } diff --git a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c index ed2d16dcb4..8bc1271a91 100644 --- a/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c +++ b/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgVbSima_Init(BgVbSima* this, GlobalContext* globalCtx); -void BgVbSima_Destroy(BgVbSima* this, GlobalContext* globalCtx); -void BgVbSima_Update(BgVbSima* this, GlobalContext* globalCtx); -void BgVbSima_Draw(BgVbSima* this, GlobalContext* globalCtx); +#define THIS ((BgVbSima*)thisx) + +void BgVbSima_Init(Actor* thisx, GlobalContext* globalCtx); +void BgVbSima_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgVbSima_Update(Actor* thisx, GlobalContext* globalCtx); +void BgVbSima_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Vb_Sima_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 0aa9604c99..996c08cae0 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void BgYdanHasi_Init(BgYdanHasi* this, GlobalContext* globalCtx); -void BgYdanHasi_Destroy(BgYdanHasi* this, GlobalContext* globalCtx); -void BgYdanHasi_Update(BgYdanHasi* this, GlobalContext* globalCtx); -void BgYdanHasi_Draw(BgYdanHasi* this, GlobalContext* globalCtx); +#define THIS ((BgYdanHasi*)thisx) + +void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx); +void BgYdanHasi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgYdanHasi_Update(Actor* thisx, GlobalContext* globalCtx); +void BgYdanHasi_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Ydan_Hasi_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index 19599da86a..275ba00b32 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgYdanMaruta_Init(BgYdanMaruta* this, GlobalContext* globalCtx); -void BgYdanMaruta_Destroy(BgYdanMaruta* this, GlobalContext* globalCtx); -void BgYdanMaruta_Update(BgYdanMaruta* this, GlobalContext* globalCtx); -void BgYdanMaruta_Draw(BgYdanMaruta* this, GlobalContext* globalCtx); +#define THIS ((BgYdanMaruta*)thisx) + +void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx); +void BgYdanMaruta_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgYdanMaruta_Update(Actor* thisx, GlobalContext* globalCtx); +void BgYdanMaruta_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Ydan_Maruta_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index 53b2c1acfe..2c696402b5 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void BgYdanSp_Init(BgYdanSp* this, GlobalContext* globalCtx); -void BgYdanSp_Destroy(BgYdanSp* this, GlobalContext* globalCtx); -void BgYdanSp_Update(BgYdanSp* this, GlobalContext* globalCtx); -void BgYdanSp_Draw(BgYdanSp* this, GlobalContext* globalCtx); +#define THIS ((BgYdanSp*)thisx) + +void BgYdanSp_Init(Actor* thisx, GlobalContext* globalCtx); +void BgYdanSp_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgYdanSp_Update(Actor* thisx, GlobalContext* globalCtx); +void BgYdanSp_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Ydan_Sp_InitVars = { diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index ef74a531a2..339c79a882 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -10,10 +10,13 @@ #define FLAGS 0x00000010 -void BgZg_Init(BgZg* this, GlobalContext* globalCtx); -void BgZg_Destroy(BgZg* this, GlobalContext* globalCtx); -void BgZg_Update(BgZg* this, GlobalContext* globalCtx); -void BgZg_Draw(BgZg* this, GlobalContext* globalCtx); +#define THIS ((BgZg*)thisx) + +void BgZg_Init(Actor* thisx, GlobalContext* globalCtx); +void BgZg_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BgZg_Update(Actor* thisx, GlobalContext* globalCtx); +void BgZg_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_808C0C50(BgZg* this); s32 func_808C0C98(BgZg* this, GlobalContext* globalCtx); s32 func_808C0CC8(BgZg* this); @@ -49,7 +52,9 @@ const ActorInit Bg_Zg_InitVars = { extern u32 D_06001080; extern u32 D_060011D4; -void BgZg_Destroy(BgZg* this, GlobalContext* globalCtx) { +void BgZg_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgZg* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -84,7 +89,8 @@ void func_808C0D08(BgZg* this, GlobalContext* globalCtx) { } } -void BgZg_Update(BgZg* this, GlobalContext* globalCtx) { +void BgZg_Update(Actor* thisx, GlobalContext* globalCtx) { + BgZg* this = THIS; s32 action = this->action; if (((action < 0) || (1 < action)) || (actionFuncs[action] == NULL)) { @@ -95,9 +101,9 @@ void BgZg_Update(BgZg* this, GlobalContext* globalCtx) { } } -void BgZg_Init(BgZg* this, GlobalContext* globalCtx) { - s32 sp20[2]; - Actor* thisx = &this->dyna.actor; +void BgZg_Init(Actor* thisx, GlobalContext* globalCtx) { + BgZg* this = THIS; + s32 pad[2]; u32 local_c; Actor_ProcessInitChain(thisx, initChain); @@ -119,7 +125,6 @@ void BgZg_Init(BgZg* this, GlobalContext* globalCtx) { } void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) { - GraphicsContext* gfxCtx; GraphicsContext* tempgfxCtx; // oddly needs this to match Gfx* dispRefs[4]; @@ -136,7 +141,8 @@ void func_808C0EEC(BgZg* this, GlobalContext* globalCtx) { Graph_CloseDisps(dispRefs, gfxCtx, "../z_bg_zg.c", 320); } -void BgZg_Draw(BgZg* this, GlobalContext* globalCtx) { +void BgZg_Draw(Actor* thisx, GlobalContext* globalCtx) { + BgZg* this = THIS; s32 action = this->drawConfig; if (((action < 0) || (action > 0)) || drawFuncs[action] == NULL) { diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 4330a2d028..7ee49098ef 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossDodongo_Init(BossDodongo* this, GlobalContext* globalCtx); -void BossDodongo_Destroy(BossDodongo* this, GlobalContext* globalCtx); -void BossDodongo_Update(BossDodongo* this, GlobalContext* globalCtx); -void BossDodongo_Draw(BossDodongo* this, GlobalContext* globalCtx); +#define THIS ((BossDodongo*)thisx) + +void BossDodongo_Init(Actor* thisx, GlobalContext* globalCtx); +void BossDodongo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossDodongo_Update(Actor* thisx, GlobalContext* globalCtx); +void BossDodongo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Dodongo_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 4389651867..094a9ce29e 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossFd_Init(BossFd* this, GlobalContext* globalCtx); -void BossFd_Destroy(BossFd* this, GlobalContext* globalCtx); -void BossFd_Update(BossFd* this, GlobalContext* globalCtx); -void BossFd_Draw(BossFd* this, GlobalContext* globalCtx); +#define THIS ((BossFd*)thisx) + +void BossFd_Init(Actor* thisx, GlobalContext* globalCtx); +void BossFd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossFd_Update(Actor* thisx, GlobalContext* globalCtx); +void BossFd_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Fd_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 8fdfbf5570..e07569343c 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossFd2_Init(BossFd2* this, GlobalContext* globalCtx); -void BossFd2_Destroy(BossFd2* this, GlobalContext* globalCtx); -void BossFd2_Update(BossFd2* this, GlobalContext* globalCtx); -void BossFd2_Draw(BossFd2* this, GlobalContext* globalCtx); +#define THIS ((BossFd2*)thisx) + +void BossFd2_Init(Actor* thisx, GlobalContext* globalCtx); +void BossFd2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossFd2_Update(Actor* thisx, GlobalContext* globalCtx); +void BossFd2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Fd2_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 951eed9e7c..fb4378a2e3 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossGanon_Init(BossGanon* this, GlobalContext* globalCtx); -void BossGanon_Destroy(BossGanon* this, GlobalContext* globalCtx); -void BossGanon_Update(BossGanon* this, GlobalContext* globalCtx); -void BossGanon_Draw(BossGanon* this, GlobalContext* globalCtx); +#define THIS ((BossGanon*)thisx) + +void BossGanon_Init(Actor* thisx, GlobalContext* globalCtx); +void BossGanon_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossGanon_Update(Actor* thisx, GlobalContext* globalCtx); +void BossGanon_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Ganon_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index b5aa87bcb0..6e9536cb3c 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossGanon2_Init(BossGanon2* this, GlobalContext* globalCtx); -void BossGanon2_Destroy(BossGanon2* this, GlobalContext* globalCtx); -void BossGanon2_Update(BossGanon2* this, GlobalContext* globalCtx); -void BossGanon2_Draw(BossGanon2* this, GlobalContext* globalCtx); +#define THIS ((BossGanon2*)thisx) + +void BossGanon2_Init(Actor* thisx, GlobalContext* globalCtx); +void BossGanon2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossGanon2_Update(Actor* thisx, GlobalContext* globalCtx); +void BossGanon2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Ganon2_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index ed14ee00b5..2a7820b095 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossGanondrof_Init(BossGanondrof* this, GlobalContext* globalCtx); -void BossGanondrof_Destroy(BossGanondrof* this, GlobalContext* globalCtx); -void BossGanondrof_Update(BossGanondrof* this, GlobalContext* globalCtx); -void BossGanondrof_Draw(BossGanondrof* this, GlobalContext* globalCtx); +#define THIS ((BossGanondrof*)thisx) + +void BossGanondrof_Init(Actor* thisx, GlobalContext* globalCtx); +void BossGanondrof_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossGanondrof_Update(Actor* thisx, GlobalContext* globalCtx); +void BossGanondrof_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Ganondrof_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 52f0c31abe..cfd515eb7c 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossGoma_Init(BossGoma* this, GlobalContext* globalCtx); -void BossGoma_Destroy(BossGoma* this, GlobalContext* globalCtx); -void BossGoma_Update(BossGoma* this, GlobalContext* globalCtx); -void BossGoma_Draw(BossGoma* this, GlobalContext* globalCtx); +#define THIS ((BossGoma*)thisx) + +void BossGoma_Init(Actor* thisx, GlobalContext* globalCtx); +void BossGoma_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossGoma_Update(Actor* thisx, GlobalContext* globalCtx); +void BossGoma_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Goma_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 2d0b622396..ad286f44b6 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossMo_Init(BossMo* this, GlobalContext* globalCtx); -void BossMo_Destroy(BossMo* this, GlobalContext* globalCtx); -void BossMo_Update(BossMo* this, GlobalContext* globalCtx); -void BossMo_Draw(BossMo* this, GlobalContext* globalCtx); +#define THIS ((BossMo*)thisx) + +void BossMo_Init(Actor* thisx, GlobalContext* globalCtx); +void BossMo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossMo_Update(Actor* thisx, GlobalContext* globalCtx); +void BossMo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Mo_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 4794f0833b..08bbca0fb1 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000435 -void BossSst_Init(BossSst* this, GlobalContext* globalCtx); -void BossSst_Destroy(BossSst* this, GlobalContext* globalCtx); -void BossSst_Update(BossSst* this, GlobalContext* globalCtx); -void BossSst_Draw(BossSst* this, GlobalContext* globalCtx); +#define THIS ((BossSst*)thisx) + +void BossSst_Init(Actor* thisx, GlobalContext* globalCtx); +void BossSst_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossSst_Update(Actor* thisx, GlobalContext* globalCtx); +void BossSst_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Sst_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 2e490c9fff..879da2dff9 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossTw_Init(BossTw* this, GlobalContext* globalCtx); -void BossTw_Destroy(BossTw* this, GlobalContext* globalCtx); -void BossTw_Update(BossTw* this, GlobalContext* globalCtx); -void BossTw_Draw(BossTw* this, GlobalContext* globalCtx); +#define THIS ((BossTw*)thisx) + +void BossTw_Init(Actor* thisx, GlobalContext* globalCtx); +void BossTw_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossTw_Update(Actor* thisx, GlobalContext* globalCtx); +void BossTw_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Tw_InitVars = { diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index cde712e34a..fd1d07cd3d 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void BossVa_Init(BossVa* this, GlobalContext* globalCtx); -void BossVa_Destroy(BossVa* this, GlobalContext* globalCtx); -void BossVa_Update(BossVa* this, GlobalContext* globalCtx); -void BossVa_Draw(BossVa* this, GlobalContext* globalCtx); +#define THIS ((BossVa*)thisx) + +void BossVa_Init(Actor* thisx, GlobalContext* globalCtx); +void BossVa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void BossVa_Update(Actor* thisx, GlobalContext* globalCtx); +void BossVa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Va_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 227edc980b..0f1b93a215 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000010 -void Demo6K_Init(Demo6K* this, GlobalContext* globalCtx); -void Demo6K_Destroy(Demo6K* this, GlobalContext* globalCtx); -void Demo6K_Update(Demo6K* this, GlobalContext* globalCtx); +#define THIS ((Demo6K*)thisx) + +void Demo6K_Init(Actor* thisx, GlobalContext* globalCtx); +void Demo6K_Destroy(Actor* thisx, GlobalContext* globalCtx); +void Demo6K_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_6K_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index 1f0ae03484..5420da033c 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void DemoDu_Init(DemoDu* this, GlobalContext* globalCtx); -void DemoDu_Destroy(DemoDu* this, GlobalContext* globalCtx); -void DemoDu_Update(DemoDu* this, GlobalContext* globalCtx); -void DemoDu_Draw(DemoDu* this, GlobalContext* globalCtx); +#define THIS ((DemoDu*)thisx) + +void DemoDu_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoDu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoDu_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoDu_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Du_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index 31f39a2c51..4d094923a8 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void DemoEc_Init(DemoEc* this, GlobalContext* globalCtx); -void DemoEc_Destroy(DemoEc* this, GlobalContext* globalCtx); -void DemoEc_Update(DemoEc* this, GlobalContext* globalCtx); -void DemoEc_Draw(DemoEc* this, GlobalContext* globalCtx); +#define THIS ((DemoEc*)thisx) + +void DemoEc_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoEc_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoEc_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoEc_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Ec_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 86988bf043..e4093eb13d 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000030 -void DemoEffect_Init(DemoEffect* this, GlobalContext* globalCtx); -void DemoEffect_Destroy(DemoEffect* this, GlobalContext* globalCtx); -void DemoEffect_Update(DemoEffect* this, GlobalContext* globalCtx); +#define THIS ((DemoEffect*)thisx) + +void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoEffect_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoEffect_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Effect_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c index ce075c567e..5672b773dc 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void DemoExt_Init(DemoExt* this, GlobalContext* globalCtx); -void DemoExt_Destroy(DemoExt* this, GlobalContext* globalCtx); -void DemoExt_Update(DemoExt* this, GlobalContext* globalCtx); -void DemoExt_Draw(DemoExt* this, GlobalContext* globalCtx); +#define THIS ((DemoExt*)thisx) + +void DemoExt_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoExt_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoExt_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoExt_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Ext_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index 131a70808b..79a80414f7 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -10,10 +10,12 @@ #define FLAGS 0x00000030 -void DemoGeff_Init(DemoGeff* this, GlobalContext* globalCtx); -void DemoGeff_Destroy(DemoGeff* this, GlobalContext* globalCtx); -void DemoGeff_Update(DemoGeff* this, GlobalContext* globalCtx); -void DemoGeff_Draw(DemoGeff* this, GlobalContext* globalCtx); +#define THIS ((DemoGeff*)thisx) + +void DemoGeff_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoGeff_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoGeff_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoGeff_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80978030(DemoGeff* this, GlobalContext* globalCtx); @@ -55,10 +57,12 @@ const ActorInit Demo_Geff_InitVars = { extern UNK_TYPE D_06000EA0; -void DemoGeff_Destroy(DemoGeff* this, GlobalContext* globalCtx) { +void DemoGeff_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void DemoGeff_Init(DemoGeff* this, GlobalContext* globalCtx) { +void DemoGeff_Init(Actor* thisx, GlobalContext* globalCtx) { + DemoGeff* this = THIS; + if (this->actor.params < 0 || this->actor.params >= 9) { osSyncPrintf(VT_FGCOL(RED) "Demo_Geff_Actor_ct:arg_dataがおかしい!!!!!!!!!!!!\n" VT_RST); Actor_Kill(&this->actor); @@ -102,6 +106,7 @@ void func_80977F80(DemoGeff* this, GlobalContext* globalCtx) { void func_80978030(DemoGeff* this, GlobalContext* globalCtx) { Vec3f* thisScale = &this->actor.scale; + this->action = 1; this->drawConfig = 1; @@ -201,7 +206,9 @@ void func_809783D4(DemoGeff* this, GlobalContext* globalCtx) { } } -void DemoGeff_Update(DemoGeff* this, GlobalContext* globalCtx) { +void DemoGeff_Update(Actor* thisx, GlobalContext* globalCtx) { + DemoGeff* this = THIS; + if (this->action < 0 || this->action >= 2 || actionFuncs[this->action] == NULL) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; @@ -212,9 +219,10 @@ void DemoGeff_Update(DemoGeff* this, GlobalContext* globalCtx) { void func_809784D4(DemoGeff* this, GlobalContext* globalCtx) { } -void DemoGeff_Draw(DemoGeff* this, GlobalContext* globalCtx) { +void DemoGeff_Draw(Actor* thisx, GlobalContext* globalCtx) { + DemoGeff* this = THIS; s32 drawConfig = this->drawConfig; - s16 pad; + if (drawConfig < 0 || drawConfig >= 2 || drawFuncs[drawConfig] == NULL) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 5a024c697a..efa134069f 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void DemoGj_Init(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Destroy(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Update(DemoGj* this, GlobalContext* globalCtx); -void DemoGj_Draw(DemoGj* this, GlobalContext* globalCtx); +#define THIS ((DemoGj*)thisx) + +void DemoGj_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoGj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoGj_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoGj_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Gj_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c index 5e936fe7fb..1de5a3c55e 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -10,10 +10,12 @@ #define FLAGS 0x00000010 -void DemoGo_Init(DemoGo* this, GlobalContext* globalCtx); -void DemoGo_Destroy(DemoGo* this, GlobalContext* globalCtx); -void DemoGo_Update(DemoGo* this, GlobalContext* globalCtx); -void DemoGo_Draw(DemoGo* this, GlobalContext* globalCtx); +#define THIS ((DemoGo*)thisx) + +void DemoGo_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoGo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoGo_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoGo_Draw(Actor* thisx, GlobalContext* globalCtx); void func_8097CE10(DemoGo* this, GlobalContext* globalCtx); void func_8097CFDC(DemoGo* this, GlobalContext* globalCtx); @@ -56,6 +58,7 @@ extern SkeletonHeader D_0600FEF0; UNK_TYPE func_8097C870(DemoGo* this) { s32 ret; + switch (this->actor.params) { case 0: ret = 3; @@ -84,7 +87,9 @@ void func_8097C8A8(DemoGo* this, GlobalContext* globalCtx) { } } -void DemoGo_Destroy(DemoGo* this, GlobalContext* globalCtx) { +void DemoGo_Destroy(Actor* thisx, GlobalContext* globalCtx) { + DemoGo* this = THIS; + SkelAnime_Free(&this->skelAnime, globalCtx); } @@ -305,7 +310,9 @@ void func_8097D130(DemoGo* this, GlobalContext* globalCtx) { func_8097C9DC(this); } -void DemoGo_Update(DemoGo* this, GlobalContext* globalCtx) { +void DemoGo_Update(Actor* thisx, GlobalContext* globalCtx) { + DemoGo* this = THIS; + if (this->action < 0 || this->action >= 7 || D_8097D44C[this->action] == 0) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; @@ -313,8 +320,8 @@ void DemoGo_Update(DemoGo* this, GlobalContext* globalCtx) { D_8097D44C[this->action](this, globalCtx); } -void DemoGo_Init(DemoGo* this, GlobalContext* globalCtx) { - s16 pad; +void DemoGo_Init(Actor* thisx, GlobalContext* globalCtx) { + DemoGo* this = THIS; AnimationHeader* animation = &D_06004930; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); @@ -348,7 +355,9 @@ void func_8097D29C(DemoGo* this, GlobalContext* globalCtx) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_demo_go.c", 746); } -void DemoGo_Draw(DemoGo* this, GlobalContext* globalCtx) { +void DemoGo_Draw(Actor* thisx, GlobalContext* globalCtx) { + DemoGo* this = THIS; + if (this->drawConfig < 0 || this->drawConfig >= 2 || D_8097D468[this->drawConfig] == 0) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index f7c137c259..0c406311e7 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void DemoGt_Init(DemoGt* this, GlobalContext* globalCtx); -void DemoGt_Destroy(DemoGt* this, GlobalContext* globalCtx); -void DemoGt_Update(DemoGt* this, GlobalContext* globalCtx); -void DemoGt_Draw(DemoGt* this, GlobalContext* globalCtx); +#define THIS ((DemoGt*)thisx) + +void DemoGt_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoGt_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoGt_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoGt_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Gt_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index 73a7a93f05..bb5b5ed8a9 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void DemoIk_Init(DemoIk* this, GlobalContext* globalCtx); -void DemoIk_Destroy(DemoIk* this, GlobalContext* globalCtx); -void DemoIk_Update(DemoIk* this, GlobalContext* globalCtx); -void DemoIk_Draw(DemoIk* this, GlobalContext* globalCtx); +#define THIS ((DemoIk*)thisx) + +void DemoIk_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoIk_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoIk_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoIk_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Ik_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 4f56ddad2f..4b51681bdb 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000011 -void DemoIm_Init(DemoIm* this, GlobalContext* globalCtx); -void DemoIm_Destroy(DemoIm* this, GlobalContext* globalCtx); -void DemoIm_Update(DemoIm* this, GlobalContext* globalCtx); -void DemoIm_Draw(DemoIm* this, GlobalContext* globalCtx); +#define THIS ((DemoIm*)thisx) + +void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoIm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoIm_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoIm_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Im_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 85448b6293..fd0666ad57 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void DemoKankyo_Init(DemoKankyo* this, GlobalContext* globalCtx); -void DemoKankyo_Destroy(DemoKankyo* this, GlobalContext* globalCtx); -void DemoKankyo_Update(DemoKankyo* this, GlobalContext* globalCtx); -void DemoKankyo_Draw(DemoKankyo* this, GlobalContext* globalCtx); +#define THIS ((DemoKankyo*)thisx) + +void DemoKankyo_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoKankyo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoKankyo_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoKankyo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Kankyo_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 438b7e0253..024589d68d 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void DemoKekkai_Init(DemoKekkai* this, GlobalContext* globalCtx); -void DemoKekkai_Destroy(DemoKekkai* this, GlobalContext* globalCtx); -void DemoKekkai_Update(DemoKekkai* this, GlobalContext* globalCtx); -void DemoKekkai_Draw(DemoKekkai* this, GlobalContext* globalCtx); +#define THIS ((DemoKekkai*)thisx) + +void DemoKekkai_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoKekkai_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoKekkai_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoKekkai_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Kekkai_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 7b82457dfe..32888e063d 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void DemoSa_Init(DemoSa* this, GlobalContext* globalCtx); -void DemoSa_Destroy(DemoSa* this, GlobalContext* globalCtx); -void DemoSa_Update(DemoSa* this, GlobalContext* globalCtx); -void DemoSa_Draw(DemoSa* this, GlobalContext* globalCtx); +#define THIS ((DemoSa*)thisx) + +void DemoSa_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoSa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoSa_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoSa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Sa_InitVars = { diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c index 8701e98ad0..9eec96dfc1 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000030 -void DemoShd_Init(DemoShd* this, GlobalContext* globalCtx); -void DemoShd_Destroy(DemoShd* this, GlobalContext* globalCtx); -void DemoShd_Update(DemoShd* this, GlobalContext* globalCtx); -void DemoShd_Draw(DemoShd* this, GlobalContext* globalCtx); +#define THIS ((DemoShd*)thisx) + +void DemoShd_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoShd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoShd_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoShd_Draw(Actor* thisx, GlobalContext* globalCtx); + void DemoShd_SetupAction(DemoShd* this, ActorFunc actionFunc); void func_80991298(DemoShd* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index c5d1674d39..0e20c45d13 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void DemoTreLgt_Init(DemoTreLgt* this, GlobalContext* globalCtx); -void DemoTreLgt_Destroy(DemoTreLgt* this, GlobalContext* globalCtx); -void DemoTreLgt_Update(DemoTreLgt* this, GlobalContext* globalCtx); -void DemoTreLgt_Draw(DemoTreLgt* this, GlobalContext* globalCtx); +#define THIS ((DemoTreLgt*)thisx) + +void DemoTreLgt_Init(Actor* thisx, GlobalContext* globalCtx); +void DemoTreLgt_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DemoTreLgt_Update(Actor* thisx, GlobalContext* globalCtx); +void DemoTreLgt_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Demo_Tre_Lgt_InitVars = { diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index a332ed58fa..6df757c7ad 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000000 -void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx); -void DoorAna_Destroy(DoorAna* this, GlobalContext* globalCtx); -void DoorAna_Update(DoorAna* this, GlobalContext* globalCtx); -void DoorAna_Draw(DoorAna* this, GlobalContext* globalCtx); +#define THIS ((DoorAna*)thisx) + +void DoorAna_Init(Actor* thisx, GlobalContext* globalCtx); +void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx); +void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx); void DoorAna_SetupAction(DoorAna* this, ActorFunc func); @@ -52,8 +54,8 @@ void DoorAna_SetupAction(DoorAna* this, ActorFunc func) { this->actionFunc = func; } -void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) { - ColliderCylinder* collider; +void DoorAna_Init(Actor* thisx, GlobalContext* globalCtx) { + DoorAna* this = THIS; this->actor.shape.rot.z = 0; this->actor.shape.rot.y = this->actor.shape.rot.z; @@ -61,9 +63,8 @@ void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) { if ((this->actor.params & 0x300) != 0) { // only allocate collider for grottos that need bombing/hammering open if ((this->actor.params & 0x200) != 0) { - collider = &this->collider; - Collider_InitCylinder(globalCtx, collider); - Collider_SetCylinder(globalCtx, collider, &this->actor, &colliderInit); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &colliderInit); } else { this->actor.flags |= 0x10; } @@ -75,7 +76,9 @@ void DoorAna_Init(DoorAna* this, GlobalContext* globalCtx) { this->actor.unk_1F = 0; } -void DoorAna_Destroy(DoorAna* this, GlobalContext* globalCtx) { +void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) { + DoorAna* this = THIS; + // free collider if it has one if ((this->actor.params & 0x200) != 0) { Collider_DestroyCylinder(globalCtx, &this->collider); @@ -84,7 +87,7 @@ void DoorAna_Destroy(DoorAna* this, GlobalContext* globalCtx) { // update routine for grottos that are currently "hidden"/unopened void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) { - bool openGrotto = false; + u32 openGrotto = false; if ((this->actor.params & 0x200) == 0) { // opening with song of storms if (this->actor.waterSurfaceDist < 40000.0f && Flags_GetEnv(globalCtx, 5)) { @@ -154,13 +157,15 @@ void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx) { } } -void DoorAna_Update(DoorAna* this, GlobalContext* globalCtx) { +void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx) { + DoorAna* this = THIS; + this->actionFunc(this, globalCtx); // changes the grottos facing angle based on camera angle this->actor.shape.rot.y = func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000; } -void DoorAna_Draw(DoorAna* this, GlobalContext* globalCtx) { +void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 94f6184aa0..f1f59edd65 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void DoorGerudo_Init(DoorGerudo* this, GlobalContext* globalCtx); -void DoorGerudo_Destroy(DoorGerudo* this, GlobalContext* globalCtx); -void DoorGerudo_Update(DoorGerudo* this, GlobalContext* globalCtx); -void DoorGerudo_Draw(DoorGerudo* this, GlobalContext* globalCtx); +#define THIS ((DoorGerudo*)thisx) + +void DoorGerudo_Init(Actor* thisx, GlobalContext* globalCtx); +void DoorGerudo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DoorGerudo_Update(Actor* thisx, GlobalContext* globalCtx); +void DoorGerudo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Door_Gerudo_InitVars = { diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index d084171a4b..5170f4d0b8 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000010 -void DoorKiller_Init(DoorKiller* this, GlobalContext* globalCtx); -void DoorKiller_Destroy(DoorKiller* this, GlobalContext* globalCtx); -void DoorKiller_Update(DoorKiller* this, GlobalContext* globalCtx); +#define THIS ((DoorKiller*)thisx) + +void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx); +void DoorKiller_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DoorKiller_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Door_Killer_InitVars = { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index ef39d1c716..3270db3f94 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void DoorShutter_Init(DoorShutter* this, GlobalContext* globalCtx); -void DoorShutter_Destroy(DoorShutter* this, GlobalContext* globalCtx); -void DoorShutter_Update(DoorShutter* this, GlobalContext* globalCtx); -void DoorShutter_Draw(DoorShutter* this, GlobalContext* globalCtx); +#define THIS ((DoorShutter*)thisx) + +void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx); +void DoorShutter_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DoorShutter_Update(Actor* thisx, GlobalContext* globalCtx); +void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Door_Shutter_InitVars = { diff --git a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c index 3bac8c67bc..dd8b8bda72 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void DoorToki_Init(DoorToki* this, GlobalContext* globalCtx); -void DoorToki_Destroy(DoorToki* this, GlobalContext* globalCtx); -void DoorToki_Update(DoorToki* this, GlobalContext* globalCtx); +#define THIS ((DoorToki*)thisx) + +void DoorToki_Init(Actor* thisx, GlobalContext* globalCtx); +void DoorToki_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DoorToki_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit Door_Toki_InitVars = { ACTOR_DOOR_TOKI, @@ -31,8 +33,9 @@ static InitChainEntry initChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -void DoorToki_Init(DoorToki* this, GlobalContext* globalCtx) { - s32 pad[2]; +void DoorToki_Init(Actor* thisx, GlobalContext* globalCtx) { + DoorToki* this = THIS; + s32 pad; u32 sp1C = 0; Actor_ProcessInitChain(&this->actor, initChain); @@ -41,11 +44,15 @@ void DoorToki_Init(DoorToki* this, GlobalContext* globalCtx) { this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp1C); } -void DoorToki_Destroy(DoorToki* this, GlobalContext* globalCtx) { +void DoorToki_Destroy(Actor* thisx, GlobalContext* globalCtx) { + DoorToki* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } -void DoorToki_Update(DoorToki* this, GlobalContext* globalCtx) { +void DoorToki_Update(Actor* thisx, GlobalContext* globalCtx) { + DoorToki* this = THIS; + if (gSaveContext.eventChkInf[4] & 0x800) { func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId); } else { diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 8b8a656854..098c9254c8 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void DoorWarp1_Init(DoorWarp1* this, GlobalContext* globalCtx); -void DoorWarp1_Destroy(DoorWarp1* this, GlobalContext* globalCtx); -void DoorWarp1_Update(DoorWarp1* this, GlobalContext* globalCtx); -void DoorWarp1_Draw(DoorWarp1* this, GlobalContext* globalCtx); +#define THIS ((DoorWarp1*)thisx) + +void DoorWarp1_Init(Actor* thisx, GlobalContext* globalCtx); +void DoorWarp1_Destroy(Actor* thisx, GlobalContext* globalCtx); +void DoorWarp1_Update(Actor* thisx, GlobalContext* globalCtx); +void DoorWarp1_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Door_Warp1_InitVars = { diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index b632c69e0f..ec0f59fcd2 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EfcErupc_Init(EfcErupc* this, GlobalContext* globalCtx); -void EfcErupc_Destroy(EfcErupc* this, GlobalContext* globalCtx); -void EfcErupc_Update(EfcErupc* this, GlobalContext* globalCtx); -void EfcErupc_Draw(EfcErupc* this, GlobalContext* globalCtx); +#define THIS ((EfcErupc*)thisx) + +void EfcErupc_Init(Actor* thisx, GlobalContext* globalCtx); +void EfcErupc_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EfcErupc_Update(Actor* thisx, GlobalContext* globalCtx); +void EfcErupc_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Efc_Erupc_InitVars = { diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 60741d4da1..d1f34f64e9 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EffDust_Init(EffDust* this, GlobalContext* globalCtx); -void EffDust_Destroy(EffDust* this, GlobalContext* globalCtx); -void EffDust_Update(EffDust* this, GlobalContext* globalCtx); -void EffDust_Draw(EffDust* this, GlobalContext* globalCtx); +#define THIS ((EffDust*)thisx) + +void EffDust_Init(Actor* thisx, GlobalContext* globalCtx); +void EffDust_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EffDust_Update(Actor* thisx, GlobalContext* globalCtx); +void EffDust_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Eff_Dust_InitVars = { diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 86667e8b9c..89a66faaaf 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void ElfMsg_Init(ElfMsg* this, GlobalContext* globalCtx); -void ElfMsg_Destroy(ElfMsg* this, GlobalContext* globalCtx); -void ElfMsg_Update(ElfMsg* this, GlobalContext* globalCtx); -void ElfMsg_Draw(ElfMsg* this, GlobalContext* globalCtx); +#define THIS ((ElfMsg*)thisx) + +void ElfMsg_Init(Actor* thisx, GlobalContext* globalCtx); +void ElfMsg_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ElfMsg_Update(Actor* thisx, GlobalContext* globalCtx); +void ElfMsg_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Elf_Msg_InitVars = { diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 9ea7fc01e3..dea90ec7f7 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void ElfMsg2_Init(ElfMsg2* this, GlobalContext* globalCtx); -void ElfMsg2_Destroy(ElfMsg2* this, GlobalContext* globalCtx); -void ElfMsg2_Update(ElfMsg2* this, GlobalContext* globalCtx); -void ElfMsg2_Draw(ElfMsg2* this, GlobalContext* globalCtx); +#define THIS ((ElfMsg2*)thisx) + +void ElfMsg2_Init(Actor* thisx, GlobalContext* globalCtx); +void ElfMsg2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ElfMsg2_Update(Actor* thisx, GlobalContext* globalCtx); +void ElfMsg2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Elf_Msg2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index c40cce8066..c506051ceb 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -8,10 +8,12 @@ #define FLAGS 0x04000015 -void EnAm_Init(EnAm* this, GlobalContext* globalCtx); -void EnAm_Destroy(EnAm* this, GlobalContext* globalCtx); -void EnAm_Update(EnAm* this, GlobalContext* globalCtx); -void EnAm_Draw(EnAm* this, GlobalContext* globalCtx); +#define THIS ((EnAm*)thisx) + +void EnAm_Init(Actor* thisx, GlobalContext* globalCtx); +void EnAm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnAm_Update(Actor* thisx, GlobalContext* globalCtx); +void EnAm_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Am_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 943c153cdf..cf4f9dc7b3 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -8,9 +8,14 @@ #define FLAGS 0x00000009 +#define THIS ((EnAni*)thisx) + +void EnAni_Init(Actor* thisx, GlobalContext* globalCtx); +void EnAni_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnAni_Update(Actor* thisx, GlobalContext* globalCtx); +void EnAni_Draw(Actor* thisx, GlobalContext* globalCtx); + void EnAni_SetupAction(EnAni* this, ActorFunc actionFunc); -void EnAni_Init(EnAni* this, GlobalContext* globalCtx); -void EnAni_Destroy(EnAni* this, GlobalContext* globalCtx); s32 EnAni_SetText(EnAni* this, GlobalContext* globalCtx, u16 textId); void func_809B04F0(EnAni* this, GlobalContext* globalCtx); void func_809B0524(EnAni* this, GlobalContext* globalCtx); @@ -22,10 +27,6 @@ void func_809B0988(EnAni* this, GlobalContext* globalCtx); void func_809B0994(EnAni* this, GlobalContext* globalCtx); void func_809B0A28(EnAni* this, GlobalContext* globalCtx); void func_809B0A6C(EnAni* this, GlobalContext* globalCtx); -void EnAni_Update(EnAni* this, GlobalContext* globalCtx); -s32 EnAni_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnAni* enAni); -void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, EnAni* enAni); -void EnAni_Draw(EnAni* this, GlobalContext* globalCtx); extern SkeletonHeader D_060000F0; extern AnimationHeader D_060067B8; @@ -67,16 +68,15 @@ void EnAni_SetupAction(EnAni* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void EnAni_Init(EnAni* this, GlobalContext* globalCtx) { - AnimationHeader* anim; - u32 pad; +void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) { + EnAni* this = THIS; + s32 pad; - anim = &D_060076EC; Actor_ProcessInitChain(&this->actor, initChain); ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawFunc_Circle, 36.0f); - SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060000F0, anim, this->limbDrawTable, this->transitionDrawTable, - 0x10); - SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, anim); + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_060000F0, &D_060076EC, this->limbDrawTable, + this->transitionDrawTable, 0x10); + SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_060076EC); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); this->actor.colChkInfo.mass = 0xFF; @@ -91,9 +91,9 @@ void EnAni_Init(EnAni* this, GlobalContext* globalCtx) { this->actor.velocity.y = -1.0f; } -void EnAni_Destroy(EnAni* this, GlobalContext* globalCtx) { - ColliderCylinder* collider; - collider = &this->collider; +void EnAni_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnAni* this = THIS; + Collider_DestroyCylinder(globalCtx, &this->collider); } @@ -238,14 +238,12 @@ void func_809B0A6C(EnAni* this, GlobalContext* globalCtx) { } } -void EnAni_Update(EnAni* this, GlobalContext* globalCtx) { - ColliderCylinder* collider; - u32 pad; - u32 pad2; +void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) { + EnAni* this = THIS; + s32 pad[2]; - collider = &this->collider; - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); Actor_MoveForward(&this->actor); func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.actorActions[0] != NULL)) { @@ -298,36 +296,34 @@ void EnAni_Update(EnAni* this, GlobalContext* globalCtx) { } } -s32 EnAni_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnAni* enAni) { - EnAni* temp; +s32 EnAni_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnAni* this = THIS; - temp = enAni; if (limbIndex == 15) { - rot->x += temp->unk_29C.y; - rot->z += temp->unk_29C.x; + rot->x += this->unk_29C.y; + rot->z += this->unk_29C.x; } return 0; } -void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, EnAni* enAni) { +void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { if (limbIndex == 15) { - Matrix_MultVec3f(&EnAniVec, &enAni->actor.posRot2.pos); + Matrix_MultVec3f(&EnAniVec, &thisx->posRot2.pos); } } -void EnAni_Draw(EnAni* this, GlobalContext* globalCtx) { - UNK_PTR* temp; - u32 pad; +void EnAni_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnAni* this = THIS; + s32 pad; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; - temp = D_809B0F80; gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ani.c", 719); func_800943C8(globalCtx->state.gfxCtx); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(temp[this->unk_2AC])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_809B0F80[this->unk_2AC])); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, EnAni_OverrideLimbDraw, EnAni_PostLimbDraw, &this->actor); diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index bc9c83bc0a..8960eda0d8 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000015 -void EnAnubice_Init(EnAnubice* this, GlobalContext* globalCtx); -void EnAnubice_Destroy(EnAnubice* this, GlobalContext* globalCtx); -void EnAnubice_Update(EnAnubice* this, GlobalContext* globalCtx); -void EnAnubice_Draw(EnAnubice* this, GlobalContext* globalCtx); +#define THIS ((EnAnubice*)thisx) + +void EnAnubice_Init(Actor* thisx, GlobalContext* globalCtx); +void EnAnubice_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnAnubice_Update(Actor* thisx, GlobalContext* globalCtx); +void EnAnubice_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Anubice_InitVars = { diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index 1b378a60ae..f846267514 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnAnubiceFire_Init(EnAnubiceFire* this, GlobalContext* globalCtx); -void EnAnubiceFire_Destroy(EnAnubiceFire* this, GlobalContext* globalCtx); -void EnAnubiceFire_Update(EnAnubiceFire* this, GlobalContext* globalCtx); -void EnAnubiceFire_Draw(EnAnubiceFire* this, GlobalContext* globalCtx); +#define THIS ((EnAnubiceFire*)thisx) + +void EnAnubiceFire_Init(Actor* thisx, GlobalContext* globalCtx); +void EnAnubiceFire_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnAnubiceFire_Update(Actor* thisx, GlobalContext* globalCtx); +void EnAnubiceFire_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Anubice_Fire_InitVars = { diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index 4d98afc25a..72e5829373 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -10,12 +10,15 @@ #define FLAGS 0x00000010 -void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx); -void EnAnubiceTag_Destroy(EnAnubiceTag* this, GlobalContext* globalCtx); +#define THIS ((EnAnubiceTag*)thisx) + +void EnAnubiceTag_Init(Actor* thisx, GlobalContext* globalCtx); +void EnAnubiceTag_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnAnubiceTag_Update(Actor* thisx, GlobalContext* globalCtx); +void EnAnubiceTag_Draw(Actor* thisx, GlobalContext* globalCtx); + void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx); void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx); -void EnAnubiceTag_Update(EnAnubiceTag* this, GlobalContext* globalCtx); -void EnAnubiceTag_Draw(EnAnubiceTag* this, GlobalContext* globalCtx); const ActorInit En_Anubice_Tag_InitVars = { ACTOR_EN_ANUBICE_TAG, @@ -29,12 +32,14 @@ const ActorInit En_Anubice_Tag_InitVars = { (ActorFunc)EnAnubiceTag_Draw, }; -void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx) { +void EnAnubiceTag_Init(Actor* thisx, GlobalContext* globalCtx) { + EnAnubiceTag* this = THIS; + osSyncPrintf("\n\n"); // "Anubis control tag generated" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ アヌビス制御タグ発生 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); - if (this->actor.params < (s16)0xFFFF) { + if (this->actor.params < -1) { this->actor.params = 0; } if (this->actor.params != 0) { @@ -43,7 +48,7 @@ void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx) { this->actionFunc = &EnAnubiceTag_SpawnAnubis; } -void EnAnubiceTag_Destroy(EnAnubiceTag* this, GlobalContext* globalCtx) { +void EnAnubiceTag_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { @@ -94,11 +99,15 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { } } -void EnAnubiceTag_Update(EnAnubiceTag* this, GlobalContext* globalCtx) { +void EnAnubiceTag_Update(Actor* thisx, GlobalContext* globalCtx) { + EnAnubiceTag* this = THIS; + this->actionFunc(this, globalCtx); } -void EnAnubiceTag_Draw(EnAnubiceTag* this, GlobalContext* globalCtx) { +void EnAnubiceTag_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnAnubiceTag* this = THIS; + if (BREG(0) != 0) { DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, diff --git a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c index 3694c1d4fd..a6cfcb2dfa 100644 --- a/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c +++ b/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000010 -void EnArowTrap_Init(EnArowTrap* this, GlobalContext* globalCtx); -void EnArowTrap_Destroy(EnArowTrap* this, GlobalContext* globalCtx); -void EnArowTrap_Update(EnArowTrap* this, GlobalContext* globalCtx); +#define THIS ((EnArowTrap*)thisx) + +void EnArowTrap_Init(Actor* thisx, GlobalContext* globalCtx); +void EnArowTrap_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnArowTrap_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Arow_Trap_InitVars = { ACTOR_EN_AROW_TRAP, @@ -24,17 +26,21 @@ const ActorInit En_Arow_Trap_InitVars = { NULL, }; -void EnArowTrap_Init(EnArowTrap* this, GlobalContext* globalCtx) { +void EnArowTrap_Init(Actor* thisx, GlobalContext* globalCtx) { + EnArowTrap* this = THIS; + Actor_SetScale(&this->actor, 0.01); this->unk_14C = 0; this->attackTimer = 80; this->actor.posRot2.pos = this->actor.posRot.pos; } -void EnArowTrap_Destroy(EnArowTrap* this, GlobalContext* globalCtx) { +void EnArowTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void EnArowTrap_Update(EnArowTrap* this, GlobalContext* globalCtx) { +void EnArowTrap_Update(Actor* thisx, GlobalContext* globalCtx) { + EnArowTrap* this = THIS; + if (this->actor.xzDistanceFromLink <= 400) { this->attackTimer--; diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 1380928dec..694419d904 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EnArrow_Init(EnArrow* this, GlobalContext* globalCtx); -void EnArrow_Destroy(EnArrow* this, GlobalContext* globalCtx); -void EnArrow_Update(EnArrow* this, GlobalContext* globalCtx); -void EnArrow_Draw(EnArrow* this, GlobalContext* globalCtx); +#define THIS ((EnArrow*)thisx) + +void EnArrow_Init(Actor* thisx, GlobalContext* globalCtx); +void EnArrow_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnArrow_Update(Actor* thisx, GlobalContext* globalCtx); +void EnArrow_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Arrow_InitVars = { diff --git a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 5e3867d531..78ff7a6627 100644 --- a/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnAttackNiw_Init(EnAttackNiw* this, GlobalContext* globalCtx); -void EnAttackNiw_Destroy(EnAttackNiw* this, GlobalContext* globalCtx); -void EnAttackNiw_Update(EnAttackNiw* this, GlobalContext* globalCtx); -void EnAttackNiw_Draw(EnAttackNiw* this, GlobalContext* globalCtx); +#define THIS ((EnAttackNiw*)thisx) + +void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx); +void EnAttackNiw_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnAttackNiw_Update(Actor* thisx, GlobalContext* globalCtx); +void EnAttackNiw_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Attack_Niw_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index f5f9c71f88..324bd97856 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000015 -void EnBa_Init(EnBa* this, GlobalContext* globalCtx); -void EnBa_Destroy(EnBa* this, GlobalContext* globalCtx); -void EnBa_Update(EnBa* this, GlobalContext* globalCtx); -void EnBa_Draw(EnBa* this, GlobalContext* globalCtx); +#define THIS ((EnBa*)thisx) + +void EnBa_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBa_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ba_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 7ff3385197..87c239baaa 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -8,10 +8,12 @@ #define FLAGS 0x01000015 -void EnBb_Init(EnBb* this, GlobalContext* globalCtx); -void EnBb_Destroy(EnBb* this, GlobalContext* globalCtx); -void EnBb_Update(EnBb* this, GlobalContext* globalCtx); -void EnBb_Draw(EnBb* this, GlobalContext* globalCtx); +#define THIS ((EnBb*)thisx) + +void EnBb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBb_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBb_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBb_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bb_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c index c81f5d07b0..3fbdef583b 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EnBdfire_Init(EnBdfire* this, GlobalContext* globalCtx); -void EnBdfire_Destroy(EnBdfire* this, GlobalContext* globalCtx); -void EnBdfire_Update(EnBdfire* this, GlobalContext* globalCtx); -void EnBdfire_Draw(EnBdfire* this, GlobalContext* globalCtx); +#define THIS ((EnBdfire*)thisx) + +void EnBdfire_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBdfire_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBdfire_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBdfire_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bdfire_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 6642b0fc70..935f4093f8 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void EnBigokuta_Init(EnBigokuta* this, GlobalContext* globalCtx); -void EnBigokuta_Destroy(EnBigokuta* this, GlobalContext* globalCtx); -void EnBigokuta_Update(EnBigokuta* this, GlobalContext* globalCtx); -void EnBigokuta_Draw(EnBigokuta* this, GlobalContext* globalCtx); +#define THIS ((EnBigokuta*)thisx) + +void EnBigokuta_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBigokuta_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBigokuta_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBigokuta_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bigokuta_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index c5be1e5b0b..41421f9760 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -2,10 +2,12 @@ #define FLAGS 0x00005005 -void EnBili_Init(EnBili* this, GlobalContext* globalCtx); -void EnBili_Destroy(EnBili* this, GlobalContext* globalCtx); -void EnBili_Update(EnBili* this, GlobalContext* globalCtx); -void EnBili_Draw(EnBili* this, GlobalContext* globalCtx); +#define THIS ((EnBili*)thisx) + +void EnBili_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBili_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBili_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBili_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bili_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bird/z_en_bird.c b/src/overlays/actors/ovl_En_Bird/z_en_bird.c index 872a360ea4..652fe685f3 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void EnBird_Init(EnBird* this, GlobalContext* globalCtx); -void EnBird_Destroy(EnBird* this, GlobalContext* globalCtx); -void EnBird_Update(EnBird* this, GlobalContext* globalCtx); -void EnBird_Draw(EnBird* this, GlobalContext* globalCtx); +#define THIS ((EnBird*)thisx) + +void EnBird_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBird_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBird_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBird_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_809C1E00(EnBird* this, s16 params); void func_809C1E40(EnBird* this, GlobalContext* globalCtx); void EnBird_SetupAction(EnBird* this, ActorFunc actionFunc); @@ -41,7 +44,9 @@ void EnBird_SetupAction(EnBird* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void EnBird_Init(EnBird* this, GlobalContext* globalCtx) { +void EnBird_Init(Actor* thisx, GlobalContext* globalCtx) { + EnBird* this = THIS; + Actor_ProcessInitChain(&this->actor, initChain); Actor_SetScale(&this->actor, 0.01); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002190, &D_0600006C, 0, 0, 0); @@ -60,7 +65,7 @@ void EnBird_Init(EnBird* this, GlobalContext* globalCtx) { func_809C1CAC(this, this->actor.params); } -void EnBird_Destroy(EnBird* this, GlobalContext* globalCtx) { +void EnBird_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_809C1CAC(EnBird* this, s16 params) { @@ -117,11 +122,15 @@ void func_809C1E40(EnBird* this, GlobalContext* globalCtx) { } } -void EnBird_Update(EnBird* this, GlobalContext* globalCtx) { +void EnBird_Update(Actor* thisx, GlobalContext* globalCtx) { + EnBird* this = THIS; + this->unk_1B4 += this->unk_1B8; this->actionFunc(this, globalCtx); } -void EnBird_Draw(EnBird* this, GlobalContext* globalCtx) { +void EnBird_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnBird* this = THIS; + SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, 0, NULL, NULL); } diff --git a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index defca311ca..1c5907cac8 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EnBlkobj_Init(EnBlkobj* this, GlobalContext* globalCtx); -void EnBlkobj_Destroy(EnBlkobj* this, GlobalContext* globalCtx); -void EnBlkobj_Update(EnBlkobj* this, GlobalContext* globalCtx); -void EnBlkobj_Draw(EnBlkobj* this, GlobalContext* globalCtx); +#define THIS ((EnBlkobj*)thisx) + +void EnBlkobj_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBlkobj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBlkobj_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBlkobj_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Blkobj_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 556cf84075..fef35f1e21 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnBom_Init(EnBom* this, GlobalContext* globalCtx); -void EnBom_Destroy(EnBom* this, GlobalContext* globalCtx); -void EnBom_Update(EnBom* this, GlobalContext* globalCtx); -void EnBom_Draw(EnBom* this, GlobalContext* globalCtx); +#define THIS ((EnBom*)thisx) + +void EnBom_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBom_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBom_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bom_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index beb18021d7..5828f505e4 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -2,10 +2,12 @@ #define FLAGS 0x08000039 -void EnBomBowlMan_Init(EnBomBowlMan* this, GlobalContext* globalCtx); -void EnBomBowlMan_Destroy(EnBomBowlMan* this, GlobalContext* globalCtx); -void EnBomBowlMan_Update(EnBomBowlMan* this, GlobalContext* globalCtx); -void EnBomBowlMan_Draw(EnBomBowlMan* this, GlobalContext* globalCtx); +#define THIS ((EnBomBowlMan*)thisx) + +void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBomBowlMan_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBomBowlMan_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBomBowlMan_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bom_Bowl_Man_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index f25183fdc6..5c82963fea 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000010 -void EnBomBowlPit_Init(EnBomBowlPit* this, GlobalContext* globalCtx); -void EnBomBowlPit_Destroy(EnBomBowlPit* this, GlobalContext* globalCtx); -void EnBomBowlPit_Update(EnBomBowlPit* this, GlobalContext* globalCtx); +#define THIS ((EnBomBowlPit*)thisx) + +void EnBomBowlPit_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBomBowlPit_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBomBowlPit_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bom_Bowl_Pit_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 6994811364..bb3a2099ed 100644 --- a/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnBomChu_Init(EnBomChu* this, GlobalContext* globalCtx); -void EnBomChu_Destroy(EnBomChu* this, GlobalContext* globalCtx); -void EnBomChu_Update(EnBomChu* this, GlobalContext* globalCtx); -void EnBomChu_Draw(EnBomChu* this, GlobalContext* globalCtx); +#define THIS ((EnBomChu*)thisx) + +void EnBomChu_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBomChu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBomChu_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBomChu_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bom_Chu_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 47ad0a2de7..1647e0038f 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000011 -void EnBombf_Init(EnBombf* this, GlobalContext* globalCtx); -void EnBombf_Destroy(EnBombf* this, GlobalContext* globalCtx); -void EnBombf_Update(EnBombf* this, GlobalContext* globalCtx); -void EnBombf_Draw(EnBombf* this, GlobalContext* globalCtx); +#define THIS ((EnBombf*)thisx) + +void EnBombf_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBombf_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBombf_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bombf_InitVars = { diff --git a/src/overlays/actors/ovl_En_Boom/z_en_boom.c b/src/overlays/actors/ovl_En_Boom/z_en_boom.c index 7a045c0a2a..4b0c223ba0 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -8,12 +8,15 @@ #define FLAGS 0x00000030 +#define THIS ((EnBoom*)thisx) + +void EnBoom_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBoom_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx); + void EnBoom_SetupAction(EnBoom* this, ActorFunc* actionFunc); -void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx); -void EnBoom_Destroy(EnBoom* this, GlobalContext* globalCtx); void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx); -void EnBoom_Update(EnBoom* this, GlobalContext* globalCtx); -void EnBoom_Draw(EnBoom* this, GlobalContext* globalCtx); const ActorInit En_Boom_InitVars = { ACTOR_EN_BOOM, @@ -47,8 +50,8 @@ void EnBoom_SetupAction(EnBoom* this, ActorFunc* actionFunc) { this->actionFunc = actionFunc; } -void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx) { - u32 pad; +void EnBoom_Init(Actor* thisx, GlobalContext* globalCtx) { + EnBoom* this = THIS; TrailEffect trail; this->actor.room = -1; @@ -87,7 +90,9 @@ void EnBoom_Init(EnBoom* this, GlobalContext* globalCtx) { EnBoom_SetupAction(this, &EnBoom_Fly); } -void EnBoom_Destroy(EnBoom* this, GlobalContext* globalCtx) { +void EnBoom_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnBoom* this = THIS; + func_8002709C(globalCtx, this->effect); Collider_DestroyQuad(globalCtx, &this->collider); } @@ -224,8 +229,10 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { } } -void EnBoom_Update(EnBoom* this, GlobalContext* globalCtx) { +void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx) { + EnBoom* this = THIS; Player* player = PLAYER; + if (!(player->stateFlags1 & 0x20000000)) { this->actionFunc(this, globalCtx); Actor_SetHeight(&this->actor, 0.0f); @@ -233,8 +240,8 @@ void EnBoom_Update(EnBoom* this, GlobalContext* globalCtx) { } } -void EnBoom_Draw(EnBoom* this, GlobalContext* globalCtx) { - s32 pad; +void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnBoom* this = THIS; Vec3f mtxDest1; Vec3f mtxDest2; GraphicsContext* gfxCtx; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 7ca83ef78d..2829f83fe0 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnBox_Init(EnBox* this, GlobalContext* globalCtx); -void EnBox_Destroy(EnBox* this, GlobalContext* globalCtx); -void EnBox_Update(EnBox* this, GlobalContext* globalCtx); -void EnBox_Draw(EnBox* this, GlobalContext* globalCtx); +#define THIS ((EnBox*)thisx) + +void EnBox_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBox_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBox_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBox_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Box_InitVars = { diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index 5f10e6eed0..fd9878b8d1 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000005 -void EnBrob_Init(EnBrob* this, GlobalContext* globalCtx); -void EnBrob_Destroy(EnBrob* this, GlobalContext* globalCtx); -void EnBrob_Update(EnBrob* this, GlobalContext* globalCtx); -void EnBrob_Draw(EnBrob* this, GlobalContext* globalCtx); +#define THIS ((EnBrob*)thisx) + +void EnBrob_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBrob_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBrob_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBrob_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Brob_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 461981839e..bd89f6a434 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000001 -void EnBubble_Init(EnBubble* this, GlobalContext* globalCtx); -void EnBubble_Destroy(EnBubble* this, GlobalContext* globalCtx); -void EnBubble_Update(EnBubble* this, GlobalContext* globalCtx); -void EnBubble_Draw(EnBubble* this, GlobalContext* globalCtx); +#define THIS ((EnBubble*)thisx) + +void EnBubble_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBubble_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBubble_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBubble_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bubble_InitVars = { diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index e55d2176a0..6a9056a084 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnButte_Init(EnButte* this, GlobalContext* globalCtx); -void EnButte_Destroy(EnButte* this, GlobalContext* globalCtx); -void EnButte_Update(EnButte* this, GlobalContext* globalCtx); -void EnButte_Draw(EnButte* this, GlobalContext* globalCtx); +#define THIS ((EnButte*)thisx) + +void EnButte_Init(Actor* thisx, GlobalContext* globalCtx); +void EnButte_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnButte_Update(Actor* thisx, GlobalContext* globalCtx); +void EnButte_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Butte_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index a948803894..c434d256c1 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000015 -void EnBw_Init(EnBw* this, GlobalContext* globalCtx); -void EnBw_Destroy(EnBw* this, GlobalContext* globalCtx); -void EnBw_Update(EnBw* this, GlobalContext* globalCtx); -void EnBw_Draw(EnBw* this, GlobalContext* globalCtx); +#define THIS ((EnBw*)thisx) + +void EnBw_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBw_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBw_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBw_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bw_InitVars = { diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index de1b1f4b57..e75ffd09d1 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnBx_Init(EnBx* this, GlobalContext* globalCtx); -void EnBx_Destroy(EnBx* this, GlobalContext* globalCtx); -void EnBx_Update(EnBx* this, GlobalContext* globalCtx); -void EnBx_Draw(EnBx* this, GlobalContext* globalCtx); +#define THIS ((EnBx*)thisx) + +void EnBx_Init(Actor* thisx, GlobalContext* globalCtx); +void EnBx_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnBx_Update(Actor* thisx, GlobalContext* globalCtx); +void EnBx_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Bx_InitVars = { diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index ab578a48ff..fadffbc87c 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000000 -void EnChanger_Init(EnChanger* this, GlobalContext* globalCtx); -void EnChanger_Destroy(EnChanger* this, GlobalContext* globalCtx); -void EnChanger_Update(EnChanger* this, GlobalContext* globalCtx); +#define THIS ((EnChanger*)thisx) + +void EnChanger_Init(Actor* thisx, GlobalContext* globalCtx); +void EnChanger_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnChanger_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Changer_InitVars = { diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 74224b6df5..33ef760987 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void EnClearTag_Init(EnClearTag* this, GlobalContext* globalCtx); -void EnClearTag_Destroy(EnClearTag* this, GlobalContext* globalCtx); -void EnClearTag_Update(EnClearTag* this, GlobalContext* globalCtx); -void EnClearTag_Draw(EnClearTag* this, GlobalContext* globalCtx); +#define THIS ((EnClearTag*)thisx) + +void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx); +void EnClearTag_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnClearTag_Update(Actor* thisx, GlobalContext* globalCtx); +void EnClearTag_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Clear_Tag_InitVars = { diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 92af2de836..bd475e3f60 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -8,10 +8,14 @@ #define FLAGS 0x00000009 -void EnCow_Init(EnCow* this, GlobalContext* globalCtx); -void EnCow_Destroy(EnCow* this, GlobalContext* globalCtx); -void EnCow_Update(EnCow* this, GlobalContext* globalCtx); -void EnCow_Draw(EnCow* this, GlobalContext* globalCtx); +#define THIS ((EnCow*)thisx) + +void EnCow_Init(Actor* thisx, GlobalContext* globalCtx); +void EnCow_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnCow_Update(Actor* thisx, GlobalContext* globalCtx); +void EnCow_Draw(Actor* thisx, GlobalContext* globalCtx); +void func_809DFE98(Actor* thisx, GlobalContext* globalCtx); +void func_809E0070(Actor* thisx, GlobalContext* globalCtx); void func_809DF494(EnCow* this, GlobalContext* globalCtx); void func_809DF6BC(EnCow* this, GlobalContext* globalCtx); @@ -21,8 +25,6 @@ void func_809DF870(EnCow* this, GlobalContext* globalCtx); void func_809DF8FC(EnCow* this, GlobalContext* globalCtx); void func_809DF96C(EnCow* this, GlobalContext* globalCtx); void func_809DFA84(EnCow* this, GlobalContext* globalCtx); -void func_809DFE98(EnCow* this, GlobalContext* globalCtx); -void func_809E0070(EnCow* this, GlobalContext* globalCtx); const ActorInit En_Cow_InitVars = { ACTOR_EN_COW, @@ -99,8 +101,9 @@ void func_809DEF94(EnCow* this) { this->actor.posRot.pos.z += vec.z; } -void EnCow_Init(EnCow* this, GlobalContext* globalCtx) { - s32 pad[2]; +void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { + EnCow* this = THIS; + s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 72.0f); switch (this->actor.params) { @@ -135,8 +138,8 @@ void EnCow_Init(EnCow* this, GlobalContext* globalCtx) { SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06004C30, NULL, this->limbDrawTable, this->transitionDrawTable, 6); SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_06004348); - this->actor.update = (ActorFunc)func_809DFE98; - this->actor.draw = (ActorFunc)func_809E0070; + this->actor.update = func_809DFE98; + this->actor.draw = func_809E0070; this->actionFunc = (ActorFunc)func_809DFA84; func_809DEF94(this); this->actor.flags &= ~0x1; @@ -148,7 +151,9 @@ void EnCow_Init(EnCow* this, GlobalContext* globalCtx) { this->unk_276 = 0; } -void EnCow_Destroy(EnCow* this, GlobalContext* globalCtx) { +void EnCow_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnCow* this = THIS; + if (this->actor.params == 0) { Collider_DestroyCylinder(globalCtx, &this->colliders[0]); Collider_DestroyCylinder(globalCtx, &this->colliders[1]); @@ -289,21 +294,21 @@ void func_809DFA84(EnCow* this, GlobalContext* globalCtx) { } } -void EnCow_Update(EnCow* this, GlobalContext* globalCtx) { +void EnCow_Update(Actor* thisx, GlobalContext* globalCtx) { + EnCow* this = THIS; s32 pad; - CollisionCheckContext* colChckCtx = &globalCtx->colChkCtx; s16 targetX; s16 targetY; Player* player = PLAYER; - CollisionCheck_SetOC(globalCtx, colChckCtx, &this->colliders[0].base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[0].base); if (globalCtx) {} // necessary to match - CollisionCheck_SetOC(globalCtx, colChckCtx, &this->colliders[1].base); - Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[1].base); + Actor_MoveForward(thisx); + func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { if (this->skelAnime.animCurrentSeg == &D_060001CC) { - Audio_PlayActorSound2(&this->actor, NA_SE_EV_COW_CRY); + Audio_PlayActorSound2(thisx, NA_SE_EV_COW_CRY); SkelAnime_ChangeAnim(&this->skelAnime, &D_06004264, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_06004264.genericHeader), 2, 1.0f); } else { @@ -312,10 +317,10 @@ void EnCow_Update(EnCow* this, GlobalContext* globalCtx) { } } this->actionFunc(this, globalCtx); - if ((this->actor.xzDistanceFromLink < 150.0f) && - (ABS(Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->actor.posRot.pos)) < 0xC000)) { - targetX = Math_Vec3f_Pitch(&this->actor.posRot2.pos, &player->actor.posRot2.pos); - targetY = Math_Vec3f_Yaw(&this->actor.posRot2.pos, &player->actor.posRot2.pos) - this->actor.shape.rot.y; + if ((thisx->xzDistanceFromLink < 150.0f) && + (ABS(Math_Vec3f_Yaw(&thisx->posRot.pos, &player->actor.posRot.pos)) < 0xC000)) { + targetX = Math_Vec3f_Pitch(&thisx->posRot2.pos, &player->actor.posRot2.pos); + targetY = Math_Vec3f_Yaw(&thisx->posRot2.pos, &player->actor.posRot2.pos) - thisx->shape.rot.y; if (targetX > 0x1000) { targetX = 0x1000; @@ -337,28 +342,28 @@ void EnCow_Update(EnCow* this, GlobalContext* globalCtx) { Math_SmoothScaleMaxMinS(&this->someRot.y, targetY, 0xA, 0xC8, 0xA); } -void func_809DFE98(EnCow* this, GlobalContext* globalCtx) { - SkelAnime* skelAnime = &this->skelAnime; - AnimationHeader* temp_a0 = &D_06004348; - if (this->skelAnime.animCurrentSeg) {} // necessary to match +void func_809DFE98(Actor* thisx, GlobalContext* globalCtx) { + EnCow* this = THIS; + s32 pad; - if (SkelAnime_FrameUpdateMatrix(skelAnime) != 0) { - if (this->skelAnime.animCurrentSeg == temp_a0) { - SkelAnime_ChangeAnim(skelAnime, &D_06004E98, 1.0f, 0.0f, + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { + if (this->skelAnime.animCurrentSeg == &D_06004348) { + SkelAnime_ChangeAnim(&this->skelAnime, &D_06004E98, 1.0f, 0.0f, (f32)SkelAnime_GetFrameCount(&D_06004E98.genericHeader), 2, 1.0f); } else { - SkelAnime_ChangeAnim(skelAnime, temp_a0, 1.0f, 0.0f, (f32)SkelAnime_GetFrameCount(&temp_a0->genericHeader), - 0, 1.0f); + SkelAnime_ChangeAnim(&this->skelAnime, &D_06004348, 1.0f, 0.0f, + (f32)SkelAnime_GetFrameCount(&D_06004348.genericHeader), 0, 1.0f); } } this->actionFunc(this, globalCtx); } -s32 EnCow_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* this) { - EnCow* thisx = (EnCow*)this; +s32 EnCow_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnCow* this = THIS; + if (limbIndex == 2) { - rot->y += thisx->someRot.y; - rot->x += thisx->someRot.x; + rot->y += this->someRot.y; + rot->x += this->someRot.x; } if (limbIndex == 5) { *dList = NULL; @@ -366,19 +371,23 @@ s32 EnCow_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, return 0; } -void EnCow_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* this) { +void EnCow_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { if (limbIndex == 2) { - Matrix_MultVec3f(&D_809E010C, &this->posRot2.pos); + Matrix_MultVec3f(&D_809E010C, &thisx->posRot2.pos); } } -void EnCow_Draw(EnCow* this, GlobalContext* globalCtx) { +void EnCow_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnCow* this = THIS; + func_800943C8(globalCtx->state.gfxCtx); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, EnCow_OverrideLimbDraw, EnCow_PostLimbDraw, &this->actor); } -void func_809E0070(EnCow* this, GlobalContext* globalCtx) { +void func_809E0070(Actor* thisx, GlobalContext* globalCtx) { + EnCow* this = THIS; + func_800943C8(globalCtx->state.gfxCtx); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL, NULL, &this->actor); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 039196a1cf..2464acaace 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -2,10 +2,12 @@ #define FLAGS 0x00005005 -void EnCrow_Init(EnCrow* this, GlobalContext* globalCtx); -void EnCrow_Destroy(EnCrow* this, GlobalContext* globalCtx); -void EnCrow_Update(EnCrow* this, GlobalContext* globalCtx); -void EnCrow_Draw(EnCrow* this, GlobalContext* globalCtx); +#define THIS ((EnCrow*)thisx) + +void EnCrow_Init(Actor* thisx, GlobalContext* globalCtx); +void EnCrow_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx); +void EnCrow_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Crow_InitVars = { diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 30eb5728c4..e88f8a8b5a 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnCs_Init(EnCs* this, GlobalContext* globalCtx); -void EnCs_Destroy(EnCs* this, GlobalContext* globalCtx); -void EnCs_Update(EnCs* this, GlobalContext* globalCtx); -void EnCs_Draw(EnCs* this, GlobalContext* globalCtx); +#define THIS ((EnCs*)thisx) + +void EnCs_Init(Actor* thisx, GlobalContext* globalCtx); +void EnCs_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnCs_Update(Actor* thisx, GlobalContext* globalCtx); +void EnCs_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Cs_InitVars = { diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 26e6e476c0..8778d810c8 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnDaiku_Init(EnDaiku* this, GlobalContext* globalCtx); -void EnDaiku_Destroy(EnDaiku* this, GlobalContext* globalCtx); -void EnDaiku_Update(EnDaiku* this, GlobalContext* globalCtx); -void EnDaiku_Draw(EnDaiku* this, GlobalContext* globalCtx); +#define THIS ((EnDaiku*)thisx) + +void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDaiku_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDaiku_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Daiku_InitVars = { diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index c5415d3a13..a1a72c9ea8 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnDaikuKakariko_Init(EnDaikuKakariko* this, GlobalContext* globalCtx); -void EnDaikuKakariko_Destroy(EnDaikuKakariko* this, GlobalContext* globalCtx); -void EnDaikuKakariko_Update(EnDaikuKakariko* this, GlobalContext* globalCtx); -void EnDaikuKakariko_Draw(EnDaikuKakariko* this, GlobalContext* globalCtx); +#define THIS ((EnDaikuKakariko*)thisx) + +void EnDaikuKakariko_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDaikuKakariko_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDaikuKakariko_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDaikuKakariko_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Daiku_Kakariko_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 6e5b43b769..bc71f204d1 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnDekubaba_Init(EnDekubaba* this, GlobalContext* globalCtx); -void EnDekubaba_Destroy(EnDekubaba* this, GlobalContext* globalCtx); -void EnDekubaba_Update(EnDekubaba* this, GlobalContext* globalCtx); -void EnDekubaba_Draw(EnDekubaba* this, GlobalContext* globalCtx); +#define THIS ((EnDekubaba*)thisx) + +void EnDekubaba_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDekubaba_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDekubaba_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDekubaba_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dekubaba_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 22cf52d3cd..6f02bef3f2 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000005 -void EnDekunuts_Init(EnDekunuts* this, GlobalContext* globalCtx); -void EnDekunuts_Destroy(EnDekunuts* this, GlobalContext* globalCtx); -void EnDekunuts_Update(EnDekunuts* this, GlobalContext* globalCtx); -void EnDekunuts_Draw(EnDekunuts* this, GlobalContext* globalCtx); +#define THIS ((EnDekunuts*)thisx) + +void EnDekunuts_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDekunuts_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDekunuts_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dekunuts_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 5b5a48a582..25218ed46d 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000415 -void EnDh_Init(EnDh* this, GlobalContext* globalCtx); -void EnDh_Destroy(EnDh* this, GlobalContext* globalCtx); -void EnDh_Update(EnDh* this, GlobalContext* globalCtx); -void EnDh_Draw(EnDh* this, GlobalContext* globalCtx); +#define THIS ((EnDh*)thisx) + +void EnDh_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDh_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDh_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDh_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dh_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index 75d8f2ccd9..cf679218dd 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000015 -void EnDha_Init(EnDha* this, GlobalContext* globalCtx); -void EnDha_Destroy(EnDha* this, GlobalContext* globalCtx); -void EnDha_Update(EnDha* this, GlobalContext* globalCtx); -void EnDha_Draw(EnDha* this, GlobalContext* globalCtx); +#define THIS ((EnDha*)thisx) + +void EnDha_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDha_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDha_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDha_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dha_InitVars = { diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index f9f9ff5a4b..aa03e6e7d9 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnDivingGame_Init(EnDivingGame* this, GlobalContext* globalCtx); -void EnDivingGame_Destroy(EnDivingGame* this, GlobalContext* globalCtx); -void EnDivingGame_Update(EnDivingGame* this, GlobalContext* globalCtx); -void EnDivingGame_Draw(EnDivingGame* this, GlobalContext* globalCtx); +#define THIS ((EnDivingGame*)thisx) + +void EnDivingGame_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDivingGame_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDivingGame_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDivingGame_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Diving_Game_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 57ac47fee7..4b9df50b14 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnDns_Init(EnDns* this, GlobalContext* globalCtx); -void EnDns_Destroy(EnDns* this, GlobalContext* globalCtx); -void EnDns_Update(EnDns* this, GlobalContext* globalCtx); -void EnDns_Draw(EnDns* this, GlobalContext* globalCtx); +#define THIS ((EnDns*)thisx) + +void EnDns_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDns_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDns_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDns_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dns_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 1067009e36..74af8d25ea 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000000 -void EnDntDemo_Init(EnDntDemo* this, GlobalContext* globalCtx); -void EnDntDemo_Destroy(EnDntDemo* this, GlobalContext* globalCtx); -void EnDntDemo_Update(EnDntDemo* this, GlobalContext* globalCtx); +#define THIS ((EnDntDemo*)thisx) + +void EnDntDemo_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDntDemo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDntDemo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dnt_Demo_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index e15bfa02d5..b611e6b6de 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnDntJiji_Init(EnDntJiji* this, GlobalContext* globalCtx); -void EnDntJiji_Destroy(EnDntJiji* this, GlobalContext* globalCtx); -void EnDntJiji_Update(EnDntJiji* this, GlobalContext* globalCtx); -void EnDntJiji_Draw(EnDntJiji* this, GlobalContext* globalCtx); +#define THIS ((EnDntJiji*)thisx) + +void EnDntJiji_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDntJiji_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDntJiji_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDntJiji_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dnt_Jiji_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 5b8b916f84..ef75051c0c 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000030 -void EnDntNomal_Init(EnDntNomal* this, GlobalContext* globalCtx); -void EnDntNomal_Destroy(EnDntNomal* this, GlobalContext* globalCtx); -void EnDntNomal_Update(EnDntNomal* this, GlobalContext* globalCtx); +#define THIS ((EnDntNomal*)thisx) + +void EnDntNomal_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDntNomal_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDntNomal_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dnt_Nomal_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index c8163b0273..fb61fb7395 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnDodojr_Init(EnDodojr* this, GlobalContext* globalCtx); -void EnDodojr_Destroy(EnDodojr* this, GlobalContext* globalCtx); -void EnDodojr_Update(EnDodojr* this, GlobalContext* globalCtx); -void EnDodojr_Draw(EnDodojr* this, GlobalContext* globalCtx); +#define THIS ((EnDodojr*)thisx) + +void EnDodojr_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDodojr_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDodojr_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDodojr_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dodojr_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index f7a89b09a9..623b1e79cb 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000015 -void EnDodongo_Init(EnDodongo* this, GlobalContext* globalCtx); -void EnDodongo_Destroy(EnDodongo* this, GlobalContext* globalCtx); -void EnDodongo_Update(EnDodongo* this, GlobalContext* globalCtx); -void EnDodongo_Draw(EnDodongo* this, GlobalContext* globalCtx); +#define THIS ((EnDodongo*)thisx) + +void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDodongo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDodongo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dodongo_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index fa42989f20..a7fcfc5ccb 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void EnDog_Init(EnDog* this, GlobalContext* globalCtx); -void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx); -void EnDog_Update(EnDog* this, GlobalContext* globalCtx); -void EnDog_Draw(EnDog* this, GlobalContext* globalCtx); +#define THIS ((EnDog*)thisx) + +void EnDog_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDog_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDog_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDog_Draw(Actor* thisx, GlobalContext* globalCtx); void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx); void EnDog_ChooseMovement(EnDog* this, GlobalContext* globalCtx); @@ -218,16 +220,14 @@ s32 EnDog_Orient(EnDog* this, GlobalContext* globalCtx) { } } -void EnDog_Init(EnDog* this, GlobalContext* globalCtx) { - SkelAnime* skelAnime; +void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) { + EnDog* this = THIS; s16 followingDog; - ColliderCylinder* collider; + s32 pad; - collider = &this->collider; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); - skelAnime = &this->skelAnime; - SkelAnime_InitSV(globalCtx, skelAnime, &D_06007290, NULL, &this->unk_1F4, &this->unk_242, 13); - func_80034EC0(skelAnime, animations, 0); + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06007290, NULL, &this->unk_1F4, &this->unk_242, 13); + func_80034EC0(&this->skelAnime, animations, 0); if ((this->actor.params & 0x8000) == 0) { this->actor.params = (this->actor.params & 0xF0FF) | ((((this->actor.params & 0x0F00) >> 8) + 1) << 8); @@ -239,8 +239,8 @@ void EnDog_Init(EnDog* this, GlobalContext* globalCtx) { return; } - Collider_InitCylinder(globalCtx, collider); - Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit); Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; @@ -277,9 +277,9 @@ void EnDog_Init(EnDog* this, GlobalContext* globalCtx) { } } -void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void EnDog_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnDog* this = THIS; + Collider_DestroyCylinder(globalCtx, &this->collider); } void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) { @@ -428,9 +428,9 @@ void EnDog_Wait(EnDog* this, GlobalContext* globalCtx) { } } -void EnDog_Update(EnDog* this, GlobalContext* globalCtx) { - s32 pad1; - s32 pad2; +void EnDog_Update(Actor* thisx, GlobalContext* globalCtx) { + EnDog* this = THIS; + s32 pad; EnDog_PlayAnimAndSFX(this); SkelAnime_FrameUpdateMatrix(&this->skelAnime); @@ -441,15 +441,15 @@ void EnDog_Update(EnDog* this, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } -s32 EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) { +s32 EnDog_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { return 0; } -void EnDog_Callback2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) { +void EnDog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { } -void EnDog_Draw(EnDog* this, GlobalContext* globalCtx) { - s32 pad; +void EnDog_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnDog* this = THIS; Color_RGBA8 colors[] = { { 0xFF, 0xFF, 0xC8, 0x00 }, { 0x96, 0x64, 0x32, 0x00 } }; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; @@ -463,6 +463,6 @@ void EnDog_Draw(EnDog* this, GlobalContext* globalCtx) { colors[this->actor.params & 0xF].b, colors[this->actor.params & 0xF].a); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, - EnDog_Callback1, EnDog_Callback2, &this->actor); + EnDog_OverrideLimbDraw, EnDog_PostLimbDraw, &this->actor); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_dog.c", 994); } diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 828bc3eb8e..8031bbd71d 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnDoor_Init(EnDoor* this, GlobalContext* globalCtx); -void EnDoor_Destroy(EnDoor* this, GlobalContext* globalCtx); -void EnDoor_Update(EnDoor* this, GlobalContext* globalCtx); -void EnDoor_Draw(EnDoor* this, GlobalContext* globalCtx); +#define THIS ((EnDoor*)thisx) + +void EnDoor_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDoor_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDoor_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDoor_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Door_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index a5e8426115..7ae8a22a22 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000009 -void EnDs_Init(EnDs* this, GlobalContext* globalCtx); -void EnDs_Destroy(EnDs* this, GlobalContext* globalCtx); -void EnDs_Update(EnDs* this, GlobalContext* globalCtx); -void EnDs_Draw(EnDs* this, GlobalContext* globalCtx); +#define THIS ((EnDs*)thisx) + +void EnDs_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDs_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDs_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDs_Draw(Actor* thisx, GlobalContext* globalCtx); void EnDs_Talk(EnDs* this, GlobalContext* globalCtx); void EnDs_TalkNoEmptyBottle(EnDs* this, GlobalContext* globalCtx); @@ -28,9 +30,6 @@ void EnDs_GiveBluePotion(EnDs* this, GlobalContext* globalCtx); void EnDs_OfferBluePotion(EnDs* this, GlobalContext* globalCtx); void EnDs_Wait(EnDs* this, GlobalContext* globalCtx); -UNK_TYPE func_809FDA38(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnDs* this); -void func_809FDA7C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* this); - const ActorInit En_Ds_InitVars = { ACTOR_EN_DS, ACTORTYPE_NPC, @@ -48,11 +47,11 @@ extern AnimationHeader D_0600039C; Vec3f mtxSrc = { 1100.0f, 500.0f, 0.0f }; -void EnDs_Init(EnDs* this, GlobalContext* globalCtx) { - SkelAnime* skelAnime = &this->skelAnime; +void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) { + EnDs* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); - SkelAnime_InitSV(globalCtx, skelAnime, &D_06004768, &D_0600039C, &this->limbDrawTable, &this->unk_1B4, 6); + SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06004768, &D_0600039C, &this->limbDrawTable, &this->unk_1B4, 6); SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600039C); this->actor.colChkInfo.mass = 0xFF; @@ -66,7 +65,7 @@ void EnDs_Init(EnDs* this, GlobalContext* globalCtx) { this->unk_1E4 = 0.0f; } -void EnDs_Destroy(EnDs* this, GlobalContext* globalCtx) { +void EnDs_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnDs_Talk(EnDs* this, GlobalContext* globalCtx) { @@ -251,7 +250,9 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) { } } -void EnDs_Update(EnDs* this, GlobalContext* globalCtx) { +void EnDs_Update(Actor* thisx, GlobalContext* globalCtx) { + EnDs* this = THIS; + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) { this->skelAnime.animCurrentFrame = 0.0f; } @@ -268,8 +269,8 @@ void EnDs_Update(EnDs* this, GlobalContext* globalCtx) { } } -UNK_TYPE func_809FDA38(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnDs* this) { - EnDs* enDs = this; +s32 EnDs_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnDs* this = THIS; if (limbIndex == 5) { rot->x += this->unk_1D8.y; @@ -278,14 +279,16 @@ UNK_TYPE func_809FDA38(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec return 0; } -void func_809FDA7C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) { +void EnDs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { if (limbIndex == 5) { - Matrix_MultVec3f(&mtxSrc, &actor->posRot2.pos); + Matrix_MultVec3f(&mtxSrc, &thisx->posRot2.pos); } } -void EnDs_Draw(EnDs* this, GlobalContext* globalCtx) { +void EnDs_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnDs* this = THIS; + func_800943C8(globalCtx->state.gfxCtx); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, - &func_809FDA38, &func_809FDA7C, this); + EnDs_OverrideLimbDraw, EnDs_PostLimbDraw, this); } diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index adb34719ca..a98c8f10c3 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000009 -void EnDu_Init(EnDu* this, GlobalContext* globalCtx); -void EnDu_Destroy(EnDu* this, GlobalContext* globalCtx); -void EnDu_Update(EnDu* this, GlobalContext* globalCtx); -void EnDu_Draw(EnDu* this, GlobalContext* globalCtx); +#define THIS ((EnDu*)thisx) + +void EnDu_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDu_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDu_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Du_InitVars = { diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 04e75c2694..64436f7c9f 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnDyExtra_Init(EnDyExtra* this, GlobalContext* globalCtx); -void EnDyExtra_Destroy(EnDyExtra* this, GlobalContext* globalCtx); -void EnDyExtra_Update(EnDyExtra* this, GlobalContext* globalCtx); -void EnDyExtra_Draw(EnDyExtra* this, GlobalContext* globalCtx); +#define THIS ((EnDyExtra*)thisx) + +void EnDyExtra_Init(Actor* thisx, GlobalContext* globalCtx); +void EnDyExtra_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnDyExtra_Update(Actor* thisx, GlobalContext* globalCtx); +void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dy_Extra_InitVars = { diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 1ade84a120..83e80813e0 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -10,11 +10,14 @@ #define FLAGS 0x00000010 -void EnEg_Init(EnEg* this, GlobalContext* globalCtx); -void EnEg_Destroy(EnEg* this, GlobalContext* globalCtx); +#define THIS ((EnEg*)thisx) + +void EnEg_Init(Actor* thisx, GlobalContext* globalCtx); +void EnEg_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnEg_Update(Actor* thisx, GlobalContext* globalCtx); +void EnEg_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_809FFDC8(EnEg* this, GlobalContext* globalCtx); -void EnEg_Update(EnEg* this, GlobalContext* globalCtx); -void EnEg_Draw(EnEg* this, GlobalContext* globalCtx); static bool hasVoidedOut = false; static const ActorFunc funcTbl[] = { @@ -37,10 +40,12 @@ void EnEg_PlayVoidOutSFX() { func_800788CC(NA_SE_OC_ABYSS); } -void EnEg_Destroy(EnEg* this, GlobalContext* globalCtx) { +void EnEg_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void EnEg_Init(EnEg* this, GlobalContext* globalCtx) { +void EnEg_Init(Actor* thisx, GlobalContext* globalCtx) { + EnEg* this = THIS; + this->funcIndex = 0; } @@ -56,7 +61,8 @@ void func_809FFDC8(EnEg* this, GlobalContext* globalCtx) { } } -void EnEg_Update(EnEg* this, GlobalContext* globalCtx) { +void EnEg_Update(Actor* thisx, GlobalContext* globalCtx) { + EnEg* this = THIS; s32 funcIndex = this->funcIndex; if (((funcIndex < 0) || (0 < funcIndex)) || (funcTbl[funcIndex] == NULL)) { @@ -67,5 +73,5 @@ void EnEg_Update(EnEg* this, GlobalContext* globalCtx) { } } -void EnEg_Draw(EnEg* this, GlobalContext* globalCtx) { +void EnEg_Draw(Actor* thisx, GlobalContext* globalCtx) { } diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index e3bac958ad..154d26f1a8 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnEiyer_Init(EnEiyer* this, GlobalContext* globalCtx); -void EnEiyer_Destroy(EnEiyer* this, GlobalContext* globalCtx); -void EnEiyer_Update(EnEiyer* this, GlobalContext* globalCtx); -void EnEiyer_Draw(EnEiyer* this, GlobalContext* globalCtx); +#define THIS ((EnEiyer*)thisx) + +void EnEiyer_Init(Actor* thisx, GlobalContext* globalCtx); +void EnEiyer_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnEiyer_Update(Actor* thisx, GlobalContext* globalCtx); +void EnEiyer_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Eiyer_InitVars = { diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 462df8e6f0..f82fe42c17 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000030 -void EnElf_Init(EnElf* this, GlobalContext* globalCtx); -void EnElf_Destroy(EnElf* this, GlobalContext* globalCtx); -void EnElf_Update(EnElf* this, GlobalContext* globalCtx); -void EnElf_Draw(EnElf* this, GlobalContext* globalCtx); +#define THIS ((EnElf*)thisx) + +void EnElf_Init(Actor* thisx, GlobalContext* globalCtx); +void EnElf_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnElf_Update(Actor* thisx, GlobalContext* globalCtx); +void EnElf_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Elf_InitVars = { diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index cb06d93f6b..b6eac3a9b1 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -2,8 +2,10 @@ #define FLAGS 0x08000010 -void EnEncount1_Init(EnEncount1* this, GlobalContext* globalCtx); -void EnEncount1_Update(EnEncount1* this, GlobalContext* globalCtx); +#define THIS ((EnEncount1*)thisx) + +void EnEncount1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnEncount1_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Encount1_InitVars = { diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 4c4e2e15d0..1de23dc478 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000030 -void EnEncount2_Init(EnEncount2* this, GlobalContext* globalCtx); -void EnEncount2_Update(EnEncount2* this, GlobalContext* globalCtx); -void EnEncount2_Draw(EnEncount2* this, GlobalContext* globalCtx); +#define THIS ((EnEncount2*)thisx) + +void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnEncount2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Encount2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 4cffa67d2e..d34ef660c4 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnExItem_Init(EnExItem* this, GlobalContext* globalCtx); -void EnExItem_Destroy(EnExItem* this, GlobalContext* globalCtx); -void EnExItem_Update(EnExItem* this, GlobalContext* globalCtx); -void EnExItem_Draw(EnExItem* this, GlobalContext* globalCtx); +#define THIS ((EnExItem*)thisx) + +void EnExItem_Init(Actor* thisx, GlobalContext* globalCtx); +void EnExItem_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnExItem_Update(Actor* thisx, GlobalContext* globalCtx); +void EnExItem_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ex_Item_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 26429f54a7..eb94403223 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnExRuppy_Init(EnExRuppy* this, GlobalContext* globalCtx); -void EnExRuppy_Destroy(EnExRuppy* this, GlobalContext* globalCtx); -void EnExRuppy_Update(EnExRuppy* this, GlobalContext* globalCtx); -void EnExRuppy_Draw(EnExRuppy* this, GlobalContext* globalCtx); +#define THIS ((EnExRuppy*)thisx) + +void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx); +void EnExRuppy_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnExRuppy_Update(Actor* thisx, GlobalContext* globalCtx); +void EnExRuppy_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ex_Ruppy_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index f68aa23aec..30947bc3a3 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000215 -void EnFd_Init(EnFd* this, GlobalContext* globalCtx); -void EnFd_Destroy(EnFd* this, GlobalContext* globalCtx); -void EnFd_Update(EnFd* this, GlobalContext* globalCtx); -void EnFd_Draw(EnFd* this, GlobalContext* globalCtx); +#define THIS ((EnFd*)thisx) + +void EnFd_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFd_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFd_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fd_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 8635d37f61..e39d7a3dd1 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000015 -void EnFdFire_Init(EnFdFire* this, GlobalContext* globalCtx); -void EnFdFire_Destroy(EnFdFire* this, GlobalContext* globalCtx); -void EnFdFire_Update(EnFdFire* this, GlobalContext* globalCtx); -void EnFdFire_Draw(EnFdFire* this, GlobalContext* globalCtx); +#define THIS ((EnFdFire*)thisx) + +void EnFdFire_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFdFire_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFdFire_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFdFire_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fd_Fire_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 9cc4b9ce78..988002a5c4 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnFhgFire_Init(EnFhgFire* this, GlobalContext* globalCtx); -void EnFhgFire_Destroy(EnFhgFire* this, GlobalContext* globalCtx); -void EnFhgFire_Update(EnFhgFire* this, GlobalContext* globalCtx); -void EnFhgFire_Draw(EnFhgFire* this, GlobalContext* globalCtx); +#define THIS ((EnFhgFire*)thisx) + +void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFhgFire_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFhgFire_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFhgFire_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fhg_Fire_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index c97b31d085..6757810228 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnFireRock_Init(EnFireRock* this, GlobalContext* globalCtx); -void EnFireRock_Destroy(EnFireRock* this, GlobalContext* globalCtx); -void EnFireRock_Update(EnFireRock* this, GlobalContext* globalCtx); -void EnFireRock_Draw(EnFireRock* this, GlobalContext* globalCtx); +#define THIS ((EnFireRock*)thisx) + +void EnFireRock_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFireRock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFireRock_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFireRock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fire_Rock_InitVars = { diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index ac3d2042bc..6ff0a44b02 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -2,10 +2,12 @@ #define FLAGS 0x00005005 -void EnFirefly_Init(EnFirefly* this, GlobalContext* globalCtx); -void EnFirefly_Destroy(EnFirefly* this, GlobalContext* globalCtx); -void EnFirefly_Update(EnFirefly* this, GlobalContext* globalCtx); -void EnFirefly_Draw(EnFirefly* this, GlobalContext* globalCtx); +#define THIS ((EnFirefly*)thisx) + +void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFirefly_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFirefly_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Firefly_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 77087df19e..4ce3566c12 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnFish_Init(EnFish* this, GlobalContext* globalCtx); -void EnFish_Destroy(EnFish* this, GlobalContext* globalCtx); -void EnFish_Update(EnFish* this, GlobalContext* globalCtx); -void EnFish_Draw(EnFish* this, GlobalContext* globalCtx); +#define THIS ((EnFish*)thisx) + +void EnFish_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFish_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFish_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFish_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fish_InitVars = { diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 4b47c33f93..1a8eb4b4e2 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000405 -void EnFloormas_Init(EnFloormas* this, GlobalContext* globalCtx); -void EnFloormas_Destroy(EnFloormas* this, GlobalContext* globalCtx); -void EnFloormas_Update(EnFloormas* this, GlobalContext* globalCtx); -void EnFloormas_Draw(EnFloormas* this, GlobalContext* globalCtx); +#define THIS ((EnFloormas*)thisx) + +void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFloormas_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFloormas_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Floormas_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index a6b2ac9970..20b26f7b57 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -2,9 +2,11 @@ #define FLAGS 0x02000019 -void EnFr_Init(EnFr* this, GlobalContext* globalCtx); -void EnFr_Destroy(EnFr* this, GlobalContext* globalCtx); -void EnFr_Update(EnFr* this, GlobalContext* globalCtx); +#define THIS ((EnFr*)thisx) + +void EnFr_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFr_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFr_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fr_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 1c4c49bc45..dc1fcd16d5 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000019 -void EnFu_Init(EnFu* this, GlobalContext* globalCtx); -void EnFu_Destroy(EnFu* this, GlobalContext* globalCtx); -void EnFu_Update(EnFu* this, GlobalContext* globalCtx); -void EnFu_Draw(EnFu* this, GlobalContext* globalCtx); +#define THIS ((EnFu*)thisx) + +void EnFu_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFu_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFu_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fu_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 9262d6a9a0..ff6b8da1fc 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000215 -void EnFw_Init(EnFw* this, GlobalContext* globalCtx); -void EnFw_Destroy(EnFw* this, GlobalContext* globalCtx); -void EnFw_Update(EnFw* this, GlobalContext* globalCtx); -void EnFw_Draw(EnFw* this, GlobalContext* globalCtx); +#define THIS ((EnFw*)thisx) + +void EnFw_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFw_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFw_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFw_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fw_InitVars = { diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 0e290ee6af..b36dc72e94 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000415 -void EnFz_Init(EnFz* this, GlobalContext* globalCtx); -void EnFz_Destroy(EnFz* this, GlobalContext* globalCtx); -void EnFz_Update(EnFz* this, GlobalContext* globalCtx); -void EnFz_Draw(EnFz* this, GlobalContext* globalCtx); +#define THIS ((EnFz*)thisx) + +void EnFz_Init(Actor* thisx, GlobalContext* globalCtx); +void EnFz_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnFz_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFz_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Fz_InitVars = { diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index f688671ab9..bde8ef9313 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000030 -void EnGSwitch_Init(EnGSwitch* this, GlobalContext* globalCtx); -void EnGSwitch_Destroy(EnGSwitch* this, GlobalContext* globalCtx); -void EnGSwitch_Update(EnGSwitch* this, GlobalContext* globalCtx); +#define THIS ((EnGSwitch*)thisx) + +void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGSwitch_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGSwitch_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_G_Switch_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 79bcd78274..5089d9f668 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnGanonMant_Init(EnGanonMant* this, GlobalContext* globalCtx); -void EnGanonMant_Destroy(EnGanonMant* this, GlobalContext* globalCtx); -void EnGanonMant_Update(EnGanonMant* this, GlobalContext* globalCtx); -void EnGanonMant_Draw(EnGanonMant* this, GlobalContext* globalCtx); +#define THIS ((EnGanonMant*)thisx) + +void EnGanonMant_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGanonMant_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGanonMant_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGanonMant_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ganon_Mant_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c index e1dac1893f..b07971c6e2 100644 --- a/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c +++ b/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.c @@ -10,10 +10,12 @@ #define FLAGS 0x00000030 -void EnGanonOrgan_Init(EnGanonOrgan* this, GlobalContext* globalCtx); -void EnGanonOrgan_Destroy(EnGanonOrgan* this, GlobalContext* globalCtx); -void EnGanonOrgan_Update(EnGanonOrgan* this, GlobalContext* globalCtx); -void EnGanonOrgan_Draw(EnGanonOrgan* this, GlobalContext* globalCtx); +#define THIS ((EnGanonOrgan*)thisx) + +void EnGanonOrgan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGanonOrgan_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGanonOrgan_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGanonOrgan_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Ganon_Organ_InitVars = { ACTOR_EN_GANON_ORGAN, @@ -30,21 +32,21 @@ const ActorInit En_Ganon_Organ_InitVars = { extern D_80A2CCA8; // remove when data is decompiled extern D_80A2EAB0; // remove when data is decompiled -void EnGanonOrgan_Init(EnGanonOrgan* this, GlobalContext* globalCtx) { - this->actor.flags &= ~1; +void EnGanonOrgan_Init(Actor* thisx, GlobalContext* globalCtx) { + thisx->flags &= ~1; } -void EnGanonOrgan_Destroy(EnGanonOrgan* this, GlobalContext* globalCtx) { +void EnGanonOrgan_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void EnGanonOrgan_Update(EnGanonOrgan* this, GlobalContext* globalCtx) { +void EnGanonOrgan_Update(Actor* thisx, GlobalContext* globalCtx) { BossGanon* dorf; osSyncPrintf("ORGAN MOVE 1\n"); - if (this->actor.params == 1) { - dorf = (BossGanon*)this->actor.attachedA; + if (thisx->params == 1) { + dorf = (BossGanon*)thisx->attachedA; if (dorf->organFadeTimer == 0) { - Actor_Kill(&this->actor); + Actor_Kill(thisx); } } osSyncPrintf("ORGAN MOVE 2\n"); @@ -91,17 +93,17 @@ Gfx* func_80A28148(GraphicsContext* gfxCtx, BossGanon* dorf) { return displayList; } -void EnGanonOrgan_Draw(EnGanonOrgan* this, GlobalContext* globalCtx) { +void EnGanonOrgan_Draw(Actor* thisx, GlobalContext* globalCtx) { BossGanon* dorf; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; - dorf = (BossGanon*)this->actor.attachedA; + dorf = (BossGanon*)thisx->attachedA; gfxCtx = globalCtx->state.gfxCtx; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ganon_organ.c", 205); osSyncPrintf("ORGAN DRAW 1\n"); func_80093D18(globalCtx->state.gfxCtx); - if ((this->actor.params == 1) && (dorf->organFadeTimer != 0xff)) { + if ((thisx->params == 1) && (dorf->organFadeTimer != 0xff)) { gSPSegment(gfxCtx->polyOpa.p++, 0x08, func_80A280BC(globalCtx->state.gfxCtx, dorf)); gSPSegment(gfxCtx->polyOpa.p++, 0x09, func_80A28148(globalCtx->state.gfxCtx, dorf)); } else { diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 4cf5a332b9..a35810e09c 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnGb_Init(EnGb* this, GlobalContext* globalCtx); -void EnGb_Destroy(EnGb* this, GlobalContext* globalCtx); -void EnGb_Update(EnGb* this, GlobalContext* globalCtx); -void EnGb_Draw(EnGb* this, GlobalContext* globalCtx); +#define THIS ((EnGb*)thisx) + +void EnGb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGb_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGb_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGb_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Gb_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index fe0b6d725d..17d5b09b8e 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnGe1_Init(EnGe1* this, GlobalContext* globalCtx); -void EnGe1_Destroy(EnGe1* this, GlobalContext* globalCtx); -void EnGe1_Update(EnGe1* this, GlobalContext* globalCtx); -void EnGe1_Draw(EnGe1* this, GlobalContext* globalCtx); +#define THIS ((EnGe1*)thisx) + +void EnGe1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGe1_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGe1_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGe1_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ge1_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 231bc34b21..9f53de0054 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnGe2_Init(EnGe2* this, GlobalContext* globalCtx); -void EnGe2_Destroy(EnGe2* this, GlobalContext* globalCtx); -void EnGe2_Update(EnGe2* this, GlobalContext* globalCtx); -void EnGe2_Draw(EnGe2* this, GlobalContext* globalCtx); +#define THIS ((EnGe2*)thisx) + +void EnGe2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGe2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGe2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGe2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ge2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 0162ddfe04..6198fdc18c 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000019 -void EnGe3_Init(EnGe3* this, GlobalContext* globalCtx); -void EnGe3_Destroy(EnGe3* this, GlobalContext* globalCtx); -void EnGe3_Update(EnGe3* this, GlobalContext* globalCtx); -void EnGe3_Draw(EnGe3* this, GlobalContext* globalCtx); +#define THIS ((EnGe3*)thisx) + +void EnGe3_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGe3_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGe3_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGe3_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ge3_InitVars = { diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 8f5ebf377d..777eb9d6d7 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000015 -void EnGeldB_Init(EnGeldB* this, GlobalContext* globalCtx); -void EnGeldB_Destroy(EnGeldB* this, GlobalContext* globalCtx); -void EnGeldB_Update(EnGeldB* this, GlobalContext* globalCtx); -void EnGeldB_Draw(EnGeldB* this, GlobalContext* globalCtx); +#define THIS ((EnGeldB*)thisx) + +void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGeldB_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_GeldB_InitVars = { diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 030e11d35d..22fb3e8011 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000019 -void EnGirlA_Init(EnGirlA* this, GlobalContext* globalCtx); -void EnGirlA_Destroy(EnGirlA* this, GlobalContext* globalCtx); -void EnGirlA_Update(EnGirlA* this, GlobalContext* globalCtx); +#define THIS ((EnGirlA*)thisx) + +void EnGirlA_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGirlA_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGirlA_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_GirlA_InitVars = { diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 9c38ccdd7f..2704d08022 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000019 -void EnGm_Init(EnGm* this, GlobalContext* globalCtx); -void EnGm_Destroy(EnGm* this, GlobalContext* globalCtx); -void EnGm_Update(EnGm* this, GlobalContext* globalCtx); +#define THIS ((EnGm*)thisx) + +void EnGm_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGm_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Gm_InitVars = { diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 52e9339d91..5a52fc74f5 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000039 -void EnGo_Init(EnGo* this, GlobalContext* globalCtx); -void EnGo_Destroy(EnGo* this, GlobalContext* globalCtx); -void EnGo_Update(EnGo* this, GlobalContext* globalCtx); -void EnGo_Draw(EnGo* this, GlobalContext* globalCtx); +#define THIS ((EnGo*)thisx) + +void EnGo_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGo_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Go_InitVars = { diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 31f9ce74eb..be21625318 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000039 -void EnGo2_Init(EnGo2* this, GlobalContext* globalCtx); -void EnGo2_Destroy(EnGo2* this, GlobalContext* globalCtx); -void EnGo2_Update(EnGo2* this, GlobalContext* globalCtx); -void EnGo2_Draw(EnGo2* this, GlobalContext* globalCtx); +#define THIS ((EnGo2*)thisx) + +void EnGo2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGo2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGo2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGo2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Go2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index eac098795e..c70dad3e6c 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void EnGoma_Init(EnGoma* this, GlobalContext* globalCtx); -void EnGoma_Destroy(EnGoma* this, GlobalContext* globalCtx); -void EnGoma_Update(EnGoma* this, GlobalContext* globalCtx); -void EnGoma_Draw(EnGoma* this, GlobalContext* globalCtx); +#define THIS ((EnGoma*)thisx) + +void EnGoma_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGoma_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGoma_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGoma_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Goma_InitVars = { diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 8265e83cc1..89c61fa8fc 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnGoroiwa_Init(EnGoroiwa* this, GlobalContext* globalCtx); -void EnGoroiwa_Destroy(EnGoroiwa* this, GlobalContext* globalCtx); -void EnGoroiwa_Update(EnGoroiwa* this, GlobalContext* globalCtx); -void EnGoroiwa_Draw(EnGoroiwa* this, GlobalContext* globalCtx); +#define THIS ((EnGoroiwa*)thisx) + +void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGoroiwa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGoroiwa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Goroiwa_InitVars = { diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index dbb0c6083d..2b4e0a9d03 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000009 -void EnGs_Init(EnGs* this, GlobalContext* globalCtx); -void EnGs_Destroy(EnGs* this, GlobalContext* globalCtx); -void EnGs_Update(EnGs* this, GlobalContext* globalCtx); -void EnGs_Draw(EnGs* this, GlobalContext* globalCtx); +#define THIS ((EnGs*)thisx) + +void EnGs_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGs_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGs_Update(Actor* thisx, GlobalContext* globalCtx); +void EnGs_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Gs_InitVars = { diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 5bbba98691..23ef9d9095 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000019 -void EnGuest_Init(EnGuest* this, GlobalContext* globalCtx); -void EnGuest_Destroy(EnGuest* this, GlobalContext* globalCtx); -void EnGuest_Update(EnGuest* this, GlobalContext* globalCtx); +#define THIS ((EnGuest*)thisx) + +void EnGuest_Init(Actor* thisx, GlobalContext* globalCtx); +void EnGuest_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Guest_InitVars = { diff --git a/src/overlays/actors/ovl_En_Hata/z_en_hata.c b/src/overlays/actors/ovl_En_Hata/z_en_hata.c index fbde62fd56..85722a3026 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void EnHata_Init(EnHata* this, GlobalContext* globalCtx); -void EnHata_Destroy(EnHata* this, GlobalContext* globalCtx); -void EnHata_Update(EnHata* this, GlobalContext* globalCtx); -void EnHata_Draw(EnHata* this, GlobalContext* globalCtx); +#define THIS ((EnHata*)thisx) + +void EnHata_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHata_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHata_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHata_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Hata_InitVars = { diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 1513974720..1b12786318 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnHeishi1_Init(EnHeishi1* this, GlobalContext* globalCtx); -void EnHeishi1_Destroy(EnHeishi1* this, GlobalContext* globalCtx); -void EnHeishi1_Update(EnHeishi1* this, GlobalContext* globalCtx); -void EnHeishi1_Draw(EnHeishi1* this, GlobalContext* globalCtx); +#define THIS ((EnHeishi1*)thisx) + +void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi1_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Heishi1_InitVars = { diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 020f903fb3..0bf559ba7b 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnHeishi2_Init(EnHeishi2* this, GlobalContext* globalCtx); -void EnHeishi2_Destroy(EnHeishi2* this, GlobalContext* globalCtx); -void EnHeishi2_Update(EnHeishi2* this, GlobalContext* globalCtx); -void EnHeishi2_Draw(EnHeishi2* this, GlobalContext* globalCtx); +#define THIS ((EnHeishi2*)thisx) + +void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Heishi2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 55fd6a5983..042e952166 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void EnHeishi3_Init(EnHeishi3* this, GlobalContext* globalCtx); -void EnHeishi3_Destroy(EnHeishi3* this, GlobalContext* globalCtx); -void EnHeishi3_Update(EnHeishi3* this, GlobalContext* globalCtx); -void EnHeishi3_Draw(EnHeishi3* this, GlobalContext* globalCtx); +#define THIS ((EnHeishi3*)thisx) + +void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi3_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi3_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi3_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Heishi3_InitVars = { diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 228c15f43d..cc1bbe89e8 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnHeishi4_Init(EnHeishi4* this, GlobalContext* globalCtx); -void EnHeishi4_Destroy(EnHeishi4* this, GlobalContext* globalCtx); -void EnHeishi4_Update(EnHeishi4* this, GlobalContext* globalCtx); -void EnHeishi4_Draw(EnHeishi4* this, GlobalContext* globalCtx); +#define THIS ((EnHeishi4*)thisx) + +void EnHeishi4_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi4_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi4_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHeishi4_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Heishi4_InitVars = { diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index db442f2562..c44e49ee35 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000005 -void EnHintnuts_Init(EnHintnuts* this, GlobalContext* globalCtx); -void EnHintnuts_Destroy(EnHintnuts* this, GlobalContext* globalCtx); -void EnHintnuts_Update(EnHintnuts* this, GlobalContext* globalCtx); -void EnHintnuts_Draw(EnHintnuts* this, GlobalContext* globalCtx); +#define THIS ((EnHintnuts*)thisx) + +void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHintnuts_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHintnuts_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHintnuts_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Hintnuts_InitVars = { diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 3b99f9c1c5..e2d6d8b018 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnHoll_Init(EnHoll* this, GlobalContext* globalCtx); -void EnHoll_Destroy(EnHoll* this, GlobalContext* globalCtx); -void EnHoll_Update(EnHoll* this, GlobalContext* globalCtx); -void EnHoll_Draw(EnHoll* this, GlobalContext* globalCtx); +#define THIS ((EnHoll*)thisx) + +void EnHoll_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHoll_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHoll_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHoll_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Holl_InitVars = { diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 70d28542b5..a7c05cd72a 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnHonotrap_Init(EnHonotrap* this, GlobalContext* globalCtx); -void EnHonotrap_Destroy(EnHonotrap* this, GlobalContext* globalCtx); -void EnHonotrap_Update(EnHonotrap* this, GlobalContext* globalCtx); -void EnHonotrap_Draw(EnHonotrap* this, GlobalContext* globalCtx); +#define THIS ((EnHonotrap*)thisx) + +void EnHonotrap_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHonotrap_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHonotrap_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHonotrap_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Honotrap_InitVars = { diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index c5cb03df5c..5f1303e8fd 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnHorse_Init(EnHorse* this, GlobalContext* globalCtx); -void EnHorse_Destroy(EnHorse* this, GlobalContext* globalCtx); -void EnHorse_Update(EnHorse* this, GlobalContext* globalCtx); -void EnHorse_Draw(EnHorse* this, GlobalContext* globalCtx); +#define THIS ((EnHorse*)thisx) + +void EnHorse_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHorse_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHorse_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Horse_InitVars = { diff --git a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index 0791b43d1f..2610ea55c4 100644 --- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnHorseGameCheck_Init(EnHorseGameCheck* this, GlobalContext* globalCtx); -void EnHorseGameCheck_Destroy(EnHorseGameCheck* this, GlobalContext* globalCtx); -void EnHorseGameCheck_Update(EnHorseGameCheck* this, GlobalContext* globalCtx); -void EnHorseGameCheck_Draw(EnHorseGameCheck* this, GlobalContext* globalCtx); +#define THIS ((EnHorseGameCheck*)thisx) + +void EnHorseGameCheck_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHorseGameCheck_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHorseGameCheck_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHorseGameCheck_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Horse_Game_Check_InitVars = { diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index d75d47e107..3c62c0bb30 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnHorseGanon_Init(EnHorseGanon* this, GlobalContext* globalCtx); -void EnHorseGanon_Destroy(EnHorseGanon* this, GlobalContext* globalCtx); -void EnHorseGanon_Update(EnHorseGanon* this, GlobalContext* globalCtx); -void EnHorseGanon_Draw(EnHorseGanon* this, GlobalContext* globalCtx); +#define THIS ((EnHorseGanon*)thisx) + +void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHorseGanon_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHorseGanon_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80A68660(unk_D_80A69248* data, s32 index, Vec3f* vec); void func_80A686A8(EnHorseGanon* this, GlobalContext* globalCtx); @@ -21,7 +23,6 @@ void func_80A68AF0(EnHorseGanon* this, GlobalContext* globalCtx); void func_80A68B20(EnHorseGanon* this); void func_80A68DB0(EnHorseGanon* this, GlobalContext* globalCtx); void func_80A68E14(EnHorseGanon* this, GlobalContext* globalCtx); -void func_80A68FA8(EnHorseGanon* this, GlobalContext* globalCtx, ColliderJntSphItem* colliderSphereItem); const ActorInit En_Horse_Ganon_InitVars = { ACTOR_EN_HORSE_GANON, @@ -152,8 +153,8 @@ void func_80A68870(EnHorseGanon* this) { #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Horse_Ganon/func_80A68870.s") #endif -void EnHorseGanon_Init(EnHorseGanon* this, GlobalContext* globalCtx) { - ColliderCylinder* colliderCylinder = &this->colliderCylinder; +void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) { + EnHorseGanon* this = THIS; Actor_ProcessInitChain(&this->actor, initChain); Actor_SetScale(&this->actor, 0.0115f); @@ -169,8 +170,8 @@ void EnHorseGanon_Init(EnHorseGanon* this, GlobalContext* globalCtx) { this->currentAnimation = 0; SkelAnime_ChangeAnimDefaultStop(&this->skin.skelAnime, D_80A691B0[0]); - Collider_InitCylinder(globalCtx, colliderCylinder); - Collider_SetCylinder(globalCtx, colliderCylinder, &this->actor, &cylinderInit); + Collider_InitCylinder(globalCtx, &this->colliderCylinder); + Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &cylinderInit); Collider_InitJntSph(globalCtx, &this->colliderSphere); Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &jntsphInit, &this->colliderSphereItem); @@ -178,7 +179,9 @@ void EnHorseGanon_Init(EnHorseGanon* this, GlobalContext* globalCtx) { func_80A68AC4(this); } -void EnHorseGanon_Destroy(EnHorseGanon* this, GlobalContext* globalCtx) { +void EnHorseGanon_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnHorseGanon* this = THIS; + func_800A6888(globalCtx, &this->skin); Collider_DestroyCylinder(globalCtx, &this->colliderCylinder); Collider_DestroyJntSph(globalCtx, &this->colliderSphere); @@ -253,7 +256,7 @@ void func_80A68DB0(EnHorseGanon* this, GlobalContext* globalCtx) { } void func_80A68E14(EnHorseGanon* this, GlobalContext* globalCtx) { - u32 padding; + s32 pad; CollisionPoly* col; f32 temp_ret; Vec3f v; @@ -269,8 +272,9 @@ void func_80A68E14(EnHorseGanon* this, GlobalContext* globalCtx) { this->actor.shape.rot.x = D_80A692D0 * Math_atan2f(this->actor.posRot.pos.y - temp_ret, 30.0f); } -void EnHorseGanon_Update(EnHorseGanon* this, GlobalContext* globalCtx) { - u32 padding[2]; +void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) { + EnHorseGanon* this = THIS; + s32 pad; actionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); @@ -281,13 +285,13 @@ void EnHorseGanon_Update(EnHorseGanon* this, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); } -void func_80A68FA8(EnHorseGanon* this, GlobalContext* globalCtx, ColliderJntSphItem* colliderSphereItem) { +void func_80A68FA8(Actor* thisx, GlobalContext* globalCtx, ColliderJntSphItem* colliderSphereItem) { Vec3f sp4C; Vec3f sp40; - ColliderJntSphItem* temp_v0; + EnHorseGanon* this = THIS; s32 index; - for (index = 0; index < this->colliderSphere.count; index += 1) { + for (index = 0; index < this->colliderSphere.count; index++) { sp4C.x = this->colliderSphere.list[index].dim.modelSphere.center.x; sp4C.y = this->colliderSphere.list[index].dim.modelSphere.center.y; sp4C.z = this->colliderSphere.list[index].dim.modelSphere.center.z; @@ -298,13 +302,15 @@ void func_80A68FA8(EnHorseGanon* this, GlobalContext* globalCtx, ColliderJntSphI this->colliderSphere.list[index].dim.worldSphere.center.y = sp40.y; this->colliderSphere.list[index].dim.worldSphere.center.z = sp40.z; - temp_v0 = &this->colliderSphere.list[index]; - temp_v0->dim.worldSphere.radius = temp_v0->dim.scale * temp_v0->dim.modelSphere.radius; + this->colliderSphere.list[index].dim.worldSphere.radius = + this->colliderSphere.list[index].dim.modelSphere.radius * this->colliderSphere.list[index].dim.scale; } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); } -void EnHorseGanon_Draw(EnHorseGanon* this, GlobalContext* globalCtx) { +void EnHorseGanon_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnHorseGanon* this = THIS; + func_80A68E14(this, globalCtx); func_80093D18(globalCtx->state.gfxCtx); func_800A6330(&this->actor, globalCtx, &this->skin, func_80A68FA8, 1); diff --git a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c index 7ebcdab82d..e74ba5b2c3 100644 --- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c +++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void EnHorseLinkChild_Init(EnHorseLinkChild* this, GlobalContext* globalCtx); -void EnHorseLinkChild_Destroy(EnHorseLinkChild* this, GlobalContext* globalCtx); -void EnHorseLinkChild_Update(EnHorseLinkChild* this, GlobalContext* globalCtx); -void EnHorseLinkChild_Draw(EnHorseLinkChild* this, GlobalContext* globalCtx); +#define THIS ((EnHorseLinkChild*)thisx) + +void EnHorseLinkChild_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHorseLinkChild_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHorseLinkChild_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHorseLinkChild_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Horse_Link_Child_InitVars = { diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 25ff310fe4..62a3996caa 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnHorseNormal_Init(EnHorseNormal* this, GlobalContext* globalCtx); -void EnHorseNormal_Destroy(EnHorseNormal* this, GlobalContext* globalCtx); -void EnHorseNormal_Update(EnHorseNormal* this, GlobalContext* globalCtx); -void EnHorseNormal_Draw(EnHorseNormal* this, GlobalContext* globalCtx); +#define THIS ((EnHorseNormal*)thisx) + +void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHorseNormal_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHorseNormal_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHorseNormal_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Horse_Normal_InitVars = { diff --git a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c index c5e79a3236..74a7ff9d9b 100644 --- a/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c +++ b/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnHorseZelda_Init(EnHorseZelda* this, GlobalContext* globalCtx); -void EnHorseZelda_Destroy(EnHorseZelda* this, GlobalContext* globalCtx); -void EnHorseZelda_Update(EnHorseZelda* this, GlobalContext* globalCtx); -void EnHorseZelda_Draw(EnHorseZelda* this, GlobalContext* globalCtx); +#define THIS ((EnHorseZelda*)thisx) + +void EnHorseZelda_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHorseZelda_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHorseZelda_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHorseZelda_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Horse_Zelda_InitVars = { diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index c9c2d3f171..1b1cdb3178 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnHs_Init(EnHs* this, GlobalContext* globalCtx); -void EnHs_Destroy(EnHs* this, GlobalContext* globalCtx); -void EnHs_Update(EnHs* this, GlobalContext* globalCtx); -void EnHs_Draw(EnHs* this, GlobalContext* globalCtx); +#define THIS ((EnHs*)thisx) + +void EnHs_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHs_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHs_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHs_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Hs_InitVars = { diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 6a6e90e2bc..bea28ce966 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000009 -void EnHs2_Init(EnHs2* this, GlobalContext* globalCtx); -void EnHs2_Destroy(EnHs2* this, GlobalContext* globalCtx); -void EnHs2_Update(EnHs2* this, GlobalContext* globalCtx); -void EnHs2_Draw(EnHs2* this, GlobalContext* globalCtx); +#define THIS ((EnHs2*)thisx) + +void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHs2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHs2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Hs2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index a1024f8ba1..d879e758d8 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnHy_Init(EnHy* this, GlobalContext* globalCtx); -void EnHy_Destroy(EnHy* this, GlobalContext* globalCtx); -void EnHy_Update(EnHy* this, GlobalContext* globalCtx); -void EnHy_Draw(EnHy* this, GlobalContext* globalCtx); +#define THIS ((EnHy*)thisx) + +void EnHy_Init(Actor* thisx, GlobalContext* globalCtx); +void EnHy_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnHy_Update(Actor* thisx, GlobalContext* globalCtx); +void EnHy_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Hy_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index 943b33cc9b..bbf457b239 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnIceHono_Init(EnIceHono* this, GlobalContext* globalCtx); -void EnIceHono_Destroy(EnIceHono* this, GlobalContext* globalCtx); -void EnIceHono_Update(EnIceHono* this, GlobalContext* globalCtx); -void EnIceHono_Draw(EnIceHono* this, GlobalContext* globalCtx); +#define THIS ((EnIceHono*)thisx) + +void EnIceHono_Init(Actor* thisx, GlobalContext* globalCtx); +void EnIceHono_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnIceHono_Update(Actor* thisx, GlobalContext* globalCtx); +void EnIceHono_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ice_Hono_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index c6805684eb..cee7730dd7 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnIk_Init(EnIk* this, GlobalContext* globalCtx); -void EnIk_Destroy(EnIk* this, GlobalContext* globalCtx); -void EnIk_Update(EnIk* this, GlobalContext* globalCtx); -void EnIk_Draw(EnIk* this, GlobalContext* globalCtx); +#define THIS ((EnIk*)thisx) + +void EnIk_Init(Actor* thisx, GlobalContext* globalCtx); +void EnIk_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnIk_Update(Actor* thisx, GlobalContext* globalCtx); +void EnIk_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ik_InitVars = { diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 80864c0961..c15bdc195b 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnIn_Init(EnIn* this, GlobalContext* globalCtx); -void EnIn_Destroy(EnIn* this, GlobalContext* globalCtx); -void EnIn_Update(EnIn* this, GlobalContext* globalCtx); -void EnIn_Draw(EnIn* this, GlobalContext* globalCtx); +#define THIS ((EnIn*)thisx) + +void EnIn_Init(Actor* thisx, GlobalContext* globalCtx); +void EnIn_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnIn_Update(Actor* thisx, GlobalContext* globalCtx); +void EnIn_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_In_InitVars = { diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 0b4d581404..1decd2a5fa 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnInsect_Init(EnInsect* this, GlobalContext* globalCtx); -void EnInsect_Destroy(EnInsect* this, GlobalContext* globalCtx); -void EnInsect_Update(EnInsect* this, GlobalContext* globalCtx); -void EnInsect_Draw(EnInsect* this, GlobalContext* globalCtx); +#define THIS ((EnInsect*)thisx) + +void EnInsect_Init(Actor* thisx, GlobalContext* globalCtx); +void EnInsect_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx); +void EnInsect_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Insect_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index d11c5e1b74..f3380f84d8 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -2,10 +2,12 @@ #define FLAGS 0x00800000 -void EnIshi_Init(EnIshi* this, GlobalContext* globalCtx); -void EnIshi_Destroy(EnIshi* this, GlobalContext* globalCtx); -void EnIshi_Update(EnIshi* this, GlobalContext* globalCtx); -void EnIshi_Draw(EnIshi* this, GlobalContext* globalCtx); +#define THIS ((EnIshi*)thisx) + +void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx); +void EnIshi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnIshi_Update(Actor* thisx, GlobalContext* globalCtx); +void EnIshi_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ishi_InitVars = { diff --git a/src/overlays/actors/ovl_En_It/z_en_it.c b/src/overlays/actors/ovl_En_It/z_en_it.c index 493b4cac63..18b9530870 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void EnIt_Init(EnIt* this, GlobalContext* globalCtx); -void EnIt_Destroy(EnIt* this, GlobalContext* globalCtx); -void EnIt_Update(EnIt* this, GlobalContext* globalCtx); +#define THIS ((EnIt*)thisx) + +void EnIt_Init(Actor* thisx, GlobalContext* globalCtx); +void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnIt_Update(Actor* thisx, GlobalContext* globalCtx); static ColliderCylinderInit cylinderInitData = { { COLTYPE_UNK10, 0x00, 0x00, 0x05, 0x10, COLSHAPE_CYLINDER }, @@ -34,25 +36,25 @@ const ActorInit En_It_InitVars = { (ActorFunc)NULL, }; -void EnIt_Init(EnIt* this, GlobalContext* globalCtx) { - EnIt* it = this; +void EnIt_Init(Actor* thisx, GlobalContext* globalCtx) { + EnIt* this = THIS; - it->actor.params = 0x0D05; - Collider_InitCylinder(globalCtx, &it->collider); - Collider_SetCylinder(globalCtx, &it->collider, &it->actor, &cylinderInitData); - func_80061EFC(&it->actor.colChkInfo, 0, &colChkInfoInit); // Init Damage Chart + this->actor.params = 0x0D05; + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); + func_80061EFC(&this->actor.colChkInfo, 0, &colChkInfoInit); // Init Damage Chart } -void EnIt_Destroy(EnIt* this, GlobalContext* globalCtx) { - EnIt* it = this; +void EnIt_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnIt* this = THIS; - Collider_DestroyCylinder(globalCtx, &it->collider); + Collider_DestroyCylinder(globalCtx, &this->collider); } -void EnIt_Update(EnIt* this, GlobalContext* globalCtx) { +void EnIt_Update(Actor* thisx, GlobalContext* globalCtx) { + EnIt* this = THIS; s32 pad; - EnIt* it = this; - Collider_CylinderUpdate(&it->actor, &it->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &it->collider); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } diff --git a/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/src/overlays/actors/ovl_En_Jj/z_en_jj.c index cd4a7df838..c2546b3b79 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EnJj_Init(EnJj* this, GlobalContext* globalCtx); -void EnJj_Destroy(EnJj* this, GlobalContext* globalCtx); -void EnJj_Update(EnJj* this, GlobalContext* globalCtx); -void EnJj_Draw(EnJj* this, GlobalContext* globalCtx); +#define THIS ((EnJj*)thisx) + +void EnJj_Init(Actor* thisx, GlobalContext* globalCtx); +void EnJj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnJj_Update(Actor* thisx, GlobalContext* globalCtx); +void EnJj_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Jj_InitVars = { diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index dc740611a8..5d355fdc2b 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnJs_Init(EnJs* this, GlobalContext* globalCtx); -void EnJs_Destroy(EnJs* this, GlobalContext* globalCtx); -void EnJs_Update(EnJs* this, GlobalContext* globalCtx); -void EnJs_Draw(EnJs* this, GlobalContext* globalCtx); +#define THIS ((EnJs*)thisx) + +void EnJs_Init(Actor* thisx, GlobalContext* globalCtx); +void EnJs_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnJs_Update(Actor* thisx, GlobalContext* globalCtx); +void EnJs_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Js_InitVars = { diff --git a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index cbb2a4f34c..ab1bd8dffa 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnJsjutan_Init(EnJsjutan* this, GlobalContext* globalCtx); -void EnJsjutan_Destroy(EnJsjutan* this, GlobalContext* globalCtx); -void EnJsjutan_Update(EnJsjutan* this, GlobalContext* globalCtx); -void EnJsjutan_Draw(EnJsjutan* this, GlobalContext* globalCtx); +#define THIS ((EnJsjutan*)thisx) + +void EnJsjutan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnJsjutan_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnJsjutan_Update(Actor* thisx, GlobalContext* globalCtx); +void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Jsjutan_InitVars = { diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 9e21e43942..eccc1f465a 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000009 -void EnKakasi_Init(EnKakasi* this, GlobalContext* globalCtx); -void EnKakasi_Destroy(EnKakasi* this, GlobalContext* globalCtx); -void EnKakasi_Update(EnKakasi* this, GlobalContext* globalCtx); -void EnKakasi_Draw(EnKakasi* this, GlobalContext* globalCtx); +#define THIS ((EnKakasi*)thisx) + +void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Kakasi_InitVars = { diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index a64ee99701..307d6ff994 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -2,9 +2,11 @@ #define FLAGS 0x0A000031 -void EnKakasi2_Init(EnKakasi2* this, GlobalContext* globalCtx); -void EnKakasi2_Destroy(EnKakasi2* this, GlobalContext* globalCtx); -void EnKakasi2_Update(EnKakasi2* this, GlobalContext* globalCtx); +#define THIS ((EnKakasi2*)thisx) + +void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Kakasi2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index f0643353e7..83ddffbcbe 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000009 -void EnKakasi3_Init(EnKakasi3* this, GlobalContext* globalCtx); -void EnKakasi3_Destroy(EnKakasi3* this, GlobalContext* globalCtx); -void EnKakasi3_Update(EnKakasi3* this, GlobalContext* globalCtx); -void EnKakasi3_Draw(EnKakasi3* this, GlobalContext* globalCtx); +#define THIS ((EnKakasi3*)thisx) + +void EnKakasi3_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi3_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi3_Update(Actor* thisx, GlobalContext* globalCtx); +void EnKakasi3_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Kakasi3_InitVars = { diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 32eac6aa41..bf3921438c 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnKanban_Init(EnKanban* this, GlobalContext* globalCtx); -void EnKanban_Destroy(EnKanban* this, GlobalContext* globalCtx); -void EnKanban_Update(EnKanban* this, GlobalContext* globalCtx); -void EnKanban_Draw(EnKanban* this, GlobalContext* globalCtx); +#define THIS ((EnKanban*)thisx) + +void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKanban_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx); +void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Kanban_InitVars = { diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 5d3316653c..317469f7db 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnKarebaba_Init(EnKarebaba* this, GlobalContext* globalCtx); -void EnKarebaba_Destroy(EnKarebaba* this, GlobalContext* globalCtx); -void EnKarebaba_Update(EnKarebaba* this, GlobalContext* globalCtx); -void EnKarebaba_Draw(EnKarebaba* this, GlobalContext* globalCtx); +#define THIS ((EnKarebaba*)thisx) + +void EnKarebaba_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKarebaba_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx); +void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Karebaba_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 2e7dc393aa..5e8e88b9a0 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnKo_Init(EnKo* this, GlobalContext* globalCtx); -void EnKo_Destroy(EnKo* this, GlobalContext* globalCtx); -void EnKo_Update(EnKo* this, GlobalContext* globalCtx); -void EnKo_Draw(EnKo* this, GlobalContext* globalCtx); +#define THIS ((EnKo*)thisx) + +void EnKo_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKo_Update(Actor* thisx, GlobalContext* globalCtx); +void EnKo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ko_InitVars = { diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 7653601c41..2c048fcf81 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -2,9 +2,11 @@ #define FLAGS 0x00800010 -void EnKusa_Init(EnKusa* this, GlobalContext* globalCtx); -void EnKusa_Destroy(EnKusa* this, GlobalContext* globalCtx); -void EnKusa_Update(EnKusa* this, GlobalContext* globalCtx); +#define THIS ((EnKusa*)thisx) + +void EnKusa_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKusa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKusa_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Kusa_InitVars = { diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index dab51846fe..04d8978c86 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnKz_Init(EnKz* this, GlobalContext* globalCtx); -void EnKz_Destroy(EnKz* this, GlobalContext* globalCtx); -void EnKz_Update(EnKz* this, GlobalContext* globalCtx); -void EnKz_Draw(EnKz* this, GlobalContext* globalCtx); +#define THIS ((EnKz*)thisx) + +void EnKz_Init(Actor* thisx, GlobalContext* globalCtx); +void EnKz_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnKz_Update(Actor* thisx, GlobalContext* globalCtx); +void EnKz_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Kz_InitVars = { diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index 5720045be2..92f3f2f28a 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnLight_Init(EnLight* this, GlobalContext* globalCtx); -void EnLight_Destroy(EnLight* this, GlobalContext* globalCtx); -void EnLight_Update(EnLight* this, GlobalContext* globalCtx); -void EnLight_Draw(EnLight* this, GlobalContext* globalCtx); +#define THIS ((EnLight*)thisx) + +void EnLight_Init(Actor* thisx, GlobalContext* globalCtx); +void EnLight_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnLight_Update(Actor* thisx, GlobalContext* globalCtx); +void EnLight_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Light_InitVars = { diff --git a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c index ef3ff832d4..9f3f4ff95f 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx); -void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx); -void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx); -void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx); +#define THIS ((EnLightbox*)thisx) + +void EnLightbox_Init(Actor* thisx, GlobalContext* globalCtx); +void EnLightbox_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx); +void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Lightbox_InitVars = { ACTOR_EN_LIGHTBOX, @@ -28,9 +30,9 @@ const ActorInit En_Lightbox_InitVars = { extern u32 D_06000B70; extern u32 D_06001F10; -void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx) { +void EnLightbox_Init(Actor* thisx, GlobalContext* globalCtx) { u32 local_c = 0; - Actor* thisx = &this->dyna.actor; + EnLightbox* this = THIS; s32 pad[4]; switch (thisx->params) { @@ -61,12 +63,14 @@ void EnLightbox_Init(EnLightbox* this, GlobalContext* globalCtx) { this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); } -void EnLightbox_Destroy(EnLightbox* this, GlobalContext* globalCtx) { +void EnLightbox_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnLightbox* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) { + EnLightbox* this = THIS; if (this->dyna.unk_162 != 0) { if (func_8002F5A0(thisx, globalCtx)) { @@ -106,6 +110,6 @@ void EnLightbox_Update(EnLightbox* this, GlobalContext* globalCtx) { thisx->posRot2.pos = thisx->posRot.pos; } -void EnLightbox_Draw(EnLightbox* this, GlobalContext* globalCtx) { +void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_06000B70); } diff --git a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c index 2a8a0c5eb4..1c34caa10b 100644 --- a/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c +++ b/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void EnMFire1_Init(EnMFire1* this, GlobalContext* globalCtx); -void EnMFire1_Destroy(EnMFire1* this, GlobalContext* globalCtx); -void EnMFire1_Update(EnMFire1* this, GlobalContext* globalCtx); +#define THIS ((EnMFire1*)thisx) + +void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMFire1_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_M_Fire1_InitVars = { ACTOR_EN_M_FIRE1, @@ -30,33 +32,32 @@ static ColliderCylinderInit cylinderInitData = { { 200, 200, 0, { 0 } } }; -void EnMFire1_Init(EnMFire1* this, GlobalContext* globalCtx) { +void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx) { + EnMFire1* this = THIS; s32 pad; - EnMFire1* thisLocal; - - thisLocal = this; if (this->actor.params < 0) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &thisLocal->actor, ACTORTYPE_ITEMACTION); + Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ITEMACTION); } - Collider_InitCylinder(globalCtx, &thisLocal->collider); - Collider_SetCylinder(globalCtx, &thisLocal->collider, &thisLocal->actor, &cylinderInitData); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); } -void EnMFire1_Destroy(EnMFire1* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void EnMFire1_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnMFire1* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } -void EnMFire1_Update(EnMFire1* this, GlobalContext* globalCtx) { +void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx) { + EnMFire1* this = THIS; s32 pad; - EnMFire1* thisLocal = this; - if (Math_ApproxF(&thisLocal->unk_198, 1.0f, 0.2f)) { + if (Math_ApproxF(&this->unk_198, 1.0f, 0.2f)) { Actor_Kill(&this->actor); } else { - Collider_CylinderUpdate(&thisLocal->actor, &thisLocal->collider); - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &thisLocal->collider); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); } } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index fec47ff82a..1437040302 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000000 -void EnMThunder_Init(EnMThunder* this, GlobalContext* globalCtx); -void EnMThunder_Destroy(EnMThunder* this, GlobalContext* globalCtx); -void EnMThunder_Update(EnMThunder* this, GlobalContext* globalCtx); -void EnMThunder_Draw(EnMThunder* this, GlobalContext* globalCtx); +#define THIS ((EnMThunder*)thisx) + +void EnMThunder_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMThunder_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMThunder_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_M_Thunder_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 0b4864b42f..2312782e43 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000039 -void EnMa1_Init(EnMa1* this, GlobalContext* globalCtx); -void EnMa1_Destroy(EnMa1* this, GlobalContext* globalCtx); -void EnMa1_Update(EnMa1* this, GlobalContext* globalCtx); -void EnMa1_Draw(EnMa1* this, GlobalContext* globalCtx); +#define THIS ((EnMa1*)thisx) + +void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMa1_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMa1_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMa1_Draw(Actor* thisx, GlobalContext* globalCtx); u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* this); s16 func_80AA0778(GlobalContext* globalCtx, Actor* this); @@ -72,7 +74,7 @@ extern AnimationHeader D_06000820; extern SkeletonHeader D_06008460; extern AnimationHeader D_06008D64; -u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* this) { +u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* thisx) { u16 faceReaction = Text_GetFaceReaction(globalCtx, 0x17); if (faceReaction != 0) { return faceReaction; @@ -106,11 +108,11 @@ u16 EnMa1_GetText(GlobalContext* globalCtx, Actor* this) { return 0x2041; } -s16 func_80AA0778(GlobalContext* globalCtx, Actor* this) { +s16 func_80AA0778(GlobalContext* globalCtx, Actor* thisx) { s16 ret = 1; switch (func_8010BDBC(&globalCtx->msgCtx)) { case 2: - switch (this->textId) { + switch (thisx->textId) { case 0x2041: gSaveContext.infTable[8] |= 0x10; gSaveContext.eventChkInf[1] |= 1; @@ -242,14 +244,14 @@ void func_80AA0B74(EnMa1* this) { } } -void EnMa1_Init(EnMa1* this, GlobalContext* globalCtx) { +void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) { + EnMa1* this = THIS; s32 pad; - ColliderCylinder* collider = &this->collider; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0); - Collider_InitCylinder(globalCtx, collider); - Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA166C); if (!func_80AA08C4(this, globalCtx)) { @@ -271,7 +273,9 @@ void EnMa1_Init(EnMa1* this, GlobalContext* globalCtx) { } } -void EnMa1_Destroy(EnMa1* this, GlobalContext* globalCtx) { +void EnMa1_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnMa1* this = THIS; + SkelAnime_Free(&this->skelAnime, globalCtx); Collider_DestroyCylinder(globalCtx, &this->collider); } @@ -376,12 +380,12 @@ void func_80AA1150(EnMa1* this, GlobalContext* globalCtx) { void func_80AA11C8(EnMa1* this, GlobalContext* globalCtx) { } -void EnMa1_Update(EnMa1* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; +void EnMa1_Update(Actor* thisx, GlobalContext* globalCtx) { + EnMa1* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_80AA0A0C(this); this->actionFunc(this, globalCtx); @@ -393,42 +397,43 @@ void EnMa1_Update(EnMa1* this, GlobalContext* globalCtx) { func_80AA0AF4(this, globalCtx); } -s32 EnMa1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* this) { - EnMa1* thisx = (EnMa1*)this; - Vec3s tempVec; +s32 EnMa1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnMa1* this = THIS; + Vec3s vec; if ((limbIndex == 2) || (limbIndex == 5)) { *dList = NULL; } if (limbIndex == 15) { Matrix_Translate(1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); - tempVec = thisx->unk_1E8.unk_08; - Matrix_RotateX(((f32)tempVec.y / 32768.0f) * M_PI, MTXMODE_APPLY); - Matrix_RotateZ(((f32)tempVec.x / 32768.0f) * M_PI, MTXMODE_APPLY); + vec = this->unk_1E8.unk_08; + Matrix_RotateX((vec.y / 32768.0f) * M_PI, MTXMODE_APPLY); + Matrix_RotateZ((vec.x / 32768.0f) * M_PI, MTXMODE_APPLY); Matrix_Translate(-1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); } if (limbIndex == 8) { - tempVec = thisx->unk_1E8.unk_0E; - Matrix_RotateX(((f32)(0 - tempVec.y) / 32768.0f) * M_PI, MTXMODE_APPLY); - Matrix_RotateZ(((f32)(0 - tempVec.x) / 32768.0f) * M_PI, MTXMODE_APPLY); + vec = this->unk_1E8.unk_0E; + Matrix_RotateX((-vec.y / 32768.0f) * M_PI, MTXMODE_APPLY); + Matrix_RotateZ((-vec.x / 32768.0f) * M_PI, MTXMODE_APPLY); } return 0; } -void EnMa1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) { - s32 pad; +void EnMa1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnMa1* this = THIS; Vec3f vec = D_80AA16B8; if (limbIndex == 15) { - Matrix_MultVec3f(&vec, &actor->posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); } } -void EnMa1_Draw(EnMa1* this, GlobalContext* globalCtx) { +void EnMa1_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnMa1* this = THIS; Camera* camera; f32 someFloat; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; - Gfx* dispRefs[6]; + Gfx* dispRefs[5]; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma1.c", 1226); camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index b020458443..8ea45e33d2 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000039 -void EnMa2_Init(EnMa2* this, GlobalContext* globalCtx); -void EnMa2_Destroy(EnMa2* this, GlobalContext* globalCtx); -void EnMa2_Update(EnMa2* this, GlobalContext* globalCtx); -void EnMa2_Draw(EnMa2* this, GlobalContext* globalCtx); +#define THIS ((EnMa2*)thisx) + +void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMa2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMa2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMa2_Draw(Actor* thisx, GlobalContext* globalCtx); u16 func_80AA19A0(GlobalContext* globalCtx, Actor* this); s16 func_80AA1A38(GlobalContext* globalCtx, Actor* this); @@ -92,7 +94,7 @@ extern SkeletonHeader D_06008D90; extern AnimationHeader D_060093BC; extern AnimationHeader D_06009EE0; -u16 func_80AA19A0(GlobalContext* globalCtx, Actor* this) { +u16 func_80AA19A0(GlobalContext* globalCtx, Actor* thisx) { u16 faceReaction = Text_GetFaceReaction(globalCtx, 23); if (faceReaction != 0) { return faceReaction; @@ -112,12 +114,12 @@ u16 func_80AA19A0(GlobalContext* globalCtx, Actor* this) { return 0x204C; } -s16 func_80AA1A38(GlobalContext* globalCtx, Actor* this) { +s16 func_80AA1A38(GlobalContext* globalCtx, Actor* thisx) { s16 ret = 1; switch (func_8010BDBC(&globalCtx->msgCtx)) { case 2: - switch (this->textId) { + switch (thisx->textId) { case 0x2051: gSaveContext.infTable[8] |= 0x1000; ret = 2; @@ -232,15 +234,14 @@ void func_80AA1DB4(EnMa2* this, GlobalContext* globalCtx) { } } -void EnMa2_Init(EnMa2* this, GlobalContext* globalCtx) { - ColliderCylinder* collider; +void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) { + EnMa2* this = THIS; s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); - collider = &this->collider; - Collider_InitCylinder(globalCtx, collider); - Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA284C); switch (func_80AA1B58(this, globalCtx)) { @@ -271,7 +272,9 @@ void EnMa2_Init(EnMa2* this, GlobalContext* globalCtx) { this->unk_1E0.unk_00 = 0; } -void EnMa2_Destroy(EnMa2* this, GlobalContext* globalCtx) { +void EnMa2_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnMa2* this = THIS; + SkelAnime_Free(&this->skelAnime, globalCtx); Collider_DestroyCylinder(globalCtx, &this->collider); } @@ -329,12 +332,12 @@ void func_80AA21C8(EnMa2* this, GlobalContext* globalCtx) { } } -void EnMa2_Update(EnMa2* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; +void EnMa2_Update(Actor* thisx, GlobalContext* globalCtx) { + EnMa2* this = THIS; s32 pad; - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_80AA1CC0(this); this->actionFunc(this, globalCtx); @@ -346,34 +349,34 @@ void EnMa2_Update(EnMa2* this, GlobalContext* globalCtx) { } } -s32 EnMa2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* this) { - EnMa2* thisx = (EnMa2*)this; - Vec3s tempVec; +s32 EnMa2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnMa2* this = THIS; + Vec3s vec; if ((limbIndex == 3) || (limbIndex == 6)) { *dList = NULL; } if (limbIndex == 18) { Matrix_Translate(1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); - tempVec = thisx->unk_1E0.unk_08; - Matrix_RotateX((tempVec.y / 32768.0f) * M_PI, MTXMODE_APPLY); - Matrix_RotateZ((tempVec.x / 32768.0f) * M_PI, MTXMODE_APPLY); + vec = this->unk_1E0.unk_08; + Matrix_RotateX((vec.y / 32768.0f) * M_PI, MTXMODE_APPLY); + Matrix_RotateZ((vec.x / 32768.0f) * M_PI, MTXMODE_APPLY); Matrix_Translate(-1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); } if (limbIndex == 11) { - tempVec = thisx->unk_1E0.unk_0E; - Matrix_RotateY((-tempVec.y / 32768.0f) * M_PI, MTXMODE_APPLY); - Matrix_RotateX((-tempVec.x / 32768.0f) * M_PI, MTXMODE_APPLY); + vec = this->unk_1E0.unk_0E; + Matrix_RotateY((-vec.y / 32768.0f) * M_PI, MTXMODE_APPLY); + Matrix_RotateX((-vec.x / 32768.0f) * M_PI, MTXMODE_APPLY); } if ((limbIndex == 11) || (limbIndex == 12) || (limbIndex == 15)) { - rot->y += Math_Sins(thisx->unk_212[limbIndex].y) * 200.0f; - rot->z += Math_Coss(thisx->unk_212[limbIndex].z) * 200.0f; + rot->y += Math_Sins(this->unk_212[limbIndex].y) * 200.0f; + rot->z += Math_Coss(this->unk_212[limbIndex].z) * 200.0f; } return 0; } -void EnMa2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* this) { - EnMa2* thisx = (EnMa2*)this; +void EnMa2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnMa2* this = THIS; Vec3f vec = D_80AA28A8; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; @@ -381,20 +384,21 @@ void EnMa2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma2.c", 904); if (limbIndex == 18) { - Matrix_MultVec3f(&vec, &this->posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); } - if ((limbIndex == 14) && (thisx->skelAnime.animCurrentSeg == &D_060093BC)) { + if ((limbIndex == 14) && (this->skelAnime.animCurrentSeg == &D_060093BC)) { gSPDisplayList(gfxCtx->polyOpa.p++, &D_06005420); } Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma2.c", 927); } -void EnMa2_Draw(EnMa2* this, GlobalContext* globalCtx) { +void EnMa2_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnMa2* this = THIS; Camera* camera; f32 someFloat; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; - Gfx* dispRefs[6]; + Gfx* dispRefs[5]; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma2.c", 955); camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index 7854dde629..796163afd3 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000039 -void EnMa3_Init(EnMa3* this, GlobalContext* globalCtx); -void EnMa3_Destroy(EnMa3* this, GlobalContext* globalCtx); -void EnMa3_Update(EnMa3* this, GlobalContext* globalCtx); -void EnMa3_Draw(EnMa3* this, GlobalContext* globalCtx); +#define THIS ((EnMa3*)thisx) + +void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMa3_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMa3_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMa3_Draw(Actor* thisx, GlobalContext* globalCtx); u16 func_80AA2AA0(GlobalContext* globalCtx, Actor* this); s16 func_80AA2BD4(GlobalContext* globalCtx, Actor* this); @@ -95,7 +97,7 @@ extern SkeletonHeader D_06008D90; extern AnimationHeader D_060093BC; extern AnimationHeader D_06009EE0; -u16 func_80AA2AA0(GlobalContext* globalCtx, Actor* this) { +u16 func_80AA2AA0(GlobalContext* globalCtx, Actor* thisx) { Player* player = PLAYER; s16* timer1ValuePtr; // weirdness with this necessary to match @@ -105,7 +107,7 @@ u16 func_80AA2AA0(GlobalContext* globalCtx, Actor* this) { timer1ValuePtr = &gSaveContext.timer1Value; if (gSaveContext.eventInf[0] & 0x400) { gSaveContext.timer1Value = gSaveContext.timer1Value; - this->flags |= 0x10000; + thisx->flags |= 0x10000; if (gSaveContext.timer1Value >= 0xD3) { return 0x208E; } @@ -122,7 +124,7 @@ u16 func_80AA2AA0(GlobalContext* globalCtx, Actor* this) { } } if ((!(player->stateFlags1 & 0x800000)) && - (Actor_FindNearby(globalCtx, this, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) { + (Actor_FindNearby(globalCtx, thisx, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) { return 0x2001; } if (!(gSaveContext.infTable[11] & 0x200)) { @@ -132,7 +134,7 @@ u16 func_80AA2AA0(GlobalContext* globalCtx, Actor* this) { } } -s16 func_80AA2BD4(GlobalContext* globalCtx, Actor* this) { +s16 func_80AA2BD4(GlobalContext* globalCtx, Actor* thisx) { s16 ret = 1; switch (func_8010BDBC(&globalCtx->msgCtx)) { @@ -161,7 +163,7 @@ s16 func_80AA2BD4(GlobalContext* globalCtx, Actor* this) { } break; case 2: - switch (this->textId) { + switch (thisx->textId) { case 0x2000: gSaveContext.infTable[11] |= 0x100; ret = 0; @@ -175,7 +177,7 @@ s16 func_80AA2BD4(GlobalContext* globalCtx, Actor* this) { } case 0x208E: gSaveContext.eventInf[0] &= ~0x400; - this->flags &= ~0x10000; + thisx->flags &= ~0x10000; ret = 0; gSaveContext.timer1State = 0xA; break; @@ -262,15 +264,14 @@ void func_80AA3004(EnMa3* this, s32 idx) { D_80AA3848[idx].transitionRate); } -void EnMa3_Init(EnMa3* this, GlobalContext* globalCtx) { - ColliderCylinder* collider; +void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) { + EnMa3* this = THIS; s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008D90, NULL, 0, 0, 0); - collider = &this->collider; - Collider_InitCylinder(globalCtx, collider); - Collider_SetCylinder(globalCtx, collider, &this->actor, &cylinderInit); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &cylinderInit); func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x16), &D_80AA383C); switch (func_80AA2EC8(this, globalCtx)) { @@ -292,7 +293,9 @@ void EnMa3_Init(EnMa3* this, GlobalContext* globalCtx) { this->unk_1E0.unk_00 = (u16)0; } -void EnMa3_Destroy(EnMa3* this, GlobalContext* globalCtx) { +void EnMa3_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnMa3* this = THIS; + SkelAnime_Free(&this->skelAnime, globalCtx); Collider_DestroyCylinder(globalCtx, &this->collider); } @@ -304,18 +307,18 @@ void func_80AA3200(EnMa3* this, GlobalContext* globalCtx) { } } -void EnMa3_Update(EnMa3* this, GlobalContext* globalCtx) { +void EnMa3_Update(Actor* thisx, GlobalContext* globalCtx) { + EnMa3* this = THIS; s32 pad; - ColliderCylinder* collider = &this->collider; - Collider_CylinderUpdate(&this->actor, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &collider->base); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); SkelAnime_FrameUpdateMatrix(&this->skelAnime); func_80AA2F80(this); this->actionFunc(this, globalCtx); func_80AA2E54(this, globalCtx); func_800343CC(globalCtx, &this->actor, &this->unk_1E0.unk_00, (f32)this->collider.dim.radius + 150.0f, - &func_80AA2AA0, &func_80AA2BD4); + func_80AA2AA0, func_80AA2BD4); if (this->unk_1E0.unk_00 == 0) { if (this->unk_20A != 0) { func_800F6584(0); @@ -328,23 +331,23 @@ void EnMa3_Update(EnMa3* this, GlobalContext* globalCtx) { } s32 EnMa3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { - EnMa3* this = (EnMa3*)thisx; - Vec3s tempVec; + EnMa3* this = THIS; + Vec3s vec; if ((limbIndex == 3) || (limbIndex == 6)) { *dList = NULL; } if (limbIndex == 18) { Matrix_Translate(1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); - tempVec = this->unk_1E0.unk_08; - Matrix_RotateX((tempVec.y / 32768.0f) * M_PI, MTXMODE_APPLY); - Matrix_RotateZ((tempVec.x / 32768.0f) * M_PI, MTXMODE_APPLY); + vec = this->unk_1E0.unk_08; + Matrix_RotateX((vec.y / 32768.0f) * M_PI, MTXMODE_APPLY); + Matrix_RotateZ((vec.x / 32768.0f) * M_PI, MTXMODE_APPLY); Matrix_Translate(-1400.0f, 0.0f, 0.0f, MTXMODE_APPLY); } if (limbIndex == 11) { - tempVec = this->unk_1E0.unk_0E; - Matrix_RotateY((-tempVec.y / 32768.0f) * M_PI, MTXMODE_APPLY); - Matrix_RotateX((-tempVec.x / 32768.0f) * M_PI, MTXMODE_APPLY); + vec = this->unk_1E0.unk_0E; + Matrix_RotateY((-vec.y / 32768.0f) * M_PI, MTXMODE_APPLY); + Matrix_RotateX((-vec.x / 32768.0f) * M_PI, MTXMODE_APPLY); } if ((limbIndex == 11) || (limbIndex == 12) || (limbIndex == 15)) { rot->y += Math_Sins(this->unk_212[limbIndex].y) * 200.0f; @@ -354,7 +357,7 @@ s32 EnMa3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } void EnMa3_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { - EnMa3* this = (EnMa3*)thisx; + EnMa3* this = THIS; Vec3f vec = D_80AA3898; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[4]; @@ -371,11 +374,12 @@ void EnMa3_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma3.c", 950); } -void EnMa3_Draw(EnMa3* this, GlobalContext* globalCtx) { +void EnMa3_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnMa3* this = THIS; Camera* camera; f32 someFloat; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; - Gfx* dispRefs[6]; + Gfx* dispRefs[5]; Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ma3.c", 978); camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 967d8fd5f8..07d32aa372 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EnMag_Init(EnMag* this, GlobalContext* globalCtx); -void EnMag_Destroy(EnMag* this, GlobalContext* globalCtx); -void EnMag_Update(EnMag* this, GlobalContext* globalCtx); -void EnMag_Draw(EnMag* this, GlobalContext* globalCtx); +#define THIS ((EnMag*)thisx) + +void EnMag_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMag_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMag_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMag_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Mag_InitVars = { diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 6b42ca8d51..226720804c 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000015 -void EnMb_Init(EnMb* this, GlobalContext* globalCtx); -void EnMb_Destroy(EnMb* this, GlobalContext* globalCtx); -void EnMb_Update(EnMb* this, GlobalContext* globalCtx); -void EnMb_Draw(EnMb* this, GlobalContext* globalCtx); +#define THIS ((EnMb*)thisx) + +void EnMb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMb_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMb_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMb_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Mb_InitVars = { diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 1b4db67cd9..a59b33ea52 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000019 -void EnMd_Init(EnMd* this, GlobalContext* globalCtx); -void EnMd_Destroy(EnMd* this, GlobalContext* globalCtx); -void EnMd_Update(EnMd* this, GlobalContext* globalCtx); -void EnMd_Draw(EnMd* this, GlobalContext* globalCtx); +#define THIS ((EnMd*)thisx) + +void EnMd_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMd_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMd_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Md_InitVars = { diff --git a/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/src/overlays/actors/ovl_En_Mk/z_en_mk.c index e58484966b..0960185113 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000019 -void EnMk_Init(EnMk* this, GlobalContext* globalCtx); -void EnMk_Destroy(EnMk* this, GlobalContext* globalCtx); -void EnMk_Update(EnMk* this, GlobalContext* globalCtx); -void EnMk_Draw(EnMk* this, GlobalContext* globalCtx); +#define THIS ((EnMk*)thisx) + +void EnMk_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMk_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMk_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMk_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Mk_InitVars = { diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 526af68dd3..3a45a8d78e 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnMm_Init(EnMm* this, GlobalContext* globalCtx); -void EnMm_Destroy(EnMm* this, GlobalContext* globalCtx); -void EnMm_Update(EnMm* this, GlobalContext* globalCtx); -void EnMm_Draw(EnMm* this, GlobalContext* globalCtx); +#define THIS ((EnMm*)thisx) + +void EnMm_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMm_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMm_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Mm_InitVars = { diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index 94b9895516..34fd6916e5 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnMm2_Init(EnMm2* this, GlobalContext* globalCtx); -void EnMm2_Destroy(EnMm2* this, GlobalContext* globalCtx); -void EnMm2_Update(EnMm2* this, GlobalContext* globalCtx); -void EnMm2_Draw(EnMm2* this, GlobalContext* globalCtx); +#define THIS ((EnMm2*)thisx) + +void EnMm2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMm2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMm2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMm2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Mm2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index f59ec2a662..e88e9005b2 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -8,15 +8,18 @@ #define FLAGS 0x00000009 +#define THIS ((EnMs*)thisx) + +void EnMs_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMs_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMs_Draw(Actor* thisx, GlobalContext* globalCtx); + void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx); -void EnMs_Init(EnMs* this, GlobalContext* globalCtx); -void EnMs_Destroy(EnMs* this, GlobalContext* globalCtx); void EnMs_Wait(EnMs* this, GlobalContext* globalCtx); void EnMs_Talk(EnMs* this, GlobalContext* globalCtx); void EnMs_Sell(EnMs* this, GlobalContext* globalCtx); void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx); -void EnMs_Update(EnMs* this, GlobalContext* globalCtx); -void EnMs_Draw(EnMs* this, GlobalContext* globalCtx); const ActorInit En_Ms_InitVars = { ACTOR_EN_MS, @@ -63,9 +66,9 @@ void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx) { } } -void EnMs_Init(EnMs* this, GlobalContext* globalCtx) { - s32 pad1; - s32 pad2; +void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { + EnMs* this = THIS; + s32 pad; if (LINK_AGE_IN_YEARS != YEARS_CHILD) { Actor_Kill(&this->actor); @@ -89,9 +92,10 @@ void EnMs_Init(EnMs* this, GlobalContext* globalCtx) { this->actionFunc = EnMs_Wait; } -void EnMs_Destroy(EnMs* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnMs* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { @@ -155,9 +159,9 @@ void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx) { } } -void EnMs_Update(EnMs* this, GlobalContext* globalCtx) { - s32 pad1; - s32 pad2; +void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { + EnMs* this = THIS; + s32 pad; this->activeTimer += 1; Actor_SetHeight(&this->actor, 20.0f); @@ -175,7 +179,9 @@ void EnMs_Update(EnMs* this, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } -void EnMs_Draw(EnMs* this, GlobalContext* globalCtx) { +void EnMs_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnMs* this = THIS; + func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, NULL, NULL, &this->actor); diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index 9790dce43a..cdc3febc9a 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000009 -void EnMu_Init(EnMu* this, GlobalContext* globalCtx); -void EnMu_Destroy(EnMu* this, GlobalContext* globalCtx); -void EnMu_Update(EnMu* this, GlobalContext* globalCtx); -void EnMu_Draw(EnMu* this, GlobalContext* globalCtx); +#define THIS ((EnMu*)thisx) + +void EnMu_Init(Actor* thisx, GlobalContext* globalCtx); +void EnMu_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnMu_Update(Actor* thisx, GlobalContext* globalCtx); +void EnMu_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Mu_InitVars = { diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index c256455d9e..80bda5501f 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnNb_Init(EnNb* this, GlobalContext* globalCtx); -void EnNb_Destroy(EnNb* this, GlobalContext* globalCtx); -void EnNb_Update(EnNb* this, GlobalContext* globalCtx); -void EnNb_Draw(EnNb* this, GlobalContext* globalCtx); +#define THIS ((EnNb*)thisx) + +void EnNb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnNb_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnNb_Update(Actor* thisx, GlobalContext* globalCtx); +void EnNb_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Nb_InitVars = { diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 772bcf9e96..5263a7b377 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -2,10 +2,12 @@ #define FLAGS 0x00800010 -void EnNiw_Init(EnNiw* this, GlobalContext* globalCtx); -void EnNiw_Destroy(EnNiw* this, GlobalContext* globalCtx); -void EnNiw_Update(EnNiw* this, GlobalContext* globalCtx); -void EnNiw_Draw(EnNiw* this, GlobalContext* globalCtx); +#define THIS ((EnNiw*)thisx) + +void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx); +void EnNiw_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx); +void EnNiw_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Niw_InitVars = { diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 30ee410482..8aeef83469 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnNiwGirl_Init(EnNiwGirl* this, GlobalContext* globalCtx); -void EnNiwGirl_Destroy(EnNiwGirl* this, GlobalContext* globalCtx); -void EnNiwGirl_Update(EnNiwGirl* this, GlobalContext* globalCtx); -void EnNiwGirl_Draw(EnNiwGirl* this, GlobalContext* globalCtx); +#define THIS ((EnNiwGirl*)thisx) + +void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx); +void EnNiwGirl_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx); +void EnNiwGirl_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Niw_Girl_InitVars = { diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 01b3e6472e..7fa0264aa2 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000019 -void EnNiwLady_Init(EnNiwLady* this, GlobalContext* globalCtx); -void EnNiwLady_Destroy(EnNiwLady* this, GlobalContext* globalCtx); -void EnNiwLady_Update(EnNiwLady* this, GlobalContext* globalCtx); +#define THIS ((EnNiwLady*)thisx) + +void EnNiwLady_Init(Actor* thisx, GlobalContext* globalCtx); +void EnNiwLady_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Niw_Lady_InitVars = { diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index af2f295102..0b9b384db5 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -8,12 +8,15 @@ #define FLAGS 0x00000010 -void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx); -void EnNutsball_Destroy(EnNutsball* this, GlobalContext* globalCtx); -void EnNutsball_Update(EnNutsball* this, GlobalContext* globalCtx); +#define THIS ((EnNutsball*)thisx) + +void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx); +void EnNutsball_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx); +void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx); void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx); -void EnNutsball_Draw(EnNutsball* this, GlobalContext* globalCtx); const ActorInit En_Nutsball_InitVars = { ACTOR_EN_NUTSBALL, @@ -36,8 +39,9 @@ static ColliderCylinderInit cylinderInitData = { static s16 objectTbl[] = { OBJECT_DEKUNUTS, OBJECT_HINTNUTS, OBJECT_SHOPNUTS, OBJECT_DNS, OBJECT_DNK }; static u32 dListTbl[] = { 0x06002028, 0x060012F0, 0x06004008, 0x06002410, 0x06001890 }; -void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx) { - s32 pad[2]; +void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) { + EnNutsball* this = THIS; + s32 pad; ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f); Collider_InitCylinder(globalCtx, &this->collider); @@ -51,15 +55,16 @@ void EnNutsball_Init(EnNutsball* this, GlobalContext* globalCtx) { } } -void EnNutsball_Destroy(EnNutsball* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void EnNutsball_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnNutsball* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) { this->actor.objBankIndex = this->objBankIndex; - this->actor.draw = (ActorFunc)EnNutsball_Draw; + this->actor.draw = EnNutsball_Draw; this->actor.shape.rot.y = 0; this->timer = 30; this->actionFunc = (ActorFunc)func_80ABBBA8; @@ -112,27 +117,27 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { } } -void EnNutsball_Update(EnNutsball* this, GlobalContext* globalCtx) { - EnNutsball* nutsball = this; +void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { + EnNutsball* this = THIS; Player* player = PLAYER; s32 pad; - if (!(player->stateFlags1 & 0x300000C0) || (nutsball->actionFunc == (ActorFunc)func_80ABBB34)) { - nutsball->actionFunc(nutsball, globalCtx); + if (!(player->stateFlags1 & 0x300000C0) || (this->actionFunc == (ActorFunc)func_80ABBB34)) { + this->actionFunc(this, globalCtx); - Actor_MoveForward(&nutsball->actor); - func_8002E4B4(globalCtx, &nutsball->actor, 10, cylinderInitData.dim.radius, cylinderInitData.dim.height, 5); - Collider_CylinderUpdate(&nutsball->actor, &nutsball->collider); + Actor_MoveForward(&this->actor); + func_8002E4B4(globalCtx, &this->actor, 10, cylinderInitData.dim.radius, cylinderInitData.dim.height, 5); + Collider_CylinderUpdate(&this->actor, &this->collider); - nutsball->actor.flags |= 0x1000000; + this->actor.flags |= 0x1000000; - CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &nutsball->collider); - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &nutsball->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &nutsball->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } } -void EnNutsball_Draw(EnNutsball* this, GlobalContext* globalCtx) { +void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; Gfx* dispRefs[5]; @@ -140,10 +145,10 @@ void EnNutsball_Draw(EnNutsball* this, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); - Matrix_RotateZ(this->actor.initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY); + Matrix_RotateZ(thisx->initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[this->actor.params]); + gSPDisplayList(gfxCtx->polyOpa.p++, dListTbl[thisx->params]); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337); } diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 2320d0ce75..c0455d3d6c 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnNwc_Init(EnNwc* this, GlobalContext* globalCtx); -void EnNwc_Destroy(EnNwc* this, GlobalContext* globalCtx); -void EnNwc_Update(EnNwc* this, GlobalContext* globalCtx); -void EnNwc_Draw(EnNwc* this, GlobalContext* globalCtx); +#define THIS ((EnNwc*)thisx) + +void EnNwc_Init(Actor* thisx, GlobalContext* globalCtx); +void EnNwc_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnNwc_Update(Actor* thisx, GlobalContext* globalCtx); +void EnNwc_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Nwc_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 4e0d5e677f..9d19dd7203 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnNy_Init(EnNy* this, GlobalContext* globalCtx); -void EnNy_Destroy(EnNy* this, GlobalContext* globalCtx); -void EnNy_Update(EnNy* this, GlobalContext* globalCtx); -void EnNy_Draw(EnNy* this, GlobalContext* globalCtx); +#define THIS ((EnNy*)thisx) + +void EnNy_Init(Actor* thisx, GlobalContext* globalCtx); +void EnNy_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnNy_Update(Actor* thisx, GlobalContext* globalCtx); +void EnNy_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ny_InitVars = { diff --git a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c index 59ab93c153..95473b9f1b 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c @@ -8,12 +8,15 @@ #define FLAGS 0x00000009 +#define THIS ((EnOE2*)thisx) + +void EnOE2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnOE2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnOE2_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_80ABE6A0(EnOE2* this, ActorFunc func); -void EnOE2_Init(EnOE2* this, GlobalContext* globalCtx); -void EnOE2_Destroy(EnOE2* this, GlobalContext* globalCtx); void func_80ABE6DC(EnOE2* this, GlobalContext* globalCtx); -void EnOE2_Update(EnOE2* this, GlobalContext* globalCtx); -void EnOE2_Draw(EnOE2* this, GlobalContext* globalCtx); const ActorInit En_OE2_InitVars = { ACTOR_EN_OE2, @@ -31,18 +34,20 @@ void EnOE2_SetupAction(EnOE2* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void EnOE2_Init(EnOE2* this, GlobalContext* globalCtx) { +void EnOE2_Init(Actor* thisx, GlobalContext* globalCtx) { + EnOE2* this = THIS; + EnOE2_SetupAction(this, func_80ABE6DC); } -void EnOE2_Destroy(EnOE2* this, GlobalContext* globalCtx) { +void EnOE2_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80ABE6DC(EnOE2* this, GlobalContext* globalCtx) { } -void EnOE2_Update(EnOE2* this, GlobalContext* globalCtx) { +void EnOE2_Update(Actor* thisx, GlobalContext* globalCtx) { } -void EnOE2_Draw(EnOE2* this, GlobalContext* globalCtx) { +void EnOE2_Draw(Actor* thisx, GlobalContext* globalCtx) { } diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index f106697c11..8129af432c 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -10,12 +10,15 @@ #define FLAGS 0x02000010 +#define THIS ((EnOkarinaEffect*)thisx) + +void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx); +void EnOkarinaEffect_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnOkarinaEffect_Update(Actor* thisx, GlobalContext* globalCtx); + void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, ActorFunc* actionFunc); -void EnOkarinaEffect_Init(EnOkarinaEffect* this, GlobalContext* globalCtx); -void EnOkarinaEffect_Destroy(EnOkarinaEffect* this, GlobalContext* globalCtx); void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCtx); void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx); -void EnOkarinaEffect_Update(EnOkarinaEffect* this, GlobalContext* globalCtx); const ActorInit En_Okarina_Effect_InitVars = { ACTOR_EN_OKARINA_EFFECT, @@ -33,7 +36,9 @@ void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, ActorFunc* actionFunc) { this->actionFunc = actionFunc; } -void EnOkarinaEffect_Destroy(EnOkarinaEffect* this, GlobalContext* globalCtx) { +void EnOkarinaEffect_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnOkarinaEffect* this = THIS; + globalCtx->envCtx.unk_F2[0] = 0; if ((D_8011FB30 != 4) && (D_8011FB30 != 5) && (globalCtx->envCtx.gloomySkyEvent == 1)) { globalCtx->envCtx.gloomySkyEvent = 2; // end gloomy sky @@ -42,7 +47,9 @@ void EnOkarinaEffect_Destroy(EnOkarinaEffect* this, GlobalContext* globalCtx) { globalCtx->envCtx.lightning = 2; // end lightning } -void EnOkarinaEffect_Init(EnOkarinaEffect* this, GlobalContext* globalCtx) { +void EnOkarinaEffect_Init(Actor* thisx, GlobalContext* globalCtx) { + EnOkarinaEffect* this = THIS; + osSyncPrintf("\n\n"); // "Ocarina Storm Effect" osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ オカリナあらし効果ビカビカビカ〜 ☆☆☆☆☆ \n" VT_RST); @@ -106,7 +113,9 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx } } -void EnOkarinaEffect_Update(EnOkarinaEffect* this, GlobalContext* globalCtx) { +void EnOkarinaEffect_Update(Actor* thisx, GlobalContext* globalCtx) { + EnOkarinaEffect* this = THIS; + this->actionFunc(this, globalCtx); if (BREG(0) != 0) { DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 96852a2e6d..b718856636 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -2,9 +2,11 @@ #define FLAGS 0x02000010 -void EnOkarinaTag_Init(EnOkarinaTag* this, GlobalContext* globalCtx); -void EnOkarinaTag_Destroy(EnOkarinaTag* this, GlobalContext* globalCtx); -void EnOkarinaTag_Update(EnOkarinaTag* this, GlobalContext* globalCtx); +#define THIS ((EnOkarinaTag*)thisx) + +void EnOkarinaTag_Init(Actor* thisx, GlobalContext* globalCtx); +void EnOkarinaTag_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnOkarinaTag_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Okarina_Tag_InitVars = { diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 5a1c3af4e6..dba19d3a77 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnOkuta_Init(EnOkuta* this, GlobalContext* globalCtx); -void EnOkuta_Destroy(EnOkuta* this, GlobalContext* globalCtx); -void EnOkuta_Update(EnOkuta* this, GlobalContext* globalCtx); -void EnOkuta_Draw(EnOkuta* this, GlobalContext* globalCtx); +#define THIS ((EnOkuta*)thisx) + +void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx); +void EnOkuta_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx); +void EnOkuta_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Okuta_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index b602d4241b..d56ba81b81 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000019 -void EnOssan_Init(EnOssan* this, GlobalContext* globalCtx); -void EnOssan_Destroy(EnOssan* this, GlobalContext* globalCtx); -void EnOssan_Update(EnOssan* this, GlobalContext* globalCtx); +#define THIS ((EnOssan*)thisx) + +void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnOssan_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnOssan_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ossan_InitVars = { diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 6d5f4a2ba5..b4375a3301 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000019 -void EnOwl_Init(EnOwl* this, GlobalContext* globalCtx); -void EnOwl_Destroy(EnOwl* this, GlobalContext* globalCtx); -void EnOwl_Update(EnOwl* this, GlobalContext* globalCtx); -void EnOwl_Draw(EnOwl* this, GlobalContext* globalCtx); +#define THIS ((EnOwl*)thisx) + +void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx); +void EnOwl_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx); +void EnOwl_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Owl_InitVars = { diff --git a/src/overlays/actors/ovl_En_Part/z_en_part.c b/src/overlays/actors/ovl_En_Part/z_en_part.c index a76838fb59..f239b197ff 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnPart_Init(EnPart* this, GlobalContext* globalCtx); -void EnPart_Destroy(EnPart* this, GlobalContext* globalCtx); -void EnPart_Update(EnPart* this, GlobalContext* globalCtx); -void EnPart_Draw(EnPart* this, GlobalContext* globalCtx); +#define THIS ((EnPart*)thisx) + +void EnPart_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPart_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPart_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPart_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Part_InitVars = { diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 1b70a3cf59..ff868d5121 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -2,10 +2,12 @@ #define FLAGS 0x01000015 -void EnPeehat_Init(EnPeehat* this, GlobalContext* globalCtx); -void EnPeehat_Destroy(EnPeehat* this, GlobalContext* globalCtx); -void EnPeehat_Update(EnPeehat* this, GlobalContext* globalCtx); -void EnPeehat_Draw(EnPeehat* this, GlobalContext* globalCtx); +#define THIS ((EnPeehat*)thisx) + +void EnPeehat_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPeehat_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPeehat_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPeehat_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Peehat_InitVars = { diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 2f5f182e84..9fafb9a3fc 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -8,10 +8,12 @@ #define FLAGS 0x00001090 -void EnPoDesert_Init(EnPoDesert* this, GlobalContext* globalCtx); -void EnPoDesert_Destroy(EnPoDesert* this, GlobalContext* globalCtx); -void EnPoDesert_Update(EnPoDesert* this, GlobalContext* globalCtx); -void EnPoDesert_Draw(EnPoDesert* this, GlobalContext* globalCtx); +#define THIS ((EnPoDesert*)thisx) + +void EnPoDesert_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPoDesert_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPoDesert_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPoDesert_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Po_Desert_InitVars = { diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 30df1e36c1..d464ebc2c4 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -2,10 +2,12 @@ #define FLAGS 0x00001035 -void EnPoField_Init(EnPoField* this, GlobalContext* globalCtx); -void EnPoField_Destroy(EnPoField* this, GlobalContext* globalCtx); -void EnPoField_Update(EnPoField* this, GlobalContext* globalCtx); -void EnPoField_Draw(EnPoField* this, GlobalContext* globalCtx); +#define THIS ((EnPoField*)thisx) + +void EnPoField_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPoField_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPoField_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPoField_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Po_Field_InitVars = { diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index 7ad74b9329..abd6b82523 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -2,10 +2,12 @@ #define FLAGS 0x00011019 -void EnPoRelay_Init(EnPoRelay* this, GlobalContext* globalCtx); -void EnPoRelay_Destroy(EnPoRelay* this, GlobalContext* globalCtx); -void EnPoRelay_Update(EnPoRelay* this, GlobalContext* globalCtx); -void EnPoRelay_Draw(EnPoRelay* this, GlobalContext* globalCtx); +#define THIS ((EnPoRelay*)thisx) + +void EnPoRelay_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPoRelay_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPoRelay_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPoRelay_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Po_Relay_InitVars = { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index f833fc696a..9470b3b084 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -2,10 +2,12 @@ #define FLAGS 0x00005215 -void EnPoSisters_Init(EnPoSisters* this, GlobalContext* globalCtx); -void EnPoSisters_Destroy(EnPoSisters* this, GlobalContext* globalCtx); -void EnPoSisters_Update(EnPoSisters* this, GlobalContext* globalCtx); -void EnPoSisters_Draw(EnPoSisters* this, GlobalContext* globalCtx); +#define THIS ((EnPoSisters*)thisx) + +void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPoSisters_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPoSisters_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Po_Sisters_InitVars = { diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index c9aae8cb9b..5703de7ebf 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -2,9 +2,11 @@ #define FLAGS 0x00001015 -void EnPoh_Init(EnPoh* this, GlobalContext* globalCtx); -void EnPoh_Destroy(EnPoh* this, GlobalContext* globalCtx); -void EnPoh_Update(EnPoh* this, GlobalContext* globalCtx); +#define THIS ((EnPoh*)thisx) + +void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPoh_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Poh_InitVars = { diff --git a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c index 69aad33873..432a39d001 100644 --- a/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c +++ b/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx); -void EnPubox_Destroy(EnPubox* this, GlobalContext* globalCtx); -void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx); -void EnPubox_Draw(EnPubox* this, GlobalContext* globalCtx); +#define THIS ((EnPubox*)thisx) + +void EnPubox_Init(Actor* thisx, GlobalContext* globalCtx); +void EnPubox_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnPubox_Update(Actor* thisx, GlobalContext* globalCtx); +void EnPubox_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Pu_box_InitVars = { ACTOR_EN_PU_BOX, @@ -28,9 +30,9 @@ const ActorInit En_Pu_box_InitVars = { extern u32 D_06000380; extern u32 D_060006D0; -void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx) { +void EnPubox_Init(Actor* thisx, GlobalContext* globalCtx) { u32 local_c = 0; - Actor* thisx = &this->dyna.actor; + EnPubox* this = THIS; switch (thisx->params) { case 0: @@ -61,12 +63,14 @@ void EnPubox_Init(EnPubox* this, GlobalContext* globalCtx) { this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, thisx, local_c); } -void EnPubox_Destroy(EnPubox* this, GlobalContext* globalCtx) { +void EnPubox_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnPubox* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } -void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx) { - Actor* thisx = &this->dyna.actor; +void EnPubox_Update(Actor* thisx, GlobalContext* globalCtx) { + EnPubox* this = THIS; thisx->speedXZ += this->dyna.unk_150; thisx->posRot.rot.y = this->dyna.unk_158; @@ -82,6 +86,6 @@ void EnPubox_Update(EnPubox* this, GlobalContext* globalCtx) { thisx->posRot2.pos = thisx->posRot.pos; } -void EnPubox_Draw(EnPubox* this, GlobalContext* globalCtx) { +void EnPubox_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_06000380); } diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 9eecc95ed2..9e550d3739 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000415 -void EnRd_Init(EnRd* this, GlobalContext* globalCtx); -void EnRd_Destroy(EnRd* this, GlobalContext* globalCtx); -void EnRd_Update(EnRd* this, GlobalContext* globalCtx); -void EnRd_Draw(EnRd* this, GlobalContext* globalCtx); +#define THIS ((EnRd*)thisx) + +void EnRd_Init(Actor* thisx, GlobalContext* globalCtx); +void EnRd_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnRd_Update(Actor* thisx, GlobalContext* globalCtx); +void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Rd_InitVars = { diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 02616f7d11..62a0ca27de 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -2,10 +2,12 @@ #define FLAGS 0x08000015 -void EnReeba_Init(EnReeba* this, GlobalContext* globalCtx); -void EnReeba_Destroy(EnReeba* this, GlobalContext* globalCtx); -void EnReeba_Update(EnReeba* this, GlobalContext* globalCtx); -void EnReeba_Draw(EnReeba* this, GlobalContext* globalCtx); +#define THIS ((EnReeba*)thisx) + +void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx); +void EnReeba_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx); +void EnReeba_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Reeba_InitVars = { diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 4fc67559d1..cbc960cf29 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EnRiverSound_Init(EnRiverSound* this, GlobalContext* globalCtx); -void EnRiverSound_Destroy(EnRiverSound* this, GlobalContext* globalCtx); -void EnRiverSound_Update(EnRiverSound* this, GlobalContext* globalCtx); -void EnRiverSound_Draw(EnRiverSound* this, GlobalContext* globalCtx); +#define THIS ((EnRiverSound*)thisx) + +void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx); +void EnRiverSound_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnRiverSound_Update(Actor* thisx, GlobalContext* globalCtx); +void EnRiverSound_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_River_Sound_InitVars = { diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index 88c283b29f..bb849aa836 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnRl_Init(EnRl* this, GlobalContext* globalCtx); -void EnRl_Destroy(EnRl* this, GlobalContext* globalCtx); -void EnRl_Update(EnRl* this, GlobalContext* globalCtx); -void EnRl_Draw(EnRl* this, GlobalContext* globalCtx); +#define THIS ((EnRl*)thisx) + +void EnRl_Init(Actor* thisx, GlobalContext* globalCtx); +void EnRl_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnRl_Update(Actor* thisx, GlobalContext* globalCtx); +void EnRl_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Rl_InitVars = { diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index fb8e834437..7e3b7295cb 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000435 -void EnRr_Init(EnRr* this, GlobalContext* globalCtx); -void EnRr_Destroy(EnRr* this, GlobalContext* globalCtx); -void EnRr_Update(EnRr* this, GlobalContext* globalCtx); -void EnRr_Draw(EnRr* this, GlobalContext* globalCtx); +#define THIS ((EnRr*)thisx) + +void EnRr_Init(Actor* thisx, GlobalContext* globalCtx); +void EnRr_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnRr_Update(Actor* thisx, GlobalContext* globalCtx); +void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Rr_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 82ac2bb0f8..5eac35fb02 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -10,10 +10,12 @@ #define FLAGS 0x04000011 -void EnRu1_Init(EnRu1* this, GlobalContext* globalCtx); -void EnRu1_Destroy(EnRu1* this, GlobalContext* globalCtx); -void EnRu1_Update(EnRu1* this, GlobalContext* globalCtx); -void EnRu1_Draw(EnRu1* this, GlobalContext* globalCtx); +#define THIS ((EnRu1*)thisx) + +void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnRu1_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnRu1_Update(Actor* thisx, GlobalContext* globalCtx); +void EnRu1_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80AEC0B4(EnRu1* this, GlobalContext* globalCtx); void func_80AEC100(EnRu1* this, GlobalContext* globalCtx); @@ -218,7 +220,9 @@ u8 func_80AEADF0(EnRu1* this) { return params; } -void EnRu1_Destroy(EnRu1* this, GlobalContext* globalCtx) { +void EnRu1_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnRu1* this = THIS; + func_80AEAD98(this, globalCtx); } @@ -2239,7 +2243,9 @@ void func_80AF0050(EnRu1* this, GlobalContext* globalCtx) { this->actor.room = -1; } -void EnRu1_Update(EnRu1* this, GlobalContext* globalCtx) { +void EnRu1_Update(Actor* thisx, GlobalContext* globalCtx) { + EnRu1* this = THIS; + if (this->action < 0 || this->action >= 46 || D_80AF193C[this->action] == NULL) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; @@ -2247,9 +2253,9 @@ void EnRu1_Update(EnRu1* this, GlobalContext* globalCtx) { D_80AF193C[this->action](this, globalCtx); } -void EnRu1_Init(EnRu1* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; - u32 temp_ret; +void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx) { + EnRu1* this = THIS; + s32 pad; ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06012700, NULL, &this->limbDrawTable, &this->transitionDrawTable, @@ -2303,30 +2309,32 @@ void func_80AF0278(EnRu1* this, GlobalContext* globalCtx, s32 limbIndex, Vec3s* } } -s32 func_80AF02E8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnRu1* actor, - Gfx** gfx) { - if ((actor->unk_290 < 0) || (actor->unk_290 > 0) || (*D_80AF19F4[actor->unk_290] == NULL)) { +s32 EnRu1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnRu1* thisx, + Gfx** gfx) { + EnRu1* this = THIS; + + if ((this->unk_290 < 0) || (this->unk_290 > 0) || (*D_80AF19F4[this->unk_290] == NULL)) { osSyncPrintf(VT_FGCOL(RED) "首回しモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); } else { - D_80AF19F4[actor->unk_290](actor, globalCtx, limbIndex, rot); + D_80AF19F4[this->unk_290](this, globalCtx, limbIndex, rot); } return 0; } -void func_80AF0368(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor, Gfx** gfx) { - s32 pad; +void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) { + EnRu1* this = THIS; Vec3f vec1; Vec3f vec2; if (limbIndex == 15) { vec1 = D_80AF19F8; Matrix_MultVec3f(&vec1, &vec2); - actor->posRot2.pos.x = vec2.x; - actor->posRot2.pos.y = vec2.y; - actor->posRot2.pos.z = vec2.z; - actor->posRot2.rot.x = actor->posRot.rot.x; - actor->posRot2.rot.y = actor->posRot.rot.y; - actor->posRot2.rot.z = actor->posRot.rot.z; + thisx->posRot2.pos.x = vec2.x; + thisx->posRot2.pos.y = vec2.y; + thisx->posRot2.pos.z = vec2.z; + thisx->posRot2.rot.x = thisx->posRot.rot.x; + thisx->posRot2.rot.y = thisx->posRot.rot.y; + thisx->posRot2.rot.z = thisx->posRot.rot.z; } } @@ -2353,7 +2361,7 @@ void func_80AF0400(EnRu1* this, GlobalContext* globalCtx) { gSPSegment(gfxCtx->polyOpa.p++, 0x0C, &D_80116280[2]); gfxCtx->polyOpa.p = SkelAnime_DrawSV2(globalCtx, skelAnime->skeleton, skelAnime->limbDrawTbl, skelAnime->dListCount, - func_80AF02E8, func_80AF0368, &this->actor, gfxCtx->polyOpa.p); + EnRu1_OverrideLimbDraw, EnRu1_PostLimbDraw, &this->actor, gfxCtx->polyOpa.p); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ru1.c", 1309); } @@ -2378,12 +2386,14 @@ void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx) { gSPSegment(gfxCtx->polyXlu.p++, 0x0C, &D_80116280[0]); gfxCtx->polyXlu.p = SkelAnime_DrawSV2(globalCtx, skelAnime->skeleton, skelAnime->limbDrawTbl, skelAnime->dListCount, - func_80AF02E8, NULL, &this->actor, gfxCtx->polyXlu.p); + EnRu1_OverrideLimbDraw, NULL, &this->actor, gfxCtx->polyXlu.p); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ru1.c", 1353); } -void EnRu1_Draw(EnRu1* this, GlobalContext* globalCtx) { +void EnRu1_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnRu1* this = THIS; + if (this->drawConfig < 0 || this->drawConfig >= 3 || D_80AF1A04[this->drawConfig] == 0) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index f4317d83eb..da230fad43 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -10,10 +10,12 @@ #define FLAGS 0x00000010 -void EnRu2_Init(EnRu2* this, GlobalContext* globalCtx); -void EnRu2_Destroy(EnRu2* this, GlobalContext* globalCtx); -void EnRu2_Update(EnRu2* this, GlobalContext* globalCtx); -void EnRu2_Draw(EnRu2* this, GlobalContext* globalCtx); +#define THIS ((EnRu2*)thisx) + +void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnRu2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnRu2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80AF2CB4(EnRu2* this, GlobalContext* globalCtx); void func_80AF2CD4(EnRu2* this, GlobalContext* globalCtx); @@ -93,10 +95,11 @@ extern AnimationHeader D_0600E630; extern AnimationHeader D_0600F03C; extern AnimationHeader D_0600F8B8; -void func_80AF2550(EnRu2* this, GlobalContext* globalCtx) { - EnRu2* thisLocal = this; - Collider_InitCylinder(globalCtx, &thisLocal->collider); - Collider_SetCylinder_Set3(globalCtx, &thisLocal->collider, &this->actor, &colliderInit); +void func_80AF2550(Actor* thisx, GlobalContext* globalCtx) { + EnRu2* this = THIS; + + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder_Set3(globalCtx, &this->collider, &this->actor, &colliderInit); } void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) { @@ -109,9 +112,10 @@ void func_80AF259C(EnRu2* this, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, collider); } -void EnRu2_Destroy(EnRu2* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void EnRu2_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnRu2* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void func_80AF2608(EnRu2* this) { @@ -746,7 +750,9 @@ void func_80AF3D60(EnRu2* this, GlobalContext* globalCtx) { func_80AF3B74(this, globalCtx); } -void EnRu2_Update(EnRu2* this, GlobalContext* globalCtx) { +void EnRu2_Update(Actor* thisx, GlobalContext* globalCtx) { + EnRu2* this = THIS; + if (this->action < 0 || this->action >= 20 || D_80AF50BC[this->action] == 0) { osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; @@ -754,9 +760,11 @@ void EnRu2_Update(EnRu2* this, GlobalContext* globalCtx) { D_80AF50BC[this->action](this, globalCtx); } -void EnRu2_Init(EnRu2* this, GlobalContext* globalCtx) { +void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) { + EnRu2* this = THIS; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); - func_80AF2550(this, globalCtx); + func_80AF2550(thisx, globalCtx); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600C700, NULL, &this->limbDrawTable, &this->transitionDrawTable, 23); @@ -803,7 +811,9 @@ void func_80AF3F20(EnRu2* this, GlobalContext* globalCtx) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_ru2.c", 663); } -void EnRu2_Draw(EnRu2* this, GlobalContext* globalCtx) { +void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnRu2* this = THIS; + if (this->drawConfig < 0 || this->drawConfig >= 3 || D_80AF510C[this->drawConfig] == 0) { osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index d433a666e5..290fae1ccf 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000019 -void EnSa_Init(EnSa* this, GlobalContext* globalCtx); -void EnSa_Destroy(EnSa* this, GlobalContext* globalCtx); -void EnSa_Update(EnSa* this, GlobalContext* globalCtx); -void EnSa_Draw(EnSa* this, GlobalContext* globalCtx); +#define THIS ((EnSa*)thisx) + +void EnSa_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSa_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Sa_InitVars = { diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 3c9baf83d2..dbdab78faa 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnSb_Init(EnSb* this, GlobalContext* globalCtx); -void EnSb_Destroy(EnSb* this, GlobalContext* globalCtx); -void EnSb_Update(EnSb* this, GlobalContext* globalCtx); -void EnSb_Draw(EnSb* this, GlobalContext* globalCtx); +#define THIS ((EnSb*)thisx) + +void EnSb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSb_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSb_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSb_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Sb_InitVars = { diff --git a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c index d110f8a1c6..e26d031c2b 100644 --- a/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c +++ b/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.c @@ -8,10 +8,13 @@ #define FLAGS 0x00000000 -void EnSceneChange_Init(EnSceneChange* this, GlobalContext* globalCtx); -void EnSceneChange_Destroy(EnSceneChange* this, GlobalContext* globalCtx); -void EnSceneChange_Update(EnSceneChange* this, GlobalContext* globalCtx); -void EnSceneChange_Draw(EnSceneChange* this, GlobalContext* globalCtx); +#define THIS ((EnSceneChange*)thisx) + +void EnSceneChange_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSceneChange_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSceneChange_Draw(Actor* thisx, GlobalContext* globalCtx); + void EnSceneChange_SetupAction(EnSceneChange* this, ActorFunc actionFunc); void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx); @@ -31,24 +34,28 @@ void EnSceneChange_SetupAction(EnSceneChange* this, ActorFunc actionFunc) { this->actionFunc = actionFunc; } -void EnSceneChange_Init(EnSceneChange* this, GlobalContext* globalCtx) { +void EnSceneChange_Init(Actor* thisx, GlobalContext* globalCtx) { + EnSceneChange* this = THIS; + EnSceneChange_SetupAction(this, func_80AF8CAC); } -void EnSceneChange_Destroy(EnSceneChange* this, GlobalContext* globalCtx) { +void EnSceneChange_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80AF8CAC(EnSceneChange* this, GlobalContext* globalCtx) { } -void EnSceneChange_Update(EnSceneChange* this, GlobalContext* globalCtx) { +void EnSceneChange_Update(Actor* thisx, GlobalContext* globalCtx) { + EnSceneChange* this = THIS; + this->actionFunc(this, globalCtx); } -void EnSceneChange_Draw(EnSceneChange* this, GlobalContext* globalCtx) { - s32 pad[0x2]; +void EnSceneChange_Draw(Actor* thisx, GlobalContext* globalCtx) { + s32 pad[2]; Gfx* displayList; - s32 pad1[0x2]; + s32 pad2[2]; Gfx* displayListHead; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_En_Sda/z_en_sda.c b/src/overlays/actors/ovl_En_Sda/z_en_sda.c index 6aa27a7398..af5ce04d4f 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnSda_Init(EnSda* this, GlobalContext* globalCtx); -void EnSda_Destroy(EnSda* this, GlobalContext* globalCtx); -void EnSda_Update(EnSda* this, GlobalContext* globalCtx); -void EnSda_Draw(EnSda* this, GlobalContext* globalCtx); +#define THIS ((EnSda*)thisx) + +void EnSda_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSda_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSda_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSda_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Sda_InitVars = { diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 8fbe69e69b..06c75a3318 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000005 -void EnShopnuts_Init(EnShopnuts* this, GlobalContext* globalCtx); -void EnShopnuts_Destroy(EnShopnuts* this, GlobalContext* globalCtx); -void EnShopnuts_Update(EnShopnuts* this, GlobalContext* globalCtx); -void EnShopnuts_Draw(EnShopnuts* this, GlobalContext* globalCtx); +#define THIS ((EnShopnuts*)thisx) + +void EnShopnuts_Init(Actor* thisx, GlobalContext* globalCtx); +void EnShopnuts_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnShopnuts_Update(Actor* thisx, GlobalContext* globalCtx); +void EnShopnuts_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Shopnuts_InitVars = { diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index a014c1def2..1ce48b8ee6 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000201 -void EnSi_Init(EnSi* this, GlobalContext* globalCtx); -void EnSi_Destroy(EnSi* this, GlobalContext* globalCtx); -void EnSi_Update(EnSi* this, GlobalContext* globalCtx); -void EnSi_Draw(EnSi* this, GlobalContext* globalCtx); +#define THIS ((EnSi*)thisx) + +void EnSi_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSi_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx); s32 func_80AFB748(EnSi* this, GlobalContext* globalCtx); void func_80AFB768(EnSi* this, GlobalContext* globalCtx); void func_80AFB89C(EnSi* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index 92a56faa34..c9ea69d9a7 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000030 -void EnSiofuki_Init(EnSiofuki* this, GlobalContext* globalCtx); -void EnSiofuki_Destroy(EnSiofuki* this, GlobalContext* globalCtx); -void EnSiofuki_Update(EnSiofuki* this, GlobalContext* globalCtx); -void EnSiofuki_Draw(EnSiofuki* this, GlobalContext* globalCtx); +#define THIS ((EnSiofuki*)thisx) + +void EnSiofuki_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSiofuki_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSiofuki_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSiofuki_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Siofuki_InitVars = { diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index b0ed771149..fc885342d3 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000015 -void EnSkb_Init(EnSkb* this, GlobalContext* globalCtx); -void EnSkb_Destroy(EnSkb* this, GlobalContext* globalCtx); -void EnSkb_Update(EnSkb* this, GlobalContext* globalCtx); -void EnSkb_Draw(EnSkb* this, GlobalContext* globalCtx); +#define THIS ((EnSkb*)thisx) + +void EnSkb_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSkb_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSkb_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSkb_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Skb_InitVars = { diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 83d00d45f8..a97351abe6 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000015 -void EnSkj_Init(EnSkj* this, GlobalContext* globalCtx); -void EnSkj_Destroy(EnSkj* this, GlobalContext* globalCtx); -void EnSkj_Update(EnSkj* this, GlobalContext* globalCtx); -void EnSkj_Draw(EnSkj* this, GlobalContext* globalCtx); +#define THIS ((EnSkj*)thisx) + +void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSkj_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSkj_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSkj_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Skj_InitVars = { diff --git a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c index d64bd0ebb9..00940ef27e 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000205 -void EnSkjneedle_Init(EnSkjneedle* this, GlobalContext* globalCtx); -void EnSkjneedle_Destroy(EnSkjneedle* this, GlobalContext* globalCtx); -void EnSkjneedle_Update(EnSkjneedle* this, GlobalContext* globalCtx); -void EnSkjneedle_Draw(EnSkjneedle* this, GlobalContext* globalCtx); +#define THIS ((EnSkjneedle*)thisx) + +void EnSkjneedle_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSkjneedle_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSkjneedle_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSkjneedle_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Skjneedle_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index dfd3755e28..c6ffadb363 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void EnSsh_Init(EnSsh* this, GlobalContext* globalCtx); -void EnSsh_Destroy(EnSsh* this, GlobalContext* globalCtx); -void EnSsh_Update(EnSsh* this, GlobalContext* globalCtx); -void EnSsh_Draw(EnSsh* this, GlobalContext* globalCtx); +#define THIS ((EnSsh*)thisx) + +void EnSsh_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSsh_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSsh_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ssh_InitVars = { diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index db98a19a38..dc6eabbb61 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000035 -void EnSt_Init(EnSt* this, GlobalContext* globalCtx); -void EnSt_Destroy(EnSt* this, GlobalContext* globalCtx); -void EnSt_Update(EnSt* this, GlobalContext* globalCtx); -void EnSt_Draw(EnSt* this, GlobalContext* globalCtx); +#define THIS ((EnSt*)thisx) + +void EnSt_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSt_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSt_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSt_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_St_InitVars = { diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index d1acef8b28..1db2c5fd02 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000019 -void EnSth_Init(EnSth* this, GlobalContext* globalCtx); -void EnSth_Destroy(EnSth* this, GlobalContext* globalCtx); -void EnSth_Update(EnSth* this, GlobalContext* globalCtx); +#define THIS ((EnSth*)thisx) + +void EnSth_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSth_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSth_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Sth_InitVars = { diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 37e098e717..fd2daa8eff 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnStream_Init(EnStream* this, GlobalContext* globalCtx); -void EnStream_Destroy(EnStream* this, GlobalContext* globalCtx); -void EnStream_Update(EnStream* this, GlobalContext* globalCtx); -void EnStream_Draw(EnStream* this, GlobalContext* globalCtx); +#define THIS ((EnStream*)thisx) + +void EnStream_Init(Actor* thisx, GlobalContext* globalCtx); +void EnStream_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnStream_Update(Actor* thisx, GlobalContext* globalCtx); +void EnStream_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Stream_InitVars = { diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index cd4c49e32e..f0bae4b5b6 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000015 -void EnSw_Init(EnSw* this, GlobalContext* globalCtx); -void EnSw_Destroy(EnSw* this, GlobalContext* globalCtx); -void EnSw_Update(EnSw* this, GlobalContext* globalCtx); -void EnSw_Draw(EnSw* this, GlobalContext* globalCtx); +#define THIS ((EnSw*)thisx) + +void EnSw_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSw_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSw_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSw_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Sw_InitVars = { diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index e1b22ff597..379a0660c0 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -2,9 +2,11 @@ #define FLAGS 0x00000010 -void EnSyatekiItm_Init(EnSyatekiItm* this, GlobalContext* globalCtx); -void EnSyatekiItm_Destroy(EnSyatekiItm* this, GlobalContext* globalCtx); -void EnSyatekiItm_Update(EnSyatekiItm* this, GlobalContext* globalCtx); +#define THIS ((EnSyatekiItm*)thisx) + +void EnSyatekiItm_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiItm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiItm_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Syateki_Itm_InitVars = { diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 8a8c72424b..2b1b620e94 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -2,10 +2,12 @@ #define FLAGS 0x08000019 -void EnSyatekiMan_Init(EnSyatekiMan* this, GlobalContext* globalCtx); -void EnSyatekiMan_Destroy(EnSyatekiMan* this, GlobalContext* globalCtx); -void EnSyatekiMan_Update(EnSyatekiMan* this, GlobalContext* globalCtx); -void EnSyatekiMan_Draw(EnSyatekiMan* this, GlobalContext* globalCtx); +#define THIS ((EnSyatekiMan*)thisx) + +void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiMan_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiMan_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiMan_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Syateki_Man_InitVars = { diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 3a3e63da2d..7aab94907c 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnSyatekiNiw_Init(EnSyatekiNiw* this, GlobalContext* globalCtx); -void EnSyatekiNiw_Destroy(EnSyatekiNiw* this, GlobalContext* globalCtx); -void EnSyatekiNiw_Update(EnSyatekiNiw* this, GlobalContext* globalCtx); -void EnSyatekiNiw_Draw(EnSyatekiNiw* this, GlobalContext* globalCtx); +#define THIS ((EnSyatekiNiw*)thisx) + +void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiNiw_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiNiw_Update(Actor* thisx, GlobalContext* globalCtx); +void EnSyatekiNiw_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Syateki_Niw_InitVars = { diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 2383924269..fcc3bcb49e 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000009 -void EnTa_Init(EnTa* this, GlobalContext* globalCtx); -void EnTa_Destroy(EnTa* this, GlobalContext* globalCtx); -void EnTa_Update(EnTa* this, GlobalContext* globalCtx); -void EnTa_Draw(EnTa* this, GlobalContext* globalCtx); +#define THIS ((EnTa*)thisx) + +void EnTa_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTa_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTa_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ta_InitVars = { diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index a1026d76b8..684fcfba46 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -8,10 +8,12 @@ #define FLAGS 0x08000039 -void EnTakaraMan_Init(EnTakaraMan* this, GlobalContext* globalCtx); -void EnTakaraMan_Destroy(EnTakaraMan* this, GlobalContext* globalCtx); -void EnTakaraMan_Update(EnTakaraMan* this, GlobalContext* globalCtx); -void EnTakaraMan_Draw(EnTakaraMan* this, GlobalContext* globalCtx); +#define THIS ((EnTakaraMan*)thisx) + +void EnTakaraMan_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTakaraMan_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTakaraMan_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTakaraMan_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Takara_Man_InitVars = { diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index 6a8f6dd972..db700489a4 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -8,11 +8,13 @@ #define FLAGS 0x00000009 -void EnTana_Init(EnTana* this, GlobalContext* globalCtx); -void EnTana_Destroy(EnTana* this, GlobalContext* globalCtx); -void EnTana_Update(EnTana* this, GlobalContext* globalCtx); -void func_80B17FC4(EnTana* this, GlobalContext* globalCtx); -void func_80B1809C(EnTana* this, GlobalContext* globalCtx); +#define THIS ((EnTana*)thisx) + +void EnTana_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTana_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTana_Update(Actor* thisx, GlobalContext* globalCtx); +void func_80B17FC4(Actor* thisx, GlobalContext* globalCtx); +void func_80B1809C(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Tana_InitVars = { ACTOR_EN_TANA, @@ -32,9 +34,9 @@ static char* shelfTypes[] = { }; static const ActorFunc drawFuncs[] = { - (ActorFunc)func_80B17FC4, - (ActorFunc)func_80B1809C, - (ActorFunc)func_80B1809C, + func_80B17FC4, + func_80B1809C, + func_80B1809C, }; static Gfx* dListTbl[] = { @@ -49,23 +51,23 @@ static Gfx* dListTbl2[] = { 0x06001608, }; -void EnTana_Init(EnTana* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; +void EnTana_Init(Actor* thisx, GlobalContext* globalCtx) { + EnTana* this = THIS; + osSyncPrintf("☆☆☆ %s ☆☆☆\n", shelfTypes[thisx->params]); Actor_SetScale(thisx, 1.0f); thisx->flags &= ~1; thisx->draw = drawFuncs[thisx->params]; } -void EnTana_Destroy(EnTana* this, GlobalContext* globalCtx) { +void EnTana_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void EnTana_Update(EnTana* this, GlobalContext* globalCtx) { +void EnTana_Update(Actor* thisx, GlobalContext* globalCtx) { } -void func_80B17FC4(EnTana* this, GlobalContext* globalCtx) { - - Actor* thisx = &this->actor; +void func_80B17FC4(Actor* thisx, GlobalContext* globalCtx) { + EnTana* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; @@ -78,8 +80,8 @@ void func_80B17FC4(EnTana* this, GlobalContext* globalCtx) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tana.c", 157); } -void func_80B1809C(EnTana* this, GlobalContext* globalCtx) { - Actor* thisx = &this->actor; +void func_80B1809C(Actor* thisx, GlobalContext* globalCtx) { + EnTana* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 9cf269358c..84a7eb0b12 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000015 -void EnTest_Init(EnTest* this, GlobalContext* globalCtx); -void EnTest_Destroy(EnTest* this, GlobalContext* globalCtx); -void EnTest_Update(EnTest* this, GlobalContext* globalCtx); -void EnTest_Draw(EnTest* this, GlobalContext* globalCtx); +#define THIS ((EnTest*)thisx) + +void EnTest_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTest_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTest_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTest_Draw(Actor* thisx, GlobalContext* globalCtx); void EnTest_SetupAction(EnTest* this, ActorFunc actionFunc); void func_8085F938(EnTest* this, GlobalContext* globalCtx); void func_8085FAB0(EnTest* this, GlobalContext* globalCtx); diff --git a/src/overlays/actors/ovl_En_Tg/z_en_tg.c b/src/overlays/actors/ovl_En_Tg/z_en_tg.c index b0bfea68e2..d4129f4562 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000009 -void EnTg_Init(EnTg* this, GlobalContext* globalCtx); -void EnTg_Destroy(EnTg* this, GlobalContext* globalCtx); -void EnTg_Update(EnTg* this, GlobalContext* globalCtx); -void EnTg_Draw(EnTg* this, GlobalContext* globalCtx); +#define THIS ((EnTg*)thisx) + +void EnTg_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTg_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTg_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTg_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Tg_InitVars = { diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 400a26efb0..89667c95bd 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000015 -void EnTite_Init(EnTite* this, GlobalContext* globalCtx); -void EnTite_Destroy(EnTite* this, GlobalContext* globalCtx); -void EnTite_Update(EnTite* this, GlobalContext* globalCtx); -void EnTite_Draw(EnTite* this, GlobalContext* globalCtx); +#define THIS ((EnTite*)thisx) + +void EnTite_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTite_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTite_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTite_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Tite_InitVars = { diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index ed9002b6f5..1f60372070 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -8,14 +8,17 @@ #define FLAGS 0x00000009 +#define THIS ((EnTk*)thisx) + +void EnTk_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTk_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx); + s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx); -void EnTk_Init(EnTk* this, GlobalContext* globalCtx); -void EnTk_Destroy(EnTk* this, GlobalContext* globalCtx); void EnTk_Rest(EnTk* this, GlobalContext* globalCtx); void EnTk_Walk(EnTk* this, GlobalContext* globalCtx); void EnTk_Dig(EnTk* this, GlobalContext* globalCtx); -void EnTk_Update(EnTk* this, GlobalContext* globalCtx); -void EnTk_Draw(EnTk* this, GlobalContext* globalCtx); extern UNK_TYPE D_04051DB0; extern UNK_TYPE D_040521B0; @@ -346,7 +349,7 @@ s32 EnTk_Orient(EnTk* this, GlobalContext* globalCtx) { } } -u16 func_80B1C54C(GlobalContext* globalCtx, Actor* a1) { +u16 func_80B1C54C(GlobalContext* globalCtx, Actor* thisx) { u16 ret; ret = Text_GetFaceReaction(globalCtx, 14); @@ -363,7 +366,7 @@ u16 func_80B1C54C(GlobalContext* globalCtx, Actor* a1) { } } -s16 func_80B1C5A0(GlobalContext* globalCtx, Actor* actor) { +s16 func_80B1C5A0(GlobalContext* globalCtx, Actor* thisx) { s32 ret = 1; switch (func_8010BDBC(&globalCtx->msgCtx)) { @@ -372,7 +375,7 @@ s16 func_80B1C5A0(GlobalContext* globalCtx, Actor* actor) { break; case 2: /* "I am the boss of the carpenters ..." (wtf?) */ - if (actor->textId == 0x5028) { + if (thisx->textId == 0x5028) { gSaveContext.infTable[13] |= 0x0100; } ret = 0; @@ -380,25 +383,25 @@ s16 func_80B1C5A0(GlobalContext* globalCtx, Actor* actor) { case 3: break; case 4: - if (func_80106BC8(globalCtx) != 0 && (actor->textId == 0x5018 || actor->textId == 0x5019)) { + if (func_80106BC8(globalCtx) != 0 && (thisx->textId == 0x5018 || thisx->textId == 0x5019)) { if (globalCtx->msgCtx.choiceIndex == 1) { /* "Thanks a lot!" */ - actor->textId = 0x0084; + thisx->textId = 0x0084; } else if (gSaveContext.rupees < 10) { /* "You don't have enough Rupees!" */ - actor->textId = 0x0085; + thisx->textId = 0x0085; } else { globalCtx->msgCtx.msgMode = 0x37; Rupees_ChangeBy(-10); gSaveContext.infTable[13] |= 0x0200; return 2; } - func_8010B720(globalCtx, actor->textId); + func_8010B720(globalCtx, thisx->textId); gSaveContext.infTable[13] |= 0x0200; } break; case 5: - if (func_80106BC8(globalCtx) != 0 && (actor->textId == 0x0084 || actor->textId == 0x0085)) { + if (func_80106BC8(globalCtx) != 0 && (thisx->textId == 0x0084 || thisx->textId == 0x0085)) { func_80106CCC(globalCtx); ret = 0; } @@ -492,39 +495,40 @@ void EnTk_DigEff(EnTk* this) { } } -void EnTk_Init(EnTk* this, GlobalContext* globalCtx) { - EnTk* thisAgain = this; - AnimationHeader* anim = &D_06002F84; +void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { + EnTk* this = THIS; + s32 pad; - ActorShape_Init(&thisAgain->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.f); - SkelAnime_InitSV(globalCtx, &thisAgain->skelAnim, &D_0600BE40, NULL, thisAgain->hz_22A, thisAgain->hz_296, 18); - SkelAnime_ChangeAnim(&thisAgain->skelAnim, anim, 1.f, 0.f, SkelAnime_GetFrameCount(&D_06002F84.genericHeader), 0, + SkelAnime_InitSV(globalCtx, &this->skelAnim, &D_0600BE40, NULL, this->hz_22A, this->hz_296, 18); + SkelAnime_ChangeAnim(&this->skelAnim, &D_06002F84, 1.f, 0.f, SkelAnime_GetFrameCount(&D_06002F84.genericHeader), 0, 0.f); - Collider_InitCylinder(globalCtx, &thisAgain->collider); - Collider_SetCylinder(globalCtx, &thisAgain->collider, &thisAgain->actor, &D_80B1D508); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80B1D508); - func_80061EFC(&thisAgain->actor.colChkInfo, NULL, &colChkInfoInit); + func_80061EFC(&this->actor.colChkInfo, NULL, &colChkInfoInit); if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD || globalCtx->sceneNum != SCENE_SPOT02) { - Actor_Kill(&thisAgain->actor); + Actor_Kill(&this->actor); return; } - Actor_SetScale(&thisAgain->actor, 0.01f); + Actor_SetScale(&this->actor, 0.01f); - thisAgain->actor.unk_1F = 6; - thisAgain->actor.gravity = -0.1f; - thisAgain->currentReward = -1; - thisAgain->currentSpot = NULL; - thisAgain->actionFunc = EnTk_Rest; + this->actor.unk_1F = 6; + this->actor.gravity = -0.1f; + this->currentReward = -1; + this->currentSpot = NULL; + this->actionFunc = EnTk_Rest; } -void EnTk_Destroy(EnTk* this, GlobalContext* globalCtx) { - EnTk* thisAgain = this; - Collider_DestroyCylinder(globalCtx, &thisAgain->collider); +void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnTk* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { @@ -670,24 +674,24 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { } } -void EnTk_Update(EnTk* this, GlobalContext* globalCtx) { - EnTk* thisAgain = this; - ColliderCylinder* collider = &thisAgain->collider; +void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) { + EnTk* this = THIS; + s32 pad; - Collider_CylinderUpdate(&thisAgain->actor, collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, collider); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); - SkelAnime_FrameUpdateMatrix(&thisAgain->skelAnim); + SkelAnime_FrameUpdateMatrix(&this->skelAnim); - Actor_MoveForward(&thisAgain->actor); + Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &thisAgain->actor, 40.f, 10.f, 0.f, 5); + func_8002E4B4(globalCtx, &this->actor, 40.f, 10.f, 0.f, 5); - thisAgain->actionFunc(thisAgain, globalCtx); + this->actionFunc(this, globalCtx); - EnTkEff_Update(thisAgain); + EnTkEff_Update(this); - EnTk_UpdateEyes(thisAgain); + EnTk_UpdateEyes(this); } void func_80B1D200(GlobalContext* globalCtx) { @@ -702,26 +706,26 @@ void func_80B1D200(GlobalContext* globalCtx) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tk.c", 1190); } -s32 func_80B1D278(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) { - EnTk* tk = (EnTk*)actor; +s32 EnTk_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnTk* this = THIS; switch (limbIndex) { /* Limb 15 - Head */ case 15: - tk->h_21E = rot->y; + this->h_21E = rot->y; break; /* Limb 16 - Jaw */ case 16: - tk->h_21E += rot->y; - rot->y += tk->headRot; + this->h_21E += rot->y; + rot->y += this->headRot; break; } return 0; } -void func_80B1D2E4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) { - EnTk* this = (EnTk*)actor; +void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnTk* this = THIS; Vec3f sp28 = { 0.f, 0.f, 4600.f }; Vec3f sp1C = { 0.f, 0.f, 0.f }; @@ -737,19 +741,19 @@ void func_80B1D2E4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } } -void EnTk_Draw(EnTk* this, GlobalContext* globalCtx) { +void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) { static UNK_PTR eyeImages[] = { &D_06003B40, &D_06004340, &D_06004B40, }; - EnTk* thisAgain = this; + EnTk* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; Matrix_Push(); - EnTkEff_Draw(thisAgain, globalCtx); + EnTkEff_Draw(this, globalCtx); Matrix_Pull(); gfxCtx = globalCtx->state.gfxCtx; @@ -757,10 +761,10 @@ void EnTk_Draw(EnTk* this, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); - gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(eyeImages[thisAgain->eyeImageIdx])); + gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(eyeImages[this->eyeImageIdx])); - SkelAnime_DrawSV(globalCtx, thisAgain->skelAnim.skeleton, thisAgain->skelAnim.limbDrawTbl, - thisAgain->skelAnim.dListCount, func_80B1D278, func_80B1D2E4, &thisAgain->actor); + SkelAnime_DrawSV(globalCtx, this->skelAnim.skeleton, this->skelAnim.limbDrawTbl, this->skelAnim.dListCount, + EnTk_OverrideLimbDraw, EnTk_PostLimbDraw, &this->actor); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_tk.c", 1312); } diff --git a/src/overlays/actors/ovl_En_Torch/z_en_torch.c b/src/overlays/actors/ovl_En_Torch/z_en_torch.c index 67892f628e..87d4f04c3e 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -8,7 +8,9 @@ #define FLAGS 0x00000000 -void EnTorch_Init(EnTorch* this, GlobalContext* globalCtx); +#define THIS ((EnTorch*)thisx) + +void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Torch_InitVars = { ACTOR_EN_TORCH, @@ -26,7 +28,8 @@ static u8 sChestContents[] = { GI_RUPEE_BLUE, GI_RUPEE_RED, GI_RUPEE_GOLD, GI_BOMBS_20, GI_BOMBS_1, GI_BOMBS_1, GI_BOMBS_1, GI_BOMBS_1, }; -void EnTorch_Init(EnTorch* this, GlobalContext* globalCtx) { +void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx) { + EnTorch* this = THIS; s8 returnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data; /* Spawn chest with desired contents. diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index cebe28842e..fd6fbdec27 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000035 -void EnTorch2_Init(EnTorch2* this, GlobalContext* globalCtx); -void EnTorch2_Destroy(EnTorch2* this, GlobalContext* globalCtx); -void EnTorch2_Update(EnTorch2* this, GlobalContext* globalCtx); -void EnTorch2_Draw(EnTorch2* this, GlobalContext* globalCtx); +#define THIS ((EnTorch2*)thisx) + +void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTorch2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTorch2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Torch2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 4e1693505d..392f165e4c 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000009 -void EnToryo_Init(EnToryo* this, GlobalContext* globalCtx); -void EnToryo_Destroy(EnToryo* this, GlobalContext* globalCtx); -void EnToryo_Update(EnToryo* this, GlobalContext* globalCtx); -void EnToryo_Draw(EnToryo* this, GlobalContext* globalCtx); +#define THIS ((EnToryo*)thisx) + +void EnToryo_Init(Actor* thisx, GlobalContext* globalCtx); +void EnToryo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnToryo_Update(Actor* thisx, GlobalContext* globalCtx); +void EnToryo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Toryo_InitVars = { diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 97a389bf0a..9c8c0e9345 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void EnTp_Init(EnTp* this, GlobalContext* globalCtx); -void EnTp_Destroy(EnTp* this, GlobalContext* globalCtx); -void EnTp_Update(EnTp* this, GlobalContext* globalCtx); -void EnTp_Draw(EnTp* this, GlobalContext* globalCtx); +#define THIS ((EnTp*)thisx) + +void EnTp_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTp_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTp_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTp_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Tp_InitVars = { diff --git a/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 175b53d787..74c056f3b1 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnTr_Init(EnTr* this, GlobalContext* globalCtx); -void EnTr_Destroy(EnTr* this, GlobalContext* globalCtx); -void EnTr_Update(EnTr* this, GlobalContext* globalCtx); -void EnTr_Draw(EnTr* this, GlobalContext* globalCtx); +#define THIS ((EnTr*)thisx) + +void EnTr_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTr_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTr_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTr_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Tr_InitVars = { diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index c7b26b392c..63301afedc 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnTrap_Init(EnTrap* this, GlobalContext* globalCtx); -void EnTrap_Destroy(EnTrap* this, GlobalContext* globalCtx); -void EnTrap_Update(EnTrap* this, GlobalContext* globalCtx); -void EnTrap_Draw(EnTrap* this, GlobalContext* globalCtx); +#define THIS ((EnTrap*)thisx) + +void EnTrap_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTrap_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTrap_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTrap_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Trap_InitVars = { diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 9bdd6bdd3e..c6e2cdb55c 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -8,16 +8,19 @@ #include -void EnTuboTrap_Init(EnTuboTrap* this, GlobalContext* globalCtx); -void EnTuboTrap_Destroy(EnTuboTrap* this, GlobalContext* globalCtx); -void EnTuboTrap_Update(EnTuboTrap* this, GlobalContext* globalCtx); -void EnTuboTrap_Draw(EnTuboTrap* this, GlobalContext* globalCtx); +#define FLAGS 0x00000010 + +#define THIS ((EnTuboTrap*)thisx) + +void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx); +void EnTuboTrap_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx); +void EnTuboTrap_Draw(Actor* thisx, GlobalContext* globalCtx); + void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx); void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx); -#define FLAGS 0x00000010 - static ColliderCylinderInit cylinderInitData = { { COLTYPE_UNK10, 0x11, 0x09, 0x00, 0x20, COLSHAPE_CYLINDER }, { 0x00, { 0xFFCFFFFF, 0x00, 0x04 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x01, 0x01, 0x00 }, @@ -39,8 +42,9 @@ const ActorInit En_Tubo_Trap_InitVars = { extern UNK_TYPE D_05017A60; extern Gfx D_05017870[]; -void EnTuboTrap_Init(EnTuboTrap* this, GlobalContext* globalCtx) { - s32 pad; +void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx) { + EnTuboTrap* this = THIS; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 2.0f); osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap" @@ -50,14 +54,16 @@ void EnTuboTrap_Init(EnTuboTrap* this, GlobalContext* globalCtx) { this->actionFunc = (ActorFunc)EnTuboTrap_WaitForProximity; } -void EnTuboTrap_Destroy(EnTuboTrap* this, GlobalContext* globalCtx) { - ColliderCylinder* collider = &this->collider; - Collider_DestroyCylinder(globalCtx, collider); +void EnTuboTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnTuboTrap* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) { s16 params = this->actor.params; s16 param3FF = (params >> 6) & 0x3FF; + if (param3FF >= 0 && param3FF < 0x1A) { Item_DropCollectible(globalCtx, &this->actor.posRot, param3FF | ((params & 0x3F) << 8)); } @@ -275,19 +281,19 @@ void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx) { EnTuboTrap_HandleImpact(this, globalCtx); } -void EnTuboTrap_Update(EnTuboTrap* this, GlobalContext* globalCtx) { - EnTuboTrap* tuboTrap = this; - CollisionCheckContext* check = &globalCtx->colChkCtx; +void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) { + EnTuboTrap* this = THIS; + s32 pad; - tuboTrap->actionFunc(tuboTrap, globalCtx); - Actor_MoveForward(&tuboTrap->actor); - func_8002E4B4(globalCtx, &tuboTrap->actor, 10.0f, 10.0f, 20.0f, 0x1D); - Actor_SetHeight(&tuboTrap->actor, 0.0f); - Collider_CylinderUpdate(&tuboTrap->actor, &tuboTrap->collider); - CollisionCheck_SetAC(globalCtx, check, &tuboTrap->collider); - CollisionCheck_SetAT(globalCtx, check, &tuboTrap->collider); + this->actionFunc(this, globalCtx); + Actor_MoveForward(&this->actor); + func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 20.0f, 0x1D); + Actor_SetHeight(&this->actor, 0.0f); + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider); } -void EnTuboTrap_Draw(EnTuboTrap* this, GlobalContext* globalCtx) { +void EnTuboTrap_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, D_05017870); } diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 3755b92cae..bdfd8bc86e 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -8,10 +8,12 @@ #define FLAGS 0x00001015 -void EnVali_Init(EnVali* this, GlobalContext* globalCtx); -void EnVali_Destroy(EnVali* this, GlobalContext* globalCtx); -void EnVali_Update(EnVali* this, GlobalContext* globalCtx); -void EnVali_Draw(EnVali* this, GlobalContext* globalCtx); +#define THIS ((EnVali*)thisx) + +void EnVali_Init(Actor* thisx, GlobalContext* globalCtx); +void EnVali_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnVali_Update(Actor* thisx, GlobalContext* globalCtx); +void EnVali_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Vali_InitVars = { diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.c b/src/overlays/actors/ovl_En_Vase/z_en_vase.c index 854261ff2b..faa45c630d 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000010 -void EnVase_Init(EnVase* this, GlobalContext* globalCtx); -void EnVase_Destroy(EnVase* this, GlobalContext* globalCtx); -void EnVase_Draw(EnVase* this, GlobalContext* globalCtx); +#define THIS ((EnVase*)thisx) + +void EnVase_Init(Actor* thisx, GlobalContext* globalCtx); +void EnVase_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Vase_InitVars = { ACTOR_EN_VASE, @@ -26,15 +28,17 @@ const ActorInit En_Vase_InitVars = { extern u32 DL_VASE; -void EnVase_Init(EnVase* this, GlobalContext* globalCtx) { +void EnVase_Init(Actor* thisx, GlobalContext* globalCtx) { + EnVase* this = THIS; + Actor_SetScale(&this->actor, 0.01f); this->actor.posRot2.pos = this->actor.posRot.pos; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); } -void EnVase_Destroy(EnVase* this, GlobalContext* globalCtx) { +void EnVase_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void EnVase_Draw(EnVase* this, GlobalContext* globalCtx) { +void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &DL_VASE); } diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 041bc9d884..8f48376c2a 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EnVbBall_Init(EnVbBall* this, GlobalContext* globalCtx); -void EnVbBall_Destroy(EnVbBall* this, GlobalContext* globalCtx); -void EnVbBall_Update(EnVbBall* this, GlobalContext* globalCtx); -void EnVbBall_Draw(EnVbBall* this, GlobalContext* globalCtx); +#define THIS ((EnVbBall*)thisx) + +void EnVbBall_Init(Actor* thisx, GlobalContext* globalCtx); +void EnVbBall_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx); +void EnVbBall_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Vb_Ball_InitVars = { diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index e4f87b4163..5defb0619c 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnViewer_Init(EnViewer* this, GlobalContext* globalCtx); -void EnViewer_Destroy(EnViewer* this, GlobalContext* globalCtx); -void EnViewer_Update(EnViewer* this, GlobalContext* globalCtx); -void EnViewer_Draw(EnViewer* this, GlobalContext* globalCtx); +#define THIS ((EnViewer*)thisx) + +void EnViewer_Init(Actor* thisx, GlobalContext* globalCtx); +void EnViewer_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnViewer_Update(Actor* thisx, GlobalContext* globalCtx); +void EnViewer_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Viewer_InitVars = { diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index c7a4eeeb83..ab9c4ca21b 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000011 -void EnVm_Init(EnVm* this, GlobalContext* globalCtx); -void EnVm_Destroy(EnVm* this, GlobalContext* globalCtx); -void EnVm_Update(EnVm* this, GlobalContext* globalCtx); -void EnVm_Draw(EnVm* this, GlobalContext* globalCtx); +#define THIS ((EnVm*)thisx) + +void EnVm_Init(Actor* thisx, GlobalContext* globalCtx); +void EnVm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnVm_Update(Actor* thisx, GlobalContext* globalCtx); +void EnVm_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Vm_InitVars = { diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index bdac84e678..93b6d993e0 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000010 -void EnWallTubo_Init(EnWallTubo* this, GlobalContext* globalCtx); -void EnWallTubo_Destroy(EnWallTubo* this, GlobalContext* globalCtx); -void EnWallTubo_Update(EnWallTubo* this, GlobalContext* globalCtx); +#define THIS ((EnWallTubo*)thisx) + +void EnWallTubo_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWallTubo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWallTubo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Wall_Tubo_InitVars = { diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 17ddecae62..01159dcc67 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -8,6 +8,8 @@ #define FLAGS 0x00000015 +#define THIS ((EnWallmas*)thisx) + #define TIMER_SCALE ((f32)OS_CLOCK_RATE / 10000000000) #define DEGREE_60_RAD 1.0471975803375244140625f #define DEGREE_15_RAD 0.261799395084381103515625f @@ -16,8 +18,11 @@ #define DAMAGE_EFFECT_STUN_WHITE 4 #define DAMAGE_EFFECT_STUN_BLUE 1 -void EnWallmas_Init(EnWallmas* this, GlobalContext* globalCtx); -void EnWallmas_Destroy(EnWallmas* this, GlobalContext* globalCtx); +void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWallmas_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx); +void EnWallmas_Draw(Actor* thisx, GlobalContext* globalCtx); + void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_ProximityOrSwitchInit(EnWallmas* this); void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx); @@ -33,9 +38,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_WaitForSwitchFlag(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx); -void EnWallmas_Update(EnWallmas* this, GlobalContext* globalCtx); void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx); -void EnWallmas_Draw(EnWallmas* this, GlobalContext* globalCtx); const ActorInit En_Wallmas_InitVars = { ACTOR_EN_WALLMAS, @@ -87,37 +90,38 @@ extern AnimationHeader D_060041F4; extern AnimationHeader D_0600A054; extern Gfx D_06008688[]; -void EnWallmas_Init(EnWallmas* this, GlobalContext* globalCtx) { - EnWallmas* this2 = this; +void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx) { + EnWallmas* this = THIS; - Actor_ProcessInitChain(&this->actor, initChain); - ActorShape_Init(&this->actor.shape, 0, NULL, 0.5f); + Actor_ProcessInitChain(thisx, initChain); + ActorShape_Init(&thisx->shape, 0, NULL, 0.5f); SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e, 0x19); Collider_InitCylinder(globalCtx, &this->collider); - Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &colCylinderInit); - func_80061ED4(&this->actor.colChkInfo, &damageTable, &colChkInfoInit); - this2->switchFlag = (u8)(this2->actor.params >> 0x8); - this->actor.params = this->actor.params & 0xFF; + Collider_SetCylinder(globalCtx, &this->collider, thisx, &colCylinderInit); + func_80061ED4(&thisx->colChkInfo, &damageTable, &colChkInfoInit); + this->switchFlag = (u8)(thisx->params >> 0x8); + thisx->params = thisx->params & 0xFF; - if (this->actor.params == WMT_FLAG) { + if (thisx->params == WMT_FLAG) { if (Flags_GetSwitch(globalCtx, this->switchFlag) != 0) { - Actor_Kill(&this->actor); + Actor_Kill(thisx); return; } EnWallmas_ProximityOrSwitchInit(this); - } else if (this->actor.params == WMT_PROXIMITY) { + } else if (thisx->params == WMT_PROXIMITY) { EnWallmas_ProximityOrSwitchInit(this); } else { EnWallmas_TimerInit(this, globalCtx); } } -void EnWallmas_Destroy(EnWallmas* this, GlobalContext* globalCtx) { - ColliderCylinder* col = &this->collider; - Collider_DestroyCylinder(globalCtx, col); +void EnWallmas_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnWallmas* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) { @@ -129,7 +133,7 @@ void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actor.posRot.pos.y = player->actor.posRot.pos.y; this->actor.unk_80 = player->actor.unk_80; - this->actor.draw = (ActorFunc)&EnWallmas_Draw; + this->actor.draw = EnWallmas_Draw; this->actionFunc = (ActorFunc)&EnWallmas_WaitToDrop; } @@ -506,50 +510,50 @@ void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { } } -void EnWallmas_Update(EnWallmas* this, GlobalContext* globalCtx) { - EnWallmas* this2 = this; +void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) { + EnWallmas* this = THIS; char pad[4]; - EnWallmas_ColUpdate(this2, globalCtx); - this2->actionFunc(this, globalCtx); + EnWallmas_ColUpdate(this, globalCtx); + this->actionFunc(this, globalCtx); - if ((this2->actionFunc == (ActorFunc)&EnWallmas_WaitToDrop) || - (this2->actionFunc == (ActorFunc)&EnWallmas_WaitForProximity) || - (this2->actionFunc == (ActorFunc)&EnWallmas_TakePlayer) || - (this2->actionFunc == (ActorFunc)&EnWallmas_WaitForSwitchFlag)) { + if ((this->actionFunc == (ActorFunc)&EnWallmas_WaitToDrop) || + (this->actionFunc == (ActorFunc)&EnWallmas_WaitForProximity) || + (this->actionFunc == (ActorFunc)&EnWallmas_TakePlayer) || + (this->actionFunc == (ActorFunc)&EnWallmas_WaitForSwitchFlag)) { return; } - if ((this2->actionFunc != (ActorFunc)&EnWallmas_ReturnToCeiling) && - (this2->actionFunc != (ActorFunc)&EnWallmas_TakePlayer)) { + if ((this->actionFunc != (ActorFunc)&EnWallmas_ReturnToCeiling) && + (this->actionFunc != (ActorFunc)&EnWallmas_TakePlayer)) { Actor_MoveForward(&this->actor); } - if (this2->actionFunc != (ActorFunc)&EnWallmas_Drop) { - func_8002E4B4(globalCtx, &this2->actor, 20.0f, 25.0f, 0.0f, 0x1D); - } else if (this2->actor.posRot.pos.y <= this2->unk_2c4) { - this2->actor.posRot.pos.y = this2->unk_2c4; - this2->actor.velocity.y = 0.0f; - EnWallmas_LandStart(this2, globalCtx); + if (this->actionFunc != (ActorFunc)&EnWallmas_Drop) { + func_8002E4B4(globalCtx, &this->actor, 20.0f, 25.0f, 0.0f, 0x1D); + } else if (this->actor.posRot.pos.y <= this->unk_2c4) { + this->actor.posRot.pos.y = this->unk_2c4; + this->actor.velocity.y = 0.0f; + EnWallmas_LandStart(this, globalCtx); } - if ((this2->actionFunc != (ActorFunc)&EnWallmas_Die) && (this2->actionFunc != (ActorFunc)&EnWallmas_Drop)) { - Collider_CylinderUpdate(&this2->actor, &this2->collider); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this2->collider); + if ((this->actionFunc != (ActorFunc)&EnWallmas_Die) && (this->actionFunc != (ActorFunc)&EnWallmas_Drop)) { + Collider_CylinderUpdate(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); - if ((this2->actionFunc != (ActorFunc)&EnWallmas_TakeDamage) && (this2->actor.bgCheckFlags & 1) != 0 && - (this2->actor.freeze == 0)) { - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this2->collider); + if ((this->actionFunc != (ActorFunc)&EnWallmas_TakeDamage) && (this->actor.bgCheckFlags & 1) != 0 && + (this->actor.freeze == 0)) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); } } - Actor_SetHeight(&this2->actor, 25.0f); + Actor_SetHeight(&this->actor, 25.0f); if (this->actionFunc == (ActorFunc)&EnWallmas_TakeDamage) { return; } - this2->actor.shape.rot.y = this2->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.posRot.rot.y; } void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) { @@ -589,8 +593,10 @@ void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) { Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_en_wallmas.c", 1426); } -s32 EnWallMas_UpdatePos(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) { - EnWallmas* this = (EnWallmas*)actor; +s32 EnWallMas_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { + EnWallmas* this = THIS; + if (limbIndex == 1) { if (this->actionFunc != (ActorFunc)EnWallmas_TakePlayer) { pos->z -= 1600.0f; @@ -602,7 +608,7 @@ s32 EnWallMas_UpdatePos(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve return 0; } -void EnWallmas_DrawOpa(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) { +void EnWallMas_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { GraphicsContext* gfxCtx; Gfx* dispRefs[4]; @@ -624,11 +630,13 @@ void EnWallmas_DrawOpa(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } } -void EnWallmas_Draw(EnWallmas* this, GlobalContext* globalCtx) { +void EnWallmas_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnWallmas* this = THIS; + if (this->actionFunc != (ActorFunc)&EnWallmas_WaitToDrop) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount, - &EnWallMas_UpdatePos, &EnWallmas_DrawOpa, &this->actor); + EnWallMas_OverrideLimbDraw, EnWallMas_PostLimbDraw, &this->actor); } EnWallmas_DrawXlu(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 573226e9b4..bbe75a48b3 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000010 -void EnWeatherTag_Init(EnWeatherTag* this, GlobalContext* globalCtx); -void EnWeatherTag_Destroy(EnWeatherTag* this, GlobalContext* globalCtx); -void EnWeatherTag_Update(EnWeatherTag* this, GlobalContext* globalCtx); +#define THIS ((EnWeatherTag*)thisx) + +void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWeatherTag_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Weather_Tag_InitVars = { diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 048a5e43db..fe75d3ebff 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000005 -void EnWeiyer_Init(EnWeiyer* this, GlobalContext* globalCtx); -void EnWeiyer_Destroy(EnWeiyer* this, GlobalContext* globalCtx); -void EnWeiyer_Update(EnWeiyer* this, GlobalContext* globalCtx); -void EnWeiyer_Draw(EnWeiyer* this, GlobalContext* globalCtx); +#define THIS ((EnWeiyer*)thisx) + +void EnWeiyer_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWeiyer_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWeiyer_Update(Actor* thisx, GlobalContext* globalCtx); +void EnWeiyer_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Weiyer_InitVars = { diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index ddc630d836..45a8c49da7 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000015 -void EnWf_Init(EnWf* this, GlobalContext* globalCtx); -void EnWf_Destroy(EnWf* this, GlobalContext* globalCtx); -void EnWf_Update(EnWf* this, GlobalContext* globalCtx); -void EnWf_Draw(EnWf* this, GlobalContext* globalCtx); +#define THIS ((EnWf*)thisx) + +void EnWf_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWf_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWf_Update(Actor* thisx, GlobalContext* globalCtx); +void EnWf_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Wf_InitVars = { diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 987f4bd8c9..ee20a8ea7e 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void EnWonderItem_Init(EnWonderItem* this, GlobalContext* globalCtx); -void EnWonderItem_Destroy(EnWonderItem* this, GlobalContext* globalCtx); -void EnWonderItem_Update(EnWonderItem* this, GlobalContext* globalCtx); +#define THIS ((EnWonderItem*)thisx) + +void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWonderItem_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWonderItem_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Wonder_Item_InitVars = { diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index e46bffb4ba..e130fe6ab9 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -8,9 +8,11 @@ #define FLAGS 0x08000009 -void EnWonderTalk_Init(EnWonderTalk* this, GlobalContext* globalCtx); -void EnWonderTalk_Destroy(EnWonderTalk* this, GlobalContext* globalCtx); -void EnWonderTalk_Update(EnWonderTalk* this, GlobalContext* globalCtx); +#define THIS ((EnWonderTalk*)thisx) + +void EnWonderTalk_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWonderTalk_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWonderTalk_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Wonder_Talk_InitVars = { diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index e46cf0da58..ac9ad7546a 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -8,9 +8,11 @@ #define FLAGS 0x08000009 -void EnWonderTalk2_Init(EnWonderTalk2* this, GlobalContext* globalCtx); -void EnWonderTalk2_Destroy(EnWonderTalk2* this, GlobalContext* globalCtx); -void EnWonderTalk2_Update(EnWonderTalk2* this, GlobalContext* globalCtx); +#define THIS ((EnWonderTalk2*)thisx) + +void EnWonderTalk2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWonderTalk2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWonderTalk2_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Wonder_Talk2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 8a35c5f504..06e25c55da 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void EnWood02_Init(EnWood02* this, GlobalContext* globalCtx); -void EnWood02_Destroy(EnWood02* this, GlobalContext* globalCtx); -void EnWood02_Update(EnWood02* this, GlobalContext* globalCtx); -void EnWood02_Draw(EnWood02* this, GlobalContext* globalCtx); +#define THIS ((EnWood02*)thisx) + +void EnWood02_Init(Actor* thisx, GlobalContext* globalCtx); +void EnWood02_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx); +void EnWood02_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Wood02_InitVars = { diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index a59cff8638..aa4b6d19ed 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnXc_Init(EnXc* this, GlobalContext* globalCtx); -void EnXc_Destroy(EnXc* this, GlobalContext* globalCtx); -void EnXc_Update(EnXc* this, GlobalContext* globalCtx); -void EnXc_Draw(EnXc* this, GlobalContext* globalCtx); +#define THIS ((EnXc*)thisx) + +void EnXc_Init(Actor* thisx, GlobalContext* globalCtx); +void EnXc_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnXc_Update(Actor* thisx, GlobalContext* globalCtx); +void EnXc_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Xc_InitVars = { diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index e9220307b2..057dd87f5a 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void EnYabusameMark_Init(EnYabusameMark* this, GlobalContext* globalCtx); -void EnYabusameMark_Destroy(EnYabusameMark* this, GlobalContext* globalCtx); -void EnYabusameMark_Update(EnYabusameMark* this, GlobalContext* globalCtx); +#define THIS ((EnYabusameMark*)thisx) + +void EnYabusameMark_Init(Actor* thisx, GlobalContext* globalCtx); +void EnYabusameMark_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnYabusameMark_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Yabusame_Mark_InitVars = { diff --git a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index daf0369c03..f95fc88045 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnYukabyun_Init(EnYukabyun* this, GlobalContext* globalCtx); -void EnYukabyun_Destroy(EnYukabyun* this, GlobalContext* globalCtx); -void EnYukabyun_Update(EnYukabyun* this, GlobalContext* globalCtx); -void EnYukabyun_Draw(EnYukabyun* this, GlobalContext* globalCtx); +#define THIS ((EnYukabyun*)thisx) + +void EnYukabyun_Init(Actor* thisx, GlobalContext* globalCtx); +void EnYukabyun_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx); +void EnYukabyun_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Yukabyun_InitVars = { diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index b70b9f3102..6e71e8248d 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000015 -void EnZf_Init(EnZf* this, GlobalContext* globalCtx); -void EnZf_Destroy(EnZf* this, GlobalContext* globalCtx); -void EnZf_Update(EnZf* this, GlobalContext* globalCtx); -void EnZf_Draw(EnZf* this, GlobalContext* globalCtx); +#define THIS ((EnZf*)thisx) + +void EnZf_Init(Actor* thisx, GlobalContext* globalCtx); +void EnZf_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnZf_Update(Actor* thisx, GlobalContext* globalCtx); +void EnZf_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Zf_InitVars = { diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c index e42d01e47a..f0b9de9f66 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000019 -void EnZl1_Init(EnZl1* this, GlobalContext* globalCtx); -void EnZl1_Destroy(EnZl1* this, GlobalContext* globalCtx); -void EnZl1_Update(EnZl1* this, GlobalContext* globalCtx); -void EnZl1_Draw(EnZl1* this, GlobalContext* globalCtx); +#define THIS ((EnZl1*)thisx) + +void EnZl1_Init(Actor* thisx, GlobalContext* globalCtx); +void EnZl1_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx); +void EnZl1_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Zl1_InitVars = { diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index f6f870b515..6e3375bd66 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnZl2_Init(EnZl2* this, GlobalContext* globalCtx); -void EnZl2_Destroy(EnZl2* this, GlobalContext* globalCtx); -void EnZl2_Update(EnZl2* this, GlobalContext* globalCtx); -void EnZl2_Draw(EnZl2* this, GlobalContext* globalCtx); +#define THIS ((EnZl2*)thisx) + +void EnZl2_Init(Actor* thisx, GlobalContext* globalCtx); +void EnZl2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnZl2_Update(Actor* thisx, GlobalContext* globalCtx); +void EnZl2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Zl2_InitVars = { diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 7e28b83f09..e545cd98f4 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void EnZl3_Init(EnZl3* this, GlobalContext* globalCtx); -void EnZl3_Destroy(EnZl3* this, GlobalContext* globalCtx); -void EnZl3_Update(EnZl3* this, GlobalContext* globalCtx); -void EnZl3_Draw(EnZl3* this, GlobalContext* globalCtx); +#define THIS ((EnZl3*)thisx) + +void EnZl3_Init(Actor* thisx, GlobalContext* globalCtx); +void EnZl3_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnZl3_Update(Actor* thisx, GlobalContext* globalCtx); +void EnZl3_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Zl3_InitVars = { diff --git a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 5847ad5ac8..a2c5a1dc0a 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000019 -void EnZl4_Init(EnZl4* this, GlobalContext* globalCtx); -void EnZl4_Destroy(EnZl4* this, GlobalContext* globalCtx); -void EnZl4_Update(EnZl4* this, GlobalContext* globalCtx); -void EnZl4_Draw(EnZl4* this, GlobalContext* globalCtx); +#define THIS ((EnZl4*)thisx) + +void EnZl4_Init(Actor* thisx, GlobalContext* globalCtx); +void EnZl4_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnZl4_Update(Actor* thisx, GlobalContext* globalCtx); +void EnZl4_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Zl4_InitVars = { diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 0c9f96060a..00aea8b98e 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000009 -void EnZo_Init(EnZo* this, GlobalContext* globalCtx); -void EnZo_Destroy(EnZo* this, GlobalContext* globalCtx); -void EnZo_Update(EnZo* this, GlobalContext* globalCtx); -void EnZo_Draw(EnZo* this, GlobalContext* globalCtx); +#define THIS ((EnZo*)thisx) + +void EnZo_Init(Actor* thisx, GlobalContext* globalCtx); +void EnZo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnZo_Update(Actor* thisx, GlobalContext* globalCtx); +void EnZo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Zo_InitVars = { diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 77421ee622..364725d0e3 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -2,10 +2,12 @@ #define FLAGS 0x00000010 -void EnfHG_Init(EnfHG* this, GlobalContext* globalCtx); -void EnfHG_Destroy(EnfHG* this, GlobalContext* globalCtx); -void EnfHG_Update(EnfHG* this, GlobalContext* globalCtx); -void EnfHG_Draw(EnfHG* this, GlobalContext* globalCtx); +#define THIS ((EnfHG*)thisx) + +void EnfHG_Init(Actor* thisx, GlobalContext* globalCtx); +void EnfHG_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EnfHG_Update(Actor* thisx, GlobalContext* globalCtx); +void EnfHG_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_fHG_InitVars = { diff --git a/src/overlays/actors/ovl_End_Title/z_end_title.c b/src/overlays/actors/ovl_End_Title/z_end_title.c index 9d672f578d..de166cff54 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void EndTitle_Init(EndTitle* this, GlobalContext* globalCtx); -void EndTitle_Destroy(EndTitle* this, GlobalContext* globalCtx); -void EndTitle_Update(EndTitle* this, GlobalContext* globalCtx); -void EndTitle_Draw(EndTitle* this, GlobalContext* globalCtx); +#define THIS ((EndTitle*)thisx) + +void EndTitle_Init(Actor* thisx, GlobalContext* globalCtx); +void EndTitle_Destroy(Actor* thisx, GlobalContext* globalCtx); +void EndTitle_Update(Actor* thisx, GlobalContext* globalCtx); +void EndTitle_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit End_Title_InitVars = { diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index fb381e6dee..3afb0e71fa 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void Fishing_Init(Fishing* this, GlobalContext* globalCtx); -void Fishing_Destroy(Fishing* this, GlobalContext* globalCtx); -void Fishing_Update(Fishing* this, GlobalContext* globalCtx); -void Fishing_Draw(Fishing* this, GlobalContext* globalCtx); +#define THIS ((Fishing*)thisx) + +void Fishing_Init(Actor* thisx, GlobalContext* globalCtx); +void Fishing_Destroy(Actor* thisx, GlobalContext* globalCtx); +void Fishing_Update(Actor* thisx, GlobalContext* globalCtx); +void Fishing_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Fishing_InitVars = { diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index f949a03833..2756a0405b 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void ItemBHeart_Init(ItemBHeart* this, GlobalContext* globalCtx); -void ItemBHeart_Destroy(ItemBHeart* this, GlobalContext* globalCtx); -void ItemBHeart_Update(ItemBHeart* this, GlobalContext* globalCtx); -void ItemBHeart_Draw(ItemBHeart* this, GlobalContext* globalCtx); +#define THIS ((ItemBHeart*)thisx) + +void ItemBHeart_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemBHeart_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx); +void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Item_B_Heart_InitVars = { diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 8673ad0dbc..2b12985869 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000010 -void ItemEtcetera_Init(ItemEtcetera* this, GlobalContext* globalCtx); -void ItemEtcetera_Destroy(ItemEtcetera* this, GlobalContext* globalCtx); -void ItemEtcetera_Update(ItemEtcetera* this, GlobalContext* globalCtx); +#define THIS ((ItemEtcetera*)thisx) + +void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemEtcetera_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemEtcetera_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Item_Etcetera_InitVars = { diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index e340949cf0..7ab8905535 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -8,11 +8,14 @@ #define FLAGS 0x00000009 -void ItemInbox_Init(ItemInbox* this, GlobalContext* globalCtx); -void ItemInbox_Destroy(ItemInbox* this, GlobalContext* globalCtx); +#define THIS ((ItemInbox*)thisx) + +void ItemInbox_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx); +void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx); + void func_80B86020(ItemInbox* this, GlobalContext* globalCtx); -void ItemInbox_Update(ItemInbox* this, GlobalContext* globalCtx); -void ItemInbox_Draw(ItemInbox* this, GlobalContext* globalCtx); const ActorInit Item_Inbox_InitVars = { ACTOR_ITEM_INBOX, @@ -26,12 +29,14 @@ const ActorInit Item_Inbox_InitVars = { (ActorFunc)ItemInbox_Draw, }; -void ItemInbox_Init(ItemInbox* this, GlobalContext* globalCtx) { +void ItemInbox_Init(Actor* thisx, GlobalContext* globalCtx) { + ItemInbox* this = THIS; + this->actionFunc = func_80B86020; Actor_SetScale(&this->actor, 0.2); } -void ItemInbox_Destroy(ItemInbox* this, GlobalContext* globalCtx) { +void ItemInbox_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80B86020(ItemInbox* this, GlobalContext* globalCtx) { @@ -40,11 +45,15 @@ void func_80B86020(ItemInbox* this, GlobalContext* globalCtx) { } } -void ItemInbox_Update(ItemInbox* this, GlobalContext* globalCtx) { +void ItemInbox_Update(Actor* thisx, GlobalContext* globalCtx) { + ItemInbox* this = THIS; + this->actionFunc(this, globalCtx); } -void ItemInbox_Draw(ItemInbox* this, GlobalContext* globalCtx) { +void ItemInbox_Draw(Actor* thisx, GlobalContext* globalCtx) { + ItemInbox* this = THIS; + func_8002EBCC(&this->actor, globalCtx, 0); func_8002ED80(&this->actor, globalCtx, 0); func_800694A0(globalCtx, this->actor.params & 0xFF); diff --git a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index b024c62d66..016de0127d 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void ItemOcarina_Init(ItemOcarina* this, GlobalContext* globalCtx); -void ItemOcarina_Destroy(ItemOcarina* this, GlobalContext* globalCtx); -void ItemOcarina_Update(ItemOcarina* this, GlobalContext* globalCtx); -void ItemOcarina_Draw(ItemOcarina* this, GlobalContext* globalCtx); +#define THIS ((ItemOcarina*)thisx) + +void ItemOcarina_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemOcarina_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemOcarina_Update(Actor* thisx, GlobalContext* globalCtx); +void ItemOcarina_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Item_Ocarina_InitVars = { diff --git a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c index 33f7314482..9c05d94315 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void ItemShield_Init(ItemShield* this, GlobalContext* globalCtx); -void ItemShield_Destroy(ItemShield* this, GlobalContext* globalCtx); -void ItemShield_Update(ItemShield* this, GlobalContext* globalCtx); -void ItemShield_Draw(ItemShield* this, GlobalContext* globalCtx); +#define THIS ((ItemShield*)thisx) + +void ItemShield_Init(Actor* thisx, GlobalContext* globalCtx); +void ItemShield_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ItemShield_Update(Actor* thisx, GlobalContext* globalCtx); +void ItemShield_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Item_Shield_InitVars = { diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index f435f98381..292a1a9770 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void MagicDark_Init(MagicDark* this, GlobalContext* globalCtx); -void MagicDark_Destroy(MagicDark* this, GlobalContext* globalCtx); -void MagicDark_Update(MagicDark* this, GlobalContext* globalCtx); -void MagicDark_Draw(MagicDark* this, GlobalContext* globalCtx); +#define THIS ((MagicDark*)thisx) + +void MagicDark_Init(Actor* thisx, GlobalContext* globalCtx); +void MagicDark_Destroy(Actor* thisx, GlobalContext* globalCtx); +void MagicDark_Update(Actor* thisx, GlobalContext* globalCtx); +void MagicDark_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Magic_Dark_InitVars = { diff --git a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index 6f65b00c1d..a5143cd2e3 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void MagicFire_Init(MagicFire* this, GlobalContext* globalCtx); -void MagicFire_Destroy(MagicFire* this, GlobalContext* globalCtx); -void MagicFire_Update(MagicFire* this, GlobalContext* globalCtx); -void MagicFire_Draw(MagicFire* this, GlobalContext* globalCtx); +#define THIS ((MagicFire*)thisx) + +void MagicFire_Init(Actor* thisx, GlobalContext* globalCtx); +void MagicFire_Destroy(Actor* thisx, GlobalContext* globalCtx); +void MagicFire_Update(Actor* thisx, GlobalContext* globalCtx); +void MagicFire_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Magic_Fire_InitVars = { diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index 8cfab660da..5d8b4b61ea 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void MagicWind_Init(MagicWind* this, GlobalContext* globalCtx); -void MagicWind_Destroy(MagicWind* this, GlobalContext* globalCtx); -void MagicWind_Update(MagicWind* this, GlobalContext* globalCtx); -void MagicWind_Draw(MagicWind* this, GlobalContext* globalCtx); +#define THIS ((MagicWind*)thisx) + +void MagicWind_Init(Actor* thisx, GlobalContext* globalCtx); +void MagicWind_Destroy(Actor* thisx, GlobalContext* globalCtx); +void MagicWind_Update(Actor* thisx, GlobalContext* globalCtx); +void MagicWind_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Magic_Wind_InitVars = { diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 57e4236f30..3c62832e8c 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000030 -void MirRay_Init(MirRay* this, GlobalContext* globalCtx); -void MirRay_Destroy(MirRay* this, GlobalContext* globalCtx); -void MirRay_Update(MirRay* this, GlobalContext* globalCtx); -void MirRay_Draw(MirRay* this, GlobalContext* globalCtx); +#define THIS ((MirRay*)thisx) + +void MirRay_Init(Actor* thisx, GlobalContext* globalCtx); +void MirRay_Destroy(Actor* thisx, GlobalContext* globalCtx); +void MirRay_Update(Actor* thisx, GlobalContext* globalCtx); +void MirRay_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Mir_Ray_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index c8909ef63a..4e54497759 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -8,10 +8,12 @@ #define FLAGS 0x00400000 -void ObjBean_Init(ObjBean* this, GlobalContext* globalCtx); -void ObjBean_Destroy(ObjBean* this, GlobalContext* globalCtx); -void ObjBean_Update(ObjBean* this, GlobalContext* globalCtx); -void ObjBean_Draw(ObjBean* this, GlobalContext* globalCtx); +#define THIS ((ObjBean*)thisx) + +void ObjBean_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjBean_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjBean_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjBean_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Bean_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index 3c35f1e26d..9ac31ed073 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void ObjBlockstop_Init(ObjBlockstop* this, GlobalContext* globalCtx); -void ObjBlockstop_Destroy(ObjBlockstop* this, GlobalContext* globalCtx); -void ObjBlockstop_Update(ObjBlockstop* this, GlobalContext* globalCtx); +#define THIS ((ObjBlockstop*)thisx) + +void ObjBlockstop_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjBlockstop_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjBlockstop_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Blockstop_InitVars = { ACTOR_OBJ_BLOCKSTOP, @@ -24,7 +26,9 @@ const ActorInit Obj_Blockstop_InitVars = { NULL, }; -void ObjBlockstop_Init(ObjBlockstop* this, GlobalContext* globalCtx) { +void ObjBlockstop_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjBlockstop* this = THIS; + if (Flags_GetSwitch(globalCtx, this->actor.params)) { Actor_Kill(&this->actor); } else { @@ -32,15 +36,15 @@ void ObjBlockstop_Init(ObjBlockstop* this, GlobalContext* globalCtx) { } } -void ObjBlockstop_Destroy(ObjBlockstop* this, GlobalContext* globalCtx) { +void ObjBlockstop_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -void ObjBlockstop_Update(ObjBlockstop* this, GlobalContext* globalCtx) { +void ObjBlockstop_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjBlockstop* this = THIS; DynaPolyActor* dynaActor; - s32 pad; Vec3f sp4C; u32 sp48; - s32 pad2; + s32 pad; if (func_8003DF10(&globalCtx->colCtx, &this->actor.initPosRot.pos, &this->actor.posRot.pos, &sp4C, &this->actor.floorPoly, 0, 0, 1, 1, &sp48, &this->actor)) { diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 5e892c3888..ebba09ec95 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -8,12 +8,14 @@ #define FLAGS 0x00000000 -void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx); -void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx); -void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx); -void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx); +#define THIS ((ObjBombiwa*)thisx) + +void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjBombiwa_InitCollision(Actor* thisx, GlobalContext* globalCtx); +void ObjBombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx); -void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx); void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx); const ActorInit Obj_Bombiwa_InitVars = { @@ -54,32 +56,33 @@ static s16 effectScales[] = { extern Gfx* D_060009E0; // dlist -void ObjBombiwa_InitCollision(ObjBombiwa* this, GlobalContext* globalCtx) { - ObjBombiwa* thisLocal = this; - Collider_InitCylinder(globalCtx, &thisLocal->collider); - Collider_SetCylinder(globalCtx, &thisLocal->collider, &thisLocal->actor, &colliderInit); - Collider_CylinderUpdate(&thisLocal->actor, &thisLocal->collider); +void ObjBombiwa_InitCollision(Actor* thisx, GlobalContext* globalCtx) { + ObjBombiwa* this = THIS; + + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &colliderInit); + Collider_CylinderUpdate(&this->actor, &this->collider); } -void ObjBombiwa_Init(ObjBombiwa* this, GlobalContext* globalCtx) { - Actor_ProcessInitChain(&this->actor, initChain); - ObjBombiwa_InitCollision(this, globalCtx); - if ((Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) != 0)) { - Actor_Kill(&this->actor); +void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { + Actor_ProcessInitChain(thisx, initChain); + ObjBombiwa_InitCollision(thisx, globalCtx); + if ((Flags_GetSwitch(globalCtx, thisx->params & 0x3F) != 0)) { + Actor_Kill(thisx); } else { - func_80061ED4(&this->actor.colChkInfo, NULL, &colChkInfoInit); - if (this->actor.shape.rot.y == 0) { + func_80061ED4(&thisx->colChkInfo, NULL, &colChkInfoInit); + if (thisx->shape.rot.y == 0) { s16 rand = (s16)Math_Rand_ZeroFloat(65536.0f); - this->actor.posRot.rot.y = rand; - this->actor.shape.rot.y = rand; + thisx->posRot.rot.y = rand; + thisx->shape.rot.y = rand; } - this->actor.shape.unk_08 = -200.0f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f; + thisx->shape.unk_08 = -200.0f; + thisx->posRot.pos.y = thisx->initPosRot.pos.y + 20.0f; } } -void ObjBombiwa_Destroy(ObjBombiwa* this, GlobalContext* globalCtx) { - Collider_DestroyCylinder(globalCtx, &this->collider); +void ObjBombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) { + Collider_DestroyCylinder(globalCtx, &THIS->collider); } void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { @@ -106,9 +109,9 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 8, 100, 160, 1); } -void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) { - CollisionCheckContext* colChkCtx; - ColliderCylinder* collider; +void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjBombiwa* this = THIS; + s32 pad; if (func_80033684(globalCtx, &this->actor) != NULL || ((this->collider.base.acFlags & 2) != 0 && (this->collider.body.acHitItem->toucher.flags & 0x40000040) != 0)) { @@ -122,14 +125,12 @@ void ObjBombiwa_Update(ObjBombiwa* this, GlobalContext* globalCtx) { } else { this->collider.base.acFlags &= ~0x2; if (this->actor.xzDistanceFromLink < 800.0f) { - colChkCtx = &globalCtx->colChkCtx; - collider = &this->collider; - CollisionCheck_SetAC(globalCtx, colChkCtx, collider); - CollisionCheck_SetOC(globalCtx, colChkCtx, collider); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider); } } } -void ObjBombiwa_Draw(ObjBombiwa* this, GlobalContext* globalCtx) { +void ObjBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_060009E0); } diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index a8e28544ac..4cae01486a 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void ObjComb_Init(ObjComb* this, GlobalContext* globalCtx); -void ObjComb_Destroy(ObjComb* this, GlobalContext* globalCtx); -void ObjComb_Update(ObjComb* this, GlobalContext* globalCtx); -void ObjComb_Draw(ObjComb* this, GlobalContext* globalCtx); +#define THIS ((ObjComb*)thisx) + +void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx); void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx); void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx); @@ -130,8 +132,8 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) { } } -void ObjComb_Init(ObjComb* this, GlobalContext* globalCtx) { - s32 pad; +void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjComb* this = THIS; Actor_ProcessInitChain(&this->actor, &initChain); Collider_InitJntSph(globalCtx, &this->collider); @@ -139,8 +141,8 @@ void ObjComb_Init(ObjComb* this, GlobalContext* globalCtx) { ObjComb_SetWait(this); } -void ObjComb_Destroy(ObjComb* this, GlobalContext* globalCtx) { - Collider_DestroyJntSph(globalCtx, &this->collider); +void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx) { + Collider_DestroyJntSph(globalCtx, &THIS->collider); } void ObjComb_SetWait(ObjComb* this) { @@ -174,14 +176,16 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) { } } -void ObjComb_Update(ObjComb* this, GlobalContext* globalCtx) { +void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjComb* this = THIS; + this->unk_1B2 += 12000; this->actionFunc(this, globalCtx); this->actor.shape.rot.x = Math_Sins(this->unk_1B2) * this->unk_1B0 + this->actor.initPosRot.rot.x; } -void ObjComb_Draw(ObjComb* this, GlobalContext* globalCtx) { - s32 pad; +void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { + ObjComb* this = THIS; GraphicsContext* gfxCtx; Gfx* dispRefs[4]; diff --git a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c index b0b42e0cad..eb17ff32dc 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000009 -void ObjDekujr_Init(ObjDekujr* this, GlobalContext* globalCtx); -void ObjDekujr_Destroy(ObjDekujr* this, GlobalContext* globalCtx); -void ObjDekujr_Update(ObjDekujr* this, GlobalContext* globalCtx); -void ObjDekujr_Draw(ObjDekujr* this, GlobalContext* globalCtx); +#define THIS ((ObjDekujr*)thisx) + +void ObjDekujr_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjDekujr_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjDekujr_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjDekujr_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Dekujr_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index 60fbb73ba9..95cf362281 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -8,12 +8,12 @@ #define FLAGS 0x00000000 -#define SIZE_PARAM 1 +#define THIS ((ObjElevator*)thisx) -void ObjElevator_Init(ObjElevator* this, GlobalContext* globalCtx); -void ObjElevator_Destroy(ObjElevator* this, GlobalContext* globalCtx); -void ObjElevator_Update(ObjElevator* this, GlobalContext* globalCtx); -void ObjElevator_Draw(ObjElevator* this, GlobalContext* globalCtx); +void ObjElevator_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjElevator_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjElevator_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjElevator_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80B92C5C(ObjElevator* this); void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx); @@ -62,12 +62,12 @@ void func_80B92B08(ObjElevator* this, GlobalContext* globalCtx, u32 collision, D } } -void ObjElevator_Init(ObjElevator* this, GlobalContext* globalCtx) { +void ObjElevator_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjElevator* this = THIS; f32 temp_f0; - Actor* thisx = &this->dyna.actor; func_80B92B08(this, globalCtx, &D_06000360, 1); - Actor_SetScale(thisx, sizes[thisx->params & SIZE_PARAM]); + Actor_SetScale(thisx, sizes[thisx->params & 1]); Actor_ProcessInitChain(thisx, initChain); temp_f0 = (thisx->params >> 8) & 0xF; this->unk_16C = temp_f0 + temp_f0; @@ -75,7 +75,9 @@ void ObjElevator_Init(ObjElevator* this, GlobalContext* globalCtx) { osSyncPrintf("(Dungeon Elevator)(arg_data 0x%04x)\n", thisx->params); } -void ObjElevator_Destroy(ObjElevator* this, GlobalContext* globalCtx) { +void ObjElevator_Destroy(Actor* thisx, GlobalContext* globalCtx) { + ObjElevator* this = THIS; + DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId); } @@ -111,13 +113,15 @@ void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) { } } -void ObjElevator_Update(ObjElevator* this, GlobalContext* globalCtx) { +void ObjElevator_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjElevator* this = THIS; + if (this->actionFunc) { this->actionFunc(this, globalCtx); } this->unk_170 = this->dyna.unk_160; } -void ObjElevator_Draw(ObjElevator* this, GlobalContext* globalCtx) { +void ObjElevator_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, &D_06000180); } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 8c7e4bae61..1ca4d6a13e 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void ObjHamishi_Init(ObjHamishi* this, GlobalContext* globalCtx); -void ObjHamishi_Destroy(ObjHamishi* this, GlobalContext* globalCtx); -void ObjHamishi_Update(ObjHamishi* this, GlobalContext* globalCtx); -void ObjHamishi_Draw(ObjHamishi* this, GlobalContext* globalCtx); +#define THIS ((ObjHamishi*)thisx) + +void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjHamishi_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjHamishi_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Hamishi_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 07908b74e7..b3e424e035 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void ObjHana_Init(ObjHana* this, GlobalContext* globalCtx); -void ObjHana_Destroy(ObjHana* this, GlobalContext* globalCtx); -void ObjHana_Update(ObjHana* this, GlobalContext* globalCtx); -void ObjHana_Draw(ObjHana* this, GlobalContext* globalCtx); +#define THIS ((ObjHana*)thisx) + +void ObjHana_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjHana_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Hana_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index 7b302e9708..bb20cf0de2 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void ObjHsblock_Init(ObjHsblock* this, GlobalContext* globalCtx); -void ObjHsblock_Destroy(ObjHsblock* this, GlobalContext* globalCtx); -void ObjHsblock_Update(ObjHsblock* this, GlobalContext* globalCtx); -void ObjHsblock_Draw(ObjHsblock* this, GlobalContext* globalCtx); +#define THIS ((ObjHsblock*)thisx) + +void ObjHsblock_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjHsblock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjHsblock_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Hsblock_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index a9d73677a7..0291bab0e4 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void ObjIcePoly_Init(ObjIcePoly* this, GlobalContext* globalCtx); -void ObjIcePoly_Destroy(ObjIcePoly* this, GlobalContext* globalCtx); -void ObjIcePoly_Update(ObjIcePoly* this, GlobalContext* globalCtx); -void ObjIcePoly_Draw(ObjIcePoly* this, GlobalContext* globalCtx); +#define THIS ((ObjIcePoly*)thisx) + +void ObjIcePoly_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjIcePoly_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjIcePoly_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjIcePoly_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Ice_Poly_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 28ea95c75e..24bc9bb154 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -8,10 +8,12 @@ #define FLAGS 0x04000010 -void ObjKibako_Init(ObjKibako* this, GlobalContext* globalCtx); -void ObjKibako_Destroy(ObjKibako* this, GlobalContext* globalCtx); -void ObjKibako_Update(ObjKibako* this, GlobalContext* globalCtx); -void ObjKibako_Draw(ObjKibako* this, GlobalContext* globalCtx); +#define THIS ((ObjKibako*)thisx) + +void ObjKibako_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjKibako_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjKibako_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjKibako_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Kibako_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index c36c100b27..7ef0bf235c 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000000 -void ObjKibako2_Init(ObjKibako2* this, GlobalContext* globalCtx); -void ObjKibako2_Destroy(ObjKibako2* this, GlobalContext* globalCtx); -void ObjKibako2_Update(ObjKibako2* this, GlobalContext* globalCtx); -void ObjKibako2_Draw(ObjKibako2* this, GlobalContext* globalCtx); +#define THIS ((ObjKibako2*)thisx) + +void ObjKibako2_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjKibako2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjKibako2_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjKibako2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Kibako2_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 817fbe8c8f..54a02d0e0f 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void ObjLift_Init(ObjLift* this, GlobalContext* globalCtx); -void ObjLift_Destroy(ObjLift* this, GlobalContext* globalCtx); -void ObjLift_Update(ObjLift* this, GlobalContext* globalCtx); -void ObjLift_Draw(ObjLift* this, GlobalContext* globalCtx); +#define THIS ((ObjLift*)thisx) + +void ObjLift_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjLift_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjLift_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjLift_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Lift_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 6b9d5ee1ba..a44f8bdc30 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void ObjLightswitch_Init(ObjLightswitch* this, GlobalContext* globalCtx); -void ObjLightswitch_Destroy(ObjLightswitch* this, GlobalContext* globalCtx); -void ObjLightswitch_Update(ObjLightswitch* this, GlobalContext* globalCtx); -void ObjLightswitch_Draw(ObjLightswitch* this, GlobalContext* globalCtx); +#define THIS ((ObjLightswitch*)thisx) + +void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjLightswitch_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjLightswitch_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Lightswitch_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index a66e27b293..cc434b28e8 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -10,8 +10,11 @@ #define FLAGS 0x00000010 -void ObjMakekinsuta_Init(ObjMakekinsuta* this, GlobalContext* globalCtx); -void ObjMakekinsuta_Update(ObjMakekinsuta* this, GlobalContext* globalCtx); +#define THIS ((ObjMakekinsuta*)thisx) + +void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx); + void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx); void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx); @@ -27,7 +30,9 @@ const ActorInit Obj_Makekinsuta_InitVars = { NULL, }; -void ObjMakekinsuta_Init(ObjMakekinsuta* this, GlobalContext* globalCtx) { +void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjMakekinsuta* this = THIS; + if ((this->actor.params & 0x6000) == 0x4000) { osSyncPrintf(VT_FGCOL(BLUE)); // Translation: Gold Star Enemy(arg_data %x) @@ -60,6 +65,8 @@ void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx) { void func_80B983D4(ObjMakekinsuta* this, GlobalContext* globalCtx) { } -void ObjMakekinsuta_Update(ObjMakekinsuta* this, GlobalContext* globalCtx) { +void ObjMakekinsuta_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjMakekinsuta* this = THIS; + this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index a16fd0d282..3950223c6d 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -8,8 +8,10 @@ #define FLAGS 0x00000020 -void ObjMakeoshihiki_Init(ObjMakeoshihiki* this, GlobalContext* globalCtx); -void ObjMakeoshihiki_Draw(ObjMakeoshihiki* this, GlobalContext* globalCtx); +#define THIS ((ObjMakeoshihiki*)thisx) + +void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Makeoshihiki_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index f6569c55ff..6e10540c47 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void ObjMure_Init(ObjMure* this, GlobalContext* globalCtx); -void ObjMure_Destroy(ObjMure* this, GlobalContext* globalCtx); -void ObjMure_Update(ObjMure* this, GlobalContext* globalCtx); +#define THIS ((ObjMure*)thisx) + +void ObjMure_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjMure_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjMure_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Mure_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 3c9b8c95d5..3a50efbf10 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -8,8 +8,10 @@ #define FLAGS 0x00000000 -void ObjMure2_Init(ObjMure2* this, GlobalContext* globalCtx); -void ObjMure2_Update(ObjMure2* this, GlobalContext* globalCtx); +#define THIS ((ObjMure2*)thisx) + +void ObjMure2_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjMure2_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Mure2_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index 07a6faff9e..050f8982ab 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000000 -void ObjMure3_Init(ObjMure3* this, GlobalContext* globalCtx); -void ObjMure3_Destroy(ObjMure3* this, GlobalContext* globalCtx); -void ObjMure3_Update(ObjMure3* this, GlobalContext* globalCtx); +#define THIS ((ObjMure3*)thisx) + +void ObjMure3_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjMure3_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjMure3_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Mure3_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 0939c56367..b5e54e5fd8 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void ObjOshihiki_Init(ObjOshihiki* this, GlobalContext* globalCtx); -void ObjOshihiki_Destroy(ObjOshihiki* this, GlobalContext* globalCtx); -void ObjOshihiki_Update(ObjOshihiki* this, GlobalContext* globalCtx); -void ObjOshihiki_Draw(ObjOshihiki* this, GlobalContext* globalCtx); +#define THIS ((ObjOshihiki*)thisx) + +void ObjOshihiki_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjOshihiki_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjOshihiki_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Oshihiki_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 7ae884da72..b3fec26792 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -8,9 +8,12 @@ #define FLAGS 0x00000010 -void ObjRoomtimer_Init(ObjRoomtimer* this, GlobalContext* globalCtx); -void ObjRoomtimer_Destroy(ObjRoomtimer* this, GlobalContext* globalCtx); -void ObjRoomtimer_Update(ObjRoomtimer* this, GlobalContext* globalCtx); +#define THIS ((ObjRoomtimer*)thisx) + +void ObjRoomtimer_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjRoomtimer_Update(Actor* thisx, GlobalContext* globalCtx); + void func_80B9D054(ObjRoomtimer* this, GlobalContext* globalCtx); void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx); @@ -26,7 +29,8 @@ const ActorInit Obj_Roomtimer_InitVars = { (ActorFunc)NULL, }; -void ObjRoomtimer_Init(ObjRoomtimer* this, GlobalContext* globalCtx) { +void ObjRoomtimer_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjRoomtimer* this = THIS; s16 params = this->actor.params; this->switchFlag = (params >> 10) & 0x3F; @@ -44,7 +48,9 @@ void ObjRoomtimer_Init(ObjRoomtimer* this, GlobalContext* globalCtx) { this->actionFunc = (ActorFunc)func_80B9D054; } -void ObjRoomtimer_Destroy(ObjRoomtimer* this, GlobalContext* globalCtx) { +void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx) { + ObjRoomtimer* this = THIS; + if (this->actor.params != 0x3FF) { if (gSaveContext.timer1Value > 0) { gSaveContext.timer1State = 10; @@ -82,6 +88,8 @@ void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx) { } } -void ObjRoomtimer_Update(ObjRoomtimer* this, GlobalContext* globalCtx) { +void ObjRoomtimer_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjRoomtimer* this = THIS; + this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 4668be96aa..77d20b2141 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000010 -void ObjSwitch_Init(ObjSwitch* this, GlobalContext* globalCtx); -void ObjSwitch_Destroy(ObjSwitch* this, GlobalContext* globalCtx); -void ObjSwitch_Update(ObjSwitch* this, GlobalContext* globalCtx); -void ObjSwitch_Draw(ObjSwitch* this, GlobalContext* globalCtx); +#define THIS ((ObjSwitch*)thisx) + +void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjSwitch_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjSwitch_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjSwitch_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Switch_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index cad2008f0e..8b5664b1e8 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -8,10 +8,12 @@ #define FLAGS 0x00000410 -void ObjSyokudai_Init(ObjSyokudai* this, GlobalContext* globalCtx); -void ObjSyokudai_Destroy(ObjSyokudai* this, GlobalContext* globalCtx); -void ObjSyokudai_Update(ObjSyokudai* this, GlobalContext* globalCtx); -void ObjSyokudai_Draw(ObjSyokudai* this, GlobalContext* globalCtx); +#define THIS ((ObjSyokudai*)thisx) + +void ObjSyokudai_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Syokudai_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index 04676e2c0f..cb0c3b08a0 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -8,10 +8,12 @@ #define FLAGS 0x0A000011 -void ObjTimeblock_Init(ObjTimeblock* this, GlobalContext* globalCtx); -void ObjTimeblock_Destroy(ObjTimeblock* this, GlobalContext* globalCtx); -void ObjTimeblock_Update(ObjTimeblock* this, GlobalContext* globalCtx); -void ObjTimeblock_Draw(ObjTimeblock* this, GlobalContext* globalCtx); +#define THIS ((ObjTimeblock*)thisx) + +void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjTimeblock_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjTimeblock_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjTimeblock_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Timeblock_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 3898f636ed..01514b9fc3 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -8,9 +8,11 @@ #define FLAGS 0x00800010 -void ObjTsubo_Init(ObjTsubo* this, GlobalContext* globalCtx); -void ObjTsubo_Destroy(ObjTsubo* this, GlobalContext* globalCtx); -void ObjTsubo_Update(ObjTsubo* this, GlobalContext* globalCtx); +#define THIS ((ObjTsubo*)thisx) + +void ObjTsubo_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjTsubo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjTsubo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Tsubo_InitVars = { diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 77ed86c536..95e3809ccd 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -8,10 +8,13 @@ #define FLAGS 0x0A000011 -void ObjWarp2block_Init(ObjWarp2block* this, GlobalContext* globalCtx); -void ObjWarp2block_Destroy(ObjWarp2block* this, GlobalContext* globalCtx); -void ObjWarp2block_Update(ObjWarp2block* this, GlobalContext* globalCtx); -void ObjWarp2block_Draw(ObjWarp2block* this, GlobalContext* globalCtx); +#define THIS ((ObjWarp2block*)thisx) + +void ObjWarp2block_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjWarp2block_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjWarp2block_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjWarp2block_Draw(Actor* thisx, GlobalContext* globalCtx); + // func_80BA1DF0 // func_80BA1EEC void func_80BA2048(ObjWarp2block* this, GlobalContext* globalCtx); @@ -24,6 +27,7 @@ void func_80BA24DC(ObjWarp2block* this, GlobalContext* globalCtx); void func_80BA24F8(ObjWarp2block* this, GlobalContext* globalCtx); // func_80BA2600 void func_80BA2610(ObjWarp2block* this, GlobalContext* globalCtx); + /* const ActorInit Obj_Warp2block_InitVars = { ACTOR_OBJ_WARP2BLOCK, diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 742bea383d..581b4d6314 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000030 -void ObjectKankyo_Init(ObjectKankyo* this, GlobalContext* globalCtx); -void ObjectKankyo_Destroy(ObjectKankyo* this, GlobalContext* globalCtx); -void ObjectKankyo_Update(ObjectKankyo* this, GlobalContext* globalCtx); -void ObjectKankyo_Draw(ObjectKankyo* this, GlobalContext* globalCtx); +#define THIS ((ObjectKankyo*)thisx) + +void ObjectKankyo_Init(Actor* thisx, GlobalContext* globalCtx); +void ObjectKankyo_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ObjectKankyo_Update(Actor* thisx, GlobalContext* globalCtx); +void ObjectKankyo_Draw(Actor* thisx, GlobalContext* globalCtx); void ObjectKankyo_SetupAction(ObjectKankyo* this, ActorFunc actionFunc); /* diff --git a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index ed701702e7..d10e3af99f 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000010 -void OceffSpot_Init(OceffSpot* this, GlobalContext* globalCtx); -void OceffSpot_Destroy(OceffSpot* this, GlobalContext* globalCtx); -void OceffSpot_Update(OceffSpot* this, GlobalContext* globalCtx); -void OceffSpot_Draw(OceffSpot* this, GlobalContext* globalCtx); +#define THIS ((OceffSpot*)thisx) + +void OceffSpot_Init(Actor* thisx, GlobalContext* globalCtx); +void OceffSpot_Destroy(Actor* thisx, GlobalContext* globalCtx); +void OceffSpot_Update(Actor* thisx, GlobalContext* globalCtx); +void OceffSpot_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Oceff_Spot_InitVars = { diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 32472d6359..a19bd089b0 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -2,10 +2,12 @@ #define FLAGS 0x02000030 -void OceffStorm_Init(OceffStorm* this, GlobalContext* globalCtx); -void OceffStorm_Destroy(OceffStorm* this, GlobalContext* globalCtx); -void OceffStorm_Update(OceffStorm* this, GlobalContext* globalCtx); -void OceffStorm_Draw(OceffStorm* this, GlobalContext* globalCtx); +#define THIS ((OceffStorm*)thisx) + +void OceffStorm_Init(Actor* thisx, GlobalContext* globalCtx); +void OceffStorm_Destroy(Actor* thisx, GlobalContext* globalCtx); +void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx); +void OceffStorm_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Oceff_Storm_InitVars = { diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index dbacbe7b6a..41d921ed67 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void OceffWipe_Init(OceffWipe* this, GlobalContext* globalCtx); -void OceffWipe_Destroy(OceffWipe* this, GlobalContext* globalCtx); -void OceffWipe_Update(OceffWipe* this, GlobalContext* globalCtx); -void OceffWipe_Draw(OceffWipe* this, GlobalContext* globalCtx); +#define THIS ((OceffWipe*)thisx) + +void OceffWipe_Init(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe_Destroy(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe_Update(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Oceff_Wipe_InitVars = { diff --git a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index b884a91c6b..8ac7a6b999 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void OceffWipe2_Init(OceffWipe2* this, GlobalContext* globalCtx); -void OceffWipe2_Destroy(OceffWipe2* this, GlobalContext* globalCtx); -void OceffWipe2_Update(OceffWipe2* this, GlobalContext* globalCtx); -void OceffWipe2_Draw(OceffWipe2* this, GlobalContext* globalCtx); +#define THIS ((OceffWipe2*)thisx) + +void OceffWipe2_Init(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe2_Destroy(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe2_Update(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Oceff_Wipe2_InitVars = { diff --git a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 538fe9df87..db8c85333c 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void OceffWipe3_Init(OceffWipe3* this, GlobalContext* globalCtx); -void OceffWipe3_Destroy(OceffWipe3* this, GlobalContext* globalCtx); -void OceffWipe3_Update(OceffWipe3* this, GlobalContext* globalCtx); -void OceffWipe3_Draw(OceffWipe3* this, GlobalContext* globalCtx); +#define THIS ((OceffWipe3*)thisx) + +void OceffWipe3_Init(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe3_Destroy(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe3_Update(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe3_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Oceff_Wipe3_InitVars = { diff --git a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 9fe1cb53de..5a93f3119a 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -8,10 +8,12 @@ #define FLAGS 0x02000010 -void OceffWipe4_Init(OceffWipe4* this, GlobalContext* globalCtx); -void OceffWipe4_Destroy(OceffWipe4* this, GlobalContext* globalCtx); -void OceffWipe4_Update(OceffWipe4* this, GlobalContext* globalCtx); -void OceffWipe4_Draw(OceffWipe4* this, GlobalContext* globalCtx); +#define THIS ((OceffWipe4*)thisx) + +void OceffWipe4_Init(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe4_Destroy(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe4_Update(Actor* thisx, GlobalContext* globalCtx); +void OceffWipe4_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Oceff_Wipe4_InitVars = { diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index e1e77d195a..32b9f01a10 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -8,9 +8,11 @@ #define FLAGS 0x00000009 -void ShotSun_Init(ShotSun* this, GlobalContext* globalCtx); -void ShotSun_Destroy(ShotSun* this, GlobalContext* globalCtx); -void ShotSun_Update(ShotSun* this, GlobalContext* globalCtx); +#define THIS ((ShotSun*)thisx) + +void ShotSun_Init(Actor* thisx, GlobalContext* globalCtx); +void ShotSun_Destroy(Actor* thisx, GlobalContext* globalCtx); +void ShotSun_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Shot_Sun_InitVars = {