diff --git a/asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s b/asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s similarity index 98% rename from asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s rename to asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s index 11b39f0082..b781a086c9 100644 --- a/asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s +++ b/asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s @@ -21,7 +21,7 @@ glabel D_80136AE8 .float 0.014285714 .text -glabel ActorShadow_DrawFunc_Teardrop +glabel ActorShadow_DrawFeet /* AA2A64 8002B8C4 27BDFEC8 */ addiu $sp, $sp, -0x138 /* AA2A68 8002B8C8 AFBF007C */ sw $ra, 0x7c($sp) /* AA2A6C 8002B8CC AFBE0078 */ sw $fp, 0x78($sp) @@ -119,7 +119,7 @@ glabel ActorShadow_DrawFunc_Teardrop .L8002BA2C: /* AA2BCC 8002BA2C 44CEF800 */ ctc1 $t6, $31 /* AA2BD0 8002BA30 A3CF00C8 */ sb $t7, 0xc8($fp) -/* AA2BD4 8002BA34 0C00AD7B */ jal ActorShadow_DrawFunc_Circle +/* AA2BD4 8002BA34 0C00AD7B */ jal ActorShadow_DrawCircle /* AA2BD8 8002BA38 8FA5013C */ lw $a1, 0x13c($sp) /* AA2BDC 8002BA3C E7D600C4 */ swc1 $f22, 0xc4($fp) /* AA2BE0 8002BA40 A3D000C8 */ sb $s0, 0xc8($fp) @@ -260,7 +260,7 @@ glabel ActorShadow_DrawFunc_Teardrop /* AA2DDC 8002BC3C 02479021 */ addu $s2, $s2, $a3 /* AA2DE0 8002BC40 E7B80010 */ swc1 $f24, 0x10($sp) /* AA2DE4 8002BC44 E7B60014 */ swc1 $f22, 0x14($sp) -/* AA2DE8 8002BC48 0C00AD9B */ jal func_8002B66C +/* AA2DE8 8002BC48 0C00AD9B */ jal ActorShadow_DrawFoot /* AA2DEC 8002BC4C E7B40018 */ swc1 $f20, 0x18($sp) /* AA2DF0 8002BC50 26310001 */ addiu $s1, $s1, 1 .L8002BC54: @@ -292,7 +292,7 @@ glabel ActorShadow_DrawFunc_Teardrop /* AA2E4C 8002BCAC 02802025 */ move $a0, $s4 /* AA2E50 8002BCB0 E7B80010 */ swc1 $f24, 0x10($sp) /* AA2E54 8002BCB4 E7B60014 */ swc1 $f22, 0x14($sp) -/* AA2E58 8002BCB8 0C00AD9B */ jal func_8002B66C +/* AA2E58 8002BCB8 0C00AD9B */ jal ActorShadow_DrawFoot /* AA2E5C 8002BCBC E7B40018 */ swc1 $f20, 0x18($sp) .L8002BCC0: /* AA2E60 8002BCC0 26310001 */ addiu $s1, $s1, 1 diff --git a/asm/non_matchings/code/z_onepointdemo/func_8007C850.s b/asm/non_matchings/code/z_onepointdemo/func_8007C850.s index 5847a33b1f..1960b9e683 100644 --- a/asm/non_matchings/code/z_onepointdemo/func_8007C850.s +++ b/asm/non_matchings/code/z_onepointdemo/func_8007C850.s @@ -1673,7 +1673,7 @@ glabel func_8007C850 /* AF49CC 8007D82C 27B000A0 */ addiu $s0, $sp, 0xa0 .L8007D830: /* AF49D0 8007D830 02002025 */ move $a0, $s0 -/* AF49D4 8007D834 0C00BBB9 */ jal func_8002EEE4 +/* AF49D4 8007D834 0C00BBB9 */ jal Actor_GetFocus /* AF49D8 8007D838 02202825 */ move $a1, $s1 /* AF49DC 8007D83C 8E190000 */ lw $t9, ($s0) /* AF49E0 8007D840 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2067,7 +2067,7 @@ glabel L8007DDF8 /* AF4FB4 8007DE14 02202825 */ move $a1, $s1 /* AF4FB8 8007DE18 E7B000B8 */ swc1 $f16, 0xb8($sp) /* AF4FBC 8007DE1C E7A600BC */ swc1 $f6, 0xbc($sp) -/* AF4FC0 8007DE20 0C00BBB9 */ jal func_8002EEE4 +/* AF4FC0 8007DE20 0C00BBB9 */ jal Actor_GetFocus /* AF4FC4 8007DE24 E7A400B4 */ swc1 $f4, 0xb4($sp) /* AF4FC8 8007DE28 8E0D0000 */ lw $t5, ($s0) /* AF4FCC 8007DE2C 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2412,7 +2412,7 @@ glabel L8007E340 /* AF54E0 8007E340 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF54E4 8007E344 02002025 */ move $a0, $s0 /* AF54E8 8007E348 02202825 */ move $a1, $s1 -/* AF54EC 8007E34C 0C00BBC5 */ jal func_8002EF14 +/* AF54EC 8007E34C 0C00BBC5 */ jal Actor_GetWorld /* AF54F0 8007E350 AFB100F4 */ sw $s1, 0xf4($sp) /* AF54F4 8007E354 8E0E0000 */ lw $t6, ($s0) /* AF54F8 8007E358 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2432,7 +2432,7 @@ glabel L8007E340 /* AF5530 8007E390 02002025 */ move $a0, $s0 /* AF5534 8007E394 E7A600C4 */ swc1 $f6, 0xc4($sp) /* AF5538 8007E398 02802825 */ move $a1, $s4 -/* AF553C 8007E39C 0C00BBC5 */ jal func_8002EF14 +/* AF553C 8007E39C 0C00BBC5 */ jal Actor_GetWorld /* AF5540 8007E3A0 E7A800D0 */ swc1 $f8, 0xd0($sp) /* AF5544 8007E3A4 02202025 */ move $a0, $s1 /* AF5548 8007E3A8 0C01F1C1 */ jal func_8007C704 @@ -2473,7 +2473,7 @@ glabel L8007E340 glabel L8007E434 /* AF55D4 8007E434 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF55D8 8007E438 02002025 */ move $a0, $s0 -/* AF55DC 8007E43C 0C00BBC5 */ jal func_8002EF14 +/* AF55DC 8007E43C 0C00BBC5 */ jal Actor_GetWorld /* AF55E0 8007E440 02202825 */ move $a1, $s1 /* AF55E4 8007E444 8E0E0000 */ lw $t6, ($s0) /* AF55E8 8007E448 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2517,7 +2517,7 @@ glabel L8007E4DC /* AF567C 8007E4DC 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF5680 8007E4E0 02002025 */ move $a0, $s0 /* AF5684 8007E4E4 02202825 */ move $a1, $s1 -/* AF5688 8007E4E8 0C00BBD1 */ jal func_8002EF44 +/* AF5688 8007E4E8 0C00BBD1 */ jal Actor_GetWorldPosShapeRot /* AF568C 8007E4EC AFB100F4 */ sw $s1, 0xf4($sp) /* AF5690 8007E4F0 8E190000 */ lw $t9, ($s0) /* AF5694 8007E4F4 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2622,11 +2622,11 @@ glabel L8007E5DC /* AF5818 8007E678 E66400FC */ swc1 $f4, 0xfc($s3) /* AF581C 8007E67C 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF5820 8007E680 02002025 */ move $a0, $s0 -/* AF5824 8007E684 0C00BBD1 */ jal func_8002EF44 +/* AF5824 8007E684 0C00BBD1 */ jal Actor_GetWorldPosShapeRot /* AF5828 8007E688 8FA500F4 */ lw $a1, 0xf4($sp) /* AF582C 8007E68C 27B5008C */ addiu $s5, $sp, 0x8c /* AF5830 8007E690 02A02025 */ move $a0, $s5 -/* AF5834 8007E694 0C00BBB9 */ jal func_8002EEE4 +/* AF5834 8007E694 0C00BBB9 */ jal Actor_GetFocus /* AF5838 8007E698 02802825 */ move $a1, $s4 /* AF583C 8007E69C 3C01428C */ li $at, 0x428C0000 # 0.000000 /* AF5840 8007E6A0 44814000 */ mtc1 $at, $f8 @@ -2681,7 +2681,7 @@ glabel L8007E5DC .L8007E764: /* AF5904 8007E764 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF5908 8007E768 02002025 */ move $a0, $s0 -/* AF590C 8007E76C 0C00BBC5 */ jal func_8002EF14 +/* AF590C 8007E76C 0C00BBC5 */ jal Actor_GetWorld /* AF5910 8007E770 02202825 */ move $a1, $s1 /* AF5914 8007E774 8E0D0000 */ lw $t5, ($s0) /* AF5918 8007E778 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2730,7 +2730,7 @@ glabel L8007E5DC glabel L8007E824 /* AF59C4 8007E824 27B000A0 */ addiu $s0, $sp, 0xa0 /* AF59C8 8007E828 02002025 */ move $a0, $s0 -/* AF59CC 8007E82C 0C00BBB9 */ jal func_8002EEE4 +/* AF59CC 8007E82C 0C00BBB9 */ jal Actor_GetFocus /* AF59D0 8007E830 02202825 */ move $a1, $s1 /* AF59D4 8007E834 8E190000 */ lw $t9, ($s0) /* AF59D8 8007E838 27B100C0 */ addiu $s1, $sp, 0xc0 @@ -2746,7 +2746,7 @@ glabel L8007E824 /* AF5A00 8007E860 0C030202 */ jal func_800C0808 /* AF5A04 8007E864 AE390008 */ sw $t9, 8($s1) /* AF5A08 8007E868 02002025 */ move $a0, $s0 -/* AF5A0C 8007E86C 0C00BBC5 */ jal func_8002EF14 +/* AF5A0C 8007E86C 0C00BBC5 */ jal Actor_GetWorld /* AF5A10 8007E870 02802825 */ move $a1, $s4 /* AF5A14 8007E874 27A400D0 */ addiu $a0, $sp, 0xd0 /* AF5A18 8007E878 02202825 */ move $a1, $s1 @@ -2821,7 +2821,7 @@ glabel L8007E914 /* AF5B24 8007E984 0C00B7D5 */ jal func_8002DF54 /* AF5B28 8007E988 24060008 */ li $a2, 8 /* AF5B2C 8007E98C 27A400A0 */ addiu $a0, $sp, 0xa0 -/* AF5B30 8007E990 0C00BBC5 */ jal func_8002EF14 +/* AF5B30 8007E990 0C00BBC5 */ jal Actor_GetWorld /* AF5B34 8007E994 8FA500F4 */ lw $a1, 0xf4($sp) /* AF5B38 8007E998 3C018014 */ lui $at, %hi(D_8013D6CC) /* AF5B3C 8007E99C C42AD6CC */ lwc1 $f10, %lo(D_8013D6CC)($at) @@ -3033,7 +3033,7 @@ glabel L8007EC78 /* AF5E5C 8007ECBC 8E5900E8 */ lw $t9, 0xe8($s2) /* AF5E60 8007ECC0 ADF90008 */ sw $t9, 8($t7) /* AF5E64 8007ECC4 C65000D0 */ lwc1 $f16, 0xd0($s2) -/* AF5E68 8007ECC8 0C00BBB9 */ jal func_8002EEE4 +/* AF5E68 8007ECC8 0C00BBB9 */ jal Actor_GetFocus /* AF5E6C 8007ECCC E4301F24 */ swc1 $f16, %lo(D_80121F24)($at) /* AF5E70 8007ECD0 87AD00AE */ lh $t5, 0xae($sp) /* AF5E74 8007ECD4 3C0E8012 */ lui $t6, %hi(D_80121F1C) # $t6, 0x8012 @@ -3756,10 +3756,10 @@ glabel L8007F6E8 /* AF693C 8007F79C 8FBF0044 */ lw $ra, 0x44($sp) .L8007F7A0: /* AF6940 8007F7A0 27A400A0 */ addiu $a0, $sp, 0xa0 -/* AF6944 8007F7A4 0C00BBB9 */ jal func_8002EEE4 +/* AF6944 8007F7A4 0C00BBB9 */ jal Actor_GetFocus /* AF6948 8007F7A8 02202825 */ move $a1, $s1 /* AF694C 8007F7AC 27A4008C */ addiu $a0, $sp, 0x8c -/* AF6950 8007F7B0 0C00BBB9 */ jal func_8002EEE4 +/* AF6950 8007F7B0 0C00BBB9 */ jal Actor_GetFocus /* AF6954 8007F7B4 02802825 */ move $a1, $s4 /* AF6958 8007F7B8 C7A600A4 */ lwc1 $f6, 0xa4($sp) /* AF695C 8007F7BC C7A80090 */ lwc1 $f8, 0x90($sp) @@ -3907,7 +3907,7 @@ glabel L8007F6E8 /* AF6B6C 8007F9CC 27B000A0 */ addiu $s0, $sp, 0xa0 .L8007F9D0: /* AF6B70 8007F9D0 02002025 */ move $a0, $s0 -/* AF6B74 8007F9D4 0C00BBD1 */ jal func_8002EF44 +/* AF6B74 8007F9D4 0C00BBD1 */ jal Actor_GetWorldPosShapeRot /* AF6B78 8007F9D8 02802825 */ move $a1, $s4 /* AF6B7C 8007F9DC 8FA600DC */ lw $a2, 0xdc($sp) /* AF6B80 8007F9E0 27A400D0 */ addiu $a0, $sp, 0xd0 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s index ce8391cdad..a4f2832e8d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Dy_Yoseizo/BgDyYoseizo_Update.s @@ -135,7 +135,7 @@ glabel BgDyYoseizo_Update /* 022D8 80874B08 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 022DC 80874B0C 46083002 */ mul.s $f0, $f6, $f8 /* 022E0 80874B10 44050000 */ mfc1 $a1, $f0 -/* 022E4 80874B14 0C00B56E */ jal Actor_SetHeight +/* 022E4 80874B14 0C00B56E */ jal Actor_SetFocus /* 022E8 80874B18 E6000328 */ swc1 $f0, 0x0328($s0) ## 00000328 /* 022EC 80874B1C C60A0328 */ lwc1 $f10, 0x0328($s0) ## 00000328 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s index 5fedd34664..3992df9872 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Rock/BgHidanRock_Update.s @@ -22,7 +22,7 @@ glabel BgHidanRock_Update /* 00B44 8088BBC4 44070000 */ mfc1 $a3, $f0 /* 00B48 8088BBC8 8FA4002C */ lw $a0, 0x002C($sp) /* 00B4C 8088BBCC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00B50 8088BBD0 0C00B92D */ jal func_8002E4B4 +/* 00B50 8088BBD0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00B54 8088BBD4 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00B58 8088BBD8 C600016C */ lwc1 $f0, 0x016C($s0) ## 0000016C .L8088BBDC: diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s index 6469b43717..0318629b3e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898920.s @@ -64,7 +64,7 @@ glabel func_80898920 /* 00104 808989A4 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 /* 00108 808989A8 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 -/* 0010C 808989AC 0C00B69E */ jal func_8002DA78 +/* 0010C 808989AC 0C00B69E */ jal Actor_WorldYawTowardActor /* 00110 808989B0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00114 808989B4 820E02FF */ lb $t6, 0x02FF($s0) ## 000002FF /* 00118 808989B8 3C014120 */ lui $at, 0x4120 ## $at = 41200000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s index 1fa84454c2..425b2651f6 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Jya_Ironobj/func_80898DB4.s @@ -64,7 +64,7 @@ glabel func_80898DB4 /* 00598 80898E38 00E02825 */ or $a1, $a3, $zero ## $a1 = 00000000 /* 0059C 80898E3C 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 -/* 005A0 80898E40 0C00B69E */ jal func_8002DA78 +/* 005A0 80898E40 0C00B69E */ jal Actor_WorldYawTowardActor /* 005A4 80898E44 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 005A8 80898E48 820E02FF */ lb $t6, 0x02FF($s0) ## 000002FF /* 005AC 80898E4C 3C0140C0 */ lui $at, 0x40C0 ## $at = 40C00000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s index 454f8d3efe..2f9603b7ef 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Mizu_Movebg/func_8089E650.s @@ -29,7 +29,7 @@ glabel func_8089E650 /* 00A78 8089E6A8 0C227842 */ jal func_8089E108 /* 00A7C 8089E6AC AFA30028 */ sw $v1, 0x0028($sp) /* 00A80 8089E6B0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A84 8089E6B4 0C00B6DB */ jal func_8002DB6C +/* 00A84 8089E6B4 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 00A88 8089E6B8 27A5003C */ addiu $a1, $sp, 0x003C ## $a1 = FFFFFFF4 /* 00A8C 8089E6BC C6120068 */ lwc1 $f18, 0x0068($s0) ## 00000068 /* 00A90 8089E6C0 26040024 */ addiu $a0, $s0, 0x0024 ## $a0 = 00000024 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s index a820eb3c06..12e1727508 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/BgSpot02Objects_Init.s @@ -145,7 +145,7 @@ glabel L808AC824 /* 001C8 808AC828 8FA40034 */ lw $a0, 0x0034($sp) /* 001CC 808AC82C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 001D0 808AC830 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 -/* 001D4 808AC834 0C00CDD2 */ jal Actor_ChangeType +/* 001D4 808AC834 0C00CDD2 */ jal Actor_ChangeCategory /* 001D8 808AC838 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 001DC 808AC83C 3C19808B */ lui $t9, %hi(func_808ACC34) ## $t9 = 808B0000 @@ -173,7 +173,7 @@ glabel L808AC87C /* 0022C 808AC88C 8FA40034 */ lw $a0, 0x0034($sp) /* 00230 808AC890 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00234 808AC894 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 -/* 00238 808AC898 0C00CDD2 */ jal Actor_ChangeType +/* 00238 808AC898 0C00CDD2 */ jal Actor_ChangeCategory /* 0023C 808AC89C 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00240 808AC8A0 3C0E808B */ lui $t6, %hi(func_808AD3D4) ## $t6 = 808B0000 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s index f3f30a28c1..87c7963dbe 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Spot02_Objects/func_808ACAFC.s @@ -10,7 +10,7 @@ glabel func_808ACAFC /* 004B8 808ACB18 91C5016B */ lbu $a1, 0x016B($t6) ## 0000016B /* 004BC 808ACB1C 1040000A */ beq $v0, $zero, .L808ACB48 /* 004C0 808ACB20 8FA40018 */ lw $a0, 0x0018($sp) -/* 004C4 808ACB24 0C00B56E */ jal Actor_SetHeight +/* 004C4 808ACB24 0C00B56E */ jal Actor_SetFocus /* 004C8 808ACB28 3C054270 */ lui $a1, 0x4270 ## $a1 = 42700000 /* 004CC 808ACB2C 8FA4001C */ lw $a0, 0x001C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s b/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s index e3fbd6a6f5..d1bdc3fd77 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Sst_Floor/BgSstFloor_Update.s @@ -146,7 +146,7 @@ glabel BgSstFloor_Update /* 00290 808B9BA0 00000000 */ nop /* 00294 808B9BA4 4502001A */ bc1fl .L808B9C10 /* 00298 808B9BA8 8E100124 */ lw $s0, 0x0124($s0) ## 00000124 -/* 0029C 808B9BAC 0C00B6E3 */ jal func_8002DB8C +/* 0029C 808B9BAC 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 002A0 808B9BB0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 002A4 808B9BB4 3C0143AF */ lui $at, 0x43AF ## $at = 43AF0000 /* 002A8 808B9BB8 44817000 */ mtc1 $at, $f14 ## $f14 = 350.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s b/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s index 97b4ca31e3..00d4d9e99c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Bg_Ydan_Sp/BgYdanSp_Init.s @@ -115,7 +115,7 @@ glabel BgYdanSp_Init /* 001A8 808BF5B8 27390464 */ addiu $t9, $t9, %lo(func_808C0464) ## $t9 = 808C0464 /* 001AC 808BF5BC AE190164 */ sw $t9, 0x0164($s0) ## 00000164 /* 001B0 808BF5C0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 001B4 808BF5C4 0C00B56E */ jal Actor_SetHeight +/* 001B4 808BF5C4 0C00B56E */ jal Actor_SetFocus /* 001B8 808BF5C8 3C0541F0 */ lui $a1, 0x41F0 ## $a1 = 41F00000 /* 001BC 808BF5CC 0C01DE1C */ jal Math_SinS diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s index b748eb1cff..d0a2739dbd 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Init.s @@ -37,8 +37,8 @@ glabel BossDodongo_Init /* 00818 808C19A8 24A5A3C8 */ addiu $a1, $a1, %lo(D_808CA3C8) ## $a1 = 808CA3C8 /* 0081C 808C19AC 3C05460F */ lui $a1, 0x460F ## $a1 = 460F0000 -/* 00820 808C19B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00824 808C19B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00820 808C19B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00824 808C19B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00828 808C19B8 34A5C000 */ ori $a1, $a1, 0xC000 ## $a1 = 460FC000 /* 0082C 808C19BC 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00830 808C19C0 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s index b606eef7fa..538beafa3d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/BossDodongo_Update.s @@ -155,7 +155,7 @@ glabel BossDodongo_Update /* 02AD8 808C3C68 AFAB0014 */ sw $t3, 0x0014($sp) /* 02ADC 808C3C6C 8FA400B4 */ lw $a0, 0x00B4($sp) /* 02AE0 808C3C70 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 02AE4 808C3C74 0C00B92D */ jal func_8002E4B4 +/* 02AE4 808C3C74 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02AE8 808C3C78 E7B20010 */ swc1 $f18, 0x0010($sp) /* 02AEC 808C3C7C 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 02AF0 808C3C80 3C073A83 */ lui $a3, 0x3A83 ## $a3 = 3A830000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s index 59fe13b8d7..c929ca7d09 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Dodongo/func_808C51F4.s @@ -2,7 +2,7 @@ glabel func_808C51F4 /* 04064 808C51F4 27BDFFE8 */ addiu $sp, $sp, 0xFFE8 ## $sp = FFFFFFE8 /* 04068 808C51F8 AFBF0014 */ sw $ra, 0x0014($sp) /* 0406C 808C51FC 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 -/* 04070 808C5200 0C00B69E */ jal func_8002DA78 +/* 04070 808C5200 0C00B69E */ jal Actor_WorldYawTowardActor /* 04074 808C5204 AFA40018 */ sw $a0, 0x0018($sp) /* 04078 808C5208 8FA40018 */ lw $a0, 0x0018($sp) /* 0407C 808C520C 848E0032 */ lh $t6, 0x0032($a0) ## 00000032 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s index 5d7fa1d9d7..b0c70d03e7 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Fd/func_808CB718.s @@ -1537,7 +1537,7 @@ glabel L808CC944 /* 01D64 808CCB24 8FA401D4 */ lw $a0, 0x01D4($sp) .L808CCB28: /* 01D68 808CCB28 E7BC0010 */ swc1 $f28, 0x0010($sp) -/* 01D6C 808CCB2C 0C00B92D */ jal func_8002E4B4 +/* 01D6C 808CCB2C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01D70 808CCB30 AFAE0014 */ sw $t6, 0x0014($sp) /* 01D74 808CCB34 86CF024A */ lh $t7, 0x024A($s6) ## 0000024A /* 01D78 808CCB38 26C4027C */ addiu $a0, $s6, 0x027C ## $a0 = 0000027C diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s index da22cddc4a..a08fabd5b7 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/BossGanon_Init.s @@ -157,7 +157,7 @@ glabel BossGanon_Init /* 00B20 808D7390 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00B24 808D7394 8FA50044 */ lw $a1, 0x0044($sp) /* 00B28 808D7398 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00B2C 808D739C 0C00CDD2 */ jal Actor_ChangeType +/* 00B2C 808D739C 0C00CDD2 */ jal Actor_ChangeCategory /* 00B30 808D73A0 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00B34 808D73A4 100000E0 */ beq $zero, $zero, .L808D7728 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s index 25de27aee7..8cb04a6d6c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon/func_808E1034.s @@ -647,7 +647,7 @@ glabel L808E176C /* 0B05C 808E18CC 44812000 */ mtc1 $at, $f4 ## $f4 = 20.00 /* 0B060 808E18D0 4406A000 */ mfc1 $a2, $f20 /* 0B064 808E18D4 AFA90014 */ sw $t1, 0x0014($sp) -/* 0B068 808E18D8 0C00B92D */ jal func_8002E4B4 +/* 0B068 808E18D8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0B06C 808E18DC E7A40010 */ swc1 $f4, 0x0010($sp) /* 0B070 808E18E0 C6200024 */ lwc1 $f0, 0x0024($s1) ## 00000024 .L808E18E4: diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s index 380d64513f..5d92c3d055 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Ganon2/BossGanon2_Update.s @@ -174,7 +174,7 @@ glabel BossGanon2_Update /* 05A40 80902980 44070000 */ mfc1 $a3, $f0 /* 05A44 80902984 AFB80014 */ sw $t8, 0x0014($sp) /* 05A48 80902988 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 -/* 05A4C 8090298C 0C00B92D */ jal func_8002E4B4 +/* 05A4C 8090298C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 05A50 80902990 E7A40010 */ swc1 $f4, 0x0010($sp) /* 05A54 80902994 96290088 */ lhu $t1, 0x0088($s1) ## 00000088 /* 05A58 80902998 3C01C0A0 */ lui $at, 0xC0A0 ## $at = C0A00000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s index b59df05fe2..a850e2324e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Init.s @@ -9,8 +9,8 @@ glabel BossGoma_Init /* 00250 80915C60 0C01E037 */ jal Actor_ProcessInitChain /* 00254 80915C64 24A5B2A8 */ addiu $a1, $a1, %lo(D_8091B2A8) ## $a1 = 8091B2A8 -/* 00258 80915C68 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0025C 80915C6C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00258 80915C68 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0025C 80915C6C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00260 80915C70 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00264 80915C74 3C05457A */ lui $a1, 0x457A ## $a1 = 457A0000 /* 00268 80915C78 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s index f8a22e7280..c36c70c353 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/BossGoma_Update.s @@ -61,7 +61,7 @@ glabel BossGoma_Update /* 04A54 8091A464 8FA4003C */ lw $a0, 0x003C($sp) /* 04A58 8091A468 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 04A5C 8091A46C AFAC0014 */ sw $t4, 0x0014($sp) -/* 04A60 8091A470 0C00B92D */ jal func_8002E4B4 +/* 04A60 8091A470 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04A64 8091A474 E7A80010 */ swc1 $f8, 0x0010($sp) /* 04A68 8091A478 10000009 */ beq $zero, $zero, .L8091A4A0 /* 04A6C 8091A47C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -71,7 +71,7 @@ glabel BossGoma_Update /* 04A78 8091A488 44815000 */ mtc1 $at, $f10 ## $f10 = 80.00 /* 04A7C 8091A48C 44070000 */ mfc1 $a3, $f0 /* 04A80 8091A490 AFAD0014 */ sw $t5, 0x0014($sp) -/* 04A84 8091A494 0C00B92D */ jal func_8002E4B4 +/* 04A84 8091A494 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04A88 8091A498 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 04A8C 8091A49C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L8091A4A0: diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s index 9e8836f197..c7d21835d3 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916AEC.s @@ -76,7 +76,7 @@ glabel func_80916AEC /* 011F8 80916C08 E646002C */ swc1 $f6, 0x002C($s2) ## 0000002C /* 011FC 80916C0C A6490032 */ sh $t1, 0x0032($s2) ## 00000032 /* 01200 80916C10 8E251C44 */ lw $a1, 0x1C44($s1) ## 00001C44 -/* 01204 80916C14 0C00B69E */ jal func_8002DA78 +/* 01204 80916C14 0C00B69E */ jal Actor_WorldYawTowardActor /* 01208 80916C18 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0120C 80916C1C 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 01210 80916C20 00415021 */ addu $t2, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s index 300caba856..4052058453 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80916C9C.s @@ -449,7 +449,7 @@ glabel L809171FC /* 01888 80917298 8FA40048 */ lw $a0, 0x0048($sp) /* 0188C 8091729C 8FB8006C */ lw $t8, 0x006C($sp) /* 01890 809172A0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01894 809172A4 0C00B69E */ jal func_8002DA78 +/* 01894 809172A4 0C00B69E */ jal Actor_WorldYawTowardActor /* 01898 809172A8 8F051C44 */ lw $a1, 0x1C44($t8) ## 00001C44 /* 0189C 809172AC 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 018A0 809172B0 00412821 */ addu $a1, $v0, $at @@ -849,7 +849,7 @@ glabel L80917738 /* 01E2C 8091783C 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 01E30 80917840 8FAB006C */ lw $t3, 0x006C($sp) /* 01E34 80917844 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01E38 80917848 0C00B69E */ jal func_8002DA78 +/* 01E38 80917848 0C00B69E */ jal Actor_WorldYawTowardActor /* 01E3C 8091784C 8D651C44 */ lw $a1, 0x1C44($t3) ## 00001C44 /* 01E40 80917850 00022C00 */ sll $a1, $v0, 16 /* 01E44 80917854 00052C03 */ sra $a1, $a1, 16 @@ -969,7 +969,7 @@ glabel L80917738 /* 01FE8 809179F8 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 01FEC 809179FC 8FA8006C */ lw $t0, 0x006C($sp) /* 01FF0 80917A00 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01FF4 80917A04 0C00B69E */ jal func_8002DA78 +/* 01FF4 80917A04 0C00B69E */ jal Actor_WorldYawTowardActor /* 01FF8 80917A08 8D051C44 */ lw $a1, 0x1C44($t0) ## 00001C44 /* 01FFC 80917A0C 00022C00 */ sll $a1, $v0, 16 /* 02000 80917A10 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s index ac6c524837..99c0e223da 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80918C08.s @@ -32,7 +32,7 @@ glabel func_80918C08 /* 03254 80918C64 00000000 */ nop /* 03258 80918C68 45000009 */ bc1f .L80918C90 /* 0325C 80918C6C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 03260 80918C70 0C00B69E */ jal func_8002DA78 +/* 03260 80918C70 0C00B69E */ jal Actor_WorldYawTowardActor /* 03264 80918C74 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 03268 80918C78 00022C00 */ sll $a1, $v0, 16 /* 0326C 80918C7C 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s index 46bcb88401..c9dc60f0d3 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919278.s @@ -15,7 +15,7 @@ glabel func_80919278 /* 03894 809192A4 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 03898 809192A8 8FAE0024 */ lw $t6, 0x0024($sp) /* 0389C 809192AC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 038A0 809192B0 0C00B69E */ jal func_8002DA78 +/* 038A0 809192B0 0C00B69E */ jal Actor_WorldYawTowardActor /* 038A4 809192B4 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 038A8 809192B8 00022C00 */ sll $a1, $v0, 16 /* 038AC 809192BC 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s index 58b9615fd0..c7c42113fb 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_8091932C.s @@ -15,7 +15,7 @@ glabel func_8091932C /* 03948 80919358 24070BB8 */ addiu $a3, $zero, 0x0BB8 ## $a3 = 00000BB8 /* 0394C 8091935C 8FAE0024 */ lw $t6, 0x0024($sp) /* 03950 80919360 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 03954 80919364 0C00B69E */ jal func_8002DA78 +/* 03954 80919364 0C00B69E */ jal Actor_WorldYawTowardActor /* 03958 80919368 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 0395C 8091936C 00022C00 */ sll $a1, $v0, 16 /* 03960 80919370 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s index 9a9327a8fa..314e9cff35 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919704.s @@ -75,7 +75,7 @@ glabel func_80919704 /* 03DF0 80919800 8FAB002C */ lw $t3, 0x002C($sp) /* 03DF4 80919804 15400042 */ bne $t2, $zero, .L80919910 /* 03DF8 80919808 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 03DFC 8091980C 0C00B69E */ jal func_8002DA78 +/* 03DFC 8091980C 0C00B69E */ jal Actor_WorldYawTowardActor /* 03E00 80919810 8D651C44 */ lw $a1, 0x1C44($t3) ## 00001C44 /* 03E04 80919814 A7A20026 */ sh $v0, 0x0026($sp) /* 03E08 80919818 86030196 */ lh $v1, 0x0196($s0) ## 00000196 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s index ae1a3ea8b1..20f2187dbc 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Goma/func_80919C38.s @@ -91,14 +91,14 @@ glabel func_80919C38 /* 04348 80919D58 00002825 */ or $a1, $zero, $zero ## $a1 = 00000000 /* 0434C 80919D5C 8FAA002C */ lw $t2, 0x002C($sp) /* 04350 80919D60 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 04354 80919D64 0C00B69E */ jal func_8002DA78 +/* 04354 80919D64 0C00B69E */ jal Actor_WorldYawTowardActor /* 04358 80919D68 8D451C44 */ lw $a1, 0x1C44($t2) ## 00001C44 /* 0435C 80919D6C 860B00B6 */ lh $t3, 0x00B6($s0) ## 000000B6 /* 04360 80919D70 8FAD002C */ lw $t5, 0x002C($sp) /* 04364 80919D74 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 04368 80919D78 004B6023 */ subu $t4, $v0, $t3 /* 0436C 80919D7C A7AC0024 */ sh $t4, 0x0024($sp) -/* 04370 80919D80 0C00B6B8 */ jal func_8002DAE0 +/* 04370 80919D80 0C00B6B8 */ jal Actor_WorldPitchTowardActor /* 04374 80919D84 8DA51C44 */ lw $a1, 0x1C44($t5) ## 00001C44 /* 04378 80919D88 860300B4 */ lh $v1, 0x00B4($s0) ## 000000B4 /* 0437C 80919D8C 87A50024 */ lh $a1, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s index fa3dabf8cf..3fc1c16c85 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/BossMo_Init.s @@ -199,7 +199,7 @@ glabel BossMo_Init /* 00884 8091C384 8FA50048 */ lw $a1, 0x0048($sp) /* 00888 8091C388 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0088C 8091C38C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00890 8091C390 0C00CDD2 */ jal Actor_ChangeType +/* 00890 8091C390 0C00CDD2 */ jal Actor_ChangeCategory /* 00894 8091C394 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00898 8091C398 1000003A */ beq $zero, $zero, .L8091C484 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s index bca7c4aa08..15a3928082 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Mo/func_809216D0.s @@ -765,7 +765,7 @@ glabel L80921B08 /* 06564 80922064 8FA400EC */ lw $a0, 0x00EC($sp) /* 06568 80922068 3C064248 */ lui $a2, 0x4248 ## $a2 = 42480000 /* 0656C 8092206C 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 -/* 06570 80922070 0C00B92D */ jal func_8002E4B4 +/* 06570 80922070 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 06574 80922074 E7A80010 */ swc1 $f8, 0x0010($sp) /* 06578 80922078 8FB800EC */ lw $t8, 0x00EC($sp) /* 0657C 8092207C 3C010001 */ lui $at, 0x0001 ## $at = 00010000 @@ -1315,7 +1315,7 @@ glabel L80921B08 /* 06D5C 8092285C E6320028 */ swc1 $f18, 0x0028($s1) ## 00000028 /* 06D60 80922860 AFA20014 */ sw $v0, 0x0014($sp) /* 06D64 80922864 8FA400EC */ lw $a0, 0x00EC($sp) -/* 06D68 80922868 0C00B92D */ jal func_8002E4B4 +/* 06D68 80922868 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 06D6C 8092286C E7A80010 */ swc1 $f8, 0x0010($sp) /* 06D70 80922870 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 /* 06D74 80922874 44815000 */ mtc1 $at, $f10 ## $f10 = 20.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s index f0efe98171..c1b9ba9d15 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Init.s @@ -75,8 +75,8 @@ glabel BossSst_Init /* 000F0 8092C6C0 0C0291BE */ jal SkelAnime_InitFlex /* 000F4 8092C6C4 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C /* 000F8 8092C6C8 3C054788 */ lui $a1, 0x4788 ## $a1 = 47880000 -/* 000FC 8092C6CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00100 8092C6D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 000FC 8092C6CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00100 8092C6D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00104 8092C6D4 34A5B800 */ ori $a1, $a1, 0xB800 ## $a1 = 4788B800 /* 00108 8092C6D8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0010C 8092C6DC 0C00AC78 */ jal ActorShape_Init @@ -233,7 +233,7 @@ glabel BossSst_Init /* 00344 8092C914 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00348 8092C918 8FA5003C */ lw $a1, 0x003C($sp) /* 0034C 8092C91C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00350 8092C920 0C00CDD2 */ jal Actor_ChangeType +/* 00350 8092C920 0C00CDD2 */ jal Actor_ChangeCategory /* 00354 8092C924 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00358 8092C928 10000046 */ beq $zero, $zero, .L8092CA44 @@ -293,8 +293,8 @@ glabel BossSst_Init /* 00424 8092C9F4 240D0001 */ addiu $t5, $zero, 0x0001 ## $t5 = 00000001 /* 00428 8092C9F8 A20D0194 */ sb $t5, 0x0194($s0) ## 00000194 .L8092C9FC: -/* 0042C 8092C9FC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00430 8092CA00 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0042C 8092C9FC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00430 8092CA00 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00434 8092CA04 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00438 8092CA08 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0043C 8092CA0C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s index 2082f2a87a..1f9815fe7b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/BossSst_Update.s @@ -79,10 +79,10 @@ glabel BossSst_Update /* 07B68 80934138 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 07B6C 8093413C 3C064248 */ lui $a2, 0x4248 ## $a2 = 42480000 /* 07B70 80934140 3C074302 */ lui $a3, 0x4302 ## $a3 = 43020000 -/* 07B74 80934144 0C00B92D */ jal func_8002E4B4 +/* 07B74 80934144 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 07B78 80934148 E7A80010 */ swc1 $f8, 0x0010($sp) /* 07B7C 8093414C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 07B80 80934150 0C00B56E */ jal Actor_SetHeight +/* 07B80 80934150 0C00B56E */ jal Actor_SetFocus /* 07B84 80934154 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 07B88 80934158 920E03E4 */ lbu $t6, 0x03E4($s0) ## 000003E4 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s index f8b403940b..47de679f4d 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092DB4C.s @@ -88,7 +88,7 @@ glabel func_8092DB4C /* 016B4 8092DC84 10000014 */ beq $zero, $zero, .L8092DCD8 /* 016B8 8092DC88 A6090198 */ sh $t1, 0x0198($s0) ## 00000198 .L8092DC8C: -/* 016BC 8092DC8C 0C00B6B0 */ jal func_8002DAC0 +/* 016BC 8092DC8C 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 016C0 8092DC90 8CC41C44 */ lw $a0, 0x1C44($a2) ## 00001C44 /* 016C4 8092DC94 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 016C8 8092DC98 00412821 */ addu $a1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s index d1ec87e7ba..426c1767c5 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092E25C.s @@ -10,7 +10,7 @@ glabel func_8092E25C /* 01CAC 8092E27C 3C06C1A0 */ lui $a2, 0xC1A0 ## $a2 = C1A00000 /* 01CB0 8092E280 3C058093 */ lui $a1, %hi(D_80937340) ## $a1 = 80930000 /* 01CB4 8092E284 8FA40018 */ lw $a0, 0x0018($sp) -/* 01CB8 8092E288 0C00B6B0 */ jal func_8002DAC0 +/* 01CB8 8092E288 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 01CBC 8092E28C 24A57340 */ addiu $a1, $a1, %lo(D_80937340) ## $a1 = 80937340 /* 01CC0 8092E290 8FA70018 */ lw $a3, 0x0018($sp) /* 01CC4 8092E294 3C01BF80 */ lui $at, 0xBF80 ## $at = BF800000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s index ae642a2143..047e9f9f4a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_8092F0BC.s @@ -103,7 +103,7 @@ glabel func_8092F0BC /* 02C44 8092F214 8FA40024 */ lw $a0, 0x0024($sp) /* 02C48 8092F218 46085180 */ add.s $f6, $f10, $f8 /* 02C4C 8092F21C 46043481 */ sub.s $f18, $f6, $f4 -/* 02C50 8092F220 0C00B6B0 */ jal func_8002DAC0 +/* 02C50 8092F220 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 02C54 8092F224 E492002C */ swc1 $f18, 0x002C($a0) ## 0000002C /* 02C58 8092F228 8FB90024 */ lw $t9, 0x0024($sp) /* 02C5C 8092F22C 3C058093 */ lui $a1, %hi(D_80937358) ## $a1 = 80930000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s index ecd298bf8e..06bd919677 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80930B18.s @@ -20,12 +20,12 @@ glabel func_80930B18 /* 04590 80930B60 3C058094 */ lui $a1, %hi(D_80938C90) ## $a1 = 80940000 /* 04594 80930B64 8CA58C90 */ lw $a1, %lo(D_80938C90)($a1) /* 04598 80930B68 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0459C 80930B6C 0C00B6EC */ jal func_8002DBB0 +/* 0459C 80930B6C 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 045A0 80930B70 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 80940024 /* 045A4 80930B74 E60003C4 */ swc1 $f0, 0x03C4($s0) ## 000003C4 /* 045A8 80930B78 3C048094 */ lui $a0, %hi(D_80938C90) ## $a0 = 80940000 /* 045AC 80930B7C 8C848C90 */ lw $a0, %lo(D_80938C90)($a0) -/* 045B0 80930B80 0C00B6B0 */ jal func_8002DAC0 +/* 045B0 80930B80 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 045B4 80930B84 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 /* 045B8 80930B88 820A0194 */ lb $t2, 0x0194($s0) ## 00000194 /* 045BC 80930B8C 86090016 */ lh $t1, 0x0016($s0) ## 00000016 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s index f01330850e..3084f5a6bd 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80931210.s @@ -31,12 +31,12 @@ glabel func_80931210 /* 04CB0 80931280 3C058094 */ lui $a1, %hi(D_80938C90) ## $a1 = 80940000 /* 04CB4 80931284 8CA58C90 */ lw $a1, %lo(D_80938C90)($a1) /* 04CB8 80931288 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 04CBC 8093128C 0C00B6EC */ jal func_8002DBB0 +/* 04CBC 8093128C 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 04CC0 80931290 24A50024 */ addiu $a1, $a1, 0x0024 ## $a1 = 80940024 /* 04CC4 80931294 E60003C4 */ swc1 $f0, 0x03C4($s0) ## 000003C4 /* 04CC8 80931298 3C048094 */ lui $a0, %hi(D_80938C90) ## $a0 = 80940000 /* 04CCC 8093129C 8C848C90 */ lw $a0, %lo(D_80938C90)($a0) -/* 04CD0 809312A0 0C00B6B0 */ jal func_8002DAC0 +/* 04CD0 809312A0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 04CD4 809312A4 26050024 */ addiu $a1, $s0, 0x0024 ## $a1 = 00000024 /* 04CD8 809312A8 82030194 */ lb $v1, 0x0194($s0) ## 00000194 /* 04CDC 809312AC 860D0016 */ lh $t5, 0x0016($s0) ## 00000016 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s index 31a64940f3..e82059160e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Sst/func_80933554.s @@ -26,12 +26,12 @@ glabel func_80933554 .L809335B4: /* 06FE4 809335B4 8E05011C */ lw $a1, 0x011C($s0) ## 0000011C /* 06FE8 809335B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 06FEC 809335BC 0C00B6EC */ jal func_8002DBB0 +/* 06FEC 809335BC 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 06FF0 809335C0 24A503C8 */ addiu $a1, $a1, 0x03C8 ## $a1 = 000003C8 /* 06FF4 809335C4 8E05011C */ lw $a1, 0x011C($s0) ## 0000011C /* 06FF8 809335C8 E60003C4 */ swc1 $f0, 0x03C4($s0) ## 000003C4 /* 06FFC 809335CC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 07000 809335D0 0C00B6B0 */ jal func_8002DAC0 +/* 07000 809335D0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 07004 809335D4 24A503C8 */ addiu $a1, $a1, 0x03C8 ## $a1 = 000003C8 /* 07008 809335D8 A60201A4 */ sh $v0, 0x01A4($s0) ## 000001A4 /* 0700C 809335DC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s index 1acaafcdd7..af4a25acb0 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_8093C2C4.s @@ -155,7 +155,7 @@ glabel func_8093C2C4 /* 03808 8093C4D8 AFA90014 */ sw $t1, 0x0014($sp) /* 0380C 8093C4DC 8FA4006C */ lw $a0, 0x006C($sp) /* 03810 8093C4E0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 03814 8093C4E4 0C00B92D */ jal func_8002E4B4 +/* 03814 8093C4E4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 03818 8093C4E8 E7B20010 */ swc1 $f18, 0x0010($sp) /* 0381C 8093C4EC 3C014248 */ lui $at, 0x4248 ## $at = 42480000 /* 03820 8093C4F0 44813000 */ mtc1 $at, $f6 ## $f6 = 50.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s index 13bcdd1853..6a89d2f197 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Tw/func_80949E10.s @@ -126,7 +126,7 @@ glabel func_80949E10 /* 112F0 80949FC0 AFA80014 */ sw $t0, 0x0014($sp) /* 112F4 80949FC4 8FA4006C */ lw $a0, 0x006C($sp) /* 112F8 80949FC8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 112FC 80949FCC 0C00B92D */ jal func_8002E4B4 +/* 112FC 80949FCC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 11300 80949FD0 E7B20010 */ swc1 $f18, 0x0010($sp) /* 11304 80949FD4 3C0141F0 */ lui $at, 0x41F0 ## $at = 41F00000 /* 11308 80949FD8 44813000 */ mtc1 $at, $f6 ## $f6 = 30.00 diff --git a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s index b0be361ed2..9976b2bfda 100644 --- a/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s +++ b/asm/non_matchings/overlays/actors/ovl_Boss_Va/func_80952858.s @@ -714,7 +714,7 @@ glabel func_80952858 /* 03F78 80953238 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 03F7C 8095323C 3C0641F0 */ lui $a2, 0x41F0 ## $a2 = 41F00000 /* 03F80 80953240 3C07428C */ lui $a3, 0x428C ## $a3 = 428C0000 -/* 03F84 80953244 0C00B92D */ jal func_8002E4B4 +/* 03F84 80953244 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 03F88 80953248 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 03F8C 8095324C 2605028C */ addiu $a1, $s0, 0x028C ## $a1 = 0000028C /* 03F90 80953250 AFA5003C */ sw $a1, 0x003C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s index 9553545fa2..b92fede292 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_6K/Demo6K_Init.s @@ -242,7 +242,7 @@ glabel L80966BCC /* 002A8 80966BF8 8FA40054 */ lw $a0, 0x0054($sp) /* 002AC 80966BFC 02203025 */ or $a2, $s1, $zero ## $a2 = 00000000 /* 002B0 80966C00 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 -/* 002B4 80966C04 0C00CDD2 */ jal Actor_ChangeType +/* 002B4 80966C04 0C00CDD2 */ jal Actor_ChangeCategory /* 002B8 80966C08 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 002BC 80966C0C 10000029 */ beq $zero, $zero, .L80966CB4 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s index 73c8c73945..f0bac4d3c9 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Du/DemoDu_Init.s @@ -4,8 +4,8 @@ glabel DemoDu_Init /* 023E8 8096BEB8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 023EC 8096BEBC AFBF001C */ sw $ra, 0x001C($sp) /* 023F0 8096BEC0 AFA50024 */ sw $a1, 0x0024($sp) -/* 023F4 8096BEC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 023F8 8096BEC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 023F4 8096BEC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 023F8 8096BEC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 023FC 8096BECC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 02400 8096BED0 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 02404 8096BED4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s b/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s index 259d74804b..302c8b3a50 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Du/func_80969C58.s @@ -11,7 +11,7 @@ glabel func_80969C58 /* 001AC 80969C7C AFAE0014 */ sw $t6, 0x0014($sp) /* 001B0 80969C80 8FA40024 */ lw $a0, 0x0024($sp) /* 001B4 80969C84 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 001B8 80969C88 0C00B92D */ jal func_8002E4B4 +/* 001B8 80969C88 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 001BC 80969C8C E7A00010 */ swc1 $f0, 0x0010($sp) /* 001C0 80969C90 8FBF001C */ lw $ra, 0x001C($sp) /* 001C4 80969C94 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s index 337d754c1e..eab685dcfa 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_8098330C.s @@ -11,7 +11,7 @@ glabel func_8098330C /* 00030 80983330 AFAE0014 */ sw $t6, 0x0014($sp) /* 00034 80983334 8FA40024 */ lw $a0, 0x0024($sp) /* 00038 80983338 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 0003C 8098333C 0C00B92D */ jal func_8002E4B4 +/* 0003C 8098333C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00040 80983340 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00044 80983344 8FBF001C */ lw $ra, 0x001C($sp) /* 00048 80983348 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s index 758d0331cf..1de5ea38d5 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Ik/func_80983820.s @@ -39,11 +39,11 @@ glabel func_80983820 /* 005A8 809838A8 AFB80048 */ sw $t8, 0x0048($sp) /* 005AC 809838AC 2631035C */ addiu $s1, $s1, %lo(D_0600035C) ## $s1 = 0600035C .L809838B0: -/* 005B0 809838B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 005B0 809838B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 005B4 809838B4 44070000 */ mfc1 $a3, $f0 /* 005B8 809838B8 0C00AC78 */ jal ActorShape_Init -/* 005BC 809838BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 005BC 809838BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 005C0 809838C0 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C /* 005C4 809838C4 26190190 */ addiu $t9, $s0, 0x0190 ## $t9 = 00000190 /* 005C8 809838C8 2608019C */ addiu $t0, $s0, 0x019C ## $t0 = 0000019C diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s index 7e0b811a88..63904794a1 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/DemoKankyo_Init.s @@ -259,7 +259,7 @@ glabel L80989190 /* 00310 80989190 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00314 80989194 26051C24 */ addiu $a1, $s0, 0x1C24 ## $a1 = 00001C24 /* 00318 80989198 02603025 */ or $a2, $s3, $zero ## $a2 = 00000000 -/* 0031C 8098919C 0C00CDD2 */ jal Actor_ChangeType +/* 0031C 8098919C 0C00CDD2 */ jal Actor_ChangeCategory /* 00320 809891A0 24070007 */ addiu $a3, $zero, 0x0007 ## $a3 = 00000007 /* 00324 809891A4 3C013F80 */ lui $at, 0x3F80 ## $at = 3F800000 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s index 7a7cd59d00..b3664e676e 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s @@ -231,7 +231,7 @@ glabel func_8098ABC0 .L8098AEBC: /* 0203C 8098AEBC 27A400B8 */ addiu $a0, $sp, 0x00B8 ## $a0 = FFFFFFC0 .L8098AEC0: -/* 02040 8098AEC0 0C00BBC5 */ jal func_8002EF14 +/* 02040 8098AEC0 0C00BBC5 */ jal Actor_GetWorld /* 02044 8098AEC4 8FA500E4 */ lw $a1, 0x00E4($sp) /* 02048 8098AEC8 3C068099 */ lui $a2, %hi(D_8098CF98) ## $a2 = 80990000 /* 0204C 8098AECC 24C6CF98 */ addiu $a2, $a2, %lo(D_8098CF98) ## $a2 = 8098CF98 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s index fa2b2d8c49..33db118e8a 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098B354.s @@ -170,7 +170,7 @@ glabel func_8098B354 /* 026F4 8098B574 258D0001 */ addiu $t5, $t4, 0x0001 ## $t5 = 00000001 /* 026F8 8098B578 A20D0172 */ sb $t5, 0x0172($s0) ## 00000172 .L8098B57C: -/* 026FC 8098B57C 0C00BBC5 */ jal func_8002EF14 +/* 026FC 8098B57C 0C00BBC5 */ jal Actor_GetWorld /* 02700 8098B580 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 /* 02704 8098B584 3C068099 */ lui $a2, %hi(D_8098CFB8) ## $a2 = 80990000 /* 02708 8098B588 24C6CFB8 */ addiu $a2, $a2, %lo(D_8098CFB8) ## $a2 = 8098CFB8 diff --git a/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s b/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s index fea0293dd5..527e005963 100644 --- a/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s +++ b/asm/non_matchings/overlays/actors/ovl_Door_Warp1/func_8099898C.s @@ -215,7 +215,7 @@ glabel L80998B6C /* 00490 80998C10 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00494 80998C14 8FA40034 */ lw $a0, 0x0034($sp) .L80998C18: -/* 00498 80998C18 0C00B6E3 */ jal func_8002DB8C +/* 00498 80998C18 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 0049C 80998C1C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 004A0 80998C20 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 /* 004A4 80998C24 44814000 */ mtc1 $at, $f8 ## $f8 = 100.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s index 46dff8f6e2..fafefa2ede 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Init.s @@ -10,8 +10,8 @@ glabel EnAm_Init /* 00150 809AE070 0C01E037 */ jal Actor_ProcessInitChain /* 00154 809AE074 24A50048 */ addiu $a1, $a1, %lo(D_809B0048) ## $a1 = 809B0048 -/* 00158 809AE078 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0015C 809AE07C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00158 809AE078 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0015C 809AE07C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00160 809AE080 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00164 809AE084 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00168 809AE088 0C00AC78 */ jal ActorShape_Init @@ -90,7 +90,7 @@ glabel EnAm_Init /* 00264 809AE184 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00268 809AE188 26251C24 */ addiu $a1, $s1, 0x1C24 ## $a1 = 00001C24 /* 0026C 809AE18C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00270 809AE190 0C00CDD2 */ jal Actor_ChangeType +/* 00270 809AE190 0C00CDD2 */ jal Actor_ChangeCategory /* 00274 809AE194 24070001 */ addiu $a3, $zero, 0x0001 ## $a3 = 00000001 /* 00278 809AE198 0C26B92A */ jal func_809AE4A8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s index 7feb77f93f..6d314f49d5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/EnAm_Update.s @@ -167,7 +167,7 @@ glabel EnAm_Update /* 01D20 809AFC40 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 /* 01D24 809AFC44 3C0641A0 */ lui $a2, 0x41A0 ## $a2 = 41A00000 /* 01D28 809AFC48 3C0741E0 */ lui $a3, 0x41E0 ## $a3 = 41E00000 -/* 01D2C 809AFC4C 0C00B92D */ jal func_8002E4B4 +/* 01D2C 809AFC4C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01D30 809AFC50 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 01D34 809AFC54 26510274 */ addiu $s1, $s2, 0x0274 ## $s1 = 00000274 .L809AFC58: @@ -198,7 +198,7 @@ glabel EnAm_Update /* 01D8C 809AFCAC 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 /* 01D90 809AFCB0 46062202 */ mul.s $f8, $f4, $f6 /* 01D94 809AFCB4 44054000 */ mfc1 $a1, $f8 -/* 01D98 809AFCB8 0C00B56E */ jal Actor_SetHeight +/* 01D98 809AFCB8 0C00B56E */ jal Actor_SetFocus /* 01D9C 809AFCBC 00000000 */ nop /* 01DA0 809AFCC0 924B0114 */ lbu $t3, 0x0114($s2) ## 00000114 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s index 572a9a305c..87f5822c5c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809ADF28.s @@ -42,7 +42,7 @@ glabel func_809ADF28 /* 000A0 809ADFC0 E608002C */ swc1 $f8, 0x002C($s0) ## 0000002C /* 000A4 809ADFC4 AFA80014 */ sw $t0, 0x0014($sp) /* 000A8 809ADFC8 8FA4004C */ lw $a0, 0x004C($sp) -/* 000AC 809ADFCC 0C00B92D */ jal func_8002E4B4 +/* 000AC 809ADFCC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 000B0 809ADFD0 E7A20010 */ swc1 $f2, 0x0010($sp) /* 000B4 809ADFD4 27AA0030 */ addiu $t2, $sp, 0x0030 ## $t2 = FFFFFFE8 /* 000B8 809ADFD8 8D4C0000 */ lw $t4, 0x0000($t2) ## FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s index 26ea0e76dd..1f91231d90 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AED8C.s @@ -63,7 +63,7 @@ glabel func_809AED8C /* 00F4C 809AEE6C 0C26B89C */ jal func_809AE270 /* 00F50 809AEE70 8FA50034 */ lw $a1, 0x0034($sp) /* 00F54 809AEE74 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F58 809AEE78 0C00B6DB */ jal func_8002DB6C +/* 00F58 809AEE78 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 00F5C 809AEE7C 8FA50028 */ lw $a1, 0x0028($sp) /* 00F60 809AEE80 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 /* 00F64 809AEE84 44812000 */ mtc1 $at, $f4 ## $f4 = 80.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s index a01539fedc..341a529721 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Am/func_809AF0DC.s @@ -78,7 +78,7 @@ glabel func_809AF0DC /* 012D4 809AF1F4 0C26B89C */ jal func_809AE270 /* 012D8 809AF1F8 8FA5002C */ lw $a1, 0x002C($sp) /* 012DC 809AF1FC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 012E0 809AF200 0C00B6EC */ jal func_8002DBB0 +/* 012E0 809AF200 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 012E4 809AF204 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 012E8 809AF208 3C014370 */ lui $at, 0x4370 ## $at = 43700000 /* 012EC 809AF20C 44815000 */ mtc1 $at, $f10 ## $f10 = 240.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s index 3534e8669a..38cf5d1f60 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Init.s @@ -18,8 +18,8 @@ glabel EnAnubice_Init /* 0018C 809B12AC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00190 809B12B0 AFBF002C */ sw $ra, 0x002C($sp) /* 00194 809B12B4 AFA5003C */ sw $a1, 0x003C($sp) -/* 00198 809B12B8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0019C 809B12BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00198 809B12B8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0019C 809B12BC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001A0 809B12C0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 001A4 809B12C4 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 001A8 809B12C8 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s index a25c8a60ca..be841328b3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice/EnAnubice_Update.s @@ -58,7 +58,7 @@ glabel EnAnubice_Update /* 00CB0 809B1DD0 8FA40064 */ lw $a0, 0x0064($sp) /* 00CB4 809B1DD4 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00CB8 809B1DD8 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00CBC 809B1DDC 0C00CDD2 */ jal Actor_ChangeType +/* 00CBC 809B1DDC 0C00CDD2 */ jal Actor_ChangeCategory /* 00CC0 809B1DE0 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C28 /* 00CC4 809B1DE4 8E190004 */ lw $t9, 0x0004($s0) ## 00000004 @@ -90,7 +90,7 @@ glabel EnAnubice_Update /* 00D24 809B1E44 8FA40064 */ lw $a0, 0x0064($sp) /* 00D28 809B1E48 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00D2C 809B1E4C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00D30 809B1E50 0C00CDD2 */ jal Actor_ChangeType +/* 00D30 809B1E50 0C00CDD2 */ jal Actor_ChangeCategory /* 00D34 809B1E54 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00D38 809B1E58 8E0D0004 */ lw $t5, 0x0004($s0) ## 00000004 @@ -223,7 +223,7 @@ glabel EnAnubice_Update /* 00F08 809B2028 AFA90014 */ sw $t1, 0x0014($sp) /* 00F0C 809B202C 8FA40064 */ lw $a0, 0x0064($sp) /* 00F10 809B2030 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00F14 809B2034 0C00B92D */ jal func_8002E4B4 +/* 00F14 809B2034 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00F18 809B2038 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 00F1C 809B203C 1000000B */ beq $zero, $zero, .L809B206C /* 00F20 809B2040 8E020250 */ lw $v0, 0x0250($s0) ## 00000250 @@ -235,7 +235,7 @@ glabel EnAnubice_Update /* 00F34 809B2054 44060000 */ mfc1 $a2, $f0 /* 00F38 809B2058 44070000 */ mfc1 $a3, $f0 /* 00F3C 809B205C AFAA0014 */ sw $t2, 0x0014($sp) -/* 00F40 809B2060 0C00B92D */ jal func_8002E4B4 +/* 00F40 809B2060 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00F44 809B2064 E7B00010 */ swc1 $f16, 0x0010($sp) /* 00F48 809B2068 8E020250 */ lw $v0, 0x0250($s0) ## 00000250 .L809B206C: @@ -246,7 +246,7 @@ glabel EnAnubice_Update /* 00F5C 809B207C 8FBF0024 */ lw $ra, 0x0024($sp) /* 00F60 809B2080 1182001B */ beq $t4, $v0, .L809B20F0 /* 00F64 809B2084 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F68 809B2088 0C00B56E */ jal Actor_SetHeight +/* 00F68 809B2088 0C00B56E */ jal Actor_SetFocus /* 00F6C 809B208C 8E05027C */ lw $a1, 0x027C($s0) ## 0000027C /* 00F70 809B2090 260502C8 */ addiu $a1, $s0, 0x02C8 ## $a1 = 000002C8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s index ef5d402462..960fed7dd8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Anubice_Fire/EnAnubiceFire_Update.s @@ -62,7 +62,7 @@ glabel EnAnubiceFire_Update /* 00820 809B2DC0 8FA4004C */ lw $a0, 0x004C($sp) /* 00824 809B2DC4 E7A40010 */ swc1 $f4, 0x0010($sp) /* 00828 809B2DC8 AFAC0014 */ sw $t4, 0x0014($sp) -/* 0082C 809B2DCC 0C00B92D */ jal func_8002E4B4 +/* 0082C 809B2DCC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00830 809B2DD0 AFA8002C */ sw $t0, 0x002C($sp) /* 00834 809B2DD4 3C01809B */ lui $at, %hi(D_809B32E8) ## $at = 809B0000 /* 00838 809B2DD8 C42632E8 */ lwc1 $f6, %lo(D_809B32E8)($at) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s index 4b5d0ec76a..f9bc640244 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ba/EnBa_Init.s @@ -86,8 +86,8 @@ glabel EnBa_Init /* 00148 809B6498 10000025 */ beq $zero, $zero, .L809B6530 /* 0014C 809B649C 8FBF0024 */ lw $ra, 0x0024($sp) .L809B64A0: -/* 00150 809B64A0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00154 809B64A4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00150 809B64A0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00154 809B64A4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00158 809B64A8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0015C 809B64AC 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s b/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s index 0944f0e6d0..d6528c0220 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ba/func_809B6A44.s @@ -50,7 +50,7 @@ glabel func_809B6A44 /* 0078C 809B6ADC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00790 809B6AE0 3C0641F0 */ lui $a2, 0x41F0 ## $a2 = 41F00000 /* 00794 809B6AE4 3C0741E0 */ lui $a3, 0x41E0 ## $a3 = 41E00000 -/* 00798 809B6AE8 0C00B92D */ jal func_8002E4B4 +/* 00798 809B6AE8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0079C 809B6AEC E7A60010 */ swc1 $f6, 0x0010($sp) .L809B6AF0: /* 007A0 809B6AF0 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s index 628b7db595..36e70ff1a3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bdfire/EnBdfire_Init.s @@ -77,8 +77,8 @@ glabel EnBdfire_Init /* 000F8 809BC128 0C26F00C */ jal func_809BC030 /* 000FC 809BC12C 24A5C598 */ addiu $a1, $a1, %lo(func_809BC598) ## $a1 = FFFFC598 /* 00100 809BC130 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 00104 809BC134 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00108 809BC138 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00104 809BC134 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00108 809BC138 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0010C 809BC13C 44050000 */ mfc1 $a1, $f0 /* 00110 809BC140 44070000 */ mfc1 $a3, $f0 /* 00114 809BC144 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s index fe6feaa0f5..a6092f133c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Init.s @@ -77,7 +77,7 @@ glabel EnBigokuta_Init /* 00108 809BCD68 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 0010C 809BCD6C 26651C24 */ addiu $a1, $s3, 0x1C24 ## $a1 = 00001C24 /* 00110 809BCD70 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 -/* 00114 809BCD74 0C00CDD2 */ jal Actor_ChangeType +/* 00114 809BCD74 0C00CDD2 */ jal Actor_ChangeCategory /* 00118 809BCD78 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 /* 0011C 809BCD7C 0C26F4C6 */ jal func_809BD318 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s index c4e05fb89f..e1f1338844 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/EnBigokuta_Update.s @@ -123,7 +123,7 @@ glabel EnBigokuta_Update /* 01F18 809BEB78 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 01F1C 809BEB7C 460A4402 */ mul.s $f16, $f8, $f10 /* 01F20 809BEB80 44058000 */ mfc1 $a1, $f16 -/* 01F24 809BEB84 0C00B56E */ jal Actor_SetHeight +/* 01F24 809BEB84 0C00B56E */ jal Actor_SetFocus /* 01F28 809BEB88 00000000 */ nop /* 01F2C 809BEB8C 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s index e665a6cabc..4022cc9260 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BD7F0.s @@ -4,7 +4,7 @@ glabel func_809BD7F0 /* 00B98 809BD7F8 00803025 */ or $a2, $a0, $zero ## $a2 = 00000000 /* 00B9C 809BD7FC 8CA41C44 */ lw $a0, 0x1C44($a1) ## 00001C44 /* 00BA0 809BD800 AFA60018 */ sw $a2, 0x0018($sp) -/* 00BA4 809BD804 0C00B6B0 */ jal func_8002DAC0 +/* 00BA4 809BD804 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00BA8 809BD808 24C50008 */ addiu $a1, $a2, 0x0008 ## $a1 = 00000008 /* 00BAC 809BD80C 8FA40018 */ lw $a0, 0x0018($sp) /* 00BB0 809BD810 808F0194 */ lb $t7, 0x0194($a0) ## 00000194 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s index e3c3e98f05..b9d367f237 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDAE8.s @@ -29,7 +29,7 @@ glabel func_809BDAE8 /* 00EEC 809BDB4C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00EF0 809BDB50 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 /* 00EF4 809BDB54 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 -/* 00EF8 809BDB58 0C00CDD2 */ jal Actor_ChangeType +/* 00EF8 809BDB58 0C00CDD2 */ jal Actor_ChangeCategory /* 00EFC 809BDB5C E604000C */ swc1 $f4, 0x000C($s0) ## 0000000C /* 00F00 809BDB60 240F0002 */ addiu $t7, $zero, 0x0002 ## $t7 = 00000002 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s index 03960b0136..181f57d9ad 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bigokuta/func_809BDC08.s @@ -57,7 +57,7 @@ glabel func_809BDC08 /* 01044 809BDCA4 1000009F */ beq $zero, $zero, .L809BDF24 /* 01048 809BDCA8 8FBF001C */ lw $ra, 0x001C($sp) .L809BDCAC: -/* 0104C 809BDCAC 0C00B6EC */ jal func_8002DBB0 +/* 0104C 809BDCAC 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 01050 809BDCB0 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 01054 809BDCB4 3C014334 */ lui $at, 0x4334 ## $at = 43340000 /* 01058 809BDCB8 44812000 */ mtc1 $at, $f4 ## $f4 = 180.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s index 8322690fbb..5fbbe15366 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Init.s @@ -8,8 +8,8 @@ glabel EnBili_Init /* 00018 809BF8B8 0C01E037 */ jal Actor_ProcessInitChain /* 0001C 809BF8BC 24A51698 */ addiu $a1, $a1, %lo(D_809C1698) ## $a1 = 809C1698 -/* 00020 809BF8C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00024 809BF8C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00020 809BF8C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00024 809BF8C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 809BF8C8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0002C 809BF8CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00030 809BF8D0 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s index bd235b7ea7..a4a18aa4af 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/EnBili_Update.s @@ -86,7 +86,7 @@ glabel EnBili_Update /* 014C8 809C0D68 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 014CC 809C0D6C 46803220 */ cvt.s.w $f8, $f6 /* 014D0 809C0D70 44072000 */ mfc1 $a3, $f4 -/* 014D4 809C0D74 0C00B92D */ jal func_8002E4B4 +/* 014D4 809C0D74 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 014D8 809C0D78 E7A80010 */ swc1 $f8, 0x0010($sp) /* 014DC 809C0D7C 260501D4 */ addiu $a1, $s0, 0x01D4 ## $a1 = 000001D4 /* 014E0 809C0D80 AFA50028 */ sw $a1, 0x0028($sp) @@ -122,7 +122,7 @@ glabel EnBili_Update ## CollisionCheck_setOC /* 01544 809C0DE4 8FA60028 */ lw $a2, 0x0028($sp) /* 01548 809C0DE8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0154C 809C0DEC 0C00B56E */ jal Actor_SetHeight +/* 0154C 809C0DEC 0C00B56E */ jal Actor_SetFocus /* 01550 809C0DF0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 01554 809C0DF4 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s b/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s index 338471e990..a57378e1a9 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bili/func_809BFBC4.s @@ -12,14 +12,14 @@ glabel func_809BFBC4 .L809BFBEC: /* 0034C 809BFBEC 8E0501DC */ lw $a1, 0x01DC($s0) ## 000001DC /* 00350 809BFBF0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00354 809BFBF4 0C00B6B0 */ jal func_8002DAC0 +/* 00354 809BFBF4 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00358 809BFBF8 24A50100 */ addiu $a1, $a1, 0x0100 ## $a1 = 00000100 /* 0035C 809BFBFC 8E0501DC */ lw $a1, 0x01DC($s0) ## 000001DC /* 00360 809BFC00 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 00364 809BFC04 00417821 */ addu $t7, $v0, $at /* 00368 809BFC08 A60F0032 */ sh $t7, 0x0032($s0) ## 00000032 /* 0036C 809BFC0C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00370 809BFC10 0C00B6CA */ jal func_8002DB28 +/* 00370 809BFC10 0C00B6CA */ jal Actor_WorldPitchTowardPoint /* 00374 809BFC14 24A50100 */ addiu $a1, $a1, 0x0100 ## $a1 = 00000100 /* 00378 809BFC18 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 /* 0037C 809BFC1C 44812000 */ mtc1 $at, $f4 ## $f4 = 5.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s index 46feee3d1f..fca7a5e528 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/EnBomChu_Update.s @@ -110,7 +110,7 @@ glabel EnBomChu_Update /* 00F3C 809C676C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 .L809C6770: /* 00F40 809C6770 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00F44 809C6774 0C00B56E */ jal Actor_SetHeight +/* 00F44 809C6774 0C00B56E */ jal Actor_SetFocus /* 00F48 809C6778 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00F4C 809C677C 8E09014C */ lw $t1, 0x014C($s0) ## 0000014C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s index 70b1bcc5cf..4ae510cf57 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Bom_Chu/func_809C5DDC.s @@ -39,7 +39,7 @@ glabel func_809C5DDC /* 00638 809C5E68 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 0063C 809C5E6C AE08002C */ sw $t0, 0x002C($s0) ## 0000002C /* 00640 809C5E70 AFA90014 */ sw $t1, 0x0014($sp) -/* 00644 809C5E74 0C00B92D */ jal func_8002E4B4 +/* 00644 809C5E74 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00648 809C5E78 E7B40010 */ swc1 $f20, 0x0010($sp) /* 0064C 809C5E7C 8FAA0034 */ lw $t2, 0x0034($sp) /* 00650 809C5E80 854B00B6 */ lh $t3, 0x00B6($t2) ## 000000B6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s index 5baf5e3251..a42b19297d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Clear_Tag/EnClearTag_Update.s @@ -573,7 +573,7 @@ glabel EnClearTag_Update /* 00E0C 809D43BC 0C00B5FB */ jal func_8002D7EC /* 00E10 809D43C0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00E14 809D43C4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 -/* 00E18 809D43C8 0C00B56E */ jal Actor_SetHeight +/* 00E18 809D43C8 0C00B56E */ jal Actor_SetFocus /* 00E1C 809D43CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00E20 809D43D0 240F0014 */ addiu $t7, $zero, 0x0014 ## $t7 = 00000014 @@ -610,7 +610,7 @@ glabel EnClearTag_Update /* 00E90 809D4440 240A0005 */ addiu $t2, $zero, 0x0005 ## $t2 = 00000005 /* 00E94 809D4444 AFAA0014 */ sw $t2, 0x0014($sp) /* 00E98 809D4448 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 00E9C 809D444C 0C00B92D */ jal func_8002E4B4 +/* 00E9C 809D444C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00EA0 809D4450 E7A80010 */ swc1 $f8, 0x0010($sp) /* 00EA4 809D4454 0C274EE0 */ jal func_809D3B80 /* 00EA8 809D4458 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 @@ -698,7 +698,7 @@ glabel EnClearTag_Update /* 00FCC 809D457C 02202825 */ or $a1, $s1, $zero ## $a1 = 00000000 /* 00FD0 809D4580 3C064248 */ lui $a2, 0x4248 ## $a2 = 42480000 /* 00FD4 809D4584 3C0742A0 */ lui $a3, 0x42A0 ## $a3 = 42A00000 -/* 00FD8 809D4588 0C00B92D */ jal func_8002E4B4 +/* 00FD8 809D4588 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00FDC 809D458C E7AA0010 */ swc1 $f10, 0x0010($sp) /* 00FE0 809D4590 962A0088 */ lhu $t2, 0x0088($s1) ## 00000088 /* 00FE4 809D4594 93AC00C7 */ lbu $t4, 0x00C7($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s index a1b10a8571..ae3dc0d7ea 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Cs/EnCs_Init.s @@ -13,8 +13,8 @@ glabel EnCs_Init /* 00148 809E19F8 10000056 */ beq $zero, $zero, .L809E1B54 /* 0014C 809E19FC 8FBF002C */ lw $ra, 0x002C($sp) .L809E1A00: -/* 00150 809E1A00 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00154 809E1A04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00150 809E1A00 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00154 809E1A04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00158 809E1A08 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0015C 809E1A0C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00160 809E1A10 0C00AC78 */ jal ActorShape_Init @@ -58,7 +58,7 @@ glabel EnCs_Init /* 001EC 809E1A9C 44070000 */ mfc1 $a3, $f0 /* 001F0 809E1AA0 8FA4004C */ lw $a0, 0x004C($sp) /* 001F4 809E1AA4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 001F8 809E1AA8 0C00B92D */ jal func_8002E4B4 +/* 001F8 809E1AA8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 001FC 809E1AAC E7A00010 */ swc1 $f0, 0x0010($sp) /* 00200 809E1AB0 3C03809E */ lui $v1, %hi(D_809E2918) ## $v1 = 809E0000 /* 00204 809E1AB4 24632918 */ addiu $v1, $v1, %lo(D_809E2918) ## $v1 = 809E2918 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s b/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s index be2f0ef4c5..4343d83d13 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Cs/func_809E1F20.s @@ -132,7 +132,7 @@ glabel func_809E1F20 /* 00844 809E20F4 44070000 */ mfc1 $a3, $f0 /* 00848 809E20F8 8FA4007C */ lw $a0, 0x007C($sp) /* 0084C 809E20FC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00850 809E2100 0C00B92D */ jal func_8002E4B4 +/* 00850 809E2100 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00854 809E2104 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00858 809E2108 8FBF004C */ lw $ra, 0x004C($sp) /* 0085C 809E210C D7B40020 */ ldc1 $f20, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s index ba400d28c4..ac0f2634ce 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/EnDaikuKakariko_Init.s @@ -74,8 +74,8 @@ glabel EnDaikuKakariko_Init /* 001B0 809E44D0 35AE0008 */ ori $t6, $t5, 0x0008 ## $t6 = 00000008 /* 001B4 809E44D4 A60E0200 */ sh $t6, 0x0200($s0) ## 00000200 .L809E44D8: -/* 001B8 809E44D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001BC 809E44DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001B8 809E44D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001BC 809E44DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001C0 809E44E0 0C00AC78 */ jal ActorShape_Init /* 001C4 809E44E4 3C074220 */ lui $a3, 0x4220 ## $a3 = 42200000 @@ -137,7 +137,7 @@ glabel EnDaikuKakariko_Init /* 00294 809E45B4 44070000 */ mfc1 $a3, $f0 /* 00298 809E45B8 8FA4004C */ lw $a0, 0x004C($sp) /* 0029C 809E45BC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 002A0 809E45C0 0C00B92D */ jal func_8002E4B4 +/* 002A0 809E45C0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 002A4 809E45C4 E7A00010 */ swc1 $f0, 0x0010($sp) /* 002A8 809E45C8 3C014040 */ lui $at, 0x4040 ## $at = 40400000 /* 002AC 809E45CC 44818000 */ mtc1 $at, $f16 ## $f16 = 3.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s index 866d39163e..64d02f9a83 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Daiku_Kakariko/func_809E4BC4.s @@ -186,7 +186,7 @@ glabel func_809E4BC4 /* 00B40 809E4E60 4407A000 */ mfc1 $a3, $f20 /* 00B44 809E4E64 24080004 */ addiu $t0, $zero, 0x0004 ## $t0 = 00000004 /* 00B48 809E4E68 AFA80014 */ sw $t0, 0x0014($sp) -/* 00B4C 809E4E6C 0C00B92D */ jal func_8002E4B4 +/* 00B4C 809E4E6C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00B50 809E4E70 E7B40010 */ swc1 $f20, 0x0010($sp) /* 00B54 809E4E74 10000017 */ beq $zero, $zero, .L809E4ED4 /* 00B58 809E4E78 00000000 */ nop @@ -209,7 +209,7 @@ glabel func_809E4BC4 /* 00B94 809E4EB4 4406A000 */ mfc1 $a2, $f20 /* 00B98 809E4EB8 4407A000 */ mfc1 $a3, $f20 /* 00B9C 809E4EBC E7B40010 */ swc1 $f20, 0x0010($sp) -/* 00BA0 809E4EC0 0C00B92D */ jal func_8002E4B4 +/* 00BA0 809E4EC0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00BA4 809E4EC4 AFAF0014 */ sw $t7, 0x0014($sp) /* 00BA8 809E4EC8 96190202 */ lhu $t9, 0x0202($s0) ## 00000202 /* 00BAC 809E4ECC 332EFFFE */ andi $t6, $t9, 0xFFFE ## $t6 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s index 8e4ce007e2..55ab2e3983 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Init.s @@ -8,8 +8,8 @@ glabel EnDekubaba_Init /* 00018 809E57E8 0C01E037 */ jal Actor_ProcessInitChain /* 0001C 809E57EC 24A59020 */ addiu $a1, $a1, %lo(D_809E9020) ## $a1 = 809E9020 -/* 00020 809E57F0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00024 809E57F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00020 809E57F0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00024 809E57F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 809E57F8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0002C 809E57FC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00030 809E5800 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s index 83a07a16be..1196648f6e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/EnDekubaba_Update.s @@ -41,7 +41,7 @@ glabel EnDekubaba_Update /* 02CB4 809E8484 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02CB8 809E8488 E7A00010 */ swc1 $f0, 0x0010($sp) /* 02CBC 809E848C 44074000 */ mfc1 $a3, $f8 -/* 02CC0 809E8490 0C00B92D */ jal func_8002E4B4 +/* 02CC0 809E8490 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02CC4 809E8494 00000000 */ nop /* 02CC8 809E8498 3C03809F */ lui $v1, %hi(func_809E80D8) ## $v1 = 809F0000 /* 02CCC 809E849C 10000013 */ beq $zero, $zero, .L809E84EC @@ -57,7 +57,7 @@ glabel EnDekubaba_Update /* 02CF0 809E84C0 44070000 */ mfc1 $a3, $f0 /* 02CF4 809E84C4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 02CF8 809E84C8 AFA3002C */ sw $v1, 0x002C($sp) -/* 02CFC 809E84CC 0C00B92D */ jal func_8002E4B4 +/* 02CFC 809E84CC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02D00 809E84D0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 02D04 809E84D4 8E0A0234 */ lw $t2, 0x0234($s0) ## 00000234 /* 02D08 809E84D8 8FA3002C */ lw $v1, 0x002C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s index bb7da8cd72..de15b64a7a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E645C.s @@ -22,7 +22,7 @@ glabel func_809E645C /* 00CD8 809E64A8 E4C400BC */ swc1 $f4, 0x00BC($a2) ## 000000BC /* 00CDC 809E64AC E4C0006C */ swc1 $f0, 0x006C($a2) ## 0000006C /* 00CE0 809E64B0 E4C00060 */ swc1 $f0, 0x0060($a2) ## 00000060 -/* 00CE4 809E64B4 0C00CDD2 */ jal Actor_ChangeType +/* 00CE4 809E64B4 0C00CDD2 */ jal Actor_ChangeCategory /* 00CE8 809E64B8 E4C600C4 */ swc1 $f6, 0x00C4($a2) ## 000000C4 /* 00CEC 809E64BC 8FA60018 */ lw $a2, 0x0018($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s index 46a3529b8c..886116dbac 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekubaba/func_809E858C.s @@ -78,7 +78,7 @@ glabel func_809E858C /* 02EA4 809E8674 AE2802C0 */ sw $t0, 0x02C0($s1) ## 000002C0 /* 02EA8 809E8678 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 02EAC 809E867C AC4A0004 */ sw $t2, 0x0004($v0) ## 00000004 -/* 02EB0 809E8680 0C00B56E */ jal Actor_SetHeight +/* 02EB0 809E8680 0C00B56E */ jal Actor_SetFocus /* 02EB4 809E8684 AC490000 */ sw $t1, 0x0000($v0) ## 00000000 /* 02EB8 809E8688 8FAB004C */ lw $t3, 0x004C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s index 0bb5887b2f..06baad4492 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Init.s @@ -20,8 +20,8 @@ glabel EnDekunuts_Init /* 00044 809E95A4 10000043 */ beq $zero, $zero, .L809E96B4 /* 00048 809E95A8 AE180004 */ sw $t8, 0x0004($s0) ## 00000004 .L809E95AC: -/* 0004C 809E95AC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00050 809E95B0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0004C 809E95AC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00050 809E95B0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00054 809E95B4 0C00AC78 */ jal ActorShape_Init /* 00058 809E95B8 3C07420C */ lui $a3, 0x420C ## $a3 = 420C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s index 786434ab36..547fba78a4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/EnDekunuts_Update.s @@ -30,7 +30,7 @@ glabel EnDekunuts_Update /* 01338 809EA898 3C0641A0 */ lui $a2, 0x41A0 ## $a2 = 41A00000 /* 0133C 809EA89C 46803220 */ cvt.s.w $f8, $f6 /* 01340 809EA8A0 44072000 */ mfc1 $a3, $f4 -/* 01344 809EA8A4 0C00B92D */ jal func_8002E4B4 +/* 01344 809EA8A4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01348 809EA8A8 E7A80010 */ swc1 $f8, 0x0010($sp) /* 0134C 809EA8AC 260502C8 */ addiu $a1, $s0, 0x02C8 ## $a1 = 000002C8 /* 01350 809EA8B0 AFA50028 */ sw $a1, 0x0028($sp) @@ -61,7 +61,7 @@ glabel EnDekunuts_Update /* 013A4 809EA904 15630006 */ bne $t3, $v1, .L809EA920 /* 013A8 809EA908 3C0C809F */ lui $t4, %hi(func_809EA0C4) ## $t4 = 809F0000 /* 013AC 809EA90C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 013B0 809EA910 0C00B56E */ jal Actor_SetHeight +/* 013B0 809EA910 0C00B56E */ jal Actor_SetFocus /* 013B4 809EA914 8E050164 */ lw $a1, 0x0164($s0) ## 00000164 /* 013B8 809EA918 10000018 */ beq $zero, $zero, .L809EA97C @@ -84,13 +84,13 @@ glabel EnDekunuts_Update /* 013F4 809EA954 46048183 */ div.s $f6, $f16, $f4 /* 013F8 809EA958 46060201 */ sub.s $f8, $f0, $f6 /* 013FC 809EA95C 44054000 */ mfc1 $a1, $f8 -/* 01400 809EA960 0C00B56E */ jal Actor_SetHeight +/* 01400 809EA960 0C00B56E */ jal Actor_SetFocus /* 01404 809EA964 00000000 */ nop /* 01408 809EA968 10000004 */ beq $zero, $zero, .L809EA97C /* 0140C 809EA96C 8FBF0024 */ lw $ra, 0x0024($sp) .L809EA970: -/* 01410 809EA970 0C00B56E */ jal Actor_SetHeight +/* 01410 809EA970 0C00B56E */ jal Actor_SetFocus /* 01414 809EA974 3C0541A0 */ lui $a1, 0x41A0 ## $a1 = 41A00000 .L809EA978: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s index dca6af31ec..caff6840be 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809E99D8.s @@ -21,7 +21,7 @@ glabel func_809E99D8 /* 004C4 809E9A24 10000006 */ beq $zero, $zero, .L809E9A40 /* 004C8 809E9A28 A6080032 */ sh $t0, 0x0032($s0) ## 00000032 .L809E9A2C: -/* 004CC 809E9A2C 0C00B69E */ jal func_8002DA78 +/* 004CC 809E9A2C 0C00B69E */ jal Actor_WorldYawTowardActor /* 004D0 809E9A30 8E0502D0 */ lw $a1, 0x02D0($s0) ## 000002D0 /* 004D4 809E9A34 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 004D8 809E9A38 00414821 */ addu $t1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s index 1bac1b0133..d663dbe4f9 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA240.s @@ -49,7 +49,7 @@ glabel func_809EA240 /* 00D84 809EA2E4 30480020 */ andi $t0, $v0, 0x0020 ## $t0 = 00000000 /* 00D88 809EA2E8 11000005 */ beq $t0, $zero, .L809EA300 /* 00D8C 809EA2EC 30490008 */ andi $t1, $v0, 0x0008 ## $t1 = 00000000 -/* 00D90 809EA2F0 0C00B6B0 */ jal func_8002DAC0 +/* 00D90 809EA2F0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00D94 809EA2F4 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 00D98 809EA2F8 10000035 */ beq $zero, $zero, .L809EA3D0 /* 00D9C 809EA2FC A6020198 */ sh $v0, 0x0198($s0) ## 00000198 @@ -64,7 +64,7 @@ glabel func_809EA240 /* 00DB8 809EA318 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00DBC 809EA31C 55600029 */ bnel $t3, $zero, .L809EA3C4 /* 00DC0 809EA320 860E008A */ lh $t6, 0x008A($s0) ## 0000008A -/* 00DC4 809EA324 0C00B6B0 */ jal func_8002DAC0 +/* 00DC4 809EA324 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 00DC8 809EA328 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 00DCC 809EA32C 8605008A */ lh $a1, 0x008A($s0) ## 0000008A /* 00DD0 809EA330 00451823 */ subu $v1, $v0, $a1 @@ -121,7 +121,7 @@ glabel func_809EA240 /* 00E80 809EA3E0 1500001D */ bne $t0, $zero, .L809EA458 /* 00E84 809EA3E4 A61900B6 */ sh $t9, 0x00B6($s0) ## 000000B6 /* 00E88 809EA3E8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00E8C 809EA3EC 0C00B6EC */ jal func_8002DBB0 +/* 00E8C 809EA3EC 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 00E90 809EA3F0 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 00E94 809EA3F4 3C0141A0 */ lui $at, 0x41A0 ## $at = 41A00000 /* 00E98 809EA3F8 44815000 */ mtc1 $at, $f10 ## $f10 = 20.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s index 096d15ddfc..6aaab0d8c5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dekunuts/func_809EA5B0.s @@ -79,7 +79,7 @@ glabel func_809EA5B0 /* 0117C 809EA6DC 26251C24 */ addiu $a1, $s1, 0x1C24 ## $a1 = 00001C24 /* 01180 809EA6E0 10C00003 */ beq $a2, $zero, .L809EA6F0 /* 01184 809EA6E4 00000000 */ nop -/* 01188 809EA6E8 0C00CDD2 */ jal Actor_ChangeType +/* 01188 809EA6E8 0C00CDD2 */ jal Actor_ChangeCategory /* 0118C 809EA6EC 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 .L809EA6F0: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s index 03b7295e32..3770cd772c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Init.s @@ -29,8 +29,8 @@ glabel EnDivingGame_Init /* 00010 809ED880 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00014 809ED884 AFBF002C */ sw $ra, 0x002C($sp) /* 00018 809ED888 AFA5003C */ sw $a1, 0x003C($sp) -/* 0001C 809ED88C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00020 809ED890 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0001C 809ED88C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00020 809ED890 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00024 809ED894 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00028 809ED898 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 0002C 809ED89C 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s index cac9c1f512..9b845e993b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Diving_Game/EnDivingGame_Update.s @@ -63,7 +63,7 @@ glabel EnDivingGame_Update /* 013F4 809EEC64 0320F809 */ jalr $ra, $t9 /* 013F8 809EEC68 00000000 */ nop /* 013FC 809EEC6C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01400 809EEC70 0C00B56E */ jal Actor_SetHeight +/* 01400 809EEC70 0C00B56E */ jal Actor_SetFocus /* 01404 809EEC74 3C0542A0 */ lui $a1, 0x42A0 ## $a1 = 42A00000 /* 01408 809EEC78 8FAB003C */ lw $t3, 0x003C($sp) @@ -129,7 +129,7 @@ glabel EnDivingGame_Update /* 014F4 809EED64 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 014F8 809EED68 3C0641A0 */ lui $a2, 0x41A0 ## $a2 = 41A00000 /* 014FC 809EED6C 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 -/* 01500 809EED70 0C00B92D */ jal func_8002E4B4 +/* 01500 809EED70 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01504 809EED74 E7B20010 */ swc1 $f18, 0x0010($sp) /* 01508 809EED78 2606034C */ addiu $a2, $s0, 0x034C ## $a2 = 0000034C /* 0150C 809EED7C 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000034C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s index ab11f08aa4..103d6b1225 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Init.s @@ -15,10 +15,10 @@ glabel EnDntJiji_Init /* 0000C 809F1AEC AFA5003C */ sw $a1, 0x003C($sp) /* 00010 809F1AF0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00014 809F1AF4 AFBF002C */ sw $ra, 0x002C($sp) -/* 00018 809F1AF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00018 809F1AF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0001C 809F1AFC 44050000 */ mfc1 $a1, $f0 /* 00020 809F1B00 44070000 */ mfc1 $a3, $f0 -/* 00024 809F1B04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 809F1B04 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 809F1B08 0C00AC78 */ jal ActorShape_Init /* 0002C 809F1B0C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s index 1c3c66f1fa..317d63dffa 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Jiji/EnDntJiji_Update.s @@ -82,7 +82,7 @@ glabel EnDntJiji_Update .L809F2D04: /* 01224 809F2D04 51E00004 */ beql $t7, $zero, .L809F2D18 /* 01228 809F2D08 8618024E */ lh $t8, 0x024E($s0) ## 0000024E -/* 0122C 809F2D0C 0C00B56E */ jal Actor_SetHeight +/* 0122C 809F2D0C 0C00B56E */ jal Actor_SetFocus /* 01230 809F2D10 3C0541F0 */ lui $a1, 0x41F0 ## $a1 = 41F00000 /* 01234 809F2D14 8618024E */ lh $t8, 0x024E($s0) ## 0000024E @@ -130,7 +130,7 @@ glabel EnDntJiji_Update /* 012C4 809F2DA4 AFB80014 */ sw $t8, 0x0014($sp) /* 012C8 809F2DA8 8FA4003C */ lw $a0, 0x003C($sp) /* 012CC 809F2DAC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 012D0 809F2DB0 0C00B92D */ jal func_8002E4B4 +/* 012D0 809F2DB0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 012D4 809F2DB4 E7A60010 */ swc1 $f6, 0x0010($sp) /* 012D8 809F2DB8 2606025C */ addiu $a2, $s0, 0x025C ## $a2 = 0000025C /* 012DC 809F2DBC 00C02825 */ or $a1, $a2, $zero ## $a1 = 0000025C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s index 00129f8655..c4e3280982 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/EnDntNomal_Update.s @@ -171,7 +171,7 @@ glabel L809F57B0 /* 02580 809F5840 AFA80014 */ sw $t0, 0x0014($sp) /* 02584 809F5844 8FA4003C */ lw $a0, 0x003C($sp) /* 02588 809F5848 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 0258C 809F584C 0C00B92D */ jal func_8002E4B4 +/* 0258C 809F584C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02590 809F5850 E7A60010 */ swc1 $f6, 0x0010($sp) /* 02594 809F5854 8609026A */ lh $t1, 0x026A($s0) ## 0000026A /* 02598 809F5858 26060314 */ addiu $a2, $s0, 0x0314 ## $a2 = 00000314 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s index 971097550c..ffa021d6dc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F3480.s @@ -22,14 +22,14 @@ glabel func_809F3480 /* 0020C 809F34CC 01194021 */ addu $t0, $t0, $t9 /* 00210 809F34D0 8D0817B4 */ lw $t0, 0x17B4($t0) ## 000117B4 /* 00214 809F34D4 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 00218 809F34D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00218 809F34D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0021C 809F34DC 01014821 */ addu $t1, $t0, $at /* 00220 809F34E0 3C018016 */ lui $at, %hi(gSegments+0x18) /* 00224 809F34E4 AC296FC0 */ sw $t1, %lo(gSegments+0x18)($at) /* 00228 809F34E8 820A0279 */ lb $t2, 0x0279($s0) ## 00000279 /* 0022C 809F34EC 44050000 */ mfc1 $a1, $f0 /* 00230 809F34F0 44070000 */ mfc1 $a3, $f0 -/* 00234 809F34F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00234 809F34F4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00238 809F34F8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0023C 809F34FC 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s index c491ae7d83..fc222b3dc4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dnt_Nomal/func_809F50EC.s @@ -42,7 +42,7 @@ glabel func_809F50EC /* 01EC4 809F5184 A600025A */ sh $zero, 0x025A($s0) ## 0000025A /* 01EC8 809F5188 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 01ECC 809F518C 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 -/* 01ED0 809F5190 0C00CDD2 */ jal Actor_ChangeType +/* 01ED0 809F5190 0C00CDD2 */ jal Actor_ChangeCategory /* 01ED4 809F5194 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 01ED8 809F5198 3C0B809F */ lui $t3, %hi(func_809F51B8) ## $t3 = 809F0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s index 1f22008a8d..1692b97aea 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/EnDodojr_Update.s @@ -32,7 +32,7 @@ glabel EnDodojr_Update /* 01940 809F7D00 468031A0 */ cvt.s.w $f6, $f6 /* 01944 809F7D04 44062000 */ mfc1 $a2, $f4 /* 01948 809F7D08 44073000 */ mfc1 $a3, $f6 -/* 0194C 809F7D0C 0C00B92D */ jal func_8002E4B4 +/* 0194C 809F7D0C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01950 809F7D10 00000000 */ nop /* 01954 809F7D14 8E020190 */ lw $v0, 0x0190($s0) ## 00000190 /* 01958 809F7D18 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -40,7 +40,7 @@ glabel EnDodojr_Update /* 0195C 809F7D1C 0040F809 */ jalr $ra, $v0 /* 01960 809F7D20 8FA5002C */ lw $a1, 0x002C($sp) /* 01964 809F7D24 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01968 809F7D28 0C00B56E */ jal Actor_SetHeight +/* 01968 809F7D28 0C00B56E */ jal Actor_SetFocus /* 0196C 809F7D2C 3C054120 */ lui $a1, 0x4120 ## $a1 = 41200000 /* 01970 809F7D30 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s index 44affbf7b7..f158391e09 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F70E8.s @@ -40,8 +40,8 @@ glabel func_809F70E8 /* 00DB8 809F7178 3C0D809F */ lui $t5, %hi(func_809F74C4) ## $t5 = 809F0000 /* 00DBC 809F717C 25AD74C4 */ addiu $t5, $t5, %lo(func_809F74C4) ## $t5 = 809F74C4 /* 00DC0 809F7180 15A20003 */ bne $t5, $v0, .L809F7190 -/* 00DC4 809F7184 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawFunc_Circle) -/* 00DC8 809F7188 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawFunc_Circle) +/* 00DC4 809F7184 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawCircle) +/* 00DC8 809F7188 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawCircle) /* 00DCC 809F718C AE0E00C0 */ sw $t6, 0x00C0($s0) ## 000000C0 .L809F7190: /* 00DD0 809F7190 0C27DC27 */ jal func_809F709C @@ -65,8 +65,8 @@ glabel func_809F70E8 /* 00E0C 809F71CC 250874C4 */ addiu $t0, $t0, %lo(func_809F74C4) ## $t0 = 809F74C4 /* 00E10 809F71D0 15020003 */ bne $t0, $v0, .L809F71E0 .L809F71D4: -/* 00E14 809F71D4 3C098003 */ lui $t1, %hi(ActorShadow_DrawFunc_Circle) -/* 00E18 809F71D8 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawFunc_Circle) +/* 00E14 809F71D4 3C098003 */ lui $t1, %hi(ActorShadow_DrawCircle) +/* 00E18 809F71D8 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawCircle) /* 00E1C 809F71DC AE0900C0 */ sw $t1, 0x00C0($s0) ## 000000C0 .L809F71E0: /* 00E20 809F71E0 920200B1 */ lbu $v0, 0x00B1($s0) ## 000000B1 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s index 51427ad4da..93c2695c48 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Dodojr/func_809F74C4.s @@ -36,8 +36,8 @@ glabel func_809F74C4 /* 01174 809F7534 8FA50034 */ lw $a1, 0x0034($sp) /* 01178 809F7538 C7A0002C */ lwc1 $f0, 0x002C($sp) /* 0117C 809F753C 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 -/* 01180 809F7540 3C188003 */ lui $t8, %hi(ActorShadow_DrawFunc_Circle) -/* 01184 809F7544 2718B5EC */ addiu $t8, %lo(ActorShadow_DrawFunc_Circle) +/* 01180 809F7540 3C188003 */ lui $t8, %hi(ActorShadow_DrawCircle) +/* 01184 809F7544 2718B5EC */ addiu $t8, %lo(ActorShadow_DrawCircle) /* 01188 809F7548 46040032 */ c.eq.s $f0, $f4 /* 0118C 809F754C 3C01809F */ lui $at, %hi(D_809F7F8C) ## $at = 809F0000 /* 01190 809F7550 4502000A */ bc1fl .L809F757C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s index 673130b119..32a0f09989 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Init.s @@ -4,8 +4,8 @@ glabel EnDu_Init /* 00584 809FE1B4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00588 809FE1B8 AFBF002C */ sw $ra, 0x002C($sp) /* 0058C 809FE1BC AFA5004C */ sw $a1, 0x004C($sp) -/* 00590 809FE1C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00594 809FE1C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00590 809FE1C0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00594 809FE1C4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00598 809FE1C8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0059C 809FE1CC 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 005A0 809FE1D0 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s index 235c083821..36de91f064 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Du/EnDu_Update.s @@ -69,7 +69,7 @@ glabel EnDu_Update /* 011E0 809FEE10 44070000 */ mfc1 $a3, $f0 /* 011E4 809FEE14 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 011E8 809FEE18 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 011EC 809FEE1C 0C00B92D */ jal func_8002E4B4 +/* 011EC 809FEE1C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 011F0 809FEE20 E7A00010 */ swc1 $f0, 0x0010($sp) /* 011F4 809FEE24 8E030190 */ lw $v1, 0x0190($s0) ## 00000190 /* 011F8 809FEE28 3C0980A0 */ lui $t1, %hi(func_809FE4A4) ## $t1 = 80A00000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s index a761370e90..1c3e739589 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Init.s @@ -9,8 +9,8 @@ glabel EnEiyer_Init /* 0001C 809FFFBC 0C01E037 */ jal Actor_ProcessInitChain /* 00020 809FFFC0 24A519C4 */ addiu $a1, $a1, %lo(D_80A019C4) ## $a1 = 80A019C4 -/* 00024 809FFFC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00028 809FFFC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 809FFFC4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00028 809FFFC8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 809FFFCC 262400B4 */ addiu $a0, $s1, 0x00B4 ## $a0 = 000000B4 /* 00030 809FFFD0 3C054416 */ lui $a1, 0x4416 ## $a1 = 44160000 /* 00034 809FFFD4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s index 9b6d2a6c9b..8309858c26 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/EnEiyer_Update.s @@ -60,7 +60,7 @@ glabel EnEiyer_Update /* 016A4 80A01644 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 016A8 80A01648 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 016AC 80A0164C 3C0741D8 */ lui $a3, 0x41D8 ## $a3 = 41D80000 -/* 016B0 80A01650 0C00B92D */ jal func_8002E4B4 +/* 016B0 80A01650 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 016B4 80A01654 E7A40010 */ swc1 $f4, 0x0010($sp) .L80A01658: /* 016B8 80A01658 8603001C */ lh $v1, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s index 5da515bd79..42d7e16394 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00950.s @@ -14,7 +14,7 @@ glabel func_80A00950 /* 009C8 80A00968 2484014C */ addiu $a0, $a0, 0x014C ## $a0 = 0000014C /* 009CC 80A0096C 26050008 */ addiu $a1, $s0, 0x0008 ## $a1 = 00000008 /* 009D0 80A00970 AFA50020 */ sw $a1, 0x0020($sp) -/* 009D4 80A00974 0C00B6EC */ jal func_8002DBB0 +/* 009D4 80A00974 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 009D8 80A00978 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 009DC 80A0097C 3C0142C8 */ lui $at, 0x42C8 ## $at = 42C80000 /* 009E0 80A00980 44812000 */ mtc1 $at, $f4 ## $f4 = 100.00 @@ -23,7 +23,7 @@ glabel func_80A00950 /* 009EC 80A0098C 00000000 */ nop /* 009F0 80A00990 45020008 */ bc1fl .L80A009B4 /* 009F4 80A00994 860F0032 */ lh $t7, 0x0032($s0) ## 00000032 -/* 009F8 80A00998 0C00B6B0 */ jal func_8002DAC0 +/* 009F8 80A00998 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 009FC 80A0099C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00A00 80A009A0 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 00A04 80A009A4 00417021 */ addu $t6, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s index 9c8da318be..b7000073fc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Eiyer/func_80A00E8C.s @@ -26,7 +26,7 @@ glabel func_80A00E8C /* 00F48 80A00EE8 46083280 */ add.s $f10, $f6, $f8 /* 00F4C 80A00EEC E7AA002C */ swc1 $f10, 0x002C($sp) /* 00F50 80A00EF0 C470002C */ lwc1 $f16, 0x002C($v1) ## 0000002C -/* 00F54 80A00EF4 0C00B6CA */ jal func_8002DB28 +/* 00F54 80A00EF4 0C00B6CA */ jal Actor_WorldPitchTowardPoint /* 00F58 80A00EF8 E7B00030 */ swc1 $f16, 0x0030($sp) /* 00F5C 80A00EFC 00022C00 */ sll $a1, $v0, 16 /* 00F60 80A00F00 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s b/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s index 577cfd2160..3b30b984d7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fhg_Fire/func_80A10220.s @@ -771,7 +771,7 @@ glabel func_80A10220 /* 01A2C 80A10C8C 44060000 */ mfc1 $a2, $f0 /* 01A30 80A10C90 44070000 */ mfc1 $a3, $f0 /* 01A34 80A10C94 AFA80014 */ sw $t0, 0x0014($sp) -/* 01A38 80A10C98 0C00B92D */ jal func_8002E4B4 +/* 01A38 80A10C98 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01A3C 80A10C9C E7A40010 */ swc1 $f4, 0x0010($sp) /* 01A40 80A10CA0 960C0088 */ lhu $t4, 0x0088($s0) ## 00000088 /* 01A44 80A10CA4 3C1880A1 */ lui $t8, %hi(D_80A11810) ## $t8 = 80A10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s index adc1512b59..bb87f12ffb 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Init.s @@ -47,11 +47,11 @@ glabel EnFireRock_Init /* 0000C 80A11C2C AFA5003C */ sw $a1, 0x003C($sp) /* 00010 80A11C30 8CAF1C44 */ lw $t7, 0x1C44($a1) ## 00001C44 /* 00014 80A11C34 24010005 */ addiu $at, $zero, 0x0005 ## $at = 00000005 -/* 00018 80A11C38 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00018 80A11C38 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0001C 80A11C3C AFAF0030 */ sw $t7, 0x0030($sp) /* 00020 80A11C40 8498001C */ lh $t8, 0x001C($a0) ## 0000001C /* 00024 80A11C44 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00028 80A11C48 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00028 80A11C48 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 80A11C4C A498018C */ sh $t8, 0x018C($a0) ## 0000018C /* 00030 80A11C50 8482018C */ lh $v0, 0x018C($a0) ## 0000018C /* 00034 80A11C54 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 @@ -141,7 +141,7 @@ glabel L80A11D14 /* 00150 80A11D70 A60B01D8 */ sh $t3, 0x01D8($s0) ## 000001D8 /* 00154 80A11D74 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00158 80A11D78 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 0015C 80A11D7C 0C00CDD2 */ jal Actor_ChangeType +/* 0015C 80A11D7C 0C00CDD2 */ jal Actor_ChangeCategory /* 00160 80A11D80 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00164 80A11D84 3C0D80A1 */ lui $t5, %hi(func_80A12730) ## $t5 = 80A10000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s index cc5e5dfc06..f86b735b4b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fire_Rock/EnFireRock_Update.s @@ -104,7 +104,7 @@ glabel EnFireRock_Update /* 00D48 80A12968 AFA80014 */ sw $t0, 0x0014($sp) /* 00D4C 80A1296C 8FA4004C */ lw $a0, 0x004C($sp) /* 00D50 80A12970 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00D54 80A12974 0C00B92D */ jal func_8002E4B4 +/* 00D54 80A12974 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00D58 80A12978 E7A60010 */ swc1 $f6, 0x0010($sp) /* 00D5C 80A1297C 8603018C */ lh $v1, 0x018C($s0) ## 0000018C /* 00D60 80A12980 8E090168 */ lw $t1, 0x0168($s0) ## 00000168 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s index 24de815b3f..b4d537f7e8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fish/EnFish_Init.s @@ -60,14 +60,14 @@ glabel EnFish_Init /* 002A8 80A15528 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 002AC 80A1552C 460A0402 */ mul.s $f16, $f0, $f10 /* 002B0 80A15530 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 -/* 002B4 80A15534 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 002B4 80A15534 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 002B8 80A15538 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 /* 002BC 80A1553C 4600848D */ trunc.w.s $f18, $f16 /* 002C0 80A15540 440D9000 */ mfc1 $t5, $f18 /* 002C4 80A15544 1440000B */ bne $v0, $zero, .L80A15574 /* 002C8 80A15548 A60D024E */ sh $t5, 0x024E($s0) ## 0000024E /* 002CC 80A1554C 8E0E0004 */ lw $t6, 0x0004($s0) ## 00000004 -/* 002D0 80A15550 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 002D0 80A15550 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 002D4 80A15554 3C074100 */ lui $a3, 0x4100 ## $a3 = 41000000 /* 002D8 80A15558 35CF0010 */ ori $t7, $t6, 0x0010 ## $t7 = 00000010 /* 002DC 80A1555C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s b/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s index f400e99350..18b8de3d3b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fish/func_80A16C68.s @@ -51,7 +51,7 @@ glabel func_80A16C68 /* 01A84 80A16D04 44802000 */ mtc1 $zero, $f4 ## $f4 = 0.00 /* 01A88 80A16D08 3C074080 */ lui $a3, 0x4080 ## $a3 = 40800000 /* 01A8C 80A16D0C AFA20014 */ sw $v0, 0x0014($sp) -/* 01A90 80A16D10 0C00B92D */ jal func_8002E4B4 +/* 01A90 80A16D10 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01A94 80A16D14 E7A40010 */ swc1 $f4, 0x0010($sp) .L80A16D18: /* 01A98 80A16D18 3C01428C */ lui $at, 0x428C ## $at = 428C0000 @@ -74,7 +74,7 @@ glabel func_80A16C68 /* 01AD4 80A16D54 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01AD8 80A16D58 46105482 */ mul.s $f18, $f10, $f16 /* 01ADC 80A16D5C 44059000 */ mfc1 $a1, $f18 -/* 01AE0 80A16D60 0C00B56E */ jal Actor_SetHeight +/* 01AE0 80A16D60 0C00B56E */ jal Actor_SetFocus /* 01AE4 80A16D64 00000000 */ nop /* 01AE8 80A16D68 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s index 6428967414..bcdf597c1d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Init.s @@ -70,7 +70,7 @@ glabel EnFr_Init /* 0015C 80A1AAFC 8FA40024 */ lw $a0, 0x0024($sp) /* 00160 80A1AB00 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00164 80A1AB04 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00168 80A1AB08 0C00CDD2 */ jal Actor_ChangeType +/* 00168 80A1AB08 0C00CDD2 */ jal Actor_ChangeCategory /* 0016C 80A1AB0C 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00170 80A1AB10 3C0A80A2 */ lui $t2, %hi(func_80A1BCB4) ## $t2 = 80A20000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s index 832275af58..79431da972 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fr/EnFr_Update.s @@ -131,7 +131,7 @@ glabel EnFr_Update /* 0046C 80A1AE0C C432D290 */ lwc1 $f18, %lo(D_80A1D290)($at) /* 00470 80A1AE10 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00474 80A1AE14 3C054120 */ lui $a1, 0x4120 ## $a1 = 41200000 -/* 00478 80A1AE18 0C00B56E */ jal Actor_SetHeight +/* 00478 80A1AE18 0C00B56E */ jal Actor_SetFocus /* 0047C 80A1AE1C E6120070 */ swc1 $f18, 0x0070($s0) ## 00000070 /* 00480 80A1AE20 3C014270 */ lui $at, 0x4270 ## $at = 42700000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s b/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s index 6419a95764..e32305d58c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fr/func_80A1BB34.s @@ -31,7 +31,7 @@ glabel func_80A1BB34 /* 011F0 80A1BB90 1000001C */ beq $zero, $zero, .L80A1BC04 /* 011F4 80A1BB94 8FBF001C */ lw $ra, 0x001C($sp) .L80A1BB98: -/* 011F8 80A1BB98 0C00B56E */ jal Actor_SetHeight +/* 011F8 80A1BB98 0C00B56E */ jal Actor_SetFocus /* 011FC 80A1BB9C 3C054120 */ lui $a1, 0x4120 ## $a1 = 41200000 /* 01200 80A1BBA0 8E190374 */ lw $t9, 0x0374($s0) ## 00000374 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s index eb814d5808..46ae6fae32 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/EnFz_Update.s @@ -24,7 +24,7 @@ glabel EnFz_Update /* 0134C 80A2110C 2448FFFF */ addiu $t0, $v0, 0xFFFF ## $t0 = FFFFFFFF /* 01350 80A21110 A2080263 */ sb $t0, 0x0263($s0) ## 00000263 .L80A21114: -/* 01354 80A21114 0C00B56E */ jal Actor_SetHeight +/* 01354 80A21114 0C00B56E */ jal Actor_SetFocus /* 01358 80A21118 3C054248 */ lui $a1, 0x4248 ## $a1 = 42480000 /* 0135C 80A2111C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -94,7 +94,7 @@ glabel EnFz_Update /* 01438 80A211F8 AFAD0014 */ sw $t5, 0x0014($sp) /* 0143C 80A211FC 44060000 */ mfc1 $a2, $f0 /* 01440 80A21200 44070000 */ mfc1 $a3, $f0 -/* 01444 80A21204 0C00B92D */ jal func_8002E4B4 +/* 01444 80A21204 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01448 80A21208 E7A00010 */ swc1 $f0, 0x0010($sp) .L80A2120C: /* 0144C 80A2120C 920E0260 */ lbu $t6, 0x0260($s0) ## 00000260 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s index c7a35900f5..e39040d3fa 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Fz/func_80A20CAC.s @@ -24,7 +24,7 @@ glabel func_80A20CAC /* 00F44 80A20D04 8FA40024 */ lw $a0, 0x0024($sp) /* 00F48 80A20D08 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00F4C 80A20D0C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 00F50 80A20D10 0C00CDD2 */ jal Actor_ChangeType +/* 00F50 80A20D10 0C00CDD2 */ jal Actor_ChangeCategory /* 00F54 80A20D14 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00F58 80A20D18 8FA40024 */ lw $a0, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s index 1e49cbf8fb..6084133643 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Gb/EnGb_Init.s @@ -116,8 +116,8 @@ glabel EnGb_Init /* 001C4 80A2F344 02002025 */ or $a0, $s0, $zero ## $a0 = 00000370 /* 001C8 80A2F348 4480C000 */ mtc1 $zero, $f24 ## $f24 = 0.00 -/* 001CC 80A2F34C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001D0 80A2F350 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001CC 80A2F34C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001D0 80A2F350 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001D4 80A2F354 4405C000 */ mfc1 $a1, $f24 /* 001D8 80A2F358 264400B4 */ addiu $a0, $s2, 0x00B4 ## $a0 = 000000B4 /* 001DC 80A2F35C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s index d6abfc7f9c..ef38c11a81 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Init.s @@ -14,8 +14,8 @@ glabel EnGe1_Init /* 00008 80A30978 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 0000C 80A3097C AFBF002C */ sw $ra, 0x002C($sp) /* 00010 80A30980 AFA50044 */ sw $a1, 0x0044($sp) -/* 00014 80A30984 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00018 80A30988 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00014 80A30984 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00018 80A30988 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0001C 80A3098C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00020 80A30990 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00024 80A30994 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s index 5b07a171af..0f88a732c5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge1/EnGe1_Update.s @@ -28,7 +28,7 @@ glabel EnGe1_Update /* 01958 80A322C8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 0195C 80A322CC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 01960 80A322D0 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 01964 80A322D4 0C00B92D */ jal func_8002E4B4 +/* 01964 80A322D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01968 80A322D8 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0196C 80A322DC 8E1902B8 */ lw $t9, 0x02B8($s0) ## 000002B8 /* 01970 80A322E0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s index 7c0b1fd0fb..9ef3a46683 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/EnGe2_Init.s @@ -14,8 +14,8 @@ glabel EnGe2_Init /* 000AC 80A32C7C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 000B0 80A32C80 AFBF002C */ sw $ra, 0x002C($sp) /* 000B4 80A32C84 AFA50044 */ sw $a1, 0x0044($sp) -/* 000B8 80A32C88 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 000BC 80A32C8C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 000B8 80A32C88 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 000BC 80A32C8C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 000C0 80A32C90 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 000C4 80A32C94 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 000C8 80A32C98 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s index 3e2192d0dd..d97b6aea06 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A33BE8.s @@ -24,7 +24,7 @@ glabel func_80A33BE8 /* 01068 80A33C38 8FA4003C */ lw $a0, 0x003C($sp) /* 0106C 80A33C3C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 01070 80A33C40 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 01074 80A33C44 0C00B92D */ jal func_8002E4B4 +/* 01074 80A33C44 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01078 80A33C48 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0107C 80A33C4C 960F02F4 */ lhu $t7, 0x02F4($s0) ## 000002F4 /* 01080 80A33C50 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s index cd31704b80..e5377aa32a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge2/func_80A3402C.s @@ -25,7 +25,7 @@ glabel func_80A3402C /* 014B0 80A34080 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 014B4 80A34084 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 014B8 80A34088 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 014BC 80A3408C 0C00B92D */ jal func_8002E4B4 +/* 014BC 80A3408C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 014C0 80A34090 E7A00010 */ swc1 $f0, 0x0010($sp) /* 014C4 80A34094 920F015D */ lbu $t7, 0x015D($s0) ## 0000015D /* 014C8 80A34098 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s index d417ffab9b..552b102ed8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge3/EnGe3_Init.s @@ -4,8 +4,8 @@ glabel EnGe3_Init /* 000AC 80A346CC 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 000B0 80A346D0 AFBF002C */ sw $ra, 0x002C($sp) /* 000B4 80A346D4 AFA50044 */ sw $a1, 0x0044($sp) -/* 000B8 80A346D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 000BC 80A346DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 000B8 80A346D8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 000BC 80A346DC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 000C0 80A346E0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 000C4 80A346E4 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 000C8 80A346E8 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s b/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s index e3c4558d20..8fc719d967 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ge3/func_80A34C40.s @@ -24,7 +24,7 @@ glabel func_80A34C40 /* 00670 80A34C90 8FA4003C */ lw $a0, 0x003C($sp) /* 00674 80A34C94 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00678 80A34C98 3C0741C8 */ lui $a3, 0x41C8 ## $a3 = 41C80000 -/* 0067C 80A34C9C 0C00B92D */ jal func_8002E4B4 +/* 0067C 80A34C9C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00680 80A34CA0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00684 80A34CA4 960F030C */ lhu $t7, 0x030C($s0) ## 0000030C /* 00688 80A34CA8 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s index bcbfe421ff..8751a281c8 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Init.s @@ -20,8 +20,8 @@ glabel EnGo_Init /* 01604 80A3FB74 AD0B0000 */ sw $t3, 0x0000($t0) ## FFFFFFE0 /* 01608 80A3FB78 8D2B0008 */ lw $t3, 0x0008($t1) ## 80A41BB0 /* 0160C 80A3FB7C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01610 80A3FB80 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 01614 80A3FB84 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 01610 80A3FB80 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 01614 80A3FB84 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 01618 80A3FB88 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 0161C 80A3FB8C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 01620 80A3FB90 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s index 9c508092de..64edf29025 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go/EnGo_Update.s @@ -53,7 +53,7 @@ glabel EnGo_Update /* 0298C 80A40EFC 44070000 */ mfc1 $a3, $f0 /* 02990 80A40F00 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02994 80A40F04 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02998 80A40F08 0C00B92D */ jal func_8002E4B4 +/* 02998 80A40F08 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0299C 80A40F0C E7A00010 */ swc1 $f0, 0x0010($sp) /* 029A0 80A40F10 0C28FC39 */ jal func_80A3F0E4 /* 029A4 80A40F14 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s index dc69f9528f..19d6a85ac7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Init.s @@ -41,8 +41,8 @@ glabel EnGo2_Init /* 037A4 80A464D4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 037A8 80A464D8 AFBF002C */ sw $ra, 0x002C($sp) /* 037AC 80A464DC AFA50044 */ sw $a1, 0x0044($sp) -/* 037B0 80A464E0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 037B4 80A464E4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 037B0 80A464E0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 037B4 80A464E4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 037B8 80A464E8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 037BC 80A464EC 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 037C0 80A464F0 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s index 081b843f76..7915020a64 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Go2/EnGo2_Update.s @@ -39,7 +39,7 @@ glabel EnGo2_Update /* 04BEC 80A4791C 46049182 */ mul.s $f6, $f18, $f4 /* 04BF0 80A47920 44065000 */ mfc1 $a2, $f10 /* 04BF4 80A47924 44073000 */ mfc1 $a3, $f6 -/* 04BF8 80A47928 0C00B92D */ jal func_8002E4B4 +/* 04BF8 80A47928 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04BFC 80A4792C 00000000 */ nop /* 04C00 80A47930 86190194 */ lh $t9, 0x0194($s0) ## 00000194 /* 04C04 80A47934 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s index 1732fc81a7..b4c0b0e870 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Init.s @@ -58,19 +58,19 @@ glabel EnGoma_Init /* 0005C 80A48F1C 28410064 */ slti $at, $v0, 0x0064 /* 00060 80A48F20 14200017 */ bne $at, $zero, .L80A48F80 /* 00064 80A48F24 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 -/* 00068 80A48F28 0C00CDD2 */ jal Actor_ChangeType +/* 00068 80A48F28 0C00CDD2 */ jal Actor_ChangeCategory /* 0006C 80A48F2C 24070009 */ addiu $a3, $zero, 0x0009 ## $a3 = 00000009 /* 00070 80A48F30 44801000 */ mtc1 $zero, $f2 ## $f2 = 0.00 /* 00074 80A48F34 3C1880A5 */ lui $t8, %hi(func_80A4B554) ## $t8 = 80A50000 /* 00078 80A48F38 2718B554 */ addiu $t8, $t8, %lo(func_80A4B554) ## $t8 = 80A4B554 /* 0007C 80A48F3C 24190003 */ addiu $t9, $zero, 0x0003 ## $t9 = 00000003 -/* 00080 80A48F40 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00080 80A48F40 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 00084 80A48F44 44051000 */ mfc1 $a1, $f2 /* 00088 80A48F48 44071000 */ mfc1 $a3, $f2 /* 0008C 80A48F4C AE1802B0 */ sw $t8, 0x02B0($s0) ## 000002B0 /* 00090 80A48F50 A61902B8 */ sh $t9, 0x02B8($s0) ## 000002B8 -/* 00094 80A48F54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00094 80A48F54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00098 80A48F58 0C00AC78 */ jal ActorShape_Init /* 0009C 80A48F5C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 @@ -147,8 +147,8 @@ glabel EnGoma_Init /* 001A0 80A49060 C42AB90C */ lwc1 $f10, %lo(D_80A4B90C)($at) /* 001A4 80A49064 46060202 */ mul.s $f8, $f0, $f6 /* 001A8 80A49068 44801000 */ mtc1 $zero, $f2 ## $f2 = 0.00 -/* 001AC 80A4906C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001B0 80A49070 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001AC 80A4906C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001B0 80A49070 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001B4 80A49074 44051000 */ mfc1 $a1, $f2 /* 001B8 80A49078 44071000 */ mfc1 $a3, $f2 /* 001BC 80A4907C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 @@ -160,8 +160,8 @@ glabel EnGoma_Init /* 001D0 80A49090 8FBF002C */ lw $ra, 0x002C($sp) .L80A49094: /* 001D4 80A49094 44801000 */ mtc1 $zero, $f2 ## $f2 = 0.00 -/* 001D8 80A49098 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 001DC 80A4909C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001D8 80A49098 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 001DC 80A4909C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001E0 80A490A0 44051000 */ mfc1 $a1, $f2 /* 001E4 80A490A4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s index 2855be1267..1830d81736 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Update.s @@ -106,12 +106,12 @@ glabel EnGoma_Update /* 01D08 80A4ABC8 AFAB0014 */ sw $t3, 0x0014($sp) /* 01D0C 80A4ABCC 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 01D10 80A4ABD0 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 01D14 80A4ABD4 0C00B92D */ jal func_8002E4B4 +/* 01D14 80A4ABD4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01D18 80A4ABD8 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 01D1C 80A4ABDC 0C292A59 */ jal func_80A4A964 /* 01D20 80A4ABE0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01D24 80A4ABE4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01D28 80A4ABE8 0C00B56E */ jal Actor_SetHeight +/* 01D28 80A4ABE8 0C00B56E */ jal Actor_SetFocus /* 01D2C 80A4ABEC 3C0541A0 */ lui $a1, 0x41A0 ## $a1 = 41A00000 /* 01D30 80A4ABF0 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s index 7fdc275f3e..44f59643cd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A49338.s @@ -16,7 +16,7 @@ glabel func_80A49338 /* 004A8 80A49368 3C074000 */ lui $a3, 0x4000 ## $a3 = 40000000 /* 004AC 80A4936C 8FAE0024 */ lw $t6, 0x0024($sp) /* 004B0 80A49370 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 004B4 80A49374 0C00B69E */ jal func_8002DA78 +/* 004B4 80A49374 0C00B69E */ jal Actor_WorldYawTowardActor /* 004B8 80A49378 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 004BC 80A4937C 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 004C0 80A49380 00412821 */ addu $a1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s index 48ceb78dad..ce6039369b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A498A8.s @@ -35,7 +35,7 @@ glabel func_80A498A8 /* 00A60 80A49920 A61802CC */ sh $t8, 0x02CC($s0) ## 000002CC /* 00A64 80A49924 8FB90034 */ lw $t9, 0x0034($sp) /* 00A68 80A49928 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00A6C 80A4992C 0C00B69E */ jal func_8002DA78 +/* 00A6C 80A4992C 0C00B69E */ jal Actor_WorldYawTowardActor /* 00A70 80A49930 8F251C44 */ lw $a1, 0x1C44($t9) ## 00001C44 /* 00A74 80A49934 A60200B6 */ sh $v0, 0x00B6($s0) ## 000000B6 /* 00A78 80A49938 860800B6 */ lh $t0, 0x00B6($s0) ## 000000B6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s index ad495350fa..0765a88cb5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A010.s @@ -14,7 +14,7 @@ glabel func_80A4A010 /* 01178 80A4A038 3C064000 */ lui $a2, 0x4000 ## $a2 = 40000000 /* 0117C 80A4A03C 8FAE002C */ lw $t6, 0x002C($sp) /* 01180 80A4A040 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01184 80A4A044 0C00B69E */ jal func_8002DA78 +/* 01184 80A4A044 0C00B69E */ jal Actor_WorldYawTowardActor /* 01188 80A4A048 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 0118C 80A4A04C 00022C00 */ sll $a1, $v0, 16 /* 01190 80A4A050 A7A20026 */ sh $v0, 0x0026($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s index 381e0307c0..c291ae2b6a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A2EC.s @@ -14,7 +14,7 @@ glabel func_80A4A2EC /* 01454 80A4A314 3C064000 */ lui $a2, 0x4000 ## $a2 = 40000000 /* 01458 80A4A318 8FAE0024 */ lw $t6, 0x0024($sp) /* 0145C 80A4A31C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01460 80A4A320 0C00B69E */ jal func_8002DA78 +/* 01460 80A4A320 0C00B69E */ jal Actor_WorldYawTowardActor /* 01464 80A4A324 8DC51C44 */ lw $a1, 0x1C44($t6) ## 00001C44 /* 01468 80A4A328 00022C00 */ sll $a1, $v0, 16 /* 0146C 80A4A32C 00052C03 */ sra $a1, $a1, 16 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s index 06988e1d8f..9da9381586 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4A608.s @@ -5,7 +5,7 @@ glabel func_80A4A608 /* 01754 80A4A614 AFB00014 */ sw $s0, 0x0014($sp) /* 01758 80A4A618 AFA5002C */ sw $a1, 0x002C($sp) /* 0175C 80A4A61C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 01760 80A4A620 0C00B69E */ jal func_8002DA78 +/* 01760 80A4A620 0C00B69E */ jal Actor_WorldYawTowardActor /* 01764 80A4A624 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 /* 01768 80A4A628 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6 /* 0176C 80A4A62C 8FB8002C */ lw $t8, 0x002C($sp) @@ -13,7 +13,7 @@ glabel func_80A4A608 /* 01774 80A4A634 004F8823 */ subu $s1, $v0, $t7 /* 01778 80A4A638 00118C00 */ sll $s1, $s1, 16 /* 0177C 80A4A63C 00118C03 */ sra $s1, $s1, 16 -/* 01780 80A4A640 0C00B6B8 */ jal func_8002DAE0 +/* 01780 80A4A640 0C00B6B8 */ jal Actor_WorldPitchTowardActor /* 01784 80A4A644 8F051C44 */ lw $a1, 0x1C44($t8) ## 00001C44 /* 01788 80A4A648 861900B4 */ lh $t9, 0x00B4($s0) ## 000000B4 /* 0178C 80A4A64C 2A211771 */ slti $at, $s1, 0x1771 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s index a88f4fb50d..988132d718 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/func_80A4B554.s @@ -48,7 +48,7 @@ glabel func_80A4B554 /* 02738 80A4B5F8 AFAE0014 */ sw $t6, 0x0014($sp) /* 0273C 80A4B5FC 8FA40074 */ lw $a0, 0x0074($sp) /* 02740 80A4B600 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02744 80A4B604 0C00B92D */ jal func_8002E4B4 +/* 02744 80A4B604 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02748 80A4B608 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 0274C 80A4B60C 3C0140A0 */ lui $at, 0x40A0 ## $at = 40A00000 /* 02750 80A4B610 44819000 */ mtc1 $at, $f18 ## $f18 = 5.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s index b2143ce482..e22e285c74 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/EnHorse_Init.s @@ -211,8 +211,8 @@ glabel EnHorse_Init /* 01088 80A5C378 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0108C 80A5C37C 3C01C060 */ lui $at, 0xC060 ## $at = C0600000 /* 01090 80A5C380 44815000 */ mtc1 $at, $f10 ## $f10 = -3.50 -/* 01094 80A5C384 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Squiggly) -/* 01098 80A5C388 24C6B644 */ addiu $a2, %lo(ActorShadow_DrawFunc_Squiggly) +/* 01094 80A5C384 3C068003 */ lui $a2, %hi(ActorShadow_DrawHorse) +/* 01098 80A5C388 24C6B644 */ addiu $a2, %lo(ActorShadow_DrawHorse) /* 0109C 80A5C38C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 010A0 80A5C390 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 010A4 80A5C394 3C0741A0 */ lui $a3, 0x41A0 ## $a3 = 41A00000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s index f55100aa9c..fb4defd7df 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5B61C.s @@ -175,12 +175,12 @@ glabel func_80A5B61C /* 00574 80A5B864 8FB90074 */ lw $t9, 0x0074($sp) .L80A5B868: /* 00578 80A5B868 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0057C 80A5B86C 0C00B6E3 */ jal func_8002DB8C +/* 0057C 80A5B86C 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 00580 80A5B870 8F251C44 */ lw $a1, 0x1C44($t9) ## 00001C44 /* 00584 80A5B874 8FB80074 */ lw $t8, 0x0074($sp) /* 00588 80A5B878 E7A00050 */ swc1 $f0, 0x0050($sp) /* 0058C 80A5B87C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00590 80A5B880 0C00B69E */ jal func_8002DA78 +/* 00590 80A5B880 0C00B69E */ jal Actor_WorldYawTowardActor /* 00594 80A5B884 8F051C44 */ lw $a1, 0x1C44($t8) ## 00001C44 /* 00598 80A5B888 3C014348 */ lui $at, 0x4348 ## $at = 43480000 /* 0059C 80A5B88C 44814000 */ mtc1 $at, $f8 ## $f8 = 200.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s index 7c4ca630f5..7eb627d830 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5BD94.s @@ -128,7 +128,7 @@ glabel func_80A5BD94 /* 00C6C 80A5BF5C AE480108 */ sw $t0, 0x0108($s2) ## 00000108 /* 00C70 80A5BF60 86090008 */ lh $t1, 0x0008($s0) ## 80A65F48 /* 00C74 80A5BF64 A6490032 */ sh $t1, 0x0032($s2) ## 00000032 -/* 00C78 80A5BF68 0C00B69E */ jal func_8002DA78 +/* 00C78 80A5BF68 0C00B69E */ jal Actor_WorldYawTowardActor /* 00C7C 80A5BF6C 8EC51C44 */ lw $a1, 0x1C44($s6) ## 00001C44 /* 00C80 80A5BF70 A64200B6 */ sh $v0, 0x00B6($s2) ## 000000B6 /* 00C84 80A5BF74 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s index a25ce552c0..bdccb4bd02 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F760.s @@ -4,7 +4,7 @@ glabel func_80A5F760 /* 04478 80A5F768 AFB00018 */ sw $s0, 0x0018($sp) /* 0447C 80A5F76C 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 /* 04480 80A5F770 24100004 */ addiu $s0, $zero, 0x0004 ## $s0 = 00000004 -/* 04484 80A5F774 0C00B6E3 */ jal func_8002DB8C +/* 04484 80A5F774 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 04488 80A5F778 AFA40020 */ sw $a0, 0x0020($sp) /* 0448C 80A5F77C 3C0143C8 */ lui $at, 0x43C8 ## $at = 43C80000 /* 04490 80A5F780 44811000 */ mtc1 $at, $f2 ## $f2 = 400.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s index 2ad44ae885..a5077ecfaf 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A5F890.s @@ -21,7 +21,7 @@ glabel func_80A5F890 /* 045B8 80A5F8A8 A5C005BE */ sh $zero, 0x05BE($t6) ## 801605BE /* 045BC 80A5F8AC 8FAF0044 */ lw $t7, 0x0044($sp) /* 045C0 80A5F8B0 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 045C4 80A5F8B4 0C00B6E3 */ jal func_8002DB8C +/* 045C4 80A5F8B4 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 045C8 80A5F8B8 8DE51C44 */ lw $a1, 0x1C44($t7) ## 00001C44 /* 045CC 80A5F8BC E7A0003C */ swc1 $f0, 0x003C($sp) /* 045D0 80A5F8C0 8E020370 */ lw $v0, 0x0370($s0) ## 00000370 @@ -46,7 +46,7 @@ glabel func_80A5F890 /* 04618 80A5F908 AE0801F0 */ sw $t0, 0x01F0($s0) ## 000001F0 /* 0461C 80A5F90C 8FA90044 */ lw $t1, 0x0044($sp) /* 04620 80A5F910 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 04624 80A5F914 0C00B69E */ jal func_8002DA78 +/* 04624 80A5F914 0C00B69E */ jal Actor_WorldYawTowardActor /* 04628 80A5F918 8D251C44 */ lw $a1, 0x1C44($t1) ## 00001C44 /* 0462C 80A5F91C A6020376 */ sh $v0, 0x0376($s0) ## 00000376 /* 04630 80A5F920 860A0376 */ lh $t2, 0x0376($s0) ## 00000376 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s index 366d15de92..67c2b50ac3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A61A28.s @@ -232,7 +232,7 @@ glabel func_80A61A28 /* 06A4C 80A61D3C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 06A50 80A61D40 84A300B6 */ lh $v1, 0x00B6($a1) ## 000000B6 /* 06A54 80A61D44 AFA6004C */ sw $a2, 0x004C($sp) -/* 06A58 80A61D48 0C00B69E */ jal func_8002DA78 +/* 06A58 80A61D48 0C00B69E */ jal Actor_WorldYawTowardActor /* 06A5C 80A61D4C A7A30046 */ sh $v1, 0x0046($sp) /* 06A60 80A61D50 87A30046 */ lh $v1, 0x0046($sp) /* 06A64 80A61D54 18400003 */ blez $v0, .L80A61D64 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s index 65b13e144c..79f5ca537d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A634A0.s @@ -51,7 +51,7 @@ glabel func_80A634A0 /* 08208 80A634F8 AFB80014 */ sw $t8, 0x0014($sp) /* 0820C 80A634FC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 08210 80A63500 3C07420C */ lui $a3, 0x420C ## $a3 = 420C0000 -/* 08214 80A63504 0C00B92D */ jal func_8002E4B4 +/* 08214 80A63504 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 08218 80A63508 E7A40010 */ swc1 $f4, 0x0010($sp) /* 0821C 80A6350C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 08220 80A63510 0C296CBC */ jal func_80A5B2F0 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s index 893b7f0864..e1c1c4dc6e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A6437C.s @@ -10,7 +10,7 @@ glabel func_80A6437C /* 09090 80A64380 AFBF001C */ sw $ra, 0x001C($sp) /* 09094 80A64384 AFB00018 */ sw $s0, 0x0018($sp) /* 09098 80A64388 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 0909C 80A6438C 0C00B69E */ jal func_8002DA78 +/* 0909C 80A6438C 0C00B69E */ jal Actor_WorldYawTowardActor /* 090A0 80A64390 8CA51C44 */ lw $a1, 0x1C44($a1) ## 00001C44 /* 090A4 80A64394 860E0032 */ lh $t6, 0x0032($s0) ## 00000032 /* 090A8 80A64398 004E2023 */ subu $a0, $v0, $t6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s index f8b895bc3d..d30d321d29 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Horse/func_80A64F14.s @@ -10,7 +10,7 @@ glabel func_80A64F14 /* 09C30 80A64F20 AFA50024 */ sw $a1, 0x0024($sp) /* 09C34 80A64F24 00C08025 */ or $s0, $a2, $zero ## $s0 = 00000000 /* 09C38 80A64F28 AFA40020 */ sw $a0, 0x0020($sp) -/* 09C3C 80A64F2C 0C00B6E3 */ jal func_8002DB8C +/* 09C3C 80A64F2C 0C00B6E3 */ jal Actor_WorldDistXZToActor /* 09C40 80A64F30 00C02825 */ or $a1, $a2, $zero ## $a1 = 00000000 /* 09C44 80A64F34 3C014296 */ lui $at, 0x4296 ## $at = 42960000 /* 09C48 80A64F38 44812000 */ mtc1 $at, $f4 ## $f4 = 75.00 @@ -35,7 +35,7 @@ glabel func_80A64F14 /* 09C90 80A64F80 1000001F */ beq $zero, $zero, .L80A65000 /* 09C94 80A64F84 00001025 */ or $v0, $zero, $zero ## $v0 = 00000000 .L80A64F88: -/* 09C98 80A64F88 0C00B69E */ jal func_8002DA78 +/* 09C98 80A64F88 0C00B69E */ jal Actor_WorldYawTowardActor /* 09C9C 80A64F8C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 09CA0 80A64F90 860E0032 */ lh $t6, 0x0032($s0) ## 00000032 /* 09CA4 80A64F94 004E2023 */ subu $a0, $v0, $t6 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s index 02411a581e..8ff5820fc3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Hy/EnHy_Update.s @@ -40,7 +40,7 @@ glabel EnHy_Update /* 020B8 80A71668 44070000 */ mfc1 $a3, $f0 /* 020BC 80A7166C 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 020C0 80A71670 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 020C4 80A71674 0C00B92D */ jal func_8002E4B4 +/* 020C4 80A71674 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 020C8 80A71678 E7A00010 */ swc1 $f0, 0x0010($sp) /* 020CC 80A7167C 8E020190 */ lw $v0, 0x0190($s0) ## 00000190 .L80A71680: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s index 966ef43de5..1567bf4b75 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Hy/func_80A70E34.s @@ -73,8 +73,8 @@ glabel func_80A70E34 /* 0193C 80A70EEC 0C0291BE */ jal SkelAnime_InitFlex /* 01940 80A70EF0 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 /* 01944 80A70EF4 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 01948 80A70EF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0194C 80A70EFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 01948 80A70EF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0194C 80A70EFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 01950 80A70F00 44050000 */ mfc1 $a1, $f0 /* 01954 80A70F04 44070000 */ mfc1 $a3, $f0 /* 01958 80A70F08 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s b/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s index 30440605e7..4ca67d8b67 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Jsjutan/func_80A89860.s @@ -99,7 +99,7 @@ glabel func_80A89860 /* 00228 80A899C8 E62A002C */ swc1 $f10, 0x002C($s1) ## 0000002C /* 0022C 80A899CC AFAB0014 */ sw $t3, 0x0014($sp) /* 00230 80A899D0 E7B40010 */ swc1 $f20, 0x0010($sp) -/* 00234 80A899D4 0C00B92D */ jal func_8002E4B4 +/* 00234 80A899D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00238 80A899D8 8FA40084 */ lw $a0, 0x0084($sp) /* 0023C 80A899DC C6300080 */ lwc1 $f16, 0x0080($s1) ## 00000080 /* 00240 80A899E0 27AD0068 */ addiu $t5, $sp, 0x0068 ## $t5 = FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s index 4716c3a5c3..b17d9e778c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ko/EnKo_Update.s @@ -60,7 +60,7 @@ glabel EnKo_Update /* 02A24 80A997D4 44060000 */ mfc1 $a2, $f0 /* 02A28 80A997D8 44070000 */ mfc1 $a3, $f0 /* 02A2C 80A997DC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02A30 80A997E0 0C00B92D */ jal func_8002E4B4 +/* 02A30 80A997E0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02A34 80A997E4 E7A00010 */ swc1 $f0, 0x0010($sp) /* 02A38 80A997E8 3C01BF80 */ lui $at, 0xBF80 ## $at = BF800000 /* 02A3C 80A997EC 44814000 */ mtc1 $at, $f8 ## $f8 = -1.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s b/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s index ab257c10b5..c9aa471b93 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ko/func_80A99048.s @@ -59,8 +59,8 @@ glabel func_80A99048 /* 02364 80A99114 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02368 80A99118 0C0291BE */ jal SkelAnime_InitFlex /* 0236C 80A9911C 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 02370 80A99120 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 02374 80A99124 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 02370 80A99120 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 02374 80A99124 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 02378 80A99128 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0237C 80A9912C 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 02380 80A99130 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s index e58e699dad..355a4265d1 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Init.s @@ -8,8 +8,8 @@ glabel EnMk_Init /* 00018 80AAC918 AFB00028 */ sw $s0, 0x0028($sp) /* 0001C 80AAC91C AFA50044 */ sw $a1, 0x0044($sp) /* 00020 80AAC920 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 -/* 00024 80AAC924 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00028 80AAC928 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 80AAC924 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00028 80AAC928 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 80AAC92C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00030 80AAC930 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00034 80AAC934 3C074210 */ lui $a3, 0x4210 ## $a3 = 42100000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s index 0f82559e65..ec7b6e6cab 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mk/EnMk_Update.s @@ -31,7 +31,7 @@ glabel EnMk_Update /* 00A24 80AAD324 44070000 */ mfc1 $a3, $f0 /* 00A28 80AAD328 8FA40054 */ lw $a0, 0x0054($sp) /* 00A2C 80AAD32C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A30 80AAD330 0C00B92D */ jal func_8002E4B4 +/* 00A30 80AAD330 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A34 80AAD334 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00A38 80AAD338 960F027E */ lhu $t7, 0x027E($s0) ## 0000027E /* 00A3C 80AAD33C 31F80002 */ andi $t8, $t7, 0x0002 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s index 6f5c0b422e..d3f539f59b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm/EnMm_Init.s @@ -8,8 +8,8 @@ glabel EnMm_Init /* 00138 80AAD8A8 0C01E037 */ jal Actor_ProcessInitChain /* 0013C 80AAD8AC 24A5EBE8 */ addiu $a1, $a1, %lo(D_80AAEBE8) ## $a1 = 80AAEBE8 -/* 00140 80AAD8B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00144 80AAD8B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00140 80AAD8B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00144 80AAD8B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00148 80AAD8B8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0014C 80AAD8BC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00150 80AAD8C0 0C00AC78 */ jal ActorShape_Init @@ -53,7 +53,7 @@ glabel EnMm_Init /* 001DC 80AAD94C 44070000 */ mfc1 $a3, $f0 /* 001E0 80AAD950 8FA4004C */ lw $a0, 0x004C($sp) /* 001E4 80AAD954 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 001E8 80AAD958 0C00B92D */ jal func_8002E4B4 +/* 001E8 80AAD958 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 001EC 80AAD95C E7A00010 */ swc1 $f0, 0x0010($sp) /* 001F0 80AAD960 3C0380AB */ lui $v1, %hi(D_80AAEB38) ## $v1 = 80AB0000 /* 001F4 80AAD964 2463EB38 */ addiu $v1, $v1, %lo(D_80AAEB38) ## $v1 = 80AAEB38 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s b/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s index 44b8afca0b..10a23e8c00 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm/func_80AADEF0.s @@ -220,7 +220,7 @@ glabel func_80AADEF0 /* 00A74 80AAE1E4 AFAD0014 */ sw $t5, 0x0014($sp) /* 00A78 80AAE1E8 8FA4007C */ lw $a0, 0x007C($sp) /* 00A7C 80AAE1EC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A80 80AAE1F0 0C00B92D */ jal func_8002E4B4 +/* 00A80 80AAE1F0 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A84 80AAE1F4 E7B40010 */ swc1 $f20, 0x0010($sp) /* 00A88 80AAE1F8 8FBF0044 */ lw $ra, 0x0044($sp) /* 00A8C 80AAE1FC D7B40020 */ ldc1 $f20, 0x0020($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s index b72e51edb6..3ba639803b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Init.s @@ -14,8 +14,8 @@ glabel EnMm2_Init /* 00204 80AAF054 0C01E037 */ jal Actor_ProcessInitChain /* 00208 80AAF058 24A5FB5C */ addiu $a1, $a1, %lo(D_80AAFB5C) ## $a1 = 80AAFB5C -/* 0020C 80AAF05C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00210 80AAF060 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0020C 80AAF05C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00210 80AAF060 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00214 80AAF064 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00218 80AAF068 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0021C 80AAF06C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s index 756245f985..1b9045ac89 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mm2/EnMm2_Update.s @@ -83,7 +83,7 @@ glabel EnMm2_Update /* 00A60 80AAF8B0 44070000 */ mfc1 $a3, $f0 /* 00A64 80AAF8B4 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00A68 80AAF8B8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A6C 80AAF8BC 0C00B92D */ jal func_8002E4B4 +/* 00A6C 80AAF8BC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A70 80AAF8C0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00A74 80AAF8C4 8FBF002C */ lw $ra, 0x002C($sp) /* 00A78 80AAF8C8 8FB00024 */ lw $s0, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s index 9dcabfd189..a8350f6f97 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Init.s @@ -4,8 +4,8 @@ glabel EnMu_Init /* 00214 80AB0634 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00218 80AB0638 AFBF002C */ sw $ra, 0x002C($sp) /* 0021C 80AB063C AFA50044 */ sw $a1, 0x0044($sp) -/* 00220 80AB0640 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00224 80AB0644 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00220 80AB0640 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00224 80AB0644 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00228 80AB0648 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0022C 80AB064C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00230 80AB0650 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s index 6f9879194b..ea45eb6a94 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Mu/EnMu_Update.s @@ -42,7 +42,7 @@ glabel EnMu_Update /* 003D4 80AB07F4 44070000 */ mfc1 $a3, $f0 /* 003D8 80AB07F8 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 003DC 80AB07FC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 003E0 80AB0800 0C00B92D */ jal func_8002E4B4 +/* 003E0 80AB0800 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003E4 80AB0804 E7A00010 */ swc1 $f0, 0x0010($sp) /* 003E8 80AB0808 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 003EC 80AB080C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s index d04e9a66fc..ece5183f78 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Init.s @@ -43,8 +43,8 @@ glabel EnNy_Init /* 00058 80ABCC08 8FA40034 */ lw $a0, 0x0034($sp) /* 0005C 80ABCC0C 0C017014 */ jal Collider_SetJntSph /* 00060 80ABCC10 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00064 80ABCC14 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00068 80ABCC18 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00064 80ABCC14 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00068 80ABCC18 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0006C 80ABCC1C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00070 80ABCC20 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00074 80ABCC24 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s index 312d9831bc..9f8cb36d29 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/EnNy_Update.s @@ -27,7 +27,7 @@ glabel EnNy_Update /* 0093C 80ABD4EC A49801CA */ sh $t8, 0x01CA($a0) ## 000001CA .L80ABD4F0: /* 00940 80ABD4F0 02402025 */ or $a0, $s2, $zero ## $a0 = 00000000 -/* 00944 80ABD4F4 0C00B56E */ jal Actor_SetHeight +/* 00944 80ABD4F4 0C00B56E */ jal Actor_SetFocus /* 00948 80ABD4F8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0094C 80ABD4FC 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 @@ -97,7 +97,7 @@ glabel EnNy_Update /* 00A40 80ABD5F0 AFAE0014 */ sw $t6, 0x0014($sp) /* 00A44 80ABD5F4 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00A48 80ABD5F8 02402825 */ or $a1, $s2, $zero ## $a1 = 00000000 -/* 00A4C 80ABD5FC 0C00B92D */ jal func_8002E4B4 +/* 00A4C 80ABD5FC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A50 80ABD600 E7A60010 */ swc1 $f6, 0x0010($sp) /* 00A54 80ABD604 C6480028 */ lwc1 $f8, 0x0028($s2) ## 00000028 /* 00A58 80ABD608 E65601F0 */ swc1 $f22, 0x01F0($s2) ## 000001F0 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s b/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s index 02c00b75b4..85faf285f4 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ny/func_80ABDBF8.s @@ -13,7 +13,7 @@ glabel func_80ABDBF8 /* 01074 80ABDC24 E7A8003C */ swc1 $f8, 0x003C($sp) /* 01078 80ABDC28 848E01C8 */ lh $t6, 0x01C8($a0) ## 000001C8 /* 0107C 80ABDC2C 25CF0001 */ addiu $t7, $t6, 0x0001 ## $t7 = 00000001 -/* 01080 80ABDC30 0C00B56E */ jal Actor_SetHeight +/* 01080 80ABDC30 0C00B56E */ jal Actor_SetFocus /* 01084 80ABDC34 A48F01C8 */ sh $t7, 0x01C8($a0) ## 000001C8 /* 01088 80ABDC38 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 @@ -45,7 +45,7 @@ glabel func_80ABDBF8 /* 010EC 80ABDC9C E6100028 */ swc1 $f16, 0x0028($s0) ## 00000028 /* 010F0 80ABDCA0 E7A00034 */ swc1 $f0, 0x0034($sp) /* 010F4 80ABDCA4 AFB80014 */ sw $t8, 0x0014($sp) -/* 010F8 80ABDCA8 0C00B92D */ jal func_8002E4B4 +/* 010F8 80ABDCA8 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 010FC 80ABDCAC E7B20010 */ swc1 $f18, 0x0010($sp) /* 01100 80ABDCB0 C7A00034 */ lwc1 $f0, 0x0034($sp) /* 01104 80ABDCB4 C6040028 */ lwc1 $f4, 0x0028($s0) ## 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s index 5eb84c8c06..a32a64b70e 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC7094.s @@ -80,9 +80,9 @@ glabel func_80AC7094 /* 044C8 80AC7168 E6080024 */ swc1 $f8, 0x0024($s0) ## 00000024 /* 044CC 80AC716C C4500004 */ lwc1 $f16, 0x0004($v0) ## 00000004 /* 044D0 80AC7170 012A5821 */ addu $t3, $t1, $t2 -/* 044D4 80AC7174 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 044D4 80AC7174 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 044D8 80AC7178 46105480 */ add.s $f18, $f10, $f16 -/* 044DC 80AC717C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 044DC 80AC717C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 044E0 80AC7180 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 044E4 80AC7184 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 044E8 80AC7188 E6120028 */ swc1 $f18, 0x0028($s0) ## 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s index 169cc63bb7..66f3015bdd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Ossan/func_80AC73B4.s @@ -46,10 +46,10 @@ glabel func_80AC73B4 /* 047B8 80AC7458 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 047BC 80AC745C 3C0641D0 */ lui $a2, 0x41D0 ## $a2 = 41D00000 /* 047C0 80AC7460 3C074120 */ lui $a3, 0x4120 ## $a3 = 41200000 -/* 047C4 80AC7464 0C00B92D */ jal func_8002E4B4 +/* 047C4 80AC7464 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 047C8 80AC7468 E7A40010 */ swc1 $f4, 0x0010($sp) /* 047CC 80AC746C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 047D0 80AC7470 0C00B56E */ jal Actor_SetHeight +/* 047D0 80AC7470 0C00B56E */ jal Actor_SetFocus /* 047D4 80AC7474 3C0542B4 */ lui $a1, 0x42B4 ## $a1 = 42B40000 /* 047D8 80AC7478 860A001C */ lh $t2, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s index 2fd7ce5413..ae86c113a2 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Owl/EnOwl_Update.s @@ -43,7 +43,7 @@ glabel EnOwl_Update /* 027D0 80ACC6F0 44070000 */ mfc1 $a3, $f0 /* 027D4 80ACC6F4 8FA40044 */ lw $a0, 0x0044($sp) /* 027D8 80ACC6F8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 027DC 80ACC6FC 0C00B92D */ jal func_8002E4B4 +/* 027DC 80ACC6FC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 027E0 80ACC700 E7A00010 */ swc1 $f0, 0x0010($sp) /* 027E4 80ACC704 8E190410 */ lw $t9, 0x0410($s0) ## 00000410 /* 027E8 80ACC708 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s index dfbf270492..768ca36983 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Init.s @@ -37,8 +37,8 @@ glabel EnPeehat_Init /* 00068 80ACF508 0C02915F */ jal SkelAnime_Init /* 0006C 80ACF50C 2605014C */ addiu $a1, $s0, 0x014C ## $a1 = 0000014C -/* 00070 80ACF510 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00074 80ACF514 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00070 80ACF510 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00074 80ACF514 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00078 80ACF518 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0007C 80ACF51C 3C0542C8 */ lui $a1, 0x42C8 ## $a1 = 42C80000 /* 00080 80ACF520 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s index a0138112cc..b6654e41de 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Peehat/EnPeehat_Update.s @@ -49,7 +49,7 @@ glabel EnPeehat_Update /* 029C0 80AD1E60 02802025 */ or $a0, $s4, $zero ## $a0 = 00000000 /* 029C4 80AD1E64 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 /* 029C8 80AD1E68 3C0641C8 */ lui $a2, 0x41C8 ## $a2 = 41C80000 -/* 029CC 80AD1E6C 0C00B92D */ jal func_8002E4B4 +/* 029CC 80AD1E6C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 029D0 80AD1E70 E7A00010 */ swc1 $f0, 0x0010($sp) /* 029D4 80AD1E74 8E7902B8 */ lw $t9, 0x02B8($s3) ## 000002B8 .L80AD1E78: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s index a23cbfd469..496f2ea3ff 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Init.s @@ -16,8 +16,8 @@ glabel EnSa_Init /* 00C60 80AF61C0 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 /* 00C64 80AF61C4 AFBF003C */ sw $ra, 0x003C($sp) /* 00C68 80AF61C8 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 -/* 00C6C 80AF61CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00C70 80AF61D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00C6C 80AF61CC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00C70 80AF61D0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00C74 80AF61D4 AFA40044 */ sw $a0, 0x0044($sp) /* 00C78 80AF61D8 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00C7C 80AF61DC 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s index 1cc9097976..6820b585ee 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sa/EnSa_Update.s @@ -87,7 +87,7 @@ glabel EnSa_Update /* 017B0 80AF6D10 AFAA0014 */ sw $t2, 0x0014($sp) /* 017B4 80AF6D14 44060000 */ mfc1 $a2, $f0 /* 017B8 80AF6D18 44070000 */ mfc1 $a3, $f0 -/* 017BC 80AF6D1C 0C00B92D */ jal func_8002E4B4 +/* 017BC 80AF6D1C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 017C0 80AF6D20 E7A00010 */ swc1 $f0, 0x0010($sp) .L80AF6D24: /* 017C4 80AF6D24 0C2BD827 */ jal func_80AF609C diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s index c887128ac3..732575175f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Init.s @@ -19,11 +19,11 @@ glabel EnSkb_Init /* 001D8 80AFCB78 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 001DC 80AFCB7C 3C0E80B0 */ lui $t6, %hi(D_80AFE078) ## $t6 = 80B00000 /* 001E0 80AFCB80 25CEE078 */ addiu $t6, $t6, %lo(D_80AFE078) ## $t6 = 80AFE078 -/* 001E4 80AFCB84 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 001E4 80AFCB84 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 001E8 80AFCB88 44050000 */ mfc1 $a1, $f0 /* 001EC 80AFCB8C 44070000 */ mfc1 $a3, $f0 /* 001F0 80AFCB90 AE0E0098 */ sw $t6, 0x0098($s0) ## 00000098 -/* 001F4 80AFCB94 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 001F4 80AFCB94 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 001F8 80AFCB98 0C00AC78 */ jal ActorShape_Init /* 001FC 80AFCB9C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s index 4df5bdfb7e..f9ef234c22 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skb/EnSkb_Update.s @@ -22,7 +22,7 @@ glabel EnSkb_Update /* 012A8 80AFDC48 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 012AC 80AFDC4C 3C064170 */ lui $a2, 0x4170 ## $a2 = 41700000 /* 012B0 80AFDC50 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 012B4 80AFDC54 0C00B92D */ jal func_8002E4B4 +/* 012B4 80AFDC54 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 012B8 80AFDC58 E7A40010 */ swc1 $f4, 0x0010($sp) /* 012BC 80AFDC5C 8E190284 */ lw $t9, 0x0284($s0) ## 00000284 /* 012C0 80AFDC60 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s index 4e45bbbec4..3265db1dff 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Init.s @@ -41,7 +41,7 @@ glabel EnSkj_Init /* 00290 80AFE540 8FA40054 */ lw $a0, 0x0054($sp) /* 00294 80AFE544 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00298 80AFE548 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 0029C 80AFE54C 0C00CDD2 */ jal Actor_ChangeType +/* 0029C 80AFE54C 0C00CDD2 */ jal Actor_ChangeCategory /* 002A0 80AFE550 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 002A4 80AFE554 100000D7 */ beq $zero, $zero, .L80AFE8B4 @@ -64,7 +64,7 @@ glabel EnSkj_Init /* 002E4 80AFE594 8FA40054 */ lw $a0, 0x0054($sp) /* 002E8 80AFE598 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 002EC 80AFE59C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 002F0 80AFE5A0 0C00CDD2 */ jal Actor_ChangeType +/* 002F0 80AFE5A0 0C00CDD2 */ jal Actor_ChangeCategory /* 002F4 80AFE5A4 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 002F8 80AFE5A8 3C0180B0 */ lui $at, %hi(D_80B018F8) ## $at = 80B00000 @@ -132,7 +132,7 @@ glabel EnSkj_Init /* 003E4 80AFE694 AE0F0004 */ sw $t7, 0x0004($s0) ## 00000004 /* 003E8 80AFE698 A7A3004E */ sh $v1, 0x004E($sp) /* 003EC 80AFE69C 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 003F0 80AFE6A0 0C00CDD2 */ jal Actor_ChangeType +/* 003F0 80AFE6A0 0C00CDD2 */ jal Actor_ChangeCategory /* 003F4 80AFE6A4 24070004 */ addiu $a3, $zero, 0x0004 ## $a3 = 00000004 /* 003F8 80AFE6A8 87A3004E */ lh $v1, 0x004E($sp) @@ -194,8 +194,8 @@ glabel EnSkj_Init /* 004C0 80AFE770 8FA40054 */ lw $a0, 0x0054($sp) /* 004C4 80AFE774 0C017114 */ jal Collider_SetCylinderType1 /* 004C8 80AFE778 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 004CC 80AFE77C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 004D0 80AFE780 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 004CC 80AFE77C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 004D0 80AFE780 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 004D4 80AFE784 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 004D8 80AFE788 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 004DC 80AFE78C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s index 53f42ef5da..620628f1d0 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Skj/EnSkj_Update.s @@ -61,7 +61,7 @@ glabel EnSkj_Update /* 025A8 80B00858 1000003E */ beq $zero, $zero, .L80B00954 /* 025AC 80B0085C 8FBF0024 */ lw $ra, 0x0024($sp) .L80B00860: -/* 025B0 80B00860 0C00B56E */ jal Actor_SetHeight +/* 025B0 80B00860 0C00B56E */ jal Actor_SetFocus /* 025B4 80B00864 3C0541F0 */ lui $a1, 0x41F0 ## $a1 = 41F00000 /* 025B8 80B00868 3C053C23 */ lui $a1, 0x3C23 ## $a1 = 3C230000 @@ -129,7 +129,7 @@ glabel EnSkj_Update /* 0268C 80B0093C 44070000 */ mfc1 $a3, $f0 /* 02690 80B00940 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 02694 80B00944 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02698 80B00948 0C00B92D */ jal func_8002E4B4 +/* 02698 80B00948 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0269C 80B0094C E7A00010 */ swc1 $f0, 0x0010($sp) /* 026A0 80B00950 8FBF0024 */ lw $ra, 0x0024($sp) .L80B00954: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s index 9a7e64be03..1cde33369a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B076B0.s @@ -4,8 +4,8 @@ glabel func_80B076B0 /* 00178 80B076B8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 0017C 80B076BC AFBF001C */ sw $ra, 0x001C($sp) /* 00180 80B076C0 AFA5002C */ sw $a1, 0x002C($sp) -/* 00184 80B076C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00188 80B076C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00184 80B076C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00188 80B076C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0018C 80B076CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00190 80B076D0 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00194 80B076D4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s index 1eba587af6..ba6b41062b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sth/func_80B07EE0.s @@ -26,7 +26,7 @@ glabel func_80B07EE0 /* 009F4 80B07F34 44070000 */ mfc1 $a3, $f0 /* 009F8 80B07F38 8FA4003C */ lw $a0, 0x003C($sp) /* 009FC 80B07F3C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00A00 80B07F40 0C00B92D */ jal func_8002E4B4 +/* 00A00 80B07F40 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00A04 80B07F44 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00A08 80B07F48 0C02927F */ jal SkelAnime_Update diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s index c6c91b1459..0b1d085911 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/EnSw_Init.s @@ -277,7 +277,7 @@ glabel EnSw_Init .L80B0C8E8: /* 00B38 80B0C8E8 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00B3C 80B0C8EC 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 -/* 00B40 80B0C8F0 0C00CDD2 */ jal Actor_ChangeType +/* 00B40 80B0C8F0 0C00CDD2 */ jal Actor_ChangeCategory /* 00B44 80B0C8F4 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 /* 00B48 80B0C8F8 240F001F */ addiu $t7, $zero, 0x001F ## $t7 = 0000001F diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s index 2a7806e824..346e155579 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0C9F0.s @@ -69,8 +69,8 @@ glabel func_80B0C9F0 /* 00D10 80B0CAC0 0C00CB1F */ jal func_80032C7C /* 00D14 80B0CAC4 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00D18 80B0CAC8 860F001C */ lh $t7, 0x001C($s0) ## 0000001C -/* 00D1C 80B0CACC 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawFunc_Circle) -/* 00D20 80B0CAD0 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawFunc_Circle) +/* 00D1C 80B0CACC 3C0E8003 */ lui $t6, %hi(ActorShadow_DrawCircle) +/* 00D20 80B0CAD0 25CEB5EC */ addiu $t6, %lo(ActorShadow_DrawCircle) /* 00D24 80B0CAD4 31F8E000 */ andi $t8, $t7, 0xE000 ## $t8 = 00000000 /* 00D28 80B0CAD8 0018CB43 */ sra $t9, $t8, 13 /* 00D2C 80B0CADC 1320001D */ beq $t9, $zero, .L80B0CB54 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s index 89297bf63e..e0a0493dbf 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Sw/func_80B0DB00.s @@ -21,7 +21,7 @@ glabel func_80B0DB00 /* 01D98 80B0DB48 AFA80014 */ sw $t0, 0x0014($sp) /* 01D9C 80B0DB4C 8FA4003C */ lw $a0, 0x003C($sp) /* 01DA0 80B0DB50 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 01DA4 80B0DB54 0C00B92D */ jal func_8002E4B4 +/* 01DA4 80B0DB54 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01DA8 80B0DB58 E7A40010 */ swc1 $f4, 0x0010($sp) /* 01DAC 80B0DB5C 96030088 */ lhu $v1, 0x0088($s0) ## 00000088 /* 01DB0 80B0DB60 30690001 */ andi $t1, $v1, 0x0001 ## $t1 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s index 4a22ea6e0b..579a4a8a0f 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Init.s @@ -37,8 +37,8 @@ glabel EnTest_Init /* 0008C 8085F6DC 0C02915F */ jal SkelAnime_Init /* 00090 8085F6E0 260504A8 */ addiu $a1, $s0, 0x04A8 ## $a1 = 000004A8 -/* 00094 8085F6E4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Teardrop) -/* 00098 8085F6E8 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFunc_Teardrop) +/* 00094 8085F6E4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFeet) +/* 00098 8085F6E8 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFeet) /* 0009C 8085F6EC 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 000A0 8085F6F0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 000A4 8085F6F4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s index 67f77d42d6..746b5f6b12 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/EnTest_Update.s @@ -29,7 +29,7 @@ glabel EnTest_Update /* 04088 808636D8 8FA40054 */ lw $a0, 0x0054($sp) /* 0408C 808636DC 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 04090 808636E0 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 04094 808636E4 0C00B92D */ jal func_8002E4B4 +/* 04094 808636E4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 04098 808636E8 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0409C 808636EC 8618001C */ lh $t8, 0x001C($s0) ## 0000001C /* 040A0 808636F0 24010001 */ addiu $at, $zero, 0x0001 ## $at = 00000001 @@ -288,11 +288,11 @@ glabel L808638F4 /* 04410 80863A60 55600011 */ bnel $t3, $zero, .L80863AA8 /* 04414 80863A64 8FBF002C */ lw $ra, 0x002C($sp) /* 04418 80863A68 918D1C27 */ lbu $t5, 0x1C27($t4) ## 00001C27 -/* 0441C 80863A6C 3C188003 */ lui $t8, %hi(ActorShadow_DrawFunc_Teardrop) +/* 0441C 80863A6C 3C188003 */ lui $t8, %hi(ActorShadow_DrawFeet) /* 04420 80863A70 51A00008 */ beql $t5, $zero, .L80863A94 /* 04424 80863A74 8E190004 */ lw $t9, 0x0004($s0) ## 00000004 /* 04428 80863A78 8E0E0004 */ lw $t6, 0x0004($s0) ## 00000004 -/* 0442C 80863A7C 2718B8C4 */ addiu $t8, %lo(ActorShadow_DrawFunc_Teardrop) +/* 0442C 80863A7C 2718B8C4 */ addiu $t8, %lo(ActorShadow_DrawFeet) /* 04430 80863A80 AE1800C0 */ sw $t8, 0x00C0($s0) ## 000000C0 /* 04434 80863A84 35CF0081 */ ori $t7, $t6, 0x0081 ## $t7 = 00000081 /* 04438 80863A88 10000006 */ beq $zero, $zero, .L80863AA4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s index dba77a6e4d..76e7de66a6 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808615F4.s @@ -59,7 +59,7 @@ glabel func_808615F4 /* 0205C 808616AC 10000057 */ beq $zero, $zero, .L8086180C /* 02060 808616B0 ACCA07E8 */ sw $t2, 0x07E8($a2) ## 000007E8 .L808616B4: -/* 02064 808616B4 0C00B69E */ jal func_8002DA78 +/* 02064 808616B4 0C00B69E */ jal Actor_WorldYawTowardActor /* 02068 808616B8 AFA60020 */ sw $a2, 0x0020($sp) /* 0206C 808616BC 8FA60020 */ lw $a2, 0x0020($sp) /* 02070 808616C0 0C03F66B */ jal Rand_ZeroOne diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s index b1b949c107..00c9c70ad9 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862DBC.s @@ -34,7 +34,7 @@ glabel func_80862DBC /* 037E4 80862E34 8FA40024 */ lw $a0, 0x0024($sp) /* 037E8 80862E38 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 037EC 80862E3C 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 037F0 80862E40 0C00CDD2 */ jal Actor_ChangeType +/* 037F0 80862E40 0C00CDD2 */ jal Actor_ChangeCategory /* 037F4 80862E44 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 .L80862E48: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s index 0b8e54ff6c..43983c069a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80862E6C.s @@ -41,7 +41,7 @@ glabel func_80862E6C /* 038AC 80862EFC 8FA4002C */ lw $a0, 0x002C($sp) /* 038B0 80862F00 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 038B4 80862F04 24070005 */ addiu $a3, $zero, 0x0005 ## $a3 = 00000005 -/* 038B8 80862F08 0C00CDD2 */ jal Actor_ChangeType +/* 038B8 80862F08 0C00CDD2 */ jal Actor_ChangeCategory /* 038BC 80862F0C 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 .L80862F10: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s index 88fb41b2d6..f9fff1d2f7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_80863CC4.s @@ -175,7 +175,7 @@ glabel func_80863CC4 /* 04840 80863E90 AFA70014 */ sw $a3, 0x0014($sp) /* 04844 80863E94 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 04848 80863E98 8FA50084 */ lw $a1, 0x0084($sp) -/* 0484C 80863E9C 0C00AF6C */ jal func_8002BDB0 +/* 0484C 80863E9C 0C00AF6C */ jal Actor_SetFeetPos /* 04850 80863EA0 24060030 */ addiu $a2, $zero, 0x0030 ## $a2 = 00000030 /* 04854 80863EA4 8FAD0084 */ lw $t5, 0x0084($sp) /* 04858 80863EA8 24010030 */ addiu $at, $zero, 0x0030 ## $at = 00000030 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s index b4c3dff997..8476af53b1 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Test/func_808641E8.s @@ -10,7 +10,7 @@ glabel func_808641E8 /* 04BB8 80864208 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 04BBC 8086420C 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 /* 04BC0 80864210 AFA20024 */ sw $v0, 0x0024($sp) -/* 04BC4 80864214 0C00B69E */ jal func_8002DA78 +/* 04BC4 80864214 0C00B69E */ jal Actor_WorldYawTowardActor /* 04BC8 80864218 AFA7002C */ sw $a3, 0x002C($sp) /* 04BCC 8086421C 8FA7002C */ lw $a3, 0x002C($sp) /* 04BD0 80864220 00004025 */ or $t0, $zero, $zero ## $t0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s index 50e7b9365a..fe7508ae3a 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Init.s @@ -4,8 +4,8 @@ glabel EnTg_Init /* 00158 80B184B8 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 0015C 80B184BC AFBF002C */ sw $ra, 0x002C($sp) /* 00160 80B184C0 AFA5003C */ sw $a1, 0x003C($sp) -/* 00164 80B184C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00168 80B184C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00164 80B184C4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00168 80B184C8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0016C 80B184CC 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00170 80B184D0 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00174 80B184D4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s index 9fcad23c5e..4ce13b6b61 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tg/EnTg_Update.s @@ -43,7 +43,7 @@ glabel EnTg_Update /* 00320 80B18680 44070000 */ mfc1 $a3, $f0 /* 00324 80B18684 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00328 80B18688 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 0032C 80B1868C 0C00B92D */ jal func_8002E4B4 +/* 0032C 80B1868C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00330 80B18690 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00334 80B18694 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 00338 80B18698 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s index 12dab7068a..6a99405260 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s @@ -1033,7 +1033,7 @@ glabel EnTorch2_Update /* 012F4 80B1EC74 24A50150 */ addiu $a1, $a1, %lo(sSpawnPoint) ## $a1 = 80B20150 /* 012F8 80B1EC78 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 012FC 80B1EC7C 46044280 */ add.s $f10, $f8, $f4 -/* 01300 80B1EC80 0C00B6DB */ jal func_8002DB6C +/* 01300 80B1EC80 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 01304 80B1EC84 E60A002C */ swc1 $f10, 0x002C($s0) ## 0000002C /* 01308 80B1EC88 3C014448 */ lui $at, 0x4448 ## $at = 44480000 /* 0130C 80B1EC8C 44818000 */ mtc1 $at, $f16 ## $f16 = 800.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s index d3238867a9..484300a1aa 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Init.s @@ -27,12 +27,12 @@ glabel EnTp_Init /* 00054 80B20E34 3C0F80B2 */ lui $t7, %hi(D_80B22AC4) ## $t7 = 80B20000 /* 00058 80B20E38 240E0003 */ addiu $t6, $zero, 0x0003 ## $t6 = 00000003 /* 0005C 80B20E3C 25EF2AC4 */ addiu $t7, $t7, %lo(D_80B22AC4) ## $t7 = 80B22AC4 -/* 00060 80B20E40 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00060 80B20E40 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 00064 80B20E44 3C073E0F */ lui $a3, 0x3E0F ## $a3 = 3E0F0000 /* 00068 80B20E48 A26E001F */ sb $t6, 0x001F($s3) ## 0000001F /* 0006C 80B20E4C AE6F0098 */ sw $t7, 0x0098($s3) ## 00000098 /* 00070 80B20E50 34E75C29 */ ori $a3, $a3, 0x5C29 ## $a3 = 3E0F5C29 -/* 00074 80B20E54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00074 80B20E54 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00078 80B20E58 266400B4 */ addiu $a0, $s3, 0x00B4 ## $a0 = 000000B4 /* 0007C 80B20E5C 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s index 76d23400fc..c7e416571c 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tp/EnTp_Update.s @@ -65,7 +65,7 @@ glabel EnTp_Update /* 01750 80B22530 AFAA0014 */ sw $t2, 0x0014($sp) /* 01754 80B22534 24060000 */ addiu $a2, $zero, 0x0000 ## $a2 = 00000000 /* 01758 80B22538 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 -/* 0175C 80B2253C 0C00B92D */ jal func_8002E4B4 +/* 0175C 80B2253C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01760 80B22540 E7A40010 */ swc1 $f4, 0x0010($sp) .L80B22544: /* 01764 80B22544 44803000 */ mtc1 $zero, $f6 ## $f6 = 0.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s index 6e0e3351ab..77878828b5 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Draw.s @@ -19,12 +19,12 @@ glabel EnTr_Draw /* 011D0 80B23EC0 11C0000B */ beq $t6, $zero, .L80B23EF0 /* 011D4 80B23EC4 00000000 */ nop /* 011D8 80B23EC8 848F02D8 */ lh $t7, 0x02D8($a0) ## 000002D8 -/* 011DC 80B23ECC 3C098003 */ lui $t1, %hi(ActorShadow_DrawFunc_Circle) +/* 011DC 80B23ECC 3C098003 */ lui $t1, %hi(ActorShadow_DrawCircle) /* 011E0 80B23ED0 3C0680B2 */ lui $a2, %hi(D_80B24414) ## $a2 = 80B20000 /* 011E4 80B23ED4 000FC080 */ sll $t8, $t7, 2 /* 011E8 80B23ED8 00B8C821 */ addu $t9, $a1, $t8 /* 011EC 80B23EDC 8F281D8C */ lw $t0, 0x1D8C($t9) ## 00001D8C -/* 011F0 80B23EE0 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawFunc_Circle) +/* 011F0 80B23EE0 2529B5EC */ addiu $t1, %lo(ActorShadow_DrawCircle) /* 011F4 80B23EE4 24C64414 */ addiu $a2, $a2, %lo(D_80B24414) ## $a2 = 80B24414 /* 011F8 80B23EE8 15000003 */ bne $t0, $zero, .L80B23EF8 /* 011FC 80B23EEC 27A4003C */ addiu $a0, $sp, 0x003C ## $a0 = FFFFFFE4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s index 816a8da3f0..8d903be913 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Init.s @@ -14,9 +14,9 @@ glabel EnTr_Init /* 00010 80B22D00 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00014 80B22D04 AFBF002C */ sw $ra, 0x002C($sp) /* 00018 80B22D08 AFA50034 */ sw $a1, 0x0034($sp) -/* 0001C 80B22D0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 0001C 80B22D0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 00020 80B22D10 AFB10028 */ sw $s1, 0x0028($sp) -/* 00024 80B22D14 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 80B22D14 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 80B22D18 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0002C 80B22D1C 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 00030 80B22D20 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s index dfca7139c5..bc2c0f7cfb 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Tr/EnTr_Update.s @@ -11,7 +11,7 @@ glabel EnTr_Update /* 00EF0 80B23BE0 44070000 */ mfc1 $a3, $f0 /* 00EF4 80B23BE4 AFAE0014 */ sw $t6, 0x0014($sp) /* 00EF8 80B23BE8 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00EFC 80B23BEC 0C00B92D */ jal func_8002E4B4 +/* 00EFC 80B23BEC 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00F00 80B23BF0 E7A00010 */ swc1 $f0, 0x0010($sp) /* 00F04 80B23BF4 8E1902DC */ lw $t9, 0x02DC($s0) ## 000002DC /* 00F08 80B23BF8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -95,7 +95,7 @@ glabel EnTr_Update .L80B23D00: /* 01010 80B23D00 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B23D04: -/* 01014 80B23D04 0C00B56E */ jal Actor_SetHeight +/* 01014 80B23D04 0C00B56E */ jal Actor_SetFocus /* 01018 80B23D08 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 0101C 80B23D0C 860302E2 */ lh $v1, 0x02E2($s0) ## 000002E2 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s index 0f5257b0bd..c8776c8c72 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Init.s @@ -100,7 +100,7 @@ glabel EnTrap_Init /* 00168 80B247C8 8FA40054 */ lw $a0, 0x0054($sp) /* 0016C 80B247CC AFAB0014 */ sw $t3, 0x0014($sp) /* 00170 80B247D0 44070000 */ mfc1 $a3, $f0 -/* 00174 80B247D4 0C00B92D */ jal func_8002E4B4 +/* 00174 80B247D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00178 80B247D8 E7A00010 */ swc1 $f0, 0x0010($sp) /* 0017C 80B247DC 26020024 */ addiu $v0, $s0, 0x0024 ## $v0 = 00000024 /* 00180 80B247E0 8C4D0000 */ lw $t5, 0x0000($v0) ## 00000024 @@ -245,8 +245,8 @@ glabel EnTrap_Init /* 00374 80B249D4 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 00378 80B249D8 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 -/* 0037C 80B249DC 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00380 80B249E0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 0037C 80B249DC 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00380 80B249E0 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00384 80B249E4 44050000 */ mfc1 $a1, $f0 /* 00388 80B249E8 44070000 */ mfc1 $a3, $f0 /* 0038C 80B249EC 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s index 0d7faa7089..1f8cfd7528 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Trap/EnTrap_Update.s @@ -943,7 +943,7 @@ glabel EnTrap_Update /* 010E0 80B25740 240F001D */ addiu $t7, $zero, 0x001D ## $t7 = 0000001D /* 010E4 80B25744 AFAF0014 */ sw $t7, 0x0014($sp) /* 010E8 80B25748 8FA400AC */ lw $a0, 0x00AC($sp) -/* 010EC 80B2574C 0C00B92D */ jal func_8002E4B4 +/* 010EC 80B2574C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 010F0 80B25750 E7A60010 */ swc1 $f6, 0x0010($sp) /* 010F4 80B25754 8619001C */ lh $t9, 0x001C($s0) ## 0000001C /* 010F8 80B25758 C7A80098 */ lwc1 $f8, 0x0098($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s index cd35e85269..518adaf8bf 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Init.s @@ -9,8 +9,8 @@ glabel EnVali_Init /* 0001C 80B266CC 0C01E037 */ jal Actor_ProcessInitChain /* 00020 80B266D0 24A58944 */ addiu $a1, $a1, %lo(D_80B28944) ## $a1 = 80B28944 -/* 00024 80B266D4 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00028 80B266D8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00024 80B266D4 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00028 80B266D8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0002C 80B266DC 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00030 80B266E0 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00034 80B266E4 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s index ea89c9f36d..cc109f5329 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vali/EnVali_Update.s @@ -90,7 +90,7 @@ glabel EnVali_Update ## CollisionCheck_setOC /* 01548 80B27BF8 8FA60020 */ lw $a2, 0x0020($sp) /* 0154C 80B27BFC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 01550 80B27C00 0C00B56E */ jal Actor_SetHeight +/* 01550 80B27C00 0C00B56E */ jal Actor_SetFocus /* 01554 80B27C04 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 .L80B27C08: diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s index 48aff85e50..192763d714 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/EnVbBall_Update.s @@ -83,7 +83,7 @@ glabel EnVbBall_Update /* 00728 80B296C8 46144281 */ sub.s $f10, $f8, $f20 /* 0072C 80B296CC E62A0028 */ swc1 $f10, 0x0028($s1) ## 00000028 /* 00730 80B296D0 AFA80014 */ sw $t0, 0x0014($sp) -/* 00734 80B296D4 0C00B92D */ jal func_8002E4B4 +/* 00734 80B296D4 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00738 80B296D8 E7B00010 */ swc1 $f16, 0x0010($sp) /* 0073C 80B296DC C6320028 */ lwc1 $f18, 0x0028($s1) ## 00000028 /* 00740 80B296E0 962C0088 */ lhu $t4, 0x0088($s1) ## 00000088 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s index 2e6ccb1a10..d898904868 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Vb_Ball/func_80B292D0.s @@ -34,7 +34,7 @@ glabel func_80B292D0 /* 0039C 80B2933C 44070000 */ mfc1 $a3, $f0 /* 003A0 80B29340 AFAE0014 */ sw $t6, 0x0014($sp) /* 003A4 80B29344 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 -/* 003A8 80B29348 0C00B92D */ jal func_8002E4B4 +/* 003A8 80B29348 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003AC 80B2934C E7A40010 */ swc1 $f4, 0x0010($sp) /* 003B0 80B29350 966F0088 */ lhu $t7, 0x0088($s3) ## 00000088 /* 003B4 80B29354 31F80001 */ andi $t8, $t7, 0x0001 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s index 358b62ebd8..b884bc72db 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Init.s @@ -8,8 +8,8 @@ glabel EnWeiyer_Init /* 00018 80B322A8 0C01E037 */ jal Actor_ProcessInitChain /* 0001C 80B322AC 24A53AE4 */ addiu $a1, $a1, %lo(D_80B33AE4) ## $a1 = 80B33AE4 -/* 00020 80B322B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 00024 80B322B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00020 80B322B0 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 00024 80B322B4 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00028 80B322B8 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 0002C 80B322BC 3C05447A */ lui $a1, 0x447A ## $a1 = 447A0000 /* 00030 80B322C0 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s index e70bc20bdd..6982586c93 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/EnWeiyer_Update.s @@ -49,10 +49,10 @@ glabel EnWeiyer_Update /* 01584 80B33814 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 01588 80B33818 3C064120 */ lui $a2, 0x4120 ## $a2 = 41200000 /* 0158C 80B3381C 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 01590 80B33820 0C00B92D */ jal func_8002E4B4 +/* 01590 80B33820 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 01594 80B33824 E7B20010 */ swc1 $f18, 0x0010($sp) /* 01598 80B33828 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 0159C 80B3382C 0C00B56E */ jal Actor_SetHeight +/* 0159C 80B3382C 0C00B56E */ jal Actor_SetFocus /* 015A0 80B33830 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 015A4 80B33834 92020294 */ lbu $v0, 0x0294($s0) ## 00000294 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s index 3e0eae0bcf..a44b0d0856 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Weiyer/func_80B32DEC.s @@ -11,7 +11,7 @@ glabel func_80B32DEC /* 00B80 80B32E10 46083280 */ add.s $f10, $f6, $f8 /* 00B84 80B32E14 E7AA001C */ swc1 $f10, 0x001C($sp) /* 00B88 80B32E18 C450002C */ lwc1 $f16, 0x002C($v0) ## 0000002C -/* 00B8C 80B32E1C 0C00B6CA */ jal func_8002DB28 +/* 00B8C 80B32E1C 0C00B6CA */ jal Actor_WorldPitchTowardPoint /* 00B90 80B32E20 E7B00020 */ swc1 $f16, 0x0020($sp) /* 00B94 80B32E24 8FBF0014 */ lw $ra, 0x0014($sp) /* 00B98 80B32E28 27BD0028 */ addiu $sp, $sp, 0x0028 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s index 94fc7497fa..66782cb2c0 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Init.s @@ -12,11 +12,11 @@ glabel EnWf_Init /* 0002C 80B33CDC 44800000 */ mtc1 $zero, $f0 ## $f0 = 0.00 /* 00030 80B33CE0 3C0E80B3 */ lui $t6, %hi(D_80B37A88) ## $t6 = 80B30000 /* 00034 80B33CE4 25CE7A88 */ addiu $t6, $t6, %lo(D_80B37A88) ## $t6 = 80B37A88 -/* 00038 80B33CE8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 00038 80B33CE8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 0003C 80B33CEC 44050000 */ mfc1 $a1, $f0 /* 00040 80B33CF0 44070000 */ mfc1 $a3, $f0 /* 00044 80B33CF4 AE0E0098 */ sw $t6, 0x0098($s0) ## 00000098 -/* 00048 80B33CF8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00048 80B33CF8 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 0004C 80B33CFC 0C00AC78 */ jal ActorShape_Init /* 00050 80B33D00 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s index dbf3a07032..7d0fb6cebc 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/EnWf_Update.s @@ -26,7 +26,7 @@ glabel EnWf_Update /* 035A0 80B37250 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 035A4 80B37254 3C064200 */ lui $a2, 0x4200 ## $a2 = 42000000 /* 035A8 80B37258 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 035AC 80B3725C 0C00B92D */ jal func_8002E4B4 +/* 035AC 80B3725C 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 035B0 80B37260 E7A40010 */ swc1 $f4, 0x0010($sp) /* 035B4 80B37264 8E1902DC */ lw $t9, 0x02DC($s0) ## 000002DC /* 035B8 80B37268 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s index 1e934289f0..60180b9fe3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B33FB0.s @@ -171,7 +171,7 @@ glabel func_80B33FB0 /* 0056C 80B3421C 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00570 80B34220 57010019 */ bnel $t8, $at, .L80B34288 /* 00574 80B34224 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00578 80B34228 0C00B6D2 */ jal func_8002DB48 +/* 00578 80B34228 0C00B6D2 */ jal Actor_WorldDistXYZToActor /* 0057C 80B3422C AFA50030 */ sw $a1, 0x0030($sp) /* 00580 80B34230 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 /* 00584 80B34234 44819000 */ mtc1 $at, $f18 ## $f18 = 80.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s index bbabf0fd1e..2da21bc99d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Wf/func_80B37830.s @@ -9,7 +9,7 @@ glabel func_80B37830 /* 03B9C 80B3784C 10400049 */ beq $v0, $zero, .L80B37974 /* 03BA0 80B37850 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 03BA4 80B37854 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 -/* 03BA8 80B37858 0C00B69E */ jal func_8002DA78 +/* 03BA8 80B37858 0C00B69E */ jal Actor_WorldYawTowardActor /* 03BAC 80B3785C AFA20024 */ sw $v0, 0x0024($sp) /* 03BB0 80B37860 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6 /* 03BB4 80B37864 8FA70024 */ lw $a3, 0x0024($sp) @@ -19,7 +19,7 @@ glabel func_80B37830 /* 03BC4 80B37874 00063403 */ sra $a2, $a2, 16 /* 03BC8 80B37878 A60F0032 */ sh $t7, 0x0032($s0) ## 00000032 /* 03BCC 80B3787C A7A60022 */ sh $a2, 0x0022($sp) -/* 03BD0 80B37880 0C00B6DB */ jal func_8002DB6C +/* 03BD0 80B37880 0C00B6DB */ jal Actor_WorldDistXYZToPoint /* 03BD4 80B37884 24E50024 */ addiu $a1, $a3, 0x0024 ## $a1 = 00000024 /* 03BD8 80B37888 87A60022 */ lh $a2, 0x0022($sp) /* 03BDC 80B3788C 46000086 */ mov.s $f2, $f0 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s index 3177e4aa48..4eb14104f6 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/EnXc_Init.s @@ -25,8 +25,8 @@ glabel EnXc_Init /* 0572C 80B4190C 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 05730 80B41910 00A08825 */ or $s1, $a1, $zero ## $s1 = 00000000 /* 05734 80B41914 AFBF002C */ sw $ra, 0x002C($sp) -/* 05738 80B41918 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0573C 80B4191C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 05738 80B41918 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0573C 80B4191C 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 05740 80B41920 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 05744 80B41924 248400B4 */ addiu $a0, $a0, 0x00B4 ## $a0 = 000000B4 /* 05748 80B41928 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s index b379cce3b8..bdc3a2ad4b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Xc/func_80B3C468.s @@ -11,7 +11,7 @@ glabel func_80B3C468 /* 002AC 80B3C48C AFAE0014 */ sw $t6, 0x0014($sp) /* 002B0 80B3C490 8FA40024 */ lw $a0, 0x0024($sp) /* 002B4 80B3C494 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 002B8 80B3C498 0C00B92D */ jal func_8002E4B4 +/* 002B8 80B3C498 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 002BC 80B3C49C E7A00010 */ swc1 $f0, 0x0010($sp) /* 002C0 80B3C4A0 8FBF001C */ lw $ra, 0x001C($sp) /* 002C4 80B3C4A4 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s index 8bdca72844..a37e2b4434 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Init.s @@ -26,8 +26,8 @@ glabel EnZf_Init /* 002FC 80B4434C 344CFF00 */ ori $t4, $v0, 0xFF00 ## $t4 = 0000FF00 /* 00300 80B44350 A60C001C */ sh $t4, 0x001C($s0) ## 0000001C .L80B44354: -/* 00304 80B44354 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Teardrop) -/* 00308 80B44358 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFunc_Teardrop) +/* 00304 80B44354 3C068003 */ lui $a2, %hi(ActorShadow_DrawFeet) +/* 00308 80B44358 24C6B8C4 */ addiu $a2, %lo(ActorShadow_DrawFeet) /* 0030C 80B4435C 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00310 80B44360 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00314 80B44364 0C00AC78 */ jal ActorShape_Init @@ -80,7 +80,7 @@ glabel EnZf_Init /* 003C8 80B44418 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 003CC 80B4441C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 003D0 80B44420 3C064296 */ lui $a2, 0x4296 ## $a2 = 42960000 -/* 003D4 80B44424 0C00B92D */ jal func_8002E4B4 +/* 003D4 80B44424 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003D8 80B44428 E7A00010 */ swc1 $f0, 0x0010($sp) /* 003DC 80B4442C 240B00FF */ addiu $t3, $zero, 0x00FF ## $t3 = 000000FF /* 003E0 80B44430 240C0028 */ addiu $t4, $zero, 0x0028 ## $t4 = 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s index 29fc1caedd..b42dd01d27 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/EnZf_Update.s @@ -58,7 +58,7 @@ glabel EnZf_Update /* 052CC 80B4931C 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 052D0 80B49320 3C0641C8 */ lui $a2, 0x41C8 ## $a2 = 41C80000 /* 052D4 80B49324 3C0741F0 */ lui $a3, 0x41F0 ## $a3 = 41F00000 -/* 052D8 80B49328 0C00B92D */ jal func_8002E4B4 +/* 052D8 80B49328 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 052DC 80B4932C E7AA0010 */ swc1 $f10, 0x0010($sp) /* 052E0 80B49330 960A0088 */ lhu $t2, 0x0088($s0) ## 00000088 /* 052E4 80B49334 240C0001 */ addiu $t4, $zero, 0x0001 ## $t4 = 00000001 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s index 5e3fcb87f0..6d215e6072 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44058.s @@ -76,7 +76,7 @@ glabel func_80B44058 /* 00114 80B44164 E60A002C */ swc1 $f10, 0x002C($s0) ## 0000002C /* 00118 80B44168 AFA90014 */ sw $t1, 0x0014($sp) /* 0011C 80B4416C 8FA4004C */ lw $a0, 0x004C($sp) -/* 00120 80B44170 0C00B92D */ jal func_8002E4B4 +/* 00120 80B44170 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00124 80B44174 E7A20010 */ swc1 $f2, 0x0010($sp) /* 00128 80B44178 27AB0030 */ addiu $t3, $sp, 0x0030 ## $t3 = FFFFFFE8 /* 0012C 80B4417C 8D6D0000 */ lw $t5, 0x0000($t3) ## FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s index e43b76a271..0b7fbe3400 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B441C4.s @@ -55,7 +55,7 @@ glabel func_80B441C4 /* 0023C 80B4428C E60A002C */ swc1 $f10, 0x002C($s0) ## 0000002C /* 00240 80B44290 AFA80014 */ sw $t0, 0x0014($sp) /* 00244 80B44294 8FA4004C */ lw $a0, 0x004C($sp) -/* 00248 80B44298 0C00B92D */ jal func_8002E4B4 +/* 00248 80B44298 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0024C 80B4429C E7A20010 */ swc1 $f2, 0x0010($sp) /* 00250 80B442A0 27AA0030 */ addiu $t2, $sp, 0x0030 ## $t2 = FFFFFFE8 /* 00254 80B442A4 8D4C0000 */ lw $t4, 0x0000($t2) ## FFFFFFE8 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s index 2974fc874b..4a4ceacd82 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B44E8C.s @@ -106,7 +106,7 @@ glabel func_80B44E8C /* 00FB8 80B45008 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00FBC 80B4500C 55C10019 */ bnel $t6, $at, .L80B45074 /* 00FC0 80B45010 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 -/* 00FC4 80B45014 0C00B6D2 */ jal func_8002DB48 +/* 00FC4 80B45014 0C00B6D2 */ jal Actor_WorldDistXYZToActor /* 00FC8 80B45018 AFA50028 */ sw $a1, 0x0028($sp) /* 00FCC 80B4501C 3C0142A0 */ lui $at, 0x42A0 ## $at = 42A00000 /* 00FD0 80B45020 44819000 */ mtc1 $at, $f18 ## $f18 = 80.00 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s index 1253125e2c..d48fcc9e11 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B45748.s @@ -87,7 +87,7 @@ glabel func_80B45748 /* 01800 80B45850 000B6080 */ sll $t4, $t3, 2 /* 01804 80B45854 018B6023 */ subu $t4, $t4, $t3 /* 01808 80B45858 000C6080 */ sll $t4, $t4, 2 -/* 0180C 80B4585C 0C00B6B0 */ jal func_8002DAC0 +/* 0180C 80B4585C 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 01810 80B45860 018D2821 */ addu $a1, $t4, $t5 /* 01814 80B45864 A60200B6 */ sh $v0, 0x00B6($s0) ## 000000B6 /* 01818 80B45868 860F00B6 */ lh $t7, 0x00B6($s0) ## 000000B6 @@ -129,7 +129,7 @@ glabel func_80B45748 /* 0189C 80B458EC 01495023 */ subu $t2, $t2, $t1 /* 018A0 80B458F0 000A5080 */ sll $t2, $t2, 2 /* 018A4 80B458F4 014B2821 */ addu $a1, $t2, $t3 -/* 018A8 80B458F8 0C00B6EC */ jal func_8002DBB0 +/* 018A8 80B458F8 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 018AC 80B458FC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 018B0 80B45900 C7A60044 */ lwc1 $f6, 0x0044($sp) /* 018B4 80B45904 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -160,7 +160,7 @@ glabel func_80B45748 /* 01914 80B45964 01EE7823 */ subu $t7, $t7, $t6 /* 01918 80B45968 000F7880 */ sll $t7, $t7, 2 /* 0191C 80B4596C 01F92821 */ addu $a1, $t7, $t9 -/* 01920 80B45970 0C00B6B0 */ jal func_8002DAC0 +/* 01920 80B45970 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 01924 80B45974 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 01928 80B45978 10000009 */ beq $zero, $zero, .L80B459A0 /* 0192C 80B4597C A6020032 */ sh $v0, 0x0032($s0) ## 00000032 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s index 1ac6f2f481..876c1f5d15 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4743C.s @@ -10,7 +10,7 @@ glabel func_80B4743C /* 0340C 80B4745C 000E7880 */ sll $t7, $t6, 2 /* 03410 80B47460 01EE7823 */ subu $t7, $t7, $t6 /* 03414 80B47464 000F7880 */ sll $t7, $t7, 2 -/* 03418 80B47468 0C00B6B0 */ jal func_8002DAC0 +/* 03418 80B47468 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 0341C 80B4746C 01F82821 */ addu $a1, $t7, $t8 /* 03420 80B47470 34018000 */ ori $at, $zero, 0x8000 ## $at = 00008000 /* 03424 80B47474 00411821 */ addu $v1, $v0, $at diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s index 43d79d02ae..8e33eaa11b 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B4781C.s @@ -27,7 +27,7 @@ glabel func_80B4781C /* 03808 80B47858 000F7880 */ sll $t7, $t7, 2 /* 0380C 80B4785C 2718A090 */ addiu $t8, $t8, %lo(D_80B4A090) ## $t8 = 80B4A090 /* 03810 80B47860 C434A388 */ lwc1 $f20, %lo(D_80B4A388)($at) -/* 03814 80B47864 0C00B6EC */ jal func_8002DBB0 +/* 03814 80B47864 0C00B6EC */ jal Actor_WorldDistXZToPoint /* 03818 80B47868 01F82821 */ addu $a1, $t7, $t8 /* 0381C 80B4786C E7A00074 */ swc1 $f0, 0x0074($sp) /* 03820 80B47870 8E1903E4 */ lw $t9, 0x03E4($s0) ## 000003E4 @@ -61,7 +61,7 @@ glabel func_80B4781C /* 03884 80B478D4 000A5880 */ sll $t3, $t2, 2 /* 03888 80B478D8 016A5823 */ subu $t3, $t3, $t2 /* 0388C 80B478DC 000B5880 */ sll $t3, $t3, 2 -/* 03890 80B478E0 0C00B6B0 */ jal func_8002DAC0 +/* 03890 80B478E0 0C00B6B0 */ jal Actor_WorldYawTowardPoint /* 03894 80B478E4 016C2821 */ addu $a1, $t3, $t4 /* 03898 80B478E8 A7A2005A */ sh $v0, 0x005A($sp) /* 0389C 80B478EC 8E0703E4 */ lw $a3, 0x03E4($s0) ## 000003E4 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s index 66f0c47043..82c2b44b19 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B48E50.s @@ -57,7 +57,7 @@ glabel func_80B48E50 .L80B48F14: /* 04EC4 80B48F14 02003025 */ or $a2, $s0, $zero ## $a2 = 00000000 /* 04EC8 80B48F18 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 -/* 04ECC 80B48F1C 0C00CDD2 */ jal Actor_ChangeType +/* 04ECC 80B48F1C 0C00CDD2 */ jal Actor_ChangeCategory /* 04ED0 80B48F20 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 04ED4 80B48F24 92020404 */ lbu $v0, 0x0404($s0) ## 00000404 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s index abf2455aed..f23b652424 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49688.s @@ -132,7 +132,7 @@ glabel func_80B49688 /* 05788 80B497D8 AFA70014 */ sw $a3, 0x0014($sp) /* 0578C 80B497DC 8FA50064 */ lw $a1, 0x0064($sp) /* 05790 80B497E0 2406002D */ addiu $a2, $zero, 0x002D ## $a2 = 0000002D -/* 05794 80B497E4 0C00AF6C */ jal func_8002BDB0 +/* 05794 80B497E4 0C00AF6C */ jal Actor_SetFeetPos /* 05798 80B497E8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B497EC: /* 0579C 80B497EC 8FA20064 */ lw $v0, 0x0064($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s index dfa1201c3a..e97f7df706 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49C2C.s @@ -10,7 +10,7 @@ glabel func_80B49C2C /* 05BFC 80B49C4C 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 /* 05C00 80B49C50 00E02025 */ or $a0, $a3, $zero ## $a0 = 00000000 /* 05C04 80B49C54 AFA2001C */ sw $v0, 0x001C($sp) -/* 05C08 80B49C58 0C00B69E */ jal func_8002DA78 +/* 05C08 80B49C58 0C00B69E */ jal Actor_WorldYawTowardActor /* 05C0C 80B49C5C AFA70024 */ sw $a3, 0x0024($sp) /* 05C10 80B49C60 8FA40024 */ lw $a0, 0x0024($sp) /* 05C14 80B49C64 3C06C100 */ lui $a2, 0xC100 ## $a2 = C1000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s index 30497c5e6b..2325137da7 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zf/func_80B49E4C.s @@ -9,7 +9,7 @@ glabel func_80B49E4C /* 05E18 80B49E68 8FA4002C */ lw $a0, 0x002C($sp) /* 05E1C 80B49E6C 10400081 */ beq $v0, $zero, .L80B4A074 /* 05E20 80B49E70 00402825 */ or $a1, $v0, $zero ## $a1 = 00000000 -/* 05E24 80B49E74 0C00B69E */ jal func_8002DA78 +/* 05E24 80B49E74 0C00B69E */ jal Actor_WorldYawTowardActor /* 05E28 80B49E78 00000000 */ nop /* 05E2C 80B49E7C 8FA4002C */ lw $a0, 0x002C($sp) /* 05E30 80B49E80 3C06C28C */ lui $a2, 0xC28C ## $a2 = C28C0000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s index 733fad59fd..47812d7a9d 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Init.s @@ -18,8 +18,8 @@ glabel EnZl4_Init /* 0063C 80B5BDEC AFAE0010 */ sw $t6, 0x0010($sp) /* 00640 80B5BDF0 0C0291BE */ jal SkelAnime_InitFlex /* 00644 80B5BDF4 00003825 */ or $a3, $zero, $zero ## $a3 = 00000000 -/* 00648 80B5BDF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) -/* 0064C 80B5BDFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 00648 80B5BDF8 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) +/* 0064C 80B5BDFC 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 00650 80B5BE00 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 00654 80B5BE04 24050000 */ addiu $a1, $zero, 0x0000 ## $a1 = 00000000 /* 00658 80B5BE08 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s index f7d1009e8d..d79a3bbf74 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Zl4/EnZl4_Update.s @@ -21,7 +21,7 @@ glabel EnZl4_Update /* 02B4C 80B5E2FC 44070000 */ mfc1 $a3, $f0 /* 02B50 80B5E300 8FA4003C */ lw $a0, 0x003C($sp) /* 02B54 80B5E304 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 02B58 80B5E308 0C00B92D */ jal func_8002E4B4 +/* 02B58 80B5E308 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 02B5C 80B5E30C E7A00010 */ swc1 $f0, 0x0010($sp) /* 02B60 80B5E310 8E190190 */ lw $t9, 0x0190($s0) ## 00000190 /* 02B64 80B5E314 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s index 3a951b0372..27d1a36175 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Init.s @@ -587,7 +587,7 @@ glabel Fishing_Init /* 01398 80B6AD38 02602025 */ or $a0, $s3, $zero ## $a0 = 00000000 /* 0139C 80B6AD3C 26651C24 */ addiu $a1, $s3, 0x1C24 ## $a1 = 00001C24 /* 013A0 80B6AD40 02403025 */ or $a2, $s2, $zero ## $a2 = 00000000 -/* 013A4 80B6AD44 0C00CDD2 */ jal Actor_ChangeType +/* 013A4 80B6AD44 0C00CDD2 */ jal Actor_ChangeCategory /* 013A8 80B6AD48 24070006 */ addiu $a3, $zero, 0x0006 ## $a3 = 00000006 /* 013AC 80B6AD4C 8E480004 */ lw $t0, 0x0004($s2) ## 00000004 diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s index d2ec0774e5..d545b16753 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/Fishing_Update.s @@ -5040,7 +5040,7 @@ glabel L80B75278 /* 0BEC8 80B75868 E6040104 */ swc1 $f4, 0x0104($s0) ## 00000104 /* 0BECC 80B7586C E7A000D8 */ swc1 $f0, 0x00D8($sp) /* 0BED0 80B75870 AFB90014 */ sw $t9, 0x0014($sp) -/* 0BED4 80B75874 0C00B92D */ jal func_8002E4B4 +/* 0BED4 80B75874 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 0BED8 80B75878 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 0BEDC 80B7587C C7A000D8 */ lwc1 $f0, 0x00D8($sp) /* 0BEE0 80B75880 C6080028 */ lwc1 $f8, 0x0028($s0) ## 00000028 diff --git a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s index 2b4e87366e..535f2b7a5c 100644 --- a/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s +++ b/asm/non_matchings/overlays/actors/ovl_Fishing/func_80B6E9E0.s @@ -869,7 +869,7 @@ glabel L80B6F0C4 /* 05A98 80B6F438 E7AC00C8 */ swc1 $f12, 0x00C8($sp) /* 05A9C 80B6F43C AFB90014 */ sw $t9, 0x0014($sp) /* 05AA0 80B6F440 8FA400EC */ lw $a0, 0x00EC($sp) -/* 05AA4 80B6F444 0C00B92D */ jal func_8002E4B4 +/* 05AA4 80B6F444 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 05AA8 80B6F448 E7AA0010 */ swc1 $f10, 0x0010($sp) /* 05AAC 80B6F44C 27AF0080 */ addiu $t7, $sp, 0x0080 ## $t7 = FFFFFF98 /* 05AB0 80B6F450 8DF80000 */ lw $t8, 0x0000($t7) ## FFFFFF98 @@ -1897,7 +1897,7 @@ glabel L80B6FA3C /* 069B8 80B70358 ACB80108 */ sw $t8, 0x0108($a1) ## 00000108 /* 069BC 80B7035C AFB90014 */ sw $t9, 0x0014($sp) /* 069C0 80B70360 8FA400EC */ lw $a0, 0x00EC($sp) -/* 069C4 80B70364 0C00B92D */ jal func_8002E4B4 +/* 069C4 80B70364 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 069C8 80B70368 E7A00010 */ swc1 $f0, 0x0010($sp) /* 069CC 80B7036C 27AF0058 */ addiu $t7, $sp, 0x0058 ## $t7 = FFFFFF70 /* 069D0 80B70370 8DF80000 */ lw $t8, 0x0000($t7) ## FFFFFF70 diff --git a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s index a18359428d..e8c398c4f8 100644 --- a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s +++ b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86AC8.s @@ -33,7 +33,7 @@ glabel func_80B86AC8 /* 00218 80B86B38 AFAE0014 */ sw $t6, 0x0014($sp) /* 0021C 80B86B3C 8FA4002C */ lw $a0, 0x002C($sp) /* 00220 80B86B40 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 -/* 00224 80B86B44 0C00B92D */ jal func_8002E4B4 +/* 00224 80B86B44 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00228 80B86B48 E7A60010 */ swc1 $f6, 0x0010($sp) /* 0022C 80B86B4C 960F0088 */ lhu $t7, 0x0088($s0) ## 00000088 /* 00230 80B86B50 31F80001 */ andi $t8, $t7, 0x0001 ## $t8 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s index e2522c0fa4..1781ed29a6 100644 --- a/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s +++ b/asm/non_matchings/overlays/actors/ovl_Item_Shield/func_80B86CA8.s @@ -42,7 +42,7 @@ glabel func_80B86CA8 /* 003EC 80B86D0C AFAE0014 */ sw $t6, 0x0014($sp) /* 003F0 80B86D10 8FA40074 */ lw $a0, 0x0074($sp) /* 003F4 80B86D14 02602825 */ or $a1, $s3, $zero ## $a1 = 00000000 -/* 003F8 80B86D18 0C00B92D */ jal func_8002E4B4 +/* 003F8 80B86D18 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 003FC 80B86D1C E7A40010 */ swc1 $f4, 0x0010($sp) /* 00400 80B86D20 0C01DE1C */ jal Math_SinS ## sins? diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s index 528975ca39..620a0d3b14 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Init.s @@ -151,12 +151,12 @@ glabel ObjBean_Init /* 01180 80B8FC00 0C2E3AA0 */ jal func_80B8EA80 /* 01184 80B8FC04 8FA50024 */ lw $a1, 0x0024($sp) /* 01188 80B8FC08 920D01F7 */ lbu $t5, 0x01F7($s0) ## 000001F7 -/* 0118C 80B8FC0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawFunc_Circle) +/* 0118C 80B8FC0C 3C068003 */ lui $a2, %hi(ActorShadow_DrawCircle) /* 01190 80B8FC10 3C07410C */ lui $a3, 0x410C ## $a3 = 410C0000 /* 01194 80B8FC14 35AE0010 */ ori $t6, $t5, 0x0010 ## $t6 = 00000010 /* 01198 80B8FC18 A20E01F7 */ sb $t6, 0x01F7($s0) ## 000001F7 /* 0119C 80B8FC1C 34E7CCCD */ ori $a3, $a3, 0xCCCD ## $a3 = 410CCCCD -/* 011A0 80B8FC20 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawFunc_Circle) +/* 011A0 80B8FC20 24C6B5EC */ addiu $a2, %lo(ActorShadow_DrawCircle) /* 011A4 80B8FC24 260400B4 */ addiu $a0, $s0, 0x00B4 ## $a0 = 000000B4 /* 011A8 80B8FC28 0C00AC78 */ jal ActorShape_Init diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s index fd64624af4..fb20f8c4dc 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Bean/ObjBean_Update.s @@ -73,8 +73,8 @@ glabel ObjBean_Update /* 0211C 80B90B9C 3C0142B0 */ lui $at, 0x42B0 ## $at = 42B00000 /* 02120 80B90BA0 44815000 */ mtc1 $at, $f10 ## $f10 = 88.00 /* 02124 80B90BA4 C6080050 */ lwc1 $f8, 0x0050($s0) ## 00000050 -/* 02128 80B90BA8 3C0A8003 */ lui $t2, %hi(ActorShadow_DrawFunc_Circle) -/* 0212C 80B90BAC 254AB5EC */ addiu $t2, %lo(ActorShadow_DrawFunc_Circle) +/* 02128 80B90BA8 3C0A8003 */ lui $t2, %hi(ActorShadow_DrawCircle) +/* 0212C 80B90BAC 254AB5EC */ addiu $t2, %lo(ActorShadow_DrawCircle) /* 02130 80B90BB0 460A4402 */ mul.s $f16, $f8, $f10 /* 02134 80B90BB4 AE0A00C0 */ sw $t2, 0x00C0($s0) ## 000000C0 /* 02138 80B90BB8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 @@ -109,7 +109,7 @@ glabel ObjBean_Update .L80B90C20: /* 021A0 80B90C20 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80B90C24: -/* 021A4 80B90C24 0C00B56E */ jal Actor_SetHeight +/* 021A4 80B90C24 0C00B56E */ jal Actor_SetFocus /* 021A8 80B90C28 3C0540C0 */ lui $a1, 0x40C0 ## $a1 = 40C00000 /* 021AC 80B90C2C 920B01F7 */ lbu $t3, 0x01F7($s0) ## 000001F7 diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s index 559850d2ee..c33aac2fb4 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA180C.s @@ -24,7 +24,7 @@ glabel func_80BA180C /* 00B04 80BA1864 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00B08 80BA1868 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 00B0C 80BA186C 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 -/* 00B10 80BA1870 0C00B92D */ jal func_8002E4B4 +/* 00B10 80BA1870 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00B14 80BA1874 E7A40010 */ swc1 $f4, 0x0010($sp) .L80BA1878: /* 00B18 80BA1878 8FBF0024 */ lw $ra, 0x0024($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s index 8b26b36fc8..80f190ec7b 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Tsubo/func_80BA1958.s @@ -86,7 +86,7 @@ glabel func_80BA1958 /* 00D24 80BA1A84 02002825 */ or $a1, $s0, $zero ## $a1 = 00000000 /* 00D28 80BA1A88 3C0640A0 */ lui $a2, 0x40A0 ## $a2 = 40A00000 /* 00D2C 80BA1A8C 3C074170 */ lui $a3, 0x4170 ## $a3 = 41700000 -/* 00D30 80BA1A90 0C00B92D */ jal func_8002E4B4 +/* 00D30 80BA1A90 0C00B92D */ jal Actor_UpdateBgCheckInfo /* 00D34 80BA1A94 E7A40010 */ swc1 $f4, 0x0010($sp) /* 00D38 80BA1A98 26050150 */ addiu $a1, $s0, 0x0150 ## $a1 = 00000150 /* 00D3C 80BA1A9C AFA5002C */ sw $a1, 0x002C($sp) diff --git a/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s b/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s index 4f58da42d1..7bc7421e59 100644 --- a/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Obj_Warp2block/ObjWarp2block_Init.s @@ -42,7 +42,7 @@ glabel ObjWarp2block_Init /* 005D8 80BA23C8 AE090168 */ sw $t1, 0x0168($s0) ## 00000168 /* 005DC 80BA23CC 00AD2821 */ addu $a1, $a1, $t5 /* 005E0 80BA23D0 8CA52844 */ lw $a1, %lo(D_80BA2844)($a1) -/* 005E4 80BA23D4 0C00B56E */ jal Actor_SetHeight +/* 005E4 80BA23D4 0C00B56E */ jal Actor_SetFocus /* 005E8 80BA23D8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 005EC 80BA23DC 860E001C */ lh $t6, 0x001C($s0) ## 0000001C diff --git a/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s b/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s index 2e4a634fef..279191e4e4 100644 --- a/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s +++ b/asm/non_matchings/overlays/actors/ovl_Object_Kankyo/ObjectKankyo_Init.s @@ -109,7 +109,7 @@ glabel L80BA2BA8 /* 00114 80BA2BB4 E4C40198 */ swc1 $f4, 0x0198($a2) ## 00000198 /* 00118 80BA2BB8 8FA4001C */ lw $a0, 0x001C($sp) /* 0011C 80BA2BBC AFA60018 */ sw $a2, 0x0018($sp) -/* 00120 80BA2BC0 0C00CDD2 */ jal Actor_ChangeType +/* 00120 80BA2BC0 0C00CDD2 */ jal Actor_ChangeCategory /* 00124 80BA2BC4 24851C24 */ addiu $a1, $a0, 0x1C24 ## $a1 = 00001C24 /* 00128 80BA2BC8 8FA40018 */ lw $a0, 0x0018($sp) diff --git a/include/functions.h b/include/functions.h index f449db303e..d9550dedfa 100644 --- a/include/functions.h +++ b/include/functions.h @@ -347,12 +347,13 @@ void EffectSsIceSmoke_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocit void FlagSet_Update(GlobalContext* globalCtx); void Overlay_LoadGameState(GameStateOverlay* overlayEntry); void Overlay_FreeGameState(GameStateOverlay* overlayEntry); -void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3); -void ActorShadow_DrawFunc_Circle(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void ActorShadow_DrawFunc_Squiggly(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* globalCtx); -void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, Vec3f* arg3, s32 arg4, Vec3f* arg5); +void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc* shadowDraw, f32 shadowScale); +void ActorShadow_DrawCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawWhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawHorse(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void ActorShadow_DrawFeet(Actor* actor, Lights* lights, GlobalContext* globalCtx); +void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, + Vec3f* rightFootPos); void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx); s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag); void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag); @@ -376,7 +377,7 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt s32 arg5, s32 arg6, s32 arg7); s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx); void Actor_Kill(Actor* actor); -void Actor_SetHeight(Actor* actor, f32 offset); +void Actor_SetFocus(Actor* actor, f32 offset); void Actor_SetScale(Actor* actor, f32 scale); void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor); void func_8002D7EC(Actor* actor); @@ -385,14 +386,14 @@ void Actor_MoveForward(Actor* actor); void func_8002D908(Actor* actor); void func_8002D97C(Actor* actor); void func_8002D9A4(Actor* actor, f32 arg1); -s16 func_8002DA78(Actor* actorA, Actor* actorB); -s16 func_8002DAC0(Actor* actor, Vec3f* arg1); -f32 func_8002DB48(Actor* actorA, Actor* actorB); -f32 func_8002DB6C(Actor* actor, Vec3f* arg1); -s16 func_8002DAE0(Actor* actorA, Actor* actorB); -s16 func_8002DB28(Actor* actor, Vec3f* arg1); -f32 func_8002DB8C(Actor* actorA, Actor* actorB); -f32 func_8002DBB0(Actor* actor, Vec3f* arg1); +s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint); +f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint); +s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB); +s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint); +f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB); +f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint); void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2); f32 Actor_HeightDiff(Actor* actorA, Actor* actorB); f32 Player_GetHeight(Player* player); @@ -414,14 +415,14 @@ s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx); s32 func_8002E084(Actor* actor, s16 arg1); s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2); s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3); -void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5); +void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5); Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx); Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx); void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag); void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag); -PosRot* func_8002EEE4(PosRot* arg0, Actor* actor); -PosRot* func_8002EF14(PosRot* arg0, Actor* actor); -PosRot* func_8002EF44(PosRot* arg0, Actor* actor); +PosRot* Actor_GetFocus(PosRot* arg0, Actor* actor); +PosRot* Actor_GetWorld(PosRot* arg0, Actor* actor); +PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor); s32 func_8002F0C8(Actor* actor, Player* player, s32 arg2); u32 func_8002F194(Actor* actor, GlobalContext* globalCtx); s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 arg4); @@ -469,7 +470,7 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx); Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx); Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player); -Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType); +Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory); void func_80032C7C(GlobalContext* globalCtx, Actor* actor); void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx); void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4, Gfx** dList, s16 arg6); @@ -480,7 +481,7 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider); Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor); Actor* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2); -void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType); +void Actor_ChangeCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory); void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 textIdLower); s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3); s32 func_80033A84(GlobalContext* globalCtx, Actor* actor); @@ -511,7 +512,7 @@ void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3); void Actor_Noop(Actor* actor, GlobalContext* globalCtx); void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist); void Gfx_DrawDListXlu(GlobalContext* globalCtx, Gfx* dlist); -Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range); +Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorCategory, f32 range); s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5); void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3); void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1); @@ -560,8 +561,10 @@ void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionCon // ? func_8003992C(?); // ? BgCheck_ComputeWallDisplacement(?); // ? BgCheck_SphVsStaticWall(?); -s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight, CollisionPoly** outPoly); -s32 func_8003A5B8(SSList* headNodeId, CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, Vec3f* outPos, CollisionPoly** outPoly, f32* outDistSq, f32 chkDist, s32 bccFlags); +s32 BgCheck_CheckStaticCeiling(StaticLookup* lookup, u16 xpFlags, CollisionContext* colCtx, f32* outY, Vec3f* pos, + f32 checkHeight, CollisionPoly** outPoly); +s32 func_8003A5B8(SSList* headNodeId, CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, + Vec3f* outPos, CollisionPoly** outPoly, f32* outDistSq, f32 chkDist, s32 bccFlags); // ? func_8003A7D8(?); // ? BgCheck_SphVsFirstStaticPolyList(?); // ? BgCheck_SphVsFirstStaticPoly(?); @@ -580,37 +583,60 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis // ? BgCheck_GetCollisionHeader(?); s32 BgCheck_PosInStaticBoundingBox(CollisionContext* colCtx, Vec3f* pos); f32 BgCheck_EntityRaycastFloor1(CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor2(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor2(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, + Vec3f* pos); f32 BgCheck_EntityRaycastFloor3(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor4(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* arg4); -f32 BgCheck_EntityRaycastFloor5(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); -f32 BgCheck_EntityRaycastFloor6(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos, f32 chkDist); +f32 BgCheck_EntityRaycastFloor4(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, + Vec3f* arg4); +f32 BgCheck_EntityRaycastFloor5(GlobalContext* globalCtx, CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, + Actor* actor, Vec3f* pos); +f32 BgCheck_EntityRaycastFloor6(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos, + f32 chkDist); f32 BgCheck_EntityRaycastFloor7(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); f32 BgCheck_AnyRaycastFloor1(CollisionContext* colCtx, CollisionPoly* outPoly, Vec3f* pos); f32 BgCheck_AnyRaycastFloor2(CollisionContext* colCtx, CollisionPoly* outPoly, s32* bgId, Vec3f* pos); f32 BgCheck_CameraRaycastFloor2(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); f32 BgCheck_EntityRaycastFloor8(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Actor* actor, Vec3f* pos); f32 BgCheck_EntityRaycastFloor9(CollisionContext* colCtx, CollisionPoly** outPoly, s32* bgId, Vec3f* pos); -s32 BgCheck_SphVsWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight, u8 argA); -s32 BgCheck_EntitySphVsWall1(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, f32 checkHeight); -s32 BgCheck_EntitySphVsWall2(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, f32 checkHeight); -s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); -s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); +s32 BgCheck_SphVsWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, + f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight, u8 argA); +s32 BgCheck_EntitySphVsWall1(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, f32 checkHeight); +s32 BgCheck_EntitySphVsWall2(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, f32 checkHeight); +s32 BgCheck_EntitySphVsWall3(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); +s32 BgCheck_EntitySphVsWall4(CollisionContext* colCtx, Vec3f* posResult, Vec3f* posNext, Vec3f* posPrev, f32 radius, + CollisionPoly** outPoly, s32* outBgId, Actor* actor, f32 checkHeight); // ? BgCheck_CheckCeilingImpl(?); s32 BgCheck_AnyCheckCeiling(CollisionContext* colCtx, f32* outY, Vec3f* pos, f32 checkHeight); -s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* arg1, Vec3f* arg2, f32 arg3, CollisionPoly** outPoly, s32* outBgId, Actor* actor); -s32 BgCheck_LineTestImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32* bgId, Actor* actor, f32 chkDist, u32 bccFlags); -s32 BgCheck_CameraLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_CameraLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, Actor* actor); -s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, Actor* actor, f32 chkDist); -s32 BgCheck_ProjectileLineTest(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); -s32 BgCheck_AnyLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkOneFace); -s32 BgCheck_AnyLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace); -s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityCheckCeiling(CollisionContext* colCtx, f32* arg1, Vec3f* arg2, f32 arg3, CollisionPoly** outPoly, + s32* outBgId, Actor* actor); +s32 BgCheck_LineTestImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, Vec3f* posA, Vec3f* posB, + Vec3f* posResult, CollisionPoly** outPoly, s32* bgId, Actor* actor, f32 chkDist, u32 bccFlags); +s32 BgCheck_CameraLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_CameraLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); +s32 BgCheck_EntityLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, + Actor* actor); +s32 BgCheck_EntityLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId, + Actor* actor, f32 chkDist); +s32 BgCheck_ProjectileLineTest(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, + s32* bgId); +s32 BgCheck_AnyLineTest1(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkOneFace); +s32 BgCheck_AnyLineTest2(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace); +s32 BgCheck_AnyLineTest3(CollisionContext* colCtx, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, + s32 chkWall, s32 chkFloor, s32 chkCeil, s32 chkOneFace, s32* bgId); // ? BgCheck_SphVsFirstPolyImpl(?); -s32 BgCheck_SphVsFirstPoly(CollisionContext* colCtx, Vec3f* center, f32 radius); +s32 BgCheck_SphVsFirstPoly(CollisionContext* colCtx, Vec3f* center, f32 radius); void SSNodeList_Initialize(SSNodeList*); void SSNodeList_Alloc(GlobalContext* globalCtx, SSNodeList* this, s32 tblMax, s32 numPolys); u16 SSNodeList_GetNextNodeIdx(SSNodeList* this); @@ -644,15 +670,19 @@ void DynaPoly_UpdateBgActorTransforms(GlobalContext* globalCtx, DynaCollisionCon // ? BgCheck_RaycastFloorDynaList(?); f32 BgCheck_RaycastFloorDyna(DynaRaycast* dynaRaycast); // ? BgCheck_SphVsDynaWallInBgActor(?); -s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* outZ, Vec3f* pos, f32 radius, CollisionPoly** outPoly, s32* outBgId, Actor* actor); +s32 BgCheck_SphVsDynaWall(CollisionContext* colCtx, u16 xpFlags, f32* outX, f32* outZ, Vec3f* pos, f32 radius, + CollisionPoly** outPoly, s32* outBgId, Actor* actor); // ? BgCheck_CheckDynaCeilingList(?); -s32 BgCheck_CheckDynaCeiling(CollisionContext* colCtx, u16 xpFlags, f32* outY, Vec3f* pos, f32 chkDist, CollisionPoly** outPoly, s32* outBgId, Actor* actor); +s32 BgCheck_CheckDynaCeiling(CollisionContext* colCtx, u16 xpFlags, f32* outY, Vec3f* pos, f32 chkDist, + CollisionPoly** outPoly, s32* outBgId, Actor* actor); // ? func_80040FA4(?); // ? func_80041128(?); -s32 func_80041240(CollisionContext* colCtx, u16 xpFlags, Vec3f* posA, Vec3f* posB, Vec3f* posResult, CollisionPoly** outPoly, f32* distSq, s32* outBgId, Actor* actor, f32 chkDist, s32 bccFlags); +s32 func_80041240(CollisionContext* colCtx, u16 xpFlags, Vec3f* posA, Vec3f* posB, Vec3f* posResult, + CollisionPoly** outPoly, f32* distSq, s32* outBgId, Actor* actor, f32 chkDist, s32 bccFlags); // ? BgCheck_SphVsFirstDynaPolyList(?); // ? BgCheck_SphVsFirstDynaPolyInBgActor(?); -s32 BgCheck_SphVsFirstDynaPoly(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, Vec3f* center, f32 radius, Actor* actor, u16 bciFlags); +s32 BgCheck_SphVsFirstDynaPoly(CollisionContext* colCtx, u16 xpFlags, CollisionPoly** outPoly, s32* outBgId, + Vec3f* center, f32 radius, Actor* actor, u16 bciFlags); // ? CollisionHeader_SegmentedToVirtual(?); void CollisionHeader_GetVirtual(void* colHeader, CollisionHeader** dest); void BgCheck_ResetPolyCheckTbl(SSNodeList* nodeList, s32 numPolys); @@ -687,9 +717,12 @@ s32 SurfaceType_IsConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bg u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_IsWallDamage(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox); -s32 WaterBox_GetSurface2(GlobalContext* globalCtx, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist, WaterBox** outWaterBox); -s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, WaterBox** outWaterBox); +s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, + WaterBox** outWaterBox); +s32 WaterBox_GetSurface2(GlobalContext* globalCtx, CollisionContext* colCtx, Vec3f* pos, f32 surfaceChkDist, + WaterBox** outWaterBox); +s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface, + WaterBox** outWaterBox); u32 WaterBox_GetCamDataIndex(CollisionContext* colCtx, WaterBox* waterBox); u16 WaterBox_GetCameraSType(CollisionContext* colCtx, WaterBox* waterBox); u32 WaterBox_GetLightSettingIndex(CollisionContext* colCtx, WaterBox* waterBox); @@ -708,8 +741,8 @@ s32 func_800433A4(CollisionContext* colCtx, s32 bgId, Actor* actor); void DynaPolyActor_Init(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags); void func_800434A0(DynaPolyActor* dynaActor); void func_800434A8(DynaPolyActor* dynaActor); -void func_800434C8(CollisionContext* colCtx, s32 floorPolySource); -void func_80043508(CollisionContext* colCtx, s32 floorPolySource); +void func_800434C8(CollisionContext* colCtx, s32 floorBgId); +void func_80043508(CollisionContext* colCtx, s32 floorBgId); void func_80043538(DynaPolyActor* dynaActor); s32 func_80043548(DynaPolyActor* dynaActor); s32 func_8004356C(DynaPolyActor* dynaActor); @@ -819,8 +852,7 @@ void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider); void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos); void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d); void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c); -void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index, - ColliderTrisElementDimInit* init); +void Collider_SetTrisDim(GlobalContext* globalCtx, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* init); void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider); void CollisionCheck_SpawnRedBlood(GlobalContext* globalCtx, Vec3f* v); void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v); @@ -1040,7 +1072,7 @@ s16 func_800800F8(GlobalContext* globalCtx, s16 csID, s16 timer, Actor* actor, s void func_800803F0(GlobalContext* globalCtx, s16 camId); s16 func_80080480(GlobalContext* globalCtx, Actor* actor); void func_800806BC(GlobalContext* globalCtx, Actor* actor, u16 sfxId); -UNK_TYPE func_80080728(GlobalContext* globalCtx, u8 actorType); +UNK_TYPE func_80080728(GlobalContext* globalCtx, u8 actorCategory); void func_80080788(UNK_TYPE, UNK_TYPE); void Map_SavePlayerInitialInfo(GlobalContext* globalCtx); void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor); diff --git a/include/macros.h b/include/macros.h index e972883c1a..13e7a061b3 100644 --- a/include/macros.h +++ b/include/macros.h @@ -19,7 +19,7 @@ #define RGBA8(r, g, b, a) (((r & 0xFF) << 24) | ((g & 0xFF) << 16) | ((b & 0xFF) << 8) | ((a & 0xFF) << 0)) -#define PLAYER ((Player*)globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first) +#define PLAYER ((Player*)globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head) #define ACTIVE_CAM globalCtx->cameraPtrs[globalCtx->activeCamera] diff --git a/include/z64.h b/include/z64.h index 19c98e68b6..865037665c 100644 --- a/include/z64.h +++ b/include/z64.h @@ -205,7 +205,7 @@ typedef struct { /* 0x40 */ f32 unk_40; /* 0x44 */ f32 unk_44; /* 0x48 */ s16 unk_48; - /* 0x4A */ u8 activeType; + /* 0x4A */ u8 activeCategory; /* 0x4B */ u8 unk_4B; /* 0x4C */ s8 unk_4C; /* 0x4D */ char unk_4D[0x03]; @@ -228,8 +228,8 @@ typedef struct { } TitleCardContext; // size = 0x10 typedef struct { - /* 0x00 */ s32 length; // number of actors loaded of this type - /* 0x04 */ Actor* first; // pointer to first actor of this type + /* 0x00 */ s32 length; // number of actors loaded of this category + /* 0x04 */ Actor* head; // pointer to head of the linked list of this category (most recent actor added) } ActorListEntry; // size = 0x08 typedef struct { @@ -240,7 +240,7 @@ typedef struct { /* 0x0004 */ char unk_04[0x04]; /* 0x0008 */ u8 total; // total number of actors loaded /* 0x0009 */ char unk_09[0x03]; - /* 0x000C */ ActorListEntry actorList[12]; + /* 0x000C */ ActorListEntry actorLists[12]; /* 0x006C */ TargetContext targetCtx; struct { /* 0x0104 */ u32 swch; diff --git a/include/z64actor.h b/include/z64actor.h index 780118c9e5..f8670cc274 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -13,50 +13,47 @@ #define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects. struct Actor; -// From z64.h struct GlobalContext; - -// From z64light.h struct Lights; +typedef void (*ActorFunc)(struct Actor*, struct GlobalContext*); +typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct GlobalContext*); +typedef u16 (*callback1_800343CC)(struct GlobalContext*, struct Actor*); +typedef s16 (*callback2_800343CC)(struct GlobalContext*, struct Actor*); + typedef struct { Vec3f pos; Vec3s rot; } PosRot; // size = 0x14 - -typedef void (*ActorFunc)(struct Actor*, struct GlobalContext*); -typedef u16 (*callback1_800343CC)(struct GlobalContext*, struct Actor*); -typedef s16 (*callback2_800343CC)(struct GlobalContext*, struct Actor*); - typedef struct { /* 0x00 */ s16 id; - /* 0x02 */ u8 type; // Classifies actor and determines when actor will execute + /* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw /* 0x04 */ u32 flags; /* 0x08 */ s16 objectId; /* 0x0C */ u32 instanceSize; /* 0x10 */ ActorFunc init; // Constructor /* 0x14 */ ActorFunc destroy; // Destructor - /* 0x18 */ ActorFunc update; // Main Update Function + /* 0x18 */ ActorFunc update; // Update Function /* 0x1C */ ActorFunc draw; // Draw function } ActorInit; // size = 0x20 typedef enum { - ALLOCTYPE_NORMAL, - ALLOCTYPE_ABSOLUTE, - ALLOCTYPE_PERMANENT + /* 0 */ ALLOCTYPE_NORMAL, + /* 1 */ ALLOCTYPE_ABSOLUTE, + /* 2 */ ALLOCTYPE_PERMANENT } AllocType; typedef struct { - /* 0x00 */ u32 vromStart; - /* 0x04 */ u32 vromEnd; + /* 0x00 */ u32 vromStart; + /* 0x04 */ u32 vromEnd; /* 0x08 */ void* vramStart; /* 0x0C */ void* vramEnd; /* 0x10 */ void* loadedRamAddr; // original name: "allocp" /* 0x14 */ ActorInit* initInfo; /* 0x18 */ char* name; - /* 0x1C */ u16 allocType; - /* 0x1E */ s8 nbLoaded; // original name: "clients" + /* 0x1C */ u16 allocType; + /* 0x1E */ s8 nbLoaded; // original name: "clients" } ActorOverlay; // size = 0x20 typedef struct { @@ -65,103 +62,131 @@ typedef struct { typedef struct { /* 0x00 */ u8 health; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; + /* 0x02 */ s16 cylRadius; + /* 0x04 */ s16 cylHeight; /* 0x06 */ u8 mass; } CollisionCheckInfoInit; typedef struct { /* 0x00 */ u8 health; - /* 0x02 */ s16 unk_02; - /* 0x04 */ s16 unk_04; - /* 0x06 */ s16 unk_06; + /* 0x02 */ s16 cylRadius; + /* 0x04 */ s16 cylHeight; + /* 0x06 */ s16 cylYShift; /* 0x08 */ u8 mass; } CollisionCheckInfoInit2; typedef struct { - /* 0x00 */ DamageTable* damageTable; // For actors which contain one (example: Stalfos)... + /* 0x00 */ DamageTable* damageTable; /* 0x04 */ Vec3f displacement; // Amount to correct velocity (0x5C) by when colliding into a body - /* 0x10 */ s16 unk_10; - /* 0x12 */ s16 unk_12; - /* 0x14 */ u16 unk_14; - /* 0x16 */ u8 mass; // Used to compute displacement, 50 is common value, 0xFF for infinite mass/unmoveable - /* 0x17 */ u8 health; - /* 0x18 */ u8 damage; // Amount to decrement health by - /* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon - /* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC - /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT + /* 0x10 */ s16 cylRadius; // Used for various purposes + /* 0x12 */ s16 cylHeight; // Used for various purposes + /* 0x14 */ s16 cylYShift; // Unused. Purpose inferred from Cylinder16 and CollisionCheck_CylSideVsLineSeg + /* 0x16 */ u8 mass; // Used to compute displacement for OC collisions + /* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one + /* 0x18 */ u8 damage; // Amount to decrement health by + /* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon + /* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC + /* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT } CollisionCheckInfo; // size = 0x1C typedef struct { - /* 0x00 */ Vec3s rot; // Current actor shape rotation - /* 0x06 */ s16 unk_06; - /* 0x08 */ f32 unk_08; // Model y axis offset. Represents model space units. collision mesh related - /* 0x0C */ void (*shadowDrawFunc)(struct Actor*, struct Lights*, struct GlobalContext*); - /* 0x10 */ f32 unk_10; - /* 0x14 */ u8 unk_14; - /* 0x15 */ u8 unk_15; + /* 0x00 */ Vec3s rot; // Current actor shape rotation + /* 0x06 */ s16 face; // Used to index eyebrow/eye/mouth textures. Only used by player + /* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units + /* 0x0C */ ActorShadowFunc shadowDraw; // Shadow draw function + /* 0x10 */ f32 shadowScale; // Changes the size of the shadow + /* 0x14 */ u8 shadowAlpha; // Default is 255 + /* 0x15 */ u8 feetFloorFlags; // Set if the actor's foot is clipped under the floor. & 1 is right foot, & 2 is left + /* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDraw } ActorShape; // size = 0x18 typedef struct Actor { - /* 0x000 */ s16 id; // Actor Id - /* 0x002 */ u8 type; // Actor Type. Refer to the corresponding enum for values - /* 0x003 */ s8 room; // Room number the actor is in. -1 denotes that the actor won't despawn on a room change - /* 0x004 */ u32 flags; // Flags used for various purposes - /* 0x008 */ PosRot initPosRot; // Initial position/rotation when spawned. Is sometimes used for other purposes - /* 0x01C */ s16 params; // original name: "args_data"; Configurable variable set by an actor's spawn data - /* 0x01E */ s8 objBankIndex; // original name: "bank"; Object bank index of this actor's object dependency - /* 0x01F */ s8 unk_1F; - /* 0x020 */ u16 sfx; // Plays sound effect relative to actor's location (if within range of camera?) - /* 0x024 */ PosRot posRot; // position/rotation in the world - /* 0x038 */ PosRot posRot2; - /* 0x04C */ f32 unk_4C; - /* 0x050 */ Vec3f scale; // Sets x,y,z scaling factor. Typically, a factor of 0.01 is used for each axis - /* 0x05C */ Vec3f velocity; - /* 0x068 */ f32 speedXZ; // Always positive, stores how fast the actor is traveling along the XZ plane - /* 0x06C */ f32 gravity; // Acceleration due to gravity; value is added to Y velocity every frame - /* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis - /* 0x074 */ CollisionPoly* wallPoly; // Wall polygon an actor is touching - /* 0x078 */ CollisionPoly* floorPoly; // Floor polygon an actor is over/touching - /* 0x07C */ u8 wallPolySource; // Complex Poly Surface Source. 0x32 = Scene - /* 0x07D */ u8 floorPolySource; // Complex Poly Surface Source. 0x32 = Scene. related to 0x80/88 - /* 0x07E */ s16 wallPolyRot; // Rotation of the wall poly - /* 0x080 */ f32 groundY; // Floor poly height - /* 0x084 */ f32 yDistToWater; // Distance from water surface - /* 0x088 */ u16 bgCheckFlags; - /* 0x08A */ s16 yawTowardsLink; - /* 0x08C */ f32 xyzDistToLinkSq; - /* 0x090 */ f32 xzDistToLink; - /* 0x094 */ f32 yDistToLink; - /* 0x098 */ CollisionCheckInfo colChkInfo; - /* 0x0B4 */ ActorShape shape; - /* 0x0CC */ Vec3f unk_CC[2]; - /* 0x0E4 */ Vec3f projectedPos; // actor position in projected space - /* 0x0F0 */ f32 projectedW; // w component of the projected actor position vector - /* 0x0F4 */ f32 uncullZoneForward; // amount to increase the uncull zone forward by (in projected space) - /* 0x0F8 */ f32 uncullZoneScale; // amount to increase the uncull zone scale by (in projected space) - /* 0x0FC */ f32 uncullZoneDownward; // amount to increase uncull zone downward by (in projected space) - /* 0x100 */ Vec3f pos4; // previous position - /* 0x10C */ u8 unk_10C; // Z-Target related - /* 0x10D */ u8 unk_10D; // Z-Target related - /* 0x10E */ u16 textId; // Text id to pass to link/display when interacting with an actor - /* 0x110 */ u16 freezeTimer; - /* 0x112 */ u16 dmgEffectParams; // Specifies damage effect color (white/red/blue) and if opaque or translucent - /* 0x114 */ u8 dmgEffectTimer; - /* 0x115 */ u8 isDrawn; // Indicates whether the actor is currently being drawn (but not seen through lens) - /* 0x116 */ u8 unk_116; - /* 0x117 */ u8 naviEnemyId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF - /* 0x118 */ struct Actor* parent; - /* 0x11C */ struct Actor* child; - /* 0x120 */ struct Actor* prev; // Previous Actor of this type - /* 0x124 */ struct Actor* next; // Next Actor of this type - /* 0x128 */ ActorFunc init; // Initialization Routine. Called by Actor_Init or Actor_UpdateAll - /* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by Actor_Destroy - /* 0x130 */ ActorFunc update; // Update Routine. Called by Actor_UpdateAll - /* 0x134 */ ActorFunc draw; // Draw Routine. Called by Actor_Draw + /* 0x000 */ s16 id; // Actor ID + /* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values + /* 0x003 */ s8 room; // Room number the actor is in. -1 denotes that the actor won't despawn on a room change + /* 0x004 */ u32 flags; // Flags used for various purposes + /* 0x008 */ PosRot home; // Initial position/rotation when spawned. Can be used for other purposes + /* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data" + /* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank" + /* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on + /* 0x020 */ u16 sfx; // SFX ID to play. Sound plays when value is set, then is cleared the following update cycle + /* 0x024 */ PosRot world; // Position/rotation in the world + /* 0x038 */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot + /* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position + /* 0x050 */ Vec3f scale; // Scale of the actor in each axis + /* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis + /* 0x068 */ f32 speedXZ; // How fast the actor is traveling along the XZ plane + /* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame + /* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis + /* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching + /* 0x078 */ CollisionPoly* floorPoly; // Floor polygon directly below the actor + /* 0x07C */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching + /* 0x07D */ u8 floorBgId; // Bg ID of the floor polygon directly below the actor + /* 0x07E */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching + /* 0x080 */ f32 floorHeight; // Y position of the floor polygon directly below the actor + /* 0x084 */ f32 yDistToWater; // Distance to the surface of active waterbox. Negative value means above water + /* 0x088 */ u16 bgCheckFlags; // See comments below actor struct for wip docs. TODO: macros for these flags + /* 0x08A */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player + /* 0x08C */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player in the x,y,z axis + /* 0x090 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane + /* 0x094 */ f32 yDistToPlayer; // Dist is negative if the actor is above the player + /* 0x098 */ CollisionCheckInfo colChkInfo; // Variables related to the Collision Check system + /* 0x0B4 */ ActorShape shape; // Variables related to the physical shape of the actor + /* 0x0E4 */ Vec3f projectedPos; // Position of the actor in projected space + /* 0x0F0 */ f32 projectedW; // w component of the projected actor position + /* 0x0F4 */ f32 uncullZoneForward; // Amount to increase the uncull zone forward by (in projected space) + /* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space) + /* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space) + /* 0x100 */ Vec3f prevPos; // World position from the previous update cycle + /* 0x10C */ u8 isTargeted; // Set to true if the actor is currently being targeted by the player + /* 0x10D */ u8 targetPriority; // Lower values have higher priority. Resets to 0 when player stops targeting + /* 0x10E */ u16 textId; // Text ID to pass to link/display when interacting with the actor + /* 0x110 */ u16 freezeTimer; // Actor does not update when set. Timer decrements automatically + /* 0x112 */ u16 colorFilterParams; // Set color filter to red, blue, or white. Toggle opa or xlu + /* 0x114 */ u8 colorFilterTimer; // A non-zero value enables the color filter. Decrements automatically + /* 0x115 */ u8 isDrawn; // Set to true if the actor is currently being drawn. Always stays false for lens actors + /* 0x116 */ u8 dropFlag; // Configures what item is dropped by the actor from `Item_DropCollectibleRandom` + /* 0x117 */ u8 naviEnemyId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF + /* 0x118 */ struct Actor* parent; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild` + /* 0x11C */ struct Actor* child; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild` + /* 0x120 */ struct Actor* prev; // Previous actor of this category + /* 0x124 */ struct Actor* next; // Next actor of this category + /* 0x128 */ ActorFunc init; // Initialization Routine. Called by `Actor_Init` or `Actor_UpdateAll` + /* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy` + /* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll` + /* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw` /* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor - /* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom + /* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom } Actor; // size = 0x14C +typedef enum { + /* 0 */ FOOT_LEFT, + /* 1 */ FOOT_RIGHT +} ActorFootIndex; + +/* +BgCheckFlags WIP documentation: +& 0x001 : Standing on the ground +& 0x002 : Has touched the ground (only active for 1 frame) +& 0x004 : Has left the ground (only active for 1 frame) +& 0x008 : Touching a wall +& 0x010 : Touching a ceiling +& 0x020 : On or below water surface +& 0x040 : Has touched water (actor is responsible for unsetting this the frame it touches the water) +& 0x080 : Similar to & 0x1 but with no velocity check and is cleared every frame +& 0x100 : Crushed between a floor and ceiling (triggers a void for player) +& 0x200 : Unknown (only set/used by player so far) +*/ + +/* +colorFilterParams WIP documentation +& 0x8000 : white +& 0x4000 : red +if neither of the above are set : blue + +(& 0x1F00 >> 5) | 7 : color intensity +0x2000 : translucent, else opaque +*/ typedef struct DynaPolyActor { /* 0x000 */ struct Actor actor; @@ -264,19 +289,19 @@ typedef struct EnAObj { } EnAObj; // size = 0x1C8 typedef enum { - /* 0x00 */ ACTORTYPE_SWITCH, - /* 0x01 */ ACTORTYPE_BG, - /* 0x02 */ ACTORTYPE_PLAYER, - /* 0x03 */ ACTORTYPE_EXPLOSIVES, - /* 0x04 */ ACTORTYPE_NPC, - /* 0x05 */ ACTORTYPE_ENEMY, - /* 0x06 */ ACTORTYPE_PROP, - /* 0x07 */ ACTORTYPE_ITEMACTION, - /* 0x08 */ ACTORTYPE_MISC, - /* 0x09 */ ACTORTYPE_BOSS, - /* 0x0A */ ACTORTYPE_DOOR, - /* 0x0B */ ACTORTYPE_CHEST -} ActorType; + /* 0x00 */ ACTORCAT_SWITCH, + /* 0x01 */ ACTORCAT_BG, + /* 0x02 */ ACTORCAT_PLAYER, + /* 0x03 */ ACTORCAT_EXPLOSIVE, + /* 0x04 */ ACTORCAT_NPC, + /* 0x05 */ ACTORCAT_ENEMY, + /* 0x06 */ ACTORCAT_PROP, + /* 0x07 */ ACTORCAT_ITEMACTION, + /* 0x08 */ ACTORCAT_MISC, + /* 0x09 */ ACTORCAT_BOSS, + /* 0x0A */ ACTORCAT_DOOR, + /* 0x0B */ ACTORCAT_CHEST +} ActorCategory; typedef enum { /* 0x0000 */ ACTOR_PLAYER, diff --git a/include/z64camera.h b/include/z64camera.h index 71ff853f57..cca2a8ff69 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -677,9 +677,9 @@ typedef struct { * & 0x00FF = atInitFlags * & 0xFF00 = eyeInitFlags * 0x1: Direct Copy of atTargetInit - * if initFlags & 0x6060: use posRot2 for focus point + * if initFlags & 0x6060: use head for focus point * 0x2: Add atTargetInit to view's lookAt - * if initFlags & 0x6060: use posRot for focus point + * if initFlags & 0x6060: use world for focus point * 0x3: Add atTargetInit to camera's at * 0x4: Don't update targets? * 0x8: flag to use atTagetInit as f32 pitch, yaw, r diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 9673fc86ae..1b2f73c480 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -22,9 +22,9 @@ void func_800430A0(CollisionContext* colCtx, s32 bgId, Actor* actor) { colCtx->dyna.bgActors[bgId].curTransform.rot.x, colCtx->dyna.bgActors[bgId].curTransform.rot.y, colCtx->dyna.bgActors[bgId].curTransform.rot.z, colCtx->dyna.bgActors[bgId].curTransform.pos.x, colCtx->dyna.bgActors[bgId].curTransform.pos.y, colCtx->dyna.bgActors[bgId].curTransform.pos.z); - SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->posRot.pos, &tempPos); + SkinMatrix_Vec3fMtxFMultXYZ(&prevTransformInv, &actor->world.pos, &tempPos); SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &pos); - actor->posRot.pos = pos; + actor->world.pos = pos; if (BGCHECK_XYZ_ABSMAX <= pos.x || pos.x <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.y || pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) { @@ -52,7 +52,7 @@ void func_800432A0(CollisionContext* colCtx, s32 bgId, Actor* actor) { } actor->shape.rot.y += rot; - actor->posRot.rot.y += rot; + actor->world.rot.y += rot; } } diff --git a/src/code/code_80043480.c b/src/code/code_80043480.c index 900dd9683e..fe8097eb97 100644 --- a/src/code/code_80043480.c +++ b/src/code/code_80043480.c @@ -20,8 +20,8 @@ void func_800434B8(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 2; } -void func_800434C8(CollisionContext* colCtx, s32 floorPolySource) { - DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource); +void func_800434C8(CollisionContext* colCtx, s32 floorBgId) { + DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId); if (dynaActor != NULL) { func_800434B8(dynaActor); @@ -32,8 +32,8 @@ void func_800434F8(DynaPolyActor* dynaActor) { dynaActor->unk_160 |= 4; } -void func_80043508(CollisionContext* colCtx, s32 floorPolySource) { - DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorPolySource); +void func_80043508(CollisionContext* colCtx, s32 floorBgId) { + DynaPolyActor* dynaActor = (DynaPolyActor*)DynaPoly_GetActor(colCtx, floorBgId); if (dynaActor != NULL) { func_800434F8(dynaActor); @@ -93,9 +93,9 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16 sign = (0.0f <= actor->unk_150) ? 1.0f : -1.0f; a2 = (f32)arg2 - 0.1f; - posA.x = actor->actor.posRot.pos.x + (a2 * cos); - posA.y = actor->actor.posRot.pos.y + arg4; - posA.z = actor->actor.posRot.pos.z - (a2 * sin); + posA.x = actor->actor.world.pos.x + (a2 * cos); + posA.y = actor->actor.world.pos.y + arg4; + posA.z = actor->actor.world.pos.z - (a2 * sin); a3 = (f32)arg3 - 0.1f; posB.x = sign * a3 * sin + posA.x; @@ -105,8 +105,8 @@ s32 func_800435D8(GlobalContext* globalCtx, DynaPolyActor* actor, s16 arg2, s16 actor, 0.0f)) { return false; } - posA.x = (actor->actor.posRot.pos.x * 2) - posA.x; - posA.z = (actor->actor.posRot.pos.z * 2) - posA.z; + posA.x = (actor->actor.world.pos.x * 2) - posA.x; + posA.z = (actor->actor.world.pos.z * 2) - posA.z; posB.x = sign * a3 * sin + posA.x; posB.z = sign * a3 * cos + posA.z; if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &posA, &posB, &posResult, &poly, true, false, false, true, &bgId, diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 40799d3529..e1c68a76dc 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -5,20 +5,20 @@ #include "overlays/actors/ovl_En_Part/z_en_part.h" #include "objects/gameplay_keep/gameplay_keep.h" -void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3) { - shape->unk_08 = arg1; - shape->shadowDrawFunc = shadowDrawFunc; - shape->unk_10 = arg3; - shape->unk_14 = -1; +void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc* shadowDraw, f32 shadowScale) { + shape->yOffset = yOffset; + shape->shadowDraw = shadowDraw; + shape->shadowScale = shadowScale; + shape->shadowAlpha = 255; } -void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* dlist, Color_RGBA8* color) { +void ActorShadow_Draw(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* dlist, Color_RGBA8* color) { f32 temp1; f32 temp2; MtxF sp60; if (actor->floorPoly != NULL) { - temp1 = actor->posRot.pos.y - actor->groundY; + temp1 = actor->world.pos.y - actor->floorHeight; if (temp1 >= -50.0f && temp1 < 500.0f) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 1553); @@ -33,19 +33,19 @@ void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* if (color != NULL) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color->r, color->g, color->b, - (u32)(actor->shape.unk_14 * temp2) & 0xFF); + (u32)(actor->shape.shadowAlpha * temp2) & 0xFF); } else { - gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u32)(actor->shape.unk_14 * temp2) & 0xFF); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 0, (u32)(actor->shape.shadowAlpha * temp2) & 0xFF); } - func_80038A28(actor->floorPoly, actor->posRot.pos.x, actor->groundY, actor->posRot.pos.z, &sp60); + func_80038A28(actor->floorPoly, actor->world.pos.x, actor->floorHeight, actor->world.pos.z, &sp60); Matrix_Put(&sp60); if (dlist != D_04049210) { Matrix_RotateY(actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); } - temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.unk_10; + temp2 = (1.0f - (temp1 * (1.0f / 350))) * actor->shape.shadowScale; Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1588), @@ -57,21 +57,21 @@ void func_8002B200(Actor* actor, Lights* lights, GlobalContext* globalCtx, Gfx* } } -void ActorShadow_DrawFunc_Circle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - func_8002B200(actor, lights, globalCtx, &D_04049210, NULL); +void ActorShadow_DrawCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + ActorShadow_Draw(actor, lights, globalCtx, D_04049210, NULL); } -Color_RGBA8 D_80115F80 = { 255, 255, 255, 255 }; +void ActorShadow_DrawWhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + static Color_RGBA8 white = { 255, 255, 255, 255 }; -void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - func_8002B200(actor, lights, globalCtx, &D_04049210, &D_80115F80); + ActorShadow_Draw(actor, lights, globalCtx, D_04049210, &white); } -void ActorShadow_DrawFunc_Squiggly(Actor* actor, Lights* lights, GlobalContext* globalCtx) { - func_8002B200(actor, lights, globalCtx, D_04049AD0, NULL); +void ActorShadow_DrawHorse(Actor* actor, Lights* lights, GlobalContext* globalCtx) { + ActorShadow_Draw(actor, lights, globalCtx, D_04049AD0, NULL); } -void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) { +void ActorShadow_DrawFoot(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) { s32 pad1; f32 sp58; s32 pad2[2]; @@ -97,7 +97,7 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, #ifdef NON_MATCHING // saved register, stack usage and minor ordering differences -void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* globalCtx) { +void ActorShadow_DrawFeet(Actor* actor, Lights* lights, GlobalContext* globalCtx) { MtxF spE8; f32 spE0[2]; s32 i; @@ -118,20 +118,20 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* s32 phi_s1; s32 phi_s2; - temp_f20 = actor->posRot.pos.y - actor->groundY; + temp_f20 = actor->world.pos.y - actor->floorHeight; if (temp_f20 > 20.0f) { - temp_10 = actor->shape.unk_10; - temp_14 = actor->shape.unk_14; - actor->shape.unk_10 *= 0.3f; - actor->shape.unk_14 *= ((temp_f20 - 20.0f) * 0.02f) > 1.0f ? 1.0f : ((temp_f20 - 20.0f) * 0.02f); - ActorShadow_DrawFunc_Circle(actor, lights, globalCtx); - actor->shape.unk_10 = temp_10; - actor->shape.unk_14 = temp_14; + temp_10 = actor->shape.shadowScale; + temp_14 = actor->shape.shadowAlpha; + actor->shape.shadowScale *= 0.3f; + actor->shape.shadowAlpha *= ((temp_f20 - 20.0f) * 0.02f) > 1.0f ? 1.0f : ((temp_f20 - 20.0f) * 0.02f); + ActorShadow_DrawCircle(actor, lights, globalCtx); + actor->shape.shadowScale = temp_10; + actor->shape.shadowAlpha = temp_14; } if (temp_f20 < 200.0f) { - phi_s7 = &actor->unk_CC[0]; + phi_s7 = &actor->shape.feetPos[FOOT_LEFT]; spAC = &spE0[0]; temp_s6 = lights->numLights; temp_s6 -= 2; @@ -139,14 +139,14 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 1741); POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP, 0x2C); - actor->shape.unk_15 = 0; + actor->shape.feetFloorFlags = 0; for (i = 0; i < 2; i++) { phi_s7->y += 50.0f; *spAC = func_800BFCB8(globalCtx, &spE8, phi_s7); phi_s7->y -= 50.0f; - actor->shape.unk_15 *= 2; + actor->shape.feetFloorFlags *= 2; phi_f2 = phi_s7->y - *spAC; @@ -154,21 +154,21 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* phi_s0 = &lights->l.l[0]; if (phi_f2 <= 0.0f) { - actor->shape.unk_15++; + actor->shape.feetFloorFlags++; } if (30.0f < phi_f2) { phi_f2 = 30.0f; } - temp_f24 = actor->shape.unk_14 * (1.0f - (phi_f2 * (1.0f / 30))); + temp_f24 = actor->shape.shadowAlpha * (1.0f - (phi_f2 * (1.0f / 30))); if (30.0f < phi_f2) { phi_f2 = 30.0f; } temp_f20_2 = 1.0f - (phi_f2 * (1.0f / 70)); - temp_f22_2 = (actor->shape.unk_10 * temp_f20_2) * actor->scale.x; + temp_f22_2 = (actor->shape.shadowScale * temp_f20_2) * actor->scale.x; phi_s2 = 0; @@ -176,7 +176,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* if (phi_s0->l.dir[1] > 0) { temp_lo = ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2]); if (temp_lo > 0) { - func_8002B66C(globalCtx, phi_s0, &spE8, temp_lo, temp_f24, temp_f22_2, temp_f20_2); + ActorShadow_DrawFoot(globalCtx, phi_s0, &spE8, temp_lo, temp_f24, temp_f22_2, temp_f20_2); phi_s2 += temp_lo; } } @@ -188,7 +188,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* temp_a3 = (ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2])) - (phi_s2 * 8); if (temp_a3 > 0) { - func_8002B66C(globalCtx, phi_s0, &spE8, temp_a3, temp_f24, temp_f22_2, temp_f20_2); + ActorShadow_DrawFoot(globalCtx, phi_s0, &spE8, temp_a3, temp_f24, temp_f22_2, temp_f20_2); } } phi_s0++; @@ -200,24 +200,25 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, Lights* lights, GlobalContext* } if (!(actor->bgCheckFlags & 1)) { - actor->shape.unk_15 = 0; - } else if (actor->shape.unk_15 == 3) { - temp_f0 = actor->unk_CC[0].y - actor->unk_CC[1].y; - actor->shape.unk_15 = ((spE0[0] + temp_f0) < (spE0[1] - temp_f0)) ? 2 : 1; + actor->shape.feetFloorFlags = 0; + } else if (actor->shape.feetFloorFlags == 3) { + temp_f0 = actor->shape.feetPos[FOOT_LEFT].y - actor->shape.feetPos[FOOT_RIGHT].y; + actor->shape.feetFloorFlags = ((spE0[0] + temp_f0) < (spE0[1] - temp_f0)) ? 2 : 1; } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 1831); } } #else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_DrawFeet.s") #endif -void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, Vec3f* arg3, s32 arg4, Vec3f* arg5) { - if (arg1 == arg2) { - Matrix_MultVec3f(arg3, &actor->unk_CC[0]); - } else if (arg1 == arg4) { - Matrix_MultVec3f(arg5, &actor->unk_CC[1]); +void Actor_SetFeetPos(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, + Vec3f* rightFootPos) { + if (limbIndex == leftFootIndex) { + Matrix_MultVec3f(leftFootPos, &actor->shape.feetPos[FOOT_LEFT]); + } else if (limbIndex == rightFootIndex) { + Matrix_MultVec3f(rightFootPos, &actor->shape.feetPos[FOOT_RIGHT]); } } @@ -253,7 +254,7 @@ void func_8002BE64(TargetContext* targetCtx, s32 index, f32 arg2, f32 arg3, f32 targetCtx->arr_50[index].unk_0C = targetCtx->unk_44; } -void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globalCtx) { +void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, GlobalContext* globalCtx) { TargetContextEntry* entry; NaviColor* naviColor; s32 i; @@ -262,7 +263,7 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa targetCtx->unk_44 = 500.0f; targetCtx->unk_48 = 0x100; - naviColor = &sNaviColorList[actorType]; + naviColor = &sNaviColorList[actorCategory]; entry = &targetCtx->arr_50[0]; for (i = 0; i < ARRAY_COUNT(targetCtx->arr_50); i++) { @@ -274,11 +275,11 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa } } -void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, GlobalContext* globalCtx) { - NaviColor* naviColor = &sNaviColorList[actorType]; - targetCtx->naviRefPos.x = actor->posRot2.pos.x; - targetCtx->naviRefPos.y = actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y); - targetCtx->naviRefPos.z = actor->posRot2.pos.z; +void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, GlobalContext* globalCtx) { + NaviColor* naviColor = &sNaviColorList[actorCategory]; + targetCtx->naviRefPos.x = actor->focus.pos.x; + targetCtx->naviRefPos.y = actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y); + targetCtx->naviRefPos.z = actor->focus.pos.z; targetCtx->naviInner.r = naviColor->inner.r; targetCtx->naviInner.g = naviColor->inner.g; targetCtx->naviInner.b = naviColor->inner.b; @@ -297,8 +298,8 @@ void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* global targetCtx->unk_90 = NULL; targetCtx->unk_4B = 0; targetCtx->unk_4C = 0; - func_8002BF60(targetCtx, actor, actor->type, globalCtx); - func_8002BE98(targetCtx, actor->type, globalCtx); + func_8002BF60(targetCtx, actor, actor->category, globalCtx); + func_8002BE98(targetCtx, actor->category, globalCtx); } void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { @@ -332,7 +333,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { } if (actor != NULL) { - Math_Vec3f_Copy(&targetCtx->targetCenterPos, &actor->posRot2.pos); + Math_Vec3f_Copy(&targetCtx->targetCenterPos, &actor->focus.pos); var1 = (500.0f - targetCtx->unk_44) / 420.0f; } else { targetCtx->unk_48 -= 120; @@ -400,12 +401,12 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { actor = targetCtx->unk_94; if ((actor != NULL) && !(actor->flags & 0x8000000)) { - NaviColor* naviColor = &sNaviColorList[actor->type]; + NaviColor* naviColor = &sNaviColorList[actor->category]; POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x7); - Matrix_Translate(actor->posRot2.pos.x, actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y) + 17.0f, - actor->posRot2.pos.z, MTXMODE_NEW); + Matrix_Translate(actor->focus.pos.x, actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y) + 17.0f, + actor->focus.pos.z, MTXMODE_NEW); Matrix_RotateY((f32)((u16)(globalCtx->gameplayFrames * 3000)) * (M_PI / 32768), MTXMODE_APPLY); Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, MTXMODE_APPLY); @@ -421,7 +422,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, GlobalContext* globalCtx) { s32 pad; Actor* unkActor; - s32 actorType; + s32 actorCategory; Vec3f sp50; f32 sp4C; f32 temp1; @@ -449,14 +450,14 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl } if (unkActor != NULL) { - actorType = unkActor->type; + actorCategory = unkActor->category; } else { - actorType = player->actor.type; + actorCategory = player->actor.category; } - if ((unkActor != targetCtx->arrowPointedActor) || (actorType != targetCtx->activeType)) { + if ((unkActor != targetCtx->arrowPointedActor) || (actorCategory != targetCtx->activeCategory)) { targetCtx->arrowPointedActor = unkActor; - targetCtx->activeType = actorType; + targetCtx->activeCategory = actorCategory; targetCtx->unk_40 = 1.0f; } @@ -466,18 +467,18 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl if (Math_StepToF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) { temp1 = 0.25f / targetCtx->unk_40; - temp2 = unkActor->posRot.pos.x - targetCtx->naviRefPos.x; - temp3 = (unkActor->posRot.pos.y + (unkActor->unk_4C * unkActor->scale.y)) - targetCtx->naviRefPos.y; - temp4 = unkActor->posRot.pos.z - targetCtx->naviRefPos.z; + temp2 = unkActor->world.pos.x - targetCtx->naviRefPos.x; + temp3 = (unkActor->world.pos.y + (unkActor->targetArrowOffset * unkActor->scale.y)) - targetCtx->naviRefPos.y; + temp4 = unkActor->world.pos.z - targetCtx->naviRefPos.z; targetCtx->naviRefPos.x += temp2 * temp1; targetCtx->naviRefPos.y += temp3 * temp1; targetCtx->naviRefPos.z += temp4 * temp1; } else { - func_8002BF60(targetCtx, unkActor, actorType, globalCtx); + func_8002BF60(targetCtx, unkActor, actorCategory, globalCtx); } if ((actorArg != NULL) && (targetCtx->unk_4B == 0)) { - func_8002BE04(globalCtx, &actorArg->posRot2.pos, &sp50, &sp4C); + func_8002BE04(globalCtx, &actorArg->focus.pos, &sp50, &sp4C); if (((sp50.z <= 0.0f) || (1.0f <= fabsf(sp50.x * sp4C))) || (1.0f <= fabsf(sp50.y * sp4C))) { actorArg = NULL; } @@ -485,7 +486,7 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl if (actorArg != NULL) { if (actorArg != targetCtx->targetedActor) { - func_8002BE98(targetCtx, actorArg->type, globalCtx); + func_8002BE98(targetCtx, actorArg->category, globalCtx); targetCtx->targetedActor = actorArg; if (actorArg->id == ACTOR_EN_BOOM) { @@ -496,9 +497,9 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl func_80078884(lockOnSfxId); } - targetCtx->targetCenterPos.x = actorArg->posRot.pos.x; - targetCtx->targetCenterPos.y = actorArg->posRot.pos.y - (actorArg->shape.unk_08 * actorArg->scale.y); - targetCtx->targetCenterPos.z = actorArg->posRot.pos.z; + targetCtx->targetCenterPos.x = actorArg->world.pos.x; + targetCtx->targetCenterPos.y = actorArg->world.pos.y - (actorArg->shape.yOffset * actorArg->scale.y); + targetCtx->targetCenterPos.z = actorArg->world.pos.z; if (targetCtx->unk_4B == 0) { temp5 = (500.0f - targetCtx->unk_44) * 3.0f; @@ -775,26 +776,26 @@ void Actor_Kill(Actor* actor) { actor->flags &= ~0x1; } -void Actor_InitPosRot(Actor* actor) { - actor->posRot = actor->initPosRot; +void Actor_SetWorldToHome(Actor* actor) { + actor->world = actor->home; } -void Actor_SetHeight(Actor* actor, f32 offset) { - actor->posRot2.pos.x = actor->posRot.pos.x; - actor->posRot2.pos.y = actor->posRot.pos.y + offset; - actor->posRot2.pos.z = actor->posRot.pos.z; +void Actor_SetFocus(Actor* actor, f32 yOffset) { + actor->focus.pos.x = actor->world.pos.x; + actor->focus.pos.y = actor->world.pos.y + yOffset; + actor->focus.pos.z = actor->world.pos.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; + actor->focus.rot.x = actor->world.rot.x; + actor->focus.rot.y = actor->world.rot.y; + actor->focus.rot.z = actor->world.rot.z; } -void func_8002D5F4(Actor* actor) { - actor->posRot.rot = actor->shape.rot; +void Actor_SetWorldRotToShape(Actor* actor) { + actor->world.rot = actor->shape.rot; } -void func_8002D610(Actor* actor) { - actor->shape.rot = actor->posRot.rot; +void Actor_SetShapeRotToWorld(Actor* actor) { + actor->shape.rot = actor->world.rot; } void Actor_SetScale(Actor* actor, f32 scale) { @@ -808,20 +809,20 @@ void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor) { } void Actor_Init(Actor* actor, GlobalContext* globalCtx) { - Actor_InitPosRot(actor); - func_8002D610(actor); - Actor_SetHeight(actor, 0.0f); - Math_Vec3f_Copy(&actor->pos4, &actor->posRot.pos); + Actor_SetWorldToHome(actor); + Actor_SetShapeRotToWorld(actor); + Actor_SetFocus(actor, 0.0f); + Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); Actor_SetScale(actor, 0.01f); - actor->unk_1F = 3; + actor->targetMode = 3; actor->minVelocityY = -20.0f; - actor->xyzDistToLinkSq = FLT_MAX; + actor->xyzDistToPlayerSq = FLT_MAX; actor->naviEnemyId = 0xFF; actor->uncullZoneForward = 1000.0f; actor->uncullZoneScale = 350.0f; actor->uncullZoneDownward = 700.0f; CollisionCheck_InitInfo(&actor->colChkInfo); - actor->floorPolySource = BGCHECK_SCENE; + actor->floorBgId = BGCHECK_SCENE; ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_SetObjectDependency(globalCtx, actor); @@ -848,14 +849,14 @@ void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) { void func_8002D7EC(Actor* actor) { f32 speedRate = R_UPDATE_RATE * 0.5f; - actor->posRot.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x; - actor->posRot.pos.y += (actor->velocity.y * speedRate) + actor->colChkInfo.displacement.y; - actor->posRot.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z; + actor->world.pos.x += (actor->velocity.x * speedRate) + actor->colChkInfo.displacement.x; + actor->world.pos.y += (actor->velocity.y * speedRate) + actor->colChkInfo.displacement.y; + actor->world.pos.z += (actor->velocity.z * speedRate) + actor->colChkInfo.displacement.z; } void func_8002D868(Actor* actor) { - actor->velocity.x = Math_SinS(actor->posRot.rot.y) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->posRot.rot.y) * actor->speedXZ; + actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ; + actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ; actor->velocity.y += actor->gravity; if (actor->velocity.y < actor->minVelocityY) { @@ -869,10 +870,10 @@ void Actor_MoveForward(Actor* actor) { } void func_8002D908(Actor* actor) { - f32 sp24 = Math_CosS(actor->posRot.rot.x) * actor->speedXZ; - actor->velocity.x = Math_SinS(actor->posRot.rot.y) * sp24; - actor->velocity.y = Math_SinS(actor->posRot.rot.x) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->posRot.rot.y) * sp24; + f32 sp24 = Math_CosS(actor->world.rot.x) * actor->speedXZ; + actor->velocity.x = Math_SinS(actor->world.rot.y) * sp24; + actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ; + actor->velocity.z = Math_CosS(actor->world.rot.y) * sp24; } void func_8002D97C(Actor* actor) { @@ -881,56 +882,56 @@ void func_8002D97C(Actor* actor) { } void func_8002D9A4(Actor* actor, f32 arg1) { - actor->speedXZ = Math_CosS(actor->posRot.rot.x) * arg1; - actor->velocity.y = -Math_SinS(actor->posRot.rot.x) * arg1; + actor->speedXZ = Math_CosS(actor->world.rot.x) * arg1; + actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1; } void func_8002D9F8(Actor* actor, SkelAnime* skelAnime) { Vec3f sp1C; SkelAnime_UpdateTranslation(skelAnime, &sp1C, actor->shape.rot.y); - actor->posRot.pos.x += sp1C.x * actor->scale.x; - actor->posRot.pos.y += sp1C.y * actor->scale.y; - actor->posRot.pos.z += sp1C.z * actor->scale.z; + actor->world.pos.x += sp1C.x * actor->scale.x; + actor->world.pos.y += sp1C.y * actor->scale.y; + actor->world.pos.z += sp1C.z * actor->scale.z; } -s16 func_8002DA78(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Yaw(&actorA->posRot.pos, &actorB->posRot.pos); +s16 Actor_WorldYawTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Yaw(&actorA->world.pos, &actorB->world.pos); } -s16 func_8002DA9C(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Yaw(&actorA->posRot2.pos, &actorB->posRot2.pos); +s16 Actor_FocusYawTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Yaw(&actorA->focus.pos, &actorB->focus.pos); } -s16 func_8002DAC0(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_Yaw(&actor->posRot.pos, arg1); +s16 Actor_WorldYawTowardPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_Yaw(&actor->world.pos, refPoint); } -s16 func_8002DAE0(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Pitch(&actorA->posRot.pos, &actorB->posRot.pos); +s16 Actor_WorldPitchTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Pitch(&actorA->world.pos, &actorB->world.pos); } -s16 func_8002DB04(Actor* actorA, Actor* actorB) { - return Math_Vec3f_Pitch(&actorA->posRot2.pos, &actorB->posRot2.pos); +s16 Actor_FocusPitchTowardActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_Pitch(&actorA->focus.pos, &actorB->focus.pos); } -s16 func_8002DB28(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_Pitch(&actor->posRot.pos, arg1); +s16 Actor_WorldPitchTowardPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_Pitch(&actor->world.pos, refPoint); } -f32 func_8002DB48(Actor* actorA, Actor* actorB) { - return Math_Vec3f_DistXYZ(&actorA->posRot.pos, &actorB->posRot.pos); +f32 Actor_WorldDistXYZToActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_DistXYZ(&actorA->world.pos, &actorB->world.pos); } -f32 func_8002DB6C(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_DistXYZ(&actor->posRot.pos, arg1); +f32 Actor_WorldDistXYZToPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_DistXYZ(&actor->world.pos, refPoint); } -f32 func_8002DB8C(Actor* actorA, Actor* actorB) { - return Math_Vec3f_DistXZ(&actorA->posRot.pos, &actorB->posRot.pos); +f32 Actor_WorldDistXZToActor(Actor* actorA, Actor* actorB) { + return Math_Vec3f_DistXZ(&actorA->world.pos, &actorB->world.pos); } -f32 func_8002DBB0(Actor* actor, Vec3f* arg1) { - return Math_Vec3f_DistXZ(&actor->posRot.pos, arg1); +f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) { + return Math_Vec3f_DistXZ(&actor->world.pos, refPoint); } void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) { @@ -941,16 +942,16 @@ void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) { cosRot2Y = Math_CosS(actor->shape.rot.y); sinRot2Y = Math_SinS(actor->shape.rot.y); - deltaX = arg2->x - actor->posRot.pos.x; - deltaZ = arg2->z - actor->posRot.pos.z; + deltaX = arg2->x - actor->world.pos.x; + deltaZ = arg2->z - actor->world.pos.z; result->x = (deltaX * cosRot2Y) - (deltaZ * sinRot2Y); result->z = (deltaX * sinRot2Y) + (deltaZ * cosRot2Y); - result->y = arg2->y - actor->posRot.pos.y; + result->y = arg2->y - actor->world.pos.y; } f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) { - return actorB->posRot.pos.y - actorA->posRot.pos.y; + return actorB->world.pos.y - actorA->world.pos.y; } f32 Player_GetHeight(Player* player) { @@ -1002,7 +1003,7 @@ s32 func_8002DDF4(GlobalContext* globalCtx) { void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) { ArmsHook* hookshot; - hookshot = (ArmsHook*)Actor_Find(&globalCtx->actorCtx, ACTOR_ARMS_HOOK, ACTORTYPE_ITEMACTION); + hookshot = (ArmsHook*)Actor_Find(&globalCtx->actorCtx, ACTOR_ARMS_HOOK, ACTORCAT_ITEMACTION); hookshot->grabbed = actorB; hookshot->grabbedDistDiff.x = 0.0f; hookshot->grabbedDistDiff.y = 0.0f; @@ -1062,7 +1063,7 @@ void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2) { s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx) { Player* player = PLAYER; - s16 var = (s16)(actor->yawTowardsLink + 0x8000) - player->actor.shape.rot.y; + s16 var = (s16)(actor->yawTowardsPlayer + 0x8000) - player->actor.shape.rot.y; if (ABS(var) < arg1) { return 1; @@ -1072,7 +1073,7 @@ s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx) { } s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2) { - s16 var = (s16)(func_8002DA78(actorA, actorB) + 0x8000) - actorB->shape.rot.y; + s16 var = (s16)(Actor_WorldYawTowardActor(actorA, actorB) + 0x8000) - actorB->shape.rot.y; if (ABS(var) < arg2) { return 1; @@ -1082,7 +1083,7 @@ s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2) { } s32 func_8002E084(Actor* actor, s16 arg1) { - s16 var = actor->yawTowardsLink - actor->shape.rot.y; + s16 var = actor->yawTowardsPlayer - actor->shape.rot.y; if (ABS(var) < arg1) { return 1; @@ -1092,7 +1093,7 @@ s32 func_8002E084(Actor* actor, s16 arg1) { } s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2) { - s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y; + s16 var = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y; if (ABS(var) < arg2) { return 1; @@ -1102,10 +1103,10 @@ s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2) { } s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2) { - s16 var = actor->yawTowardsLink - actor->shape.rot.y; + s16 var = actor->yawTowardsPlayer - actor->shape.rot.y; if (ABS(var) < arg2) { - f32 xyzDistanceFromLink = sqrtf(SQ(actor->xzDistToLink) + SQ(actor->yDistToLink)); + f32 xyzDistanceFromLink = sqrtf(SQ(actor->xzDistToPlayer) + SQ(actor->yDistToPlayer)); if (xyzDistanceFromLink < arg1) { return 1; @@ -1116,8 +1117,8 @@ s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2) { } s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3) { - if (func_8002DB48(actorA, actorB) < arg2) { - s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y; + if (Actor_WorldDistXYZToActor(actorA, actorB) < arg2) { + s16 var = Actor_WorldYawTowardActor(actorA, actorB) - actorA->shape.rot.y; if (ABS(var) < arg3) { return 1; @@ -1142,40 +1143,41 @@ s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2) { return 1; } -CollisionPoly* D_8015BBA0; -s32 D_8015BBA4; +CollisionPoly* sCurCeilingPoly; +s32 sCurCeilingBgId; s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) { - f32 sp34; - s32 bgId; + f32 floorHeightDiff; + s32 floorBgId; arg2->y += 50.0f; - actor->groundY = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &bgId, actor, arg2); + actor->floorHeight = + BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &floorBgId, actor, arg2); actor->bgCheckFlags &= ~0x0086; - if (actor->groundY <= BGCHECK_Y_MIN) { + if (actor->floorHeight <= BGCHECK_Y_MIN) { return func_8002E234(actor, BGCHECK_Y_MIN, arg3); } - sp34 = actor->groundY - actor->posRot.pos.y; - actor->floorPolySource = bgId; + floorHeightDiff = actor->floorHeight - actor->world.pos.y; + actor->floorBgId = floorBgId; - if (sp34 >= 0.0f) { + if (floorHeightDiff >= 0.0f) { // actor is on or below the ground actor->bgCheckFlags |= 0x80; if (actor->bgCheckFlags & 0x10) { - if (bgId != D_8015BBA4) { - if (sp34 > 15.0f) { + if (floorBgId != sCurCeilingBgId) { + if (floorHeightDiff > 15.0f) { actor->bgCheckFlags |= 0x100; } } else { - actor->posRot.pos.x = actor->pos4.x; - actor->posRot.pos.z = actor->pos4.z; + actor->world.pos.x = actor->prevPos.x; + actor->world.pos.z = actor->prevPos.z; } } - actor->posRot.pos.y = actor->groundY; + actor->world.pos.y = actor->floorHeight; if (actor->velocity.y <= 0.0f) { if (!(actor->bgCheckFlags & 0x1)) { @@ -1187,81 +1189,81 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) } actor->bgCheckFlags |= 0x1; - func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource); + func_80043334(&globalCtx->colCtx, actor, actor->floorBgId); } - } else { - if ((actor->bgCheckFlags & 0x1) && (sp34 >= -11.0f)) { - func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource); + } else { // actor is above ground + if ((actor->bgCheckFlags & 0x1) && (floorHeightDiff >= -11.0f)) { + func_80043334(&globalCtx->colCtx, actor, actor->floorBgId); } - return func_8002E234(actor, sp34, arg3); + return func_8002E234(actor, floorHeightDiff, arg3); } return 1; } -void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { +void Actor_UpdateBgCheckInfo(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5) { f32 sp74; s32 pad; Vec3f sp64; s32 bgId; - CollisionPoly* sp5C; + CollisionPoly* wallPoly; f32 sp58; WaterBox* waterBox; - f32 sp50; + f32 waterBoxYSurface; Vec3f ripplePos; - sp74 = actor->posRot.pos.y - actor->pos4.y; + sp74 = actor->world.pos.y - actor->prevPos.y; - if ((actor->floorPolySource != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) { - func_800433A4(&globalCtx->colCtx, actor->floorPolySource, actor); + if ((actor->floorBgId != BGCHECK_SCENE) && (actor->bgCheckFlags & 1)) { + func_800433A4(&globalCtx->colCtx, actor->floorBgId, actor); } if (arg5 & 1) { - if ((!(arg5 & 0x80) && BgCheck_EntitySphVsWall3(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, + if ((!(arg5 & 0x80) && BgCheck_EntitySphVsWall3(&globalCtx->colCtx, &sp64, &actor->world.pos, &actor->prevPos, arg3, &actor->wallPoly, &bgId, actor, arg2)) || - ((arg5 & 0x80) && BgCheck_EntitySphVsWall4(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, + ((arg5 & 0x80) && BgCheck_EntitySphVsWall4(&globalCtx->colCtx, &sp64, &actor->world.pos, &actor->prevPos, arg3, &actor->wallPoly, &bgId, actor, arg2))) { - sp5C = actor->wallPoly; - Math_Vec3f_Copy(&actor->posRot.pos, &sp64); - actor->wallPolyRot = Math_Atan2S(sp5C->normal.z, sp5C->normal.x); + wallPoly = actor->wallPoly; + Math_Vec3f_Copy(&actor->world.pos, &sp64); + actor->wallYaw = Math_Atan2S(wallPoly->normal.z, wallPoly->normal.x); actor->bgCheckFlags |= 8; - actor->wallPolySource = bgId; + actor->wallBgId = bgId; } else { actor->bgCheckFlags &= ~8; } } - sp64.x = actor->posRot.pos.x; - sp64.z = actor->posRot.pos.z; + sp64.x = actor->world.pos.x; + sp64.z = actor->world.pos.z; if (arg5 & 2) { - sp64.y = actor->pos4.y + 10.0f; - if (BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &D_8015BBA0, - &D_8015BBA4, actor)) { + sp64.y = actor->prevPos.y + 10.0f; + if (BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &sCurCeilingPoly, + &sCurCeilingBgId, actor)) { actor->bgCheckFlags |= 0x10; - actor->posRot.pos.y = (sp58 + sp74) - 10.0f; + actor->world.pos.y = (sp58 + sp74) - 10.0f; } else { actor->bgCheckFlags &= ~0x10; } } if (arg5 & 4) { - sp64.y = actor->pos4.y; + sp64.y = actor->prevPos.y; func_8002E2AC(globalCtx, actor, &sp64, arg5); - sp50 = actor->posRot.pos.y; - if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, actor->posRot.pos.x, actor->posRot.pos.z, &sp50, - &waterBox)) { - actor->yDistToWater = sp50 - actor->posRot.pos.y; + waterBoxYSurface = actor->world.pos.y; + if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, actor->world.pos.x, actor->world.pos.z, + &waterBoxYSurface, &waterBox)) { + actor->yDistToWater = waterBoxYSurface - actor->world.pos.y; if (actor->yDistToWater < 0.0f) { actor->bgCheckFlags &= ~0x60; } else { if (!(actor->bgCheckFlags & 0x20)) { actor->bgCheckFlags |= 0x40; if (!(arg5 & 0x40)) { - ripplePos.x = actor->posRot.pos.x; - ripplePos.y = sp50; - ripplePos.z = actor->posRot.pos.z; + ripplePos.x = actor->world.pos.x; + ripplePos.y = waterBoxYSurface; + ripplePos.z = actor->world.pos.z; EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 0); EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 4); EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 8); @@ -1343,7 +1345,7 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) { globalCtx->view.eye.y, globalCtx->view.eye.z); } - hilite = func_8002EABC(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); + hilite = func_8002EABC(&actor->world.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); if (flag != 0) { displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); @@ -1369,7 +1371,7 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) { lightDir.y = globalCtx->envCtx.unk_2B; lightDir.z = globalCtx->envCtx.unk_2C; - hilite = func_8002EB44(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); + hilite = func_8002EB44(&actor->world.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx); if (flag != 0) { displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx)); @@ -1385,22 +1387,22 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) { } } -PosRot* func_8002EEE4(PosRot* arg0, Actor* actor) { - *arg0 = actor->posRot2; +PosRot* Actor_GetFocus(PosRot* dest, Actor* actor) { + *dest = actor->focus; - return arg0; + return dest; } -PosRot* func_8002EF14(PosRot* arg0, Actor* actor) { - *arg0 = actor->posRot; +PosRot* Actor_GetWorld(PosRot* dest, Actor* actor) { + *dest = actor->world; - return arg0; + return dest; } -PosRot* func_8002EF44(PosRot* arg0, Actor* actor) { +PosRot* Actor_GetWorldPosShapeRot(PosRot* arg0, Actor* actor) { PosRot sp1C; - Math_Vec3f_Copy(&sp1C.pos, &actor->posRot.pos); + Math_Vec3f_Copy(&sp1C.pos, &actor->world.pos); sp1C.rot = actor->shape.rot; *arg0 = sp1C; @@ -1412,14 +1414,15 @@ f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { s16 yawTempAbs; f32 ret; - yawTemp = (s16)(actor->yawTowardsLink - 0x8000) - arg2; + yawTemp = (s16)(actor->yawTowardsPlayer - 0x8000) - arg2; yawTempAbs = ABS(yawTemp); if (player->unk_664 != NULL) { if ((yawTempAbs > 0x4000) || (actor->flags & 0x8000000)) { return FLT_MAX; } else { - ret = actor->xyzDistToLinkSq - actor->xyzDistToLinkSq * 0.8f * ((0x4000 - yawTempAbs) * 3.0517578125e-05f); + ret = actor->xyzDistToPlayerSq - + actor->xyzDistToPlayerSq * 0.8f * ((0x4000 - yawTempAbs) * 3.0517578125e-05f); return ret; } } @@ -1428,7 +1431,7 @@ f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) { return FLT_MAX; } - return actor->xyzDistToLinkSq; + return actor->xyzDistToPlayerSq; } typedef struct { @@ -1446,7 +1449,7 @@ TargetRangeParams D_80115FF8[] = { }; u32 func_8002F090(Actor* actor, f32 arg1) { - return arg1 < D_80115FF8[actor->unk_1F].rangeSq; + return arg1 < D_80115FF8[actor->targetMode].rangeSq; } s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { @@ -1459,16 +1462,16 @@ s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) { } if (!flag) { - var = (s16)(actor->yawTowardsLink - 0x8000) - player->actor.shape.rot.y; + var = (s16)(actor->yawTowardsPlayer - 0x8000) - player->actor.shape.rot.y; abs_var = ABS(var); if ((player->unk_664 == NULL) && (abs_var > 0x2AAA)) { dist = FLT_MAX; } else { - dist = actor->xyzDistToLinkSq; + dist = actor->xyzDistToPlayerSq; } - return !func_8002F090(actor, D_80115FF8[actor->unk_1F].leashScale * dist); + return !func_8002F090(actor, D_80115FF8[actor->targetMode].leashScale * dist); } return 0; @@ -1488,14 +1491,14 @@ s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u3 // This is convoluted but it seems like it must be a single if statement to match if ((player->actor.flags & 0x100) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(globalCtx)) || - ((actor->unk_10C == 0) && - ((arg3 < fabsf(actor->yDistToLink)) || (player->targetActorDistance < actor->xzDistToLink) || - (arg2 < actor->xzDistToLink)))) { + (!actor->isTargeted && + ((arg3 < fabsf(actor->yDistToPlayer)) || (player->targetActorDistance < actor->xzDistToPlayer) || + (arg2 < actor->xzDistToPlayer)))) { return 0; } player->targetActor = actor; - player->targetActorDistance = actor->xzDistToLink; + player->targetActorDistance = actor->xzDistToPlayer; player->exchangeItemId = exchangeItemId; return 1; @@ -1510,7 +1513,7 @@ s32 func_8002F2CC(Actor* actor, GlobalContext* globalCtx, f32 arg2) { } s32 func_8002F2F4(Actor* actor, GlobalContext* globalCtx) { - f32 var1 = 50.0f + actor->colChkInfo.unk_10; + f32 var1 = 50.0f + actor->colChkInfo.cylRadius; return func_8002F2CC(actor, globalCtx, var1); } @@ -1532,7 +1535,7 @@ void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3) Vec3f sp1C; f32 sp18; - func_8002BE04(globalCtx, &actor->posRot2.pos, &sp1C, &sp18); + func_8002BE04(globalCtx, &actor->focus.pos, &sp1C, &sp18); *arg2 = sp1C.x * sp18 * 160.0f + 160.0f; *arg3 = sp1C.y * sp18 * -120.0f + 120.0f; } @@ -1554,8 +1557,8 @@ s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzR if ((((player->heldActor != NULL) || (actor == player->targetActor)) && (getItemId > GI_NONE) && (getItemId < GI_MAX)) || (!(player->stateFlags1 & 0x20000800))) { - if ((actor->xzDistToLink < xzRange) && (fabsf(actor->yDistToLink) < yRange)) { - yawDiff = actor->yawTowardsLink - player->actor.shape.rot.y; + if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) { + yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; absYawDiff = ABS(yawDiff); if ((getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) { player->getItemId = getItemId; @@ -1603,8 +1606,8 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) { void func_8002F5F0(Actor* actor, GlobalContext* globalCtx) { Player* player = PLAYER; - if (actor->xyzDistToLinkSq < player->unk_6A4) { - player->unk_6A4 = actor->xyzDistToLinkSq; + if (actor->xyzDistToPlayerSq < player->unk_6A4) { + player->unk_6A4 = actor->xyzDistToPlayerSq; } } @@ -1680,7 +1683,7 @@ void func_8002F850(GlobalContext* globalCtx, Actor* actor) { sfxId = NA_SE_PL_WALK_WATER1 - SFX_FLAG; } } else { - sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, actor->floorPoly, actor->floorPolySource); + sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, actor->floorPoly, actor->floorBgId); } func_80078914(&actor->projectedPos, NA_SE_EV_BOMB_BOUND); @@ -1982,7 +1985,7 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorCtx->absoluteSpace = NULL; Actor_SpawnEntry(actorCtx, actorEntry, globalCtx); - func_8002C0C0(&actorCtx->targetCtx, actorCtx->actorList[ACTORTYPE_PLAYER].first, globalCtx); + func_8002C0C0(&actorCtx->targetCtx, actorCtx->actorLists[ACTORCAT_PLAYER].head, globalCtx); func_8002FA60(globalCtx); } @@ -2029,8 +2032,8 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { if (KREG(0) == -100) { refActor = &PLAYER->actor; KREG(0) = 0; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, refActor->posRot.pos.x, - refActor->posRot.pos.y + 100.0f, refActor->posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, refActor->world.pos.x, + refActor->world.pos.y + 100.0f, refActor->world.pos.z, 0, 0, 0, 1); } sp80 = &D_80116068[0]; @@ -2043,13 +2046,13 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { sp74 = player->targetActor; } - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, sp80++) { + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++, sp80++) { unkCondition = (*sp80 & player->stateFlags1); - actor = actorCtx->actorList[i].first; + actor = actorCtx->actorLists[i].head; while (actor != NULL) { - if (actor->posRot.pos.y < -25000.0f) { - actor->posRot.pos.y = -25000.0f; + if (actor->world.pos.y < -25000.0f) { + actor->world.pos.y = -25000.0f; } actor->sfx = 0; @@ -2077,28 +2080,28 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { actor = actor->next; } } else { - Math_Vec3f_Copy(&actor->pos4, &actor->posRot.pos); - actor->xzDistToLink = func_8002DB8C(actor, &player->actor); - actor->yDistToLink = Actor_HeightDiff(actor, &player->actor); - actor->xyzDistToLinkSq = SQ(actor->xzDistToLink) + SQ(actor->yDistToLink); + Math_Vec3f_Copy(&actor->prevPos, &actor->world.pos); + actor->xzDistToPlayer = Actor_WorldDistXZToActor(actor, &player->actor); + actor->yDistToPlayer = Actor_HeightDiff(actor, &player->actor); + actor->xyzDistToPlayerSq = SQ(actor->xzDistToPlayer) + SQ(actor->yDistToPlayer); - actor->yawTowardsLink = func_8002DA78(actor, &player->actor); + actor->yawTowardsPlayer = Actor_WorldYawTowardActor(actor, &player->actor); actor->flags &= ~0x1000000; if ((DECR(actor->freezeTimer) == 0) && (actor->flags & 0x50)) { if (actor == player->unk_664) { - actor->unk_10C = 1; + actor->isTargeted = true; } else { - actor->unk_10C = 0; + actor->isTargeted = false; } - if ((actor->unk_10D != 0) && (player->unk_664 == NULL)) { - actor->unk_10D = 0; + if ((actor->targetPriority != 0) && (player->unk_664 == NULL)) { + actor->targetPriority = 0; } Actor_SetObjectDependency(globalCtx, actor); - if (actor->dmgEffectTimer != 0) { - actor->dmgEffectTimer--; + if (actor->colorFilterTimer != 0) { + actor->colorFilterTimer--; } actor->update(actor, globalCtx); func_8003F8EC(globalCtx, &globalCtx->colCtx.dyna, actor); @@ -2110,7 +2113,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { } } - if (i == ACTORTYPE_BG) { + if (i == ACTORCAT_BG) { DynaPoly_Setup(globalCtx, &globalCtx->colCtx.dyna); } } @@ -2169,17 +2172,17 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { lights = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx); - Lights_BindAll(lights, globalCtx->lightCtx.listHead, (actor->flags & 0x400000) ? NULL : &actor->posRot.pos); + Lights_BindAll(lights, globalCtx->lightCtx.listHead, (actor->flags & 0x400000) ? NULL : &actor->world.pos); Lights_Draw(lights, globalCtx->state.gfxCtx); if (actor->flags & 0x1000) { - func_800D1694(actor->posRot.pos.x + globalCtx->mainCamera.skyboxOffset.x, - actor->posRot.pos.y + - (f32)((actor->shape.unk_08 * actor->scale.y) + globalCtx->mainCamera.skyboxOffset.y), - actor->posRot.pos.z + globalCtx->mainCamera.skyboxOffset.z, &actor->shape.rot); + func_800D1694(actor->world.pos.x + globalCtx->mainCamera.skyboxOffset.x, + actor->world.pos.y + + (f32)((actor->shape.yOffset * actor->scale.y) + globalCtx->mainCamera.skyboxOffset.y), + actor->world.pos.z + globalCtx->mainCamera.skyboxOffset.z, &actor->shape.rot); } else { - func_800D1694(actor->posRot.pos.x, actor->posRot.pos.y + (actor->shape.unk_08 * actor->scale.y), - actor->posRot.pos.z, &actor->shape.rot); + func_800D1694(actor->world.pos.x, actor->world.pos.y + (actor->shape.yOffset * actor->scale.y), + actor->world.pos.z, &actor->shape.rot); } Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY); @@ -2188,36 +2191,36 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); gSPSegment(POLY_XLU_DISP++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment); - if (actor->dmgEffectTimer != 0) { + if (actor->colorFilterTimer != 0) { Color_RGBA8 sp2C = { 0, 0, 0, 255 }; - if (actor->dmgEffectParams & 0x8000) { - sp2C.r = sp2C.g = sp2C.b = ((actor->dmgEffectParams & 0x1F00) >> 5) | 7; - } else if (actor->dmgEffectParams & 0x4000) { - sp2C.r = ((actor->dmgEffectParams & 0x1F00) >> 5) | 7; + if (actor->colorFilterParams & 0x8000) { + sp2C.r = sp2C.g = sp2C.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; + } else if (actor->colorFilterParams & 0x4000) { + sp2C.r = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; } else { - sp2C.b = ((actor->dmgEffectParams & 0x1F00) >> 5) | 7; + sp2C.b = ((actor->colorFilterParams & 0x1F00) >> 5) | 7; } - if (actor->dmgEffectParams & 0x2000) { - func_80026860(globalCtx, &sp2C, actor->dmgEffectTimer, actor->dmgEffectParams & 0xFF); + if (actor->colorFilterParams & 0x2000) { + func_80026860(globalCtx, &sp2C, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); } else { - func_80026400(globalCtx, &sp2C, actor->dmgEffectTimer, actor->dmgEffectParams & 0xFF); + func_80026400(globalCtx, &sp2C, actor->colorFilterTimer, actor->colorFilterParams & 0xFF); } } actor->draw(actor, globalCtx); - if (actor->dmgEffectTimer != 0) { - if (actor->dmgEffectParams & 0x2000) { + if (actor->colorFilterTimer != 0) { + if (actor->colorFilterParams & 0x2000) { func_80026A6C(globalCtx); } else { func_80026608(globalCtx); } } - if (actor->shape.shadowDrawFunc != NULL) { - actor->shape.shadowDrawFunc(actor, lights, globalCtx); + if (actor->shape.shadowDraw != NULL) { + actor->shape.shadowDraw(actor, lights, globalCtx); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6119); @@ -2358,10 +2361,10 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6336); - actorListEntry = &actorCtx->actorList[0]; + actorListEntry = &actorCtx->actorLists[0]; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, actorListEntry++) { - actor = actorListEntry->first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++, actorListEntry++) { + actor = actorListEntry->head; while (actor != NULL) { ActorOverlay* overlayEntry = actor->overlayEntry; @@ -2373,7 +2376,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { HREG(66) = i; if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(68) == 0)) { - SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &actor->posRot.pos, &actor->projectedPos, + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &actor->world.pos, &actor->projectedPos, &actor->projectedW); } @@ -2391,7 +2394,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { } } - actor->isDrawn = 0; + actor->isDrawn = false; if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) { if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & 0x60)) { @@ -2406,7 +2409,7 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) { } else { if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(72) == 0)) { Actor_Draw(globalCtx, actor); - actor->isDrawn = 1; + actor->isDrawn = true; } } } @@ -2454,8 +2457,8 @@ void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { - actor = actorCtx->actorList[i].first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].head; while (actor != NULL) { if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_Kill(actor); @@ -2465,14 +2468,14 @@ void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) { } } -u8 sEnemyActorTypes[] = { ACTORTYPE_ENEMY, ACTORTYPE_BOSS }; +u8 sEnemyActorCategories[] = { ACTORCAT_ENEMY, ACTORCAT_BOSS }; void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 duration) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(sEnemyActorTypes); i++) { - actor = actorCtx->actorList[sEnemyActorTypes[i]].first; + for (i = 0; i < ARRAY_COUNT(sEnemyActorCategories); i++) { + actor = actorCtx->actorLists[sEnemyActorCategories[i]].head; while (actor != NULL) { actor->freezeTimer = duration; actor = actor->next; @@ -2484,8 +2487,8 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { - actor = actorCtx->actorList[i].first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].head; while (actor != NULL) { if ((actor->room >= 0) && (actor->room != globalCtx->roomCtx.curRoom.num) && (actor->room != globalCtx->roomCtx.prevRoom.num)) { @@ -2513,11 +2516,11 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { Actor* actor; s32 i; - for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) { - actor = actorCtx->actorList[i].first; + for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) { + actor = actorCtx->actorLists[i].head; while (actor != NULL) { Actor_Delete(actorCtx, actor, globalCtx); - actor = actorCtx->actorList[i].first; + actor = actorCtx->actorLists[i].head; } } @@ -2537,57 +2540,57 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) { } /** - * Adds a given actor instance at the front of the actor list of the specified type. - * Also sets the actor instance as being of that type. + * Adds a given actor instance at the front of the actor list of the specified category. + * Also sets the actor instance as being of that category. */ -void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType) { - Actor* prevFirstActor; +void Actor_AddToCategory(ActorContext* actorCtx, Actor* actorToAdd, u8 actorCategory) { + Actor* prevHead; - actorToAdd->type = actorType; + actorToAdd->category = actorCategory; actorCtx->total++; - actorCtx->actorList[actorType].length++; - prevFirstActor = actorCtx->actorList[actorType].first; + actorCtx->actorLists[actorCategory].length++; + prevHead = actorCtx->actorLists[actorCategory].head; - if (prevFirstActor != NULL) { - prevFirstActor->prev = actorToAdd; + if (prevHead != NULL) { + prevHead->prev = actorToAdd; } - actorCtx->actorList[actorType].first = actorToAdd; - actorToAdd->next = prevFirstActor; + actorCtx->actorLists[actorCategory].head = actorToAdd; + actorToAdd->next = prevHead; } /** * Removes a given actor instance from its actor list. * Also sets the temp clear flag of the current room if the actor removed was the last enemy loaded. */ -Actor* Actor_RemoveFromTypeList(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) { - Actor* newFirstActor; +Actor* Actor_RemoveFromCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) { + Actor* newHead; actorCtx->total--; - actorCtx->actorList[actorToRemove->type].length--; + actorCtx->actorLists[actorToRemove->category].length--; if (actorToRemove->prev != NULL) { actorToRemove->prev->next = actorToRemove->next; } else { - actorCtx->actorList[actorToRemove->type].first = actorToRemove->next; + actorCtx->actorLists[actorToRemove->category].head = actorToRemove->next; } - newFirstActor = actorToRemove->next; + newHead = actorToRemove->next; - if (newFirstActor != NULL) { - newFirstActor->prev = actorToRemove->prev; + if (newHead != NULL) { + newHead->prev = actorToRemove->prev; } actorToRemove->next = NULL; actorToRemove->prev = NULL; - if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) && (actorToRemove->type == ACTORTYPE_ENEMY) && - (actorCtx->actorList[ACTORTYPE_ENEMY].length == 0)) { + if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) && (actorToRemove->category == ACTORCAT_ENEMY) && + (actorCtx->actorLists[ACTORCAT_ENEMY].length == 0)) { Flags_SetTempClear(globalCtx, globalCtx->roomCtx.curRoom.num); } - return newFirstActor; + return newHead; } void Actor_FreeOverlay(ActorOverlay* actorOverlay) { @@ -2722,7 +2725,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId objBankIndex = Object_GetIndex(&globalCtx->objectCtx, actorInit->objectId); if ((objBankIndex < 0) || - ((actorInit->type == ACTORTYPE_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) { + ((actorInit->category == ACTORCAT_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) { // Translates to: "NO DATA BANK!! (profilep->bank=%d)" osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, objBankIndex, actorInit->objectId); @@ -2768,15 +2771,15 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId actor->update = actorInit->update; actor->draw = actorInit->draw; actor->room = globalCtx->roomCtx.curRoom.num; - actor->initPosRot.pos.x = posX; - actor->initPosRot.pos.y = posY; - actor->initPosRot.pos.z = posZ; - actor->initPosRot.rot.x = rotX; - actor->initPosRot.rot.y = rotY; - actor->initPosRot.rot.z = rotZ; + actor->home.pos.x = posX; + actor->home.pos.y = posY; + actor->home.pos.z = posZ; + actor->home.rot.x = rotX; + actor->home.rot.y = rotY; + actor->home.rot.z = rotZ; actor->params = params; - Actor_AddToTypeList(actorCtx, actor, actorInit->type); + Actor_AddToCategory(actorCtx, actor, actorInit->category); temp = gSegments[6]; Actor_Init(actor, globalCtx); @@ -2838,7 +2841,7 @@ Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalCo Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx) { char* name; Player* player; - Actor* newFirstActor; + Actor* newHead; ActorOverlay* overlayEntry; player = PLAYER; @@ -2871,7 +2874,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC func_800F89E8(&actor->projectedPos); Actor_Destroy(actor, globalCtx); - newFirstActor = Actor_RemoveFromTypeList(globalCtx, actorCtx, actor); + newHead = Actor_RemoveFromCategory(globalCtx, actorCtx, actor); ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242); @@ -2893,7 +2896,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC Actor_FreeOverlay(overlayEntry); } - return newFirstActor; + return newHead; } s32 func_80032880(GlobalContext* globalCtx, Actor* actor) { @@ -2912,7 +2915,7 @@ f32 D_8015BBF4; s32 D_8015BBF8; s16 D_8015BBFC; -void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorType) { +void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorCategory) { f32 var; Actor* actor; Actor* sp84; @@ -2920,27 +2923,27 @@ void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* pla UNK_TYPE sp7C; Vec3f sp70; - actor = actorCtx->actorList[actorType].first; + actor = actorCtx->actorLists[actorCategory].head; sp84 = player->unk_664; while (actor != NULL) { if ((actor->update != NULL) && ((Player*)actor != player) && ((actor->flags & 1) == 1)) { - if ((actorType == ACTORTYPE_ENEMY) && ((actor->flags & 5) == 5) && (actor->xyzDistToLinkSq < 250000.0f) && - (actor->xyzDistToLinkSq < D_8015BBF4)) { + if ((actorCategory == ACTORCAT_ENEMY) && ((actor->flags & 5) == 5) && + (actor->xyzDistToPlayerSq < 250000.0f) && (actor->xyzDistToPlayerSq < D_8015BBF4)) { actorCtx->targetCtx.unk_90 = actor; - D_8015BBF4 = actor->xyzDistToLinkSq; + D_8015BBF4 = actor->xyzDistToPlayerSq; } if (actor != sp84) { var = func_8002EFC0(actor, player, D_8015BBFC); if ((var < D_8015BBF0) && func_8002F090(actor, var) && func_80032880(globalCtx, actor) && - (!BgCheck_CameraLineTest1(&globalCtx->colCtx, &player->actor.posRot2.pos, &actor->posRot2.pos, - &sp70, &sp80, 1, 1, 1, 1, &sp7C) || + (!BgCheck_CameraLineTest1(&globalCtx->colCtx, &player->actor.focus.pos, &actor->focus.pos, &sp70, + &sp80, 1, 1, 1, 1, &sp7C) || SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, sp80, sp7C))) { - if (actor->unk_10D != 0) { - if (actor->unk_10D < D_8015BBF8) { + if (actor->targetPriority != 0) { + if (actor->targetPriority < D_8015BBF8) { D_8015BBEC = actor; - D_8015BBF8 = actor->unk_10D; + D_8015BBF8 = actor->targetPriority; } } else { D_8015BBE8 = actor; @@ -2955,8 +2958,8 @@ void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* pla } u8 D_801160A0[] = { - ACTORTYPE_BOSS, ACTORTYPE_ENEMY, ACTORTYPE_BG, ACTORTYPE_EXPLOSIVES, ACTORTYPE_NPC, ACTORTYPE_ITEMACTION, - ACTORTYPE_CHEST, ACTORTYPE_SWITCH, ACTORTYPE_PROP, ACTORTYPE_MISC, ACTORTYPE_DOOR, ACTORTYPE_SWITCH, + ACTORCAT_BOSS, ACTORCAT_ENEMY, ACTORCAT_BG, ACTORCAT_EXPLOSIVE, ACTORCAT_NPC, ACTORCAT_ITEMACTION, + ACTORCAT_CHEST, ACTORCAT_SWITCH, ACTORCAT_PROP, ACTORCAT_MISC, ACTORCAT_DOOR, ACTORCAT_SWITCH, }; Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player) { @@ -2996,10 +2999,10 @@ Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** a } /** - * Finds the first actor instance of a specified id and type if there is one. + * Finds the first actor instance of a specified ID and category if there is one. */ -Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) { - Actor* actor = actorCtx->actorList[actorType].first; +Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory) { + Actor* actor = actorCtx->actorLists[actorCategory].head; while (actor != NULL) { if (actorId == actor->id) { @@ -3013,7 +3016,7 @@ Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) { void func_80032C7C(GlobalContext* globalCtx, Actor* actor) { globalCtx->actorCtx.unk_00 = 5; - Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 20, NA_SE_EN_LAST_DAMAGE); + Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE); } s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { @@ -3156,7 +3159,7 @@ void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3 s32 i; var = (Rand_ZeroOne() - 0.5f) * 6.28f; - pos.y = actor->groundY; + pos.y = actor->floorHeight; accel.y += (Rand_ZeroOne() - 0.5f) * 0.2f; for (i = arg4; i >= 0; i--) { @@ -3202,7 +3205,7 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 } Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider) { - if ((collider->acFlags & AC_HIT) && (collider->ac->type == ACTORTYPE_EXPLOSIVES)) { + if ((collider->acFlags & AC_HIT) && (collider->ac->category == ACTORCAT_EXPLOSIVE)) { collider->acFlags &= ~AC_HIT; return collider->ac; } @@ -3211,13 +3214,13 @@ Actor* Actor_GetCollidedExplosive(GlobalContext* globalCtx, Collider* collider) } Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (actor != NULL) { if ((actor == explosiveActor) || (actor->params != 1)) { actor = actor->next; } else { - if (func_8002DB48(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f) { + if (Actor_WorldDistXYZToActor(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f) { return actor; } else { actor = actor->next; @@ -3229,12 +3232,12 @@ Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) { } /** - * Dynamically changes the type of a given actor instance. - * This is done by moving it to the corresponding type list and setting its type variable accordingly. + * Dynamically changes the category of a given actor instance. + * This is done by moving it to the corresponding category list and setting its category variable accordingly. */ -void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType) { - Actor_RemoveFromTypeList(globalCtx, actorCtx, actor); - Actor_AddToTypeList(actorCtx, actor, actorType); +void Actor_ChangeCategory(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorCategory) { + Actor_RemoveFromCategory(globalCtx, actorCtx, actor); + Actor_AddToCategory(actorCtx, actor, actorCategory); } typedef struct { @@ -3253,27 +3256,27 @@ Actor* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2) { Vec3f sp84; Actor* actor; - actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (actor != NULL) { if (((actor->id != ACTOR_ARMS_HOOK) && (actor->id != ACTOR_EN_ARROW)) || (actor == refActor)) { actor = actor->next; } else { itemActor = (Actor_80033780*)actor; - if ((arg2 < Math_Vec3f_DistXYZ(&refActor->posRot.pos, &itemActor->actor.posRot.pos)) || + if ((arg2 < Math_Vec3f_DistXYZ(&refActor->world.pos, &itemActor->actor.world.pos)) || (itemActor->unk_210 == 0)) { actor = actor->next; } else { - deltaX = Math_SinS(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f); + deltaX = Math_SinS(itemActor->actor.world.rot.y) * (itemActor->actor.speedXZ * 10.0f); deltaY = itemActor->actor.velocity.y + (itemActor->actor.gravity * 10.0f); - deltaZ = Math_CosS(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f); + deltaZ = Math_CosS(itemActor->actor.world.rot.y) * (itemActor->actor.speedXZ * 10.0f); - spA8.x = itemActor->actor.posRot.pos.x + deltaX; - spA8.y = itemActor->actor.posRot.pos.y + deltaY; - spA8.z = itemActor->actor.posRot.pos.z + deltaZ; + spA8.x = itemActor->actor.world.pos.x + deltaX; + spA8.y = itemActor->actor.world.pos.y + deltaY; + spA8.z = itemActor->actor.world.pos.z + deltaZ; - if (CollisionCheck_CylSideVsLineSeg(refActor->colChkInfo.unk_10, refActor->colChkInfo.unk_12, 0.0f, - &refActor->posRot.pos, &itemActor->actor.posRot.pos, &spA8, &sp90, - &sp84)) { + if (CollisionCheck_CylSideVsLineSeg(refActor->colChkInfo.cylRadius, refActor->colChkInfo.cylHeight, + 0.0f, &refActor->world.pos, &itemActor->actor.world.pos, &spA8, + &sp90, &sp84)) { return &itemActor->actor; } else { actor = actor->next; @@ -3372,14 +3375,14 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) { f32 sp3C; Vec3f sp30; - Math_Vec3f_Copy(&sp30, &actor->posRot.pos); + Math_Vec3f_Copy(&sp30, &actor->world.pos); sp44 = actor->bgCheckFlags; sp40 = Math_SinS(arg3) * arg2; sp3C = Math_CosS(arg3) * arg2; - actor->posRot.pos.x += sp40; - actor->posRot.pos.z += sp3C; - func_8002E4B4(globalCtx, actor, 0.0f, 0.0f, 0.0f, 4); - Math_Vec3f_Copy(&actor->posRot.pos, &sp30); + actor->world.pos.x += sp40; + actor->world.pos.z += sp3C; + Actor_UpdateBgCheckInfo(globalCtx, actor, 0.0f, 0.0f, 0.0f, 4); + Math_Vec3f_Copy(&actor->world.pos, &sp30); ret = actor->bgCheckFlags & 1; actor->bgCheckFlags = sp44; @@ -3390,7 +3393,7 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) { s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) { Player* player = PLAYER; - if ((player->stateFlags1 & 0x10) && (actor->unk_10C != 0)) { + if ((player->stateFlags1 & 0x10) && actor->isTargeted) { return 1; } else { return 0; @@ -3400,7 +3403,7 @@ s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) { s32 func_80033AB8(GlobalContext* globalCtx, Actor* actor) { Player* player = PLAYER; - if ((player->stateFlags1 & 0x10) && (actor->unk_10C == 0)) { + if ((player->stateFlags1 & 0x10) && !actor->isTargeted) { return 1; } else { return 0; @@ -3475,9 +3478,9 @@ void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) { void func_80033E88(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3) { if (arg2 >= 5) { - func_800AA000(actor->xyzDistToLinkSq, 0xFF, 0x14, 0x96); + func_800AA000(actor->xyzDistToPlayerSq, 0xFF, 0x14, 0x96); } else { - func_800AA000(actor->xyzDistToLinkSq, 0xB4, 0x14, 0x64); + func_800AA000(actor->xyzDistToPlayerSq, 0xB4, 0x14, 0x64); } func_80033DB8(globalCtx, arg2, arg3); @@ -3568,8 +3571,8 @@ void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) { Audio_PlayActorSound2(actor, NA_SE_EN_LIGHT_ARROW_HIT); } - actor->dmgEffectParams = arg1 | arg3 | ((arg2 & 0xF8) << 5) | arg4; - actor->dmgEffectTimer = arg4; + actor->colorFilterParams = arg1 | arg3 | ((arg2 & 0xF8) << 5) | arg4; + actor->colorFilterTimer = arg4; } Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) { @@ -3665,13 +3668,13 @@ void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, s16 temp1; Vec3f sp30; - sp30.x = actor->posRot.pos.x; - sp30.y = actor->posRot.pos.y + arg1->unk_14; - sp30.z = actor->posRot.pos.z; + sp30.x = actor->world.pos.x; + sp30.y = actor->world.pos.y + arg1->unk_14; + sp30.z = actor->world.pos.z; sp46 = Math_Vec3f_Pitch(&sp30, &arg1->unk_18); sp44 = Math_Vec3f_Yaw(&sp30, &arg1->unk_18); - sp40 = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18) - actor->shape.rot.y; + sp40 = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18) - actor->shape.rot.y; temp1 = CLAMP(sp40, -arg2, arg2); Math_SmoothStepToS(&arg1->unk_08.y, temp1, 6, 2000, 1); @@ -3721,13 +3724,13 @@ s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, return 4; } - if (arg2 < Math_Vec3f_DistXYZ(&actor->posRot.pos, &arg1->unk_18)) { + if (arg2 < Math_Vec3f_DistXYZ(&actor->world.pos, &arg1->unk_18)) { arg1->unk_04 = 0; arg1->unk_06 = 0; return 1; } - var = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18); + var = Math_Vec3f_Yaw(&actor->world.pos, &arg1->unk_18); abs_var = ABS((s16)((f32)var - actor->shape.rot.y)); if (arg3 >= abs_var) { arg1->unk_04 = 0; @@ -3840,9 +3843,9 @@ s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) { f32 var; if ((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) { - var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &globalCtx->view.eye) * 0.25f; + var = Math_Vec3f_DistXYZ(&actor->world.pos, &globalCtx->view.eye) * 0.25f; } else { - var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &player->actor.posRot.pos); + var = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos); } if (arg3 < var) { @@ -3908,7 +3911,8 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) { break; } - func_8002E4B4(globalCtx, actor, actor->colChkInfo.unk_12, actor->colChkInfo.unk_10, actor->colChkInfo.unk_10, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, actor, actor->colChkInfo.cylHeight, actor->colChkInfo.cylRadius, + actor->colChkInfo.cylRadius, 0x1D); return ret; } @@ -3922,17 +3926,18 @@ u8 func_800353E8(GlobalContext* globalCtx) { } /** - * Finds the first actor instance of a specified id and type within a given range from an actor if there is one. - * If the id provided is -1, this will look for any actor of the specified type rather than a specific id. + * Finds the first actor instance of a specified ID and category within a given range from + * an actor if there is one. If the ID provided is -1, this will look for any actor of the + * specified category rather than a specific ID. */ -Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range) { - Actor* actor = globalCtx->actorCtx.actorList[actorType].first; +Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorCategory, f32 range) { + Actor* actor = globalCtx->actorCtx.actorLists[actorCategory].head; while (actor != NULL) { if (actor == refActor || ((actorId != -1) && (actorId != actor->id))) { actor = actor->next; } else { - if (func_8002DB48(refActor, actor) <= range) { + if (Actor_WorldDistXYZToActor(refActor, actor) <= range) { return actor; } else { actor = actor->next; @@ -3948,10 +3953,10 @@ s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s s16 var1; s16 var2; - var1 = (s16)(actor->yawTowardsLink + 0x8000) - player->actor.shape.rot.y; - var2 = actor->yawTowardsLink - arg5; + var1 = (s16)(actor->yawTowardsPlayer + 0x8000) - player->actor.shape.rot.y; + var2 = actor->yawTowardsPlayer - arg5; - if ((actor->xzDistToLink <= range) && (player->swordState != 0) && (arg4 >= ABS(var1)) && (arg3 >= ABS(var2))) { + if ((actor->xzDistToPlayer <= range) && (player->swordState != 0) && (arg4 >= ABS(var1)) && (arg3 >= ABS(var2))) { return 1; } else { return 0; @@ -4009,29 +4014,29 @@ u8 Actor_ApplyDamage(Actor* actor) { void func_80035650(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag) { if (colInfo->acHitInfo == NULL) { - actor->unk_116 = 0x00; + actor->dropFlag = 0x00; } else if (freezeFlag && (colInfo->acHitInfo->toucher.dmgFlags & 0x10060000)) { actor->freezeTimer = colInfo->acHitInfo->toucher.damage; - actor->unk_116 = 0x00; + actor->dropFlag = 0x00; } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x0800) { - actor->unk_116 = 0x01; + actor->dropFlag = 0x01; } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x1000) { - actor->unk_116 = 0x02; + actor->dropFlag = 0x02; } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x4000) { - actor->unk_116 = 0x04; + actor->dropFlag = 0x04; } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x8000) { - actor->unk_116 = 0x08; + actor->dropFlag = 0x08; } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x10000) { - actor->unk_116 = 0x10; + actor->dropFlag = 0x10; } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x2000) { - actor->unk_116 = 0x20; + actor->dropFlag = 0x20; } else if (colInfo->acHitInfo->toucher.dmgFlags & 0x80000) { if (freezeFlag) { actor->freezeTimer = colInfo->acHitInfo->toucher.damage; } - actor->unk_116 = 0x40; + actor->dropFlag = 0x40; } else { - actor->unk_116 = 0x00; + actor->dropFlag = 0x00; } } @@ -4040,7 +4045,7 @@ void func_8003573C(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) { s32 flag; s32 i; - actor->unk_116 = 0x00; + actor->dropFlag = 0x00; for (i = jntSph->count - 1; i >= 0; i--) { curColInfo = &jntSph->elements[i].info; @@ -4069,7 +4074,7 @@ void func_8003573C(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag) { } else { flag = 0x00; } - actor->unk_116 |= flag; + actor->dropFlag |= flag; } } @@ -5416,18 +5421,18 @@ s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3) { return 0; } - var = actor->yawTowardsLink - actor->shape.rot.y; + var = actor->yawTowardsPlayer - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { return 0; } - if ((actor->xyzDistToLinkSq > 25600.0f) && (actor->unk_10C == 0)) { + if ((actor->xyzDistToPlayerSq > 25600.0f) && !actor->isTargeted) { return 0; } - if (actor->xyzDistToLinkSq <= 6400.0f) { + if (actor->xyzDistToPlayerSq <= 6400.0f) { if (func_8002F2CC(actor, globalCtx, 80.0f)) { actor->textId = func_80037C30(globalCtx, arg2); } @@ -5453,8 +5458,8 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) { s16 sp34; s16 var; - sp36 = Math_Vec3f_Pitch(&actor->posRot2.pos, arg1); - sp34 = Math_Vec3f_Yaw(&actor->posRot2.pos, arg1) - actor->posRot.rot.y; + sp36 = Math_Vec3f_Pitch(&actor->focus.pos, arg1); + sp34 = Math_Vec3f_Yaw(&actor->focus.pos, arg1) - actor->world.rot.y; Math_SmoothStepToS(&arg2->x, sp36, 6, 2000, 1); arg2->x = (arg2->x < -6000) ? -6000 : ((arg2->x > 6000) ? 6000 : arg2->x); @@ -5479,11 +5484,11 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar s16 var; s16 abs_var; - actor->posRot2.pos = actor->posRot.pos; - actor->posRot2.pos.y += arg4; + actor->focus.pos = actor->world.pos; + actor->focus.pos.y += arg4; if (!(((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE))) { - var = actor->yawTowardsLink - actor->shape.rot.y; + var = actor->yawTowardsPlayer - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { func_80037F30(arg2, arg3); @@ -5494,7 +5499,7 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar if (((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE)) { sp2C = globalCtx->view.eye; } else { - sp2C = player->actor.posRot2.pos; + sp2C = player->actor.focus.pos; } func_80037FC8(actor, &sp2C, arg2, arg3); @@ -5509,10 +5514,10 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar s16 var; s16 abs_var; - actor->posRot2.pos = arg4; + actor->focus.pos = arg4; if (!(((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE))) { - var = actor->yawTowardsLink - actor->shape.rot.y; + var = actor->yawTowardsPlayer - actor->shape.rot.y; abs_var = ABS(var); if (abs_var >= 0x4300) { func_80037F30(arg2, arg3); @@ -5523,7 +5528,7 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar if (((globalCtx->csCtx.state != 0) || (gDbgCamEnabled != 0)) && (gSaveContext.entranceIndex == 0x00EE)) { sp24 = globalCtx->view.eye; } else { - sp24 = player->actor.posRot2.pos; + sp24 = player->actor.focus.pos; } func_80037FC8(actor, &sp24, arg2, arg3); diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 775db6cde8..d5f03badcb 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -2507,10 +2507,10 @@ void BgActor_SetActor(BgActor* bgActor, Actor* actor, CollisionHeader* colHeader bgActor->prevTransform.scale = actor->scale; bgActor->prevTransform.rot = actor->shape.rot; bgActor->prevTransform.rot.x--; - bgActor->prevTransform.pos = actor->posRot.pos; + bgActor->prevTransform.pos = actor->world.pos; bgActor->curTransform.scale = actor->scale; bgActor->curTransform.rot = actor->shape.rot; - bgActor->curTransform.pos = actor->posRot.pos; + bgActor->curTransform.pos = actor->world.pos; } /** @@ -2742,8 +2742,8 @@ void DynaPoly_ExpandSRT(GlobalContext* globalCtx, DynaCollisionContext* dyna, s3 actor = dyna->bgActors[bgId].actor; dyna->bgActors[bgId].dynaLookup.polyStartIndex = *polyStartIndex; dyna->bgActors[bgId].vtxStartIndex = *vtxStartIndex; - pos = actor->posRot.pos; - pos.y += actor->shape.unk_08 * actor->scale.y; + pos = actor->world.pos; + pos.y += actor->shape.yOffset * actor->scale.y; ScaleRotPos_SetValue(&dyna->bgActors[bgId].curTransform, &actor->scale, &actor->shape.rot, &pos); @@ -4494,7 +4494,7 @@ void BgCheck_DrawStaticCollision(GlobalContext* globalCtx, CollisionContext* col StaticLookup* lookup; player = PLAYER; - lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.posRot.pos); + lookup = BgCheck_GetNearestStaticLookup(colCtx, colCtx->lookupTbl, &player->actor.world.pos); if (AREG(23) != 0) { BgCheck_DrawStaticPolyList(globalCtx, colCtx, &lookup->floor, 0, 0, 255); } diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 22b5ff338a..3c3666a72d 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -459,7 +459,7 @@ s32 Camera_GetDataIdxForPoly(Camera* camera, u32* bgId, CollisionPoly* poly) { PosRot playerPosRot; s32 ret; - func_8002EF44(&playerPosRot, &camera->player->actor); // unused. + Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); // unused. camDataIdx = SurfaceType_GetCamDataIndex(&camera->globalCtx->colCtx, poly, *bgId); if (func_80041A4C(&camera->globalCtx->colCtx, camDataIdx, *bgId) == CAM_SET_NONE) { @@ -481,7 +481,7 @@ Vec3s* Camera_GetCamBgDataUnderPlayer(Camera* camera, u16* dataCnt) { s32 bgId; PosRot playerPosShape; - func_8002EF44(&playerPosShape, &camera->player->actor); + Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor); playerPosShape.pos.y += Player_GetHeight(camera->player); if (BgCheck_EntityRaycastFloor3(&camera->globalCtx->colCtx, &floorPoly, &bgId, &playerPosShape.pos) == BGCHECK_Y_MIN) { @@ -503,7 +503,7 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) { WaterBox* waterBox; s32 ret; - func_8002EF44(&playerPosShape, &camera->player->actor); + Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor); *waterY = playerPosShape.pos.y; if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, playerPosShape.pos.x, playerPosShape.pos.z, @@ -538,7 +538,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) { f32 waterY; WaterBox* waterBox; - func_8002EF44(&playerPosRot, &camera->player->actor); + Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor); waterY = playerPosRot.pos.y; if (!WaterBox_GetSurface1(camera->globalCtx, &camera->globalCtx->colCtx, chkPos->x, chkPos->z, &waterY, @@ -1184,7 +1184,7 @@ s32 Camera_CalcAtForHorse(Camera* camera, VecSph* eyeAtDir, f32 yOffset, f32* yP playerHeight = Player_GetHeight(camera->player); player = camera->player; - func_8002EF44(&horsePosRot, player->rideActor); + Actor_GetWorldPosShapeRot(&horsePosRot, player->rideActor); if (EN_HORSE_CHECK_5((EnHorse*)player->rideActor)) { horsePosRot.pos.y -= 49.f; @@ -2171,7 +2171,7 @@ s32 Camera_Jump1(Camera* camera) { VecSph eyeDiffSph; VecSph eyeDiffTarget; PosRot* playerPosRot = &camera->playerPosRot; - PosRot playerPosRot2; + PosRot playerhead; s16 tangle; Jump1* jump1 = (Jump1*)camera->paramData; Jump1Anim* anim = &jump1->anim; @@ -2196,8 +2196,8 @@ s32 Camera_Jump1(Camera* camera) { Camera_CopyPREGToModeValues(camera); } - // playerPosRot2 never gets used. - func_8002EEE4(&playerPosRot2, &camera->player->actor); + // playerhead never gets used. + Actor_GetFocus(&playerhead, &camera->player->actor); OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, at, eye); OLib_Vec3fDiffToVecSphGeo(&eyeNextAtOffset, at, eyeNext); @@ -2506,7 +2506,7 @@ s32 Camera_Jump3(Camera* camera) { f32 phi_f0; f32 phi_f2; f32 playerHeight; - PosRot playerPosRot2; + PosRot playerhead; f32 yNormal; f32 temp_f18; s32 modeSwitch; @@ -2514,7 +2514,7 @@ s32 Camera_Jump3(Camera* camera) { Jump3Anim* anim = &jump3->anim; playerHeight = Player_GetHeight(camera->player); - func_8002EEE4(&playerPosRot2, &camera->player->actor); + Actor_GetFocus(&playerhead, &camera->player->actor); modeSwitch = false; if (((camera->waterYPos - eye->y) < OREG(44) || (camera->animState == 0))) { @@ -2611,10 +2611,10 @@ s32 Camera_Jump3(Camera* camera) { } if (!(phi_f0 < 10.0f)) { - if (camera->waterYPos <= playerPosRot2.pos.y) { - phi_f2 = playerPosRot2.pos.y - camera->waterYPos; + if (camera->waterYPos <= playerhead.pos.y) { + phi_f2 = playerhead.pos.y - camera->waterYPos; } else { - phi_f2 = -(playerPosRot2.pos.y - camera->waterYPos); + phi_f2 = -(playerhead.pos.y - camera->waterYPos); } if (!(phi_f2 < 50.0f)) { camera->pitchUpdateRateInv = 100.0f; @@ -2829,7 +2829,7 @@ s32 Camera_Battle1(Camera* camera) { camera->atLERPStepScale = Camera_ClampLERPScale(camera, isOffGround ? batt1->atLERPScaleOffGround : batt1->atLERPScaleOnGround); } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); if (anim->target != camera->target) { osSyncPrintf("camera: battle: change target %d -> " VT_FGCOL(BLUE) "%d" VT_RST "\n", anim->target->id, camera->target->id); @@ -3108,17 +3108,17 @@ s32 Camera_KeepOn1(Camera* camera) { switch (camera->paramFlags & 0x18) { case 8: - if ((camera->player->actor.type == 2) && (camera->player->interactRangeActor == camera->target)) { + if ((camera->player->actor.category == 2) && (camera->player->interactRangeActor == camera->target)) { PosRot sp54; - func_8002EEE4(&sp54, &camera->player->actor); + Actor_GetFocus(&sp54, &camera->player->actor); spC8.r = 60.0f; spC8.yaw = camera->playerPosRot.rot.y; spC8.pitch = 0x2EE0; Camera_Vec3fVecSphGeoAdd(&camera->targetPosRot.pos, &sp54.pos, &spC8); } else { - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); if (anim->unk_0C != camera->target) { anim->unk_0C = camera->target; camera->atLERPStepScale = 0.0f; @@ -3324,8 +3324,8 @@ s32 Camera_KeepOn3(Camera* camera) { playerHeight += keep3->yOffset; OLib_Vec3fDiffToVecSphGeo(&atToEyeDir, at, eye); OLib_Vec3fDiffToVecSphGeo(&atToEyeNextDir, at, eyeNext); - func_8002EEE4(&camera->targetPosRot, camera->target); - func_8002EEE4(&playerPosRot, &camera->player->actor); + Actor_GetFocus(&camera->targetPosRot, camera->target); + Actor_GetFocus(&playerPosRot, &camera->player->actor); playerHeadPos = camPlayerPosRot->pos; playerHeadPos.y += playerHeight; OLib_Vec3fDiffToVecSphGeo(&targetToPlayerDir, &playerHeadPos, &camera->targetPosRot.pos); @@ -3470,7 +3470,7 @@ s32 Camera_KeepOn4(Camera* camera) { s16 angleCnt; s32 i; - player = (Player*)camera->globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first; + player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head; if (camera->animState == 0 || camera->animState == 0xA || camera->animState == 0x14) { if (camera->globalCtx->view.unk_124 == 0) { @@ -3634,7 +3634,7 @@ s32 Camera_KeepOn4(Camera* camera) { } else if ((keep4->unk_1C & 8) && camera->target != NULL) { PosRot sp60; - func_8002EF44(&sp60, camera->target); + Actor_GetWorldPosShapeRot(&sp60, camera->target); spA2 = DEGF_TO_BINANG(keep4->unk_08) - sp60.rot.x; spA0 = BINANG_SUB(BINANG_ROT180(sp60.rot.y), spA8.yaw) > 0 ? BINANG_ROT180(sp60.rot.y) + DEGF_TO_BINANG(keep4->unk_0C) @@ -3644,7 +3644,7 @@ s32 Camera_KeepOn4(Camera* camera) { } else if ((keep4->unk_1C & 0x80) && camera->target != NULL) { PosRot sp4C; - func_8002EF14(&sp4C, camera->target); + Actor_GetWorld(&sp4C, camera->target); spA2 = DEGF_TO_BINANG(keep4->unk_08); sp9E = Camera_XZAngle(&sp4C.pos, &playerPosRot->pos); spA0 = (BINANG_SUB(sp9E, spA8.yaw) > 0) ? sp9E + DEGF_TO_BINANG(keep4->unk_0C) @@ -3786,7 +3786,7 @@ s32 Camera_KeepOn0(Camera* camera) { return true; } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); OLib_Vec3fDiffToVecSphGeo(&eyeAtOffset, eye, at); OLib_Vec3fDiffToVecSphGeo(&eyeTargetPosOffset, eye, &camera->targetPosRot.pos); @@ -4144,7 +4144,7 @@ s32 Camera_Subj3(Camera* camera) { Vec3f* pad2; f32 playerHeight; - func_8002EEE4(&sp60, &camera->player->actor); + Actor_GetFocus(&sp60, &camera->player->actor); playerHeight = Player_GetHeight(camera->player); if (camera->globalCtx->view.unk_124 == 0) { @@ -4280,7 +4280,7 @@ s32 Camera_Subj4(Camera* camera) { return true; } - func_8002EF44(&sp6C, &camera->player->actor); + Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor); OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eye); sCameraInterfaceFlags = subj4->interfaceFlags; @@ -4333,7 +4333,7 @@ s32 Camera_Subj4(Camera* camera) { return false; } - func_8002EF44(&sp6C, &camera->player->actor); + Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor); Math3D_LineClosestToPoint(&anim->unk_00, &sp6C.pos, eyeNext); at->x = eyeNext->x + anim->unk_00.b.x; at->y = eyeNext->y + anim->unk_00.b.y; @@ -4358,8 +4358,8 @@ s32 Camera_Subj4(Camera* camera) { } anim->unk_28 = temp_f16; - camera->player->actor.posRot.pos = *eyeNext; - camera->player->actor.posRot.pos.y = camera->playerGroundY; + camera->player->actor.world.pos = *eyeNext; + camera->player->actor.world.pos.y = camera->playerGroundY; camera->player->actor.shape.rot.y = sp64.yaw; temp_f16 = ((240.0f * temp_f16) * (anim->unk_24 * 0.416667f)); temp_a0 = temp_f16 + anim->unk_30; @@ -4478,7 +4478,7 @@ s32 Camera_Unique1(Camera* camera) { VecSph eyeAtOffset; VecSph eyeNextAtOffset; PosRot* playerPosRot = &camera->playerPosRot; - PosRot playerPosRot2; + PosRot playerhead; Unique1* uniq1 = (Unique1*)camera->paramData; Unique1Anim* anim = &uniq1->anim; s32 pad; @@ -4522,7 +4522,7 @@ s32 Camera_Unique1(Camera* camera) { camera->animState++; } - func_8002EEE4(&playerPosRot2, &camera->player->actor); // unused + Actor_GetFocus(&playerhead, &camera->player->actor); // unused camera->yawUpdateRateInv = Camera_LERPCeilF(100.0f, camera->yawUpdateRateInv, OREG(25) * 0.01f, 0.1f); camera->pitchUpdateRateInv = Camera_LERPCeilF(100.0f, camera->pitchUpdateRateInv, OREG(25) * 0.01f, 0.1f); @@ -5001,8 +5001,8 @@ s32 Camera_Unique9(Camera* camera) { s16 atInitFlags; s16 eyeInitFlags; s16 pad2; - PosRot targetPosRot2; - PosRot playerPosRot2; + PosRot targethead; + PosRot playerhead; PosRot playerPosRot; Vec3f* eyeNext = &camera->eyeNext; Vec3f* at = &camera->at; @@ -5028,7 +5028,7 @@ s32 Camera_Unique9(Camera* camera) { sCameraInterfaceFlags = uniq9->interfaceFlags; - func_8002EF14(&playerPosRot, &camera->player->actor); + Actor_GetWorld(&playerPosRot, &camera->player->actor); if (camera->animState == 0) { camera->animState++; @@ -5094,11 +5094,11 @@ s32 Camera_Unique9(Camera* camera) { } } else if (atInitFlags == 4 || atInitFlags == 0x84) { if (camera->target != NULL && camera->target->update != NULL) { - func_8002EEE4(&targetPosRot2, camera->target); - func_8002EEE4(&playerPosRot2, &camera->player->actor); - playerPosRot2.pos.x = playerPosRot.pos.x; - playerPosRot2.pos.z = playerPosRot.pos.z; - OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos); + Actor_GetFocus(&targethead, camera->target); + Actor_GetFocus(&playerhead, &camera->player->actor); + playerhead.pos.x = playerPosRot.pos.x; + playerhead.pos.z = playerPosRot.pos.z; + OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos); if (atInitFlags & (s16)0x8080) { scratchSph.pitch = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.x); scratchSph.yaw = DEGF_TO_BINANG(anim->curKeyFrame->atTargetInit.y); @@ -5108,7 +5108,7 @@ s32 Camera_Unique9(Camera* camera) { } scratchSph.yaw += playerTargetOffset.yaw; scratchSph.pitch += playerTargetOffset.pitch; - Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targetPosRot2.pos, &scratchSph); + Camera_Vec3fVecSphGeoAdd(&anim->atTarget, &targethead.pos, &scratchSph); } else { if (camera->target == NULL) { osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: warning: demo C: actor is not valid\n" VT_RST); @@ -5130,14 +5130,14 @@ s32 Camera_Unique9(Camera* camera) { if (focusActor != NULL) { if ((atInitFlags & 0xF) == 1) { - // posRot2 - func_8002EEE4(&atFocusPosRot, focusActor); + // head + Actor_GetFocus(&atFocusPosRot, focusActor); } else if ((atInitFlags & 0xF) == 2) { - // posRot - func_8002EF14(&atFocusPosRot, focusActor); + // world + Actor_GetWorld(&atFocusPosRot, focusActor); } else { - // posRot, shape rot - func_8002EF44(&atFocusPosRot, focusActor); + // world, shape rot + Actor_GetWorldPosShapeRot(&atFocusPosRot, focusActor); } if (atInitFlags & (s16)0x8080) { @@ -5181,13 +5181,13 @@ s32 Camera_Unique9(Camera* camera) { if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400 || eyeInitFlags == 0x500 || eyeInitFlags == (s16)0x8500) { if (camera->target != NULL && camera->target->update != NULL) { - func_8002EEE4(&targetPosRot2, camera->target); - func_8002EEE4(&playerPosRot2, &camera->player->actor); - playerPosRot2.pos.x = playerPosRot.pos.x; - playerPosRot2.pos.z = playerPosRot.pos.z; - OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targetPosRot2.pos, &playerPosRot2.pos); + Actor_GetFocus(&targethead, camera->target); + Actor_GetFocus(&playerhead, &camera->player->actor); + playerhead.pos.x = playerPosRot.pos.x; + playerhead.pos.z = playerPosRot.pos.z; + OLib_Vec3fDiffToVecSphGeo(&playerTargetOffset, &targethead.pos, &playerhead.pos); if (eyeInitFlags == 0x400 || eyeInitFlags == (s16)0x8400) { - eyeLookAtPos = targetPosRot2.pos; + eyeLookAtPos = targethead.pos; } else { eyeLookAtPos = anim->atTarget; } @@ -5224,14 +5224,14 @@ s32 Camera_Unique9(Camera* camera) { if (focusActor != NULL) { if ((eyeInitFlags & 0xF00) == 0x100) { - // posRot2 - func_8002EEE4(&eyeFocusPosRot, focusActor); + // head + Actor_GetFocus(&eyeFocusPosRot, focusActor); } else if ((eyeInitFlags & 0xF00) == 0x200) { - // posRot - func_8002EF14(&eyeFocusPosRot, focusActor); + // world + Actor_GetWorld(&eyeFocusPosRot, focusActor); } else { - // posRot, shapeRot - func_8002EF44(&eyeFocusPosRot, focusActor); + // world, shapeRot + Actor_GetWorldPosShapeRot(&eyeFocusPosRot, focusActor); } if (eyeInitFlags & (s16)0x8080) { @@ -5436,10 +5436,10 @@ s32 Camera_Unique9(Camera* camera) { if (anim->curKeyFrame->actionFlags & 0x40) { // Set the player's position - camera->player->actor.posRot.pos.x = anim->playerPos.x; - camera->player->actor.posRot.pos.z = anim->playerPos.z; + camera->player->actor.world.pos.x = anim->playerPos.x; + camera->player->actor.world.pos.z = anim->playerPos.z; if (camera->player->stateFlags1 & 0x8000000 && player->currentBoots != PLAYER_BOOTS_IRON) { - camera->player->actor.posRot.pos.y = anim->playerPos.y; + camera->player->actor.world.pos.y = anim->playerPos.y; } } else { anim->playerPos.x = playerPosRot.pos.x; @@ -5555,7 +5555,7 @@ s32 Camera_Demo1(Camera* camera) { // if the camera is set to be relative to the player, move the interpolated points // relative to the player's position if (camera->player != NULL && camera->player->actor.update != NULL) { - func_8002EF14(&curPlayerPosRot, &camera->player->actor); + Actor_GetWorld(&curPlayerPosRot, &camera->player->actor); Camera_RotateAroundPoint(&curPlayerPosRot, &csEyeUpdate, eyeNext); Camera_RotateAroundPoint(&curPlayerPosRot, &csAtUpdate, at); } else { @@ -5811,8 +5811,8 @@ s32 Camera_Demo5(Camera* camera) { VecSph playerTargetGeo; VecSph eyePlayerGeo; VecSph sp78; - PosRot playerPosRot2; - PosRot targetPosRot2; + PosRot playerhead; + PosRot targethead; Player* player; s16 sp4A; s32 pad; @@ -5820,7 +5820,7 @@ s32 Camera_Demo5(Camera* camera) { s16 t; s32 pad2; - func_8002EEE4(&playerPosRot2, &camera->player->actor); + Actor_GetFocus(&playerhead, &camera->player->actor); player = camera->player; sCameraInterfaceFlags = 0x3200; if ((camera->target == NULL) || (camera->target->update == NULL)) { @@ -5830,14 +5830,14 @@ s32 Camera_Demo5(Camera* camera) { camera->target = NULL; return true; } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); OLib_Vec3fDiffToVecSphGeo(&playerTargetGeo, &camera->targetPosRot.pos, &camera->playerPosRot.pos); - D_8011D3AC = camera->target->type; + D_8011D3AC = camera->target->category; func_8002F374(camera->globalCtx, camera->target, &sp78.yaw, &sp78.pitch); eyeTargetDist = OLib_Vec3fDist(&camera->targetPosRot.pos, &camera->eye); - OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerPosRot2.pos, &camera->eyeNext); + OLib_Vec3fDiffToVecSphGeo(&eyePlayerGeo, &playerhead.pos, &camera->eyeNext); sp4A = eyePlayerGeo.yaw - playerTargetGeo.yaw; - if (camera->target->type == ACTORTYPE_PLAYER) { + if (camera->target->category == ACTORCAT_PLAYER) { // camera is targeting a(the) player actor if (eyePlayerGeo.r > 30.0f) { D_8011D6AC[1].timerInit = camera->timer - 1; @@ -5925,7 +5925,7 @@ s32 Camera_Demo5(Camera* camera) { camera->timer += D_8011D8DC[1].timerInit + D_8011D8DC[2].timerInit; } } - } else if (camera->target->type == ACTORTYPE_DOOR) { + } else if (camera->target->category == ACTORCAT_DOOR) { // the target is a door. D_8011D954[0].timerInit = camera->timer - 5; sp4A = 0; @@ -5945,10 +5945,10 @@ s32 Camera_Demo5(Camera* camera) { temp_v0 = Rand_ZeroOne() * (sp90 * -0.2f); D_8011D954[1].rollTargetInit = temp_v0; D_8011D954[0].rollTargetInit = temp_v0; - func_8002EEE4(&targetPosRot2, camera->target); - targetPosRot2.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A)); - targetPosRot2.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A)); - if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) { + Actor_GetFocus(&targethead, camera->target); + targethead.pos.x += 50.0f * Math_SinS(BINANG_ROT180(sp4A)); + targethead.pos.z += 50.0f * Math_CosS(BINANG_ROT180(sp4A)); + if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) { D_8011D954[1].actionFlags = 0xC1; D_8011D954[2].actionFlags = 0x8F; } else { @@ -5971,8 +5971,8 @@ s32 Camera_Demo5(Camera* camera) { } Player_GetHeight(camera->player); D_8011D9F4[0].timerInit = camera->timer; - func_8002EEE4(&targetPosRot2, camera->target); - if (Camera_BGCheck(camera, &playerPosRot2.pos, &targetPosRot2.pos)) { + Actor_GetFocus(&targethead, camera->target); + if (Camera_BGCheck(camera, &playerhead.pos, &targethead.pos)) { D_8011D9F4[1].timerInit = 4; D_8011D9F4[1].actionFlags = 0x8F; } else { @@ -6006,8 +6006,8 @@ s32 Camera_Demo5(Camera* camera) { // env frozen player->actor.freezeTimer = camera->timer; } else { - sp4A = playerPosRot2.rot.y - playerTargetGeo.yaw; - if (camera->target->type == ACTORTYPE_PLAYER) { + sp4A = playerhead.rot.y - playerTargetGeo.yaw; + if (camera->target->category == ACTORCAT_PLAYER) { pad = camera->globalCtx->state.frames - sDemo5PrevAction12Frame; if (player->stateFlags1 & 0x800) { // holding object over head. @@ -6063,7 +6063,7 @@ s32 Camera_Demo6(Camera* camera) { // initalizes the camera state. anim->animTimer = 0; camera->fov = 60.0f; - func_8002EF14(&focusPosRot, camFocus); + Actor_GetWorld(&focusPosRot, camFocus); camera->at.x = focusPosRot.pos.x; camera->at.y = focusPosRot.pos.y + 20.0f; camera->at.z = focusPosRot.pos.z; @@ -6078,7 +6078,7 @@ s32 Camera_Demo6(Camera* camera) { case 1: if (stateTimers[camera->animState] < anim->animTimer) { func_8002DF54(camera->globalCtx, &camera->player->actor, 8); - func_8002EF14(&focusPosRot, camFocus); + Actor_GetWorld(&focusPosRot, camFocus); anim->atTarget.x = focusPosRot.pos.x; anim->atTarget.y = focusPosRot.pos.y - 20.0f; anim->atTarget.z = focusPosRot.pos.z; @@ -6103,7 +6103,7 @@ s32 Camera_Demo6(Camera* camera) { } anim->animTimer++; - func_8002EF14(&focusPosRot, camFocus); + Actor_GetWorld(&focusPosRot, camFocus); return true; } @@ -6198,13 +6198,13 @@ s32 Camera_Demo9(Camera* camera) { Camera_RotateAroundPoint(cam0PlayerPosRot, &csAtUpdate, &newAt); } else if (demo9OnePoint->onePointDemo.actionParameters == 4) { // rotate around the current camera's player - func_8002EF14(&focusPosRot, &camera->player->actor); + Actor_GetWorld(&focusPosRot, &camera->player->actor); Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye); Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt); } else if (demo9OnePoint->onePointDemo.actionParameters == 8) { // rotate around the current camera's target if (camera->target != NULL && camera->target->update != NULL) { - func_8002EF14(&focusPosRot, camera->target); + Actor_GetWorld(&focusPosRot, camera->target); Camera_RotateAroundPoint(&focusPosRot, &csEyeUpdate, &newEye); Camera_RotateAroundPoint(&focusPosRot, &csAtUpdate, &newAt); } else { @@ -6297,7 +6297,7 @@ s32 Camera_Special0(Camera* camera) { return true; } - func_8002EEE4(&camera->targetPosRot, camera->target); + Actor_GetFocus(&camera->targetPosRot, camera->target); Camera_LERPCeilVec3f(&camera->targetPosRot.pos, &camera->at, spec0->lerpAtScale, spec0->lerpAtScale, 0.1f); camera->posOffset.x = camera->at.x - playerPosRot->pos.x; @@ -6343,7 +6343,7 @@ s32 Camera_Special4(Camera* camera) { return false; } else { camera->roll = -0x1F4; - func_8002EF14(&curTargetPosRot, camera->target); + Actor_GetWorld(&curTargetPosRot, camera->target); camera->at = curTargetPosRot.pos; camera->at.y -= 150.0f; @@ -6401,7 +6401,7 @@ s32 Camera_Special5(Camera* camera) { OLib_Vec3fDiffToVecSphGeo(&sp64, at, eye); OLib_Vec3fDiffToVecSphGeo(&sp5C, at, eyeNext); - func_8002EF14(&spA8, camera->target); + Actor_GetWorld(&spA8, camera->target); sCameraInterfaceFlags = spec5->interfaceFlags; @@ -6647,7 +6647,7 @@ s32 Camera_Special9(Camera* camera) { } if (spec9->doorParams.doorActor != NULL) { - func_8002EF44(&adjustedPlayerPosRot, spec9->doorParams.doorActor); + Actor_GetWorldPosShapeRot(&adjustedPlayerPosRot, spec9->doorParams.doorActor); } else { adjustedPlayerPosRot = *playerPosRot; adjustedPlayerPosRot.pos.y += playerYOffset + params->yOffset; @@ -6894,7 +6894,7 @@ void Camera_InitPlayerSettings(Camera* camera, Player* player) { Vec3f* at = &camera->at; Vec3f* eyeNext = &camera->eyeNext; - func_8002EF44(&playerPosShape, &player->actor); + Actor_GetWorldPosShapeRot(&playerPosShape, &player->actor); playerYOffset = Player_GetHeight(player); camera->player = player; camera->playerPosRot = playerPosShape; @@ -7333,7 +7333,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) { sUpdateCameraDirection = false; if (camera->player != NULL) { - func_8002EF44(&curPlayerPosRot, &camera->player->actor); + Actor_GetWorldPosShapeRot(&curPlayerPosRot, &camera->player->actor); camera->xzSpeed = playerXZSpeed = OLib_Vec3fDistXZ(&curPlayerPosRot.pos, &camera->playerPosRot.pos); camera->speedRatio = OLib_ClampMaxDist(playerXZSpeed / (func_8002DCE4(camera->player) * PCT(OREG(8))), 1.0f); @@ -7558,7 +7558,7 @@ Vec3s* Camera_Update(Vec3s* outVec, Camera* camera) { */ void Camera_Finish(Camera* camera) { Camera* defaultCam = camera->globalCtx->cameraPtrs[0]; - Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first; + Player* player = (Player*)camera->globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].head; if (camera->timer == 0) { Gameplay_ChangeCameraStatus(camera->globalCtx, camera->parentCamIdx, 7); @@ -7966,7 +7966,7 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa if (camera->data2 != 0) { camera->player = player; - func_8002EF44(&playerPosRot, &player->actor); + Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor); camera->playerPosRot = playerPosRot; camera->nextCamDataIdx = -1; @@ -8042,7 +8042,7 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) { func_80043B60(dstCamera); if (dstCamera->player != NULL) { - func_8002EF14(&dstCamera->playerPosRot, &dstCamera->player->actor); + Actor_GetWorld(&dstCamera->playerPosRot, &dstCamera->player->actor); dstCamera->posOffset.x = dstCamera->at.x - dstCamera->playerPosRot.pos.x; dstCamera->posOffset.y = dstCamera->at.y - dstCamera->playerPosRot.pos.y; dstCamera->posOffset.z = dstCamera->at.z - dstCamera->playerPosRot.pos.z; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index be884c4440..30f71cda20 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1632,7 +1632,7 @@ void CollisionCheck_HitSolid(GlobalContext* globalCtx, ColliderInfo* info, Colli * Plays a hit sound effect for AT colliders attached to Player based on the AC element's elemType. */ s32 CollisionCheck_SwordHitAudio(Collider* at, ColliderInfo* acInfo) { - if (at->actor != NULL && at->actor->type == ACTORTYPE_PLAYER) { + if (at->actor != NULL && at->actor->category == ACTORCAT_PLAYER) { if (acInfo->elemType == ELEMTYPE_UNK0) { Audio_PlaySoundGeneral(NA_SE_IT_SWORD_STRIKE, &at->actor->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -2962,8 +2962,8 @@ void CollisionCheck_ResetDamage(CollisionCheckInfo* info) { */ void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionCheckInfoInit* init) { info->health = init->health; - info->unk_10 = init->unk_02; - info->unk_12 = init->unk_04; + info->cylRadius = init->cylRadius; + info->cylHeight = init->cylHeight; info->mass = init->mass; } @@ -2973,8 +2973,8 @@ void CollisionCheck_SetInfoNoDamageTable(CollisionCheckInfo* info, CollisionChec void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit* init) { info->health = init->health; info->damageTable = damageTable; - info->unk_10 = init->unk_02; - info->unk_12 = init->unk_04; + info->cylRadius = init->cylRadius; + info->cylHeight = init->cylHeight; info->mass = init->mass; } @@ -2984,9 +2984,9 @@ void CollisionCheck_SetInfo(CollisionCheckInfo* info, DamageTable* damageTable, void CollisionCheck_SetInfo2(CollisionCheckInfo* info, DamageTable* damageTable, CollisionCheckInfoInit2* init) { info->health = init->health; info->damageTable = damageTable; - info->unk_10 = init->unk_02; - info->unk_12 = init->unk_04; - info->unk_14 = init->unk_06; + info->cylRadius = init->cylRadius; + info->cylHeight = init->cylHeight; + info->cylYShift = init->cylYShift; info->mass = init->mass; } @@ -3218,9 +3218,9 @@ s32 CollisionCheck_LineOCCheck(GlobalContext* globalCtx, CollisionCheckContext* * Moves the ColliderCylinder's position to the actor's position */ void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider) { - collider->dim.pos.x = actor->posRot.pos.x; - collider->dim.pos.y = actor->posRot.pos.y; - collider->dim.pos.z = actor->posRot.pos.z; + collider->dim.pos.x = actor->world.pos.x; + collider->dim.pos.y = actor->world.pos.y; + collider->dim.pos.z = actor->world.pos.z; } /** diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 3e62d46cb3..7f65ff5eb7 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -23,7 +23,7 @@ void func_8001D5C8(EnAObj* this, s16 params); const ActorInit En_A_Obj_InitVars = { ACTOR_EN_A_OBJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnAObj), @@ -108,9 +108,9 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { sp28 = 12.0f; } - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, sp28); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, sp28); - thisx->posRot2.pos = thisx->posRot.pos; + thisx->focus.pos = thisx->world.pos; this->dyna.bgId = BGACTOR_NEG_ONE; this->dyna.unk_160 = 0; this->dyna.unk_15C = DPM_UNK; @@ -121,13 +121,13 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { case A_OBJ_BLOCK_LARGE: case A_OBJ_BLOCK_HUGE: this->dyna.bgId = 1; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG); func_8001D5C8(this, thisx->params); break; case A_OBJ_BLOCK_SMALL_ROT: case A_OBJ_BLOCK_LARGE_ROT: this->dyna.bgId = 3; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_BG); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BG); func_8001D310(this, thisx->params); break; case A_OBJ_UNKNOWN_6: @@ -146,14 +146,14 @@ void EnAObj_Init(Actor* thisx, GlobalContext* globalCtx) { case A_OBJ_SIGNPOST_ARROW: thisx->textId = (this->textId & 0xFF) | 0x300; // clang-format off - thisx->flags |= 0x1 | 0x8; thisx->unk_4C = 500.0f; + thisx->flags |= 0x1 | 0x8; thisx->targetArrowOffset = 500.0f; // clang-format on this->unk_178 = 45.0f; func_8001D234(this, thisx->params); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); thisx->colChkInfo.mass = MASS_IMMOVABLE; - thisx->unk_1F = 0; + thisx->targetMode = 0; break; case A_OBJ_KNOB: thisx->gravity = -1.5f; @@ -201,7 +201,7 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) { s16 var; if (this->dyna.actor.textId != 0) { - var = this->dyna.actor.yawTowardsLink - this->dyna.actor.shape.rot.y; + var = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y; if ((ABS(var) < 0x2800) || ((this->dyna.actor.params == 0xA) && (ABS(var) > 0x5800))) { if (func_8002F194(&this->dyna.actor, globalCtx)) { EnAObj_SetupAction(this, func_8001D204); @@ -215,8 +215,8 @@ void func_8001D25C(EnAObj* this, GlobalContext* globalCtx) { void func_8001D310(EnAObj* this, s16 params) { this->unk_16E = 0; this->unk_168 = 10; - this->dyna.actor.posRot.rot.y = 0; - this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot; + this->dyna.actor.world.rot.y = 0; + this->dyna.actor.shape.rot = this->dyna.actor.world.rot; EnAObj_SetupAction(this, func_8001D360); } @@ -226,13 +226,13 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) { this->unk_16E++; this->unk_170 = 20; - if ((s16)(this->dyna.actor.yawTowardsLink + 0x4000) < 0) { + if ((s16)(this->dyna.actor.yawTowardsPlayer + 0x4000) < 0) { this->unk_174 = -1000; } else { this->unk_174 = 1000; } - if (this->dyna.actor.yawTowardsLink < 0) { + if (this->dyna.actor.yawTowardsPlayer < 0) { this->unk_172 = -this->unk_174; } else { this->unk_172 = this->unk_174; @@ -248,12 +248,12 @@ void func_8001D360(EnAObj* this, GlobalContext* globalCtx) { this->dyna.actor.gravity = -1.0f; if (this->unk_170 == 0) { - this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos; + this->dyna.actor.world.pos = this->dyna.actor.home.pos; this->unk_16E = 0; this->unk_168 = 10; this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.gravity = 0.0f; - this->dyna.actor.shape.rot = this->dyna.actor.posRot.rot; + this->dyna.actor.shape.rot = this->dyna.actor.world.rot; } } } @@ -265,14 +265,13 @@ void func_8001D480(EnAObj* this, s16 params) { void func_8001D4A8(EnAObj* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f); - this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.posRot.rot.x >> 1); - this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.posRot.rot.z >> 1); + this->dyna.actor.shape.rot.x = this->dyna.actor.shape.rot.x + (this->dyna.actor.world.rot.x >> 1); + this->dyna.actor.shape.rot.z = this->dyna.actor.shape.rot.z + (this->dyna.actor.world.rot.z >> 1); if ((this->dyna.actor.speedXZ != 0.0f) && (this->dyna.actor.bgCheckFlags & 0x8)) { if (1) { // Necessary to match - this->dyna.actor.posRot.rot.y = - ((this->dyna.actor.wallPolyRot - this->dyna.actor.posRot.rot.y) + this->dyna.actor.wallPolyRot) - - 0x8000; + this->dyna.actor.world.rot.y = + ((this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y) + this->dyna.actor.wallYaw) - 0x8000; } this->dyna.actor.bgCheckFlags &= ~0x8; } @@ -296,7 +295,7 @@ void func_8001D5C8(EnAObj* this, s16 params) { void func_8001D608(EnAObj* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ += this->dyna.unk_150; - this->dyna.actor.posRot.rot.y = this->dyna.unk_158; + this->dyna.actor.world.rot.y = this->dyna.unk_158; this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f); Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); @@ -317,14 +316,14 @@ void EnAObj_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->dyna.actor.gravity != 0.0f) { if (this->dyna.actor.params != A_OBJ_KNOB) { - func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 40.0f, 0.0f, 0x1D); } else { - func_8002E4B4(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 5.0f, 20.0f, 0.0f, 0x1D); } } - this->dyna.actor.posRot2.pos = this->dyna.actor.posRot.pos; - this->dyna.actor.posRot2.pos.y += this->unk_178; + this->dyna.actor.focus.pos = this->dyna.actor.world.pos; + this->dyna.actor.focus.pos.y += this->unk_178; switch (this->dyna.actor.params) { case A_OBJ_SIGNPOST_OBLONG: diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index af464beeb1..4058748f83 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -18,7 +18,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx); const ActorInit En_Item00_InitVars = { ACTOR_EN_ITEM00, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnItem00), @@ -96,7 +96,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.02f; break; case ITEM00_HEART: - this->actor.initPosRot.rot.z = Rand_CenteredFloat(65535.0f); + this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); sp34 = 430.0f; Actor_SetScale(&this->actor, 0.02f); this->unk_15C = 0.02f; @@ -157,7 +157,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.5f; sp34 = 0.0f; sp30 = 0.6f; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; break; case ITEM00_SHIELD_HYLIAN: this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_2); @@ -166,7 +166,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.5f; sp34 = 0.0f; sp30 = 0.6f; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; break; case ITEM00_TUNIC_ZORA: case ITEM00_TUNIC_GORON: @@ -176,14 +176,14 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C = 0.5f; sp34 = 0.0f; sp30 = 0.6f; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; break; } this->unk_156 = 0; - ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawFunc_Circle, sp30); - this->actor.shape.unk_14 = 0xB4; - this->actor.posRot2.pos = this->actor.posRot.pos; + ActorShape_Init(&this->actor.shape, sp34, ActorShadow_DrawCircle, sp30); + this->actor.shape.shadowAlpha = 0xB4; + this->actor.focus.pos = this->actor.world.pos; this->unk_152 = 0; if (!spawnParam8000) { @@ -286,20 +286,20 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { } else { if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) { if (this->unk_15A == -1) { - if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) { + if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) { this->unk_15A = -2; } } else { - if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500)) { + if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) { this->unk_15A = -1; } } - Math_SmoothStepToS(&this->actor.posRot.rot.x, 0, 2, 2500, 500); + Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500); } } if (this->actor.params == ITEM00_HEART_PIECE) { - this->actor.shape.unk_08 = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; + this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; } Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); @@ -332,9 +332,9 @@ void func_8001E1C8(EnItem00* this, GlobalContext* globalCtx) { } if (globalCtx->gameplayFrames & 1) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(10.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(10.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(10.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(10.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(10.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(10.0f); EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514); } @@ -364,20 +364,20 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) { if (this->actor.velocity.y < -1.5f) { this->actor.velocity.y = -1.5f; } - this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f); - this->actor.posRot.pos.x += - Math_CosS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z)); - this->actor.posRot.pos.z += - Math_SinS(this->actor.yawTowardsLink) * (-3.0f * Math_CosS(this->actor.initPosRot.rot.z)); + this->actor.home.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f); + this->actor.world.pos.x += + Math_CosS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z)); + this->actor.world.pos.z += + Math_SinS(this->actor.yawTowardsPlayer) * (-3.0f * Math_CosS(this->actor.home.rot.z)); } } if (this->actor.params <= ITEM00_RUPEE_RED) { this->actor.shape.rot.y += 960; } else if ((this->actor.params >= ITEM00_SHIELD_DEKU) && (this->actor.params != ITEM00_BOMBS_SPECIAL)) { - this->actor.posRot.rot.x -= 700; + this->actor.world.rot.x -= 700; this->actor.shape.rot.y += 400; - this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000; + this->actor.shape.rot.x = this->actor.world.rot.x - 0x4000; } if (this->actor.velocity.y <= 2.0f) { @@ -390,9 +390,9 @@ void func_8001E304(EnItem00* this, GlobalContext* globalCtx) { } if (!(globalCtx->gameplayFrames & 1)) { - pos.x = this->actor.posRot.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f; - pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f; - pos.z = this->actor.posRot.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f; + pos.x = this->actor.world.pos.x + (Rand_ZeroOne() - 0.5f) * 10.0f; + pos.y = this->actor.world.pos.y + (Rand_ZeroOne() - 0.5f) * 10.0f; + pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 10.0f; EffectSsKiraKira_SpawnSmall(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514); } @@ -421,7 +421,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) { return; } - this->actor.posRot.pos = player->actor.posRot.pos; + this->actor.world.pos = player->actor.world.pos; if (this->actor.params <= ITEM00_RUPEE_RED) { this->actor.shape.rot.y += 960; @@ -429,10 +429,10 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = 0; } - this->actor.posRot.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f); + this->actor.world.pos.y += 40.0f + Math_SinS(this->unk_15A * 15000) * (this->unk_15A * 0.3f); if (LINK_IS_ADULT) { - this->actor.posRot.pos.y += 20.0f; + this->actor.world.pos.y += 20.0f; } } @@ -475,9 +475,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx->colCtx.dyna.bgActorFlags[i] & 1) { dynaActor = globalCtx->colCtx.dyna.bgActors[i].actor; if ((dynaActor != NULL) && (dynaActor->update != NULL) && - ((dynaActor->posRot.pos.x != dynaActor->pos4.x) || - (dynaActor->posRot.pos.y != dynaActor->pos4.y) || - (dynaActor->posRot.pos.z != dynaActor->pos4.z))) { + ((dynaActor->world.pos.x != dynaActor->prevPos.x) || + (dynaActor->world.pos.y != dynaActor->prevPos.y) || + (dynaActor->world.pos.z != dynaActor->prevPos.z))) { D_80157D94++; break; } @@ -490,9 +490,9 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { } if (sp3A || D_80157D94) { - func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D); - if (this->actor.groundY <= -10000.0f) { + if (this->actor.floorHeight <= -10000.0f) { Actor_Kill(&this->actor); return; } @@ -505,11 +505,11 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actor.params == ITEM00_SHIELD_DEKU) || (this->actor.params == ITEM00_SHIELD_HYLIAN) || (this->actor.params == ITEM00_TUNIC_ZORA) || (this->actor.params == ITEM00_TUNIC_GORON)) { f32 newUnkBC = Math_CosS(this->actor.shape.rot.x) * 37.0f; - this->actor.shape.unk_08 = newUnkBC; + this->actor.shape.yOffset = newUnkBC; if (newUnkBC >= 0.0f) { - this->actor.shape.unk_08 = this->actor.shape.unk_08; + this->actor.shape.yOffset = this->actor.shape.yOffset; } else { - this->actor.shape.unk_08 = -this->actor.shape.unk_08; + this->actor.shape.yOffset = -this->actor.shape.yOffset; } } @@ -517,8 +517,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { return; } - if (!((this->actor.xzDistToLink <= 30.0f) && (this->actor.yDistToLink >= -50.0f) && - (this->actor.yDistToLink <= 50.0f))) { + if (!((this->actor.xzDistToPlayer <= 30.0f) && (this->actor.yDistToPlayer >= -50.0f) && + (this->actor.yDistToPlayer <= 50.0f))) { if (!Actor_HasParent(&this->actor, globalCtx)) { return; } @@ -890,7 +890,7 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 pa spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f; spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.gravity = -0.9f; - spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f); + spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); Actor_SetScale(&spawnedActor->actor, 0.0f); EnItem00_SetupAction(spawnedActor, func_8001E304); spawnedActor->unk_15A = 220; @@ -931,7 +931,7 @@ EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 p spawnedActor->actor.velocity.y = 0.0f; spawnedActor->actor.speedXZ = 0.0f; spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f; - spawnedActor->actor.posRot.rot.y = Rand_CenteredFloat(65536.0f); + spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); spawnedActor->actor.flags |= 0x0010; } } @@ -953,31 +953,31 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 params = params & 0x7FFF; if (fromActor != NULL) { - if (fromActor->unk_116) { - if (fromActor->unk_116 & 0x01) { + if (fromActor->dropFlag) { + if (fromActor->dropFlag & 0x01) { params = 1 * 0x10; - dropTableIndex = 0xB; - } else if (fromActor->unk_116 & 0x02) { + dropTableIndex = 11; + } else if (fromActor->dropFlag & 0x02) { params = 1 * 0x10; - dropTableIndex = 0x6; - } else if (fromActor->unk_116 & 0x04) { + dropTableIndex = 6; + } else if (fromActor->dropFlag & 0x04) { params = 6 * 0x10; - dropTableIndex = 0x9; - } else if (fromActor->unk_116 & 0x08) { + dropTableIndex = 9; + } else if (fromActor->dropFlag & 0x08) { params = 3 * 0x10; - dropTableIndex = 0xB; - } else if (fromActor->unk_116 & 0x10) { + dropTableIndex = 11; + } else if (fromActor->dropFlag & 0x10) { params = 6 * 0x10; - dropTableIndex = 0xC; - } else if (fromActor->unk_116 & 0x20) { + dropTableIndex = 12; + } else if (fromActor->dropFlag & 0x20) { params = 0 * 0x10; - dropTableIndex = 0x0; - } else if (fromActor->unk_116 & 0x40) { + dropTableIndex = 0; + } else if (fromActor->dropFlag & 0x40) { params = 0 * 0x10; - dropTableIndex = 0x1; + dropTableIndex = 1; } } - if (fromActor->unk_116 & 0x20) { + if (fromActor->dropFlag & 0x20) { dropId = ITEM00_RUPEE_PURPLE; } else { dropId = D_80115574[params + dropTableIndex]; @@ -1043,7 +1043,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 spawnedActor->actor.velocity.y = 8.0f; spawnedActor->actor.speedXZ = 2.0f; spawnedActor->actor.gravity = -0.9f; - spawnedActor->actor.posRot.rot.y = Rand_ZeroOne() * 40000.0f; + spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f; Actor_SetScale(&spawnedActor->actor, 0.0f); EnItem00_SetupAction(spawnedActor, func_8001E304); spawnedActor->actor.flags |= 0x0010; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 076d69d2bc..fd6cb3cbb7 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -48,10 +48,9 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) { }; if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) { - player->rideActor = - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x, - player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x, - player->actor.shape.rot.y, player->actor.shape.rot.z, 9); + player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.world.pos.x, + player->actor.world.pos.y, player->actor.world.pos.z, player->actor.shape.rot.x, + player->actor.shape.rot.y, player->actor.shape.rot.z, 9); if (player->rideActor == NULL) { __assert("player->ride.actor != NULL", "../z_horse.c", 343); } @@ -167,7 +166,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { } player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y, - spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7); + spawnPos.z, 0, player->actor.world.rot.y, 0, 7); if (player->rideActor == NULL) { __assert("player->ride.actor != NULL", "../z_horse.c", 561); } @@ -203,14 +202,14 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { (((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) { if (D_8011F9B8[i].type == 7) { if ((globalCtx->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) { - D_8011F9B8[i].pos.x = player->actor.posRot.pos.x; - D_8011F9B8[i].pos.y = player->actor.posRot.pos.y; - D_8011F9B8[i].pos.z = player->actor.posRot.pos.z; + D_8011F9B8[i].pos.x = player->actor.world.pos.x; + D_8011F9B8[i].pos.y = player->actor.world.pos.y; + D_8011F9B8[i].pos.z = player->actor.world.pos.z; } player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, - player->actor.posRot.rot.y, 0, D_8011F9B8[i].type); + player->actor.world.rot.y, 0, D_8011F9B8[i].type); if (player->rideActor == NULL) { __assert("player->ride.actor != NULL", "../z_horse.c", 628); } @@ -233,20 +232,20 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) { __assert("player->ride.actor != NULL", "../z_horse.c", 667); } - player->actor.posRot.pos.x = D_8011F9B8[i].pos.x; - player->actor.posRot.pos.y = D_8011F9B8[i].pos.y; - player->actor.posRot.pos.z = D_8011F9B8[i].pos.z; + player->actor.world.pos.x = D_8011F9B8[i].pos.x; + player->actor.world.pos.y = D_8011F9B8[i].pos.y; + player->actor.world.pos.z = D_8011F9B8[i].pos.z; player->actor.shape.rot.x = player->actor.shape.rot.z = 0; player->actor.shape.rot.y = D_8011F9B8[i].angle; func_8002DECC(globalCtx, player, player->rideActor); func_8002DE74(globalCtx, player); - sp54.x = player->actor.posRot.pos.x - 200.0f; - sp54.y = player->actor.posRot.pos.y + 100.0f; - sp54.z = player->actor.posRot.pos.z; + sp54.x = player->actor.world.pos.x - 200.0f; + sp54.y = player->actor.world.pos.y + 100.0f; + sp54.z = player->actor.world.pos.z; - Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.posRot.pos, &sp54); + Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.world.pos, &sp54); } else { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0, @@ -284,15 +283,15 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player) { } void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) { - s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y; + s16 x = Math_Vec3f_Yaw(&actor->world.pos, arg1) - actor->world.rot.y; if (x > arg2) { - actor->posRot.rot.y += arg2; + actor->world.rot.y += arg2; } else if (x < -arg2) { - actor->posRot.rot.y -= arg2; + actor->world.rot.y -= arg2; } else { - actor->posRot.rot.y += x; + actor->world.rot.y += x; } - actor->shape.rot.y = actor->posRot.rot.y; + actor->shape.rot.y = actor->world.rot.y; } diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index e81b087fc0..fab39d42b7 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -11,8 +11,8 @@ s16 sEntranceIconMapIndex = 0; void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) { Player* player = PLAYER; - sPlayerInitialPosX = player->actor.posRot.pos.x; - sPlayerInitialPosZ = player->actor.posRot.pos.z; + sPlayerInitialPosX = player->actor.world.pos.x; + sPlayerInitialPosZ = player->actor.world.pos.z; sPlayerInitialDirection = (s16)((0x7FFF - player->actor.shape.rot.y) / 0x400); } @@ -326,8 +326,8 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) { gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); - tempX = player->actor.posRot.pos.x; - tempZ = player->actor.posRot.pos.z; + tempX = player->actor.world.pos.x; + tempZ = player->actor.world.pos.z; tempX /= R_COMPASS_SCALE_X; tempZ /= R_COMPASS_SCALE_Y; Matrix_Translate((R_COMPASS_OFFSET_X + tempX) / 10.0f, (R_COMPASS_OFFSET_Y - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); @@ -531,7 +531,7 @@ void Map_Update(GlobalContext* globalCtx) { } for (floor = 0; floor < 8; floor++) { - if (player->actor.posRot.pos.y > gMapData->floorCoordY[mapIndex][floor]) { + if (player->actor.world.pos.y > gMapData->floorCoordY[mapIndex][floor]) { break; } } diff --git a/src/code/z_path.c b/src/code/z_path.c index 0f50fe02a6..8ff42c07aa 100644 --- a/src/code/z_path.c +++ b/src/code/z_path.c @@ -24,8 +24,8 @@ f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos = &pointPos[waypoint]; - dx = pointPos->x - actor->posRot.pos.x; - dz = pointPos->z - actor->posRot.pos.z; + dx = pointPos->x - actor->world.pos.x; + dz = pointPos->z - actor->world.pos.z; *yaw = Math_FAtan2F(dx, dz) * (32768 / M_PI); diff --git a/src/code/z_play.c b/src/code/z_play.c index fba0e5a4c4..06a5f82d99 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -1594,9 +1594,9 @@ s32 Gameplay_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3 player = camera->player; if (player != NULL) { - camera->posOffset.x = at->x - player->actor.posRot.pos.x; - camera->posOffset.y = at->y - player->actor.posRot.pos.y; - camera->posOffset.z = at->z - player->actor.posRot.pos.z; + camera->posOffset.x = at->x - player->actor.world.pos.x; + camera->posOffset.y = at->y - player->actor.world.pos.y; + camera->posOffset.z = at->z - player->actor.world.pos.z; } else { camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f; } @@ -1622,9 +1622,9 @@ s32 Gameplay_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Ve player = camera->player; if (player != NULL) { - camera->posOffset.x = at->x - player->actor.posRot.pos.x; - camera->posOffset.y = at->y - player->actor.posRot.pos.y; - camera->posOffset.z = at->z - player->actor.posRot.pos.z; + camera->posOffset.x = at->x - player->actor.world.pos.x; + camera->posOffset.y = at->y - player->actor.world.pos.y; + camera->posOffset.z = at->z - player->actor.world.pos.z; } else { camera->posOffset.x = camera->posOffset.y = camera->posOffset.z = 0.0f; } @@ -1748,7 +1748,7 @@ void Gameplay_SetupRespawnPoint(GlobalContext* globalCtx, s32 respawnMode, s32 p roomIndex = globalCtx->roomCtx.curRoom.num; entranceIndex = gSaveContext.entranceIndex; Gameplay_SetRespawnData(globalCtx, respawnMode, entranceIndex, roomIndex, playerParams, - &player->actor.posRot.pos, player->actor.shape.rot.y); + &player->actor.world.pos, player->actor.shape.rot.y); } } @@ -1797,7 +1797,7 @@ s32 func_800C0D34(GlobalContext* globalCtx, Actor* actor, s16* yaw) { TransitionActorEntry* transitionActor; s32 frontRoom; - if (actor->type != ACTORTYPE_DOOR) { + if (actor->category != ACTORCAT_DOOR) { return 0; } diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c index 616f1e4b37..d6ed609d21 100644 --- a/src/code/z_player_call.c +++ b/src/code/z_player_call.c @@ -19,7 +19,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Player_InitVars = { ACTOR_PLAYER, - ACTORTYPE_PLAYER, + ACTORCAT_PLAYER, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(Player), diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 248998e214..e4d9141ed1 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -389,7 +389,7 @@ void func_8008EDF0(Player* this) { void func_8008EE08(Player* this) { if ((this->actor.bgCheckFlags & 1) || (this->stateFlags1 & 0x8A00000) || - (!(this->stateFlags1 & 0xC0000) && ((this->actor.posRot.pos.y - this->actor.groundY) < 100.0f))) { + (!(this->stateFlags1 & 0xC0000) && ((this->actor.world.pos.y - this->actor.floorHeight) < 100.0f))) { this->stateFlags1 &= ~0x400F8000; } else if (!(this->stateFlags1 & 0x2C0000)) { this->stateFlags1 |= 0x80000; @@ -1215,11 +1215,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* if (this->actor.scale.y >= 0.0f) { if (!Player_HoldsHookshot(this) && ((hookedActor = this->heldActor) != NULL)) { if (this->stateFlags1 & 0x200) { - Matrix_MultVec3f(&D_80126128, &hookedActor->posRot.pos); + Matrix_MultVec3f(&D_80126128, &hookedActor->world.pos); Matrix_RotateRPY(0x69E8, -0x5708, 0x458E, MTXMODE_APPLY); Matrix_Get(&sp14C); - func_800D20CC(&sp14C, &hookedActor->posRot.rot, 0); - hookedActor->shape.rot = hookedActor->posRot.rot; + func_800D20CC(&sp14C, &hookedActor->world.rot, 0); + hookedActor->shape.rot = hookedActor->world.rot; } else if (this->stateFlags1 & 0x800) { Vec3s spB8; @@ -1227,10 +1227,9 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* func_800D20CC(&sp14C, &spB8, 0); if (hookedActor->flags & 0x20000) { - hookedActor->posRot.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x; + hookedActor->world.rot.x = hookedActor->shape.rot.x = spB8.x - this->unk_3BC.x; } else { - hookedActor->posRot.rot.y = hookedActor->shape.rot.y = - this->actor.shape.rot.y + this->unk_3BC.y; + hookedActor->world.rot.y = hookedActor->shape.rot.y = this->actor.shape.rot.y + this->unk_3BC.y; } } } else { @@ -1298,11 +1297,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* MtxF sp44; s32 pad; - Matrix_MultVec3f(&D_80126190, &heldActor->posRot.pos); + Matrix_MultVec3f(&D_80126190, &heldActor->world.pos); Matrix_RotateRPY(0, -0x4000, -0x4000, MTXMODE_APPLY); Matrix_Get(&sp44); - func_800D20CC(&sp44, &heldActor->posRot.rot, 0); - heldActor->shape.rot = heldActor->posRot.rot; + func_800D20CC(&sp44, &heldActor->world.rot, 0); + heldActor->shape.rot = heldActor->world.rot; if (func_8002DD78(this) != 0) { Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY); @@ -1322,7 +1321,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } if (this->unk_862 == 0) { - Math_Vec3f_Copy(&heldActor->posRot.pos, &sGetItemRefPos); + Math_Vec3f_Copy(&heldActor->world.pos, &sGetItemRefPos); } } } @@ -1337,11 +1336,11 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* Matrix_Get(&this->shieldMf); } } else if (limbIndex == PLAYER_LIMB_HEAD) { - Matrix_MultVec3f(&D_801260D4, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_801260D4, &this->actor.focus.pos); } else { Vec3f* vec = &D_801261E0[(0, gSaveContext.linkAge)]; - func_8002BDB0(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec); + Actor_SetFeetPos(&this->actor, limbIndex, PLAYER_LIMB_L_FOOT, vec, PLAYER_LIMB_R_FOOT, vec); } } } diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index f0752a3e5e..30451a159c 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1054,9 +1054,9 @@ void AnimationContext_MoveActor(GlobalContext* globalCtx, AnimationEntryData* da Vec3f diff; SkelAnime_UpdateTranslation(entry->skelAnime, &diff, actor->shape.rot.y); - actor->posRot.pos.x += diff.x * actor->scale.x; - actor->posRot.pos.y += diff.y * actor->scale.y * entry->unk_08; - actor->posRot.pos.z += diff.z * actor->scale.z; + actor->world.pos.x += diff.x * actor->scale.x; + actor->world.pos.y += diff.y * actor->scale.y * entry->unk_08; + actor->world.pos.z += diff.z * actor->scale.z; } /** 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 26e784b19c..923aa5c10f 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -14,7 +14,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx); const ActorInit Arms_Hook_InitVars = { ACTOR_ARMS_HOOK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_LINK_BOY, sizeof(ArmsHook), @@ -72,7 +72,7 @@ void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitQuad(globalCtx, &this->collider); Collider_SetQuad(globalCtx, &this->collider, &this->actor, &sQuadInit); ArmsHook_SetupAction(this, ArmsHook_Wait); - this->unk_1E8 = this->actor.posRot.pos; + this->unk_1E8 = this->actor.world.pos; } void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -130,7 +130,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) { ((player->stateFlags1 & 0x4000080))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); - Math_Vec3f_Copy(&this->actor.posRot.pos, &player->unk_3C8); + Math_Vec3f_Copy(&this->actor.world.pos, &player->unk_3C8); return 1; } } @@ -140,7 +140,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) { void ArmsHook_AttachHookToActor(ArmsHook* this, Actor* actor) { actor->flags |= 0x2000; this->grabbed = actor; - Math_Vec3f_Diff(&actor->posRot.pos, &this->actor.posRot.pos, &this->grabbedDistDiff); + Math_Vec3f_Diff(&actor->world.pos, &this->actor.world.pos, &this->grabbedDistDiff); } void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { @@ -200,10 +200,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { this->grabbed = NULL; } else { if (this->actor.child != NULL) { - sp94 = func_8002DB48(this, grabbed); + sp94 = Actor_WorldDistXYZToActor(this, grabbed); sp90 = sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z)); - Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos); + Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos); if (50.0f < (sp94 - sp90)) { ArmsHook_DetachHookFromActor(this); grabbed = NULL; @@ -212,7 +212,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { } } - bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.posRot.pos, &bodyDistDiffVec); + bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.world.pos, &bodyDistDiffVec); if (bodyDistDiff < 30.0f) { velocity = 0.0f; phi_f16 = 0.0f; @@ -239,17 +239,17 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { if (this->actor.child == NULL) { if ((grabbed != NULL) && (grabbed->id == ACTOR_BG_SPOT06_OBJECTS)) { - Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos); + Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos); phi_f16 = 1.0f; } else { - Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.posRot.pos); + Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.world.pos); if (grabbed != NULL) { - Math_Vec3f_Sum(&this->actor.posRot.pos, &this->grabbedDistDiff, &grabbed->posRot.pos); + Math_Vec3f_Sum(&this->actor.world.pos, &this->grabbedDistDiff, &grabbed->world.pos); } } } else { Math_Vec3f_Diff(&bodyDistDiffVec, &newPos, &player->actor.velocity); - player->actor.posRot.rot.x = + player->actor.world.rot.x = Math_Atan2S(sqrtf(SQ(bodyDistDiffVec.x) + SQ(bodyDistDiffVec.z)), -bodyDistDiffVec.y); } @@ -258,7 +258,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { if (phi_f16 == 0.0f) { ArmsHook_SetupAction(this, ArmsHook_Wait); if (ArmsHook_AttachToPlayer(this, player)) { - Math_Vec3f_Diff(&this->actor.posRot.pos, &player->actor.posRot.pos, &player->actor.velocity); + Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &player->actor.velocity); player->actor.velocity.y -= 20.0f; return; } @@ -266,7 +266,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { } } else { Actor_MoveForward(&this->actor); - Math_Vec3f_Diff(&this->actor.posRot.pos, &this->actor.pos4, &prevFrameDiff); + Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff); Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8); this->actor.shape.rot.x = Math_Atan2S(this->actor.speedXZ, -this->actor.velocity.y); sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x); @@ -276,9 +276,9 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { if (func_8002F9EC(globalCtx, &this->actor, poly, bgId, &sp78) == false) { sp5C = COLPOLY_GET_NORMAL(poly->normal.x); sp58 = COLPOLY_GET_NORMAL(poly->normal.z); - Math_Vec3f_Copy(&this->actor.posRot.pos, &sp78); - this->actor.posRot.pos.x += 10.0f * sp5C; - this->actor.posRot.pos.z += 10.0f * sp58; + Math_Vec3f_Copy(&this->actor.world.pos, &sp78); + this->actor.world.pos.x += 10.0f * sp5C; + this->actor.world.pos.z += 10.0f * sp58; this->timer = 0; if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId) != 0) { if (bgId != BGCHECK_SCENE) { @@ -292,7 +292,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { &D_801333E0, &D_801333E8); return; } - CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.posRot.pos); + CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.world.pos); Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); return; @@ -342,8 +342,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_0602B288); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); - Math_Vec3f_Diff(&player->unk_3C8, &this->actor.posRot.pos, &sp78); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + Math_Vec3f_Diff(&player->unk_3C8, &this->actor.world.pos, &sp78); sp58 = SQ(sp78.x) + SQ(sp78.z); sp5C = sqrtf(sp58); Matrix_RotateY(Math_FAtan2F(sp78.x, sp78.z), MTXMODE_APPLY); 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 54bfe1e424..03d769267f 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -24,7 +24,7 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx); const ActorInit Arrow_Fire_InitVars = { ACTOR_ARROW_FIRE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ArrowFire), @@ -74,14 +74,14 @@ void ArrowFire_Charge(ArrowFire* this, GlobalContext* globalCtx) { this->radius += 1; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_FIRE - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { - this->unkPos = this->actor.posRot.pos; + this->unkPos = this->actor.world.pos; this->radius = 10; ArrowFire_SetupAction(this, ArrowFire_Fly); this->alpha = 255; @@ -157,14 +157,14 @@ void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx) { return; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f); + distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f); this->unk_158 = distanceScaled; if (distanceScaled < 1.0f) { this->unk_158 = 1.0f; } - func_80865ECC(&this->unkPos, &this->actor.posRot.pos, 0.05f); + func_80865ECC(&this->unkPos, &this->actor.world.pos, 0.05f); if (arrow->hitWall & 1) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_FRAME); @@ -207,7 +207,7 @@ void ArrowFire_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 618); - Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY); 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 e34b68c11f..cd0dd87db8 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -25,7 +25,7 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx); const ActorInit Arrow_Ice_InitVars = { ACTOR_ARROW_ICE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ArrowIce), @@ -75,14 +75,14 @@ void ArrowIce_Charge(ArrowIce* this, GlobalContext* globalCtx) { this->radius += 1; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_ICE - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { - this->unkPos = this->actor.posRot.pos; + this->unkPos = this->actor.world.pos; this->radius = 10; ArrowIce_SetupAction(this, ArrowIce_Fly); this->alpha = 255; @@ -158,14 +158,14 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) { return; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f); + distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f); this->unk_160 = distanceScaled; if (distanceScaled < 1.0f) { this->unk_160 = 1.0f; } - func_80867E8C(&this->unkPos, &this->actor.posRot.pos, 0.05f); + func_80867E8C(&this->unkPos, &this->actor.world.pos, 0.05f); if (arrow->hitWall & 1) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_ICE); @@ -208,7 +208,7 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 610); - Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY); 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 02feaaf5e4..90a5e7f033 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -25,7 +25,7 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx); const ActorInit Arrow_Light_InitVars = { ACTOR_ARROW_LIGHT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ArrowLight), @@ -75,14 +75,14 @@ void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx) { this->radius += 1; } // copy position and rotation from arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; func_8002F974(&this->actor, NA_SE_PL_ARROW_CHARGE_LIGHT - SFX_FLAG); // if arrow has no parent, player has fired the arrow if (arrow->actor.parent == NULL) { - this->unkPos = this->actor.posRot.pos; + this->unkPos = this->actor.world.pos; this->radius = 10; ArrowLight_SetupAction(this, ArrowLight_Fly); this->alpha = 255; @@ -158,14 +158,14 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) { return; } // copy position and rotation from parent arrow - this->actor.posRot.pos = arrow->actor.posRot.pos; + this->actor.world.pos = arrow->actor.world.pos; this->actor.shape.rot = arrow->actor.shape.rot; - distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.posRot.pos) * (1.0f / 24.0f); + distanceScaled = Math_Vec3f_DistXYZ(&this->unkPos, &this->actor.world.pos) * (1.0f / 24.0f); this->unk_160 = distanceScaled; if (distanceScaled < 1.0f) { this->unk_160 = 1.0f; } - func_80869E6C(&this->unkPos, &this->actor.posRot.pos, 0.05f); + func_80869E6C(&this->unkPos, &this->actor.world.pos, 0.05f); if (arrow->hitWall & 1) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_EXPLOSION_LIGHT); @@ -208,7 +208,7 @@ void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_arrow_light.c", 598); - Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(tranform->world.pos.x, tranform->world.pos.y, tranform->world.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateZ(tranform->shape.rot.z * (M_PI / 32768), MTXMODE_APPLY); 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 7b2c3dd01c..ae669899ee 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 @@ -34,7 +34,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx); const ActorInit Bg_Bdan_Objects_InitVars = { ACTOR_BG_BDAN_OBJECTS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_BDAN_OBJECTS, sizeof(BgBdanObjects), @@ -121,7 +121,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->params &= 0xFF; if (thisx->params == 2) { thisx->flags |= 0x30; - globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = thisx->posRot.pos.y; + globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = thisx->world.pos.y; this->actionFunc = func_8086C9A8; return; } @@ -129,20 +129,20 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06008CE0, &colHeader); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, this, &sCylinderInit); - thisx->posRot.pos.y = (f32)(thisx->posRot.pos.y + -79.0f); + thisx->world.pos.y = (f32)(thisx->world.pos.y + -79.0f); if (Flags_GetClear(globalCtx, thisx->room)) { Flags_SetSwitch(globalCtx, this->unk_168); this->actionFunc = func_8086C6EC; } else { if (BgBdanObjects_GetContactRu1(this, 4)) { - if (Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA, - thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, 0, - thisx->shape.rot.y + 0x8000, 0, 3) != NULL) { - thisx->child->posRot.pos.z = thisx->child->initPosRot.pos.z + 263.0f; + if (Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_EN_BIGOKUTA, thisx->home.pos.x, + thisx->home.pos.y, thisx->home.pos.z, 0, thisx->shape.rot.y + 0x8000, 0, + 3) != NULL) { + thisx->child->world.pos.z = thisx->child->home.pos.z + 263.0f; } - thisx->posRot.rot.y = 0; + thisx->world.rot.y = 0; this->actionFunc = func_8086C618; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + -70.0f; + thisx->world.pos.y = thisx->home.pos.y + -70.0f; } else { Flags_SetSwitch(globalCtx, this->unk_168); this->unk_16A = 0; @@ -159,7 +159,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06005580, &colHeader); if (Flags_GetSwitch(globalCtx, this->unk_168)) { this->actionFunc = BgBdanObjects_DoNothing; - thisx->posRot.pos.y = thisx->initPosRot.pos.y - 400.0f; + thisx->world.pos.y = thisx->home.pos.y - 400.0f; } else { this->actionFunc = func_8086CB10; } @@ -181,13 +181,13 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (BgBdanObjects_GetContactRu1(this, 0)) { - if (this->dyna.actor.xzDistToLink < 250.0f) { + if (this->dyna.actor.xzDistToPlayer < 250.0f) { BgBdanObjects_SetContactRu1(this, 1); this->unk_16A = 0x14; func_800800F8(globalCtx, 0xBFE, -0x63, &this->dyna.actor, 0); - player->actor.posRot.pos.x = -1130.0f; - player->actor.posRot.pos.y = -1025.0f; - player->actor.posRot.pos.z = -3300.0f; + player->actor.world.pos.x = -1130.0f; + player->actor.world.pos.y = -1025.0f; + player->actor.world.pos.z = -3300.0f; func_800AA000(0.0f, 0xFF, 0x14, 0x96); } } else { @@ -202,15 +202,15 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) { } if (!Gameplay_InCsMode(globalCtx) && !BgBdanObjects_GetContactRu1(this, 0)) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + -79.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + -79.0f; } else { - this->dyna.actor.posRot.pos.y = (this->dyna.actor.initPosRot.pos.y + -79.0f) - 5.0f; + this->dyna.actor.world.pos.y = (this->dyna.actor.home.pos.y + -79.0f) - 5.0f; } } void func_8086C1A0(BgBdanObjects* this, GlobalContext* globalCtx) { - if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 500.0f, 0.5f, 7.5f, - 1.0f) < 0.1f) { + if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 500.0f, 0.5f, 7.5f, 1.0f) < + 0.1f) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); this->actionFunc = func_8086C29C; this->unk_16A = 0x1E; @@ -243,8 +243,8 @@ void func_8086C29C(BgBdanObjects* this, GlobalContext* globalCtx) { if (BgBdanObjects_GetContactRu1(this, 3)) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_BIGOKUTA, - this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 140.0f, - this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0); + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 140.0f, + this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y + 0x8000, 0, 0); BgBdanObjects_SetContactRu1(this, 4); this->unk_16A = 0xA; this->actionFunc = func_8086C55C; @@ -256,19 +256,19 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) { Player* player = PLAYER; this->dyna.actor.velocity.y += 0.5f; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -70.0f, + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -70.0f, this->dyna.actor.velocity.y)) { - this->dyna.actor.posRot.rot.y = 0; + this->dyna.actor.world.rot.y = 0; this->unk_16A = 0x3C; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); - this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f; + this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f; this->actionFunc = func_8086C5BC; func_800800F8(globalCtx, 0xC08, -0x63, this->dyna.actor.child, 0); - player->actor.posRot.pos.x = -1130.0f; - player->actor.posRot.pos.y = -1025.0f; - player->actor.posRot.pos.z = -3500.0f; + player->actor.world.pos.x = -1130.0f; + player->actor.world.pos.y = -1025.0f; + player->actor.world.pos.z = -3500.0f; player->actor.shape.rot.y = 0x7530; - player->actor.posRot.rot.y = player->actor.shape.rot.y; + player->actor.world.rot.y = player->actor.shape.rot.y; func_800AA000(0.0f, 0xFF, 0x1E, 0x96); } else { func_8002F974(&this->dyna.actor, NA_SE_EV_BUYOSTAND_FALL - SFX_FLAG); @@ -280,7 +280,7 @@ void func_8086C3D8(BgBdanObjects* this, GlobalContext* globalCtx) { this->unk_16A = 0xB; } if (this->dyna.actor.child != NULL) { - this->dyna.actor.child->posRot.pos.y = this->dyna.actor.posRot.pos.y + 140.0f; + this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 140.0f; } } } @@ -316,18 +316,18 @@ void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { Flags_SetSwitch(globalCtx, this->unk_168); - this->dyna.actor.initPosRot.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000; + this->dyna.actor.home.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000; this->actionFunc = func_8086C6EC; } else { - this->dyna.actor.shape.rot.y += this->dyna.actor.posRot.rot.y; - func_800F436C(&this->dyna.actor.projectedPos, 0x2063, ABS(this->dyna.actor.posRot.rot.y) / 512.0f); + this->dyna.actor.shape.rot.y += this->dyna.actor.world.rot.y; + func_800F436C(&this->dyna.actor.projectedPos, 0x2063, ABS(this->dyna.actor.world.rot.y) / 512.0f); } } void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) { - s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.initPosRot.rot.y, 0x200); + s32 cond = Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 0x200); - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + -125.0f, 3.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + -125.0f, 3.0f)) { if (cond) { this->actionFunc = func_8086C76C; } @@ -336,7 +336,7 @@ void func_8086C6EC(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx) { if (func_8004356C(&this->dyna.actor)) { - if (this->dyna.actor.xzDistToLink < 120.0f) { + if (this->dyna.actor.xzDistToPlayer < 120.0f) { this->actionFunc = func_8086C7D0; func_800800F8(globalCtx, 0xC12, -0x63, &this->dyna.actor, 0); } @@ -344,8 +344,8 @@ void func_8086C76C(BgBdanObjects* this, GlobalContext* globalCtx) { } void func_8086C7D0(BgBdanObjects* this, GlobalContext* globalCtx) { - if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 965.0f, 0.5f, 15.0f, - 0.2f) < 0.01f) { + if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 965.0f, 0.5f, 15.0f, 0.2f) < + 0.01f) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_A); this->actionFunc = BgBdanObjects_DoNothing; } else { @@ -381,8 +381,8 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) { func_8005ACFC(globalCtx->cameraPtrs[0], 4); } } - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - - (sinf((f32)this->unk_16A * (M_PI / 256.0f)) * 471.239990234375f); // pi * 150 + this->dyna.actor.world.pos.y = + this->dyna.actor.home.pos.y - (sinf((f32)this->unk_16A * (M_PI / 256.0f)) * 471.239990234375f); // pi * 150 if (this->unk_16A == 0) { this->unk_16A = 0x200; } @@ -397,18 +397,18 @@ void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C9F0(BgBdanObjects* this, GlobalContext* globalCtx) { if (this->unk_16A == 0) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 0.5f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.5f)) { Flags_UnsetSwitch(globalCtx, this->unk_168); this->actionFunc = func_8086C9A8; } func_8002F948(this, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 75.0f, 0.5f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 75.0f, 0.5f)) { this->actionFunc = func_8086CABC; } func_8002F948(this, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } - globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.posRot.pos.y; + globalCtx->colCtx.colHeader->waterBoxes[7].ySurface = this->dyna.actor.world.pos.y; } void func_8086CABC(BgBdanObjects* this, GlobalContext* globalCtx) { @@ -426,7 +426,7 @@ void func_8086CB10(BgBdanObjects* this, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, this->unk_168); this->unk_16A = 0x32; this->actionFunc = func_8086CB8C; - this->dyna.actor.initPosRot.pos.y -= 200.0f; + this->dyna.actor.home.pos.y -= 200.0f; func_800800F8(globalCtx, 0xC1C, 0x33, &this->dyna.actor, 0); } } @@ -435,7 +435,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) { if (this->unk_16A != 0) { this->unk_16A -= 1; } - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f); + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->unk_16A * (M_PI / 50.0f)) * 200.0f); if (this->unk_16A == 0) { Audio_PlayActorSound2(this, NA_SE_EV_BUYOSTAND_STOP_U); this->actionFunc = BgBdanObjects_DoNothing; @@ -448,7 +448,7 @@ void func_8086CB8C(BgBdanObjects* this, GlobalContext* globalCtx) { void BgBdanObjects_Update(Actor* thisx, GlobalContext* globalCtx) { BgBdanObjects* this = THIS; - Actor_SetHeight(thisx, 50.0f); + Actor_SetFocus(thisx, 50.0f); this->actionFunc(this, globalCtx); } @@ -457,7 +457,7 @@ void BgBdanObjects_Draw(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == 0) { if (this->actionFunc == func_8086C054) { - if (((thisx->initPosRot.pos.y + -79.0f) - 5.0f) < thisx->posRot.pos.y) { + if (((thisx->home.pos.y + -79.0f) - 5.0f) < thisx->world.pos.y) { Matrix_Translate(0.0f, -50.0f, 0.0f, MTXMODE_APPLY); } } 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 c0afb59bf3..df768d6478 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 @@ -45,7 +45,7 @@ void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx); const ActorInit Bg_Bdan_Switch_InitVars = { ACTOR_BG_BDAN_SWITCH, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_BDAN_OBJECTS, sizeof(BgBdanSwitch), @@ -135,7 +135,7 @@ void func_8086D0EC(BgBdanSwitch* this) { this->unk_1D0 = ((Math_CosS(this->unk_1CC) * 0.5f) + 20.5f) * (this->unk_1C8 * 0.0050000004f); this->dyna.actor.scale.y = this->unk_1C8 * 0.1f; } - this->dyna.actor.shape.unk_08 = 1.2f / this->unk_1D0; + this->dyna.actor.shape.yOffset = 1.2f / this->unk_1D0; } void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -154,7 +154,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.scale.x = 0.1f; } this->dyna.actor.scale.y = 0.0f; - Actor_SetHeight(&this->dyna.actor, 10.0f); + Actor_SetFocus(&this->dyna.actor, 10.0f); switch (type) { case BLUE: @@ -166,7 +166,7 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { case YELLOW_TALL_2: func_8086D098(this, globalCtx); this->dyna.actor.flags |= 1; - this->dyna.actor.unk_1F = 4; + this->dyna.actor.targetMode = 4; } flag = Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); @@ -270,12 +270,12 @@ void func_8086D67C(BgBdanSwitch* this) { } void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) { + if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.2f; if (this->unk_1C8 <= 0.1f) { func_8086D730(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); } } } @@ -337,7 +337,7 @@ void func_8086D8CC(BgBdanSwitch* this, GlobalContext* globalCtx) { if (this->unk_1C8 <= 0.6f) { func_8086D9F8(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); } } @@ -347,12 +347,12 @@ void func_8086D944(BgBdanSwitch* this) { } void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) { + if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.2f; if (this->unk_1C8 <= 0.1f) { func_8086DB24(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); } } } @@ -433,7 +433,7 @@ void func_8086DC30(BgBdanSwitch* this) { } void func_8086DC48(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) { + if ((func_8005B198() == this->dyna.actor.category) || (this->unk_1DA <= 0)) { this->unk_1C8 -= 0.3f; if (this->unk_1C8 <= 1.0f) { func_8086DCCC(this); @@ -469,7 +469,7 @@ void func_8086DDA8(BgBdanSwitch* this) { } void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) { - if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.type)) || + if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; if (this->unk_1C8 >= 2.0f) { @@ -505,9 +505,9 @@ void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { } void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) { - func_800D1694(this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y + (this->dyna.actor.shape.unk_08 * this->unk_1D0), - this->dyna.actor.posRot.pos.z, &this->dyna.actor.shape.rot); + func_800D1694(this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y + (this->dyna.actor.shape.yOffset * this->unk_1D0), + this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot); Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY); Gfx_DrawDListOpa(globalCtx, dlist); } @@ -524,7 +524,7 @@ void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) { case YELLOW_TALL_2: func_8086DF58(this, globalCtx, D_060061A0); Collider_UpdateSpheres(0, &this->collider); - Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.posRot2.pos); + Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.focus.pos); break; case BLUE: func_8086DF58(this, globalCtx, D_06005A20); 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 0f5a15537f..ebffccccb0 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 @@ -20,7 +20,7 @@ void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx); const ActorInit Bg_Bom_Guard_InitVars = { ACTOR_BG_BOM_GUARD, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOWL, sizeof(BgBomGuard), @@ -51,7 +51,7 @@ void BgBomGuard_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.x = 1.0f; thisx->scale.y = 1.0f; thisx->scale.z = 1.0f; - this->unk_16C = thisx->posRot.pos; + this->unk_16C = thisx->world.pos; BgBomGuard_SetupAction(this, func_8086E638); } @@ -62,7 +62,7 @@ void BgBomGuard_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) { - Actor* it = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + Actor* it = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; Actor* thisx = &this->dyna.actor; this->unk_168 = 0; @@ -79,9 +79,9 @@ void func_8086E638(BgBomGuard* this, GlobalContext* globalCtx) { } if (this->unk_168 == 0) { - thisx->posRot.pos.y = sREG(64) + -200.0f; + thisx->world.pos.y = sREG(64) + -200.0f; } else { - thisx->posRot.pos.y = 0.0f; + thisx->world.pos.y = 0.0f; } } 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 9e74db67a6..e38cf2ef3f 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -76,7 +76,7 @@ static ColliderTrisInit sTrisInit = { const ActorInit Bg_Bombwall_InitVars = { ACTOR_BG_BOMBWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(BgBombwall), @@ -143,9 +143,9 @@ void BgBombwall_Init(Actor* thisx, GlobalContext* globalCtx) { BgBombwall_RotateVec(&vecs[j], &sp80, sin, cos); - vecs[j].x += this->dyna.actor.posRot.pos.x; - vecs[j].y += this->dyna.actor.posRot.pos.y; - vecs[j].z += this->dyna.actor.posRot.pos.z; + vecs[j].x += this->dyna.actor.world.pos.x; + vecs[j].y += this->dyna.actor.world.pos.y; + vecs[j].z += this->dyna.actor.world.pos.z; } Collider_SetTrisVertices(&this->collider, i, &vecs[0], &vecs[1], &vecs[2]); } @@ -187,7 +187,7 @@ void func_8086EB5C(BgBombwall* this, GlobalContext* globalCtx) { s32 i; f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; f32 temp; f32 new_var; @@ -219,7 +219,7 @@ void func_8086ED70(BgBombwall* this, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_HIT; func_8086EDFC(this, globalCtx); Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); - } else if (this->dyna.actor.xzDistToLink < 600.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } 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 1d44577c78..08c07b7dc3 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 @@ -31,7 +31,7 @@ extern Gfx D_06001390[]; const ActorInit Bg_Bowl_Wall_InitVars = { ACTOR_BG_BOWL_WALL, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOWL, sizeof(BgBowlWall), @@ -65,7 +65,7 @@ void BgBowlWall_Init(Actor* thisx, GlobalContext* globalCtx) { } this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - this->initPos = this->dyna.actor.posRot.pos; + this->initPos = this->dyna.actor.world.pos; osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ ボーリングおじゃま壁発生 ☆☆☆☆☆ %d\n" VT_RST, this->dyna.actor.params); this->actionFunc = BgBowlWall_SpawnBullseyes; @@ -87,12 +87,12 @@ void BgBowlWall_SpawnBullseyes(BgBowlWall* this, GlobalContext* globalCtx) { type = this->dyna.actor.params; if (type != 0) { type += (s16)Rand_ZeroFloat(2.99f); - this->dyna.actor.shape.rot.z = this->dyna.actor.posRot.rot.z = sTargetRot[type]; + this->dyna.actor.shape.rot.z = this->dyna.actor.world.rot.z = sTargetRot[type]; osSyncPrintf("\n\n"); } - this->bullseyeCenter.x = sBullseyeOffset[type].x + this->dyna.actor.posRot.pos.x; - this->bullseyeCenter.y = sBullseyeOffset[type].y + this->dyna.actor.posRot.pos.y; - this->bullseyeCenter.z = sBullseyeOffset[type].z + this->dyna.actor.posRot.pos.z; + this->bullseyeCenter.x = sBullseyeOffset[type].x + this->dyna.actor.world.pos.x; + this->bullseyeCenter.y = sBullseyeOffset[type].y + this->dyna.actor.world.pos.y; + this->bullseyeCenter.z = sBullseyeOffset[type].z + this->dyna.actor.world.pos.z; if (1) {} bullseye = (EnWallTubo*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_EN_WALL_TUBO, this->bullseyeCenter.x, this->bullseyeCenter.y, this->bullseyeCenter.z, @@ -100,10 +100,10 @@ void BgBowlWall_SpawnBullseyes(BgBowlWall* this, GlobalContext* globalCtx) { if (bullseye != NULL) { bullseye->explosionCenter = this->bullseyeCenter; if (type != 0) { - bullseye->explosionCenter = this->bullseyeCenter = this->dyna.actor.posRot.pos; + bullseye->explosionCenter = this->bullseyeCenter = this->dyna.actor.world.pos; } if (this->chuGirl == NULL) { - lookForGirl = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + lookForGirl = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; while (lookForGirl != NULL) { if (lookForGirl->id != ACTOR_EN_BOM_BOWL_MAN) { lookForGirl = lookForGirl->next; @@ -136,13 +136,13 @@ void BgBowlWall_FallDoEffects(BgBowlWall* this, GlobalContext* globalCtx) { if (this->dyna.actor.params == 0) { // wall collapses backwards Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, -0x3E80, 3, 500, 0); - this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x; + this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x; if (this->dyna.actor.shape.rot.x < -0x3C1E) { wallFallen = true; } } else { // wall slides downwards - Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); - if (this->dyna.actor.posRot.pos.y < (this->initPos.y - 400.0f)) { + Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); + if (this->dyna.actor.world.pos.y < (this->initPos.y - 400.0f)) { wallFallen = true; } } @@ -171,11 +171,11 @@ void BgBowlWall_FinishFall(BgBowlWall* this, GlobalContext* globalCtx) { if (this->dyna.actor.params == 0) { Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, -0x3E80, 1, 200, 0); } else { - Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); + Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y - 450.0f, 0.3f, 10.0f); } } else if (this->timer == 1) { - this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x = 0; - this->dyna.actor.posRot.pos.y = this->initPos.y - 450.0f; + this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0; + this->dyna.actor.world.pos.y = this->initPos.y - 450.0f; this->chuGirl->wallStatus[this->dyna.actor.params] = 2; this->actionFunc = BgBowlWall_Reset; } @@ -183,9 +183,9 @@ void BgBowlWall_FinishFall(BgBowlWall* this, GlobalContext* globalCtx) { void BgBowlWall_Reset(BgBowlWall* this, GlobalContext* globalCtx) { if (this->chuGirl->wallStatus[this->dyna.actor.params] != 2) { - Math_ApproachF(&this->dyna.actor.posRot.pos.y, this->initPos.y, 0.3f, 50.0f); - if (fabsf(this->dyna.actor.posRot.pos.y - this->initPos.y) <= 10.0f) { - this->dyna.actor.posRot.pos.y = this->initPos.y; + Math_ApproachF(&this->dyna.actor.world.pos.y, this->initPos.y, 0.3f, 50.0f); + if (fabsf(this->dyna.actor.world.pos.y - this->initPos.y) <= 10.0f) { + this->dyna.actor.world.pos.y = this->initPos.y; this->isHit = false; this->actionFunc = BgBowlWall_SpawnBullseyes; } 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 5251158b07..08362ae1b8 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_02014F80; /* const ActorInit Bg_Breakwall_InitVars = { ACTOR_BG_BREAKWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgBreakwall), 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 d9ec7b202b..24ea5ffcec 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 @@ -23,7 +23,7 @@ extern CollisionHeader D_06003CE0; const ActorInit Bg_Ddan_Jd_InitVars = { ACTOR_BG_DDAN_JD, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DDAN_OBJECTS, sizeof(BgDdanJd), @@ -94,35 +94,35 @@ void BgDdanJd_Idle(BgDdanJd* this, GlobalContext* globalCtx) { this->ySpeed = SHORTCUT_Y_SPEED; this->state = STATE_GO_MIDDLE_FROM_BOTTOM; this->idleTimer = 0; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; func_800800F8(globalCtx, 0xBF4, -0x63, &this->dyna.actor, 0); } if (this->idleTimer == 0) { this->idleTimer = IDLE_FRAMES; if (this->state == STATE_GO_BOTTOM) { this->state = STATE_GO_MIDDLE_FROM_BOTTOM; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; } else if (this->state == STATE_GO_MIDDLE_FROM_BOTTOM) { // If the platform has been activated as a shortcut if (this->ySpeed != DEFAULT_Y_SPEED) { this->state = STATE_GO_TOP; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_TOP; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_TOP; } else { this->state = STATE_GO_BOTTOM; - this->targetY = this->dyna.actor.initPosRot.pos.y; + this->targetY = this->dyna.actor.home.pos.y; } } else if (this->state == STATE_GO_MIDDLE_FROM_TOP) { // If the platform has been activated as a shortcut if (this->ySpeed != DEFAULT_Y_SPEED) { this->state = STATE_GO_TOP; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_TOP; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_TOP; } else { this->state = STATE_GO_BOTTOM; - this->targetY = this->dyna.actor.initPosRot.pos.y; + this->targetY = this->dyna.actor.home.pos.y; } } else if (this->state == STATE_GO_TOP) { this->state = STATE_GO_MIDDLE_FROM_TOP; - this->targetY = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->targetY = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; } this->actionFunc = BgDdanJd_Move; } @@ -133,20 +133,20 @@ void BgDdanJd_MoveEffects(BgDdanJd* this, GlobalContext* globalCtx) { Vec3f dustPos; // Generate random dust particles at the platform's base. - dustPos.y = this->dyna.actor.initPosRot.pos.y; + dustPos.y = this->dyna.actor.home.pos.y; if (globalCtx->gameplayFrames & 1) { - dustPos.x = this->dyna.actor.posRot.pos.x + 65.0f; - dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.z; + dustPos.x = this->dyna.actor.world.pos.x + 65.0f; + dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.z; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); - dustPos.x = this->dyna.actor.posRot.pos.x - 65.0f; - dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.z; + dustPos.x = this->dyna.actor.world.pos.x - 65.0f; + dustPos.z = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.z; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); } else { - dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.x; - dustPos.z = this->dyna.actor.posRot.pos.z + 65.0f; + dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.x; + dustPos.z = this->dyna.actor.world.pos.z + 65.0f; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); - dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.posRot.pos.x; - dustPos.z = this->dyna.actor.posRot.pos.z - 65.0f; + dustPos.x = Rand_CenteredFloat(110.0f) + this->dyna.actor.world.pos.x; + dustPos.z = this->dyna.actor.world.pos.z - 65.0f; func_80033480(globalCtx, &dustPos, 5.0f, 1, 20, 60, 1); } if (this->ySpeed == SHORTCUT_Y_SPEED) { @@ -161,11 +161,11 @@ void BgDdanJd_Move(BgDdanJd* this, GlobalContext* globalCtx) { Flags_GetSwitch(globalCtx, this->dyna.actor.params)) { this->ySpeed = SHORTCUT_Y_SPEED; this->state = STATE_GO_MIDDLE_FROM_BOTTOM; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + MOVE_HEIGHT_MIDDLE; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + MOVE_HEIGHT_MIDDLE; this->idleTimer = 0; this->actionFunc = BgDdanJd_Idle; func_800800F8(globalCtx, 0xBF4, -0x63, &this->dyna.actor, 0); - } else if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->targetY, this->ySpeed)) { + } else if (Math_StepToF(&this->dyna.actor.world.pos.y, this->targetY, this->ySpeed)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_PILLAR_MOVE_STOP); this->actionFunc = BgDdanJd_Idle; } 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 9b21211cb5..d9e8219c9b 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 @@ -21,7 +21,7 @@ void func_80871838(BgDdanKd* this, GlobalContext* globalCtx); const ActorInit Bg_Ddan_Kd_InitVars = { ACTOR_BG_DDAN_KD, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DDAN_OBJECTS, sizeof(BgDdanKd), @@ -87,7 +87,7 @@ void BgDdanKd_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params) == 0) { BgDdanKd_SetupAction(this, BgDdanKd_CheckForExplosions); } else { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 200.0f - 20.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 200.0f - 20.0f; BgDdanKd_SetupAction(this, func_80871838); } } @@ -108,7 +108,7 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) { explosive->params = 2; } if ((explosive != NULL) && (this->prevExplosive != NULL) && (explosive != this->prevExplosive) && - (Math_Vec3f_DistXZ(&this->prevExplosivePos, &explosive->posRot.pos) > 80.0f)) { + (Math_Vec3f_DistXZ(&this->prevExplosivePos, &explosive->world.pos) > 80.0f)) { BgDdanKd_SetupAction(this, BgDdanKd_LowerStairs); func_800800F8(globalCtx, 0xBEA, 0x3E7, this, 0); } else { @@ -118,7 +118,7 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) { this->prevExplosive = explosive; if (explosive != NULL) { this->timer = 13; - this->prevExplosivePos = explosive->posRot.pos; + this->prevExplosivePos = explosive->world.pos; } } Collider_UpdateCylinder(&this->dyna.actor, &this->collider); @@ -134,15 +134,15 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.speedXZ, 4.0f, 0.5f, 0.025f, 0.0f); func_800AA000(500.0f, 0x78, 0x14, 0xA); - if (Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, (this->dyna.actor.initPosRot.pos.y - 200.0f) - 20.0f, 0.075f, + if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, (this->dyna.actor.home.pos.y - 200.0f) - 20.0f, 0.075f, this->dyna.actor.speedXZ, 0.0075f) == 0.0f) { Flags_SetSwitch(globalCtx, this->dyna.actor.params); BgDdanKd_SetupAction(this, func_80871838); } else { - sp4C = (this->dyna.actor.pos4.y - this->dyna.actor.posRot.pos.y) + (this->dyna.actor.speedXZ * 0.25f); + sp4C = (this->dyna.actor.prevPos.y - this->dyna.actor.world.pos.y) + (this->dyna.actor.speedXZ * 0.25f); if (globalCtx->state.frames & 1) { - sp5C = sp50 = this->dyna.actor.posRot.pos; + sp5C = sp50 = this->dyna.actor.world.pos; if (globalCtx->state.frames & 2) { sp5C.z += 210.0f + Rand_ZeroOne() * 230.0f; @@ -153,8 +153,8 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { } sp5C.x += 80.0f + Rand_ZeroOne() * 10.0f; sp50.x -= 80.0f + Rand_ZeroOne() * 10.0f; - sp5C.y = this->dyna.actor.groundY + 20.0f + Rand_ZeroOne(); - sp50.y = this->dyna.actor.groundY + 20.0f + Rand_ZeroOne(); + sp5C.y = this->dyna.actor.floorHeight + 20.0f + Rand_ZeroOne(); + sp50.y = this->dyna.actor.floorHeight + 20.0f + Rand_ZeroOne(); func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1); func_80033480(globalCtx, &sp50, 20.0f, 1, sp4C * 135.0f, 60, 1); @@ -165,10 +165,10 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { func_8003555C(globalCtx, &sp5C, &D_808718FC, &D_80871908); func_8003555C(globalCtx, &sp50, &D_808718FC, &D_80871908); - sp5C = this->dyna.actor.posRot.pos; + sp5C = this->dyna.actor.world.pos; sp5C.z += 560.0f + Rand_ZeroOne() * 5.0f; sp5C.x += (Rand_ZeroOne() - 0.5f) * 160.0f; - sp5C.y = Rand_ZeroOne() * 3.0f + (this->dyna.actor.groundY + 20.0f); + sp5C.y = Rand_ZeroOne() * 3.0f + (this->dyna.actor.floorHeight + 20.0f); func_80033480(globalCtx, &sp5C, 20.0f, 1, sp4C * 135.0f, 60, 1); func_8003555C(globalCtx, &sp5C, &D_808718FC, &D_80871908); 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 fddb975b92..96b5e19547 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -23,7 +23,7 @@ void func_80872288(BgDodoago* this, GlobalContext* globalCtx); const ActorInit Bg_Dodoago_InitVars = { ACTOR_BG_DODOAGO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DDAN_OBJECTS, sizeof(BgDodoago), @@ -151,8 +151,8 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) { if (explosive != NULL) { this->unk_164 = - (Math_Vec3f_Yaw(&this->dyna.actor.posRot.pos, &explosive->posRot.pos) >= this->dyna.actor.shape.rot.y) ? 1 - : 0; + (Math_Vec3f_Yaw(&this->dyna.actor.world.pos, &explosive->world.pos) >= this->dyna.actor.shape.rot.y) ? 1 + : 0; if (((globalCtx->unk_11D30[0] == 0xFF) && (this->unk_164 == 1)) || ((globalCtx->unk_11D30[1] == 0xFF) && (this->unk_164 == 0))) { @@ -220,22 +220,22 @@ void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx) { if (D_80872824 == 0x6C) { for (i = 10; i >= 0; i--) { - currentPos.x = D_808725CC[i].x + this->dyna.actor.posRot.pos.x; - currentPos.y = D_808725CC[i].y + this->dyna.actor.posRot.pos.y; - currentPos.z = D_808725CC[i].z + this->dyna.actor.posRot.pos.z; + currentPos.x = D_808725CC[i].x + this->dyna.actor.world.pos.x; + currentPos.y = D_808725CC[i].y + this->dyna.actor.world.pos.y; + currentPos.z = D_808725CC[i].z + this->dyna.actor.world.pos.z; func_80033480(globalCtx, ¤tPos, 2.0f, 3, 0xC8, 0x4B, 1); } } - currentPos.x = this->dyna.actor.posRot.pos.x + 200.0f; - currentPos.y = this->dyna.actor.posRot.pos.y - 20.0f; - currentPos.z = this->dyna.actor.posRot.pos.z + 100.0f; + currentPos.x = this->dyna.actor.world.pos.x + 200.0f; + currentPos.y = this->dyna.actor.world.pos.y - 20.0f; + currentPos.z = this->dyna.actor.world.pos.z + 100.0f; BgDodoago_SpawnSparkles(¤tPos, globalCtx); - currentPos.x = this->dyna.actor.posRot.pos.x - 200.0f; - currentPos.y = this->dyna.actor.posRot.pos.y - 20.0f; - currentPos.z = this->dyna.actor.posRot.pos.z + 100.0f; + currentPos.x = this->dyna.actor.world.pos.x - 200.0f; + currentPos.y = this->dyna.actor.world.pos.y - 20.0f; + currentPos.z = this->dyna.actor.world.pos.z + 100.0f; BgDodoago_SpawnSparkles(¤tPos, globalCtx); Math_StepToS(&this->unk_164, 0x64, 3); @@ -276,7 +276,8 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) { } this->colliders[1].base.ocFlags1 &= ~OC1_HIT; this->colliders[2].base.ocFlags1 &= ~OC1_HIT; - if (bomb->actor.type == ACTORTYPE_EXPLOSIVES && bomb->actor.id == ACTOR_EN_BOM && bomb->actor.params == 0) { + if (bomb->actor.category == ACTORCAT_EXPLOSIVE && bomb->actor.id == ACTOR_EN_BOM && + bomb->actor.params == 0) { this->dyna.actor.parent = &bomb->actor; bomb->timer = 50; bomb->actor.speedXZ = 0.0f; 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 6e227b4c12..e892972eac 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 @@ -62,7 +62,7 @@ extern UNK_TYPE D_0601D514; /* const ActorInit Bg_Dy_Yoseizo_InitVars = { ACTOR_BG_DY_YOSEIZO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DY_OBJ, sizeof(BgDyYoseizo), 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 09dc7cc5a6..d2dc3a9e2e 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 @@ -29,7 +29,7 @@ void BgGanonOtyuka_DoNothing(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Ganon_Otyuka_InitVars = { ACTOR_BG_GANON_OTYUKA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GANON, sizeof(BgGanonOtyuka), @@ -135,11 +135,11 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) { Vec3f center; s16 i; - if (this->isFalling || ((globalCtx->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToLinkSq < 4900.0f))) { + if (this->isFalling || ((globalCtx->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToPlayerSq < 4900.0f))) { osSyncPrintf("OTC O 1\n"); for (i = 0; i < ARRAY_COUNT(D_80876A68); i++) { - prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (prop != NULL) { if ((prop == thisx) || (prop->id != ACTOR_BG_GANON_OTYUKA)) { prop = prop->next; @@ -148,9 +148,9 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) { platform = (BgGanonOtyuka*)prop; - dx = platform->dyna.actor.posRot.pos.x - this->dyna.actor.posRot.pos.x + D_80876A68[i].x; - dy = platform->dyna.actor.posRot.pos.y - this->dyna.actor.posRot.pos.y; - dz = platform->dyna.actor.posRot.pos.z - this->dyna.actor.posRot.pos.z + D_80876A68[i].z; + dx = platform->dyna.actor.world.pos.x - this->dyna.actor.world.pos.x + D_80876A68[i].x; + dy = platform->dyna.actor.world.pos.y - this->dyna.actor.world.pos.y; + dz = platform->dyna.actor.world.pos.z - this->dyna.actor.world.pos.z + D_80876A68[i].z; if ((fabsf(dx) < 10.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 10.0f)) { platform->visibleSides |= sSides[i]; @@ -164,9 +164,9 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, GlobalContext* globalCtx) { osSyncPrintf("OTC O 2\n"); for (i = 0; i < ARRAY_COUNT(D_80876A68); i++) { - center.x = this->dyna.actor.posRot.pos.x + D_80876A68[i].x; - center.y = this->dyna.actor.posRot.pos.y; - center.z = this->dyna.actor.posRot.pos.z + D_80876A68[i].z; + center.x = this->dyna.actor.world.pos.x + D_80876A68[i].x; + center.y = this->dyna.actor.world.pos.y; + center.z = this->dyna.actor.world.pos.z + D_80876A68[i].z; if (BgCheck_SphVsFirstPoly(&globalCtx->colCtx, ¢er, 50.0f)) { this->unwalledSides |= sSides[i]; } @@ -214,7 +214,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { } if (this->dropTimer == 0) { this->flashYScale = 0.0f; - Math_ApproachF(&this->dyna.actor.posRot.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); + Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 2.0f); if (!(this->unwalledSides & OTYUKA_SIDE_EAST)) { this->dyna.actor.shape.rot.z -= (s16)(this->dyna.actor.speedXZ * 30.0f); @@ -228,22 +228,22 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { if (!(this->unwalledSides & OTYUKA_SIDE_NORTH)) { this->dyna.actor.shape.rot.x -= (s16)(this->dyna.actor.speedXZ * 30.0f); } - if (this->dyna.actor.posRot.pos.y < -750.0f) { - if (player->actor.posRot.pos.y < -400.0f) { + if (this->dyna.actor.world.pos.y < -750.0f) { + if (player->actor.world.pos.y < -400.0f) { accel.x = accel.z = 0.0f; accel.y = 0.1f; velocity.x = velocity.y = velocity.z = 0.0f; for (i = 0; i < 30; i++) { - pos.x = Rand_CenteredFloat(150.0f) + this->dyna.actor.posRot.pos.x; + pos.x = Rand_CenteredFloat(150.0f) + this->dyna.actor.world.pos.x; pos.y = Rand_ZeroFloat(60.0f) + -750.0f; - pos.z = Rand_CenteredFloat(150.0f) + this->dyna.actor.posRot.pos.z; + pos.z = Rand_CenteredFloat(150.0f) + this->dyna.actor.world.pos.z; func_8002836C(globalCtx, &pos, &velocity, &accel, &sDustPrimColor, &sDustEnvColor, (s16)Rand_ZeroFloat(100.0f) + 250, 5, (s16)Rand_ZeroFloat(5.0f) + 15); } func_80033DB8(globalCtx, 10, 15); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 0x28, NA_SE_EV_BOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 0x28, NA_SE_EV_BOX_BREAK); } Actor_Kill(&this->dyna.actor); } @@ -255,7 +255,7 @@ void BgGanonOtyuka_Fall(BgGanonOtyuka* this, GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_EV_BLOCKSINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - Math_ApproachF(&this->dyna.actor.posRot.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); + Math_ApproachF(&this->dyna.actor.world.pos.y, -1000.0f, 1.0f, this->dyna.actor.speedXZ); Math_ApproachF(&this->dyna.actor.speedXZ, 100.0f, 1.0f, 0.1f); } osSyncPrintf("MODE DOWN END\n"); @@ -287,7 +287,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_ganon_otyuka.c", 702); - actor = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actor != NULL) { if (actor->id == ACTOR_BOSS_GANON) { ganondorf = (BossGanon*)actor; @@ -307,24 +307,24 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, sPlatformSetupDList); - actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (actor != NULL) { if (actor->id == ACTOR_BG_GANON_OTYUKA) { platform = (BgGanonOtyuka*)actor; if (platform->dyna.actor.projectedPos.z > spBC) { - if (camera->eye.y > platform->dyna.actor.posRot.pos.y) { + if (camera->eye.y > platform->dyna.actor.world.pos.y) { phi_s2 = sPlatformTopDList; } else { phi_s2 = sPlatformBottomDList; } - Matrix_Translate(platform->dyna.actor.posRot.pos.x, platform->dyna.actor.posRot.pos.y, - platform->dyna.actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(platform->dyna.actor.world.pos.x, platform->dyna.actor.world.pos.y, + platform->dyna.actor.world.pos.z, MTXMODE_NEW); phi_s1 = NULL; if (platform->isFalling) { Matrix_RotateX((platform->dyna.actor.shape.rot.x / (f32)0x8000) * M_PI, MTXMODE_APPLY); Matrix_RotateZ((platform->dyna.actor.shape.rot.z / (f32)0x8000) * M_PI, MTXMODE_APPLY); - if (camera->eye.y > platform->dyna.actor.posRot.pos.y) { + if (camera->eye.y > platform->dyna.actor.world.pos.y) { phi_s1 = sPlatformBottomDList; } else { phi_s1 = sPlatformTopDList; @@ -357,7 +357,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { } func_80093D84(globalCtx->state.gfxCtx); - actor = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (actor != NULL) { if (actor->id == ACTOR_BG_GANON_OTYUKA) { platform = (BgGanonOtyuka*)actor; @@ -371,8 +371,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { platform->flashPrimColorB, 0); gDPSetEnvColor(POLY_XLU_DISP++, platform->flashEnvColorR, platform->flashEnvColorG, platform->flashEnvColorB, 128); - Matrix_Translate(platform->dyna.actor.posRot.pos.x, 0.0f, platform->dyna.actor.posRot.pos.z, - MTXMODE_NEW); + Matrix_Translate(platform->dyna.actor.world.pos.x, 0.0f, platform->dyna.actor.world.pos.z, MTXMODE_NEW); for (i = 0; i < ARRAY_COUNT(sSides); i++) { if (platform->unwalledSides & sSides[i]) { 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 eb5f279aaf..144f967170 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 @@ -23,7 +23,7 @@ void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx); const ActorInit Bg_Gate_Shutter_InitVars = { ACTOR_BG_GATE_SHUTTER, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_SPOT01_MATOYAB, sizeof(BgGateShutter), @@ -44,13 +44,13 @@ void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_06001DA8, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - this->somePos.x = thisx->posRot.pos.x; - this->somePos.y = thisx->posRot.pos.y; - this->somePos.z = thisx->posRot.pos.z; + this->somePos.x = thisx->world.pos.x; + this->somePos.y = thisx->world.pos.y; + this->somePos.z = thisx->world.pos.z; if (((gSaveContext.infTable[7] & 0x40) || (gSaveContext.eventChkInf[4] & 0x20)) && (globalCtx->sceneNum == SCENE_SPOT01)) { - thisx->posRot.pos.x = -89.0f; - thisx->posRot.pos.z = -1375.0f; + thisx->world.pos.x = -89.0f; + thisx->world.pos.z = -1375.0f; } thisx->scale.x = 1.0f; thisx->scale.y = 1.0f; @@ -84,9 +84,9 @@ void func_80878300(BgGateShutter* this, GlobalContext* globalCtx) { if (this->unk_178 == 0) { Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); - thisx->posRot.pos.x -= 2.0f; - Math_ApproachF(&thisx->posRot.pos.z, -1375.0f, 0.8f, 0.3f); - if (thisx->posRot.pos.x < -89.0f) { + thisx->world.pos.x -= 2.0f; + Math_ApproachF(&thisx->world.pos.z, -1375.0f, 0.8f, 0.3f); + if (thisx->world.pos.x < -89.0f) { Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); this->unk_178 = 0x1E; this->actionFunc = func_808783AC; @@ -106,10 +106,10 @@ void func_808783D4(BgGateShutter* this, GlobalContext* globalCtx) { if (this->unk_178 == 0) { Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); - thisx->posRot.pos.x += 2.0f; - Math_ApproachF(&thisx->posRot.pos.z, -1350.0f, 0.8f, 0.3f); - if (thisx->posRot.pos.x > 90.0f) { - thisx->posRot.pos.x = 91.0f; + thisx->world.pos.x += 2.0f; + Math_ApproachF(&thisx->world.pos.z, -1350.0f, 0.8f, 0.3f); + if (thisx->world.pos.x > 90.0f) { + thisx->world.pos.x = 91.0f; Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); this->unk_178 = 30; this->actionFunc = func_808783AC; 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 b2c401451e..f3e2e75c60 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 @@ -21,7 +21,7 @@ void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, GlobalContext* globalCtx); const ActorInit Bg_Gjyo_Bridge_InitVars = { ACTOR_BG_GJYO_BRIDGE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GJYO_OBJECTS, sizeof(BgGjyoBridge), @@ -75,9 +75,9 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) Player* player = PLAYER; if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && - (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.posRot.pos.x > -70.0f) && - (player->actor.posRot.pos.x < 300.0f) && (player->actor.posRot.pos.y > 1340.0f) && - (player->actor.posRot.pos.z > 1340.0f) && (player->actor.posRot.pos.z < 1662.0f) && + (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.world.pos.x > -70.0f) && + (player->actor.world.pos.x < 300.0f) && (player->actor.world.pos.y > 1340.0f) && + (player->actor.world.pos.z > 1340.0f) && (player->actor.world.pos.z < 1662.0f) && !Gameplay_InCsMode(globalCtx)) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_02002640); gSaveContext.cutsceneTrigger = 1; 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 dfc40ef178..5997d1d8e0 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 @@ -24,7 +24,7 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, GlobalContext* globa const ActorInit Bg_Gnd_Darkmeiro_InitVars = { ACTOR_BG_GND_DARKMEIRO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndDarkmeiro), 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 a9b02997ec..a5f7652033 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 @@ -25,7 +25,7 @@ extern UNK_TYPE D_0600ECD8; /* const ActorInit Bg_Gnd_Firemeiro_InitVars = { ACTOR_BG_GND_FIREMEIRO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndFiremeiro), 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 0ee93ed524..c079e69e08 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 @@ -29,7 +29,7 @@ extern CollisionHeader D_06004618; const ActorInit Bg_Gnd_Iceblock_InitVars = { ACTOR_BG_GND_ICEBLOCK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndIceblock), @@ -56,17 +56,17 @@ void BgGndIceblock_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_06004618, &colHeader); - this->targetPos = this->dyna.actor.initPosRot.pos; + this->targetPos = this->dyna.actor.home.pos; this->actionFunc = BgGndIceblock_Idle; this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - if (this->dyna.actor.posRot.pos.x == 2792.0f) { + if (this->dyna.actor.world.pos.x == 2792.0f) { this->dyna.actor.params = 0; sBlockPositions[0] = 7; - } else if (this->dyna.actor.posRot.pos.x == 3032.0f) { + } else if (this->dyna.actor.world.pos.x == 3032.0f) { this->dyna.actor.params = 1; sBlockPositions[1] = 14; } else { - LOG_FLOAT("thisx->world.position.x", this->dyna.actor.posRot.pos.x, "../z_bg_gnd_iceblock.c", 138); + LOG_FLOAT("thisx->world.position.x", this->dyna.actor.world.pos.x, "../z_bg_gnd_iceblock.c", 138); __assert("0", "../z_bg_gnd_iceblock.c", 139); } } @@ -242,7 +242,7 @@ void BgGndIceblock_Idle(BgGndIceblock* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; if (this->dyna.unk_150 > 0.0f) { BgGndIceblock_SetNextPosition(this); - if (func_8002DBB0(&this->dyna.actor, &this->targetPos) > 1.0f) { + if (Actor_WorldDistXZToPoint(&this->dyna.actor, &this->targetPos) > 1.0f) { func_8002DF54(globalCtx, &this->dyna.actor, 8); this->actionFunc = BgGndIceblock_Slide; } @@ -259,8 +259,8 @@ void BgGndIceblock_Reset(BgGndIceblock* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; } - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 1.0f)) { - this->targetPos = thisx->initPosRot.pos; + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) { + this->targetPos = thisx->home.pos; thisx->speedXZ = 0.0f; this->actionFunc = BgGndIceblock_Idle; switch (thisx->params) { @@ -278,11 +278,11 @@ void BgGndIceblock_Fall(BgGndIceblock* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->velocity.y += 1.0f; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 300.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 300.0f, thisx->velocity.y)) { thisx->velocity.y = 0.0f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.y = thisx->initPosRot.pos.y - 100.0f; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.y = thisx->home.pos.y - 100.0f; + thisx->world.pos.z = thisx->home.pos.z; if (Player_InCsMode(globalCtx)) { func_8002DF54(globalCtx, thisx, 7); } @@ -294,7 +294,7 @@ void BgGndIceblock_Hole(BgGndIceblock* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->velocity.y += 1.0f; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 100.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 100.0f, thisx->velocity.y)) { thisx->velocity.y = 0.0f; if (Player_InCsMode(globalCtx)) { func_8002DF54(globalCtx, thisx, 7); @@ -311,12 +311,12 @@ void BgGndIceblock_Slide(BgGndIceblock* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f); - atTarget = Math_StepToF(&thisx->posRot.pos.x, this->targetPos.x, thisx->speedXZ); - atTarget &= Math_StepToF(&thisx->posRot.pos.z, this->targetPos.z, thisx->speedXZ); + atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ); + atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ); if (atTarget) { thisx->speedXZ = 0.0f; - this->targetPos.x = thisx->posRot.pos.x; - this->targetPos.z = thisx->posRot.pos.z; + this->targetPos.x = thisx->world.pos.x; + this->targetPos.z = thisx->world.pos.z; Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); switch (BgGndIceblock_NextAction(this)) { case GNDICE_IDLE: @@ -335,17 +335,13 @@ void BgGndIceblock_Slide(BgGndIceblock* this, GlobalContext* globalCtx) { velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158); velocity.y = Rand_ZeroOne() + 1.0f; velocity.z = -(1.5f + Rand_ZeroOne()) * Math_CosS(this->dyna.unk_158); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); - pos.y = thisx->posRot.pos.y; + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); + pos.y = thisx->world.pos.y; func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); spread = Rand_CenteredFloat(120.0f); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); } 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 58d9b4eb64..af0f8acf17 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 @@ -17,7 +17,7 @@ void BgGndNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Gnd_Nisekabe_InitVars = { ACTOR_BG_GND_NISEKABE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndNisekabe), 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 2b550e8469..ee410ce7fc 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 @@ -22,7 +22,7 @@ void func_8087B350(BgGndSoulmeiro* this, GlobalContext* globalCtx); const ActorInit Bg_Gnd_Soulmeiro_InitVars = { ACTOR_BG_GND_SOULMEIRO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(BgGndSoulmeiro), @@ -77,8 +77,8 @@ void BgGndSoulmeiro_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = func_8087B284; if (Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 9); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 9); this->actor.draw = NULL; Actor_Kill(&this->actor); return; @@ -130,8 +130,8 @@ void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx) { if (!this->unk_198) { Flags_SetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F); Actor_Kill(&this->actor); - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 9); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 9); return; } @@ -140,29 +140,29 @@ void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx) { if ((this->unk_198 % 6) == 0) { temp_2 = Rand_ZeroOne() * (10922.0f); // This should be: 0x10000 / 6.0f vecA.y = 0.0f; - vecB.y = this->actor.posRot.pos.y; + vecB.y = this->actor.world.pos.y; this2 = this; for (i = 0; i < 6; i++) { temp_1 = Rand_CenteredFloat(0x2800) + temp_2; temp_3 = Math_SinS(temp_1); temp_4 = Math_CosS(temp_1); - vecB.x = this2->actor.posRot.pos.x + (120.0f * temp_3); - vecB.z = this2->actor.posRot.pos.z + (120.0f * temp_4); - distXZ = Math_Vec3f_DistXZ(&this2->actor.initPosRot.pos, &vecB) * (1.0f / 120.0f); + vecB.x = this2->actor.world.pos.x + (120.0f * temp_3); + vecB.z = this2->actor.world.pos.z + (120.0f * temp_4); + distXZ = Math_Vec3f_DistXZ(&this2->actor.home.pos, &vecB) * (1.0f / 120.0f); if (distXZ < 0.7f) { temp_3 = Math_SinS(temp_1 + 0x8000); temp_4 = Math_CosS(temp_1 + 0x8000); - vecB.x = this->actor.posRot.pos.x + (120.0f * temp_3); - vecB.z = this->actor.posRot.pos.z + (120.0f * temp_4); - distXZ = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &vecB) * (1.0f / 120.0f); + vecB.x = this->actor.world.pos.x + (120.0f * temp_3); + vecB.z = this->actor.world.pos.z + (120.0f * temp_4); + distXZ = Math_Vec3f_DistXZ(&this->actor.home.pos, &vecB) * (1.0f / 120.0f); } vecA.x = 4.0f * temp_3 * distXZ; vecA.y = 0.0f; vecA.z = 4.0f * temp_4 * distXZ; - EffectSsDeadDb_Spawn(globalCtx, &this->actor.initPosRot.pos, &vecA, &sZeroVec, 60, 6, 255, 255, 150, 170, - 255, 0, 0, 1, 14, true); + EffectSsDeadDb_Spawn(globalCtx, &this->actor.home.pos, &vecA, &sZeroVec, 60, 6, 255, 255, 150, 170, 255, 0, + 0, 1, 14, true); temp_2 += 0x2AAA; } } 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 e04b5c2220..bdaff7b6f4 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -23,7 +23,7 @@ void func_8087BAE4(BgHaka* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_InitVars = { ACTOR_BG_HAKA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA, sizeof(BgHaka), @@ -63,7 +63,7 @@ void BgHaka_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_8087B758(BgHaka* this, Player* player) { Vec3f sp1C; - func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp1C, &player->actor.world.pos); if (fabsf(sp1C.x) < 34.6f && sp1C.z > -112.8f && sp1C.z < -36.0f) { player->stateFlags2 |= 0x200; } @@ -86,7 +86,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; } else { - this->dyna.actor.posRot.rot.y = this->dyna.actor.shape.rot.y + 0x8000; + this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x8000; this->actionFunc = func_8087B938; } } @@ -100,19 +100,19 @@ void func_8087B938(BgHaka* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ += 0.05f; this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 1.5f); sp38 = Math_StepToF(&this->dyna.actor.minVelocityY, 60.0f, this->dyna.actor.speedXZ); - this->dyna.actor.posRot.pos.x = - Math_SinS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - Math_CosS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = + Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = + Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.minVelocityY + this->dyna.actor.home.pos.z; if (sp38 != 0) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; if (this->dyna.actor.params == 1) { func_80078884(NA_SE_SY_CORRECT_CHIME); } else if (gSaveContext.nightFlag && globalCtx->sceneNum == SCENE_SPOT02) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->dyna.actor.initPosRot.pos.x, - this->dyna.actor.initPosRot.pos.y, this->dyna.actor.initPosRot.pos.z, 0, - this->dyna.actor.shape.rot.y, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->dyna.actor.home.pos.x, + this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, this->dyna.actor.shape.rot.y, 0, + 1); } this->actionFunc = func_8087BAAC; } 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 4a2a28b501..08e6faf3fa 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 @@ -56,13 +56,13 @@ extern CollisionHeader D_060131C4; static s16 sSkullOfTruthRotY = 0x100; static u8 sPuzzleState = 1; -static f32 sStatueDistToLink = 0; +static f32 sStatueDistToPlayer = 0; static s16 sStatueRotY; const ActorInit Bg_Haka_Gate_InitVars = { ACTOR_BG_HAKA_GATE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaGate), @@ -113,7 +113,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == BGHAKAGATE_STATUE) { CollisionHeader_GetVirtual(&D_060131C4, &colHeader); this->vTimer = 0; - sStatueDistToLink = 0.0f; + sStatueDistToPlayer = 0.0f; if (Flags_GetSwitch(globalCtx, this->switchFlag)) { this->actionFunc = BgHakaGate_StatueInactive; } else { @@ -130,10 +130,10 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_0600A938, &colHeader); if (Flags_GetSwitch(globalCtx, this->switchFlag)) { this->actionFunc = BgHakaGate_DoNothing; - thisx->posRot.pos.y += 80.0f; + thisx->world.pos.y += 80.0f; } else { thisx->flags |= 0x10; - Actor_SetHeight(thisx, 30.0f); + Actor_SetFocus(thisx, 30.0f); this->actionFunc = BgHakaGate_GateWait; } } @@ -171,10 +171,10 @@ void BgHakaGate_StatueIdle(BgHakaGate* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 != 0.0f) { if (this->vTimer == 0) { - this->vInitTurnAngle = this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsLink; - sStatueDistToLink = this->dyna.actor.xzDistToLink; + this->vInitTurnAngle = this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsPlayer; + sStatueDistToPlayer = this->dyna.actor.xzDistToPlayer; forceDirection = (this->dyna.unk_150 >= 0.0f) ? 1.0f : -1.0f; - linkDirection = ((s16)(this->dyna.actor.yawTowardsLink - player->actor.shape.rot.y) > 0) ? -1 : 1; + linkDirection = ((s16)(this->dyna.actor.yawTowardsPlayer - player->actor.shape.rot.y) > 0) ? -1 : 1; this->vTurnDirection = linkDirection * forceDirection; this->actionFunc = BgHakaGate_StatueTurn; } else { @@ -203,15 +203,15 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { turnFinished = Math_StepToS(&this->vTurnAngleDeg10, 600, this->vTurnRateDeg10); turnAngle = this->vTurnAngleDeg10 * this->vTurnDirection; this->dyna.actor.shape.rot.y = (this->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f); - if ((player->stateFlags2 & 0x10) && (sStatueDistToLink > 0.0f)) { - player->actor.posRot.pos.x = - this->dyna.actor.initPosRot.pos.x + - (Math_SinS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToLink); - player->actor.posRot.pos.z = - this->dyna.actor.initPosRot.pos.z + - (Math_CosS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToLink); + if ((player->stateFlags2 & 0x10) && (sStatueDistToPlayer > 0.0f)) { + player->actor.world.pos.x = + this->dyna.actor.home.pos.x + + (Math_SinS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToPlayer); + player->actor.world.pos.z = + this->dyna.actor.home.pos.z + + (Math_CosS(this->dyna.actor.shape.rot.y - this->vInitTurnAngle) * sStatueDistToPlayer); } else { - sStatueDistToLink = 0.0f; + sStatueDistToPlayer = 0.0f; } sStatueRotY = this->dyna.actor.shape.rot.y; if (turnFinished) { @@ -227,14 +227,14 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { } void BgHakaGate_FloorClosed(BgHakaGate* this, GlobalContext* globalCtx) { - if ((sStatueDistToLink > 1.0f) && (sStatueRotY != 0)) { + if ((sStatueDistToPlayer > 1.0f) && (sStatueRotY != 0)) { Player* player = PLAYER; f32 radialDist; f32 angDist; f32 cos = Math_CosS(sStatueRotY); f32 sin = Math_SinS(sStatueRotY); - f32 dx = player->actor.posRot.pos.x - this->dyna.actor.posRot.pos.x; - f32 dz = player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z; + f32 dx = player->actor.world.pos.x - this->dyna.actor.world.pos.x; + f32 dz = player->actor.world.pos.z - this->dyna.actor.world.pos.z; radialDist = dx * cos - dz * sin; angDist = dx * sin + dz * cos; @@ -242,7 +242,7 @@ void BgHakaGate_FloorClosed(BgHakaGate* this, GlobalContext* globalCtx) { if ((radialDist > 110.0f) || (fabsf(angDist) > 40.0f)) { s16 yawDiff = sSkullOfTruthRotY - sStatueRotY; - sStatueDistToLink = 0.0f; + sStatueDistToPlayer = 0.0f; if (ABS(yawDiff) < 0x80) { Flags_SetSwitch(globalCtx, this->switchFlag); sPuzzleState = SKULL_OF_TRUTH_FOUND; @@ -280,7 +280,7 @@ void BgHakaGate_GateWait(BgHakaGate* this, GlobalContext* globalCtx) { } void BgHakaGate_GateOpen(BgHakaGate* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 80.0f, 1.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 80.0f, 1.0f)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); this->dyna.actor.flags &= ~0x10; this->actionFunc = BgHakaGate_DoNothing; @@ -332,7 +332,7 @@ void BgHakaGate_DrawFlame(BgHakaGate* this, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); - Matrix_Translate(thisx->posRot.pos.x, thisx->posRot.pos.y + 15.0f, thisx->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y + 15.0f, thisx->world.pos.z, MTXMODE_NEW); Matrix_RotateY(Camera_GetCamDirYaw(ACTIVE_CAM) * (M_PI / 0x8000), MTXMODE_APPLY); scale = this->vFlameScale * 0.00001f; Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); 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 19a44eacf8..b4ea40dbdd 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 @@ -22,7 +22,7 @@ extern UNK_TYPE D_06000870; /* const ActorInit Bg_Haka_Huta_InitVars = { ACTOR_BG_HAKA_HUTA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKACH_OBJECTS, sizeof(BgHakaHuta), 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 f5a5178715..3b87b6d214 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 @@ -21,7 +21,7 @@ void BgHakaMegane_DoNothing(BgHakaMegane* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Megane_InitVars = { ACTOR_BG_HAKA_MEGANE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHakaMegane), 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 9e50a0ce06..74e9bec158 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 @@ -26,7 +26,7 @@ void func_8087E34C(BgHakaMeganeBG* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_MeganeBG_InitVars = { ACTOR_BG_HAKA_MEGANEBG, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaMeganeBG), @@ -84,11 +84,11 @@ void BgHakaMeganeBG_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = func_8087DFF8; } else if (thisx->params == 3) { CollisionHeader_GetVirtual(&D_06000118, &colHeader); - thisx->initPosRot.pos.y += 100.0f; + thisx->home.pos.y += 100.0f; if (Flags_GetSwitch(globalCtx, this->unk_168)) { this->actionFunc = func_8087E34C; - thisx->posRot.pos.y = thisx->initPosRot.pos.y; + thisx->world.pos.y = thisx->home.pos.y; } else { thisx->flags |= 0x10; this->actionFunc = func_8087E288; @@ -118,7 +118,7 @@ void func_8087DFF8(BgHakaMeganeBG* this, GlobalContext* globalCtx) { if (this->unk_16A == 0) { this->unk_16A = 40; - this->dyna.actor.posRot.rot.y += 0x8000; + this->dyna.actor.world.rot.y += 0x8000; this->actionFunc = func_8087E040; } } @@ -132,11 +132,11 @@ void func_8087E040(BgHakaMeganeBG* this, GlobalContext* globalCtx) { xSub = (sinf(((this->unk_16A * 0.025f) + 0.5f) * M_PI) + 1.0f) * 160.0f; - if (this->dyna.actor.posRot.rot.y != this->dyna.actor.shape.rot.y) { + if (this->dyna.actor.world.rot.y != this->dyna.actor.shape.rot.y) { xSub = 320.0f - xSub; } - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x - xSub; + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - xSub; if (this->unk_16A == 0) { this->unk_16A = 20; @@ -157,7 +157,7 @@ void func_8087E10C(BgHakaMeganeBG* this, GlobalContext* globalCtx) { this->unk_16A--; } - if (!Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 640.0f, + if (!Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 640.0f, this->dyna.actor.velocity.y)) { func_8002F974(&this->dyna.actor, NA_SE_EV_CHINETRAP_DOWN - SFX_FLAG); } @@ -170,7 +170,7 @@ void func_8087E10C(BgHakaMeganeBG* this, GlobalContext* globalCtx) { } void func_8087E1E0(BgHakaMeganeBG* this, GlobalContext* globalCtx) { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 16.0f / 3.0f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 16.0f / 3.0f); func_8002F974(&this->dyna.actor, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); if (this->unk_16A != 0) { @@ -198,8 +198,8 @@ void func_8087E288(BgHakaMeganeBG* this, GlobalContext* globalCtx) { void func_8087E2D8(BgHakaMeganeBG* this, GlobalContext* globalCtx) { Math_StepToF(&this->dyna.actor.speedXZ, 30.0f, 2.0f); - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.speedXZ)) { - Actor_SetHeight(&this->dyna.actor, 50.0f); + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.speedXZ)) { + Actor_SetFocus(&this->dyna.actor, 50.0f); this->actionFunc = func_8087E34C; } else { func_8002F974(&this->dyna.actor, NA_SE_EV_METALDOOR_OPEN); 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 0a80e8864e..9b87dc6b7b 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 @@ -31,7 +31,7 @@ extern Gfx D_060021F0[]; const ActorInit Bg_Haka_Sgami_InitVars = { ACTOR_BG_HAKA_SGAMI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHakaSgami), @@ -125,7 +125,7 @@ static CollisionCheckInfoInit sColChkInfoInit = { 0, 80, 130, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 4, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 4, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; @@ -153,9 +153,9 @@ void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->colliderScytheCenter); Collider_SetCylinder(globalCtx, &this->colliderScytheCenter, thisx, &sCylinderInit); - this->colliderScytheCenter.dim.pos.x = thisx->posRot.pos.x; - this->colliderScytheCenter.dim.pos.y = thisx->posRot.pos.y; - this->colliderScytheCenter.dim.pos.z = thisx->posRot.pos.z; + this->colliderScytheCenter.dim.pos.x = thisx->world.pos.x; + this->colliderScytheCenter.dim.pos.y = thisx->world.pos.y; + this->colliderScytheCenter.dim.pos.z = thisx->world.pos.z; CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); @@ -178,7 +178,7 @@ void BgHakaSgami_Init(Actor* thisx, GlobalContext* globalCtx) { this->requiredObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_ICE_OBJECTS); this->colliderScytheCenter.dim.radius = 30; this->colliderScytheCenter.dim.height = 70; - Actor_SetHeight(thisx, 40.0f); + Actor_SetFocus(thisx, 40.0f); } if (this->requiredObjBankIndex < 0) { @@ -244,18 +244,18 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) { elementInit = &sTrisInit.elements[i]; for (j = 0; j < 3; j++) { - scytheVertices[j].x = this->actor.posRot.pos.x + elementInit->dim.vtx[j].z * actorRotYSin + + scytheVertices[j].x = this->actor.world.pos.x + elementInit->dim.vtx[j].z * actorRotYSin + elementInit->dim.vtx[j].x * actorRotYCos; - scytheVertices[j].y = this->actor.posRot.pos.y + elementInit->dim.vtx[j].y; - scytheVertices[j].z = this->actor.posRot.pos.z + elementInit->dim.vtx[j].z * actorRotYCos - + scytheVertices[j].y = this->actor.world.pos.y + elementInit->dim.vtx[j].y; + scytheVertices[j].z = this->actor.world.pos.z + elementInit->dim.vtx[j].z * actorRotYCos - elementInit->dim.vtx[j].x * actorRotYSin; } Collider_SetTrisVertices(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); for (j = 0; j < 3; j++) { - scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x; - scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z; + scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x; + scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z; } Collider_SetTrisVertices(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], @@ -263,21 +263,21 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) { } if ((this->unk_151 == 0) || (globalCtx->actorCtx.unk_03 != 0)) { - scytheVertices[0].x = this->actor.posRot.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin + + scytheVertices[0].x = this->actor.world.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin + blureEffectVertices1[this->actor.params].x * actorRotYCos; - scytheVertices[0].y = this->actor.posRot.pos.y + blureEffectVertices1[this->actor.params].y; - scytheVertices[0].z = this->actor.posRot.pos.z + blureEffectVertices1[this->actor.params].z * actorRotYCos - + scytheVertices[0].y = this->actor.world.pos.y + blureEffectVertices1[this->actor.params].y; + scytheVertices[0].z = this->actor.world.pos.z + blureEffectVertices1[this->actor.params].z * actorRotYCos - blureEffectVertices1[this->actor.params].x * actorRotYSin; - scytheVertices[1].x = this->actor.posRot.pos.x + blureEffectVertices2[this->actor.params].z * actorRotYSin + + scytheVertices[1].x = this->actor.world.pos.x + blureEffectVertices2[this->actor.params].z * actorRotYSin + blureEffectVertices2[this->actor.params].x * actorRotYCos; - scytheVertices[1].y = this->actor.posRot.pos.y + blureEffectVertices2[this->actor.params].y; - scytheVertices[1].z = this->actor.posRot.pos.z + blureEffectVertices2[this->actor.params].z * actorRotYCos - + scytheVertices[1].y = this->actor.world.pos.y + blureEffectVertices2[this->actor.params].y; + scytheVertices[1].z = this->actor.world.pos.z + blureEffectVertices2[this->actor.params].z * actorRotYCos - blureEffectVertices2[this->actor.params].x * actorRotYSin; EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[0]), &scytheVertices[0], &scytheVertices[1]); for (j = 0; j < 2; j++) { - scytheVertices[j].x = (2 * this->actor.posRot.pos.x) - scytheVertices[j].x; - scytheVertices[j].z = (2 * this->actor.posRot.pos.z) - scytheVertices[j].z; + scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x; + scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z; } EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[1]), &scytheVertices[0], &scytheVertices[1]); 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 a0bca7a21f..abdb8cfa5e 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 @@ -32,7 +32,7 @@ extern UNK_TYPE D_0600ED7C; /* const ActorInit Bg_Haka_Ship_InitVars = { ACTOR_BG_HAKA_SHIP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaShip), 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 c0b7f761f0..a323e52624 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 @@ -32,7 +32,7 @@ static UNK_TYPE D_80880F30 = 0; const ActorInit Bg_Haka_Trap_InitVars = { ACTOR_BG_HAKA_TRAP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaTrap), @@ -152,17 +152,17 @@ void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->velocity.y = 0.5f; } - thisx->groundY = thisx->initPosRot.pos.y - 225.0f; - this->unk_16A = (thisx->groundY + 50.0f) - 25.0f; + thisx->floorHeight = thisx->home.pos.y - 225.0f; + this->unk_16A = (thisx->floorHeight + 50.0f) - 25.0f; this->colliderCylinder.dim.radius = 10; this->colliderCylinder.dim.height = 40; } else { if (thisx->params == HAKA_TRAP_SPIKED_WALL) { CollisionHeader_GetVirtual(&D_060081D0, &colHeader); - thisx->initPosRot.pos.x -= 200.0f; + thisx->home.pos.x -= 200.0f; } else { - thisx->initPosRot.pos.x += 200.0f; + thisx->home.pos.x += 200.0f; CollisionHeader_GetVirtual(&D_06008D10, &colHeader); } @@ -213,7 +213,7 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) { f32 zNonNegative; Player* player = PLAYER; - func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp28, &player->actor.world.pos); sine = Math_SinS(this->dyna.actor.shape.rot.y); cosine = Math_CosS(this->dyna.actor.shape.rot.y); @@ -227,8 +227,8 @@ void func_8087FFC0(BgHakaTrap* this, GlobalContext* globalCtx) { sp28.z = zNonNegative * 15.0f; } - this->colliderCylinder.dim.pos.x = this->dyna.actor.posRot.pos.x + sp28.x * cosine + sp28.z * sine; - this->colliderCylinder.dim.pos.z = this->dyna.actor.posRot.pos.z + sp28.x * sine + sp28.z * cosine; + this->colliderCylinder.dim.pos.x = this->dyna.actor.world.pos.x + sp28.x * cosine + sp28.z * sine; + this->colliderCylinder.dim.pos.z = this->dyna.actor.world.pos.z + sp28.x * sine + sp28.z * cosine; } void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) { @@ -236,7 +236,7 @@ void func_808801B8(BgHakaTrap* this, GlobalContext* globalCtx) { Player* player = PLAYER; if ((D_80880F30 == 0) && (!Player_InCsMode(globalCtx))) { - if (!Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x, 0.5f)) { + if (!Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x, 0.5f)) { func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); } else if (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) { D_80881018 |= 1; @@ -274,9 +274,9 @@ void func_808802D8(BgHakaTrap* this, GlobalContext* globalCtx) { xScale = (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) ? -30.0f : 30.0f; - vector.x = xScale * rand + this->dyna.actor.posRot.pos.x; - vector.y = Rand_ZeroOne() * 10.0f + this->dyna.actor.posRot.pos.y + 30.0f; - vector.z = Rand_CenteredFloat(320.0f) + this->dyna.actor.posRot.pos.z; + vector.x = xScale * rand + this->dyna.actor.world.pos.x; + vector.y = Rand_ZeroOne() * 10.0f + this->dyna.actor.world.pos.y + 30.0f; + vector.z = Rand_CenteredFloat(320.0f) + this->dyna.actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vector, &zeroVec, &zeroVec, 130, 20, 255, 255, 150, 170, 255, 0, 0, 1, 9, false); @@ -302,8 +302,8 @@ void func_80880484(BgHakaTrap* this, GlobalContext* globalCtx) { this->timer -= 1; } - sp24 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 185.0f, - this->dyna.actor.velocity.y); + sp24 = + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 185.0f, this->dyna.actor.velocity.y); timer = this->timer; if ((timer == 10 && !this->unk_16A) || (timer == 13 && this->unk_16A)) { @@ -330,12 +330,12 @@ void func_808805C0(BgHakaTrap* this, GlobalContext* globalCtx) { } if (this->unk_16A) { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 27.0f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 27.0f); } else { if (this->timer > 20) { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 90.0f, 9.0f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 90.0f, 9.0f); } else { - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 4.5f); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 4.5f); } if (this->timer == 20) { @@ -345,7 +345,7 @@ void func_808805C0(BgHakaTrap* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->timer = 20; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; this->dyna.actor.velocity.y = 0.1f; this->actionFunc = func_80880484; } @@ -366,11 +366,11 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) { this->timer--; } - vector.x = this->dyna.actor.posRot.pos.x + 90.0f; - vector.y = (this->dyna.actor.posRot.pos.y + 1.0f) + 25.0f; - vector.z = this->dyna.actor.posRot.pos.z; + vector.x = this->dyna.actor.world.pos.x + 90.0f; + vector.y = (this->dyna.actor.world.pos.y + 1.0f) + 25.0f; + vector.z = this->dyna.actor.world.pos.z; - tempf20 = this->dyna.actor.groundY; + tempf20 = this->dyna.actor.floorHeight; for (i = 0; i < 3; i++) { temp = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &sp64, &this->dyna.actor, @@ -383,7 +383,7 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) { vector.x -= 90.0f; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, tempf20, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, tempf20, this->dyna.actor.velocity.y)) { if (this->dyna.actor.velocity.y > 0.01f) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_TRAP_BOUND); } @@ -397,8 +397,8 @@ void func_808806BC(BgHakaTrap* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->dyna.actor.velocity.y = 0.0f; this->timer = 30; - this->unk_16A = (s16)this->dyna.actor.posRot.pos.y + 50.0f; - this->unk_16A = CLAMP_MAX(this->unk_16A, this->dyna.actor.initPosRot.pos.y); + this->unk_16A = (s16)this->dyna.actor.world.pos.y + 50.0f; + this->unk_16A = CLAMP_MAX(this->unk_16A, this->dyna.actor.home.pos.y); this->actionFunc = func_808808F4; } @@ -410,14 +410,14 @@ void func_808808F4(BgHakaTrap* this, GlobalContext* globalCtx) { } if (this->timer > 20) { - this->unk_169 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->unk_16A, 15.0f); + this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->unk_16A, 15.0f); } else { - this->unk_169 = Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 20.0f); + this->unk_169 = Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 20.0f); } if (this->timer == 0) { this->timer = 30; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; this->dyna.actor.velocity.y = 0.5f; this->actionFunc = func_808806BC; } @@ -437,7 +437,7 @@ void func_808809E4(BgHakaTrap* this, GlobalContext* globalCtx, s16 arg2) { Player* player = PLAYER; Vec3f sp18; - func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp18, &player->actor.world.pos); if ((fabsf(sp18.x) < 70.0f) && (fabsf(sp18.y) < 100.0f) && (sp18.z < 500.0f) && (PLAYER->currentBoots != PLAYER_BOOTS_IRON)) { @@ -448,23 +448,23 @@ void func_808809E4(BgHakaTrap* this, GlobalContext* globalCtx, s16 arg2) { void func_80880AE8(BgHakaTrap* this, GlobalContext* globalCtx) { if (this->timer != 0) { - if (Math_ScaledStepToS(&this->dyna.actor.posRot.rot.z, 0, this->dyna.actor.posRot.rot.z * 0.03f + 5.0f)) { + if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { this->timer = 40; this->actionFunc = func_808809B0; } } else { - if (Math_ScaledStepToS(&this->dyna.actor.posRot.rot.z, 0x3A00, this->dyna.actor.posRot.rot.z * 0.03f + 5.0f)) { + if (Math_ScaledStepToS(&this->dyna.actor.world.rot.z, 0x3A00, this->dyna.actor.world.rot.z * 0.03f + 5.0f)) { this->timer = 100; this->actionFunc = func_80880C0C; } } - this->dyna.actor.shape.rot.z += this->dyna.actor.posRot.rot.z; - if (this->dyna.actor.posRot.rot.z >= 0x1801) { + this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z; + if (this->dyna.actor.world.rot.z >= 0x1801) { func_8002F974(&this->dyna.actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); } - func_808809E4(this, globalCtx, this->dyna.actor.posRot.rot.z); + func_808809E4(this, globalCtx, this->dyna.actor.world.rot.z); } void func_80880C0C(BgHakaTrap* this, GlobalContext* globalCtx) { @@ -479,13 +479,13 @@ void func_80880C0C(BgHakaTrap* this, GlobalContext* globalCtx) { this->actionFunc = func_80880AE8; } - this->dyna.actor.shape.rot.z += this->dyna.actor.posRot.rot.z; - func_808809E4(this, globalCtx, this->dyna.actor.posRot.rot.z); + this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z; + func_808809E4(this, globalCtx, this->dyna.actor.world.rot.z); } void BgHakaTrap_Update(Actor* thisx, GlobalContext* globalCtx) { BgHakaTrap* this = THIS; - Vec3f* actorPos = &thisx->posRot.pos; + Vec3f* actorPos = &thisx->world.pos; this->actionFunc(this, globalCtx); @@ -543,9 +543,9 @@ void BgHakaTrap_Draw(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actionFunc == func_808808F4) && !this->unk_169) { - sp2C.x = thisx->posRot.pos.x; - sp2C.z = thisx->posRot.pos.z; - sp2C.y = thisx->posRot.pos.y + 110.0f; + sp2C.x = thisx->world.pos.x; + sp2C.z = thisx->world.pos.z; + sp2C.y = thisx->world.pos.y + 110.0f; SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->mf_11D60, &sp2C, &this->unk_16C); func_80078914(&this->unk_16C, NA_SE_EV_BRIDGE_CLOSE - SFX_FLAG); 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 1d1a34d6a4..7dcd20b125 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 @@ -20,7 +20,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Tubo_InitVars = { ACTOR_BG_HAKA_TUBO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HAKA_OBJECTS, sizeof(BgHakaTubo), @@ -113,26 +113,26 @@ void BgHakaTubo_Idle(BgHakaTubo* this, GlobalContext* globalCtx) { if (this->dyna.actor.room == 12) { // 3 spinning pots room in Shadow Temple this->dyna.actor.shape.rot.y += 0x180; - this->dyna.actor.posRot.pos.x = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -5559.0f; - this->dyna.actor.posRot.pos.z = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -1587.0f; + this->dyna.actor.world.pos.x = Math_SinS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -5559.0f; + this->dyna.actor.world.pos.z = Math_CosS(this->dyna.actor.shape.rot.y - 0x4000) * 145.0f + -1587.0f; } // Colliding with flame circle if (this->flamesCollider.base.atFlags & AT_HIT) { this->flamesCollider.base.atFlags &= ~AT_HIT; - func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsLink, 5.0f); + func_8002F71C(globalCtx, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 5.0f); } // Colliding with hitbox inside the pot if (this->potCollider.base.acFlags & AC_HIT) { this->potCollider.base.acFlags &= ~AC_HIT; // If the colliding actor is within a 50 unit radius and 50 unit height cylinder centered // on the actor's position, break the pot - if (func_8002DBB0(&this->dyna.actor, &this->potCollider.base.ac->posRot.pos) < 50.0f && - (this->potCollider.base.ac->posRot.pos.y - this->dyna.actor.posRot.pos.y) < 50.0f) { - pos.x = this->dyna.actor.posRot.pos.x; - pos.z = this->dyna.actor.posRot.pos.z; - pos.y = this->dyna.actor.posRot.pos.y + 80.0f; + if (Actor_WorldDistXZToPoint(&this->dyna.actor, &this->potCollider.base.ac->world.pos) < 50.0f && + (this->potCollider.base.ac->world.pos.y - this->dyna.actor.world.pos.y) < 50.0f) { + pos.x = this->dyna.actor.world.pos.x; + pos.z = this->dyna.actor.world.pos.z; + pos.y = this->dyna.actor.world.pos.y + 80.0f; EffectSsBomb2_SpawnLayered(globalCtx, &pos, &sZeroVector, &sZeroVector, 100, 45); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 50, NA_SE_EV_BOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 50, NA_SE_EV_BOX_BREAK); EffectSsHahen_SpawnBurst(globalCtx, &pos, 20.0f, 0, 350, 100, 50, OBJECT_HAKA_OBJECTS, 40, D_0400CD80); this->dropTimer = 5; this->dyna.actor.draw = NULL; @@ -157,9 +157,9 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) { this->dropTimer--; if (this->dropTimer == 0) { // Creates a delay between destroying the pot and dropping the collectible - spawnPos.x = this->dyna.actor.posRot.pos.x; - spawnPos.y = this->dyna.actor.posRot.pos.y + 200.0f; - spawnPos.z = this->dyna.actor.posRot.pos.z; + spawnPos.x = this->dyna.actor.world.pos.x; + spawnPos.y = this->dyna.actor.world.pos.y + 200.0f; + spawnPos.z = this->dyna.actor.world.pos.z; if (this->dyna.actor.room == 12) { // 3 spinning pots room in Shadow Temple rnd = Rand_ZeroOne(); sPotsDestroyed++; @@ -172,14 +172,14 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &spawnPos, i % 3); if (collectible != NULL) { collectible->actor.velocity.y = 15.0f; - collectible->actor.posRot.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71); + collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y + (i * 0x1C71); } } } else if (rnd < 0.2f) { // Unlucky, no reward and spawn keese collectibleParams = -1; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FIREFLY, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y + 80.0f, this->dyna.actor.posRot.pos.z, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FIREFLY, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y + 80.0f, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, 2); func_80078884(NA_SE_SY_ERROR); } else { @@ -208,7 +208,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &spawnPos, collectibleParams); if (collectible != NULL) { collectible->actor.velocity.y = 15.0f; - collectible->actor.posRot.rot.y = this->dyna.actor.shape.rot.y; + collectible->actor.world.rot.y = this->dyna.actor.shape.rot.y; } } Actor_Kill(&this->dyna.actor); @@ -228,8 +228,8 @@ void BgHakaTubo_DrawFlameCircle(BgHakaTubo* this, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_haka_tubo.c", 476); func_80093D84(globalCtx->state.gfxCtx); - Matrix_Translate(this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y + 235.0f, - this->dyna.actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 235.0f, this->dyna.actor.world.pos.z, + MTXMODE_NEW); Matrix_RotateY(this->dyna.actor.shape.rot.y * 0.0000958738f, MTXMODE_APPLY); Matrix_Scale(0.07f, 0.04f, 0.07f, MTXMODE_APPLY); if (1) {} 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 7364aaf237..7b6f9d07ab 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 @@ -21,7 +21,7 @@ void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx); const ActorInit Bg_Haka_Water_InitVars = { ACTOR_BG_HAKA_WATER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HAKACH_OBJECTS, sizeof(BgHakaWater), @@ -44,8 +44,8 @@ void BgHakaWater_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); if (Flags_GetSwitch(globalCtx, this->actor.params)) { this->isLowered = true; - this->actor.initPosRot.pos.y -= 200.0f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; + this->actor.home.pos.y -= 200.0f; + this->actor.world.pos.y = this->actor.home.pos.y; } else { this->isLowered = false; } @@ -60,7 +60,7 @@ void func_80881D94(BgHakaWater* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 9; i++) { - globalCtx->colCtx.colHeader->waterBoxes[i].ySurface = (s16)this->actor.posRot.pos.y - 8; + globalCtx->colCtx.colHeader->waterBoxes[i].ySurface = (s16)this->actor.world.pos.y - 8; } } @@ -70,10 +70,10 @@ void BgHakaWater_Wait(BgHakaWater* this, GlobalContext* globalCtx) { if (this->isLowered) { this->isLowered = false; this->actor.draw = BgHakaWater_Draw; - this->actor.initPosRot.pos.y += 200.0f; + this->actor.home.pos.y += 200.0f; } else { this->isLowered = true; - this->actor.initPosRot.pos.y -= 200.0f; + this->actor.home.pos.y -= 200.0f; } this->actionFunc = BgHakaWater_ChangeWaterLevel; } @@ -82,19 +82,19 @@ void BgHakaWater_Wait(BgHakaWater* this, GlobalContext* globalCtx) { void BgHakaWater_ChangeWaterLevel(BgHakaWater* this, GlobalContext* globalCtx) { if (!this->isLowered && Flags_GetSwitch(globalCtx, this->actor.params)) { this->isLowered = true; - this->actor.initPosRot.pos.y -= 200.0f; + this->actor.home.pos.y -= 200.0f; } else if (this->isLowered && !Flags_GetSwitch(globalCtx, this->actor.params)) { this->isLowered = false; - this->actor.initPosRot.pos.y += 200.0f; + this->actor.home.pos.y += 200.0f; } - if (this->actor.initPosRot.pos.y < this->actor.posRot.pos.y) { + if (this->actor.home.pos.y < this->actor.world.pos.y) { func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f) != 0) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f) != 0) { this->actionFunc = BgHakaWater_Wait; if (this->isLowered) { this->actor.draw = NULL; @@ -119,9 +119,9 @@ void BgHakaWater_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); if (this->isLowered) { - temp = this->actor.posRot.pos.y - this->actor.initPosRot.pos.y; + temp = this->actor.world.pos.y - this->actor.home.pos.y; } else { - temp = this->actor.posRot.pos.y - (this->actor.initPosRot.pos.y - 200.0f); + temp = this->actor.world.pos.y - (this->actor.home.pos.y - 200.0f); } gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(0.765f * temp)); 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 a4cbcfe377..26ca26c17c 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 @@ -21,7 +21,7 @@ extern UNK_TYPE D_06006F70; /* const ActorInit Bg_Haka_Zou_InitVars = { ACTOR_BG_HAKA_ZOU, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHakaZou), 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 0c2cc8af6f..62b5462611 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 @@ -29,7 +29,7 @@ void BgHeavyBlock_DoNothing(BgHeavyBlock* this, GlobalContext* globalCtx); const ActorInit Bg_Heavy_Block_InitVars = { ACTOR_BG_HEAVY_BLOCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HEAVY_OBJECT, sizeof(BgHeavyBlock), @@ -52,9 +52,9 @@ extern Gfx D_06001A30[]; extern Gfx D_060018A0[]; void BgHeavyBlock_SetPieceRandRot(BgHeavyBlock* this, f32 scale) { - this->dyna.actor.posRot.rot.x = Rand_CenteredFloat(1024.0f) * scale; - this->dyna.actor.posRot.rot.y = Rand_CenteredFloat(1024.0f) * scale; - this->dyna.actor.posRot.rot.z = Rand_CenteredFloat(1024.0f) * scale; + this->dyna.actor.world.rot.x = Rand_CenteredFloat(1024.0f) * scale; + this->dyna.actor.world.rot.y = Rand_CenteredFloat(1024.0f) * scale; + this->dyna.actor.world.rot.z = Rand_CenteredFloat(1024.0f) * scale; } void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) { @@ -68,12 +68,12 @@ void BgHeavyBlock_InitPiece(BgHeavyBlock* this, f32 scale) { rand = (randChoice < 0.0f) ? randChoice - 2.0f : randChoice + 2.0f; this->dyna.actor.velocity.y = (Rand_ZeroFloat(8.0f) + 4.0f) * scale; this->dyna.actor.velocity.z = Rand_ZeroFloat(-8.0f * scale); - yawSinCos = Math_CosS(this->dyna.actor.posRot.rot.y); + yawSinCos = Math_CosS(this->dyna.actor.world.rot.y); this->dyna.actor.velocity.x = - (Math_SinS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.velocity.z + (yawSinCos * rand)); - yawSinCos = Math_SinS(this->dyna.actor.posRot.rot.y); + (Math_SinS(this->dyna.actor.world.rot.y) * this->dyna.actor.velocity.z + (yawSinCos * rand)); + yawSinCos = Math_SinS(this->dyna.actor.world.rot.y); this->dyna.actor.velocity.z = - (Math_CosS(this->dyna.actor.posRot.rot.y) * this->dyna.actor.velocity.z) + (-yawSinCos * rand); + (Math_CosS(this->dyna.actor.world.rot.y) * this->dyna.actor.velocity.z) + (-yawSinCos * rand); BgHeavyBlock_SetPieceRandRot(this, scale); Actor_SetScale(&this->dyna.actor, Rand_CenteredFloat(0.2f) + 1.0f); } @@ -131,12 +131,12 @@ void BgHeavyBlock_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) { this->actionFunc = BgHeavyBlock_DoNothing; - thisx->shape.rot.x = thisx->posRot.rot.x = 0x8AD0; - thisx->shape.rot.y = thisx->posRot.rot.y = 0xC000; - thisx->shape.rot.z = thisx->posRot.rot.z = 0x0; - thisx->posRot.pos.x = 1704.0f; - thisx->posRot.pos.y = 1504.0f; - thisx->posRot.pos.z = 516.0f; + thisx->shape.rot.x = thisx->world.rot.x = 0x8AD0; + thisx->shape.rot.y = thisx->world.rot.y = 0xC000; + thisx->shape.rot.z = thisx->world.rot.z = 0x0; + thisx->world.pos.x = 1704.0f; + thisx->world.pos.y = 1504.0f; + thisx->world.pos.z = 516.0f; } this->actionFunc = BgHeavyBlock_Wait; @@ -178,16 +178,16 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, GlobalContext* globalCtx) { thisx->velocity.x *= 0.98f; thisx->velocity.z *= 0.98f; func_8002D7EC(thisx); - thisx->shape.rot.x += thisx->posRot.rot.x; - thisx->shape.rot.y += thisx->posRot.rot.y; - thisx->shape.rot.z += thisx->posRot.rot.z; + thisx->shape.rot.x += thisx->world.rot.x; + thisx->shape.rot.y += thisx->world.rot.y; + thisx->shape.rot.z += thisx->world.rot.z; if (!(this->pieceFlags & PIECE_FLAG_HIT_FLOOR)) { - thisx->posRot.pos.y += this->unk_164.y; - thisx->pos4.y += this->unk_164.y; - func_8002E4B4(globalCtx, thisx, 50.0f, 50.0f, 0.0f, 5); - thisx->posRot.pos.y -= this->unk_164.y; - thisx->pos4.y -= this->unk_164.y; + thisx->world.pos.y += this->unk_164.y; + thisx->prevPos.y += this->unk_164.y; + Actor_UpdateBgCheckInfo(globalCtx, thisx, 50.0f, 50.0f, 0.0f, 5); + thisx->world.pos.y -= this->unk_164.y; + thisx->prevPos.y -= this->unk_164.y; if (thisx->bgCheckFlags & 1) { this->pieceFlags |= PIECE_FLAG_HIT_FLOOR; thisx->velocity.y = Rand_ZeroFloat(4.0f) + 2.0f; @@ -195,7 +195,7 @@ void BgHeavyBlock_MovePiece(BgHeavyBlock* this, GlobalContext* globalCtx) { thisx->velocity.z = Rand_CenteredFloat(8.0f); BgHeavyBlock_SetPieceRandRot(this, 1.0f); Audio_PlayActorSound2(thisx, NA_SE_EV_ROCK_BROKEN); - func_800AA000(thisx->xzDistToLink, 0x96, 0xA, 8); + func_800AA000(thisx->xzDistToPlayer, 0x96, 0xA, 8); } } @@ -297,17 +297,17 @@ void BgHeavyBlock_SpawnPieces(BgHeavyBlock* this, GlobalContext* globalCtx) { f32 sinYaw; f32 cosYaw; - sinPitch = Math_SinS(this->dyna.actor.posRot.rot.x); - cosPitch = Math_CosS(this->dyna.actor.posRot.rot.x); - sinYaw = Math_SinS(this->dyna.actor.posRot.rot.y); - cosYaw = Math_CosS(this->dyna.actor.posRot.rot.y); + sinPitch = Math_SinS(this->dyna.actor.world.rot.x); + cosPitch = Math_CosS(this->dyna.actor.world.rot.x); + sinYaw = Math_SinS(this->dyna.actor.world.rot.y); + cosYaw = Math_CosS(this->dyna.actor.world.rot.y); for (i = 0; i < ARRAY_COUNT(spA4); i++) { pos.z = (spA4[i].y * sinPitch) + (spA4[i].z * cosPitch); - pos.x = this->dyna.actor.posRot.pos.x + (spA4[i].x * cosYaw) + (sinYaw * pos.z); - pos.y = this->dyna.actor.posRot.pos.y + (spA4[i].y * cosPitch) + (-spA4[i].z * sinPitch); - pos.z = this->dyna.actor.posRot.pos.z + (spA4[i].x * -sinYaw) + (cosYaw * pos.z); + pos.x = this->dyna.actor.world.pos.x + (spA4[i].x * cosYaw) + (sinYaw * pos.z); + pos.y = this->dyna.actor.world.pos.y + (spA4[i].y * cosPitch) + (-spA4[i].z * sinPitch); + pos.z = this->dyna.actor.world.pos.z + (spA4[i].x * -sinYaw) + (cosYaw * pos.z); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_HEAVY_BLOCK, pos.x, pos.y, pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, 0, 2); @@ -365,9 +365,9 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, GlobalContext* globalCtx) { zOffset = Rand_CenteredFloat(110.0f); cosYaw = Math_CosS(this->dyna.actor.shape.rot.y); - BgHeavyBlock_SpawnDust(globalCtx, (sinYaw * -70.0f) + (this->dyna.actor.posRot.pos.x + xOffset), - this->dyna.actor.posRot.pos.y + 10.0f, - (cosYaw * -70.0f) + (this->dyna.actor.posRot.pos.z + zOffset), 0.0f, -1.0f, 0.0f, 0xC); + BgHeavyBlock_SpawnDust(globalCtx, (sinYaw * -70.0f) + (this->dyna.actor.world.pos.x + xOffset), + this->dyna.actor.world.pos.y + 10.0f, + (cosYaw * -70.0f) + (this->dyna.actor.world.pos.z + zOffset), 0.0f, -1.0f, 0.0f, 0xC); } this->timer++; @@ -388,14 +388,14 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, GlobalContext* globalCtx) { f32 raycastResult; Actor_MoveForward(&this->dyna.actor); - pos.x = this->dyna.actor.initPosRot.pos.x; - pos.y = this->dyna.actor.initPosRot.pos.y + 1000.0f; - pos.z = this->dyna.actor.initPosRot.pos.z; + pos.x = this->dyna.actor.home.pos.x; + pos.y = this->dyna.actor.home.pos.y + 1000.0f; + pos.z = this->dyna.actor.home.pos.z; raycastResult = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &pos); - this->dyna.actor.groundY = raycastResult; + this->dyna.actor.floorHeight = raycastResult; - if (this->dyna.actor.initPosRot.pos.y <= raycastResult) { + if (this->dyna.actor.home.pos.y <= raycastResult) { func_800AA000(0.0f, 0xFF, 0x3C, 4); switch (this->dyna.actor.params & 0xFF) { @@ -414,7 +414,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, GlobalContext* globalCtx) { Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); Quake_SetCountdown(quakeIndex, 999); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ELECTRIC_EXPLOSION); return; case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); @@ -459,9 +459,9 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, GlobalContext* globalCtx) { Math_StepToF(&this->dyna.actor.speedXZ, 0.0f, 20.0f); Math_StepToF(&this->dyna.actor.velocity.y, 0.0f, 3.0f); this->dyna.actor.gravity = 0.0f; - this->dyna.actor.posRot.pos = this->dyna.actor.initPosRot.pos; + this->dyna.actor.world.pos = this->dyna.actor.home.pos; Actor_MoveForward(&this->dyna.actor); - this->dyna.actor.initPosRot.pos = this->dyna.actor.posRot.pos; + this->dyna.actor.home.pos = this->dyna.actor.world.pos; switch (this->dyna.actor.params & 0xFF) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SpawnDust(globalCtx, Rand_CenteredFloat(30.0f) + 1678.0f, Rand_ZeroFloat(100.0f) + 1286.0f, @@ -499,12 +499,12 @@ void BgHeavyBlock_Draw(Actor* thisx, GlobalContext* globalCtx) { func_800D1694(player->leftHandPos.x, player->leftHandPos.y, player->leftHandPos.z, &thisx->shape.rot); Matrix_Translate(-this->unk_164.x, -this->unk_164.y, -this->unk_164.z, MTXMODE_APPLY); } else if ((thisx->gravity == 0.0f) && (BgHeavyBlock_Land == this->actionFunc)) { - func_800D1694(thisx->initPosRot.pos.x, thisx->initPosRot.pos.y, thisx->initPosRot.pos.z, &thisx->shape.rot); + func_800D1694(thisx->home.pos.x, thisx->home.pos.y, thisx->home.pos.z, &thisx->shape.rot); Matrix_Translate(-D_80884ED4.x, -D_80884ED4.y, -D_80884ED4.z, MTXMODE_APPLY); } - Matrix_MultVec3f(&D_80884EC8, &thisx->posRot.pos); - Matrix_MultVec3f(&D_80884ED4, &thisx->initPosRot.pos); + Matrix_MultVec3f(&D_80884EC8, &thisx->world.pos); + Matrix_MultVec3f(&D_80884ED4, &thisx->home.pos); func_80093D18(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_heavy_block.c", 931), 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 5ede60fe52..5713f37bfc 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 @@ -58,7 +58,7 @@ static BgHidanCurtainParams sHCParams[] = { { 81, 144, 0.090f, 144.0f, 5.0f }, { const ActorInit Bg_Hidan_Curtain_InitVars = { ACTOR_BG_HIDAN_CURTAIN, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgHidanCurtain), @@ -74,7 +74,7 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { BgHidanCurtainParams* hcParams; osSyncPrintf("Curtain (arg_data 0x%04x)\n", this->actor.params); - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); this->type = (thisx->params >> 0xC) & 0xF; if (this->type > 6) { // Type is not set @@ -97,9 +97,9 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, hcParams->scale); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.dim.pos.x = this->actor.posRot.pos.x; - this->collider.dim.pos.y = this->actor.posRot.pos.y; - this->collider.dim.pos.z = this->actor.posRot.pos.z; + this->collider.dim.pos.x = this->actor.world.pos.x; + this->collider.dim.pos.y = this->actor.world.pos.y; + this->collider.dim.pos.z = this->actor.world.pos.z; this->collider.dim.radius = hcParams->radius; this->collider.dim.height = hcParams->height; Collider_UpdateCylinder(&this->actor, &this->collider); @@ -109,7 +109,7 @@ void BgHidanCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { } else { this->actionFunc = BgHidanCurtain_WaitForSwitchOn; if ((this->type == 4) || (this->type == 5)) { - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - hcParams->riseDist; + this->actor.world.pos.y = this->actor.home.pos.y - hcParams->riseDist; } } if (((this->type == 1) && Flags_GetTreasure(globalCtx, this->treasureFlag)) || @@ -163,7 +163,7 @@ void BgHidanCurtain_WaitForSwitchOff(BgHidanCurtain* this, GlobalContext* global void BgHidanCurtain_TurnOn(BgHidanCurtain* this, GlobalContext* globalCtx) { f32 riseSpeed = sHCParams[this->size].riseSpeed; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, riseSpeed)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, riseSpeed)) { Flags_UnsetSwitch(globalCtx, this->actor.params); this->actionFunc = BgHidanCurtain_WaitForSwitchOn; } @@ -172,8 +172,7 @@ void BgHidanCurtain_TurnOn(BgHidanCurtain* this, GlobalContext* globalCtx) { void BgHidanCurtain_TurnOff(BgHidanCurtain* this, GlobalContext* globalCtx) { BgHidanCurtainParams* hcParams = &sHCParams[this->size]; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - hcParams->riseDist, - hcParams->riseSpeed)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - hcParams->riseDist, hcParams->riseSpeed)) { if ((this->type == 0) || (this->type == 6)) { Actor_Kill(&this->actor); } else if (this->type == 5) { @@ -214,21 +213,18 @@ void BgHidanCurtain_Update(Actor* thisx, GlobalContext* globalCtx2) { } else { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 1.0f); + func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 1.0f); } if ((this->type == 4) || (this->type == 5)) { - this->actor.posRot.pos.y = - (2.0f * this->actor.initPosRot.pos.y) - hcParams->riseDist - this->actor.posRot.pos.y; + this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y; } this->actionFunc(this, globalCtx); if ((this->type == 4) || (this->type == 5)) { - this->actor.posRot.pos.y = - (2.0f * this->actor.initPosRot.pos.y) - hcParams->riseDist - this->actor.posRot.pos.y; + this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y; } - riseProgress = - (hcParams->riseDist - (this->actor.initPosRot.pos.y - this->actor.posRot.pos.y)) / hcParams->riseDist; + riseProgress = (hcParams->riseDist - (this->actor.home.pos.y - this->actor.world.pos.y)) / hcParams->riseDist; this->alpha = 255.0f * riseProgress; if (this->alpha > 50) { this->collider.dim.height = hcParams->height * riseProgress; 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 55179f9861..27bb393c55 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 @@ -20,7 +20,7 @@ void BgHidanDalm_Shrink(BgHidanDalm* this, GlobalContext* globalCtx); const ActorInit Bg_Hidan_Dalm_InitVars = { ACTOR_BG_HIDAN_DALM, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanDalm), @@ -135,12 +135,12 @@ void BgHidanDalm_Wait(BgHidanDalm* this, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_HIT; if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) || (this->collider.elements[1].info.bumperFlags & BUMP_HIT)) { - this->dyna.actor.posRot.rot.y -= 0x4000; + this->dyna.actor.world.rot.y -= 0x4000; } else { - this->dyna.actor.posRot.rot.y += 0x4000; + this->dyna.actor.world.rot.y += 0x4000; } - this->dyna.actor.posRot.pos.x += 32.5f * Math_SinS(this->dyna.actor.posRot.rot.y); - this->dyna.actor.posRot.pos.z += 32.5f * Math_CosS(this->dyna.actor.posRot.rot.y); + this->dyna.actor.world.pos.x += 32.5f * Math_SinS(this->dyna.actor.world.rot.y); + this->dyna.actor.world.pos.z += 32.5f * Math_CosS(this->dyna.actor.world.rot.y); func_8002DF54(globalCtx, &this->dyna.actor, 8); this->dyna.actor.flags |= 0x10; @@ -169,13 +169,13 @@ void BgHidanDalm_Shrink(BgHidanDalm* this, GlobalContext* globalCtx) { this->dyna.actor.scale.y = this->dyna.actor.scale.z = this->dyna.actor.scale.x; - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + this->dyna.actor.scale.x * 160.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + this->dyna.actor.scale.x * 160.0f; + pos.z = this->dyna.actor.world.pos.z; for (i = 0; i < 4; i++) { - velocity.x = 5.0f * Math_SinS(this->dyna.actor.posRot.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; - velocity.z = 5.0f * Math_CosS(this->dyna.actor.posRot.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; + velocity.x = 5.0f * Math_SinS(this->dyna.actor.world.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; + velocity.z = 5.0f * Math_CosS(this->dyna.actor.world.rot.y + 0x8000) + (Rand_ZeroOne() - 0.5f) * 5.0f; velocity.y = (Rand_ZeroOne() - 0.5f) * 1.5f; EffectSsKiraKira_SpawnSmallYellow(globalCtx, &pos, &velocity, &accel); } @@ -186,7 +186,7 @@ void BgHidanDalm_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->dyna.actor); - func_8002E4B4(globalCtx, &this->dyna.actor, 10.0f, 15.0f, 32.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 10.0f, 15.0f, 32.0f, 5); } /** 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 dcf8a8751e..b406f8c025 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 @@ -26,7 +26,7 @@ extern Gfx D_0600DA80[]; const ActorInit Bg_Hidan_Firewall_InitVars = { ACTOR_BG_HIDAN_FIREWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanFirewall), @@ -74,7 +74,7 @@ void BgHidanFirewall_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->collider.dim.pos.y = this->actor.posRot.pos.y; + this->collider.dim.pos.y = this->actor.world.pos.y; CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); @@ -92,7 +92,7 @@ s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, GlobalContext* globalC Vec3f distance; player = PLAYER; - func_8002DBD0(&this->actor, &distance, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &distance, &player->actor.world.pos); if (fabsf(distance.x) < 100.0f && fabsf(distance.z) < 120.0f) { return 1; @@ -151,7 +151,7 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* player = PLAYER; - func_8002DBD0(&this->actor, &sp30, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &sp30, &player->actor.world.pos); if (sp30.x < -70.0f) { sp30.x = -70.0f; } else { @@ -175,8 +175,8 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* } sp28 = Math_SinS(this->actor.shape.rot.y); temp_ret = Math_CosS(this->actor.shape.rot.y); - this->collider.dim.pos.x = this->actor.posRot.pos.x + sp30.x * temp_ret + sp30.z * sp28; - this->collider.dim.pos.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret; + this->collider.dim.pos.x = this->actor.world.pos.x + sp30.x * temp_ret + sp30.z * sp28; + this->collider.dim.pos.z = this->actor.world.pos.z - sp30.x * sp28 + sp30.z * temp_ret; } void BgHidanFirewall_Update(Actor* thisx, GlobalContext* globalCtx) { 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 f0588fb2b2..3e742991d4 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 @@ -24,7 +24,7 @@ extern CollisionHeader D_0600E1E8; const ActorInit Bg_Hidan_Fslift_InitVars = { ACTOR_BG_HIDAN_FSLIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanFslift), @@ -51,8 +51,8 @@ void BgHidanFslift_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(thisx, DPM_PLAYER); CollisionHeader_GetVirtual(&D_0600E1E8, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->posRot.pos.x, - thisx->posRot.pos.y + 40.0f, thisx->posRot.pos.z + -28.0f, 0, 0, 0, 2) == NULL) { + if (Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_HSBLOCK, thisx->world.pos.x, + thisx->world.pos.y + 40.0f, thisx->world.pos.z + -28.0f, 0, 0, 0, 2) == NULL) { Actor_Kill(thisx); return; } @@ -63,9 +63,9 @@ void func_80886F24(BgHidanFslift* this) { Actor* thisx = &this->dyna.actor; if (thisx->child != NULL && thisx->child->update != NULL) { - thisx->child->posRot.pos.x = thisx->posRot.pos.x; - thisx->child->posRot.pos.y = thisx->posRot.pos.y + 40.0f; - thisx->child->posRot.pos.z = thisx->posRot.pos.z + -28.0f; + thisx->child->world.pos.x = thisx->world.pos.x; + thisx->child->world.pos.y = thisx->world.pos.y + 40.0f; + thisx->child->world.pos.z = thisx->world.pos.z + -28.0f; return; } thisx->child = NULL; @@ -90,7 +90,7 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { if (this->unk_168 == 0) { heightBool = false; - if ((thisx->posRot.pos.y - thisx->initPosRot.pos.y) < 0.5f) { + if ((thisx->world.pos.y - thisx->home.pos.y) < 0.5f) { heightBool = true; } if (func_80043590(thisx)) { @@ -108,7 +108,7 @@ void func_80886FCC(BgHidanFslift* this, GlobalContext* globalCtx) { void func_8088706C(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 4.0f)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); func_80886FB4(this); } else { @@ -121,7 +121,7 @@ void func_808870D8(BgHidanFslift* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (func_80043590(thisx)) { - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 790.0f, 4.0f)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y + 790.0f, 4.0f)) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); func_80886FB4(this); } else { 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 eb8252faca..1bac23a64e 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 @@ -30,7 +30,7 @@ extern Gfx D_04017BD0[]; const ActorInit Bg_Hidan_Fwbig_InitVars = { ACTOR_BG_HIDAN_FWBIG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanFwbig), @@ -76,14 +76,14 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) { this->direction = (u16)(thisx->params >> 8); thisx->params &= 0xFF; if (this->direction != 0) { - this->actor.initPosRot.pos.x = 1560.0f; - this->actor.initPosRot.pos.z = 0.0f; - if (player->actor.posRot.pos.z > 300.0f) { + this->actor.home.pos.x = 1560.0f; + this->actor.home.pos.z = 0.0f; + if (player->actor.world.pos.z > 300.0f) { this->direction = -1; - this->actor.initPosRot.rot.y = this->actor.shape.rot.y = -0x4E38; - } else if (player->actor.posRot.pos.z < -300.0f) { + this->actor.home.rot.y = this->actor.shape.rot.y = -0x4E38; + } else if (player->actor.world.pos.z < -300.0f) { this->direction = 1; - this->actor.initPosRot.rot.y = this->actor.shape.rot.y = -0x31C8; + this->actor.home.rot.y = this->actor.shape.rot.y = -0x31C8; } else { Actor_Kill(&this->actor); return; @@ -94,7 +94,7 @@ void BgHidanFwbig_Init(Actor* thisx, GlobalContext* globalCtx2) { this->actor.flags |= 0x10; this->moveState = FWBIG_MOVE; this->actionFunc = BgHidanFwbig_WaitForPlayer; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - (2400.0f * this->actor.scale.y); + this->actor.world.pos.y = this->actor.home.pos.y - (2400.0f * this->actor.scale.y); } else { Actor_SetScale(&this->actor, 0.1f); this->actionFunc = BgHidanFwbig_WaitForSwitch; @@ -111,8 +111,8 @@ void BgHidanFwbig_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgHidanFwbig_UpdatePosition(BgHidanFwbig* this) { s16 startAngle = this->actor.shape.rot.y + this->direction * -0x4000; - this->actor.posRot.pos.x = (Math_SinS(startAngle) * 885.4f) + this->actor.initPosRot.pos.x; - this->actor.posRot.pos.z = (Math_CosS(startAngle) * 885.4f) + this->actor.initPosRot.pos.z; + this->actor.world.pos.x = (Math_SinS(startAngle) * 885.4f) + this->actor.home.pos.x; + this->actor.world.pos.z = (Math_CosS(startAngle) * 885.4f) + this->actor.home.pos.z; } void BgHidanFwbig_WaitForSwitch(BgHidanFwbig* this, GlobalContext* globalCtx) { @@ -130,7 +130,7 @@ void BgHidanFwbig_WaitForCs(BgHidanFwbig* this, GlobalContext* globalCtx) { } void BgHidanFwbig_Rise(BgHidanFwbig* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 10.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 10.0f)) { if (this->direction == 0) { Flags_UnsetSwitch(globalCtx, this->actor.params); this->actionFunc = BgHidanFwbig_WaitForSwitch; @@ -141,8 +141,7 @@ void BgHidanFwbig_Rise(BgHidanFwbig* this, GlobalContext* globalCtx) { } void BgHidanFwbig_Lower(BgHidanFwbig* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - (2400.0f * this->actor.scale.y), - 10.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - (2400.0f * this->actor.scale.y), 10.0f)) { if (this->direction == 0) { this->actionFunc = BgHidanFwbig_WaitForTimer; this->timer = 150; @@ -153,7 +152,7 @@ void BgHidanFwbig_Lower(BgHidanFwbig* this, GlobalContext* globalCtx) { this->actor.shape.rot.y -= (this->direction * 0x1800); } else { this->moveState = FWBIG_MOVE; - this->actor.shape.rot.y = this->actor.initPosRot.rot.y; + this->actor.shape.rot.y = this->actor.home.rot.y; } BgHidanFwbig_UpdatePosition(this); this->actionFunc = BgHidanFwbig_Rise; @@ -174,7 +173,7 @@ void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, GlobalContext* globalCtx) { void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (player->actor.posRot.pos.x < 1150.0f) { + if (player->actor.world.pos.x < 1150.0f) { this->actionFunc = BgHidanFwbig_Rise; func_800800F8(globalCtx, 0xCDA, -0x63, &this->actor, 0); } @@ -182,8 +181,7 @@ void BgHidanFwbig_WaitForPlayer(BgHidanFwbig* this, GlobalContext* globalCtx) { void BgHidanFwbig_Move(BgHidanFwbig* this, GlobalContext* globalCtx) { if (!Player_InCsMode(globalCtx)) { - if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y + (this->direction * 0x6390), - 0x20)) { + if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y + (this->direction * 0x6390), 0x20)) { this->moveState = FWBIG_RESET; this->actionFunc = BgHidanFwbig_Lower; } else { @@ -198,7 +196,7 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, GlobalContext* globalCtx) { f32 cs; f32 sn; - func_8002DBD0(&this->actor, &projPos, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &projPos, &player->actor.world.pos); projPos.z = ((projPos.z >= 0.0f) ? 1.0f : -1.0f) * 25.0f * -1.0f; if (this->direction == 0) { projPos.x = CLAMP(projPos.x, -360.0f, 360.0f); @@ -208,11 +206,11 @@ void BgHidanFwbig_MoveCollider(BgHidanFwbig* this, GlobalContext* globalCtx) { sn = Math_SinS(this->actor.shape.rot.y); cs = Math_CosS(this->actor.shape.rot.y); - this->collider.dim.pos.x = this->actor.posRot.pos.x + (projPos.x * cs) + (projPos.z * sn); - this->collider.dim.pos.z = this->actor.posRot.pos.z - (projPos.x * sn) + (projPos.z * cs); - this->collider.dim.pos.y = this->actor.posRot.pos.y; + this->collider.dim.pos.x = this->actor.world.pos.x + (projPos.x * cs) + (projPos.z * sn); + this->collider.dim.pos.z = this->actor.world.pos.z - (projPos.x * sn) + (projPos.z * cs); + this->collider.dim.pos.y = this->actor.world.pos.y; - this->actor.posRot.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = (projPos.z < 0.0f) ? this->actor.shape.rot.y : this->actor.shape.rot.y + 0x8000; } void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -221,7 +219,7 @@ void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.posRot.rot.y, 1.0f); + func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f); if (this->direction != 0) { this->actionFunc = BgHidanFwbig_Lower; } @@ -233,10 +231,10 @@ void BgHidanFwbig_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); - if ((this->actor.initPosRot.pos.y - 200.0f) < this->actor.posRot.pos.y) { + if ((this->actor.home.pos.y - 200.0f) < this->actor.world.pos.y) { if (gSaveContext.sceneSetupIndex < 4) { func_8002F974(&this->actor, NA_SE_EV_BURNING - SFX_FLAG); - } else if ((s16)this->actor.posRot.pos.x == -513) { + } else if ((s16)this->actor.world.pos.x == -513) { func_8002F974(&this->actor, NA_SE_EV_FLAME_OF_FIRE - SFX_FLAG); } BgHidanFwbig_MoveCollider(this, globalCtx); @@ -258,7 +256,7 @@ void BgHidanFwbig_Draw(Actor* thisx, GlobalContext* globalCtx) { height = thisx->scale.y * 2400.0f; gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 220, 0, - ((height - (thisx->initPosRot.pos.y - thisx->posRot.pos.y)) * 255.0f) / height); + ((height - (thisx->home.pos.y - thisx->world.pos.y)) * 255.0f) / height); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); 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 c2468da577..a8959d8324 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 @@ -70,7 +70,7 @@ static ColliderTrisInit sTrisInit = { const ActorInit Bg_Hidan_Hamstep_InitVars = { ACTOR_BG_HIDAN_HAMSTEP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanHamstep), @@ -109,20 +109,20 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, GlobalContext* globalCtx) GlobalContext* globalCtx2 = globalCtx; pos = pos; // Required to match - pos.y = this->dyna.actor.initPosRot.pos.y - 100.0f; + pos.y = this->dyna.actor.home.pos.y - 100.0f; sin = Math_SinS(this->dyna.actor.shape.rot.y + 0x8000); cos = Math_CosS(this->dyna.actor.shape.rot.y + 0x8000); for (i = 0; i < 5; i++) { - pos.x = (((i * 160.0f) + 60.0f) * sin) + this->dyna.actor.initPosRot.pos.x; - pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.initPosRot.pos.z; + pos.x = (((i * 160.0f) + 60.0f) * sin) + this->dyna.actor.home.pos.x; + pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z; params = ((i + 1) & 0xFF); params |= (this->dyna.actor.params & 0xFF00); step = (BgHidanHamstep*)Actor_SpawnAsChild( &globalCtx2->actorCtx, &step->dyna.actor, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, - this->dyna.actor.posRot.rot.x, this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, params); + this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, params); if (step == NULL) { return 0; @@ -149,9 +149,9 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < 2; i++) { for (i2 = 0; i2 < 3; i2++) { - sp48[i2].x = sTrisInit.elements[i].dim.vtx[i2].x + this->dyna.actor.initPosRot.pos.x; - sp48[i2].y = sTrisInit.elements[i].dim.vtx[i2].y + this->dyna.actor.initPosRot.pos.y; - sp48[i2].z = sTrisInit.elements[i].dim.vtx[i2].z + this->dyna.actor.initPosRot.pos.z; + sp48[i2].x = sTrisInit.elements[i].dim.vtx[i2].x + this->dyna.actor.home.pos.x; + sp48[i2].y = sTrisInit.elements[i].dim.vtx[i2].y + this->dyna.actor.home.pos.y; + sp48[i2].z = sTrisInit.elements[i].dim.vtx[i2].z + this->dyna.actor.home.pos.z; } Collider_SetTrisVertices(&this->collider, i, &sp48[0], &sp48[1], &sp48[2]); } @@ -167,11 +167,11 @@ void BgHidanHamstep_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0xFF)) { if ((this->dyna.actor.params & 0xFF) == 0) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + (-20.0f); + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + (-20.0f); BgHidanHamstep_SetupAction(this, 4); } else { - this->dyna.actor.posRot.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = + sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } } else if ((this->dyna.actor.params & 0xFF) == 0) { @@ -212,7 +212,7 @@ void BgHidanHamstep_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_808884C8(BgHidanHamstep* step, GlobalContext* globalCtx) { - Vec3f pos = step->dyna.actor.posRot.pos; + Vec3f pos = step->dyna.actor.world.pos; s32 i; f32 sin; f32 cos; @@ -224,11 +224,11 @@ void func_808884C8(BgHidanHamstep* step, GlobalContext* globalCtx) { sin = Math_SinS(step->dyna.actor.shape.rot.y + 0x8000); cos = Math_CosS(step->dyna.actor.shape.rot.y + 0x8000); - pos.y = step->dyna.actor.posRot.pos.y; + pos.y = step->dyna.actor.world.pos.y; for (i = 0; i < ARRAY_COUNT(sEffectPositions); i++) { - pos.x = (sEffectPositions[i][1] * sin) + (sEffectPositions[i][0] * cos) + step->dyna.actor.posRot.pos.x; - pos.z = ((sEffectPositions[i][1] * cos) - (sEffectPositions[i][0] * sin)) + step->dyna.actor.posRot.pos.z; + pos.x = (sEffectPositions[i][1] * sin) + (sEffectPositions[i][0] * cos) + step->dyna.actor.world.pos.x; + pos.z = ((sEffectPositions[i][1] * cos) - (sEffectPositions[i][0] * sin)) + step->dyna.actor.world.pos.z; func_80033480(globalCtx, &pos, 0.0f, 0, 150, 150, 0); } } @@ -248,18 +248,18 @@ void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) { BgHidanHamstep* child; if ((this->dyna.actor.params & 0xFF) >= 2) { - if (parent->dyna.actor.posRot.pos.y < this->dyna.actor.posRot.pos.y) { - this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y; - } else if ((this->dyna.actor.posRot.pos.y - parent->dyna.actor.posRot.pos.y) < -100.0f) { - this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y - 100.0f; + if (parent->dyna.actor.world.pos.y < this->dyna.actor.world.pos.y) { + this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y; + } else if ((this->dyna.actor.world.pos.y - parent->dyna.actor.world.pos.y) < -100.0f) { + this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } } child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { - if (this->dyna.actor.posRot.pos.y < child->dyna.actor.posRot.pos.y) { - child->dyna.actor.posRot.pos.y = this->dyna.actor.posRot.pos.y; + if (this->dyna.actor.world.pos.y < child->dyna.actor.world.pos.y) { + child->dyna.actor.world.pos.y = this->dyna.actor.world.pos.y; } child = (BgHidanHamstep*)child->dyna.actor.child; } @@ -273,9 +273,9 @@ void func_80888734(BgHidanHamstep* this) { this->dyna.actor.velocity.y = parent->dyna.actor.velocity.y; if ((this->dyna.actor.params & 0xFF) == 1) { - this->dyna.actor.posRot.pos.y = parent->dyna.actor.posRot.pos.y - 100.0f; + this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } else { - this->dyna.actor.posRot.pos.y += (this->dyna.actor.velocity.y * factor); + this->dyna.actor.world.pos.y += (this->dyna.actor.velocity.y * factor); } func_80888694(this, parent); @@ -301,13 +301,12 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - if (((this->dyna.actor.posRot.pos.y - this->dyna.actor.initPosRot.pos.y) < - (-20.0f - this->dyna.actor.minVelocityY)) && + if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) < (-20.0f - this->dyna.actor.minVelocityY)) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + -20.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + -20.0f; BgHidanHamstep_SetupAction(this, 4); } else { this->dyna.actor.velocity.y *= -0.24f; @@ -320,7 +319,7 @@ void func_80888860(BgHidanHamstep* this, GlobalContext* globalCtx) { Quake_SetQuakeValues(quakeIndex, 0, 0, 500, 0); Quake_SetCountdown(quakeIndex, 20); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 255, 20, 150); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 255, 20, 150); func_80888638(this, globalCtx); osSyncPrintf("A(%d)\n", this->dyna.actor.params); } @@ -336,8 +335,8 @@ void func_808889B8(BgHidanHamstep* this, GlobalContext* globalCtx) { if ((parent->action == 4) || ((parent->action == 3) && (parent->unk_244 >= 5))) { if ((this->dyna.actor.params & 0xFF) == 1) { - this->dyna.actor.posRot.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = + sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } else { BgHidanHamstep_SetupAction(this, 3); @@ -359,14 +358,14 @@ void func_80888A58(BgHidanHamstep* this, GlobalContext* globalCtx) { osSyncPrintf("%s %d\n", "../z_bg_hidan_hamstep.c", 696); } - if (((this->dyna.actor.posRot.pos.y - this->dyna.actor.initPosRot.pos.y) <= + if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { - this->dyna.actor.posRot.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = + sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 3); } else { this->dyna.actor.velocity.y *= -0.24f; 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 c43fcfdfe5..ff9ddc313d 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 @@ -20,7 +20,7 @@ extern UNK_TYPE D_0600D054; /* const ActorInit Bg_Hidan_Hrock_InitVars = { ACTOR_BG_HIDAN_HROCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanHrock), 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 f950bdf0d3..5ae6fd14dc 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 @@ -26,7 +26,7 @@ static f32 D_80889E40[] = { 120.0f, 150.0f, 150.0f }; const ActorInit Bg_Hidan_Kousi_InitVars = { ACTOR_BG_HIDAN_KOUSI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanKousi), @@ -71,7 +71,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - Actor_SetHeight(thisx, 50.0f); + Actor_SetFocus(thisx, 50.0f); osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF, ((s32)thisx->params >> 8) & 0xFF); @@ -82,7 +82,7 @@ void BgHidanKousi_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(D_80889E70[thisx->params & 0xFF], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - thisx->posRot.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y; + thisx->world.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y; if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0xFF)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); @@ -98,13 +98,13 @@ void BgHidanKousi_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80889ACC(BgHidanKousi* this) { s32 pad[2]; - Vec3s* rot = &this->dyna.actor.posRot.rot; + Vec3s* rot = &this->dyna.actor.world.rot; f32 temp1 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_SinS(rot->y); f32 temp2 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_CosS(rot->y); - Vec3f* initPos = &this->dyna.actor.initPosRot.pos; + Vec3f* initPos = &this->dyna.actor.home.pos; - this->dyna.actor.posRot.pos.x = initPos->x + temp1; - this->dyna.actor.posRot.pos.z = initPos->z + temp2; + this->dyna.actor.world.pos.x = initPos->x + temp1; + this->dyna.actor.world.pos.z = initPos->z + temp2; } void func_80889B5C(BgHidanKousi* this, GlobalContext* globalCtx) { @@ -117,7 +117,7 @@ void func_80889B5C(BgHidanKousi* this, GlobalContext* globalCtx) { void func_80889BC0(BgHidanKousi* this, GlobalContext* globalCtx) { this->unk_168 -= 1; - if (this->dyna.actor.type == func_8005B198() || (this->unk_168 <= 0)) { + if (this->dyna.actor.category == func_8005B198() || (this->unk_168 <= 0)) { BgHidanKousi_SetupAction(this, func_80889C18); } } @@ -135,7 +135,7 @@ void func_80889C18(BgHidanKousi* this, GlobalContext* globalCtx) { void func_80889C90(BgHidanKousi* this, GlobalContext* globalCtx) { func_8002D7EC(&this->dyna.actor); if (D_80889E40[this->dyna.actor.params & 0xFF] < - Math_Vec3f_DistXYZ(&this->dyna.actor.initPosRot.pos, &this->dyna.actor.posRot.pos)) { + Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_METALDOOR_STOP); 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 a0bc3555fd..0c3047112f 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 @@ -26,7 +26,7 @@ extern Gfx D_05000530[]; const ActorInit Bg_Hidan_Kowarerukabe_InitVars = { ACTOR_BG_HIDAN_KOWARERUKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanKowarerukabe), @@ -95,8 +95,7 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, GlobalCon void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f }; - this->dyna.actor.posRot.pos.y = - actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.home.pos.y; } static InitChainEntry sInitChain[] = { @@ -144,14 +143,14 @@ void BgHidanKowarerukabe_SpawnDust(BgHidanKowarerukabe* this, GlobalContext* glo s32 pad; Vec3f pos; - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; pos.y += 10.0f; func_80033480(globalCtx, &pos, 0.0f, 0, 600, 300, 1); - pos.x = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() * 100.0f) + this->dyna.actor.posRot.pos.y; - pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.posRot.pos.z; + pos.x = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.world.pos.x; + pos.y = (Rand_ZeroOne() * 100.0f) + this->dyna.actor.world.pos.y; + pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + this->dyna.actor.world.pos.z; func_80033480(globalCtx, &pos, 100.0f, 4, 200, 250, 1); } @@ -169,15 +168,15 @@ void BgHidanKowarerukabe_FloorBreak(BgHidanKowarerukabe* this, GlobalContext* gl f32 tmp2; s16 arg9; - pos.y = thisx->posRot.pos.y + 10.0f; + pos.y = thisx->world.pos.y + 10.0f; for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { tmp1 = 24 * (i - 2); tmp2 = 24 * (j - 2); - pos.x = (tmp2 * sin) + (tmp1 * cos) + thisx->posRot.pos.x; - pos.z = (tmp2 * cos) - (tmp1 * sin) + thisx->posRot.pos.z; + pos.x = (tmp2 * sin) + (tmp1 * cos) + thisx->world.pos.x; + pos.z = (tmp2 * cos) - (tmp1 * sin) + thisx->world.pos.z; tmp1 = 8.0f * Rand_ZeroOne() * (i - 2); tmp2 = 8.0f * Rand_ZeroOne() * (j - 2); @@ -190,8 +189,8 @@ void BgHidanKowarerukabe_FloorBreak(BgHidanKowarerukabe* this, GlobalContext* gl arg5 = (((i == 0) || (i == 4)) && ((j == 0) || (j == 4))) ? 65 : 64; - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot.pos, -550, arg5, 15, 15, 0, arg9, 2, 16, - 100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -550, arg5, 15, 15, 0, arg9, 2, 16, 100, + KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); } } } @@ -210,12 +209,12 @@ void func_8088A67C(BgHidanKowarerukabe* this, GlobalContext* globalCtx) { s16 arg9; for (i = 0; i < 5; i++) { - pos.y = (20 * i) + thisx->posRot.pos.y; + pos.y = (20 * i) + thisx->world.pos.y; for (j = 0; j < 5; j++) { tmp1 = 16 * (j - 2); - pos.x = (tmp1 * cos) + thisx->posRot.pos.x; - pos.z = -(tmp1 * sin) + thisx->posRot.pos.z; + pos.x = (tmp1 * cos) + thisx->world.pos.x; + pos.z = -(tmp1 * sin) + thisx->world.pos.z; tmp1 = 3.0f * Rand_ZeroOne() * (j - 2); tmp2 = 6.0f * Rand_ZeroOne(); @@ -231,8 +230,8 @@ void func_8088A67C(BgHidanKowarerukabe* this, GlobalContext* globalCtx) { arg5 |= 1; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot.pos, -540, arg5, 20, 20, 0, arg9, 2, 32, - 100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -540, arg5, 20, 20, 0, arg9, 2, 32, 100, + KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); } } } @@ -251,12 +250,12 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext s16 arg9; for (i = 0; i < 5; i++) { - pos.y = (24 * i) + thisx->posRot.pos.y; + pos.y = (24 * i) + thisx->world.pos.y; for (j = 0; j < 5; j++) { tmp1 = 28 * (j - 2); - pos.x = (tmp1 * cos) + thisx->posRot.pos.x; - pos.z = -(tmp1 * sin) + thisx->posRot.pos.z; + pos.x = (tmp1 * cos) + thisx->world.pos.x; + pos.z = -(tmp1 * sin) + thisx->world.pos.z; tmp1 = 6.0f * Rand_ZeroOne() * (j - 2); tmp2 = 6.0f * Rand_ZeroOne(); @@ -272,7 +271,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext arg5 |= 1; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->posRot, -650, arg5, 20, 20, 0, arg9, 2, 32, 100, + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world, -650, arg5, 20, 20, 0, arg9, 2, 32, 100, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); } } @@ -303,9 +302,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); if ((this->dyna.actor.params & 0xFF) == 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); } else { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); } func_80078884(NA_SE_SY_CORRECT_CHIME); 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 b2e30caa43..3c7b9300e2 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 @@ -18,7 +18,7 @@ extern UNK_TYPE D_0600DF78; /* const ActorInit Bg_Hidan_Rock_InitVars = { ACTOR_BG_HIDAN_ROCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanRock), 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 8c016d664a..5aaf3b9bb8 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 @@ -11,7 +11,7 @@ void BgHidanRsekizou_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Hidan_Rsekizou_InitVars = { ACTOR_BG_HIDAN_RSEKIZOU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanRsekizou), @@ -167,13 +167,11 @@ void BgHidanRsekizou_Update(Actor* thisx, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(this->colliderItems); i++) { sphere = &this->collider.elements[i]; - sphere->dim.worldSphere.center.x = this->dyna.actor.initPosRot.pos.x + - yawCosine * sphere->dim.modelSphere.center.x + + sphere->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + yawCosine * sphere->dim.modelSphere.center.x + yawSine * sphere->dim.modelSphere.center.z; - sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.initPosRot.pos.y + sphere->dim.modelSphere.center.y; - sphere->dim.worldSphere.center.z = - (this->dyna.actor.initPosRot.pos.z - yawSine * sphere->dim.modelSphere.center.x) + - yawCosine * sphere->dim.modelSphere.center.z; + sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + sphere->dim.modelSphere.center.y; + sphere->dim.worldSphere.center.z = (this->dyna.actor.home.pos.z - yawSine * sphere->dim.modelSphere.center.x) + + yawCosine * sphere->dim.modelSphere.center.z; } CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -208,9 +206,9 @@ Gfx* BgHidanRsekizou_DrawFireball(GlobalContext* globalCtx, BgHidanRsekizou* thi mf->xx = mf->yy = mf->zz = (0.7f * fVar6) + 0.5f; tmpf7 = (((((0.7f * fVar6) + 0.5f) * 10.0f) * fVar6) + 20.0f); - mf->wx = (tmpf7 * sins) + this->dyna.actor.posRot.pos.x; - mf->wy = (this->dyna.actor.posRot.pos.y + 30.0f) + (0.699999988079f * fVar6); - mf->wz = (tmpf7 * coss) + this->dyna.actor.posRot.pos.z; + mf->wx = (tmpf7 * sins) + this->dyna.actor.world.pos.x; + mf->wy = (this->dyna.actor.world.pos.y + 30.0f) + (0.699999988079f * fVar6); + mf->wz = (tmpf7 * coss) + this->dyna.actor.world.pos.z; gSPMatrix(displayList++, Matrix_MtxFToMtx(Matrix_CheckFloats(mf, "../z_bg_hidan_rsekizou.c", 543), 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 4dc6d98337..94d5721663 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 @@ -17,7 +17,7 @@ extern UNK_TYPE D_0600DC30; /* const ActorInit Bg_Hidan_Sekizou_InitVars = { ACTOR_BG_HIDAN_SEKIZOU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanSekizou), 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 0603e79f1d..1ac6679adc 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 @@ -18,7 +18,7 @@ extern UNK_TYPE D_060120E8; /* const ActorInit Bg_Hidan_Sima_InitVars = { ACTOR_BG_HIDAN_SIMA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanSima), 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 2980acdfd1..4c3ec40854 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 @@ -21,7 +21,7 @@ void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx); const ActorInit Bg_Hidan_Syoku_InitVars = { ACTOR_BG_HIDAN_SYOKU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HIDAN_OBJECTS, sizeof(BgHidanSyoku), @@ -48,7 +48,7 @@ void BgHidanSyoku_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_0600E568, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); this->actionFunc = func_8088F4B8; - this->dyna.actor.initPosRot.pos.y += 540.0f; + this->dyna.actor.home.pos.y += 540.0f; } void BgHidanSyoku_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -74,7 +74,7 @@ void func_8088F514(BgHidanSyoku* this, GlobalContext* globalCtx) { if (this->unk_16A != 0) { this->unk_16A -= 1; } - this->dyna.actor.posRot.pos.y = (cosf(this->unk_16A * (M_PI / 140)) * 540.0f) + this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = (cosf(this->unk_16A * (M_PI / 140)) * 540.0f) + this->dyna.actor.home.pos.y; if (this->unk_16A == 0) { func_8088F47C(this); } else { @@ -86,7 +86,7 @@ void func_8088F5A0(BgHidanSyoku* this, GlobalContext* globalCtx) { if (this->unk_16A != 0) { this->unk_16A -= 1; } - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - (cosf(this->unk_16A * (M_PI / 140)) * 540.0f); + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - (cosf(this->unk_16A * (M_PI / 140)) * 540.0f); if (this->unk_16A == 0) { func_8088F47C(this); } else { @@ -100,7 +100,7 @@ void func_8088F62C(BgHidanSyoku* this, GlobalContext* globalCtx) { } if (this->unk_16A == 0) { this->unk_16A = 0x8c; - if (this->dyna.actor.posRot.pos.y < this->dyna.actor.initPosRot.pos.y) { + if (this->dyna.actor.world.pos.y < this->dyna.actor.home.pos.y) { this->actionFunc = func_8088F514; } else { this->actionFunc = func_8088F5A0; 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 c0d0ba7468..81a806d747 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 @@ -29,7 +29,7 @@ static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; const ActorInit Bg_Ice_Objects_InitVars = { ACTOR_BG_ICE_OBJECTS, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceObjects), @@ -51,7 +51,7 @@ void BgIceObjects_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_060003F0, &colHeader); - Math_Vec3f_Copy(&this->targetPos, &this->dyna.actor.initPosRot.pos); + Math_Vec3f_Copy(&this->targetPos, &this->dyna.actor.home.pos); this->actionFunc = BgIceObjects_Idle; this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.actor.params = 0; @@ -89,7 +89,7 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) { s32 i; if ((this->dyna.unk_158 == 0) || (this->dyna.unk_158 == -0x8000)) { - x16 = this->dyna.actor.posRot.pos.x; + x16 = this->dyna.actor.world.pos.x; for (i = 0; i < 7; i++) { if (x16 == sXStarts[i]) { z16 = (this->dyna.unk_158 == 0) ? sZStops[i][0] : sZStops[i][1]; @@ -99,7 +99,7 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) { } this->targetPos.z = (this->dyna.unk_158 == 0) ? -340 : -1260; } else { - z16 = this->dyna.actor.posRot.pos.z; + z16 = this->dyna.actor.world.pos.z; for (i = 0; i < 7; i++) { if (z16 == sZStarts[i]) { x16 = (this->dyna.unk_158 == 0x4000) ? sXStops[i][0] : sXStops[i][1]; @@ -117,17 +117,17 @@ void BgIceObjects_SetNextTarget(BgIceObjects* this, GlobalContext* globalCtx) { void BgIceObjects_CheckPits(BgIceObjects* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if ((thisx->velocity.y > 0.0f) || ((thisx->posRot.pos.x <= -1660.0f) && (thisx->posRot.pos.z <= -1060.0f)) || - ((thisx->posRot.pos.x <= -1580.0f) && (thisx->posRot.pos.z >= -420.0f)) || - ((thisx->posRot.pos.x >= -980.0f) && (thisx->posRot.pos.z <= -1180.0f)) || - ((thisx->posRot.pos.x >= -860.0f) && (thisx->posRot.pos.z >= -700.0f))) { + if ((thisx->velocity.y > 0.0f) || ((thisx->world.pos.x <= -1660.0f) && (thisx->world.pos.z <= -1060.0f)) || + ((thisx->world.pos.x <= -1580.0f) && (thisx->world.pos.z >= -420.0f)) || + ((thisx->world.pos.x >= -980.0f) && (thisx->world.pos.z <= -1180.0f)) || + ((thisx->world.pos.x >= -860.0f) && (thisx->world.pos.z >= -700.0f))) { thisx->velocity.y += 1.0f; - if (Math_StepToF(&thisx->posRot.pos.y, -300.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, -300.0f, thisx->velocity.y)) { thisx->velocity.y = 0.0f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.y = thisx->initPosRot.pos.y - 60.0f; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.y = thisx->home.pos.y - 60.0f; + thisx->world.pos.z = thisx->home.pos.z; if (thisx->params != 0) { func_8002DF54(globalCtx, thisx, 7); } @@ -144,7 +144,7 @@ void BgIceObjects_Idle(BgIceObjects* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; if ((this->dyna.unk_150 > 0.0f) && !Player_InCsMode(globalCtx)) { BgIceObjects_SetNextTarget(this, globalCtx); - if (func_8002DBB0(thisx, &this->targetPos) > 1.0f) { + if (Actor_WorldDistXZToPoint(thisx, &this->targetPos) > 1.0f) { thisx->flags |= 0x10; func_8002DF54(globalCtx, thisx, 8); thisx->params = 1; @@ -166,39 +166,35 @@ void BgIceObjects_Slide(BgIceObjects* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; Math_StepToF(&thisx->speedXZ, 10.0f, 0.5f); - atTarget = Math_StepToF(&thisx->posRot.pos.x, this->targetPos.x, thisx->speedXZ); - atTarget &= Math_StepToF(&thisx->posRot.pos.z, this->targetPos.z, thisx->speedXZ); + atTarget = Math_StepToF(&thisx->world.pos.x, this->targetPos.x, thisx->speedXZ); + atTarget &= Math_StepToF(&thisx->world.pos.z, this->targetPos.z, thisx->speedXZ); if (atTarget) { thisx->speedXZ = 0.0f; - this->targetPos.x = thisx->posRot.pos.x; - this->targetPos.z = thisx->posRot.pos.z; + this->targetPos.x = thisx->world.pos.x; + this->targetPos.z = thisx->world.pos.z; if (thisx->velocity.y <= 0.0f) { thisx->flags &= ~0x10; } thisx->params = 0; func_8002DF54(globalCtx, thisx, 7); Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); - if ((fabsf(thisx->posRot.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->posRot.pos.z + 260.0f) < 1.0f)) { + if ((fabsf(thisx->world.pos.x + 1387.0f) < 1.0f) && (fabsf(thisx->world.pos.z + 260.0f) < 1.0f)) { this->actionFunc = BgIceObjects_Stuck; } else { this->actionFunc = BgIceObjects_Idle; } - } else if ((thisx->speedXZ > 6.0f) && (thisx->posRot.pos.y >= 0.0f)) { + } else if ((thisx->speedXZ > 6.0f) && (thisx->world.pos.y >= 0.0f)) { spread = Rand_CenteredFloat(120.0f); velocity.x = -(1.5f + Rand_ZeroOne()) * Math_SinS(this->dyna.unk_158); velocity.y = Rand_ZeroOne() + 1.0f; velocity.z = -(1.5f + Rand_ZeroOne()) * Math_CosS(this->dyna.unk_158); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); - pos.y = thisx->posRot.pos.y; + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) - (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) + (Math_SinS(this->dyna.unk_158) * spread); + pos.y = thisx->world.pos.y; func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); spread = Rand_CenteredFloat(120.0f); - pos.x = - thisx->posRot.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); - pos.z = - thisx->posRot.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); + pos.x = thisx->world.pos.x - (60.0f * Math_SinS(this->dyna.unk_158)) + (Math_CosS(this->dyna.unk_158) * spread); + pos.z = thisx->world.pos.z - (60.0f * Math_CosS(this->dyna.unk_158)) - (Math_SinS(this->dyna.unk_158) * spread); func_8002829C(globalCtx, &pos, &velocity, &sZeroVec, &sWhite, &sGray, 250, Rand_S16Offset(40, 15)); func_8002F974(thisx, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG); } @@ -213,9 +209,9 @@ void BgIceObjects_Reset(BgIceObjects* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; } - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y, 1.0f)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y, 1.0f)) { thisx->flags &= ~0x10; - Math_Vec3f_Copy(&this->targetPos, &thisx->initPosRot.pos); + Math_Vec3f_Copy(&this->targetPos, &thisx->home.pos); this->actionFunc = BgIceObjects_Idle; thisx->speedXZ = 0.0f; } 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 fa04dc3ddb..f86a2d5bb4 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 @@ -18,7 +18,7 @@ extern UNK_TYPE D_06002920; /* const ActorInit Bg_Ice_Shelter_InitVars = { ACTOR_BG_ICE_SHELTER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceShelter), 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 62c68cd22b..a0cd13ea89 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 @@ -21,7 +21,7 @@ void func_80891DD4(BgIceShutter* thisx, GlobalContext* globalCtx); const ActorInit Bg_Ice_Shutter_InitVars = { ACTOR_BG_ICE_SHUTTER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceShutter), @@ -42,12 +42,10 @@ void func_80891AC0(BgIceShutter* this) { f32 sp24; sp24 = Math_SinS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y; - this->dyna.actor.posRot.pos.y = - (Math_CosS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y) + this->dyna.actor.initPosRot.pos.y; - this->dyna.actor.posRot.pos.x = - (Math_SinS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_CosS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.y = + (Math_CosS(this->dyna.actor.shape.rot.x) * this->dyna.actor.velocity.y) + this->dyna.actor.home.pos.y; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.shape.rot.y) * sp24) + this->dyna.actor.home.pos.z; } void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -85,13 +83,13 @@ void BgIceShutter_Init(Actor* thisx, GlobalContext* globalCtx) { if (sp28 == 2) { temp_f6 = Math_SinS(this->dyna.actor.shape.rot.x) * 50.0f; - this->dyna.actor.posRot2.pos.x = - (Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot2.pos.y = this->dyna.actor.initPosRot.pos.y; - this->dyna.actor.posRot2.pos.z = - this->dyna.actor.initPosRot.pos.z + (Math_CosS(this->dyna.actor.shape.rot.y) * temp_f6); + this->dyna.actor.focus.pos.x = + (Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.home.pos.x; + this->dyna.actor.focus.pos.y = this->dyna.actor.home.pos.y; + this->dyna.actor.focus.pos.z = + this->dyna.actor.home.pos.z + (Math_CosS(this->dyna.actor.shape.rot.y) * temp_f6); } else { - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); } } @@ -103,7 +101,7 @@ void BgIceShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) { if (Flags_GetTempClear(globalCtx, this->dyna.actor.room)) { Flags_SetClear(globalCtx, this->dyna.actor.room); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80891DD4; if (this->dyna.actor.shape.rot.x == 0) { func_80080480(globalCtx, &this->dyna.actor); @@ -113,7 +111,7 @@ void func_80891CF4(BgIceShutter* this, GlobalContext* globalCtx) { void func_80891D6C(BgIceShutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params)) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_SLIDE_DOOR_OPEN); this->actionFunc = func_80891DD4; func_80080480(globalCtx, &this->dyna.actor); } 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 4feb20b469..609c55aeb5 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 @@ -46,7 +46,7 @@ extern CollisionHeader D_06002594; const ActorInit Bg_Ice_Turara_InitVars = { ACTOR_BG_ICE_TURARA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_ICE_OBJECTS, sizeof(BgIceTurara), @@ -79,7 +79,7 @@ void BgIceTurara_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = BgIceTurara_Stalagmite; } else { this->dyna.actor.shape.rot.x = -0x8000; - this->dyna.actor.shape.unk_08 = 1200.0f; + this->dyna.actor.shape.yOffset = 1200.0f; this->actionFunc = BgIceTurara_Wait; } } @@ -100,12 +100,12 @@ void BgIceTurara_Break(BgIceTurara* this, GlobalContext* globalCtx, f32 arg2) { s32 j; s32 i; - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 30, NA_SE_EV_ICE_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 30, NA_SE_EV_ICE_BROKEN); for (i = 0; i < 2; i++) { for (j = 0; j < 10; j++) { - pos.x = this->dyna.actor.posRot.pos.x + Rand_CenteredFloat(8.0f); - pos.y = this->dyna.actor.posRot.pos.y + (Rand_ZeroOne() * arg2) + (i * arg2); - pos.z = this->dyna.actor.posRot.pos.z + Rand_CenteredFloat(8.0f); + pos.x = this->dyna.actor.world.pos.x + Rand_CenteredFloat(8.0f); + pos.y = this->dyna.actor.world.pos.y + (Rand_ZeroOne() * arg2) + (i * arg2); + pos.z = this->dyna.actor.world.pos.z + Rand_CenteredFloat(8.0f); vel.x = Rand_CenteredFloat(7.0f); vel.z = Rand_CenteredFloat(7.0f); @@ -127,7 +127,7 @@ void BgIceTurara_Stalagmite(BgIceTurara* this, GlobalContext* globalCtx) { } void BgIceTurara_Wait(BgIceTurara* this, GlobalContext* globalCtx) { - if (this->dyna.actor.xzDistToLink < 60.0f) { + if (this->dyna.actor.xzDistToPlayer < 60.0f) { this->shiverTimer = 10; this->actionFunc = BgIceTurara_Shiver; } @@ -145,8 +145,8 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ICE_SWING); } if (this->shiverTimer == 0) { - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z; Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); @@ -154,10 +154,10 @@ void BgIceTurara_Shiver(BgIceTurara* this, GlobalContext* globalCtx) { } else { sp28 = Rand_ZeroOne(); phi_v0_2 = (Rand_ZeroOne() < 0.5f ? -1 : 1); - this->dyna.actor.posRot.pos.x = (phi_v0_2 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.initPosRot.pos.x; + this->dyna.actor.world.pos.x = (phi_v0_2 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.home.pos.x; sp28 = Rand_ZeroOne(); phi_v0_3 = (Rand_ZeroOne() < 0.5f ? -1 : 1); - this->dyna.actor.posRot.pos.z = (phi_v0_3 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.z = (phi_v0_3 * ((0.5f * sp28) + 0.5f)) + this->dyna.actor.home.pos.z; } } @@ -165,12 +165,12 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) { if ((this->collider.base.atFlags & AT_HIT) || (this->dyna.actor.bgCheckFlags & 1)) { this->collider.base.atFlags &= ~AT_HIT; this->dyna.actor.bgCheckFlags &= ~1; - if (this->dyna.actor.posRot.pos.y < this->dyna.actor.groundY) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if (this->dyna.actor.world.pos.y < this->dyna.actor.floorHeight) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } BgIceTurara_Break(this, globalCtx, 40.0f); if (this->dyna.actor.params == TURARA_STALACTITE_REGROW) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 120.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 120.0f; func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->actionFunc = BgIceTurara_Regrow; } else { @@ -179,16 +179,16 @@ void BgIceTurara_Fall(BgIceTurara* this, GlobalContext* globalCtx) { } } else { Actor_MoveForward(&this->dyna.actor); - this->dyna.actor.posRot.pos.y += 40.0f; - func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); - this->dyna.actor.posRot.pos.y -= 40.0f; + this->dyna.actor.world.pos.y += 40.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); + this->dyna.actor.world.pos.y -= 40.0f; Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } void BgIceTurara_Regrow(BgIceTurara* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 1.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f)) { this->actionFunc = BgIceTurara_Wait; this->dyna.actor.velocity.y = 0.0f; } 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 369dc2b3ee..b0028723fb 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -20,7 +20,7 @@ void BgIngate_DoNothing(BgIngate* this, GlobalContext* globalCtx); const ActorInit Bg_Ingate_InitVars = { ACTOR_BG_INGATE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_INGATE, sizeof(BgIngate), @@ -79,7 +79,7 @@ void func_80892890(BgIngate* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params & 2) == 0) { phi0 = -0x4000; } - this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y + phi0; + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi0; BgIngate_SetupAction(this, &BgIngate_DoNothing); } else if (globalCtx->csCtx.frames >= 10) { csFrames = globalCtx->csCtx.frames - 10; @@ -93,7 +93,7 @@ void func_80892890(BgIngate* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params & 2) == 0) { phi1 = -phi1; } - this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y + phi1; + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi1; } } 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 da23f69d81..4c0ef12c01 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 @@ -28,7 +28,7 @@ static u8 sIsSpawned = false; const ActorInit Bg_Jya_1flift_InitVars = { ACTOR_BG_JYA_1FLIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJya1flift), @@ -128,7 +128,7 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80892DB0(BgJya1flift* this) { this->actionFunc = func_80892DCC; - this->dyna.actor.posRot.pos.y = sFinalPositions[0]; + this->dyna.actor.world.pos.y = sFinalPositions[0]; } void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) { @@ -139,7 +139,7 @@ void func_80892DCC(BgJya1flift* this, GlobalContext* globalCtx) { void func_80892E0C(BgJya1flift* this) { this->actionFunc = BgJya1flift_DoNothing; - this->dyna.actor.posRot.pos.y = sFinalPositions[0]; + this->dyna.actor.world.pos.y = sFinalPositions[0]; } void BgJya1flift_DoNothing(BgJya1flift* this, GlobalContext* globalCtx) { @@ -160,9 +160,9 @@ void BgJya1flift_Move(BgJya1flift* this, GlobalContext* globalCtx) { } else { tempVelocity = this->dyna.actor.velocity.y; } - if (fabsf(Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, (sFinalPositions[this->isMovingDown]), 0.5f, + if (fabsf(Math_SmoothStepToF(&this->dyna.actor.world.pos.y, (sFinalPositions[this->isMovingDown]), 0.5f, tempVelocity, 1.0f)) < 0.001f) { - this->dyna.actor.posRot.pos.y = sFinalPositions[this->isMovingDown]; + this->dyna.actor.world.pos.y = sFinalPositions[this->isMovingDown]; BgJya1flift_ResetMoveDelay(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { 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 046ff31eb5..9be1b04676 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 @@ -26,7 +26,7 @@ void func_8089350C(BgJyaAmishutter* this); const ActorInit Bg_Jya_Amishutter_InitVars = { ACTOR_BG_JYA_AMISHUTTER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaAmishutter), @@ -79,8 +79,8 @@ void func_808933BC(BgJyaAmishutter* this) { } void func_808933CC(BgJyaAmishutter* this) { - if (this->actor.xzDistToLink < 60.0f) { - if (fabsf(this->actor.yDistToLink) < 30.0f) { + if (this->actor.xzDistToPlayer < 60.0f) { + if (fabsf(this->actor.yDistToPlayer) < 30.0f) { func_80893428(this); } } @@ -91,7 +91,7 @@ void func_80893428(BgJyaAmishutter* this) { } void func_80893438(BgJyaAmishutter* this) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 100.0f, 3.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 100.0f, 3.0f)) { func_808934B0(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP); } else { @@ -104,7 +104,7 @@ void func_808934B0(BgJyaAmishutter* this) { } void func_808934C0(BgJyaAmishutter* this) { - if (this->actor.xzDistToLink > 300.0f) { + if (this->actor.xzDistToPlayer > 300.0f) { func_808934FC(this); } } @@ -114,7 +114,7 @@ void func_808934FC(BgJyaAmishutter* this) { } void func_8089350C(BgJyaAmishutter* this) { - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 3.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 3.0f)) { func_808933BC(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_METALDOOR_STOP); } else { 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 e8114c167a..00e0d97e28 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 @@ -26,7 +26,7 @@ static u8 sIsSpawned = false; const ActorInit Bg_Jya_Bigmirror_InitVars = { ACTOR_BG_JYA_BIGMIRROR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaBigmirror), @@ -229,11 +229,11 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 435); func_80093D84(globalCtx->state.gfxCtx); - lift = Actor_Find(&globalCtx->actorCtx, ACTOR_BG_JYA_LIFT, ACTORTYPE_BG); + lift = Actor_Find(&globalCtx->actorCtx, ACTOR_BG_JYA_LIFT, ACTORCAT_BG); if (lift != NULL) { - this->liftHeight = lift->posRot.pos.y; + this->liftHeight = lift->world.pos.y; } - func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, + func_800D1694(this->actor.world.pos.x, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, &this->actor.shape.rot); // Second float seems to be either this or 1613/1280 + 0.13: both numerators relate to the lift height Matrix_Scale(0.1f, (this->liftHeight * -(1.0f / 1280.0f)) + (973.0f / 1280.0f + 0.63f) /* 1.3901563f */, 0.1f, @@ -244,7 +244,7 @@ void BgJyaBigmirror_DrawLightBeam(Actor* thisx, GlobalContext* globalCtx) { if (lift != NULL) { if (1) {} - func_800D1694(lift->posRot.pos.x, lift->posRot.pos.y, lift->posRot.pos.z, &D_80893F4C); + func_800D1694(lift->world.pos.x, lift->world.pos.y, lift->world.pos.z, &D_80893F4C); Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_bigmirror.c", 467), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); 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 329c855db7..19be0e33ab 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 @@ -17,7 +17,7 @@ void BgJyaBlock_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Jya_Block_InitVars = { ACTOR_BG_JYA_BLOCK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(BgJyaBlock), 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 aaaf9fc72a..e22f42b739 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 @@ -18,7 +18,7 @@ void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, GlobalContext* globalC const ActorInit Bg_Jya_Bombchuiwa_InitVars = { ACTOR_BG_JYA_BOMBCHUIWA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaBombchuiwa), @@ -56,7 +56,7 @@ static ColliderJntSphInit sJntSphInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 3, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE), @@ -91,7 +91,7 @@ void BgJyaBombchuiwa_Init(Actor* thisx, GlobalContext* globalCtx) { } else { BgJyaBombchuiwa_SetupWaitForExplosion(this, globalCtx); } - Actor_SetHeight(thisx, 0.0f); + Actor_SetFocus(thisx, 0.0f); } void BgJyaBombchuiwa_Destroy(Actor* thisx, GlobalContext* globalCtx2) { @@ -111,9 +111,9 @@ void BgJyaBombchuiwa_Break(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 20; i++) { - pos.x = Rand_ZeroOne() * 10.0f + this->actor.posRot.pos.x - 10.0f; - pos.y = Rand_ZeroOne() * 40.0f + this->actor.posRot.pos.y - 20.0f; - pos.z = Rand_ZeroOne() * 50.0f + this->actor.posRot.pos.z - 25.0f; + pos.x = Rand_ZeroOne() * 10.0f + this->actor.world.pos.x - 10.0f; + pos.y = Rand_ZeroOne() * 40.0f + this->actor.world.pos.y - 20.0f; + pos.z = Rand_ZeroOne() * 50.0f + this->actor.world.pos.z - 25.0f; velocity.x = Rand_ZeroOne() * 3.0f - 0.3f; velocity.y = Rand_ZeroOne() * 18.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 15.0f; @@ -139,7 +139,7 @@ void BgJyaBombchuiwa_Break(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -300, arg5, arg6, arg7, 0, scale, 1, 15, 80, KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0); } - func_80033480(globalCtx, &this->actor.posRot.pos, 100.0f, 8, 100, 160, 0); + func_80033480(globalCtx, &this->actor.world.pos, 100.0f, 8, 100, 160, 0); } void BgJyaBombchuiwa_SetupWaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { @@ -157,7 +157,7 @@ void BgJyaBombchuiwa_WaitForExplosion(BgJyaBombchuiwa* this, GlobalContext* glob if (this->timer > 10) { BgJyaBombchuiwa_Break(this, globalCtx); BgJyaBombchuiwa_CleanUpAfterExplosion(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); } } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -176,7 +176,7 @@ void BgJyaBombchuiwa_CleanUpAfterExplosion(BgJyaBombchuiwa* this, GlobalContext* void func_808949B8(BgJyaBombchuiwa* this, GlobalContext* globalCtx) { this->timer++; if (this->timer & 4) { - func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 3, 100, 100, 0); + func_80033480(globalCtx, &this->actor.world.pos, 60.0f, 3, 100, 100, 0); } if (Math_StepToF(&this->lightRayIntensity, 1.0f, 0.028)) { BgJyaBombchuiwa_SpawnLightRay(this, globalCtx); @@ -187,8 +187,8 @@ void BgJyaBombchuiwa_SpawnLightRay(BgJyaBombchuiwa* this, GlobalContext* globalC this->actionFunc = NULL; this->lightRayIntensity = 153.0f; BgJyaBombchuiwa_SetDrawFlags(this, 4); - if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0) == NULL) { + if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0) == NULL) { // Occurrence failure osSyncPrintf("Error : Mir_Ray 発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_jya_bombchuiwa.c", 410, this->actor.params); 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 c5818724a8..a05957023a 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 @@ -13,7 +13,7 @@ void BgJyaBombiwa_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Jya_Bombiwa_InitVars = { ACTOR_BG_JYA_BOMBIWA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaBombiwa), @@ -120,9 +120,9 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) { s16 scale; for (i = 0; i < 16; i++) { - pos.x = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.posRot.pos.x) - 40.0f; - pos.y = (Rand_ZeroOne() * 140.0f) + this->dyna.actor.posRot.pos.y; - pos.z = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.posRot.pos.z) - 40.0f; + pos.x = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.x) - 40.0f; + pos.y = (Rand_ZeroOne() * 140.0f) + this->dyna.actor.world.pos.y; + pos.z = ((Rand_ZeroOne() * 80.0f) + this->dyna.actor.world.pos.z) - 40.0f; velocity.x = (Rand_ZeroOne() - 0.5f) * 10.0f; velocity.y = Rand_ZeroOne() * 12.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 10.0f; @@ -148,9 +148,9 @@ void BgJyaBombiwa_Break(BgJyaBombiwa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -400, arg5, arg6, arg7, 0, scale, 1, 20, 80, KAKERA_COLOR_NONE, OBJECT_JYA_OBJ, D_0600EDC0); } - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + 70.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + 70.0f; + pos.z = this->dyna.actor.world.pos.z; func_80033480(globalCtx, &pos, 100.0f, 0xA, 0x64, 0xA0, 1); } @@ -160,7 +160,7 @@ void BgJyaBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 f2351276aa..cfe196e3a1 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 @@ -17,7 +17,7 @@ extern UNK_TYPE D_060117D0; /* const ActorInit Bg_Jya_Cobra_InitVars = { ACTOR_BG_JYA_COBRA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaCobra), 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 0926d5e4ee..b4b230d252 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 @@ -26,7 +26,7 @@ void func_80897970(BgJyaGoroiwa* this); const ActorInit Bg_Jya_Goroiwa_InitVars = { ACTOR_BG_JYA_GOROIWA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GOROIWA, sizeof(BgJyaGoroiwa), @@ -76,9 +76,9 @@ static InitChainEntry sInitChain[] = { void func_80897970(BgJyaGoroiwa* this) { Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; - worldSphere->center.x = this->actor.posRot.pos.x; - worldSphere->center.y = (s32)(this->actor.posRot.pos.y + 59.5f); - worldSphere->center.z = this->actor.posRot.pos.z; + worldSphere->center.x = this->actor.world.pos.x; + worldSphere->center.y = (s32)(this->actor.world.pos.y + 59.5f); + worldSphere->center.z = this->actor.world.pos.z; } void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) { @@ -91,7 +91,7 @@ void func_808979C0(BgJyaGoroiwa* this, GlobalContext* globalCtx) { } void func_80897A2C(BgJyaGoroiwa* this) { - f32 posDiff = this->actor.posRot.pos.x - this->actor.pos4.x; + f32 posDiff = this->actor.world.pos.x - this->actor.prevPos.x; this->actor.shape.rot.z -= 0x10000 / (119 * M_PI) * posDiff; } @@ -103,8 +103,8 @@ void BgJyaGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { func_808979C0(this, globalCtx); this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0; CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 595.0f, &ActorShadow_DrawFunc_Circle, 9.0f); - this->actor.shape.unk_14 = 0x80; + ActorShape_Init(&this->actor.shape, 595.0f, ActorShadow_DrawCircle, 9.0f); + this->actor.shape.shadowAlpha = 128; func_80897B1C(this); } @@ -125,37 +125,37 @@ void func_80897B48(BgJyaGoroiwa* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; f32 tmpf2; s16 tmp16; - f32 tmpf1 = (-100.0f - thisx->posRot.pos.y) * 2.5f; + f32 tmpf1 = (-100.0f - thisx->world.pos.y) * 2.5f; if (tmpf1 < 0.01f) { tmpf1 = 0.01f; } thisx->speedXZ = (sqrtf(tmpf1) * this->unk_1B0); - thisx->velocity.x = (Math_SinS(thisx->posRot.rot.y) * thisx->speedXZ); + thisx->velocity.x = (Math_SinS(thisx->world.rot.y) * thisx->speedXZ); - tmpf2 = Math_CosS(thisx->posRot.rot.y) * thisx->speedXZ; + tmpf2 = Math_CosS(thisx->world.rot.y) * thisx->speedXZ; thisx->velocity.z = tmpf2; - thisx->posRot.pos.x = thisx->posRot.pos.x + thisx->velocity.x; - thisx->posRot.pos.z = thisx->posRot.pos.z + tmpf2; + thisx->world.pos.x = thisx->world.pos.x + thisx->velocity.x; + thisx->world.pos.z = thisx->world.pos.z + tmpf2; - if ((1466.0f < thisx->posRot.pos.x) && (thisx->posRot.pos.x < 1673.0f)) { - thisx->posRot.pos.y = -129.5f; + if ((1466.0f < thisx->world.pos.x) && (thisx->world.pos.x < 1673.0f)) { + thisx->world.pos.y = -129.5f; } else { - tmpf2 = 1569.0f - thisx->posRot.pos.x; + tmpf2 = 1569.0f - thisx->world.pos.x; tmpf1 = fabsf(tmpf2) - 103.0f; - thisx->posRot.pos.y = (0.38043478f * tmpf1) - 129.5f; + thisx->world.pos.y = (0.38043478f * tmpf1) - 129.5f; } if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT & ~AT_ON; - tmp16 = thisx->yawTowardsLink - thisx->posRot.rot.y; + tmp16 = thisx->yawTowardsPlayer - thisx->world.rot.y; if ((tmp16 >= -0x3FFF) && (tmp16 < 0x4000)) { - thisx->posRot.rot.y += 0x8000; + thisx->world.rot.y += 0x8000; } - func_8002F6D4(globalCtx, thisx, 2.0f, thisx->yawTowardsLink, 0.0f, 0); + func_8002F6D4(globalCtx, thisx, 2.0f, thisx->yawTowardsPlayer, 0.0f, 0); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); this->unk_1B8 = 10.0f; @@ -165,19 +165,19 @@ void func_80897B48(BgJyaGoroiwa* this, GlobalContext* globalCtx) { if (this->unk_1B4) { this->unk_1B8 -= 1.5f; - thisx->shape.unk_08 += this->unk_1B8 * 10.0f; - if (thisx->shape.unk_08 < 595.0f) { - thisx->shape.unk_08 = 595.0f; + thisx->shape.yOffset += this->unk_1B8 * 10.0f; + if (thisx->shape.yOffset < 595.0f) { + thisx->shape.yOffset = 595.0f; func_80897DDC(this); } } else { Math_StepToF(&this->unk_1B0, 1.0f, 0.04f); } - if (thisx->posRot.pos.x > 1745.0f) { - thisx->posRot.rot.y = -0x4000; - } else if (thisx->posRot.pos.x < 1393.0f) { - thisx->posRot.rot.y = 0x4000; + if (thisx->world.pos.x > 1745.0f) { + thisx->world.rot.y = -0x4000; + } else if (thisx->world.pos.x < 1393.0f) { + thisx->world.rot.y = 0x4000; } Audio_PlayActorSound2(thisx, NA_SE_EV_BIGBALL_ROLL - SFX_FLAG); @@ -206,10 +206,10 @@ void BgJyaGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->stateFlags1 & 0x300000C0)) { this->actionFunc(this, globalCtx); func_80897A2C(this); - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 59.5f; - pos.z = this->actor.posRot.pos.z; - this->actor.groundY = + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 59.5f; + pos.z = this->actor.world.pos.z; + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp38, &this->actor, &pos); func_80897970(this); if (this->collider.base.atFlags & AT_ON) { 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 e5250d1c21..5e2faf70ea 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 @@ -25,7 +25,7 @@ void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx const ActorInit Bg_Jya_Haheniron_InitVars = { ACTOR_BG_JYA_HAHENIRON, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JYA_IRON, sizeof(BgJyaHaheniron), @@ -152,13 +152,13 @@ void BgJyaHaheniron_ChairCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx) Vec3f vec; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 8.0f, 0.0f, 0x85); if ((this->actor.bgCheckFlags & 9) || ((this->collider.base.atFlags & AT_HIT) && (this->collider.base.at != NULL) && - (this->collider.base.at->type == ACTORTYPE_PLAYER))) { + (this->collider.base.at->category == ACTORCAT_PLAYER))) { vec.x = -Rand_ZeroOne() * this->actor.velocity.x; vec.y = -Rand_ZeroOne() * this->actor.velocity.y; vec.z = -Rand_ZeroOne() * this->actor.velocity.z; - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, &vec); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, &vec); Actor_Kill(&this->actor); } else if (this->timer > 60) { Actor_Kill(&this->actor); @@ -177,7 +177,7 @@ void BgJyaHaheniron_PillarCrumble(BgJyaHaheniron* this, GlobalContext* globalCtx if (this->timer >= 8) { Actor_MoveForward(&this->actor); } else if (this->timer >= 17) { - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, D_808987A0); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987A0); Actor_Kill(&this->actor); } this->actor.shape.rot.y += 0x258; @@ -190,8 +190,8 @@ void BgJyaHaheniron_SetupRubbleCollide(BgJyaHaheniron* this) { void BgJyaHaheniron_RubbleCollide(BgJyaHaheniron* this, GlobalContext* globalCtx) { if (this->timer >= 17) { - BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.posRot.pos, D_808987AC); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); + BgJyaHaheniron_SpawnFragments(globalCtx, &this->actor.world.pos, D_808987AC); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR2); Actor_Kill(&this->actor); } } 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 cafa2768a1..0a37766a4f 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 @@ -14,7 +14,7 @@ extern UNK_TYPE D_06000880; /* const ActorInit Bg_Jya_Ironobj_InitVars = { ACTOR_BG_JYA_IRONOBJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JYA_IRON, sizeof(BgJyaIronobj), 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 dcc6cb6f9f..d3162b574d 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 @@ -23,7 +23,7 @@ void func_80899A08(BgJyaKanaami* this); const ActorInit Bg_Jya_Kanaami_InitVars = { ACTOR_BG_JYA_KANAAMI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaKanaami), @@ -83,7 +83,7 @@ void func_80899880(BgJyaKanaami* this) { void func_80899894(BgJyaKanaami* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->actor.params & 0x3F) || this->unk_16A > 0) { - if (this->actor.posRot.pos.x > -1000.0f && this->unk_16A == 0) { + if (this->actor.world.pos.x > -1000.0f && this->unk_16A == 0) { func_800800F8(globalCtx, 0xD7A, -0x63, &this->actor, 0); } this->unk_16A += 1; @@ -102,7 +102,7 @@ void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) { s32 pad[2]; s32 var; this->unk_168 += 0x20; - if (Math_ScaledStepToS(&this->actor.posRot.rot.x, 0x4000, this->unk_168)) { + if (Math_ScaledStepToS(&this->actor.world.rot.x, 0x4000, this->unk_168)) { func_80899A08(this); Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRAP_BOUND); var = Quake_Add(ACTIVE_CAM, 3); @@ -114,7 +114,7 @@ void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) { void func_80899A08(BgJyaKanaami* this) { this->actionFunc = 0; - this->actor.posRot.rot.x = 0x4000; + this->actor.world.rot.x = 0x4000; } void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -123,7 +123,7 @@ void BgJyaKanaami_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); } - this->actor.shape.rot.x = this->actor.posRot.rot.x; + this->actor.shape.rot.x = this->actor.world.rot.x; } void BgJyaKanaami_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 8139f87a0c..db6549f6db 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 @@ -27,7 +27,7 @@ static s16 sIsSpawned = false; const ActorInit Bg_Jya_Lift_InitVars = { ACTOR_BG_JYA_LIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaLift), @@ -94,7 +94,7 @@ void BgJyaLift_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgJyaLift_SetInitPosY(BgJyaLift* this) { this->actionFunc = BgJyaLift_DelayMove; - this->dyna.actor.posRot.pos.y = 1613.0f; + this->dyna.actor.world.pos.y = 1613.0f; this->moveDelay = 0; } @@ -118,8 +118,8 @@ void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.velocity.y, 4.0f, 0.1f, 1.0f, 0.0f); tempVelocity = (this->dyna.actor.velocity.y < 0.2f) ? 0.2f : this->dyna.actor.velocity.y; - distFromBottom = Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f); - if ((this->dyna.actor.posRot.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.pos4.y)) { + distFromBottom = Math_SmoothStepToF(&this->dyna.actor.world.pos.y, 973.0f, 0.1f, tempVelocity, 0.2f); + if ((this->dyna.actor.world.pos.y < 1440.0f) && (1440.0f <= this->dyna.actor.prevPos.y)) { func_8005B1A4(ACTIVE_CAM); } if (fabsf(distFromBottom) < 0.001f) { @@ -132,7 +132,7 @@ void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx) { void BgJyaLift_SetFinalPosY(BgJyaLift* this) { this->actionFunc = NULL; - this->dyna.actor.posRot.pos.y = 973.0f; + this->dyna.actor.world.pos.y = 973.0f; } void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx) { 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 72dc49dd3b..f7bb8ff55f 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 @@ -29,7 +29,7 @@ typedef struct { const ActorInit Bg_Jya_Megami_InitVars = { ACTOR_BG_JYA_MEGAMI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaMegami), @@ -164,7 +164,7 @@ void func_8089A41C(BgJyaMegami* this, GlobalContext* globalCtx, f32 arg2) { for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { if (Rand_ZeroOne() < arg2) { - Math_Vec3f_Sum(&this->dyna.actor.posRot.pos, &sPiecesInit[i].unk_00, &sp50); + Math_Vec3f_Sum(&this->dyna.actor.world.pos, &sPiecesInit[i].unk_00, &sp50); sp50.z += 15.0f; func_8089A1DC(globalCtx, &sp50, &D_8089B184, 1, 0); } @@ -180,7 +180,7 @@ void BgJyaMegami_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetHeight(&this->dyna.actor, -50.0f); + Actor_SetFocus(&this->dyna.actor, -50.0f); BgJyaMegami_SetupDetectLight(this); } } @@ -212,7 +212,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, GlobalContext* globalCtx) { if (this->lightTimer > 40) { Flags_SetSwitch(globalCtx, this->dyna.actor.params & 0x3F); BgJyaMegami_SetupExplode(this); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 100, NA_SE_EV_FACE_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); func_800800F8(globalCtx, 0xD70, -0x63, &this->dyna.actor, 0); } else { if (this->lightTimer < 8) { @@ -235,7 +235,7 @@ void BgJyaMegami_SetupExplode(BgJyaMegami* this) { this->actionFunc = BgJyaMegami_Explode; for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { - Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.posRot.pos); + Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.world.pos); this->pieces[i].vel.x = sPiecesInit[i].velX; } this->explosionTimer = 0; @@ -250,7 +250,7 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) { this->explosionTimer++; if (this->explosionTimer == 30) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 100, NA_SE_EV_FACE_BREAKDOWN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_BREAKDOWN); } for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { @@ -280,15 +280,15 @@ void BgJyaMegami_Explode(BgJyaMegami* this, GlobalContext* globalCtx) { if ((this->explosionTimer % 4 == 0) && (this->explosionTimer > 30) && (this->explosionTimer < 80) && (this->explosionTimer > 40)) { - sp8C.x = ((Rand_ZeroOne() - 0.5f) * 90.0f) + this->dyna.actor.posRot.pos.x; - sp8C.y = (this->dyna.actor.posRot.pos.y - (Rand_ZeroOne() * 80.0f)) - 20.0f; - sp8C.z = this->dyna.actor.posRot.pos.z - ((Rand_ZeroOne() - 0.5f) * 50.0f); + sp8C.x = ((Rand_ZeroOne() - 0.5f) * 90.0f) + this->dyna.actor.world.pos.x; + sp8C.y = (this->dyna.actor.world.pos.y - (Rand_ZeroOne() * 80.0f)) - 20.0f; + sp8C.z = this->dyna.actor.world.pos.z - ((Rand_ZeroOne() - 0.5f) * 50.0f); func_8089A1DC(globalCtx, &sp8C, &sVec, 1, 0); } if (this->explosionTimer < ARRAY_COUNT(this->pieces)) { - sp8C.x = this->dyna.actor.posRot.pos.x; - sp8C.y = this->dyna.actor.posRot.pos.y - 60.0f; - sp8C.z = this->dyna.actor.posRot.pos.z; + sp8C.x = this->dyna.actor.world.pos.x; + sp8C.y = this->dyna.actor.world.pos.y - 60.0f; + sp8C.z = this->dyna.actor.world.pos.z; func_80033480(globalCtx, &sp8C, 100.0f, 1, 150, 100, 1); } if (this->explosionTimer == 60) { 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 59b640a4d7..a9d78688b1 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 @@ -26,7 +26,7 @@ static f32 D_8089B9C0[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; const ActorInit Bg_Jya_Zurerukabe_InitVars = { ACTOR_BG_JYA_ZURERUKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_JYA_OBJ, sizeof(BgJyaZurerukabe), @@ -85,7 +85,7 @@ void func_8089B4C8(BgJyaZurerukabe* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < ARRAY_COUNT(D_8089BA18); i++) { - f32 posY = player->actor.posRot.pos.y; + f32 posY = player->actor.world.pos.y; if ((posY >= D_8089BA18[i][0]) && (posY <= D_8089BA18[i][1])) { break; } @@ -118,7 +118,7 @@ void BgJyaZurerukabe_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); for (i = 0; i < ARRAY_COUNT(D_8089B9F0); i++) { - if (fabsf(D_8089B9F0[i] - this->dyna.actor.initPosRot.pos.y) < 1.0f) { + if (fabsf(D_8089B9F0[i] - this->dyna.actor.home.pos.y) < 1.0f) { this->unk_168 = i; break; } @@ -166,7 +166,7 @@ void func_8089B80C(BgJyaZurerukabe* this) { } void func_8089B870(BgJyaZurerukabe* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x + (this->unk_16C * 75), + if (Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + (this->unk_16C * 75), D_8089BA08[this->unk_168])) { func_8089B7B4(this); } 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 235b6befe0..8064bc9110 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 @@ -17,7 +17,7 @@ void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Eye_InitVars = { ACTOR_BG_MENKURI_EYE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MENKURI_OBJECTS, sizeof(BgMenkuriEye), @@ -68,9 +68,9 @@ void BgMenkuriEye_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); - this->collider.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y; - this->collider.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; colliderList = this->collider.elements; colliderList->dim.worldSphere.radius = colliderList->dim.modelSphere.radius; if (!Flags_GetSwitch(globalCtx, this->actor.params)) { @@ -100,7 +100,7 @@ void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx) { } } if ((this->collider.base.acFlags & AC_HIT) && - (ABS((s16)(this->collider.base.ac->posRot.rot.y - this->actor.shape.rot.y)) > 0x5000)) { + (ABS((s16)(this->collider.base.ac->world.rot.y - this->actor.shape.rot.y)) > 0x5000)) { this->collider.base.acFlags &= ~AC_HIT; if (this->framesUntilDisable == -1) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_AMOS_DAMAGE); @@ -116,7 +116,7 @@ void BgMenkuriEye_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->framesUntilDisable == -1) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -132,8 +132,8 @@ void BgMenkuriEye_Draw(Actor* thisx, GlobalContext* globalCtx) { } else { gDPSetEnvColor(POLY_XLU_DISP++, 200, 0, 0, 255); } - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, 1); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_menkuri_eye.c", 331), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); 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 eea442bce0..228e283894 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 @@ -17,7 +17,7 @@ void BgMenkuriKaiten_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Kaiten_InitVars = { ACTOR_BG_MENKURI_KAITEN, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MENKURI_OBJECTS, sizeof(BgMenkuriKaiten), 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 e61c58ee36..76668f9744 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 @@ -17,7 +17,7 @@ void BgMenkuriNisekabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Menkuri_Nisekabe_InitVars = { ACTOR_BG_MENKURI_NISEKABE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MENKURI_OBJECTS, sizeof(BgMenkuriNisekabe), 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 b8c7153a35..cebddb99a5 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 @@ -21,7 +21,7 @@ void BgMizuBwall_DoNothing(BgMizuBwall* this, GlobalContext* globalCtx); const ActorInit Bg_Mizu_Bwall_InitVars = { ACTOR_BG_MIZU_BWALL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuBwall), @@ -173,7 +173,7 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, D_8089D854); - this->yRot = this->dyna.actor.posRot.pos.y; + this->yRot = this->dyna.actor.world.pos.y; this->dList = sDLists[(u16)this->dyna.actor.params & 0xF]; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); CollisionHeader_GetVirtual(sColHeaders[(u16)this->dyna.actor.params & 0xF], &colHeader); @@ -205,9 +205,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } @@ -241,9 +241,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { offset.y = sTrisInitRutoWall.elements[i].dim.vtx[j].y; offset.z = sTrisInitRutoWall.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } @@ -279,9 +279,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } @@ -317,9 +317,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } @@ -355,9 +355,9 @@ void BgMizuBwall_Init(Actor* thisx, GlobalContext* globalCtx) { offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; offset.z = sTrisInitFloor.elements[i].dim.vtx[j].z + 2.0f; BgMizuBwall_RotateVec3f(&vtx[j], &offset, sin, cos); - vtx[j].x += this->dyna.actor.posRot.pos.x; - vtx[j].y += this->dyna.actor.posRot.pos.y; - vtx[j].z += this->dyna.actor.posRot.pos.z; + vtx[j].x += this->dyna.actor.world.pos.x; + vtx[j].y += this->dyna.actor.world.pos.y; + vtx[j].z += this->dyna.actor.world.pos.z; } Collider_SetTrisVertices(&this->collider, i, &vtx[0], &vtx[1], &vtx[2]); } @@ -414,7 +414,7 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, GlobalContext* globalCtx) { s32 pad; s16 rand1; s16 rand2; - Vec3f* thisPos = &this->dyna.actor.posRot.pos; + Vec3f* thisPos = &this->dyna.actor.world.pos; Vec3f debrisPos; f32 tempx; f32 tempz; @@ -472,7 +472,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WALL_BROKEN); Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->actionFunc = BgMizuBwall_Break; - } else if (this->dyna.actor.xzDistToLink < 600.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } 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 b52688f22f..d0dfd33554 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 @@ -12,7 +12,7 @@ void BgMizuMovebg_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Mizu_Movebg_InitVars = { ACTOR_BG_MIZU_MOVEBG, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuMovebg), 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 402a37fc7e..2150cacc0e 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 @@ -19,7 +19,7 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, GlobalContext* globalCtx const ActorInit Bg_Mizu_Shutter_InitVars = { ACTOR_BG_MIZU_SHUTTER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuShutter), @@ -55,22 +55,22 @@ void BgMizuShutter_Init(BgMizuShutter* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(sCollisionHeaders[SIZE_PARAM], &sp30); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, sp30); if ((SIZE_PARAM == BGMIZUSHUTTER_SMALL) || (SIZE_PARAM == BGMIZUSHUTTER_LARGE)) { - this->closedPos = this->dyna.actor.posRot.pos; + this->closedPos = this->dyna.actor.world.pos; this->timer = 0; this->timerMax = TIMER_PARAM * 20; - Matrix_RotateY(this->dyna.actor.posRot.rot.y * (M_PI / 0x8000), 0); - Matrix_RotateX(this->dyna.actor.posRot.rot.x * (M_PI / 0x8000), 1); - Matrix_RotateZ(this->dyna.actor.posRot.rot.z * (M_PI / 0x8000), 1); + Matrix_RotateY(this->dyna.actor.world.rot.y * (M_PI / 0x8000), 0); + Matrix_RotateX(this->dyna.actor.world.rot.x * (M_PI / 0x8000), 1); + Matrix_RotateZ(this->dyna.actor.world.rot.z * (M_PI / 0x8000), 1); Matrix_MultVec3f(&sDisplacements[SIZE_PARAM], &this->openPos); - this->openPos.x += this->dyna.actor.posRot.pos.x; - this->openPos.y += this->dyna.actor.posRot.pos.y; - this->openPos.z += this->dyna.actor.posRot.pos.z; + this->openPos.x += this->dyna.actor.world.pos.x; + this->openPos.y += this->dyna.actor.world.pos.y; + this->openPos.z += this->dyna.actor.world.pos.z; if (this->timerMax != 0x3F * 20) { Flags_UnsetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F); - this->dyna.actor.posRot.pos = this->closedPos; + this->dyna.actor.world.pos = this->closedPos; } if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) { - this->dyna.actor.posRot.pos = this->openPos; + this->dyna.actor.world.pos = this->openPos; this->actionFunc = BgMizuShutter_WaitForTimer; } else { this->actionFunc = BgMizuShutter_WaitForSwitch; @@ -87,7 +87,7 @@ void BgMizuShutter_Destroy(BgMizuShutter* thisx, GlobalContext* globalCtx) { void BgMizuShutter_WaitForSwitch(BgMizuShutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) { - if (ABS(this->dyna.actor.posRot.rot.x) > 0x2C60) { + if (ABS(this->dyna.actor.world.rot.x) > 0x2C60) { func_800800F8(globalCtx, 0x119E, -0x63, &this->dyna.actor, 0); } else { func_80080480(globalCtx, &this->dyna.actor); @@ -106,23 +106,23 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, GlobalContext* globalCtx void BgMizuShutter_Move(BgMizuShutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, (u16)this->dyna.actor.params & 0x3F)) { - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f); - if ((this->dyna.actor.posRot.pos.x == this->openPos.x) && (this->dyna.actor.posRot.pos.y == this->openPos.y) && - (this->dyna.actor.posRot.pos.z == this->openPos.z)) { + Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f); + if ((this->dyna.actor.world.pos.x == this->openPos.x) && (this->dyna.actor.world.pos.y == this->openPos.y) && + (this->dyna.actor.world.pos.z == this->openPos.z)) { this->timer = this->timerMax; this->actionFunc = BgMizuShutter_WaitForTimer; } } else { Math_SmoothStepToF(&this->maxSpeed, 20.0f, 1.0f, 3.0f, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.x, this->closedPos.x, 1.0f, this->maxSpeed, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->closedPos.y, 1.0f, this->maxSpeed, 0.1f); - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.z, this->closedPos.z, 1.0f, this->maxSpeed, 0.1f); - if ((this->dyna.actor.posRot.pos.x == this->closedPos.x) && - (this->dyna.actor.posRot.pos.y == this->closedPos.y) && - (this->dyna.actor.posRot.pos.z == this->closedPos.z)) { - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0x78, 0x14, 0xA); + Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->closedPos.x, 1.0f, this->maxSpeed, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->closedPos.y, 1.0f, this->maxSpeed, 0.1f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->closedPos.z, 1.0f, this->maxSpeed, 0.1f); + if ((this->dyna.actor.world.pos.x == this->closedPos.x) && + (this->dyna.actor.world.pos.y == this->closedPos.y) && + (this->dyna.actor.world.pos.z == this->closedPos.z)) { + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0x78, 0x14, 0xA); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); this->actionFunc = BgMizuShutter_WaitForSwitch; } 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 25545d2d00..50aa184706 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 @@ -17,7 +17,7 @@ void BgMizuUzu_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Mizu_Uzu_InitVars = { ACTOR_BG_MIZU_UZU, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuUzu), 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 1f03aeb282..760c5aceff 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 @@ -34,7 +34,7 @@ static WaterLevel sWaterLevels[] = { const ActorInit Bg_Mizu_Water_InitVars = { ACTOR_BG_MIZU_WATER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MIZU_OBJECTS, sizeof(BgMizuWater), @@ -101,7 +101,7 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) { this->type = this->actor.params & 0xFF; this->switchFlag = (this->actor.params >> 8) & 0xFF; Actor_ProcessInitChain(&this->actor, sInitChain); - initialActorY = this->actor.posRot.pos.y; + initialActorY = this->actor.world.pos.y; this->baseY = initialActorY; this->targetY = initialActorY; @@ -112,8 +112,8 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) { Flags_GetSwitch(globalCtx, 0x1D), Flags_GetSwitch(globalCtx, 0x1E)); } waterLevelActionIndex = BgMizuWater_GetWaterLevelActionIndex(-1, globalCtx); - this->actor.posRot.pos.y = sWaterLevels[waterLevelActionIndex].yDiff + this->baseY; - BgMizuWater_SetWaterBoxesHeight(waterBoxes, this->actor.posRot.pos.y); + this->actor.world.pos.y = sWaterLevels[waterLevelActionIndex].yDiff + this->baseY; + BgMizuWater_SetWaterBoxesHeight(waterBoxes, this->actor.world.pos.y); this->actor.params = sWaterLevels[waterLevelActionIndex].switchFlag; Flags_UnsetSwitch(globalCtx, 0x1C); Flags_UnsetSwitch(globalCtx, 0x1D); @@ -131,31 +131,31 @@ void BgMizuWater_Init(Actor* thisx, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, 0x1C); break; } - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; break; case 1: break; case 2: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - this->actor.posRot.pos.y = this->baseY + 85.0f; + this->actor.world.pos.y = this->baseY + 85.0f; } - waterBoxes[6].ySurface = this->actor.posRot.pos.y; + waterBoxes[6].ySurface = this->actor.world.pos.y; break; case 3: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - this->actor.posRot.pos.y = this->baseY + 110.0f; + this->actor.world.pos.y = this->baseY + 110.0f; if (1) {} - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; } - waterBoxes[8].ySurface = this->actor.posRot.pos.y; + waterBoxes[8].ySurface = this->actor.world.pos.y; break; case 4: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - this->actor.posRot.pos.y = this->baseY + 160.0f; + this->actor.world.pos.y = this->baseY + 160.0f; if (1) {} - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; } - waterBoxes[16].ySurface = this->actor.posRot.pos.y; + waterBoxes[16].ySurface = this->actor.world.pos.y; break; } @@ -209,7 +209,7 @@ void BgMizuWater_WaitForAction(BgMizuWater* this, GlobalContext* globalCtx) { } } - if (this->targetY != this->actor.posRot.pos.y) { + if (this->targetY != this->actor.world.pos.y) { this->actionFunc = BgMizuWater_ChangeWaterLevel; } } @@ -236,12 +236,12 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { Flags_UnsetSwitch(globalCtx, prevSwitchFlag); } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 5.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 5.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; func_80106CCC(globalCtx); } - BgMizuWater_SetWaterBoxesHeight(globalCtx->colCtx.colHeader->waterBoxes, this->actor.posRot.pos.y); + BgMizuWater_SetWaterBoxesHeight(globalCtx->colCtx.colHeader->waterBoxes, this->actor.world.pos.y); break; case 1: break; @@ -251,11 +251,11 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { } else { this->targetY = this->baseY; } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } - waterBoxes[6].ySurface = this->actor.posRot.pos.y; + waterBoxes[6].ySurface = this->actor.world.pos.y; break; case 3: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { @@ -263,11 +263,11 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { } else { this->targetY = this->baseY; } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } - waterBoxes[8].ySurface = this->actor.posRot.pos.y; + waterBoxes[8].ySurface = this->actor.world.pos.y; break; case 4: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { @@ -275,18 +275,18 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, GlobalContext* globalCtx) { } else { this->targetY = this->baseY; } - if (Math_StepToF(&this->actor.posRot.pos.y, this->targetY, 1.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 1.0f)) { globalCtx->unk_11D30[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; } - waterBoxes[16].ySurface = this->actor.posRot.pos.y; + waterBoxes[16].ySurface = this->actor.world.pos.y; break; } - if (this->targetY < this->actor.posRot.pos.y) { + if (this->targetY < this->actor.world.pos.y) { func_800AA000(0.0f, 0x78, 0x14, 0xA); func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); - } else if (this->targetY > this->actor.posRot.pos.y) { + } else if (this->targetY > this->actor.world.pos.y) { func_800AA000(0.0f, 0x78, 0x14, 0xA); func_8002F948(&this->actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } @@ -305,7 +305,7 @@ void BgMizuWater_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->type == 0) { - posY = this->actor.posRot.pos.y; + posY = this->actor.world.pos.y; unk0 = 0; unk1 = 0; if (posY < -15.0f) { 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 4bac9fa56c..a41cabb3e0 100644 --- a/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c +++ b/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.c @@ -20,7 +20,7 @@ void func_808A0920(BgMjin* this, GlobalContext* globalCtx); const ActorInit Bg_Mjin_InitVars = { ACTOR_BG_MJIN, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgMjin), 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 cc7960212b..9a853a8225 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 @@ -33,7 +33,7 @@ extern Gfx D_06001E50[]; const ActorInit Bg_Mori_Bigst_InitVars = { ACTOR_BG_MORI_BIGST, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriBigst), @@ -77,7 +77,7 @@ void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params, Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F), Flags_GetTempClear(globalCtx, this->dyna.actor.room), Flags_GetClear(globalCtx, this->dyna.actor.room), - PLAYER->actor.posRot.pos.y); + PLAYER->actor.world.pos.y); BgMoriBigst_InitDynapoly(this, globalCtx, &D_0600221C, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX); @@ -89,11 +89,11 @@ void BgMoriBigst_Init(Actor* thisx, GlobalContext* globalCtx) { return; } if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 270.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 270.0f; } - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); BgMoriBigst_SetupWaitForMoriTex(this, globalCtx); } @@ -113,7 +113,7 @@ void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIndex)) { thisx->draw = BgMoriBigst_Draw; - if (Flags_GetClear(globalCtx, thisx->room) && (PLAYER->actor.posRot.pos.y > 700.0f)) { + if (Flags_GetClear(globalCtx, thisx->room) && (PLAYER->actor.world.pos.y > 700.0f)) { if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) { BgMoriBigst_SetupDone(this, globalCtx); } else { @@ -138,7 +138,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, GlobalContext* globalCtx) -3320.0f, 0, 0, 0, 1); if (stalfos != NULL) { this->dyna.actor.child = NULL; - this->dyna.actor.initPosRot.rot.z++; + this->dyna.actor.home.rot.z++; } else { // Second Stalfos failure osSyncPrintf("Warning : 第2スタルフォス発生失敗\n"); @@ -149,8 +149,7 @@ void BgMoriBigst_SetupStalfosFight(BgMoriBigst* this, GlobalContext* globalCtx) void BgMoriBigst_StalfosFight(BgMoriBigst* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->dyna.actor.initPosRot.rot.z == 0) && - ((this->dyna.actor.initPosRot.pos.y - 5.0f) <= PLAYER->actor.posRot.pos.y)) { + if ((this->dyna.actor.home.rot.z == 0) && ((this->dyna.actor.home.pos.y - 5.0f) <= PLAYER->actor.world.pos.y)) { BgMoriBigst_SetupFall(this, globalCtx); func_800800F8(globalCtx, 0xC94, 0x48, &this->dyna.actor, 0); } @@ -162,8 +161,8 @@ void BgMoriBigst_SetupFall(BgMoriBigst* this, GlobalContext* globalCtx) { void BgMoriBigst_Fall(BgMoriBigst* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - if (this->dyna.actor.posRot.pos.y <= this->dyna.actor.initPosRot.pos.y) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + if (this->dyna.actor.world.pos.y <= this->dyna.actor.home.pos.y) { + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; BgMoriBigst_SetupLanding(this, globalCtx); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); func_800800F8(globalCtx, 0x3FC, 8, &this->dyna.actor, 0); @@ -199,7 +198,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC -3383.0f, 0, 0, 0, 5); if (stalfos1 != NULL) { this->dyna.actor.child = NULL; - this->dyna.actor.initPosRot.rot.z++; + this->dyna.actor.home.rot.z++; } else { // Warning: 3-1 Stalfos failure osSyncPrintf("Warning : 第3-1スタルフォス発生失敗\n"); @@ -208,7 +207,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC -3260.0f, 0, 0, 0, 5); if (stalfos2 != NULL) { this->dyna.actor.child = NULL; - this->dyna.actor.initPosRot.rot.z++; + this->dyna.actor.home.rot.z++; } else { // Warning: 3-2 Stalfos failure osSyncPrintf("Warning : 第3-2スタルフォス発生失敗\n"); @@ -217,7 +216,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, GlobalContext* globalC } void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, GlobalContext* globalCtx) { - if ((this->dyna.actor.initPosRot.rot.z == 0) && !Player_InCsMode(globalCtx)) { + if ((this->dyna.actor.home.rot.z == 0) && !Player_InCsMode(globalCtx)) { Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); BgMoriBigst_SetupDone(this, globalCtx); } @@ -231,7 +230,7 @@ void BgMoriBigst_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgMoriBigst* this = THIS; - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); if (this->waitTimer > 0) { this->waitTimer--; } 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 a435ef5977..425651359d 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 @@ -22,7 +22,7 @@ static s16 sIsSpawned = false; const ActorInit Bg_Mori_Elevator_InitVars = { ACTOR_BG_MORI_ELEVATOR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriElevator), @@ -129,7 +129,7 @@ void BgMoriElevator_Destroy(Actor* thisx, GlobalContext* globalCtx) { s32 BgMoriElevator_IsPlayerRiding(BgMoriElevator* this, GlobalContext* globalCtx) { return ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2) && - ((PLAYER->actor.posRot.pos.y - this->dyna.actor.posRot.pos.y) < 80.0f)); + ((PLAYER->actor.world.pos.y - this->dyna.actor.world.pos.y) < 80.0f)); } void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) { @@ -140,7 +140,7 @@ void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, GlobalContext* globalCtx if (Object_IsLoaded(&globalCtx->objectCtx, this->moriTexObjIndex)) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { if (globalCtx->roomCtx.curRoom.num == 2) { - this->dyna.actor.posRot.pos.y = 73.0f; + this->dyna.actor.world.pos.y = 73.0f; BgMoriElevator_SetupSetPosition(this); } else { // Error: Forest Temple obj elevator Room setting is dangerous @@ -161,7 +161,7 @@ void BgMoriElevator_MoveIntoGround(BgMoriElevator* this, GlobalContext* globalCt f32 distToTarget; func_808A1800(&this->dyna.actor.velocity.y, 2.0f, 0.05f, 1.0f, 0.0f); - distToTarget = func_808A1800(&this->dyna.actor.posRot.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); + distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 73.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); if (fabsf(distToTarget) < 0.001f) { BgMoriElevator_SetupSetPosition(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); @@ -180,7 +180,7 @@ void BgMoriElevator_MoveAboveGround(BgMoriElevator* this, GlobalContext* globalC f32 distToTarget; func_808A1800(&this->dyna.actor.velocity.y, 2.0f, 0.05f, 1.0f, 0.0f); - distToTarget = func_808A1800(&this->dyna.actor.posRot.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); + distToTarget = func_808A1800(&this->dyna.actor.world.pos.y, 233.0f, 0.08f, this->dyna.actor.velocity.y, 1.5f); if (fabsf(distToTarget) < 0.001f) { BgMoriElevator_SetupSetPosition(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); @@ -207,10 +207,10 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, GlobalContext* globalCtx) // Error:Forest Temple obj elevator Room setting is dangerous(% s % d) osSyncPrintf("Error : 森の神殿 obj elevator 部屋設定が危険(%s %d)\n", "../z_bg_mori_elevator.c", 479); } - } else if ((globalCtx->roomCtx.curRoom.num == 2) && (this->dyna.actor.posRot.pos.y < -275.0f)) { + } else if ((globalCtx->roomCtx.curRoom.num == 2) && (this->dyna.actor.world.pos.y < -275.0f)) { this->targetY = 233.0f; BgMoriElevator_StopMovement(this); - } else if ((globalCtx->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.posRot.pos.y)) { + } else if ((globalCtx->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.world.pos.y)) { this->targetY = -779.0f; BgMoriElevator_StopMovement(this); } else if ((globalCtx->roomCtx.curRoom.num == 2) && Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F) && @@ -233,7 +233,7 @@ void func_808A2008(BgMoriElevator* this, GlobalContext* globalCtx) { f32 distTo; func_808A1800(&this->dyna.actor.velocity.y, 12.0f, 0.1f, 1.0f, 0.0f); - distTo = func_808A1800(&this->dyna.actor.posRot.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f); + distTo = func_808A1800(&this->dyna.actor.world.pos.y, this->targetY, 0.1f, this->dyna.actor.velocity.y, 0.3f); if (fabsf(distTo) < 0.001f) { BgMoriElevator_SetupSetPosition(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ELEVATOR_STOP); 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 e481ee3289..060f8b2991 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 @@ -31,7 +31,7 @@ extern Gfx D_06004770[]; const ActorInit Bg_Mori_Hashigo_InitVars = { ACTOR_BG_MORI_HASHIGO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriHashigo), @@ -69,12 +69,9 @@ static ColliderJntSphInit sJntSphInit = { }; static InitChainEntry sInitChainClasp[] = { - ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 3, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 40, ICHAIN_CONTINUE), - ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), + ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 40, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; static InitChainEntry sInitChainLadder[] = { @@ -108,9 +105,9 @@ void BgMoriHashigo_InitCollider(BgMoriHashigo* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.elements[0].dim.worldSphere.center.x = (s16)this->dyna.actor.posRot.pos.x; - this->collider.elements[0].dim.worldSphere.center.y = (s16)this->dyna.actor.posRot.pos.y + 21; - this->collider.elements[0].dim.worldSphere.center.z = (s16)this->dyna.actor.posRot.pos.z; + this->collider.elements[0].dim.worldSphere.center.x = (s16)this->dyna.actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = (s16)this->dyna.actor.world.pos.y + 21; + this->collider.elements[0].dim.worldSphere.center.z = (s16)this->dyna.actor.world.pos.z; this->collider.elements[0].dim.worldSphere.radius = 19; } @@ -123,13 +120,13 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) { cs = Math_CosS(this->dyna.actor.shape.rot.y); sn = Math_SinS(this->dyna.actor.shape.rot.y); - pos.x = 6.0f * sn + this->dyna.actor.posRot.pos.x; - pos.y = -210.0f + this->dyna.actor.posRot.pos.y; - pos.z = 6.0f * cs + this->dyna.actor.posRot.pos.z; + pos.x = 6.0f * sn + this->dyna.actor.world.pos.x; + pos.y = -210.0f + this->dyna.actor.world.pos.y; + pos.z = 6.0f * cs + this->dyna.actor.world.pos.z; ladder = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_MORI_HASHIGO, pos.x, pos.y, - pos.z, this->dyna.actor.posRot.rot.x, this->dyna.actor.posRot.rot.y, - this->dyna.actor.posRot.rot.z, 0); + pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, + this->dyna.actor.world.rot.z, 0); if (ladder != NULL) { return true; } else { @@ -143,7 +140,7 @@ s32 BgMoriHashigo_SpawnLadder(BgMoriHashigo* this, GlobalContext* globalCtx) { s32 BgMoriHashigo_InitClasp(BgMoriHashigo* this, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChainClasp); this->dyna.actor.flags |= 1; - Actor_SetHeight(&this->dyna.actor, 55.0f); + Actor_SetFocus(&this->dyna.actor, 55.0f); BgMoriHashigo_InitCollider(this, globalCtx); if ((this->dyna.actor.params == -1) && !BgMoriHashigo_SpawnLadder(this, globalCtx)) { return false; @@ -257,12 +254,12 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, GlobalContext* globalCtx) { if (this->bounceCounter >= ARRAY_COUNT(bounceSpeed)) { BgMoriHashigo_SetupLadderRest(this); } else { - func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); thisx->velocity.y = bounceSpeed[this->bounceCounter]; this->bounceCounter++; } } else { - func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 0x1C); } } @@ -270,7 +267,7 @@ void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this) { this->actionFunc = NULL; this->dyna.actor.gravity = 0.0f; this->dyna.actor.velocity.y = 0.0f; - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } void BgMoriHashigo_Update(Actor* thisx, GlobalContext* globalCtx) { 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 8947b7a110..29c4555ade 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 @@ -27,7 +27,7 @@ extern CollisionHeader D_060089E0; const ActorInit Bg_Mori_Hashira4_InitVars = { ACTOR_BG_MORI_HASHIRA4, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriHashira4), @@ -95,7 +95,7 @@ void BgMoriHashira4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->dyna.actor); return; } - Actor_SetHeight(&this->dyna.actor, 50.0f); + Actor_SetFocus(&this->dyna.actor, 50.0f); BgMoriHashira4_SetupWaitForMoriTex(this); // (4 pillars of the Forest Temple) Bank danger osSyncPrintf("(森の神殿 4本柱)(arg_data 0x%04x)\n", this->dyna.actor.params); @@ -130,7 +130,7 @@ void BgMoriHashira4_SetupPillarsRotate(BgMoriHashira4* this) { } void BgMoriHashira4_PillarsRotate(BgMoriHashira4* this, GlobalContext* globalCtx) { - this->dyna.actor.shape.rot.y = this->dyna.actor.posRot.rot.y += 0x96; + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y += 0x96; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_ROLL_STAND_2 - SFX_FLAG); } @@ -147,7 +147,7 @@ void BgMoriHashira4_GateWait(BgMoriHashira4* this, GlobalContext* globalCtx) { } void BgMoriHashira4_GateOpen(BgMoriHashira4* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 10.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 10.0f)) { Actor_Kill(&this->dyna.actor); } } 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 20db1be8b6..78ff4335a7 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 @@ -26,7 +26,7 @@ static s16 D_808A43E0 = -1; const ActorInit Bg_Mori_Hineri_InitVars = { ACTOR_BG_MORI_HINERI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgMoriHineri), @@ -162,8 +162,8 @@ void BgMoriHineri_DoNothing(BgMoriHineri* this, GlobalContext* globalCtx) { } void BgMoriHineri_SpawnBossKeyChest(BgMoriHineri* this, GlobalContext* globalCtx) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->dyna.actor.posRot.pos.x + 147.0f, - this->dyna.actor.posRot.pos.y + -245.0f, this->dyna.actor.posRot.pos.z + -453.0f, 0, 0x4000, 0, 0x27EE); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->dyna.actor.world.pos.x + 147.0f, + this->dyna.actor.world.pos.y + -245.0f, this->dyna.actor.world.pos.z + -453.0f, 0, 0x4000, 0, 0x27EE); this->actionFunc = BgMoriHineri_DoNothing; } @@ -171,7 +171,7 @@ void func_808A3C8C(BgMoriHineri* this, GlobalContext* globalCtx) { f32 f0; Player* player = PLAYER; - f0 = 1100.0f - (player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z); + f0 = 1100.0f - (player->actor.world.pos.z - this->dyna.actor.world.pos.z); this->dyna.actor.shape.rot.z = CLAMP(f0, 0.0f, 1000.0f) * 16.384f; Camera_ChangeSetting(globalCtx->cameraPtrs[0], CAM_SET_DUNGEON1); if (this->dyna.actor.params != 0) { @@ -215,7 +215,7 @@ void func_808A3E54(BgMoriHineri* this, GlobalContext* globalCtx) { D_808A43E0 = -1; } } - if ((D_808A43E0 > 0) && ((ACTIVE_CAM->eye.z - this->dyna.actor.posRot.pos.z) < 1100.0f)) { + if ((D_808A43E0 > 0) && ((ACTIVE_CAM->eye.z - this->dyna.actor.world.pos.z) < 1100.0f)) { func_8002F948(&this->dyna.actor, NA_SE_EV_FLOOR_ROLLING - SFX_FLAG); } } 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 f6eaec9da8..d43f5c1a87 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 @@ -26,7 +26,7 @@ static s16 sIsSpawned = false; const ActorInit Bg_Mori_Idomizu_InitVars = { ACTOR_BG_MORI_IDOMIZU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriIdomizu), @@ -59,14 +59,14 @@ void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = 1.1f; this->actor.scale.y = 1.0f; this->actor.scale.z = 1.0f; - this->actor.posRot.pos.x = 119.0f; - this->actor.posRot.pos.z = -1820.0f; + this->actor.world.pos.x = 119.0f; + this->actor.world.pos.z = -1820.0f; this->prevSwitchFlagSet = Flags_GetSwitch(globalCtx, this->actor.params & 0x3F); if (this->prevSwitchFlagSet != 0) { - this->actor.posRot.pos.y = -282.0f; + this->actor.world.pos.y = -282.0f; BgMoriIdomizu_SetWaterLevel(globalCtx, -282); } else { - this->actor.posRot.pos.y = 184.0f; + this->actor.world.pos.y = 184.0f; BgMoriIdomizu_SetWaterLevel(globalCtx, 184); } this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX); @@ -127,13 +127,13 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx) { } else if (!switchFlagSet && this->prevSwitchFlagSet) { func_800800F8(globalCtx, 0xCA8, 0x46, thisx, 0); this->drainTimer = 90; - thisx->posRot.pos.y = 0.0f; + thisx->world.pos.y = 0.0f; } this->drainTimer--; if ((roomNum == 7) || (roomNum == 8) || (roomNum == 9)) { if (this->drainTimer < 70) { - Math_StepToF(&thisx->posRot.pos.y, this->targetWaterLevel, 3.5f); - BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->posRot.pos.y); + Math_StepToF(&thisx->world.pos.y, this->targetWaterLevel, 3.5f); + BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->world.pos.y); if (this->drainTimer > 0) { if (switchFlagSet) { func_800788CC(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); @@ -143,8 +143,8 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx) { } } } else { - thisx->posRot.pos.y = this->targetWaterLevel; - BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->posRot.pos.y); + thisx->world.pos.y = this->targetWaterLevel; + BgMoriIdomizu_SetWaterLevel(globalCtx, thisx->world.pos.y); Actor_Kill(thisx); return; } 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 7ebf95bb22..edb1419290 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 @@ -26,7 +26,7 @@ extern Gfx D_060056B0[]; const ActorInit Bg_Mori_Kaitenkabe_InitVars = { ACTOR_BG_MORI_KAITENKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriKaitenkabe), @@ -100,13 +100,13 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { if ((this->timer > 28) && !Player_InCsMode(globalCtx)) { BgMoriKaitenkabe_SetupRotate(this); func_8002DF54(globalCtx, &this->dyna.actor, 8); - Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.posRot.pos); + Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos); push.x = Math_SinS(this->dyna.unk_158); push.y = 0.0f; push.z = Math_CosS(this->dyna.unk_158); - leverArm.x = this->dyna.actor.posRot.pos.x - player->actor.posRot.pos.x; + leverArm.x = this->dyna.actor.world.pos.x - player->actor.world.pos.x; leverArm.y = 0.0f; - leverArm.z = this->dyna.actor.posRot.pos.z - player->actor.posRot.pos.z; + leverArm.z = this->dyna.actor.world.pos.z - player->actor.world.pos.z; BgMoriKaitenkabe_CrossProduct(&torque, &push, &leverArm); this->rotDirection = (torque.y > 0.0f) ? 1.0f : -1.0f; } @@ -135,22 +135,22 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { BgMoriKaitenkabe_SetupWait(this); func_8002DF54(globalCtx, thisx, 7); if (this->rotDirection > 0.0f) { - thisx->initPosRot.rot.y += 0x2000; + thisx->home.rot.y += 0x2000; } else { - thisx->initPosRot.rot.y -= 0x2000; + thisx->home.rot.y -= 0x2000; } - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->initPosRot.rot.y; + thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y; func_800788CC(NA_SE_EV_STONEDOOR_STOP); } else { rotY = this->rotYdeg * (0x10000 / 360.0f); - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->initPosRot.rot.y + rotY; + thisx->world.rot.y = thisx->shape.rot.y = thisx->home.rot.y + rotY; func_800788CC(NA_SE_EV_WALL_SLIDE - SFX_FLAG); } if (fabsf(this->dyna.unk_150) > 0.001f) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; } - Math_Vec3f_Copy(&player->actor.posRot.pos, &this->lockedPlayerPos); + Math_Vec3f_Copy(&player->actor.world.pos, &this->lockedPlayerPos); } void BgMoriKaitenkabe_Update(Actor* thisx, GlobalContext* globalCtx) { 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 b4b110cf89..9fc70adb64 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 @@ -33,7 +33,7 @@ static s16 sCamSetting = 0; const ActorInit Bg_Mori_Rakkatenjo_InitVars = { ACTOR_BG_MORI_RAKKATENJO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MORI_OBJECTS, sizeof(BgMoriRakkatenjo), @@ -56,14 +56,14 @@ void BgMoriRakkatenjo_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); // Forest Temple obj. Falling Ceiling - osSyncPrintf("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.initPosRot.pos.y); - if ((fabsf(1991.0f - this->dyna.actor.initPosRot.pos.x) > 0.001f) || - (fabsf(683.0f - this->dyna.actor.initPosRot.pos.y) > 0.001f) || - (fabsf(-2520.0f - this->dyna.actor.initPosRot.pos.z) > 0.001f)) { + osSyncPrintf("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y); + if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) || + (fabsf(683.0f - this->dyna.actor.home.pos.y) > 0.001f) || + (fabsf(-2520.0f - this->dyna.actor.home.pos.z) > 0.001f)) { // The set position has been changed. Let's fix the program. osSyncPrintf("Warning : セット位置が変更されています。プログラムを修正しましょう。\n"); } - if (this->dyna.actor.initPosRot.rot.y != 0x8000) { + if (this->dyna.actor.home.rot.y != 0x8000) { // The set Angle has changed. Let's fix the program. osSyncPrintf("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n"); } @@ -89,13 +89,13 @@ void BgMoriRakkatenjo_Destroy(Actor* thisx, GlobalContext* globalCtx) { } s32 BgMoriRakkatenjo_IsLinkUnder(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { - Vec3f* pos = &PLAYER->actor.posRot.pos; + Vec3f* pos = &PLAYER->actor.world.pos; return (-3300.0f < pos->z) && (pos->z < -1840.0f) && (1791.0f < pos->x) && (pos->x < 2191.0f); } s32 BgMoriRakkatenjo_IsLinkClose(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { - Vec3f* pos = &PLAYER->actor.posRot.pos; + Vec3f* pos = &PLAYER->actor.world.pos; return (-3360.0f < pos->z) && (pos->z < -1840.0f) && (1791.0f < pos->x) && (pos->x < 2191.0f); } @@ -113,7 +113,7 @@ void BgMoriRakkatenjo_WaitForMoriTex(BgMoriRakkatenjo* this, GlobalContext* glob void BgMoriRakkatenjo_SetupWait(BgMoriRakkatenjo* this) { this->timer = (this->fallCount > 0) ? 100 : 21; - this->dyna.actor.posRot.pos.y = 683.0f; + this->dyna.actor.world.pos.y = 683.0f; this->actionFunc = BgMoriRakkatenjo_Wait; } @@ -153,17 +153,17 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { s32 quake; Actor_MoveForward(thisx); - if ((thisx->velocity.y < 0.0f) && (thisx->posRot.pos.y <= 403.0f)) { + if ((thisx->velocity.y < 0.0f) && (thisx->world.pos.y <= 403.0f)) { if (this->bounceCount >= ARRAY_COUNT(bounceVel)) { BgMoriRakkatenjo_SetupRest(this); } else { if (this->bounceCount == 0) { this->fallCount++; func_800788CC(NA_SE_EV_STONE_BOUND); - func_800AA000(SQ(thisx->yDistToLink), 0xFF, 0x14, 0x96); + func_800AA000(SQ(thisx->yDistToPlayer), 0xFF, 0x14, 0x96); } - thisx->posRot.pos.y = - 403.0f - (thisx->posRot.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y); + thisx->world.pos.y = + 403.0f - (thisx->world.pos.y - 403.0f) * bounceVel[this->bounceCount] / fabsf(thisx->velocity.y); thisx->velocity.y = bounceVel[this->bounceCount]; this->bounceCount++; quake = Quake_Add(ACTIVE_CAM, 3); @@ -176,7 +176,7 @@ void BgMoriRakkatenjo_Fall(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { void BgMoriRakkatenjo_SetupRest(BgMoriRakkatenjo* this) { this->actionFunc = BgMoriRakkatenjo_Rest; - this->dyna.actor.posRot.pos.y = 403.0f; + this->dyna.actor.world.pos.y = 403.0f; this->timer = 20; } @@ -193,8 +193,8 @@ void BgMoriRakkatenjo_SetupRise(BgMoriRakkatenjo* this) { void BgMoriRakkatenjo_Rise(BgMoriRakkatenjo* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.velocity.y, 5.0f, 0.06f, 0.1f, 0.0f); - this->dyna.actor.posRot.pos.y += this->dyna.actor.velocity.y; - if (this->dyna.actor.posRot.pos.y >= 683.0f) { + this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y; + if (this->dyna.actor.world.pos.y >= 683.0f) { BgMoriRakkatenjo_SetupWait(this); } } 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 241d59eb95..4f3ce13360 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 @@ -38,7 +38,7 @@ extern CollisionHeader D_06007860; const ActorInit Bg_Po_Event_InitVars = { ACTOR_BG_PO_EVENT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_PO_SISTERS, sizeof(BgPoEvent), @@ -121,9 +121,9 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { if (1) {} // This section looks like a macro of some sort. for (i2 = 0; i2 < 3; i2++) { vtxVec = &item->dim.vtx[i2]; - sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.initPosRot.pos.x + (sins * vtxVec->z)); - sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.initPosRot.pos.y; - sp9C[i2].z = this->dyna.actor.initPosRot.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins); + sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.home.pos.x + (sins * vtxVec->z)); + sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.home.pos.y; + sp9C[i2].z = this->dyna.actor.home.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins); } Collider_SetTrisVertices(&this->collider, i1, &sp9C[0], &sp9C[1], &sp9C[2]); } @@ -168,7 +168,7 @@ void BgPoEvent_InitBlocks(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); if ((this->type == 0) && (this->index != 3)) { newBlock = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_PO_EVENT, - blockPosX[this->index], this->dyna.actor.posRot.pos.y, blockPosZ[this->index], 0, + blockPosX[this->index], this->dyna.actor.world.pos.y, blockPosZ[this->index], 0, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z - 0x4000, ((this->index + 1) << 0xC) + (this->type << 8) + this->dyna.actor.params); if (newBlock == NULL) { @@ -189,9 +189,9 @@ void BgPoEvent_InitBlocks(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.actor.child->child->child->child = &this->dyna.actor; } } - this->dyna.actor.posRot.pos.y = 833.0f; - this->dyna.actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, - &this->dyna.actor, &this->dyna.actor.posRot.pos); + this->dyna.actor.world.pos.y = 833.0f; + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, + &this->dyna.actor, &this->dyna.actor.world.pos); this->actionFunc = BgPoEvent_BlockWait; } @@ -241,14 +241,14 @@ void BgPoEvent_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) { - this->dyna.actor.posRot.pos.y = 833.0f; + this->dyna.actor.world.pos.y = 833.0f; if (sPuzzleState == 0x3F) { if (this->type == 1) { func_800800F8(globalCtx, 0xC4E, 0x41, NULL, 0); } this->timer = 45; this->actionFunc = BgPoEvent_BlockShake; - } else if (this->dyna.actor.xzDistToLink > 50.0f) { + } else if (this->dyna.actor.xzDistToPlayer > 50.0f) { if (this->type != 1) { sPuzzleState |= (1 << this->index); } else { @@ -264,13 +264,13 @@ void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) { void BgPoEvent_BlockShake(BgPoEvent* this, GlobalContext* globalCtx) { DECR(this->timer); if (this->timer < 15) { - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x + 2.0f * ((this->timer % 3) - 1); + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + 2.0f * ((this->timer % 3) - 1); if (!(this->timer % 4)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_SHAKE); } } if (this->timer == 0) { - this->dyna.actor.posRot.pos.x = this->dyna.actor.initPosRot.pos.x; + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x; sPuzzleState = 0; this->timer = 60; this->actionFunc = BgPoEvent_BlockFall; @@ -284,24 +284,24 @@ void BgPoEvent_CheckBlock(BgPoEvent* this) { s32 phi_a3; if ((this->index == 3) || (this->index == 1)) { - phi_v1 = this->dyna.actor.posRot.pos.z; - phi_a1 = this->dyna.actor.child->posRot.pos.z; + phi_v1 = this->dyna.actor.world.pos.z; + phi_a1 = this->dyna.actor.child->world.pos.z; if (this->index == 3) { - phi_a3 = this->dyna.actor.posRot.pos.x; - phi_t0 = this->dyna.actor.child->posRot.pos.x; + phi_a3 = this->dyna.actor.world.pos.x; + phi_t0 = this->dyna.actor.child->world.pos.x; } else { // this->index == 1 - phi_a3 = this->dyna.actor.child->posRot.pos.x; - phi_t0 = this->dyna.actor.posRot.pos.x; + phi_a3 = this->dyna.actor.child->world.pos.x; + phi_t0 = this->dyna.actor.world.pos.x; } } else { - phi_v1 = this->dyna.actor.posRot.pos.x; - phi_a1 = this->dyna.actor.child->posRot.pos.x; + phi_v1 = this->dyna.actor.world.pos.x; + phi_a1 = this->dyna.actor.child->world.pos.x; if (this->index == 0) { - phi_a3 = this->dyna.actor.posRot.pos.z; - phi_t0 = this->dyna.actor.child->posRot.pos.z; + phi_a3 = this->dyna.actor.world.pos.z; + phi_t0 = this->dyna.actor.child->world.pos.z; } else { // this->index == 2 - phi_a3 = this->dyna.actor.child->posRot.pos.z; - phi_t0 = this->dyna.actor.posRot.pos.z; + phi_a3 = this->dyna.actor.child->world.pos.z; + phi_t0 = this->dyna.actor.world.pos.z; } } if ((phi_v1 == phi_a1) && ((phi_t0 - phi_a3) == 60)) { @@ -315,7 +315,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, GlobalContext* globalCtx) { static s32 firstFall = 0; this->dyna.actor.velocity.y++; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 433.0f, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, 433.0f, this->dyna.actor.velocity.y)) { this->dyna.actor.flags &= ~0x20; this->dyna.actor.velocity.y = 0.0f; sBlocksAtRest++; @@ -344,8 +344,8 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { this->actionFunc = BgPoEvent_BlockSolved; if ((this->type == 0) && (this->index == 0)) { amy = - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->dyna.actor.posRot.pos.x + 30.0f, - this->dyna.actor.posRot.pos.y - 30.0f, this->dyna.actor.posRot.pos.z + 30.0f, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->dyna.actor.world.pos.x + 30.0f, + this->dyna.actor.world.pos.y - 30.0f, this->dyna.actor.world.pos.z + 30.0f, 0, this->dyna.actor.shape.rot.y, 0, this->dyna.actor.params + 0x300); if (amy != NULL) { func_800800F8(globalCtx, 0xC62, 0x1E, amy, 0); @@ -360,7 +360,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { sBlocksAtRest = 0; } if ((sPuzzleState == 0x40) || ((sPuzzleState == 0x10) && !Player_InCsMode(globalCtx))) { - this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z; + this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; this->actionFunc = BgPoEvent_BlockReset; if (sPuzzleState == 0x10) { sPuzzleState = 0x40; @@ -398,16 +398,16 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); blockStop = Math_StepToF(&blockPushDist, 20.0f, this->dyna.actor.speedXZ); displacement = this->direction * blockPushDist; - this->dyna.actor.posRot.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.z; if (blockStop) { player->stateFlags2 &= ~0x10; if ((this->dyna.unk_150 > 0.0f) && (func_800435D8(globalCtx, &this->dyna, 0x1E, 0x32, -0x14) == 0)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } this->dyna.unk_150 = 0.0f; - this->dyna.actor.initPosRot.pos.x = this->dyna.actor.posRot.pos.x; - this->dyna.actor.initPosRot.pos.z = this->dyna.actor.posRot.pos.z; + this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; + this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; blockPushDist = 0.0f; this->dyna.actor.speedXZ = 0.0f; this->direction = 5; @@ -429,8 +429,8 @@ void BgPoEvent_BlockReset(BgPoEvent* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 493.0f, 1.0f) && - Math_ScaledStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.posRot.rot.z - 0x4000, 0x400)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, 493.0f, 1.0f) && + Math_ScaledStepToS(&this->dyna.actor.shape.rot.z, this->dyna.actor.world.rot.z - 0x4000, 0x400)) { this->index = (this->index + 1) % 4; this->actionFunc = BgPoEvent_BlockFall; @@ -448,7 +448,7 @@ void BgPoEvent_BlockSolved(BgPoEvent* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 != 0.0f) { player->stateFlags2 &= ~0x10; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, 369.0f, 2.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, 369.0f, 2.0f)) { sPuzzleState = 0x20; Actor_Kill(&this->dyna.actor); } @@ -468,9 +468,9 @@ void BgPoEvent_AmyPuzzle(BgPoEvent* this, GlobalContext* globalCtx) { Vec3f pos; if (sPuzzleState == 0xF) { - pos.x = this->dyna.actor.posRot.pos.x - 5.0f; - pos.y = Rand_CenteredFloat(120.0f) + this->dyna.actor.posRot.pos.y; - pos.z = Rand_CenteredFloat(120.0f) + this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x - 5.0f; + pos.y = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.y; + pos.z = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &pos, &sZeroVec, &sZeroVec, 170, 0, 200, 255, 100, 170, 0, 255, 0, 1, 9, true); } else if (sPuzzleState == 0x20) { Actor_Kill(&this->dyna.actor); @@ -525,9 +525,9 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, GlobalContext* globalCtx) { DECR(this->timer); - if (((this->timer == 0) || ((thisx->xzDistToLink < 150.0f) && (thisx->yDistToLink < 50.0f)) || - (func_8002DD78(player) && (thisx->xzDistToLink < 320.0f) && - ((this->index != 2) ? (thisx->yDistToLink < 100.0f) : (thisx->yDistToLink < 0.0f)) && + if (((this->timer == 0) || ((thisx->xzDistToPlayer < 150.0f) && (thisx->yDistToPlayer < 50.0f)) || + (func_8002DD78(player) && (thisx->xzDistToPlayer < 320.0f) && + ((this->index != 2) ? (thisx->yDistToPlayer < 100.0f) : (thisx->yDistToPlayer < 0.0f)) && func_8002DFC8(thisx, 0x2000, globalCtx))) && ((thisx->parent != NULL) || (thisx->child != NULL))) { /*The third condition in the || is checking if @@ -541,8 +541,8 @@ void BgPoEvent_PaintingPresent(BgPoEvent* this, GlobalContext* globalCtx) { this->actionFunc = BgPoEvent_PaintingVanish; } else if (this->collider.base.acFlags & AC_HIT) { if (!BgPoEvent_NextPainting(this)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->posRot.pos.x, - thisx->posRot.pos.y - 40.0f, thisx->posRot.pos.z, 0, thisx->shape.rot.y, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->world.pos.x, + thisx->world.pos.y - 40.0f, thisx->world.pos.z, 0, thisx->shape.rot.y, 0, thisx->params + ((this->type - 1) << 8)); func_800800F8(globalCtx, 0xC58, 0x50, thisx, 0); func_80078884(NA_SE_SY_CORRECT_CHIME); @@ -568,9 +568,9 @@ void BgPoEvent_PaintingBurn(BgPoEvent* this, GlobalContext* globalCtx) { Vec3f sp54; this->timer--; - sp54.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 5.0f) + this->dyna.actor.posRot.pos.x; - sp54.y = Rand_CenteredFloat(66.0f) + this->dyna.actor.posRot.pos.y; - sp54.z = Rand_CenteredFloat(50.0f) + this->dyna.actor.posRot.pos.z; + sp54.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 5.0f) + this->dyna.actor.world.pos.x; + sp54.y = Rand_CenteredFloat(66.0f) + this->dyna.actor.world.pos.y; + sp54.z = Rand_CenteredFloat(50.0f) + this->dyna.actor.world.pos.z; if (this->timer >= 0) { if (this->type == 2) { EffectSsDeadDb_Spawn(globalCtx, &sp54, &sZeroVec, &sZeroVec, 100, 0, 255, 255, 150, 170, 255, 0, 0, 1, 9, @@ -626,11 +626,11 @@ void BgPoEvent_Draw(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_po_event.c", 1508); if ((this->type == 0) || (this->type == 1)) { - sp48 = (833.0f - this->dyna.actor.posRot.pos.y) * 0.0025f; + sp48 = (833.0f - this->dyna.actor.world.pos.y) * 0.0025f; if (!(sp48 > 1.0f)) { - sp58.x = this->dyna.actor.posRot.pos.x; - sp58.y = this->dyna.actor.posRot.pos.y - 30.0f; - sp58.z = this->dyna.actor.posRot.pos.z; + sp58.x = this->dyna.actor.world.pos.x; + sp58.y = this->dyna.actor.world.pos.y - 30.0f; + sp58.z = this->dyna.actor.world.pos.z; sp4C.y = 1.0f; sp4C.x = sp4C.z = (sp48 * 0.3f) + 0.4f; func_80033C30(&sp58, &sp4C, (u8)(155.0f + sp48 * 100.0f), globalCtx); 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 c608cd05da..52c4b8f279 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 @@ -60,7 +60,7 @@ static Color_RGBA8 sEnvColors[] = { const ActorInit Bg_Po_Syokudai_InitVars = { ACTOR_BG_PO_SYOKUDAI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SYOKUDAI, sizeof(BgPoSyokudai), @@ -89,15 +89,15 @@ void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->colChkInfo.mass = MASS_IMMOVABLE; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, thisx->posRot.pos.x, (s16)thisx->posRot.pos.y + 65, thisx->posRot.pos.z, - 0, 0, 0, 0); + Lights_PointGlowSetInfo(&this->lightInfo, thisx->world.pos.x, (s16)thisx->world.pos.y + 65, thisx->world.pos.z, 0, + 0, 0, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); - this->collider.dim.pos.x = thisx->posRot.pos.x; - this->collider.dim.pos.y = thisx->posRot.pos.y; - this->collider.dim.pos.z = thisx->posRot.pos.z; + this->collider.dim.pos.x = thisx->world.pos.x; + this->collider.dim.pos.y = thisx->world.pos.y; + this->collider.dim.pos.z = thisx->world.pos.z; if (this->flameColor == POE_FLAME_PURPLE && Flags_GetSwitch(globalCtx, POE_TORCH_FLAG + POE_FLAME_GREEN) && Flags_GetSwitch(globalCtx, POE_TORCH_FLAG + POE_FLAME_BLUE) && @@ -109,8 +109,8 @@ void BgPoSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { } else if (!Flags_GetSwitch(globalCtx, POE_TORCH_FLAG + POE_FLAME_PURPLE) && !Flags_GetSwitch(globalCtx, 0x1B)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->posRot.pos.x, - thisx->posRot.pos.y + 52.0f, thisx->posRot.pos.z, 0, 0, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, thisx->world.pos.x, + thisx->world.pos.y + 52.0f, thisx->world.pos.z, 0, 0, 0, (this->flameColor << 8) + thisx->params + 0x1000); } else if (!Flags_GetSwitch(globalCtx, thisx->params)) { 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 f3be709087..d8d385a3ee 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -19,7 +19,7 @@ void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx); const ActorInit Bg_Pushbox_InitVars = { ACTOR_BG_PUSHBOX, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(BgPushbox), @@ -66,9 +66,9 @@ void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx) { thisx->speedXZ += this->dyna.unk_150 * 0.2f; thisx->speedXZ = (thisx->speedXZ < -1.0f) ? -1.0f : ((thisx->speedXZ > 1.0f) ? 1.0f : thisx->speedXZ); Math_StepToF(&thisx->speedXZ, 0.0f, 0.2f); - thisx->posRot.rot.y = this->dyna.unk_158; + thisx->world.rot.y = this->dyna.unk_158; Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 20.0f, 40.0f, 40.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 20.0f, 40.0f, 40.0f, 0x1D); } void BgPushbox_Update(Actor* thisx, GlobalContext* globalCtx) { 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 3c1a094103..551925a329 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 @@ -34,7 +34,7 @@ extern UNK_TYPE D_060025FC; const ActorInit Bg_Relay_Objects_InitVars = { ACTOR_BG_RELAY_OBJECTS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_RELAY_OBJECTS, sizeof(BgRelayObjects), @@ -62,9 +62,9 @@ void BgRelayObjects_Init(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == WINDMILL_ROTATING_GEAR) { CollisionHeader_GetVirtual(&D_060025FC, &colHeader); if (gSaveContext.eventChkInf[6] & 0x20) { - thisx->posRot.rot.y = 0x400; + thisx->world.rot.y = 0x400; } else { - thisx->posRot.rot.y = 0x80; + thisx->world.rot.y = 0x80; } func_800F5718(); thisx->room = -1; @@ -103,7 +103,7 @@ void BgRelayObjects_Init(Actor* thisx, GlobalContext* globalCtx) { } else { Flags_SetSwitch(globalCtx, this->switchFlag); this->actionFunc = func_808A91AC; - thisx->posRot.pos.y += 120.0f; + thisx->world.pos.y += 120.0f; D_808A9508 |= 1; } } @@ -129,7 +129,7 @@ void func_808A90F4(BgRelayObjects* this, GlobalContext* globalCtx) { this->timer = 160; } } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 12.0f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 12.0f)) { this->actionFunc = func_808A91AC; } } @@ -150,8 +150,8 @@ void func_808A91AC(BgRelayObjects* this, GlobalContext* globalCtx) { void func_808A9234(BgRelayObjects* this, GlobalContext* globalCtx) { this->dyna.actor.velocity.y += this->dyna.actor.gravity; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.velocity.y)) { - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 180, 20, 100); + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 180, 20, 100); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); if (this->unk_169 != globalCtx->roomCtx.curRoom.num) { func_800788CC(NA_SE_EN_PO_LAUGH); @@ -189,13 +189,13 @@ void func_808A939C(BgRelayObjects* this, GlobalContext* globalCtx) { gSaveContext.eventChkInf[6] |= 0x20; } if (gSaveContext.eventChkInf[6] & 0x20) { - Math_ScaledStepToS(&this->dyna.actor.posRot.rot.y, 0x400, 8); + Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x400, 8); } else { - Math_ScaledStepToS(&this->dyna.actor.posRot.rot.y, 0x80, 8); + Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0x80, 8); } - this->dyna.actor.shape.rot.y += this->dyna.actor.posRot.rot.y; + this->dyna.actor.shape.rot.y += this->dyna.actor.world.rot.y; func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WOOD_GEAR - SFX_FLAG, - ((this->dyna.actor.posRot.rot.y - 0x80) * (1.0f / 0x380)) + 1.0f); + ((this->dyna.actor.world.rot.y - 0x80) * (1.0f / 0x380)) + 1.0f); } void BgRelayObjects_Update(Actor* thisx, GlobalContext* globalCtx) { 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 9a67b2d18b..e7545e9061 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 @@ -17,7 +17,7 @@ void BgSpot00Break_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot00_Break_InitVars = { ACTOR_BG_SPOT00_BREAK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT00_BREAK, sizeof(BgSpot00Break), 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 fc86d2dd32..3337507fd1 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 @@ -18,7 +18,7 @@ extern UNK_TYPE D_060005E0; /* const ActorInit Bg_Spot00_Hanebasi_InitVars = { ACTOR_BG_SPOT00_HANEBASI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT00_OBJECTS, sizeof(BgSpot00Hanebasi), 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 e2fdbc4fc4..3d593c0493 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 @@ -19,7 +19,7 @@ void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Fusya_InitVars = { ACTOR_BG_SPOT01_FUSYA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT01_OBJECTS, sizeof(BgSpot01Fusya), 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 b6dba4efbb..7fa6fed6a9 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 @@ -40,7 +40,7 @@ static BgSpot01IdohashiraDrawFunc sDrawFuncs[] = { const ActorInit Bg_Spot01_Idohashira_InitVars = { ACTOR_BG_SPOT01_IDOHASHIRA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT01_OBJECTS, sizeof(BgSpot01Idohashira), @@ -58,7 +58,7 @@ void BgSpot01Idohashira_PlayBreakSfx1(BgSpot01Idohashira* this) { } void BgSpot01Idohashira_PlayBreakSfx2(BgSpot01Idohashira* this, GlobalContext* globalCtx) { - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 60, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 60, NA_SE_EV_WOODBOX_BREAK); } void func_808AAD3C(GlobalContext* globalCtx, Vec3f* vec, u32 arg2) { @@ -112,7 +112,7 @@ void func_808AAD3C(GlobalContext* globalCtx, Vec3f* vec, u32 arg2) { void func_808AAE6C(BgSpot01Idohashira* this, GlobalContext* globalCtx) { s32 pad; - Vec3f sp30 = this->dyna.actor.posRot.pos; + Vec3f sp30 = this->dyna.actor.world.pos; sp30.y += kREG(15); func_80033480(globalCtx, &sp30, kREG(11) + 350.0f, kREG(12) + 5, kREG(13) + 0x7D0, kREG(14) + 0x320, 0); @@ -203,11 +203,11 @@ s32 func_808AB29C(BgSpot01Idohashira* this, GlobalContext* globalCtx) { npcAction = BgSpot01Idohashira_GetNpcAction(globalCtx, 2); if (npcAction != NULL) { temp_f0 = func_8006F93C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames); - initPos = this->dyna.actor.initPosRot.pos; + initPos = this->dyna.actor.home.pos; endX = npcAction->endPos.x; tempY = ((kREG(10) + 1100.0f) / 10.0f) + npcAction->endPos.y; endZ = npcAction->endPos.z; - thisPos = &this->dyna.actor.posRot.pos; + thisPos = &this->dyna.actor.world.pos; thisPos->x = ((endX - initPos.x) * temp_f0) + initPos.x; thisPos->y = func_808AB1DC(initPos.y, tempY, npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames) + @@ -314,7 +314,7 @@ void BgSpot01Idohashira_Init(Actor* thisx, GlobalContext* globalCtx) { } } else if (gSaveContext.sceneSetupIndex == 4) { this->action = 1; - this->dyna.actor.shape.unk_08 = -(kREG(10) + 1100.0f); + this->dyna.actor.shape.yOffset = -(kREG(10) + 1100.0f); } else if (gSaveContext.sceneSetupIndex == 6) { this->action = 0; } else { 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 b0bf447d73..604c22a284 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 @@ -19,7 +19,7 @@ void func_808ABB84(BgSpot01Idomizu* this, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Idomizu_InitVars = { ACTOR_BG_SPOT01_IDOMIZU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT01_OBJECTS, sizeof(BgSpot01Idomizu), @@ -45,7 +45,7 @@ void BgSpot01Idomizu_Init(Actor* thisx, GlobalContext* globalCtx) { this->waterHeight = 52.0f; } this->actionFunc = func_808ABB84; - this->actor.posRot.pos.y = this->waterHeight; + this->actor.world.pos.y = this->waterHeight; } void BgSpot01Idomizu_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -55,12 +55,12 @@ void func_808ABB84(BgSpot01Idomizu* this, GlobalContext* globalCtx) { if (gSaveContext.eventChkInf[6] & 0x80) { this->waterHeight = -550.0f; } - globalCtx->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.posRot.pos.y; - if (this->waterHeight < this->actor.posRot.pos.y) { + globalCtx->colCtx.colHeader->waterBoxes[0].ySurface = this->actor.world.pos.y; + if (this->waterHeight < this->actor.world.pos.y) { Audio_PlaySoundGeneral(NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - Math_ApproachF(&this->actor.posRot.pos.y, this->waterHeight, 1.0f, 2.0f); + Math_ApproachF(&this->actor.world.pos.y, this->waterHeight, 1.0f, 2.0f); } void BgSpot01Idomizu_Update(Actor* thisx, 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 c7ccbc0763..efc8cd061d 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 @@ -19,7 +19,7 @@ void func_808ABF54(BgSpot01Idosoko* this, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Idosoko_InitVars = { ACTOR_BG_SPOT01_IDOSOKO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT01_MATOYA, sizeof(BgSpot01Idosoko), 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 f3b5198b97..1735959f8c 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 @@ -20,7 +20,7 @@ void func_808AC4A4(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot01_Objects2_InitVars = { ACTOR_BG_SPOT01_OBJECTS2, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(BgSpot01Objects2), @@ -110,8 +110,8 @@ void func_808AC2BC(BgSpot01Objects2* this, GlobalContext* globalCtx) { if (gSaveContext.nightFlag == 0) { func_808AC22C(globalCtx->setupPathList, &position, ((s32)thisx->params >> 8) & 0xFF, 0); Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_EN_DAIKU_KAKARIKO, position.x, - position.y, position.z, thisx->posRot.rot.x, thisx->posRot.rot.y, - thisx->posRot.rot.z, ((((s32)thisx->params >> 8) & 0xFF) << 8) + 1); + position.y, position.z, thisx->world.rot.x, thisx->world.rot.y, + thisx->world.rot.z, ((((s32)thisx->params >> 8) & 0xFF) << 8) + 1); } break; case 0: // Potion Shop Poster 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 b75135ea36..04b171796e 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 @@ -19,7 +19,7 @@ extern UNK_TYPE D_060133EC; /* const ActorInit Bg_Spot02_Objects_InitVars = { ACTOR_BG_SPOT02_OBJECTS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT02_OBJECTS, sizeof(BgSpot02Objects), 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 f76f3a9302..46cf0846b2 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 @@ -19,7 +19,7 @@ void func_808ADEF0(BgSpot03Taki* this, GlobalContext* globalCtx); const ActorInit Bg_Spot03_Taki_InitVars = { ACTOR_BG_SPOT03_TAKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT03_OBJECT, sizeof(BgSpot03Taki), 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 e5f413b0bb..07993ca848 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 @@ -23,7 +23,7 @@ extern CollisionHeader D_060012C0; const ActorInit Bg_Spot05_Soko_InitVars = { ACTOR_BG_SPOT05_SOKO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT05_OBJECTS, sizeof(BgSpot05Soko), @@ -85,8 +85,8 @@ void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (Flags_GetSwitch(globalCtx, this->switchFlag)) { - Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 30, NA_SE_EV_METALDOOR_CLOSE); - Actor_SetHeight(thisx, 50.0f); + Audio_PlaySoundAtPosition(globalCtx, &thisx->world.pos, 30, NA_SE_EV_METALDOOR_CLOSE); + Actor_SetFocus(thisx, 50.0f); func_80080480(globalCtx, &this->dyna.actor); this->actionFunc = func_808AE630; thisx->speedXZ = 0.5f; @@ -97,7 +97,7 @@ void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; thisx->speedXZ *= 1.5f; - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y - 120.0f, thisx->speedXZ) != 0) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y - 120.0f, thisx->speedXZ) != 0) { Actor_Kill(thisx); } } 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 4a386d3f45..dcc09a15e5 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 @@ -20,7 +20,7 @@ extern UNK_TYPE D_06002490; /* const ActorInit Bg_Spot06_Objects_InitVars = { ACTOR_BG_SPOT06_OBJECTS, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT06_OBJECTS, sizeof(BgSpot06Objects), 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 72636b9794..83db881f38 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 @@ -27,7 +27,7 @@ extern UNK_TYPE D_060038FC; /* const ActorInit Bg_Spot07_Taki_InitVars = { ACTOR_BG_SPOT07_TAKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT07_OBJECT, sizeof(BgSpot07Taki), 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 ae21bdbf3d..683a78a1db 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 @@ -21,7 +21,7 @@ void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx); const ActorInit Bg_Spot08_Bakudankabe_InitVars = { ACTOR_BG_SPOT08_BAKUDANKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT08_OBJ, sizeof(BgSpot08Bakudankabe), @@ -127,9 +127,9 @@ void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx) { temp1 = (Rand_ZeroOne() - 0.5f) * 440.0f; temp2 = (Rand_ZeroOne() - 0.5f) * 20.0f; - burstDepthY.x = this->dyna.actor.posRot.pos.x + temp2 * sinY + (temp1 * cosY); - burstDepthY.y = (this->dyna.actor.posRot.pos.y + 20.0f) + (i * 5.4166665f); - burstDepthY.z = this->dyna.actor.posRot.pos.z + temp2 * cosY - (temp1 * sinY); + burstDepthY.x = this->dyna.actor.world.pos.x + temp2 * sinY + (temp1 * cosY); + burstDepthY.y = (this->dyna.actor.world.pos.y + 20.0f) + (i * 5.4166665f); + burstDepthY.z = this->dyna.actor.world.pos.z + temp2 * cosY - (temp1 * sinY); burstDepthX.y = (Rand_ZeroOne() - 0.2f) * 12.0f; scale = Rand_ZeroOne() * 75.0f + 10.0f; @@ -153,9 +153,9 @@ void func_808B0324(BgSpot08Bakudankabe* this, GlobalContext* globalCtx) { } for (i = 0; i < ARRAY_COUNT(D_808B08AC); i++) { - burstDepthY.x = this->dyna.actor.posRot.pos.x + D_808B08AC[i].z * sinY + D_808B08AC[i].x * cosY; - burstDepthY.y = this->dyna.actor.posRot.pos.y + D_808B08AC[i].y; - burstDepthY.z = this->dyna.actor.posRot.pos.z + D_808B08AC[i].z * cosY - (D_808B08AC[i].x * sinY); + burstDepthY.x = this->dyna.actor.world.pos.x + D_808B08AC[i].z * sinY + D_808B08AC[i].x * cosY; + burstDepthY.y = this->dyna.actor.world.pos.y + D_808B08AC[i].y; + burstDepthY.z = this->dyna.actor.world.pos.z + D_808B08AC[i].z * cosY - (D_808B08AC[i].x * sinY); func_80033480(globalCtx, &burstDepthY, 120.0f, 4, 0x78, 0xA0, 1); } } @@ -189,10 +189,10 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); - } else if (this->dyna.actor.xzDistToLink < 800.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 800.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } 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 737531d1f1..f37a728eeb 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 @@ -17,7 +17,7 @@ extern UNK_TYPE D_06001904; /* const ActorInit Bg_Spot08_Iceblock_InitVars = { ACTOR_BG_SPOT08_ICEBLOCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT08_OBJ, sizeof(BgSpot08Iceblock), 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 478912e70d..b63443cc53 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 @@ -22,7 +22,7 @@ s32 func_808B1BEC(BgSpot09Obj* this, GlobalContext* globalCtx); const ActorInit Bg_Spot09_Obj_InitVars = { ACTOR_BG_SPOT09_OBJ, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT09_OBJ, sizeof(BgSpot09Obj), 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 98bb62497d..696a3bf0b3 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 @@ -19,7 +19,7 @@ void BgSpot11Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot11_Bakudankabe_InitVars = { ACTOR_BG_SPOT11_BAKUDANKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT11_OBJ, sizeof(BgSpot11Bakudankabe), @@ -59,9 +59,9 @@ void func_808B2180(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); - this->collider.dim.pos.x += (s16)this->dyna.actor.posRot.pos.x; - this->collider.dim.pos.y += (s16)this->dyna.actor.posRot.pos.y; - this->collider.dim.pos.z += (s16)this->dyna.actor.posRot.pos.z; + this->collider.dim.pos.x += (s16)this->dyna.actor.world.pos.x; + this->collider.dim.pos.y += (s16)this->dyna.actor.world.pos.y; + this->collider.dim.pos.z += (s16)this->dyna.actor.world.pos.z; } void func_808B2218(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { @@ -78,7 +78,7 @@ void func_808B2218(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { s32 gravityInfluence; s32 rotationSpeed; - Math_Vec3f_Sum(&thisx->posRot.pos, &D_808B272C, &burstDepthY); + Math_Vec3f_Sum(&thisx->world.pos, &D_808B272C, &burstDepthY); burstDepthY.x += (Rand_ZeroOne() - 0.5f) * 120.0f; burstDepthY.y += (30.0f + (i * 6.5f)); @@ -102,7 +102,7 @@ void func_808B2218(BgSpot11Bakudankabe* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E, 4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880); } - Math_Vec3f_Sum(&thisx->posRot.pos, &D_808B272C, &burstDepthY); + Math_Vec3f_Sum(&thisx->world.pos, &D_808B272C, &burstDepthY); func_80033480(globalCtx, &burstDepthY, 70, 4, 110, 160, 1); burstDepthY.y += 40; func_80033480(globalCtx, &burstDepthY, 70, 5, 110, 160, 1); 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 2e515329b0..2024014aed 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 @@ -17,7 +17,7 @@ void func_808B2AB8(BgSpot11Oasis* this, GlobalContext* globalCtx); const ActorInit Bg_Spot11_Oasis_InitVars = { ACTOR_BG_SPOT11_OASIS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT11_OBJ, sizeof(BgSpot11Oasis), @@ -70,8 +70,7 @@ s32 func_808B280C(GlobalContext* globalCtx) { sp4C.z = D_808B2E10[i][1]; sp40.x = D_808B2E10[i + 1][0]; sp40.z = D_808B2E10[i + 1][1]; - if (Math3D_TriChkPointParaYSlopedY(&sp58, &sp4C, &sp40, player->actor.posRot.pos.z, - player->actor.posRot.pos.x)) { + if (Math3D_TriChkPointParaYSlopedY(&sp58, &sp4C, &sp40, player->actor.world.pos.z, player->actor.world.pos.x)) { return 1; } } @@ -83,7 +82,7 @@ void BgSpot11Oasis_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); func_808B2970(this); - this->actor.posRot.pos.y = -100.0f; + this->actor.world.pos.y = -100.0f; func_808B27F0(globalCtx, -100); } @@ -103,13 +102,13 @@ void func_808B29E0(BgSpot11Oasis* this) { } void func_808B29F0(BgSpot11Oasis* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->actor.posRot.pos.y, 0.0f, 0.7f)) { + if (Math_StepToF(&this->actor.world.pos.y, 0.0f, 0.7f)) { func_808B2AA8(this); - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_SPAWNER); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, FAIRY_SPAWNER); func_80078884(NA_SE_SY_CORRECT_CHIME); } - func_808B27F0(globalCtx, this->actor.posRot.pos.y); + func_808B27F0(globalCtx, this->actor.world.pos.y); } void func_808B2AA8(BgSpot11Oasis* this) { @@ -134,7 +133,7 @@ void BgSpot11Oasis_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_150 && (this->actor.projectedPos.z < 400.0f) && (this->actor.projectedPos.z > -40.0f)) { gameplayFrames = globalCtx->gameplayFrames; if (gameplayFrames & 4) { - Math_Vec3f_Sum(&this->actor.posRot.pos, &D_808B2E34[this->unk_151], &sp30); + Math_Vec3f_Sum(&this->actor.world.pos, &D_808B2E34[this->unk_151], &sp30); EffectSsBubble_Spawn(globalCtx, &sp30, 0.0f, 15.0f, 50.0f, (Rand_ZeroOne() * 0.12f) + 0.02f); if (Rand_ZeroOne() < 0.3f) { this->unk_151 = Rand_ZeroOne() * 4.9f; 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 e369dd4661..6d673286cc 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 @@ -26,7 +26,7 @@ void func_808B3298(BgSpot12Gate* this, GlobalContext* globalCtx); const ActorInit Bg_Spot12_Gate_InitVars = { ACTOR_BG_SPOT12_GATE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT12_OBJ, sizeof(BgSpot12Gate), @@ -83,7 +83,7 @@ void func_808B30C0(BgSpot12Gate* this) { Actor* thisx = &this->dyna.actor; this->actionFunc = func_808B30D8; - thisx->posRot.pos.y = thisx->initPosRot.pos.y; + thisx->world.pos.y = thisx->home.pos.y; } void func_808B30D8(BgSpot12Gate* this, GlobalContext* globalCtx) { @@ -115,7 +115,7 @@ void func_808B318C(BgSpot12Gate* this, GlobalContext* globalCtx) { s32 var; Math_StepToF(&thisx->velocity.y, 1.6f, 0.03f); - if (Math_StepToF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 200.0f, thisx->velocity.y)) { + if (Math_StepToF(&thisx->world.pos.y, thisx->home.pos.y + 200.0f, thisx->velocity.y)) { func_808B3274(this); var = Quake_Add(ACTIVE_CAM, 3); Quake_SetSpeed(var, -0x3CB0); @@ -131,7 +131,7 @@ void func_808B3274(BgSpot12Gate* this) { Actor* thisx = &this->dyna.actor; this->actionFunc = func_808B3298; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 200.0f; + thisx->world.pos.y = thisx->home.pos.y + 200.0f; } void func_808B3298(BgSpot12Gate* this, GlobalContext* globalCtx) { 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 9a7c70869f..546a4211f8 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 @@ -24,7 +24,7 @@ void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx); const ActorInit Bg_Spot12_Saku_InitVars = { ACTOR_BG_SPOT12_SAKU, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT12_OBJ, sizeof(BgSpot12Saku), @@ -81,8 +81,8 @@ void func_808B3550(BgSpot12Saku* this) { this->actionFunc = func_808B357C; thisx->scale.x = 0.1f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.z = thisx->home.pos.z; } void func_808B357C(BgSpot12Saku* this, GlobalContext* globalCtx) { @@ -105,10 +105,10 @@ void func_808B3604(BgSpot12Saku* this, GlobalContext* globalCtx) { f32 temp_ret = Math_SmoothStepToF(&this->dyna.actor.scale.x, 0.001f / 0.14f, 0.16f, 0.0022f, 0.001f); f32 temp_f18 = ((0.1f - this->dyna.actor.scale.x) * 840.0f); - this->dyna.actor.posRot.pos.x = - this->dyna.actor.initPosRot.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); - this->dyna.actor.posRot.pos.z = - this->dyna.actor.initPosRot.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); + this->dyna.actor.world.pos.x = + this->dyna.actor.home.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); + this->dyna.actor.world.pos.z = + this->dyna.actor.home.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * temp_f18); if (fabsf(temp_ret) < 0.0001f) { func_808B3714(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); @@ -122,8 +122,8 @@ void func_808B3714(BgSpot12Saku* this) { this->actionFunc = func_808B37AC; thisx->scale.x = 0.001f / 0.14f; - thisx->posRot.pos.x = thisx->initPosRot.pos.x - (Math_SinS(thisx->shape.rot.y + 0x4000) * 78.0f); - thisx->posRot.pos.z = thisx->initPosRot.pos.z - (Math_CosS(thisx->shape.rot.y + 0x4000) * 78.0f); + thisx->world.pos.x = thisx->home.pos.x - (Math_SinS(thisx->shape.rot.y + 0x4000) * 78.0f); + thisx->world.pos.z = thisx->home.pos.z - (Math_CosS(thisx->shape.rot.y + 0x4000) * 78.0f); } void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx) { 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 4d695ad22b..0c24a2c497 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 @@ -25,7 +25,7 @@ extern Gfx D_06000180[]; const ActorInit Bg_Spot15_Rrbox_InitVars = { ACTOR_BG_SPOT15_RRBOX, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT15_OBJ, sizeof(BgSpot15Rrbox), @@ -81,9 +81,8 @@ void func_808B3A34(BgSpot15Rrbox* this) { s32 func_808B3A40(BgSpot15Rrbox* this, GlobalContext* globalCtx) { DynaPolyActor* dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->bgId); - if (dynaPolyActor != NULL && - Math3D_Dist2DSq(dynaPolyActor->actor.posRot.pos.x, dynaPolyActor->actor.posRot.pos.z, - this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.z) < 0.01f) { + if (dynaPolyActor != NULL && Math3D_Dist2DSq(dynaPolyActor->actor.world.pos.x, dynaPolyActor->actor.world.pos.z, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z) < 0.01f) { return true; } return false; @@ -99,11 +98,11 @@ s32 func_808B3AAC(BgSpot15Rrbox* this, GlobalContext* globalCtx) { return false; } - if (actor->posRot.pos.x <= 930.0f && actor->posRot.pos.z >= -360.0f) { + if (actor->world.pos.x <= 930.0f && actor->world.pos.z >= -360.0f) { if (this->dyna.unk_150 >= 0.0f) { - rotY = actor->posRot.rot.y; + rotY = actor->world.rot.y; } else { - rotY = actor->posRot.rot.y + 0x8000; + rotY = actor->world.rot.y + 0x8000; } if (rotY < 0x2000 && rotY > -0x6000) { @@ -123,7 +122,7 @@ void BgSpot15Rrbox_Init(Actor* thisx, GlobalContext* globalCtx) { func_808B3A34(this); if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x3F))) { func_808B44B8(this, globalCtx); - this->dyna.actor.posRot.pos = D_808B45C4[D_808B4590]; + this->dyna.actor.world.pos = D_808B45C4[D_808B4590]; D_808B4590++; } else { func_808B4084(this, globalCtx); @@ -151,15 +150,15 @@ s32 func_808B3CA0(BgSpot15Rrbox* this, GlobalContext* globalCtx, s32 arg2) { func_808B39E8(&actorPosition, &actorScale, this->unk_16C, this->unk_170); - actorPosition.x += this->dyna.actor.posRot.pos.x; - actorPosition.y += this->dyna.actor.pos4.y; - actorPosition.z += this->dyna.actor.posRot.pos.z; + actorPosition.x += this->dyna.actor.world.pos.x; + actorPosition.y += this->dyna.actor.prevPos.y; + actorPosition.z += this->dyna.actor.world.pos.z; - this->dyna.actor.groundY = BgCheck_EntityRaycastFloor6(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &this->bgId, - &this->dyna.actor, &actorPosition, chkDist); + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor6(&globalCtx->colCtx, &this->dyna.actor.floorPoly, + &this->bgId, &this->dyna.actor, &actorPosition, chkDist); - if ((this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) >= -0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; return true; } return false; @@ -182,9 +181,9 @@ f32 func_808B3DDC(BgSpot15Rrbox* this, GlobalContext* globalCtx) { func_808B39E8(&position, &scale, this->unk_16C, this->unk_170); - position.x += actor->posRot.pos.x; - position.y += actor->pos4.y; - position.z += actor->posRot.pos.z; + position.x += actor->world.pos.x; + position.y += actor->prevPos.y; + position.z += actor->world.pos.z; yIntersect = BgCheck_EntityRaycastFloor6(&globalCtx->colCtx, &actor->floorPoly, &bgId, actor, &position, 0); @@ -266,12 +265,12 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { sign = this->unk_17C >= 0.0f ? 1.0f : -1.0f; tempUnk178 = (f32)sign * this->unk_178; - actor->posRot.pos.x = actor->initPosRot.pos.x + (tempUnk178 * this->unk_16C); - actor->posRot.pos.z = actor->initPosRot.pos.z + (tempUnk178 * this->unk_170); + actor->world.pos.x = actor->home.pos.x + (tempUnk178 * this->unk_16C); + actor->world.pos.z = actor->home.pos.z + (tempUnk178 * this->unk_170); if (!func_808B3F58(this, globalCtx)) { - actor->initPosRot.pos.x = actor->posRot.pos.x; - actor->initPosRot.pos.z = actor->posRot.pos.z; + actor->home.pos.x = actor->world.pos.x; + actor->home.pos.z = actor->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; @@ -285,8 +284,8 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { if (func_808B3A40(this, globalCtx)) { func_80078884(NA_SE_SY_CORRECT_CHIME); } - actor->initPosRot.pos.x = actor->posRot.pos.x; - actor->initPosRot.pos.z = actor->posRot.pos.z; + actor->home.pos.x = actor->world.pos.x; + actor->home.pos.z = actor->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; @@ -302,12 +301,12 @@ void func_808B4380(BgSpot15Rrbox* this, GlobalContext* globalCtx) { this->dyna.actor.velocity.y = 0.0f; this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.gravity = -1.0f; - this->dyna.actor.groundY = func_808B3DDC(this, globalCtx); + this->dyna.actor.floorHeight = func_808B3DDC(this, globalCtx); this->actionFunc = func_808B43D0; } void func_808B43D0(BgSpot15Rrbox* this, GlobalContext* globalCtx) { - f32 groundY; + f32 floorHeight; Player* player = PLAYER; Actor* actor = &this->dyna.actor; @@ -318,7 +317,7 @@ void func_808B43D0(BgSpot15Rrbox* this, GlobalContext* globalCtx) { Actor_MoveForward(actor); - if (actor->posRot.pos.y <= -31990.0f) { + if (actor->world.pos.y <= -31990.0f) { osSyncPrintf("Warning : ロンロン木箱落ちすぎた(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot15_rrbox.c", 599, actor->params); @@ -327,10 +326,10 @@ void func_808B43D0(BgSpot15Rrbox* this, GlobalContext* globalCtx) { return; } - groundY = actor->groundY; + floorHeight = actor->floorHeight; - if ((groundY - actor->posRot.pos.y) >= -0.001f) { - actor->posRot.pos.y = groundY; + if ((floorHeight - actor->world.pos.y) >= -0.001f) { + actor->world.pos.y = floorHeight; func_808B4084(this, globalCtx); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_WOOD_BOUND); } @@ -353,9 +352,9 @@ void BgSpot15Rrbox_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_168 > 0) { this->unk_168--; } - this->dyna.actor.posRot.rot.y = this->dyna.unk_158; - this->unk_16C = Math_SinS(this->dyna.actor.posRot.rot.y); - this->unk_170 = Math_CosS(this->dyna.actor.posRot.rot.y); + this->dyna.actor.world.rot.y = this->dyna.unk_158; + this->unk_16C = Math_SinS(this->dyna.actor.world.rot.y); + this->unk_170 = Math_CosS(this->dyna.actor.world.rot.y); this->actionFunc(this, globalCtx); } 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 5ad99f068c..130280a4a4 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 @@ -21,7 +21,7 @@ void func_808B4A04(BgSpot15Saku* this, GlobalContext* globalCtx); const ActorInit Bg_Spot15_Saku_InitVars = { ACTOR_BG_SPOT15_SAKU, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_SPOT15_OBJ, sizeof(BgSpot15Saku), @@ -45,11 +45,11 @@ void BgSpot15Saku_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.x = 0.1f; thisx->scale.y = 0.1f; thisx->scale.z = 0.1f; - this->unk_170 = thisx->posRot.pos.x; - this->unk_174 = thisx->posRot.pos.y; - this->unk_178 = thisx->posRot.pos.z; + this->unk_170 = thisx->world.pos.x; + this->unk_174 = thisx->world.pos.y; + this->unk_178 = thisx->world.pos.z; if ((gSaveContext.infTable[7] & 2) != 0) { - thisx->posRot.pos.z = 2659.0f; + thisx->world.pos.z = 2659.0f; } this->actionFunc = func_808B4930; } @@ -71,8 +71,8 @@ void func_808B4978(BgSpot15Saku* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if (!this->unk_17C) { Audio_PlayActorSound2(thisx, NA_SE_EV_METALGATE_OPEN - SFX_FLAG); - thisx->posRot.pos.z -= 2.0f; - if (thisx->posRot.pos.z < 2660.0f) { + thisx->world.pos.z -= 2.0f; + if (thisx->world.pos.z < 2660.0f) { Audio_PlayActorSound2(thisx, NA_SE_EV_BRIDGE_OPEN_STOP); this->unk_17C = 0x1E; this->actionFunc = func_808B4A04; 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 595b3808cd..044cfa5516 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 @@ -114,7 +114,7 @@ static s16 D_808B5EB0[][7] = { const ActorInit Bg_Spot16_Bombstone_InitVars = { ACTOR_BG_SPOT16_BOMBSTONE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT16_OBJ, sizeof(BgSpot16Bombstone), @@ -156,9 +156,9 @@ void func_808B4C4C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { Collider_InitJntSph(globalCtx, &this->colliderJntSph); Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderElements); - this->colliderJntSph.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->colliderJntSph.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + 50.0f; - this->colliderJntSph.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->colliderJntSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->colliderJntSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y + 50.0f; + this->colliderJntSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; this->colliderJntSph.elements[0].dim.worldSphere.radius = 120; } @@ -167,9 +167,9 @@ void func_808B4D04(BgSpot16Bombstone* this, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->colliderCylinder); Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); - this->colliderCylinder.dim.pos.x += (s16)this->actor.posRot.pos.x; - this->colliderCylinder.dim.pos.y += (s16)this->actor.posRot.pos.y; - this->colliderCylinder.dim.pos.z += (s16)this->actor.posRot.pos.z; + this->colliderCylinder.dim.pos.x += (s16)this->actor.world.pos.x; + this->colliderCylinder.dim.pos.y += (s16)this->actor.world.pos.y; + this->colliderCylinder.dim.pos.z += (s16)this->actor.world.pos.z; } s32 func_808B4D9C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { @@ -207,14 +207,14 @@ s32 func_808B4E58(BgSpot16Bombstone* this, GlobalContext* globalctx) { this->unk_210 = (f32)D_808B5DD8[actor->params][3]; this->unk_212 = (f32)D_808B5DD8[actor->params][4]; - actor->posRot.rot.y = D_808B5DD8[actor->params][5]; + actor->world.rot.y = D_808B5DD8[actor->params][5]; - sinValue = Math_SinS(this->actor.posRot.rot.y); - cosValue = Math_CosS(this->actor.posRot.rot.y); + sinValue = Math_SinS(this->actor.world.rot.y); + cosValue = Math_CosS(this->actor.world.rot.y); - actor->posRot.pos.x = (sinValue * sinCosPosFactor) + actor->initPosRot.pos.x; - actor->posRot.pos.y = D_808B5DD8[actor->params][6] + actor->initPosRot.pos.y; - actor->posRot.pos.z = (cosValue * sinCosPosFactor) + actor->initPosRot.pos.z; + actor->world.pos.x = (sinValue * sinCosPosFactor) + actor->home.pos.x; + actor->world.pos.y = D_808B5DD8[actor->params][6] + actor->home.pos.y; + actor->world.pos.z = (cosValue * sinCosPosFactor) + actor->home.pos.z; actor->shape.rot.x = D_808B5DD8[actor->params][7]; actor->shape.rot.y = D_808B5DD8[actor->params][8]; @@ -280,13 +280,13 @@ void BgSpot16Bombstone_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot16Bombstone_SpawnDust(BgSpot16Bombstone* this, GlobalContext* globalCtx) { f32 scaleX1 = this->actor.scale.x * 150; s16 scaleX2 = this->actor.scale.x * 250; - Vec3f posRot; + Vec3f world; - posRot.x = this->actor.posRot.pos.x; - posRot.y = this->actor.posRot.pos.y + 50.0f; - posRot.z = this->actor.posRot.pos.z; + world.x = this->actor.world.pos.x; + world.y = this->actor.world.pos.y + 50.0f; + world.z = this->actor.world.pos.z; - func_80033480(globalCtx, &posRot, scaleX1, 2, scaleX2, 0xA0, 1); + func_80033480(globalCtx, &world, scaleX1, 2, scaleX2, 0xA0, 1); } void func_808B5240(BgSpot16Bombstone* this, GlobalContext* globalCtx) { @@ -294,7 +294,7 @@ void func_808B5240(BgSpot16Bombstone* this, GlobalContext* globalCtx) { f32 tempUnk2; s16 index; Vec3f position; - Vec3f* actorPosition = &this->actor.posRot.pos; + Vec3f* actorPosition = &this->actor.world.pos; if (1) {} @@ -329,8 +329,8 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl s16 scale; if (this->actor.params == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 5); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 5); index = 3; } else { index = 0; @@ -338,9 +338,9 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl if (index < ARRAY_COUNT(D_808B6074)) { do { - pos.x = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.posRot.pos.x; - pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.posRot.pos.y) + 8.0f; - pos.z = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.posRot.pos.z; + pos.x = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.world.pos.x; + pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.world.pos.y) + 8.0f; + pos.z = ((Rand_ZeroOne() - 0.5f) * 8.0f) + this->actor.world.pos.z; velocity.x = (Rand_ZeroOne() - 0.5f) * 16.0f; velocity.y = (Rand_ZeroOne() * 14.0) + (fabsf(this->actor.velocity.y) * velocityYMultiplier); @@ -348,7 +348,7 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl scale = D_808B6074[index] * this->actor.scale.x * 3; - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, -420, 0x31, 0xF, 0xF, 0, scale, 2, + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, -420, 0x31, 0xF, 0xF, 0, scale, 2, 0x40, 160, KAKERA_COLOR_NONE, OBJECT_BOMBIWA, D_060009E0); index += 1; } while (index != ARRAY_COUNT(D_808B6074)); @@ -357,12 +357,12 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, GlobalContext* gl void func_808B561C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { s32 index; - PosRot* posRot; + PosRot* world; - posRot = &this->actor.posRot; + world = &this->actor.world; for (index = 0; index < ARRAY_COUNT(D_808B6088); index++) { - if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, posRot->pos.x, posRot->pos.y, - posRot->pos.z, 0, 0, 0, D_808B6088[index]) == NULL) { + if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_SPOT16_BOMBSTONE, world->pos.x, world->pos.y, + world->pos.z, 0, 0, 0, D_808B6088[index]) == NULL) { break; } } @@ -375,18 +375,19 @@ void func_808B56BC(BgSpot16Bombstone* this, GlobalContext* globalCtx) { s32 yawDiff; s32 absYawDiff; - if (this->actor.xzDistToLink < 130.0f && this->actor.yDistToLink < 160.0f && this->actor.yDistToLink >= -10.0f) { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + if (this->actor.xzDistToPlayer < 130.0f && this->actor.yDistToPlayer < 160.0f && + this->actor.yDistToPlayer >= -10.0f) { + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; absYawDiff = ABS(yawDiff); adjustedYawDiff = absYawDiff - 0x3FFF; if (adjustedYawDiff > 0) { - sinValue = Math_SinS(adjustedYawDiff) * this->actor.xzDistToLink; + sinValue = Math_SinS(adjustedYawDiff) * this->actor.xzDistToPlayer; if (sinValue >= 0.0f) { - player->actor.posRot.pos.x += sinValue * this->sinRotation; - player->actor.posRot.pos.z += sinValue * this->cosRotation; + player->actor.world.pos.x += sinValue * this->sinRotation; + player->actor.world.pos.z += sinValue * this->cosRotation; } else { osSyncPrintf("Error 補正出来ない(%s %d)(arg_data 0x%04x)(hosei_angY %x)\n", "../z_bg_spot16_bombstone.c", 935, this->actor.params, adjustedYawDiff); @@ -407,9 +408,9 @@ void func_808B57E0(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (sPlayerBomb != NULL) { if (sPlayerBomb->actor.update == NULL) { sPlayerBomb = NULL; - } else if (sTimer <= 0 && sPlayerBomb->actor.posRot.pos.y < 1400.0f && - Math3D_Dist1DSq(sPlayerBomb->actor.posRot.pos.x + 1579.0f, - sPlayerBomb->actor.posRot.pos.z + 790.0f) < SQ(400.0f) && + } else if (sTimer <= 0 && sPlayerBomb->actor.world.pos.y < 1400.0f && + Math3D_Dist1DSq(sPlayerBomb->actor.world.pos.x + 1579.0f, sPlayerBomb->actor.world.pos.z + 790.0f) < + SQ(400.0f) && sPlayerBomb->actor.params == 0) { currentBomb = sPlayerBomb; if (currentBomb->timer > 0) { @@ -419,7 +420,7 @@ void func_808B57E0(BgSpot16Bombstone* this, GlobalContext* globalCtx) { } } else if (player->stateFlags1 & 0x800) { playerHeldActor = player->heldActor; - if (playerHeldActor != NULL && playerHeldActor->type == ACTORTYPE_EXPLOSIVES && + if (playerHeldActor != NULL && playerHeldActor->category == ACTORCAT_EXPLOSIVE && playerHeldActor->id == ACTOR_EN_BOMBF) { sPlayerBomb = (EnBombf*)playerHeldActor; } @@ -516,12 +517,12 @@ void func_808B5B6C(BgSpot16Bombstone* this, GlobalContext* globalCtx) { if (actor->bgCheckFlags & 8 || (actor->bgCheckFlags & 1 && actor->velocity.y < 0.0f)) { BgSpot16Bombstone_SpawnFragments(this, globalCtx); BgSpot16Bombstone_SpawnDust(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 20, NA_SE_EV_ROCK_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &actor->world.pos, 20, NA_SE_EV_ROCK_BROKEN); Actor_Kill(actor); return; } - func_8002E4B4(globalCtx, actor, 17.5f, 35.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, actor, 17.5f, 35.0f, 0.0f, 5); } void BgSpot16Bombstone_Update(Actor* thisx, GlobalContext* globalCtx) { 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 afde11bf87..00fc830817 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 @@ -21,7 +21,7 @@ void BgSpot16Doughnut_DrawExpanding(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot16_Doughnut_InitVars = { ACTOR_BG_SPOT16_DOUGHNUT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_EFC_DOUGHNUT, sizeof(BgSpot16Doughnut), 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 a6fa3f63b8..e67a642ee6 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 @@ -18,7 +18,7 @@ void BgSpot17Bakudankabe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot17_Bakudankabe_InitVars = { ACTOR_BG_SPOT17_BAKUDANKABE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT17_OBJ, sizeof(BgSpot17Bakudankabe), @@ -64,9 +64,9 @@ void func_808B6BC0(BgSpot17Bakudankabe* this, GlobalContext* globalCtx) { temp1 = (Rand_ZeroOne() - 0.5f) * 140.0f; temp2 = (Rand_ZeroOne() - 0.5f) * 20.0f; - burstDepthY.x = this->dyna.actor.posRot.pos.x + temp2 * sinY + (temp1 * cosY); - burstDepthY.y = this->dyna.actor.posRot.pos.y + 30.0f + (i * 6.5f); - burstDepthY.z = this->dyna.actor.posRot.pos.z + temp2 * cosY - (temp1 * sinY); + burstDepthY.x = this->dyna.actor.world.pos.x + temp2 * sinY + (temp1 * cosY); + burstDepthY.y = this->dyna.actor.world.pos.y + 30.0f + (i * 6.5f); + burstDepthY.z = this->dyna.actor.world.pos.z + temp2 * cosY - (temp1 * sinY); burstDepthX.y = (Rand_ZeroOne() - 0.2f) * 12.0f; scale = Rand_ZeroOne() * 55.0f + 8.0f; @@ -87,7 +87,7 @@ void func_808B6BC0(BgSpot17Bakudankabe* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &burstDepthY, &burstDepthX, &burstDepthY, gravityInfluence, rotationSpeed, 0x1E, 4, 0, scale, 1, 3, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A880); } - Math_Vec3f_Copy(&burstDepthY, &this->dyna.actor.posRot.pos); + Math_Vec3f_Copy(&burstDepthY, &this->dyna.actor.world.pos); func_80033480(globalCtx, &burstDepthY, 60.0f, 4, 110, 160, 1); burstDepthY.y += 40.0f; func_80033480(globalCtx, &burstDepthY, 60.0f, 4, 120, 160, 1); @@ -117,10 +117,10 @@ void BgSpot17Bakudankabe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot17Bakudankabe_Update(Actor* thisx, GlobalContext* globalCtx) { BgSpot17Bakudankabe* this = THIS; - if (this->dyna.actor.xzDistToLink < 650.0f && func_80033684(globalCtx, &this->dyna.actor) != NULL) { + if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(globalCtx, &this->dyna.actor) != NULL) { func_808B6BC0(this, globalCtx); Flags_SetSwitch(globalCtx, (this->dyna.actor.params & 0x3F)); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); } 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 86ec989efd..87e7de0e07 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 @@ -19,7 +19,7 @@ void func_808B7478(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot17_Funen_InitVars = { ACTOR_BG_SPOT17_FUNEN, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_SPOT17_OBJ, sizeof(BgSpot17Funen), 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 29b00e8f01..c7d3920b1b 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 @@ -28,7 +28,7 @@ extern Gfx D_060018B0[]; const ActorInit Bg_Spot18_Basket_InitVars = { ACTOR_BG_SPOT18_BASKET, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Basket), @@ -108,9 +108,9 @@ void func_808B7770(BgSpot18Basket* this, GlobalContext* globalCtx, f32 arg2) { randomValue = (Rand_ZeroOne() * 35.0f) + 35.0f; - position.x = (randomValue * sinValue) + this->dyna.actor.posRot.pos.x; - position.y = this->dyna.actor.posRot.pos.y + 10.0f; - position.z = (randomValue * cosValue) + this->dyna.actor.posRot.pos.z; + position.x = (randomValue * sinValue) + this->dyna.actor.world.pos.x; + position.y = this->dyna.actor.world.pos.y + 10.0f; + position.z = (randomValue * cosValue) + this->dyna.actor.world.pos.z; velocity.x = sinValue; velocity.y = 0.0f; @@ -145,9 +145,9 @@ void BgSpot18Basket_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, actor, colHeader); Actor_ProcessInitChain(actor, sInitChain); - ActorShape_Init(&actor->shape, 0.0f, ActorShadow_DrawFunc_Circle, 15.0f); - actor->initPosRot.pos.y += 0.01f; - actor->posRot.pos.y = actor->initPosRot.pos.y; + ActorShape_Init(&actor->shape, 0.0f, ActorShadow_DrawCircle, 15.0f); + actor->home.pos.y += 0.01f; + actor->world.pos.y = actor->home.pos.y; if (Flags_GetSwitch(globalCtx, (actor->params >> 8) & 0x3F)) { func_808B7BB0(this); @@ -155,8 +155,8 @@ void BgSpot18Basket_Init(Actor* thisx, GlobalContext* globalCtx) { } func_808B7AEC(this); - Actor_SpawnAsChild(&globalCtx->actorCtx, actor, globalCtx, ACTOR_BG_SPOT18_FUTA, actor->posRot.pos.x, - actor->posRot.pos.y, actor->posRot.pos.z, actor->shape.rot.x, actor->shape.rot.y + 0x1555, + Actor_SpawnAsChild(&globalCtx->actorCtx, actor, globalCtx, ACTOR_BG_SPOT18_FUTA, actor->world.pos.x, + actor->world.pos.y, actor->world.pos.z, actor->shape.rot.x, actor->shape.rot.y + 0x1555, actor->shape.rot.z, -1); if (actor->child == NULL) { @@ -216,18 +216,18 @@ void func_808B7BCC(BgSpot18Basket* this, GlobalContext* globalCtx) { this->unk_20E += this->unk_20C; - this->dyna.actor.posRot.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.z; if (this->colliderJntSph.base.acFlags & AC_HIT) { colliderBaseAc = this->colliderJntSph.base.ac; if (colliderBaseAc != NULL) { - positionDiff = colliderBaseAc->posRot.pos.y - this->dyna.actor.posRot.pos.y; + positionDiff = colliderBaseAc->world.pos.y - this->dyna.actor.world.pos.y; if (positionDiff > 120.0f && positionDiff < 200.0f) { - if (Math3D_Dist2DSq(colliderBaseAc->posRot.pos.z, this->colliderJntSph.base.ac->posRot.pos.x, - this->dyna.actor.posRot.pos.z, this->dyna.actor.posRot.pos.x) < SQ(32.0f)) { + if (Math3D_Dist2DSq(colliderBaseAc->world.pos.z, this->colliderJntSph.base.ac->world.pos.x, + this->dyna.actor.world.pos.z, this->dyna.actor.world.pos.x) < SQ(32.0f)) { func_800800F8(globalCtx, 4210, 240, this, 0); func_808B7D38(this); func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); @@ -266,8 +266,8 @@ void func_808B7D50(BgSpot18Basket* this, GlobalContext* globalCtx) { this->unk_20E += this->unk_20C; - this->dyna.actor.posRot.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->unk_20E) * this->unk_208) + this->dyna.actor.home.pos.z; this->unk_212 += 0xBB8; @@ -369,16 +369,16 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { EnItem00* collectible; if (this->unk_216 == 1) { - tempVector.x = actor->posRot.pos.x; - tempVector.y = actor->posRot.pos.y + 170.0f; - tempVector.z = actor->posRot.pos.z; + tempVector.x = actor->world.pos.x; + tempVector.y = actor->world.pos.y + 170.0f; + tempVector.z = actor->world.pos.z; if (this->unk_218 == 0) { for (i = 0; i < ARRAY_COUNT(D_808B85E4); i++) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_BOMBS_A); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[i]; + collectible->actor.world.rot.y = D_808B85E4[i]; } } } else if (this->unk_218 == 1) { @@ -386,7 +386,7 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_GREEN); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[i]; + collectible->actor.world.rot.y = D_808B85E4[i]; } } } else if (this->unk_218 == 2) { @@ -394,14 +394,14 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_PURPLE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[1]; + collectible->actor.world.rot.y = D_808B85E4[1]; } } else { collectible = Item_DropCollectible(globalCtx, &tempVector, ((actor->params & 0x3F) << 8) | ITEM00_HEART_PIECE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[1]; + collectible->actor.world.rot.y = D_808B85E4[1]; this->unk_21A = 1; } } @@ -409,13 +409,13 @@ void func_808B81A0(BgSpot18Basket* this, GlobalContext* globalCtx) { collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_RED); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[0]; + collectible->actor.world.rot.y = D_808B85E4[0]; } collectible = Item_DropCollectible(globalCtx, &tempVector, ITEM00_RUPEE_BLUE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; - collectible->actor.posRot.rot.y = D_808B85E4[2]; + collectible->actor.world.rot.y = D_808B85E4[2]; } } } else if (this->unk_216 == 2) { @@ -435,8 +435,8 @@ void BgSpot18Basket_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_216++; this->actionFunc(this, globalCtx); - this->dyna.actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &temp, - &this->dyna.actor, &this->dyna.actor.posRot); + this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &temp, + &this->dyna.actor, &this->dyna.actor.world); if (this->actionFunc != func_808B7AFC) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderJntSph); if (this->actionFunc != func_808B7B6C) { 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 224b8f9605..1e32042c28 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 @@ -17,7 +17,7 @@ void BgSpot18Futa_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Spot18_Futa_InitVars = { ACTOR_BG_SPOT18_FUTA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Futa), 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 c1741f25b3..e638ce8286 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 @@ -32,7 +32,7 @@ void func_808B9040(BgSpot18Obj* this, GlobalContext* globalCtx); const ActorInit Bg_Spot18_Obj_InitVars = { ACTOR_BG_SPOT18_OBJ, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Obj), @@ -163,10 +163,8 @@ s32 func_808B8BB4(BgSpot18Obj* this, GlobalContext* globalCtx) { func_808B9030(this); } else if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) { func_808B9030(this); - this->dyna.actor.posRot.pos.x = - (Math_SinS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_CosS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; } else { func_808B8E64(this); } @@ -212,7 +210,7 @@ void func_808B8DD0(BgSpot18Obj* this, GlobalContext* globalCtx) { } void func_808B8DDC(BgSpot18Obj* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->dyna.actor, 20.0f, 46.0f, 0.0f, 28); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 20.0f, 46.0f, 0.0f, 28); } void func_808B8E20(BgSpot18Obj* this, GlobalContext* globalCtx) { @@ -242,7 +240,7 @@ void func_808B8E7C(BgSpot18Obj* this, GlobalContext* globalCtx) { void func_808B8EE0(BgSpot18Obj* this) { this->actionFunc = func_808B8F08; - this->dyna.actor.posRot.rot.y = 0; + this->dyna.actor.world.rot.y = 0; this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.velocity.y = 0.0f; @@ -257,13 +255,11 @@ void func_808B8F08(BgSpot18Obj* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); func_808B8DDC(this, globalCtx); - if (Math3D_Dist2DSq(this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.z, this->dyna.actor.initPosRot.pos.x, - this->dyna.actor.initPosRot.pos.z) >= 6400.0f) { + if (Math3D_Dist2DSq(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.x, + this->dyna.actor.home.pos.z) >= 6400.0f) { func_808B9030(this); - this->dyna.actor.posRot.pos.x = - (Math_SinS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_CosS(this->dyna.actor.posRot.rot.y) * 80.0f) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); 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 abd162665b..eb1db394c0 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 @@ -23,7 +23,7 @@ void func_808B971C(BgSpot18Shutter* this, GlobalContext* globalCtx); const ActorInit Bg_Spot18_Shutter_InitVars = { ACTOR_BG_SPOT18_SHUTTER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SPOT18_OBJ, sizeof(BgSpot18Shutter), @@ -53,22 +53,22 @@ void BgSpot18Shutter_Init(Actor* thisx, GlobalContext* globalCtx) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { if (gSaveContext.infTable[16] & 0x200) { this->actionFunc = func_808B95AC; - this->dyna.actor.posRot.pos.y += 180.0f; + this->dyna.actor.world.pos.y += 180.0f; } else { this->actionFunc = func_808B9618; } } else { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { this->actionFunc = func_808B95AC; - this->dyna.actor.posRot.pos.y += 180.0f; + this->dyna.actor.world.pos.y += 180.0f; } else { this->actionFunc = func_808B95B8; } } } else { if (gSaveContext.infTable[16] & 0x200) { - this->dyna.actor.posRot.pos.x += 125.0f * Math_CosS(this->dyna.actor.posRot.rot.y); - this->dyna.actor.posRot.pos.z -= 125.0f * Math_SinS(this->dyna.actor.posRot.rot.y); + this->dyna.actor.world.pos.x += 125.0f * Math_CosS(this->dyna.actor.world.rot.y); + this->dyna.actor.world.pos.z -= 125.0f * Math_SinS(this->dyna.actor.world.rot.y); this->actionFunc = func_808B95AC; } else { this->actionFunc = func_808B9618; @@ -90,7 +90,7 @@ void func_808B95AC(BgSpot18Shutter* this, GlobalContext* globalCtx) { void func_808B95B8(BgSpot18Shutter* this, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { - Actor_SetHeight(&this->dyna.actor, 70.0f); + Actor_SetFocus(&this->dyna.actor, 70.0f); func_80080480(globalCtx, this); this->actionFunc = func_808B9698; } @@ -98,7 +98,7 @@ void func_808B95B8(BgSpot18Shutter* this, GlobalContext* globalCtx) { void func_808B9618(BgSpot18Shutter* this, GlobalContext* globalCtx) { if (gSaveContext.infTable[16] & 0x200) { - Actor_SetHeight(&this->dyna.actor, 70.0f); + Actor_SetFocus(&this->dyna.actor, 70.0f); if (((this->dyna.actor.params >> 8) & 1) == 0) { this->actionFunc = func_808B9698; } else { @@ -109,7 +109,7 @@ void func_808B9618(BgSpot18Shutter* this, GlobalContext* globalCtx) { } void func_808B9698(BgSpot18Shutter* this, GlobalContext* globalCtx) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 180.0f, 1.44f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 180.0f, 1.44f)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); this->actionFunc = func_808B95AC; } else { @@ -118,13 +118,11 @@ void func_808B9698(BgSpot18Shutter* this, GlobalContext* globalCtx) { } void func_808B971C(BgSpot18Shutter* this, GlobalContext* globalCtx) { - f32 sin = Math_SinS(this->dyna.actor.posRot.rot.y); - f32 cos = Math_CosS(this->dyna.actor.posRot.rot.y); + f32 sin = Math_SinS(this->dyna.actor.world.rot.y); + f32 cos = Math_CosS(this->dyna.actor.world.rot.y); s32 flag = - Math_StepToF(&this->dyna.actor.posRot.pos.x, this->dyna.actor.initPosRot.pos.x + (125.0f * cos), fabsf(cos)) & - 1; - flag &= - Math_StepToF(&this->dyna.actor.posRot.pos.z, this->dyna.actor.initPosRot.pos.z - (125.0f * sin), fabsf(sin)); + Math_StepToF(&this->dyna.actor.world.pos.x, this->dyna.actor.home.pos.x + (125.0f * cos), fabsf(cos)) & 1; + flag &= Math_StepToF(&this->dyna.actor.world.pos.z, this->dyna.actor.home.pos.z - (125.0f * sin), fabsf(sin)); if (flag) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); 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 813ab28625..290f41f2ac 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 @@ -12,7 +12,7 @@ void BgSstFloor_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Sst_Floor_InitVars = { ACTOR_BG_SST_FLOOR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SST, sizeof(BgSstFloor), 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 ec0d7c3cde..18ee20f61a 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 @@ -19,7 +19,7 @@ extern UNK_TYPE D_06008190; /* const ActorInit Bg_Toki_Hikari_InitVars = { ACTOR_BG_TOKI_HIKARI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_TOKI_OBJECTS, sizeof(BgTokiHikari), 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 15919f8ba6..a6067aa3d3 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 @@ -27,7 +27,7 @@ extern CutsceneData D_808BBD90[]; const ActorInit Bg_Toki_Swd_InitVars = { ACTOR_BG_TOKI_SWD, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_TOKI_OBJECTS, sizeof(BgTokiSwd), @@ -70,7 +70,7 @@ void BgTokiSwd_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(thisx, sInitChain); - this->actor.shape.unk_08 = 800.0f; + this->actor.shape.yOffset = 800.0f; BgTokiSwd_SetupAction(thisx, func_808BAF40); if (LINK_IS_ADULT) { 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 aeffc0b3ed..48a52c1a92 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -29,7 +29,7 @@ void func_808BCAF0(BgTreemouth* this, GlobalContext* globalCtx); const ActorInit Bg_Treemouth_InitVars = { ACTOR_BG_TREEMOUTH, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SPOT04_OBJECTS, sizeof(BgTreemouth), @@ -40,7 +40,7 @@ const ActorInit Bg_Treemouth_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 5, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 8000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE), @@ -69,7 +69,7 @@ void BgTreemouth_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06000E94, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); - Actor_SetHeight(thisx, 50.0f); + Actor_SetFocus(thisx, 50.0f); if ((gSaveContext.sceneSetupIndex < 4) && LINK_IS_CHILD) { BgTreemouth_SetupAction(this, func_808BC8B8); @@ -144,7 +144,7 @@ void func_808BC8B8(BgTreemouth* this, GlobalContext* globalCtx) { if (Flags_GetEventChkInf(0xC)) { if (func_8002E12C(&this->dyna.actor, 1658.0f, 0x7530)) { this->dyna.actor.flags |= 1; - if (this->dyna.actor.unk_10C != 0) { + if (this->dyna.actor.isTargeted) { this->dyna.actor.flags &= ~1; globalCtx->csCtx.segment = D_808BD2A0; gSaveContext.cutsceneTrigger = 1; @@ -168,9 +168,9 @@ void func_808BC9EC(BgTreemouth* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state == 3) { if (func_8002E12C(&this->dyna.actor, 350.0f, 0x7530)) { - player->actor.posRot.pos.x = 3827.0f; - player->actor.posRot.pos.y = -161.0f; - player->actor.posRot.pos.z = -1142.0f; + player->actor.world.pos.x = 3827.0f; + player->actor.world.pos.y = -161.0f; + player->actor.world.pos.z = -1142.0f; } globalCtx->csCtx.frames = 0; @@ -219,9 +219,9 @@ void BgTreemouth_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); unk_168 = this->unk_168; - thisx->posRot.pos.x = (unk_168 * -160.0f) + 4029.0f; - thisx->posRot.pos.y = (unk_168 * -399.0f) + 136.0f; - thisx->posRot.pos.z = (unk_168 * 92.0f) + -1255.0f; + thisx->world.pos.x = (unk_168 * -160.0f) + 4029.0f; + thisx->world.pos.y = (unk_168 * -399.0f) + 136.0f; + thisx->world.pos.z = (unk_168 * 92.0f) + -1255.0f; } void BgTreemouth_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 a2e97d9783..1d7a51e0ec 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -17,7 +17,7 @@ void BgUmaJump_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Bg_Umajump_InitVars = { ACTOR_BG_UMAJUMP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_UMAJUMP, sizeof(BgUmaJump), 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 8bc1271a91..22bf754a2b 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 @@ -12,7 +12,7 @@ void BgVbSima_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Bg_Vb_Sima_InitVars = { ACTOR_BG_VB_SIMA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_FD, sizeof(BgVbSima), 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 7314922868..712c57326f 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 @@ -23,7 +23,7 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx); const ActorInit Bg_Ydan_Hasi_InitVars = { ACTOR_BG_YDAN_HASI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_YDAN_OBJECTS, sizeof(BgYdanHasi), @@ -58,9 +58,9 @@ void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); if (thisx->params == 1) { // Water the moving platform floats on in B1. Never runs in Master Quest - thisx->initPosRot.pos.y = (thisx->initPosRot.pos.y + -5.0f); - thisx->posRot.pos.y = thisx->initPosRot.pos.y; - waterBox->ySurface = thisx->initPosRot.pos.y; + thisx->home.pos.y = (thisx->home.pos.y + -5.0f); + thisx->world.pos.y = thisx->home.pos.y; + waterBox->ySurface = thisx->home.pos.y; this->actionFunc = BgYdanHasi_InitWater; } else { if (thisx->params == 0) { @@ -68,14 +68,14 @@ void BgYdanHasi_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader_GetVirtual(&D_06007798, &colHeader); thisx->scale.z = 0.15f; thisx->scale.x = 0.15f; - thisx->posRot.pos.y = (waterBox->ySurface + 20.0f); + thisx->world.pos.y = (waterBox->ySurface + 20.0f); this->actionFunc = BgYdanHasi_UpdateFloatingBlock; } else { // 3 platforms on 2F CollisionHeader_GetVirtual(&D_06005780, &colHeader); thisx->draw = NULL; this->actionFunc = BgYdanHasi_SetupThreeBlocks; - Actor_SetHeight(thisx, 40.0f); + Actor_SetFocus(thisx, 40.0f); } this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); } @@ -95,12 +95,12 @@ void BgYdanHasi_UpdateFloatingBlock(BgYdanHasi* this, GlobalContext* globalCtx) WaterBox* waterBox; framesAfterMath = sinf((globalCtx->gameplayFrames & 0xFF) * 0.024543693f) * 165.0f; - this->dyna.actor.posRot.pos.x = - ((Math_SinS(this->dyna.actor.posRot.rot.y) * framesAfterMath) + this->dyna.actor.initPosRot.pos.x); - this->dyna.actor.posRot.pos.z = - ((Math_CosS(this->dyna.actor.posRot.rot.y) * framesAfterMath) + this->dyna.actor.initPosRot.pos.z); + this->dyna.actor.world.pos.x = + ((Math_SinS(this->dyna.actor.world.rot.y) * framesAfterMath) + this->dyna.actor.home.pos.x); + this->dyna.actor.world.pos.z = + ((Math_CosS(this->dyna.actor.world.rot.y) * framesAfterMath) + this->dyna.actor.home.pos.z); waterBox = &globalCtx->colCtx.colHeader->waterBoxes[1]; - this->dyna.actor.posRot.pos.y = waterBox->ySurface + 20.0f; + this->dyna.actor.world.pos.y = waterBox->ySurface + 20.0f; if (this->timer != 0) { this->timer--; } @@ -108,7 +108,7 @@ void BgYdanHasi_UpdateFloatingBlock(BgYdanHasi* this, GlobalContext* globalCtx) this->timer = 50; } posOffset = sinf(this->timer * 0.12566371f); - this->dyna.actor.posRot.pos.y = (this->dyna.actor.posRot.pos.y + (posOffset + posOffset)); + this->dyna.actor.world.pos.y = (this->dyna.actor.world.pos.y + (posOffset + posOffset)); } void BgYdanHasi_InitWater(BgYdanHasi* this, GlobalContext* globalCtx) { @@ -122,19 +122,19 @@ WaterBox* BgYdanHasi_MoveWater(BgYdanHasi* this, GlobalContext* globalCtx) { WaterBox* waterBox; if (this->timer == 0) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 1.0f) != 0) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f) != 0) { Flags_UnsetSwitch(globalCtx, this->unk_168); this->actionFunc = BgYdanHasi_InitWater; } func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } else { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y - 47.0f, 0.5f)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 47.0f, 0.5f)) { this->actionFunc = BgYdanHasi_DecWaterTimer; } func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); } waterBox = globalCtx->colCtx.colHeader->waterBoxes; - globalCtx->colCtx.colHeader->waterBoxes[1].ySurface = this->dyna.actor.posRot.pos.y; + globalCtx->colCtx.colHeader->waterBoxes[1].ySurface = this->dyna.actor.world.pos.y; if (1) {} return waterBox + 0x1; } @@ -165,7 +165,7 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) { this->timer--; } if (this->timer == 0) { - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 3.0f) != 0) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 3.0f) != 0) { Flags_UnsetSwitch(globalCtx, this->unk_168); this->dyna.actor.draw = NULL; this->actionFunc = BgYdanHasi_SetupThreeBlocks; @@ -174,7 +174,7 @@ void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, GlobalContext* globalCtx) { func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); return; } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 120.0f, 3.0f) == 0) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 120.0f, 3.0f) == 0) { func_8002F948(&this->dyna.actor, NA_SE_EV_ELEVATOR_MOVE - SFX_FLAG); return; } 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 a505aaf54a..f42995c7e3 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 @@ -23,7 +23,7 @@ void func_808BF1EC(BgYdanMaruta* this, GlobalContext* globalCtx); const ActorInit Bg_Ydan_Maruta_InitVars = { ACTOR_BG_YDAN_MARUTA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_YDAN_OBJECTS, sizeof(BgYdanMaruta), @@ -104,9 +104,9 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&D_060066A8, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - thisx->initPosRot.pos.y += -280.0f; + thisx->home.pos.y += -280.0f; if (Flags_GetSwitch(globalCtx, this->unk_168)) { - thisx->posRot.pos.y = thisx->initPosRot.pos.y; + thisx->world.pos.y = thisx->home.pos.y; this->actionFunc = BgYdanMaruta_DoNothing; } else { this->actionFunc = func_808BF078; @@ -117,16 +117,16 @@ void BgYdanMaruta_Init(Actor* thisx, GlobalContext* globalCtx) { cosRotY = Math_CosS(thisx->shape.rot.y); for (i = 0; i < 3; i++) { - sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + thisx->posRot.pos.x; - sp4C[i].y = triInit->dim.vtx[i].y + thisx->posRot.pos.y; - sp4C[i].z = thisx->posRot.pos.z - (triInit->dim.vtx[i].x * sinRotY); + sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + thisx->world.pos.x; + sp4C[i].y = triInit->dim.vtx[i].y + thisx->world.pos.y; + sp4C[i].z = thisx->world.pos.z - (triInit->dim.vtx[i].x * sinRotY); } Collider_SetTrisVertices(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]); - sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + thisx->posRot.pos.x; - sp4C[1].y = triInit->dim.vtx[0].y + thisx->posRot.pos.y; - sp4C[1].z = thisx->posRot.pos.z - (triInit->dim.vtx[2].x * sinRotY); + sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + thisx->world.pos.x; + sp4C[1].y = triInit->dim.vtx[0].y + thisx->world.pos.y; + sp4C[1].z = thisx->world.pos.z - (triInit->dim.vtx[2].x * sinRotY); Collider_SetTrisVertices(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]); } @@ -180,17 +180,15 @@ void func_808BF108(BgYdanMaruta* this, GlobalContext* globalCtx) { temp *= 2; } - this->dyna.actor.posRot.pos.x = - (Math_CosS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.initPosRot.pos.x; - this->dyna.actor.posRot.pos.z = - (Math_SinS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.initPosRot.pos.z; + this->dyna.actor.world.pos.x = (Math_CosS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = (Math_SinS(this->dyna.actor.shape.rot.y) * temp) + this->dyna.actor.home.pos.z; func_8002F974(&this->dyna.actor, NA_SE_EV_TRAP_OBJ_SLIDE - SFX_FLAG); } void func_808BF1EC(BgYdanMaruta* this, GlobalContext* globalCtx) { this->dyna.actor.velocity.y += 1.0f; - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_LADDER_DOUND); this->actionFunc = BgYdanMaruta_DoNothing; } 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 23ab479902..4cce5d3734 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 @@ -18,7 +18,7 @@ extern UNK_TYPE D_06006460; /* const ActorInit Bg_Ydan_Sp_InitVars = { ACTOR_BG_YDAN_SP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_YDAN_OBJECTS, sizeof(BgYdanSp), 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 acbf71e78f..5dedabfe46 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -38,7 +38,7 @@ static BgZgDrawFunc sDrawFuncs[] = { const ActorInit Bg_Zg_InitVars = { ACTOR_BG_ZG, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZG, sizeof(BgZg), @@ -85,8 +85,8 @@ void func_808C0CD4(BgZg* this, GlobalContext* globalCtx) { void func_808C0D08(BgZg* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - thisx->posRot.pos.y += (kREG(16) + 20.0f) * 1.2f; - if ((((kREG(17) + 200.0f) * 1.2f) + thisx->initPosRot.pos.y) <= thisx->posRot.pos.y) { + thisx->world.pos.y += (kREG(16) + 20.0f) * 1.2f; + if ((((kREG(17) + 200.0f) * 1.2f) + thisx->home.pos.y) <= thisx->world.pos.y) { Actor_Kill(thisx); } } 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 74a507add7..f287ff3393 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -41,7 +41,7 @@ extern UNK_TYPE D_0601D934; /* const ActorInit Boss_Dodongo_InitVars = { ACTOR_EN_DODONGO, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_KINGDODONGO, sizeof(BossDodongo), 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 c8c54eb48e..3c3e115a71 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -12,7 +12,7 @@ void BossFd_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Fd_InitVars = { ACTOR_BOSS_FD, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FD, sizeof(BossFd), 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 6d63591a83..fa31868e05 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -12,7 +12,7 @@ void BossFd2_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Fd2_InitVars = { ACTOR_BOSS_FD2, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FD2, sizeof(BossFd2), 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 96bb15eb43..d9dbe0aeb9 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -59,7 +59,7 @@ extern UNK_TYPE D_060114E8; /* const ActorInit Boss_Ganon_InitVars = { ACTOR_BOSS_GANON, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GANON, sizeof(BossGanon), 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 955f7ae390..59750dba52 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -42,7 +42,7 @@ extern UNK_TYPE D_060353C0; /* const ActorInit Boss_Ganon2_InitVars = { ACTOR_BOSS_GANON2, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GANON2, sizeof(BossGanon2), 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 0cd9326856..d2e3fe6a52 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -12,7 +12,7 @@ void BossGanondrof_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Ganondrof_InitVars = { ACTOR_BOSS_GANONDROF, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GND, sizeof(BossGanondrof), 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 4f80de5239..1d896cd6b8 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -12,7 +12,7 @@ void BossGoma_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Goma_InitVars = { ACTOR_BOSS_GOMA, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GOMA, sizeof(BossGoma), 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 d4eaecf626..c57bec444f 100644 --- a/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -12,7 +12,7 @@ void BossMo_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Mo_InitVars = { ACTOR_BOSS_MO, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_MO, sizeof(BossMo), 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 9fdb914f79..4d5ab239ca 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -12,7 +12,7 @@ void BossSst_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Boss_Sst_InitVars = { ACTOR_BOSS_SST, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_SST, sizeof(BossSst), 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 1d57f3d0e0..0f29c3f27e 100644 --- a/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -86,7 +86,7 @@ extern UNK_TYPE D_0603A2D0; /* const ActorInit Boss_Tw_InitVars = { ACTOR_BOSS_TW, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_TW, sizeof(BossTw), 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 cf16102d4a..47acd0531d 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -50,7 +50,7 @@ extern UNK_TYPE D_060199A0; /* const ActorInit Boss_Va_InitVars = { ACTOR_BOSS_VA, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_BV, sizeof(BossVa), 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 dea4149e46..cb9a55e3ed 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_060039D0; /* const ActorInit Demo_6K_InitVars = { ACTOR_DEMO_6K, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(Demo6K), 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 add0640eac..49ed284eed 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -25,7 +25,7 @@ extern UNK_TYPE D_06012014; /* const ActorInit Demo_Du_InitVars = { ACTOR_DEMO_DU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DU, sizeof(DemoDu), 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 314f8b03a1..30ceec946c 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -177,7 +177,7 @@ s32 DemoEc_UpdateSkelAnime(DemoEc* this) { } void DemoEc_UpdateBgFlags(DemoEc* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 30.0f, 25.0f, 30.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 25.0f, 30.0f, 7); } void func_8096D594(DemoEc* this, GlobalContext* globalCtx) { @@ -349,11 +349,11 @@ void DemoEc_SetNpcActionPosRot(DemoEc* this, GlobalContext* globalCtx, s32 actio CsCmdActorAction* npcAction = DemoEc_GetNpcAction(globalCtx, actionIndex); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -363,7 +363,7 @@ void DemoEc_InitIngo(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_060048F4, 0, 0.0f, false); func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_INGO; this->drawConfig = EC_DRAW_INGO; } @@ -384,7 +384,7 @@ void DemoEc_InitTalon(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600BD38, 0, 0.0f, false); func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_TALON; this->drawConfig = EC_DRAW_TALON; } @@ -405,7 +405,7 @@ void DemoEc_InitWindmillMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600196C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_WINDMILL_MAN; this->drawConfig = EC_DRAW_WINDMILL_MAN; } @@ -426,7 +426,7 @@ void DemoEc_InitKokiriBoy(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005670, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_KOKIRI_BOY; this->drawConfig = EC_DRAW_KOKIRI_BOY; } @@ -437,7 +437,7 @@ void DemoEc_InitDancingKokiriBoy(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600513C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_DANCING_KOKIRI_BOY; this->drawConfig = EC_DRAW_KOKIRI_BOY; } @@ -465,7 +465,7 @@ void DemoEc_InitKokiriGirl(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005670, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_KOKIRI_GIRL; this->drawConfig = EC_DRAW_KOKIRI_GIRL; } @@ -476,7 +476,7 @@ void DemoEc_InitDancingKokiriGirl(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600513C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_DANCING_KOKIRI_GIRL; this->drawConfig = EC_DRAW_KOKIRI_GIRL; } @@ -507,7 +507,7 @@ void DemoEc_InitOldMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_OLD_MAN; this->drawConfig = EC_DRAW_OLD_MAN; } @@ -535,7 +535,7 @@ void DemoEc_InitBeardedMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_BEARDED_MAN; this->drawConfig = EC_DRAW_BEARDED_MAN; } @@ -563,7 +563,7 @@ void DemoEc_InitWoman(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_WOMAN; this->drawConfig = EC_DRAW_WOMAN; } @@ -589,7 +589,7 @@ void DemoEc_InitOldWoman(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06005EA8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_OLD_WOMAN; this->drawConfig = EC_DRAW_OLD_WOMAN; } @@ -610,7 +610,7 @@ void DemoEc_InitBossCarpenter(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600164C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_BOSS_CARPENTER; this->drawConfig = EC_DRAW_BOSS_CARPENTER; } @@ -631,7 +631,7 @@ void DemoEc_InitCarpenter(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600164C, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_CARPENTER; this->drawConfig = EC_DRAW_CARPENTER; } @@ -704,7 +704,7 @@ void DemoEc_InitGerudo(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06002254, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_GERUDO; this->drawConfig = EC_DRAW_GERUDO; } @@ -755,7 +755,7 @@ void DemoEc_InitDancingZora(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600C918, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_DANCING_ZORA; this->drawConfig = EC_DRAW_DANCING_ZORA; } @@ -781,7 +781,7 @@ void DemoEc_InitKingZora(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06006C40, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_KING_ZORA; this->drawConfig = EC_DRAW_KING_ZORA; DemoEc_SetEyeTexIndex(this, 3); @@ -866,7 +866,7 @@ void DemoEc_InitMido(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_060095DC, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_MIDO; this->drawConfig = EC_DRAW_MIDO; DemoEc_SetEyeTexIndex(this, 3); @@ -942,7 +942,7 @@ void DemoEc_InitCucco(DemoEc* this, GlobalContext* globalCtx) { DemoEc_ChangeAnimation(this, animation, 0, 0.0f, false); func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_CUCCO; this->drawConfig = EC_DRAW_CUCCO; } @@ -963,7 +963,7 @@ void DemoEc_InitCuccoLady(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06000CD8, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_CUCCO_LADY; this->drawConfig = EC_DRAW_CUCCO_LADY; } @@ -989,7 +989,7 @@ void DemoEc_InitPotionShopOwner(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_POTION_SHOP_OWNER; this->drawConfig = EC_DRAW_POTION_SHOP_OWNER; } @@ -1015,7 +1015,7 @@ void DemoEc_InitMaskShopOwner(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_MASK_SHOP_OWNER; this->drawConfig = EC_DRAW_MASK_SHOP_OWNER; } @@ -1036,7 +1036,7 @@ void DemoEc_InitFishingMan(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_FISHING_MAN; this->drawConfig = EC_DRAW_FISHING_MAN; } @@ -1071,7 +1071,7 @@ void DemoEc_InitBombchuShopOwner(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_0600AFE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_BOMBCHU_SHOP_OWNER; this->drawConfig = EC_DRAW_BOMBCHU_SHOP_OWNER; } @@ -1121,7 +1121,7 @@ void DemoEc_InitGorons(DemoEc* this, GlobalContext* globalCtx) { scale->z *= goronScale; func_8096D64C(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_GORON; this->drawConfig = EC_DRAW_GORON; } @@ -1147,7 +1147,7 @@ void DemoEc_InitMalon(DemoEc* this, GlobalContext* globalCtx) { DemoEc_UseAnimationObject(this, globalCtx); DemoEc_ChangeAnimation(this, &D_06009EE0, 0, 0.0f, false); func_8096D5D4(this, globalCtx); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->updateMode = EC_UPDATE_MALON; this->drawConfig = EC_DRAW_MALON; } @@ -1332,7 +1332,7 @@ void DemoEc_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit Demo_Ec_InitVars = { ACTOR_DEMO_EC, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_EC, sizeof(DemoEc), 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 1125f737e8..70962d802f 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -78,7 +78,7 @@ extern SkelCurveLimbList D_060012E8; // timewarpLimbList const ActorInit Demo_Effect_InitVars = { ACTOR_DEMO_EFFECT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DemoEffect), @@ -417,16 +417,16 @@ void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.020f); crystalLight = (DemoEffect*)Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_CRYSTAL_LIGHT); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_CRYSTAL_LIGHT); if (crystalLight != NULL) { Actor_SetScale(&crystalLight->actor, 0.6f); } lightRing = (DemoEffect*)Actor_SpawnAsChild( - &globalCtx2->actorCtx, &crystalLight->actor, globalCtx2, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_TRIFORCE); + &globalCtx2->actorCtx, &crystalLight->actor, globalCtx2, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_TRIFORCE); if (lightRing != NULL) { Actor_SetScale(&lightRing->actor, 0.4f); @@ -503,7 +503,7 @@ void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) { this->jewel.type = DEMO_EFFECT_JEWEL_ZORA; this->jewel.isPositionInit = 0; DemoEffect_InitJewel(globalCtx, this); - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTOR_EN_DOOR); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTOR_EN_DOOR); if ((globalCtx->sceneNum == SCENE_BDAN) && (gSaveContext.infTable[20] & 0x20)) { Actor_Kill(&this->actor); return; @@ -561,9 +561,9 @@ void DemoEffect_Wait(DemoEffect* this, GlobalContext* globalCtx) { void DemoEffect_UpdatePositionToParent(DemoEffect* this, GlobalContext* globalCtx) { if (this->actor.parent != NULL) { // Struct copy affects regalloc - this->actor.posRot.pos.x = this->actor.parent->posRot.pos.x; - this->actor.posRot.pos.y = this->actor.parent->posRot.pos.y; - this->actor.posRot.pos.z = this->actor.parent->posRot.pos.z; + this->actor.world.pos.x = this->actor.parent->world.pos.x; + this->actor.world.pos.y = this->actor.parent->world.pos.y; + this->actor.world.pos.z = this->actor.parent->world.pos.z; } } @@ -575,7 +575,7 @@ void DemoEffect_UpdatePositionToParent(DemoEffect* this, GlobalContext* globalCt */ void DemoEffect_UpdateCrystalLight(DemoEffect* this, GlobalContext* globalCtx) { DemoEffect_UpdatePositionToParent(this, globalCtx); - this->actor.posRot.pos.y += 14.0f; + this->actor.world.pos.y += 14.0f; } /** @@ -611,9 +611,9 @@ void DemoEffect_MedalSparkle(DemoEffect* this, GlobalContext* globalCtx, s32 isS velocity.z = (Rand_ZeroOne() - 0.5f) * 2.0f; } - pos.x = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.x; - pos.y = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.y; - pos.z = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.z; + pos.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x; + pos.y = Rand_CenteredFloat(10.0f) + this->actor.world.pos.y; + pos.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z; EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, 1000, 16); } @@ -929,8 +929,8 @@ void DemoEffect_UpdateLightRingTriforce(DemoEffect* this, GlobalContext* globalC if (globalCtx->csCtx.npcActions[this->csActionId] != NULL && globalCtx->csCtx.npcActions[this->csActionId]->action == 2) { blueOrb = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); if (blueOrb != NULL) { Actor_SetScale(&blueOrb->actor, 0.0f); @@ -959,22 +959,21 @@ void DemoEffect_UpdateCreationFireball(DemoEffect* this, GlobalContext* globalCt return; } - effect = - (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); + effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_BLUE_ORB); if (effect != NULL) { Actor_SetScale(&effect->actor, 0.0f); } - effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, + effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_EXPANDING); if (effect != NULL) { Actor_SetScale(&effect->actor, 0.1f); } - effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, + effect = (DemoEffect*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_SHRINKING); if (effect != NULL) { Actor_SetScale(&effect->actor, 0.2f); @@ -992,7 +991,7 @@ void DemoEffect_UpdateCreationFireball(DemoEffect* this, GlobalContext* globalCt void DemoEffect_InitCreationFireball(DemoEffect* this, GlobalContext* globalCtx) { Actor* parent = this->actor.parent; - this->actor.posRot.rot.y = parent->shape.rot.y; + this->actor.world.rot.y = parent->shape.rot.y; this->fireBall.timer = 50; this->actor.speedXZ = 1.5f; this->actor.minVelocityY = -1.5f; @@ -1158,8 +1157,8 @@ void DemoEffect_UpdateGodLgtDin(DemoEffect* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.npcActions[this->csActionId]->action == 3) { fireBall = (DemoEffect*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_FIRE_BALL); + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_FIRE_BALL); if (fireBall != NULL) { fireBall->initUpdateFunc = DemoEffect_InitCreationFireball; @@ -1212,9 +1211,9 @@ void DemoEffect_UpdateGodLgtNayru(DemoEffect* this, GlobalContext* globalCtx) { } else { this->godLgt.lightRingSpawnTimer = this->godLgt.lightRingSpawnDelay; lightRing = (DemoEffect*)Actor_Spawn( - &globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.posRot.rot.x + 0x4000, - this->actor.posRot.rot.y, this->actor.posRot.rot.z, DEMO_EFFECT_LIGHTRING_EXPANDING); + &globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x + 0x4000, + this->actor.world.rot.y, this->actor.world.rot.z, DEMO_EFFECT_LIGHTRING_EXPANDING); if (lightRing != NULL) { Actor_SetScale(&lightRing->actor, 1.0f); @@ -1269,8 +1268,8 @@ void DemoEffect_UpdateGodLgtFarore(DemoEffect* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.npcActions[this->csActionId]->action == 3) { lgtShower = (DemoEffect*)Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y - 150.0f, this->actor.posRot.pos.z, 0, 0, 0, DEMO_EFFECT_LGT_SHOWER); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y - 150.0f, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LGT_SHOWER); if (lgtShower != NULL) { lgtShower->actor.scale.x = 0.23f; @@ -1310,9 +1309,9 @@ void DemoEffect_UpdateGodLgtFarore(DemoEffect* this, GlobalContext* globalCtx) { * Moves this actor towards the target position with a given speed. */ void DemoEffect_MoveTowardTarget(Vec3f targetPos, DemoEffect* this, f32 speed) { - this->actor.posRot.pos.x += (targetPos.x - this->actor.posRot.pos.x) * speed; - this->actor.posRot.pos.y += (targetPos.y - this->actor.posRot.pos.y) * speed; - this->actor.posRot.pos.z += (targetPos.z - this->actor.posRot.pos.z) * speed; + this->actor.world.pos.x += (targetPos.x - this->actor.world.pos.x) * speed; + this->actor.world.pos.y += (targetPos.y - this->actor.world.pos.y) * speed; + this->actor.world.pos.z += (targetPos.z - this->actor.world.pos.z) * speed; } /** @@ -1395,15 +1394,15 @@ void DemoEffect_SetJewelColor(DemoEffect* this, f32 alpha) { * Moves the Jewel Actor during the activation of the Door of Time cutscene. * This is used once the Jewel Actor is done orbiting Link and split up to move into the pedastal slots. */ -void DemoEffect_MoveJewelSplit(PosRot* posRot, DemoEffect* this) { +void DemoEffect_MoveJewelSplit(PosRot* world, DemoEffect* this) { switch (this->jewel.type) { case DEMO_EFFECT_JEWEL_KOKIRI: - posRot->pos.x -= 40.0f; + world->pos.x -= 40.0f; break; case DEMO_EFFECT_JEWEL_GORON: break; case DEMO_EFFECT_JEWEL_ZORA: - posRot->pos.x += 40.0f; + world->pos.x += 40.0f; break; } } @@ -1424,25 +1423,25 @@ void DemoEffect_MoveJewelSpherical(f32 degrees, f32 frameDivisor, Vec3f startPos distance = frameDivisor * sqrtf(SQ(endPos.x - startPos.x) + SQ(endPos.y - startPos.y) + SQ(endPos.z - startPos.z)); - this->actor.posRot.pos.x = radius * cosf(degrees * (M_PI / 180.0f)); - this->actor.posRot.pos.y = distance; - this->actor.posRot.pos.z = radius * sinf(degrees * (M_PI / 180.0f)); + this->actor.world.pos.x = radius * cosf(degrees * (M_PI / 180.0f)); + this->actor.world.pos.y = distance; + this->actor.world.pos.z = radius * sinf(degrees * (M_PI / 180.0f)); - xPos = this->actor.posRot.pos.x; - ySpherical = (this->actor.posRot.pos.y * cosf(rotation.x * (M_PI / 0x8000))) - - (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.posRot.pos.z); - xzSpherical = (this->actor.posRot.pos.z * cosf(rotation.x * (M_PI / 0x8000))) + - (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.posRot.pos.y); + xPos = this->actor.world.pos.x; + ySpherical = (this->actor.world.pos.y * cosf(rotation.x * (M_PI / 0x8000))) - + (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.world.pos.z); + xzSpherical = (this->actor.world.pos.z * cosf(rotation.x * (M_PI / 0x8000))) + + (sinf(rotation.x * (M_PI / 0x8000)) * this->actor.world.pos.y); - this->actor.posRot.pos.x = + this->actor.world.pos.x = (xPos * cosf(rotation.y * (M_PI / 0x8000))) - (sinf(rotation.y * (M_PI / 0x8000)) * xzSpherical); - this->actor.posRot.pos.y = ySpherical; - this->actor.posRot.pos.z = + this->actor.world.pos.y = ySpherical; + this->actor.world.pos.z = (xzSpherical * cosf(rotation.y * (M_PI / 0x8000))) + (sinf(rotation.y * (M_PI / 0x8000)) * xPos); - this->actor.posRot.pos.x += startPos.x; - this->actor.posRot.pos.y += startPos.y; - this->actor.posRot.pos.z += startPos.z; + this->actor.world.pos.x += startPos.x; + this->actor.world.pos.y += startPos.y; + this->actor.world.pos.z += startPos.z; } /** @@ -1527,7 +1526,7 @@ void DemoEffect_JewelSparkle(DemoEffect* this, GlobalContext* globalCtx, s32 spa velocity.x = (Rand_ZeroOne() - 0.5f) * 1.5f; velocity.z = (Rand_ZeroOne() - 0.5f) * 1.5f; - EffectSsKiraKira_SpawnDispersed(globalCtx, &this->actor.posRot.pos, &velocity, &accel, &primColor, &envColor, + EffectSsKiraKira_SpawnDispersed(globalCtx, &this->actor.world.pos, &velocity, &accel, &primColor, &envColor, 3000, 16); } } @@ -1586,13 +1585,13 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, GlobalContext* globalCtx) { case 4: if (this->jewel.isPositionInit) { DemoEffect_MoveToCsEndpoint(this, globalCtx, this->csActionId, 0); - DemoEffect_MoveJewelSplit(&thisx->posRot, this); + DemoEffect_MoveJewelSplit(&thisx->world, this); if ((globalCtx->gameplayFrames & 1) == 0) { DemoEffect_JewelSparkle(this, globalCtx, 1); } } else { DemoEffect_InitPositionFromCsAction(this, globalCtx, this->csActionId); - DemoEffect_MoveJewelSplit(&thisx->posRot, this); + DemoEffect_MoveJewelSplit(&thisx->world, this); this->jewel.isPositionInit = 1; } break; @@ -1602,7 +1601,7 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, GlobalContext* globalCtx) { default: DemoEffect_MoveToCsEndpoint(this, globalCtx, this->csActionId, 0); if (gSaveContext.entranceIndex == 0x0053) { - DemoEffect_MoveJewelSplit(&thisx->posRot, this); + DemoEffect_MoveJewelSplit(&thisx->world, this); } break; } @@ -1635,7 +1634,7 @@ void DemoEffect_UpdateDust(DemoEffect* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state != 0 && globalCtx->csCtx.npcActions[this->csActionId] != NULL && globalCtx->csCtx.npcActions[this->csActionId]->action == 2) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += 600.0f; pos.x += Rand_CenteredFloat(300.0f); @@ -2131,9 +2130,9 @@ void DemoEffect_MoveToCsEndpoint(DemoEffect* this, GlobalContext* globalCtx, s32 speed = DemoEffect_InterpolateCsFrames(globalCtx, csActionId); - this->actor.posRot.pos.x = ((endPos.x - startPos.x) * speed) + startPos.x; - this->actor.posRot.pos.y = ((endPos.y - startPos.y) * speed) + startPos.y; - this->actor.posRot.pos.z = ((endPos.z - startPos.z) * speed) + startPos.z; + this->actor.world.pos.x = ((endPos.x - startPos.x) * speed) + startPos.x; + this->actor.world.pos.y = ((endPos.y - startPos.y) * speed) + startPos.y; + this->actor.world.pos.z = ((endPos.z - startPos.z) * speed) + startPos.z; if (shouldUpdateFacing) { DemoEffect_FaceToCsEndpoint(this, startPos, endPos); @@ -2159,7 +2158,7 @@ void DemoEffect_InitPositionFromCsAction(DemoEffect* this, GlobalContext* global f32 y = globalCtx->csCtx.npcActions[csActionIndex]->startPos.y; f32 z = globalCtx->csCtx.npcActions[csActionIndex]->startPos.z; - this->actor.posRot.pos.x = x; - this->actor.posRot.pos.y = y; - this->actor.posRot.pos.z = z; + this->actor.world.pos.x = x; + this->actor.world.pos.y = y; + this->actor.world.pos.z = z; } 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 b648a96756..31d2df022a 100644 --- a/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c +++ b/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.c @@ -69,10 +69,10 @@ void DemoExt_SetupMaintainVortex(DemoExt* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = DemoExt_GetNpcAction(globalCtx, 5); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } this->action = EXT_MAINTAIN; this->drawMode = EXT_DRAW_VORTEX; @@ -238,7 +238,7 @@ void DemoExt_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit Demo_Ext_InitVars = { ACTOR_DEMO_EXT, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FHG, sizeof(DemoExt), 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 0f1f01ba54..0f990bd49d 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -45,7 +45,7 @@ static DemoGeffDrawFunc sDrawFuncs[] = { const ActorInit Demo_Geff_InitVars = { ACTOR_DEMO_GEFF, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GEFF, sizeof(DemoGeff), @@ -137,7 +137,7 @@ void func_809781FC(DemoGeff* this, GlobalContext* globalCtx) { Actor* propIt; if (this->demoGt == NULL) { - propIt = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + propIt = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; if ((this->actor.params != 0) && (this->actor.params != 1) && (this->actor.params != 2)) { targetParams = 2; } else { @@ -145,9 +145,9 @@ void func_809781FC(DemoGeff* this, GlobalContext* globalCtx) { } while (propIt != NULL) { if (propIt->id == ACTOR_DEMO_GT && propIt->params == targetParams) { - this->deltaPosX = this->actor.posRot.pos.x - propIt->posRot.pos.x; - this->deltaPosY = this->actor.posRot.pos.y - propIt->posRot.pos.y; - this->deltaPosZ = this->actor.posRot.pos.z - propIt->posRot.pos.z; + this->deltaPosX = this->actor.world.pos.x - propIt->world.pos.x; + this->deltaPosY = this->actor.world.pos.y - propIt->world.pos.y; + this->deltaPosZ = this->actor.world.pos.z - propIt->world.pos.z; this->demoGt = propIt; } propIt = propIt->next; @@ -159,9 +159,9 @@ void func_809782A0(DemoGeff* this, GlobalContext* globalCtx) { DemoGt* demoGt = this->demoGt; s16 params = this->actor.params; if (demoGt != NULL && (params != 6) && (params != 7) && (params != 8)) { - this->actor.posRot.pos.x = demoGt->dyna.actor.posRot.pos.x + this->deltaPosX; - this->actor.posRot.pos.y = demoGt->dyna.actor.posRot.pos.y + this->deltaPosY; - this->actor.posRot.pos.z = demoGt->dyna.actor.posRot.pos.z + this->deltaPosZ; + this->actor.world.pos.x = demoGt->dyna.actor.world.pos.x + this->deltaPosX; + this->actor.world.pos.y = demoGt->dyna.actor.world.pos.y + this->deltaPosY; + this->actor.world.pos.z = demoGt->dyna.actor.world.pos.z + this->deltaPosZ; } } 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 4533af9d09..6c2d878225 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -30,7 +30,7 @@ extern UNK_TYPE D_06003AF0; /* const ActorInit Demo_Gj_InitVars = { ACTOR_DEMO_GJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GJ, sizeof(DemoGj), 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 aa2e15d050..fe32fd58f3 100644 --- a/src/overlays/actors/ovl_Demo_Go/z_demo_go.c +++ b/src/overlays/actors/ovl_Demo_Go/z_demo_go.c @@ -40,7 +40,7 @@ static DemoGoDrawFunc D_8097D468[] = { const ActorInit Demo_Go_InitVars = { ACTOR_DEMO_GO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(DemoGo), @@ -81,7 +81,7 @@ void func_8097C8A8(DemoGo* this, GlobalContext* globalCtx) { Vec3f* sp1C; if ((thisx->params == 0) || (thisx->params == 1)) { - SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &thisx->posRot.pos, &sp20, &sp1C); + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &thisx->world.pos, &sp20, &sp1C); Audio_PlaySoundAtPosition(globalCtx, &sp20, 20, NA_SE_EV_OBJECT_FALL); } } @@ -118,19 +118,19 @@ void func_8097C9DC(DemoGo* this) { } void func_8097CA30(DemoGo* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } void func_8097CA78(DemoGo* this, GlobalContext* globalCtx) { s16 pad; - Vec3f vec = this->actor.posRot.pos; + Vec3f vec = this->actor.world.pos; func_80033480(globalCtx, &vec, kREG(11) + 100.0f, kREG(12) + 0xA, kREG(13) + 0x12C, kREG(14), 0); func_8097C9B8(this); } void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; - PosRot* posRot = &thisx->posRot; + PosRot* world = &thisx->world; CutsceneContext* csCtx = &globalCtx->csCtx; CsCmdActorAction* npcAction; f32 temp_ret; @@ -148,10 +148,10 @@ void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) { endPos.x = npcAction->endPos.x; endPos.y = npcAction->endPos.y; endPos.z = npcAction->endPos.z; - posRot->pos.x = (((endPos.x - startPos.x) * temp_ret) + startPos.x); - posRot->pos.y = (((endPos.y - startPos.y) * temp_ret) + startPos.y); - posRot->pos.z = (((endPos.z - startPos.z) * temp_ret) + startPos.z); - posRot->rot.y = thisx->shape.rot.y = npcAction->rot.y; + world->pos.x = (((endPos.x - startPos.x) * temp_ret) + startPos.x); + world->pos.y = (((endPos.y - startPos.y) * temp_ret) + startPos.y); + world->pos.z = (((endPos.z - startPos.z) * temp_ret) + startPos.z); + world->rot.y = thisx->shape.rot.y = npcAction->rot.y; } } } @@ -180,7 +180,7 @@ void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state != 0) { npcAction = globalCtx->csCtx.npcActions[func_8097C870(this)]; if (npcAction != NULL) { - thisRotY = thisx->posRot.rot.y; + thisRotY = thisx->world.rot.y; rotYDelta = npcAction->rot.y - thisRotY; if ((rotYDelta > -(kREG(16) + 0x96)) && (rotYDelta < kREG(16) + 0x96)) { newRotY = npcAction->rot.y; @@ -190,7 +190,7 @@ void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) { newRotY = (thisRotY - kREG(16)) - 0x96; } thisx->shape.rot.y = newRotY; - thisx->posRot.rot.y = newRotY; + thisx->world.rot.y = newRotY; } } } @@ -318,7 +318,7 @@ 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); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600FEF0, NULL, NULL, NULL, 0); Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, 0.0f); this->action = 0; 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 60c4a3ad8a..6bf57baef8 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -334,7 +334,7 @@ u8 func_8097E704(GlobalContext* globalCtx, u16 arg1, s32 arg2) { void func_8097E744(DemoGt* this, GlobalContext* globalCtx, u32 actionIdx) { CsCmdActorAction* npcAction = DemoGt_GetNpcAction(globalCtx, actionIdx); - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; f32 startX; f32 startY; f32 startZ; @@ -362,7 +362,7 @@ void func_8097E824(DemoGt* this, s32 arg1) { s16 phi_a1; s16 phi_a2; s16 phi_a3; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3s* unk16C = &this->unk_16C; s32 pad; f32 tempf3; @@ -513,7 +513,7 @@ void func_8097EF40(DemoGt* this, GlobalContext* globalCtx) { Vec3f dustPos; Vec3f velocity = { 0.0f, -16.0f, 0.0f }; Vec3f accel = { 0.0f, 1.20000004768f, 0.0f }; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; s32 pad; if ((kREG(1) == 20) || (frames == 220)) { @@ -540,16 +540,16 @@ void func_8097F0AC(DemoGt* this, GlobalContext* globalCtx) { s32 pad2; if ((frames == 140) || (kREG(1) == 19)) { - sp38.x = this->dyna.actor.posRot.pos.x + 260.0f; - sp38.y = this->dyna.actor.posRot.pos.y + 340.0f; - sp38.z = this->dyna.actor.posRot.pos.z + 45.0f; + sp38.x = this->dyna.actor.world.pos.x + 260.0f; + sp38.y = this->dyna.actor.world.pos.y + 340.0f; + sp38.z = this->dyna.actor.world.pos.z + 45.0f; DemoGt_SpawnExplosionWithSound(globalCtx, &sp38, 2.0f); } if (frames == 176) { - sp24.x = this->dyna.actor.posRot.pos.x + 260.0f; - sp24.y = this->dyna.actor.posRot.pos.y + 840.0f; - sp24.z = this->dyna.actor.posRot.pos.z + 45.0f; + sp24.x = this->dyna.actor.world.pos.x + 260.0f; + sp24.y = this->dyna.actor.world.pos.y + 840.0f; + sp24.z = this->dyna.actor.world.pos.z + 45.0f; DemoGt_SpawnExplosionWithSound(globalCtx, &sp24, 2.0f); } } @@ -720,17 +720,17 @@ void func_8097F96C(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if (((frames > 1059) && (frames < 1062)) || kREG(1) == 17) { - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + 612.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + 612.0f; + pos.z = this->dyna.actor.world.pos.z; if (cloudRing == NULL) { cloudRing = DemoGt_SpawnCloudRing(globalCtx, &pos, 2); } else { actor = cloudRing; - actor->posRot.pos.x = pos.x; - actor->posRot.pos.y = pos.y; - actor->posRot.pos.z = pos.z; + actor->world.pos.x = pos.x; + actor->world.pos.y = pos.y; + actor->world.pos.z = pos.z; } } } @@ -739,7 +739,7 @@ void func_8097FA1C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { -12.0f, -17.0, 5.0 }; s32 pad1[3]; @@ -765,7 +765,7 @@ void func_8097FAFC(DemoGt* this, GlobalContext* globalCtx) { f32 new_var = -200.0; if (((frames > 582) && (frames < 683)) || (kREG(1) == 6)) { - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; pos.y += 680.0f; if (frames == 682) { @@ -782,7 +782,7 @@ void func_8097FC1C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -800,9 +800,9 @@ void func_8097FCE4(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if (frames == 0x1F7 || kREG(1) == 4) { - vec.x = this->dyna.actor.posRot.pos.x + 300.0f; - vec.y = this->dyna.actor.posRot.pos.y + 560.0f; - vec.z = this->dyna.actor.posRot.pos.z - 377.0f; + vec.x = this->dyna.actor.world.pos.x + 300.0f; + vec.y = this->dyna.actor.world.pos.y + 560.0f; + vec.z = this->dyna.actor.world.pos.z - 377.0f; DemoGt_SpawnExplosionWithSound(globalCtx, &vec, 2.0f); } } @@ -900,17 +900,17 @@ void func_80980184(DemoGt* this, GlobalContext* globalCtx) { Actor* actor; if ((globalCtx->csCtx.frames > 1027) && (globalCtx->csCtx.frames < 1031)) { - pos.x = this->dyna.actor.posRot.pos.x; - pos.y = this->dyna.actor.posRot.pos.y + 247.0f; - pos.z = this->dyna.actor.posRot.pos.z; + pos.x = this->dyna.actor.world.pos.x; + pos.y = this->dyna.actor.world.pos.y + 247.0f; + pos.z = this->dyna.actor.world.pos.z; if (cloudRing == NULL) { cloudRing = DemoGt_SpawnCloudRing(globalCtx, &pos, 3); } else { actor = cloudRing; - actor->posRot.pos.x = pos.x; - actor->posRot.pos.y = pos.y; - actor->posRot.pos.z = pos.z; + actor->world.pos.x = pos.x; + actor->world.pos.y = pos.y; + actor->world.pos.z = pos.z; } } } @@ -922,17 +922,17 @@ void func_80980218(DemoGt* this, GlobalContext* globalCtx) { Actor* actor; if ((globalCtx->csCtx.frames > 997) && (globalCtx->csCtx.frames < 1001)) { - pos.x = this->dyna.actor.initPosRot.pos.x; - pos.y = this->dyna.actor.initPosRot.pos.y + 38.0f; - pos.z = this->dyna.actor.initPosRot.pos.z; + pos.x = this->dyna.actor.home.pos.x; + pos.y = this->dyna.actor.home.pos.y + 38.0f; + pos.z = this->dyna.actor.home.pos.z; if (cloudRing == NULL) { cloudRing = DemoGt_SpawnCloudRing(globalCtx, &pos, 4); } else { actor = cloudRing; - actor->posRot.pos.x = pos.x; - actor->posRot.pos.y = pos.y; - actor->posRot.pos.z = pos.z; + actor->world.pos.x = pos.x; + actor->world.pos.y = pos.y; + actor->world.pos.z = pos.z; } } } @@ -941,7 +941,7 @@ void func_809802AC(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 0.0f, 0.0f, -10.0f }; s32 pad1[3]; @@ -957,14 +957,14 @@ void func_8098036C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* posRot = &this->dyna.actor.posRot.pos; + Vec3f* world = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -3.0f, 0.0f }; s32 pad1[3]; if ((frames > 284) && (frames < 421)) { - dustPos.x = posRot->x + 760.0f; - dustPos.y = posRot->y - 40.0f; - dustPos.z = posRot->z - 240.0f; + dustPos.x = world->x + 760.0f; + dustPos.y = world->y - 40.0f; + dustPos.z = world->z - 240.0f; func_8097D7D8(globalCtx, &dustPos, &velOffset, 6.0f, 6, 1, 35); } } @@ -973,7 +973,7 @@ void func_80980430(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; s32 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -3.0f, 0.0f }; s32 pad1[3]; @@ -989,7 +989,7 @@ void func_80980504(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -1005,7 +1005,7 @@ void func_809805D8(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f dustPos; u16 frames = globalCtx->csCtx.frames; - Vec3f* homePos = &this->dyna.actor.initPosRot.pos; + Vec3f* homePos = &this->dyna.actor.home.pos; Vec3f velOffset = { 15.0f, -26.0, 0.0f }; s32 pad1[3]; @@ -1021,7 +1021,7 @@ void func_809806B8(DemoGt* this, GlobalContext* globalContext) { s32 pad[3]; Vec3f dustPos; u16 frames = globalContext->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -1037,7 +1037,7 @@ void func_8098078C(DemoGt* this, GlobalContext* globalContext) { s32 pad[3]; Vec3f dustPos; u16 frames = globalContext->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; @@ -1053,7 +1053,7 @@ void func_8098085C(DemoGt* this, GlobalContext* globalCtx) { s32 pad[3]; Vec3f sp28; u16 frames = globalCtx->csCtx.frames; - Vec3f* pos = &this->dyna.actor.posRot.pos; + Vec3f* pos = &this->dyna.actor.world.pos; if ((frames == 58) || (kREG(1) == 1)) { sp28.x = pos->x + 900.0f; @@ -1086,9 +1086,9 @@ void func_809809C0(DemoGt* this, GlobalContext* globalCtx) { Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; s16 pad2[3]; - sp54.x = this2->dyna.actor.posRot.pos.x + 790.0f; - sp54.y = this2->dyna.actor.posRot.pos.y + 60.0f; - sp54.z = this2->dyna.actor.posRot.pos.z + 23.0f; + sp54.x = this2->dyna.actor.world.pos.x + 790.0f; + sp54.y = this2->dyna.actor.world.pos.y + 60.0f; + sp54.z = this2->dyna.actor.world.pos.z + 23.0f; if (ABS(gameplayFrames % 12) == 0) { DemoGt_SpawnExplosionNoSound(globalCtx2, &sp54, &sp40, &sp34, 2.0f); @@ -1102,9 +1102,9 @@ void func_80980AD4(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if ((frames == 477) || (kREG(2) == 1)) { - pos.x = this->dyna.actor.posRot.pos.x + 790.0f; - pos.y = this->dyna.actor.posRot.pos.y + 60.0f; - pos.z = this->dyna.actor.posRot.pos.z + 23.0f; + pos.x = this->dyna.actor.world.pos.x + 790.0f; + pos.y = this->dyna.actor.world.pos.y + 60.0f; + pos.z = this->dyna.actor.world.pos.z + 23.0f; func_8097DAC8(this, globalCtx, &pos); DemoGt_PlayExplosion2Sfx(globalCtx, &pos); @@ -1117,9 +1117,9 @@ void func_80980B68(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if ((frames == 317) || (kREG(3) == 1)) { - pos.x = this->dyna.actor.posRot.pos.x + 980.0f; - pos.y = this->dyna.actor.posRot.pos.y + 410.0f; - pos.z = this->dyna.actor.posRot.pos.z - 177.0f; + pos.x = this->dyna.actor.world.pos.x + 980.0f; + pos.y = this->dyna.actor.world.pos.y + 410.0f; + pos.z = this->dyna.actor.world.pos.z - 177.0f; func_8097DD28(this, globalCtx, &pos); DemoGt_PlayExplosion2Sfx(globalCtx, &pos); } @@ -1131,9 +1131,9 @@ void func_80980BFC(DemoGt* this, GlobalContext* globalCtx) { u16 frames = globalCtx->csCtx.frames; if ((frames == 740) || (kREG(4) == 1)) { - pos.x = this->dyna.actor.posRot.pos.x + 790.0f; - pos.y = this->dyna.actor.posRot.pos.y + 60.0f; - pos.z = this->dyna.actor.posRot.pos.z + 23.0f; + pos.x = this->dyna.actor.world.pos.x + 790.0f; + pos.y = this->dyna.actor.world.pos.y + 60.0f; + pos.z = this->dyna.actor.world.pos.z + 23.0f; func_8097DF70(this, globalCtx, &pos); DemoGt_PlayExplosion2Sfx(globalCtx, &pos); @@ -1783,7 +1783,7 @@ void DemoGt_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit Demo_Gt_InitVars = { ACTOR_DEMO_GT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GT, sizeof(DemoGt), 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 1aea5a3b2f..f974cb2461 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -32,7 +32,7 @@ extern UNK_TYPE D_06000900; /* const ActorInit Demo_Ik_InitVars = { ACTOR_DEMO_IK, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_IK, sizeof(DemoIk), 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 bb20b10222..506f27fa2f 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -91,7 +91,7 @@ static DemoImDrawFunc sDrawFuncs[] = { const ActorInit Demo_Im_InitVars = { ACTOR_DEMO_IM, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_IM, sizeof(DemoIm), @@ -135,7 +135,7 @@ void func_80984C68(DemoIm* this) { this->drawConfig = 0; this->unk_26C = 0; this->unk_270 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_268 = 0.0f; } @@ -193,10 +193,10 @@ void func_80984E58(DemoIm* this, GlobalContext* globalCtx) { s16 yawDiff; s16 phi_a3; - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; this->unk_2D4.unk_14 = kREG(16) + 4.0f; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; phi_a3 = (ABS(yawDiff) < 0x18E3) ? 2 : 1; func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, phi_a3); } @@ -204,7 +204,7 @@ void func_80984E58(DemoIm* this, GlobalContext* globalCtx) { void func_80984F10(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; this->unk_2D4.unk_14 = kREG(16) + 12.0f; func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 2); @@ -213,13 +213,13 @@ void func_80984F10(DemoIm* this, GlobalContext* globalCtx) { void func_80984F94(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; this->unk_2D4.unk_14 = kREG(16) + 4.0f; func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 4); } void func_80985018(DemoIm* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 func_80985060(DemoIm* this) { @@ -269,10 +269,10 @@ void func_80985180(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -280,10 +280,10 @@ void func_80985200(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -308,22 +308,22 @@ void func_80985280(DemoIm* this, AnimationHeader* animHeaderSeg, u8 arg2, f32 tr void func_80985310(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; } void func_80985358(DemoIm* this, GlobalContext* globalCtx) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y; - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y; + f32 posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void func_809853B4(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerX = player->actor.posRot.pos.x; - f32 playerY = player->actor.posRot.pos.y + 80.0f; - f32 playerZ = player->actor.posRot.pos.z; + f32 playerX = player->actor.world.pos.x; + f32 playerY = player->actor.world.pos.y + 80.0f; + f32 playerZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, playerX, playerY, playerZ, 0, 0, 0, 0xD); @@ -331,7 +331,7 @@ void func_809853B4(DemoIm* this, GlobalContext* globalCtx) { } void func_80985430(DemoIm* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += 250.0f / 3.0f; + this->actor.shape.yOffset += 250.0f / 3.0f; } void func_8098544C(DemoIm* this, GlobalContext* globalCtx) { @@ -344,7 +344,7 @@ void func_8098544C(DemoIm* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = D_8098786C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_SHADOW); - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } } @@ -360,9 +360,9 @@ void func_809854DC(DemoIm* this, GlobalContext* globalCtx) { } void func_8098557C(DemoIm* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = 3; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -438,7 +438,7 @@ void func_80985830(DemoIm* this, GlobalContext* globalCtx) { void func_80985860(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); this->action = 7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_809858A8(void) { @@ -446,8 +446,8 @@ void func_809858A8(void) { } void func_809858C8(DemoIm* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - (kREG(17) + 24.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 6); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + (kREG(17) + 24.0f) + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 6); } void func_80985948(DemoIm* this, GlobalContext* globalCtx) { @@ -457,7 +457,7 @@ void func_80985948(DemoIm* this, GlobalContext* globalCtx) { this->action = 8; this->drawConfig = 2; this->unk_26C = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_268 = 0.0f; func_809858A8(); } @@ -473,7 +473,7 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) { this->action = 9; this->drawConfig = 1; *unk_268 = kREG(5) + 10.0f; - this->unk_26C = this->actor.shape.unk_14 = alpha; + this->unk_26C = this->actor.shape.shadowAlpha = alpha; return; } } else { @@ -483,11 +483,11 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_268 = 0.0f; this->unk_26C = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } - this->actor.shape.unk_14 = this->unk_26C = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f; + this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f; } void func_80985B34(DemoIm* this, GlobalContext* globalCtx) { @@ -502,7 +502,7 @@ void func_80985B34(DemoIm* this, GlobalContext* globalCtx) { func_809858C8(this, globalCtx); this->unk_270 = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -730,7 +730,7 @@ void func_80986570(DemoIm* this, GlobalContext* globalCtx) { if ((Animation_OnFrame(&this->skelAnime, 7.0f)) && (this->actor.bgCheckFlags & 1)) { u32 sfxId = SFX_FLAG; - sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); Audio_PlaySoundGeneral(sfxId, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } @@ -743,7 +743,7 @@ void func_809865F8(DemoIm* this, GlobalContext* globalCtx, s32 arg2) { if (*unk_278 >= 0.0f) { if (this->unk_27C == 0) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; s16 shapeRotY = this->actor.shape.rot.y; f32 spawnPosX = thisPos->x + (Math_SinS(shapeRotY) * 30.0f); f32 spawnPosY = thisPos->y; @@ -833,13 +833,13 @@ void func_80986948(DemoIm* this, GlobalContext* globalCtx) { void func_809869B0(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); this->action = 18; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerPosX = player->actor.posRot.pos.x; - f32 thisPosX = this->actor.posRot.pos.x; + f32 playerPosX = player->actor.world.pos.x; + f32 thisPosX = this->actor.world.pos.x; if ((thisPosX - (kREG(16) + 30.0f) > playerPosX) && (!(this->actor.flags & 0x40))) { return 1; @@ -849,8 +849,8 @@ s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) { s32 func_80986A5C(DemoIm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerPosX = player->actor.posRot.pos.x; - f32 thisPosX = this->actor.posRot.pos.x; + f32 playerPosX = player->actor.world.pos.x; + f32 thisPosX = this->actor.world.pos.x; if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Gameplay_InCsMode(globalCtx))) { return 1; @@ -885,7 +885,7 @@ void func_80986BA0(DemoIm* this, GlobalContext* globalCtx) { this->action = 21; this->drawConfig = 1; this->unk_280 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -900,7 +900,7 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) { this->action = 24; this->drawConfig = 1; this->unk_280 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -919,7 +919,7 @@ void func_80986CC8(DemoIm* this) { this->action = 26; this->drawConfig = 1; this->unk_280 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -1004,7 +1004,7 @@ void func_80987018(DemoIm* this, GlobalContext* globalCtx) { func_80985280(this, &D_06001868, 0, 0.0f, 0); this->action = 27; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80987064(DemoIm* this) { @@ -1016,9 +1016,9 @@ void func_80987064(DemoIm* this) { temp = kREG(17) + 10.0f; if (*unk_268 >= temp) { - this->actor.shape.unk_14 = this->unk_26C = alpha; + this->actor.shape.shadowAlpha = this->unk_26C = alpha; } else { - this->actor.shape.unk_14 = this->unk_26C = (*unk_268 / temp) * 255.0f; + this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / temp) * 255.0f; } } @@ -1110,7 +1110,7 @@ void DemoIm_Update(Actor* thisx, GlobalContext* globalCtx) { void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx) { DemoIm* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); func_80984D00(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600F788, NULL, this->jointTable, this->morphTable, 17); thisx->flags &= ~1; @@ -1176,12 +1176,12 @@ void func_809875C0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* Vec3f dest; Matrix_MultVec3f(&sp28, &dest); - this->actor.posRot2.pos.x = dest.x; - this->actor.posRot2.pos.y = dest.y; - this->actor.posRot2.pos.z = dest.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = dest.x; + this->actor.focus.pos.y = dest.y; + this->actor.focus.pos.z = dest.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } 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 f3f5aa370a..8225aa46d5 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_06008390; /* const ActorInit Demo_Kankyo_InitVars = { ACTOR_DEMO_KANKYO, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DemoKankyo), 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 8508c46c7d..7d37fc17dd 100644 --- a/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06005CB0; /* const ActorInit Demo_Kekkai_InitVars = { ACTOR_DEMO_KEKKAI, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_DEMO_KEKKAI, sizeof(DemoKekkai), 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 47d44c19f2..f224bffec6 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -70,7 +70,7 @@ static DemoSaDrawFunc sDrawFuncs[] = { const ActorInit Demo_Sa_InitVars = { ACTOR_DEMO_SA, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SA, sizeof(DemoSa), @@ -128,7 +128,7 @@ void func_8098E530(DemoSa* this) { this->drawConfig = 0; this->alpha = 0; this->unk_1A8 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_1A0 = 0.0f; } @@ -148,7 +148,7 @@ void func_8098E554(DemoSa* this, GlobalContext* globalCtx) { } void func_8098E5C8(DemoSa* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 DemoSa_FrameUpdateMatrix(DemoSa* this) { @@ -184,10 +184,10 @@ void func_8098E6EC(DemoSa* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = DemoSa_GetNpcAction(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -213,25 +213,25 @@ void func_8098E76C(DemoSa* this, AnimationHeader* animHeaderSeg, u8 arg2, f32 tr void func_8098E7FC(DemoSa* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B1A0, &D_060021D8, NULL, NULL, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; func_8098E508(this, 1); func_8098E51C(this, 0); } void func_8098E86C(DemoSa* this, GlobalContext* globalCtx) { - Vec3f* posRot = &this->actor.posRot.pos; - f32 posX = posRot->x; - f32 posY = posRot->y; - f32 posZ = posRot->z; + Vec3f* world = &this->actor.world.pos; + f32 posX = world->x; + f32 posY = world->y; + f32 posZ = world->z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void func_8098E8C8(DemoSa* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 posX = player->actor.posRot.pos.x; - f32 posY = player->actor.posRot.pos.y + 80.0f; - f32 posZ = player->actor.posRot.pos.z; + f32 posX = player->actor.world.pos.x; + f32 posY = player->actor.world.pos.y + 80.0f; + f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0xB); @@ -239,7 +239,7 @@ void func_8098E8C8(DemoSa* this, GlobalContext* globalCtx) { } void func_8098E944(DemoSa* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += (250.0f / 3.0f); + this->actor.shape.yOffset += (250.0f / 3.0f); } void func_8098E960(DemoSa* this, GlobalContext* globalCtx) { @@ -252,7 +252,7 @@ void func_8098E960(DemoSa* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = D_8099010C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_FOREST); - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } } @@ -270,9 +270,9 @@ void func_8098E9EC(DemoSa* this, GlobalContext* globalCtx) { } void func_8098EA3C(DemoSa* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = 3; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -353,7 +353,7 @@ void func_8098ECF4(DemoSa* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, skelAnime, &D_0600B1A0, NULL, NULL, NULL, 0); Animation_Change(skelAnime, &D_06001334, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); this->action = 7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; func_8098E508(this, 2); func_8098E51C(this, 2); } @@ -372,8 +372,8 @@ void func_8098EE08(void) { } void func_8098EE28(DemoSa* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - (kREG(23) + 25.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 4); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + (kREG(23) + 25.0f) + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 4); } void func_8098EEA8(DemoSa* this, GlobalContext* globalCtx) { @@ -381,7 +381,7 @@ void func_8098EEA8(DemoSa* this, GlobalContext* globalCtx) { this->action = 8; this->drawConfig = 2; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_1A0 = 0.0f; func_8098EE08(); } @@ -398,7 +398,7 @@ void func_8098EEFC(DemoSa* this, GlobalContext* globalCtx) { this->drawConfig = 1; *unk_1A0 = kREG(5) + 10.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; return; } } else { @@ -408,11 +408,11 @@ void func_8098EEFC(DemoSa* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_1A0 = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } - this->actor.shape.unk_14 = this->alpha = (*unk_1A0 / (kREG(5) + 10.0f)) * 255.0f; + this->actor.shape.shadowAlpha = this->alpha = (*unk_1A0 / (kREG(5) + 10.0f)) * 255.0f; } void func_8098F050(DemoSa* this, GlobalContext* globalCtx) { @@ -425,7 +425,7 @@ void func_8098F050(DemoSa* this, GlobalContext* globalCtx) { func_8098EE28(this, globalCtx); this->unk_1A8 = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -491,7 +491,7 @@ void func_8098F420(DemoSa* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B1A0, &D_0600FFD4, NULL, NULL, 0); this->action = 11; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_8098F480(DemoSa* this) { @@ -503,9 +503,9 @@ void func_8098F480(DemoSa* this) { temp_f0 = kREG(17) + 10.0f; if (temp_f0 <= *unk_1A0) { - this->actor.shape.unk_14 = this->alpha = alpha; + this->actor.shape.shadowAlpha = this->alpha = alpha; } else { - this->actor.shape.unk_14 = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; + this->actor.shape.shadowAlpha = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; } } @@ -602,14 +602,14 @@ void func_8098F7FC(DemoSa* this, GlobalContext* globalCtx) { } void func_8098F83C(DemoSa* this, GlobalContext* globalCtx) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B1A0, &D_0601113C, NULL, NULL, 0); Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, thisPos->x, thisPos->y, thisPos->z, 0, 0, 0, FAIRY_KOKIRI); this->action = 16; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; func_8098E508(this, 4); func_8098E51C(this, 2); } @@ -623,16 +623,16 @@ void func_8098F8F8(DemoSa* this) { temp_f0 = kREG(17) + 10.0f; if (temp_f0 <= *unk_1A0) { - this->actor.shape.unk_14 = this->alpha = alpha; + this->actor.shape.shadowAlpha = this->alpha = alpha; } else { - this->actor.shape.unk_14 = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; + this->actor.shape.shadowAlpha = this->alpha = (*unk_1A0 / temp_f0) * 255.0f; } } void func_8098F984(DemoSa* this) { this->action = 16; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_8098F998(DemoSa* this, GlobalContext* globalCtx) { @@ -641,13 +641,13 @@ void func_8098F998(DemoSa* this, GlobalContext* globalCtx) { this->action = 17; this->drawConfig = 2; this->unk_1B0 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } else { func_8098E76C(this, &D_0601113C, 0, 0.0f, 0); this->action = 18; this->drawConfig = 1; this->unk_1B0 = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } func_8098E508(this, 4); } @@ -657,7 +657,7 @@ void func_8098FA2C(DemoSa* this) { this->action = 18; this->drawConfig = 1; this->unk_1B0 = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -666,7 +666,7 @@ void func_8098FA84(DemoSa* this) { this->action = 19; this->drawConfig = 1; this->unk_1B0 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; func_8098E508(this, 2); } @@ -675,7 +675,7 @@ void func_8098FAE0(DemoSa* this) { this->action = 20; this->drawConfig = 1; this->unk_1B0 = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_8098FB34(DemoSa* this, s32 arg1) { @@ -756,7 +756,7 @@ void DemoSa_Update(Actor* thisx, GlobalContext* globalCtx) { void DemoSa_Init(Actor* thisx, GlobalContext* globalCtx) { DemoSa* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); switch (this->actor.params) { case 2: 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 4ad7d474ec..396f0d03df 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c @@ -19,7 +19,7 @@ void func_80991298(DemoShd* this, GlobalContext* globalCtx); const ActorInit Demo_Shd_InitVars = { ACTOR_DEMO_SHD, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DemoShd), @@ -41,8 +41,8 @@ void DemoShd_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_14C = 0; DemoShd_SetupAction(this, func_80991298); Actor_SetScale(&this->actor, 0.4f); - this->actor.posRot.pos.y = 0.0f; - this->actor.posRot.pos.x = 0.0f; + this->actor.world.pos.y = 0.0f; + this->actor.world.pos.x = 0.0f; } void DemoShd_Destroy(Actor* thisx, 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 17d8bb1e8f..1350033b29 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 @@ -31,7 +31,7 @@ static DemoTreLgtInfo sDemoTreLgtInfo[] = { const ActorInit Demo_Tre_Lgt_InitVars = { ACTOR_DEMO_TRE_LGT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_BOX, sizeof(DemoTreLgt), 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 74bdef8e1d..afe992c09b 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -21,7 +21,7 @@ void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx); const ActorInit Door_Ana_InitVars = { ACTOR_DOOR_ANA, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(DoorAna), @@ -82,7 +82,7 @@ void DoorAna_Init(Actor* thisx, GlobalContext* globalCtx) { } else { DoorAna_SetupAction(this, DoorAna_WaitOpen); } - this->actor.unk_1F = 0; + this->actor.targetMode = 0; } void DoorAna_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -99,7 +99,7 @@ void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) { u32 openGrotto = false; if (!(this->actor.params & 0x200)) { // opening with song of storms - if (this->actor.xyzDistToLinkSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) { + if (this->actor.xyzDistToPlayerSq < 40000.0f && Flags_GetEnv(globalCtx, 5)) { openGrotto = true; this->actor.flags &= ~0x10; } @@ -129,26 +129,26 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { player = PLAYER; if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { - if ((this->actor.unk_1F != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) && + if ((this->actor.targetMode != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) && (player->unk_84F == 0)) { destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_RETURN, 0x4FF); - gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.posRot.pos.y; - gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.initPosRot.rot.y; + gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; + gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.home.rot.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].data = this->actor.params & 0xFFFF; if (destinationIdx < 0) { - destinationIdx = this->actor.initPosRot.rot.z + 1; + destinationIdx = this->actor.home.rot.z + 1; } globalCtx->nextEntranceIndex = entrances[destinationIdx]; DoorAna_SetupAction(this, DoorAna_GrabLink); } else { if (!Player_InCsMode(globalCtx) && !(player->stateFlags1 & 0x8800000) && - this->actor.xzDistToLink <= 15.0f && -50.0f <= this->actor.yDistToLink && - this->actor.yDistToLink <= 15.0f) { + this->actor.xzDistToPlayer <= 15.0f && -50.0f <= this->actor.yDistToPlayer && + this->actor.yDistToPlayer <= 15.0f) { player->stateFlags1 |= 0x80000000; - this->actor.unk_1F = 1; + this->actor.targetMode = 1; } else { - this->actor.unk_1F = 0; + this->actor.targetMode = 0; } } } @@ -159,10 +159,10 @@ void DoorAna_WaitOpen(DoorAna* this, GlobalContext* globalCtx) { void DoorAna_GrabLink(DoorAna* this, GlobalContext* globalCtx) { Player* player; - if (this->actor.yDistToLink <= 0.0f && 15.0f < this->actor.xzDistToLink) { + if (this->actor.yDistToPlayer <= 0.0f && 15.0f < this->actor.xzDistToPlayer) { player = PLAYER; - player->actor.posRot.pos.x = Math_SinS(this->actor.yawTowardsLink) * 15.0f + this->actor.posRot.pos.x; - player->actor.posRot.pos.z = Math_CosS(this->actor.yawTowardsLink) * 15.0f + this->actor.posRot.pos.z; + player->actor.world.pos.x = Math_SinS(this->actor.yawTowardsPlayer) * 15.0f + this->actor.world.pos.x; + player->actor.world.pos.z = Math_CosS(this->actor.yawTowardsPlayer) * 15.0f + this->actor.world.pos.z; } } 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 e9a289b9ac..49c7cef99c 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -22,7 +22,7 @@ void func_809949C8(DoorGerudo* this, GlobalContext* globalCtx); const ActorInit Door_Gerudo_InitVars = { ACTOR_DOOR_GERUDO, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_DOOR_GERUDO, sizeof(DoorGerudo), @@ -51,7 +51,7 @@ void DoorGerudo_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, thisx->params & 0x3F)) { this->actionFunc = func_8099485C; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 200.0f; + thisx->world.pos.y = thisx->home.pos.y + 200.0f; } else { this->actionFunc = func_8099485C; this->unk_166 = 10; @@ -69,9 +69,9 @@ f32 func_809946BC(GlobalContext* globalCtx, DoorGerudo* this, f32 arg2, f32 arg3 Vec3f playerPos; Vec3f sp1C; - playerPos.x = player->actor.posRot.pos.x; - playerPos.y = player->actor.posRot.pos.y + arg2; - playerPos.z = player->actor.posRot.pos.z; + playerPos.x = player->actor.world.pos.x; + playerPos.y = player->actor.world.pos.y + arg2; + playerPos.z = player->actor.world.pos.z; func_8002DBD0(&this->dyna.actor, &sp1C, &playerPos); if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) { @@ -136,8 +136,7 @@ void func_8099496C(DoorGerudo* this, GlobalContext* globalCtx) { void func_809949C8(DoorGerudo* this, GlobalContext* globalCtx) { Math_StepToF(&this->dyna.actor.velocity.y, 15.0f, 3.0f); - Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 200.0f, - this->dyna.actor.velocity.y); + Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y); } void DoorGerudo_Update(Actor* thisx, GlobalContext* globalCtx) { 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 1366e85d60..e44f5375f7 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -13,7 +13,7 @@ extern UNK_TYPE D_06001BC8; /* const ActorInit Door_Killer_InitVars = { ACTOR_DOOR_KILLER, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_DOOR_KILLER, sizeof(DoorKiller), 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 0fcf0749d5..36da6c7776 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -34,7 +34,7 @@ void func_80997744(DoorShutter* this, GlobalContext* globalCtx); const ActorInit Door_Shutter_InitVars = { ACTOR_DOOR_SHUTTER, - ACTORTYPE_DOOR, + ACTORCAT_DOOR, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(DoorShutter), @@ -158,7 +158,7 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, GlobalContext* globalCtx) { if (doorType != SHUTTER_KEY_LOCKED) { if (frontRoom == transitionEntry->sides[1].room) { - if (ABS((s16)(this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsLink)) < 0x4000) { + if (ABS((s16)(this->dyna.actor.shape.rot.y - this->dyna.actor.yawTowardsPlayer)) < 0x4000) { frontRoom = -1; } } @@ -203,7 +203,7 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->dyna.actor.initPosRot.pos.z = this->dyna.actor.shape.unk_08; + this->dyna.actor.home.pos.z = this->dyna.actor.shape.yOffset; DynaPolyActor_Init(&this->dyna, DPM_UNK); this->doorType = (this->dyna.actor.params >> 6) & 0xF; phi_a3 = D_80998224[this->doorType]; @@ -239,14 +239,14 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx2, this->dyna.actor.params & 0x3F)) { this->unk_16E = 10; } - Actor_SetHeight(&this->dyna.actor, 60.0f); + Actor_SetFocus(&this->dyna.actor, 60.0f); } else if (phi_a3 == 4) { Actor_SetScale(&this->dyna.actor, 0.1f); this->unk_166 = 100; this->dyna.actor.uncullZoneScale = 200.0f; - Actor_SetHeight(&this->dyna.actor, 0.0f); + Actor_SetFocus(&this->dyna.actor, 0.0f); } else { - Actor_SetHeight(&this->dyna.actor, 60.0f); + Actor_SetFocus(&this->dyna.actor, 60.0f); } } @@ -293,9 +293,9 @@ f32 func_80996840(GlobalContext* globalCtx, DoorShutter* this, f32 arg2, f32 arg Vec3f sp1C; Player* player = PLAYER; - sp28.x = player->actor.posRot.pos.x; - sp28.y = player->actor.posRot.pos.y + arg2; - sp28.z = player->actor.posRot.pos.z; + sp28.x = player->actor.world.pos.x; + sp28.y = player->actor.world.pos.y + arg2; + sp28.z = player->actor.world.pos.z; func_8002DBD0(&this->dyna.actor, &sp1C, &sp28); if (arg3 < fabsf(sp1C.x) || arg4 < fabsf(sp1C.y)) { return FLT_MAX; @@ -381,7 +381,7 @@ void func_80996B0C(DoorShutter* this, GlobalContext* globalCtx) { } void func_80996C60(DoorShutter* this, GlobalContext* globalCtx) { - if (this->dyna.actor.type == ACTORTYPE_DOOR) { + if (this->dyna.actor.category == ACTORCAT_DOOR) { Player* player = PLAYER; s32 sp38 = this->unk_16C; s32 sp34 = 0xF; @@ -403,7 +403,7 @@ s32 func_80996D14(DoorShutter* this, GlobalContext* globalCtx) { func_80996C60(this, globalCtx); } Math_StepToF(&this->dyna.actor.velocity.y, 15.0f, 3.0f); - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y + 200.0f, + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y)) { return true; } @@ -465,7 +465,7 @@ void func_80996F98(DoorShutter* this, GlobalContext* globalCtx) { void func_80997004(DoorShutter* this, GlobalContext* globalCtx) { if (DECR(this->unk_16E) == 0 && globalCtx->roomCtx.status == 0 && func_80996D14(this, globalCtx) != 0) { - if (((this->doorType == SHUTTER_BOSS) ? 20.0f : 50.0f) < this->dyna.actor.xzDistToLink) { + if (((this->doorType == SHUTTER_BOSS) ? 20.0f : 50.0f) < this->dyna.actor.xzDistToPlayer) { if (DoorShutter_SetupDoor(this, globalCtx)) { this->dyna.actor.velocity.y = 30.0f; } @@ -490,7 +490,7 @@ void func_80997150(DoorShutter* this, GlobalContext* globalCtx) { if (globalCtx->state.frames % 2 != 0) { this->unk_16F++; } - if (this->dyna.actor.type == func_8005B198() || this->unk_16F == 0) { + if (this->dyna.actor.category == func_8005B198() || this->unk_16F == 0) { this->unk_16F = 5; } } else { @@ -513,7 +513,7 @@ void func_80997220(DoorShutter* this, GlobalContext* globalCtx) { if (this->dyna.actor.room >= 0) { Vec3f vec; - func_8002DBD0(&this->dyna.actor, &vec, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &vec, &player->actor.world.pos); this->dyna.actor.room = globalCtx->transitionActorList[(u16)this->dyna.actor.params >> 0xA].sides[(vec.z < 0.0f) ? 0 : 1].room; if (room != this->dyna.actor.room) { @@ -540,17 +540,17 @@ void func_809973E8(DoorShutter* this, GlobalContext* globalCtx) { if (this->dyna.actor.velocity.y < 20.0f) { Math_StepToF(&this->dyna.actor.velocity.y, 20.0f, 8.0f); } - if (Math_StepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, this->dyna.actor.velocity.y)) { if (this->dyna.actor.velocity.y > 20.0f) { - this->dyna.actor.groundY = this->dyna.actor.initPosRot.pos.y; - func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.posRot.pos, 45.0f, 0xA, 8.0f, 0x1F4, 0xA, 0); + this->dyna.actor.floorHeight = this->dyna.actor.home.pos.y; + func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 45.0f, 0xA, 8.0f, 0x1F4, 0xA, 0); } Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); quakeId = Quake_Add(Gameplay_GetCamera(globalCtx, 0), 3); Quake_SetSpeed(quakeId, -32536); Quake_SetQuakeValues(quakeId, 2, 0, 0, 0); Quake_SetCountdown(quakeId, 10); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 0xB4, 0x14, 0x64); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 0xB4, 0x14, 0x64); func_80997220(this, globalCtx); } } @@ -570,7 +570,7 @@ void func_80997568(DoorShutter* this, GlobalContext* globalCtx) { void func_809975C0(DoorShutter* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->dyna.actor); - func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 4); if (this->dyna.actor.bgCheckFlags & 1) { DoorShutter_SetupAction(this, func_809976B8); if (!(gSaveContext.eventChkInf[7] & 1)) { @@ -579,7 +579,7 @@ void func_809975C0(DoorShutter* this, GlobalContext* globalCtx) { this->unk_164 = 10; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_STONE_BOUND); func_8099803C(globalCtx, 2, 10, parent->subCameraId); - func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.posRot.pos, 70.0f, 20, 8.0f, 500, 10, 1); + func_80033260(globalCtx, &this->dyna.actor, &this->dyna.actor.world.pos, 70.0f, 20, 8.0f, 500, 10, 1); } } } @@ -590,7 +590,7 @@ void func_809976B8(DoorShutter* this, GlobalContext* globalCtx) { if (this->unk_164 != 0) { this->unk_164--; mult = sinf(this->unk_164 * 250.0f / 100.0f); - this->dyna.actor.shape.unk_08 = this->unk_164 * 3.0f / 10.0f * mult; + this->dyna.actor.shape.yOffset = this->unk_164 * 3.0f / 10.0f * mult; } } @@ -602,7 +602,7 @@ void func_80997744(DoorShutter* this, GlobalContext* globalCtx) { this->unk_164--; } phi_f0 = (this->unk_164 % 2 != 0) ? -3.0f : 0.0f; - Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, -34.0f + phi_f0, 1.0f, 20.0f, 0.0f); + Math_SmoothStepToF(&this->dyna.actor.world.pos.y, -34.0f + phi_f0, 1.0f, 20.0f, 0.0f); osSyncPrintf("FHG SAKU END !!\n"); } @@ -650,8 +650,8 @@ s32 func_80997A34(DoorShutter* this, GlobalContext* globalCtx) { if (Player_InCsMode(globalCtx)) { return true; } - phi_a0 = (s16)(func_8002DAC0(&this->dyna.actor, &globalCtx->view.eye) - this->dyna.actor.shape.rot.y); - phi_a1 = (s16)(this->dyna.actor.yawTowardsLink - this->dyna.actor.shape.rot.y); + phi_a0 = (s16)(Actor_WorldYawTowardPoint(&this->dyna.actor, &globalCtx->view.eye) - this->dyna.actor.shape.rot.y); + phi_a1 = (s16)(this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y); phi_a0 = ABS(phi_a0); phi_a1 = ABS(phi_a1); if ((phi_a1 < 0x4000 && phi_a0 > 0x4000) || (phi_a1 > 0x4000 && phi_a0 < 0x4000)) { @@ -690,7 +690,7 @@ void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx->roomCtx.prevRoom.num >= 0 || transitionEntry->sides[0].room == transitionEntry->sides[1].room) { - s32 yaw = Math_Vec3f_Yaw(&globalCtx->view.eye, &this->dyna.actor.posRot.pos); + s32 yaw = Math_Vec3f_Yaw(&globalCtx->view.eye, &this->dyna.actor.world.pos); if (ABS((s16)(this->dyna.actor.shape.rot.y - yaw)) < 0x4000) { Matrix_RotateY(M_PI, MTXMODE_APPLY); 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 b93796e505..9224fe3beb 100644 --- a/src/overlays/actors/ovl_Door_Toki/z_door_toki.c +++ b/src/overlays/actors/ovl_Door_Toki/z_door_toki.c @@ -16,7 +16,7 @@ void DoorToki_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit Door_Toki_InitVars = { ACTOR_DOOR_TOKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_TOKI_OBJECTS, sizeof(DoorToki), 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 0a36f15f77..1c309a8c09 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_06002CA8; /* const ActorInit Door_Warp1_InitVars = { ACTOR_DOOR_WARP1, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_WARP1, sizeof(DoorWarp1), 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 b77a244d32..52e620c2ee 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_060027D8; /* const ActorInit Efc_Erupc_InitVars = { ACTOR_EFC_ERUPC, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_EFC_ERUPC, sizeof(EfcErupc), 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 30086387b1..caef504118 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -14,7 +14,7 @@ extern UNK_TYPE D_04037880; /* const ActorInit Eff_Dust_InitVars = { ACTOR_EFF_DUST, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EffDust), 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 497849a7f9..6f4ae05a5f 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -22,7 +22,7 @@ void ElfMsg_CallNaviCylinder(ElfMsg* this, GlobalContext* globalCtx); const ActorInit Elf_Msg_InitVars = { ACTOR_ELF_MSG, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ElfMsg), @@ -97,8 +97,8 @@ void ElfMsg_SetupAction(ElfMsg* this, ElfMsgActionFunc actionFunc) { */ s32 ElfMsg_KillCheck(ElfMsg* this, GlobalContext* globalCtx) { - if ((this->actor.posRot.rot.y > 0) && (this->actor.posRot.rot.y < 0x41) && - (Flags_GetSwitch(globalCtx, this->actor.posRot.rot.y - 1))) { + if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && + (Flags_GetSwitch(globalCtx, this->actor.world.rot.y - 1))) { // "Mutual destruction" LOG_STRING("共倒れ", "../z_elf_msg.c", 161); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -106,7 +106,7 @@ s32 ElfMsg_KillCheck(ElfMsg* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); return 1; - } else if ((this->actor.posRot.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { + } else if ((this->actor.world.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { // "Mutual destruction" LOG_STRING("共倒れ", "../z_elf_msg.c", 172); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -136,17 +136,17 @@ void ElfMsg_Init(Actor* thisx, GlobalContext* globalCtx) { if (!ElfMsg_KillCheck(this, globalCtx)) { Actor_ProcessInitChain(thisx, sInitChain); - if (thisx->posRot.rot.x == 0) { + if (thisx->world.rot.x == 0) { thisx->scale.z = 0.4f; thisx->scale.x = 0.4f; } else { - thisx->scale.x = thisx->scale.z = thisx->posRot.rot.x * 0.04f; + thisx->scale.x = thisx->scale.z = thisx->world.rot.x * 0.04f; } - if (thisx->posRot.rot.z == 0) { + if (thisx->world.rot.z == 0) { thisx->scale.y = 0.4f; } else { - thisx->scale.y = thisx->posRot.rot.z * 0.04f; + thisx->scale.y = thisx->world.rot.z * 0.04f; } if (thisx->params & 0x4000) { @@ -175,10 +175,10 @@ void ElfMsg_CallNaviCuboid(ElfMsg* this, GlobalContext* globalCtx) { Player* player = PLAYER; EnElf* navi = (EnElf*)player->naviActor; - if ((fabsf(player->actor.posRot.pos.x - this->actor.posRot.pos.x) < (100.0f * this->actor.scale.x)) && - (this->actor.posRot.pos.y <= player->actor.posRot.pos.y) && - ((player->actor.posRot.pos.y - this->actor.posRot.pos.y) < (100.0f * this->actor.scale.y)) && - (fabsf(player->actor.posRot.pos.z - this->actor.posRot.pos.z) < (100.0f * this->actor.scale.z))) { + if ((fabsf(player->actor.world.pos.x - this->actor.world.pos.x) < (100.0f * this->actor.scale.x)) && + (this->actor.world.pos.y <= player->actor.world.pos.y) && + ((player->actor.world.pos.y - this->actor.world.pos.y) < (100.0f * this->actor.scale.y)) && + (fabsf(player->actor.world.pos.z - this->actor.world.pos.z) < (100.0f * this->actor.scale.z))) { player->naviTextId = ElfMsg_GetMessageId(this); navi->elfMsg = this; } @@ -192,9 +192,9 @@ void ElfMsg_CallNaviCylinder(ElfMsg* this, GlobalContext* globalCtx) { Player* player = PLAYER; EnElf* navi = (EnElf*)player->naviActor; - if (ElfMsg_WithinXZDistance(&player->actor.posRot.pos, &this->actor.posRot.pos, this->actor.scale.x * 100.0f) && - (this->actor.posRot.pos.y <= player->actor.posRot.pos.y) && - ((player->actor.posRot.pos.y - this->actor.posRot.pos.y) < (100.0f * this->actor.scale.y))) { + if (ElfMsg_WithinXZDistance(&player->actor.world.pos, &this->actor.world.pos, this->actor.scale.x * 100.0f) && + (this->actor.world.pos.y <= player->actor.world.pos.y) && + ((player->actor.world.pos.y - this->actor.world.pos.y) < (100.0f * this->actor.scale.y))) { player->naviTextId = ElfMsg_GetMessageId(this); navi->elfMsg = this; } @@ -211,8 +211,8 @@ void ElfMsg_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - if ((this->actor.posRot.rot.y <= 0x41) || (this->actor.posRot.rot.y > 0x80) || - Flags_GetSwitch(globalCtx, this->actor.posRot.rot.y - 0x41)) { + if ((this->actor.world.rot.y <= 0x41) || (this->actor.world.rot.y > 0x80) || + Flags_GetSwitch(globalCtx, this->actor.world.rot.y - 0x41)) { this->actionFunc(this, globalCtx); } } 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 27b386514f..b9a5073d2a 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -22,7 +22,7 @@ void ElfMsg2_WaitForTextRead(ElfMsg2* this, GlobalContext* globalCtx); const ActorInit Elf_Msg2_InitVars = { ACTOR_ELF_MSG2, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ElfMsg2), @@ -74,8 +74,8 @@ void ElfMsg2_SetupAction(ElfMsg2* this, ElfMsg2ActionFunc actionFunc) { */ s32 ElfMsg2_KillCheck(ElfMsg2* this, GlobalContext* globalCtx) { - if ((this->actor.posRot.rot.y > 0) && (this->actor.posRot.rot.y < 0x41) && - (Flags_GetSwitch(globalCtx, this->actor.posRot.rot.y - 1))) { + if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && + (Flags_GetSwitch(globalCtx, this->actor.world.rot.y - 1))) { // "Mutual destruction" LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -83,7 +83,7 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); return 1; - } else if ((this->actor.posRot.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { + } else if ((this->actor.world.rot.y == -1) && (Flags_GetClear(globalCtx, this->actor.room))) { // "Mutual destruction 2" LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); if (((this->actor.params >> 8) & 0x3F) != 0x3F) { @@ -107,11 +107,11 @@ void ElfMsg2_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(CYAN) " Elf_Msg2_Actor_ct %04x\n\n" VT_RST, this->actor.params); if (!ElfMsg2_KillCheck(this, globalCtx)) { - if ((this->actor.posRot.rot.x > 0) && (this->actor.posRot.rot.x < 8)) { - this->actor.unk_1F = this->actor.posRot.rot.x - 1; + if ((this->actor.world.rot.x > 0) && (this->actor.world.rot.x < 8)) { + this->actor.targetMode = this->actor.world.rot.x - 1; } Actor_ProcessInitChain(thisx, sInitChain); - if (this->actor.posRot.rot.y >= 0x41) { + if (this->actor.world.rot.y >= 0x41) { ElfMsg2_SetupAction(this, ElfMsg2_WaitUntilActivated); } else { ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead); @@ -137,7 +137,7 @@ void ElfMsg2_WaitForTextClose(ElfMsg2* this, GlobalContext* globalCtx) { s32 switchFlag; if (func_8002F334(&this->actor, globalCtx)) { - if (this->actor.posRot.rot.z != 1) { + if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); switchFlag = (this->actor.params >> 8) & 0x3F; if (switchFlag != 0x3F) { @@ -162,10 +162,10 @@ void ElfMsg2_WaitForTextRead(ElfMsg2* this, GlobalContext* globalCtx) { * Idles until a switch flag is set, at which point the actor becomes interactable */ void ElfMsg2_WaitUntilActivated(ElfMsg2* this, GlobalContext* globalCtx) { - // If (y >= 0x41) && (y <= 0x80), Idles until switch flag (actor.posRot.rot.y - 0x41) is set + // If (y >= 0x41) && (y <= 0x80), Idles until switch flag (actor.world.rot.y - 0x41) is set // If (y > 0x80), Idles forever (Bug?) - if ((this->actor.posRot.rot.y >= 0x41) && (this->actor.posRot.rot.y <= 0x80) && - (Flags_GetSwitch(globalCtx, (this->actor.posRot.rot.y - 0x41)))) { + if ((this->actor.world.rot.y >= 0x41) && (this->actor.world.rot.y <= 0x80) && + (Flags_GetSwitch(globalCtx, (this->actor.world.rot.y - 0x41)))) { ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead); this->actor.flags |= 0x00040001; // Make actor targetable and Navi-checkable this->actor.textId = ElfMsg2_GetMessageId(this); 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 68442538eb..5807df3ec9 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06005B3C; /* const ActorInit En_Am_InitVars = { ACTOR_EN_AM, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_AM, sizeof(EnAm), 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 f48a4f5ddc..cd4a99dd1f 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -34,7 +34,7 @@ extern AnimationHeader D_060076EC; const ActorInit En_Ani_InitVars = { ACTOR_EN_ANI, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ANI, sizeof(EnAni), @@ -86,7 +86,7 @@ void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, -2800.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060000F0, &D_060076EC, this->jointTable, this->morphTable, 0x10); Animation_PlayOnce(&this->skelAnime, &D_060076EC); Collider_InitCylinder(globalCtx, &this->collider); @@ -164,7 +164,7 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) { // "...all I can do is look at Death Mountain." } - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx) != 0) { if (this->actor.textId == 0x5056) { // "To get a good view..." EnAni_SetupAction(this, func_809B04F0); @@ -173,14 +173,14 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) { } else { EnAni_SetupAction(this, func_809B04F0); } - } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToLink < 150.0f && - -80.0f < this->actor.yDistToLink) { + } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && + -80.0f < this->actor.yDistToPlayer) { if (gSaveContext.itemGetInf[1] & 0x20) { EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..." } else { EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento." } - } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToLink < 350.0f) { + } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) { EnAni_SetText(this, globalCtx, textId); } } @@ -190,7 +190,7 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) { s16 yawDiff; u16 textId; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx) != 0) { if (this->actor.textId == 0x5056) { // "To get a good view..." EnAni_SetupAction(this, func_809B0524); @@ -199,14 +199,14 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) { } else { EnAni_SetupAction(this, func_809B0524); } - } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToLink < 150.0f && - -80.0f < this->actor.yDistToLink) { + } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && + -80.0f < this->actor.yDistToPlayer) { if ((gSaveContext.itemGetInf[1] & 0x20) != 0) { EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..." } else { EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento." } - } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToLink < 350.0f) { + } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) { if ((gSaveContext.eventChkInf[2] & 0x8000) == 0) { textId = 0x5052; // "...Something is happening on Death Mountain!" } else { @@ -225,7 +225,7 @@ void func_809B0994(EnAni* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_060070F0, 1.0f, 0.0f, Animation_GetLastFrame(&D_060070F0), ANIMMODE_ONCE, -4.0f); this->unk_2AA++; - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } } @@ -242,7 +242,7 @@ void func_809B0A6C(EnAni* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.npcActions[0]->action == 2) { Animation_Change(&this->skelAnime, &D_060067B8, 1.0f, 0.0f, Animation_GetLastFrame(&D_060067B8), ANIMMODE_ONCE, 0.0f); - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; this->unk_2AA++; } } @@ -254,7 +254,7 @@ void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.npcActions[0] != NULL)) { switch (this->unk_2AA) { case 0: @@ -285,7 +285,7 @@ void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->unk_2A8 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos); this->unk_2A2.z = 0; this->unk_2A2.y = this->unk_2A2.z; this->unk_2A2.x = this->unk_2A2.z; @@ -319,7 +319,7 @@ void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve EnAni* this = THIS; if (limbIndex == 15) { - Matrix_MultVec3f(&sMultVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMultVec, &this->actor.focus.pos); } } 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 1ed8f0843c..532e66b646 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06003990; /* const ActorInit En_Anubice_InitVars = { ACTOR_EN_ANUBICE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ANUBICE, sizeof(EnAnubice), 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 ced0195be0..cd699e9042 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 @@ -20,7 +20,7 @@ extern UNK_TYPE D_06003510; /* const ActorInit En_Anubice_Fire_InitVars = { ACTOR_EN_ANUBICE_FIRE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ANUBICE, sizeof(EnAnubiceFire), 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 58409292a0..1bbd04922f 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 @@ -21,7 +21,7 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx); const ActorInit En_Anubice_Tag_InitVars = { ACTOR_EN_ANUBICE_TAG, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnAnubiceTag), @@ -52,8 +52,8 @@ void EnAnubiceTag_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { this->anubis = - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, 0); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.yawTowardsPlayer, 0, 0); if (this->anubis != NULL) { this->actionFunc = EnAnubiceTag_ManageAnubis; @@ -79,14 +79,14 @@ void EnAnubiceTag_ManageAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { return; } - if (this->actor.xzDistToLink < (200.0f + this->triggerRange)) { + if (this->actor.xzDistToPlayer < (200.0f + this->triggerRange)) { if (anubis->unk_260 == 0) { if (anubis->unk_262 == 0) { anubis->unk_25E = 1; - offset.x = -Math_SinS(this->actor.yawTowardsLink) * this->actor.xzDistToLink; - offset.z = -Math_CosS(this->actor.yawTowardsLink) * this->actor.xzDistToLink; - Math_ApproachF(&anubis->actor.posRot.pos.x, (this->actor.posRot.pos.x + offset.x), 0.3f, 10.0f); - Math_ApproachF(&anubis->actor.posRot.pos.z, (this->actor.posRot.pos.z + offset.z), 0.3f, 10.0f); + offset.x = -Math_SinS(this->actor.yawTowardsPlayer) * this->actor.xzDistToPlayer; + offset.z = -Math_CosS(this->actor.yawTowardsPlayer) * this->actor.xzDistToPlayer; + Math_ApproachF(&anubis->actor.world.pos.x, (this->actor.world.pos.x + offset.x), 0.3f, 10.0f); + Math_ApproachF(&anubis->actor.world.pos.z, (this->actor.world.pos.z + offset.z), 0.3f, 10.0f); return; } } @@ -107,8 +107,8 @@ 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0xFF, 0, 0, 0xFF, 4, globalCtx->state.gfxCtx); } } 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 9385c1f62c..b50b2a33ad 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 @@ -16,7 +16,7 @@ void EnArowTrap_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Arow_Trap_InitVars = { ACTOR_EN_AROW_TRAP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnArowTrap), @@ -32,7 +32,7 @@ void EnArowTrap_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01); this->unk_14C = 0; this->attackTimer = 80; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; } void EnArowTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -41,12 +41,12 @@ void EnArowTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnArowTrap_Update(Actor* thisx, GlobalContext* globalCtx) { EnArowTrap* this = THIS; - if (this->actor.xzDistToLink <= 400) { + if (this->actor.xzDistToPlayer <= 400) { this->attackTimer--; if (this->attackTimer == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.shape.rot.x, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 0xFFFFFFFF); this->attackTimer = 80; } 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 5d9e908f1f..c99c478af5 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -23,7 +23,7 @@ extern UNK_TYPE D_04037880; /* const ActorInit En_Arrow_InitVars = { ACTOR_EN_ARROW, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnArrow), 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 6ddf930932..cdec504fa2 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 @@ -25,7 +25,7 @@ extern FlexSkeletonHeader D_06002530; const ActorInit En_Attack_Niw_InitVars = { ACTOR_EN_ATTACK_NIW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_NIW, sizeof(EnAttackNiw), @@ -36,9 +36,9 @@ const ActorInit En_Attack_Niw_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 1, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -46,7 +46,7 @@ void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, 16); if (this->actor.params < 0) { this->actor.params = 0; @@ -58,7 +58,7 @@ void EnAttackNiw_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_298.z = Rand_CenteredFloat(100.0f); Actor_SetScale(&this->actor, 0.01f); this->actor.flags &= ~1; - this->actor.shape.rot.y = this->actor.posRot.rot.y = (Rand_ZeroOne() - 0.5f) * 60000.0f; + this->actor.shape.rot.y = this->actor.world.rot.y = (Rand_ZeroOne() - 0.5f) * 60000.0f; this->actionFunc = func_809B5670; } @@ -171,7 +171,7 @@ s32 func_809B55EC(EnAttackNiw* this, GlobalContext* globalCtx) { s16 sp1E; s16 sp1C; - Actor_SetHeight(&this->actor, this->unk_2E4); + Actor_SetFocus(&this->actor, this->unk_2E4); func_8002F374(globalCtx, &this->actor, &sp1E, &sp1C); if ((this->actor.projectedPos.z < -20.0f) || (sp1E < 0) || (sp1E > SCREEN_WIDTH) || (sp1C < 0) || (sp1C > SCREEN_HEIGHT)) { @@ -199,19 +199,19 @@ void func_809B5670(EnAttackNiw* this, GlobalContext* globalCtx) { sp34.y = globalCtx->view.lookAt.y + tmpf2; sp34.z = globalCtx->view.lookAt.z + tmpf3; - this->unk_2D4 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &sp34); - this->unk_2D0 = Math_Vec3f_Pitch(&this->actor.posRot.pos, &sp34) * -1.0f; + this->unk_2D4 = Math_Vec3f_Yaw(&this->actor.world.pos, &sp34); + this->unk_2D0 = Math_Vec3f_Pitch(&this->actor.world.pos, &sp34) * -1.0f; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_2D4, 5, this->unk_2DC, 0); - Math_SmoothStepToS(&this->actor.posRot.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D4, 5, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); Math_ApproachF(&this->unk_2DC, 5000.0f, 1.0f, 100.0f); - Actor_SetHeight(&this->actor, this->unk_2E4); + Actor_SetFocus(&this->actor, this->unk_2E4); func_8002F374(globalCtx, &this->actor, &sp4E, &sp4C); if (this->actor.bgCheckFlags & 8) { - this->unk_2D4 = this->actor.yawTowardsLink; - this->unk_2D0 = this->actor.posRot.rot.x - 3000.0f; + this->unk_2D4 = this->actor.yawTowardsPlayer; + this->unk_2D0 = this->actor.world.rot.x - 3000.0f; this->unk_2DC = 0.0f; this->unk_284 = 0.0f; this->unk_27C = 0.0f; @@ -221,13 +221,13 @@ void func_809B5670(EnAttackNiw* this, GlobalContext* globalCtx) { this->unk_2E0 = 5.0f; this->unk_288 = 0.0f; this->actionFunc = func_809B59B0; - } else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(sp34.x - this->actor.posRot.pos.x) < 50.0f) && - (fabsf(sp34.y - this->actor.posRot.pos.y) < 50.0f) && - (fabsf(sp34.z - this->actor.posRot.pos.z) < 50.0f)) || + } else if (((this->actor.projectedPos.z > 0.0f) && (fabsf(sp34.x - this->actor.world.pos.x) < 50.0f) && + (fabsf(sp34.y - this->actor.world.pos.y) < 50.0f) && + (fabsf(sp34.z - this->actor.world.pos.z) < 50.0f)) || (this->actor.bgCheckFlags & 1)) { - this->unk_2D4 = this->actor.yawTowardsLink; - this->unk_2D0 = this->actor.posRot.rot.x - 2000.0f; + this->unk_2D4 = this->actor.yawTowardsPlayer; + this->unk_2D0 = this->actor.world.rot.x - 2000.0f; this->unk_2DC = 0.0f; this->unk_27C = 0.0f; this->unk_284 = 0.0f; @@ -258,17 +258,17 @@ void func_809B59B0(EnAttackNiw* this, GlobalContext* globalCtx) { if (this->actor.gravity != -2.0f) { this->unk_280 = this->unk_278 = 14000.0f; this->unk_2D0 = this->unk_26C = this->unk_268 = this->unk_284 = this->unk_27C = 0.0f; - this->unk_2D4 = this->actor.yawTowardsLink; + this->unk_2D4 = this->actor.yawTowardsPlayer; this->unk_262 = 0x32; this->unk_25C = 0x64; this->actor.gravity = -2.0f; } } if (this->unk_25C == 0x32) { - this->unk_2D4 = Rand_CenteredFloat(200.0f) + this->actor.yawTowardsLink; + this->unk_2D4 = Rand_CenteredFloat(200.0f) + this->actor.yawTowardsPlayer; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_2D4, 2, this->unk_2DC, 0); - Math_SmoothStepToS(&this->actor.posRot.rot.x, this->unk_2D0, 2, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2D4, 2, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 2, this->unk_2DC, 0); Math_ApproachF(&this->unk_2DC, 10000.0f, 1.0f, 1000.0f); Math_ApproachF(&this->actor.speedXZ, this->unk_2E0, 0.9f, 1.0f); if ((this->actor.gravity == -2.0f) && (this->unk_262 == 0) && @@ -276,7 +276,7 @@ void func_809B59B0(EnAttackNiw* this, GlobalContext* globalCtx) { this->unk_2E0 = 0.0f; this->actor.gravity = 0.0f; this->unk_2DC = 0.0f; - this->unk_2D0 = this->actor.posRot.rot.x - 5000.0f; + this->unk_2D0 = this->actor.world.rot.x - 5000.0f; this->actionFunc = func_809B5C18; } else if (this->actor.bgCheckFlags & 1) { func_809B5268(this, globalCtx, 5); @@ -290,7 +290,7 @@ void func_809B5C18(EnAttackNiw* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - Math_SmoothStepToS(&this->actor.posRot.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); + Math_SmoothStepToS(&this->actor.world.rot.x, this->unk_2D0, 5, this->unk_2DC, 0); Math_ApproachF(&this->unk_2DC, 5000.0f, 1.0f, 100.0f); Math_ApproachF(&this->actor.velocity.y, 5.0f, 0.3f, 1.0f); func_809B5268(this, globalCtx, 2); @@ -328,10 +328,10 @@ void EnAttackNiw_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_262--; } - this->actor.shape.rot = this->actor.posRot.rot; - this->actor.shape.unk_10 = 15.0f; + this->actor.shape.rot = this->actor.world.rot; + this->actor.shape.shadowScale = 15.0f; this->actionFunc(this, globalCtx2); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); if (this->actionFunc == func_809B5670) { func_8002D97C(&this->actor); @@ -339,29 +339,29 @@ void EnAttackNiw_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); } - if (this->actor.groundY <= BGCHECK_Y_MIN) { + if (this->actor.floorHeight <= BGCHECK_Y_MIN) { Actor_Kill(&this->actor); return; } if ((this->actor.bgCheckFlags & 0x20) && (this->actionFunc != func_809B5C18)) { - Math_Vec3f_Copy(&sp30, &this->actor.posRot.pos); + Math_Vec3f_Copy(&sp30, &this->actor.world.pos); sp30.y += this->actor.yDistToWater; EffectSsGSplash_Spawn(globalCtx, &sp30, 0, 0, 0, 0x190); this->unk_2DC = 0.0f; this->actor.gravity = 0.0f; this->unk_2E0 = 0.0f; - this->unk_2D0 = this->actor.posRot.rot.x - 5000.0f; + this->unk_2D0 = this->actor.world.rot.x - 5000.0f; this->actionFunc = func_809B5C18; return; } tmpf1 = 20.0f; - if (this->actor.xyzDistToLinkSq < SQ(tmpf1)) { + if (this->actor.xyzDistToPlayerSq < SQ(tmpf1)) { cucco = (EnNiw*)this->actor.parent; if ((this->actor.parent->update != NULL) && (this->actor.parent != NULL) && (cucco != NULL) && (cucco->timer9 == 0) && (player->invincibilityTimer == 0)) { - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.posRot.rot.y, 0.0f, 0x10); + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.world.rot.y, 0.0f, 0x10); cucco->timer9 = 0x46; } } 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 65bae38dac..117643d1df 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_06001D80; /* const ActorInit En_Ba_InitVars = { ACTOR_EN_BA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BXA, sizeof(EnBa), 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 6ae8e87b45..1055b920e3 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -202,7 +202,7 @@ static DamageTable sDamageTableWhite = { const ActorInit En_Bb_InitVars = { ACTOR_EN_BB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BB, sizeof(EnBb), @@ -240,7 +240,7 @@ static ColliderJntSphInit sJntSphInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 10, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 10, ICHAIN_STOP), }; void EnBb_SetupAction(EnBb* this, EnBbActionFunc actionFunc) { @@ -248,7 +248,7 @@ void EnBb_SetupAction(EnBb* this, EnBbActionFunc actionFunc) { } Actor* EnBb_FindExplosive(GlobalContext* globalCtx, EnBb* this, f32 range) { - Actor* explosive = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* explosive = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; f32 dist; while (explosive != NULL) { @@ -256,7 +256,7 @@ Actor* EnBb_FindExplosive(GlobalContext* globalCtx, EnBb* this, f32 range) { explosive = explosive->next; continue; } - dist = func_8002DB48(&this->actor, explosive); + dist = Actor_WorldDistXYZToActor(&this->actor, explosive); if ((explosive->params == 0) && (dist <= range)) { return explosive; } @@ -271,8 +271,8 @@ void EnBb_SpawnFlameTrail(GlobalContext* globalCtx, EnBb* this, s16 startAtZero) s32 i; for (i = 0; i < 5; i++) { - next = (EnBb*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BB, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + next = (EnBb*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BB, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (next != NULL) { now->actor.child = &next->actor; next->actor.parent = &now->actor; @@ -328,7 +328,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->params |= 0xFF00; } if (thisx->params <= ENBB_BLUE) { - ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawCircle, 35.0f); } if (thisx->params & 0xFF00) { this->timer = 0; @@ -346,7 +346,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->naviEnemyId = 0x1C; thisx->colChkInfo.damageTable = &sDamageTableBlueGreen; this->flamePrimBlue = this->flameEnvColor.b = 255; - thisx->posRot.pos.y += 50.0f; + thisx->world.pos.y += 50.0f; EnBb_SetupBlue(this); thisx->flags |= 0x4000; break; @@ -393,7 +393,7 @@ void EnBb_Init(Actor* thisx, GlobalContext* globalCtx) { EnBb_InitGreen(this, globalCtx); break; } - thisx->posRot2.pos = thisx->posRot.pos; + thisx->focus.pos = thisx->world.pos; } else { EnBb_SetupFlameTrail(this); } @@ -444,10 +444,10 @@ void EnBb_FlameTrail(EnBb* this, GlobalContext* globalCtx) { this->flamePrimAlpha -= 20; } } - this->actor.posRot.pos = this->actor.parent->pos4; + this->actor.world.pos = this->actor.parent->prevPos; } else { this->timer--; - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.parent->posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.parent->world.rot.y; } } if (this->actor.parent != NULL) { @@ -457,7 +457,7 @@ void EnBb_FlameTrail(EnBb* this, GlobalContext* globalCtx) { void EnBb_SetupDeath(EnBb* this, GlobalContext* globalCtx) { if (this->actor.params <= ENBB_BLUE) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = -7.0f; this->timer = 5; this->actor.shape.rot.x += 0x4E20; @@ -489,7 +489,7 @@ void EnBb_Death(EnBb* this, GlobalContext* globalCtx) { if (!func_8003305C(&this->actor, &this->enPartInfo, globalCtx, sp4E)) { return; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xD0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xD0); } else { if (this->flamePrimAlpha) { if (this->flamePrimAlpha <= 20) { @@ -507,11 +507,11 @@ void EnBb_SetupDamage(EnBb* this) { this->action = BB_DAMAGE; Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DAMAGE); if (this->actor.params > ENBB_GREEN) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if ((this->actor.bgCheckFlags & 8) == 0) { this->actor.speedXZ = -7.0f; } - this->actor.shape.unk_08 = 1500.0f; + this->actor.shape.yOffset = 1500.0f; } if (this->actor.params == ENBB_RED) { EnBb_KillFlameTrail(this); @@ -524,7 +524,7 @@ void EnBb_SetupDamage(EnBb* this) { void EnBb_Damage(EnBb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); if (this->actor.speedXZ == 0.0f) { - this->actor.shape.unk_08 = 200.0f; + this->actor.shape.yOffset = 200.0f; EnBb_SetupDown(this); } } @@ -547,8 +547,8 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f); Math_SmoothStepToF(&this->flameScaleX, 100.0f, 1.0f, 10.0f, 0.0f); - if (this->actor.groundY > -32000.0f) { - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.groundY + 50.0f + this->flyHeightMod, 1.0f, 0.5f, + if (this->actor.floorHeight > -32000.0f) { + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight + 50.0f + this->flyHeightMod, 1.0f, 0.5f, 0.0f); } SkelAnime_Update(&this->skelAnime); @@ -559,13 +559,13 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { this->bobSpeedMod = Rand_ZeroOne() * 4.0f; } } - this->actor.posRot.pos.y += Math_CosF(this->bobPhase) * (1.0f + this->bobSpeedMod); + this->actor.world.pos.y += Math_CosF(this->bobPhase) * (1.0f + this->bobSpeedMod); this->bobPhase += 0.2f; Math_SmoothStepToF(&this->actor.speedXZ, this->maxSpeed, 1.0f, 0.5f, 0.0f); - if (Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 300.0f) { - this->vMoveAngleY = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); + if (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 300.0f) { + this->vMoveAngleY = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); } else { this->timer--; if (this->timer <= 0) { @@ -573,10 +573,10 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { this->flyHeightMod = (s16)(Math_CosF(this->bobPhase) * 10.0f); this->actor.speedXZ = 0.0f; if (this->charge && (this->targetActor == NULL)) { - this->vMoveAngleY = this->actor.posRot.rot.y; - if (this->actor.xzDistToLink < 200.0f) { + this->vMoveAngleY = this->actor.world.rot.y; + if (this->actor.xzDistToPlayer < 200.0f) { Animation_PlayLoop(&this->skelAnime, &D_06000184); - this->vMoveAngleY = this->actor.yawTowardsLink; + this->vMoveAngleY = this->actor.yawTowardsPlayer; } this->maxSpeed = (Rand_ZeroOne() * 1.5f) + 6.0f; this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f; @@ -588,16 +588,16 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { this->vMoveAngleY = Math_SinF(this->bobPhase) * 65535.0f; } } - if ((this->actor.xzDistToLink < 150.0f) && (this->actionState != BBBLUE_NORMAL)) { + if ((this->actor.xzDistToPlayer < 150.0f) && (this->actionState != BBBLUE_NORMAL)) { if (!this->charge) { Animation_PlayLoop(&this->skelAnime, &D_06000184); this->maxSpeed = (Rand_ZeroOne() * 1.5f) + 6.0f; this->timer = (Rand_ZeroOne() * 5.0f) + 20.0f; - this->vMoveAngleY = this->actor.yawTowardsLink; + this->vMoveAngleY = this->actor.yawTowardsPlayer; this->actionState = this->charge = true; // Sets actionState to BBBLUE_AGGRO } - } else if (this->actor.xzDistToLink < 200.0f) { - this->vMoveAngleY = this->actor.yawTowardsLink; + } else if (this->actor.xzDistToPlayer < 200.0f) { + this->vMoveAngleY = this->actor.yawTowardsPlayer; } if (this->targetActor == NULL) { explosive = EnBb_FindExplosive(globalCtx, this, 300.0f); @@ -607,35 +607,35 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { explosive = NULL; } if (explosive != NULL) { - this->vMoveAngleY = func_8002DA78(&this->actor, explosive); + this->vMoveAngleY = Actor_WorldYawTowardActor(&this->actor, explosive); if ((this->vBombHopPhase == 0) && (explosive != this->targetActor)) { this->vBombHopPhase = -0x8000; this->targetActor = explosive; this->actor.speedXZ *= 0.5f; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x1388, 0); - Math_SmoothStepToF(&this->actor.posRot.pos.x, explosive->posRot.pos.x, 1.0f, 1.5f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, explosive->posRot.pos.y + 40.0f, 1.0f, 1.5f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, explosive->posRot.pos.z, 1.0f, 1.5f, 0.0f); + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x1388, 0); + Math_SmoothStepToF(&this->actor.world.pos.x, explosive->world.pos.x, 1.0f, 1.5f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, explosive->world.pos.y + 40.0f, 1.0f, 1.5f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, explosive->world.pos.z, 1.0f, 1.5f, 0.0f); } else { this->targetActor = NULL; } if (this->vBombHopPhase != 0) { - this->actor.posRot.pos.y += -Math_CosS(this->vBombHopPhase) * 10.0f; + this->actor.world.pos.y += -Math_CosS(this->vBombHopPhase) * 10.0f; this->vBombHopPhase += 0x1000; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x7D0, 0); } - thisYawToWall = this->actor.wallPolyRot - this->actor.posRot.rot.y; - moveYawToWall = this->actor.wallPolyRot - this->vMoveAngleY; + thisYawToWall = this->actor.wallYaw - this->actor.world.rot.y; + moveYawToWall = this->actor.wallYaw - this->vMoveAngleY; if ((this->targetActor == NULL) && (this->actor.bgCheckFlags & 8) && (ABS(thisYawToWall) > 0x4000 || ABS(moveYawToWall) > 0x4000)) { - this->vMoveAngleY = this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0xBB8, 0); + this->vMoveAngleY = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0xBB8, 0); } } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->vMoveAngleY, 1, 0x3E8, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->vMoveAngleY, 1, 0x3E8, 0); if ((this->collider.base.acFlags & AC_HIT) || (this->collider.base.atFlags & AT_HIT)) { - this->vMoveAngleY = this->actor.yawTowardsLink + 0x8000; + this->vMoveAngleY = this->actor.yawTowardsPlayer + 0x8000; if (this->collider.base.acFlags & AC_HIT) { afterHitAngle = -0x8000; } else { @@ -645,7 +645,7 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { afterHitAngle = -0x4000; } } - this->actor.posRot.rot.y = this->actor.yawTowardsLink + afterHitAngle; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + afterHitAngle; this->collider.base.acFlags &= ~AC_HIT; this->collider.base.atFlags &= ~AT_HIT; } @@ -664,14 +664,14 @@ void EnBb_Blue(EnBb* this, GlobalContext* globalCtx) { if (((s32)this->skelAnime.curFrame == 0) && (Rand_ZeroOne() < 0.1f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_LAUGH); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnBb_SetupDown(EnBb* this) { Animation_PlayLoop(&this->skelAnime, &D_06000444); this->action = BB_DOWN; this->timer = 200; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; this->actor.bgCheckFlags &= ~1; this->actor.speedXZ = 3.0f; this->flameScaleX = 0.0f; @@ -682,19 +682,18 @@ void EnBb_SetupDown(EnBb* this) { } void EnBb_Down(EnBb* this, GlobalContext* globalCtx) { - s16 yawDiff = this->actor.posRot.rot.y - this->actor.wallPolyRot; + s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw; SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 8) { if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = - this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; + this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } this->actor.bgCheckFlags &= ~8; } if (this->actor.bgCheckFlags & 3) { if (this->actor.params == ENBB_RED) { - s32 floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + s32 floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorType == 2) || (floorType == 3) || (floorType == 9)) { this->moveMode = BBMOVE_HIDDEN; @@ -713,10 +712,10 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) { this->actor.velocity.y = 10.0f; } this->actor.bgCheckFlags &= ~1; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 7.0f, 2, 2.0f, 0, 0, 0); - Math_SmoothStepToS(&this->actor.posRot.rot.y, -this->actor.yawTowardsLink, 1, 0xBB8, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, -this->actor.yawTowardsPlayer, 1, 0xBB8, 0); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if ((s32)this->skelAnime.curFrame == 5) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_WING); } @@ -738,7 +737,7 @@ void EnBb_Down(EnBb* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; EnBb_SetupWhite(globalCtx, this); - this->actor.posRot.pos.y -= 60.0f; + this->actor.world.pos.y -= 60.0f; break; } } else { @@ -761,8 +760,8 @@ void EnBb_SetupRed(GlobalContext* globalCtx, EnBb* this) { this->timer = 0; this->actionState = BBRED_WAIT; this->moveMode = BBMOVE_HIDDEN; - this->actor.posRot.pos.y -= 80.0f; - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.world.pos.y -= 80.0f; + this->actor.home.pos = this->actor.world.pos; this->actor.velocity.y = this->actor.gravity = this->actor.speedXZ = 0.0f; this->actor.bgCheckFlags &= ~1; this->actor.flags &= ~1; @@ -781,10 +780,10 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { this->timer--; } - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; switch (this->actionState) { case BBRED_WAIT: - if ((func_8002DB48(&this->actor, &player->actor) <= 250.0f) && (ABS(yawDiff) <= 0x4000) && + if ((Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 250.0f) && (ABS(yawDiff) <= 0x4000) && (this->timer == 0)) { this->actor.speedXZ = 5.0f; this->actor.gravity = -1.0f; @@ -805,15 +804,15 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->flameScaleY, 80.0f, 1.0f, 10.0f, 0.0f); Math_SmoothStepToF(&this->flameScaleX, 100.0f, 1.0f, 10.0f, 0.0f); if (this->actor.bgCheckFlags & 8) { - yawDiff = this->actor.posRot.rot.y - this->actor.wallPolyRot; + yawDiff = this->actor.world.rot.y - this->actor.wallYaw; if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = - this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; + this->actor.world.rot.y = + this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } this->actor.bgCheckFlags &= ~8; } if (this->actor.bgCheckFlags & 1) { - floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + floorType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorType == 2) || (floorType == 3) || (floorType == 9)) { this->moveMode = BBMOVE_HIDDEN; this->timer = 10; @@ -824,11 +823,11 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { if (this->actor.velocity.y > 13.0f) { this->actor.velocity.y = 13.0f; } - this->actor.posRot.rot.y = Math_SinF(this->bobPhase) * 65535.0f; + this->actor.world.rot.y = Math_SinF(this->bobPhase) * 65535.0f; } this->actor.bgCheckFlags &= ~1; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if (Actor_GetCollidedExplosive(globalCtx, &this->collider.base) != NULL) { EnBb_SetupDown(this); } @@ -840,8 +839,8 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { this->actor.velocity.y = 0.0f; this->actionState = BBRED_WAIT; this->timer = 120; - this->actor.posRot.pos = this->actor.initPosRot.pos; - this->actor.shape.rot = this->actor.posRot.rot = this->actor.initPosRot.rot; + this->actor.world.pos = this->actor.home.pos; + this->actor.shape.rot = this->actor.world.rot = this->actor.home.rot; EnBb_KillFlameTrail(this); } break; @@ -855,7 +854,7 @@ void EnBb_Red(EnBb* this, GlobalContext* globalCtx) { } void EnBb_FaceWaypoint(EnBb* this) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); + this->actor.world.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); } void EnBb_SetWaypoint(EnBb* this, GlobalContext* globalCtx) { @@ -876,7 +875,7 @@ void EnBb_SetWaypoint(EnBb* this, GlobalContext* globalCtx) { void EnBb_SetupWhite(GlobalContext* globalCtx, EnBb* this) { Animation_PlayLoop(&this->skelAnime, &D_06000444); this->actor.speedXZ = 0.0f; - this->actor.posRot.pos.y += 60.0f; + this->actor.world.pos.y += 60.0f; this->flameScaleX = 100.0f; this->action = BB_WHITE; this->waypoint = 0; @@ -890,15 +889,15 @@ void EnBb_White(EnBb* this, GlobalContext* globalCtx) { f32 distL1; f32 vx; f32 vz; - s16 pitch = Math_Vec3f_Pitch(&this->actor.posRot.pos, &this->waypointPos); + s16 pitch = Math_Vec3f_Pitch(&this->actor.world.pos, &this->waypointPos); f32 vy = Math_SinS(pitch) * this->maxSpeed; f32 vxz = Math_CosS(pitch) * this->maxSpeed; vx = Math_SinS(this->actor.shape.rot.y) * vxz; vz = Math_CosS(this->actor.shape.rot.y) * vxz; - distL1 = Math_SmoothStepToF(&this->actor.posRot.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); - distL1 += Math_SmoothStepToF(&this->actor.posRot.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); - distL1 += Math_SmoothStepToF(&this->actor.posRot.pos.z, this->waypointPos.z, 1.0f, ABS(vz), 0.0f); + distL1 = Math_SmoothStepToF(&this->actor.world.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); + distL1 += Math_SmoothStepToF(&this->actor.world.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); + distL1 += Math_SmoothStepToF(&this->actor.world.pos.z, this->waypointPos.z, 1.0f, ABS(vz), 0.0f); this->bobPhase += (0.05f + (Rand_ZeroOne() * 0.01f)); if (distL1 == 0.0f) { this->timer--; @@ -911,7 +910,7 @@ void EnBb_White(EnBb* this, GlobalContext* globalCtx) { if (this->moveMode != BBMOVE_NORMAL) { Animation_PlayLoop(&this->skelAnime, &D_06000444); } - this->actor.posRot.rot.y += 0x1F40; + this->actor.world.rot.y += 0x1F40; } this->moveMode = BBMOVE_NORMAL; this->maxSpeed = 0.0f; @@ -923,7 +922,7 @@ void EnBb_White(EnBb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_BITE); this->collider.base.atFlags &= ~AT_HIT; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) { EnBb_FaceWaypoint(this); } @@ -947,17 +946,16 @@ void EnBb_InitGreen(EnBb* this, GlobalContext* globalCtx) { this->actionState = BBGREEN_FLAME_ON; this->bobPhase = Rand_ZeroOne(); this->actor.shape.rot.x = this->actor.shape.rot.z = 0; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (this->actor.params == ENBB_GREEN_BIG) { EnBb_SetWaypoint(this, globalCtx); EnBb_FaceWaypoint(this); } - Matrix_Translate(this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - MTXMODE_NEW); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, 0, MTXMODE_APPLY); + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, 0, MTXMODE_APPLY); Matrix_RotateZ(this->bobPhase, MTXMODE_APPLY); bobOffset.y = this->bobSize; - Matrix_MultVec3f(&bobOffset, &this->actor.posRot.pos); + Matrix_MultVec3f(&bobOffset, &this->actor.world.pos); this->targetActor = NULL; this->action = BB_GREEN; this->actor.speedXZ = 0.0f; @@ -974,32 +972,32 @@ void EnBb_SetupGreen(EnBb* this) { this->actor.speedXZ = 0.0f; this->vFlameTimer = (Rand_ZeroOne() * 30.0f) + 180.0f; this->actor.shape.rot.z = 0; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; EnBb_SetupAction(this, EnBb_Green); } void EnBb_Green(EnBb* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f bobOffset = { 0.0f, 0.0f, 0.0f }; - Vec3f nextPos = player->actor.posRot.pos; + Vec3f nextPos = player->actor.world.pos; nextPos.y += 30.0f; if (this->actor.params == ENBB_GREEN_BIG) { if (this->actor.speedXZ == 0.0f) { - s16 pitch = Math_Vec3f_Pitch(&this->actor.initPosRot.pos, &this->waypointPos); - s16 yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->waypointPos); + s16 pitch = Math_Vec3f_Pitch(&this->actor.home.pos, &this->waypointPos); + s16 yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &this->waypointPos); f32 vy = Math_SinS(pitch) * this->maxSpeed; f32 vxz = Math_CosS(pitch) * this->maxSpeed; f32 vz; f32 vx; f32 distL1; - Math_SmoothStepToS(&this->actor.posRot.rot.y, yaw, 1, 0x3E8, 0); - vx = Math_SinS(this->actor.posRot.rot.y) * vxz; - distL1 = Math_CosS(this->actor.posRot.rot.y) * vxz; - vz = Math_SmoothStepToF(&this->actor.initPosRot.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); - vz += Math_SmoothStepToF(&this->actor.initPosRot.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); - vz += Math_SmoothStepToF(&this->actor.initPosRot.pos.z, this->waypointPos.z, 1.0f, ABS(distL1), 0.0f); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 0x3E8, 0); + vx = Math_SinS(this->actor.world.rot.y) * vxz; + distL1 = Math_CosS(this->actor.world.rot.y) * vxz; + vz = Math_SmoothStepToF(&this->actor.home.pos.x, this->waypointPos.x, 1.0f, ABS(vx), 0.0f); + vz += Math_SmoothStepToF(&this->actor.home.pos.y, this->waypointPos.y, 1.0f, ABS(vy), 0.0f); + vz += Math_SmoothStepToF(&this->actor.home.pos.z, this->waypointPos.z, 1.0f, ABS(distL1), 0.0f); this->bobPhase += (0.05f + (Rand_ZeroOne() * 0.01f)); if (vz == 0.0f) { EnBb_SetWaypoint(this, globalCtx); @@ -1018,27 +1016,26 @@ void EnBb_Green(EnBb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_LAUGH); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f) == 0.0f) { EnBb_FaceWaypoint(this); } } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 0); - Math_SmoothStepToS(&this->actor.shape.rot.x, Math_Vec3f_Pitch(&this->actor.posRot.pos, &nextPos), 1, 0xFA0, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 0); + Math_SmoothStepToS(&this->actor.shape.rot.x, Math_Vec3f_Pitch(&this->actor.world.pos, &nextPos), 1, 0xFA0, 0); } SkelAnime_Update(&this->skelAnime); if (Math_CosF(this->bobPhase) <= 0.002f) { this->bobSpeedMod = Rand_ZeroOne() * 0.05f; } - Matrix_Translate(this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - MTXMODE_NEW); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, 0, MTXMODE_APPLY); + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, 0, MTXMODE_APPLY); Matrix_RotateZ(this->bobPhase, MTXMODE_APPLY); bobOffset.y = this->bobSize; Matrix_MultVec3f(&bobOffset, &nextPos); - Math_SmoothStepToF(&this->actor.posRot.pos.x, nextPos.x, 1.0f, this->bobPhase * 0.75f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, nextPos.y, 1.0f, this->bobPhase * 0.75f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, nextPos.z, 1.0f, this->bobPhase * 0.75f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.x, nextPos.x, 1.0f, this->bobPhase * 0.75f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, nextPos.y, 1.0f, this->bobPhase * 0.75f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, nextPos.z, 1.0f, this->bobPhase * 0.75f, 0.0f); this->bobPhase += 0.1f + this->bobSpeedMod; if (Actor_GetCollidedExplosive(globalCtx, &this->collider.base) || (--this->vFlameTimer == 0)) { this->actionState++; @@ -1075,7 +1072,7 @@ void EnBb_SetupStunned(EnBb* this) { if (this->actor.params != ENBB_RED) { if (this->actor.params > ENBB_GREEN) { this->actor.gravity = -2.0f; - this->actor.shape.unk_08 = 1500.0f; + this->actor.shape.yOffset = 1500.0f; } this->actor.speedXZ = 0.0f; this->flameScaleX = 0.0f; @@ -1100,12 +1097,11 @@ void EnBb_SetupStunned(EnBb* this) { } void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) { - s16 yawDiff = this->actor.posRot.rot.y - this->actor.wallPolyRot; + s16 yawDiff = this->actor.world.rot.y - this->actor.wallYaw; if (this->actor.bgCheckFlags & 8) { if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = - this->actor.wallPolyRot + this->actor.wallPolyRot - this->actor.posRot.rot.y - 0x8000; + this->actor.world.rot.y = this->actor.wallYaw + this->actor.wallYaw - this->actor.world.rot.y - 0x8000; } this->actor.bgCheckFlags &= ~8; } @@ -1116,10 +1112,10 @@ void EnBb_Stunned(EnBb* this, GlobalContext* globalCtx) { } else { this->actor.velocity.y = 0.0f; } - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 7.0f, 2, 2.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 7.0f, 2, 2.0f, 0, 0, 0); } - if (this->actor.dmgEffectTimer == 0) { - this->actor.shape.unk_08 = 200.0f; + if (this->actor.colorFilterTimer == 0) { + this->actor.shape.yOffset = 200.0f; if (this->actor.colChkInfo.health != 0) { if ((this->actor.params == ENBB_GREEN) || (this->actor.params == ENBB_GREEN_BIG)) { EnBb_SetupGreen(this); @@ -1141,7 +1137,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { this->collider.base.atFlags &= ~AT_BOUNCED; if (this->action != BB_DOWN) { if (this->actor.params >= ENBB_RED) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer + 0x8000; if (this->actor.params == ENBB_RED) { EnBb_KillFlameTrail(this); } @@ -1202,7 +1198,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { EnBb_SetupDeath(this, globalCtx); //! @bug //! Because Din's Fire kills the bubble in a single hit, func_8003426C is never called and - //! dmgEffectParams is never set. And because Din's Fire halts updating during its cutscene, + //! colorFilterParams is never set. And because Din's Fire halts updating during its cutscene, //! EnBb_Death doesn't kill the bubble on the next frame like it should. This combines with //! the bug in EnBb_Draw below to crash the game. } else if ((this->actor.params == ENBB_WHITE) && @@ -1210,7 +1206,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0xC); this->actor.speedXZ = -8.0f; this->maxSpeed = 0.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLE_DAMAGE); } else if (((this->action == BB_DOWN) && (this->timer < 190)) || ((this->actor.params != ENBB_WHITE) && (this->flameScaleX < 20.0f))) { @@ -1241,22 +1237,22 @@ void EnBb_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_MoveForward(&this->actor); } if (this->moveMode == BBMOVE_NORMAL) { - if ((this->actor.posRot.pos.y - 20.0f) <= this->actor.groundY) { + if ((this->actor.world.pos.y - 20.0f) <= this->actor.floorHeight) { sp34 = 20.0f; } - func_8002E4B4(globalCtx, &this->actor, sp34, 25.0f, 20.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, sp34, 25.0f, 20.0f, 5); } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->collider.elements->dim.worldSphere.center.x = this->actor.posRot.pos.x; + this->actor.focus.pos = this->actor.world.pos; + this->collider.elements->dim.worldSphere.center.x = this->actor.world.pos.x; this->collider.elements->dim.worldSphere.center.y = - this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y); - this->collider.elements->dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); + this->collider.elements->dim.worldSphere.center.z = this->actor.world.pos.z; if ((this->action > BB_KILL) && ((this->actor.speedXZ != 0.0f) || (this->action == BB_GREEN))) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if ((this->action > BB_FLAME_TRAIL) && - ((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000)) && + ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000)) && (this->moveMode != BBMOVE_HIDDEN)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -1295,21 +1291,21 @@ void EnBb_Draw(Actor* thisx, GlobalContext* globalCtx) { this); if (this->fireIceTimer != 0) { - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; //! @bug: - //! The purpose of this is to counteract Actor_UpdateAll decrementing dmgEffectTimer. However, + //! The purpose of this is to counteract Actor_UpdateAll decrementing colorFilterTimer. However, //! the above bugs mean unk_2A8 can be nonzero without damage effects ever having been set. - //! This routine will then increment dmgEffectTimer, and on the next frame Actor_Draw will try - //! to draw the unset dmgEffectParams. This causes a divide-by-zero error, crashing the game. + //! This routine will then increment colorFilterTimer, and on the next frame Actor_Draw will try + //! to draw the unset colorFilterParams. This causes a divide-by-zero error, crashing the game. if (1) {} this->fireIceTimer--; if ((this->fireIceTimer % 4) == 0) { Vec3f sp70; s32 index = this->fireIceTimer >> 2; - sp70.x = this->actor.posRot.pos.x + sFireIceOffsets[index].x; - sp70.y = this->actor.posRot.pos.y + sFireIceOffsets[index].y; - sp70.z = this->actor.posRot.pos.z + sFireIceOffsets[index].z; + sp70.x = this->actor.world.pos.x + sFireIceOffsets[index].x; + sp70.y = this->actor.world.pos.y + sFireIceOffsets[index].y; + sp70.z = this->actor.world.pos.z + sFireIceOffsets[index].z; if ((this->dmgEffect != 7) && (this->dmgEffect != 5)) { EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &sp70, 0x96, 0x96, 0x96, 0xFA, 0xEB, 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 ba34146f4b..d7b3473eda 100644 --- a/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c +++ b/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_0601D950; /* const ActorInit En_Bdfire_InitVars = { 0, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_KINGDODONGO, sizeof(EnBdfire), 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 61259b5970..8dbad73d8a 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_06006BC0; /* const ActorInit En_Bigokuta_InitVars = { ACTOR_EN_BIGOKUTA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BIGOKUTA, sizeof(EnBigokuta), 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 7e3b622839..0c0681cec2 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_06005848; /* const ActorInit En_Bili_InitVars = { ACTOR_EN_BILI, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BL, sizeof(EnBili), 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 23216f98c1..88c48dd12d 100644 --- a/src/overlays/actors/ovl_En_Bird/z_en_bird.c +++ b/src/overlays/actors/ovl_En_Bird/z_en_bird.c @@ -22,7 +22,7 @@ void func_809C1CAC(EnBird* this, s16 params); const ActorInit En_Bird_InitVars = { ACTOR_EN_BIRD, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BIRD, sizeof(EnBird), @@ -33,7 +33,7 @@ const ActorInit En_Bird_InitVars = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5600, ICHAIN_STOP), }; extern AnimationHeader D_0600006C; @@ -49,7 +49,7 @@ void EnBird_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.01); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002190, &D_0600006C, NULL, NULL, 0); - ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawFunc_Circle, 4); + ActorShape_Init(&this->actor.shape, 5500, ActorShadow_DrawCircle, 4); this->unk_194 = 0; this->unk_198 = 0; this->unk_1C0 = 0x9C4; @@ -80,7 +80,7 @@ void func_809C1CAC(EnBird* this, s16 params) { void func_809C1D60(EnBird* this, GlobalContext* globalCtx) { f32 fVar2 = sinf(this->unk_1B4); - this->actor.shape.unk_08 = this->actor.shape.unk_08 + fVar2 * this->unk_1A0; + this->actor.shape.yOffset = this->actor.shape.yOffset + fVar2 * this->unk_1A0; Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); if (this->unk_19C != 0) { @@ -102,18 +102,18 @@ void func_809C1E00(EnBird* this, s16 params) { void func_809C1E40(EnBird* this, GlobalContext* globalCtx) { f32 fVar4 = sinf(this->unk_1B4); - this->actor.shape.unk_08 += fVar4 * this->unk_1A0; + this->actor.shape.yOffset += fVar4 * this->unk_1A0; Math_SmoothStepToF(&this->actor.speedXZ, this->unk_1A8, 0.1f, this->unk_1AC, 0.0f); - if (this->unk_1B0 < Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) || this->unk_198 < 4) { - Math_StepToAngleS(&this->actor.posRot.rot.y, - Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos), this->unk_1C0); + if (this->unk_1B0 < Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) || this->unk_198 < 4) { + Math_StepToAngleS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos), + this->unk_1C0); } else { fVar4 = sinf(this->unk_1B4); - this->actor.posRot.rot.y += (s16)(fVar4 * this->unk_1A4); + this->actor.world.rot.y += (s16)(fVar4 * this->unk_1A4); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; SkelAnime_Update(&this->skelAnime); this->unk_198 -= 1; if (this->unk_198 < 0) { 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 4dcb2e36eb..0a3eee46ca 100644 --- a/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -22,7 +22,7 @@ void EnBlkobj_DoNothing(EnBlkobj* this, GlobalContext* globalCtx); const ActorInit En_Blkobj_InitVars = { ACTOR_EN_BLKOBJ, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BLKOBJ, sizeof(EnBlkobj), @@ -85,7 +85,7 @@ void EnBlkobj_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnBlkobj_Wait(EnBlkobj* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->dyna.actor.xzDistToLink < 120.0f) { + if (this->dyna.actor.xzDistToPlayer < 120.0f) { EnBlkobj_SetupAction(this, EnBlkobj_SpawnDarkLink); } player->stateFlags2 |= 0x04000000; @@ -93,8 +93,8 @@ void EnBlkobj_Wait(EnBlkobj* this, GlobalContext* globalCtx) { void EnBlkobj_SpawnDarkLink(EnBlkobj* this, GlobalContext* globalCtx) { if (!(this->dyna.actor.flags & 0x40)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_TORCH2, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.yawTowardsLink, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_TORCH2, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.yawTowardsPlayer, 0, 0); EnBlkobj_SetupAction(this, EnBlkobj_DarkLinkFight); } @@ -104,7 +104,7 @@ void EnBlkobj_DarkLinkFight(EnBlkobj* this, GlobalContext* globalCtx) { s32 alphaMod; if (this->timer == 0) { - if (Actor_Find(&globalCtx->actorCtx, ACTOR_EN_TORCH2, ACTORTYPE_BOSS) == NULL) { + if (Actor_Find(&globalCtx->actorCtx, ACTOR_EN_TORCH2, ACTORCAT_BOSS) == NULL) { Flags_SetClear(globalCtx, this->dyna.actor.room); this->timer++; } 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 9a92d42fff..84be5871fd 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -21,7 +21,7 @@ void EnBom_WaitForRelease(EnBom* this, GlobalContext* globalCtx); const ActorInit En_Bom_InitVars = { ACTOR_EN_BOM, - ACTORTYPE_EXPLOSIVES, + ACTORCAT_EXPLOSIVE, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBom), @@ -80,7 +80,7 @@ static ColliderJntSphInit sJntSphInit = { static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 0, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_STOP), }; @@ -95,10 +95,10 @@ void EnBom_Init(Actor* thisx, GlobalContext* globalCtx) { EnBom* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - ActorShape_Init(&thisx->shape, 700.0f, ActorShadow_DrawFunc_Circle, 16.0f); + ActorShape_Init(&thisx->shape, 700.0f, ActorShadow_DrawCircle, 16.0f); thisx->colChkInfo.mass = 200; - thisx->colChkInfo.unk_10 = 5; - thisx->colChkInfo.unk_12 = 0xA; + thisx->colChkInfo.cylRadius = 5; + thisx->colChkInfo.cylHeight = 10; this->timer = 70; this->flashSpeedScale = 7; Collider_InitCylinder(globalCtx, &this->bombCollider); @@ -136,9 +136,8 @@ void EnBom_Move(EnBom* this, GlobalContext* globalCtx) { // rebound bomb off the wall it hits if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { - if (ABS((s16)(this->actor.wallPolyRot - this->actor.posRot.rot.y)) > 0x4000) { - this->actor.posRot.rot.y = - ((this->actor.wallPolyRot - this->actor.posRot.rot.y) + this->actor.wallPolyRot) - 0x8000; + if (ABS((s16)(this->actor.wallYaw - this->actor.world.rot.y)) > 0x4000) { + this->actor.world.rot.y = ((this->actor.wallYaw - this->actor.world.rot.y) + this->actor.wallYaw) - 0x8000; } Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_BOUND); Actor_MoveForward(&this->actor); @@ -175,7 +174,7 @@ void EnBom_Explode(EnBom* this, GlobalContext* globalCtx) { if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) { this->actor.flags |= 0x20; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); } this->explosionCollider.elements[0].dim.worldSphere.radius += this->actor.shape.rot.z + 8; @@ -243,20 +242,20 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(thisx, 0.01f); } - if ((thisx->xzDistToLink >= 20.0f) || (ABS(thisx->yDistToLink) >= 80.0f)) { + if ((thisx->xzDistToPlayer >= 20.0f) || (ABS(thisx->yDistToPlayer) >= 80.0f)) { this->bumpOn = true; } this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 15.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 15.0f, 0x1F); if (thisx->params == BOMB_BODY) { if (this->timer < 63) { dustAccel.y = 0.2f; // spawn spark effect on even frames - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 17.0f; if ((globalCtx->gameplayFrames % 2) == 0) { EffectSsGSpk_SpawnFuse(globalCtx, thisx, &effPos, &effVelocity, &effAccel); @@ -268,20 +267,20 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002829C(globalCtx, &effPos, &effVelocity, &dustAccel, &dustColor, &dustColor, 50, 5); } - if ((this->bombCollider.base.acFlags & AC_HIT) || - ((this->bombCollider.base.ocFlags1 & OC1_HIT) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { + if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) && + (this->bombCollider.base.oc->category == ACTORCAT_ENEMY))) { this->timer = 0; thisx->shape.rot.z = 0; } else { // if a lit stick touches the bomb, set timer to 100 // these bombs never have a timer over 70, so this isnt used - if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) { + if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->world.pos, 30.0f, 50.0f)) { this->timer = 100; } } dustAccel.y = 0.2f; - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 10.0f; // double bomb flash speed and adjust red color at certain times during the countdown @@ -301,7 +300,7 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->timer == 0) { - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 10.0f; if (Actor_HasParent(thisx, globalCtx)) { @@ -311,8 +310,8 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { EffectSsBomb2_SpawnLayered(globalCtx, &effPos, &effVelocity, &bomb2Accel, 100, (thisx->shape.rot.z * 6) + 19); - effPos.y = thisx->groundY; - if (thisx->groundY > BGCHECK_Y_MIN) { + effPos.y = thisx->floorHeight; + if (thisx->floorHeight > BGCHECK_Y_MIN) { EffectSsBlast_SpawnWhiteShockwave(globalCtx, &effPos, &effVelocity, &effAccel); } @@ -328,7 +327,7 @@ void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(thisx, 20.0f); + Actor_SetFocus(thisx, 20.0f); if (thisx->params <= BOMB_BODY) { Collider_UpdateCylinder(thisx, &this->bombCollider); 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 6d4bfb7b61..b998343c06 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 @@ -42,7 +42,7 @@ extern AnimationHeader D_060072AC; const ActorInit En_Bom_Bowl_Man_InitVars = { ACTOR_EN_BOM_BOWL_MAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_BG, sizeof(EnBomBowlMan), @@ -61,15 +61,15 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; GlobalContext* globalCtx2 = globalCtx; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx2, &this->skelAnime, &D_06006EB0, &D_06000710, this->jointTable, this->morphTable, 11); // ☆ Man, my shoulders hurt~ ☆ osSyncPrintf(VT_FGCOL(GREEN) "☆ もー 肩こっちゃうよねぇ〜 \t\t ☆ \n" VT_RST); // ☆ Isn't there some sort of job that will pay better and be more relaxing? ☆ %d osSyncPrintf(VT_FGCOL(GREEN) "☆ もっとラクしてもうかるバイトないかしら? ☆ %d\n" VT_RST, globalCtx2->bombchuBowlingStatus); - this->posCopy = this->actor.posRot.pos; - this->actor.shape.unk_08 = -60.0f; + this->posCopy = this->actor.world.pos; + this->actor.shape.yOffset = -60.0f; Actor_SetScale(&this->actor, 0.013f); for (i = 0; i < 2; i++) { @@ -83,7 +83,7 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) { } this->prizeSelect = (s16)Rand_ZeroFloat(4.99f); - this->actor.unk_1F = 1; + this->actor.targetMode = 1; this->actionFunc = EnBomBowMan_SetupWaitAsleep; } @@ -106,9 +106,9 @@ void EnBomBowMan_WaitAsleep(EnBomBowlMan* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->actionFunc = EnBomBowMan_TalkAsleep; } else { - yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); + yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); - if (!(this->actor.xzDistToLink > 120.0f) && (yawDiff < 0x4300)) { + if (!(this->actor.xzDistToPlayer > 120.0f) && (yawDiff < 0x4300)) { func_8002F2CC(&this->actor, globalCtx, 120.0f); } } @@ -238,7 +238,7 @@ void EnBomBowMan_RunGame(EnBomBowlMan* this, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 中央HIT!!!! ☆☆☆☆☆ \n" VT_RST); } if ((globalCtx->bombchuBowlingStatus == -1) && - (globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].length == 0) && (this->bowlPit->status == 0) && + (globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length == 0) && (this->bowlPit->status == 0) && (this->wallStatus[0] != 1) && (this->wallStatus[1] != 1)) { this->gameResult = 2; // Lost // Bombchu lost @@ -269,8 +269,8 @@ void EnBomBowMan_RunGame(EnBomBowlMan* this, GlobalContext* globalCtx) { this->actionFunc = func_809C41FC; } } else { - yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); - if (!(this->actor.xzDistToLink > 120.0f) && (yawDiff < 0x4300)) { + yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); + if (!(this->actor.xzDistToPlayer > 120.0f) && (yawDiff < 0x4300)) { func_8002F2CC(&this->actor, globalCtx, 120.0f); } } @@ -454,8 +454,8 @@ void EnBomBowlMan_Update(Actor* thisx, GlobalContext* globalCtx) { EnBomBowlMan* this = THIS; this->timer++; - this->actor.posRot2.pos.y = 60.0f; - Actor_SetHeight(&this->actor, 60.0f); + this->actor.focus.pos.y = 60.0f; + Actor_SetFocus(&this->actor, 60.0f); switch (this->eyeMode) { case CHU_GIRL_EYES_ASLEEP: @@ -483,7 +483,7 @@ void EnBomBowlMan_Update(Actor* thisx, GlobalContext* globalCtx) { } } - func_80038290(globalCtx, &this->actor, &this->unk_218, &this->unk_224, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_218, &this->unk_224, this->actor.focus.pos); break; } 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 3a764a4dba..9ea4a5b993 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 @@ -24,7 +24,7 @@ static s32 sGetItemIds[] = { GI_BOMB_BAG_30, GI_HEART_PIECE, GI_BOMBCHUS_10, GI_ const ActorInit En_Bom_Bowl_Pit_InitVars = { ACTOR_EN_BOM_BOWL_PIT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBomBowlPit), @@ -55,7 +55,7 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, GlobalContext* globalCtx) { Vec3f chuPosDiff; if (globalCtx->cameraPtrs[0]->setting == 0x15) { - chu = (EnBomChu*)globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + chu = (EnBomChu*)globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (chu != NULL) { if ((&chu->actor == &this->actor) || (chu->actor.id != ACTOR_EN_BOM_CHU)) { @@ -63,9 +63,9 @@ void EnBomBowlPit_DetectHit(EnBomBowlPit* this, GlobalContext* globalCtx) { continue; } - chuPosDiff.x = chu->actor.posRot.pos.x - this->actor.posRot.pos.x; - chuPosDiff.y = chu->actor.posRot.pos.y - this->actor.posRot.pos.y; - chuPosDiff.z = chu->actor.posRot.pos.z - this->actor.posRot.pos.z; + chuPosDiff.x = chu->actor.world.pos.x - this->actor.world.pos.x; + chuPosDiff.y = chu->actor.world.pos.y - this->actor.world.pos.y; + chuPosDiff.z = chu->actor.world.pos.z - this->actor.world.pos.z; if (((fabsf(chuPosDiff.x) < 40.0f) || (BREG(2))) && ((fabsf(chuPosDiff.y) < 40.0f) || (BREG(2))) && ((fabsf(chuPosDiff.z) < 40.0f) || (BREG(2)))) { @@ -147,8 +147,8 @@ void EnBomBowlPit_CameraDollyIn(EnBomBowlPit* this, GlobalContext* globalCtx) { void EnBomBowlPit_SpawnPrize(EnBomBowlPit* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->exItem = (EnExItem*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_EX_ITEM, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z - 70.0f, 0, 0, 0, this->prizeIndex); + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z - 70.0f, 0, 0, 0, this->prizeIndex); if (this->exItem != NULL) { this->actionFunc = EnBomBowlPit_SetupGivePrize; } 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 6d1c781175..621ac46118 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 @@ -14,7 +14,7 @@ extern UNK_TYPE D_04007E10; /* const ActorInit En_Bom_Chu_InitVars = { ACTOR_EN_BOM_CHU, - ACTORTYPE_EXPLOSIVES, + ACTORCAT_EXPLOSIVE, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBomChu), 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 eea7b88ee0..1724346480 100644 --- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -24,7 +24,7 @@ void EnBombf_SetupGrowBomb(EnBombf* this, s16 params); const ActorInit En_Bombf_InitVars = { ACTOR_EN_BOMBF, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOMBF, sizeof(EnBombf), @@ -105,22 +105,22 @@ void EnBombf_Init(Actor* thisx, GlobalContext* globalCtx) { shapeUnk10 = 1000.0f; } - ActorShape_Init(&thisx->shape, shapeUnk10, ActorShadow_DrawFunc_Circle, 12.0f); - thisx->posRot2.pos = thisx->posRot.pos; + ActorShape_Init(&thisx->shape, shapeUnk10, ActorShadow_DrawCircle, 12.0f); + thisx->focus.pos = thisx->world.pos; - if (Actor_FindNearby(globalCtx, thisx, ACTOR_BG_DDAN_KD, ACTORTYPE_BG, 10000.0f) != NULL) { + if (Actor_FindNearby(globalCtx, thisx, ACTOR_BG_DDAN_KD, ACTORCAT_BG, 10000.0f) != NULL) { thisx->flags |= 0x20; } - thisx->colChkInfo.unk_10 = 10.0f; - thisx->colChkInfo.unk_12 = 10; - thisx->unk_1F = 0; + thisx->colChkInfo.cylRadius = 10.0f; + thisx->colChkInfo.cylHeight = 10; + thisx->targetMode = 0; if (thisx->params == BOMBFLOWER_BODY) { this->timer = 140; this->flashSpeedScale = 15; thisx->gravity = -1.5f; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_EXPLOSIVES); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_EXPLOSIVE); thisx->colChkInfo.mass = 200; thisx->flags &= ~1; EnBombf_SetupAction(this, EnBombf_Move); @@ -155,9 +155,8 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { if (this->flowerBombScale >= 1.0f) { if (Actor_HasParent(&this->actor, globalCtx)) { - bombFlower = - (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + bombFlower = (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bombFlower != NULL) { func_8002F5C4(&this->actor, &bombFlower->actor, globalCtx); this->timer = 180; @@ -174,10 +173,10 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { } else if (this->bombCollider.base.acFlags & AC_HIT) { this->bombCollider.base.acFlags &= ~AC_HIT; - if (this->bombCollider.base.ac->type != ACTORTYPE_BOSS) { + if (this->bombCollider.base.ac->category != ACTORCAT_BOSS) { bombFlower = - (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bombFlower != NULL) { bombFlower->unk_200 = 1; bombFlower->timer = 0; @@ -187,10 +186,10 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { } } } else { - if (Player_IsBurningStickInRange(globalCtx, &this->actor.posRot.pos, 30.0f, 50.0f)) { + if (Player_IsBurningStickInRange(globalCtx, &this->actor.world.pos, 30.0f, 50.0f)) { bombFlower = - (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + (EnBombf*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOMBF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bombFlower != NULL) { bombFlower->timer = 100; this->timer = 180; @@ -206,7 +205,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { player->interactRangeActor = NULL; this->actor.parent = NULL; player->stateFlags1 &= ~0x800; - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; } } } @@ -224,7 +223,7 @@ void EnBombf_GrowBomb(EnBombf* this, GlobalContext* globalCtx) { player->interactRangeActor = NULL; this->actor.parent = NULL; player->stateFlags1 &= ~0x800; - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; } } } @@ -269,7 +268,7 @@ void EnBombf_Explode(EnBombf* this, GlobalContext* globalCtx) { if (this->explosionCollider.elements[0].dim.modelSphere.radius == 0) { this->actor.flags |= 0x20; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); } this->explosionCollider.elements[0].dim.modelSphere.radius += 8; @@ -333,7 +332,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((!this->bumpOn) && (!Actor_HasParent(thisx, globalCtx)) && - ((thisx->xzDistToLink >= 20.0f) || (ABS(thisx->yDistToLink) >= 80.0f))) { + ((thisx->xzDistToPlayer >= 20.0f) || (ABS(thisx->yDistToPlayer) >= 80.0f))) { this->bumpOn = true; } @@ -345,7 +344,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { if (thisx->gravity != 0.0f) { DREG(6) = 1; - func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); DREG(6) = 0; } @@ -358,33 +357,33 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { // rebound bomb off the wall it hits if ((thisx->speedXZ != 0.0f) && (thisx->bgCheckFlags & 8)) { - if (ABS((s16)(thisx->wallPolyRot - thisx->posRot.rot.y)) > 0x4000) { + if (ABS((s16)(thisx->wallYaw - thisx->world.rot.y)) > 0x4000) { if (1) {} - thisx->posRot.rot.y = ((thisx->wallPolyRot - thisx->posRot.rot.y) + thisx->wallPolyRot) - 0x8000; + thisx->world.rot.y = ((thisx->wallYaw - thisx->world.rot.y) + thisx->wallYaw) - 0x8000; } Audio_PlayActorSound2(thisx, NA_SE_EV_BOMB_BOUND); Actor_MoveForward(thisx); DREG(6) = 1; - func_8002E4B4(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 5.0f, 10.0f, 0.0f, 0x1F); DREG(6) = 0; thisx->speedXZ *= 0.7f; thisx->bgCheckFlags &= ~8; } - if ((this->bombCollider.base.acFlags & AC_HIT) || - ((this->bombCollider.base.ocFlags1 & OC1_HIT) && (this->bombCollider.base.oc->type == ACTORTYPE_ENEMY))) { + if ((this->bombCollider.base.acFlags & AC_HIT) || ((this->bombCollider.base.ocFlags1 & OC1_HIT) && + (this->bombCollider.base.oc->category == ACTORCAT_ENEMY))) { this->unk_200 = 1; this->timer = 0; } else { // if a lit stick touches the bomb, set timer to 100 - if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->posRot.pos, 30.0f, 50.0f)) { + if ((this->timer > 100) && Player_IsBurningStickInRange(globalCtx, &thisx->world.pos, 30.0f, 50.0f)) { this->timer = 100; } } if (this->unk_200 != 0) { dustAccel.y = 0.2f; - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 25.0f; if (this->timer < 127) { // spawn spark effect on even frames @@ -413,7 +412,7 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->timer == 0) { - effPos = thisx->posRot.pos; + effPos = thisx->world.pos; effPos.y += 10.0f; @@ -423,8 +422,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { EffectSsBomb2_SpawnLayered(globalCtx, &effPos, &effVelocity, &bomb2Accel, 100, 19); - effPos.y = thisx->groundY; - if (thisx->groundY > BGCHECK_Y_MIN) { + effPos.y = thisx->floorHeight; + if (thisx->floorHeight > BGCHECK_Y_MIN) { EffectSsBlast_SpawnWhiteShockwave(globalCtx, &effPos, &effVelocity, &effAccel); } @@ -440,8 +439,8 @@ void EnBombf_Update(Actor* thisx, GlobalContext* globalCtx) { } } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 10.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 10.0f; if (thisx->params <= BOMBFLOWER_BODY) { 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 58bfb2edaa..5a28ab7e6d 100644 --- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c +++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c @@ -19,7 +19,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx); const ActorInit En_Boom_InitVars = { ACTOR_EN_BOOM, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnBoom), @@ -50,7 +50,7 @@ static ColliderQuadInit sQuadInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(unk_1F, 5, ICHAIN_CONTINUE), + ICHAIN_S8(targetMode, 5, ICHAIN_CONTINUE), ICHAIN_VEC3S(shape.rot, 0, ICHAIN_STOP), }; @@ -128,13 +128,13 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // If the boomerang is moving toward a targeted actor, handle setting the proper x and y angle to fly toward it. if (target != NULL) { - yawTarget = func_8002DAC0(&this->actor, &target->posRot2.pos); - yawDiff = this->actor.posRot.rot.y - yawTarget; + yawTarget = Actor_WorldYawTowardPoint(&this->actor, &target->focus.pos); + yawDiff = this->actor.world.rot.y - yawTarget; - pitchTarget = func_8002DB28(&this->actor, &target->posRot2.pos); - pitchDiff = this->actor.posRot.rot.x - pitchTarget; + pitchTarget = Actor_WorldPitchTowardPoint(&this->actor, &target->focus.pos); + pitchDiff = this->actor.world.rot.x - pitchTarget; - distXYZScale = (200.0f - Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &target->posRot2.pos)) * 0.005f; + distXYZScale = (200.0f - Math_Vec3f_DistXYZ(&this->actor.world.pos, &target->focus.pos)) * 0.005f; if (distXYZScale < 0.12f) { distXYZScale = 0.12f; } @@ -145,8 +145,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // the moveTo pointer is nulled and it flies off in a seemingly random direction. this->moveTo = NULL; } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale)); - Math_ScaledStepToS(&this->actor.posRot.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale)); + Math_ScaledStepToS(&this->actor.world.rot.y, yawTarget, (s16)(ABS(yawDiff) * distXYZScale)); + Math_ScaledStepToS(&this->actor.world.rot.x, pitchTarget, (s16)(ABS(pitchDiff) * distXYZScale)); } } @@ -170,14 +170,14 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // Decrement the return timer and check if its 0. If it is, check if Link can catch it and handle accordingly. // Otherwise handle grabbing and colliding. if (DECR(this->returnTimer) == 0) { - distFromLink = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &player->actor.posRot2.pos); + distFromLink = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.focus.pos); this->moveTo = player; // If the boomerang is less than 40 units away from Link, he can catch it. if (distFromLink < 40.0f) { target = this->grabbed; if (target != NULL) { - Math_Vec3f_Copy(&target->posRot.pos, &player->actor.posRot.pos); + Math_Vec3f_Copy(&target->world.pos, &player->actor.world.pos); // If the grabbed actor is EnItem00 (HP/Key etc) set gravity and flags so it falls in front of Link. // Otherwise if its a Skulltula Token, just set flags so he collides with it to collect it. @@ -197,9 +197,9 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { collided = (!!(collided)); if (collided) { // Copy the position from the prevous frame to the boomerang to start the bounce back. - Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.pos4); + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); } else { - collided = BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.pos4, &this->actor.posRot.pos, + collided = BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.prevPos, &this->actor.world.pos, &hitPoint, &this->actor.wallPoly, 1, 1, 1, 1, &hitDynaID); if (collided) { @@ -220,8 +220,8 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { // If the boomerang needs to bounce back, set x and y angle accordingly. // Set timer to 0 and set return actor to player so it goes back to Link. if (collided) { - this->actor.posRot.rot.x = -this->actor.posRot.rot.x; - this->actor.posRot.rot.y += 0x8000; + this->actor.world.rot.x = -this->actor.world.rot.x; + this->actor.world.rot.y += 0x8000; this->moveTo = player; this->returnTimer = 0; } @@ -234,7 +234,7 @@ void EnBoom_Fly(EnBoom* this, GlobalContext* globalCtx) { if (target->update == NULL) { this->grabbed = NULL; } else { - Math_Vec3f_Copy(&target->posRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&target->world.pos, &this->actor.world.pos); } } } @@ -245,7 +245,7 @@ void EnBoom_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->stateFlags1 & 0x20000000)) { this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); this->activeTimer = this->activeTimer + 1; } } @@ -259,9 +259,9 @@ void EnBoom_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_boom.c", 567); - Matrix_RotateY(this->actor.posRot.rot.y * 0.0000958738f, MTXMODE_APPLY); + Matrix_RotateY(this->actor.world.rot.y * 0.0000958738f, MTXMODE_APPLY); Matrix_RotateZ(0.7669904f, MTXMODE_APPLY); - Matrix_RotateX(this->actor.posRot.rot.x * 0.0000958738f, MTXMODE_APPLY); + Matrix_RotateX(this->actor.world.rot.x * 0.0000958738f, MTXMODE_APPLY); Matrix_MultVec3f(&sMultVec1, &vec1); Matrix_MultVec3f(&sMultVec2, &vec2); 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 d7c73d8183..8fea984f16 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -62,7 +62,7 @@ extern CollisionHeader D_06005FC8; const ActorInit En_Box_InitVars = { ACTOR_EN_BOX, - ACTORTYPE_CHEST, + ACTORCAT_CHEST, FLAGS, OBJECT_BOX, sizeof(EnBox), @@ -75,7 +75,7 @@ const ActorInit En_Box_InitVars = { static AnimationHeader* D_809CA800[4] = { &D_0600024C, &D_06000128, &D_0600043C, &D_0600043C }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 0, ICHAIN_STOP), + ICHAIN_U8(targetMode, 0, ICHAIN_STOP), }; static s32 sUnused; @@ -90,11 +90,11 @@ void EnBox_ClipToGround(EnBox* this, GlobalContext* globalCtx) { s32* bgId; Vec3f pos; - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; pos.y += 1.0f; newY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &poly, &bgId, &this->dyna.actor, &pos); if (newY != BGCHECK_Y_MIN) { - this->dyna.actor.posRot.pos.y = newY; + this->dyna.actor.world.pos.y = newY; } } @@ -122,7 +122,7 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->iceSmokeTimer = 0; this->unk_1FB = ENBOX_STATE_0; this->dyna.actor.gravity = -5.5f; - this->switchFlag = this->dyna.actor.posRot.rot.z; + this->switchFlag = this->dyna.actor.world.rot.z; this->dyna.actor.minVelocityY = -50.0f; if (globalCtx2) {} // helps the compiler store globalCtx2 into s1 @@ -149,7 +149,7 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { EnBox_SetupAction(this, EnBox_AppearOnRoomClear); func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 50.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; this->dyna.actor.flags |= 0x10; } else if (this->type == ENBOX_TYPE_9 || this->type == ENBOX_TYPE_10) { @@ -157,14 +157,14 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.flags |= 0x2000000; func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 50.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; this->dyna.actor.flags |= 0x10; } else if (this->type == ENBOX_TYPE_SWITCH_FLAG_BIG && !Flags_GetSwitch(globalCtx2, this->switchFlag)) { EnBox_SetupAction(this, EnBox_AppearOnSwitchFlag); func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 50.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; this->dyna.actor.flags |= 0x10; } else { @@ -176,8 +176,8 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->movementFlags |= ENBOX_MOVE_STICK_TO_GROUND; } - this->dyna.actor.posRot.rot.y += 0x8000; - this->dyna.actor.initPosRot.rot.z = this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z = 0; + this->dyna.actor.world.rot.y += 0x8000; + this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; SkelAnime_Init(globalCtx2, &this->skelanime, &D_060047D8, anim, this->jointTable, this->morphTable, 5); Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f); @@ -188,11 +188,11 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { case ENBOX_TYPE_ROOM_CLEAR_SMALL: case ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL: Actor_SetScale(&this->dyna.actor, 0.005f); - Actor_SetHeight(&this->dyna.actor, 20.0f); + Actor_SetFocus(&this->dyna.actor, 20.0f); break; default: Actor_SetScale(&this->dyna.actor, 0.01f); - Actor_SetHeight(&this->dyna.actor, 40.0f); + Actor_SetFocus(&this->dyna.actor, 40.0f); } } @@ -206,7 +206,7 @@ void EnBox_RandomDustKinematic(EnBox* this, Vec3f* pos, Vec3f* velocity, Vec3f* f32 randomRadius = Rand_ZeroOne() * 25.0f; s16 randomAngle = Rand_ZeroOne() * 0x10000; - *pos = this->dyna.actor.posRot.pos; + *pos = this->dyna.actor.world.pos; pos->x += Math_SinS(randomAngle) * randomRadius; pos->z += Math_CosS(randomAngle) * randomRadius; @@ -256,7 +256,7 @@ void EnBox_Fall(EnBox* this, GlobalContext* globalCtx) { } if (this->dyna.actor.velocity.y < 5.5f) { this->dyna.actor.shape.rot.z = 0; - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; EnBox_SetupAction(this, EnBox_WaitOpen); func_800803F0(globalCtx, this->unk_1AC); } @@ -264,7 +264,7 @@ void EnBox_Fall(EnBox* this, GlobalContext* globalCtx) { &D_801333E8); EnBox_SpawnDust(this, globalCtx); } - yDiff = this->dyna.actor.posRot.pos.y - this->dyna.actor.groundY; + yDiff = this->dyna.actor.world.pos.y - this->dyna.actor.floorHeight; if (this->movementFlags & ENBOX_MOVE_FALL_ANGLE_SIDE) { this->dyna.actor.shape.rot.z = yDiff * 50.0f; } else { @@ -299,7 +299,7 @@ void func_809C9700(EnBox* this, GlobalContext* globalCtx) { func_8002F5F0(&this->dyna.actor, globalCtx); } - if (Math3D_Vec3fDistSq(&this->dyna.actor.posRot.pos, &player->actor.posRot.pos) > 22500.0f) { + if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &player->actor.world.pos) > 22500.0f) { this->unk_1FB = ENBOX_STATE_0; } else { if (this->unk_1FB == ENBOX_STATE_0) { @@ -353,7 +353,7 @@ void EnBox_AppearOnRoomClear(EnBox* this, GlobalContext* globalCtx) { Flags_SetClear(globalCtx, this->dyna.actor.room); EnBox_SetupAction(this, EnBox_AppearInit); func_80080480(globalCtx, &this->dyna.actor); - if (func_80080728(globalCtx, this->dyna.actor.type)) { + if (func_80080728(globalCtx, this->dyna.actor.category)) { this->unk_1A8 = 0; } else { this->unk_1A8 = -30; @@ -365,11 +365,11 @@ void EnBox_AppearOnRoomClear(EnBox* this, GlobalContext* globalCtx) { * The chest is ready to appear, possibly waiting for camera/cutscene-related stuff to happen */ void EnBox_AppearInit(EnBox* this, GlobalContext* globalCtx) { - if (func_8005B198() == this->dyna.actor.type || this->unk_1A8 != 0) { + if (func_8005B198() == this->dyna.actor.category || this->unk_1A8 != 0) { EnBox_SetupAction(this, EnBox_AppearAnimation); this->unk_1A8 = 0; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->dyna.actor.initPosRot.pos.x, - this->dyna.actor.initPosRot.pos.y, this->dyna.actor.initPosRot.pos.z, 0, 0, 0, 0x0011); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->dyna.actor.home.pos.x, + this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, 0, 0, 0x0011); Audio_PlaySoundGeneral(NA_SE_EV_TRE_BOX_APPEAR, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -382,11 +382,11 @@ void EnBox_AppearAnimation(EnBox* this, GlobalContext* globalCtx) { this->unk_1A8++; } else if (this->unk_1A8 < 40) { this->unk_1A8++; - this->dyna.actor.posRot.pos.y += 1.25f; + this->dyna.actor.world.pos.y += 1.25f; } else if (this->unk_1A8 < 60) { this->alpha += 12; this->unk_1A8++; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { EnBox_SetupAction(this, EnBox_WaitOpen); } @@ -420,8 +420,8 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) { break; default: Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_DEMO_TRE_LGT, - this->dyna.actor.posRot.pos.x, this->dyna.actor.posRot.pos.y, - this->dyna.actor.posRot.pos.z, this->dyna.actor.shape.rot.x, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, + this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, 0xFFFF); func_800F5C64(0x92B); } @@ -430,7 +430,7 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) { Flags_SetTreasure(globalCtx, this->dyna.actor.params & 0x1F); } else { player = PLAYER; - func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && func_8002DFC8(&this->dyna.actor, 0x3000, globalCtx)) { func_8002F554(&this->dyna.actor, globalCtx, 0 - (this->dyna.actor.params >> 5 & 0x7F)); @@ -497,22 +497,22 @@ void EnBox_SpawnIceSmoke(EnBox* this, GlobalContext* globalCtx) { func_8002F974(&this->dyna.actor, NA_SE_EN_MIMICK_BREATH - SFX_FLAG); if (Rand_ZeroOne() < 0.3f) { f0 = 2.0f * Rand_ZeroOne() - 1.0f; - pos = this->dyna.actor.posRot.pos; + pos = this->dyna.actor.world.pos; if (this->type == ENBOX_TYPE_SMALL || this->type == ENBOX_TYPE_6 || this->type == ENBOX_TYPE_ROOM_CLEAR_SMALL || this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL) { - pos.x += f0 * 10.0f * Math_SinS(this->dyna.actor.posRot.rot.y + 0x4000); - pos.z += f0 * 10.0f * Math_CosS(this->dyna.actor.posRot.rot.y + 0x4000); + pos.x += f0 * 10.0f * Math_SinS(this->dyna.actor.world.rot.y + 0x4000); + pos.z += f0 * 10.0f * Math_CosS(this->dyna.actor.world.rot.y + 0x4000); f0 = 2.0f * Rand_ZeroOne() - 1.0f; - vel.x = f0 * 0.8f * Math_SinS(this->dyna.actor.posRot.rot.y); + vel.x = f0 * 0.8f * Math_SinS(this->dyna.actor.world.rot.y); vel.y = 1.8f; - vel.z = f0 * 0.8f * Math_CosS(this->dyna.actor.posRot.rot.y); + vel.z = f0 * 0.8f * Math_CosS(this->dyna.actor.world.rot.y); } else { - pos.x += f0 * 20.0f * Math_SinS(this->dyna.actor.posRot.rot.y + 0x4000); - pos.z += f0 * 20.0f * Math_CosS(this->dyna.actor.posRot.rot.y + 0x4000); + pos.x += f0 * 20.0f * Math_SinS(this->dyna.actor.world.rot.y + 0x4000); + pos.z += f0 * 20.0f * Math_CosS(this->dyna.actor.world.rot.y + 0x4000); f0 = 2.0f * Rand_ZeroOne() - 1.0f; - vel.x = f0 * 1.6f * Math_SinS(this->dyna.actor.posRot.rot.y); + vel.x = f0 * 1.6f * Math_SinS(this->dyna.actor.world.rot.y); vel.y = 1.8f; - vel.z = f0 * 1.6f * Math_CosS(this->dyna.actor.posRot.rot.y); + vel.z = f0 * 1.6f * Math_CosS(this->dyna.actor.world.rot.y); } EffectSsIceSmoke_Spawn(globalCtx, &pos, &vel, &accel, 150); } @@ -530,7 +530,7 @@ void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(this->movementFlags & ENBOX_MOVE_IMMOBILE)) { Actor_MoveForward(&this->dyna.actor); - func_8002E4B4(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x1C); } switch (this->type) { @@ -538,10 +538,10 @@ void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) { case ENBOX_TYPE_6: case ENBOX_TYPE_ROOM_CLEAR_SMALL: case ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL: - Actor_SetHeight(&this->dyna.actor, 20.0f); + Actor_SetFocus(&this->dyna.actor, 20.0f); break; default: - Actor_SetHeight(&this->dyna.actor, 40.0f); + Actor_SetFocus(&this->dyna.actor, 40.0f); } if ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C && this->actionFunc == EnBox_Open && 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 b7d5e80bea..7797c32216 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -25,7 +25,7 @@ extern UNK_TYPE D_06001A70; /* const ActorInit En_Brob_InitVars = { ACTOR_EN_BROB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BROB, sizeof(EnBrob), 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 d205542177..72e2eaefa2 100644 --- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -17,7 +17,7 @@ extern Gfx D_06001000[]; const ActorInit En_Bubble_InitVars = { ACTOR_EN_BUBBLE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BUBBLE, sizeof(EnBubble), @@ -83,7 +83,7 @@ void EnBubble_SetDimensions(EnBubble* this, f32 dim) { this->actor.flags |= 1; Actor_SetScale(&this->actor, 1.0f); - this->actor.shape.unk_08 = 16.0f; + this->actor.shape.yOffset = 16.0f; this->graphicRotSpeed = 16.0f; this->graphicEccentricity = 0.08f; this->expansionWidth = dim; @@ -120,7 +120,7 @@ void EnBubble_DamagePlayer(EnBubble* this, GlobalContext* globalCtx) { s32 damage = -this->colliderSphere.elements[0].info.toucher.damage; globalCtx->damagePlayer(globalCtx, damage); - func_8002F7A0(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F7A0(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); } s32 EnBubble_Explosion(EnBubble* this, GlobalContext* globalCtx) { @@ -134,14 +134,14 @@ s32 EnBubble_Explosion(EnBubble* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->expansionHeight, 4.0f, 0.1f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->graphicRotSpeed, 54.0f, 0.1f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->graphicEccentricity, 0.2f, 0.1f, 1000.0f, 0.0f); - this->actor.shape.unk_08 = ((this->expansionHeight + 1.0f) * 16.0f); + this->actor.shape.yOffset = ((this->expansionHeight + 1.0f) * 16.0f); if (DECR(this->explosionCountdown) != 0) { return -1; } - effectPos.x = this->actor.posRot.pos.x; - effectPos.y = this->actor.posRot.pos.y + this->actor.shape.unk_08; - effectPos.z = this->actor.posRot.pos.z; + effectPos.x = this->actor.world.pos.x; + effectPos.y = this->actor.world.pos.y + this->actor.shape.yOffset; + effectPos.z = this->actor.world.pos.z; for (i = 0; i < 20; i++) { effectVel.x = (Rand_ZeroOne() - 0.5f) * 7.0f; effectVel.y = Rand_ZeroOne() * 7.0f; @@ -149,7 +149,7 @@ s32 EnBubble_Explosion(EnBubble* this, GlobalContext* globalCtx) { EffectSsDtBubble_SpawnCustomColor(globalCtx, &effectPos, &effectVel, &effectAccel, &sEffectPrimColor, &sEffectEnvColor, Rand_S16Offset(100, 50), 0x19, 0); } - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, 0x50); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0x50); this->actor.flags &= ~0x1; return Rand_S16Offset(90, 60); } @@ -229,9 +229,9 @@ void EnBubble_Fly(EnBubble* this, GlobalContext* globalCtx) { sp54.z = this->velocityFromBounce.z + this->velocityFromBump.z; EnBubble_Vec3fNormalize(&sp54); - sp78.x = this->actor.posRot.pos.x; - sp78.y = this->actor.posRot.pos.y + this->actor.shape.unk_08; - sp78.z = this->actor.posRot.pos.z; + sp78.x = this->actor.world.pos.x; + sp78.y = this->actor.world.pos.y + this->actor.shape.yOffset; + sp78.z = this->actor.world.pos.z; sp6C = sp78; sp6C.x += (sp54.x * 24.0f); @@ -337,7 +337,7 @@ void EnBubble_Init(Actor* thisx, GlobalContext* globalCtx) { EnBubble* this = THIS; u32 pad; - ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawFunc_Circle, 0.2f); + ActorShape_Init(&this->actor.shape, 16.0f, ActorShadow_DrawCircle, 0.2f); Collider_InitJntSph(globalCtx, &this->colliderSphere); Collider_SetJntSph(globalCtx, &this->colliderSphere, &this->actor, &sJntSphInit, this->colliderSphereItems); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(9), &sColChkInfoInit2); @@ -365,7 +365,7 @@ void EnBubble_Wait(EnBubble* this, GlobalContext* globalCtx) { this->actionFunc = EnBubble_Pop; } else { EnBubble_Fly(this, globalCtx); - this->actor.shape.unk_08 = ((this->expansionHeight + 1.0f) * 16.0f); + this->actor.shape.yOffset = ((this->expansionHeight + 1.0f) * 16.0f); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSphere.base); } @@ -373,7 +373,7 @@ void EnBubble_Wait(EnBubble* this, GlobalContext* globalCtx) { void EnBubble_Pop(EnBubble* this, GlobalContext* globalCtx) { if (EnBubble_Explosion(this, globalCtx) >= 0) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 60, NA_SE_EN_AWA_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); Actor_Kill(&this->actor); } } @@ -384,7 +384,7 @@ void EnBubble_Disappear(EnBubble* this, GlobalContext* globalCtx) { temp_v0 = func_809CBFD4(this); if (temp_v0 >= 0) { - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->explosionCountdown = temp_v0; this->actionFunc = EnBubble_Regrow; } @@ -403,9 +403,9 @@ void EnBubble_Update(Actor* thisx, GlobalContext* globalCtx) { EnBubble* this = THIS; func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 16.0f, 16.0f, 0.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 16.0f, 16.0f, 0.0f, 7); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->actor.shape.unk_08); + Actor_SetFocus(&this->actor, this->actor.shape.yOffset); } void EnBubble_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -433,7 +433,7 @@ void EnBubble_Draw(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_bubble.c", 1226); if (this->actionFunc != EnBubble_Disappear) { - this->actor.shape.unk_10 = (f32)((this->expansionWidth + 1.0f) * 0.2f); + this->actor.shape.shadowScale = (f32)((this->expansionWidth + 1.0f) * 0.2f); func_809CC774(this); } } 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 4143acc8e7..cd24764a7c 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -50,7 +50,7 @@ static ColliderJntSphInit sColliderInit = { const ActorInit En_Butte_InitVars = { ACTOR_EN_BUTTE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(EnButte), @@ -128,8 +128,8 @@ void EnButte_DrawTransformationEffect(EnButte* this, GlobalContext* globalCtx) { Matrix_RotateX(camDir.x * (M_PI / 0x8000), MTXMODE_APPLY); Matrix_RotateZ(camDir.z * (M_PI / 0x8000), MTXMODE_APPLY); Matrix_MultVec3f(&D_809CE3C4, &sp5C); - func_800D1694(this->actor.posRot2.pos.x + sp5C.x, this->actor.posRot2.pos.y + sp5C.y, - this->actor.posRot2.pos.z + sp5C.z, &camDir); + func_800D1694(this->actor.focus.pos.x + sp5C.x, this->actor.focus.pos.y + sp5C.y, this->actor.focus.pos.z + sp5C.z, + &camDir); Matrix_Scale(sTransformationEffectScale, sTransformationEffectScale, sTransformationEffectScale, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_choo.c", 317), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -186,22 +186,22 @@ void func_809CD56C(EnButte* this) { static f32 D_809CE3E0[] = { 50.0f, 80.0f, 100.0f }; static f32 D_809CE3EC[] = { 30.0f, 40.0f, 50.0f }; - this->actor.shape.unk_08 += Math_SinS(this->unk_25C) * D_809CE3E0[this->flightParamsIdx] + - Math_SinS(this->unk_25E) * D_809CE3EC[this->flightParamsIdx]; - this->actor.shape.unk_08 = CLAMP(this->actor.shape.unk_08, -2000.0f, 2000.0f); + this->actor.shape.yOffset += Math_SinS(this->unk_25C) * D_809CE3E0[this->flightParamsIdx] + + Math_SinS(this->unk_25E) * D_809CE3EC[this->flightParamsIdx]; + this->actor.shape.yOffset = CLAMP(this->actor.shape.yOffset, -2000.0f, 2000.0f); } void func_809CD634(EnButte* this) { static f32 D_809CE3F8[] = { 15.0f, 20.0f, 25.0f }; static f32 D_809CE404[] = { 7.5f, 10.0f, 12.5f }; - this->actor.shape.unk_08 += Math_SinS(this->unk_25C) * D_809CE3F8[this->flightParamsIdx] + - Math_SinS(this->unk_25E) * D_809CE404[this->flightParamsIdx]; - this->actor.shape.unk_08 = CLAMP(this->actor.shape.unk_08, -500.0f, 500.0f); + this->actor.shape.yOffset += Math_SinS(this->unk_25C) * D_809CE3F8[this->flightParamsIdx] + + Math_SinS(this->unk_25E) * D_809CE404[this->flightParamsIdx]; + this->actor.shape.yOffset = CLAMP(this->actor.shape.yOffset, -500.0f, 500.0f); } void EnButte_Turn(EnButte* this) { - s16 target = this->actor.posRot.rot.y + 0x8000; + s16 target = this->actor.world.rot.y + 0x8000; s16 diff = target - this->actor.shape.rot.y; Math_ScaledStepToS(&this->actor.shape.rot.y, target, ABS(diff) >> 3); @@ -223,8 +223,8 @@ void EnButte_FlyAround(EnButte* this, GlobalContext* globalCtx) { f32 animSpeed; s16 rotStep; - distSqFromHome = Math3D_Dist2DSq(this->actor.posRot.pos.x, this->actor.posRot.pos.z, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.z); + distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, + this->actor.home.pos.z); func_809CD56C(this); Math_SmoothStepToF(&this->actor.speedXZ, flightParams->speedXZTarget, flightParams->speedXZScale, flightParams->speedXZStep, 0.0f); @@ -238,25 +238,25 @@ void EnButte_FlyAround(EnButte* this, GlobalContext* globalCtx) { } minAnimSpeed = 0.0f; - this->posYTarget = this->actor.initPosRot.pos.y; + this->posYTarget = this->actor.home.pos.y; if ((this->flightParamsIdx != 0) && ((distSqFromHome > maxDistSqFromHome) || (this->timer < 4))) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, flightParams->rotYStep) == 0) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, flightParams->rotYStep) == 0) { minAnimSpeed = 0.5f; } } else if ((this->unk_257 == 0) && (this->actor.child != NULL) && (this->actor.child != &this->actor)) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.child->posRot.pos); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, rotStep) == 0) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.child->world.pos); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { minAnimSpeed = 0.3f; } } else if (this->unk_257 == 1) { - yaw = this->actor.yawTowardsLink + 0x8000 + (s16)((Rand_ZeroOne() - 0.5f) * 0x6000); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, rotStep) == 0) { + yaw = this->actor.yawTowardsPlayer + 0x8000 + (s16)((Rand_ZeroOne() - 0.5f) * 0x6000); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, rotStep) == 0) { minAnimSpeed = 0.4f; } } else { - this->actor.posRot.rot.y += (s16)(sinf(this->unk_25C) * 100.0f); + this->actor.world.rot.y += (s16)(sinf(this->unk_25C) * 100.0f); } EnButte_Turn(this); @@ -271,12 +271,12 @@ void EnButte_FlyAround(EnButte* this, GlobalContext* globalCtx) { } if (((this->actor.params & 1) == 1) && (player->heldItemActionParam == 6) && (this->swordDownTimer <= 0) && - ((Math3D_Dist2DSq(player->actor.posRot.pos.x, player->actor.posRot.pos.z, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.z) < SQ(120.0f)) || - (this->actor.xzDistToLink < 60.0f))) { + ((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, + this->actor.home.pos.z) < SQ(120.0f)) || + (this->actor.xzDistToPlayer < 60.0f))) { EnButte_SetupFollowLink(this); this->unk_257 = 2; - } else if (this->actor.xzDistToLink < 120.0) { + } else if (this->actor.xzDistToPlayer < 120.0) { this->unk_257 = 1; } else { this->unk_257 = 0; @@ -309,17 +309,17 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) { swordTip.y = player->swordInfo[0].tip.y; swordTip.z = player->swordInfo[0].tip.z + Math_CosS(player->actor.shape.rot.y) * 10.0f; - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &swordTip) + (s16)(Rand_ZeroOne() * D_809CE410); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000) != 0) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &swordTip) + (s16)(Rand_ZeroOne() * D_809CE410); + if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000) != 0) { if (globalCtx->gameplayFrames % 2) { - this->actor.posRot.rot.y += (s16)(sinf(this->unk_25C) * 60.0f); + this->actor.world.rot.y += (s16)(sinf(this->unk_25C) * 60.0f); } } else { minAnimSpeed = 0.3f; } } - this->posYTarget = MAX(player->actor.posRot.pos.y + 30.0f, player->swordInfo[0].tip.y); + this->posYTarget = MAX(player->actor.world.pos.y + 30.0f, player->swordInfo[0].tip.y); EnButte_Turn(this); @@ -333,14 +333,14 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) { D_809CE410 = -D_809CE410; } - distSqFromHome = Math3D_Dist2DSq(this->actor.posRot.pos.x, this->actor.posRot.pos.z, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.z); + distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, + this->actor.home.pos.z); if (!((player->heldItemActionParam == 6) && (fabsf(player->actor.speedXZ) < 1.8f) && (this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) { EnButte_SetupFlyAround(this); } else if (distSqFromHome > SQ(240.0f)) { distSqFromSword = Math3D_Dist2DSq(player->swordInfo[0].tip.x, player->swordInfo[0].tip.z, - this->actor.posRot.pos.x, this->actor.posRot.pos.z); + this->actor.world.pos.x, this->actor.world.pos.z); if (distSqFromSword < SQ(60.0f)) { EnButte_SetupTransformIntoFairy(this); } @@ -360,10 +360,10 @@ void EnButte_TransformIntoFairy(EnButte* this, GlobalContext* globalCtx) { EnButte_UpdateTransformationEffect(); if (this->timer == 5) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 60, NA_SE_EV_BUTTERFRY_TO_FAIRY); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 60, NA_SE_EV_BUTTERFRY_TO_FAIRY); } else if (this->timer == 4) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot2.pos.x, this->actor.posRot2.pos.y, - this->actor.posRot2.pos.z, 0, this->actor.shape.rot.y, 0, FAIRY_HEAL_TIMED); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.focus.pos.x, this->actor.focus.pos.y, + this->actor.focus.pos.z, 0, this->actor.shape.rot.y, 0, FAIRY_HEAL_TIMED); this->drawSkelAnime = false; } else if (this->timer <= 0) { EnButte_SetupWaitToDie(this); @@ -411,11 +411,11 @@ void EnButte_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.update != NULL) { Actor_MoveForward(&this->actor); - Math_StepToF(&this->actor.posRot.pos.y, this->posYTarget, 0.6f); - if (this->actor.xyzDistToLinkSq < 5000.0f) { + Math_StepToF(&this->actor.world.pos.y, this->posYTarget, 0.6f); + if (this->actor.xyzDistToPlayerSq < 5000.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, this->actor.shape.unk_08 * this->actor.scale.y); + Actor_SetFocus(&this->actor, this->actor.shape.yOffset * this->actor.scale.y); } } 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 1769502172..9fa372255f 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -41,7 +41,7 @@ extern AnimationHeader D_06002250; const ActorInit En_Bw_InitVars = { ACTOR_EN_BW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BW, sizeof(EnBw), @@ -139,11 +139,11 @@ void EnBw_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.naviEnemyId = 0x23; this->actor.gravity = -2.0f; SkelAnime_Init(globalCtx, &this->skelAnime, &D_060020F0, &D_06000228, this->jointTable, this->morphTable, 12); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 40.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = 6; this->actor.colChkInfo.mass = MASS_HEAVY; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; func_809CE9A8(this); this->color1.a = this->color1.r = 255; this->color1.g = this->color1.b = 0; @@ -153,7 +153,7 @@ void EnBw_Init(Actor* thisx, GlobalContext* globalCtx) { //! this->collider2 should have Init called on it, but it doesn't matter since the heap is zeroed before use. Collider_SetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); Collider_SetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); - this->unk_236 = this->actor.posRot.rot.y; + this->unk_236 = this->actor.world.rot.y; this->actor.params = sSlugGroup; sSlugGroup = (sSlugGroup + 1) & 3; } @@ -173,7 +173,7 @@ void func_809CE884(EnBw* this, GlobalContext* globalCtx) { this->actor.scale.y = 0.013f - Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f; this->actor.scale.z = 0.013f + Math_SinF(this->unk_222 * 0.001f) * 0.0069999998f; if (this->unk_222 == 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; func_809CE9A8(this); } } @@ -227,14 +227,14 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->color1.g = sp60; } if ((((globalCtx->gameplayFrames % 4) == this->actor.params) && (this->actor.speedXZ != 0.0f) && - (sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.posRot.pos, &this->unk_264, &sp68, &sp74, 1, 0, - 0, 1))) || + (sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.world.pos, &this->unk_264, &sp68, &sp74, 1, 0, 0, + 1))) || (this->unk_222 == 0)) { if (sp74 != NULL) { sp74 = SEGMENTED_TO_VIRTUAL(sp74); sp62 = Math_FAtan2F(sp74->normal.x, sp74->normal.z) * ((f32)0x8000 / M_PI); } else { - sp62 = this->actor.posRot.rot.y + 0x8000; + sp62 = this->actor.world.rot.y + 0x8000; } if ((this->unk_236 != sp62) || (sp64 == 0)) { if (BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->unk_270, &this->unk_288, &sp68, &sp74, 1, 0, 0, 1)) { @@ -254,7 +254,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->unk_238 = -0x4000; } } else { - if ((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y) >= 0.0f) { + if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0.0f) { this->unk_238 = 0x4000; } else { this->unk_238 = -0x4000; @@ -284,9 +284,9 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->unk_222 = (Rand_ZeroOne() * 200.0f) + 200.0f; } } else if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { - if (this->unk_236 != this->actor.wallPolyRot) { + if (this->unk_236 != this->actor.wallYaw) { sp64 = 1; - this->unk_236 = this->actor.wallPolyRot; + this->unk_236 = this->actor.wallYaw; if (this->unk_221 == 3) { if (globalCtx->gameplayFrames & 0x20) { this->unk_238 = 0x4000; @@ -296,7 +296,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { this->actor.bgCheckFlags &= ~8; this->unk_222 = (Rand_ZeroOne() * 20.0f) + 160.0f; } else { - if ((s16)(this->actor.yawTowardsLink - this->unk_236) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - this->unk_236) >= 0) { this->unk_238 = 0x4000; } else { this->unk_238 = -0x4000; @@ -306,13 +306,13 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { } } } else if (this->unk_221 == 0) { - sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.posRot.pos, &player->actor.posRot.pos, &sp68, + sp64 = BgCheck_AnyLineTest2(&globalCtx->colCtx, &this->actor.world.pos, &player->actor.world.pos, &sp68, &sp74, 1, 0, 0, 1); if (sp64 != 0) { sp74 = SEGMENTED_TO_VIRTUAL(sp74); sp60 = Math_FAtan2F(sp74->normal.x, sp74->normal.z) * ((f32)0x8000 / M_PI); if (this->unk_236 != sp60) { - if ((s16)(this->actor.yawTowardsLink - sp60) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - sp60) >= 0) { this->unk_238 = 0x4000; } else { this->unk_238 = -0x4000; @@ -336,29 +336,29 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { switch (this->unk_221) { case 3: Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f); - if ((this->unk_224 == 0) && (this->actor.xzDistToLink < 200.0f) && (ABS(this->actor.yDistToLink) < 50.0f) && - func_8002E084(&this->actor, 0x1C70)) { + if ((this->unk_224 == 0) && (this->actor.xzDistToPlayer < 200.0f) && + (ABS(this->actor.yDistToPlayer) < 50.0f) && func_8002E084(&this->actor, 0x1C70)) { func_809CF72C(this); } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_236 + this->unk_238, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, this->actor.speedXZ * 1000.0f, 0); } break; case 0: Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f); if (sp64 == 0) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, this->actor.speedXZ * 1000.0f, 0); - if ((this->actor.xzDistToLink < 90.0f) && (this->actor.yDistToLink < 50.0f) && + if ((this->actor.xzDistToPlayer < 90.0f) && (this->actor.yDistToPlayer < 50.0f) && func_8002E084(&this->actor, 0x1554) && - func_800339B8(&this->actor, globalCtx, 71.24802f, this->actor.yawTowardsLink)) { + func_800339B8(&this->actor, globalCtx, 71.24802f, this->actor.yawTowardsPlayer)) { func_809CF8F0(this); } } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_236 + this->unk_238, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, this->actor.speedXZ * 1000.0f, 0); } - if ((this->unk_224 == 0) || (ABS(this->actor.yDistToLink) > 60.0f) || (player2->stateFlags1 & 0x6000)) { + if ((this->unk_224 == 0) || (ABS(this->actor.yDistToPlayer) > 60.0f) || (player2->stateFlags1 & 0x6000)) { this->unk_221 = 3; this->unk_224 = 150; this->unk_250 = 0.0f; @@ -369,10 +369,10 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { if (func_8002E084(&this->actor, 0x1C70)) { this->unk_238 = -this->unk_238; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink - 0x8000, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x8000, 1, this->actor.speedXZ * 1000.0f, 0); } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_236 + this->unk_238, 1, + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_236 + this->unk_238, 1, this->actor.speedXZ * 1000.0f, 0); } if (this->unk_224 <= 200) { @@ -389,7 +389,7 @@ void func_809CEA24(EnBw* this, GlobalContext* globalCtx) { } break; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_809CF72C(EnBw* this) { @@ -427,7 +427,7 @@ void func_809CF7AC(EnBw* this, GlobalContext* globalCtx) { void func_809CF8F0(EnBw* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06002250, -1.0f); this->actor.speedXZ = 7.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_220 = 4; this->unk_222 = 1000; this->actor.velocity.y = 11.0f; @@ -448,19 +448,19 @@ void func_809CF984(EnBw* this, GlobalContext* globalCtx) { if (this->collider1.base.atFlags & AT_HIT) { this->collider1.base.atFlags &= ~AT_HIT; this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if ((&player->actor == this->collider1.base.at) && !(this->collider1.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } } SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 3) { - floorPolyType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + floorPolyType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((floorPolyType == 2) || (floorPolyType == 3) || (floorPolyType == 9)) { Actor_Kill(&this->actor); return; } - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); this->unk_222 = 3000; this->actor.flags &= ~0x01000000; this->actor.speedXZ = 0.0f; @@ -494,7 +494,7 @@ void func_809CFC4C(EnBw* this, GlobalContext* globalCtx) { this->unk_258 += this->unk_25C; Math_SmoothStepToF(&this->unk_260, 0.075f, 1.0f, 0.005f, 0.0f); if (this->actor.bgCheckFlags & 2) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } if (this->unk_224 != 0) { @@ -521,8 +521,8 @@ void func_809CFC4C(EnBw* this, GlobalContext* globalCtx) { } else { this->color1.b += 40; } - if (this->actor.shape.unk_08 < 1000.0f) { - this->actor.shape.unk_08 += 200.0f; + if (this->actor.shape.yOffset < 1000.0f) { + this->actor.shape.yOffset += 200.0f; } } } @@ -544,7 +544,7 @@ void func_809CFF98(EnBw* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->unk_248, 0.6f, 1.0f, 0.05f, 0.0f); SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 3) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); this->unk_222 = 0xBB8; this->unk_250 = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); @@ -565,8 +565,8 @@ void func_809CFF98(EnBw* this, GlobalContext* globalCtx) { } else { this->color1.b -= 40; } - if (this->actor.shape.unk_08 > 0.0f) { - this->actor.shape.unk_08 -= 200.0f; + if (this->actor.shape.yOffset > 0.0f) { + this->actor.shape.yOffset -= 200.0f; } } @@ -585,7 +585,7 @@ void func_809D014C(EnBw* this, GlobalContext* globalCtx) { this->actor.scale.y -= 0.0002f; this->actor.scale.z += 0.0002f; } - this->actor.shape.unk_14 = this->color1.a -= 6; + this->actor.shape.shadowAlpha = this->color1.a -= 6; this->unk_222--; if (this->unk_222 <= 0) { Actor_Kill(&this->actor); @@ -600,7 +600,7 @@ void func_809D01CC(EnBw* this) { if (this->damageEffect == 0xE) { this->iceTimer = 0x50; } - this->unk_222 = (this->actor.dmgEffectParams & 0x4000) ? 25 : 80; + this->unk_222 = (this->actor.colorFilterParams & 0x4000) ? 25 : 80; EnBw_SetupAction(this, func_809D0268); } @@ -617,7 +617,7 @@ void func_809D0268(EnBw* this, GlobalContext* globalCtx) { if (this->color1.b > 230) { this->color1.b = 230; } - if (this->actor.dmgEffectParams & 0x4000) { + if (this->actor.colorFilterParams & 0x4000) { if ((globalCtx->gameplayFrames % 0x80) == 0) { this->unk_25C = 0.5f + Rand_ZeroOne() * 0.25f; } @@ -641,13 +641,13 @@ void func_809D03CC(EnBw* this) { if (this->damageEffect == 0xE) { this->iceTimer = 32; } - this->unk_23C = this->actor.dmgEffectTimer; + this->unk_23C = this->actor.colorFilterTimer; Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); EnBw_SetupAction(this, func_809D0424); } void func_809D0424(EnBw* this, GlobalContext* globalCtx) { - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->unk_23C = 0; if (this->actor.colChkInfo.health != 0) { if ((this->unk_220 != 5) && (this->unk_220 != 6)) { @@ -667,11 +667,11 @@ void func_809D0424(EnBw* this, GlobalContext* globalCtx) { if (func_800355E4(globalCtx, &this->collider2.base)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); } else { this->unk_230 = 1; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); func_809D00F4(this); } } @@ -681,7 +681,7 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0x10) && (this->actor.bgCheckFlags & 1)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); func_809D00F4(this); } else { if (this->collider2.base.acFlags & AC_HIT) { @@ -709,11 +709,11 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { if (func_800355E4(globalCtx, &this->collider2.base)) { this->unk_230 = 0; this->actor.scale.y -= 0.009f; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 30.0f, 0xB, 4.0f, 0, 0, 0); } else { this->unk_230 = 1; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); func_809D00F4(this); } } else if ((this->unk_220 != 1) && (this->unk_220 != 6)) { @@ -725,7 +725,7 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { this->unk_248 = 0.0f; } } - if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xzDistToLink <= 400.0f) && + if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xzDistToPlayer <= 400.0f) && (this->actor.bgCheckFlags & 1)) { if (this->unk_220 == 5) { this->unk_23C = 0; @@ -762,7 +762,7 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) { velocity.z = Rand_CenteredFloat(this->unk_248 * 24.0f); accel.x = velocity.x * -0.075f; accel.z = velocity.z * -0.075f; - func_8002836C(globalCtx, &thisx->posRot.pos, &velocity, &accel, &sp50, &sp4C, 0x3C, 0, 0x14); + func_8002836C(globalCtx, &thisx->world.pos, &velocity, &accel, &sp50, &sp4C, 0x3C, 0, 0x14); } if (this->unk_248 <= 0.4f) { this->collider1.info.toucher.effect = 0; @@ -781,31 +781,31 @@ void EnBw_Update(Actor* thisx, GlobalContext* globalCtx2) { } else { sp44.a = 0; } - func_8002836C(globalCtx, &thisx->posRot.pos, &velocity, &accel, &sp48, &sp44, 0xB4, 0x28, + func_8002836C(globalCtx, &thisx->world.pos, &velocity, &accel, &sp48, &sp44, 0xB4, 0x28, 20.0f - (this->unk_248 * 40.0f)); } } else { this->collider1.info.toucher.effect = 1; } - this->unk_234 = func_800339B8(thisx, globalCtx, 50.0f, thisx->posRot.rot.y); + this->unk_234 = func_800339B8(thisx, globalCtx, 50.0f, thisx->world.rot.y); if ((this->unk_220 == 4) || (this->unk_220 == 6) || (this->unk_220 == 5) || (this->unk_220 == 1) || (this->unk_234 != 0)) { Actor_MoveForward(thisx); } - func_8002E4B4(globalCtx, thisx, 20.0f, 30.0f, 21.0f, 0x1F); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 20.0f, 30.0f, 21.0f, 0x1F); } Collider_UpdateCylinder(thisx, &this->collider2); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); - if ((this->unk_220 != 0) && ((thisx->dmgEffectTimer == 0) || !(thisx->dmgEffectParams & 0x4000))) { + if ((this->unk_220 != 0) && ((thisx->colorFilterTimer == 0) || !(thisx->colorFilterParams & 0x4000))) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); } if ((this->unk_221 != 1) && (this->unk_220 < 5) && (this->unk_248 > 0.4f)) { Collider_UpdateCylinder(thisx, &this->collider1); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 5.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 5.0f; } s32 EnBw_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, @@ -876,8 +876,8 @@ void EnBw_Draw(Actor* thisx, GlobalContext* globalCtx2) { Matrix_MultVec3f(&spAC, &this->unk_27C); } - Matrix_Translate(thisx->posRot.pos.x, thisx->posRot.pos.y + ((thisx->scale.y - 0.013f) * 1000.0f), - thisx->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(thisx->world.pos.x, thisx->world.pos.y + ((thisx->scale.y - 0.013f) * 1000.0f), thisx->world.pos.z, + MTXMODE_NEW); func_80093D84(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0); @@ -892,14 +892,14 @@ void EnBw_Draw(Actor* thisx, GlobalContext* globalCtx2) { gSPDisplayList(POLY_XLU_DISP++, D_0404D4E0); if (this->iceTimer != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->iceTimer--; if ((this->iceTimer & 3) == 0) { iceIndex = this->iceTimer >> 2; - icePos.x = sIceOffsets[iceIndex].x + thisx->posRot.pos.x; - icePos.y = sIceOffsets[iceIndex].y + thisx->posRot.pos.y; - icePos.z = sIceOffsets[iceIndex].z + thisx->posRot.pos.z; + icePos.x = sIceOffsets[iceIndex].x + thisx->world.pos.x; + icePos.y = sIceOffsets[iceIndex].y + thisx->world.pos.y; + icePos.z = sIceOffsets[iceIndex].z + thisx->world.pos.z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, thisx, &icePos, 0x96, 0x96, 0x96, 0xFA, 0xEB, 0xF5, 0xFF, 1.3f); } } 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 0055cb0a93..34195dc182 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -19,7 +19,7 @@ extern Gfx D_060022F0[]; const ActorInit En_Bx_InitVars = { ACTOR_EN_BX, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_BXA, sizeof(EnBx), @@ -74,7 +74,7 @@ void EnBx_Init(Actor* thisx, GlobalContext* globalCtx) { Vec3f sp48 = { 0.015f, 0.015f, 0.015f }; Vec3f sp3C = { 0.0f, 0.0f, 0.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 5300, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), }; s32 i; s32 pad; @@ -83,17 +83,17 @@ void EnBx_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.x = thisx->scale.z = 0.01f; thisx->scale.y = 0.03f; - thisx->posRot.pos.y = thisx->posRot.pos.y - 100.0f; + thisx->world.pos.y = thisx->world.pos.y - 100.0f; for (i = 0; i < 4; i++) { this->unk_184[i] = sp48; if (i == 0) { this->unk_1B4[i].x = thisx->shape.rot.x - 0x4000; } - this->unk_154[i] = thisx->posRot.pos; - this->unk_154[i].y = thisx->posRot.pos.y + ((i + 1) * 140.0f); + this->unk_154[i] = thisx->world.pos; + this->unk_154[i].y = thisx->world.pos.y + ((i + 1) * 140.0f); } - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 48.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 48.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Collider_InitQuad(globalCtx, &this->colliderQuad); @@ -137,14 +137,14 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { s16 tmp32; s32 tmp33; - if ((thisx->xzDistToLink <= 70.0f) || (this->collider.base.atFlags & AT_HIT) || + if ((thisx->xzDistToPlayer <= 70.0f) || (this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || (this->colliderQuad.base.atFlags & AT_HIT)) { - if ((thisx->xzDistToLink <= 70.0f) || (&player->actor == this->collider.base.at) || + if ((thisx->xzDistToPlayer <= 70.0f) || (&player->actor == this->collider.base.at) || (&player->actor == this->collider.base.ac) || (&player->actor == this->colliderQuad.base.at)) { tmp33 = player->invincibilityTimer & 0xFF; - tmp32 = thisx->posRot.rot.y; + tmp32 = thisx->world.rot.y; if (!(thisx->params & 0x80)) { - tmp32 = thisx->yawTowardsLink; + tmp32 = thisx->yawTowardsPlayer; } if ((&player->actor != this->collider.base.at) && (&player->actor != this->collider.base.ac) && (&player->actor != this->colliderQuad.base.at) && (player->invincibilityTimer <= 0)) { @@ -179,16 +179,16 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) { yaw = (s32)Rand_CenteredFloat(12288.0f); yaw = (yaw + (i * 0x4000)) + 0x2000; - pos.x = Rand_CenteredFloat(5.0f) + thisx->posRot.pos.x; - pos.y = Rand_CenteredFloat(30.0f) + thisx->posRot.pos.y + 170.0f; - pos.z = Rand_CenteredFloat(5.0f) + thisx->posRot.pos.z; + pos.x = Rand_CenteredFloat(5.0f) + thisx->world.pos.x; + pos.y = Rand_CenteredFloat(30.0f) + thisx->world.pos.y + 170.0f; + pos.z = Rand_CenteredFloat(5.0f) + thisx->world.pos.z; EffectSsLightning_Spawn(globalCtx, &pos, &primColor, &envColor, 230, yaw, 6, 0); } } Audio_PlayActorSound2(thisx, NA_SE_EN_BIRI_SPARK - SFX_FLAG); } - thisx->posRot2.pos = thisx->posRot.pos; + thisx->focus.pos = thisx->world.pos; Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 50ee77b353..a9c19dfe9b 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -28,7 +28,7 @@ void EnChanger_SetHeartPieceFlag(EnChanger* this, GlobalContext* globalCtx); const ActorInit En_Changer_InitVars = { ACTOR_EN_CHANGER, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnChanger), @@ -239,9 +239,9 @@ void EnChanger_OpenChests(EnChanger* this, GlobalContext* globalCtx) { switch (temp_s0_2) { case CHEST_LEFT: - xPos = right->dyna.actor.posRot.pos.x; - yPos = right->dyna.actor.posRot.pos.y; - zPos = right->dyna.actor.posRot.pos.z; + xPos = right->dyna.actor.world.pos.x; + yPos = right->dyna.actor.world.pos.y; + zPos = right->dyna.actor.world.pos.z; if (this->rightChestGetItemId == GI_DOOR_KEY) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); @@ -255,9 +255,9 @@ void EnChanger_OpenChests(EnChanger* this, GlobalContext* globalCtx) { } break; case CHEST_RIGHT: - xPos = left->dyna.actor.posRot.pos.x; - yPos = left->dyna.actor.posRot.pos.y; - zPos = left->dyna.actor.posRot.pos.z; + xPos = left->dyna.actor.world.pos.x; + yPos = left->dyna.actor.world.pos.y; + zPos = left->dyna.actor.world.pos.z; if (this->leftChestGetItemId == GI_DOOR_KEY) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EX_ITEM, xPos, yPos, zPos, 0, 0, 0, 0xF); @@ -295,8 +295,8 @@ void EnChanger_Update(Actor* thisx, GlobalContext* globalCtx) { } if (BREG(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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } 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 490316eaaa..abb22e80bc 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 @@ -12,7 +12,7 @@ void EnClearTag_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Clear_Tag_InitVars = { ACTOR_EN_CLEAR_TAG, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnClearTag), 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 bf47b4e77f..3b86d59a9e 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -28,7 +28,7 @@ void func_809DFA84(EnCow* this, GlobalContext* globalCtx); const ActorInit En_Cow_InitVars = { ACTOR_EN_COW, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_COW, sizeof(EnCow), @@ -85,17 +85,17 @@ void func_809DEE9C(EnCow* this) { vec.x = 0.0f; vec.z = 30.0f; func_809DEE00(&vec, this->actor.shape.rot.y); - this->colliders[0].dim.pos.x = this->actor.posRot.pos.x + vec.x; - this->colliders[0].dim.pos.y = this->actor.posRot.pos.y; - this->colliders[0].dim.pos.z = this->actor.posRot.pos.z + vec.z; + this->colliders[0].dim.pos.x = this->actor.world.pos.x + vec.x; + this->colliders[0].dim.pos.y = this->actor.world.pos.y; + this->colliders[0].dim.pos.z = this->actor.world.pos.z + vec.z; vec.x = 0.0f; vec.y = 0.0f; vec.z = -20.0f; func_809DEE00(&vec, this->actor.shape.rot.y); - this->colliders[1].dim.pos.x = this->actor.posRot.pos.x + vec.x; - this->colliders[1].dim.pos.y = this->actor.posRot.pos.y; - this->colliders[1].dim.pos.z = this->actor.posRot.pos.z + vec.z; + this->colliders[1].dim.pos.x = this->actor.world.pos.x + vec.x; + this->colliders[1].dim.pos.y = this->actor.world.pos.y; + this->colliders[1].dim.pos.z = this->actor.world.pos.z + vec.z; } void func_809DEF94(EnCow* this) { @@ -104,16 +104,16 @@ void func_809DEF94(EnCow* this) { VEC_SET(vec, 0.0f, 57.0f, -36.0f); func_809DEE00(&vec, this->actor.shape.rot.y); - this->actor.posRot.pos.x += vec.x; - this->actor.posRot.pos.y += vec.y; - this->actor.posRot.pos.z += vec.z; + this->actor.world.pos.x += vec.x; + this->actor.world.pos.y += vec.y; + this->actor.world.pos.z += vec.z; } void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { EnCow* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 72.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 72.0f); switch (this->actor.params) { case 0: SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004010, NULL, this->jointTable, this->morphTable, 6); @@ -134,11 +134,11 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { return; } } - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_COW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, 1); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_COW, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 1); this->unk_278 = Rand_ZeroFloat(1000.0f) + 40.0f; this->unk_27A = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; DREG(53) = 0; break; case 1: @@ -175,7 +175,7 @@ void func_809DF494(EnCow* this, GlobalContext* globalCtx) { Animation_GetLastFrame(&D_060001CC), ANIMMODE_ONCE, 1.0f); } - if ((this->actor.xzDistToLink < 150.0f) && (!(this->unk_276 & 2))) { + if ((this->actor.xzDistToPlayer < 150.0f) && (!(this->unk_276 & 2))) { this->unk_276 |= 2; if (this->skelAnime.animation == &D_060001CC) { this->unk_278 = 0; @@ -264,8 +264,8 @@ void func_809DF96C(EnCow* this, GlobalContext* globalCtx) { this->unk_276 &= ~0x4; DREG(53) = 0; } else { - if ((this->actor.xzDistToLink < 150.0f) && - (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) < 0x61A8)) { + if ((this->actor.xzDistToPlayer < 150.0f) && + (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x61A8)) { DREG(53) = 0; this->actionFunc = func_809DF8FC; this->actor.flags |= 0x10000; @@ -291,8 +291,8 @@ void func_809DFA84(EnCow* this, GlobalContext* globalCtx) { Animation_GetLastFrame(&D_06004348), ANIMMODE_ONCE, 1.0f); } - if ((this->actor.xzDistToLink < 150.0f) && - (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->unk_276 & 2))) { + if ((this->actor.xzDistToPlayer < 150.0f) && + (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) >= 0x61A9) && (!(this->unk_276 & 2))) { this->unk_276 |= 2; if (this->skelAnime.animation == &D_06004348) { this->unk_278 = 0; @@ -311,7 +311,7 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx) {} // necessary to match CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[1].base); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime) != 0) { if (this->skelAnime.animation == &D_060001CC) { Audio_PlayActorSound2(thisx, NA_SE_EV_COW_CRY); @@ -323,10 +323,10 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx) { } } this->actionFunc(this, globalCtx); - if ((thisx->xzDistToLink < 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 ((thisx->xzDistToPlayer < 150.0f) && + (ABS(Math_Vec3f_Yaw(&thisx->world.pos, &player->actor.world.pos)) < 0xC000)) { + targetX = Math_Vec3f_Pitch(&thisx->focus.pos, &player->actor.focus.pos); + targetY = Math_Vec3f_Yaw(&thisx->focus.pos, &player->actor.focus.pos) - thisx->shape.rot.y; if (targetX > 0x1000) { targetX = 0x1000; @@ -381,7 +381,7 @@ void EnCow_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve EnCow* this = THIS; if (limbIndex == 2) { - Matrix_MultVec3f(&D_809E010C, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_809E010C, &this->actor.focus.pos); } } 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 896855a202..edfc5a8ee0 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -24,7 +24,7 @@ static Vec3f sZeroVecAccel = { 0.0f, 0.0f, 0.0f }; const ActorInit En_Crow_InitVars = { ACTOR_EN_CROW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_CROW, sizeof(EnCrow), @@ -104,7 +104,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 3000, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 88, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), }; static Vec3f sHeadVec = { 2500.0f, 0.0f, 0.0f }; @@ -118,7 +118,7 @@ void EnCrow_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); this->collider.elements[0].dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius; CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f); sDeathCount = 0; EnCrow_SetupWait(this); } @@ -148,22 +148,22 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { f32 scale; Vec3f iceParticlePos; - this->actor.speedXZ *= Math_CosS(this->actor.posRot.rot.x); + this->actor.speedXZ *= Math_CosS(this->actor.world.rot.x); this->actor.velocity.y = 0.0f; Animation_Change(&this->skelAnime, &D_060000F0, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -3.0f); scale = this->actor.scale.x * 100.0f; - this->actor.posRot.pos.y += 20.0f * scale; + this->actor.world.pos.y += 20.0f * scale; this->actor.bgCheckFlags &= ~1; - this->actor.shape.unk_08 = 0.0f; - this->actor.unk_4C = 0.0f; + this->actor.shape.yOffset = 0.0f; + this->actor.targetArrowOffset = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_DEAD); if (this->actor.colChkInfo.damageEffect == 3) { func_8003426C(&this->actor, 0, 255, 0, 40); for (i = 0; i < 8; i++) { - iceParticlePos.x = ((i & 1 ? 7.0f : -7.0f) * scale) + this->actor.posRot.pos.x; - iceParticlePos.y = ((i & 2 ? 7.0f : -7.0f) * scale) + this->actor.posRot.pos.y; - iceParticlePos.z = ((i & 4 ? 7.0f : -7.0f) * scale) + this->actor.posRot.pos.z; + iceParticlePos.x = ((i & 1 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.x; + iceParticlePos.y = ((i & 2 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.y; + iceParticlePos.z = ((i & 4 ? 7.0f : -7.0f) * scale) + this->actor.world.pos.z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &iceParticlePos, 150, 150, 150, 250, 235, 245, 255, ((Rand_ZeroOne() * 0.15f) + 0.85f) * scale); } @@ -171,7 +171,7 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 255, 0, 40); for (i = 0; i < 4; i++) { - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 50.0f * scale, 0, 0, i); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 50.0f * scale, 0, 0, i); } } else { func_8003426C(&this->actor, 0x4000, 255, 0, 40); @@ -188,7 +188,7 @@ void func_809E03B4(EnCrow* this, GlobalContext* globalCtx) { } void EnCrow_SetupDie(EnCrow* this) { - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; this->actionFunc = EnCrow_Die; } @@ -196,7 +196,7 @@ void func_809E06E8(EnCrow* this) { this->timer = 100; this->actor.speedXZ = 3.5f; this->aimRotX = -0x1000; - this->aimRotY = this->actor.yawTowardsLink + 0x8000; + this->aimRotY = this->actor.yawTowardsPlayer + 0x8000; this->skelAnime.playSpeed = 2.0f; func_8003426C(&this->actor, 0, 255, 0, 5); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); @@ -215,12 +215,12 @@ void func_809E0770(EnCrow* this) { } Animation_PlayLoop(&this->skelAnime, &D_060000F0); - Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->timer = 300; - this->actor.shape.unk_08 = 2000; - this->actor.unk_4C = 2000.0f; + this->actor.shape.yOffset = 2000; + this->actor.targetArrowOffset = 2000.0f; this->actor.draw = NULL; this->actionFunc = func_809E10A8; } @@ -235,14 +235,14 @@ void EnCrow_Wait(EnCrow* this, GlobalContext* globalCtx) { this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 3.0f; if (this->actor.bgCheckFlags & 8) { - this->aimRotY = this->actor.wallPolyRot; - } else if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) > 300.0f) { - this->aimRotY = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); + this->aimRotY = this->actor.wallYaw; + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { + this->aimRotY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } if ((Math_SmoothStepToS(&this->actor.shape.rot.y, this->aimRotY, 5, 0x300, 0x10) == 0) && skelanimeUpdated && (Rand_ZeroOne() < 0.1f)) { - var = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos) - this->actor.shape.rot.y; + var = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y; if (var > 0) { this->aimRotY += 0x1000 + (0x1000 * Rand_ZeroOne()); } else { @@ -253,15 +253,15 @@ void EnCrow_Wait(EnCrow* this, GlobalContext* globalCtx) { if (this->actor.yDistToWater > -40.0f) { this->aimRotX = -0x1000; - } else if (this->actor.posRot.pos.y < (this->actor.initPosRot.pos.y - 50.0f)) { + } else if (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f)) { this->aimRotX = -0x800 - (Rand_ZeroOne() * 0x800); - } else if (this->actor.posRot.pos.y > (this->actor.initPosRot.pos.y + 50.0f)) { + } else if (this->actor.world.pos.y > (this->actor.home.pos.y + 50.0f)) { this->aimRotX = 0x800 + (Rand_ZeroOne() * 0x800); } if ((Math_SmoothStepToS(&this->actor.shape.rot.x, this->aimRotX, 10, 0x100, 8) == 0) && (skelanimeUpdated) && (Rand_ZeroOne() < 0.1f)) { - if (this->actor.initPosRot.pos.y < this->actor.posRot.pos.y) { + if (this->actor.home.pos.y < this->actor.world.pos.y) { this->aimRotX -= (0x400 * Rand_ZeroOne()) + 0x400; } else { this->aimRotX += (0x400 * Rand_ZeroOne()) + 0x400; @@ -276,7 +276,7 @@ void EnCrow_Wait(EnCrow* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; } - if ((this->timer == 0) && (this->actor.xzDistToLink < 300.0f) && !(player->stateFlags1 & 0x00800000) && + if ((this->timer == 0) && (this->actor.xzDistToPlayer < 300.0f) && !(player->stateFlags1 & 0x00800000) && (this->actor.yDistToWater < -40.0f) && (Player_GetMask(globalCtx) != PLAYER_MASK_SKULL)) { func_809E0384(this); } @@ -296,10 +296,10 @@ void func_809E0C8C(EnCrow* this, GlobalContext* globalCtx) { yaw = func_8002E084(&this->actor, 0x2800); if (yaw != 0) { - pos.x = player->actor.posRot.pos.x; - pos.y = player->actor.posRot.pos.y + 20.0f; - pos.z = player->actor.posRot.pos.z; - target = func_8002DB28(&this->actor, &pos); + pos.x = player->actor.world.pos.x; + pos.y = player->actor.world.pos.y + 20.0f; + pos.z = player->actor.world.pos.z; + target = Actor_WorldPitchTowardPoint(&this->actor, &pos); if (target > 0x3000) { target = 0x3000; } @@ -308,8 +308,8 @@ void func_809E0C8C(EnCrow* this, GlobalContext* globalCtx) { Math_ApproachS(&this->actor.shape.rot.x, -0x1000, 2, 0x100); } - if ((yaw != 0) || (this->actor.xzDistToLink > 80.0f)) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 4, 0xC00); + if ((yaw != 0) || (this->actor.xzDistToPlayer > 80.0f)) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00); } if ((this->timer == 0) || (Player_GetMask(globalCtx) == PLAYER_MASK_SKULL) || @@ -326,15 +326,15 @@ void func_809E0C8C(EnCrow* this, GlobalContext* globalCtx) { void func_809E0E2C(EnCrow* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); - this->actor.dmgEffectTimer = 40; + this->actor.colorFilterTimer = 40; if (!(this->actor.flags & 0x8000)) { - if (this->actor.dmgEffectParams & 0x4000) { + if (this->actor.colorFilterParams & 0x4000) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200); this->actor.shape.rot.z += 0x1780; } - if ((this->actor.bgCheckFlags & 1) || (this->actor.groundY == BGCHECK_Y_MIN)) { - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot, &sZeroVecAccel, &sZeroVecAccel, + if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world, &sZeroVecAccel, &sZeroVecAccel, this->actor.scale.x * 10000.0f, 0, 255, 255, 255, 255, 255, 0, 0, 1, 9, 1); EnCrow_SetupDie(this); } @@ -353,9 +353,9 @@ void EnCrow_Die(EnCrow* this, GlobalContext* globalCtx) { if (Math_StepToF(&this->actor.scale.x, 0.0f, step)) { if (this->actor.params == 0) { sDeathCount++; - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, ITEM00_RUPEE_RED); + Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_RUPEE_RED); } func_809E0770(this); } @@ -367,9 +367,9 @@ void func_809E1004(EnCrow* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->actor.bgCheckFlags & 8) { - this->aimRotY = this->actor.wallPolyRot; + this->aimRotY = this->actor.wallYaw; } else { - this->aimRotY = this->actor.yawTowardsLink + 0x8000; + this->aimRotY = this->actor.yawTowardsPlayer + 0x8000; } Math_ApproachS(&this->actor.shape.rot.y, this->aimRotY, 3, 0xC00); @@ -434,8 +434,8 @@ void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx) { func_809E1174(this, globalCtx); this->actionFunc(this, globalCtx); scale = this->actor.scale.x * 100.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->actor.posRot.rot.x = -this->actor.shape.rot.x; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.x = -this->actor.shape.rot.x; if (this->actionFunc != func_809E10A8) { if (this->actor.colChkInfo.health != 0) { @@ -445,14 +445,14 @@ void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx) { height = 0.0f; Actor_MoveForward(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 12.0f * scale, 25.0f * scale, 50.0f * scale, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 12.0f * scale, 25.0f * scale, 50.0f * scale, 7); } else { height = 0.0f; } - this->collider.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + height; - this->collider.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y + height; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; if (this->actionFunc == func_809E0C8C) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -466,7 +466,7 @@ void EnCrow_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, height); + Actor_SetFocus(&this->actor, height); if (this->actor.colChkInfo.health != 0 && Animation_OnFrame(&this->skelAnime, 3.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_KAICHO_FLUTTER); 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 15d2f40e74..e735c71b3b 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_0602AF70; /* const ActorInit En_Cs_InitVars = { ACTOR_EN_CS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_CS, sizeof(EnCs), 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 625136448a..1acb68dd08 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -61,7 +61,7 @@ extern FlexSkeletonHeader D_06007958; const ActorInit En_Daiku_InitVars = { ACTOR_EN_DAIKU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DAIKU, sizeof(EnDaiku), @@ -180,7 +180,7 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) { this->startFightSwitchFlag = this->actor.shape.rot.z & 0x3F; this->actor.shape.rot.z = 0; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 40.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007958, NULL, this->jointTable, this->morphTable, 17); if (!noKill) { @@ -195,13 +195,13 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, sAnimations[0].anim, 1.0f, 0.0f, Animation_GetLastFrame(sAnimations[0].anim), sAnimations[0].mode, sAnimations[0].transitionRate); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->currentAnimIndex = -1; this->runSpeed = 5.0f; - this->initRot = this->actor.posRot.rot; - this->initPos = this->actor.posRot.pos; + this->initRot = this->actor.world.rot; + this->initPos = this->actor.world.pos; if (globalCtx->sceneNum == SCENE_GERUDOWAY) { EnDaiku_Change(this, ENDAIKU_ANIM_STAND, &this->currentAnimIndex); @@ -383,7 +383,7 @@ void EnDaiku_Jailed(EnDaiku* this, GlobalContext* globalCtx) { } SkelAnime_Update(&this->skelAnime); - gerudo = (EnGeldB*)Actor_Find(&globalCtx->actorCtx, ACTOR_EN_GELDB, ACTORTYPE_ENEMY); + gerudo = (EnGeldB*)Actor_Find(&globalCtx->actorCtx, ACTOR_EN_GELDB, ACTORCAT_ENEMY); if (gerudo == NULL) { this->stateFlags |= ENDAIKU_STATEFLAG_GERUDODEFEATED; this->stateFlags &= ~ENDAIKU_STATEFLAG_GERUDOFIGHTING; @@ -433,8 +433,8 @@ void EnDaiku_InitEscape(EnDaiku* this, GlobalContext* globalCtx) { path = &globalCtx->setupPathList[this->actor.params >> 4 & 0xF]; while (!exitLoop) { pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; - dx = pointPos->x - this->actor.posRot.pos.x; - dz = pointPos->z - this->actor.posRot.pos.z; + dx = pointPos->x - this->actor.world.pos.x; + dz = pointPos->z - this->actor.world.pos.z; this->rotYtowardsPath = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); dxz = sqrtf(SQ(dx) + SQ(dz)); if (dxz > 10.0f) { @@ -472,19 +472,19 @@ void EnDaiku_InitSubCamera(EnDaiku* this, GlobalContext* globalCtx) { eyePosDeltaLocal.x = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.x; eyePosDeltaLocal.y = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.y; eyePosDeltaLocal.z = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.z; - Matrix_RotateY(this->actor.posRot.rot.y * (M_PI / 0x8000), MTXMODE_NEW); + Matrix_RotateY(this->actor.world.rot.y * (M_PI / 0x8000), MTXMODE_NEW); Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld); - this->subCamEyeInit.x = this->subCamEye.x = this->actor.posRot.pos.x + eyePosDeltaWorld.x; - this->subCamEyeInit.y = this->subCamEye.y = this->actor.posRot.pos.y + eyePosDeltaWorld.y; + this->subCamEyeInit.x = this->subCamEye.x = this->actor.world.pos.x + eyePosDeltaWorld.x; + this->subCamEyeInit.y = this->subCamEye.y = this->actor.world.pos.y + eyePosDeltaWorld.y; if (1) {} - this->subCamEyeInit.z = this->subCamEye.z = this->actor.posRot.pos.z + eyePosDeltaWorld.z; + this->subCamEyeInit.z = this->subCamEye.z = this->actor.world.pos.z + eyePosDeltaWorld.z; if (1) {} - this->subCamAtTarget.x = this->subCamAt.x = this->actor.posRot.pos.x; - this->subCamAtTarget.y = this->subCamAt.y = this->actor.posRot.pos.y + 60.0f; + this->subCamAtTarget.x = this->subCamAt.x = this->actor.world.pos.x; + this->subCamAtTarget.y = this->subCamAt.y = this->actor.world.pos.y + 60.0f; if (1) {} - this->subCamAtTarget.z = this->subCamAt.z = this->actor.posRot.pos.z; + this->subCamAtTarget.z = this->subCamAt.z = this->actor.world.pos.z; this->subCamId = Gameplay_CreateSubCamera(globalCtx); Gameplay_ChangeCameraStatus(globalCtx, 0, 1); @@ -498,9 +498,9 @@ void EnDaiku_InitSubCamera(EnDaiku* this, GlobalContext* globalCtx) { void EnDaiku_UpdateSubCamera(EnDaiku* this, GlobalContext* globalCtx) { s32 pad; - this->subCamAtTarget.x = this->actor.posRot.pos.x; - this->subCamAtTarget.y = this->actor.posRot.pos.y + 60.0f; - this->subCamAtTarget.z = this->actor.posRot.pos.z; + this->subCamAtTarget.x = this->actor.world.pos.x; + this->subCamAtTarget.y = this->actor.world.pos.y + 60.0f; + this->subCamAtTarget.z = this->actor.world.pos.z; Math_SmoothStepToF(&this->subCamAt.x, this->subCamAtTarget.x, 1.0f, 1000.0f, 0.0f); Math_SmoothStepToF(&this->subCamAt.y, this->subCamAtTarget.y, 1.0f, 1000.0f, 0.0f); @@ -548,8 +548,8 @@ void EnDaiku_EscapeRun(EnDaiku* this, GlobalContext* globalCtx) { path = &globalCtx->setupPathList[this->actor.params >> 4 & 0xF]; pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; - dx = pointPos->x - this->actor.posRot.pos.x; - dz = pointPos->z - this->actor.posRot.pos.z; + dx = pointPos->x - this->actor.world.pos.x; + dz = pointPos->z - this->actor.world.pos.z; ry = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); dxz = sqrtf(SQ(dx) + SQ(dz)); if (dxz <= 20.88f) { @@ -564,10 +564,10 @@ void EnDaiku_EscapeRun(EnDaiku* this, GlobalContext* globalCtx) { } Math_SmoothStepToS(&this->actor.shape.rot.y, ry, 1, 0xFA0, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; Math_SmoothStepToF(&this->actor.speedXZ, this->runSpeed, 0.6f, dxz, 0.0f); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->subCamActive) { EnDaiku_UpdateSubCamera(this, globalCtx); @@ -597,9 +597,9 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->stateFlags & ENDAIKU_STATEFLAG_1) { - this->unk_244.unk_18.x = player->actor.posRot2.pos.x; - this->unk_244.unk_18.y = player->actor.posRot2.pos.y; - this->unk_244.unk_18.z = player->actor.posRot2.pos.z; + this->unk_244.unk_18.x = player->actor.focus.pos.x; + this->unk_244.unk_18.y = player->actor.focus.pos.y; + this->unk_244.unk_18.z = player->actor.focus.pos.z; if (this->stateFlags & ENDAIKU_STATEFLAG_2) { func_80034A14(&this->actor, &this->unk_244, 0, 4); @@ -657,7 +657,7 @@ void EnDaiku_PostLimbDraw(GlobalContext* globalCtx, s32 limb, Gfx** dList, Vec3s OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_daiku.c", 1323); if (limb == 15) { // head - Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.posRot2.pos); + Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos); gSPDisplayList(POLY_OPA_DISP++, hairDLists[this->actor.params & 3]); } 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 44457977ce..7bec3178a7 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 @@ -14,7 +14,7 @@ extern UNK_TYPE D_06007958; /* const ActorInit En_Daiku_Kakariko_InitVars = { ACTOR_EN_DAIKU_KAKARIKO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DAIKU, sizeof(EnDaikuKakariko), 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 4f0c991ab2..a251fddf06 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_06003070; /* const ActorInit En_Dekubaba_InitVars = { ACTOR_EN_DEKUBABA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DEKUBABA, sizeof(EnDekubaba), 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 377c5ef40b..dd575c1640 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -31,7 +31,7 @@ extern UNK_TYPE D_06003650; /* const ActorInit En_Dekunuts_InitVars = { ACTOR_EN_DEKUNUTS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DEKUNUTS, sizeof(EnDekunuts), 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 d728b93510..daa4bba25a 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -45,7 +45,7 @@ extern Gfx D_06007FC0[]; const ActorInit En_Dh_InitVars = { ACTOR_EN_DH, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DH, sizeof(EnDh), @@ -139,7 +139,7 @@ static DamageTable D_809EC620 = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 47, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), }; @@ -154,7 +154,7 @@ void EnDh_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &D_809EC620; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007E88, &D_06005880, this->jointTable, this->limbRotTable, 16); - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 64.0f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 64.0f); this->actor.params = ENDH_WAIT_UNDERGROUND; this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = (gSaveContext.linkAge == 0) ? 14 : 20; @@ -185,7 +185,7 @@ void EnDh_SpawnDebris(GlobalContext* globalCtx, EnDh* this, Vec3f* spawnPos, f32 f32 scaleMod; spreadAngle = (Rand_ZeroOne() - 0.5f) * 6.28f; - pos.y = this->actor.groundY; + pos.y = this->actor.floorHeight; pos.x = (Math_SinF(spreadAngle) * spread) + spawnPos->x; pos.z = (Math_CosF(spreadAngle) * spread) + spawnPos->z; accel.x = (Rand_ZeroOne() - 0.5f) * accelXZ; @@ -198,11 +198,11 @@ void EnDh_SpawnDebris(GlobalContext* globalCtx, EnDh* this, Vec3f* spawnPos, f32 void EnDh_SetupWait(EnDh* this) { Animation_PlayLoop(&this->skelAnime, &D_06003A8C); this->curAction = DH_WAIT; - this->actor.posRot.pos.x = Rand_CenteredFloat(600.0f) + this->actor.initPosRot.pos.x; - this->actor.posRot.pos.z = Rand_CenteredFloat(600.0f) + this->actor.initPosRot.pos.z; - this->actor.shape.unk_08 = -15000.0f; + this->actor.world.pos.x = Rand_CenteredFloat(600.0f) + this->actor.home.pos.x; + this->actor.world.pos.z = Rand_CenteredFloat(600.0f) + this->actor.home.pos.z; + this->actor.shape.yOffset = -15000.0f; this->dirtWaveSpread = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.flags |= 0x80; this->dirtWavePhase = this->actionState = this->actor.params = ENDH_WAIT_UNDERGROUND; EnDh_SetupAction(this, EnDh_Wait); @@ -219,7 +219,7 @@ void EnDh_Wait(EnDh* this, GlobalContext* globalCtx) { switch (this->actionState) { case 0: this->actor.flags |= 1; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.flags &= ~0x80; this->actionState++; this->drawDirtWave++; @@ -229,19 +229,19 @@ void EnDh_Wait(EnDh* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dirtWaveSpread, 300.0f, 1.0f, 5.0f, 0.0f); this->dirtWaveHeight = Math_SinS(this->dirtWavePhase) * 55.0f; this->dirtWaveAlpha = (s16)(Math_SinS(this->dirtWavePhase) * 255.0f); - EnDh_SpawnDebris(globalCtx, this, &this->actor.posRot.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); - if (this->actor.shape.unk_08 == 0.0f) { + EnDh_SpawnDebris(globalCtx, this, &this->actor.world.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); + if (this->actor.shape.yOffset == 0.0f) { this->drawDirtWave = false; this->actionState++; } else if (this->dirtWavePhase > 0x12C0) { - this->actor.shape.unk_08 += 500.0f; + this->actor.shape.yOffset += 500.0f; } break; case 2: EnDh_SetupWalk(this); break; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x7D0, 0); SkelAnime_Update(&this->skelAnime); if (this->actor.params != ENDH_START_ATTACK_BOMB) { func_8008EEAC(globalCtx, &this->actor); @@ -259,8 +259,8 @@ void EnDh_SetupWalk(EnDh* this) { } void EnDh_Walk(EnDh* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); if (((s32)this->skelAnime.curFrame % 8) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_WALK); @@ -268,7 +268,7 @@ void EnDh_Walk(EnDh* this, GlobalContext* globalCtx) { if ((globalCtx->gameplayFrames & 0x5F) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_LAUGH); } - if (this->actor.xzDistToLink <= 100.0f) { + if (this->actor.xzDistToPlayer <= 100.0f) { this->actor.speedXZ = 0.0f; if (func_8002E084(&this->actor, 60 * 0x10000 / 360)) { EnDh_SetupAttack(this); @@ -292,9 +292,9 @@ void EnDh_Retreat(EnDh* this, GlobalContext* globalCtx) { this->retreat = false; EnDh_SetupBurrow(this); } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, (s16)(this->actor.yawTowardsLink + 0x8000), 1, 0xBB8, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, (s16)(this->actor.yawTowardsPlayer + 0x8000), 1, 0xBB8, 0); } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); } @@ -311,7 +311,7 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { this->actionState++; - } else if ((this->actor.xzDistToLink > 100.0f) || !func_8002E084(&this->actor, 60 * 0x10000 / 360)) { + } else if ((this->actor.xzDistToPlayer > 100.0f) || !func_8002E084(&this->actor, 60 * 0x10000 / 360)) { Animation_Change(&this->skelAnime, &D_06004658, -1.0f, this->skelAnime.curFrame, 0.0f, ANIMMODE_ONCE, -4.0f); this->actionState = 4; this->collider2.base.atFlags = this->collider2.elements[0].info.toucherFlags = AT_NONE; // also TOUCH_NONE @@ -323,7 +323,7 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { this->actionState++; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_BITE); case 0: - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x5DC, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); break; case 2: if (this->skelAnime.curFrame >= 4.0f) { @@ -344,7 +344,7 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { } break; case 3: - if ((this->actor.xzDistToLink <= 100.0f) && (func_8002E084(&this->actor, 60 * 0x10000 / 360) != 0)) { + if ((this->actor.xzDistToPlayer <= 100.0f) && (func_8002E084(&this->actor, 60 * 0x10000 / 360) != 0)) { Animation_Change(&this->skelAnime, &D_06004658, 1.0f, 20.0f, Animation_GetLastFrame(&D_06004658), ANIMMODE_ONCE, -6.0f); this->actionState = 0; @@ -363,14 +363,14 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) { case 4: break; } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } void EnDh_SetupBurrow(EnDh* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06002148, -6.0f); this->curAction = DH_BURROW; this->dirtWaveSpread = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->dirtWavePhase = 0; this->actionState = 0; this->actor.flags &= ~1; @@ -392,7 +392,7 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dirtWaveSpread, 300.0f, 1.0f, 8.0f, 0.0f); this->dirtWaveHeight = Math_SinS(this->dirtWavePhase) * 55.0f; this->dirtWaveAlpha = (s16)(Math_SinS(this->dirtWavePhase) * 255.0f); - EnDh_SpawnDebris(globalCtx, this, &this->actor.posRot.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); + EnDh_SpawnDebris(globalCtx, this, &this->actor.world.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f); this->collider1.dim.radius = this->dirtWaveSpread * 0.6f; if (SkelAnime_Update(&this->skelAnime)) { this->actionState++; @@ -422,12 +422,12 @@ void EnDh_Damage(EnDh* this, GlobalContext* globalCtx) { if (this->actor.speedXZ < 0.0f) { this->actor.speedXZ += 0.15f; } - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (SkelAnime_Update(&this->skelAnime)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->retreat) { EnDh_SetupRetreat(this, globalCtx); - } else if ((this->actor.xzDistToLink <= 105.0f) && func_8002E084(&this->actor, 60 * 0x10000 / 360)) { + } else if ((this->actor.xzDistToPlayer <= 105.0f) && func_8002E084(&this->actor, 60 * 0x10000 / 360)) { f32 frames = Animation_GetLastFrame(&D_06004658); EnDh_SetupAttack(this); @@ -460,7 +460,7 @@ void EnDh_Death(EnDh* this, GlobalContext* globalCtx) { if (this->timer < 150) { if (this->alpha != 0) { this->actor.scale.y -= 0.000075f; - this->actor.shape.unk_14 = this->alpha -= 5; + this->actor.shape.shadowAlpha = this->alpha -= 5; } else { Actor_Kill(&this->actor); return; @@ -472,7 +472,7 @@ void EnDh_Death(EnDh* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); } if ((s32)this->skelAnime.curFrame == 61) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); } } } @@ -494,7 +494,7 @@ void EnDh_CollisionCheck(EnDh* this, GlobalContext* globalCtx) { lastHealth = this->actor.colChkInfo.health; if (Actor_ApplyDamage(&this->actor) == 0) { EnDh_SetupDeath(this); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); } else { if (((lastHealth >= 15) && (this->actor.colChkInfo.health < 15)) || ((lastHealth >= 9) && (this->actor.colChkInfo.health < 9)) || @@ -517,8 +517,8 @@ void EnDh_Update(Actor* thisx, GlobalContext* globalCtx) { EnDh_CollisionCheck(this, globalCtx); this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 45.0f, 45.0f, 0x1D); - this->actor.posRot2.pos = this->headPos; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 45.0f, 45.0f, 0x1D); + this->actor.focus.pos = this->headPos; Collider_UpdateCylinder(&this->actor, &this->collider1); if (this->actor.colChkInfo.health > 0) { if (this->curAction == DH_WAIT) { @@ -526,7 +526,7 @@ void EnDh_Update(Actor* thisx, GlobalContext* globalCtx) { } else { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); } - if (((this->curAction != DH_DAMAGE) && (this->actor.shape.unk_08 == 0.0f)) || + if (((this->curAction != DH_DAMAGE) && (this->actor.shape.yOffset == 0.0f)) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_258))) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); @@ -580,7 +580,7 @@ void EnDh_Draw(Actor* thisx, GlobalContext* globalCtx) { 0x20, 0x40)); gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 0, 0, 0, this->dirtWaveAlpha); - Matrix_Translate(0.0f, -this->actor.shape.unk_08, 0.0f, MTXMODE_APPLY); + Matrix_Translate(0.0f, -this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY); Matrix_Scale(this->dirtWaveSpread * 0.01f, this->dirtWaveHeight * 0.01f, this->dirtWaveSpread * 0.01f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_dh.c", 1160), 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 ba52daaacf..b5d204bcff 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -26,7 +26,7 @@ void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx); const ActorInit En_Dha_InitVars = { ACTOR_EN_DHA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DH, sizeof(EnDha), @@ -144,7 +144,7 @@ static ColliderJntSphInit sJntSphInit = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x2E, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_STOP), }; @@ -161,9 +161,9 @@ void EnDha_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &sDamageTable; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06000BD8, &D_060015B0, this->jointTable, this->morphTable, 4); - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Teardrop, 90.0f); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 50.0f; + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFeet, 90.0f); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 50.0f; this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 8; this->unk_1CE = -0x4000; @@ -185,8 +185,8 @@ void func_809EC9C8(EnDha* this) { this->unk_1C0 = 0; this->unk_1C8 = ((Rand_ZeroOne() * 10.0f) + 5.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; - this->actor.initPosRot.rot.z = 1; + this->actor.world.rot.y = this->actor.shape.rot.y; + this->actor.home.rot.z = 1; EnDha_SetupAction(this, func_809ECA50); } @@ -197,7 +197,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 pad; s32 pad2; - Vec3f playerPos = player->actor.posRot.pos; + Vec3f playerPos = player->actor.world.pos; Vec3s test; s16 result; s32 resultAbs; @@ -209,7 +209,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { } else { playerPos.y += 56.0f; } - if (this->actor.xzDistToLink <= 100.0f) { + if (this->actor.xzDistToPlayer <= 100.0f) { this->unk_1D6.x = this->unk_1D0.z = this->unk_1D0.y = 0; if (Math_Vec3f_DistXYZ(&playerPos, &this->unk_1DC) <= 12.0f) { if (this->unk_1CC == 0) { @@ -242,12 +242,12 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { player->actor.parent = NULL; player->unk_850 = 200; } - if (this->actor.initPosRot.rot.z != 0) { + if (this->actor.home.rot.z != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_HAND_AT); - this->actor.initPosRot.rot.z = 0; + this->actor.home.rot.z = 0; } } - this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &playerPos); + this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &playerPos); Math_SmoothStepToF(&this->unk_1DC.x, playerPos.x, 1.0f, 16.0f, 0.0f); Math_SmoothStepToF(&this->unk_1DC.y, playerPos.y, 1.0f, 16.0f, 0.0f); Math_SmoothStepToF(&this->unk_1DC.z, playerPos.z, 1.0f, 16.0f, 0.0f); @@ -255,12 +255,12 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { Matrix_Translate(this->unk_1DC.x, this->unk_1DC.y, this->unk_1DC.z, MTXMODE_NEW); Matrix_RotateRPY(test.x, test.y, 0, MTXMODE_APPLY); Matrix_MultVec3f(&D_809ED758, &this->unk_1F4); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); - func_80035844(&this->actor.posRot.pos, &this->unk_1F4, &test, 0); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); + func_80035844(&this->actor.world.pos, &this->unk_1F4, &test, 0); Matrix_RotateRPY(test.x, test.y, 0, MTXMODE_APPLY); Matrix_MultVec3f(&D_809ED74C, &this->unk_1F4); - this->unk_1CE = Math_Vec3f_Pitch(&this->actor.posRot.pos, &this->unk_1F4); - result = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_1F4) - this->actor.shape.rot.y; + this->unk_1CE = Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_1F4); + result = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_1F4) - this->actor.shape.rot.y; resultAbs = ABS(result); if (resultAbs >= 0x4000) { this->unk_1CE = -0x8000 - this->unk_1CE; @@ -276,7 +276,7 @@ void func_809ECA50(EnDha* this, GlobalContext* globalCtx) { player->actor.parent = NULL; player->unk_850 = 200; } - this->actor.initPosRot.rot.z = 1; + this->actor.home.rot.z = 1; Math_SmoothStepToS(&this->unk_1D0.x, 0, 1, 0x3E8, 0); Math_SmoothStepToS(&this->unk_1CE, -0x4000, 1, 0x3E8, 0); SkelAnime_Update(&this->skelAnime); @@ -335,11 +335,11 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) { result = Math_SmoothStepToS(&this->unk_1CE, -0x4000, 1, 0x7D0, 0); SkelAnime_Update(&this->skelAnime); if (result == 0) { - vector = this->actor.posRot.pos; + vector = this->actor.world.pos; if (this->unk_1C8 != 0) { - if (-12000.0f < this->actor.shape.unk_08) { - this->actor.shape.unk_08 -= 1000.0f; + if (-12000.0f < this->actor.shape.yOffset) { + this->actor.shape.yOffset -= 1000.0f; func_80033480(globalCtx, &vector, 7.0f, 1, 0x5A, 0x14, 1); } else { this->unk_1C8--; @@ -349,9 +349,9 @@ void EnDha_Die(EnDha* this, GlobalContext* globalCtx) { } } } else { - this->actor.shape.unk_08 += 500.0f; + this->actor.shape.yOffset += 500.0f; func_80033480(globalCtx, &vector, 7.0f, 1, 0x5A, 0x14, 1); - if (this->actor.shape.unk_08 == 0.0f) { + if (this->actor.shape.yOffset == 0.0f) { func_809EC9C8(this); } } @@ -368,7 +368,7 @@ void EnDha_UpdateHealth(EnDha* this, GlobalContext* globalCtx) { if (Actor_ApplyDamage(&this->actor) == 0) { EnDha_SetupDeath(this); this->actor.colChkInfo.health = 8; - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_DAMAGE); this->unk_1C0 = 9; @@ -386,7 +386,7 @@ void EnDha_Update(Actor* thisx, GlobalContext* globalCtx) { EnDha* this = THIS; if (this->actor.parent == NULL) { - this->actor.parent = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_DH, ACTORTYPE_ENEMY, 10000.0f); + this->actor.parent = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_DH, ACTORCAT_ENEMY, 10000.0f); } EnDha_UpdateHealth(this, globalCtx); this->actionFunc(this, globalCtx); 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 c67aea9a16..15cbd35437 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 @@ -16,7 +16,7 @@ extern UNK_TYPE D_0600BFA8; /* const ActorInit En_Diving_Game_InitVars = { ACTOR_EN_DIVING_GAME, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZO, sizeof(EnDivingGame), 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 150159e138..ddf73c8053 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -46,7 +46,7 @@ void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx); const ActorInit En_Dns_InitVars = { ACTOR_EN_DNS, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SHOPNUTS, sizeof(EnDns), @@ -117,8 +117,8 @@ DnsItemEntry* D_809F0500[] = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 78, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; typedef struct { @@ -157,7 +157,7 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060041A8, &D_060009A0, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 35.0f); this->actor.textId = D_809F040C[this->actor.params]; Actor_SetScale(&this->actor, 0.01f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -324,17 +324,17 @@ void EnDns_SetupWait(EnDns* this, GlobalContext* globalCtx) { } void EnDns_Wait(EnDns* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 2000, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx)) { this->actionFunc = EnDns_Talk; } else { - if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->actor.unk_10C != 0)) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) { this->actor.flags |= 0x10000; } else { this->actor.flags &= ~0x10000; } - if (this->actor.xzDistToLink < 130.0f) { + if (this->actor.xzDistToPlayer < 130.0f) { func_8002F2F4(&this->actor, globalCtx); } } @@ -444,7 +444,7 @@ void EnDns_SetupBurrow(EnDns* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); this->actionFunc = EnDns_Burrow; this->standOnGround = 0; - this->yInitPos = this->actor.posRot.pos.y; + this->yInitPos = this->actor.world.pos.y; } } @@ -453,20 +453,20 @@ void EnDns_Burrow(EnDns* this, GlobalContext* globalCtx) { Vec3f initPos; s32 i; - depth = this->yInitPos - this->actor.posRot.pos.y; + depth = this->yInitPos - this->actor.world.pos.y; if ((this->dustTimer & 3) == 0) { - initPos.x = this->actor.posRot.pos.x; + initPos.x = this->actor.world.pos.x; initPos.y = this->yInitPos; - initPos.z = this->actor.posRot.pos.z; + initPos.z = this->actor.world.pos.z; func_80028990(globalCtx, 20.0f, &initPos); } this->actor.shape.rot.y += 0x2000; // Drops only if you bought its item if (depth > 400.0f) { if (this->dropCollectible) { - initPos.x = this->actor.posRot.pos.x; + initPos.x = this->actor.world.pos.x; initPos.y = this->yInitPos; - initPos.z = this->actor.posRot.pos.z; + initPos.z = this->actor.world.pos.z; for (i = 0; i < 3; i++) { Item_DropCollectible(globalCtx, &initPos, ITEM00_HEART); } @@ -481,13 +481,13 @@ void EnDns_Update(Actor* thisx, GlobalContext* globalCtx) { this->dustTimer++; this->actor.textId = D_809F040C[this->actor.params]; - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); Actor_SetScale(&this->actor, 0.01f); SkelAnime_Update(&this->skelAnime); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); if (this->standOnGround) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 4); } if (this->maintainCollider) { Collider_UpdateCylinder(&this->actor, &this->collider); 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 74af8d25ea..f6f79d7e59 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 @@ -11,7 +11,7 @@ void EnDntDemo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Dnt_Demo_InitVars = { ACTOR_EN_DNT_DEMO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnDntDemo), 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 3d588b927f..c4a9ac3f97 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 @@ -22,7 +22,7 @@ extern UNK_TYPE D_060037C0; /* const ActorInit En_Dnt_Jiji_InitVars = { ACTOR_EN_DNT_JIJI, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DNS, sizeof(EnDntJiji), 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 ee987978c1..90a0b4cc5f 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 @@ -26,7 +26,7 @@ extern UNK_TYPE D_06003128; /* const ActorInit En_Dnt_Nomal_InitVars = { ACTOR_EN_DNT_NOMAL, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnDntNomal), 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 37b7de4a41..bee4ffe008 100644 --- a/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_060020E0; /* const ActorInit En_Dodojr_InitVars = { ACTOR_EN_DODOJR, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DODOJR, sizeof(EnDodojr), 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 cd9a7ea29f..0b2eb27d2f 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -49,7 +49,7 @@ extern AnimationHeader D_06001A44; const ActorInit En_Dodongo_InitVars = { ACTOR_EN_DODONGO, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DODONGO, sizeof(EnDodongo), @@ -312,20 +312,20 @@ void EnDodongo_SpawnBombSmoke(EnDodongo* this, GlobalContext* globalCtx) { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 13, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2800, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2800, ICHAIN_STOP), }; void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { EnDodongo* this = THIS; EffectBlureInit1 blureInit; - this->actor.unk_1F = 3; + this->actor.targetMode = 3; Actor_ProcessInitChain(&this->actor, sInitChain); this->bombSmokePrimColor.r = this->bombSmokePrimColor.g = this->bombSmokeEnvColor.r = 255; this->bombSmokePrimColor.a = this->bombSmokeEnvColor.a = 200; this->bombSmokeEnvColor.g = 10; this->bodyScale.x = this->bodyScale.y = this->bodyScale.z = 1.0f; - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 48.0f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 48.0f); Actor_SetScale(&this->actor, 0.01875f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31); this->actor.colChkInfo.health = 4; @@ -350,7 +350,7 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { blureInit.calcMode = 2; Effect_Add(globalCtx, &this->blureIdx, EFFECT_BLURE1, 0, 0, &blureInit); - func_8002E4B4(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); EnDodongo_SetupIdle(this); } @@ -444,10 +444,10 @@ void EnDodongo_BreatheFire(EnDodongo* this, GlobalContext* globalCtx) { if ((29.0f <= this->skelAnime.curFrame) && (this->skelAnime.curFrame <= 43.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG); fireFrame = this->skelAnime.curFrame - 29.0f; - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += 35.0f; - EnDodongo_ShiftVecRadial(this->actor.posRot.rot.y, 30.0f, &pos); - EnDodongo_ShiftVecRadial(this->actor.posRot.rot.y, 2.5f, &accel); + EnDodongo_ShiftVecRadial(this->actor.world.rot.y, 30.0f, &pos); + EnDodongo_ShiftVecRadial(this->actor.world.rot.y, 2.5f, &accel); EffectSsDFire_SpawnFixedScale(globalCtx, &pos, &velocity, &accel, 255 - (fireFrame * 10), fireFrame + 3); } else if ((2.0f <= this->skelAnime.curFrame) && (this->skelAnime.curFrame <= 20.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_BREATH - SFX_FLAG); @@ -468,10 +468,10 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) { s32 pad; if (this->actor.child != NULL) { - this->actor.child->posRot.pos = this->mouthPos; + this->actor.child->world.pos = this->mouthPos; ((EnBom*)this->actor.child)->timer++; } else if (this->actor.parent != NULL) { - this->actor.parent->posRot.pos = this->mouthPos; + this->actor.parent->world.pos = this->mouthPos; ((EnBombf*)this->actor.parent)->timer++; //! @bug The devs forgot an explosive could also be a bombchu, which leads to a serious bug. ->timer (0x1F8) is //! outside the bounds of the bombchu actor, and the memory it writes to happens to be one of the pointers in @@ -524,8 +524,8 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) { func_8002829C(globalCtx, &pos, &smokeVel, &smokeAccel, &white, &white, 50, 5); } } - this->bodyScale.y = this->bodyScale.z = (Math_SinS(this->actor.dmgEffectTimer * 0x1000) * 0.5f) + 1.0f; - this->bodyScale.x = Math_SinS(this->actor.dmgEffectTimer * 0x1000) + 1.0f; + this->bodyScale.y = this->bodyScale.z = (Math_SinS(this->actor.colorFilterTimer * 0x1000) * 0.5f) + 1.0f; + this->bodyScale.x = Math_SinS(this->actor.colorFilterTimer * 0x1000) + 1.0f; SkelAnime_Update(&this->skelAnime); if (this->timer == 0) { @@ -537,7 +537,7 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) { s32 pad; f32 playbackSpeed; Player* player = PLAYER; - s16 yawDiff = (s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y); + s16 yawDiff = (s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y); yawDiff = ABS(yawDiff); @@ -570,19 +570,18 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) { } } - if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 400.0f) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x1F4, 0); + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 400.0f) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x1F4, 0); this->actor.flags |= 1; - if ((this->actor.xzDistToLink < 100.0f) && (yawDiff < 0x1388) && (this->actor.yDistToLink < 60.0f)) { + if ((this->actor.xzDistToPlayer < 100.0f) && (yawDiff < 0x1388) && (this->actor.yDistToPlayer < 60.0f)) { EnDodongo_SetupBreatheFire(this); } } else { this->actor.flags &= ~1; - if ((Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 150.0f) || - (this->retreatTimer != 0)) { - s16 yawToHome = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + if ((Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) > 150.0f) || (this->retreatTimer != 0)) { + s16 yawToHome = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, yawToHome, 1, 0x1F4, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, yawToHome, 1, 0x1F4, 0); } if (this->retreatTimer != 0) { this->retreatTimer--; @@ -598,7 +597,7 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) { } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnDodongo_SetupSweepTail(EnDodongo* this) { @@ -611,7 +610,7 @@ void EnDodongo_SetupSweepTail(EnDodongo* this) { } void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { - s16 yawDiff1 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 yawDiff1 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (SkelAnime_Update(&this->skelAnime)) { if ((this->timer != 0) || (ABS(yawDiff1) < 0x4000)) { @@ -625,11 +624,11 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { EnDodongo_SetupBreatheFire(this); this->timer = Rand_S16Offset(5, 10); } else { - s16 yawDiff2 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 yawDiff2 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; AnimationHeader* animation; this->tailSwipeSpeed = (0xFFFF - ABS(yawDiff2)) / 0xF; - if ((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0) { this->tailSwipeSpeed = -this->tailSwipeSpeed; animation = &D_060042C4; } else { @@ -647,7 +646,7 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) { Vec3f tailPos; this->timer--; - this->actor.shape.rot.y = this->actor.posRot.rot.y += this->tailSwipeSpeed; + this->actor.shape.rot.y = this->actor.world.rot.y += this->tailSwipeSpeed; tailPos.x = this->sphElements[1].dim.worldSphere.center.x; tailPos.y = this->sphElements[1].dim.worldSphere.center.y; tailPos.z = this->sphElements[1].dim.worldSphere.center.z; @@ -685,13 +684,13 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) { if (this->actor.params == EN_DODONGO_SMOKE_DEATH) { EnDodongo_SpawnBombSmoke(this, globalCtx); } - } else if (this->actor.dmgEffectTimer == 0) { + } else if (this->actor.colorFilterTimer == 0) { func_8003426C(&this->actor, 0x4000, 0x78, 0, 4); } if (SkelAnime_Update(&this->skelAnime) != 0) { if (this->timer == 0) { - bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 6, BOMB_BODY); + bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 6, BOMB_BODY); if (bomb != NULL) { bomb->timer = 0; this->timer = 8; @@ -703,7 +702,7 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; if (this->timer == 0) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x40); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x40); Actor_Kill(&this->actor); } } @@ -711,7 +710,7 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) { void EnDodongo_Stunned(EnDodongo* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { if (this->actor.colChkInfo.health == 0) { EnDodongo_SetupDeath(this, globalCtx); } else { @@ -780,7 +779,7 @@ void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect != 0xE) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 60.0f, 70.0f, 0x1D); if (this->actor.bgCheckFlags & 2) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); } @@ -800,9 +799,9 @@ void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderAT.base); } } - this->actor.posRot2.pos.x = this->actor.posRot.pos.x + Math_SinS(this->actor.shape.rot.y) * -30.0f; - this->actor.posRot2.pos.y = this->actor.posRot.pos.y + 20.0f; - this->actor.posRot2.pos.z = this->actor.posRot.pos.z + Math_CosS(this->actor.shape.rot.y) * -30.0f; + this->actor.focus.pos.x = this->actor.world.pos.x + Math_SinS(this->actor.shape.rot.y) * -30.0f; + this->actor.focus.pos.y = this->actor.world.pos.y + 20.0f; + this->actor.focus.pos.z = this->actor.world.pos.z + Math_CosS(this->actor.shape.rot.y) * -30.0f; } s32 EnDodongo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, @@ -933,7 +932,7 @@ void EnDodongo_Draw(Actor* thisx, GlobalContext* globalCtx2) { EnDodongo_PostLimbDraw, this); if (this->iceTimer != 0) { - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; if (1) {} this->iceTimer--; if ((this->iceTimer % 4) == 0) { @@ -950,7 +949,7 @@ void EnDodongo_ShiftVecRadial(s16 yaw, f32 radius, Vec3f* vec) { } s32 EnDodongo_AteBomb(EnDodongo* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; f32 dx; f32 dy; f32 dz; @@ -960,9 +959,9 @@ s32 EnDodongo_AteBomb(EnDodongo* this, GlobalContext* globalCtx) { actor = actor->next; continue; } - dx = actor->posRot.pos.x - this->mouthPos.x; - dy = actor->posRot.pos.y - this->mouthPos.y; - dz = actor->posRot.pos.z - this->mouthPos.z; + dx = actor->world.pos.x - this->mouthPos.x; + dy = actor->world.pos.y - this->mouthPos.y; + dz = actor->world.pos.z - this->mouthPos.z; if ((fabsf(dx) < 20.0f) && (fabsf(dy) < 10.0f) && (fabsf(dz) < 20.0f)) { if (actor->id == ACTOR_EN_BOM) { this->actor.child = actor; 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 c62aa7da2f..7d4e47ce01 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -24,7 +24,7 @@ void EnDog_Wait(EnDog* this, GlobalContext* globalCtx); const ActorInit En_Dog_InitVars = { ACTOR_EN_DOG, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DOG, sizeof(EnDog), @@ -219,7 +219,7 @@ s32 EnDog_Orient(EnDog* this, GlobalContext* globalCtx) { f32 waypointDistSq; waypointDistSq = Path_OrientAndGetDistSq(&this->actor, this->path, this->waypoint, &targetYaw); - Math_SmoothStepToS(&this->actor.posRot.rot.y, targetYaw, 10, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, targetYaw, 10, 1000, 1); if ((waypointDistSq > 0.0f) && (waypointDistSq < 1000.0f)) { return EnDog_UpdateWaypoint(this, globalCtx); @@ -233,7 +233,7 @@ void EnDog_Init(Actor* thisx, GlobalContext* globalCtx) { s16 followingDog; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007290, NULL, this->jointTable, this->morphTable, 13); func_80034EC0(&this->skelAnime, sAnimations, 0); @@ -308,7 +308,7 @@ void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) { } Math_SmoothStepToF(&this->actor.speedXZ, speed, 0.4f, 1.0f, 0.0f); EnDog_Orient(this, globalCtx); - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; // Used to change between two text boxes for Richard's owner in the Market Day scene // depending on where he is on his path. En_Hy checks these event flags. @@ -359,16 +359,16 @@ void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) { return; } - if (this->actor.xzDistToLink > 400.0f) { + if (this->actor.xzDistToPlayer > 400.0f) { if (this->nextBehavior != DOG_SIT && this->nextBehavior != DOG_SIT_2) { this->nextBehavior = DOG_BOW; } gSaveContext.dogParams = 0; speed = 0.0f; - } else if (this->actor.xzDistToLink > 100.0f) { + } else if (this->actor.xzDistToPlayer > 100.0f) { this->nextBehavior = DOG_RUN; speed = 4.0f; - } else if (this->actor.xzDistToLink < 40.0f) { + } else if (this->actor.xzDistToPlayer < 40.0f) { if (this->nextBehavior != DOG_BOW && this->nextBehavior != DOG_BOW_2) { this->nextBehavior = DOG_BOW; } @@ -380,20 +380,20 @@ void EnDog_FollowLink(EnDog* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, speed, 0.6f, 1.0f); - if (!(this->actor.xzDistToLink > 400.0f)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 10, 1000, 1); - this->actor.shape.rot = this->actor.posRot.rot; + if (!(this->actor.xzDistToPlayer > 400.0f)) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 10, 1000, 1); + this->actor.shape.rot = this->actor.world.rot; } } void EnDog_RunAway(EnDog* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { Math_ApproachF(&this->actor.speedXZ, 4.0f, 0.6f, 1.0f); - Math_SmoothStepToS(&this->actor.posRot.rot.y, (this->actor.yawTowardsLink ^ 0x8000), 10, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, (this->actor.yawTowardsPlayer ^ 0x8000), 10, 1000, 1); } else { this->actionFunc = EnDog_FaceLink; } - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; } void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) { @@ -402,16 +402,16 @@ void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) { f32 absAngleDiff; // if the dog is more than 200 units away from Link, turn to face him then wait - if (200.0f <= this->actor.xzDistToLink) { + if (200.0f <= this->actor.xzDistToPlayer) { this->nextBehavior = DOG_WALK; Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.6f, 1.0f); - rotTowardLink = this->actor.yawTowardsLink; - prevRotY = this->actor.posRot.rot.y; - Math_SmoothStepToS(&this->actor.posRot.rot.y, rotTowardLink, 10, 1000, 1); + rotTowardLink = this->actor.yawTowardsPlayer; + prevRotY = this->actor.world.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, rotTowardLink, 10, 1000, 1); - absAngleDiff = this->actor.posRot.rot.y; + absAngleDiff = this->actor.world.rot.y; absAngleDiff -= prevRotY; absAngleDiff = fabsf(absAngleDiff); if (absAngleDiff < 200.0f) { @@ -423,14 +423,14 @@ void EnDog_FaceLink(EnDog* this, GlobalContext* globalCtx) { this->nextBehavior = DOG_RUN; this->actionFunc = EnDog_RunAway; } - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; } void EnDog_Wait(EnDog* this, GlobalContext* globalCtx) { - this->unusedAngle = (this->actor.yawTowardsLink - this->actor.shape.rot.y); + this->unusedAngle = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y); // If another dog is following Link and he gets within 200 units of waiting dog, run away - if ((gSaveContext.dogParams != 0) && (this->actor.xzDistToLink < 200.0f)) { + if ((gSaveContext.dogParams != 0) && (this->actor.xzDistToPlayer < 200.0f)) { this->nextBehavior = DOG_RUN; this->actionFunc = EnDog_RunAway; } @@ -442,7 +442,8 @@ void EnDog_Update(Actor* thisx, GlobalContext* globalCtx) { EnDog_PlayAnimAndSFX(this); SkelAnime_Update(&this->skelAnime); - func_8002E4B4(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, this->collider.dim.radius, this->collider.dim.height * 0.5f, 0.0f, + 5); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); Collider_UpdateCylinder(&this->actor, &this->collider); 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 bc6ede9afa..64b78e8669 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -31,7 +31,7 @@ void EnDoor_Open(EnDoor* this, GlobalContext* globalCtx); const ActorInit En_Door_InitVars = { ACTOR_EN_DOOR, - ACTORTYPE_DOOR, + ACTORCAT_DOOR, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnDoor), @@ -55,7 +55,7 @@ static EnDoorInfo sDoorInfo[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 0, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_STOP), }; @@ -119,16 +119,16 @@ void EnDoor_Init(Actor* thisx, GlobalContext* globalCtx2) { xOffset = Math_CosS(this->actor.shape.rot.y) * 30.0f; zOffset = Math_SinS(this->actor.shape.rot.y) * 30.0f; other = (EnDoor*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_DOOR, - this->actor.posRot.pos.x + xOffset, this->actor.posRot.pos.y, - this->actor.posRot.pos.z - zOffset, 0, this->actor.shape.rot.y + 0x8000, 0, + this->actor.world.pos.x + xOffset, this->actor.world.pos.y, + this->actor.world.pos.z - zOffset, 0, this->actor.shape.rot.y + 0x8000, 0, this->actor.params & ~0x40); if (other != NULL) { other->unk_192 = 1; } - this->actor.posRot.pos.x -= xOffset; - this->actor.posRot.pos.z += zOffset; + this->actor.world.pos.x -= xOffset; + this->actor.world.pos.z += zOffset; } - Actor_SetHeight(&this->actor, 70.0f); + Actor_SetFocus(&this->actor, 70.0f); } void EnDoor_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -153,15 +153,15 @@ void EnDoor_SetupType(EnDoor* this, GlobalContext* globalCtx) { doorType = (gSaveContext.dayTime > 0xC000 && gSaveContext.dayTime < 0xE000) ? DOOR_SCENEEXIT : DOOR_CHECKABLE; } - this->actor.posRot.rot.y = 0x0000; + this->actor.world.rot.y = 0x0000; if (doorType == DOOR_LOCKED) { if (!Flags_GetSwitch(globalCtx, this->actor.params & 0x3F)) { this->lockTimer = 10; } } else if (doorType == DOOR_AJAR) { - if (func_8002DB8C(&this->actor, &PLAYER->actor) > DOOR_AJAR_SLAM_RANGE) { + if (Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor) > DOOR_AJAR_SLAM_RANGE) { this->actionFunc = EnDoor_AjarWait; - this->actor.posRot.rot.y = -0x1800; + this->actor.world.rot.y = -0x1800; } } else if (doorType == DOOR_CHECKABLE) { this->actor.textId = (this->actor.params & 0x3F) + 0x0200; @@ -188,7 +188,7 @@ void EnDoor_Idle(EnDoor* this, GlobalContext* globalCtx) { s16 phi_v0; doorType = this->actor.params >> 7 & 7; - func_8002DBD0(&this->actor, &sp2C, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &sp2C, &player->actor.world.pos); if (this->unk_191 != 0) { this->actionFunc = EnDoor_Open; Animation_PlayOnceSetSpeed(&this->skelAnime, D_809FCECC[this->unk_190], @@ -219,7 +219,7 @@ void EnDoor_Idle(EnDoor* this, GlobalContext* globalCtx) { player->doorDirection = (sp2C.z >= 0.0f) ? 1.0f : -1.0f; player->doorActor = &this->actor; } - } else if (doorType == DOOR_AJAR && this->actor.xzDistToLink > DOOR_AJAR_OPEN_RANGE) { + } else if (doorType == DOOR_AJAR && this->actor.xzDistToPlayer > DOOR_AJAR_OPEN_RANGE) { this->actionFunc = EnDoor_AjarOpen; } } @@ -240,21 +240,21 @@ void EnDoor_Check(EnDoor* this, GlobalContext* globalCtx) { } void EnDoor_AjarWait(EnDoor* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < DOOR_AJAR_SLAM_RANGE) { + if (this->actor.xzDistToPlayer < DOOR_AJAR_SLAM_RANGE) { this->actionFunc = EnDoor_AjarClose; } } void EnDoor_AjarOpen(EnDoor* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < DOOR_AJAR_SLAM_RANGE) { + if (this->actor.xzDistToPlayer < DOOR_AJAR_SLAM_RANGE) { this->actionFunc = EnDoor_AjarClose; - } else if (Math_ScaledStepToS(&this->actor.posRot.rot.y, -0x1800, 0x100)) { + } else if (Math_ScaledStepToS(&this->actor.world.rot.y, -0x1800, 0x100)) { this->actionFunc = EnDoor_AjarWait; } } void EnDoor_AjarClose(EnDoor* this, GlobalContext* globalCtx) { - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, 0, 0x700)) { + if (Math_ScaledStepToS(&this->actor.world.rot.y, 0, 0x700)) { this->actionFunc = EnDoor_Idle; } } @@ -276,7 +276,7 @@ void EnDoor_Open(EnDoor* this, GlobalContext* globalCtx) { if (this->skelAnime.playSpeed < 1.5f) { numEffects = (s32)(Rand_ZeroOne() * 30.0f) + 50; for (i = 0; i < numEffects; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 60.0f, 100.0f, 50.0f, 0.15f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 60.0f, 100.0f, 50.0f, 0.15f); } } } else if (Animation_OnFrame(&this->skelAnime, sDoorAnimCloseFrames[this->unk_190])) { @@ -306,11 +306,11 @@ s32 EnDoor_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList if (limbIndex == 4) { temp_a2 = D_809FCEE4[this->dListIndex]; transitionEntry = &globalCtx->transitionActorList[(u16)this->actor.params >> 0xA]; - rot->z += this->actor.posRot.rot.y; + rot->z += this->actor.world.rot.y; if ((globalCtx->roomCtx.prevRoom.num >= 0) || (transitionEntry->sides[0].room == transitionEntry->sides[1].room)) { phi_v0_2 = ((this->actor.shape.rot.y + this->skelAnime.jointTable[3].z) + rot->z) - - Math_Vec3f_Yaw(&globalCtx->view.eye, &this->actor.posRot.pos); + Math_Vec3f_Yaw(&globalCtx->view.eye, &this->actor.world.pos); *dList = (ABS(phi_v0_2) < 0x4000) ? temp_a2[0] : temp_a2[1]; } else { phi_v0 = this->unk_192; @@ -332,9 +332,9 @@ void EnDoor_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDoor_OverrideLimbDraw, NULL, &this->actor); - if (this->actor.posRot.rot.y != 0) { + if (this->actor.world.rot.y != 0) { if (1) {} - if (this->actor.posRot.rot.y > 0) { + if (this->actor.world.rot.y > 0) { gSPDisplayList(POLY_OPA_DISP++, D_0400EE00); } else { gSPDisplayList(POLY_OPA_DISP++, D_0400ECB8); 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 1dce215b9d..5b9bc7280a 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -19,7 +19,7 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx); const ActorInit En_Ds_InitVars = { ACTOR_EN_DS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DS, sizeof(EnDs), @@ -35,7 +35,7 @@ extern AnimationHeader D_0600039C; void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) { EnDs* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004768, &D_0600039C, this->jointTable, this->morphTable, 6); Animation_PlayOnce(&this->skelAnime, &D_0600039C); @@ -44,7 +44,7 @@ void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.013f); this->actionFunc = EnDs_Wait; - this->actor.unk_1F = 1; + this->actor.targetMode = 1; this->unk_1E8 = 0; this->actor.flags &= ~0x1; this->unk_1E4 = 0.0f; @@ -225,10 +225,10 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) { this->actionFunc = EnDs_Talk; } } else { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; this->actor.textId = 0x5048; - if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistToLink < 200.0f)) { + if ((ABS(yawDiff) < 0x2151) && (this->actor.xzDistToPlayer < 200.0f)) { func_8002F298(this, globalCtx, 100.0f, EXCH_ITEM_ODD_MUSHROOM); this->unk_1E8 |= 1; } @@ -245,7 +245,7 @@ void EnDs_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->unk_1E8 & 1) { - func_80038290(globalCtx, this, &this->unk_1D8, &this->unk_1DE, this->actor.posRot2.pos); + func_80038290(globalCtx, this, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->unk_1D8.x, 0, 6, 0x1838, 100); Math_SmoothStepToS(&this->unk_1D8.y, 0, 6, 0x1838, 100); @@ -269,7 +269,7 @@ void EnDs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnDs* this = THIS; if (limbIndex == 5) { - Matrix_MultVec3f(&sMultVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMultVec, &this->actor.focus.pos); } } 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 9252b64701..eb2aba76c7 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06011CA8; /* const ActorInit En_Du_InitVars = { ACTOR_EN_DU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DU, sizeof(EnDu), 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 df5ddb68a6..fd5f3b2c29 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 @@ -21,7 +21,7 @@ void func_809FF840(EnDyExtra* this, GlobalContext* globalCtx); const ActorInit En_Dy_Extra_InitVars = { ACTOR_EN_DY_EXTRA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_DY_OBJ, sizeof(EnDyExtra), @@ -47,7 +47,7 @@ void EnDyExtra_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_15C.x = 0.025f; this->unk_15C.y = 0.039f; this->unk_15C.z = 0.025f; - this->unk_168 = this->actor.posRot.pos; + this->unk_168 = this->actor.world.pos; this->actor.gravity = -0.2f; this->unk_158 = 1.0f; this->unk_154 = 0x3C; @@ -56,7 +56,7 @@ void EnDyExtra_Init(Actor* thisx, GlobalContext* globalCtx) { void func_809FF7AC(EnDyExtra* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.gravity, 0.0f, 0.1f, 0.005f); - if (this->actor.posRot.pos.y < -55.0f) { + if (this->actor.world.pos.y < -55.0f) { this->actor.velocity.y = 0.0f; } if (this->unk_154 == 0 && this->unk_152 != 0) { @@ -72,7 +72,7 @@ void func_809FF840(EnDyExtra* this, GlobalContext* globalCtx) { return; } Math_ApproachZeroF(&this->unk_158, 0.03f, 0.05f); - if (this->actor.posRot.pos.y < -55.0f) { + if (this->actor.world.pos.y < -55.0f) { this->actor.velocity.y = 0.0f; } } 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 1824e54abb..6e8a3df7eb 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -26,7 +26,7 @@ static EnEgActionFunc sActionFuncs[] = { const ActorInit En_Eg_InitVars = { ACTOR_EN_EG, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_ZL2, sizeof(EnEg), 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 3a986d679c..8d2aea34e6 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_06003410; /* const ActorInit En_Eiyer_InitVars = { ACTOR_EN_EIYER, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EI, sizeof(EnEiyer), 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 c58229f3fc..1e1fd74138 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -57,7 +57,7 @@ void EnElf_GetCutsceneNextPos(Vec3f* vec, GlobalContext* globalCtx, s32 action); const ActorInit En_Elf_InitVars = { ACTOR_EN_ELF, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnElf), @@ -215,7 +215,7 @@ s32 func_80A01F90(Vec3f* this, Vec3f* arg1, f32 arg2) { void func_80A01FE0(EnElf* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (!func_80A01F90(&this->actor.posRot.pos, &player->actor.posRot.pos, 30.0f)) { + if (!func_80A01F90(&this->actor.world.pos, &player->actor.world.pos, 30.0f)) { this->unk_2B8 = 0.5f; } else { this->unk_2B8 = 2.0f; @@ -235,7 +235,7 @@ void func_80A01FE0(EnElf* this, GlobalContext* globalCtx) { void func_80A020A4(EnElf* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (func_80A01F90(&this->actor.posRot.pos, &player->actor.posRot.pos, 50.0f)) { + if (func_80A01F90(&this->actor.world.pos, &player->actor.world.pos, 50.0f)) { if (this->unk_2C0 > 0) { this->unk_2C0--; } else { @@ -249,13 +249,13 @@ void func_80A020A4(EnElf* this, GlobalContext* globalCtx) { } void func_80A0214C(EnElf* this, GlobalContext* globalCtx) { - f32 xzDistToLink; + f32 xzDistToPlayer; if (this->unk_2C0 > 0) { this->unk_2C0--; } else { - xzDistToLink = this->actor.xzDistToLink; - if (xzDistToLink < 50.0f) { + xzDistToPlayer = this->actor.xzDistToPlayer; + if (xzDistToPlayer < 50.0f) { if (Rand_ZeroOne() < 0.2f) { this->unk_2A8 = 2; this->unk_2AC = 0x400; @@ -267,16 +267,16 @@ void func_80A0214C(EnElf* this, GlobalContext* globalCtx) { this->unk_2C0 = 10; } } else { - if (xzDistToLink > 150.0f) { - xzDistToLink = 150.0f; + if (xzDistToPlayer > 150.0f) { + xzDistToPlayer = 150.0f; } - xzDistToLink = ((xzDistToLink - 50.0f) * 0.95f) + 0.05f; + xzDistToPlayer = ((xzDistToPlayer - 50.0f) * 0.95f) + 0.05f; - if (Rand_ZeroOne() < xzDistToLink) { + if (Rand_ZeroOne() < xzDistToPlayer) { this->unk_2A8 = 3; this->unk_2AC = 0x200; - this->unk_2B8 = (xzDistToLink * 2.0f) + 1.0f; + this->unk_2B8 = (xzDistToPlayer * 2.0f) + 1.0f; this->func_2C8 = func_80A01FE0; this->unk_2C0 = (s16)Rand_ZeroFloat(16.0f) + 0x10; } else { @@ -294,7 +294,7 @@ void func_80A0214C(EnElf* this, GlobalContext* globalCtx) { } void func_80A0232C(EnElf* this, GlobalContext* globalCtx) { - if (func_80A01F90(&this->unk_28C, &this->actor.posRot.pos, 100.0f)) { + if (func_80A01F90(&this->unk_28C, &this->actor.world.pos, 100.0f)) { this->unk_2A8 = 0; this->unk_2AC = 0x200; this->func_2C8 = func_80A0214C; @@ -325,14 +325,14 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); SkelAnime_Init(globalCtx, &this->skelAnime, &D_04016A48, &D_04014BA4, this->jointTable, this->morphTable, 15); ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f); - thisx->shape.unk_14 = 0xFF; + thisx->shape.shadowAlpha = 0xFF; - Lights_PointGlowSetInfo(&this->lightInfoGlow, thisx->posRot.pos.x, thisx->posRot.pos.y, thisx->posRot.pos.z, 255, - 255, 255, 0); + Lights_PointGlowSetInfo(&this->lightInfoGlow, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 255, 255, + 255, 0); this->lightNodeGlow = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfoGlow); - Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, thisx->posRot.pos.x, thisx->posRot.pos.y, thisx->posRot.pos.z, - 255, 255, 255, 0); + Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 255, + 255, 255, 0); this->lightNodeNoGlow = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfoNoGlow); this->fairyFlags = 0; @@ -357,10 +357,10 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { case FAIRY_REVIVE_BOTTLE: colorConfig = -1; EnElf_SetupAction(this, func_80A03610); - this->unk_2B8 = Math_Vec3f_DistXZ(&thisx->posRot.pos, &player->actor.posRot.pos); + this->unk_2B8 = Math_Vec3f_DistXZ(&thisx->world.pos, &player->actor.world.pos); this->unk_2AC = player->actor.shape.rot.y; this->unk_2B0 = -0x1000; - this->unk_28C.y = thisx->posRot.pos.y - player->actor.posRot.pos.y; + this->unk_28C.y = thisx->world.pos.y - player->actor.world.pos.y; this->unk_2AA = 0; this->unk_2B4 = 0.0f; break; @@ -370,13 +370,13 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B8 = 0.0f; this->unk_2AC = player->actor.shape.rot.y; this->unk_2B0 = 0; - this->unk_28C.y = thisx->posRot.pos.y - player->actor.posRot.pos.y; + this->unk_28C.y = thisx->world.pos.y - player->actor.world.pos.y; this->unk_2AA = 0; this->unk_2B4 = 7.0f; break; case FAIRY_HEAL_BIG: this->fairyFlags |= FAIRY_FLAG_BIG; - thisx->shape.shadowDrawFunc = ActorShadow_DrawFunc_WhiteCircle; + thisx->shape.shadowDraw = ActorShadow_DrawWhiteCircle; case FAIRY_HEAL_TIMED: this->fairyFlags |= FAIRY_FLAG_TIMED; case FAIRY_HEAL: @@ -385,7 +385,7 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = Rand_ZeroFloat(10.0f) + 10.0f; this->unk_2AA = 0; this->unk_2AE = (s16)(Rand_ZeroFloat(1048.0f)) + 0x200; - this->unk_28C = thisx->posRot.pos; + this->unk_28C = thisx->world.pos; this->unk_2BC = Rand_CenteredFloat(32767.0f); this->func_2C8 = func_80A0214C; func_80A0232C(this, globalCtx); @@ -402,8 +402,8 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx) { func_80A01C38(this, 8); for (i = 0; i < 8; i++) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, thisx->posRot.pos.x, - thisx->posRot.pos.y - 30.0f, thisx->posRot.pos.z, 0, 0, 0, FAIRY_HEAL); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, thisx->world.pos.x, + thisx->world.pos.y - 30.0f, thisx->world.pos.z, 0, 0, 0, FAIRY_HEAL); } break; default: @@ -478,7 +478,7 @@ void func_80A02BD8(EnElf* this, Vec3f* targetPos, f32 arg2) { f32 yVelTarget; f32 yVelDirection; - yVelTarget = ((targetPos->y + this->unk_28C.y) - this->actor.posRot.pos.y) * arg2; + yVelTarget = ((targetPos->y + this->unk_28C.y) - this->actor.world.pos.y) * arg2; yVelDirection = (yVelTarget >= 0.0f) ? 1.0f : -1.0f; yVelTarget = fabsf(yVelTarget); yVelTarget = CLAMP(yVelTarget, 0.0f, 20.0f) * yVelDirection; @@ -491,8 +491,8 @@ void func_80A02C98(EnElf* this, Vec3f* targetPos, f32 arg2) { f32 xVelDirection; f32 zVelDirection; - xVelTarget = ((targetPos->x + this->unk_28C.x) - this->actor.posRot.pos.x) * arg2; - zVelTarget = ((targetPos->z + this->unk_28C.z) - this->actor.posRot.pos.z) * arg2; + xVelTarget = ((targetPos->x + this->unk_28C.x) - this->actor.world.pos.x) * arg2; + zVelTarget = ((targetPos->z + this->unk_28C.z) - this->actor.world.pos.z) * arg2; xVelDirection = (xVelTarget >= 0.0f) ? 1.0f : -1.0f; zVelDirection = (zVelTarget >= 0.0f) ? 1.0f : -1.0f; @@ -511,26 +511,26 @@ void func_80A02C98(EnElf* this, Vec3f* targetPos, f32 arg2) { void func_80A02E30(EnElf* this, Vec3f* targetPos) { func_80A02BD8(this, targetPos, 0.2f); - this->actor.velocity.x = (targetPos->x + this->unk_28C.x) - this->actor.posRot.pos.x; - this->actor.velocity.z = (targetPos->z + this->unk_28C.z) - this->actor.posRot.pos.z; + this->actor.velocity.x = (targetPos->x + this->unk_28C.x) - this->actor.world.pos.x; + this->actor.velocity.z = (targetPos->z + this->unk_28C.z) - this->actor.world.pos.z; func_8002D7EC(&this->actor); - this->actor.posRot.pos.x = targetPos->x + this->unk_28C.x; - this->actor.posRot.pos.z = targetPos->z + this->unk_28C.z; + this->actor.world.pos.x = targetPos->x + this->unk_28C.x; + this->actor.world.pos.z = targetPos->z + this->unk_28C.z; } void func_80A02EC0(EnElf* this, Vec3f* targetPos) { func_80A02BD8(this, targetPos, 0.2f); this->actor.velocity.x = this->actor.velocity.z = 0.0f; func_8002D7EC(&this->actor); - this->actor.posRot.pos.x = targetPos->x + this->unk_28C.x; - this->actor.posRot.pos.z = targetPos->z + this->unk_28C.z; + this->actor.world.pos.x = targetPos->x + this->unk_28C.x; + this->actor.world.pos.z = targetPos->z + this->unk_28C.z; } void func_80A02F2C(EnElf* this, Vec3f* targetPos) { f32 yVelTarget; f32 yVelDirection; - yVelTarget = (((Math_SinS(this->unk_2AA) * this->unk_2B4) + targetPos->y) - this->actor.posRot.pos.y) * 0.2f; + yVelTarget = (((Math_SinS(this->unk_2AA) * this->unk_2B4) + targetPos->y) - this->actor.world.pos.y) * 0.2f; yVelDirection = (yVelTarget >= 0.0f) ? 1.0f : -1.0f; this->unk_2AA += this->unk_2AE; yVelTarget = fabsf(yVelTarget); @@ -548,17 +548,17 @@ void func_80A03018(EnElf* this, GlobalContext* globalCtx) { switch (this->unk_2A8) { case 0: - targetYaw = Math_Atan2S(-(this->actor.posRot.pos.z - unk_28C->z), -(this->actor.posRot.pos.x - unk_28C->x)); + targetYaw = Math_Atan2S(-(this->actor.world.pos.z - unk_28C->z), -(this->actor.world.pos.x - unk_28C->x)); break; case 3: - targetYaw = Math_Atan2S(-(this->actor.posRot.pos.z - player->actor.posRot.pos.z), - -(this->actor.posRot.pos.x - player->actor.posRot.pos.x)); + targetYaw = Math_Atan2S(-(this->actor.world.pos.z - player->actor.world.pos.z), + -(this->actor.world.pos.x - player->actor.world.pos.x)); break; case 2: - targetYaw = Math_Atan2S(this->actor.posRot.pos.z - player->actor.posRot.pos.z, - this->actor.posRot.pos.x - player->actor.posRot.pos.x); + targetYaw = Math_Atan2S(this->actor.world.pos.z - player->actor.world.pos.z, + this->actor.world.pos.x - player->actor.world.pos.x); break; default: @@ -567,7 +567,7 @@ void func_80A03018(EnElf* this, GlobalContext* globalCtx) { } Math_SmoothStepToS(&this->unk_2BC, targetYaw, 10, this->unk_2AC, 0x20); - this->actor.posRot.rot.y = this->unk_2BC; + this->actor.world.rot.y = this->unk_2BC; Actor_MoveForward(&this->actor); } @@ -577,8 +577,8 @@ void func_80A03148(EnElf* this, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4) { f32 xzVelocity; f32 clampedXZ; - xVelTarget = ((arg1->x + this->unk_28C.x) - this->actor.posRot.pos.x) * arg4; - zVelTarget = ((arg1->z + this->unk_28C.z) - this->actor.posRot.pos.z) * arg4; + xVelTarget = ((arg1->x + this->unk_28C.x) - this->actor.world.pos.x) * arg4; + zVelTarget = ((arg1->z + this->unk_28C.z) - this->actor.world.pos.z) * arg4; arg4 += 0.3f; arg3 += 30.0f; @@ -627,10 +627,10 @@ void func_80A0329C(EnElf* this, GlobalContext* globalCtx) { } if (!Player_InCsMode(globalCtx)) { - heightDiff = this->actor.posRot.pos.y - refActor->actor.posRot.pos.y; + heightDiff = this->actor.world.pos.y - refActor->actor.world.pos.y; if ((heightDiff > 0.0f) && (heightDiff < 60.0f)) { - if (!func_80A01F90(&this->actor.posRot.pos, &refActor->actor.posRot.pos, 10.0f)) { + if (!func_80A01F90(&this->actor.world.pos, &refActor->actor.world.pos, 10.0f)) { Health_ChangeBy(globalCtx, 128); if (this->fairyFlags & FAIRY_FLAG_BIG) { Magic_Fill(globalCtx); @@ -676,7 +676,7 @@ void func_80A0353C(EnElf* this, GlobalContext* globalCtx) { parent = this->actor.parent; if ((parent != NULL) && (parent->update != NULL)) { - parentPos = this->actor.parent->posRot.pos; + parentPos = this->actor.parent->world.pos; parentPos.y += ((1500.0f * this->actor.scale.y) + 40.0f); func_80A02C98(this, &parentPos, 0.2f); } else { @@ -714,7 +714,7 @@ void func_80A03610(EnElf* this, GlobalContext* globalCtx) { this->unk_28C.z = Math_SinS(this->unk_2AC) * -this->unk_2B8; this->unk_2AC += this->unk_2B0; - func_80A02C98(this, &player->actor.posRot.pos, 0.2f); + func_80A02C98(this, &player->actor.world.pos, 0.2f); if (this->unk_2B4 < 0.0f) { if ((this->unk_28C.y < 20.0f) && (this->unk_28C.y > 0.0f)) { @@ -818,16 +818,16 @@ void EnElf_UpdateLights(EnElf* this, GlobalContext* globalCtx) { if (this->fairyFlags & 0x20) { player = PLAYER; - Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, player->actor.posRot.pos.x, - (s16)(player->actor.posRot.pos.y) + 60.0f, player->actor.posRot.pos.z, 255, 255, 255, + Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, player->actor.world.pos.x, + (s16)(player->actor.world.pos.y) + 60.0f, player->actor.world.pos.z, 255, 255, 255, 200); } else { - Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 255, -1); + Lights_PointNoGlowSetInfo(&this->lightInfoNoGlow, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 255, -1); } - Lights_PointGlowSetInfo(&this->lightInfoGlow, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 255, glowLightRadius); + Lights_PointGlowSetInfo(&this->lightInfoGlow, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 255, glowLightRadius); this->unk_2BC = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); @@ -855,7 +855,7 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { EnElf_SpawnSparkles(this, globalCtx, 16); } - prevPos = this->actor.posRot.pos; + prevPos = this->actor.world.pos; if (this->unk_2A8 == 0xA) { func_80A02EC0(this, &nextPos); @@ -873,11 +873,11 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { // play dash sound in intervals as Navi is waking up Link in the intro if (this->unk_2A8 == 6) { if (this->fairyFlags & 0x40) { - if (prevPos.y < this->actor.posRot.pos.y) { + if (prevPos.y < this->actor.world.pos.y) { this->fairyFlags &= ~0x40; } } else { - if (this->actor.posRot.pos.y < prevPos.y) { + if (this->actor.world.pos.y < prevPos.y) { this->fairyFlags |= 0x40; Audio_PlayActorSound2(&this->actor, NA_SE_EV_FAIRY_DASH); } @@ -885,12 +885,12 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { } } } else { - distFromLinksHead = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.posRot.pos); + distFromLinksHead = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.world.pos); switch (this->unk_2A8) { case 7: func_80A02C98(this, &player->bodyPartsPos[8], 1.0f - this->unk_2AE * 0.033333335f); - xScale = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.posRot.pos); + xScale = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.world.pos); if (distFromLinksHead < 7.0f) { this->unk_2C0 = 0; @@ -906,7 +906,7 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) { break; case 8: func_80A02C98(this, &player->bodyPartsPos[8], 0.2f); - this->actor.posRot.pos = player->bodyPartsPos[8]; + this->actor.world.pos = player->bodyPartsPos[8]; func_80A029A8(this, 1); break; case 11: @@ -1016,7 +1016,7 @@ void func_80A04414(EnElf* this, GlobalContext* globalCtx) { } else { if (this->unk_2C6 == 0) { if ((arrowPointedActor == NULL) || - (Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &globalCtx->actorCtx.targetCtx.naviRefPos) < 50.0f)) { + (Math_Vec3f_DistXYZ(&this->actor.world.pos, &globalCtx->actorCtx.targetCtx.naviRefPos) < 50.0f)) { this->unk_2C6 = 1; } } else if (this->unk_29C != 0.0f) { @@ -1039,10 +1039,11 @@ void func_80A04414(EnElf* this, GlobalContext* globalCtx) { } } else { if ((arrowPointedActor != NULL) && (player->unk_664 != NULL)) { - if (arrowPointedActor->type == ACTORTYPE_NPC) { + if (arrowPointedActor->category == ACTORCAT_NPC) { targetSound = NA_SE_VO_NAVY_HELLO; } else { - targetSound = (arrowPointedActor->type == ACTORTYPE_ENEMY) ? NA_SE_VO_NAVY_ENEMY : NA_SE_VO_NAVY_HEAR; + targetSound = + (arrowPointedActor->category == ACTORCAT_ENEMY) ? NA_SE_VO_NAVY_ENEMY : NA_SE_VO_NAVY_HEAR; } if (this->unk_2C7 == 0) { @@ -1088,7 +1089,7 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { if ((player->stateFlags1 & 0x400) || ((YREG(15) & 0x10) && func_800BC56C(globalCtx, 2))) { temp = 12; this->unk_2C0 = 100; - } else if ((arrowPointedActor == NULL) || (temp = 1, (arrowPointedActor->type == ACTORTYPE_NPC))) { + } else if ((arrowPointedActor == NULL) || (temp = 1, (arrowPointedActor->category == ACTORCAT_NPC))) { if (arrowPointedActor != NULL) { this->unk_2C0 = 100; player->stateFlags2 |= 0x100000; @@ -1170,8 +1171,8 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) { func_80A01C38(this, temp); if (temp == 11) { - this->unk_2B8 = Math_Vec3f_DistXZ(&player->bodyPartsPos[8], &this->actor.posRot.pos); - this->unk_2AC = Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->bodyPartsPos[8]); + this->unk_2B8 = Math_Vec3f_DistXZ(&player->bodyPartsPos[8], &this->actor.world.pos); + this->unk_2AC = Math_Vec3f_Yaw(&this->actor.world.pos, &player->bodyPartsPos[8]); } } } @@ -1187,9 +1188,9 @@ void EnElf_SpawnSparkles(EnElf* this, GlobalContext* globalCtx, s32 sparkleLife) Color_RGBA8 primColor; Color_RGBA8 envColor; - sparklePos.x = Rand_CenteredFloat(6.0f) + this->actor.posRot.pos.x; - sparklePos.y = (Rand_ZeroOne() * 6.0f) + this->actor.posRot.pos.y; - sparklePos.z = Rand_CenteredFloat(6.0f) + this->actor.posRot.pos.z; + sparklePos.x = Rand_CenteredFloat(6.0f) + this->actor.world.pos.x; + sparklePos.y = (Rand_ZeroOne() * 6.0f) + this->actor.world.pos.y; + sparklePos.z = Rand_CenteredFloat(6.0f) + this->actor.world.pos.z; primColor.r = this->innerColor.r; primColor.g = this->innerColor.g; @@ -1207,14 +1208,14 @@ void func_80A04D90(EnElf* this, GlobalContext* globalCtx) { s32 pad; s32 bgId; - this->actor.groundY = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &this->actor.floorPoly, &bgId, - &this->actor, &this->actor.posRot.pos); - this->actor.shape.unk_14 = 0x32; + this->actor.floorHeight = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &this->actor.floorPoly, &bgId, + &this->actor, &this->actor.world.pos); + this->actor.shape.shadowAlpha = 0x32; } // move to talk to player void func_80A04DE4(EnElf* this, GlobalContext* globalCtx) { - Vec3f posRot2Copy; + Vec3f headCopy; Player* player = PLAYER; Vec3f naviRefPos; @@ -1227,14 +1228,14 @@ void func_80A04DE4(EnElf* this, GlobalContext* globalCtx) { naviRefPos.z = player->bodyPartsPos[7].z + (Math_CosS(player->actor.shape.rot.y) * 20.0f); } - this->actor.posRot2.pos = naviRefPos; + this->actor.focus.pos = naviRefPos; this->fairyFlags &= ~0x10; } func_80A03AB0(this, globalCtx); - posRot2Copy = this->actor.posRot2.pos; + headCopy = this->actor.focus.pos; - func_80A03148(this, &posRot2Copy, 0, 20.0f, 0.2f); + func_80A03148(this, &headCopy, 0, 20.0f, 0.2f); if (this->actor.speedXZ >= 5.0f) { EnElf_SpawnSparkles(this, globalCtx, 16); @@ -1389,7 +1390,7 @@ void func_80A053F0(Actor* thisx, GlobalContext* globalCtx) { if (func_8002F194(thisx, globalCtx)) { func_800F4524(&D_801333D4, NA_SE_VO_SK_LAUGH, 0x20); - thisx->posRot2.pos = thisx->posRot.pos; + thisx->focus.pos = thisx->world.pos; if (thisx->textId == ElfMessage_GetCUpText(globalCtx)) { this->fairyFlags |= 0x80; 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 eb6c977b17..fea14a75bc 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -18,7 +18,7 @@ static f32 sLeeverDists[] = { 200.0f, 170.0f, 120.0f, 120.0f, 170.0f }; const ActorInit En_Encount1_InitVars = { ACTOR_EN_ENCOUNT1, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnEncount1), @@ -50,7 +50,7 @@ void EnEncount1_Init(Actor* thisx, GlobalContext* globalCtx) { this->maxCurSpawns = (this->actor.params >> 6) & 0x1F; this->maxTotalSpawns = this->actor.params & 0x3F; this->curNumSpawn = this->totalNumSpawn = 0; - spawnRange = 120.0f + (40.0f * this->actor.posRot.rot.z); + spawnRange = 120.0f + (40.0f * this->actor.world.rot.z); this->spawnRange = spawnRange; osSyncPrintf("\n\n"); @@ -105,14 +105,14 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, GlobalContext* globalCtx) { EnReeba* leever; this->outOfRangeTimer = 0; - spawnPos = this->actor.posRot.pos; + spawnPos = this->actor.world.pos; if ((this->timer == 0) && (globalCtx->csCtx.state == 0) && (this->curNumSpawn <= this->maxCurSpawns) && (this->curNumSpawn < 5)) { - floorType = func_80041D4C(&globalCtx->colCtx, player->actor.floorPoly, player->actor.floorPolySource); + floorType = func_80041D4C(&globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId); if ((floorType != 4) && (floorType != 7) && (floorType != 12)) { this->numLeeverSpawns = 0; - } else if (!(this->reduceLeevers && (this->actor.xzDistToLink > 1300.0f))) { + } else if (!(this->reduceLeevers && (this->actor.xzDistToPlayer > 1300.0f))) { spawnLimit = 5; if (this->reduceLeevers) { spawnLimit = 3; @@ -129,9 +129,9 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, GlobalContext* globalCtx) { spawnParams = LEEVER_BIG; } - spawnPos.x = player->actor.posRot.pos.x + Math_SinS(spawnAngle) * spawnDist; - spawnPos.y = player->actor.groundY + 120.0f; - spawnPos.z = player->actor.posRot.pos.z + Math_CosS(spawnAngle) * spawnDist; + spawnPos.x = player->actor.world.pos.x + Math_SinS(spawnAngle) * spawnDist; + spawnPos.y = player->actor.floorHeight + 120.0f; + spawnPos.z = player->actor.world.pos.z + Math_CosS(spawnAngle) * spawnDist; floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos); if (floorY <= BGCHECK_Y_MIN) { @@ -185,15 +185,15 @@ void EnEncount1_SpawnTektites(EnEncount1* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->timer = 10; - if ((fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) > 100.0f) || - (this->actor.xzDistToLink > this->spawnRange)) { + if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || + (this->actor.xzDistToPlayer > this->spawnRange)) { this->outOfRangeTimer++; } else { this->outOfRangeTimer = 0; if ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) { - spawnPos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(50.0f); - spawnPos.y = this->actor.posRot.pos.y + 120.0f; - spawnPos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(50.0f); + spawnPos.x = this->actor.world.pos.x + Rand_CenteredFloat(50.0f); + spawnPos.y = this->actor.world.pos.y + 120.0f; + spawnPos.z = this->actor.world.pos.z + Rand_CenteredFloat(50.0f); floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos); if (floorY <= BGCHECK_Y_MIN) { return; @@ -228,8 +228,8 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt f32 floorY; if (globalCtx->sceneNum != SCENE_SPOT00) { - if ((fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) > 100.0f) || - (this->actor.xzDistToLink > this->spawnRange)) { + if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || + (this->actor.xzDistToPlayer > this->spawnRange)) { this->outOfRangeTimer++; return; } @@ -239,11 +239,11 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt } this->outOfRangeTimer = 0; - spawnPos = this->actor.posRot.pos; + spawnPos = this->actor.world.pos; if ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) { while ((this->curNumSpawn < this->maxCurSpawns) && (this->totalNumSpawn < this->maxTotalSpawns)) { if (globalCtx->sceneNum == SCENE_SPOT00) { - if ((player->unk_89E == 0) || (player->actor.floorPolySource != 0x32) || + if ((player->unk_89E == 0) || (player->actor.floorBgId != BGCHECK_SCENE) || !(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & 0x08000000)) { this->fieldSpawnTimer = 60; @@ -264,16 +264,16 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt spawnDist = Rand_CenteredFloat(40.0f) + 100.0f; } spawnPos.x = - player->actor.posRot.pos.x + (Math_SinS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); - spawnPos.y = player->actor.groundY + 120.0f; + player->actor.world.pos.x + (Math_SinS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); + spawnPos.y = player->actor.floorHeight + 120.0f; spawnPos.z = - player->actor.posRot.pos.z + (Math_CosS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); + player->actor.world.pos.z + (Math_CosS(spawnAngle) * spawnDist) + Rand_CenteredFloat(40.0f); floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &floorPoly, &bgId, &this->actor, &spawnPos); if (floorY <= BGCHECK_Y_MIN) { break; } if ((player->actor.yDistToWater != BGCHECK_Y_MIN) && - (floorY < (player->actor.posRot.pos.y - player->actor.yDistToWater))) { + (floorY < (player->actor.world.pos.y - player->actor.yDistToWater))) { break; } spawnPos.y = floorY; @@ -327,13 +327,13 @@ void EnEncount1_Update(Actor* thisx, GlobalContext* globalCtx) { if (BREG(0) != 0) { if (this->outOfRangeTimer != 0) { if ((this->outOfRangeTimer & 1) == 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, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); } } else { - 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } 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 d1801e33d5..c2417432b6 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -13,7 +13,7 @@ extern UNK_TYPE D_06000DE0; /* const ActorInit En_Encount2_InitVars = { ACTOR_EN_ENCOUNT2, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EFC_STAR_FIELD, sizeof(EnEncount2), 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 1503588971..5ecb507643 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 @@ -35,7 +35,7 @@ void EnExItem_TargetPrizeFinish(EnExItem* this, GlobalContext* globalCtx); const ActorInit En_Ex_Item_InitVars = { ACTOR_EN_EX_ITEM, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnExItem), @@ -60,7 +60,7 @@ void EnExItem_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->type); // What will come out? osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->unusedParam); - this->initPos = this->actor.posRot.pos; + this->initPos = this->actor.world.pos; this->getItemObjId = -1; switch (this->type) { case EXITEM_BOMB_BAG_BOWLING: @@ -145,7 +145,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = -18.0f; + this->actor.shape.yOffset = -18.0f; } break; case EXITEM_HEART_PIECE_COUNTER: @@ -160,7 +160,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = -10.0f; + this->actor.shape.yOffset = -10.0f; } break; case EXITEM_BOMBCHUS_COUNTER: @@ -189,7 +189,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = 10.0f; + this->actor.shape.yOffset = 10.0f; } break; case EXITEM_PURPLE_RUPEE_BOWLING: @@ -205,7 +205,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.unk_08 = 40.0f; + this->actor.shape.yOffset = 40.0f; } break; case EXITEM_GREEN_RUPEE_CHEST: @@ -289,13 +289,13 @@ void EnExItem_BowlPrize(EnExItem* this, GlobalContext* globalCtx) { tmpf6 = (tmpf2 / tmpf4) * 5.0f; tmpf7 = (tmpf3 / tmpf4) * 5.0f; - tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.posRot.pos.x; - tmpf2 = globalCtx->view.eye.y + tmpf6 - this->actor.posRot.pos.y; - tmpf3 = globalCtx->view.eye.z + tmpf7 - this->actor.posRot.pos.z; + tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.world.pos.x; + tmpf2 = globalCtx->view.eye.y + tmpf6 - this->actor.world.pos.y; + tmpf3 = globalCtx->view.eye.z + tmpf7 - this->actor.world.pos.z; - this->actor.posRot.pos.x += (tmpf1 / tmpf4) * 5.0f; - this->actor.posRot.pos.y += (tmpf2 / tmpf4) * 5.0f; - this->actor.posRot.pos.z += (tmpf3 / tmpf4) * 5.0f; + this->actor.world.pos.x += (tmpf1 / tmpf4) * 5.0f; + this->actor.world.pos.y += (tmpf2 / tmpf4) * 5.0f; + this->actor.world.pos.z += (tmpf3 / tmpf4) * 5.0f; } } else { // parent @@ -312,7 +312,7 @@ void EnExItem_BowlPrize(EnExItem* this, GlobalContext* globalCtx) { } void EnExItem_SetupBowlCounter(EnExItem* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = 0x4268; + this->actor.world.rot.y = this->actor.shape.rot.y = 0x4268; this->actionFunc = EnExItem_BowlCounter; } @@ -372,13 +372,13 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) { tmpf6 = (tmpf2 / tmpf4) * 5.0f; tmpf7 = (tmpf3 / tmpf4) * 5.0f; - tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.posRot.pos.x; - tmpf2 = globalCtx->view.eye.y - 10.0f + tmpf6 - this->actor.posRot.pos.y; - tmpf3 = globalCtx->view.eye.z + 10.0f + tmpf7 - this->actor.posRot.pos.z; + tmpf1 = globalCtx->view.eye.x + tmpf5 - this->actor.world.pos.x; + tmpf2 = globalCtx->view.eye.y - 10.0f + tmpf6 - this->actor.world.pos.y; + tmpf3 = globalCtx->view.eye.z + 10.0f + tmpf7 - this->actor.world.pos.z; - this->actor.posRot.pos.x += (tmpf1 / tmpf4) * 5.0f; - this->actor.posRot.pos.y += (tmpf2 / tmpf4) * 5.0f; - this->actor.posRot.pos.z += (tmpf3 / tmpf4) * 5.0f; + this->actor.world.pos.x += (tmpf1 / tmpf4) * 5.0f; + this->actor.world.pos.y += (tmpf2 / tmpf4) * 5.0f; + this->actor.world.pos.z += (tmpf3 / tmpf4) * 5.0f; } } else { s32 itemId; 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 6a20193229..e875052898 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 @@ -31,7 +31,7 @@ static s16 sRupeeValues[] = { const ActorInit En_Ex_Ruppy_InitVars = { ACTOR_EN_EX_RUPPY, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnExRuppy), @@ -51,7 +51,7 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->type = this->actor.params; // "Index" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); switch (this->type) { case 0: @@ -101,10 +101,10 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { } } - this->actor.shape.unk_10 = 7.0f; - this->actor.shape.unk_08 = 700.0f; - this->unk_15A = this->actor.posRot.rot.z; - this->actor.posRot.rot.z = 0; + this->actor.shape.shadowScale = 7.0f; + this->actor.shape.yOffset = 700.0f; + this->unk_15A = this->actor.world.rot.z; + this->actor.world.rot.z = 0; this->timer = 30; this->actor.flags &= ~1; this->actionFunc = EnExRuppy_DropIntoWater; @@ -122,8 +122,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.0f; // "Wow Coin" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST); - this->actor.shape.unk_10 = 6.0f; - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.shadowScale = 6.0f; + this->actor.shape.yOffset = 700.0f; this->actor.flags &= ~1; this->actionFunc = EnExRuppy_WaitToBlowUp; break; @@ -144,8 +144,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.0f; // "Normal rupee" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST); - this->actor.shape.unk_10 = 6.0f; - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.shadowScale = 6.0f; + this->actor.shape.yOffset = 700.0f; this->actor.flags &= ~1; this->actionFunc = EnExRuppy_WaitAsCollectible; break; @@ -154,8 +154,8 @@ void EnExRuppy_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.0f; this->actor.flags &= ~1; Actor_SetScale(&this->actor, 0.01f); - this->actor.shape.unk_10 = 6.0f; - this->actor.shape.unk_08 = -700.0f; + this->actor.shape.shadowScale = 6.0f; + this->actor.shape.yOffset = -700.0f; this->actionFunc = EnExRuppy_GalleryTarget; break; } @@ -198,9 +198,9 @@ void EnExRuppy_SpawnSparkles(EnExRuppy* this, GlobalContext* globalCtx, s16 numS scale = 5000; life = 20; } - pos.x = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() - 0.5f) * 10.0f + (this->actor.posRot.pos.y + this->unk_160 * 600.0f); - pos.z = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.posRot.pos.z; + pos.x = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.world.pos.x; + pos.y = (Rand_ZeroOne() - 0.5f) * 10.0f + (this->actor.world.pos.y + this->unk_160 * 600.0f); + pos.z = (Rand_ZeroOne() - 0.5f) * 10.0f + this->actor.world.pos.z; EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, scale, life); } } @@ -230,15 +230,15 @@ void EnExRuppy_EnterWater(EnExRuppy* this, GlobalContext* globalCtx) { if ((divingGame != NULL) && (divingGame->actor.update != NULL) && (divingGame->unk_2A2 == 2)) { this->invisible = false; - this->actor.posRot.pos.x = ((Rand_ZeroOne() - 0.5f) * 300.0f) + -260.0f; - this->actor.posRot.pos.y = ((Rand_ZeroOne() - 0.5f) * 200.0f) + 370.0f; + this->actor.world.pos.x = ((Rand_ZeroOne() - 0.5f) * 300.0f) + -260.0f; + this->actor.world.pos.y = ((Rand_ZeroOne() - 0.5f) * 200.0f) + 370.0f; temp_f2 = this->unk_15A * -50.0f; if (!(gSaveContext.eventChkInf[3] & 0x100)) { temp_f2 += -500.0f; - this->actor.posRot.pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + temp_f2; + this->actor.world.pos.z = ((Rand_ZeroOne() - 0.5f) * 80.0f) + temp_f2; } else { temp_f2 += -300.0f; - this->actor.posRot.pos.z = ((Rand_ZeroOne() - 0.5f) * 60.0f) + temp_f2; + this->actor.world.pos.z = ((Rand_ZeroOne() - 0.5f) * 60.0f) + temp_f2; } this->actionFunc = EnExRuppy_Sink; this->actor.gravity = -1.0f; @@ -251,7 +251,7 @@ void EnExRuppy_Sink(EnExRuppy* this, GlobalContext* globalCtx) { s32 pad; if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f)) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += this->actor.yDistToWater; this->actor.velocity.y = -1.0f; this->actor.gravity = -0.2f; @@ -274,7 +274,7 @@ void EnExRuppy_WaitInGame(EnExRuppy* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->timer = 10; - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f); } if (this->actor.parent != NULL) { divingGame = (EnDivingGame*)this->actor.parent; @@ -283,7 +283,7 @@ void EnExRuppy_WaitInGame(EnExRuppy* this, GlobalContext* globalCtx) { this->timer = 20; this->actionFunc = EnExRuppy_Kill; if (1) {} - } else if (this->actor.xyzDistToLinkSq < SQ(localConst)) { + } else if (this->actor.xyzDistToPlayerSq < SQ(localConst)) { Rupees_ChangeBy(this->rupeeValue); func_80078884(NA_SE_SY_GET_RUPY); divingGame->unk_2A4++; @@ -320,7 +320,7 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, GlobalContext* globalCtx) { if (this->type == 2) { distToBlowUp = 30.0f; } - if (this->actor.xyzDistToLinkSq < SQ(distToBlowUp)) { + if (this->actor.xyzDistToPlayerSq < SQ(distToBlowUp)) { parent = (EnExRuppyParentActor*)this->actor.parent; if (parent != NULL) { if (parent->actor.update != NULL) { @@ -338,9 +338,9 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, GlobalContext* globalCtx) { explosionScale = 20; explosionScaleStep = 6; } - EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.posRot.pos, &velocity, &accel, explosionScale, + EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.world.pos, &velocity, &accel, explosionScale, explosionScaleStep); - func_8002F71C(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f); + func_8002F71C(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f); Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_Kill(&this->actor); } @@ -349,18 +349,18 @@ void EnExRuppy_WaitToBlowUp(EnExRuppy* this, GlobalContext* globalCtx) { void EnExRuppy_WaitAsCollectible(EnExRuppy* this, GlobalContext* globalCtx) { f32 localConst = 30.0f; - if (this->actor.xyzDistToLinkSq < SQ(localConst)) { + if (this->actor.xyzDistToPlayerSq < SQ(localConst)) { func_80078884(NA_SE_SY_GET_RUPY); - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, (sEnExRuppyCollectibleTypes[this->colorIdx] | 0x8000)); + Item_DropCollectible(globalCtx, &this->actor.world.pos, (sEnExRuppyCollectibleTypes[this->colorIdx] | 0x8000)); Actor_Kill(&this->actor); } } void EnExRuppy_GalleryTarget(EnExRuppy* this, GlobalContext* globalCtx) { if (this->galleryFlag) { - Math_ApproachF(&this->actor.shape.unk_08, 700.0f, 0.5f, 200.0f); + Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 0.5f, 200.0f); } else { - Math_ApproachF(&this->actor.shape.unk_08, -700.0f, 0.5f, 200.0f); + Math_ApproachF(&this->actor.shape.yOffset, -700.0f, 0.5f, 200.0f); } } @@ -373,7 +373,7 @@ void EnExRuppy_Update(Actor* thisx, GlobalContext* globalCtx) { this->timer--; } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); } UNK_PTR D_80A0B3B8[] = { 0x04042140, 0x04042160, 0x04042180, 0x040421C0, 0x040421A0 }; 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 3a4467f2d7..3ef5f0529a 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -32,7 +32,7 @@ extern FlexSkeletonHeader D_06005810; const ActorInit En_Fd_InitVars = { ACTOR_EN_FD, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FW, sizeof(EnFd), @@ -227,9 +227,9 @@ void EnFd_SpawnChildFire(EnFd* this, GlobalContext* globalCtx, s16 fireCnt, s16 s32 i; for (i = 0; i < fireCnt; i++) { - s16 angle = (s16)((((i * 360.0f) / fireCnt) * (0x10000 / 360.0f))) + this->actor.yawTowardsLink; - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FD_FIRE, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, angle, 0, (color << 0xF) | i); + s16 angle = (s16)((((i * 360.0f) / fireCnt) * (0x10000 / 360.0f))) + this->actor.yawTowardsPlayer; + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FD_FIRE, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, angle, 0, (color << 0xF) | i); } } @@ -239,9 +239,9 @@ void EnFd_SpawnDot(EnFd* this, GlobalContext* globalCtx) { Vec3f accel = { 0.0f, 0.0f, 0.0f }; if (this->actionFunc == EnFd_Run || this->actionFunc == EnFd_SpinAndSpawnFire) { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.groundY + 4.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.floorHeight + 4.0f; + pos.z = this->actor.world.pos.z; accel.x = (Rand_ZeroOne() - 0.5f) * 2.0f; accel.y = ((Rand_ZeroOne() - 0.5f) * 0.2f) + 0.3f; accel.z = (Rand_ZeroOne() - 0.5f) * 2.0f; @@ -256,8 +256,8 @@ s32 EnFd_CheckHammer(EnFd* this, GlobalContext* globalCtx) { if (this->actionFunc == EnFd_Reappear || this->actionFunc == EnFd_SpinAndGrow || this->actionFunc == EnFd_JumpToGround || this->actionFunc == EnFd_WaitForCore) { return false; - } else if (globalCtx->actorCtx.unk_02 != 0 && this->actor.xzDistToLink < 300.0f && - this->actor.yDistToLink < 60.0f) { + } else if (globalCtx->actorCtx.unk_02 != 0 && this->actor.xzDistToPlayer < 300.0f && + this->actor.yDistToPlayer < 60.0f) { return true; } else { return false; @@ -297,7 +297,7 @@ s32 EnFd_ColliderCheck(EnFd* this, GlobalContext* globalCtx) { } this->attackTimer = 30; Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); - func_8002F71C(globalCtx, &this->actor, this->actor.speedXZ + 2.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, this->actor.speedXZ + 2.0f, this->actor.yawTowardsPlayer, 6.0f); } return false; } @@ -315,18 +315,18 @@ s32 EnFd_CanSeeActor(EnFd* this, Actor* actor, GlobalContext* globalCtx) { s32 pad; // Check to see if `actor` is within 400 units of `this` - if (Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &actor->posRot.pos) > 400.0f) { + if (Math_Vec3f_DistXYZ(&this->actor.world.pos, &actor->world.pos) > 400.0f) { return false; } // Check to see if the angle between this facing angle and `actor` is withing ~40 degrees - angle = (f32)Math_Vec3f_Yaw(&this->actor.posRot.pos, &actor->posRot.pos) - this->actor.shape.rot.y; + angle = (f32)Math_Vec3f_Yaw(&this->actor.world.pos, &actor->world.pos) - this->actor.shape.rot.y; if (ABS(angle) > 0x1C70) { return false; } // check to see if the line between `this` and `actor` does not intersect a collision poly - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &actor->posRot.pos, &colPoint, &colPoly, 1, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &actor->world.pos, &colPoint, &colPoly, 1, 0, 0, 1, &bgId)) { return false; } @@ -335,7 +335,7 @@ s32 EnFd_CanSeeActor(EnFd* this, Actor* actor, GlobalContext* globalCtx) { } Actor* EnFd_FindBomb(EnFd* this, GlobalContext* globalCtx) { - Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (actor != NULL) { if (actor->params != 0 || actor->parent != NULL) { @@ -386,11 +386,11 @@ Vec3f* EnFd_GetPosAdjAroundCircle(Vec3f* dst, EnFd* this, f32 radius, s16 dir) { s16 angle; Vec3f newPos; - angle = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->actor.posRot.pos) + (dir * 0x1554); // ~30 degrees - newPos.x = (Math_SinS(angle) * radius) + this->actor.initPosRot.pos.x; - newPos.z = (Math_CosS(angle) * radius) + this->actor.initPosRot.pos.z; - newPos.x -= this->actor.posRot.pos.x; - newPos.z -= this->actor.posRot.pos.z; + angle = Math_Vec3f_Yaw(&this->actor.home.pos, &this->actor.world.pos) + (dir * 0x1554); // ~30 degrees + newPos.x = (Math_SinS(angle) * radius) + this->actor.home.pos.x; + newPos.z = (Math_CosS(angle) * radius) + this->actor.home.pos.z; + newPos.x -= this->actor.world.pos.x; + newPos.z -= this->actor.world.pos.z; *dst = newPos; return dst; } @@ -405,11 +405,11 @@ s32 EnFd_ShouldStopRunning(EnFd* this, GlobalContext* globalCtx, f32 radius, s16 // will result in a background collision EnFd_GetPosAdjAroundCircle(&pos, this, radius, *runDir); - pos.x += this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y; - pos.z += this->actor.posRot.pos.z; + pos.x += this->actor.world.pos.x; + pos.y = this->actor.world.pos.y; + pos.z += this->actor.world.pos.z; - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &pos, &colPoint, &poly, 1, 0, 0, 1, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &pos, &colPoint, &poly, 1, 0, 0, 1, &bgId)) { *runDir = -*runDir; return true; @@ -428,7 +428,7 @@ s32 EnFd_ShouldStopRunning(EnFd* this, GlobalContext* globalCtx, f32 radius, s16 void EnFd_Fade(EnFd* this, GlobalContext* globalCtx) { if (this->invincibilityTimer != 0) { Math_SmoothStepToF(&this->fadeAlpha, 0.0f, 0.3f, 10.0f, 0.0f); - this->actor.shape.unk_14 = this->fadeAlpha; + this->actor.shape.shadowAlpha = this->fadeAlpha; if (!(this->fadeAlpha >= 0.9f)) { this->invincibilityTimer = 0; this->spinTimer = 0; @@ -442,7 +442,7 @@ void EnFd_Init(Actor* thisx, GlobalContext* globalCtx) { EnFd* this = THIS; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06005810, NULL, this->jointTable, this->morphTable, 27); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 32.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 32.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colSphs); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit); @@ -463,9 +463,9 @@ void EnFd_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnFd_Reappear(EnFd* this, GlobalContext* globalCtx) { - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; this->actor.params = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->coreActive = false; this->actor.scale.y = 0.0f; this->fadeAlpha = 255.0f; @@ -478,7 +478,7 @@ void EnFd_SpinAndGrow(EnFd* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->actor.velocity.y = 6.0f; this->actor.scale.y = 0.01f; - this->actor.posRot.rot.y ^= 0x8000; + this->actor.world.rot.y ^= 0x8000; this->actor.flags |= 1; this->actor.speedXZ = 8.0f; func_80034EC0(&this->skelAnime, sAnimations, 1); @@ -486,7 +486,7 @@ void EnFd_SpinAndGrow(EnFd* this, GlobalContext* globalCtx) { } else { this->actor.scale.y = this->skelAnime.curFrame * (0.01f / this->skelAnime.animLength); this->actor.shape.rot.y += 0x2000; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } } @@ -494,7 +494,7 @@ void EnFd_JumpToGround(EnFd* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 1) && !(this->actor.velocity.y > 0.0f)) { this->actor.velocity.y = 0.0f; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; func_80034EC0(&this->skelAnime, sAnimations, 2); this->actionFunc = EnFd_Land; } @@ -506,9 +506,9 @@ void EnFd_Land(EnFd* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->skelAnime.playSpeed, 1.0f, 0.1f, 1.0f, 0.0f); if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { this->spinTimer = Rand_S16Offset(60, 90); - this->runRadius = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->runRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); EnFd_GetPosAdjAroundCircle(&adjPos, this, this->runRadius, this->runDir); - this->actor.posRot.rot.y = Math_FAtan2F(adjPos.x, adjPos.z) * (0x8000 / M_PI); + this->actor.world.rot.y = Math_FAtan2F(adjPos.x, adjPos.z) * (0x8000 / M_PI); func_80034EC0(&this->skelAnime, sAnimations, 4); this->actionFunc = EnFd_SpinAndSpawnFire; } @@ -528,7 +528,7 @@ void EnFd_SpinAndSpawnFire(EnFd* this, GlobalContext* globalCtx) { if (DECR(this->spinTimer) != 0) { this->actor.shape.rot.y += (this->runDir * 0x2000); if (this->spinTimer == 30 && this->invincibilityTimer == 0) { - if (this->actor.xzDistToLink > 160.0f) { + if (this->actor.xzDistToPlayer > 160.0f) { // orange flames EnFd_SpawnChildFire(this, globalCtx, 8, 0); } else { @@ -538,7 +538,7 @@ void EnFd_SpinAndSpawnFire(EnFd* this, GlobalContext* globalCtx) { } } else { // slow shape rotation down to meet `this` rotation within ~1.66 degrees - deceleration = this->actor.posRot.rot.y; + deceleration = this->actor.world.rot.y; deceleration -= this->actor.shape.rot.y; rotSpeed = 0.0f; tgtSpeed = fabsf(deceleration); @@ -549,11 +549,11 @@ void EnFd_SpinAndSpawnFire(EnFd* this, GlobalContext* globalCtx) { rotSpeed = fabsf(rotSpeed); if ((s32)rotSpeed <= 300) { // ~1.6 degrees - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } - if (this->actor.shape.rot.y == this->actor.posRot.rot.y) { - this->initYawToInitPos = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + if (this->actor.shape.rot.y == this->actor.world.rot.y) { + this->initYawToInitPos = Math_Vec3f_Yaw(&this->actor.home.pos, &this->actor.world.pos); this->curYawToInitPos = this->runDir < 0 ? 0xFFFF : 0; this->circlesToComplete = (globalCtx->state.frames & 7) + 2; this->spinTimer = Rand_S16Offset(30, 120); @@ -576,7 +576,7 @@ void EnFd_Run(EnFd* this, GlobalContext* globalCtx) { if (EnFd_ShouldStopRunning(this, globalCtx, this->runRadius, &this->runDir)) { if (this->invincibilityTimer == 0) { - this->actor.posRot.rot.y ^= 0x8000; + this->actor.world.rot.y ^= 0x8000; this->actor.velocity.y = 6.0f; this->actor.speedXZ = 0.0f; func_80034EC0(&this->skelAnime, sAnimations, 1); @@ -585,7 +585,7 @@ void EnFd_Run(EnFd* this, GlobalContext* globalCtx) { } } - yawToYawTarget = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &this->actor.posRot.pos) - this->initYawToInitPos; + yawToYawTarget = Math_Vec3f_Yaw(&this->actor.home.pos, &this->actor.world.pos) - this->initYawToInitPos; if (this->runDir > 0) { if ((u16)this->curYawToInitPos > (u16)(yawToYawTarget)) { this->circlesToComplete--; @@ -603,14 +603,14 @@ void EnFd_Run(EnFd* this, GlobalContext* globalCtx) { // the distance to that threat, otherwise default to 200. potentialThreat = EnFd_FindPotentialTheat(this, globalCtx); if ((potentialThreat != NULL) && (this->invincibilityTimer == 0)) { - runRadiusTarget = Math_Vec3f_DistXYZ(&this->actor.initPosRot.pos, &potentialThreat->posRot.pos); + runRadiusTarget = Math_Vec3f_DistXYZ(&this->actor.home.pos, &potentialThreat->world.pos); } else { runRadiusTarget = 200.0f; } Math_SmoothStepToF(&this->runRadius, runRadiusTarget, 0.3f, 100.0f, 0.0f); EnFd_GetPosAdjAroundCircle(&adjPos, this, this->runRadius, this->runDir); Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(adjPos.x, adjPos.z) * (0x8000 / M_PI), 4, 0xFA0, 1); - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; func_8002F974(&this->actor, NA_SE_EN_FLAME_RUN - SFX_FLAG); if (this->skelAnime.curFrame == 6.0f || this->skelAnime.curFrame == 13.0f || this->skelAnime.curFrame == 28.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLAME_KICK); @@ -665,7 +665,7 @@ void EnFd_Update(Actor* thisx, GlobalContext* globalCtx) { EnFd_ColliderCheck(this, globalCtx); } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); EnFd_Fade(this, globalCtx); this->actionFunc(this, globalCtx); EnFd_UpdateDots(this); @@ -714,7 +714,7 @@ void EnFd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } if (limbIndex == 13) { - Matrix_MultVec3f(&initialPos, &this->actor.posRot2.pos); + Matrix_MultVec3f(&initialPos, &this->actor.focus.pos); } if (limbIndex == 3 || limbIndex == 6 || limbIndex == 7 || limbIndex == 10 || limbIndex == 14 || limbIndex == 15 || 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 89cfb3ba72..402342c886 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 @@ -17,7 +17,7 @@ extern Gfx D_0404D4E0[]; const ActorInit En_Fd_Fire_InitVars = { ACTOR_EN_FD_FIRE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(EnFdFire), @@ -86,9 +86,9 @@ static DamageTable sDamageTable = { void EnFdFire_UpdatePos(EnFdFire* this, Vec3f* targetPos) { f32 dist; - f32 xDiff = targetPos->x - this->actor.posRot.pos.x; - f32 yDiff = targetPos->y - this->actor.posRot.pos.y; - f32 zDiff = targetPos->z - this->actor.posRot.pos.z; + f32 xDiff = targetPos->x - this->actor.world.pos.x; + f32 yDiff = targetPos->y - this->actor.world.pos.y; + f32 zDiff = targetPos->z - this->actor.world.pos.z; dist = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff)); if (fabsf(dist) > fabsf(this->actor.speedXZ)) { @@ -127,7 +127,7 @@ void EnFdFire_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInit); @@ -135,7 +135,7 @@ void EnFdFire_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -0.6f; this->actor.speedXZ = 5.0f; this->actor.velocity.y = 12.0f; - this->spawnRadius = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &player->actor.posRot.pos); + this->spawnRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &player->actor.world.pos); this->scale = 3.0f; this->tile2Y = (s16)Rand_ZeroFloat(5.0f) - 25; this->actionFunc = func_80A0E70C; @@ -149,10 +149,10 @@ void EnFdFire_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80A0E70C(EnFdFire* this, GlobalContext* globalCtx) { Vec3f velocity = { 0.0f, 0.0f, 0.0f }; - Vec3f targetPos = this->actor.parent->posRot.pos; + Vec3f targetPos = this->actor.parent->world.pos; - targetPos.x += this->spawnRadius * Math_SinS(this->actor.posRot.rot.y); - targetPos.z += this->spawnRadius * Math_CosS(this->actor.posRot.rot.y); + targetPos.x += this->spawnRadius * Math_SinS(this->actor.world.rot.y); + targetPos.z += this->spawnRadius * Math_CosS(this->actor.world.rot.y); EnFdFire_UpdatePos(this, &targetPos); if (this->actor.bgCheckFlags & 1 && (!(this->actor.velocity.y > 0.0f))) { this->actor.velocity = velocity; @@ -183,14 +183,14 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, GlobalContext* globalCtx) { s16 idx; idx = ((globalCtx->state.frames / 10) + (this->actor.params & 0x7FFF)) % ARRAY_COUNT(angles); - pos = player->actor.posRot.pos; + pos = player->actor.world.pos; pos.x += 120.0f * sinf(angles[idx]); pos.z += 120.0f * cosf(angles[idx]); if (DECR(this->deathTimer) == 0) { this->actionFunc = EnFdFire_Disappear; } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_Vec3f_Yaw(&this->actor.posRot.pos, &pos), 8, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &pos), 8, 0xFA0, 1); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.4f, 1.0f, 0.0f); if (this->actor.speedXZ < 0.1f) { this->actor.speedXZ = 5.0f; @@ -203,8 +203,8 @@ void EnFdFire_Disappear(EnFdFire* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.6f, 9.0f, 0.0f); func_8002D868(&this->actor); Math_SmoothStepToF(&this->scale, 0.0f, 0.3f, 0.1f, 0.0f); - this->actor.shape.unk_10 = 20.0f; - this->actor.shape.unk_10 *= (this->scale / 3.0f); + this->actor.shape.shadowScale = 20.0f; + this->actor.shape.shadowScale *= (this->scale / 3.0f); if (!(this->scale > 0.01f)) { Actor_Kill(&this->actor); } @@ -222,7 +222,7 @@ void EnFdFire_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002D7EC(&this->actor); this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 12.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 12.0f, 10.0f, 0.0f, 5); if (this->actionFunc != EnFdFire_Disappear) { Collider_UpdateCylinder(&this->actor, &this->collider); @@ -251,7 +251,7 @@ void EnFdFire_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_fd_fire.c", 572); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); sp8E = Math_Vec3f_Yaw(&scale, &this->actor.velocity) - Camera_GetCamDirYaw(ACTIVE_CAM); sp84 = fabsf(Math_CosS(sp8E)); sp88 = Math_SinS(sp8E); 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 ffd4615c39..0eb4519f73 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 @@ -37,7 +37,7 @@ extern Gfx D_06012160[]; const ActorInit En_Fhg_Fire_InitVars = { 0, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FHG, sizeof(EnFhgFire), @@ -72,7 +72,7 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { Audio_PlayActorSound2(thisx, NA_SE_EN_FANTOM_THUNDER); } else if (thisx->params >= 0x64) { EnFhgFire_SetupAction(this, func_80A0FA90); - thisx->shape.rot = thisx->posRot.rot; + thisx->shape.rot = thisx->world.rot; } if (thisx->params == 0x23) { @@ -90,7 +90,7 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_150.y = 0x32; this->unk_1FE = 0x0A; - tempf2 = thisx->posRot.rot.x; + tempf2 = thisx->world.rot.x; this->unk_18C = tempf2 / 100.0f; tempf1 = tempf2 * 0.13f; @@ -105,8 +105,8 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("yari hikari ct 1\n"); EnFhgFire_SetupAction(this, func_80A10008); osSyncPrintf("yari hikari ct 2\n"); - this->unk_150.x = thisx->posRot.rot.x; - this->fireMode = thisx->posRot.rot.y; + this->unk_150.x = thisx->world.rot.x; + this->fireMode = thisx->world.rot.y; return; } @@ -128,23 +128,23 @@ void EnFhgFire_Init(Actor* thisx, GlobalContext* globalCtx) { } if (thisx->params == 0x32) { - thisx->speedXZ = (thisx->posRot.rot.x == 0) ? 8.0f : 3.0f; + thisx->speedXZ = (thisx->world.rot.x == 0) ? 8.0f : 3.0f; EnFhgFire_SetupAction(this, func_80A10220); this->unk_150.x = 0x46; this->unk_150.y = 0x02; - tempf1 = player->actor.posRot.pos.x - thisx->posRot.pos.x; - tempf2 = player->actor.posRot.pos.y + 30.0f - thisx->posRot.pos.y; - tempf3 = player->actor.posRot.pos.z - thisx->posRot.pos.z; - thisx->posRot.rot.y = Math_FAtan2F(tempf1, tempf3) * 10430.378f; // 65536/(2*M_PI) + tempf1 = player->actor.world.pos.x - thisx->world.pos.x; + tempf2 = player->actor.world.pos.y + 30.0f - thisx->world.pos.y; + tempf3 = player->actor.world.pos.z - thisx->world.pos.z; + thisx->world.rot.y = Math_FAtan2F(tempf1, tempf3) * 10430.378f; // 65536/(2*M_PI) tempf0 = sqrtf(SQ(tempf1) + SQ(tempf3)); - thisx->posRot.rot.x = Math_FAtan2F(tempf2, tempf0) * 10430.378f; // 65536/(2*M_PI) + thisx->world.rot.x = Math_FAtan2F(tempf2, tempf0) * 10430.378f; // 65536/(2*M_PI) this->collider.dim.radius = 40; this->collider.dim.height = 50; this->collider.dim.yShift = -25; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointNoGlowSetInfo(&this->lightInfo, thisx->posRot.pos.x, thisx->posRot.pos.y, thisx->posRot.pos.z, 255, + Lights_PointNoGlowSetInfo(&this->lightInfo, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 255, 255, 255, 0xFF); } } @@ -187,11 +187,11 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) { this->fireMode = 0x0B; this->actor.shape.rot.z += 0x8000; this->unk_150.x = 0x25; - this->actor.posRot.pos.y -= 200.0f; + this->actor.world.pos.y -= 200.0f; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 500, 0, - 0, 0x24); + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 500, 0, 0, + 0x24); ballAccel = D_80A117BC; @@ -200,7 +200,7 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) { ballVelocity.y = Rand_ZeroFloat(5.0f) + 3.0f; ballVelocity.z = Rand_CenteredFloat(30.f); ballAccel.y = -0.2f; - EffectSsFhgFlash_SpawnLightBall(globalCtx, &this->actor.posRot.pos, &ballVelocity, &ballAccel, + EffectSsFhgFlash_SpawnLightBall(globalCtx, &this->actor.world.pos, &ballVelocity, &ballAccel, (s16)(Rand_ZeroOne() * 100.0f) + 240, FHGFLASH_LIGHTBALL_GREEN); } @@ -218,13 +218,13 @@ void func_80A0F6F8(EnFhgFire* this, GlobalContext* globalCtx) { for (i = 0; i < 8; i++) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, (i * 8192) + randY, 0x4000, i + 0x64); } for (i = 0; i < 8; i++) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_FHG_FIRE, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, (i * 8192) + randY, 0, 0x23); } } @@ -251,8 +251,8 @@ void func_80A0FA90(EnFhgFire* this, GlobalContext* globalCtx) { if (this->unk_150.x == 0) { this->fireMode = 0x02; this->unk_150.x = 0x0A; - this->actor.posRot.pos.z += Math_SinS(this->actor.shape.rot.y) * -200.0f * this->scale; - this->actor.posRot.pos.x += Math_CosS(this->actor.shape.rot.y) * 200.0f * this->scale; + this->actor.world.pos.z += Math_SinS(this->actor.shape.rot.y) * -200.0f * this->scale; + this->actor.world.pos.x += Math_CosS(this->actor.shape.rot.y) * 200.0f * this->scale; this->actor.shape.rot.y += 0x8000; } break; @@ -282,7 +282,7 @@ void func_80A0FC48(EnFhgFire* this, GlobalContext* globalCtx) { } if (Rand_ZeroOne() < 0.5f) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y -= 20.0f; EffectSsFhgFlash_SpawnShock(globalCtx, &this->actor, &pos, 200, FHGFLASH_SHOCK_NO_ACTOR); } @@ -293,7 +293,7 @@ void func_80A0FC48(EnFhgFire* this, GlobalContext* globalCtx) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 1); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 1); if (this->actor.bgCheckFlags & 8) { Actor_Kill(&this->actor); } @@ -361,7 +361,7 @@ void func_80A0FD8C(EnFhgFire* this, GlobalContext* globalCtx) { // Related to scene draw config 30, only used in BossGanon_Update and // loaded in z_kankyo D_8015FCF0 = this->unk_1FC; - D_8015FCF8 = this->actor.posRot.pos; + D_8015FCF8 = this->actor.world.pos; D_8015FD06 = this->unk_200; D_8015FD08 = 10.0f; D_8015FD0C = 0; @@ -379,7 +379,7 @@ void func_80A10008(EnFhgFire* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 5.25f); } - this->actor.posRot.pos = horse->unk_200; + this->actor.world.pos = horse->unk_200; this->actor.shape.rot.z += (s16)(Rand_ZeroOne() * 20000.0f) + 0x4000; osSyncPrintf("yari hikari 2\n"); @@ -391,9 +391,9 @@ void func_80A10008(EnFhgFire* this, GlobalContext* globalCtx) { osSyncPrintf("FLASH !!\n"); for (i = 0; i < 2; i++) { - ballPos.x = Rand_CenteredFloat(20.0f) + this->actor.posRot.pos.x; - ballPos.y = Rand_CenteredFloat(20.0f) + this->actor.posRot.pos.y; - ballPos.z = Rand_CenteredFloat(20.0f) + this->actor.posRot.pos.z; + ballPos.x = Rand_CenteredFloat(20.0f) + this->actor.world.pos.x; + ballPos.y = Rand_CenteredFloat(20.0f) + this->actor.world.pos.y; + ballPos.z = Rand_CenteredFloat(20.0f) + this->actor.world.pos.z; ballAccel.y = -0.08f; EffectSsFhgFlash_SpawnLightBall(globalCtx, &ballPos, &ballVelocity, &ballAccel, 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 4b0d8fb6dd..687e43f049 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 @@ -14,7 +14,7 @@ extern UNK_TYPE D_06000DE0; /* const ActorInit En_Fire_Rock_InitVars = { ACTOR_EN_FIRE_ROCK, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EFC_STAR_FIELD, sizeof(EnFireRock), 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 55e6a64f6e..c88c732c7c 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -31,7 +31,7 @@ typedef enum { const ActorInit En_Firefly_InitVars = { ACTOR_EN_FIREFLY, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FIREFLY, sizeof(EnFirefly), @@ -106,9 +106,9 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -500, ICHAIN_CONTINUE), - ICHAIN_F32(minVelocityY, -4, ICHAIN_CONTINUE), ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 4000, ICHAIN_STOP), + ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -500, ICHAIN_CONTINUE), + ICHAIN_F32(minVelocityY, -4, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 4000, ICHAIN_STOP), }; extern SkeletonHeader D_060018B8; @@ -139,7 +139,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { EnFirefly* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->jointTable, this->morphTable, 28); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); @@ -164,7 +164,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.shape.rot.x = 0x1554; this->auraType = KEESE_AURA_FIRE; this->actor.naviEnemyId = 0x11; // Fire Keese - this->maxAltitude = this->actor.initPosRot.pos.y; + this->maxAltitude = this->actor.home.pos.y; } else { if (this->actor.params == KEESE_NORMAL_PERCH) { this->actionFunc = EnFirefly_Perch; @@ -180,7 +180,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.naviEnemyId = 0x12; // Keese } - this->maxAltitude = this->actor.initPosRot.pos.y + 100.0f; + this->maxAltitude = this->actor.home.pos.y + 100.0f; if (this->actor.params == KEESE_ICE_FLY) { this->auraType = KEESE_AURA_ICE; @@ -201,8 +201,8 @@ void EnFirefly_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnFirefly_SetupWait(EnFirefly* this) { this->timer = Rand_S16Offset(70, 100); this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f; - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x300); - this->targetPitch = ((this->maxAltitude < this->actor.posRot.pos.y) ? 0xC00 : -0xC00) + 0x1554; + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); + this->targetPitch = ((this->maxAltitude < this->actor.world.pos.y) ? 0xC00 : -0xC00) + 0x1554; this->skelAnime.playSpeed = 1.0f; this->actionFunc = EnFirefly_FlyIdle; } @@ -224,7 +224,7 @@ void EnFirefly_SetupDie(EnFirefly* this) { } void EnFirefly_SetupRebound(EnFirefly* this) { - this->actor.posRot.rot.x = 0x7000; + this->actor.world.rot.x = 0x7000; this->timer = 18; this->skelAnime.playSpeed = 1.0f; this->actor.speedXZ = 2.5f; @@ -234,7 +234,7 @@ void EnFirefly_SetupRebound(EnFirefly* this) { void EnFirefly_SetupDiveAttack(EnFirefly* this) { this->timer = Rand_S16Offset(70, 100); this->skelAnime.playSpeed = 1.0f; - this->targetPitch = ((this->actor.yDistToLink > 0.0f) ? -0xC00 : 0xC00) + 0x1554; + this->targetPitch = ((this->actor.yDistToPlayer > 0.0f) ? -0xC00 : 0xC00) + 0x1554; this->actionFunc = EnFirefly_DiveAttack; } @@ -266,9 +266,9 @@ void EnFirefly_SetupFrozenFall(EnFirefly* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_DEAD); for (i = 0; i <= 7; i++) { - iceParticlePos.x = (i & 1 ? 7.0f : -7.0f) + this->actor.posRot.pos.x; - iceParticlePos.y = (i & 2 ? 7.0f : -7.0f) + this->actor.posRot.pos.y; - iceParticlePos.z = (i & 4 ? 7.0f : -7.0f) + this->actor.posRot.pos.z; + iceParticlePos.x = (i & 1 ? 7.0f : -7.0f) + this->actor.world.pos.x; + iceParticlePos.y = (i & 2 ? 7.0f : -7.0f) + this->actor.world.pos.y; + iceParticlePos.z = (i & 4 ? 7.0f : -7.0f) + this->actor.world.pos.z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &iceParticlePos, 150, 150, 150, 250, 235, 245, 255, (Rand_ZeroOne() * 0.15f) + 0.85f); } @@ -285,7 +285,7 @@ void EnFirefly_SetupPerch(EnFirefly* this) { void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) { this->skelAnime.playSpeed = 3.0f; this->actor.shape.rot.x = 0x1554; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 3.0f; this->timer = 50; this->actionFunc = EnFirefly_DisturbDiveAttack; @@ -299,8 +299,8 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, GlobalContext* globalCtx) { return 0; } - if (func_8002DBB0(&player->actor, &this->actor.initPosRot.pos) > 300.0f) { - distFromHome = func_8002DB6C(&this->actor, &this->actor.initPosRot.pos); + if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) > 300.0f) { + distFromHome = Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos); if (distFromHome < 5.0f) { EnFirefly_SetupPerch(this); @@ -313,9 +313,10 @@ s32 EnFirefly_ReturnToPerch(EnFirefly* this, GlobalContext* globalCtx) { this->actor.speedXZ *= distFromHome; } - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &this->actor.initPosRot.pos) + 0x1554, - 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.x, + Actor_WorldPitchTowardPoint(&this->actor, &this->actor.home.pos) + 0x1554, 0x100); return 1; } @@ -329,13 +330,13 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, GlobalContext* globalCtx) { f32 currentMinDist; Vec3f flamePos; - findTorch = (ObjSyokudai*)globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + findTorch = (ObjSyokudai*)globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; closestTorch = NULL; currentMinDist = 35000.0f; while (findTorch != NULL) { if ((findTorch->actor.id == ACTOR_OBJ_SYOKUDAI) && (findTorch->litTimer != 0)) { - torchDist = func_8002DB48(&this->actor, &findTorch->actor); + torchDist = Actor_WorldDistXYZToActor(&this->actor, &findTorch->actor); if (torchDist < currentMinDist) { currentMinDist = torchDist; closestTorch = findTorch; @@ -345,15 +346,17 @@ s32 EnFirefly_SeekTorch(EnFirefly* this, GlobalContext* globalCtx) { } if (closestTorch != NULL) { - flamePos.x = closestTorch->actor.posRot.pos.x; - flamePos.y = closestTorch->actor.posRot.pos.y + 52.0f + 15.0f; - flamePos.z = closestTorch->actor.posRot.pos.z; - if (func_8002DB6C(&this->actor, &flamePos) < 15.0f) { + flamePos.x = closestTorch->actor.world.pos.x; + flamePos.y = closestTorch->actor.world.pos.y + 52.0f + 15.0f; + flamePos.z = closestTorch->actor.world.pos.z; + if (Actor_WorldDistXYZToPoint(&this->actor, &flamePos) < 15.0f) { EnFirefly_Ignite(this); return 1; } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, &closestTorch->actor), 0x300); - Math_ScaledStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &flamePos) + 0x1554, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, &closestTorch->actor), + 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &flamePos) + 0x1554, + 0x100); return 1; } } @@ -375,16 +378,16 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) { if (skelanimeUpdated) { rand = Rand_ZeroOne(); if (rand < 0.5f) { - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), - 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, + Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), 0x300); } else if (rand < 0.8f) { this->actor.shape.rot.y += Rand_CenteredFloat(1536.0f); } // Climb if too close to ground - if (this->actor.posRot.pos.y < (this->actor.groundY + 20.0f)) { + if (this->actor.world.pos.y < (this->actor.floorHeight + 20.0f)) { this->targetPitch = 0x954; // Descend if above maxAltitude - } else if (this->maxAltitude < this->actor.posRot.pos.y) { + } else if (this->maxAltitude < this->actor.world.pos.y) { this->targetPitch = 0x2154; // Otherwise ascend or descend at random, biased towards ascending } else if (0.35f < Rand_ZeroOne()) { @@ -395,16 +398,17 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) { } else { if (this->actor.bgCheckFlags & 1) { this->targetPitch = 0x954; - } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.posRot.pos.y)) { + } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; } } Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } if (this->actor.bgCheckFlags & 8) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallPolyRot, 2, 0xC00, 0x300); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } - if ((this->timer == 0) && (this->actor.xzDistToLink < 200.0f) && (Player_GetMask(globalCtx) != PLAYER_MASK_SKULL)) { + if ((this->timer == 0) && (this->actor.xzDistToPlayer < 200.0f) && + (Player_GetMask(globalCtx) != PLAYER_MASK_SKULL)) { EnFirefly_SetupDiveAttack(this); } } @@ -414,11 +418,11 @@ void EnFirefly_Fall(EnFirefly* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 6.0f)) { this->skelAnime.playSpeed = 0.0f; } - this->actor.dmgEffectTimer = 40; + this->actor.colorFilterTimer = 40; SkelAnime_Update(&this->skelAnime); Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); if (this->actor.flags & 0x8000) { - this->actor.dmgEffectTimer = 40; + this->actor.colorFilterTimer = 40; } else { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x6800, 0x200); this->actor.shape.rot.y = this->actor.shape.rot.y - 0x300; @@ -439,7 +443,7 @@ void EnFirefly_Die(EnFirefly* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.scale.x, 0.0f, 0.00034f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; if (this->timer == 0) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); Actor_Kill(&this->actor); } } @@ -455,27 +459,28 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) { } Math_StepToF(&this->actor.speedXZ, 4.0f, 0.5f); if (this->actor.bgCheckFlags & 8) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallPolyRot, 2, 0xC00, 0x300); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } else if (func_8002E084(&this->actor, 0x2800)) { if (Animation_OnFrame(&this->skelAnime, 4.0f)) { this->skelAnime.playSpeed = 0.0f; this->skelAnime.curFrame = 4.0f; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xC00, 0x300); - preyPos.x = player->actor.posRot.pos.x; - preyPos.y = player->actor.posRot.pos.y + 20.0f; - preyPos.z = player->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &preyPos) + 0x1554, 2, 0x400, 0x100); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300); + preyPos.x = player->actor.world.pos.x; + preyPos.y = player->actor.world.pos.y + 20.0f; + preyPos.z = player->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, 2, + 0x400, 0x100); } else { this->skelAnime.playSpeed = 1.5f; - if (this->actor.xzDistToLink > 80.0f) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xC00, 0x300); + if (this->actor.xzDistToPlayer > 80.0f) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xC00, 0x300); } if (this->actor.bgCheckFlags & 1) { this->targetPitch = 0x954; } - if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.posRot.pos.y)) { + if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; } else { this->targetPitch = 0x954; @@ -507,8 +512,8 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; } - if (((fabsf(this->actor.posRot.pos.y - this->maxAltitude) < 10.0f) && - (Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos) < 20.0f)) || + if (((fabsf(this->actor.world.pos.y - this->maxAltitude) < 10.0f) && + (Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) < 20.0f)) || (this->timer == 0)) { EnFirefly_SetupWait(this); return; @@ -516,15 +521,16 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 3.0f, 0.3f); if (this->actor.bgCheckFlags & 1) { this->targetPitch = 0x954; - } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.posRot.pos.y)) { + } else if ((this->actor.bgCheckFlags & 0x10) || (this->maxAltitude < this->actor.world.pos.y)) { this->targetPitch = 0x2154; } else { this->targetPitch = 0x954; } if (this->actor.bgCheckFlags & 8) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallPolyRot, 2, 0xC00, 0x300); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallYaw, 2, 0xC00, 0x300); } else { - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x300); + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x300); } Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100); } @@ -547,11 +553,11 @@ void EnFirefly_Stunned(EnFirefly* this, GlobalContext* globalCtx) { } void EnFirefly_FrozenFall(EnFirefly* this, GlobalContext* globalCtx) { - if ((this->actor.bgCheckFlags & 1) || (this->actor.groundY == BGCHECK_Y_MIN)) { - this->actor.dmgEffectTimer = 0; + if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight == BGCHECK_Y_MIN)) { + this->actor.colorFilterTimer = 0; EnFirefly_SetupDie(this); } else { - this->actor.dmgEffectTimer = 255; + this->actor.colorFilterTimer = 255; } } @@ -568,7 +574,7 @@ void EnFirefly_Perch(EnFirefly* this, GlobalContext* globalCtx) { this->timer = 1; } - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { EnFirefly_SetupDisturbDiveAttack(this); } } @@ -585,11 +591,12 @@ void EnFirefly_DisturbDiveAttack(EnFirefly* this, GlobalContext* globalCtx) { if (this->timer < 40) { Math_ScaledStepToS(&this->actor.shape.rot.x, -0xAAC, 0x100); } else { - preyPos.x = player->actor.posRot.pos.x; - preyPos.y = player->actor.posRot.pos.y + 20.0f; - preyPos.z = player->actor.posRot.pos.z; - Math_ScaledStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &preyPos) + 0x1554, 0x100); - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x300); + preyPos.x = player->actor.world.pos.x; + preyPos.y = player->actor.world.pos.y + 20.0f; + preyPos.z = player->actor.world.pos.z; + Math_ScaledStepToS(&this->actor.shape.rot.x, Actor_WorldPitchTowardPoint(&this->actor, &preyPos) + 0x1554, + 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x300); } if (this->timer == 0) { @@ -601,7 +608,7 @@ void EnFirefly_Combust(EnFirefly* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i <= 2; i++) { - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0, 0, i); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0, 0, i); } this->auraType = KEESE_AURA_NONE; @@ -678,16 +685,16 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_MoveForward(&this->actor); } else { if (this->actionFunc != EnFirefly_Rebound) { - this->actor.posRot.rot.x = 0x1554 - this->actor.shape.rot.x; + this->actor.world.rot.x = 0x1554 - this->actor.shape.rot.x; } func_8002D97C(&this->actor); } } - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 15.0f, 7); - this->collider.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->collider.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y + 10.0f; - this->collider.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 15.0f, 7); + this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y + 10.0f; + this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; if ((this->actionFunc == EnFirefly_DiveAttack) || (this->actionFunc == EnFirefly_DisturbDiveAttack)) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -695,18 +702,18 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->actor.colChkInfo.health != 0) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (Animation_OnFrame(&this->skelAnime, 5.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_FLY); } } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - this->actor.posRot2.pos.x = - (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y)) + this->actor.posRot.pos.x; - this->actor.posRot2.pos.y = (10.0f * Math_CosS(this->actor.shape.rot.x)) + this->actor.posRot.pos.y; - this->actor.posRot2.pos.z = - (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y)) + this->actor.posRot.pos.z; + this->actor.focus.pos.x = + (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y)) + this->actor.world.pos.x; + this->actor.focus.pos.y = (10.0f * Math_CosS(this->actor.shape.rot.x)) + this->actor.world.pos.y; + this->actor.focus.pos.z = + (10.0f * Math_SinS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y)) + this->actor.world.pos.z; } s32 EnFirefly_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, @@ -752,14 +759,14 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList effLife = 3; } else { if (limbIndex == 15) { - effPos.x = (Math_SinS(9100 * this->timer) * this->timer) + this->actor.posRot.pos.x; - effPos.z = (Math_CosS(9100 * this->timer) * this->timer) + this->actor.posRot.pos.z; + effPos.x = (Math_SinS(9100 * this->timer) * this->timer) + this->actor.world.pos.x; + effPos.z = (Math_CosS(9100 * this->timer) * this->timer) + this->actor.world.pos.z; } else { - effPos.x = this->actor.posRot.pos.x - (Math_SinS(9100 * this->timer) * this->timer); - effPos.z = this->actor.posRot.pos.z - (Math_CosS(9100 * this->timer) * this->timer); + effPos.x = this->actor.world.pos.x - (Math_SinS(9100 * this->timer) * this->timer); + effPos.z = this->actor.world.pos.z - (Math_CosS(9100 * this->timer) * this->timer); } - effPos.y = this->actor.posRot.pos.y + ((15 - this->timer) * 1.5f); + effPos.y = this->actor.world.pos.y + ((15 - this->timer) * 1.5f); effScaleStep = -5; effLife = 10; } 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 8c0efc5cb1..8cfe3990c7 100644 --- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_0401909C; /* const ActorInit En_Fish_InitVars = { ACTOR_EN_FISH, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnFish), 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 bb704421fc..f4f5c72958 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -47,7 +47,7 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx); const ActorInit En_Floormas_InitVars = { ACTOR_EN_FLOORMAS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_WALLMASTER, sizeof(EnFloormas), @@ -116,7 +116,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x31, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0x157C, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 0x157C, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_STOP), }; @@ -142,7 +142,7 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, this->jointTable, this->morphTable, 25); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -164,16 +164,16 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { } else { // spawn first small floormaster this->actor.parent = - Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); + Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); if (this->actor.parent == NULL) { Actor_Kill(&this->actor); return; } // spawn 2nd small floormaster this->actor.child = - Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); + Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); if (this->actor.child == NULL) { Actor_Kill(this->actor.parent); Actor_Kill(&this->actor); @@ -267,7 +267,7 @@ void EnFloormas_SetupHover(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; EnFloormas_MakeInvulnerable(this); - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_ATTACK); this->actionFunc = EnFloormas_Hover; } @@ -300,7 +300,7 @@ void EnFloormas_SetupSplit(EnFloormas* this) { this->actor.draw = EnFloormas_Draw; } this->actor.shape.rot.y = this->actor.parent->shape.rot.y + 0x5555; - this->actor.posRot.pos = this->actor.parent->posRot.pos; + this->actor.world.pos = this->actor.parent->world.pos; this->actor.params = 0x10; Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, Animation_GetLastFrame(&D_060019CC), ANIMMODE_ONCE, 0.0f); @@ -335,9 +335,9 @@ void EnFloormas_SetupSmShrink(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 15.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 15.0f; + pos.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &pos, &velocity, &accel, 150, -10, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); this->actionFunc = EnFloormas_SmShrink; } @@ -364,15 +364,15 @@ void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) { this->actor.velocity.y = 0.0f; EnFloormas_MakeInvulnerable(this); if (LINK_IS_CHILD) { - yDelta = CLAMP(-this->actor.yDistToLink, 20.0f, 30.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 20.0f, 30.0f); xzDelta = -10.0f; } else { - yDelta = CLAMP(-this->actor.yDistToLink, 25.0f, 45.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 25.0f, 45.0f); xzDelta = -70.0f; } - this->actor.posRot.pos.y = player->actor.posRot.pos.y + yDelta; - this->actor.posRot.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.z; + this->actor.world.pos.y = player->actor.world.pos.y + yDelta; + this->actor.world.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.x; + this->actor.world.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.z; this->actor.shape.rot.x = -0x4CE0; this->actionFunc = EnFloormas_GrabLink; } @@ -404,9 +404,9 @@ void EnFloormas_SetupSmWait(EnFloormas* this) { void EnFloormas_SetupTakeDamage(EnFloormas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) { - this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; + this->actor.world.rot.y = this->collider.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0x14); this->actionFunc = EnFloormas_TakeDamage; @@ -417,7 +417,7 @@ void EnFloormas_SetupTakeDamage(EnFloormas* this) { void EnFloormas_SetupRecover(EnFloormas* this) { Animation_PlayOnce(&this->skelAnime, &D_06000EA4); this->actor.velocity.y = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnFloormas_Recover; } @@ -441,14 +441,14 @@ void EnFloormas_SetupFreeze(EnFloormas* this) { void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) { if (this->actor.scale.x > 0.004f) { // split - this->actor.shape.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer + 0x8000; EnFloormas_SetupSplit((EnFloormas*)this->actor.child); EnFloormas_SetupSplit((EnFloormas*)this->actor.parent); EnFloormas_SetupSplit(this); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SPLIT); } else { // Die - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); EnFloormas_SetupSmShrink(this, globalCtx); } } @@ -456,11 +456,11 @@ void EnFloormas_Die(EnFloormas* this, GlobalContext* globalCtx) { void EnFloormas_BigDecideAction(EnFloormas* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { // within 400 units of link and within 90 degrees rotation of him - if (this->actor.xzDistToLink < 400.0f && !func_8002E084(&this->actor, 0x4000)) { - this->actionTarget = this->actor.yawTowardsLink; + if (this->actor.xzDistToPlayer < 400.0f && !func_8002E084(&this->actor, 0x4000)) { + this->actionTarget = this->actor.yawTowardsPlayer; EnFloormas_SetupTurn(this); // within 280 units of link and within 45 degrees rotation of him - } else if (this->actor.xzDistToLink < 280.0f && func_8002E084(&this->actor, 0x2000)) { + } else if (this->actor.xzDistToPlayer < 280.0f && func_8002E084(&this->actor, 0x2000)) { EnFloormas_SetupHover(this, globalCtx); } else { EnFloormas_SetupStand(this); @@ -495,15 +495,15 @@ void EnFloormas_BigWalk(EnFloormas* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); } - if ((this->actor.xzDistToLink < 320.0f) && (func_8002E084(&this->actor, 0x4000))) { + if ((this->actor.xzDistToPlayer < 320.0f) && (func_8002E084(&this->actor, 0x4000))) { EnFloormas_SetupRun(this); } else if (this->actor.bgCheckFlags & 8) { // set target rotation to the colliding wall's rotation - this->actionTarget = this->actor.wallPolyRot; + this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); - } else if ((this->actor.xzDistToLink < 400.0f) && !func_8002E084(&this->actor, 0x4000)) { + } else if ((this->actor.xzDistToPlayer < 400.0f) && !func_8002E084(&this->actor, 0x4000)) { // set target rotation to link. - this->actionTarget = this->actor.yawTowardsLink; + this->actionTarget = this->actor.yawTowardsPlayer; EnFloormas_SetupTurn(this); } else if (this->actionTimer == 0) { EnFloormas_SetupBigStopWalk(this); @@ -524,11 +524,12 @@ void EnFloormas_Run(EnFloormas* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK); } - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); - if ((this->actor.xzDistToLink < 280.0f) && func_8002E084(&this->actor, 0x2000) && !(this->actor.bgCheckFlags & 8)) { + if ((this->actor.xzDistToPlayer < 280.0f) && func_8002E084(&this->actor, 0x2000) && + !(this->actor.bgCheckFlags & 8)) { EnFloormas_SetupHover(this, globalCtx); - } else if (this->actor.xzDistToLink > 400.0f) { + } else if (this->actor.xzDistToPlayer > 400.0f) { EnFloormas_SetupBigWalk(this); } } @@ -556,9 +557,9 @@ void EnFloormas_Turn(EnFloormas* this, GlobalContext* globalCtx) { sp30 = Math_SinS(this->actor.shape.rot.y + 0x4268); sp2C = Math_CosS(this->actor.shape.rot.y + 0x4268); this->actor.shape.rot.y += this->actionTarget; - this->actor.posRot.pos.x -= + this->actor.world.pos.x -= (this->actor.scale.x * 2700.0f) * (Math_SinS(this->actor.shape.rot.y + 0x4268) - sp30); - this->actor.posRot.pos.z -= + this->actor.world.pos.z -= (this->actor.scale.x * 2700.0f) * (Math_CosS(this->actor.shape.rot.y + 0x4268) - sp2C); } } @@ -568,8 +569,8 @@ void EnFloormas_Hover(EnFloormas* this, GlobalContext* globalCtx) { EnFloormas_SetupCharge(this); } this->actor.shape.rot.x += 0x140; - this->actor.posRot.pos.y += 10.0f; - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 2730); + this->actor.world.pos.y += 10.0f; + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2730); Math_StepToS(&this->zOffset, 1200, 100); } @@ -578,9 +579,9 @@ void EnFloormas_Slide(EnFloormas* this, GlobalContext* globalCtx) { Vec3f pos; Vec3f velocity; - pos.x = this->actor.posRot.pos.x; - pos.z = this->actor.posRot.pos.z; - pos.y = this->actor.groundY; + pos.x = this->actor.world.pos.x; + pos.z = this->actor.world.pos.z; + pos.y = this->actor.floorHeight; velocity.y = 2.0f; velocity.x = Math_SinS(this->actor.shape.rot.y + 0x6000) * 7.0f; @@ -606,9 +607,9 @@ void EnFloormas_Charge(EnFloormas* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 15.0f, SQ(this->actor.speedXZ) * (1.0f / 3.0f)); Math_ScaledStepToS(&this->actor.shape.rot.x, -0x1680, 0x140); - distFromGround = this->actor.posRot.pos.y - this->actor.groundY; + distFromGround = this->actor.world.pos.y - this->actor.floorHeight; if (distFromGround < 10.0f) { - this->actor.posRot.pos.y = this->actor.groundY + 10.0f; + this->actor.world.pos.y = this->actor.floorHeight + 10.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; } @@ -647,7 +648,7 @@ void EnFloormas_Land(EnFloormas* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 2.0f); } - if ((this->actor.speedXZ > 0.0f) && ((this->actor.posRot.pos.y - this->actor.groundY) < 12.0f)) { + if ((this->actor.speedXZ > 0.0f) && ((this->actor.world.pos.y - this->actor.floorHeight) < 12.0f)) { EnFloormas_Slide(this, globalCtx); } @@ -698,10 +699,10 @@ void EnFloormas_SmWalk(EnFloormas* this, GlobalContext* globalCtx) { if (this->smActionTimer == 0) { EnFloormas_SetupSmDecideAction(this); } else if (this->actor.bgCheckFlags & 8) { - this->actionTarget = this->actor.wallPolyRot; + this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); - } else if (this->actor.xzDistToLink < 120.0f) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink + 0x8000, 0x38E); + } else if (this->actor.xzDistToPlayer < 120.0f) { + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x38E); } } @@ -715,7 +716,7 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) { } isAgainstWall = this->actor.bgCheckFlags & 8; if (isAgainstWall) { - this->actionTarget = this->actor.wallPolyRot; + this->actionTarget = this->actor.wallYaw; EnFloormas_SetupTurn(this); return; } @@ -730,13 +731,13 @@ void EnFloormas_SmDecideAction(EnFloormas* this, GlobalContext* globalCtx) { return; } - Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, primaryFloormas), 0x38E); - if (func_8002DB8C(&this->actor, primaryFloormas) < 80.0f) { + Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primaryFloormas), 0x38E); + if (Actor_WorldDistXZToActor(&this->actor, primaryFloormas) < 80.0f) { EnFloormas_SetupSlaveJumpAtMaster(this); } } else { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C); - if (this->actor.xzDistToLink < 80.0f) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); + if (this->actor.xzDistToPlayer < 80.0f) { EnFloormas_SetupJumpAtLink(this); } } @@ -755,7 +756,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->skelAnime.curFrame < 20.0f) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } else if (Animation_OnFrame(&this->skelAnime, 20.0f)) { this->actor.speedXZ = 5.0f; this->actor.velocity.y = 7.0f; @@ -764,7 +765,7 @@ void EnFloormas_JumpAtLink(EnFloormas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLOORMASTER_SM_LAND); EnFloormas_SetupLand(this); - } else if ((this->actor.yDistToLink < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && + } else if ((this->actor.yDistToPlayer < -10.0f) && (this->collider.base.ocFlags1 & OC1_HIT) && (&player->actor == this->collider.base.oc)) { globalCtx->grabPlayer(globalCtx, player); EnFloormas_SetupGrabLink(this, player); @@ -791,16 +792,16 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) { } if (LINK_IS_CHILD) { - yDelta = CLAMP(-this->actor.yDistToLink, 20.0f, 30.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 20.0f, 30.0f); xzDelta = -10.0f; } else { - yDelta = CLAMP(-this->actor.yDistToLink, 25.0f, 45.0f); + yDelta = CLAMP(-this->actor.yDistToPlayer, 25.0f, 45.0f); xzDelta = -30.0f; } - this->actor.posRot.pos.y = player->actor.posRot.pos.y + yDelta; - this->actor.posRot.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.posRot.pos.z; + this->actor.world.pos.y = player->actor.world.pos.y + yDelta; + this->actor.world.pos.x = Math_SinS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.x; + this->actor.world.pos.z = Math_CosS(this->actor.shape.rot.y) * (xzDelta * 0.1f) + player->actor.world.pos.z; // let go if (!(player->stateFlags2 & 0x80) || (player->invincibilityTimer < 0)) { @@ -854,10 +855,10 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx) this->actor.speedXZ = 5.0f; this->actor.velocity.y = 7.0f; } else if (this->skelAnime.curFrame < 20.0f) { - Math_ApproachS(&this->actor.shape.rot.y, func_8002DA78(&this->actor, primFloormas), 2, 0xE38); - } else if ((((primFloormas->posRot.pos.y - this->actor.posRot.pos.y) < -10.0f) && - (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 10.0f)) && - (fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 10.0f)) { + Math_ApproachS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, primFloormas), 2, 0xE38); + } else if ((((primFloormas->world.pos.y - this->actor.world.pos.y) < -10.0f) && + (fabsf(this->actor.world.pos.x - primFloormas->world.pos.x) < 10.0f)) && + (fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 10.0f)) { EnFloormas_SetupSmWait(this); this->collider.base.ocFlags1 |= OC1_ON; } else if (this->actor.bgCheckFlags & 2) { @@ -866,8 +867,8 @@ void EnFloormas_SmSlaveJumpAtMaster(EnFloormas* this, GlobalContext* globalCtx) EnFloormas_SetupLand(this); } - if (fabsf(this->actor.posRot.pos.x - primFloormas->posRot.pos.x) < 5.0f && - fabsf(this->actor.posRot.pos.z - primFloormas->posRot.pos.z) < 5.0f) { + if (fabsf(this->actor.world.pos.x - primFloormas->world.pos.x) < 5.0f && + fabsf(this->actor.world.pos.z - primFloormas->world.pos.z) < 5.0f) { Math_StepToF(&this->actor.speedXZ, 0, 2.0f); } } @@ -1020,7 +1021,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) { } } else { if (this->actor.colChkInfo.damageEffect == 2) { - EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.posRot.pos, + EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.world.pos, this->actor.scale.x * 4000.0f, this->actor.scale.x * 4000.0f); } EnFloormas_SetupTakeDamage(this); @@ -1053,14 +1054,14 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actionFunc != EnFloormas_TakeDamage) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } if (this->actionFunc != EnFloormas_GrabLink) { Actor_MoveForward(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, 0x1D); Collider_UpdateCylinder(&this->actor, &this->collider); if (this->actionFunc == EnFloormas_Charge) { this->actor.flags |= 0x1000000; @@ -1077,7 +1078,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, this->actor.scale.x * 2500.0f); + Actor_SetFocus(&this->actor, this->actor.scale.x * 2500.0f); if (this->collider.base.colType == COLTYPE_HARD) { if (this->actionTarget != 0) { 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 be3c209001..4253a7a947 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_0600B498; /* const ActorInit En_Fr_InitVars = { ACTOR_EN_FR, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FR, sizeof(EnFr), 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 45480e1275..0636ef44e8 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -30,7 +30,7 @@ void func_80A1DB60(EnFu* this, GlobalContext* globalCtx); const ActorInit En_Fu_InitVars = { ACTOR_EN_FU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FU, sizeof(EnFu), @@ -90,7 +90,7 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { EnFu* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_06006C90, &D_06000B04, this->jointTable, this->morphTable, 16); Animation_PlayLoop(&this->skelanime, &D_06000B04); Collider_InitCylinder(globalCtx, &this->collider); @@ -106,7 +106,7 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { this->skelanime.playSpeed = 2.0f; } this->behaviorFlags = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; } void EnFu_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -123,9 +123,9 @@ s32 func_80A1D94C(EnFu* this, GlobalContext* globalCtx, u16 textID, EnFuActionFu return true; } this->actor.textId = textID; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if ((ABS(yawDiff) < 0x2301) && (this->actor.xzDistToLink < 100.0f)) { + if ((ABS(yawDiff) < 0x2301) && (this->actor.xzDistToPlayer < 100.0f)) { func_8002F2CC(&this->actor, globalCtx, 100.0f); } else { this->behaviorFlags |= FU_RESET_LOOK_ANGLE; @@ -230,7 +230,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) { static s16 yawDiff; Player* player = PLAYER; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((gSaveContext.eventChkInf[5] & 0x800)) { func_80A1D94C(this, globalCtx, 0x508E, func_80A1DBA0); } else if (player->stateFlags2 & 0x1000000) { @@ -241,7 +241,7 @@ void EnFu_WaitAdult(EnFu* this, GlobalContext* globalCtx) { } else if (func_8002F194(&this->actor, globalCtx) != 0) { this->actionFunc = func_80A1DBA0; } else if (ABS(yawDiff) < 0x2301) { - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { this->actor.textId = 0x5034; func_8002F2CC(&this->actor, globalCtx, 100.0f); player->stateFlags2 |= 0x800000; @@ -256,7 +256,7 @@ void EnFu_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((!(this->behaviorFlags & FU_WAIT)) && (SkelAnime_Update(&this->skelanime) != 0)) { Animation_Change(&this->skelanime, this->skelanime.animation, 1.0f, 0.0f, Animation_GetLastFrame(this->skelanime.animation), ANIMMODE_ONCE, 0.0f); @@ -269,7 +269,7 @@ void EnFu_Update(Actor* thisx, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk_2A2.y, 0, 6, 6200, 100); this->behaviorFlags &= ~FU_RESET_LOOK_ANGLE; } else { - func_80038290(globalCtx, &this->actor, &this->lookAngleOffset, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->lookAngleOffset, &this->unk_2A2, this->actor.focus.pos); } } @@ -304,7 +304,7 @@ void EnFu_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnFu* this = THIS; if (limbIndex == 14) { - Matrix_MultVec3f(&sMtxSrc, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMtxSrc, &this->actor.focus.pos); } } 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 9de9b3923c..af8b421362 100644 --- a/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -20,7 +20,7 @@ void EnFw_TurnToParentInitPos(EnFw* this, GlobalContext* globalCtx); const ActorInit En_Fw_InitVars = { ACTOR_EN_FW, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FW, sizeof(EnFw), @@ -99,15 +99,15 @@ s32 EnFw_PlayerInRange(EnFw* this, GlobalContext* globalCtx) { u32 bgId; Vec3f collisionPos; - if (this->actor.xzDistToLink > 300.0f) { + if (this->actor.xzDistToPlayer > 300.0f) { return false; } - if (ABS((s16)((f32)this->actor.yawTowardsLink - (f32)this->actor.shape.rot.y)) > 0x1C70) { + if (ABS((s16)((f32)this->actor.yawTowardsPlayer - (f32)this->actor.shape.rot.y)) > 0x1C70) { return false; } - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &player->actor.posRot.pos, &collisionPos, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &player->actor.world.pos, &collisionPos, &poly, 1, 0, 0, 1, &bgId)) { return false; } @@ -120,11 +120,11 @@ Vec3f* EnFw_GetPosAdjAroundCircle(Vec3f* dst, EnFw* this, f32 radius, s16 dir) { Vec3f posAdj; // increase rotation around circle ~30 degrees. - angle = Math_Vec3f_Yaw(&this->actor.parent->initPosRot.pos, &this->actor.posRot.pos) + (dir * 0x1554); - posAdj.x = (Math_SinS(angle) * radius) + this->actor.parent->initPosRot.pos.x; - posAdj.z = (Math_CosS(angle) * radius) + this->actor.parent->initPosRot.pos.z; - posAdj.x -= this->actor.posRot.pos.x; - posAdj.z -= this->actor.posRot.pos.z; + angle = Math_Vec3f_Yaw(&this->actor.parent->home.pos, &this->actor.world.pos) + (dir * 0x1554); + posAdj.x = (Math_SinS(angle) * radius) + this->actor.parent->home.pos.x; + posAdj.z = (Math_CosS(angle) * radius) + this->actor.parent->home.pos.z; + posAdj.x -= this->actor.world.pos.x; + posAdj.z -= this->actor.world.pos.z; *dst = posAdj; return dst; } @@ -163,16 +163,16 @@ s32 EnFw_SpawnDust(EnFw* this, u8 timer, f32 scale, f32 scaleStep, s32 dustCnt, s16 angle; s32 i; - pos = this->actor.posRot.pos; - pos.y = this->actor.groundY + 2.0f; + pos = this->actor.world.pos; + pos.y = this->actor.floorHeight + 2.0f; angle = ((Rand_ZeroOne() - 0.5f) * 0x10000); i = dustCnt; while (i >= 0) { accel.x = (Rand_ZeroOne() - 0.5f) * xzAccel; accel.y = yAccel; accel.z = (Rand_ZeroOne() - 0.5f) * xzAccel; - pos.x = (Math_SinS(angle) * radius) + this->actor.posRot.pos.x; - pos.z = (Math_CosS(angle) * radius) + this->actor.posRot.pos.z; + pos.x = (Math_SinS(angle) * radius) + this->actor.world.pos.x; + pos.z = (Math_CosS(angle) * radius) + this->actor.world.pos.z; EnFw_AddDust(this, &pos, &velocity, &accel, timer, scale, scaleStep); angle += (s16)(0x10000 / dustCnt); i--; @@ -185,7 +185,7 @@ void EnFw_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007C30, NULL, this->jointTable, this->morphTable, 11); func_80034EC0(&this->skelAnime, D_80A1FBA0, 0); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->sphs); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94); @@ -217,7 +217,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->skelAnime.playSpeed, 1.0f, 0.1f, 1.0f, 0.0f); if (this->skelAnime.animation == &D_06006CF8) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) == 0) { - this->runRadius = Math_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.parent->posRot.pos); + this->runRadius = Math_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.parent->world.pos); func_80034EC0(&this->skelAnime, D_80A1FBA0, 2); } return; @@ -241,7 +241,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = 0.0f; Math_SmoothStepToF(&this->actor.scale.x, 0.024999999f, 0.08f, 0.6f, 0.0f); Actor_SetScale(&this->actor, this->actor.scale.x); - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { func_8003426C(&this->actor, 0x4000, 0xC8, 0, this->explosionTimer); this->explosionTimer--; } @@ -254,7 +254,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { } flareDancer = this->actor.parent; flareDancer->params |= 0x4000; - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, 0xA0); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0xA0); Actor_Kill(&this->actor); return; } @@ -277,7 +277,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { if (this->turnAround) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 1.0f, 0.0f); - tmpAngle = (s16)(this->actor.posRot.rot.y ^ 0x8000); + tmpAngle = (s16)(this->actor.world.rot.y ^ 0x8000); facingDir = this->actor.shape.rot.y; tmpAngle = Math_SmoothStepToF(&facingDir, tmpAngle, 0.1f, 10000.0f, 0.0f); this->actor.shape.rot.y = facingDir; @@ -291,7 +291,7 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, (Math_FAtan2F(sp48.x, sp48.z) * (0x8000 / M_PI)), 4, 0xFA0, 1); } - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; if (this->slideTimer == 0 && EnFw_PlayerInRange(this, globalCtx)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FLAME_MAN_SURP); @@ -326,13 +326,13 @@ void EnFw_Run(EnFw* this, GlobalContext* globalCtx) { void EnFw_TurnToParentInitPos(EnFw* this, GlobalContext* globalCtx) { s16 angleToParentInit; - angleToParentInit = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.parent->initPosRot.pos); + angleToParentInit = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.parent->home.pos); Math_SmoothStepToS(&this->actor.shape.rot.y, angleToParentInit, 4, 0xFA0, 1); if (ABS(angleToParentInit - this->actor.shape.rot.y) < 0x65) { // angle to parent init pos is ~0.5 degrees - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; this->actor.velocity.y = 14.0f; - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); func_80034EC0(&this->skelAnime, D_80A1FBA0, 1); this->actionFunc = EnFw_JumpToParentInitPos; @@ -344,8 +344,8 @@ void EnFw_JumpToParentInitPos(EnFw* this, GlobalContext* globalCtx) { this->actor.parent->params |= 0x8000; Actor_Kill(&this->actor); } else { - Math_SmoothStepToF(&this->actor.posRot.pos.x, this->actor.parent->initPosRot.pos.x, 0.6f, 8.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, this->actor.parent->initPosRot.pos.z, 0.6f, 8.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.parent->home.pos.x, 0.6f, 8.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.parent->home.pos.z, 0.6f, 8.0f, 0.0f); } } @@ -355,7 +355,7 @@ void EnFw_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actor.flags & 0x2000) != 0x2000) { // not attached to hookshot. Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 20.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 20.0f, 0.0f, 5); this->actionFunc(this, globalCtx); if (this->damageTimer == 0 && this->explosionTimer == 0 && this->actionFunc == EnFw_Run) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -380,7 +380,7 @@ void EnFw_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec if (limbIndex == 3) { // head - Matrix_MultVec3f(&zeroVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&zeroVec, &this->actor.focus.pos); } Collider_UpdateSpheres(limbIndex, &this->collider); 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 d9b25d66bc..1b32cb1ec8 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_06003160; /* const ActorInit En_Fz_InitVars = { ACTOR_EN_FZ, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_FZ, sizeof(EnFz), 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 8bc8a09ad8..35e5a4d002 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 @@ -69,7 +69,7 @@ static s16 sRupeeTypes[] = { const ActorInit En_G_Switch_InitVars = { ACTOR_EN_G_SWITCH, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnGSwitch), @@ -118,7 +118,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.draw = EnGSwitch_DrawRupee; - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.yOffset = 700.0f; if (Flags_GetSwitch(globalCtx, this->switchFlag)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); Actor_Kill(&this->actor); @@ -154,7 +154,7 @@ void EnGSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = EnGSwitch_WaitForObject; break; case ENGSWITCH_TARGET_RUPEE: - this->actor.shape.unk_08 = 700.0f; + this->actor.shape.yOffset = 700.0f; Actor_SetScale(&this->actor, 0.05f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -181,9 +181,9 @@ void EnGSwitch_Break(EnGSwitch* this, GlobalContext* globalCtx) { Vec3f velocity = { 0.0f, 0.0f, 0.0f }; s32 i; - randPos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(40.0f); - randPos.y = this->actor.posRot.pos.y + 30.0f + Rand_CenteredFloat(35.0f); - randPos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(40.0f); + randPos.x = this->actor.world.pos.x + Rand_CenteredFloat(40.0f); + randPos.y = this->actor.world.pos.y + 30.0f + Rand_CenteredFloat(35.0f); + randPos.z = this->actor.world.pos.z + Rand_CenteredFloat(40.0f); hitPos.x = this->collider.info.bumper.hitPos.x; hitPos.y = this->collider.info.bumper.hitPos.y; hitPos.z = this->collider.info.bumper.hitPos.z; @@ -240,14 +240,14 @@ void EnGSwitch_SilverRupeeIdle(EnGSwitch* this, GlobalContext* globalCtx) { Player* player = PLAYER; this->actor.shape.rot.y += 0x800; - if (this->actor.xyzDistToLinkSq < 900.0f) { + if (this->actor.xyzDistToPlayerSq < 900.0f) { Rupees_ChangeBy(5); sCollectedCount++; func_80078884(NA_SE_SY_GET_RUPY); - this->actor.posRot.pos = player->actor.posRot.pos; - this->actor.posRot.pos.y += 40.0f; + this->actor.world.pos = player->actor.world.pos; + this->actor.world.pos.y += 40.0f; if (LINK_IS_ADULT) { - this->actor.posRot.pos.y += 20.0f; + this->actor.world.pos.y += 20.0f; } this->actor.gravity = 0.0f; this->killTimer = 15; @@ -263,11 +263,11 @@ void EnGSwitch_SilverRupeeCollected(EnGSwitch* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - this->actor.posRot.pos = player->actor.posRot.pos; - this->actor.posRot.pos.y = - player->actor.posRot.pos.y + 40.0f + (this->killTimer * 0.3f) * Math_SinS(this->killTimer * 0x3A98); + this->actor.world.pos = player->actor.world.pos; + this->actor.world.pos.y = + player->actor.world.pos.y + 40.0f + (this->killTimer * 0.3f) * Math_SinS(this->killTimer * 0x3A98); if (LINK_IS_ADULT) { - this->actor.posRot.pos.y += 20.0f; + this->actor.world.pos.y += 20.0f; } } @@ -279,8 +279,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { switch (this->moveMode) { case GSWITCH_THROW: Actor_MoveForward(&this->actor); - if ((this->actor.velocity.y < 0.0f) && - (this->actor.posRot.pos.y < (this->actor.initPosRot.pos.y - 50.0f))) { + if ((this->actor.velocity.y < 0.0f) && (this->actor.world.pos.y < (this->actor.home.pos.y - 50.0f))) { gallery = ((EnSyatekiItm*)this->actor.parent); this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; @@ -292,7 +291,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { break; case GSWITCH_LEFT: func_8002D7EC(&this->actor); - if ((this->actor.velocity.x < 0.0f) && (this->actor.posRot.pos.x < this->targetPos.x)) { + if ((this->actor.velocity.x < 0.0f) && (this->actor.world.pos.x < this->targetPos.x)) { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { gallery->targetState[this->index] = ENSYATEKIHIT_MISS; @@ -302,7 +301,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { break; case GSWITCH_RIGHT: func_8002D7EC(&this->actor); - if (this->actor.posRot.pos.x > this->targetPos.x) { + if (this->actor.world.pos.x > this->targetPos.x) { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { gallery->targetState[this->index] = ENSYATEKIHIT_MISS; @@ -313,10 +312,10 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { default: switch (this->moveState) { case MOVE_TARGET: - if ((fabsf(this->actor.posRot.pos.x - this->targetPos.x) > 5.0f) || - (fabsf(this->actor.posRot.pos.y - this->targetPos.y) > 5.0f)) { - Math_ApproachF(&this->actor.posRot.pos.x, this->targetPos.x, 0.3f, 30.0f); - Math_ApproachF(&this->actor.posRot.pos.y, this->targetPos.y, 0.3f, 30.0f); + if ((fabsf(this->actor.world.pos.x - this->targetPos.x) > 5.0f) || + (fabsf(this->actor.world.pos.y - this->targetPos.y) > 5.0f)) { + Math_ApproachF(&this->actor.world.pos.x, this->targetPos.x, 0.3f, 30.0f); + Math_ApproachF(&this->actor.world.pos.y, this->targetPos.y, 0.3f, 30.0f); } else { this->moveState = MOVE_HOME; this->waitTimer = 60; @@ -324,10 +323,10 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { break; case MOVE_HOME: if (this->waitTimer == 0) { - if ((fabsf(this->actor.posRot.pos.x - this->actor.initPosRot.pos.x) > 5.0f) || - (fabsf(this->actor.posRot.pos.y - this->actor.initPosRot.pos.y) > 5.0f)) { - Math_ApproachF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 0.3f, 30.0f); - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.3f, 30.0f); + if ((fabsf(this->actor.world.pos.x - this->actor.home.pos.x) > 5.0f) || + (fabsf(this->actor.world.pos.y - this->actor.home.pos.y) > 5.0f)) { + Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.3f, 30.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.3f, 30.0f); } else { gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { @@ -362,7 +361,7 @@ void EnGSwitch_GalleryRupee(EnGSwitch* this, GlobalContext* globalCtx) { void EnGSwitch_ArcheryPot(EnGSwitch* this, GlobalContext* globalCtx) { s32 i; s16 angle; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; this->actor.shape.rot.y += 0x3C0; if (this->collider.base.acFlags & AC_HIT) { @@ -435,7 +434,7 @@ void EnGSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->type != ENGSWITCH_SILVER_TRACKER) && (this->type != ENGSWITCH_SILVER_RUPEE) && (this->type != ENGSWITCH_TARGET_RUPEE)) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 0x1C); } if (this->actor.draw != NULL) { if (this->type == ENGSWITCH_TARGET_RUPEE) { @@ -447,8 +446,8 @@ void EnGSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { } } if (BREG(0) && (this->type == ENGSWITCH_SILVER_TRACKER)) { - 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } 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 5089d9f668..50ee39c8c9 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 @@ -12,7 +12,7 @@ void EnGanonMant_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Ganon_Mant_InitVars = { ACTOR_EN_GANON_MANT, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnGanonMant), 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 48295a5a2e..6344554733 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 @@ -18,7 +18,7 @@ void EnGanonOrgan_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Ganon_Organ_InitVars = { ACTOR_EN_GANON_ORGAN, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GANON, sizeof(EnGanonOrgan), 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 3aca501e6e..e303b7f594 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_0600C8EC; /* const ActorInit En_Gb_InitVars = { ACTOR_EN_GB, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_PS, sizeof(EnGb), 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 11bf3d537f..6ca95beb24 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -17,7 +17,7 @@ extern UNK_TYPE D_0600A498; /* const ActorInit En_Ge1_InitVars = { ACTOR_EN_GE1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GE1, sizeof(EnGe1), 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 7ad8026138..6ef9dcdac5 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_06009ED4; /* const ActorInit En_Ge2_InitVars = { ACTOR_EN_GE2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GLA, sizeof(EnGe2), 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 ecae5b6293..b321627579 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_0600B07C; /* const ActorInit En_Ge3_InitVars = { ACTOR_EN_GE3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GELDB, sizeof(EnGe3), 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 12d255ad3b..7b3969ccac 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -79,7 +79,7 @@ extern AnimationHeader D_06001578; const ActorInit En_GeldB_InitVars = { ACTOR_EN_GELDB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GELDB, sizeof(EnGeldB), @@ -212,7 +212,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3000, ICHAIN_STOP), }; @@ -230,11 +230,11 @@ void EnGeldB_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); thisx->colChkInfo.damageTable = &sDamageTable; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Teardrop, 0.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFeet, 0.0f); this->actor.colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.health = 20; - thisx->colChkInfo.unk_10 = 50; - thisx->colChkInfo.unk_12 = 100; + thisx->colChkInfo.cylRadius = 50; + thisx->colChkInfo.cylHeight = 100; thisx->naviEnemyId = 0x54; this->keyFlag = thisx->params & 0xFF00; thisx->params &= 0xFF; @@ -283,9 +283,9 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { s16 angleToLink; Actor* bomb; - angleToWall = thisx->wallPolyRot - thisx->shape.rot.y; + angleToWall = thisx->wallYaw - thisx->shape.rot.y; angleToWall = ABS(angleToWall); - angleToLink = thisx->yawTowardsLink - thisx->shape.rot.y; + angleToLink = thisx->yawTowardsPlayer - thisx->shape.rot.y; angleToLink = ABS(angleToLink); if (func_800354B4(globalCtx, thisx, 100.0f, 0x2710, 0x3E80, thisx->shape.rot.y)) { @@ -298,25 +298,25 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { } } if (func_800354B4(globalCtx, thisx, 100.0f, 0x5DC0, 0x2AA8, thisx->shape.rot.y)) { - thisx->shape.rot.y = thisx->posRot.rot.y = thisx->yawTowardsLink; - if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToLink < 90.0f)) { + thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer; + if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); return true; } else if (player->swordAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, globalCtx); return true; - } else if ((thisx->xzDistToLink < 90.0f) && (globalCtx->gameplayFrames & 1)) { + } else if ((thisx->xzDistToPlayer < 90.0f) && (globalCtx->gameplayFrames & 1)) { EnGeldB_SetupBlock(this); return true; } else { EnGeldB_SetupRollBack(this); return true; } - } else if ((bomb = Actor_FindNearby(globalCtx, thisx, -1, ACTORTYPE_EXPLOSIVES, 80.0f)) != NULL) { - thisx->shape.rot.y = thisx->posRot.rot.y = thisx->yawTowardsLink; + } else if ((bomb = Actor_FindNearby(globalCtx, thisx, -1, ACTORCAT_EXPLOSIVE, 80.0f)) != NULL) { + thisx->shape.rot.y = thisx->world.rot.y = thisx->yawTowardsPlayer; if (((thisx->bgCheckFlags & 8) && (angleToWall < 0x2EE0)) || (bomb->id == ACTOR_EN_BOM_CHU)) { - if ((bomb->id == ACTOR_EN_BOM_CHU) && (func_8002DB48(thisx, bomb) < 80.0f) && - ((s16)(thisx->shape.rot.y - (bomb->posRot.rot.y - 0x8000)) < 0x3E80)) { + if ((bomb->id == ACTOR_EN_BOM_CHU) && (Actor_WorldDistXYZToActor(thisx, bomb) < 80.0f) && + ((s16)(thisx->shape.rot.y - (bomb->world.rot.y - 0x8000)) < 0x3E80)) { EnGeldB_SetupJump(this); return true; } else { @@ -334,7 +334,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { } else { s16 angleToFacingLink = player->actor.shape.rot.y - thisx->shape.rot.y; - if ((thisx->xzDistToLink <= 45.0f) && !func_80033AB8(globalCtx, thisx) && + if ((thisx->xzDistToPlayer <= 45.0f) && !func_80033AB8(globalCtx, thisx) && ((globalCtx->gameplayFrames & 7) || (ABS(angleToFacingLink) < 0x38E0))) { EnGeldB_SetupSlash(this); return true; @@ -349,7 +349,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) { void EnGeldB_SetupWait(EnGeldB* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_0600ADF8, 0.0f); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 120.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 120.0f; this->timer = 10; this->invisible = true; this->actionState = GELDB_WAIT; @@ -360,21 +360,21 @@ void EnGeldB_SetupWait(EnGeldB* this) { } void EnGeldB_Wait(EnGeldB* this, GlobalContext* globalCtx) { - if ((this->invisible && !Flags_GetSwitch(globalCtx, this->actor.initPosRot.rot.z)) || - this->actor.xzDistToLink > 300.0f) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; - this->actor.posRot.pos.y = this->actor.groundY + 120.0f; + if ((this->invisible && !Flags_GetSwitch(globalCtx, this->actor.home.rot.z)) || + this->actor.xzDistToPlayer > 300.0f) { + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.world.pos.y = this->actor.floorHeight + 120.0f; } else { this->invisible = false; - this->actor.shape.unk_10 = 90.0f; + this->actor.shape.shadowScale = 90.0f; func_800F5ACC(0x38); } if (this->actor.bgCheckFlags & 2) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); this->skelAnime.playSpeed = 1.0f; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; this->actor.flags |= 1; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->actor.bgCheckFlags &= ~2; this->actor.velocity.y = 0.0f; func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0); @@ -391,7 +391,7 @@ void EnGeldB_SetupFlee(EnGeldB* this) { this->timer = 20; this->invisible = false; this->actionState = GELDB_WAIT; - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupAction(this, EnGeldB_Flee); } @@ -405,7 +405,7 @@ void EnGeldB_Flee(EnGeldB* this, GlobalContext* globalCtx) { func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0); } if (SkelAnime_Update(&this->skelAnime)) { - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.groundY + 300.0f, 1.0f, 20.5f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.floorHeight + 300.0f, 1.0f, 20.5f, 0.0f); this->timer--; if (this->timer == 0) { Actor_Kill(&this->actor); @@ -418,7 +418,7 @@ void EnGeldB_SetupReady(EnGeldB* this) { this->actionState = GELDB_READY; this->timer = Rand_ZeroOne() * 10.0f + 5.0f; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnGeldB_SetupAction(this, EnGeldB_Ready); } @@ -429,14 +429,14 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->lookTimer != 0) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->headRot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->headRot.y; if (ABS(angleToLink) > 0x2000) { this->lookTimer--; return; } this->lookTimer = 0; } - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (!EnGeldB_DodgeRanged(globalCtx, this)) { if (this->unkTimer != 0) { this->unkTimer--; @@ -449,12 +449,12 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) { return; } angleToLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - if ((this->actor.xzDistToLink < 100.0f) && (player->swordState != 0) && (ABS(angleToLink) >= 0x1F40)) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0) && (ABS(angleToLink) >= 0x1F40)) { + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupCircle(this); } else if (--this->timer == 0) { if (func_8002E084(&this->actor, 30 * 0x10000 / 360)) { - if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) && + if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && (Rand_ZeroOne() < 0.3f)) { if (func_80033AB8(globalCtx, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleToLink) < 0x38E0)) { @@ -495,11 +495,11 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { f32 playSpeed; if (!EnGeldB_DodgeRanged(globalCtx, this)) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x2EE, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; - if (this->actor.xzDistToLink <= 40.0f) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; + if (this->actor.xzDistToPlayer <= 40.0f) { Math_SmoothStepToF(&this->actor.speedXZ, -8.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 55.0f) { + } else if (this->actor.xzDistToPlayer > 55.0f) { Math_SmoothStepToF(&this->actor.speedXZ, 8.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 6.65f, 0.0f); @@ -507,8 +507,8 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = this->actor.speedXZ * 0.125f; facingAngletoLink = player->actor.shape.rot.y - this->actor.shape.rot.y; facingAngletoLink = ABS(facingAngletoLink); - if ((this->actor.xzDistToLink < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + if ((this->actor.xzDistToPlayer < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) { + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (Rand_ZeroOne() > 0.7f) { EnGeldB_SetupCircle(this); return; @@ -525,9 +525,9 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { } else { EnGeldB_SetupReady(this); } - } else if (this->actor.xzDistToLink < 90.0f) { + } else if (this->actor.xzDistToPlayer < 90.0f) { if (!func_80033AB8(globalCtx, &this->actor) && - (Rand_ZeroOne() > 0.03f || (this->actor.xzDistToLink <= 45.0f && facingAngletoLink < 0x38E0))) { + (Rand_ZeroOne() > 0.03f || (this->actor.xzDistToPlayer <= 45.0f && facingAngletoLink < 0x38E0))) { EnGeldB_SetupSlash(this); } else if (func_80033AB8(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnGeldB_SetupRollBack(this); @@ -536,7 +536,7 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) { } } if (!EnGeldB_ReactToPlayer(globalCtx, this, 0)) { - if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) && + if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && func_8002E084(&this->actor, 0x71C)) { if (func_80033A84(globalCtx, &this->actor)) { if (Rand_ZeroOne() > 0.5f) { @@ -567,7 +567,7 @@ void EnGeldB_SetupRollForward(EnGeldB* this) { this->timer = 0; this->invisible = true; this->actionState = GELDB_ROLL_FORWARD; - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 10.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); EnGeldB_SetupAction(this, EnGeldB_RollForward); @@ -610,9 +610,9 @@ void EnGeldB_Pivot(EnGeldB* this, GlobalContext* globalCtx) { f32 playSpeed; if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0)) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; turnRate = (angleToLink > 0) ? ((angleToLink * 0.25f) + 2000.0f) : ((angleToLink * 0.25f) - 2000.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y += turnRate; + this->actor.world.rot.y = this->actor.shape.rot.y += turnRate; if (angleToLink > 0) { playSpeed = turnRate * 0.5f; playSpeed = CLAMP_MAX(playSpeed, 1.0f); @@ -639,7 +639,7 @@ void EnGeldB_SetupCircle(EnGeldB* this) { Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814), ANIMMODE_LOOP_INTERP, 0.0f); this->actor.speedXZ = Rand_CenteredFloat(12.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->timer = Rand_ZeroOne() * 30.0f + 30.0f; this->actionState = GELDB_CIRCLE; @@ -656,9 +656,9 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { s32 prevKeyFrame; Player* player = PLAYER; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1); if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3A98; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3A98; angleBehindLink = player->actor.shape.rot.y + 0x8000; if (Math_SinS(angleBehindLink - this->actor.shape.rot.y) >= 0.0f) { this->actor.speedXZ -= 0.25f; @@ -679,7 +679,7 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { } else { phi_v1 = this->actor.shape.rot.y - 0x3E80; } - phi_v1 = this->actor.wallPolyRot - phi_v1; + phi_v1 = this->actor.wallYaw - phi_v1; } else { this->actor.speedXZ *= -0.8f; phi_v1 = 0; @@ -693,16 +693,16 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { } } } - if (this->actor.xzDistToLink <= 45.0f) { + if (this->actor.xzDistToPlayer <= 45.0f) { Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 40.0f) { + } else if (this->actor.xzDistToPlayer > 40.0f) { Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f); } if (this->approachRate != 0.0f) { - this->actor.posRot.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; - this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; } if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; @@ -724,7 +724,7 @@ void EnGeldB_Circle(EnGeldB* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_BREATH); } if ((Math_CosS(angleBehindLink - this->actor.shape.rot.y) < -0.85f) && - !func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink <= 45.0f)) { + !func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer <= 45.0f)) { EnGeldB_SetupSlash(this); } else if (--this->timer == 0) { if (func_80033AB8(globalCtx, &this->actor) && (Rand_ZeroOne() > 0.5f)) { @@ -753,7 +753,7 @@ void EnGeldB_SetupSpinDodge(EnGeldB* this, GlobalContext* globalCtx) { this->actor.speedXZ = -10.0f; } this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->timer = 6; this->approachRate = 0.0f; this->unkFloat = 0.0f; @@ -769,7 +769,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { s32 lastKeyFrame; s32 nextKeyFrame; - this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x3A98; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x3A98; if ((this->actor.bgCheckFlags & 8) || !func_800339B8(&this->actor, globalCtx, this->actor.speedXZ, this->actor.shape.rot.y + 0x3E80)) { if (this->actor.bgCheckFlags & 8) { @@ -778,7 +778,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { } else { phi_v1 = this->actor.shape.rot.y - 0x3E80; } - phi_v1 = this->actor.wallPolyRot - phi_v1; + phi_v1 = this->actor.wallYaw - phi_v1; } else { this->actor.speedXZ *= -0.8f; phi_v1 = 0; @@ -788,16 +788,16 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { return; } } - if (this->actor.xzDistToLink <= 45.0f) { + if (this->actor.xzDistToPlayer <= 45.0f) { Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 40.0f) { + } else if (this->actor.xzDistToPlayer > 40.0f) { Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f); } if (this->approachRate != 0.0f) { - this->actor.posRot.pos.x += Math_SinS(this->actor.yawTowardsLink) * this->approachRate; - this->actor.posRot.pos.z += Math_CosS(this->actor.yawTowardsLink) * this->approachRate; + this->actor.world.pos.x += Math_SinS(this->actor.yawTowardsPlayer) * this->approachRate; + this->actor.world.pos.z += Math_CosS(this->actor.yawTowardsPlayer) * this->approachRate; } if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; @@ -818,9 +818,9 @@ void EnGeldB_SpinDodge(EnGeldB* this, GlobalContext* globalCtx) { } this->timer--; if (this->timer == 0) { - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (!EnGeldB_DodgeRanged(globalCtx, this)) { - if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink <= 70.0f)) { + if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer <= 70.0f)) { EnGeldB_SetupSlash(this); } else { EnGeldB_SetupRollBack(this); @@ -848,7 +848,7 @@ void EnGeldB_SetupSlash(EnGeldB* this) { void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { Player* player = PLAYER; s16 angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - s16 angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; angleFacingLink = ABS(angleFacingLink); angleToLink = ABS(angleToLink); @@ -871,16 +871,16 @@ void EnGeldB_Slash(EnGeldB* this, GlobalContext* globalCtx) { if (angleToLink > 0x4000) { this->lookTimer = 20; } - } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToLink >= 120.0f)) { + } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToPlayer >= 120.0f)) { EnGeldB_SetupReady(this); this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f; } else { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (Rand_ZeroOne() > 0.7f) { EnGeldB_SetupSidestep(this, globalCtx); } else if (angleFacingLink <= 0x2710) { if (angleToLink > 0x3E80) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupCircle(this); } else { EnGeldB_ReactToPlayer(globalCtx, this, 1); @@ -915,7 +915,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) { } else if (this->swordCollider.base.atFlags & AT_HIT) { this->swordCollider.base.atFlags &= ~AT_HIT; if (&player->actor == this->swordCollider.base.at) { - func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.yawTowardsPlayer, 6.0f); this->spinAttackState = 2; func_8002DF54(globalCtx, &this->actor, 0x18); func_8010B680(globalCtx, 0x6003, &this->actor); @@ -927,7 +927,7 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) { } } if ((s32)this->skelAnime.curFrame < 9) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; } else if ((s32)this->skelAnime.curFrame == 13) { func_80033260(globalCtx, &this->actor, &this->rightFootPos, 3.0f, 2, 2.0f, 0, 0, 0); func_80033260(globalCtx, &this->actor, &this->leftFootPos, 3.0f, 2, 2.0f, 0, 0, 0); @@ -946,21 +946,21 @@ void EnGeldB_SpinAttack(EnGeldB* this, GlobalContext* globalCtx) { this->lookTimer = 46; } else if (this->spinAttackState != 0) { EnGeldB_SetupRollBack(this); - } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToLink >= 120.0f)) { + } else if (Rand_ZeroOne() > 0.7f || (this->actor.xzDistToPlayer >= 120.0f)) { EnGeldB_SetupReady(this); this->timer = (Rand_ZeroOne() * 5.0f) + 5.0f; } else { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (Rand_ZeroOne() > 0.7f) { EnGeldB_SetupSidestep(this, globalCtx); } else { angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; angleFacingLink = ABS(angleFacingLink); if (angleFacingLink <= 0x2710) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; angleToLink = ABS(angleToLink); if (angleToLink > 0x3E80) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupCircle(this); } else { EnGeldB_ReactToPlayer(globalCtx, this, 1); @@ -980,14 +980,14 @@ void EnGeldB_SetupRollBack(EnGeldB* this) { this->actionState = GELDB_ROLL_BACK; this->actor.speedXZ = -8.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnGeldB_SetupAction(this, EnGeldB_RollBack); } void EnGeldB_RollBack(EnGeldB* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToLink < 170.0f) && - (this->actor.xzDistToLink > 140.0f) && (Rand_ZeroOne() < 0.2f)) { + if (!func_80033AB8(globalCtx, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && + (this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) { EnGeldB_SetupSpinAttack(this); } else if (globalCtx->gameplayFrames & 1) { EnGeldB_SetupSidestep(this, globalCtx); @@ -1025,7 +1025,7 @@ void EnGeldB_Stunned(EnGeldB* this, GlobalContext* globalCtx) { } this->invisible = false; } - if ((this->actor.dmgEffectTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { if (this->actor.colChkInfo.health == 0) { EnGeldB_SetupDefeated(this); } else { @@ -1043,7 +1043,7 @@ void EnGeldB_SetupDamaged(EnGeldB* this) { this->invisible = true; } this->lookTimer = 0; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DAMAGE); this->actionState = GELDB_DAMAGED; EnGeldB_SetupAction(this, EnGeldB_Damaged); @@ -1061,14 +1061,14 @@ void EnGeldB_Damaged(EnGeldB* this, GlobalContext* globalCtx) { } this->invisible = false; } - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x1194, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x1194, 0); if (!EnGeldB_DodgeRanged(globalCtx, this) && !EnGeldB_ReactToPlayer(globalCtx, this, 0) && SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 1)) { - angleToWall = this->actor.wallPolyRot - this->actor.shape.rot.y; - if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToLink < 90.0f)) { + angleToWall = this->actor.wallYaw - this->actor.shape.rot.y; + if ((this->actor.bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (this->actor.xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); } else if (!EnGeldB_DodgeRanged(globalCtx, this)) { - if ((this->actor.xzDistToLink <= 45.0f) && !func_80033AB8(globalCtx, &this->actor) && + if ((this->actor.xzDistToPlayer <= 45.0f) && !func_80033AB8(globalCtx, &this->actor) && (globalCtx->gameplayFrames & 7)) { EnGeldB_SetupSlash(this); } else { @@ -1087,22 +1087,22 @@ void EnGeldB_SetupJump(EnGeldB* this) { this->actor.speedXZ = 6.5f; this->actor.velocity.y = 15.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnGeldB_SetupAction(this, EnGeldB_Jump); } void EnGeldB_Jump(EnGeldB* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1); if (this->actor.velocity.y >= 5.0f) { func_800355B8(globalCtx, &this->rightFootPos); func_800355B8(globalCtx, &this->leftFootPos); } if (SkelAnime_Update(&this->skelAnime) && (this->actor.bgCheckFlags & 3)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.x = 0; this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; if (!func_80033AB8(globalCtx, &this->actor)) { EnGeldB_SetupSlash(this); } else { @@ -1137,9 +1137,9 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = 1.0f; } if (SkelAnime_Update(&this->skelAnime)) { - angleToLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToLink < 40.0f) && - (ABS(this->actor.yDistToLink) < 50.0f)) { + angleToLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToPlayer < 40.0f) && + (ABS(this->actor.yDistToPlayer) < 50.0f)) { if (func_800354B4(globalCtx, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) { if (player->swordAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, globalCtx); @@ -1166,7 +1166,7 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) { EnGeldB_SetupSpinDodge(this, globalCtx); } else if (!EnGeldB_DodgeRanged(globalCtx, this)) { if ((globalCtx->gameplayFrames & 1)) { - if ((this->actor.xzDistToLink < 100.0f) && (Rand_ZeroOne() > 0.7f)) { + if ((this->actor.xzDistToPlayer < 100.0f) && (Rand_ZeroOne() > 0.7f)) { EnGeldB_SetupJump(this); } else { EnGeldB_SetupRollBack(this); @@ -1185,7 +1185,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_0600A814, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600A814), ANIMMODE_LOOP_INTERP, 0.0f); player = PLAYER; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA0, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA0, 1); linkAngle = player->actor.shape.rot.y; if (Math_SinS(linkAngle - this->actor.shape.rot.y) > 0.0f) { this->actor.speedXZ = -6.0f; @@ -1196,7 +1196,7 @@ void EnGeldB_SetupSidestep(EnGeldB* this, GlobalContext* globalCtx) { } this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; this->approachRate = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3FFF; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; this->timer = Rand_ZeroOne() * 10.0f + 5.0f; this->actionState = GELDB_SIDESTEP; EnGeldB_SetupAction(this, EnGeldB_Sidestep); @@ -1210,7 +1210,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { s32 prevKeyFrame; f32 playSpeed; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xBB8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 1); behindLinkAngle = player->actor.shape.rot.y + 0x8000; if (Math_SinS(behindLinkAngle - this->actor.shape.rot.y) > 0.0f) { this->actor.speedXZ += 0.125f; @@ -1226,7 +1226,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { } else { phi_v1 = this->actor.shape.rot.y - 0x3E80; } - phi_v1 = this->actor.wallPolyRot - phi_v1; + phi_v1 = this->actor.wallYaw - phi_v1; } else { this->actor.speedXZ *= -0.8f; phi_v1 = 0; @@ -1241,20 +1241,20 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { } } if (this->actor.speedXZ >= 0.0f) { - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3E80; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3E80; } else { - this->actor.posRot.rot.y = this->actor.shape.rot.y - 0x3E80; + this->actor.world.rot.y = this->actor.shape.rot.y - 0x3E80; } - if (this->actor.xzDistToLink <= 45.0f) { + if (this->actor.xzDistToPlayer <= 45.0f) { Math_SmoothStepToF(&this->approachRate, -4.0f, 1.0f, 1.5f, 0.0f); - } else if (this->actor.xzDistToLink > 40.0f) { + } else if (this->actor.xzDistToPlayer > 40.0f) { Math_SmoothStepToF(&this->approachRate, 4.0f, 1.0f, 1.5f, 0.0f); } else { Math_SmoothStepToF(&this->approachRate, 0.0f, 1.0f, 6.65f, 0.0f); } if (this->approachRate != 0.0f) { - this->actor.posRot.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; - this->actor.posRot.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.x += Math_SinS(this->actor.shape.rot.y) * this->approachRate; + this->actor.world.pos.z += Math_CosS(this->actor.shape.rot.y) * this->approachRate; } if (ABS(this->approachRate) < ABS(this->actor.speedXZ)) { this->skelAnime.playSpeed = -this->actor.speedXZ * 0.5f; @@ -1280,11 +1280,11 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { Player* player2 = PLAYER; s16 angleFacingPlayer2 = player2->actor.shape.rot.y - this->actor.shape.rot.y; - this->actor.posRot.rot.y = this->actor.shape.rot.y; - if ((this->actor.xzDistToLink <= 45.0f) && (!func_80033AB8(globalCtx, &this->actor)) && + this->actor.world.rot.y = this->actor.shape.rot.y; + if ((this->actor.xzDistToPlayer <= 45.0f) && (!func_80033AB8(globalCtx, &this->actor)) && (!(globalCtx->gameplayFrames & 3) || (ABS(angleFacingPlayer2) < 0x38E0))) { EnGeldB_SetupSlash(this); - } else if ((210.0f > this->actor.xzDistToLink) && (this->actor.xzDistToLink > 150.0f) && + } else if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && !(globalCtx->gameplayFrames & 1)) { if (func_80033AB8(globalCtx, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleFacingPlayer2) < 0x38E0)) { @@ -1310,7 +1310,7 @@ void EnGeldB_Sidestep(EnGeldB* this, GlobalContext* globalCtx) { void EnGeldB_SetupDefeated(EnGeldB* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06001E10, -4.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (this->actor.bgCheckFlags & 1) { this->invisible = false; this->actor.speedXZ = -6.0f; @@ -1344,7 +1344,7 @@ void func_80A391D8(EnGeldB* this, GlobalContext* globalCtx) { this->headRot.y = Math_SinS(this->lookTimer * 0x1068) * 8920.0f; } else if (this->actionState != GELDB_STUNNED) { if ((this->actionState != GELDB_SLASH) && (this->actionState != GELDB_SPIN_ATTACK)) { - Math_SmoothStepToS(&this->headRot.y, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F4, 0); + Math_SmoothStepToS(&this->headRot.y, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, 0x1F4, 0); this->headRot.y = CLAMP(this->headRot.y, -0x256F, 0x256F); } else { this->headRot.y = 0; @@ -1377,11 +1377,9 @@ void func_80A392D8(EnGeldB* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); if (Actor_ApplyDamage(&this->actor) == 0) { if (this->keyFlag != 0) { - key = - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, this->keyFlag | ITEM00_SMALL_KEY); + key = Item_DropCollectible(globalCtx, &this->actor.world.pos, this->keyFlag | ITEM00_SMALL_KEY); if (key != NULL) { - key->actor.posRot.rot.y = - Math_Vec3f_Yaw(&key->actor.posRot.pos, &this->actor.initPosRot.pos); + key->actor.world.rot.y = Math_Vec3f_Yaw(&key->actor.world.pos, &this->actor.home.pos); key->actor.speedXZ = 6.0f; Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -1404,16 +1402,16 @@ void EnGeldB_Update(Actor* thisx, GlobalContext* globalCtx) { func_80A392D8(this, globalCtx); if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D); this->actionFunc(this, globalCtx); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 40.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 40.0f; func_80A391D8(this, globalCtx); } Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); if ((this->actionState >= GELDB_READY) && (this->spinAttackState < 2) && - ((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000))) { + ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000))) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); } if ((this->actionState == GELDB_BLOCK) && (this->skelAnime.curFrame == 0.0f)) { @@ -1488,7 +1486,7 @@ void EnGeldB_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, EffectBlure_AddVertex(Effect_GetByIndex(this->blureIdx), &swordTip, &swordHilt); } } else { - func_8002BDB0(&this->actor, limbIndex, 19, &footOffset, 22, &footOffset); + Actor_SetFeetPos(&this->actor, limbIndex, 19, &footOffset, 22, &footOffset); } if (limbIndex == 19) { Matrix_MultVec3f(&footOffset, &this->rightFootPos); @@ -1560,7 +1558,7 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->spinAttackState == 2) { Animation_Change(&this->skelAnime, &D_06000F5C, 0.5f, 0.0f, 12.0f, ANIMMODE_ONCE_INTERP, 4.0f); this->spinAttackState++; - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->yawTowardsLink; + thisx->world.rot.y = thisx->shape.rot.y = thisx->yawTowardsPlayer; } else { this->timer--; if (this->timer == 0) { @@ -1596,7 +1594,7 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) { } if (this->iceTimer != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->iceTimer--; if ((this->iceTimer % 4) == 0) { s32 iceIndex = this->iceTimer >> 2; @@ -1617,11 +1615,11 @@ s32 EnGeldB_DodgeRanged(GlobalContext* globalCtx, EnGeldB* this) { s16 pad18; f32 dist; - angleToFacing = func_8002DA78(&this->actor, actor) - this->actor.shape.rot.y; - this->actor.posRot.rot.y = (u16)this->actor.shape.rot.y & 0xFFFF; - dist = func_8002DB6C(&this->actor, &actor->posRot.pos); + angleToFacing = Actor_WorldYawTowardActor(&this->actor, actor) - this->actor.shape.rot.y; + this->actor.world.rot.y = (u16)this->actor.shape.rot.y & 0xFFFF; + dist = Actor_WorldDistXYZToPoint(&this->actor, &actor->world.pos); //! @bug - // func_8002DB6C already sqrtfs the distance, so this actually checks for a + // Actor_WorldDistXYZToPoint already sqrtfs the distance, so this actually checks for a // distance of 360000. Also it's a double calculation because no f on sqrt. if ((ABS(angleToFacing) < 0x2EE0) && (sqrt(dist) < 600.0)) { if (actor->id == ACTOR_ARMS_HOOK) { @@ -1630,7 +1628,7 @@ s32 EnGeldB_DodgeRanged(GlobalContext* globalCtx, EnGeldB* this) { EnGeldB_SetupBlock(this); } } else { - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x3FFF; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; if ((ABS(angleToFacing) < 0x2000) || (ABS(angleToFacing) > 0x5FFF)) { EnGeldB_SetupSidestep(this, globalCtx); this->actor.speedXZ *= 3.0f; 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 ff7a930002..0e406e3c50 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -71,7 +71,7 @@ void func_80A3BC6C(GlobalContext* globalCtx, EnGirlA* this); const ActorInit En_GirlA_InitVars = { ACTOR_EN_GIRLA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnGirlA), @@ -963,9 +963,9 @@ void func_80A3BFE4(EnGirlA* this, GlobalContext* globalCtx) { osSyncPrintf("%s(%2d)\n", D_80A3C590[params], params); this->actor.flags &= ~1; Actor_SetScale(&this->actor, 0.25f); - this->actor.shape.unk_08 = 24.0f; - this->actor.shape.unk_10 = 4.0f; - this->actor.groundY = this->actor.initPosRot.pos.y; + this->actor.shape.yOffset = 24.0f; + this->actor.shape.shadowScale = 4.0f; + this->actor.floorHeight = this->actor.home.pos.y; this->actor.gravity = 0.0f; func_80A3A750(this, func_80A3BD80); this->unk_19C = 1; @@ -978,11 +978,11 @@ void func_80A3BFE4(EnGirlA* this, GlobalContext* globalCtx) { void func_80A3C3BC(EnGirlA* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.25f); - this->actor.shape.unk_08 = 24.0f; - this->actor.shape.unk_10 = 4.0f; + this->actor.shape.yOffset = 24.0f; + this->actor.shape.shadowScale = 4.0f; func_80A3BF54(this, globalCtx); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 5.0f); + Actor_SetFocus(&this->actor, 5.0f); this->actor.shape.rot.x = 0.0f; if (this->actor.params != 38) { if (this->unk_1B4 != 0) { 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 aa5918a798..2376906cc1 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -32,7 +32,7 @@ extern AnimationHeader D_060002B8; const ActorInit En_Gm_InitVars = { ACTOR_EN_GM, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(EnGm), @@ -62,8 +62,8 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 5, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; void EnGm_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -115,7 +115,7 @@ void func_80A3D838(EnGm* this, GlobalContext* globalCtx) { this->actor.draw = EnGm_Draw; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->actor, 0.05f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->eyeTexIndex = 0; @@ -172,8 +172,8 @@ void func_80A3DB04(EnGm* this, GlobalContext* globalCtx) { f32 dz; Player* player = PLAYER; - dx = this->talkPos.x - player->actor.posRot.pos.x; - dz = this->talkPos.z - player->actor.posRot.pos.z; + dx = this->talkPos.x - player->actor.world.pos.x; + dz = this->talkPos.z - player->actor.world.pos.z; if (Flags_GetSwitch(globalCtx, this->actor.params)) { EnGm_SetTextID(this); @@ -200,8 +200,8 @@ void func_80A3DC44(EnGm* this, GlobalContext* globalCtx) { EnGm_SetTextID(this); - dx = this->talkPos.x - player->actor.posRot.pos.x; - dz = this->talkPos.z - player->actor.posRot.pos.z; + dx = this->talkPos.x - player->actor.world.pos.x; + dz = this->talkPos.z - player->actor.world.pos.z; if (func_8002F194(&this->actor, globalCtx)) { switch (func_80A3D7C8()) { @@ -278,9 +278,9 @@ void func_80A3DFBC(EnGm* this, GlobalContext* globalCtx) { gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->objGmBankIndex].segment); this->timer++; this->actionFunc(this, globalCtx); - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; EnGm_UpdateEye(this); SkelAnime_Update(&this->skelAnime); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -298,7 +298,7 @@ void func_80A3E090(EnGm* this) { Matrix_Push(); Matrix_Translate(0.0f, 0.0f, 2600.0f, MTXMODE_APPLY); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, MTXMODE_APPLY); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, MTXMODE_APPLY); vec1.x = vec1.y = vec1.z = 0.0f; Matrix_MultVec3f(&vec1, &vec2); this->collider.dim.pos.x = vec2.x; @@ -307,15 +307,15 @@ void func_80A3E090(EnGm* this) { Matrix_Pull(); Matrix_Push(); Matrix_Translate(0.0f, 0.0f, 4300.0f, MTXMODE_APPLY); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, MTXMODE_APPLY); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, MTXMODE_APPLY); vec1.x = vec1.y = vec1.z = 0.0f; Matrix_MultVec3f(&vec1, &this->talkPos); Matrix_Pull(); Matrix_Translate(0.0f, 0.0f, 3800.0f, MTXMODE_APPLY); - Matrix_RotateRPY(this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, MTXMODE_APPLY); + Matrix_RotateRPY(this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, MTXMODE_APPLY); vec1.x = vec1.y = vec1.z = 0.0f; - Matrix_MultVec3f(&vec1, &this->actor.posRot2.pos); - this->actor.posRot2.pos.y += 100.0f; + Matrix_MultVec3f(&vec1, &this->actor.focus.pos); + this->actor.focus.pos.y += 100.0f; } void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 2bbb9681c5..5e36f29a97 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -22,7 +22,7 @@ extern UNK_TYPE D_06010590; /* const ActorInit En_Go_InitVars = { ACTOR_EN_GO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(EnGo), 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 aec705dd5d..2e3abc7699 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_0600FEF0; /* const ActorInit En_Go2_InitVars = { ACTOR_EN_GO2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OF1D_MAP, sizeof(EnGo2), 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 fc874ab498..497ff22608 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06003D78; /* const ActorInit En_Goma_InitVars = { ACTOR_BOSS_GOMA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GOL, sizeof(EnGoma), 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 05754ba2b7..f408b1cbb5 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -34,7 +34,7 @@ void func_80A4DC00(EnGoroiwa* this, GlobalContext* globalCtx); const ActorInit En_Goroiwa_InitVars = { ACTOR_EN_GOROIWA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GOROIWA, sizeof(EnGoroiwa), @@ -83,9 +83,9 @@ void func_80A4BCA0(EnGoroiwa* this) { static f32 colliderHeightOffset[] = { 0.0f, 59.5f }; Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; - worldSphere->center.x = this->actor.posRot.pos.x; - worldSphere->center.y = this->actor.posRot.pos.y + colliderHeightOffset[(this->actor.params >> 10) & 1]; - worldSphere->center.z = this->actor.posRot.pos.z; + worldSphere->center.x = this->actor.world.pos.x; + worldSphere->center.y = this->actor.world.pos.y + colliderHeightOffset[(this->actor.params >> 10) & 1]; + worldSphere->center.z = this->actor.world.pos.z; } void func_80A4BD04(EnGoroiwa* this, GlobalContext* globalCtx) { @@ -138,7 +138,7 @@ void func_80A4BE54(EnGoroiwa* this, GlobalContext* globalCtx) { nextPosF.y = nextPos->y; nextPosF.z = nextPos->z; - this->actor.posRot.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &nextPosF); + this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &nextPosF); } void func_80A4BF28(EnGoroiwa* this, GlobalContext* globalCtx, Vec3f* arg2) { @@ -218,9 +218,9 @@ void func_80A4C1C4(EnGoroiwa* this, GlobalContext* globalCtx, s32 waypoint) { Path* path = &globalCtx->setupPathList[this->actor.params & 0xFF]; Vec3s* pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + waypoint; - this->actor.posRot.pos.x = pointPos->x; - this->actor.posRot.pos.y = pointPos->y; - this->actor.posRot.pos.z = pointPos->z; + this->actor.world.pos.x = pointPos->x; + this->actor.world.pos.y = pointPos->y; + this->actor.world.pos.z = pointPos->z; } void func_80A4C264(EnGoroiwa* this) { @@ -296,9 +296,9 @@ s32 func_80A4C6C8(EnGoroiwa* this, GlobalContext* globalCtx) { func_8002D868(&this->actor); path = &globalCtx->setupPathList[this->actor.params & 0xFF]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; - result = Math_StepToF(&this->actor.posRot.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)) & 1; - result &= Math_StepToF(&this->actor.posRot.pos.z, nextPointPos->z, fabsf(this->actor.velocity.z)); - this->actor.posRot.pos.y += this->actor.velocity.y; + result = Math_StepToF(&this->actor.world.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)) & 1; + result &= Math_StepToF(&this->actor.world.pos.z, nextPointPos->z, fabsf(this->actor.velocity.z)); + this->actor.world.pos.y += this->actor.velocity.y; return result; } @@ -315,8 +315,8 @@ s32 func_80A4C814(EnGoroiwa* this, GlobalContext* globalCtx) { nextPointPosF.y = nextPointPos->y; nextPointPosF.z = nextPointPos->z; Math_StepToF(&this->actor.speedXZ, mREG(12) * 0.01f, 0.3f); - if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.posRot.pos) < 25.0f) { - Math_Vec3f_Diff(&nextPointPosF, &this->actor.posRot.pos, &posDiff); + if (Math3D_Vec3fDistSq(&nextPointPosF, &this->actor.world.pos) < 25.0f) { + Math_Vec3f_Diff(&nextPointPosF, &this->actor.world.pos, &posDiff); } else { posDiff.x = nextPointPosF.x - currentPointPos->x; posDiff.y = nextPointPosF.y - currentPointPos->y; @@ -326,9 +326,9 @@ s32 func_80A4C814(EnGoroiwa* this, GlobalContext* globalCtx) { this->actor.velocity.x *= this->actor.speedXZ; this->actor.velocity.y *= this->actor.speedXZ; this->actor.velocity.z *= this->actor.speedXZ; - result = Math_StepToF(&this->actor.posRot.pos.x, nextPointPosF.x, fabsf(this->actor.velocity.x)) & 1; - result &= Math_StepToF(&this->actor.posRot.pos.y, nextPointPosF.y, fabsf(this->actor.velocity.y)); - result &= Math_StepToF(&this->actor.posRot.pos.z, nextPointPosF.z, fabsf(this->actor.velocity.z)); + result = Math_StepToF(&this->actor.world.pos.x, nextPointPosF.x, fabsf(this->actor.velocity.x)) & 1; + result &= Math_StepToF(&this->actor.world.pos.y, nextPointPosF.y, fabsf(this->actor.velocity.y)); + result &= Math_StepToF(&this->actor.world.pos.z, nextPointPosF.z, fabsf(this->actor.velocity.z)); return result; } @@ -338,9 +338,9 @@ s32 func_80A4CA50(EnGoroiwa* this, GlobalContext* globalCtx) { Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Math_StepToF(&this->actor.velocity.y, (mREG(12) * 0.01f) * 0.5f, 0.18f); - this->actor.posRot.pos.x = nextPointPos->x; - this->actor.posRot.pos.z = nextPointPos->z; - return Math_StepToF(&this->actor.posRot.pos.y, nextPointPos->y, fabsf(this->actor.velocity.y)); + this->actor.world.pos.x = nextPointPos->x; + this->actor.world.pos.z = nextPointPos->z; + return Math_StepToF(&this->actor.world.pos.y, nextPointPos->y, fabsf(this->actor.velocity.y)); } s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { @@ -363,14 +363,14 @@ s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { nextPointY = nextPointPos->y; Math_StepToF(&this->actor.velocity.y, -14.0f, 1.0f); - this->actor.posRot.pos.x = nextPointPos->x; - this->actor.posRot.pos.z = nextPointPos->z; - thisY = this->actor.posRot.pos.y; + this->actor.world.pos.x = nextPointPos->x; + this->actor.world.pos.z = nextPointPos->z; + thisY = this->actor.world.pos.y; if (1) {} - this->actor.posRot.pos.y += this->actor.velocity.y; - if (this->actor.velocity.y < 0.0f && this->actor.posRot.pos.y <= nextPointY) { + this->actor.world.pos.y += this->actor.velocity.y; + if (this->actor.velocity.y < 0.0f && this->actor.world.pos.y <= nextPointY) { if (this->unk_1C6 == 0) { - if (this->actor.xzDistToLink < 600.0f) { + if (this->actor.xzDistToPlayer < 600.0f) { quakeIdx = Quake_Add(ACTIVE_CAM, 3); Quake_SetSpeed(quakeIdx, -0x3CB0); Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0); @@ -378,17 +378,17 @@ s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { } this->unk_1C0 = 0.0f; if (!(this->unk_1D3 & 0x10)) { - sp5C.x = this->actor.posRot.pos.x; - sp5C.y = this->actor.posRot.pos.y + 50.0f; - sp5C.z = this->actor.posRot.pos.z; + sp5C.x = this->actor.world.pos.x; + sp5C.y = this->actor.world.pos.y + 50.0f; + sp5C.z = this->actor.world.pos.z; temp_f0_2 = BgCheck_EntityRaycastFloor5(globalCtx, &globalCtx->colCtx, &sp68, &sp50, &this->actor, &sp5C); // temp needed to match - temp = temp_f0_2 - (this->actor.posRot.pos.y - 59.5f); + temp = temp_f0_2 - (this->actor.world.pos.y - 59.5f); if (fabsf(temp) < 15.0f) { - sp44.x = this->actor.posRot.pos.x; + sp44.x = this->actor.world.pos.x; sp44.y = temp_f0_2 + 10.0f; - sp44.z = this->actor.posRot.pos.z; + sp44.z = this->actor.world.pos.z; EnGoroiwa_SpawnDust(globalCtx, &sp44); } } @@ -398,17 +398,17 @@ s32 func_80A4CB78(EnGoroiwa* this, GlobalContext* globalCtx) { } this->unk_1C6 += 1; this->actor.velocity.y *= -0.3f; - this->actor.posRot.pos.y = nextPointY - ((this->actor.posRot.pos.y - nextPointY) * 0.3f); + this->actor.world.pos.y = nextPointY - ((this->actor.world.pos.y - nextPointY) * 0.3f); } if (this->unk_1C6 == 0 && - WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.posRot.pos.x, this->actor.posRot.pos.z, + WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, &waterBox) && - this->actor.posRot.pos.y <= ySurface) { + this->actor.world.pos.y <= ySurface) { this->unk_1D3 |= 0x10; if (ySurface < thisY) { - sp30.x = this->actor.posRot.pos.x; + sp30.x = this->actor.world.pos.x; sp30.y = ySurface; - sp30.z = this->actor.posRot.pos.z; + sp30.z = this->actor.world.pos.z; EnGoroiwa_SpawnWaterEffects(globalCtx, &sp30); this->actor.velocity.y *= 0.2f; } @@ -432,7 +432,7 @@ void func_80A4CED8(EnGoroiwa* this, GlobalContext* globalCtx) { if (this->unk_1D3 & 8) { sp8C = this->unk_1BC; } else { - this->unk_1BC = Math3D_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.pos4) * 0.016806724f; + this->unk_1BC = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.prevPos) * 0.016806724f; sp8C = this->unk_1BC; } sp8C *= this->unk_1C0; @@ -478,7 +478,7 @@ void func_80A4D0FC(EnGoroiwa* this, GlobalContext* globalCtx) { s16 angle1; s16 angle2; s32 pad; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; Vec3f effectPos; Vec3f fragmentVelocity; f32 temp_f24; @@ -539,8 +539,8 @@ void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, D_80A4DF10[(this->actor.params >> 10) & 1], ActorShadow_DrawFunc_Circle, 9.4f); - this->actor.shape.unk_14 = 200; + ActorShape_Init(&this->actor.shape, D_80A4DF10[(this->actor.params >> 10) & 1], ActorShadow_DrawCircle, 9.4f); + this->actor.shape.shadowAlpha = 200; EnGoroiwa_SetSpeed(this, globalCtx); func_80A4C188(this, globalCtx); func_80A4C1C4(this, globalCtx, 0); @@ -550,7 +550,7 @@ void EnGoroiwa_Init(Actor* thisx, GlobalContext* globalCtx) { // Translation: (Goroiwa) osSyncPrintf("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, this->actor.params & 0xFF, (this->actor.params >> 8) & 3, (this->actor.params >> 10) & 1, - this->actor.initPosRot.rot.z & 1); + this->actor.home.rot.z & 1); } void EnGoroiwa_Destroy(Actor* thisx, GlobalContext* globalCtx2) { @@ -577,22 +577,22 @@ void func_80A4D624(EnGoroiwa* this, GlobalContext* globalCtx) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; this->unk_1D3 &= ~4; - yawDiff = this->actor.yawTowardsLink - this->actor.posRot.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if (yawDiff > -0x4000 && yawDiff < 0x4000) { this->unk_1D3 |= 4; - if ((this->actor.params >> 10) & 1 || (this->actor.initPosRot.rot.z & 1) != 1) { + if ((this->actor.params >> 10) & 1 || (this->actor.home.rot.z & 1) != 1) { func_80A4C164(this); func_80A4BE54(this, globalCtx); } } - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 0); + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 0); osSyncPrintf(VT_FGCOL(CYAN)); // Translation: Player knocked down osSyncPrintf("Player ぶっ飛ばし\n"); osSyncPrintf(VT_RST); D_80A4DF20[(this->actor.params >> 10) & 1](this); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); - if ((this->actor.initPosRot.rot.z & 1) == 1) { + if ((this->actor.home.rot.z & 1) == 1) { this->collisionTimer = 50; } } else if (D_80A4DF18[(this->actor.params >> 10) & 1](this, globalCtx)) { @@ -635,7 +635,7 @@ void func_80A4D8CC(EnGoroiwa* this) { void func_80A4D944(EnGoroiwa* this, GlobalContext* globalCtx) { func_80A4C6C8(this, globalCtx); if (this->actor.bgCheckFlags & 1 && this->actor.velocity.y < 0.0f) { - if (this->unk_1D3 & 4 && (this->actor.initPosRot.rot.z & 1) == 1) { + if (this->unk_1D3 & 4 && (this->actor.home.rot.z & 1) == 1) { func_80A4C164(this); func_80A4BE54(this, globalCtx); } @@ -649,7 +649,7 @@ void func_80A4D9DC(EnGoroiwa* this) { this->actionFunc = func_80A4DA3C; this->actor.speedXZ = 0.0f; func_80A4BD70(this, 2); - this->waitTimer = waitDurations[this->actor.initPosRot.rot.z & 1]; + this->waitTimer = waitDurations[this->actor.home.rot.z & 1]; this->unk_1C0 = 0.0f; } @@ -672,9 +672,9 @@ void func_80A4DA7C(EnGoroiwa* this) { void func_80A4DAD0(EnGoroiwa* this, GlobalContext* globalCtx) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 4); + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); - if ((this->actor.initPosRot.rot.z & 1) == 1) { + if ((this->actor.home.rot.z & 1) == 1) { this->collisionTimer = 50; } } else if (func_80A4CA50(this, globalCtx)) { @@ -697,9 +697,9 @@ void func_80A4DB90(EnGoroiwa* this) { void func_80A4DC00(EnGoroiwa* this, GlobalContext* globalCtx) { if (this->collider.base.atFlags & AT_HIT) { this->collider.base.atFlags &= ~AT_HIT; - func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsLink, 0.0f, 4); + func_8002F6D4(globalCtx, &this->actor, 2.0f, this->actor.yawTowardsPlayer, 0.0f, 4); func_8002F7DC(&PLAYER->actor, NA_SE_PL_BODY_HIT); - if ((this->actor.initPosRot.rot.z & 1) == 1) { + if ((this->actor.home.rot.z & 1) == 1) { this->collisionTimer = 50; } } else if (func_80A4CB78(this, globalCtx)) { @@ -723,15 +723,15 @@ void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); switch ((this->actor.params >> 10) & 1) { case 1: - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 0x1C); break; case 0: - this->actor.groundY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp30, - &this->actor, &this->actor.posRot.pos); + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp30, + &this->actor, &this->actor.world.pos); break; } func_80A4CED8(this, globalCtx); - if (this->actor.xzDistToLink < 300.0f) { + if (this->actor.xzDistToPlayer < 300.0f) { func_80A4BCA0(this); if (this->unk_1D3 & 1 && this->collisionTimer <= 0) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 2d10a0cd88..06c1485c73 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -28,7 +28,7 @@ extern Gfx D_06000A60[]; const ActorInit En_Gs_InitVars = { ACTOR_EN_GS, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GS, sizeof(EnGs), @@ -107,8 +107,8 @@ void EnGs_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); CollisionCheck_SetInfo2(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - thisx->unk_1F = 6; - this->unk_1D8 = thisx->posRot.pos; + thisx->targetMode = 6; + this->unk_1D8 = thisx->world.pos; this->actionFunc = func_80A4F734; this->unk_1B4[0].x = 1.0f; this->unk_1B4[0].y = 1.0f; @@ -145,7 +145,7 @@ void func_80A4E470(EnGs* this, GlobalContext* globalCtx) { Player* player = PLAYER; bREG(15) = 0; - if (this->actor.xzDistToLink <= 100.0f) { + if (this->actor.xzDistToPlayer <= 100.0f) { bREG(15) = 1; if (this->unk_19D == 0) { player->stateFlags2 |= 0x800000; @@ -159,12 +159,12 @@ void func_80A4E470(EnGs* this, GlobalContext* globalCtx) { if ((globalCtx->msgCtx.unk_E3F2 == 6) || (globalCtx->msgCtx.unk_E3F2 == 7) || (globalCtx->msgCtx.unk_E3F2 == 8) || (globalCtx->msgCtx.unk_E3F2 == 9) || (globalCtx->msgCtx.unk_E3F2 == 10)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_HEAL_TIMED); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, FAIRY_HEAL_TIMED); Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } else if (globalCtx->msgCtx.unk_E3F2 == 11) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_HEAL_BIG); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z, 0, 0, 0, FAIRY_HEAL_BIG); Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } this->unk_19D = 0; @@ -348,9 +348,9 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) { dustVelocity.x = Rand_CenteredFloat(15.0f); dustVelocity.y = Rand_ZeroFloat(-1.0f); dustVelocity.z = Rand_CenteredFloat(15.0f); - dustPos.x = this->actor.posRot.pos.x + (dustVelocity.x + dustVelocity.x); - dustPos.y = this->actor.posRot.pos.y + 7.0f; - dustPos.z = this->actor.posRot.pos.z + (dustVelocity.z + dustVelocity.z); + dustPos.x = this->actor.world.pos.x + (dustVelocity.x + dustVelocity.x); + dustPos.y = this->actor.world.pos.y + 7.0f; + dustPos.z = this->actor.world.pos.z + (dustVelocity.z + dustVelocity.z); func_8002836C(globalCtx, &dustPos, &dustVelocity, &dustAccel, &dustPrim, &dustEnv, (s16)Rand_ZeroFloat(50.0f) + 200, 40, 15); } @@ -367,11 +367,11 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) { } if (this->unk_19F == 4) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 3); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 3); if (this->actor.bgCheckFlags & 0x18) { - bomb2Pos.x = this->actor.posRot.pos.x; - bomb2Pos.y = this->actor.posRot.pos.y; - bomb2Pos.z = this->actor.posRot.pos.z; + bomb2Pos.x = this->actor.world.pos.x; + bomb2Pos.y = this->actor.world.pos.y; + bomb2Pos.z = this->actor.world.pos.z; Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION); EffectSsBomb2_SpawnLayered(globalCtx, &bomb2Pos, &bomb2Velocity, &bomb2Accel, 100, 20); this->unk_200 = 10; @@ -382,7 +382,7 @@ void func_80A4ED34(EnGs* this, GlobalContext* globalCtx) { } Actor_MoveForward(&this->actor); - if (this->actor.yDistToLink < -12000.0f) { + if (this->actor.yDistToPlayer < -12000.0f) { Actor_Kill(&this->actor); } } @@ -522,7 +522,7 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnGs* this = THIS; - Actor_SetHeight(&this->actor, 23.0f); + Actor_SetFocus(&this->actor, 23.0f); if (globalCtx) {}; if (!(this->unk_19E & 0x10)) { if (globalCtx) {}; 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 f41c037e21..0441867574 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -22,7 +22,7 @@ void func_80A505CC(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Guest_InitVars = { ACTOR_EN_GUEST, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_BOJ, sizeof(EnGuest), @@ -45,8 +45,8 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 6, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), + ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; static UNK_PTR D_80A50BA4[] = { @@ -101,7 +101,7 @@ void EnGuest_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); this->unk_30E = 0; this->unk_30D = 0; @@ -137,7 +137,7 @@ void func_80A5046C(EnGuest* this) { void func_80A50518(EnGuest* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx) != 0) { this->actionFunc = func_80A5057C; - } else if (this->actor.xzDistToLink < 100.0f) { + } else if (this->actor.xzDistToPlayer < 100.0f) { func_8002F2CC(&this->actor, globalCtx, 100.0f); } } @@ -161,7 +161,7 @@ void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) { func_80A5046C(this); this->actionFunc(this, globalCtx); - this->unk_2A0.unk_18 = player->actor.posRot.pos; + this->unk_2A0.unk_18 = player->actor.world.pos; if (LINK_IS_ADULT) { this->unk_2A0.unk_14 = 10.0f; } else { @@ -174,7 +174,7 @@ void func_80A505CC(Actor* thisx, GlobalContext* globalCtx) { gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->osAnimeBankIndex].segment); SkelAnime_Update(&this->skelAnime); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 69cc2436c6..44fa131e9c 100644 --- a/src/overlays/actors/ovl_En_Hata/z_en_hata.c +++ b/src/overlays/actors/ovl_En_Hata/z_en_hata.c @@ -17,7 +17,7 @@ void EnHata_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Hata_InitVars = { ACTOR_EN_HATA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_HATA, sizeof(EnHata), 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 009d7058ca..4bdff5068f 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -34,7 +34,7 @@ static s32 sPlayerIsCaught = false; const ActorInit En_Heishi1_InitVars = { 0, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi1), @@ -167,13 +167,13 @@ void EnHeishi1_Walk(EnHeishi1* this, GlobalContext* globalCtx) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - Math_ApproachF(&this->actor.posRot.pos.x, pointPos->x, 1.0f, this->moveSpeed); - Math_ApproachF(&this->actor.posRot.pos.z, pointPos->z, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.x, pointPos->x, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.z, pointPos->z, 1.0f, this->moveSpeed); Math_ApproachF(&this->moveSpeed, this->moveSpeedTarget, 1.0f, this->moveSpeedMax); - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.shape.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * 10430.378f), 3, this->bodyTurnSpeed, 0); @@ -237,14 +237,14 @@ void EnHeishi1_MoveToLink(EnHeishi1* this, GlobalContext* globalCtx) { Player* player = PLAYER; SkelAnime_Update(&this->skelAnime); - Math_ApproachF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 1.0f, this->moveSpeed); - Math_ApproachF(&this->actor.posRot.pos.z, player->actor.posRot.pos.z, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.x, player->actor.world.pos.x, 1.0f, this->moveSpeed); + Math_ApproachF(&this->actor.world.pos.z, player->actor.world.pos.z, 1.0f, this->moveSpeed); Math_ApproachF(&this->moveSpeed, 6.0f, 1.0f, 0.4f); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, this->bodyTurnSpeed, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, this->bodyTurnSpeed, 0); Math_ApproachF(&this->bodyTurnSpeed, 3000.0f, 1.0f, 300.0f); Math_ApproachZeroF(&this->headAngle, 0.5f, 2000.0f); - if (this->actor.xzDistToLink < 70.0f) { + if (this->actor.xzDistToPlayer < 70.0f) { this->actionFunc = EnHeishi1_SetupTurnTowardLink; } } @@ -332,7 +332,7 @@ void EnHeishi1_TurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->type != 5) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, this->bodyTurnSpeed, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, this->bodyTurnSpeed, 0); Math_ApproachF(&this->bodyTurnSpeed, 3000.0f, 1.0f, 300.0f); Math_ApproachZeroF(&this->headAngle, 0.5f, 2000.0f); } @@ -378,7 +378,7 @@ void EnHeishi1_SetupWaitNight(EnHeishi1* this, GlobalContext* globalCtx) { void EnHeishi1_WaitNight(EnHeishi1* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { func_8010B680(globalCtx, 0x702D, &this->actor); func_80078884(NA_SE_SY_FOUND); // "Discovered!" @@ -429,9 +429,9 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) { Vec3f searchBallMult = { 0.0f, 0.0f, 20.0f }; Vec3f searchBallPos; - searchBallPos.x = this->actor.posRot.pos.x; - searchBallPos.y = this->actor.posRot.pos.y + 60.0f; - searchBallPos.z = this->actor.posRot.pos.z; + searchBallPos.x = this->actor.world.pos.x; + searchBallPos.y = this->actor.world.pos.y + 60.0f; + searchBallPos.z = this->actor.world.pos.z; Matrix_Push(); Matrix_RotateY(((this->actor.shape.rot.y + this->headAngle) / 32768.0f) * M_PI, 0); @@ -442,9 +442,9 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) { EffectSsSolderSrchBall_Spawn(globalCtx, &searchBallPos, &searchBallVel, &searchBallAccel, 2, &this->linkDetected); - if (this->actor.xzDistToLink < 60.0f) { + if (this->actor.xzDistToPlayer < 60.0f) { this->linkDetected = true; - } else if (this->actor.xzDistToLink < 70.0f) { + } else if (this->actor.xzDistToPlayer < 70.0f) { // this case probably exists to detect link making a jump sound // from slightly further away than the previous 60 unit check if (player->actor.velocity.y > -4.0f) { @@ -463,7 +463,7 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->actor.velocity.y > -3.9f)) { this->linkDetected = false; // this 60 unit height check is so the player doesnt get caught when on the upper path - if (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 60.0f) { + if (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 60.0f) { func_80078884(NA_SE_SY_FOUND); // "Discovered!" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 発見! ☆☆☆☆☆ \n" VT_RST); @@ -500,11 +500,11 @@ void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi1_OverrideLimbDraw, NULL, this); - func_80033C30(&this->actor.posRot.pos, &matrixScale, 0xFF, globalCtx); + func_80033C30(&this->actor.world.pos, &matrixScale, 0xFF, globalCtx); if ((this->path == BREG(1)) && (BREG(0) != 0)) { - DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 100.0f, this->actor.posRot.pos.z, - 17000, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, + 17000, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } 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 580fc91f01..06d7388d7e 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -58,7 +58,7 @@ extern Gfx D_06002C10[]; // 2D Guard in Window const ActorInit En_Heishi2_InitVars = { ACTOR_EN_HEISHI2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi2), @@ -99,7 +99,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { if ((this->initParams == 6) || (this->initParams == 9)) { this->actor.draw = func_80A54C6C; this->actor.flags &= -2; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 6); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, 6); if (this->initParams == 6) { this->actionFunc = func_80A531CC; @@ -110,12 +110,12 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.02f); - this->unk_274 = this->actor.posRot.pos; - this->actor.posRot.rot.y = 0x7918; - this->actor.posRot.pos.x += 90.0f; - this->actor.posRot.pos.y -= 60.0f; - this->actor.posRot.pos.z += 90.0f; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->unk_274 = this->actor.world.pos; + this->actor.world.rot.y = 0x7918; + this->actor.world.pos.x += 90.0f; + this->actor.world.pos.y -= 60.0f; + this->actor.world.pos.z += 90.0f; + this->actor.shape.rot.y = this->actor.world.rot.y; Collider_DestroyCylinder(globalCtx, &this->collider); func_8002DF54(globalCtx, 0, 8); this->actor.flags |= 0x11; @@ -123,7 +123,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { } } else { this->unk_2E0 = 60.0f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17); collider = &this->collider; Collider_InitCylinder(globalCtx, collider); @@ -131,7 +131,7 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider.dim.yShift = 0; this->collider.dim.radius = 0xF; this->collider.dim.height = 0x46; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; switch (this->initParams) { @@ -291,7 +291,7 @@ void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx) { frameCount = this->skelAnime.curFrame; thisx = &this->actor; - actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; SkelAnime_Update(&this->skelAnime); if ((frameCount >= 12.0f) && (!this->audioFlag)) { Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT); @@ -423,9 +423,9 @@ void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx) { player->actor.textId = 0x200F; // "I don't want that!" } } else { - yawDiffTemp = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiffTemp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiff = ABS(yawDiffTemp); - if (!(120.0f < this->actor.xzDistToLink) && (yawDiff < 0x4300)) { + if (!(120.0f < this->actor.xzDistToPlayer) && (yawDiff < 0x4300)) { func_8002F298(&this->actor, globalCtx, 100.0f, EXCH_ITEM_LETTER_ZELDA); } } @@ -456,7 +456,7 @@ void func_80A53D0C(EnHeishi2* this, GlobalContext* globalCtx) { BgGateShutter* gate; frameCount = this->skelAnime.curFrame; - gate = (BgGateShutter*)globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + gate = (BgGateShutter*)globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; SkelAnime_Update(&this->skelAnime); if (12.0f <= frameCount) { if (this->audioFlag == 0) { @@ -621,7 +621,7 @@ void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) { frameCount = this->skelAnime.curFrame; thisx = &this->actor; - gate = (BgGateShutter*)(globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first); + gate = (BgGateShutter*)(globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head); SkelAnime_Update(&this->skelAnime); if ((frameCount >= 12.0f) && (!this->audioFlag)) { Audio_PlayActorSound2(thisx, NA_SE_EV_SPEAR_HIT); @@ -651,7 +651,7 @@ void func_80A543A0(EnHeishi2* this, GlobalContext* globalCtx) { void func_80A544AC(EnHeishi2* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.z, -6100, 5, this->unk_2E4, 0); Math_ApproachF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f); - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; if (this->actor.shape.rot.z < -6000) { func_8010B680(globalCtx, 0x708F, NULL); this->actor.flags |= 0x10000; @@ -673,7 +673,7 @@ void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) { pos.x = Rand_CenteredFloat(20.0f) + this->unk_274.x; pos.y = Rand_CenteredFloat(20.0f) + (this->unk_274.y - 40.0f); pos.z = Rand_CenteredFloat(20.0f) + (this->unk_274.z - 20.0f); - rotY = Rand_CenteredFloat(7000.0f) + thisx->yawTowardsLink; + rotY = Rand_CenteredFloat(7000.0f) + thisx->yawTowardsPlayer; bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, pos.x, pos.y, pos.z, 0, rotY, 0, 0); if (bomb != NULL) { bomb->actor.speedXZ = Rand_CenteredFloat(5.0f) + 10.0f; @@ -689,7 +689,7 @@ void func_80A5455C(EnHeishi2* this, GlobalContext* globalCtx) { void func_80A546DC(EnHeishi2* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.z, 200, 5, this->unk_2E4, 0); Math_ApproachF(&this->unk_2E4, 3000.0f, 1.0f, 500.0f); - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; if (this->actor.shape.rot.z > 0) { Actor_Kill(&this->actor); } @@ -750,8 +750,8 @@ void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) { } if (((this->initParams != 2) && (this->initParams != 5)) || - ((yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)), - !(this->actor.xzDistToLink > 120.0f)) && + ((yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)), + !(this->actor.xzDistToPlayer > 120.0f)) && (yawDiff < 0x4300))) { func_8002F2F4(&this->actor, globalCtx); } @@ -784,11 +784,11 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) { EnHeishi2* this = THIS; s32 i; - Actor_SetHeight(&this->actor, this->unk_2E0); + Actor_SetFocus(&this->actor, this->unk_2E0); if ((this->initParams == 2) || (this->initParams == 5)) { - this->actor.posRot2.pos.y = 70.0f; - Actor_SetHeight(&this->actor, 70.0f); - func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.posRot2.pos); + this->actor.focus.pos.y = 70.0f; + Actor_SetFocus(&this->actor, 70.0f); + func_80038290(globalCtx, &this->actor, &this->unk_260, &this->unk_26C, this->actor.focus.pos); } this->unk_2FC++; @@ -806,7 +806,7 @@ void EnHeishi2_Update(Actor* thisx, GlobalContext* globalCtx) { case 9: break; default: - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 0x1D); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); break; 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 33f8a17b9c..e73b40387e 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -32,7 +32,7 @@ static s16 sPlayerCaught = 0; const ActorInit En_Heishi3_InitVars = { ACTOR_EN_HEISHI3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi3), @@ -70,22 +70,22 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_278 = 0; } else { this->unk_278 = 1; - if (this->actor.posRot.pos.x < -290.0f) { + if (this->actor.world.pos.x < -290.0f) { this->unk_278 = 2; } } Actor_SetScale(&this->actor, 0.01f); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); // "Castle Gate Soldier - Power Up" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 城門兵パワーアップ ☆☆☆☆☆ \n" VT_RST); this->actor.gravity = -3.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->actionFunc = EnHeishi3_SetupGuardType; } @@ -117,7 +117,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx) player = PLAYER; SkelAnime_Update(&this->skelAnime); - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiffNew = ABS(yawDiff); if (yawDiffNew < 0x4300) { if (gSaveContext.nightFlag == 0) { @@ -132,8 +132,8 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx) sightRange = 100.0f; } } - if ((this->actor.xzDistToLink < sightRange) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) && (sPlayerCaught == 0)) { + if ((this->actor.xzDistToPlayer < sightRange) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f) && (sPlayerCaught == 0)) { sPlayerCaught = 1; func_8010B680(globalCtx, 0x702D, &this->actor); // "Hey you! Stop! You, kid, over there!" func_80078884(NA_SE_SY_FOUND); @@ -150,15 +150,15 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, GlobalContext* globalCtx) Player* player = PLAYER; SkelAnime_Update(&this->skelAnime); - if ((player->actor.posRot.pos.x < -190.0f) && (player->actor.posRot.pos.x > -380.0f) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) && - (player->actor.posRot.pos.z < 1020.0f) && (player->actor.posRot.pos.z > 700.0f) && (sPlayerCaught == 0)) { + if ((player->actor.world.pos.x < -190.0f) && (player->actor.world.pos.x > -380.0f) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f) && + (player->actor.world.pos.z < 1020.0f) && (player->actor.world.pos.z > 700.0f) && (sPlayerCaught == 0)) { if (this->unk_278 == 1) { - if ((player->actor.posRot.pos.x < -290.0f)) { + if ((player->actor.world.pos.x < -290.0f)) { return; } } else { - if (player->actor.posRot.pos.x > -290.0f) { + if (player->actor.world.pos.x > -290.0f) { return; } } @@ -190,7 +190,7 @@ void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) { this->actionFunc = EnHeishi3_ResetAnimationToIdle; this->actor.speedXZ = 0.0f; } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 5, 3000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 3000, 0); } } @@ -218,15 +218,15 @@ void EnHeishi3_Update(Actor* thisx, GlobalContext* globalCtx) { EnHeishi3* this = THIS; s32 pad; - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); this->unk_274 += 1; if (this->caughtTimer != 0) { this->caughtTimer -= 1; } this->actionFunc(this, globalCtx); - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1C); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } 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 4af73b3871..676155543e 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -24,7 +24,7 @@ void func_80A56ACC(EnHeishi4* this, GlobalContext* globalCtx); const ActorInit En_Heishi4_InitVars = { ACTOR_EN_HEISHI4, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SD, sizeof(EnHeishi4), @@ -68,15 +68,15 @@ void EnHeishi4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(thisx, 0.01f); this->type = thisx->params & 0xFF; thisx->colChkInfo.mass = MASS_IMMOVABLE; - this->pos = thisx->posRot.pos; - thisx->unk_1F = 6; + this->pos = thisx->world.pos; + thisx->targetMode = 6; if (this->type == HEISHI4_AT_MARKET_DYING) { this->height = 30.0f; ActorShape_Init(&thisx->shape, 0.0f, NULL, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_0600C444, this->jointTable, this->morphTable, 17); } else { this->height = 60.0f; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17); } Collider_InitCylinder(globalCtx, &this->collider); @@ -266,7 +266,7 @@ void func_80A56900(EnHeishi4* this, GlobalContext* globalCtx) { void func_80A56994(EnHeishi4* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - func_80038290(globalCtx, &this->actor, &this->unk_260.x, &this->unk_266.x, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_260.x, &this->unk_266.x, this->actor.focus.pos); if (this->unk_282 == func_8010BDBC(&globalCtx->msgCtx)) { if (func_80106BC8(globalCtx) != 0) { func_80106CCC(globalCtx); @@ -347,14 +347,14 @@ void EnHeishi4_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; - thisx->posRot.pos.x = this->pos.x; - thisx->posRot.pos.y = this->pos.y; - thisx->posRot.pos.z = this->pos.z; - Actor_SetHeight(thisx, this->height); + thisx->world.pos.x = this->pos.x; + thisx->world.pos.y = this->pos.y; + thisx->world.pos.z = this->pos.z; + Actor_SetFocus(thisx, this->height); if (this->type != HEISHI4_AT_MARKET_DYING) { - this->unk_28C.unk_18 = player->actor.posRot.pos; + this->unk_28C.unk_18 = player->actor.world.pos; if (LINK_IS_CHILD) { - this->unk_28C.unk_18.y = (player->actor.posRot.pos.y - 10.0f); + this->unk_28C.unk_18.y = (player->actor.world.pos.y - 10.0f); } func_80034A14(thisx, &this->unk_28C, 2, 4); this->unk_260 = this->unk_28C.unk_08; @@ -363,7 +363,7 @@ void EnHeishi4_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_27E += 1; this->actionFunc(this, globalCtx); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 10.0f, 10.0f, 30.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 10.0f, 10.0f, 30.0f, 0x1D); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } 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 cf8f3ae4d1..0adb524d4d 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -42,7 +42,7 @@ extern AnimationHeader D_06003128; const ActorInit En_Hintnuts_InitVars = { ACTOR_EN_HINTNUTS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_HINTNUTS, sizeof(EnHintnuts), @@ -79,7 +79,7 @@ static s16 sPuzzleCounter = 0; static InitChainEntry sInitChain[] = { ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 10, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), }; void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -90,7 +90,7 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.params == 0xA) { this->actor.flags &= ~5; } else { - ActorShape_Init(&this->actor.shape, 0x0, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&this->actor.shape, 0x0, ActorShadow_DrawCircle, 35.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060023B8, &D_06002F7C, this->jointTable, this->morphTable, 10); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -106,8 +106,8 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { } } EnHintnuts_SetupWait(this); - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HINTNUTS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.posRot.rot.y, 0, 0xA); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HINTNUTS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.world.rot.y, 0, 0xA); } } @@ -119,11 +119,11 @@ void EnHintnuts_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnHintnuts_HitByScrubProjectile1(EnHintnuts* this, GlobalContext* globalCtx) { - if (this->actor.textId != 0 && this->actor.type == ACTORTYPE_ENEMY && + if (this->actor.textId != 0 && this->actor.category == ACTORCAT_ENEMY && ((this->actor.params == 0) || (sPuzzleCounter == 2))) { this->actor.flags &= ~0x5; this->actor.flags |= 0x9; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_BG); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_BG); } } @@ -131,7 +131,7 @@ void EnHintnuts_SetupWait(EnHintnuts* this) { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06002B90, 0.0f); this->animFlagAndTimer = Rand_S16Offset(100, 50); this->collider.dim.height = 5; - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnHintnuts_Wait; } @@ -169,7 +169,7 @@ void EnHintnuts_HitByScrubProjectile2(EnHintnuts* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->collider.base.acFlags &= ~AC_ON; - if (this->actor.params > 0 && this->actor.params < 4 && this->actor.type == ACTORTYPE_ENEMY) { + if (this->actor.params > 0 && this->actor.params < 4 && this->actor.category == ACTORCAT_ENEMY) { if (sPuzzleCounter == -4) { sPuzzleCounter = 0; } @@ -204,12 +204,12 @@ void EnHintnuts_SetupLeave(EnHintnuts* this, GlobalContext* globalCtx) { Animation_MorphToLoop(&this->skelAnime, &D_06003128, -5.0f); this->actor.speedXZ = 3.0f; this->animFlagAndTimer = 100; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->collider.base.ocFlags1 &= ~OC1_ON; this->actor.flags |= 0x10; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0x0, 0x0, 0x0, 0x3); // recovery heart + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0x0, 0x0, 0x0, 0x3); // recovery heart this->actionFunc = EnHintnuts_Leave; } @@ -217,7 +217,7 @@ void EnHintnuts_SetupFreeze(EnHintnuts* this) { Animation_PlayLoop(&this->skelAnime, &D_060029BC); this->actor.flags &= ~1; func_8003426C(&this->actor, 0, 0xFF, 0, 100); - this->actor.dmgEffectTimer = 1; + this->actor.colorFilterTimer = 1; this->animFlagAndTimer = 0; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_FAINT); if (sPuzzleCounter == -3) { @@ -243,19 +243,19 @@ void EnHintnuts_Wait(EnHintnuts* this, GlobalContext* globalCtx) { } this->collider.dim.height = 5.0f + ((CLAMP(this->skelAnime.curFrame, 9.0f, 12.0f) - 9.0f) * 9.0f); - if (!hasSlowPlaybackSpeed && (this->actor.xzDistToLink < 120.0f)) { + if (!hasSlowPlaybackSpeed && (this->actor.xzDistToPlayer < 120.0f)) { EnHintnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { EnHintnuts_SetupBurrow(this); - } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToLink > 320.0f)) { + } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToPlayer > 320.0f)) { EnHintnuts_SetupLookAround(this); } else { EnHintnuts_SetupStand(this); } } - if (hasSlowPlaybackSpeed && 160.0f < this->actor.xzDistToLink && fabsf(this->actor.yDistToLink) < 120.0f && - ((this->animFlagAndTimer == 0) || (this->actor.xzDistToLink < 480.0f))) { + if (hasSlowPlaybackSpeed && 160.0f < this->actor.xzDistToPlayer && fabsf(this->actor.yDistToPlayer) < 120.0f && + ((this->animFlagAndTimer == 0) || (this->actor.xzDistToPlayer < 480.0f))) { this->skelAnime.playSpeed = 1.0f; } } @@ -265,7 +265,7 @@ void EnHintnuts_LookAround(EnHintnuts* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->animFlagAndTimer != 0) { this->animFlagAndTimer--; } - if ((this->actor.xzDistToLink < 120.0f) || (this->animFlagAndTimer == 0)) { + if ((this->actor.xzDistToPlayer < 120.0f) || (this->animFlagAndTimer == 0)) { EnHintnuts_SetupBurrow(this); } } @@ -276,9 +276,9 @@ void EnHintnuts_Stand(EnHintnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (!(this->animFlagAndTimer & 0x1000)) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } - if (this->actor.xzDistToLink < 120.0f || this->animFlagAndTimer == 0x1000) { + if (this->actor.xzDistToPlayer < 120.0f || this->animFlagAndTimer == 0x1000) { EnHintnuts_SetupBurrow(this); } else if (this->animFlagAndTimer == 0) { EnHintnuts_SetupThrowScrubProjectile(this); @@ -288,15 +288,15 @@ void EnHintnuts_Stand(EnHintnuts* this, GlobalContext* globalCtx) { void EnHintnuts_ThrowNut(EnHintnuts* this, GlobalContext* globalCtx) { Vec3f nutPos; - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); - if (this->actor.xzDistToLink < 120.0f) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); + if (this->actor.xzDistToPlayer < 120.0f) { EnHintnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { EnHintnuts_SetupStand(this); } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - nutPos.x = this->actor.posRot.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); - nutPos.y = this->actor.posRot.pos.y + 12.0f; - nutPos.z = this->actor.posRot.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); + nutPos.x = this->actor.world.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); + nutPos.y = this->actor.world.pos.y + 12.0f; + nutPos.z = this->actor.world.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_NUTSBALL, nutPos.x, nutPos.y, nutPos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 1) != NULL) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_THROW); @@ -314,16 +314,16 @@ void EnHintnuts_Burrow(EnHintnuts* this, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_ON; } - Math_ApproachF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 0.5f, 3.0f); - Math_ApproachF(&this->actor.posRot.pos.z, this->actor.initPosRot.pos.z, 0.5f, 3.0f); + Math_ApproachF(&this->actor.world.pos.x, this->actor.home.pos.x, 0.5f, 3.0f); + Math_ApproachF(&this->actor.world.pos.z, this->actor.home.pos.z, 0.5f, 3.0f); } void EnHintnuts_BeginRun(EnHintnuts* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - this->unk_196 = this->actor.yawTowardsLink + 0x8000; + this->unk_196 = this->actor.yawTowardsPlayer + 0x8000; EnHintnuts_SetupRun(this); } - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } void EnHintnuts_BeginFreeze(EnHintnuts* this, GlobalContext* globalCtx) { @@ -333,13 +333,13 @@ void EnHintnuts_BeginFreeze(EnHintnuts* this, GlobalContext* globalCtx) { } void EnHintnuts_CheckProximity(EnHintnuts* this, GlobalContext* globalCtx) { - if (this->actor.type != ACTORTYPE_ENEMY) { - if ((this->collider.base.ocFlags1 & OC1_HIT) || (this->actor.unk_10C != 0)) { + if (this->actor.category != ACTORCAT_ENEMY) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) { this->actor.flags |= 0x10000; } else { this->actor.flags &= ~0x10000; } - if (this->actor.xzDistToLink < 130.0f) { + if (this->actor.xzDistToPlayer < 130.0f) { this->actor.textId = this->textIdCopy; func_8002F2F4(&this->actor, globalCtx); } @@ -362,35 +362,35 @@ void EnHintnuts_Run(EnHintnuts* this, GlobalContext* globalCtx) { } Math_StepToF(&this->actor.speedXZ, 7.5f, 1.0f); - if (Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) { + if (Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_196, 1, 0xE38, 0xB6) == 0) { if (this->actor.bgCheckFlags & 0x20) { - this->unk_196 = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); + this->unk_196 = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } else if (this->actor.bgCheckFlags & 8) { - this->unk_196 = this->actor.wallPolyRot; + this->unk_196 = this->actor.wallYaw; } else if (this->animFlagAndTimer == 0) { - diffRotInit = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); - diffRot = diffRotInit - this->actor.yawTowardsLink; + diffRotInit = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); + diffRot = diffRotInit - this->actor.yawTowardsPlayer; if (ABS(diffRot) >= 0x2001) { this->unk_196 = diffRotInit; } else { phi_f0 = (0.0f <= (f32)diffRot) ? 1.0f : -1.0f; - this->unk_196 = (s16)((phi_f0 * -8192.0f) + (f32)this->actor.yawTowardsLink); + this->unk_196 = (s16)((phi_f0 * -8192.0f) + (f32)this->actor.yawTowardsPlayer); } } else { - this->unk_196 = (s16)(this->actor.yawTowardsLink + 0x8000); + this->unk_196 = (s16)(this->actor.yawTowardsPlayer + 0x8000); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; if (func_8002F194(&this->actor, globalCtx) != 0) { EnHintnuts_SetupTalk(this); - } else if (this->animFlagAndTimer == 0 && func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) < 20.0f && - fabsf(this->actor.posRot.pos.y - this->actor.initPosRot.pos.y) < 2.0f) { + } else if (this->animFlagAndTimer == 0 && Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 20.0f && + fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) { this->actor.speedXZ = 0.0f; - if (this->actor.type == ACTORTYPE_BG) { + if (this->actor.category == ACTORCAT_BG) { this->actor.flags &= ~0x00010009; this->actor.flags |= 0x5; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); } EnHintnuts_SetupBurrow(this); } else { @@ -400,7 +400,7 @@ void EnHintnuts_Run(EnHintnuts* this, GlobalContext* globalCtx) { void EnHintnuts_Talk(EnHintnuts* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x3, 0x400, 0x100); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x3, 0x400, 0x100); if (func_8010BDBC(&globalCtx->msgCtx) == 5) { EnHintnuts_SetupLeave(this, globalCtx); } @@ -417,10 +417,10 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_WALK); } if (this->actor.bgCheckFlags & 8) { - temp_a1 = this->actor.wallPolyRot; + temp_a1 = this->actor.wallYaw; } else { temp_a1 = - this->actor.yawTowardsLink - Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) - 0x8000; + this->actor.yawTowardsPlayer - Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) - 0x8000; if (ABS(temp_a1) >= 0x4001) { temp_a1 = Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000; } else { @@ -428,7 +428,7 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) { } } Math_ScaledStepToS(&this->actor.shape.rot.y, temp_a1, 0x800); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->animFlagAndTimer == 0) || (this->actor.projectedPos.z < 0.0f)) { func_80106CCC(globalCtx); if (this->actor.params == 3) { @@ -436,14 +436,14 @@ void EnHintnuts_Leave(EnHintnuts* this, GlobalContext* globalCtx) { sPuzzleCounter = 3; } if (this->actor.child != NULL) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORCAT_PROP); } Actor_Kill(&this->actor); } } void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) { - this->actor.dmgEffectTimer = 1; + this->actor.colorFilterTimer = 1; SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_FAINT); @@ -451,20 +451,20 @@ void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) { if (this->animFlagAndTimer == 0) { if (sPuzzleCounter == 3) { if (this->actor.child != NULL) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, this->actor.child, ACTORCAT_PROP); } this->animFlagAndTimer = 1; } else if (sPuzzleCounter == -4) { this->animFlagAndTimer = 2; } - } else if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y - 35.0f, 7.0f) != 0) { + } else if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 35.0f, 7.0f) != 0) { if (this->animFlagAndTimer == 1) { Actor_Kill(&this->actor); } else { this->actor.flags |= 1; this->actor.flags &= ~0x10; this->actor.colChkInfo.health = sColChkInfoInit.health; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; EnHintnuts_SetupWait(this); } } @@ -495,7 +495,8 @@ void EnHintnuts_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actionFunc != EnHintnuts_Freeze && this->actionFunc != EnHintnuts_BeginFreeze) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, + this->collider.dim.height, 0x1D); } Collider_UpdateCylinder(&this->actor, &this->collider); if (this->collider.base.acFlags & AC_ON) { @@ -503,12 +504,12 @@ void EnHintnuts_Update(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actionFunc == EnHintnuts_Wait) { - Actor_SetHeight(&this->actor, this->skelAnime.curFrame); + Actor_SetFocus(&this->actor, this->skelAnime.curFrame); } else if (this->actionFunc == EnHintnuts_Burrow) { - Actor_SetHeight(&this->actor, - 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_060024CC))); + Actor_SetFocus(&this->actor, + 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_060024CC))); } else { - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); } } } 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 f34ed6e29c..f4889ff8fb 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -27,7 +27,7 @@ void func_80A59618(EnHoll* this, GlobalContext* globalCtx); const ActorInit En_Holl_InitVars = { ACTOR_EN_HOLL, - ACTORTYPE_DOOR, + ACTORCAT_DOOR, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnHoll), @@ -141,7 +141,7 @@ void func_80A58DD4(EnHoll* this, GlobalContext* globalCtx) { f32 absZ; s32 transitionActorIdx; - func_8002DBD0(&this->actor, &vec, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &vec, &player->actor.world.pos); this->side = (vec.z < 0.0f) ? 0 : 1; absZ = fabsf(vec.z); if (vec.y > PLANE_Y_MIN && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH && @@ -185,7 +185,7 @@ void func_80A59014(EnHoll* this, GlobalContext* globalCtx) { f32 absZ; s32 side; - func_8002DBD0(&this->actor, &vec, (useViewEye) ? &globalCtx->view.eye : &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &vec, (useViewEye) ? &globalCtx->view.eye : &player->actor.world.pos); planeHalfWidth = (((this->actor.params >> 6) & 7) == 6) ? PLANE_HALFWIDTH : PLANE_HALFWIDTH_2; if (EnHoll_IsKokiriSetup8() || (vec.y > PLANE_Y_MIN && vec.y < PLANE_Y_MAX && fabsf(vec.x) < planeHalfWidth && fabsf(vec.z) < 100.0f && fabsf(vec.z) > 50.0f)) { @@ -206,10 +206,10 @@ void func_80A59014(EnHoll* this, GlobalContext* globalCtx) { // Vertical Planes void func_80A591C0(EnHoll* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 absY = fabsf(this->actor.yDistToLink); + f32 absY = fabsf(this->actor.yDistToPlayer); s32 transitionActorIdx; - if (this->actor.xzDistToLink < 500.0f && absY < 700.0f) { + if (this->actor.xzDistToPlayer < 500.0f && absY < 700.0f) { transitionActorIdx = (u16)this->actor.params >> 0xA; if (absY < 95.0f) { globalCtx->unk_11E18 = 0xFF; @@ -220,8 +220,8 @@ void func_80A591C0(EnHoll* this, GlobalContext* globalCtx) { } if (absY < 95.0f) { this->actor.room = globalCtx->transitionActorList[transitionActorIdx].sides[1].room; - Math_SmoothStepToF(&player->actor.posRot.pos.x, this->actor.posRot.pos.x, 1.0f, 50.0f, 10.0f); - Math_SmoothStepToF(&player->actor.posRot.pos.z, this->actor.posRot.pos.z, 1.0f, 50.0f, 10.0f); + Math_SmoothStepToF(&player->actor.world.pos.x, this->actor.world.pos.x, 1.0f, 50.0f, 10.0f); + Math_SmoothStepToF(&player->actor.world.pos.z, this->actor.world.pos.z, 1.0f, 50.0f, 10.0f); if (this->actor.room != globalCtx->roomCtx.curRoom.num && func_8009728C(globalCtx, &globalCtx->roomCtx, this->actor.room) != 0) { EnHoll_SetupAction(this, EnHoll_NextAction); @@ -241,7 +241,7 @@ void func_80A593A4(EnHoll* this, GlobalContext* globalCtx) { s32 side; s32 transitionActorIdx; - if ((this->actor.xzDistToLink < 120.0f) && (absY = fabsf(this->actor.yDistToLink), absY < 200.0f)) { + if ((this->actor.xzDistToPlayer < 120.0f) && (absY = fabsf(this->actor.yDistToPlayer), absY < 200.0f)) { if (absY < 50.0f) { globalCtx->unk_11E18 = 0xFF; } else { @@ -249,7 +249,7 @@ void func_80A593A4(EnHoll* this, GlobalContext* globalCtx) { } if (absY > 50.0f) { transitionActorIdx = (u16)this->actor.params >> 0xA; - side = (0.0f < this->actor.yDistToLink) ? 0 : 1; + side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = globalCtx->transitionActorList[transitionActorIdx].sides[side].room; if (this->actor.room != globalCtx->roomCtx.curRoom.num && func_8009728C(globalCtx, &globalCtx->roomCtx, this->actor.room) != 0) { @@ -269,11 +269,11 @@ void func_80A59520(EnHoll* this, GlobalContext* globalCtx) { s8 side; s32 transitionActorIdx; - if (this->actor.xzDistToLink < 120.0f) { - absY = fabsf(this->actor.yDistToLink); + if (this->actor.xzDistToPlayer < 120.0f) { + absY = fabsf(this->actor.yDistToPlayer); if (absY < 200.0f && absY > 50.0f) { transitionActorIdx = (u16)this->actor.params >> 0xA; - side = (0.0f < this->actor.yDistToLink) ? 0 : 1; + side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = globalCtx->transitionActorList[transitionActorIdx].sides[side].room; if (this->actor.room != globalCtx->roomCtx.curRoom.num && func_8009728C(globalCtx, &globalCtx->roomCtx, this->actor.room) != 0) { @@ -297,7 +297,7 @@ void func_80A59618(EnHoll* this, GlobalContext* globalCtx) { this->unk_14F = 0; } } else { - func_8002DBD0(&this->actor, &vec, &player->actor.posRot.pos); + func_8002DBD0(&this->actor, &vec, &player->actor.world.pos); absZ = fabsf(vec.z); if (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH_2 && absZ < 100.0f) { this->unk_14F = 1; 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 df9db553ad..6cb7c16d32 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -52,7 +52,7 @@ extern Gfx D_05006810[]; const ActorInit En_Honotrap_InitVars = { ACTOR_EN_HONOTRAP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(EnHonotrap), @@ -166,8 +166,8 @@ void EnHonotrap_InitEye(Actor* thisx, GlobalContext* globalCtx) { f32 sin; Actor_SetScale(thisx, 0.1f); - sin = Math_SinS(thisx->initPosRot.rot.y); - cos = Math_CosS(thisx->initPosRot.rot.y); + sin = Math_SinS(thisx->home.rot.y); + cos = Math_CosS(thisx->home.rot.y); Collider_InitTris(globalCtx, &this->collider.tris); Collider_SetTris(globalCtx, &this->collider.tris, thisx, &sTrisInit, this->collider.elements); @@ -178,12 +178,12 @@ void EnHonotrap_InitEye(Actor* thisx, GlobalContext* globalCtx) { vtx->x = baseVtx->z * sin + baseVtx->x * cos; vtx->y = baseVtx->y; vtx->z = baseVtx->z * cos - baseVtx->x * sin; - Math_Vec3f_Sum(vtx, &thisx->posRot.pos, vtx); + Math_Vec3f_Sum(vtx, &thisx->world.pos, vtx); } Collider_SetTrisVertices(&this->collider.tris, i, &triangle[0], &triangle[1], &triangle[2]); } EnHonotrap_SetupEyeIdle(this); - Actor_SetHeight(thisx, 0.0f); + Actor_SetFocus(thisx, 0.0f); } void EnHonotrap_InitFlame(Actor* thisx, GlobalContext* globalCtx) { @@ -196,9 +196,9 @@ void EnHonotrap_InitFlame(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider.cyl); this->actor.minVelocityY = -1.0f; CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); - this->actor.shape.unk_14 = 0x80; - this->targetPos = PLAYER->actor.posRot.pos; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + this->actor.shape.shadowAlpha = 128; + this->targetPos = PLAYER->actor.world.pos; this->targetPos.y += 10.0f; this->flameScroll = Rand_ZeroOne() * 511.0f; EnHonotrap_SetupFlame(this); @@ -207,7 +207,7 @@ void EnHonotrap_InitFlame(Actor* thisx, GlobalContext* globalCtx) { this->actor.room = -1; this->collider.cyl.dim.radius = 12; this->collider.cyl.dim.height = 30; - this->actor.shape.unk_08 = -1000.0f; + this->actor.shape.yOffset = -1000.0f; } } @@ -239,10 +239,10 @@ void EnHonotrap_SetupEyeIdle(EnHonotrap* this) { void EnHonotrap_EyeIdle(EnHonotrap* this, GlobalContext* globalCtx) { if (this->actor.child != NULL) { this->timer = 200; - } else if ((this->timer <= 0) && (this->actor.xzDistToLink < 750.0f) && (0.0f > this->actor.yDistToLink) && - (this->actor.yDistToLink > -700.0f) && - (-0x4000 < (this->actor.yawTowardsLink - this->actor.shape.rot.y)) && - ((this->actor.yawTowardsLink - this->actor.shape.rot.y) < 0x4000)) { + } else if ((this->timer <= 0) && (this->actor.xzDistToPlayer < 750.0f) && (0.0f > this->actor.yDistToPlayer) && + (this->actor.yDistToPlayer > -700.0f) && + (-0x4000 < (this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) && + ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) < 0x4000)) { EnHonotrap_SetupEyeOpen(this); } } @@ -264,9 +264,9 @@ void EnHonotrap_EyeOpen(EnHonotrap* this, GlobalContext* globalCtx) { sin = Math_SinS(this->actor.shape.rot.y); cos = Math_CosS(this->actor.shape.rot.y); Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_HONOTRAP, - (sin * 12.0f) + this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y - 10.0f, - (cos * 12.0f) + this->actor.initPosRot.pos.z, this->actor.initPosRot.rot.x, - this->actor.initPosRot.rot.y, this->actor.initPosRot.rot.z, HONOTRAP_FLAME_MOVE); + (sin * 12.0f) + this->actor.home.pos.x, this->actor.home.pos.y - 10.0f, + (cos * 12.0f) + this->actor.home.pos.z, this->actor.home.rot.x, this->actor.home.rot.y, + this->actor.home.rot.z, HONOTRAP_FLAME_MOVE); } } @@ -315,25 +315,25 @@ void EnHonotrap_Flame(EnHonotrap* this, GlobalContext* globalCtx) { void EnHonotrap_SetupFlameDrop(EnHonotrap* this) { this->timer = 40; this->actor.velocity.y = 1.0f; - this->actor.velocity.x = 2.0f * Math_SinS(this->actor.posRot.rot.y); - this->actor.velocity.z = 2.0f * Math_CosS(this->actor.posRot.rot.y); + this->actor.velocity.x = 2.0f * Math_SinS(this->actor.world.rot.y); + this->actor.velocity.z = 2.0f * Math_CosS(this->actor.world.rot.y); this->actionFunc = EnHonotrap_FlameDrop; } void EnHonotrap_FlameDrop(EnHonotrap* this, GlobalContext* globalCtx) { if ((this->collider.cyl.base.atFlags & AT_HIT) || (this->timer <= 0)) { if ((this->collider.cyl.base.atFlags & AT_HIT) && !(this->collider.cyl.base.atFlags & AT_BOUNCED)) { - func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsLink, 0.0f); + func_8002F71C(globalCtx, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 0.0f); } this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = 0.0f; EnHonotrap_SetupFlameVanish(this); } else { if (this->actor.velocity.y > 0.0f) { - this->actor.posRot.pos.x += this->actor.velocity.x; - this->actor.posRot.pos.z += this->actor.velocity.z; - func_8002E4B4(globalCtx, &this->actor, 7.0f, 12.0f, 0.0f, 5); + this->actor.world.pos.x += this->actor.velocity.x; + this->actor.world.pos.z += this->actor.velocity.z; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 12.0f, 0.0f, 5); } - if (!Math_StepToF(&this->actor.posRot.pos.y, this->actor.groundY + 1.0f, this->actor.velocity.y)) { + if (!Math_StepToF(&this->actor.world.pos.y, this->actor.floorHeight + 1.0f, this->actor.velocity.y)) { this->actor.velocity.y += 1.0f; } else { this->actor.velocity.y = 0.0f; @@ -347,10 +347,10 @@ void EnHonotrap_SetupFlameMove(EnHonotrap* this) { this->actionFunc = EnHonotrap_FlameMove; - distFrac = 1.0f / (func_8002DB6C(&this->actor, &this->targetPos) + 1.0f); - this->actor.velocity.x = (this->targetPos.x - this->actor.posRot.pos.x) * distFrac; - this->actor.velocity.y = (this->targetPos.y - this->actor.posRot.pos.y) * distFrac; - this->actor.velocity.z = (this->targetPos.z - this->actor.posRot.pos.z) * distFrac; + distFrac = 1.0f / (Actor_WorldDistXYZToPoint(&this->actor, &this->targetPos) + 1.0f); + this->actor.velocity.x = (this->targetPos.x - this->actor.world.pos.x) * distFrac; + this->actor.velocity.y = (this->targetPos.y - this->actor.world.pos.y) * distFrac; + this->actor.velocity.z = (this->targetPos.z - this->actor.world.pos.z) * distFrac; this->speedMod = 0.0f; this->timer = 160; @@ -365,10 +365,10 @@ void EnHonotrap_FlameMove(EnHonotrap* this, GlobalContext* globalCtx) { speed.x = fabsf(this->speedMod * this->actor.velocity.x); speed.y = fabsf(this->speedMod * this->actor.velocity.y); speed.z = fabsf(this->speedMod * this->actor.velocity.z); - ready = Math_StepToF(&this->actor.posRot.pos.x, this->targetPos.x, speed.x) & 1; - ready &= Math_StepToF(&this->actor.posRot.pos.y, this->targetPos.y, speed.y); - ready &= Math_StepToF(&this->actor.posRot.pos.z, this->targetPos.z, speed.z); - func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); + ready = Math_StepToF(&this->actor.world.pos.x, this->targetPos.x, speed.x) & 1; + ready &= Math_StepToF(&this->actor.world.pos.y, this->targetPos.y, speed.y); + ready &= Math_StepToF(&this->actor.world.pos.z, this->targetPos.z, speed.z); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); if (this->collider.tris.base.atFlags & AT_BOUNCED) { Player* player = PLAYER; @@ -384,7 +384,7 @@ void EnHonotrap_FlameMove(EnHonotrap* this, GlobalContext* globalCtx) { tempVel = this->actor.velocity; Math3D_Vec3fReflect(&tempVel, &shieldNorm, &this->actor.velocity); this->actor.speedXZ = this->speedMod * 0.5f; - this->actor.posRot.rot.y = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); + this->actor.world.rot.y = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); EnHonotrap_SetupFlameVanish(this); } else if (this->collider.tris.base.atFlags & AT_HIT) { this->actor.velocity.y = this->actor.speedXZ = 0.0f; @@ -403,7 +403,7 @@ void EnHonotrap_SetupFlameChase(EnHonotrap* this) { this->actionFunc = EnHonotrap_FlameChase; this->actor.velocity.x = this->actor.velocity.y = this->actor.velocity.z = this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.x = this->actor.posRot.rot.y = this->actor.posRot.rot.z = 0; + this->actor.world.rot.x = this->actor.world.rot.y = this->actor.world.rot.z = 0; this->timer = 100; } @@ -411,22 +411,22 @@ void EnHonotrap_SetupFlameChase(EnHonotrap* this) { void EnHonotrap_FlameChase(EnHonotrap* this, GlobalContext* globalCtx) { s32 pad; - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x300); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x300); Math_StepToF(&this->actor.speedXZ, 3.0f, 0.1f); - this->actor.gravity = (-this->actor.yDistToLink < 10.0f) ? 0.08f : -0.08f; + this->actor.gravity = (-this->actor.yDistToPlayer < 10.0f) ? 0.08f : -0.08f; func_8002D868(&this->actor); if (this->actor.velocity.y > 1.0f) { this->actor.velocity.y = 1.0f; } this->actor.velocity.y *= 0.95f; func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); if (this->collider.cyl.base.atFlags & AT_BOUNCED) { Player* player = PLAYER; Vec3s shieldRot; func_800D20CC(&player->shieldMf, &shieldRot, false); - this->actor.posRot.rot.y = ((shieldRot.y * 2) - this->actor.posRot.rot.y) + 0x8000; + this->actor.world.rot.y = ((shieldRot.y * 2) - this->actor.world.rot.y) + 0x8000; EnHonotrap_SetupFlameVanish(this); } else if (this->collider.cyl.base.atFlags & AT_HIT) { this->actor.speedXZ *= 0.1f; @@ -449,7 +449,7 @@ void EnHonotrap_FlameVanish(EnHonotrap* this, GlobalContext* globalCtx) { this->actor.scale.z = this->actor.scale.y = this->actor.scale.x; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.0f, 10.0f, 0.0f, 0x1D); if (ready) { Actor_Kill(&this->actor); } @@ -471,14 +471,14 @@ void EnHonotrap_Update(Actor* thisx, GlobalContext* globalCtx) { } else { this->colChkFlags = 0; this->bobPhase += 0x640; - this->actor.shape.unk_08 = (Math_SinS(this->bobPhase) * 1000.0f) + 600.0f; - Actor_SetHeight(&this->actor, 5.0f); + this->actor.shape.yOffset = (Math_SinS(this->bobPhase) * 1000.0f) + 600.0f; + Actor_SetFocus(&this->actor, 5.0f); Audio_PlayActorSound2(&this->actor, NA_SE_EV_BURN_OUT - SFX_FLAG); } this->actionFunc(this, globalCtx); if (this->actor.params == HONOTRAP_EYE) { if (this->collider.tris.base.acFlags & AC_HIT) { - EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.posRot.pos, &velocity, &accel, 15, 8); + EffectSsBomb2_SpawnLayered(globalCtx, &this->actor.world.pos, &velocity, &accel, 15, 8); Actor_Kill(&this->actor); } else if (this->eyeState < HONOTRAP_EYE_SHUT) { this->collider.tris.base.acFlags &= ~AC_HIT; 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 1aa05a024a..e720bfffc3 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_06006530; /* const ActorInit En_Horse_InitVars = { ACTOR_EN_HORSE, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE, sizeof(EnHorse), 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 2610ea55c4..37dbf6f940 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 @@ -18,7 +18,7 @@ void EnHorseGameCheck_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Horse_Game_Check_InitVars = { ACTOR_EN_HORSE_GAME_CHECK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnHorseGameCheck), 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 a848647246..fffbeccbd9 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 @@ -26,7 +26,7 @@ void func_80A68DB0(EnHorseGanon* this, GlobalContext* globalCtx); const ActorInit En_Horse_Ganon_InitVars = { ACTOR_EN_HORSE_GANON, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_GANON, sizeof(EnHorseGanon), @@ -120,7 +120,7 @@ void func_80A686A8(EnHorseGanon* this, GlobalContext* globalCtx) { s16 y; func_80A68660(D_80A69248, this->unk_1EC, &vec); - if (Math3D_Vec3f_DistXYZ(&vec, &this->actor.posRot.pos) <= 400.0f) { + if (Math3D_Vec3f_DistXYZ(&vec, &this->actor.world.pos) <= 400.0f) { this->unk_1EC += 1; if (this->unk_1EC >= 14) { this->unk_1EC = 0; @@ -128,18 +128,18 @@ void func_80A686A8(EnHorseGanon* this, GlobalContext* globalCtx) { } } - tempPos = &this->actor.posRot.pos; - y = Math_Vec3f_Yaw(tempPos, &vec) - this->actor.posRot.rot.y; + tempPos = &this->actor.world.pos; + y = Math_Vec3f_Yaw(tempPos, &vec) - this->actor.world.rot.y; if (y >= 301) { - this->actor.posRot.rot.y += 300; + this->actor.world.rot.y += 300; } else if (y < -300) { - this->actor.posRot.rot.y -= 300; + this->actor.world.rot.y -= 300; } else { - this->actor.posRot.rot.y += y; + this->actor.world.rot.y += y; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; - if (func_8002DB8C(&this->actor, &PLAYER->actor) <= 300.0f) { + if (Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor) <= 300.0f) { if (this->actor.speedXZ < 12.0f) { this->actor.speedXZ += 1.0f; } else { @@ -173,11 +173,11 @@ void EnHorseGanon_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->action = 0; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos.y += 70.0f; func_800A663C(globalCtx, &this->skin, &D_06008668, &D_06004AA4); this->currentAnimation = 0; Animation_PlayOnce(&this->skin.skelAnime, D_80A691B0[0]); @@ -274,14 +274,14 @@ void func_80A68E14(EnHorseGanon* this, GlobalContext* globalCtx) { Vec3f v; s32 temp1; - v.x = Math_SinS(this->actor.shape.rot.y) * 30.0f + this->actor.posRot.pos.x; - v.y = this->actor.posRot.pos.y + 60.0f; - v.z = Math_CosS(this->actor.shape.rot.y) * 30.0f + this->actor.posRot.pos.z; + v.x = Math_SinS(this->actor.shape.rot.y) * 30.0f + this->actor.world.pos.x; + v.y = this->actor.world.pos.y + 60.0f; + v.z = Math_CosS(this->actor.shape.rot.y) * 30.0f + this->actor.world.pos.z; temp_ret = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &col, &temp1, &v); this->unk_1F4 = temp_ret; - this->actor.shape.rot.x = 10430.3779f * Math_FAtan2F(this->actor.posRot.pos.y - temp_ret, 30.0f); + this->actor.shape.rot.x = 10430.3779f * Math_FAtan2F(this->actor.world.pos.y - temp_ret, 30.0f); } void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -290,9 +290,9 @@ void EnHorseGanon_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 29); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; Collider_UpdateCylinder(&this->actor, &this->colliderBody); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderBody.base); } 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 8767bef5fe..728eea24b0 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 @@ -22,7 +22,7 @@ void func_80A6A724(EnHorseLinkChild* this); const ActorInit En_Horse_Link_Child_InitVars = { ACTOR_EN_HORSE_LINK_CHILD, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_LINK_CHILD, sizeof(EnHorseLinkChild), @@ -147,11 +147,11 @@ void EnHorseLinkChild_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.005f); this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; this->action = 1; - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; func_800A663C(globalCtx, &this->skin, &D_06007B20, &D_06002F98); this->animationIdx = 0; Animation_PlayOnce(&this->skin.skelAnime, sAnimations[0]); @@ -176,7 +176,7 @@ void EnHorseLinkChild_Init(Actor* thisx, GlobalContext* globalCtx) { func_80A69EC0(this); } - this->actor.initPosRot.rot.z = this->actor.posRot.rot.z = this->actor.shape.rot.z = 0; + this->actor.home.rot.z = this->actor.world.rot.z = this->actor.shape.rot.z = 0; } void EnHorseLinkChild_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -224,7 +224,7 @@ void func_80A699FC(EnHorseLinkChild* this, GlobalContext* globalCtx) { f32 distFromLink; s32 newAnimationIdx; - distFromLink = func_8002DB8C(&this->actor, &PLAYER->actor); + distFromLink = Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor); if (SkelAnime_Update(&this->skin.skelAnime)) { if ((distFromLink < 1000.0f) && (distFromLink > 70.0f)) { @@ -257,21 +257,21 @@ void func_80A69C18(EnHorseLinkChild* this, GlobalContext* globalCtx) { s32 newAnimationIdx; if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) { - yawDiff = func_8002DA78(&this->actor, &PLAYER->actor) - this->actor.posRot.rot.y; + yawDiff = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) - this->actor.world.rot.y; if (yawDiff > 0x12C) { - this->actor.posRot.rot.y += 0x12C; + this->actor.world.rot.y += 0x12C; } else if (yawDiff < -0x12C) { - this->actor.posRot.rot.y -= 0x12C; + this->actor.world.rot.y -= 0x12C; } else { - this->actor.posRot.rot.y += yawDiff; + this->actor.world.rot.y += yawDiff; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } if (SkelAnime_Update(&this->skin.skelAnime)) { - distFromLink = func_8002DB8C(&this->actor, &PLAYER->actor); + distFromLink = Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor); if (distFromLink > 1000.0f) { func_80A6993C(this, 0); @@ -319,24 +319,24 @@ void func_80A69F5C(EnHorseLinkChild* this, GlobalContext* globalCtx) { if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) { player = PLAYER; - if (Math3D_Vec3f_DistXYZ(&player->actor.posRot.pos, &this->actor.initPosRot.pos) < 250.0f) { + if (Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &this->actor.home.pos) < 250.0f) { yawDiff = player->actor.shape.rot.y; - yawSign = func_8002DA78(&this->actor, &player->actor) > 0 ? 1 : -1; + yawSign = Actor_WorldYawTowardActor(&this->actor, &player->actor) > 0 ? 1 : -1; yawOffset = yawSign << 0xE; yawDiff += yawOffset; } else { - yawDiff = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos) - this->actor.posRot.rot.y; + yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos) - this->actor.world.rot.y; } if (yawDiff > 0x12C) { - this->actor.posRot.rot.y += 0x12C; + this->actor.world.rot.y += 0x12C; } else if (yawDiff < -0x12C) { - this->actor.posRot.rot.y -= 0x12C; + this->actor.world.rot.y -= 0x12C; } else { - this->actor.posRot.rot.y += yawDiff; + this->actor.world.rot.y += yawDiff; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } } @@ -350,7 +350,7 @@ void func_80A6A068(EnHorseLinkChild* this, GlobalContext* globalCtx) { func_80A69F5C(this, globalCtx); player = PLAYER; - distFromLink = func_8002DB8C(&this->actor, &player->actor); + distFromLink = Actor_WorldDistXZToActor(&this->actor, &player->actor); if (gSaveContext.entranceIndex == 0x2AE) { Audio_PlaySoundGeneral(NA_SE_EV_KID_HORSE_NEIGH, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, @@ -370,8 +370,8 @@ void func_80A6A068(EnHorseLinkChild* this, GlobalContext* globalCtx) { animationEnded = SkelAnime_Update(&this->skin.skelAnime); if (animationEnded || (this->animationIdx == 1) || (this->animationIdx == 0)) { if (gSaveContext.eventChkInf[1] & 0x20) { - distFromHome = Math3D_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - distLinkFromHome = Math3D_Vec3f_DistXYZ(&player->actor.posRot.pos, &this->actor.initPosRot.pos); + distFromHome = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); + distLinkFromHome = Math3D_Vec3f_DistXYZ(&player->actor.world.pos, &this->actor.home.pos); if (distLinkFromHome > 250.0f) { if (distFromHome >= 300.0f) { newAnimationIdx = 4; @@ -450,10 +450,10 @@ void func_80A6A5A4(EnHorseLinkChild* this, GlobalContext* globalCtx) { func_80A6A724(this); } else { this->actor.speedXZ = 0.0f; - yawDiff = func_8002DA78(&this->actor, &PLAYER->actor) - this->actor.posRot.rot.y; + yawDiff = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) - this->actor.world.rot.y; // 0.7071 = cos(pi/4) if ((Math_CosS(yawDiff) < 0.7071f) && (this->animationIdx == 2)) { - func_8006DD9C(&this->actor, &PLAYER->actor.posRot.pos, 300); + func_8006DD9C(&this->actor, &PLAYER->actor.world.pos, 300); } if (SkelAnime_Update(&this->skin.skelAnime)) { @@ -490,17 +490,17 @@ void func_80A6A7D0(EnHorseLinkChild* this, GlobalContext* globalCtx) { if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) { if (!this->unk_1E8) { - func_8006DD9C(&this->actor, &player->actor.posRot.pos, 300); + func_8006DD9C(&this->actor, &player->actor.world.pos, 300); } else { - func_8006DD9C(&this->actor, &this->actor.initPosRot.pos, 300); + func_8006DD9C(&this->actor, &this->actor.home.pos, 300); } } if (SkelAnime_Update(&this->skin.skelAnime)) { if (!this->unk_1E8) { - dist = func_8002DB8C(&this->actor, &PLAYER->actor); + dist = Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor); } else { - dist = Math3D_Vec3f_DistXYZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + dist = Math3D_Vec3f_DistXYZ(&this->actor.world.pos, &this->actor.home.pos); } if (!this->unk_1E8) { @@ -555,14 +555,14 @@ void EnHorseLinkChild_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); - if ((globalCtx->sceneNum == SCENE_SPOT20) && (this->actor.posRot.pos.z < -2400.0f)) { - this->actor.posRot.pos.z = -2400.0f; + if ((globalCtx->sceneNum == SCENE_SPOT20) && (this->actor.world.pos.z < -2400.0f)) { + this->actor.world.pos.z = -2400.0f; } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; if ((Rand_ZeroOne() < 0.025f) && (this->unk_1EC == 0)) { this->unk_1EC++; 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 d6bf1cc480..25e6c502a1 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 @@ -41,7 +41,7 @@ void func_80A6C6B0(EnHorseNormal* this); const ActorInit En_Horse_Normal_InitVars = { ACTOR_EN_HORSE_NORMAL, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_NORMAL, sizeof(EnHorseNormal), @@ -198,10 +198,10 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.01f); this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; this->action = HORSE_CYCLE_ANIMATIONS; this->animationIdx = 0; Collider_InitCylinder(globalCtx, &this->bodyCollider); @@ -212,36 +212,36 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->cloneCollider, &this->actor, &sCylinderInit2); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); if (globalCtx->sceneNum == SCENE_SPOT20) { - if (this->actor.posRot.rot.z == 0 || gSaveContext.nightFlag) { + if (this->actor.world.rot.z == 0 || gSaveContext.nightFlag) { Actor_Kill(&this->actor); return; } if (LINK_IS_CHILD) { if (Flags_GetEventChkInf(0x14)) { - if (this->actor.posRot.rot.z != 3) { + if (this->actor.world.rot.z != 3) { Actor_Kill(&this->actor); return; } - } else if (this->actor.posRot.rot.z != 1) { + } else if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); return; } } else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { - if (this->actor.posRot.rot.z != 7) { + if (this->actor.world.rot.z != 7) { Actor_Kill(&this->actor); return; } - } else if (this->actor.posRot.rot.z != 5) { + } else if (this->actor.world.rot.z != 5) { Actor_Kill(&this->actor); return; } - this->actor.initPosRot.rot.z = this->actor.posRot.rot.z = this->actor.shape.rot.z = 0; + this->actor.home.rot.z = this->actor.world.rot.z = this->actor.shape.rot.z = 0; func_800A663C(globalCtx, &this->skin, &D_06009FAC, &D_06004580); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); - if ((this->actor.posRot.pos.x == -730.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1100.0f) || - (this->actor.posRot.pos.x == 880.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1170.0f)) { + if ((this->actor.world.pos.x == -730.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1100.0f) || + (this->actor.world.pos.x == 880.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1170.0f)) { func_80A6C6B0(this); return; } @@ -256,8 +256,8 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { return; } } else if (globalCtx->sceneNum == SCENE_SPOT12) { - if (this->actor.posRot.pos.x == 3707.0f && this->actor.posRot.pos.y == 1413.0f && - this->actor.posRot.pos.z == -665.0f) { + if (this->actor.world.pos.x == 3707.0f && this->actor.world.pos.y == 1413.0f && + this->actor.world.pos.z == -665.0f) { func_800A663C(globalCtx, &this->skin, &D_06009FAC, &D_06004580); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); func_80A6C4CC(this); @@ -303,10 +303,10 @@ void EnHorseNormal_FollowPath(EnHorseNormal* this, GlobalContext* globalCtx) { s32 pad; pointPos += this->waypoint; - dx = pointPos->x - this->actor.posRot.pos.x; - dz = pointPos->z - this->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 0xA, 0x7D0, 1); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + dx = pointPos->x - this->actor.world.pos.x; + dz = pointPos->z - this->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 0xA, 0x7D0, 1); + this->actor.shape.rot.y = this->actor.world.rot.y; if (SQ(dx) + SQ(dz) < 600.0f) { this->waypoint++; if (this->waypoint >= path->count) { @@ -424,8 +424,8 @@ void EnHorseNormal_Wander(EnHorseNormal* this, GlobalContext* globalCtx) { this->unk_21C = 0; this->unk_21E = 0; } - this->actor.posRot.rot.y += this->unk_21C; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.world.rot.y += this->unk_21C; + this->actor.shape.rot.y = this->actor.world.rot.y; break; case 2: case 3: @@ -562,11 +562,11 @@ void func_80A6C8E0(EnHorseNormal* this, GlobalContext* globalCtx) { Vec3f sp28; s32 sp24; - sp28.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.x; - sp28.y = this->actor.posRot.pos.y + 60.0f; - sp28.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.z; + sp28.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.x; + sp28.y = this->actor.world.pos.y + 60.0f; + sp28.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.z; this->unk_220 = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &sp38, &sp24, &sp28); - this->actor.shape.rot.x = Math_FAtan2F(this->actor.posRot.pos.y - this->unk_220, 30.0f) * (0x8000 / M_PI); + this->actor.shape.rot.x = Math_FAtan2F(this->actor.world.pos.y - this->unk_220, 30.0f) * (0x8000 / M_PI); } static EnHorseNormalActionFunc sActionFuncs[] = { @@ -580,12 +580,12 @@ void EnHorseNormal_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 35.0f, 100.0f, 0x1D); - if (globalCtx->sceneNum == SCENE_SPOT20 && this->actor.posRot.pos.z < -2400.0f) { - this->actor.posRot.pos.z = -2400.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 35.0f, 100.0f, 0x1D); + if (globalCtx->sceneNum == SCENE_SPOT20 && this->actor.world.pos.z < -2400.0f) { + this->actor.world.pos.z = -2400.0f; } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; this->unk_204 = this->actor.projectedPos; this->unk_204.y += 120.0f; Collider_UpdateCylinder(&this->actor, &this->bodyCollider); @@ -658,32 +658,32 @@ void EnHorseNormal_Draw(Actor* thisx, GlobalContext* globalCtx) { Mtx* mtx1; Vec3f clonePos = { 0.0f, 0.0f, 0.0f }; s16 cloneRotY; - f32 distFromGround = this->actor.posRot.pos.y - this->actor.groundY; + f32 distFromGround = this->actor.world.pos.y - this->actor.floorHeight; f32 temp_f0_4; if (globalCtx->sceneNum == SCENE_MALON_STABLE) { - if (this->actor.posRot.pos.x == 355.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -245.0f) { + if (this->actor.world.pos.x == 355.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -245.0f) { clonePos.x = 235.0f; clonePos.y = 0.0f; clonePos.z = 100.0f; cloneRotY = 0x7FFF; - } else if (this->actor.posRot.pos.x == 238.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -245.0f) { + } else if (this->actor.world.pos.x == 238.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -245.0f) { clonePos.x = 478.0f; clonePos.y = 0.0f; clonePos.z = 100.0f; cloneRotY = 0x7FFF; } } else if (globalCtx->sceneNum == SCENE_SPOT20) { - if (this->actor.posRot.pos.x == -730.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1100.0f) { + if (this->actor.world.pos.x == -730.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1100.0f) { clonePos.x = 780.0f; clonePos.y = 0.0f; clonePos.z = -80.0f; cloneRotY = 0; - } else if (this->actor.posRot.pos.x == 880.0f && this->actor.posRot.pos.y == 0.0f && - this->actor.posRot.pos.z == -1170.0f) { + } else if (this->actor.world.pos.x == 880.0f && this->actor.world.pos.y == 0.0f && + this->actor.world.pos.z == -1170.0f) { clonePos.x = -1000.0f; clonePos.y = 0.0f; clonePos.z = -70.0f; @@ -693,7 +693,7 @@ void EnHorseNormal_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80A6CC88(globalCtx, this, &clonePos); SkinMatrix_SetScaleRotateYRPTranslate(&skinMtx, this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, this->actor.shape.rot.x, cloneRotY, this->actor.shape.rot.z, clonePos.x, - (this->actor.shape.unk_08 * this->actor.scale.y) + clonePos.y, + (this->actor.shape.yOffset * this->actor.scale.y) + clonePos.y, clonePos.z); mtx1 = SkinMatrix_MtxFToNewMtx(globalCtx->state.gfxCtx, &skinMtx); if (mtx1 == NULL) { @@ -709,7 +709,7 @@ void EnHorseNormal_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); Matrix_Translate(clonePos.x, clonePos.y, clonePos.z, MTXMODE_NEW); - temp_f0_4 = (1.0f - (distFromGround * 0.01f)) * this->actor.shape.unk_10; + temp_f0_4 = (1.0f - (distFromGround * 0.01f)) * this->actor.shape.shadowScale; Matrix_Scale(this->actor.scale.x * temp_f0_4, 1.0f, this->actor.scale.z * temp_f0_4, MTXMODE_APPLY); Matrix_RotateY(cloneRotY * (2.0f * M_PI / 0x10000), MTXMODE_APPLY); mtx2 = Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_horse_normal.c", 2329); 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 bd83b93cbd..3c7e2ab6fa 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 @@ -21,7 +21,7 @@ void func_80A6DC7C(EnHorseZelda* this); const ActorInit En_Horse_Zelda_InitVars = { ACTOR_EN_HORSE_ZELDA, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_HORSE_ZELDA, sizeof(EnHorseZelda), @@ -120,24 +120,24 @@ void func_80A6D918(EnHorseZelda* this, GlobalContext* globalCtx) { s16 yawDiff; func_80A6D8D0(D_80A6E240, this->unk_1EC, &sp28); - if (Math3D_Vec3f_DistXYZ(&sp28, &this->actor.posRot.pos) <= 400.0f) { + if (Math3D_Vec3f_DistXYZ(&sp28, &this->actor.world.pos) <= 400.0f) { this->unk_1EC++; if (this->unk_1EC >= 14) { this->unk_1EC = 0; func_80A6D8D0(D_80A6E240, 0, &sp28); } } - yawDiff = Math_Vec3f_Yaw(&this->actor.posRot.pos, &sp28) - this->actor.posRot.rot.y; + yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &sp28) - this->actor.world.rot.y; if (yawDiff >= 0x12D) { - this->actor.posRot.rot.y += 0x12C; + this->actor.world.rot.y += 0x12C; } else if (yawDiff < -0x12C) { - this->actor.posRot.rot.y -= 0x12C; + this->actor.world.rot.y -= 0x12C; } else { - this->actor.posRot.rot.y += yawDiff; + this->actor.world.rot.y += yawDiff; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; - if (func_8002DB8C(&this->actor, &PLAYER->actor) <= 300.0f) { + if (Actor_WorldDistXZToActor(&this->actor, &PLAYER->actor) <= 300.0f) { if (this->actor.speedXZ < 12.0f) { this->actor.speedXZ += 1.0f; } else { @@ -156,11 +156,11 @@ void EnHorseZelda_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, 0.0115f); this->actor.gravity = -3.5f; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Squiggly, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawHorse, 20.0f); this->actor.speedXZ = 0.0f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; this->action = 0; - this->actor.posRot2.pos.y += 70.0f; + this->actor.focus.pos.y += 70.0f; func_800A663C(globalCtx, &this->skin, &D_06006B2C, &D_06007148); this->animationIndex = 0; Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[0]); @@ -223,11 +223,11 @@ void func_80A6DE38(EnHorseZelda* this, GlobalContext* globalCtx) { Vec3f pos; s32 bgId; - pos.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 60.0f; - pos.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.posRot.pos.z; + pos.x = (Math_SinS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 60.0f; + pos.z = (Math_CosS(this->actor.shape.rot.y) * 30.0f) + this->actor.world.pos.z; this->unk_1F4 = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &poly, &bgId, &pos); - this->actor.shape.rot.x = Math_FAtan2F(this->actor.posRot.pos.y - this->unk_1F4, 30.0f) * (0x8000 / M_PI); + this->actor.shape.rot.x = Math_FAtan2F(this->actor.world.pos.y - this->unk_1F4, 30.0f) * (0x8000 / M_PI); } void EnHorseZelda_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -237,9 +237,9 @@ void EnHorseZelda_Update(Actor* thisx, GlobalContext* globalCtx) { sActionFuncs[this->action](this, globalCtx); this->actor.speedXZ = 0.0f; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 70.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 55.0f, 100.0f, 0x1D); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 70.0f; Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base); } 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 195b7584ec..d350c386ae 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -21,7 +21,7 @@ void func_80A6E6B0(EnHs* this, GlobalContext* globalCtx); const ActorInit En_Hs_InitVars = { ACTOR_EN_HS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_HS, sizeof(EnHs), @@ -64,7 +64,7 @@ void EnHs_Init(Actor* thisx, GlobalContext* globalCtx) { EnHs* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006260, &D_060005C0, this->jointTable, this->morphTable, 16); Animation_PlayLoop(&this->skelAnime, &D_060005C0); Collider_InitCylinder(globalCtx, &this->collider); @@ -94,7 +94,7 @@ void EnHs_Init(Actor* thisx, GlobalContext* globalCtx) { } this->unk_2A8 = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; } void EnHs_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -112,8 +112,8 @@ s32 func_80A6E53C(EnHs* this, GlobalContext* globalCtx, u16 textId, EnHsActionFu } this->actor.textId = textId; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToLink < 100.0f)) { + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToPlayer < 100.0f)) { this->unk_2A8 |= 1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -223,9 +223,9 @@ void func_80A6E9AC(EnHs* this, GlobalContext* globalCtx) { func_80A6E3A0(this, func_80A6E6D8); } } else { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; this->actor.textId = 0x10B1; - if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToLink < 100.0f)) { + if ((ABS(yawDiff) <= 0x2150) && (this->actor.xzDistToPlayer < 100.0f)) { func_8002F298(&this->actor, globalCtx, 100.0f, 7); } } @@ -238,7 +238,7 @@ void EnHs_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime)) { this->skelAnime.curFrame = 0.0f; } @@ -246,7 +246,7 @@ void EnHs_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->unk_2A8 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos); this->unk_2A8 &= ~1; } else { Math_SmoothStepToS(&this->unk_29C.x, 12800, 6, 6200, 100); @@ -291,7 +291,7 @@ void EnHs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnHs* this = THIS; if (limbIndex == 9) { - Matrix_MultVec3f(&D_80A6EDFC, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80A6EDFC, &this->actor.focus.pos); } } 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 b525708147..8686e55957 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -19,7 +19,7 @@ void func_80A6F1A4(EnHs2* this, GlobalContext* globalCtx); const ActorInit En_Hs2_InitVars = { ACTOR_EN_HS2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_HS, sizeof(EnHs2), @@ -56,7 +56,7 @@ void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx) { EnHs2* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006260, &D_060005C0, this->jointTable, this->morphTable, 16); Animation_PlayLoop(&this->skelAnime, &D_060005C0); Collider_InitCylinder(globalCtx, &this->collider); @@ -66,7 +66,7 @@ void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(CYAN) " ヒヨコの店(子人の時) \n" VT_RST); this->actionFunc = func_80A6F1A4; this->unk_2A8 = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; } void EnHs2_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -82,8 +82,8 @@ s32 func_80A6F0B4(EnHs2* this, GlobalContext* globalCtx, u16 textId, EnHs2Action } this->actor.textId = textId; - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) < 0x2151 && - this->actor.xzDistToLink < 100.0f) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x2151 && + this->actor.xzDistToPlayer < 100.0f) { this->unk_2A8 |= 0x1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -115,13 +115,13 @@ void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime) != 0) { this->skelAnime.curFrame = 0.0f; } this->actionFunc(this, globalCtx); if (this->unk_2A8 & 0x1) { - func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos); this->unk_2A8 &= ~1; } else { Math_SmoothStepToS(&this->unk_29C.x, 12800, 6, 6200, 100); @@ -158,7 +158,7 @@ void EnHs2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve EnHs2* this = THIS; if (limbIndex == 9) { - Matrix_MultVec3f(&D_80A6F4CC, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80A6F4CC, &this->actor.focus.pos); } } 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 56444cbc34..d86fbc178d 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_06005BC8; /* const ActorInit En_Hy_InitVars = { ACTOR_EN_HY, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnHy), 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 7dd6db38a1..00aae40d96 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 @@ -23,7 +23,7 @@ extern Gfx D_0404D4E0[]; const ActorInit En_Ice_Hono_InitVars = { ACTOR_EN_ICE_HONO, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnIceHono), @@ -74,8 +74,8 @@ static ColliderCylinderInit sCylinderInitDroppedFlame = { }; static InitChainEntry sInitChainCapturableFlame[] = { - ICHAIN_U8(unk_1F, 0, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 60, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 60, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), @@ -106,7 +106,7 @@ void EnIceHono_InitCapturableFlame(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChainCapturableFlame); Actor_SetScale(&this->actor, 0.0074f); this->actor.flags |= 1; - Actor_SetHeight(&this->actor, 10.0f); + Actor_SetFocus(&this->actor, 10.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitCapturableFlame); @@ -123,9 +123,9 @@ void EnIceHono_InitDroppedFlame(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = this->actor.scale.z = this->actor.scale.y = 0.00002f; this->actor.gravity = -0.3f; this->actor.minVelocityY = -4.0f; - this->actor.shape.unk_08 = 0.0f; - this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = this->actor.posRot.rot.x = - this->actor.posRot.rot.y = this->actor.posRot.rot.z = 0; + this->actor.shape.yOffset = 0.0f; + this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = this->actor.world.rot.x = + this->actor.world.rot.y = this->actor.world.rot.z = 0; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitDroppedFlame); @@ -144,7 +144,7 @@ void EnIceHono_InitSmallFlame(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.x = this->actor.scale.z = this->actor.scale.y = 0.0008f; this->actor.gravity = -0.3f; this->actor.minVelocityY = -4.0f; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; EnIceHono_SetupActionSmallFlame(this); } @@ -167,8 +167,8 @@ void EnIceHono_Init(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actor.params == -1) || (this->actor.params == 0)) { - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, (s16)this->actor.posRot.pos.y + 10, - this->actor.posRot.pos.z, 155, 210, 255, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, (s16)this->actor.world.pos.y + 10, + this->actor.world.pos.z, 155, 210, 255, 0); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); this->unk_154 = Rand_ZeroOne() * (0x1FFFF / 2.0f); this->unk_156 = Rand_ZeroOne() * (0x1FFFF / 2.0f); @@ -189,12 +189,12 @@ void EnIceHono_Destroy(Actor* thisx, GlobalContext* globalCtx) { u32 EnIceHono_LinkCloseAndFacing(EnIceHono* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->actor.xzDistToLink < 60.0f) { + if (this->actor.xzDistToPlayer < 60.0f) { Vec3f tempPos; - tempPos.x = Math_SinS(this->actor.yawTowardsLink + 0x8000) * 40.0f + player->actor.posRot.pos.x; - tempPos.y = player->actor.posRot.pos.y; - tempPos.z = Math_CosS(this->actor.yawTowardsLink + 0x8000) * 40.0f + player->actor.posRot.pos.z; - if (EnIceHono_SquareDist(&tempPos, &this->actor.posRot.pos) <= SQ(40.0f)) { + tempPos.x = Math_SinS(this->actor.yawTowardsPlayer + 0x8000) * 40.0f + player->actor.world.pos.x; + tempPos.y = player->actor.world.pos.y; + tempPos.z = Math_CosS(this->actor.yawTowardsPlayer + 0x8000) * 40.0f + player->actor.world.pos.z; + if (EnIceHono_SquareDist(&tempPos, &this->actor.world.pos) <= SQ(40.0f)) { return 1; } } @@ -204,7 +204,7 @@ u32 EnIceHono_LinkCloseAndFacing(EnIceHono* this, GlobalContext* globalCtx) { void EnIceHono_SetupActionCapturableFlame(EnIceHono* this) { this->actionFunc = EnIceHono_CapturableFlame; this->alpha = 255; - this->actor.shape.unk_08 = -1000.0f; + this->actor.shape.yOffset = -1000.0f; } void EnIceHono_CapturableFlame(EnIceHono* this, GlobalContext* globalCtx) { @@ -214,7 +214,7 @@ void EnIceHono_CapturableFlame(EnIceHono* this, GlobalContext* globalCtx) { func_8002F434(&this->actor, globalCtx, 0x7E, 60.0f, 100.0f); } - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } func_8002F8F0(&this->actor, NA_SE_EV_FIRE_PILLAR_S - SFX_FLAG); @@ -236,14 +236,14 @@ void EnIceHono_DropFlame(EnIceHono* this, GlobalContext* globalCtx) { if (bgFlag != 0) { s32 i; for (i = 0; i < 8; i++) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, ((s32)(Rand_ZeroOne() * 1000.0f) + i * 0x2000) - 0x1F4, 0, 1); } EnIceHono_SetupActionSpreadFlames(this); } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 5); Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.dim.radius = this->actor.scale.x * 4000.0f; @@ -271,7 +271,7 @@ void EnIceHono_SpreadFlames(EnIceHono* this, GlobalContext* globalCtx) { } this->actor.scale.z = this->actor.scale.x; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, this->actor.scale.x * 3500.0f, 0.0f, 4); if (this->timer < 25) { this->alpha -= 10; this->alpha = CLAMP(this->alpha, 0, 255); @@ -287,8 +287,8 @@ void EnIceHono_SpreadFlames(EnIceHono* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 10; i++) { s32 rot = i * 0x1999; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ICE_HONO, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, ((s32)(Rand_ZeroOne() * 1000.0f) + rot) - 0x1F4, 0, 2); } } @@ -322,7 +322,7 @@ void EnIceHono_SmallFlameMove(EnIceHono* this, GlobalContext* globalCtx) { this->actor.scale.z = this->actor.scale.x; Math_StepToF(&this->actor.speedXZ, 0, 0.06f); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); if (this->timer < 25) { this->alpha -= 10; @@ -357,8 +357,8 @@ void EnIceHono_Update(Actor* thisx, GlobalContext* globalCtx) { // Translates to: "impossible value(ratio = %f)" osSyncPrintf("ありえない値(ratio = %f)\n", intensity); } - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, (s16)this->actor.posRot.pos.y + 10, - this->actor.posRot.pos.z, (s32)(155.0f * intensity), (s32)(210.0f * intensity), + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, (s16)this->actor.world.pos.y + 10, + this->actor.world.pos.z, (s32)(155.0f * intensity), (s32)(210.0f * intensity), (s32)(255.0f * intensity), 1400); } 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 1034e7967f..bd87b79e6b 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -196,7 +196,7 @@ static DamageTable sDamageTable = { void EnIk_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnIk* this = THIS; - if (Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_IK, ACTORTYPE_ENEMY, 8000.0f) == NULL) { + if (Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_IK, ACTORCAT_ENEMY, 8000.0f) == NULL) { func_800F5B58(); } @@ -239,7 +239,7 @@ void func_80A74398(Actor* thisx, GlobalContext* globalCtx) { } else { Actor_SetScale(thisx, 0.012f); thisx->naviEnemyId = 53; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_ENEMY); } blureInit.p1StartColor[0] = blureInit.p1StartColor[1] = blureInit.p2StartColor[0] = blureInit.p2StartColor[1] = @@ -279,7 +279,7 @@ s32 func_80A745E4(EnIk* this, GlobalContext* globalCtx) { } Actor* func_80A74674(GlobalContext* globalCtx, Actor* actor) { - Actor* prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + Actor* prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (prop != NULL) { if ((prop == actor) || (prop->id != ACTOR_BG_JYA_IRONOBJ)) { @@ -315,7 +315,7 @@ void func_80A747C0(EnIk* this, GlobalContext* globalCtx) { Vec3f sp24; if (this->bodyCollider.base.acFlags & AC_HIT) { - sp24 = this->actor.posRot.pos; + sp24 = this->actor.world.pos; Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT); sp24.y += 30.0f; func_8003424C(globalCtx, &sp24); @@ -343,15 +343,16 @@ void func_80A7489C(EnIk* this) { void func_80A7492C(EnIk* this, GlobalContext* globalCtx) { s32 phi_a0 = (this->unk_2FB == 0) ? 0xAAA : 0x3FFC; - s16 yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if ((ABS(yawDiff) <= phi_a0) && (this->actor.xzDistToLink < 100.0f) && (ABS(this->actor.yDistToLink) < 150.0f)) { + if ((ABS(yawDiff) <= phi_a0) && (this->actor.xzDistToPlayer < 100.0f) && + (ABS(this->actor.yDistToPlayer) < 150.0f)) { if ((globalCtx->gameplayFrames & 1)) { func_80A74E2C(this); } else { func_80A751C8(this); } - } else if ((ABS(yawDiff) <= 0x4000) && (ABS(this->actor.yDistToLink) < 150.0f)) { + } else if ((ABS(yawDiff) <= 0x4000) && (ABS(this->actor.yDistToPlayer) < 150.0f)) { func_80A74AAC(this); } else { func_80A74AAC(this); @@ -372,7 +373,7 @@ void func_80A74AAC(EnIk* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DASH); this->actor.speedXZ = 2.5f; } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnIk_SetupAction(this, func_80A74BA4); } @@ -395,18 +396,17 @@ void func_80A74BA4(EnIk* this, GlobalContext* globalCtx) { sp30 = 2; sp2E = 9; } - temp_a1 = this->actor.wallPolyRot - this->actor.shape.rot.y; + temp_a1 = this->actor.wallYaw - this->actor.shape.rot.y; if ((this->actor.bgCheckFlags & 8) && (ABS(temp_a1) >= 0x4000)) { - temp_a1 = - (this->actor.yawTowardsLink > 0) ? this->actor.wallPolyRot - 0x4000 : this->actor.wallPolyRot + 0x4000; - Math_SmoothStepToS(&this->actor.posRot.rot.y, temp_a1, 1, phi_a3, 0); + temp_a1 = (this->actor.yawTowardsPlayer > 0) ? this->actor.wallYaw - 0x4000 : this->actor.wallYaw + 0x4000; + Math_SmoothStepToS(&this->actor.world.rot.y, temp_a1, 1, phi_a3, 0); } else { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, phi_a3, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, phi_a3, 0); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((ABS(yawDiff) <= temp_t0) && (this->actor.xzDistToLink < 100.0f)) { - if (ABS(this->actor.yDistToLink) < 150.0f) { + this->actor.shape.rot.y = this->actor.world.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((ABS(yawDiff) <= temp_t0) && (this->actor.xzDistToPlayer < 100.0f)) { + if (ABS(this->actor.yDistToPlayer) < 150.0f) { if ((globalCtx->gameplayFrames & 1)) { func_80A74E2C(this); } else { @@ -418,7 +418,7 @@ void func_80A74BA4(EnIk* this, GlobalContext* globalCtx) { func_80A751C8(this); this->unk_2FC = 1; } else { - temp_t0 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + temp_t0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(temp_t0) > 0x4000) { this->unk_300--; if (this->unk_300 == 0) { @@ -451,12 +451,12 @@ void func_80A74EBC(EnIk* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame == 15.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); } else if (this->skelAnime.curFrame == 21.0f) { - sp2C.x = this->actor.posRot.pos.x + Math_SinS(this->actor.shape.rot.y + 0x6A4) * 70.0f; - sp2C.z = this->actor.posRot.pos.z + Math_CosS(this->actor.shape.rot.y + 0x6A4) * 70.0f; - sp2C.y = this->actor.posRot.pos.y; + sp2C.x = this->actor.world.pos.x + Math_SinS(this->actor.shape.rot.y + 0x6A4) * 70.0f; + sp2C.z = this->actor.world.pos.z + Math_CosS(this->actor.shape.rot.y + 0x6A4) * 70.0f; + sp2C.y = this->actor.world.pos.y; Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_HIT_GND); Camera_AddQuake(&globalCtx->mainCamera, 2, 0x19, 5); - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); CollisionCheck_SpawnShieldParticles(globalCtx, &sp2C); } @@ -464,8 +464,8 @@ void func_80A74EBC(EnIk* this, GlobalContext* globalCtx) { this->unk_2FE = 1; } else { if ((this->unk_2FB != 0) && (this->skelAnime.curFrame < 10.0f)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x5DC, 0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); + this->actor.shape.rot.y = this->actor.world.rot.y; } this->unk_2FE = 0; } @@ -526,8 +526,8 @@ void func_80A75260(EnIk* this, GlobalContext* globalCtx) { if (((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 9.0f)) || ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 18.0f))) { if ((this->unk_2FC == 0) && (this->unk_2FB != 0) && (this->skelAnime.curFrame < 10.0f)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x5DC, 0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x5DC, 0); + this->actor.shape.rot.y = this->actor.world.rot.y; } if (this->unk_2FE < 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); @@ -568,8 +568,8 @@ void func_80A754A0(EnIk* this) { } void func_80A75530(EnIk* this, GlobalContext* globalCtx) { - Math_StepUntilS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x7D0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_StepUntilS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x7D0); + this->actor.shape.rot.y = this->actor.world.rot.y; if ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 18.0f)) { if (this->unk_2FE < 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_SWING_AXE); @@ -597,8 +597,8 @@ void func_80A755F0(EnIk* this) { void func_80A7567C(EnIk* this, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->shieldCollider.base); if (SkelAnime_Update(&this->skelAnime)) { - if ((ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4000) && - (this->actor.xzDistToLink < 100.0f) && (ABS(this->actor.yDistToLink) < 150.0f)) { + if ((ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4000) && + (this->actor.xzDistToPlayer < 100.0f) && (ABS(this->actor.yDistToPlayer) < 150.0f)) { if ((globalCtx->gameplayFrames & 1)) { func_80A74E2C(this); } else { @@ -614,7 +614,7 @@ void func_80A75790(EnIk* this) { s16 yaw; s16 yawDiff; - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->bodyCollider.base.ac->posRot.pos); + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->bodyCollider.base.ac->world.pos); this->unk_2F8 = 0; yawDiff = yaw - this->actor.shape.rot.y; if (ABS(yawDiff) <= 0x4000) { @@ -636,7 +636,7 @@ void func_80A758B0(EnIk* this, GlobalContext* globalCtx) { this->unk_308.unk_10 = 0; } if (SkelAnime_Update(&this->skelAnime)) { - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4000) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4000) { func_80A7489C(this); func_80A745E4(this, globalCtx); } else { @@ -668,13 +668,13 @@ void func_80A75A38(EnIk* this, GlobalContext* globalCtx) { this->unk_2F9--; for (i = 0xC - (this->unk_2F9 >> 1); i >= 0; i--) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(120.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(120.0f); - pos.y = this->actor.posRot.pos.y + 20.0f + Rand_CenteredFloat(50.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(120.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(120.0f); + pos.y = this->actor.world.pos.y + 20.0f + Rand_CenteredFloat(50.0f); EffectSsDeadDb_Spawn(globalCtx, &pos, &sp7C, &sp7C, 100, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); } if (this->unk_2F9 == 0) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xB0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xB0); if (this->switchFlags != 0xFF) { Flags_SetSwitch(globalCtx, this->switchFlags); } @@ -709,7 +709,7 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { if (!(this->bodyCollider.base.acFlags & AC_HIT)) { return; } - sp38 = this->actor.posRot.pos; + sp38 = this->actor.world.pos; sp38.y += 50.0f; func_80035650(&this->actor, &this->bodyCollider.info, 1); temp_v0_3 = this->actor.colChkInfo.damageEffect; @@ -733,14 +733,14 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { func_80032E24(&this->unk_308, 3, globalCtx); } } else if (this->actor.colChkInfo.health <= 10) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_BOSS); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_LAST_DAMAGE); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_BOSS); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_LAST_DAMAGE); if (this->switchFlags != 0xFF) { Flags_SetSwitch(globalCtx, this->switchFlags); } return; } else if (prevHealth == 50) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); } if (this->actor.colChkInfo.health == 0) { @@ -748,9 +748,9 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { func_80032C7C(globalCtx, &this->actor); return; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 0x7D0, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 0x7D0, 0); if ((this->actor.params == 0) && (Rand_ZeroOne() < 0.5f)) { - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) > 0x4000) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) > 0x4000) { func_80A754A0(this); } } @@ -795,17 +795,17 @@ void func_80A75FA0(Actor* thisx, GlobalContext* globalCtx) { this->unk_2FE = 0; } } - func_8002F71C(globalCtx, &this->actor, 8.0f, this->actor.yawTowardsLink, 8.0f); + func_8002F71C(globalCtx, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f); player->invincibilityTimer = prevInvincibilityTimer; } } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 0x1D); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 45.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 0x1D); + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 45.0f; Collider_UpdateCylinder(&this->actor, &this->bodyCollider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); - if ((this->actor.colChkInfo.health > 0) && (this->actor.dmgEffectTimer == 0) && (this->unk_2F8 >= 2)) { + if ((this->actor.colChkInfo.health > 0) && (this->actor.colorFilterTimer == 0) && (this->unk_2F8 >= 2)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); } if (this->unk_2FE > 0) { @@ -1057,7 +1057,7 @@ void func_80A76E2C(EnIk* this, GlobalContext* globalCtx, Vec3f* pos) { } void func_80A77034(EnIk* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 func_80A7707C(EnIk* this) { @@ -1076,10 +1076,10 @@ void func_80A770C0(EnIk* this, GlobalContext* globalCtx, s32 actionIdx) { CsCmdActorAction* npcAction = EnIk_GetNpcAction(globalCtx, actionIdx); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -1092,7 +1092,7 @@ f32 EnIk_curFrame(Actor* thisx) { void func_80A77148(EnIk* this) { this->action = 0; this->drawMode = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80A77158(EnIk* this, GlobalContext* globalCtx) { @@ -1101,7 +1101,7 @@ void func_80A77158(EnIk* this, GlobalContext* globalCtx) { func_80A770C0(this, globalCtx, 4); this->action = 1; this->drawMode = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A771E4(EnIk* this) { @@ -1110,7 +1110,7 @@ void func_80A771E4(EnIk* this) { this->action = 2; this->drawMode = 1; this->unk_4D4 = 0; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A77264(EnIk* this, GlobalContext* globalCtx, s32 arg2) { @@ -1129,7 +1129,7 @@ void func_80A772EC(EnIk* this, GlobalContext* globalCtx) { s32 pad[2]; f32 wDest; - SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &this->actor.posRot.pos, &D_80A78FA0, &wDest); + SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->mf_11D60, &this->actor.world.pos, &D_80A78FA0, &wDest); Audio_PlaySoundGeneral(NA_SE_EN_IRONNACK_DEAD, &D_80A78FA0, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -1143,20 +1143,20 @@ void func_80A7735C(EnIk* this, GlobalContext* globalCtx) { this->drawMode = 2; func_80A770C0(this, globalCtx, 4); func_80A772EC(this, globalCtx); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A77434(EnIk* this, GlobalContext* globalCtx) { this->action = 4; this->drawMode = 2; func_80A772A4(this); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80A77474(EnIk* this, GlobalContext* globalCtx) { this->action = 5; this->drawMode = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80A7748C(EnIk* this, GlobalContext* globalCtx) { @@ -1467,7 +1467,7 @@ void EnIk_Init(Actor* thisx, GlobalContext* globalCtx) { (flag != 0 && Flags_GetSwitch(globalCtx, flag >> 8))) { Actor_Kill(&this->actor); } else { - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0601E178, &D_0600C114, this->jointTable, this->morphTable, 30); func_80A74398(&this->actor, globalCtx); @@ -1477,7 +1477,7 @@ void EnIk_Init(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Ik_InitVars = { ACTOR_EN_IK, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_IK, sizeof(EnIk), 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 876ac309a0..1a42e0f51c 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -27,7 +27,7 @@ void func_80A7A4BC(EnIn* this, GlobalContext* globalCtx); const ActorInit En_In_InitVars = { ACTOR_EN_IN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_IN, sizeof(EnIn), @@ -310,7 +310,7 @@ void func_80A795C8(EnIn* this, GlobalContext* globalCtx) { this->unk_308.unk_18 = globalCtx->view.eye; this->unk_308.unk_14 = 60.0f; } else { - this->unk_308.unk_18 = player->actor.posRot.pos; + this->unk_308.unk_18 = player->actor.world.pos; this->unk_308.unk_14 = 16.0f; } func_80034A14(&this->actor, &this->unk_308, 1, phi_a3); @@ -435,23 +435,23 @@ void func_80A79C78(EnIn* this, GlobalContext* globalCtx) { this->camId = Gameplay_CreateSubCamera(globalCtx); Gameplay_ChangeCameraStatus(globalCtx, 0, 1); Gameplay_ChangeCameraStatus(globalCtx, this->camId, 7); - sp48.x = this->actor.posRot.pos.x; - sp48.y = this->actor.posRot.pos.y + 60.0f; - sp48.z = this->actor.posRot.pos.z; + sp48.x = this->actor.world.pos.x; + sp48.y = this->actor.world.pos.y + 60.0f; + sp48.z = this->actor.world.pos.z; sp3C.x = sp48.x; sp3C.y = sp48.y - 22.0f; sp3C.z = sp48.z + 40.0f; Gameplay_CameraSetAtEye(globalCtx, this->camId, &sp48, &sp3C); - this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, &sp3C); + this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &sp3C); this->unk_308.unk_08 = zeroVec; this->unk_308.unk_0E = zeroVec; func_8010B680(globalCtx, 0x2025, NULL); this->unk_308.unk_00 = 1; - player->actor.posRot.pos = this->actor.posRot.pos; - player->actor.posRot.pos.x += 100.0f * Math_SinS(this->actor.shape.rot.y); - player->actor.posRot.pos.z += 100.0f * Math_CosS(this->actor.shape.rot.y); + player->actor.world.pos = this->actor.world.pos; + player->actor.world.pos.x += 100.0f * Math_SinS(this->actor.shape.rot.y); + player->actor.world.pos.z += 100.0f * Math_CosS(this->actor.shape.rot.y); if (player->rideActor != NULL) { - player->rideActor->posRot.pos = player->actor.posRot.pos; + player->rideActor->world.pos = player->actor.world.pos; player->rideActor->freezeTimer = 10; } player->actor.freezeTimer = 10; @@ -494,7 +494,7 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { s32 sp3C = 0; if (Object_IsLoaded(&globalCtx->objectCtx, this->ingoObjBankIndex) || this->actor.params <= 0) { - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013B88, NULL, this->jointTable, this->morphTable, 20); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -504,7 +504,7 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { return; } Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->unk_308.unk_00 = 0; this->actionFunc = func_80A7A4BC; @@ -563,7 +563,7 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { gSaveContext.eventInf[0] = 0; break; case 1: - this->actor.unk_1F = 3; + this->actor.targetMode = 3; func_80A796EC(this, 2); this->actionFunc = func_80A7A568; func_80088B34(0x3C); @@ -579,7 +579,7 @@ void func_80A79FB0(EnIn* this, GlobalContext* globalCtx) { break; case 5: case 6: - this->actor.unk_1F = 3; + this->actor.targetMode = 3; func_80A796EC(this, 6); this->unk_1EC = 8; this->actionFunc = func_80A7AA40; @@ -755,8 +755,8 @@ void func_80A7AA40(EnIn* this, GlobalContext* globalCtx) { this->unk_300 = 50.0f; this->unk_304 = 50.0f; - sp30 = this->actor.posRot.pos; - sp24 = this->actor.posRot.pos; + sp30 = this->actor.world.pos; + sp24 = this->actor.world.pos; sp30.x += this->unk_2F0; sp30.y += this->unk_2F4; @@ -821,8 +821,8 @@ void func_80A7ABD4(EnIn* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->unk_300, 150.0f, 0.06f, 10000.0f, 0.0f); Math_SmoothStepToF(&this->unk_304, 300.0f, 0.06f, 10000.0f, 0.0f); - sp48 = this->actor.posRot.pos; - sp3C = this->actor.posRot.pos; + sp48 = this->actor.world.pos; + sp3C = this->actor.world.pos; sp48.x += this->unk_2F0; sp48.y += this->unk_2F4; @@ -845,11 +845,11 @@ void func_80A7AE84(EnIn* this, GlobalContext* globalCtx) { void func_80A7AEF0(EnIn* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 yaw; - Vec3f pos = this->actor.posRot.pos; + Vec3f pos = this->actor.world.pos; pos.x += 90.0f * Math_SinS(this->actor.shape.rot.y); pos.z += 90.0f * Math_CosS(this->actor.shape.rot.y); - yaw = Math_Vec3f_Yaw(&pos, &player->actor.posRot.pos); + yaw = Math_Vec3f_Yaw(&pos, &player->actor.world.pos); if (ABS(yaw) > 0x4000) { globalCtx->nextEntranceIndex = 0x0476; globalCtx->sceneLoadFlag = 0x14; @@ -903,7 +903,7 @@ void EnIn_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->skelAnime.animation == &D_06001BE0 && ((gSaveContext.eventInf[0] & 0xF) != 6)) { func_80A79690(&this->skelAnime, this, globalCtx); } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); } func_80A79A2C(this); this->actionFunc(this, globalCtx); @@ -913,7 +913,7 @@ void EnIn_Update(Actor* thisx, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) {} } else { func_800343CC(globalCtx, &this->actor, &this->unk_308.unk_00, - ((this->actor.unk_1F == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, func_80A79168, + ((this->actor.targetMode == 6) ? 80.0f : 320.0f) + this->collider.dim.radius, func_80A79168, func_80A79500); if (this->unk_308.unk_00 != 0) { this->unk_1FA = this->unk_1F8; @@ -958,8 +958,8 @@ void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_in.c", 2335); if (limbIndex == 16) { - Matrix_MultVec3f(&D_80A7B9A8, &this->actor.posRot2.pos); - this->actor.posRot2.rot = this->actor.posRot.rot; + Matrix_MultVec3f(&D_80A7B9A8, &this->actor.focus.pos); + this->actor.focus.rot = this->actor.world.rot; } if (limbIndex == 12 && this->skelAnime.animation == &D_06014CA8) { gSPDisplayList(POLY_OPA_DISP++, D_06007A20); 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 fcc7d4c091..0115319071 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -35,7 +35,7 @@ static s16 D_80A7DEB8 = 0; const ActorInit En_Insect_InitVars = { ACTOR_EN_INSECT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnInsect), @@ -94,12 +94,12 @@ s32 func_80A7BE6C(EnInsect* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f pos; - if (this->actor.xzDistToLink < 32.0f) { - pos.x = Math_SinS(this->actor.yawTowardsLink + 0x8000) * 16.0f + player->actor.posRot.pos.x; - pos.y = player->actor.posRot.pos.y; - pos.z = Math_CosS(this->actor.yawTowardsLink + 0x8000) * 16.0f + player->actor.posRot.pos.z; + if (this->actor.xzDistToPlayer < 32.0f) { + pos.x = Math_SinS(this->actor.yawTowardsPlayer + 0x8000) * 16.0f + player->actor.world.pos.x; + pos.y = player->actor.world.pos.y; + pos.z = Math_CosS(this->actor.yawTowardsPlayer + 0x8000) * 16.0f + player->actor.world.pos.z; - if (EnInsect_XZDistanceSquared(&pos, &this->actor.posRot.pos) <= 400.0f) { + if (EnInsect_XZDistanceSquared(&pos, &this->actor.world.pos) <= 400.0f) { return 1; } } @@ -123,14 +123,14 @@ s32 EnInsect_FoundNearbySoil(EnInsect* this, GlobalContext* globalCtx) { s32 ret; ret = 0; - currentActor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + currentActor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; bestDistance = 6400.0f; this->soilActor = NULL; while (currentActor != NULL) { if (currentActor->id == ACTOR_OBJ_MAKEKINSUTA) { - currentDistance = Math3D_Dist2DSq(this->actor.posRot.pos.x, this->actor.posRot.pos.z, - currentActor->posRot.pos.x, currentActor->posRot.pos.z); + currentDistance = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, + currentActor->world.pos.x, currentActor->world.pos.z); if (currentDistance < bestDistance && currentActor->room == this->actor.room) { ret = 1; @@ -191,12 +191,12 @@ void EnInsect_Init(Actor* thisx, GlobalContext* globalCtx) { } if (temp_s2 == 2) { - this->actor.posRot.rot.z = 0; - this->actor.shape.rot.z = this->actor.posRot.rot.z; + this->actor.world.rot.z = 0; + this->actor.shape.rot.z = this->actor.world.rot.z; for (count = 0; count < 2; count++) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, this->actor.shape.rot.x, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 3); if (globalCtx) {} @@ -252,7 +252,7 @@ void func_80A7C3F4(EnInsect* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = CLAMP(playSpeed, 0.0f, 1.9f); SkelAnime_Update(&this->skelAnime); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->unk_31A <= 0) { func_80A7C598(this); } @@ -262,7 +262,7 @@ void func_80A7C3F4(EnInsect* this, GlobalContext* globalCtx) { func_80A7CBC8(this); } else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { func_80A7CE60(this); - } else if (this->actor.xzDistToLink < 40.0f) { + } else if (this->actor.xzDistToPlayer < 40.0f) { func_80A7C818(this); } } @@ -282,16 +282,15 @@ void func_80A7C5EC(EnInsect* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f); - if (EnInsect_XZDistanceSquared(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 1600.0f || - (this->unk_31A < 4)) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 1600.0f || (this->unk_31A < 4)) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } else if (this->actor.child != NULL && &this->actor != this->actor.child) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.child->posRot.pos); - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.child->world.pos); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.4f, 0.7f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -305,7 +304,7 @@ void func_80A7C5EC(EnInsect* this, GlobalContext* globalCtx) { func_80A7CBC8(this); } else if ((this->unk_314 & 1) && (this->actor.bgCheckFlags & 0x40)) { func_80A7CE60(this); - } else if (this->actor.xzDistToLink < 40.0f) { + } else if (this->actor.xzDistToPlayer < 40.0f) { func_80A7C818(this); } } @@ -323,17 +322,16 @@ void func_80A7C86C(EnInsect* this, GlobalContext* globalCtx) { s16 pad3; s16 frames; s16 yaw; - s16 sp38 = this->actor.xzDistToLink < 40.0f; + s16 sp38 = this->actor.xzDistToPlayer < 40.0f; Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.1f, 0.5f, 0.0f); - if (EnInsect_XZDistanceSquared(&this->actor.posRot.pos, &this->actor.initPosRot.pos) > 25600.0f || - this->unk_31A < 4) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + if (EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > 25600.0f || this->unk_31A < 4) { + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } else if (sp38 != 0) { frames = globalCtx->state.frames; - yaw = this->actor.yawTowardsLink + 0x8000; + yaw = this->actor.yawTowardsPlayer + 0x8000; if (frames & 0x10) { if (frames & 0x20) { @@ -345,9 +343,9 @@ void func_80A7C86C(EnInsect* this, GlobalContext* globalCtx) { } } if (globalCtx) {} - Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000); + Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.6f, 0.8f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -394,7 +392,7 @@ void func_80A7CBC8(EnInsect* this) { func_80A7BF58(this); this->skelAnime.playSpeed = 1.9f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_SINK); - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); this->actionFunc = func_80A7CC3C; this->unk_314 &= ~0x100; this->unk_314 |= 0x8; @@ -411,9 +409,9 @@ void func_80A7CC3C(EnInsect* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.0002f, 0.001f)); - this->actor.shape.unk_08 -= 0.8f; - this->actor.posRot.pos.x = Rand_ZeroOne() + this->actor.initPosRot.pos.x - 0.5f; - this->actor.posRot.pos.z = Rand_ZeroOne() + this->actor.initPosRot.pos.z - 0.5f; + this->actor.shape.yOffset -= 0.8f; + this->actor.world.pos.x = Rand_ZeroOne() + this->actor.home.pos.x - 0.5f; + this->actor.world.pos.z = Rand_ZeroOne() + this->actor.home.pos.z - 0.5f; SkelAnime_Update(&this->skelAnime); @@ -421,13 +419,13 @@ void func_80A7CC3C(EnInsect* this, GlobalContext* globalCtx) { velocity.x = Math_SinS(this->actor.shape.rot.y) * -0.6f; velocity.y = Math_SinS(this->actor.shape.rot.x) * 0.6f; velocity.z = Math_CosS(this->actor.shape.rot.y) * -0.6f; - func_800286CC(globalCtx, &this->actor.posRot.pos, &velocity, &accel, Rand_ZeroOne() * 5.0f + 8.0f, + func_800286CC(globalCtx, &this->actor.world.pos, &velocity, &accel, Rand_ZeroOne() * 5.0f + 8.0f, Rand_ZeroOne() * 5.0f + 8.0f); } if (this->unk_31A <= 0) { if ((this->unk_314 & 0x10) && this->soilActor != NULL && - Math3D_Vec3fDistSq(&this->soilActor->actor.posRot.pos, &this->actor.posRot.pos) < 64.0f) { + Math3D_Vec3fDistSq(&this->soilActor->actor.world.pos, &this->actor.world.pos) < 64.0f) { this->soilActor->unk_152 = 1; } Actor_Kill(&this->actor); @@ -459,7 +457,7 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f); } this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; this->skelAnime.playSpeed = CLAMP(this->unk_31A * 0.018f, 0.1f, 1.9f); SkelAnime_Update(&this->skelAnime); @@ -481,7 +479,7 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) { } this->unk_316 = phi_v0; } - this->actor.posRot.rot.y += this->unk_316; + this->actor.world.rot.y += this->unk_316; temp_v1 = this->skelAnime.playSpeed * 1000.0f; if (this->unk_318 < -temp_v1) { @@ -496,13 +494,13 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += this->unk_318; - Math_ScaledStepToS(&this->actor.posRot.rot.x, 0, 3000); - this->actor.shape.rot.x = this->actor.posRot.rot.x; + Math_ScaledStepToS(&this->actor.world.rot.x, 0, 3000); + this->actor.shape.rot.x = this->actor.world.rot.x; if (Rand_ZeroOne() < 0.03f) { - sp40.x = this->actor.posRot.pos.x; - sp40.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - sp40.z = this->actor.posRot.pos.z; + sp40.x = this->actor.world.pos.x; + sp40.y = this->actor.world.pos.y + this->actor.yDistToWater; + sp40.z = this->actor.world.pos.z; EffectSsGRipple_Spawn(globalCtx, &sp40, 20, 100, 4); EffectSsGRipple_Spawn(globalCtx, &sp40, 40, 200, 8); } @@ -538,7 +536,7 @@ void func_80A7D26C(EnInsect* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.00005f, 0.001f)); if (this->actor.yDistToWater > 5.0f && this->actor.yDistToWater < 30.0f && Rand_ZeroOne() < 0.3f) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f); } if (this->unk_31A <= 0) { @@ -552,7 +550,7 @@ void func_80A7D39C(EnInsect* this) { this->unk_324 = 1.5f; this->unk_328 = Rand_ZeroOne() * 65535.5f; this->unk_316 = (Rand_ZeroOne() - 0.5f) * 1500.0f; - this->actor.posRot.rot.y = Rand_ZeroOne() * 65535.5f; + this->actor.world.rot.y = Rand_ZeroOne() * 65535.5f; Actor_SetScale(&this->actor, 0.003f); this->actionFunc = func_80A7D460; this->unk_314 |= 0x100; @@ -574,7 +572,7 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { sp3A = this->actor.params & 3; if (this->soilActor != NULL) { - sp40 = Math3D_Vec3fDistSq(&this->actor.posRot.pos, &this->soilActor->actor.posRot.pos); + sp40 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos); } else { if (this->unk_314 & 0x10) { osSyncPrintf(VT_COL(YELLOW, BLACK)); @@ -603,13 +601,13 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { } if (this->soilActor != NULL && Rand_ZeroOne() < 0.07f) { - this->actor.initPosRot.pos.x = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.posRot.pos.x; - this->actor.initPosRot.pos.y = thisTemp->soilActor->actor.posRot.pos.y; - this->actor.initPosRot.pos.z = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.posRot.pos.z; + this->actor.home.pos.x = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.world.pos.x; + this->actor.home.pos.y = thisTemp->soilActor->actor.world.pos.y; + this->actor.home.pos.z = (Rand_ZeroOne() - 0.5f) * phi_f2 + thisTemp->soilActor->actor.world.pos.z; } if (D_80A7DEB0 > 0.999f) { - this->unk_328 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->unk_328 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->unk_324 = Rand_ZeroOne() * 0.6f + 0.6f; } else if (Rand_ZeroOne() < 0.07f) { if (this->unk_324 > 1.0f) { @@ -631,23 +629,23 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { } sp38 = (Rand_ZeroOne() - 0.5f) * 65535.0f * sp34; - this->unk_328 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos) + sp38; + this->unk_328 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos) + sp38; } Actor_SetScale(&this->actor, CLAMP_MAX(thisTemp->actor.scale.x + 0.0008f, 0.01f)); if (this->actor.bgCheckFlags & 1) { Math_SmoothStepToF(&this->actor.speedXZ, this->unk_324, 0.1f, 0.5f, 0.0f); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_328, 2000); - sp50 = Math_ScaledStepToS(&this->actor.posRot.rot.x, 0, 2000); - this->actor.shape.rot.y = this->actor.posRot.rot.y; - this->actor.shape.rot.x = this->actor.posRot.rot.x; + Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_328, 2000); + sp50 = Math_ScaledStepToS(&this->actor.world.rot.x, 0, 2000); + this->actor.shape.rot.y = this->actor.world.rot.y; + this->actor.shape.rot.x = this->actor.world.rot.x; } else { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); this->actor.speedXZ += (Rand_ZeroOne() - 0.5f) * 0.14f; this->actor.velocity.y += Rand_ZeroOne() * 0.12f; - this->actor.posRot.rot.y += this->unk_316; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.world.rot.y += this->unk_316; + this->actor.shape.rot.y = this->actor.world.rot.y; this->actor.shape.rot.x -= 2000; } @@ -706,7 +704,7 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) { } else if (sp50 != 0) { func_80A7C3A0(this); } else if ((sp3A == 2 || sp3A == 3) && (this->unk_314 & 1) && this->unk_31C <= 0 && this->unk_31A <= 0 && - this->actor.groundY < -31990.0f) { + this->actor.floorHeight < -31990.0f) { osSyncPrintf(VT_COL(YELLOW, BLACK)); // BG missing? To do Actor_delete osSyncPrintf("BG 抜け? Actor_delete します(%s %d)\n", "../z_en_mushi.c", 1197); @@ -761,7 +759,7 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) { if (phi_v0 != 0) { phi_v0 |= 0x40; - func_8002E4B4(globalCtx, &this->actor, 8.0f, 5.0f, 0.0f, phi_v0); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 8.0f, 5.0f, 0.0f, phi_v0); } if (Actor_HasParent(&this->actor, globalCtx)) { @@ -773,7 +771,7 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) { } else { func_80A7CA64(this); } - } else if (this->actor.xzDistToLink < 50.0f && this->actionFunc != func_80A7CAD0) { + } else if (this->actor.xzDistToPlayer < 50.0f && this->actionFunc != func_80A7CAD0) { if (!(this->unk_314 & 0x20) && this->unk_31C < 180) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -784,7 +782,7 @@ void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } } 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 8b1abd989d..ab23da9c30 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -41,7 +41,7 @@ static s16 sRotSpeedY = 0; const ActorInit En_Ishi_InitVars = { ACTOR_EN_ISHI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(EnIshi), @@ -116,13 +116,13 @@ s32 EnIshi_SnapToFloor(EnIshi* this, GlobalContext* globalCtx, f32 arg2) { s32 bgId; f32 floorY; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 30.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 30.0f; + pos.z = this->actor.world.pos.z; floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &poly, &bgId, &this->actor, &pos); if (floorY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = floorY + arg2; - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + this->actor.world.pos.y = floorY + arg2; + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); return true; } else { osSyncPrintf(VT_COL(YELLOW, BLACK)); @@ -142,9 +142,9 @@ void EnIshi_SpawnFragmentsSmall(EnIshi* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < ARRAY_COUNT(scales); i++) { - pos.x = this->actor.posRot.pos.x + (Rand_ZeroOne() - 0.5f) * 8.0f; - pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() * 5.0f) + 5.0f; - pos.z = this->actor.posRot.pos.z + (Rand_ZeroOne() - 0.5f) * 8.0f; + pos.x = this->actor.world.pos.x + (Rand_ZeroOne() - 0.5f) * 8.0f; + pos.y = this->actor.world.pos.y + (Rand_ZeroOne() * 5.0f) + 5.0f; + pos.z = this->actor.world.pos.z + (Rand_ZeroOne() - 0.5f) * 8.0f; Math_Vec3f_Copy(&velocity, &this->actor.velocity); if (this->actor.bgCheckFlags & 1) { velocity.x *= 0.8f; @@ -182,9 +182,9 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(scales); i++) { angle += 0x4E20; rand = Rand_ZeroOne() * 10.0f; - pos.x = this->actor.posRot.pos.x + (Math_SinS(angle) * rand); - pos.y = this->actor.posRot.pos.y + (Rand_ZeroOne() * 40.0f) + 5.0f; - pos.z = this->actor.posRot.pos.z + (Math_CosS(angle) * rand); + pos.x = this->actor.world.pos.x + (Math_SinS(angle) * rand); + pos.y = this->actor.world.pos.y + (Rand_ZeroOne() * 40.0f) + 5.0f; + pos.z = this->actor.world.pos.z + (Math_CosS(angle) * rand); Math_Vec3f_Copy(&velocity, &thisx->velocity); if (thisx->bgCheckFlags & 1) { velocity.x *= 0.9f; @@ -209,15 +209,15 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx) { phi_v0 = 69; phi_v1 = -320; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, phi_v1, phi_v0, 30, 5, 0, scales[i], - 5, 2, 70, KAKERA_COLOR_WHITE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8); + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, phi_v1, phi_v0, 30, 5, 0, scales[i], 5, + 2, 70, KAKERA_COLOR_WHITE, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8); } } void EnIshi_SpawnDustSmall(EnIshi* this, GlobalContext* globalCtx) { Vec3f pos; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); if (this->actor.bgCheckFlags & 1) { pos.x += 2.0f * this->actor.velocity.x; pos.y -= 2.0f * this->actor.velocity.y; @@ -233,7 +233,7 @@ void EnIshi_SpawnDustSmall(EnIshi* this, GlobalContext* globalCtx) { void EnIshi_SpawnDustLarge(EnIshi* this, GlobalContext* globalCtx) { Vec3f pos; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); if (this->actor.bgCheckFlags & 1) { pos.x += 2.0f * this->actor.velocity.x; pos.y -= 2.0f * this->actor.velocity.y; @@ -256,7 +256,7 @@ void EnIshi_DropCollectible(EnIshi* this, GlobalContext* globalCtx) { dropParams = 0; } - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, dropParams << 4); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, dropParams << 4); } } @@ -279,8 +279,8 @@ void EnIshi_SpawnBugs(EnIshi* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); + Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); if (bug == NULL) { break; @@ -314,7 +314,7 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.uncullZoneForward += 1000.0f; } if (this->actor.shape.rot.y == 0) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = Rand_ZeroFloat(0x10000); + this->actor.shape.rot.y = this->actor.world.rot.y = Rand_ZeroFloat(0x10000); } Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, globalCtx); @@ -324,7 +324,7 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) { return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - this->actor.shape.unk_08 = D_80A7FA20[type]; + this->actor.shape.yOffset = D_80A7FA20[type]; if (!((this->actor.params >> 5) & 1) && !EnIshi_SnapToFloor(this, globalCtx, 0.0f)) { Actor_Kill(&this->actor); return; @@ -350,24 +350,24 @@ void EnIshi_Wait(EnIshi* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnIshi_SetupLiftedUp(this); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, liftSounds[type]); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, liftSounds[type]); if ((this->actor.params >> 4) & 1) { EnIshi_SpawnBugs(this, globalCtx); } } else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) && this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000048) { EnIshi_DropCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, sBreakSoundDurations[type], sBreakSounds[type]); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], sBreakSounds[type]); sFragmentSpawnFuncs[type](this, globalCtx); sDustSpawnFuncs[type](this, globalCtx); Actor_Kill(&this->actor); - } else if (this->actor.xzDistToLink < 600.0f) { + } else if (this->actor.xzDistToPlayer < 600.0f) { Collider_UpdateCylinder(&this->actor, &this->collider); this->collider.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 400.0f) { + if (this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 90.0f) { + if (this->actor.xzDistToPlayer < 90.0f) { if (type == ROCK_LARGE) { func_8002F434(&this->actor, globalCtx, 0, 80.0f, 20.0f); } else { @@ -394,13 +394,13 @@ void EnIshi_LiftedUp(EnIshi* this, GlobalContext* globalCtx) { EnIshi_Fall(this); func_80A7ED94(&this->actor.velocity, D_80A7FA28[this->actor.params & 1]); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); } } void EnIshi_SetupFly(EnIshi* this) { - this->actor.velocity.x = Math_SinS(this->actor.posRot.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.posRot.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; if ((this->actor.params & 1) == ROCK_SMALL) { sRotSpeedX = (Rand_ZeroOne() - 0.5f) * 16000.0f; sRotSpeedY = (Rand_ZeroOne() - 0.5f) * 2400.0f; @@ -423,7 +423,7 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { EnIshi_DropCollectible(this, globalCtx); sFragmentSpawnFuncs[type](this, globalCtx); if (!(this->actor.bgCheckFlags & 0x20)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, sBreakSoundDurations[type], + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, sBreakSoundDurations[type], sBreakSounds[type]); sDustSpawnFuncs[type](this, globalCtx); } @@ -432,15 +432,15 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { Quake_SetSpeed(quakeIdx, -0x3CB0); Quake_SetQuakeValues(quakeIdx, 3, 0, 0, 0); Quake_SetCountdown(quakeIdx, 7); - func_800AA000(this->actor.xyzDistToLinkSq, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xyzDistToPlayerSq, 0xFF, 0x14, 0x96); } Actor_Kill(&this->actor); return; } if (this->actor.bgCheckFlags & 0x40) { - contactPos.x = this->actor.posRot.pos.x; - contactPos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - contactPos.z = this->actor.posRot.pos.z; + contactPos.x = this->actor.world.pos.x; + contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater; + contactPos.z = this->actor.world.pos.z; EffectSsGSplash_Spawn(globalCtx, &contactPos, 0, 0, 0, 350); if (type == ROCK_SMALL) { EffectSsGRipple_Spawn(globalCtx, &contactPos, 150, 650, 0); @@ -454,16 +454,16 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { this->actor.minVelocityY = -6.0f; sRotSpeedX >>= 2; sRotSpeedY >>= 2; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); this->actor.bgCheckFlags &= ~0x40; } - Math_StepToF(&this->actor.shape.unk_08, 0.0f, 2.0f); + Math_StepToF(&this->actor.shape.yOffset, 0.0f, 2.0f); EnIshi_Fall(this); func_80A7ED94(&this->actor.velocity, D_80A7FA28[type]); func_8002D7EC(&this->actor); this->actor.shape.rot.x += sRotSpeedX; this->actor.shape.rot.y += sRotSpeedY; - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } 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 72d29daec2..98c2e85007 100644 --- a/src/overlays/actors/ovl_En_It/z_en_it.c +++ b/src/overlays/actors/ovl_En_It/z_en_it.c @@ -38,7 +38,7 @@ static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_It_InitVars = { ACTOR_EN_IT, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnIt), 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 9957f8999f..b18ca9ee37 100644 --- a/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_0600BA8C; /* const ActorInit En_Jj_InitVars = { ACTOR_EN_JJ, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_JJ, sizeof(EnJj), 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 27c3bbe1b5..3de29128b3 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -19,7 +19,7 @@ void func_80A89304(EnJs* this, GlobalContext* globalCtx); const ActorInit En_Js_InitVars = { ACTOR_EN_JS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_JS, sizeof(EnJs), @@ -71,8 +71,8 @@ void EnJs_Init(Actor* thisx, GlobalContext* globalCtx) { En_Js_SetupAction(this, func_80A89304); this->unk_284 = 0; this->actor.gravity = -1.0f; - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_JSJUTAN, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_JSJUTAN, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } void EnJs_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -88,9 +88,9 @@ u8 func_80A88F64(EnJs* this, GlobalContext* globalCtx, u16 textId) { return 1; } else { this->actor.textId = textId; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; - if (ABS(yawDiff) <= 0x1800 && this->actor.xzDistToLink < 100.0f) { + if (ABS(yawDiff) <= 0x1800 && this->actor.xzDistToPlayer < 100.0f) { this->unk_284 |= 1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -175,21 +175,21 @@ void EnJs_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->actor.bgCheckFlags & 1) { - if (SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource) == 1) { - Math_ApproachF(&this->actor.shape.unk_08, sREG(80) + -2000.0f, 1.0f, (sREG(81) / 10.0f) + 50.0f); + if (SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1) { + Math_ApproachF(&this->actor.shape.yOffset, sREG(80) + -2000.0f, 1.0f, (sREG(81) / 10.0f) + 50.0f); } } else { - Math_ApproachZeroF(&this->actor.shape.unk_08, 1.0f, (sREG(81) / 10.0f) + 50.0f); + Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, (sREG(81) / 10.0f) + 50.0f); } if (SkelAnime_Update(&this->skelAnime)) { this->skelAnime.curFrame = 0.0f; } this->actionFunc(this, globalCtx); if (this->unk_284 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_278, &this->unk_27E, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_278, &this->unk_27E, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->unk_278.x, 0, 6, 0x1838, 0x64); Math_SmoothStepToS(&this->unk_278.y, 0, 6, 0x1838, 0x64); @@ -223,7 +223,7 @@ void EnJs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnJs* this = THIS; if (limbIndex == 12) { - Matrix_MultVec3f(&D_80A896DC, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80A896DC, &this->actor.focus.pos); } } void EnJs_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 ab1bd8dffa..cfcbd1813c 100644 --- a/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -12,7 +12,7 @@ void EnJsjutan_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Jsjutan_InitVars = { ACTOR_EN_JSJUTAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnJsjutan), 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 01b3774171..fdd7e6eb57 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -48,7 +48,7 @@ extern AnimationHeader D_06000214; const ActorInit En_Kakasi_InitVars = { ACTOR_EN_KAKASI, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_KA, sizeof(EnKakasi), @@ -69,14 +69,14 @@ void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) { EnKakasi* this = THIS; osSyncPrintf("\n\n"); - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ Let’s DANCE! ☆☆☆☆☆ %f\n" VT_RST, this->actor.posRot.pos.y); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ Let’s DANCE! ☆☆☆☆☆ %f\n" VT_RST, this->actor.world.pos.y); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_060065B0, &D_06000214, NULL, NULL, 0); - this->rot = this->actor.posRot.rot; + this->rot = this->actor.world.rot; this->actor.flags |= 0x400; this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -199,8 +199,8 @@ void func_80A8F660(EnKakasi* this, GlobalContext* globalCtx) { void func_80A8F75C(EnKakasi* this, GlobalContext* globalCtx) { Player* player = PLAYER; - s16 yawTowardsLink; - s16 absyawTowardsLink; + s16 yawTowardsPlayer; + s16 absyawTowardsPlayer; func_80A8F28C(this); SkelAnime_Update(&this->skelanime); @@ -214,11 +214,11 @@ void func_80A8F75C(EnKakasi* this, GlobalContext* globalCtx) { return; } - yawTowardsLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if (!(this->actor.xzDistToLink > 120.0f)) { - absyawTowardsLink = ABS(yawTowardsLink); + yawTowardsPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if (!(this->actor.xzDistToPlayer > 120.0f)) { + absyawTowardsPlayer = ABS(yawTowardsPlayer); - if (absyawTowardsLink < 0x4300) { + if (absyawTowardsPlayer < 0x4300) { if (!this->unk_194) { if (player->stateFlags2 & 0x1000000) { this->camId = func_800800F8(globalCtx, 0x8D4, -0x63, &this->actor, 0); @@ -230,7 +230,7 @@ void func_80A8F75C(EnKakasi* this, GlobalContext* globalCtx) { this->actionFunc = func_80A8F8D0; return; } - if (this->actor.xzDistToLink < 80.0f) { + if (this->actor.xzDistToPlayer < 80.0f) { player->stateFlags2 |= 0x800000; } } @@ -327,7 +327,7 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) { s32 i; this->unk_198++; - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; for (i = 0; i < ARRAY_COUNT(this->unk_19C); i++) { if (this->unk_19C[i] != 0) { this->unk_19C[i]--; @@ -335,10 +335,10 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) { } this->height = 60.0f; - Actor_SetHeight(&this->actor, this->height); + Actor_SetFocus(&this->actor, this->height); this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } 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 f8e4512865..cdf8c80b6f 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -47,7 +47,7 @@ extern AnimationHeader D_06000214; const ActorInit En_Kakasi2_InitVars = { ACTOR_EN_KAKASI2, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_KA, sizeof(EnKakasi2), @@ -69,11 +69,11 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->switchFlag = this->actor.params & 0x3F; spawnRangeY = (this->actor.params >> 6) & 0xFF; - spawnRangeXZ = this->actor.posRot.rot.z; + spawnRangeXZ = this->actor.world.rot.z; if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.unk_1F = 4; + this->actor.targetMode = 4; this->maxSpawnDistance.x = (spawnRangeY * 40.0f) + 40.0f; this->maxSpawnDistance.y = (spawnRangeXZ * 40.0f) + 40.0f; @@ -104,7 +104,7 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = func_80A9062C; } else { this->actionFunc = func_80A90264; - this->actor.shape.unk_08 = -8000.0f; + this->actor.shape.yOffset = -8000.0f; } } @@ -120,8 +120,8 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) { this->unk_194++; - if ((BREG(1) != 0) && (this->actor.xzDistToLink < this->maxSpawnDistance.x) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < this->maxSpawnDistance.y)) { + if ((BREG(1) != 0) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) { this->actor.draw = func_80A90948; Collider_InitCylinder(globalCtx, &this->collider); @@ -137,8 +137,8 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ SAVE 終了 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); this->actionFunc = func_80A904D8; - } else if ((this->actor.xzDistToLink < this->maxSpawnDistance.x) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < this->maxSpawnDistance.y) && + } else if ((this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y) && (gSaveContext.eventChkInf[9] & 0x1000)) { this->unk_194 = 0; @@ -180,11 +180,11 @@ void func_80A90578(EnKakasi2* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += 0x800; - Math_ApproachZeroF(&this->actor.shape.unk_08, 0.5f, 500.0f); + Math_ApproachZeroF(&this->actor.shape.yOffset, 0.5f, 500.0f); - if (this->actor.shape.unk_08 > -100.0f) { + if (this->actor.shape.yOffset > -100.0f) { this->actionFunc = func_80A9062C; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -207,12 +207,12 @@ void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) { EnKakasi2* this = THIS; GlobalContext* globalCtx2 = globalCtx; - this->actor.posRot.rot = this->actor.shape.rot; - Actor_SetHeight(&this->actor, this->height); + this->actor.world.rot = this->actor.shape.rot; + Actor_SetFocus(&this->actor, this->height); this->actionFunc(this, globalCtx2); Actor_MoveForward(&this->actor); - if (this->actor.shape.unk_08 == 0.0f) { + if (this->actor.shape.yOffset == 0.0f) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); @@ -220,21 +220,21 @@ void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) { if (BREG(0) != 0) { if (BREG(5) != 0) { osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->actor.player_distance ☆☆☆☆☆ %f\n" VT_RST, - this->actor.xzDistToLink); + this->actor.xzDistToPlayer); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->hosei.x ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.x); osSyncPrintf("\n\n"); } if (this->actor.draw == NULL) { if (this->unk_194 != 0) { if ((this->unk_194 % 2) == 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx2->state.gfxCtx); } } else { - 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, 1.0f, 0, 255, 255, 255, 4, globalCtx2->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 0, 255, 255, 255, 4, globalCtx2->state.gfxCtx); } } } 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 6578155f9d..407e1a8b0e 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -52,7 +52,7 @@ extern AnimationHeader D_06000214; const ActorInit En_Kakasi3_InitVars = { ACTOR_EN_KAKASI3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_KA, sizeof(EnKakasi3), @@ -75,13 +75,13 @@ void EnKakasi3_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Translates to: Obonur -- Related to the name of the scarecrow (Bonooru) osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ おーボヌール ☆☆☆☆☆ \n" VT_RST); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060065B0, &D_06000214, NULL, NULL, 0); this->actor.flags |= 0x400; - this->rot = this->actor.posRot.rot; + this->rot = this->actor.world.rot; this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80A911F0; @@ -232,8 +232,8 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) { return; } - angleTowardsLink = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if (!(this->actor.xzDistToLink > 120.0f)) { + angleTowardsLink = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if (!(this->actor.xzDistToPlayer > 120.0f)) { absAngleTowardsLink = ABS(angleTowardsLink); if (absAngleTowardsLink < 0x4300) { @@ -249,7 +249,7 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) { this->actionFunc = func_80A915B8; return; } - if (this->actor.xzDistToLink < 80.0f) { + if (this->actor.xzDistToPlayer < 80.0f) { player->stateFlags2 |= 0x800000; } } else if (gSaveContext.scarecrowSpawnSongSet && !this->unk_195) { @@ -264,7 +264,7 @@ void func_80A91348(EnKakasi3* this, GlobalContext* globalCtx) { this->actionFunc = func_80A9187C; return; } - if (this->actor.xzDistToLink < 80.0f) { + if (this->actor.xzDistToPlayer < 80.0f) { player->stateFlags2 |= 0x800000; } } @@ -423,17 +423,17 @@ void EnKakasi3_Update(Actor* thisx, GlobalContext* globalCtx) { } this->unk_198++; - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; for (i = 0; i < ARRAY_COUNT(this->unk_19C); i++) { if (this->unk_19C[i] != 0) { this->unk_19C[i]--; } } - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 28); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } 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 b3a5c1bfbf..6b8a895cb2 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -81,7 +81,7 @@ extern Gfx D_06001630[]; const ActorInit En_Kanban_InitVars = { ACTOR_EN_KANBAN, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_KANBAN, sizeof(EnKanban), @@ -199,7 +199,7 @@ void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); if (this->actor.params != ENKANBAN_PIECE) { - this->actor.unk_1F = 0; + this->actor.targetMode = 0; this->actor.flags |= 1; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -215,10 +215,10 @@ void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx) { } this->bounceX = 1; this->partFlags = 0xFFFF; - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); EnKanban_SetFloorRot(this); if (gSaveContext.linkAge == 1) { - this->actor.posRot.pos.y -= 15.0f; + this->actor.world.pos.y -= 15.0f; } } } @@ -235,7 +235,7 @@ void EnKanban_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnKanban_Message(EnKanban* this, GlobalContext* globalCtx) { if (!this->msgFlag) { if (this->msgTimer == 0) { - if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) < 0x2800) { + if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x2800) { if (func_8002F194(&this->actor, globalCtx)) { this->msgFlag = true; } else { @@ -281,12 +281,12 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { this->collider.base.acFlags &= ~AC_HIT; this->invincibilityTimer = 6; piece = (EnKanban*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_KANBAN, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->actor.shape.rot.x, + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, ENKANBAN_PIECE); if (piece != NULL) { ColliderInfo* hitItem = this->collider.info.acHitInfo; - s16 yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; u8 i; if (hitItem->toucher.dmgFlags & 0x700) { @@ -363,9 +363,9 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Matrix_RotateY((this->actor.shape.rot.y / (f32)0x8000) * M_PI, MTXMODE_NEW); Matrix_MultVec3f(&sPieceOffsets[piece->pieceType], &offset); - piece->actor.posRot.pos.x += offset.x; - piece->actor.posRot.pos.y += offset.y; - piece->actor.posRot.pos.z += offset.z; + piece->actor.world.pos.x += offset.x; + piece->actor.world.pos.y += offset.y; + piece->actor.world.pos.z += offset.z; piece->offset.x = -sPieceOffsets[piece->pieceType].x / this->actor.scale.x; piece->offset.y = -sPieceOffsets[piece->pieceType].y / this->actor.scale.x; piece->offset.z = -sPieceOffsets[piece->pieceType].z / this->actor.scale.x; @@ -373,7 +373,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { piece->pieceHeight = sPieceSizes[piece->pieceType].y; piece->actor.gravity = -1.0f; piece->actionState = ENKANBAN_AIR; - piece->actor.posRot.rot.y = (s16)Rand_CenteredFloat(0x3000) + this->actor.yawTowardsLink + 0x8000; + piece->actor.world.rot.y = (s16)Rand_CenteredFloat(0x3000) + this->actor.yawTowardsPlayer + 0x8000; piece->actor.velocity.y = Rand_ZeroFloat(2.0f) + 3.0f; piece->actor.speedXZ = Rand_ZeroFloat(2.0f) + 3.0f; if (piece->partCount >= 4) { @@ -396,12 +396,12 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_SWORD_STRIKE); } } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 44.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 44.0f; Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink > 500.0f) { + if (this->actor.xzDistToPlayer > 500.0f) { this->actor.flags |= 1; this->partFlags = 0xFFFF; } @@ -430,21 +430,21 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { u8 onGround; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 30.0f, 30.0f, 50.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 30.0f, 50.0f, 5); - tempX = this->actor.posRot.pos.x; - tempY = this->actor.posRot.pos.y; - tempZ = this->actor.posRot.pos.z; + tempX = this->actor.world.pos.x; + tempY = this->actor.world.pos.y; + tempZ = this->actor.world.pos.z; tempBgFlags = this->actor.bgCheckFlags; tempYDistToWater = this->actor.yDistToWater; - this->actor.posRot.pos.z += ((this->actor.posRot.pos.y - this->actor.groundY) * -50.0f) / 100.0f; - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); + this->actor.world.pos.z += ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); EnKanban_SetFloorRot(this); - this->actor.posRot.pos.x = tempX; - this->actor.posRot.pos.y = tempY; - this->actor.posRot.pos.z = tempZ; + this->actor.world.pos.x = tempX; + this->actor.world.pos.y = tempY; + this->actor.world.pos.z = tempZ; this->actor.bgCheckFlags = tempBgFlags; this->actor.yDistToWater = tempYDistToWater; @@ -494,15 +494,15 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { this->actionState = ENKANBAN_WATER; Audio_PlayActorSound2(&this->actor, NA_SE_EV_BOMB_DROP_WATER); this->bounceX = this->bounceZ = 0; - this->actor.posRot.pos.y += this->actor.yDistToWater; - EffectSsGSplash_Spawn(globalCtx, &this->actor.posRot.pos, NULL, NULL, 0, (this->partCount * 20) + 300); - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, 150, 650, 0); - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, 300, 800, 5); + this->actor.world.pos.y += this->actor.yDistToWater; + EffectSsGSplash_Spawn(globalCtx, &this->actor.world.pos, NULL, NULL, 0, (this->partCount * 20) + 300); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, 150, 650, 0); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, 300, 800, 5); this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; osSyncPrintf(" WAT Y = %f\n", this->actor.yDistToWater); - osSyncPrintf(" POS Y = %f\n", this->actor.posRot.pos.y); - osSyncPrintf(" GROUND Y = %f\n", this->actor.groundY); + osSyncPrintf(" POS Y = %f\n", this->actor.world.pos.y); + osSyncPrintf(" GROUND Y = %f\n", this->actor.floorHeight); break; } @@ -510,7 +510,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->bounceCount <= 0) { this->bounceCount++; this->actor.velocity.y *= -0.3f; - this->actor.posRot.rot.y += (s16)Rand_CenteredFloat(16384.0f); + this->actor.world.rot.y += (s16)Rand_CenteredFloat(16384.0f); } else { this->actor.velocity.y = 0.0f; } @@ -561,11 +561,11 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { accel.x = 0.0f; accel.y = 0.1f; accel.z = 0.0f; - pos.y = this->actor.groundY + 3.0f; + pos.y = this->actor.floorHeight + 3.0f; dustCount = this->partCount * 0.5f; for (j = 0; j < dustCount + 3; j++) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat((this->partCount * 0.5f) + 20.0f); func_800286CC(globalCtx, &pos, &velocity, &accel, 100, 5); } } @@ -580,18 +580,18 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { if (signpost->partFlags == 0xFFFF) { Actor_Kill(&this->actor); } - Math_ApproachF(&this->actor.shape.unk_08, 100.0f, 1.0f, 5.0f); + Math_ApproachF(&this->actor.shape.yOffset, 100.0f, 1.0f, 5.0f); if (this->actionState == ENKANBAN_WATER) { s32 rippleDelay; s32 rippleScale; - if ((player->actor.speedXZ > 0.0f) && (player->actor.posRot.pos.y < this->actor.posRot.pos.y) && - (this->actor.xyzDistToLinkSq < 2500.0f)) { + if ((player->actor.speedXZ > 0.0f) && (player->actor.world.pos.y < this->actor.world.pos.y) && + (this->actor.xyzDistToPlayerSq < 2500.0f)) { Math_ApproachF(&this->actor.speedXZ, player->actor.speedXZ, 1.0f, 0.2f); if (this->actor.speedXZ > 1.0f) { this->actor.speedXZ = 1.0f; } - if (Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 1, 0x1000, + if (Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 1, 0x1000, 0) > 0) { this->spinVel.y = this->actor.speedXZ * 1000.0f; } else { @@ -603,7 +603,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { } Actor_MoveForward(&this->actor); if (this->actor.speedXZ != 0.0f) { - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 5); if (this->actor.bgCheckFlags & 8) { this->actor.speedXZ *= -0.5f; if (this->spinVel.y > 0) { @@ -636,14 +636,14 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { } else { rippleScale = 200; } - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, rippleScale, rippleScale + 500, 0); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, rippleScale, rippleScale + 500, 0); } - } else if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xyzDistToLinkSq < SQ(100.0f))) { - f32 hammerStrength = (100.0f - sqrtf(this->actor.xyzDistToLinkSq)) * 0.05f; + } else if ((globalCtx->actorCtx.unk_02 != 0) && (this->actor.xyzDistToPlayerSq < SQ(100.0f))) { + f32 hammerStrength = (100.0f - sqrtf(this->actor.xyzDistToPlayerSq)) * 0.05f; this->actionState = ENKANBAN_AIR; this->actor.gravity = -1.0f; - this->actor.posRot.rot.y = Rand_CenteredFloat(0x10000); + this->actor.world.rot.y = Rand_CenteredFloat(0x10000); if (this->partCount >= 4) { this->bounceX = (s16)Rand_ZeroFloat(10.0f) + 6; this->bounceZ = (s16)Rand_ZeroFloat(10.0f) + 6; @@ -664,7 +664,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { this->airTimer = 70; } if (this->bounceX == 0) { - Actor* bomb = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + Actor* bomb = globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; f32 dx; f32 dy; f32 dz; @@ -674,15 +674,15 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { bomb = bomb->next; continue; } - dx = this->actor.posRot.pos.x - bomb->posRot.pos.x; - dy = this->actor.posRot.pos.y - bomb->posRot.pos.y; - dz = this->actor.posRot.pos.z - bomb->posRot.pos.z; + dx = this->actor.world.pos.x - bomb->world.pos.x; + dy = this->actor.world.pos.y - bomb->world.pos.y; + dz = this->actor.world.pos.z - bomb->world.pos.z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 100.0f) { f32 bombStrength = (100.0f - sqrtf(SQ(dx) + SQ(dy) + SQ(dz))) * 0.05f; this->actionState = ENKANBAN_AIR; this->actor.gravity = -1.0f; - this->actor.posRot.rot.y = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); + this->actor.world.rot.y = Math_FAtan2F(dx, dz) * (0x8000 / M_PI); if (this->partCount >= 4) { this->bounceX = (s16)Rand_ZeroFloat(10.0f) + 6; this->bounceZ = (s16)Rand_ZeroFloat(10.0f) + 6; @@ -739,12 +739,12 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Matrix_RotateY((signpost->actor.shape.rot.y / 32768.0f) * 3.1415927f, MTXMODE_NEW); Matrix_MultVec3f(&sPieceOffsets[this->pieceType], &offset); - distX = Math_SmoothStepToF(&this->actor.posRot.pos.x, signpost->actor.posRot.pos.x + offset.x, 1.0f, 3.0f, - 0.0f); - distY = Math_SmoothStepToF(&this->actor.posRot.pos.y, signpost->actor.posRot.pos.y + offset.y, 1.0f, 3.0f, - 0.0f); - distZ = Math_SmoothStepToF(&this->actor.posRot.pos.z, signpost->actor.posRot.pos.z + offset.z, 1.0f, 3.0f, - 0.0f); + distX = + Math_SmoothStepToF(&this->actor.world.pos.x, signpost->actor.world.pos.x + offset.x, 1.0f, 3.0f, 0.0f); + distY = + Math_SmoothStepToF(&this->actor.world.pos.y, signpost->actor.world.pos.y + offset.y, 1.0f, 3.0f, 0.0f); + distZ = + Math_SmoothStepToF(&this->actor.world.pos.z, signpost->actor.world.pos.z + offset.z, 1.0f, 3.0f, 0.0f); pDiff = Math_SmoothStepToS(&this->actor.shape.rot.x, signpost->actor.shape.rot.x, 1, 0x200, 0); yDiff = Math_SmoothStepToS(&this->actor.shape.rot.y, signpost->actor.shape.rot.y, 1, 0x200, 0); rDiff = Math_SmoothStepToS(&this->actor.shape.rot.z, signpost->actor.shape.rot.z, 1, 0x200, 0); @@ -752,7 +752,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_ApproachS(&this->spinRot.z, 0, 1, 0x200); Math_ApproachZeroF(&this->floorRot.x, 1.0f, 0.05f); Math_ApproachZeroF(&this->floorRot.z, 1.0f, 0.05f); - Math_ApproachZeroF(&this->actor.shape.unk_08, 1.0f, 2.0f); + Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, 2.0f); if (((distX + distY + distZ) == 0.0f) && ((pDiff + yDiff + rDiff + this->spinRot.x + this->spinRot.z) == 0) && (this->floorRot.x == 0.0f) && (this->floorRot.z == 0.0f)) { @@ -815,11 +815,11 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, D_06000C30); if (this->actionState != ENKANBAN_SIGN) { - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_RotateX(this->floorRot.x, MTXMODE_APPLY); Matrix_RotateZ(this->floorRot.z, MTXMODE_APPLY); - Matrix_Translate(0.0f, this->actor.shape.unk_08, 0.0f, MTXMODE_APPLY); + Matrix_Translate(0.0f, this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY); Matrix_RotateY((this->actor.shape.rot.y / (f32)0x8000) * M_PI, MTXMODE_APPLY); Matrix_RotateX((this->actor.shape.rot.x / (f32)0x8000) * M_PI, MTXMODE_APPLY); zShift = fabsf(Math_SinS(this->spinRot.x) * this->pieceHeight); @@ -865,7 +865,7 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) { } } if ((this->actor.projectedPos.z <= 400.0f) && (this->actor.projectedPos.z > 0.0f) && - (this->actor.groundY > -3000.0f)) { + (this->actor.floorHeight > -3000.0f)) { if ((this->bounceX != 0) || (this->bounceZ != 0)) { u16 dayTime = gSaveContext.dayTime; f32 shadowAlpha; @@ -882,10 +882,10 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) { if ((this->actionState == ENKANBAN_SIGN) && (gSaveContext.linkAge == 1)) { zShift = 0.0f; } else { - zShift = ((this->actor.posRot.pos.y - this->actor.groundY) * -50.0f) / 100.0f; + zShift = ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f; } - Matrix_Translate(this->actor.posRot.pos.x, this->actor.groundY, this->actor.posRot.pos.z + zShift, + Matrix_Translate(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z + zShift, MTXMODE_NEW); Matrix_RotateX(this->floorRot.x, MTXMODE_APPLY); Matrix_RotateZ(this->floorRot.z, MTXMODE_APPLY); 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 82dcd30045..7bc1f9e501 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -31,7 +31,7 @@ void EnKarebaba_Upright(EnKarebaba* this, GlobalContext* globalCtx); const ActorInit En_Karebaba_InitVars = { ACTOR_EN_KAREBABA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_DEKUBABA, sizeof(EnKarebaba), @@ -84,8 +84,8 @@ static ColliderCylinderInit sHeadColliderInit = { static CollisionCheckInfoInit sColCheckInfoInit = { 1, 15, 80, MASS_HEAVY }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 2500, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 1, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), ICHAIN_S8(naviEnemyId, 9, ICHAIN_STOP), }; @@ -101,7 +101,7 @@ void EnKarebaba_Init(Actor* thisx, GlobalContext* globalCtx) { EnKarebaba* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 22.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002A40, &D_060002B8, this->jointTable, this->morphTable, 8); Collider_InitCylinder(globalCtx, &this->bodyCollider); Collider_SetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sBodyColliderInit); @@ -140,14 +140,14 @@ void EnKarebaba_SetupGrow(EnKarebaba* this) { Actor_SetScale(&this->actor, 0.0f); this->actor.shape.rot.x = -0x4000; this->actionFunc = EnKarebaba_Grow; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 14.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 14.0f; } void EnKarebaba_SetupIdle(EnKarebaba* this) { Actor_SetScale(&this->actor, 0.005f); this->actor.shape.rot.x = -0x4000; this->actionFunc = EnKarebaba_Idle; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 14.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 14.0f; } void EnKarebaba_SetupAwaken(EnKarebaba* this) { @@ -181,7 +181,7 @@ void EnKarebaba_SetupDying(EnKarebaba* this) { this->actor.params = 0; this->actor.gravity = -0.8f; this->actor.velocity.y = 4.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->actor.speedXZ = 3.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKU_JR_DEAD); this->actor.flags |= 0x30; @@ -191,11 +191,11 @@ void EnKarebaba_SetupDying(EnKarebaba* this) { void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.03f); this->actor.shape.rot.x -= 0x4000; - this->actor.shape.unk_08 = 1000.0f; + this->actor.shape.yOffset = 1000.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.shape.unk_10 = 3.0f; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_MISC); + this->actor.shape.shadowScale = 3.0f; + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_MISC); this->actor.params = 200; this->actor.flags &= ~0x20; this->actionFunc = EnKarebaba_DeadItemDrop; @@ -214,14 +214,14 @@ void EnKarebaba_SetupDead(EnKarebaba* this) { this->actor.shape.rot.x = -0x4000; this->actor.params = 200; this->actor.parent = NULL; - this->actor.shape.unk_10 = 0.0f; - Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->actor.shape.shadowScale = 0.0f; + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); this->actionFunc = EnKarebaba_Dead; } void EnKarebaba_SetupRegrow(EnKarebaba* this) { - this->actor.shape.unk_08 = 0.0f; - this->actor.shape.unk_10 = 22.0f; + this->actor.shape.yOffset = 0.0f; + this->actor.shape.shadowScale = 22.0f; this->headCollider.dim.radius = sHeadColliderInit.dim.radius; Actor_SetScale(&this->actor, 0.0f); this->actionFunc = EnKarebaba_Regrow; @@ -233,14 +233,14 @@ void EnKarebaba_Grow(EnKarebaba* this, GlobalContext* globalCtx) { this->actor.params++; scale = this->actor.params * 0.05f; Actor_SetScale(&this->actor, 0.005f * scale); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (14.0f * scale); + this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scale); if (this->actor.params == 20) { EnKarebaba_SetupIdle(this); } } void EnKarebaba_Idle(EnKarebaba* this, GlobalContext* globalCtx) { - if (this->actor.xzDistToLink < 200.0f && fabsf(this->actor.yDistToLink) < 30.0f) { + if (this->actor.xzDistToPlayer < 200.0f && fabsf(this->actor.yDistToPlayer) < 30.0f) { EnKarebaba_SetupAwaken(this); } } @@ -249,11 +249,11 @@ void EnKarebaba_Awaken(EnKarebaba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); Math_StepToF(&this->actor.scale.x, 0.01f, 0.0005f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 60.0f, 5.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 60.0f, 5.0f)) { EnKarebaba_SetupUpright(this); } this->actor.shape.rot.y += 0x1999; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.initPosRot.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); } void EnKarebaba_Upright(EnKarebaba* this, GlobalContext* globalCtx) { @@ -272,7 +272,7 @@ void EnKarebaba_Upright(EnKarebaba* this, GlobalContext* globalCtx) { if (this->bodyCollider.base.acFlags & AC_HIT) { EnKarebaba_SetupDying(this); func_80032C7C(globalCtx, &this->actor); - } else if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) > 240.0f) { + } else if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 240.0f) { EnKarebaba_SetupRetract(this); } else if (this->actor.params == 0) { EnKarebaba_SetupSpin(this); @@ -305,12 +305,12 @@ void EnKarebaba_Spin(EnKarebaba* this, GlobalContext* globalCtx) { this->headCollider.dim.radius = sHeadColliderInit.dim.radius + (value * 2); this->actor.shape.rot.x = 0xC000 - (value * 0x100); this->actor.shape.rot.y += value * 0x2C0; - this->actor.posRot.pos.y = (Math_SinS(this->actor.shape.rot.x) * -60.0f) + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = (Math_SinS(this->actor.shape.rot.x) * -60.0f) + this->actor.home.pos.y; cos60 = Math_CosS(this->actor.shape.rot.x) * 60.0f; - this->actor.posRot.pos.x = (Math_SinS(this->actor.shape.rot.y) * cos60) + this->actor.initPosRot.pos.x; - this->actor.posRot.pos.z = (Math_CosS(this->actor.shape.rot.y) * cos60) + this->actor.initPosRot.pos.z; + this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * cos60) + this->actor.home.pos.x; + this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * cos60) + this->actor.home.pos.z; if (this->bodyCollider.base.acFlags & AC_HIT) { EnKarebaba_SetupDying(this); @@ -330,13 +330,13 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) { if (this->actor.params == 0) { Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C); - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); if (this->actor.scale.x > 0.005f && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) { this->actor.scale.x = this->actor.scale.y = this->actor.scale.z = 0.0f; this->actor.speedXZ = 0.0f; this->actor.flags &= ~5; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10, + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); } @@ -345,7 +345,7 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) { this->actor.params = 1; } } else if (this->actor.params == 1) { - Math_Vec3f_Copy(&position, &this->actor.posRot.pos); + Math_Vec3f_Copy(&position, &this->actor.world.pos); rotation.z = Math_SinS(this->actor.shape.rot.x) * 20.0f; rotation.x = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_SinS(this->actor.shape.rot.y); rotation.y = -20.0f * Math_CosS(this->actor.shape.rot.x) * Math_CosS(this->actor.shape.rot.y); @@ -357,7 +357,7 @@ void EnKarebaba_Dying(EnKarebaba* this, GlobalContext* globalCtx) { position.z += rotation.y; } - func_800286CC(globalCtx, &this->actor.initPosRot.pos, &zeroVec, &zeroVec, 500, 100); + func_800286CC(globalCtx, &this->actor.home.pos, &zeroVec, &zeroVec, 500, 100); EnKarebaba_SetupDeadItemDrop(this, globalCtx); } } @@ -379,12 +379,12 @@ void EnKarebaba_Retract(EnKarebaba* this, GlobalContext* globalCtx) { Math_StepToF(&this->actor.scale.x, 0.005f, 0.0005f); this->actor.scale.y = this->actor.scale.z = this->actor.scale.x; - if (Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 14.0f, 5.0f)) { + if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 14.0f, 5.0f)) { EnKarebaba_SetupIdle(this); } this->actor.shape.rot.y += 0x1999; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.initPosRot.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, HAHEN_OBJECT_DEFAULT, 10, NULL); } void EnKarebaba_Dead(EnKarebaba* this, GlobalContext* globalCtx) { @@ -404,12 +404,12 @@ void EnKarebaba_Regrow(EnKarebaba* this, GlobalContext* globalCtx) { this->actor.params++; scaleFactor = this->actor.params * 0.05f; Actor_SetScale(&this->actor, 0.005f * scaleFactor); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (14.0f * scaleFactor); + this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * scaleFactor); if (this->actor.params == 20) { this->actor.flags &= ~0x10; this->actor.flags |= 5; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); EnKarebaba_SetupIdle(this); } } @@ -424,9 +424,9 @@ void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != EnKarebaba_Dead) { if (this->actionFunc == EnKarebaba_Dying) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 10.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 10.0f, 5); } else { - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (this->boundFloor == NULL) { this->boundFloor = this->actor.floorPoly; } @@ -437,11 +437,11 @@ void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->headCollider.base); - Actor_SetHeight(&this->actor, (this->actor.scale.x * 10.0f) / 0.01f); - height = this->actor.initPosRot.pos.y + 40.0f; - this->actor.posRot2.pos.x = this->actor.initPosRot.pos.x; - this->actor.posRot2.pos.y = CLAMP_MAX(this->actor.posRot2.pos.y, height); - this->actor.posRot2.pos.z = this->actor.initPosRot.pos.z; + Actor_SetFocus(&this->actor, (this->actor.scale.x * 10.0f) / 0.01f); + height = this->actor.home.pos.y + 40.0f; + this->actor.focus.pos.x = this->actor.home.pos.x; + this->actor.focus.pos.y = CLAMP_MAX(this->actor.focus.pos.y, height); + this->actor.focus.pos.z = this->actor.home.pos.z; } } } @@ -454,8 +454,7 @@ void EnKarebaba_DrawCenterShadow(EnKarebaba* this, GlobalContext* globalCtx) { func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); - func_80038A28(this->boundFloor, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, &mf); + func_80038A28(this->boundFloor, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &mf); Matrix_Mult(&mf, MTXMODE_NEW); Matrix_Scale(0.15f, 1.0f, 0.15f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1029), @@ -488,7 +487,7 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) { } else if (this->actionFunc != EnKarebaba_Dead) { func_80026230(globalCtx, &black, 1, 2); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); if ((this->actionFunc == EnKarebaba_Regrow) || (this->actionFunc == EnKarebaba_Grow)) { scale = this->actor.params * 0.0005f; @@ -512,7 +511,7 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPDisplayList(POLY_OPA_DISP++, dLists[i]); if (i == 0 && this->actionFunc == EnKarebaba_Dying) { - Matrix_MultVec3f(&zeroVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&zeroVec, &this->actor.focus.pos); } } @@ -520,21 +519,20 @@ void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) { } func_80026230(globalCtx, &black, 1, 2); - Matrix_Translate(this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - MTXMODE_NEW); + Matrix_Translate(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW); if (this->actionFunc != EnKarebaba_Grow) { scale = 0.01f; } Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); - Matrix_RotateY(this->actor.initPosRot.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); + Matrix_RotateY(this->actor.home.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1144), G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_060010F0); if (this->actionFunc == EnKarebaba_Dying) { - Matrix_RotateRPY(-0x4000, (s16)(this->actor.shape.rot.y - this->actor.initPosRot.rot.y), 0, MTXMODE_APPLY); + Matrix_RotateRPY(-0x4000, (s16)(this->actor.shape.rot.y - this->actor.home.rot.y), 0, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_karebaba.c", 1155), G_MTX_LOAD | G_MTX_NOPUSH | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_06001828); 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 87a0bfc9a9..16844d4cdf 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06008F6C; /* const ActorInit En_Ko_InitVars = { ACTOR_EN_KO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnKo), 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 1e6780a540..74fb152098 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -41,7 +41,7 @@ s16 D_80A9C1DC = 0; const ActorInit En_Kusa_InitVars = { ACTOR_EN_KUSA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnKusa), @@ -106,15 +106,15 @@ s32 EnKusa_SnapToFloor(EnKusa* this, GlobalContext* globalCtx, f32 yOffset) { s32 bgId; f32 floorY; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 30.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 30.0f; + pos.z = this->actor.world.pos.z; floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &poly, &bgId, &this->actor, &pos); if (floorY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = floorY + yOffset; - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + this->actor.world.pos.y = floorY + yOffset; + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); return true; } else { osSyncPrintf(VT_COL(YELLOW, BLACK)); @@ -136,13 +136,13 @@ void EnKusa_DropCollectible(EnKusa* this, GlobalContext* globalCtx) { if (dropParams >= 0xD) { dropParams = 0; } - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, dropParams << 4); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, dropParams << 4); break; case 1: if (Rand_ZeroOne() < 0.5f) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, ITEM00_SEEDS); + Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_SEEDS); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, ITEM00_HEART); + Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_HEART); } break; } @@ -180,9 +180,9 @@ void EnKusa_SpawnFragments(EnKusa* this, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(D_80A9C23C); i++) { scale = &D_80A9C23C[i]; - pos.x = this->actor.posRot.pos.x + (scale->x * this->actor.scale.x * 20.0f); - pos.y = this->actor.posRot.pos.y + (scale->y * this->actor.scale.y * 20.0f) + 10.0f; - pos.z = this->actor.posRot.pos.z + (scale->z * this->actor.scale.z * 20.0f); + pos.x = this->actor.world.pos.x + (scale->x * this->actor.scale.x * 20.0f); + pos.y = this->actor.world.pos.y + (scale->y * this->actor.scale.y * 20.0f) + 10.0f; + pos.z = this->actor.world.pos.z + (scale->z * this->actor.scale.z * 20.0f); velocity.x = (Rand_ZeroOne() - 0.5f) * 8.0f; velocity.y = Rand_ZeroOne() * 10.0f; @@ -193,9 +193,9 @@ void EnKusa_SpawnFragments(EnKusa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -100, 64, 40, 3, 0, D_80A9C26C[index], 0, 0, 80, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_KEEP, D_040355E0); - pos.x = this->actor.posRot.pos.x + (scale->x * this->actor.scale.x * 40.0f); - pos.y = this->actor.posRot.pos.y + (scale->y * this->actor.scale.y * 40.0f) + 10.0f; - pos.z = this->actor.posRot.pos.z + (scale->z * this->actor.scale.z * 40.0f); + pos.x = this->actor.world.pos.x + (scale->x * this->actor.scale.x * 40.0f); + pos.y = this->actor.world.pos.y + (scale->y * this->actor.scale.y * 40.0f) + 10.0f; + pos.z = this->actor.world.pos.z + (scale->z * this->actor.scale.z * 40.0f); velocity.x = (Rand_ZeroOne() - 0.5f) * 6.0f; velocity.y = Rand_ZeroOne() * 10.0f; @@ -212,8 +212,8 @@ void EnKusa_SpawnBugs(EnKusa* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); + Actor* bug = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INSECT, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, Rand_ZeroOne() * 0xFFFF, 0, 1); if (bug == NULL) { break; @@ -244,8 +244,8 @@ void EnKusa_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.shape.rot.y == 0) { s16 rand = Rand_ZeroFloat(0x10000); - this->actor.posRot.rot.y = rand; - this->actor.initPosRot.rot.y = rand; + this->actor.world.rot.y = rand; + this->actor.home.rot.y = rand; this->actor.shape.rot.y = rand; } @@ -301,12 +301,12 @@ void func_80A9B8D8(EnKusa* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnKusa_SetupLiftedUp(this); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_PL_PULL_UP_PLANT); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_PL_PULL_UP_PLANT); } else if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_PLANT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); if ((this->actor.params >> 4) & 1) { EnKusa_SpawnBugs(this, globalCtx); @@ -320,17 +320,17 @@ void func_80A9B8D8(EnKusa* this, GlobalContext* globalCtx) { func_80A9BEAC(this); this->actor.flags |= 0x800; } else { - if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToLink > 12.0f)) { + if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 12.0f)) { this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; } - if (this->actor.xzDistToLink < 600.0f) { + if (this->actor.xzDistToPlayer < 600.0f) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 400.0f) { + if (this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { func_8002F580(&this->actor, globalCtx); } } @@ -348,14 +348,14 @@ void EnKusa_LiftedUp(EnKusa* this, GlobalContext* globalCtx) { if (Actor_HasNoParent(&this->actor, globalCtx)) { this->actor.room = globalCtx->roomCtx.curRoom.num; func_80A9BBB0(this); - this->actor.velocity.x = this->actor.speedXZ * Math_SinS(this->actor.posRot.rot.y); - this->actor.velocity.z = this->actor.speedXZ * Math_CosS(this->actor.posRot.rot.y); + this->actor.velocity.x = this->actor.speedXZ * Math_SinS(this->actor.world.rot.y); + this->actor.velocity.z = this->actor.speedXZ * Math_CosS(this->actor.world.rot.y); this->actor.colChkInfo.mass = 240; this->actor.gravity = -0.1f; EnKusa_Fall(this); func_80A9B174(&this->actor.velocity, 0.005f); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); this->actor.gravity = -3.2f; } } @@ -374,7 +374,7 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 11) { if (!(this->actor.bgCheckFlags & 32)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_PLANT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); } EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); @@ -390,9 +390,9 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { } } else { if (this->actor.bgCheckFlags & 0x40) { - contactPos.x = this->actor.posRot.pos.x; - contactPos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - contactPos.z = this->actor.posRot.pos.z; + contactPos.x = this->actor.world.pos.x; + contactPos.y = this->actor.world.pos.y + this->actor.yDistToWater; + contactPos.z = this->actor.world.pos.z; EffectSsGSplash_Spawn(globalCtx, &contactPos, NULL, NULL, 0, 400); EffectSsGRipple_Spawn(globalCtx, &contactPos, 150, 650, 0); EffectSsGRipple_Spawn(globalCtx, &contactPos, 400, 800, 4); @@ -403,7 +403,7 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { D_80A9C1DC >>= 1; D_80A9C1D8 >>= 1; this->actor.bgCheckFlags &= ~0x40; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); } EnKusa_Fall(this); Math_StepToS(&D_80A9C1D4, D_80A9C1D0, 0x1F4); @@ -412,7 +412,7 @@ void func_80A9BC1C(EnKusa* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += D_80A9C1DC; func_80A9B174(&this->actor.velocity, 0.05f); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -439,17 +439,17 @@ void func_80A9BF30(EnKusa* this, GlobalContext* globalCtx) { } void func_80A9BF3C(EnKusa* this) { - this->actor.posRot.pos.x = this->actor.initPosRot.pos.x; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y - 9.0f; - this->actor.posRot.pos.z = this->actor.initPosRot.pos.z; + this->actor.world.pos.x = this->actor.home.pos.x; + this->actor.world.pos.y = this->actor.home.pos.y - 9.0f; + this->actor.world.pos.z = this->actor.home.pos.z; EnKusa_SetScale(this); - this->actor.shape.rot = this->actor.initPosRot.rot; + this->actor.shape.rot = this->actor.home.rot; EnKusa_SetupAction(this, func_80A9BFA8); } void func_80A9BFA8(EnKusa* this, GlobalContext* globalCtx) { if (this->timer > 120) { - if ((Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.6f)) && (this->timer >= 170)) { + if ((Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.6f)) && (this->timer >= 170)) { func_80A9C00C(this); } } @@ -458,7 +458,7 @@ void func_80A9BFA8(EnKusa* this, GlobalContext* globalCtx) { void func_80A9C00C(EnKusa* this) { EnKusa_SetupAction(this, func_80A9C068); EnKusa_SetScale(this); - this->actor.shape.rot = this->actor.initPosRot.rot; + this->actor.shape.rot = this->actor.home.rot; this->actor.flags &= ~0x800; } @@ -484,9 +484,9 @@ void EnKusa_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (this->actor.flags & 0x800) { - this->actor.shape.unk_08 = -6.25f; + this->actor.shape.yOffset = -6.25f; } else { - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } 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 9305ae1886..0d0ffa29bd 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -25,7 +25,7 @@ void EnKz_StartTimer(EnKz* this, GlobalContext* globalCtx); const ActorInit En_Kz_InitVars = { ACTOR_EN_KZ, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_KZ, sizeof(EnKz), @@ -188,7 +188,7 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal Player* player = PLAYER; s16 sp32; s16 sp30; - f32 xzDistToLink; + f32 xzDistToPlayer; f32 yaw; if (func_8002F194(&this->actor, globalCtx) != 0) { @@ -201,9 +201,9 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal return 0; } - yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &player->actor.posRot.pos); + yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos); yaw -= this->actor.shape.rot.y; - if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistToLink < 265.0f)) { + if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistToPlayer < 265.0f)) { this->actor.flags &= ~1; return 0; } @@ -215,13 +215,13 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal return 0; } - xzDistToLink = this->actor.xzDistToLink; - this->actor.xzDistToLink = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos); + xzDistToPlayer = this->actor.xzDistToPlayer; + this->actor.xzDistToPlayer = Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos); if (func_8002F2CC(&this->actor, globalCtx, unkf) == 0) { - this->actor.xzDistToLink = xzDistToLink; + this->actor.xzDistToPlayer = xzDistToPlayer; return 0; } - this->actor.xzDistToLink = xzDistToLink; + this->actor.xzDistToPlayer = xzDistToPlayer; this->actor.textId = callback1(globalCtx, this); return 0; @@ -278,9 +278,9 @@ s32 EnKz_FollowPath(EnKz* this, GlobalContext* globalCtx) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.posRot.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * 10430.3779296875f), 0xA, 0x3E8, + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.world.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * 10430.3779296875f), 0xA, 0x3E8, 1); if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f) { @@ -305,9 +305,9 @@ s32 EnKz_SetMovedPos(EnKz* this, GlobalContext* globalCtx) { lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; - this->actor.posRot.pos.x = lastPointPos->x; - this->actor.posRot.pos.y = lastPointPos->y; - this->actor.posRot.pos.z = lastPointPos->z; + this->actor.world.pos.x = lastPointPos->x; + this->actor.world.pos.y = lastPointPos->y; + this->actor.world.pos.z = lastPointPos->z; return 1; } @@ -322,7 +322,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Actor_SetScale(&this->actor, 0.01); - this->actor.unk_1F = 3; + this->actor.targetMode = 3; this->unk_1E0.unk_00 = 0; func_80034EC0(&this->skelanime, sAnimations, 0); @@ -333,7 +333,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) { if (LINK_IS_ADULT) { if (!(gSaveContext.infTable[19] & 0x100)) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BG_ICE_SHELTER, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x04FF); } this->actionFunc = EnKz_Wait; @@ -367,8 +367,8 @@ void EnKz_SetupMweep(EnKz* this, GlobalContext* globalCtx) { this->gameplayCamera = globalCtx->activeCamera; Gameplay_ChangeCameraStatus(globalCtx, this->gameplayCamera, 1); Gameplay_ChangeCameraStatus(globalCtx, this->cutsceneCamera, 7); - pos = this->actor.posRot.pos; - initPos = this->actor.initPosRot.pos; + pos = this->actor.world.pos; + initPos = this->actor.home.pos; pos.y += 60.0f; initPos.y += -100.0f; initPos.z += 260.0f; @@ -383,8 +383,8 @@ void EnKz_Mweep(EnKz* this, GlobalContext* globalCtx) { Vec3f pos; Vec3f initPos; - pos = this->actor.posRot.pos; - initPos = this->actor.initPosRot.pos; + pos = this->actor.world.pos; + initPos = this->actor.home.pos; pos.y += 60.0f; initPos.y += -100.0f; initPos.z += 260.0f; @@ -429,8 +429,8 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) { this->actionFunc = EnKz_StartTimer; } else { getItemID = this->isTrading == true ? GI_FROG : GI_TUNIC_ZORA; - yRange = fabsf(this->actor.yDistToLink) + 1.0f; - xzRange = this->actor.xzDistToLink + 1.0f; + yRange = fabsf(this->actor.yDistToPlayer) + 1.0f; + xzRange = this->actor.xzDistToPlayer + 1.0f; func_8002F434(&this->actor, globalCtx, getItemID, xzRange, yRange); } } @@ -480,7 +480,7 @@ void EnKz_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f mult = { 2600.0f, 0.0f, 0.0f }; if (limbIndex == 11) { - Matrix_MultVec3f(&mult, &this->actor.posRot2.pos); + Matrix_MultVec3f(&mult, &this->actor.focus.pos); } } 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 59f13d4404..8ff45bc796 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -18,7 +18,7 @@ void EnLight_UpdateSwitch(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Light_InitVars = { ACTOR_EN_LIGHT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnLight), @@ -55,12 +55,12 @@ void EnLight_Init(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.gameMode == 3) { // special case for the credits yOffset = (this->actor.params < 0) ? 1 : 40; - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, yOffset + (s16)this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 180, -1); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, yOffset + (s16)this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 180, -1); } else { yOffset = (this->actor.params < 0) ? 1 : 40; - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, yOffset + (s16)this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 255, 255, 180, -1); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, yOffset + (s16)this->actor.world.pos.y, + this->actor.world.pos.z, 255, 255, 180, -1); } this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); @@ -83,8 +83,8 @@ void EnLight_UpdatePosRot(EnLight* this, GlobalContext* globalCtx) { this->actor.shape.rot.y = Camera_GetCamDirYaw(ACTIVE_CAM) + 0x8000; if (this->actor.parent != NULL) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &(this->actor.parent)->posRot.pos); - this->actor.posRot.pos.y += 17.0f; + Math_Vec3f_Copy(&this->actor.world.pos, &(this->actor.parent)->world.pos); + this->actor.world.pos.y += 17.0f; } this->timer++; 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 f37e61c661..a8d8c10d42 100644 --- a/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c +++ b/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.c @@ -17,7 +17,7 @@ void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Lightbox_InitVars = { ACTOR_EN_LIGHTBOX, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_LIGHTBOX, sizeof(EnLightbox), @@ -51,13 +51,13 @@ void EnLightbox_Init(Actor* thisx, GlobalContext* globalCtx) { break; } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->colChkInfo.unk_10 = 0x1E; - thisx->colChkInfo.unk_12 = 0x32; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); + thisx->focus.pos = thisx->world.pos; + thisx->colChkInfo.cylRadius = 30; + thisx->colChkInfo.cylHeight = 50; + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f); this->dyna.unk_160 = 0; this->dyna.unk_15C = 0; - thisx->unk_1F = 0; + thisx->targetMode = 0; thisx->gravity = -2.0f; CollisionHeader_GetVirtual(&D_06001F10, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); @@ -82,7 +82,7 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) { } else { if (thisx->speedXZ) { if (thisx->bgCheckFlags & 8) { - thisx->posRot.rot.y = (thisx->posRot.rot.y + thisx->wallPolyRot) - thisx->posRot.rot.y; + thisx->world.rot.y = (thisx->world.rot.y + thisx->wallYaw) - thisx->world.rot.y; Audio_PlaySoundGeneral(NA_SE_EV_BOMB_BOUND, &thisx->projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); thisx->speedXZ *= 0.7f; @@ -106,8 +106,9 @@ void EnLightbox_Update(Actor* thisx, GlobalContext* globalCtx) { } } Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, thisx->colChkInfo.unk_12, thisx->colChkInfo.unk_10, thisx->colChkInfo.unk_10, 0x1D); - thisx->posRot2.pos = thisx->posRot.pos; + Actor_UpdateBgCheckInfo(globalCtx, thisx, thisx->colChkInfo.cylHeight, thisx->colChkInfo.cylRadius, + thisx->colChkInfo.cylRadius, 0x1D); + thisx->focus.pos = thisx->world.pos; } void EnLightbox_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 257f7bb107..5b419fddef 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 @@ -16,7 +16,7 @@ void EnMFire1_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_M_Fire1_InitVars = { ACTOR_EN_M_FIRE1, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnMFire1), @@ -49,7 +49,7 @@ void EnMFire1_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (this->actor.params < 0) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ITEMACTION); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ITEMACTION); } Collider_InitCylinder(globalCtx, &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 d0591ec984..a076561d9d 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 @@ -18,7 +18,7 @@ extern UNK_TYPE D_04013610; /* const ActorInit En_M_Thunder_InitVars = { ACTOR_EN_M_THUNDER, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnMThunder), 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 c24477b694..d3429e0567 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -29,7 +29,7 @@ void func_80AA11C8(EnMa1* this, GlobalContext* globalCtx); const ActorInit En_Ma1_InitVars = { ACTOR_EN_MA1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MA1, sizeof(EnMa1), @@ -234,7 +234,7 @@ void func_80AA0AF4(EnMa1* this, GlobalContext* globalCtx) { phi_a3 = 0; } - this->unk_1E8.unk_18 = player->actor.posRot.pos; + this->unk_1E8.unk_18 = player->actor.world.pos; this->unk_1E8.unk_18.y -= -10.0f; func_80034A14(&this->actor, &this->unk_1E8, 0, phi_a3); @@ -260,7 +260,7 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) { EnMa1* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008460, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -271,9 +271,9 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->unk_1E8.unk_00 = 0; if ((!(gSaveContext.eventChkInf[1] & 0x10)) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA))) { @@ -354,7 +354,7 @@ void func_80AA0F44(EnMa1* this, GlobalContext* globalCtx) { this->unk_1E8.unk_00 = 1; this->actor.flags |= 0x10000; this->actionFunc = func_80AA106C; - } else if (this->actor.xzDistToLink < 30.0f + (f32)this->collider.dim.radius) { + } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { player->stateFlags2 |= 0x800000; } } @@ -436,7 +436,7 @@ void EnMa1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Vec3f vec = D_80AA16B8; if (limbIndex == 15) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } @@ -449,7 +449,7 @@ void EnMa1_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma1.c", 1226); camera = ACTIVE_CAM; - someFloat = Math_Vec3f_DistXZ(&this->actor.posRot.pos, &camera->eye); + someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye); func_800F6268(someFloat, 0x2F); func_80093D18(globalCtx->state.gfxCtx); 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 669dd57e00..ff55495958 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -23,7 +23,7 @@ void func_80AA21C8(EnMa2* this, GlobalContext* globalCtx); const ActorInit En_Ma2_InitVars = { ACTOR_EN_MA2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MA2, sizeof(EnMa2), @@ -141,7 +141,7 @@ void func_80AA1AE4(EnMa2* this, GlobalContext* globalCtx) { phi_a3 = 0; } - this->unk_1E0.unk_18 = player->actor.posRot.pos; + this->unk_1E0.unk_18 = player->actor.world.pos; this->unk_1E0.unk_14 = 0.0f; func_80034A14(&this->actor, &this->unk_1E0, 0, phi_a3); @@ -223,7 +223,7 @@ void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) { EnMa2* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -251,9 +251,9 @@ void EnMa2_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->unk_1E0.unk_00 = 0; } @@ -279,7 +279,7 @@ void func_80AA204C(EnMa2* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x2000000; func_8010BD58(globalCtx, 0x23); this->actionFunc = func_80AA20E4; - } else if (this->actor.xzDistToLink < 30.0f + (f32)this->collider.dim.radius) { + } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { player->stateFlags2 |= 0x800000; } } @@ -367,7 +367,7 @@ void EnMa2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma2.c", 904); if (limbIndex == 18) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } if ((limbIndex == 14) && (this->skelAnime.animation == &D_060093BC)) { gSPDisplayList(POLY_OPA_DISP++, D_06005420); @@ -385,7 +385,7 @@ void EnMa2_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma2.c", 955); camera = ACTIVE_CAM; - someFloat = Math_Vec3f_DistXZ(&this->actor.posRot.pos, &camera->eye); + someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye); func_800F6268(someFloat, 0x2F); func_80093D18(globalCtx->state.gfxCtx); 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 3f97c761d7..e14d4c5b9e 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -27,7 +27,7 @@ void func_80AA3200(EnMa3* this, GlobalContext* globalCtx); const ActorInit En_Ma3_InitVars = { ACTOR_EN_MA3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MA2, sizeof(EnMa3), @@ -200,7 +200,7 @@ void func_80AA2E54(EnMa3* this, GlobalContext* globalCtx) { phi_a3 = 0; } - this->unk_1E0.unk_18 = player->actor.posRot.pos; + this->unk_1E0.unk_18 = player->actor.world.pos; this->unk_1E0.unk_14 = 0.0f; func_80034A14(&this->actor, &this->unk_1E0, 0, phi_a3); } @@ -254,7 +254,7 @@ void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) { EnMa3* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008D90, NULL, NULL, NULL, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -274,7 +274,7 @@ void EnMa3_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Actor_SetScale(&this->actor, 0.01f); this->unk_1E0.unk_00 = (u16)0; } @@ -349,7 +349,7 @@ void EnMa3_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma3.c", 927); if (limbIndex == 18) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } if ((limbIndex == 14) && (this->skelAnime.animation == &D_060093BC)) { gSPDisplayList(POLY_OPA_DISP++, &D_06005420); @@ -367,7 +367,7 @@ void EnMa3_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ma3.c", 978); camera = globalCtx->cameraPtrs[globalCtx->activeCamera]; - someFloat = Math_Vec3f_DistXZ(&this->actor.posRot.pos, &camera->eye); + someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &camera->eye); func_800F6268(someFloat, 0x2F); func_80093D18(globalCtx->state.gfxCtx); 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 2710a351cc..217ea77d60 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -24,7 +24,7 @@ extern u8 D_06024E40[]; // "Ocarina of Time" const ActorInit En_Mag_InitVars = { ACTOR_EN_MAG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_MAG, sizeof(EnMag), 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 874c1ed4e8..c8269bec3b 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -11,7 +11,7 @@ void EnMb_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Mb_InitVars = { ACTOR_EN_MB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_MB, sizeof(EnMb), @@ -220,7 +220,7 @@ static DamageTable sBigMoblinDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 74, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 64536, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 5300, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), }; void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -230,7 +230,7 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { s16 yawDiff; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 46.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 46.0f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.colChkInfo.damageTable = &sDamageTable; Collider_InitCylinder(globalCtx, &this->collider1); @@ -264,14 +264,14 @@ void EnMb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.uncullZoneDownward = 1800.0f; this->unk_364 = 710.0f; this->collider2.info.toucher.dmgFlags = 0x20000000; - yawDiff = (this->actor.posRot.rot.y - Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->actor.posRot.pos)); + yawDiff = (this->actor.world.rot.y - Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos)); if (ABS(yawDiff) > 0x4000) { - this->actor.posRot.rot.y = thisx->posRot.rot.y + 0x8000; - this->actor.shape.rot.y = thisx->posRot.rot.y; - this->actor.posRot.pos.z = thisx->posRot.pos.z + 600.0f; + this->actor.world.rot.y = thisx->world.rot.y + 0x8000; + this->actor.shape.rot.y = thisx->world.rot.y; + this->actor.world.pos.z = thisx->world.pos.z + 600.0f; } - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Teardrop, 90.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, 90.0f); this->actor.flags &= ~1; this->actor.naviEnemyId++; func_80AA6898(this); @@ -302,10 +302,10 @@ void EnMb_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80AA6408(EnMb* this, GlobalContext* globalCtx) { - s16 yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); + s16 yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); this->actor.shape.rot.y = yaw; - this->actor.posRot.rot.y = yaw; + this->actor.world.rot.y = yaw; } void func_80AA6444(EnMb* this, GlobalContext* globalCtx) { @@ -339,12 +339,12 @@ s32 func_80AA652C(EnMb* this, GlobalContext* globalCtx) { player = PLAYER; phi_a2 = 0; - if ((this->actor.posRot.rot.y < -0x62A2) || (this->actor.posRot.rot.y >= 0x62A3)) { + if ((this->actor.world.rot.y < -0x62A2) || (this->actor.world.rot.y >= 0x62A3)) { phi_a2 = -0x8000; - } else if (this->actor.posRot.rot.y < -0x20E0) { + } else if (this->actor.world.rot.y < -0x20E0) { phi_a2 = -0x4000; } else { - if (this->actor.posRot.rot.y >= 0x20E1) { + if (this->actor.world.rot.y >= 0x20E1) { phi_a2 = 0x4000; } } @@ -352,8 +352,8 @@ s32 func_80AA652C(EnMb* this, GlobalContext* globalCtx) { sinAngle = Math_SinS(phi_a2); cosAngle = ABS(cosAngle); sinAngle = ABS(sinAngle); - xDist = this->actor.posRot.pos.x - player->actor.posRot.pos.x; - zDist = this->actor.posRot.pos.z - player->actor.posRot.pos.z; + xDist = this->actor.world.pos.x - player->actor.world.pos.x; + zDist = this->actor.world.pos.z - player->actor.world.pos.z; xDistABS = ABS(xDist); if (xDistABS < cosAngle * 37.0f + sinAngle * 400.0f) { if (0 <= zDist) { @@ -384,11 +384,11 @@ void func_80AA66A0(EnMb* this, GlobalContext* globalCtx) { points.x = pointPath->x; points.y = pointPath->y; points.z = pointPath->z; - yawToPoints = Math_Vec3f_Yaw(&this->actor.posRot.pos, &points); - yawDiff = yawToPoints - this->actor.yawTowardsLink; + yawToPoints = Math_Vec3f_Yaw(&this->actor.world.pos, &points); + yawDiff = yawToPoints - this->actor.yawTowardsPlayer; yawDiffABS = (yawDiff >= 0) ? yawDiff : -yawDiff; if (yawDiffABS <= 0x1770) { - this->actor.posRot.rot.y = yawToPoints; + this->actor.world.rot.y = yawToPoints; if (pathIndex == this->waypoint) { this->direction = -this->direction; } @@ -481,7 +481,7 @@ void func_80AA6BF0(EnMb* this) { this->unk_320 = 10; Animation_Change(&this->skelAnime, &D_0600B4BC, 3.0f, 0.0f, frames, ANIMMODE_ONCE_INTERP, 0.0f); this->unk_32E = 1; - yawDiff = (this->actor.posRot.rot.y - this->actor.yawTowardsLink); + yawDiff = (this->actor.world.rot.y - this->actor.yawTowardsPlayer); if (yawDiff >= 0) { yawDiffABS = yawDiff; @@ -584,10 +584,10 @@ void func_80AA702C(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attackParams = 0; } - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { if (this->actor.params == 0) { if (this->actor.colChkInfo.health == 0) { func_80AA6F04(this); @@ -629,21 +629,21 @@ void func_80AA71AC(EnMb* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->unk_32A == 0) { - this->unk_330 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); + this->unk_330 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_330, 1, 0x3E8, 0) == 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; func_80AA6A18(this); } } else { this->unk_32A--; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y, 1, 0x3E8, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0x3E8, 0); } - yDist = this->actor.yDistToLink; + yDist = this->actor.yDistToPlayer; yDistAbs = ABS(yDist); if ((yDistAbs <= 20.0f) && func_80AA652C(this, globalCtx)) { - yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsLink; + yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsPlayer; yawDiffAbs = ABS(yawDiff); - if ((yawDiffAbs <= 0x4000) || (func_8002DDE4(globalCtx) != 0) && (this->actor.xzDistToLink < 160.0f)) { + if ((yawDiffAbs <= 0x4000) || (func_8002DDE4(globalCtx) != 0) && (this->actor.xzDistToPlayer < 160.0f)) { func_80AA66A0(this, globalCtx); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_VOICE); func_80AA6AC8(this); @@ -656,7 +656,7 @@ void func_80AA7310(EnMb* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.5f, 1.0f, 0.0f); if (this->actor.speedXZ > 1.0f) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); } if (SkelAnime_Update(&this->skelAnime) != 0) { if (this->unk_32A == 0) { @@ -695,20 +695,20 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } if (this->actor.bgCheckFlags & 1) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 1.5f, 0.0f); if (1.0f < this->actor.speedXZ) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); } if (this->unk_32A != 0) { this->unk_32E--; if (this->unk_32E == 0) { - yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsLink; + yawDiff = this->actor.shape.rot.y - this->actor.yawTowardsPlayer; - if ((ABS(this->actor.yDistToLink) <= 20.0f) && (func_80AA652C(this, globalCtx) != 0) && - (ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToLink <= 200.0f)) { + if ((ABS(this->actor.yDistToPlayer) <= 20.0f) && (func_80AA652C(this, globalCtx) != 0) && + (ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToPlayer <= 200.0f)) { func_80AA6AC8(this); } else { endFrame = Animation_GetLastFrame(&D_06002C10); @@ -717,7 +717,7 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_SPEAR_NORM); } - } else if (this->actor.xzDistToLink <= 160.0f) { + } else if (this->actor.xzDistToPlayer <= 160.0f) { this->actor.speedXZ = -5.0f; } else { this->actor.speedXZ = 0.0f; @@ -729,7 +729,7 @@ void func_80AA74BC(EnMb* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_06002F10, 0.5f, 0.0f, endFrame, ANIMMODE_LOOP_INTERP, 0.0f); this->unk_32A = 1; } else { - yawDiff = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos) - this->actor.yawTowardsLink; + yawDiff = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos) - this->actor.yawTowardsPlayer; if (ABS(yawDiff) <= 0x4000) { func_80AA68FC(this, globalCtx); @@ -745,7 +745,7 @@ void func_80AA77D0(EnMb* this, GlobalContext* globalCtx) { s32 currentFrame; s16 yawDiff; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (yawDiff < 0) { yawDiff = -yawDiff; @@ -760,11 +760,11 @@ void func_80AA77D0(EnMb* this, GlobalContext* globalCtx) { if (this->unk_32E != 0) { this->unk_32E--; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 3000, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 3000, 0); } else { this->actor.speedXZ = 10.0f; this->attackParams = 1; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); if ((currentFrame != (s32)this->skelAnime.curFrame) && (((s32)this->skelAnime.curFrame == 2) || ((s32)this->skelAnime.curFrame == 6))) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DASH); @@ -786,7 +786,7 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) { s16 sp54[] = { 20, 40, 0 }; s16 sp4C[] = { -2500, 0, 3500 }; - Math_SmoothStepToS(&this->actor.shape.rot.y, sp4C[this->attackParams - 1] + this->actor.posRot.rot.y, 1, 0x2EE, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, sp4C[this->attackParams - 1] + this->actor.world.rot.y, 1, 0x2EE, 0); if (this->collider2.base.atFlags & AT_HIT) { this->collider2.base.atFlags &= ~AT_HIT; @@ -802,8 +802,8 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) { } } - func_8002F71C(globalCtx, &this->actor, ((650.0f - this->actor.xzDistToLink) * 0.04f) + 4.0f, - this->actor.posRot.rot.y, 8.0f); + func_8002F71C(globalCtx, &this->actor, ((650.0f - this->actor.xzDistToPlayer) * 0.04f) + 4.0f, + this->actor.world.rot.y, 8.0f); player->invincibilityTimer = oldInvincibilityTimer; } @@ -817,13 +817,13 @@ void func_80AA7938(EnMb* this, GlobalContext* globalCtx) { } } else { sp74 = this->effSpawnPos; - sp74.y = this->actor.groundY; + sp74.y = this->actor.floorHeight; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MONBLIN_HAM_LAND); - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); EffectSsBlast_SpawnWhiteShockwave(globalCtx, &sp74, &sp68, &sp68); func_80033480(globalCtx, &sp74, 2.0f, 3, 0x12C, 0xB4, 1); Camera_AddQuake(&globalCtx->mainCamera, 2, 0x19, 5); - func_800358DC(&this->actor, &sp74, &this->actor.posRot.rot, &sp5C, 20, &sp54, globalCtx, -1, 0); + func_800358DC(&this->actor, &sp74, &this->actor.world.rot, &sp5C, 20, &sp54, globalCtx, -1, 0); func_80AA6DA4(this); } } else { @@ -844,7 +844,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { player = PLAYER; sp4C = 0; - sp48 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.posRot.rot.y); + sp48 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.world.rot.y); currentFrame = (s32)this->skelAnime.curFrame; if (SkelAnime_Update(&this->skelAnime) != 0) { Animation_PlayLoop(&this->skelAnime, &D_06002F10); @@ -852,12 +852,12 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { } if (this->unk_32E != 0) { this->unk_32E--; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 1, 0x1F40, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 1, 0x1F40, 0); sp48 = 0; } else { this->actor.speedXZ = 10.0f; this->attackParams = 1; - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); if (currentFrame != (s32)this->skelAnime.curFrame) { if (((s32)this->skelAnime.curFrame == 2 || (s32)this->skelAnime.curFrame == 6)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DASH); @@ -888,11 +888,11 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { } } if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->actor.posRot.pos.x = this->actor.posRot.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + - (Math_SinS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.x = this->actor.world.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + + (Math_SinS(this->actor.shape.rot.y) * 89.0f); sp4C = 1; - player->actor.posRot.pos.z = this->actor.posRot.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + - (Math_CosS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.z = this->actor.world.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + + (Math_CosS(this->actor.shape.rot.y) * 89.0f); player->unk_850 = 0; player->actor.speedXZ = 0.0f; player->actor.velocity.y = 0.0f; @@ -904,7 +904,7 @@ void func_80AA7CAC(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } } this->attackParams = 0; @@ -921,10 +921,10 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { player = PLAYER; sp54 = 0; - sp50 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.posRot.rot.y); + sp50 = !func_800339B8(&this->actor, globalCtx, 110.0f, this->actor.world.rot.y); currentFrame = (s32)this->skelAnime.curFrame; SkelAnime_Update(&this->skelAnime); - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 5.0f, 3, 4.0f, 0x64, 0xF, 0); if (currentFrame != (s32)this->skelAnime.curFrame) { if (((s32)this->skelAnime.curFrame == 2) || ((s32)this->skelAnime.curFrame == 6)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DASH); @@ -954,11 +954,11 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { } } if ((player->stateFlags2 & 0x80) && (&this->actor == player->actor.parent)) { - player->actor.posRot.pos.x = this->actor.posRot.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + - (Math_SinS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.x = this->actor.world.pos.x + (Math_CosS(this->actor.shape.rot.y) * 10.0f) + + (Math_SinS(this->actor.shape.rot.y) * 89.0f); sp54 = 1; - player->actor.posRot.pos.z = this->actor.posRot.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + - (Math_CosS(this->actor.shape.rot.y) * 89.0f); + player->actor.world.pos.z = this->actor.world.pos.z + (Math_SinS(this->actor.shape.rot.y) * 10.0f) + + (Math_CosS(this->actor.shape.rot.y) * 89.0f); player->unk_850 = 0; player->actor.speedXZ = 0.0f; player->actor.velocity.y = 0.0f; @@ -970,7 +970,7 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); } this->attackParams = 0; this->actor.speedXZ = -10.0f; @@ -982,8 +982,8 @@ void func_80AA800C(EnMb* this, GlobalContext* globalCtx) { } } func_80AA6408(this, globalCtx); - this->actor.shape.rot.y = this->actor.posRot.rot.y; - if ((this->unk_32E == 0) && Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &this->actor.posRot.pos) < 80.0f) { + this->actor.shape.rot.y = this->actor.world.rot.y; + if ((this->unk_32E == 0) && Math_Vec3f_DistXZ(&this->actor.home.pos, &this->actor.world.pos) < 80.0f) { this->attackParams = 0; func_80AA6CC0(this); } @@ -994,7 +994,7 @@ void func_80AA8378(EnMb* this, GlobalContext* globalCtx) { if (this->unk_32E != 0) { Animation_PlayOnce(&this->skelAnime, &D_0600E18C); this->unk_32E = 0; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); Camera_AddQuake(&globalCtx->mainCamera, 2, 25, 5); } else { func_80AA6898(this); @@ -1032,7 +1032,7 @@ void func_80AA8514(EnMb* this, GlobalContext* globalCtx) { Vec3f effZeroVector; s32 effectsPerFrame; - effPosition = this->actor.posRot.pos; + effPosition = this->actor.world.pos; effPosition.x += Math_SinS(this->actor.shape.rot.y) * -70.0f; effPosition.z += Math_CosS(this->actor.shape.rot.y) * -70.0f; Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); @@ -1053,7 +1053,7 @@ void func_80AA8514(EnMb* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } } else if (((s32)this->skelAnime.curFrame == 15) || ((s32)this->skelAnime.curFrame == 22)) { - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); func_80033260(globalCtx, &this->actor, &effPosition, 50.0f, 0xA, 3.0f, 0x190, 0x3C, 0); Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN); Camera_AddQuake(&globalCtx->mainCamera, 2, 0x19, 5); @@ -1070,7 +1070,7 @@ void func_80AA87D8(EnMb* this, GlobalContext* globalCtx) { s16 yaw; f32 playSpeedABS; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiff = ABS(yawDiff); Math_SmoothStepToF(&this->actor.speedXZ, 0.59999996f, 0.1f, 1.0f, 0.0f); this->skelAnime.playSpeed = this->actor.speedXZ; @@ -1080,19 +1080,18 @@ void func_80AA87D8(EnMb* this, GlobalContext* globalCtx) { sp48 = this->skelAnime.curFrame - playSpeedABS; playSpeedABS = ABS(this->skelAnime.playSpeed); - if ((this->unk_32E == 0) && - (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < this->unk_364)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 750, 0); + if ((this->unk_32E == 0) && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->unk_364)) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 750, 0); this->actor.flags |= 1; - if ((this->actor.xzDistToLink < 500.0f) && (yawDiff <= 0x1387)) { + if ((this->actor.xzDistToPlayer < 500.0f) && (yawDiff <= 0x1387)) { func_80AA6AC8(this); } } else { this->actor.flags &= ~1; - if ((this->unk_360 < Math_Vec3f_DistXZ(&this->actor.posRot.pos, &this->actor.initPosRot.pos)) || + if ((this->unk_360 < Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos)) || (this->soundTimer != 0)) { - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, yaw, 1, 750, 0); + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 750, 0); } if (this->soundTimer != 0) { this->soundTimer--; @@ -1120,7 +1119,7 @@ void func_80AA87D8(EnMb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_80AA8AEC(EnMb* this, GlobalContext* globalCtx) { @@ -1131,20 +1130,20 @@ void func_80AA8AEC(EnMb* this, GlobalContext* globalCtx) { s32 yawDiffAbs; f32 playSpeedABS; - if (Math_Vec3f_DistXZ(&this->waypointPos, &this->actor.posRot.pos) <= 8.0f || - Rand_ZeroOne() < 0.1f && Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &this->actor.posRot.pos) <= 4.0f) { + if (Math_Vec3f_DistXZ(&this->waypointPos, &this->actor.world.pos) <= 8.0f || + Rand_ZeroOne() < 0.1f && Math_Vec3f_DistXZ(&this->actor.home.pos, &this->actor.world.pos) <= 4.0f) { func_80AA68FC(this, globalCtx); } else { Math_SmoothStepToF(&this->actor.speedXZ, 0.59999996f, 0.1f, 1.0f, 0.0f); this->skelAnime.playSpeed = (this->actor.speedXZ + this->actor.speedXZ); } - this->unk_330 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->waypointPos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_330, 1, 0x5DC, 0); - yDistAbs = (this->actor.yDistToLink >= 0.0f) ? this->actor.yDistToLink : -this->actor.yDistToLink; + this->unk_330 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->waypointPos); + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_330, 1, 0x5DC, 0); + yDistAbs = (this->actor.yDistToPlayer >= 0.0f) ? this->actor.yDistToPlayer : -this->actor.yDistToPlayer; if (yDistAbs <= 20.0f && func_80AA652C(this, globalCtx) != 0) { - yawDiff = (this->actor.shape.rot.y - this->actor.yawTowardsLink); + yawDiff = (this->actor.shape.rot.y - this->actor.yawTowardsPlayer); yawDiffAbs = ABS(yawDiff); - if (yawDiffAbs <= 0x4000 || func_8002DDE4(globalCtx) != 0 && this->actor.xzDistToLink < 160.0f) { + if (yawDiffAbs <= 0x4000 || func_8002DDE4(globalCtx) != 0 && this->actor.xzDistToPlayer < 160.0f) { func_80AA66A0(this, globalCtx); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_VOICE); func_80AA6AC8(this); @@ -1172,7 +1171,7 @@ void func_80AA8AEC(EnMb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_WALK); } } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_80AA8DD8(EnMb* this, GlobalContext* globalCtx) { @@ -1181,9 +1180,9 @@ void func_80AA8DD8(EnMb* this, GlobalContext* globalCtx) { s16 yawDiff; s32 yawDiffAbs; - yawDiff = (this->actor.posRot.rot.y - this->actor.yawTowardsLink); + yawDiff = (this->actor.world.rot.y - this->actor.yawTowardsPlayer); SkelAnime_Update(&this->skelAnime); - if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < this->unk_364) { + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->unk_364) { if (!(player->stateFlags1 & 0x4000000)) { yawDiffAbs = ABS(yawDiff); if (yawDiffAbs < 0x3E80) { @@ -1197,7 +1196,7 @@ void func_80AA8E88(EnMb* this) { s16 yawDiff; s32 yawDiffABS; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiffABS = ABS(yawDiff); if (yawDiffABS <= 0x4000) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06001950, -4.0f); @@ -1208,7 +1207,7 @@ void func_80AA8E88(EnMb* this) { } this->unk_32A = 30; this->unk_320 = 0; - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DEAD); EnMb_SetupAction(this, func_80AA8F50); } @@ -1228,7 +1227,7 @@ void func_80AA8FC8(EnMb* this) { s16 yawDiff; s32 yawDiffAbs; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiffAbs = ABS(yawDiff); if (yawDiffAbs <= 0x4000) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f); @@ -1237,7 +1236,7 @@ void func_80AA8FC8(EnMb* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060016B4, -4.0f); this->actor.speedXZ = 8.0f; } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_32A = 30; this->unk_320 = 0; Audio_PlayActorSound2(&this->actor, NA_SE_EN_MORIBLIN_DEAD); @@ -1254,7 +1253,7 @@ void func_80AA90A0(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.posRot.rot.y, 4.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.world.rot.y, 4.0f); this->attackParams = 0; } } @@ -1264,18 +1263,18 @@ void func_80AA90A0(EnMb* this, GlobalContext* globalCtx) { s32 i; Vec3f effPos; - this->actor.shape.unk_10 = 0.0f; + this->actor.shape.shadowScale = 0.0f; this->unk_32A--; for (i = 4; i >= 0; i--) { - effPos.x = Rand_CenteredFloat(110.0f) + this->actor.posRot.pos.x; - effPos.y = Rand_CenteredFloat(15.0f) + (this->actor.posRot.pos.y + 20.0f); - effPos.z = Rand_CenteredFloat(110.0f) + this->actor.posRot.pos.z; + effPos.x = Rand_CenteredFloat(110.0f) + this->actor.world.pos.x; + effPos.y = Rand_CenteredFloat(15.0f) + (this->actor.world.pos.y + 20.0f); + effPos.z = Rand_CenteredFloat(110.0f) + this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &effPos, &zeroVec, &zeroVec, 0x64, 7, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0xFF, 0, 1, 9, 1); } } else { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); Actor_Kill(&this->actor); } } @@ -1336,7 +1335,7 @@ void func_80AA94D8(EnMb* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->actor.parent = NULL; player->unk_850 = 200; - func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.posRot.rot.y, 6.0f); + func_8002F71C(globalCtx, &this->actor, 6.0f, this->actor.world.rot.y, 6.0f); } this->unk_188 = this->actor.colChkInfo.damageEffect; this->attackParams = 0; @@ -1374,8 +1373,8 @@ void EnMb_Update(Actor* thisx, GlobalContext* globalCtx) { if (thisx->colChkInfo.damageEffect != 5) { this->actionFunc(this, globalCtx); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 40.0f, 40.0f, 70.0f, 0x1D); - Actor_SetHeight(thisx, thisx->scale.x * 4500.0f); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 40.0f, 40.0f, 70.0f, 0x1D); + Actor_SetFocus(thisx, thisx->scale.x * 4500.0f); Collider_UpdateCylinder(thisx, &this->collider1); if (thisx->colChkInfo.health <= 0) { this->collider1.dim.pos.x += (Math_SinS(thisx->shape.rot.y) * (-4400.0f * thisx->scale.y)); @@ -1414,7 +1413,7 @@ void EnMb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec func_80AA9440(&this->actor, globalCtx); } } - func_8002BDB0(&this->actor, limbIndex, 0x16, &D_80AA9DFC, 0x1B, &D_80AA9DFC); + Actor_SetFeetPos(&this->actor, limbIndex, 22, &D_80AA9DFC, 27, &D_80AA9DFC); } if (this->unk_328 != 0) { switch (limbIndex) { @@ -1491,7 +1490,7 @@ void EnMb_Draw(Actor* thisx, GlobalContext* globalCtx) { Collider_SetTrisVertices(&this->collider3, 1, &phi_s0[0], &phi_s0[1], &phi_s0[2]); } if (this->unk_328 != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; if (this->unk_328 >= 0) { this->unk_328--; } 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 0db2aa988a..2a8be4b847 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -24,7 +24,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx); const ActorInit En_Md_InitVars = { ACTOR_EN_MD, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MD, sizeof(EnMd), @@ -494,8 +494,8 @@ void func_80AAB158(EnMd* this, GlobalContext* globalCtx) { s16 temp2; s16 yawDiff; - if (this->actor.xzDistToLink < 170.0f) { - yawDiff = (f32)this->actor.yawTowardsLink - this->actor.shape.rot.y; + if (this->actor.xzDistToPlayer < 170.0f) { + yawDiff = (f32)this->actor.yawTowardsPlayer - this->actor.shape.rot.y; absYawDiff = ABS(yawDiff); temp = (absYawDiff <= func_800347E8(2)) ? 2 : 1; @@ -523,7 +523,7 @@ void func_80AAB158(EnMd* this, GlobalContext* globalCtx) { this->unk_1E0.unk_14 = 40.0f; temp = 2; } else { - this->unk_1E0.unk_18 = player->actor.posRot.pos; + this->unk_1E0.unk_18 = player->actor.world.pos; this->unk_1E0.unk_14 = (gSaveContext.linkAge > 0) ? 0.0f : -18.0f; } @@ -550,9 +550,9 @@ u8 EnMd_FollowPath(EnMd* this, GlobalContext* globalCtx) { pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(pathDiffX, pathDiffZ) * (65536.0f / (2 * M_PI)), 4, 4000, + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(pathDiffX, pathDiffZ) * (65536.0f / (2 * M_PI)), 4, 4000, 1); if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 100.0f) { @@ -577,9 +577,9 @@ u8 EnMd_SetMovedPos(EnMd* this, GlobalContext* globalCtx) { lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; - this->actor.posRot.pos.x = lastPointPos->x; - this->actor.posRot.pos.y = lastPointPos->y; - this->actor.posRot.pos.z = lastPointPos->z; + this->actor.world.pos.x = lastPointPos->x; + this->actor.world.pos.y = lastPointPos->y; + this->actor.world.pos.z = lastPointPos->z; return 1; } @@ -593,10 +593,10 @@ void func_80AAB5A4(EnMd* this, GlobalContext* globalCtx) { ? 100.0f : 400.0f; this->alpha = func_80034DD4(this, globalCtx, this->alpha, temp); - this->actor.shape.unk_14 = this->alpha; + this->actor.shape.shadowAlpha = this->alpha; } else { this->alpha = 255; - this->actor.shape.unk_14 = this->alpha; + this->actor.shape.shadowAlpha = this->alpha; } } @@ -604,7 +604,7 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) { EnMd* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007FB8, NULL, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx, &this->collider); @@ -617,16 +617,16 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) { func_80034EC0(&this->skelAnime, sAnimations, 0); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->alpha = 255; - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_KOKIRI); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, FAIRY_KOKIRI); if (((globalCtx->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) || ((globalCtx->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || ((globalCtx->sceneNum == SCENE_SPOT10) && !(gSaveContext.eventChkInf[0] & 0x400))) { - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; this->actionFunc = func_80AAB948; return; } @@ -669,18 +669,18 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) { func_80AAAA24(this); if (this->unk_1E0.unk_00 == 0) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; - yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &actorToBlock->posRot.pos); + yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &actorToBlock->world.pos); - this->actor.posRot.pos.x = this->actor.initPosRot.pos.x; - this->actor.posRot.pos.x += 60.0f * Math_SinS(yaw); + this->actor.world.pos.x = this->actor.home.pos.x; + this->actor.world.pos.x += 60.0f * Math_SinS(yaw); - this->actor.posRot.pos.z = this->actor.initPosRot.pos.z; - this->actor.posRot.pos.z += 60.0f * Math_CosS(yaw); + this->actor.world.pos.z = this->actor.home.pos.z; + this->actor.world.pos.z += 60.0f * Math_CosS(yaw); - temp = fabsf((f32)this->actor.yawTowardsLink - yaw) * 0.001f * 3.0f; + temp = fabsf((f32)this->actor.yawTowardsPlayer - yaw) * 0.001f * 3.0f; this->skelAnime.playSpeed = CLAMP(temp, 1.0f, 3.0f); } @@ -719,7 +719,7 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) { return; } - if (this->actor.xzDistToLink < (30.0f + this->collider.dim.radius)) { + if (this->actor.xzDistToPlayer < (30.0f + this->collider.dim.radius)) { player->stateFlags2 |= 0x800000; } } @@ -748,7 +748,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx) { func_80AAA93C(this); if (!(EnMd_FollowPath(this, globalCtx)) || (this->waypoint != 0)) { - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; return; } @@ -764,7 +764,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = 0.0f; this->actor.speedXZ = 0.0f; - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; this->actionFunc = func_80AAB8F8; } @@ -779,7 +779,7 @@ void EnMd_Update(Actor* thisx, GlobalContext* globalCtx) { func_80AAB5A4(this, globalCtx); Actor_MoveForward(&this->actor); func_80AAB158(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->actionFunc(this, globalCtx); } @@ -814,7 +814,7 @@ void EnMd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f vec = { 400.0f, 0.0f, 0.0f }; if (limbIndex == 16) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } 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 cd3d2979b1..9d1dea7e86 100644 --- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06005DF0; /* const ActorInit En_Mk_InitVars = { ACTOR_EN_MK, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MK, sizeof(EnMk), 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 f0aeda893e..542f25e566 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_0602CA38; /* const ActorInit En_Mm_InitVars = { ACTOR_EN_MM, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MM, sizeof(EnMm), 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 8e5e37e046..a4ff8e1e07 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -14,7 +14,7 @@ extern UNK_TYPE D_06005E18; /* const ActorInit En_Mm2_InitVars = { ACTOR_EN_MM2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MM, sizeof(EnMm2), 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 28f1e62877..8846c30bf8 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -23,7 +23,7 @@ void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx); const ActorInit En_Ms_InitVars = { ACTOR_EN_MS, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MS, sizeof(EnMs), @@ -54,8 +54,8 @@ static u16 sOfferTextIDs[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; extern AnimationHeader D_060005EC; @@ -84,7 +84,7 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, this->jointTable, this->morphTable, 9); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, this, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); Actor_SetScale(&this->actor, 0.015f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -106,14 +106,14 @@ void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) { s16 yawDiff; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; EnMs_SetOfferText(&this->actor, globalCtx); if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated this->actionFunc = EnMs_Talk; return; } - if ((this->actor.xzDistToLink < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range + if ((this->actor.xzDistToPlayer < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range func_8002F2CC(&this->actor, globalCtx, 90.0f); } } @@ -169,8 +169,8 @@ void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { s32 pad; this->activeTimer += 1; - Actor_SetHeight(&this->actor, 20.0f); - this->actor.unk_4C = 500.0f; + Actor_SetFocus(&this->actor, 20.0f); + this->actor.targetArrowOffset = 500.0f; Actor_SetScale(&this->actor, 0.015f); SkelAnime_Update(&this->skelAnime); this->actionFunc(this, globalCtx); @@ -178,7 +178,7 @@ void EnMs_Update(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.entranceIndex == 0x157 && gSaveContext.sceneSetupIndex == 8) { // ride carpet if in credits Actor_MoveForward(&this->actor); osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); } Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 9bb18cb732..fec3a81f3c 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -15,7 +15,7 @@ extern UNK_TYPE D_06004F70; /* const ActorInit En_Mu_InitVars = { ACTOR_EN_MU, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MU, sizeof(EnMu), 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 913bdb8feb..d6ccc50ce4 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -171,7 +171,7 @@ void EnNb_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80AB0FBC(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_300.unk_18 = player->actor.posRot.pos; + this->unk_300.unk_18 = player->actor.world.pos; this->unk_300.unk_14 = kREG(16) + 9.0f; func_80034A14(&this->actor, &this->unk_300, kREG(17) + 0xC, 2); } @@ -179,7 +179,7 @@ void func_80AB0FBC(EnNb* this, GlobalContext* globalCtx) { void func_80AB1040(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_300.unk_18 = player->actor.posRot.pos; + this->unk_300.unk_18 = player->actor.world.pos; this->unk_300.unk_14 = kREG(16) + 9.0f; func_80034A14(&this->actor, &this->unk_300, kREG(17) + 0xC, 4); } @@ -217,7 +217,7 @@ void func_80AB11EC(EnNb* this) { this->drawMode = NB_DRAW_NOTHING; this->alpha = 0; this->flag = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->alphaTimer = 0.0f; } @@ -241,7 +241,7 @@ void func_80AB1210(EnNb* this, GlobalContext* globalCtx) { } void func_80AB1284(EnNb* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); } s32 EnNb_FrameUpdateMatrix(EnNb* this) { @@ -261,10 +261,10 @@ void EnNb_SetupCsPosRot(EnNb* this, GlobalContext* globalCtx, s32 npcActionIdx) Actor* thisx = &this->actor; if (csCmdNPCAction != NULL) { - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; - thisx->posRot.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; + thisx->world.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; } } @@ -295,10 +295,10 @@ void EnNb_SetInitialCsPosRot(EnNb* this, GlobalContext* globalCtx, s32 npcAction Actor* thisx = &this->actor; if (csCmdNPCAction != NULL) { - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; - thisx->posRot.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; + thisx->world.rot.y = thisx->shape.rot.y = csCmdNPCAction->rot.y; } } @@ -323,22 +323,22 @@ void EnNb_SetCurrentAnim(EnNb* this, AnimationHeader* animation, u8 mode, f32 tr void EnNb_SetChamberAnim(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06009694, 0, 0, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; } void EnNb_SpawnBlueWarp(EnNb* this, GlobalContext* globalCtx) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y; - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y; + f32 posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void EnNb_GiveMedallion(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 posX = player->actor.posRot.pos.x; - f32 posY = player->actor.posRot.pos.y + 50.0f; - f32 posZ = player->actor.posRot.pos.z; + f32 posX = player->actor.world.pos.x; + f32 posY = player->actor.world.pos.y + 50.0f; + f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0xC); @@ -346,7 +346,7 @@ void EnNb_GiveMedallion(EnNb* this, GlobalContext* globalCtx) { } void EnNb_ComeUpImpl(EnNb* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += 83.333336f; + this->actor.shape.yOffset += 83.333336f; } void EnNb_SetupChamberCsImpl(EnNb* this, GlobalContext* globalCtx) { @@ -359,7 +359,7 @@ void EnNb_SetupChamberCsImpl(EnNb* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = &D_80AB431C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_SPIRIT); - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } } @@ -378,9 +378,9 @@ void EnNb_SetupChamberWarpImpl(EnNb* this, GlobalContext* globalCtx) { } void EnNb_SetupDefaultChamberIdle(EnNb* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = NB_CHAMBER_IDLE; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -468,7 +468,7 @@ void func_80AB19FC(EnNb* this, GlobalContext* globalCtx) { void EnNb_SetupLightArrowOrSealingCs(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06000410, 2, 0.0f, 0); this->action = NB_ACTION_7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_PlaySealingSound(void) { @@ -476,8 +476,8 @@ void EnNb_PlaySealingSound(void) { } void EnNb_InitializeDemo6K(EnNb* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(21) + 22.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 7); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(21) + 22.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 7); } void EnNb_SetupHide(EnNb* this, GlobalContext* globalCtx) { @@ -485,7 +485,7 @@ void EnNb_SetupHide(EnNb* this, GlobalContext* globalCtx) { this->action = NB_SEAL_HIDE; this->drawMode = NB_DRAW_HIDE; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->alphaTimer = 0.0f; EnNb_PlaySealingSound(); } @@ -502,7 +502,7 @@ void EnNb_CheckToFade(EnNb* this, GlobalContext* globalCtx) { this->drawMode = NB_DRAW_DEFAULT; *alphaTimer = kREG(5) + 10.0f; this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; return; } } else { @@ -512,14 +512,14 @@ void EnNb_CheckToFade(EnNb* this, GlobalContext* globalCtx) { this->drawMode = NB_DRAW_NOTHING; *alphaTimer = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } alpha = (*alphaTimer / (kREG(5) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } void EnNb_SetupLightOrb(EnNb* this, GlobalContext* globalCtx) { @@ -534,7 +534,7 @@ void EnNb_SetupLightOrb(EnNb* this, GlobalContext* globalCtx) { this->flag = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -581,7 +581,7 @@ void EnNb_DrawTransparency(EnNb* this, GlobalContext* globalCtx) { void EnNb_InitKidnap(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06001E7C, 0, 0.0f, 0); this->action = NB_KIDNAPPED; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; gSaveContext.eventChkInf[9] |= 0x20; } @@ -599,7 +599,7 @@ void EnNb_PlayAgonySFX(EnNb* this, GlobalContext* globalCtx) { void EnNb_SetPosInPortal(EnNb* this, GlobalContext* globalCtx) { CsCmdActorAction* csCmdNPCAction = EnNb_GetNpcCsAction(globalCtx, 1); - Vec3f* pos = &this->actor.posRot.pos; + Vec3f* pos = &this->actor.world.pos; f32 f0; s32 pad; Vec3f startPos; @@ -623,7 +623,7 @@ void EnNb_SetupCaptureCutsceneState(EnNb* this, GlobalContext* globalCtx) { EnNb_SetupCsPosRot(this, globalCtx, 1); this->action = NB_KIDNAPPED; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_SetRaisedArmCaptureAnim(EnNb* this, s32 animFinished) { @@ -711,7 +711,7 @@ void EnNb_SetupConfrontation(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, animation, 0, 0.0f, 0); this->action = NB_IN_CONFRONTATION; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_PlayKnuckleDefeatSFX(EnNb* this, GlobalContext* globalCtx) { @@ -749,8 +749,8 @@ void EnNb_PlayLookLeftSFX(EnNb* this) { } void EnNb_InitDemo6KInConfrontation(EnNb* this, GlobalContext* globalCtx) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(21) + 22.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0xB); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(21) + 22.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0xB); } void func_80AB2688(EnNb* this, GlobalContext* globalCtx) { @@ -761,7 +761,7 @@ void func_80AB2688(EnNb* this, GlobalContext* globalCtx) { void func_80AB26C8(EnNb* this) { this->action = NB_IN_CONFRONTATION; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AB26DC(EnNb* this, GlobalContext* globalCtx) { @@ -773,7 +773,7 @@ void func_80AB26DC(EnNb* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, 0.0f); this->action = NB_ACTION_14; this->drawMode = NB_DRAW_KNEEL; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_SetupKneel(EnNb* this) { @@ -783,7 +783,7 @@ void EnNb_SetupKneel(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, 0.0f); this->action = NB_KNEEL; this->drawMode = NB_DRAW_KNEEL; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_CheckIfKneeling(EnNb* this, s32 animFinished) { @@ -803,7 +803,7 @@ void EnNb_SetupLookRight(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f); this->action = NB_LOOK_RIGHT; this->drawMode = NB_DRAW_DEFAULT; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_CheckIfLookingRight(EnNb* this, s32 animFinished) { @@ -823,7 +823,7 @@ void EnNb_SetupLookLeft(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f); this->action = NB_LOOK_LEFT; this->drawMode = NB_DRAW_LOOK_DIRECTION; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_CheckIfLookLeft(EnNb* this, s32 animFinished) { @@ -849,13 +849,13 @@ void EnNb_SetupRun(EnNb* this) { Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, frames, ANIMMODE_ONCE, -8.0f); this->action = NB_RUN; this->drawMode = NB_DRAW_LOOK_DIRECTION; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void EnNb_SetupConfrontationDestroy(EnNb* this) { this->action = NB_CONFRONTATION_DESTROYED; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_CheckConfrontationCsMode(EnNb* this, GlobalContext* globalCtx) { @@ -1019,7 +1019,7 @@ void EnNb_SetupCreditsSpawn(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06000BC0, 0, 0.0f, 0); this->action = NB_CREDITS_INIT; this->drawMode = NB_DRAW_NOTHING; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void EnNb_SetAlphaInCredits(EnNb* this) { @@ -1030,11 +1030,11 @@ void EnNb_SetAlphaInCredits(EnNb* this) { if ((kREG(17) + 10.0f) <= this->alphaTimer) { this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } else { alpha = (*alphaTimer / (kREG(17) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } } @@ -1129,7 +1129,7 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, GlobalContext* globalCtx) { EnNb_SetCurrentAnim(this, &D_06004BB4, 0, 0.0f, 0); this->headTurnFlag = 1; this->actor.flags |= 9; - this->actor.posRot.pos = this->finalPos; + this->actor.world.pos = this->finalPos; this->action = NB_IDLE_AFTER_TALK; this->drawMode = NB_DRAW_DEFAULT; } @@ -1139,7 +1139,7 @@ void EnNb_CrawlspaceSpawnCheck(EnNb* this, GlobalContext* globalCtx) { } void func_80AB359C(EnNb* this) { - PosRot* posRot = &this->actor.posRot; + PosRot* world = &this->actor.world; Vec3f* initialPos = &this->initialPos; Vec3f* finalPos = &this->finalPos; f32 f0; @@ -1153,9 +1153,9 @@ void func_80AB359C(EnNb* this) { if (temp_t1 >= this->movementTimer) { f0 = func_8006F9BC(temp_t1, 0, this->movementTimer, 3, 3); - posRot->pos.x = initialPos->x + (f0 * (finalPos->x - initialPos->x)); - posRot->pos.y = initialPos->y + (f0 * (finalPos->y - initialPos->y)); - posRot->pos.z = initialPos->z + (f0 * (finalPos->z - initialPos->z)); + world->pos.x = initialPos->x + (f0 * (finalPos->x - initialPos->x)); + world->pos.y = initialPos->y + (f0 * (finalPos->y - initialPos->y)); + world->pos.z = initialPos->z + (f0 * (finalPos->z - initialPos->z)); } } @@ -1165,10 +1165,10 @@ void EnNb_SetNoticeSFX(EnNb* this) { s32 EnNb_GetNoticedStatus(EnNb* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 playerX = player->actor.posRot.pos.x; - f32 playerZ = player->actor.posRot.pos.z; - f32 thisX = this->actor.posRot.pos.x; - f32 thisZ = this->actor.posRot.pos.z; + f32 playerX = player->actor.world.pos.x; + f32 playerZ = player->actor.world.pos.z; + f32 thisX = this->actor.world.pos.x; + f32 thisZ = this->actor.world.pos.z; if (SQ(playerX - thisX) + SQ(playerZ - thisZ) < SQ(80.0f)) { return true; @@ -1188,7 +1188,7 @@ void func_80AB36DC(EnNb* this, GlobalContext* globalCtx) { } else { s16 invScale = (u16)(kREG(17) + 25) - moveTime; if (invScale > 0) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y, invScale, 6200, 100); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, invScale, 6200, 100); } } } @@ -1441,7 +1441,7 @@ void EnNb_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnNb* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); EnNb_SetupCollider(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060181C8, NULL, this->jointTable, this->morphTable, 19); @@ -1495,12 +1495,12 @@ void EnNb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f vec2; Matrix_MultVec3f(&vec1, &vec2); - this->actor.posRot2.pos.x = vec2.x; - this->actor.posRot2.pos.y = vec2.y; - this->actor.posRot2.pos.z = vec2.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = vec2.x; + this->actor.focus.pos.y = vec2.y; + this->actor.focus.pos.z = vec2.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } @@ -1545,7 +1545,7 @@ void EnNb_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Nb_InitVars = { ACTOR_EN_NB, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_NB, sizeof(EnNb), 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 dffcc499de..b81089c25a 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -39,7 +39,7 @@ static s16 D_80AB85E0 = 0; const ActorInit En_Niw_InitVars = { ACTOR_EN_NIW, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_NIW, sizeof(EnNiw), @@ -114,9 +114,9 @@ static ColliderCylinderInit sCylinderInit2 = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 6, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; extern FlexSkeletonHeader D_06002530; @@ -157,27 +157,27 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.flags |= 1; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, 16); if (globalCtx->sceneNum == SCENE_SPOT01) { for (i = 0; i < ARRAY_COUNT(sKakarikoPosList); i++) { - if (fabsf(this->actor.posRot.pos.x - sKakarikoPosList[i].x) < 40.0f && - fabsf(this->actor.posRot.pos.z - sKakarikoPosList[i].z) < 40.0f) { + if (fabsf(this->actor.world.pos.x - sKakarikoPosList[i].x) < 40.0f && + fabsf(this->actor.world.pos.z - sKakarikoPosList[i].z) < 40.0f) { this->unk_2AA = i; osSyncPrintf(VT_FGCOL(YELLOW) " 通常鶏index %d\n" VT_RST, this->unk_2AA); if (gSaveContext.infTable[25] & sKakarikoFlagList[i]) { - this->actor.posRot.pos.x = 300.0f; - this->actor.posRot.pos.y = 100.0f; - this->actor.posRot.pos.z = 1530.0f; + this->actor.world.pos.x = 300.0f; + this->actor.world.pos.y = 100.0f; + this->actor.world.pos.z = 1530.0f; this->actor.params = 0; } } } } - Math_Vec3f_Copy(&this->unk_2AC, &this->actor.posRot.pos); - Math_Vec3f_Copy(&this->unk_2B8, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->unk_2AC, &this->actor.world.pos); + Math_Vec3f_Copy(&this->unk_2B8, &this->actor.world.pos); this->unk_304 = 10.0f; Actor_SetScale(&this->actor, 0.01f); this->unk_2A4 = (s16)Rand_ZeroFloat(3.99f) + 5; @@ -400,12 +400,12 @@ void func_80AB6100(EnNiw* this, GlobalContext* globalCtx, s32 arg2) { this->timer6 = 150; if (this->timer8 == 0) { this->timer8 = 70; - this->unk_2E4 = this->actor.yawTowardsLink; + this->unk_2E4 = this->actor.yawTowardsPlayer; } } } targetRotY = this->unk_2E4 + factor; - Math_SmoothStepToS(&this->actor.posRot.rot.y, targetRotY, 3, this->unk_2FC, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, targetRotY, 3, this->unk_2FC, 0); Math_ApproachF(&this->unk_2FC, 3000.0f, 1.0f, 500.0f); func_80AB5BF8(this, globalCtx, 5); } @@ -438,9 +438,9 @@ void func_80AB6324(EnNiw* this, GlobalContext* globalCtx) { void func_80AB63A8(EnNiw* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1 && this->actor.velocity.y < 0.0f) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = @@ -455,7 +455,7 @@ void func_80AB63A8(EnNiw* this, GlobalContext* globalCtx) { void func_80AB6450(EnNiw* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (this->actor.xzDistToLink < 30.0f && fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 5.0f) { + if (this->actor.xzDistToPlayer < 30.0f && fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 5.0f) { this->timer6 = 100; this->actor.gravity = -2.0f; this->actionFunc = func_80AB7290; @@ -567,11 +567,11 @@ void func_80AB6570(EnNiw* this, GlobalContext* globalCtx) { if (this->timer4 != 0) { Math_ApproachZeroF(&this->unk_26C[9], 0.5f, 4000.0f); tmp = 1; - Math_ApproachF(&this->actor.posRot.pos.x, this->unk_2B8, 1.0f, this->unk_2FC); - Math_ApproachF(&this->actor.posRot.pos.z, this->unk_2C0, 1.0f, this->unk_2FC); + Math_ApproachF(&this->actor.world.pos.x, this->unk_2B8, 1.0f, this->unk_2FC); + Math_ApproachF(&this->actor.world.pos.z, this->unk_2C0, 1.0f, this->unk_2FC); Math_ApproachF(&this->unk_2FC, 3.0f, 1.0f, 0.3f); - posY = this->unk_2B8 - this->actor.posRot.pos.x; - posZ = this->unk_2C0 - this->actor.posRot.pos.z; + posY = this->unk_2B8 - this->actor.world.pos.x; + posZ = this->unk_2C0 - this->actor.world.pos.z; if (fabsf(posY) < 10.0f) { posY = 0.0; @@ -584,7 +584,7 @@ void func_80AB6570(EnNiw* this, GlobalContext* globalCtx) { this->unk_29E = 7; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(posY, posZ) * (0x8000 / M_PI), 3, this->unk_300, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(posY, posZ) * (0x8000 / M_PI), 3, this->unk_300, 0); Math_ApproachF(&this->unk_300, 10000.0f, 1.0f, 1000.0f); } @@ -599,9 +599,9 @@ void func_80AB6A38(EnNiw* this, GlobalContext* globalCtx) { s16 pathIndex = this->path - 1; if (this->path == 0) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = this->unk_2FC = this->unk_300 = 0.0f; @@ -610,8 +610,8 @@ void func_80AB6A38(EnNiw* this, GlobalContext* globalCtx) { path = &globalCtx->setupPathList[pathIndex]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; - pathDiffX = pointPos->x - this->actor.posRot.pos.x; - pathDiffZ = pointPos->z - this->actor.posRot.pos.z; + pathDiffX = pointPos->x - this->actor.world.pos.x; + pathDiffZ = pointPos->z - this->actor.world.pos.z; this->unk_2E4 = Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI); func_80AB6100(this, globalCtx, 2); @@ -659,9 +659,9 @@ void func_80AB6D08(EnNiw* this, GlobalContext* globalCtx) { return; } if (this->actor.params == 0xE) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = @@ -707,7 +707,7 @@ void func_80AB6D08(EnNiw* this, GlobalContext* globalCtx) { } void func_80AB6EB4(EnNiw* this, GlobalContext* globalCtx) { - if (this->actor.posRot.pos.y > 400.0f) { + if (this->actor.world.pos.y > 400.0f) { Actor_Kill(&this->actor); } @@ -727,11 +727,11 @@ void func_80AB6F04(EnNiw* this, GlobalContext* globalCtx) { this->actor.gravity = 0.0f; if (this->actor.yDistToWater > 15.0f) { - this->actor.posRot.pos.y += 2.0f; + this->actor.world.pos.y += 2.0f; } if (this->timer4 == 0) { this->timer4 = 30; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); pos.y += this->actor.yDistToWater; EffectSsGRipple_Spawn(globalCtx, &pos, 100, 500, 30); } @@ -801,7 +801,7 @@ void func_80AB714C(EnNiw* this, GlobalContext* globalCtx) { } if (this->timer5 == 0) { this->timer7 = 10; - this->unk_2E4 = this->actor.yawTowardsLink; + this->unk_2E4 = this->actor.yawTowardsPlayer; this->actor.flags &= ~1; this->actionFunc = func_80AB7204; } @@ -835,9 +835,9 @@ void func_80AB7328(EnNiw* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (this->timer6 == 0) { - this->unk_2AC = this->unk_2B8 = this->actor.posRot.pos.x; - this->unk_2B0 = this->unk_2BC = this->actor.posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = this->actor.posRot.pos.z; + this->unk_2AC = this->unk_2B8 = this->actor.world.pos.x; + this->unk_2B0 = this->unk_2BC = this->actor.world.pos.y; + this->unk_2B4 = this->unk_2C0 = this->actor.world.pos.z; this->timer5 = this->timer4 = this->unk_29E = 0; this->unk_26C[7] = this->unk_26C[5] = this->unk_26C[6] = this->unk_26C[8] = this->actor.speedXZ = this->unk_2FC = this->unk_300 = 0.0f; @@ -846,8 +846,8 @@ void func_80AB7328(EnNiw* this, GlobalContext* globalCtx) { } this->actionFunc = EnNiw_ResetAction; } else { - this->unk_2E4 = Math_FAtan2F(this->actor.posRot.pos.x - player->actor.posRot.pos.x, - this->actor.posRot.pos.z - player->actor.posRot.pos.z) * + this->unk_2E4 = Math_FAtan2F(this->actor.world.pos.x - player->actor.world.pos.x, + this->actor.world.pos.z - player->actor.world.pos.z) * (0x8000 / M_PI); func_80AB6100(this, globalCtx, 0); func_80AB5BF8(this, globalCtx, 2); @@ -912,9 +912,9 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { } for (i = 0; i < featherCount; i++) { - pos.x = Rand_CenteredFloat(10.0f) + thisx->posRot.pos.x; - pos.y = Rand_CenteredFloat(10.0f) + (thisx->posRot.pos.y + this->unk_304); - pos.z = Rand_CenteredFloat(10.0f) + thisx->posRot.pos.z; + pos.x = Rand_CenteredFloat(10.0f) + thisx->world.pos.x; + pos.y = Rand_CenteredFloat(10.0f) + (thisx->world.pos.y + this->unk_304); + pos.z = Rand_CenteredFloat(10.0f) + thisx->world.pos.z; scale = Rand_ZeroFloat(6.0f) + 6.0f; if (this->unk_2A6 == 2 && this->unk_304 != 0) { @@ -973,46 +973,46 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->timer9 != 0) { this->timer9--; } - thisx->shape.rot = thisx->posRot.rot; - thisx->shape.unk_10 = 15.0f; + thisx->shape.rot = thisx->world.rot; + thisx->shape.shadowScale = 15.0f; this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->unk_304); + Actor_SetFocus(&this->actor, this->unk_304); Actor_MoveForward(&this->actor); if (this->actionFunc != func_80AB6EB4 && this->actionFunc != func_80AB6450 && globalCtx->sceneNum != SCENE_SPOT03) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 31); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 31); } if (globalCtx->sceneNum == SCENE_SPOT03) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 29); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 29); } - if (thisx->groundY <= BGCHECK_Y_MIN || thisx->groundY >= 32000.0f) { - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 上下? ☆☆☆☆☆ %f\n" VT_RST, thisx->groundY); + if (thisx->floorHeight <= BGCHECK_Y_MIN || thisx->floorHeight >= 32000.0f) { + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 上下? ☆☆☆☆☆ %f\n" VT_RST, thisx->floorHeight); cam.x = globalCtx->view.lookAt.x - globalCtx->view.eye.x; cam.y = globalCtx->view.lookAt.y - globalCtx->view.eye.y; cam.z = globalCtx->view.lookAt.z - globalCtx->view.eye.z; camResult = cam.y / sqrtf(SQ(cam.x) + SQ(cam.y) + SQ(cam.z)); - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外X! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.x); - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.y); - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.z); - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットX! ☆☆☆☆☆ %f\n" VT_RST, thisx->initPosRot.pos.x); - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットY! ☆☆☆☆☆ %f\n" VT_RST, thisx->initPosRot.pos.y); - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットZ! ☆☆☆☆☆ %f\n" VT_RST, thisx->initPosRot.pos.z); - thisx->posRot.pos.x = thisx->initPosRot.pos.x; - thisx->posRot.pos.z = thisx->initPosRot.pos.z; - thisx->posRot.pos.y = ((thisx->initPosRot.pos.y + globalCtx->view.eye.y) + (camResult * 160.0f)); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外X! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.x); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.y); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 範囲外Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットX! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.x); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットY! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.y); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ セットZ! ☆☆☆☆☆ %f\n" VT_RST, thisx->home.pos.z); + thisx->world.pos.x = thisx->home.pos.x; + thisx->world.pos.z = thisx->home.pos.z; + thisx->world.pos.y = ((thisx->home.pos.y + globalCtx->view.eye.y) + (camResult * 160.0f)); - if (thisx->posRot.pos.y < thisx->initPosRot.pos.y) { - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 300.0f; + if (thisx->world.pos.y < thisx->home.pos.y) { + thisx->world.pos.y = thisx->home.pos.y + 300.0f; } - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後X! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.x); - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.y); - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->posRot.pos.z); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後X! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.x); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Y! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.y); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 修整後Z! ☆☆☆☆☆ %f\n" VT_RST, thisx->world.pos.z); osSyncPrintf("\n\n"); thisx->speedXZ = 0.0f; thisx->gravity = -2.0f; - Math_Vec3f_Copy(&this->unk_2AC, &thisx->initPosRot); - Math_Vec3f_Copy(&this->unk_2B8, &thisx->initPosRot); + Math_Vec3f_Copy(&this->unk_2AC, &thisx->home); + Math_Vec3f_Copy(&this->unk_2B8, &thisx->home); this->unk_300 = 0.0f; this->unk_2FC = 0.0f; this->unk_2F0.z = 0.0f; @@ -1042,7 +1042,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA) { thisx->velocity.y = 0.0f; thisx->gravity = 0.0f; - Math_Vec3f_Copy(&pos, &thisx->posRot); + Math_Vec3f_Copy(&pos, &thisx->world); pos.y += thisx->yDistToWater; this->timer4 = 30; EffectSsGSplash_Spawn(globalCtx, &pos, 0, 0, 0, 400); @@ -1057,7 +1057,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { if (D_80AB85E0 == 0 && this->unk_2A4 <= 0 && thisx->params != 0xD && thisx->params != 0xE && thisx->params != 0xA) { this->timer6 = 100; - if (thisx->xzDistToLink > 10.0f) { + if (thisx->xzDistToPlayer > 10.0f) { D_80AB85E0 = 1; this->timer5 = this->timer4 = this->unk_29E = 0; thisx->speedXZ = 0.0f; @@ -1069,9 +1069,9 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_26C[8] = 0.0f; this->sfxTimer1 = 10000; this->unk_2A8 = 1; - this->unk_2AC = this->unk_2B8 = thisx->posRot.pos.x; - this->unk_2B0 = this->unk_2BC = thisx->posRot.pos.y; - this->unk_2B4 = this->unk_2C0 = thisx->posRot.pos.z; + this->unk_2AC = this->unk_2B8 = thisx->world.pos.x; + this->unk_2B0 = this->unk_2BC = thisx->world.pos.y; + this->unk_2B4 = this->unk_2C0 = thisx->world.pos.z; this->actionFunc = func_80AB70A0; return; } @@ -1079,8 +1079,8 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { dist = 20.0f; - if (this->unk_2A8 != 0 && thisx->xyzDistToLinkSq < SQ(dist) && player->invincibilityTimer == 0) { - func_8002F6D4(globalCtx, &this->actor, 2.0f, thisx->posRot.rot.y, 0.0f, 0x10); + if (this->unk_2A8 != 0 && thisx->xyzDistToPlayerSq < SQ(dist) && player->invincibilityTimer == 0) { + func_8002F6D4(globalCtx, &this->actor, 2.0f, thisx->world.rot.y, 0.0f, 0x10); } func_80AB747C(&this->actor, globalCtx); @@ -1146,7 +1146,7 @@ void EnNiw_Draw(Actor* thisx, GlobalContext* globalCtx) { EnNiw_OverrideLimbDraw, NULL, this); if (this->actionFunc == func_80AB6450) { - func_80033C30(&this->actor.posRot.pos, &scale, 255, globalCtx); + func_80033C30(&this->actor.world.pos, &scale, 255, globalCtx); } EnNiw_FeatherDraw(this, globalCtx); 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 946e1396ec..5a81402748 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 @@ -22,7 +22,7 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx); const ActorInit En_Niw_Girl_InitVars = { ACTOR_EN_NIW_GIRL, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GR, sizeof(EnNiwGirl), @@ -70,7 +70,7 @@ void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009948, &D_06000378, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; if (this->actor.params < 0) { this->actor.params = 0; } @@ -82,8 +82,8 @@ void EnNiwGirl_Init(Actor* thisx, GlobalContext* globalCtx) { vec1.z = 50.0; Matrix_MultVec3f(&vec1, &vec2); this->chasedEnNiw = (EnNiw*)Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_NIW, this->actor.posRot.pos.x + vec2.x, - this->actor.posRot.pos.y + vec2.y, this->actor.posRot.pos.z + vec2.z, 0, this->actor.posRot.rot.y, 0, 0xA); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_NIW, this->actor.world.pos.x + vec2.x, + this->actor.world.pos.y + vec2.y, this->actor.world.pos.z + vec2.z, 0, this->actor.world.rot.y, 0, 0xA); if (this->chasedEnNiw != NULL) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ シツレイしちゃうわね!プンプン ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ きゃははははは、まてー ☆☆☆☆☆ %d\n" VT_RST, this->path); @@ -118,8 +118,8 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.2f, 0.4f); // Find the X and Z distance between the girl and the cuckoo she is chasing - xDistBetween = this->chasedEnNiw->actor.posRot.pos.x - this->actor.posRot.pos.x; - zDistBetween = this->chasedEnNiw->actor.posRot.pos.z - this->actor.posRot.pos.z; + xDistBetween = this->chasedEnNiw->actor.world.pos.x - this->actor.world.pos.x; + zDistBetween = this->chasedEnNiw->actor.world.pos.z - this->actor.world.pos.z; if (func_8010BDBC(&globalCtx->msgCtx) != 0) { this->chasedEnNiw->path = 0; } @@ -134,7 +134,7 @@ void func_80AB9210(EnNiwGirl* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(xDistBetween, zDistBetween) * 10430.378f, 3, this->unk_27C, 0); Math_ApproachF(&this->unk_27C, 5000.0f, 30.0f, 150.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; // Only allow Link to talk to her when she is playing the jumping animation if ((this->jumpTimer == 0) || (Player_GetMask(globalCtx) != PLAYER_MASK_NONE)) { @@ -209,11 +209,11 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) { } } this->unk_280 = 30.0f; - Actor_SetHeight(&this->actor, 30.0f); + Actor_SetFocus(&this->actor, 30.0f); if (tempActionFunc == this->actionFunc) { - this->unk_2D4.unk_18 = player->actor.posRot.pos; + this->unk_2D4.unk_18 = player->actor.world.pos; if (LINK_IS_CHILD) { - this->unk_2D4.unk_18.y = player->actor.posRot.pos.y - 10.0f; + this->unk_2D4.unk_18.y = player->actor.world.pos.y - 10.0f; } func_80034A14(&this->actor, &this->unk_2D4, 2, 4); this->unk_260 = this->unk_2D4.unk_08; @@ -231,7 +231,7 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) { } this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 100.0f, 100.0f, 200.0f, 0x1C); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 100.0f, 100.0f, 200.0f, 0x1C); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -261,7 +261,7 @@ void EnNiwGirl_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80AB99D8[this->unk_272])); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnNiwGirlOverrideLimbDraw, 0, this); - func_80033C30(&this->actor.posRot.pos, &sp4C, 255, globalCtx); + func_80033C30(&this->actor.world.pos, &sp4C, 255, globalCtx); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_niw_girl.c", 592); } 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 f49a84d52a..9bff836bfc 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 @@ -27,7 +27,7 @@ void func_80ABAD7C(EnNiwLady* this, GlobalContext* globalCtx); const ActorInit En_Niw_Lady_InitVars = { ACTOR_EN_NIW_LADY, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ANE, sizeof(EnNiwLady), @@ -165,11 +165,11 @@ void func_80AB9F24(EnNiwLady* this, GlobalContext* globalCtx) { this->unk_27E = 1; this->actor.gravity = -3.0f; Actor_SetScale(&this->actor, 0.01f); - ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 20.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->unk_272 = 0; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actor.draw = EnNiwLady_Draw; switch (this->unk_278) { case 0: @@ -206,11 +206,11 @@ void func_80ABA244(EnNiwLady* this, GlobalContext* globalCtx) { s32 phi_s1; this->cuccosInPen = 0; - currentCucco = (EnNiw*)globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + currentCucco = (EnNiw*)globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (currentCucco != NULL) { if (currentCucco->actor.id == ACTOR_EN_NIW) { - if ((fabsf(currentCucco->actor.posRot.pos.x - 330.0f) < 90.0f) && - (fabsf(currentCucco->actor.posRot.pos.z - 1610.0f) < 190.0f)) { + if ((fabsf(currentCucco->actor.world.pos.x - 330.0f) < 90.0f) && + (fabsf(currentCucco->actor.world.pos.z - 1610.0f) < 190.0f)) { if (this->unk_26C == 0) { gSaveContext.infTable[25] |= D_80ABB3B4[currentCucco->unk_2AA]; if (BREG(1) != 0) { @@ -494,10 +494,10 @@ void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx) { EnNiwLady* this = THIS; Player* player = PLAYER; - Actor_SetHeight(thisx, 60.0f); - this->unk_288.unk_18 = player->actor.posRot.pos; + Actor_SetFocus(thisx, 60.0f); + this->unk_288.unk_18 = player->actor.world.pos; if (LINK_IS_CHILD) { - this->unk_288.unk_18.y = player->actor.posRot.pos.y - 10.0f; + this->unk_288.unk_18.y = player->actor.world.pos.y - 10.0f; } func_80034A14(thisx, &this->unk_288, 2, 4); this->unk_254 = this->unk_288.unk_08; @@ -532,7 +532,7 @@ void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx) { this->unusedRandomTimer = ((s16)Rand_ZeroFloat(60.0f) + 0x14); } } - func_8002E4B4(globalCtx, thisx, 20.0f, 20.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 20.0f, 20.0f, 60.0f, 0x1D); Collider_UpdateCylinder(thisx, &this->collider); if (1) {} CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 6bf6ad81e4..3632ecc0fd 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -21,7 +21,7 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx); const ActorInit En_Nutsball_InitVars = { ACTOR_EN_NUTSBALL, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnNutsball), @@ -59,7 +59,7 @@ void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) { EnNutsball* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawFunc_Circle, 13.0f); + ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[this->actor.params]); @@ -99,7 +99,7 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; } - this->actor.initPosRot.rot.z += 0x2AA8; + this->actor.home.rot.z += 0x2AA8; if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || (this->collider.base.acFlags & AC_HIT) || (this->collider.base.ocFlags1 & OC1_HIT)) { @@ -114,18 +114,18 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) { this->collider.info.toucher.dmgFlags = 2; func_800D20CC(&player->shieldMf, &sp4C, 0); - this->actor.posRot.rot.y = sp4C.y + 0x8000; + this->actor.world.rot.y = sp4C.y + 0x8000; this->timer = 30; return; } } - sp40.x = this->actor.posRot.pos.x; - sp40.y = this->actor.posRot.pos.y + 4; - sp40.z = this->actor.posRot.pos.z; + sp40.x = this->actor.world.pos.x; + sp40.y = this->actor.world.pos.y + 4; + sp40.z = this->actor.world.pos.z; EffectSsHahen_SpawnBurst(globalCtx, &sp40, 6.0f, 0, 7, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_OCTAROCK_ROCK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); Actor_Kill(&this->actor); } else { if (this->timer == -300) { @@ -143,7 +143,7 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height, 5); Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.flags |= 0x1000000; @@ -161,7 +161,7 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); - Matrix_RotateZ(thisx->initPosRot.rot.z * 9.58738e-05f, MTXMODE_APPLY); + Matrix_RotateZ(thisx->home.rot.z * 9.58738e-05f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params]); 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 5dfde88285..673b9b384d 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -39,7 +39,7 @@ extern Gfx D_06000D50[]; const ActorInit En_Nwc_InitVars = { ACTOR_EN_NWC, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_NWC, sizeof(EnNwc), @@ -227,9 +227,9 @@ void EnNwc_Init(Actor* thisx, GlobalContext* globalCtx) { chick = this->chicks; for (i = 0; i < this->count; i++, chick++) { chick->type = CHICK_NORMAL; - chick->pos.x = thisx->posRot.pos.x + ((Rand_ZeroOne() * 100.0f) - 50.0f); - chick->pos.y = thisx->posRot.pos.y + 20.0f; - chick->pos.z = thisx->posRot.pos.z + ((Rand_ZeroOne() * 100.0f) - 50.0f); + chick->pos.x = thisx->world.pos.x + ((Rand_ZeroOne() * 100.0f) - 50.0f); + chick->pos.y = thisx->world.pos.y + 20.0f; + chick->pos.z = thisx->world.pos.z + ((Rand_ZeroOne() * 100.0f) - 50.0f); chick->height = 5; } EnNwc_SetUpdate(this, EnNwc_Idle); 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 1ce1126056..05940a2205 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -16,7 +16,7 @@ extern UNK_TYPE D_06001FC8; /* const ActorInit En_Ny_InitVars = { ACTOR_EN_NY, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_NY, sizeof(EnNy), 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 0416dd7150..422a0a96bb 100644 --- a/src/overlays/actors/ovl_En_OE2/z_en_oe2.c +++ b/src/overlays/actors/ovl_En_OE2/z_en_oe2.c @@ -19,7 +19,7 @@ void EnOE2_DoNothing(EnOE2* this, GlobalContext* globalCtx); const ActorInit En_OE2_InitVars = { ACTOR_EN_OE2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OE2, sizeof(EnOE2), 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 7affec989f..7536232e0a 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 @@ -20,7 +20,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx const ActorInit En_Okarina_Effect_InitVars = { ACTOR_EN_OKARINA_EFFECT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnOkarinaEffect), @@ -116,8 +116,8 @@ void EnOkarinaEffect_Update(Actor* thisx, GlobalContext* globalCtx) { 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, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0xFF, 0, 0xFF, 0xFF, 4, globalCtx->state.gfxCtx); } } 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 44068f0eff..1ed1e2f588 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 @@ -24,7 +24,7 @@ void func_80ABF7CC(EnOkarinaTag* this, GlobalContext* globalCtx); const ActorInit En_Okarina_Tag_InitVars = { ACTOR_EN_OKARINA_TAG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnOkarinaTag), @@ -60,9 +60,9 @@ void EnOkarinaTag_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_152 = 0; this->unk_158 = 1; } - this->actor.unk_1F = 1; - if (this->actor.posRot.rot.z > 0) { - this->unk_15C = this->actor.posRot.rot.z * 40.0f; + this->actor.targetMode = 1; + if (this->actor.world.rot.z > 0) { + this->unk_15C = this->actor.world.rot.z * 40.0f; } // "Save information" @@ -72,7 +72,7 @@ void EnOkarinaTag_Init(Actor* thisx, GlobalContext* globalCtx) { // "Correct answer information" osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 正解情報\t ☆☆☆☆☆ %d\n" VT_RST, this->unk_152); // "Range information" - osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 範囲情報\t ☆☆☆☆☆ %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 範囲情報\t ☆☆☆☆☆ %d\n" VT_RST, this->actor.world.rot.z); // "Processing range information" osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 処理範囲情報\t ☆☆☆☆☆ %f\n" VT_RST, this->unk_15C); // "Hit?" @@ -120,10 +120,10 @@ void func_80ABEF2C(EnOkarinaTag* this, GlobalContext* globalCtx) { if ((this->unk_152 != 6) || (gSaveContext.scarecrowSpawnSongSet)) { if (player->stateFlags2 & 0x1000000) { // "North! ! ! ! !" - osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToLink); + osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ 北!!!!! ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToPlayer); } - if ((this->actor.xzDistToLink < (90.0f + this->unk_15C)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 80.0f)) { + if ((this->actor.xzDistToPlayer < (90.0f + this->unk_15C)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { if (player->stateFlags2 & 0x2000000) { unk_152 = this->unk_152; if (unk_152 == 6) { @@ -132,8 +132,8 @@ void func_80ABEF2C(EnOkarinaTag* this, GlobalContext* globalCtx) { player->stateFlags2 |= 0x800000; func_8010BD58(globalCtx, unk_152 + 0x22); this->actionFunc = func_80ABF0CC; - } else if ((this->actor.xzDistToLink < (50.0f + this->unk_15C) && - ((fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 40.0f)))) { + } else if ((this->actor.xzDistToPlayer < (50.0f + this->unk_15C) && + ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f)))) { this->unk_15A = 0; player->unk_6A8 = &this->actor; } @@ -194,8 +194,8 @@ void func_80ABF28C(EnOkarinaTag* this, GlobalContext* globalCtx) { this->actor.flags &= ~1; } else if (((this->unk_150 != 4) || !(gSaveContext.eventChkInf[4] & 0x800)) && ((this->unk_150 != 6) || !(gSaveContext.eventChkInf[1] & 0x2000)) && - (this->actor.xzDistToLink < (90.0f + this->unk_15C)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 80.0f)) { + (this->actor.xzDistToPlayer < (90.0f + this->unk_15C)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) { if (player->stateFlags2 & 0x1000000) { switch (this->unk_150) { case 1: @@ -219,8 +219,8 @@ void func_80ABF28C(EnOkarinaTag* this, GlobalContext* globalCtx) { } player->stateFlags2 |= 0x800000; this->actionFunc = func_80ABF4C8; - } else if ((this->actor.xzDistToLink < (50.0f + this->unk_15C)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 40.0f)) { + } else if ((this->actor.xzDistToPlayer < (50.0f + this->unk_15C)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 40.0f)) { this->unk_15A = 0; player->stateFlags2 |= 0x800000; } @@ -285,9 +285,9 @@ void func_80ABF708(EnOkarinaTag* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx) != 0) { this->actionFunc = func_80ABF7CC; } else { - yawDiff = this->actor.yawTowardsLink - this->actor.posRot.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; this->unk_15A++; - if (!(this->actor.xzDistToLink > 120.0f)) { + if (!(this->actor.xzDistToPlayer > 120.0f)) { if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { // "This poem is dedicated to the memory of the dearly departed members of the Royal Family." this->actor.textId = 0x5021; @@ -322,13 +322,13 @@ void EnOkarinaTag_Update(Actor* thisx, GlobalContext* globalCtx) { if (BREG(0) != 0) { if (this->unk_15A != 0) { if (!(this->unk_15A & 1)) { - 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, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 120, 120, 120, 255, 4, globalCtx->state.gfxCtx); } } else { - 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } 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 366b7e5103..d30920238a 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -22,7 +22,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx); const ActorInit En_Okuta_InitVars = { ACTOR_EN_OKUTA, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_OKUTA, sizeof(EnOkuta), @@ -120,7 +120,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 66, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 6500, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 6500, ICHAIN_STOP), }; void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -141,24 +141,24 @@ void EnOkuta_Init(Actor* thisx, GlobalContext* globalCtx) { if ((this->numShots == 0xFF) || (this->numShots == 0)) { this->numShots = 1; } - thisx->groundY = - BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &thisx->floorPoly, &sp30, thisx, &thisx->posRot.pos); + thisx->floorHeight = + BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &thisx->floorPoly, &sp30, thisx, &thisx->world.pos); //! @bug calls WaterBox_GetSurfaceImpl directly - if (!WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, thisx->posRot.pos.x, thisx->posRot.pos.z, &ySurface, + if (!WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, thisx->world.pos.x, thisx->world.pos.z, &ySurface, &outWaterBox) || - (ySurface <= thisx->groundY)) { + (ySurface <= thisx->floorHeight)) { Actor_Kill(thisx); } else { - thisx->initPosRot.pos.y = ySurface; + thisx->home.pos.y = ySurface; } EnOkuta_SetupWaitToAppear(this); } else { - ActorShape_Init(&thisx->shape, 1100.0f, ActorShadow_DrawFunc_Circle, 18.0f); + ActorShape_Init(&thisx->shape, 1100.0f, ActorShadow_DrawCircle, 18.0f); thisx->flags &= ~1; thisx->flags |= 0x10; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sProjectileColliderInit); - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, thisx, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_PROP); this->timer = 30; thisx->shape.rot.y = 0; this->actionFunc = EnOkuta_ProjectileFly; @@ -176,7 +176,7 @@ void EnOkuta_SpawnBubbles(EnOkuta* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 10; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, -10.0f, 10.0f, 30.0f, 0.25f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, -10.0f, 10.0f, 30.0f, 0.25f); } } @@ -189,17 +189,17 @@ void EnOkuta_SpawnDust(Vec3f* pos, Vec3f* velocity, s16 scaleStep, GlobalContext } void EnOkuta_SpawnSplash(EnOkuta* this, GlobalContext* globalCtx) { - EffectSsGSplash_Spawn(globalCtx, &this->actor.initPosRot.pos, NULL, NULL, 0, 1300); + EffectSsGSplash_Spawn(globalCtx, &this->actor.home.pos, NULL, NULL, 0, 1300); } void EnOkuta_SpawnRipple(EnOkuta* this, GlobalContext* globalCtx) { Vec3f pos; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.initPosRot.pos.y; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.home.pos.y; + pos.z = this->actor.world.pos.z; if ((globalCtx->gameplayFrames % 7) == 0 && - ((this->actionFunc != EnOkuta_Shoot) || ((this->actor.posRot.pos.y - this->actor.initPosRot.pos.y) < 50.0f))) { + ((this->actionFunc != EnOkuta_Shoot) || ((this->actor.world.pos.y - this->actor.home.pos.y) < 50.0f))) { EffectSsGRipple_Spawn(globalCtx, &pos, 250, 650, 0); } } @@ -208,12 +208,12 @@ void EnOkuta_SetupWaitToAppear(EnOkuta* this) { this->actor.draw = NULL; this->actor.flags &= ~1; this->actionFunc = EnOkuta_WaitToAppear; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; + this->actor.world.pos.y = this->actor.home.pos.y; } void EnOkuta_SetupAppear(EnOkuta* this, GlobalContext* globalCtx) { this->actor.draw = EnOkuta_Draw; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->actor.flags |= 1; Animation_PlayOnce(&this->skelAnime, &D_06003C64); EnOkuta_SpawnBubbles(this, globalCtx); @@ -236,7 +236,7 @@ void EnOkuta_SetupShoot(EnOkuta* this, GlobalContext* globalCtx) { if (this->actionFunc != EnOkuta_Shoot) { this->timer = this->numShots; } - this->jumpHeight = this->actor.yDistToLink + 20.0f; + this->jumpHeight = this->actor.yDistToPlayer + 20.0f; this->jumpHeight = CLAMP_MIN(this->jumpHeight, 10.0f); if (this->jumpHeight > 50.0f) { EnOkuta_SpawnSplash(this, globalCtx); @@ -274,14 +274,14 @@ void EnOkuta_SpawnProjectile(EnOkuta* this, GlobalContext* globalCtx) { f32 sin = Math_SinS(this->actor.shape.rot.y); f32 cos = Math_CosS(this->actor.shape.rot.y); - pos.x = this->actor.posRot.pos.x + (25.0f * sin); - pos.y = this->actor.posRot.pos.y - 6.0f; - pos.z = this->actor.posRot.pos.z + (25.0f * cos); + pos.x = this->actor.world.pos.x + (25.0f * sin); + pos.y = this->actor.world.pos.y - 6.0f; + pos.z = this->actor.world.pos.z + (25.0f * cos); if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OKUTA, pos.x, pos.y, pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 0x10) != NULL) { - pos.x = this->actor.posRot.pos.x + (40.0f * sin); - pos.z = this->actor.posRot.pos.z + (40.0f * cos); - pos.y = this->actor.posRot.pos.y; + pos.x = this->actor.world.pos.x + (40.0f * sin); + pos.z = this->actor.world.pos.z + (40.0f * cos); + pos.y = this->actor.world.pos.y; velocity.x = 1.5f * sin; velocity.y = 0.0f; velocity.z = 1.5f * cos; @@ -291,8 +291,8 @@ void EnOkuta_SpawnProjectile(EnOkuta* this, GlobalContext* globalCtx) { } void EnOkuta_WaitToAppear(EnOkuta* this, GlobalContext* globalCtx) { - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; - if ((this->actor.xzDistToLink < 480.0f) && (this->actor.xzDistToLink > 200.0f)) { + this->actor.world.pos.y = this->actor.home.pos.y; + if ((this->actor.xzDistToPlayer < 480.0f) && (this->actor.xzDistToPlayer > 200.0f)) { EnOkuta_SetupAppear(this, globalCtx); } } @@ -301,7 +301,7 @@ void EnOkuta_Appear(EnOkuta* this, GlobalContext* globalCtx) { s32 pad; if (SkelAnime_Update(&this->skelAnime)) { - if (this->actor.xzDistToLink < 160.0f) { + if (this->actor.xzDistToPlayer < 160.0f) { EnOkuta_SetupHide(this); } else { EnOkuta_SetupWaitToShoot(this); @@ -325,7 +325,7 @@ void EnOkuta_Appear(EnOkuta* this, GlobalContext* globalCtx) { void EnOkuta_Hide(EnOkuta* this, GlobalContext* globalCtx) { s32 pad; - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 30.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 30.0f); if (SkelAnime_Update(&this->skelAnime)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_BUBLE); EnOkuta_SpawnBubbles(this, globalCtx); @@ -345,7 +345,7 @@ void EnOkuta_WaitToShoot(EnOkuta* this, GlobalContext* globalCtx) { s16 temp_v0_2; s32 phi_v1; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y; + this->actor.world.pos.y = this->actor.home.pos.y; SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f)) { if (this->timer != 0) { @@ -355,19 +355,19 @@ void EnOkuta_WaitToShoot(EnOkuta* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.5f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_FLOAT); } - if (this->actor.xzDistToLink < 160.0f || this->actor.xzDistToLink > 560.0f) { + if (this->actor.xzDistToPlayer < 160.0f || this->actor.xzDistToPlayer > 560.0f) { EnOkuta_SetupHide(this); } else { - temp_v0_2 = Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C, 0x38E); + temp_v0_2 = Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C, 0x38E); phi_v1 = ABS(temp_v0_2); - if ((phi_v1 < 0x38E) && (this->timer == 0) && (this->actor.yDistToLink < 200.0f)) { + if ((phi_v1 < 0x38E) && (this->timer == 0) && (this->actor.yDistToPlayer < 200.0f)) { EnOkuta_SetupShoot(this, globalCtx); } } } void EnOkuta_Shoot(EnOkuta* this, GlobalContext* globalCtx) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, 0x71C); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x71C); if (SkelAnime_Update(&this->skelAnime)) { if (this->timer != 0) { this->timer--; @@ -381,8 +381,7 @@ void EnOkuta_Shoot(EnOkuta* this, GlobalContext* globalCtx) { f32 curFrame = this->skelAnime.curFrame; if (curFrame < 13.0f) { - this->actor.posRot.pos.y = - (sinf((0.08333f * M_PI) * curFrame) * this->jumpHeight) + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = (sinf((0.08333f * M_PI) * curFrame) * this->jumpHeight) + this->actor.home.pos.y; } if (Animation_OnFrame(&this->skelAnime, 6.0f)) { EnOkuta_SpawnProjectile(this, globalCtx); @@ -394,7 +393,7 @@ void EnOkuta_Shoot(EnOkuta* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_OCTAROCK_LAND); } } - if (this->actor.xzDistToLink < 160.0f) { + if (this->actor.xzDistToPlayer < 160.0f) { EnOkuta_SetupHide(this); } } @@ -403,7 +402,7 @@ void EnOkuta_WaitToDie(EnOkuta* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { EnOkuta_SetupDie(this); } - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 5.0f); } void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) { @@ -417,11 +416,11 @@ void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { this->timer++; } - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 5.0f); if (this->timer == 5) { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 40.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 40.0f; + pos.z = this->actor.world.pos.z; velocity.x = 0.0f; velocity.y = -0.5f; velocity.z = 0.0f; @@ -440,13 +439,13 @@ void EnOkuta_Die(EnOkuta* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, (((this->timer - 5) * 0.04f) + 0.8f) * 0.01f); } else { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) { - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EN_OCTAROCK_BUBLE); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x70); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_BUBLE); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x70); for (i = 0; i < 20; i++) { velocity.x = (Rand_ZeroOne() - 0.5f) * 7.0f; velocity.y = Rand_ZeroOne() * 7.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 7.0f; - EffectSsDtBubble_SpawnCustomColor(globalCtx, &this->actor.posRot.pos, &velocity, &accel, &primColor, + EffectSsDtBubble_SpawnCustomColor(globalCtx, &this->actor.world.pos, &velocity, &accel, &primColor, &envColor, Rand_S16Offset(100, 50), 25, 0); } Actor_Kill(&this->actor); @@ -467,13 +466,13 @@ void EnOkuta_Freeze(EnOkuta* this, GlobalContext* globalCtx) { } if ((this->timer >= 64) && (this->timer & 1)) { temp_v1 = (this->timer - 64) >> 1; - pos.y = (this->actor.posRot.pos.y - 32.0f) + (8.0f * (8 - temp_v1)); - pos.x = this->actor.posRot.pos.x + ((temp_v1 & 2) ? 10.0f : -10.0f); - pos.z = this->actor.posRot.pos.z + ((temp_v1 & 1) ? 10.0f : -10.0f); + pos.y = (this->actor.world.pos.y - 32.0f) + (8.0f * (8 - temp_v1)); + pos.x = this->actor.world.pos.x + ((temp_v1 & 2) ? 10.0f : -10.0f); + pos.z = this->actor.world.pos.z + ((temp_v1 & 1) ? 10.0f : -10.0f); EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &pos, 150, 150, 150, 250, 235, 245, 255, (Rand_ZeroOne() * 0.2f) + 1.9f); } - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.5f, 5.0f); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.5f, 5.0f); } void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { @@ -485,7 +484,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { if (this->timer == 0) { this->actor.gravity = -1.0f; } - this->actor.initPosRot.rot.z += 0x1554; + this->actor.home.rot.z += 0x1554; if (this->actor.bgCheckFlags & 0x20) { this->actor.gravity = -1.0f; this->actor.speedXZ -= 0.1f; @@ -493,7 +492,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { } if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1) || (this->collider.base.atFlags & AT_HIT) || this->collider.base.acFlags & AC_HIT || this->collider.base.ocFlags1 & OC1_HIT || - this->actor.groundY == BGCHECK_Y_MIN) { + this->actor.floorHeight == BGCHECK_Y_MIN) { if ((player->currentShield == PLAYER_SHIELD_DEKU || (player->currentShield == PLAYER_SHIELD_HYLIAN && LINK_IS_ADULT)) && this->collider.base.atFlags & AT_HIT && this->collider.base.atFlags & AT_TYPE_ENEMY && @@ -502,14 +501,14 @@ void EnOkuta_ProjectileFly(EnOkuta* this, GlobalContext* globalCtx) { this->collider.base.atFlags |= AT_TYPE_PLAYER; this->collider.info.toucher.dmgFlags = 2; func_800D20CC(&player->shieldMf, &sp40, 0); - this->actor.posRot.rot.y = sp40.y + 0x8000; + this->actor.world.rot.y = sp40.y + 0x8000; this->timer = 30; } else { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 11.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 11.0f; + pos.z = this->actor.world.pos.z; EffectSsHahen_SpawnBurst(globalCtx, &pos, 6.0f, 0, 1, 2, 15, 7, 10, D_06003380); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EN_OCTAROCK_ROCK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK); Actor_Kill(&this->actor); } } else if (this->timer == -300) { @@ -591,15 +590,15 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->stateFlags1 & 0x300000C0)) { if (this->actor.params == 0) { EnOkuta_ColliderCheck(this, globalCtx2); - if (!WaterBox_GetSurfaceImpl(globalCtx2, &globalCtx2->colCtx, this->actor.posRot.pos.x, - this->actor.posRot.pos.z, &ySurface, &outWaterBox) || - (ySurface < this->actor.groundY)) { + if (!WaterBox_GetSurfaceImpl(globalCtx2, &globalCtx2->colCtx, this->actor.world.pos.x, + this->actor.world.pos.z, &ySurface, &outWaterBox) || + (ySurface < this->actor.floorHeight)) { if (this->actor.colChkInfo.health != 0) { Actor_Kill(&this->actor); return; } } else { - this->actor.initPosRot.pos.y = ySurface; + this->actor.home.pos.y = ySurface; } } this->actionFunc(this, globalCtx2); @@ -611,27 +610,25 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { } else { sp34 = false; Actor_MoveForward(&this->actor); - Math_Vec3f_Copy(&sp38, &this->actor.posRot.pos); - func_8002E4B4(globalCtx2, &this->actor, 10.0f, 15.0f, 30.0f, 5); + Math_Vec3f_Copy(&sp38, &this->actor.world.pos); + Actor_UpdateBgCheckInfo(globalCtx2, &this->actor, 10.0f, 15.0f, 30.0f, 5); if ((this->actor.bgCheckFlags & 8) && - SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.wallPoly, - this->actor.wallPolySource)) { + SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.wallPoly, this->actor.wallBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~8; } if ((this->actor.bgCheckFlags & 1) && - SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.floorPoly, - this->actor.floorPolySource)) { + SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.floorPoly, this->actor.floorBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~1; } if (sp34 && !(this->actor.bgCheckFlags & 9)) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &sp38); + Math_Vec3f_Copy(&this->actor.world.pos, &sp38); } } Collider_UpdateCylinder(&this->actor, &this->collider); if ((this->actionFunc == EnOkuta_Appear) || (this->actionFunc == EnOkuta_Hide)) { - this->collider.dim.pos.y = this->actor.posRot.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y); + this->collider.dim.pos.y = this->actor.world.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y); this->collider.dim.radius = sOctorockColliderInit.dim.radius * this->actor.scale.x * 100.0f; } if (this->actor.params == 0x10) { @@ -645,7 +642,7 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 15.0f); + Actor_SetFocus(&this->actor, 15.0f); if ((this->actor.params == 0) && (this->actor.draw != NULL)) { EnOkuta_SpawnRipple(this, globalCtx2); } @@ -725,7 +722,7 @@ void EnOkuta_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1653); Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY); - Matrix_RotateZ(this->actor.initPosRot.rot.z * (M_PI / 0x8000), MTXMODE_APPLY); + Matrix_RotateZ(this->actor.home.rot.z * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_okuta.c", 1657), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_06003380); 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 7c023441c0..ebcf348718 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -30,7 +30,7 @@ extern UNK_TYPE D_0600FEF0; /* const ActorInit En_Ossan_InitVars = { ACTOR_EN_OSSAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnOssan), 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 65b098cb0c..20c679581d 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -76,7 +76,7 @@ typedef enum { const ActorInit En_Owl_InitVars = { ACTOR_EN_OWL, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OWL, sizeof(EnOwl), @@ -120,7 +120,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { s32 switchFlag; Actor_ProcessInitChain(&this->actor, sOwlInitChain); - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C0E8, &D_060015CC, this->jointTable, this->morphTable, 21); SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &D_060100B0, &D_0600C8A0, this->jointTable2, this->morphTable2, 16); @@ -128,7 +128,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sOwlCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.minVelocityY = -10.0f; - this->actor.unk_4C = 500.0f; + this->actor.targetArrowOffset = 500.0f; EnOwl_ChangeMode(this, EnOwl_WaitDefault, func_80ACC540, &this->skelAnime2, &D_0600C8A0, 0.0f); this->actionFlags = this->unk_406 = this->unk_409 = 0; this->unk_405 = 4; @@ -150,7 +150,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { } this->unk_3EE = 0; - this->unk_400 = this->actor.posRot.rot.y; + this->unk_400 = this->actor.world.rot.y; switch (owlType) { case OWL_DEFAULT: @@ -254,8 +254,8 @@ void EnOwl_LookAtLink(EnOwl* this, GlobalContext* globalCtx) { s16 yaw; Player* player = PLAYER; - yaw = Math_Vec3f_Yaw(&this->actor.posRot.pos, &player->actor.posRot.pos); - this->actor.posRot.rot.y = yaw; + yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos); + this->actor.world.rot.y = yaw; this->actor.shape.rot.y = yaw; } @@ -286,7 +286,7 @@ s32 EnOwl_CheckInitTalk(EnOwl* this, GlobalContext* globalCtx, u16 textId, f32 t } else { this->actor.textId = textId; distCheck = (flags & 2) ? 200.0f : 1000.0f; - if (this->actor.xzDistToLink < targetDist) { + if (this->actor.xzDistToPlayer < targetDist) { this->actor.flags |= 0x10000; func_8002F1C4(&this->actor, globalCtx, targetDist, distCheck, 0); } @@ -300,7 +300,7 @@ s32 func_80ACA558(EnOwl* this, GlobalContext* globalCtx, u16 textId) { return true; } else { this->actor.textId = textId; - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { func_8002F1C4(&this->actor, globalCtx, 350.0f, 1000.0f, 0); } @@ -824,7 +824,7 @@ void EnOwl_WaitDefault(EnOwl* this, GlobalContext* globalCtx) { func_80ACD130(this, globalCtx, 7); func_80ACBAB8(this, globalCtx); } else { - this->actor.posRot.rot.z = globalCtx->csCtx.npcActions[7]->urot.y; + this->actor.world.rot.z = globalCtx->csCtx.npcActions[7]->urot.y; } } @@ -861,18 +861,18 @@ void func_80ACBAB8(EnOwl* this, GlobalContext* globalCtx) { void func_80ACBC0C(EnOwl* this, GlobalContext* globalCtx) { this->actor.flags |= 0x20; - if (this->actor.xzDistToLink > 6000.0f && !(this->actionFlags & 0x80)) { + if (this->actor.xzDistToPlayer > 6000.0f && !(this->actionFlags & 0x80)) { Actor_Kill(&this->actor); } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x80, 0x40); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x80, 0x40); + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actor.speedXZ < 16.0f) { this->actor.speedXZ += 0.5f; } - if ((this->unk_3F8 + 1000.0f) < this->actor.posRot.pos.y) { + if ((this->unk_3F8 + 1000.0f) < this->actor.world.pos.y) { if (this->actor.velocity.y > 0.0f) { this->actor.velocity.y -= 0.4f; } @@ -885,8 +885,8 @@ void func_80ACBC0C(EnOwl* this, GlobalContext* globalCtx) { void func_80ACBD4C(EnOwl* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame > 10.0f) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x400, 0x40); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x400, 0x40); + this->actor.shape.rot.y = this->actor.world.rot.y; } if (this->skelAnime.curFrame > 45.0f) { @@ -916,12 +916,12 @@ void func_80ACBEA0(EnOwl* this, GlobalContext* GlobalContext) { if (this->actionFlags & 1) { this->unk_3FE = 3; EnOwl_ChangeMode(this, func_80ACBD4C, func_80ACC540, &this->skelAnime, &D_06001168, 0.0f); - this->unk_3F8 = this->actor.posRot.pos.y; + this->unk_3F8 = this->actor.world.pos.y; this->actor.velocity.y = 2.0f; if (this->actionFlags & 0x40) { - this->unk_400 = this->actor.posRot.rot.y + 0x4000; + this->unk_400 = this->actor.world.rot.y + 0x4000; } else { - this->unk_400 = this->actor.posRot.rot.y - 0x4000; + this->unk_400 = this->actor.world.rot.y - 0x4000; } } @@ -929,8 +929,8 @@ void func_80ACBEA0(EnOwl* this, GlobalContext* GlobalContext) { } void func_80ACBF50(EnOwl* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x384, 0x258); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x384, 0x258); + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->actionFlags & 1) { EnOwl_ChangeMode(this, func_80ACBC0C, func_80ACC460, &this->skelAnime, &D_060015CC, 0.0f); @@ -947,10 +947,10 @@ void func_80ACC00C(EnOwl* this, GlobalContext* globalCtx) { s32 temp_v0; s32 temp_v0_2; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x384, 0x258); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x384, 0x258); + this->actor.shape.rot.y = this->actor.world.rot.y; - if (this->actor.xzDistToLink < 50.0f) { + if (this->actor.xzDistToPlayer < 50.0f) { if (!Gameplay_InCsMode(globalCtx)) { owlType = (this->actor.params & 0xFC0) >> 6; osSyncPrintf(VT_FGCOL(CYAN)); @@ -1001,8 +1001,8 @@ void func_80ACC23C(EnOwl* this, GlobalContext* globalCtx) { this->actor.speedXZ = 1.5f; } else { this->actor.speedXZ = 0.0f; - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_400, 2, 0x384, 0x258); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_400, 2, 0x384, 0x258); + this->actor.shape.rot.y = this->actor.world.rot.y; } if (this->skelAnime.curFrame >= 37.0f) { @@ -1021,7 +1021,7 @@ void func_80ACC30C(EnOwl* this, GlobalContext* globalCtx) { if (this->actionFlags & 1) { this->unk_3FE = 3; EnOwl_ChangeMode(this, func_80ACC23C, func_80ACC540, &this->skelAnime, &D_06001168, 0.0f); - this->unk_3F8 = this->actor.posRot.pos.y; + this->unk_3F8 = this->actor.world.pos.y; this->actor.velocity.y = 0.2f; } @@ -1109,7 +1109,7 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 5); this->unk_410(this); this->actionFlags &= ~8; this->actionFunc(this, globalCtx); @@ -1337,7 +1337,7 @@ void EnOwl_PostLimbUpdate(GlobalContext* globalCtx, s32 limbIndex, Gfx** gfx, Ve vec.x = 1400.0f; } if (limbIndex == 3) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } @@ -1370,8 +1370,8 @@ void func_80ACD130(EnOwl* this, GlobalContext* globalCtx, s32 idx) { startPos.x = globalCtx->csCtx.npcActions[idx]->startPos.x; startPos.y = globalCtx->csCtx.npcActions[idx]->startPos.y; startPos.z = globalCtx->csCtx.npcActions[idx]->startPos.z; - this->actor.posRot.pos = startPos; - this->actor.posRot.rot.y = this->actor.shape.rot.y = globalCtx->csCtx.npcActions[idx]->rot.y; + this->actor.world.pos = startPos; + this->actor.world.rot.y = this->actor.shape.rot.y = globalCtx->csCtx.npcActions[idx]->rot.y; this->actor.shape.rot.z = globalCtx->csCtx.npcActions[idx]->urot.z; } @@ -1389,14 +1389,14 @@ f32 func_80ACD1C4(GlobalContext* globalCtx, s32 idx) { void func_80ACD220(EnOwl* this, Vec3f* arg1, f32 arg2) { Vec3f rpy; - rpy.x = (arg1->x - this->actor.posRot.pos.x) * arg2; - rpy.y = (arg1->y - this->actor.posRot.pos.y) * arg2; - rpy.z = (arg1->z - this->actor.posRot.pos.z) * arg2; + rpy.x = (arg1->x - this->actor.world.pos.x) * arg2; + rpy.y = (arg1->y - this->actor.world.pos.y) * arg2; + rpy.z = (arg1->z - this->actor.world.pos.z) * arg2; Math_StepToF(&this->actor.velocity.y, rpy.y, 1.0f); this->actor.speedXZ = sqrtf(SQ(rpy.x) + SQ(rpy.z)); - this->actor.posRot.rot.y = Math_Vec3f_Yaw(&this->actor.posRot.pos, arg1); - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.world.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, arg1); + this->actor.shape.rot.y = this->actor.world.rot.y; } void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) { @@ -1409,11 +1409,11 @@ void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) { pos.x = globalCtx->csCtx.npcActions[7]->startPos.x; pos.y = globalCtx->csCtx.npcActions[7]->startPos.y; pos.z = globalCtx->csCtx.npcActions[7]->startPos.z; - angle = (s16)globalCtx->csCtx.npcActions[7]->rot.y - this->actor.posRot.rot.z; + angle = (s16)globalCtx->csCtx.npcActions[7]->rot.y - this->actor.world.rot.z; if (angle < 0) { angle += 0x10000; } - angle = (s16)((t * angle) + this->actor.posRot.rot.z); + angle = (s16)((t * angle) + this->actor.world.rot.z); angle = (u16)angle; if (this->actionFlags & 4) { phi_f2 = globalCtx->csCtx.npcActions[7]->urot.x; @@ -1424,7 +1424,7 @@ void func_80ACD2CC(EnOwl* this, GlobalContext* globalCtx) { pos.x -= Math_SinS(angle) * phi_f2; pos.z += Math_CosS(angle) * phi_f2; this->unk_3F8 = phi_f2; - this->actor.posRot.pos = pos; + this->actor.world.pos = pos; this->actor.draw = &EnOwl_Draw; this->actionFlags &= ~4; this->actor.speedXZ = 0.0f; 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 90cdead6e6..3732ebd3c8 100644 --- a/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -17,7 +17,7 @@ void EnPart_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Part_InitVars = { ACTOR_EN_PART, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnPart), @@ -46,7 +46,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { f32 sign = 1.0f; this->action = 1; - this->actor.posRot.rot.y = Rand_ZeroOne() * 20000.0f; + this->actor.world.rot.y = Rand_ZeroOne() * 20000.0f; switch (this->actor.params) { case 0: @@ -60,14 +60,14 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { this->timer = 400; case 12: this->actor.speedXZ = Rand_CenteredFloat(6.0f); - this->actor.initPosRot.pos = this->actor.posRot.pos; + this->actor.home.pos = this->actor.world.pos; this->timer += 60; this->actor.velocity.y = Rand_ZeroOne() * 5.0f + 4.0f; this->actor.gravity = -0.6f - Rand_ZeroOne() * 0.5f; this->rotZSpeed = 0.15f; break; case 14: - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0x8001, 0, -1); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1); case 1: case 4: case 9: @@ -79,7 +79,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { this->rotZSpeed = 0.15f; break; case 11: - EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 0x8001, 0, -1); + EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &this->actor.world.pos, 40, 0x8001, 0, -1); case 3: this->actor.speedXZ = (Rand_ZeroOne() - 0.5f) * 3.0f; this->timer = (s16)(Rand_ZeroOne() * 17.0f) + 10; @@ -91,7 +91,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { case 6: case 7: case 8: - this->actor.posRot.rot.y = this->actor.parent->shape.rot.y; + this->actor.world.rot.y = this->actor.parent->shape.rot.y; if (this->displayList == D_06015380) { sign = -1.0f; } @@ -99,7 +99,7 @@ void func_80ACDDE8(EnPart* this, GlobalContext* globalCtx) { this->actor.speedXZ = 6.0f * sign; this->actor.gravity = -1.2f; this->rotZSpeed = 0.15f * sign; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->timer = 18; break; } @@ -113,9 +113,9 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; if ((this->actor.params == 12) || (this->actor.params == 13)) { - func_8002E4B4(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 0x1D); - if ((this->actor.bgCheckFlags & 1) || (this->actor.posRot.pos.y <= this->actor.groundY)) { + if ((this->actor.bgCheckFlags & 1) || (this->actor.world.pos.y <= this->actor.floorHeight)) { this->action = 4; this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; @@ -131,22 +131,22 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) { case 9: case 10: case 14: - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, (s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 255, 0, 1, 9, true); break; case 3: case 11: - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, (s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); break; case 4: for (i = 7; i >= 0; i--) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(60.0f); - pos.y = this->actor.posRot.pos.y + this->actor.shape.unk_08 * this->actor.scale.y + + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(60.0f); + pos.y = this->actor.world.pos.y + this->actor.shape.yOffset * this->actor.scale.y + Rand_CenteredFloat(50.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(60.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(60.0f); velocity.y = Rand_ZeroOne() + 1.0f; EffectSsDtBubble_SpawnColorProfile(globalCtx, &pos, &velocity, &accel, Rand_S16Offset(80, 100), 25, 0, true); @@ -157,9 +157,9 @@ void func_80ACE13C(EnPart* this, GlobalContext* globalCtx) { case 7: case 8: for (i = 4; i >= 0; i--) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(25.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(40.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(25.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(25.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(40.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(25.0f); EffectSsDeadDb_Spawn(globalCtx, &pos, &zeroVec, &zeroVec, 40, 7, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); } @@ -188,7 +188,7 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) { Vec3f velocity = { 0.0f, 8.0f, 0.0f }; Vec3f accel = { 0.0f, -1.5f, 0.0f }; - if (sqrt(this->actor.xyzDistToLinkSq) <= 40.0f) { + if (sqrt(this->actor.xyzDistToPlayerSq) <= 40.0f) { u8 prevInvincibilityTimer = player->invincibilityTimer; if (player->invincibilityTimer <= 0) { if (player->invincibilityTimer <= -40) { @@ -198,15 +198,15 @@ void func_80ACE5C8(EnPart* this, GlobalContext* globalCtx) { globalCtx->damagePlayer(globalCtx, -8); } } - func_8002F71C(globalCtx, this->actor.parent, (650.0f - this->actor.parent->xzDistToLink) * 0.04f + 4.0f, - this->actor.parent->posRot.rot.y, 8.0f); + func_8002F71C(globalCtx, this->actor.parent, (650.0f - this->actor.parent->xzDistToPlayer) * 0.04f + 4.0f, + this->actor.parent->world.rot.y, 8.0f); player->invincibilityTimer = prevInvincibilityTimer; this->timer = 1; } - func_80033480(globalCtx, &this->actor.posRot.pos, 0.0f, 1, 300, 150, 1); + func_80033480(globalCtx, &this->actor.world.pos, 0.0f, 1, 300, 150, 1); velocity.x = Rand_CenteredFloat(16.0f); - EffectSsHahen_Spawn(globalCtx, &this->actor.posRot.pos, &velocity, &accel, 20, + EffectSsHahen_Spawn(globalCtx, &this->actor.world.pos, &velocity, &accel, 20, (s32)((Rand_ZeroOne() * 5.0f + 12.0f) * 2), -1, 10, NULL); Audio_PlayActorSound2(&this->actor, NA_SE_EN_MONBLIN_GNDWAVE - SFX_FLAG); } @@ -216,19 +216,19 @@ void func_80ACE7E8(EnPart* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; if ((this->actor.parent == NULL) || (this->actor.parent->update == NULL)) { - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, (s16)(this->actor.scale.y * 100.0f) * 40, 7, 255, 255, 255, 255, 0, 255, 0, 1, 9, true); Actor_Kill(&this->actor); return; } if (this->timer == 0) { - f32 diffsSum = Math_SmoothStepToF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 1.0f, 5.0f, 0.0f); - diffsSum += Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 1.0f, 5.0f, 0.0f); - diffsSum += Math_SmoothStepToF(&this->actor.posRot.pos.z, this->actor.initPosRot.pos.z, 1.0f, 5.0f, 0.0f); + f32 diffsSum = Math_SmoothStepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f, 5.0f, 0.0f); + diffsSum += Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f, 5.0f, 0.0f); + diffsSum += Math_SmoothStepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f, 5.0f, 0.0f); diffsSum += Math_SmoothStepToF(&this->rotZ, 0.0f, 1.0f, 0.25f, 0.0f); if (diffsSum == 0.0f) { - this->actor.parent->initPosRot.rot.x--; + this->actor.parent->home.rot.x--; this->timer--; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_DAMAGE); } @@ -251,7 +251,7 @@ void EnPart_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if ((this->actor.params > 4 && this->actor.params < 9) || this->actor.params < 0) { - func_8002E4B4(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 15.0f, 0.0f, 5); if (this->actor.params >= 0) { Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); if (thisx->bgCheckFlags & 1) { 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 5b79062497..5385b049d0 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -18,7 +18,7 @@ extern UNK_TYPE D_06001C80; /* const ActorInit En_Peehat_InitVars = { ACTOR_EN_PEEHAT, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_PEEHAT, sizeof(EnPeehat), 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 419a4ce52e..7603bf80d7 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 @@ -22,7 +22,7 @@ void EnPoDesert_Disappear(EnPoDesert* this, GlobalContext* globalCtx); const ActorInit En_Po_Desert_InitVars = { ACTOR_EN_PO_DESERT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_PO_FIELD, sizeof(EnPoDesert), @@ -55,7 +55,7 @@ static ColliderCylinderInit sColliderInit = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x5C, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 3200, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), }; extern SkeletonHeader D_06006A30; @@ -78,12 +78,12 @@ void EnPoDesert_Init(Actor* thisx, GlobalContext* globalCtx) { this->lightColor.b = 210; this->lightColor.a = 255; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 200); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 37.0f); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 200); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 37.0f); this->currentPathPoint = 1; this->actor.params = (this->actor.params >> 8) & 0xFF; - this->targetY = this->actor.posRot.pos.y; + this->targetY = this->actor.world.pos.y; EnPoDesert_SetNextPathPoint(this, globalCtx); } @@ -100,13 +100,13 @@ void EnPoDesert_SetNextPathPoint(EnPoDesert* this, GlobalContext* globalCtx) { Animation_MorphToLoop(&this->skelAnime, &D_06001360, -6.0f); pathPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->currentPathPoint]; - this->actor.initPosRot.pos.x = pathPoint->x; - this->actor.initPosRot.pos.y = pathPoint->y; - this->actor.initPosRot.pos.z = pathPoint->z; - this->initDistToNextPoint = func_8002DBB0(&this->actor, &this->actor.initPosRot.pos); + this->actor.home.pos.x = pathPoint->x; + this->actor.home.pos.y = pathPoint->y; + this->actor.home.pos.z = pathPoint->z; + this->initDistToNextPoint = Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos); this->initDistToNextPoint = CLAMP_MIN(this->initDistToNextPoint, 1.0f); this->currentPathPoint++; - this->yDiff = this->actor.initPosRot.pos.y - this->actor.posRot.pos.y; + this->yDiff = this->actor.home.pos.y - this->actor.world.pos.y; this->actor.speedXZ = 0.0f; if (path->count == this->currentPathPoint) { this->currentPathPoint = 0; @@ -134,12 +134,12 @@ void EnPoDesert_UpdateSpeedModifier(EnPoDesert* this) { if (this->speedModifier != 0) { this->speedModifier--; } - this->actor.posRot.pos.y = Math_SinS(this->speedModifier * 0x800) * 13.0f + this->targetY; + this->actor.world.pos.y = Math_SinS(this->speedModifier * 0x800) * 13.0f + this->targetY; } void EnPoDesert_WaitForPlayer(EnPoDesert* this, GlobalContext* globalCtx) { func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); - if (this->actor.xzDistToLink < 200.0f && (this->currentPathPoint != 2 || globalCtx->actorCtx.unk_03)) { + if (this->actor.xzDistToPlayer < 200.0f && (this->currentPathPoint != 2 || globalCtx->actorCtx.unk_03)) { if (this->currentPathPoint == 2) { if (Gameplay_InCsMode(globalCtx)) { this->actor.shape.rot.y += 0x800; @@ -160,17 +160,17 @@ void EnPoDesert_MoveToNextPoint(EnPoDesert* this, GlobalContext* globalCtx) { this->actionTimer--; } temp_f20 = sinf(this->actionTimer * (M_PI / 20.0f)) * 5.0f; - this->actor.posRot.pos.x += temp_f20 * Math_CosS(this->actor.shape.rot.y); - this->actor.posRot.pos.z += temp_f20 * Math_SinS(this->actor.shape.rot.y); + this->actor.world.pos.x += temp_f20 * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.z += temp_f20 * Math_SinS(this->actor.shape.rot.y); if (this->actionTimer == 0) { this->actionTimer = 40; } - temp_f20 = func_8002DBB0(&this->actor, &this->actor.initPosRot.pos); - this->actor.posRot.rot.y = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); - Math_ApproachS(&this->actor.shape.rot.y, this->actor.posRot.rot.y + 0x8000, 5, 0x400); + temp_f20 = Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos); + this->actor.world.rot.y = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y + 0x8000, 5, 0x400); this->actor.speedXZ = sinf(this->speedModifier * (M_PI / 32.0f)) * 2.5f + 5.5f; func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG); - this->targetY = this->actor.initPosRot.pos.y - ((temp_f20 * this->yDiff) / this->initDistToNextPoint); + this->targetY = this->actor.home.pos.y - ((temp_f20 * this->yDiff) / this->initDistToNextPoint); if (temp_f20 < 40.0f) { if (this->currentPathPoint != 0) { EnPoDesert_SetNextPathPoint(this, globalCtx); @@ -186,7 +186,7 @@ void EnPoDesert_Disappear(EnPoDesert* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += 0x2000; this->lightColor.a = this->actionTimer * 15.9375f; - this->actor.shape.unk_14 = this->lightColor.a; + this->actor.shape.shadowAlpha = this->lightColor.a; if (this->actionTimer == 0) { Actor_Kill(&this->actor); } @@ -200,15 +200,15 @@ void EnPoDesert_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); EnPoDesert_UpdateSpeedModifier(this); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); - Actor_SetHeight(&this->actor, 42.0f); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); + Actor_SetFocus(&this->actor, 42.0f); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (globalCtx->actorCtx.unk_03) { this->actor.flags |= 0x81; - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; } else { - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; this->actor.flags &= ~0x81; } } 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 917385f95f..adc0fafc1f 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 @@ -35,7 +35,7 @@ void EnPoField_SpawnFlame(EnPoField* this); const ActorInit En_Po_Field_InitVars = { ACTOR_EN_PO_FIELD, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_PO_FIELD, sizeof(EnPoField), @@ -127,7 +127,7 @@ static s32 sNumSpawned = 0; static Vec3f sFieldMiddle = { -1000.0f, 0.0f, 6500.0f }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 3200, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), }; static Vec3f D_80AD7114 = { 0.0f, 3.0f, 0.0f }; @@ -165,9 +165,9 @@ void EnPoField_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; if (sNumSpawned != 10) { - sSpawnPositions[sNumSpawned].x = this->actor.posRot.pos.x; - sSpawnPositions[sNumSpawned].y = this->actor.posRot.pos.y; - sSpawnPositions[sNumSpawned].z = this->actor.posRot.pos.z; + sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; + sSpawnPositions[sNumSpawned].y = this->actor.world.pos.y; + sSpawnPositions[sNumSpawned].z = this->actor.world.pos.z; sSpawnSwitchFlags[sNumSpawned] = this->actor.params & 0xFF; sNumSpawned++; } @@ -184,9 +184,9 @@ void EnPoField_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->flameCollider, &this->actor, &D_80AD70AC); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &D_80AD70D8); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 0); - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 0); + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; EnPoField_SetupWaitForSpawn(this, globalCtx); } @@ -202,7 +202,7 @@ void EnPoField_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnPoField_SetupWaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { this->actor.update = EnPoField_Update; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); this->actor.shape.rot.x = 0; Lights_PointSetColorAndRadius(&this->lightInfo, 0, 0, 0, 0); this->actionTimer = 200; @@ -223,16 +223,16 @@ void EnPoField_SetupAppear(EnPoField* this) { this->lightColor.g = 255; this->lightColor.b = 210; this->lightColor.a = 0; - this->actor.shape.unk_14 = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.shadowAlpha = 0; + this->actor.shape.yOffset = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.home.pos.y = this->actor.world.pos.y; if (this->actor.params == EN_PO_FIELD_BIG) { this->actor.speedXZ = 12.0f; this->collider.dim.radius = 35; this->collider.dim.height = 100; this->collider.dim.yShift = 10; - this->actor.shape.unk_10 = 45.0f; + this->actor.shape.shadowScale = 45.0f; this->scaleModifier = 0.014f; this->actor.naviEnemyId = 0x5A; } else { @@ -240,7 +240,7 @@ void EnPoField_SetupAppear(EnPoField* this) { this->collider.dim.radius = D_80AD7080.dim.radius; this->collider.dim.height = D_80AD7080.dim.height; this->collider.dim.yShift = D_80AD7080.dim.yShift; - this->actor.shape.unk_10 = 37.0f; + this->actor.shape.shadowScale = 37.0f; this->scaleModifier = 0.01f; this->actor.naviEnemyId = 0x5C; } @@ -252,9 +252,9 @@ void EnPoField_SetupCirclePlayer(EnPoField* this, GlobalContext* globalCtx) { Animation_PlayLoop(&this->skelAnime, &D_06000924); this->collider.base.acFlags |= AC_ON; - this->scaleModifier = this->actor.xzDistToLink; - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &player->actor.posRot.pos); - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->scaleModifier = this->actor.xzDistToPlayer; + Math_Vec3f_Copy(&this->actor.home.pos, &player->actor.world.pos); + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->actionFunc != EnPoField_Damage) { this->actor.flags |= 1; this->actionTimer = 600; @@ -270,7 +270,7 @@ void EnPoField_SetupFlee(EnPoField* this) { this->actor.speedXZ = 12.0f; if (this->actionFunc != EnPoField_Damage) { this->actor.flags |= 1; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->actionTimer = 2000; this->unk_194 = 32; } @@ -279,9 +279,9 @@ void EnPoField_SetupFlee(EnPoField* this) { void EnPoField_SetupDamage(EnPoField* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000454, -6.0f); if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) { - this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; + this->actor.world.rot.y = this->collider.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } this->collider.base.acFlags &= ~(AC_HIT | AC_ON); this->actor.speedXZ = 5.0f; @@ -293,7 +293,7 @@ void EnPoField_SetupDeath(EnPoField* this) { this->actionTimer = 0; this->actor.flags &= -2; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.naviEnemyId = 0xFF; if (this->flameTimer >= 20) { this->flameTimer = 19; @@ -314,27 +314,27 @@ void EnPoField_SetupDisappear(EnPoField* this) { void EnPoField_SetupSoulIdle(EnPoField* this, GlobalContext* globalCtx) { this->actor.update = EnPoField_UpdateDead; this->actor.draw = EnPoField_DrawSoul; - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; Actor_SetScale(&this->actor, 0.01f); this->actor.gravity = -1.0f; - this->actor.shape.unk_08 = 1500.0f; + this->actor.shape.yOffset = 1500.0f; this->actor.shape.rot.x = -0x8000; this->actionTimer = 60; - this->actor.posRot.pos.y -= 15.0f; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_MISC); + this->actor.world.pos.y -= 15.0f; + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_MISC); this->actionFunc = EnPoField_SoulIdle; } void func_80AD42B0(EnPoField* this) { - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->actor.shape.rot.y = 0; this->lightColor.a = 0; this->actor.shape.rot.x = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.home.pos.y = this->actor.world.pos.y; this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND); @@ -345,14 +345,14 @@ void func_80AD42B0(EnPoField* this) { } void func_80AD4384(EnPoField* this) { - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; - Actor_SetHeight(&this->actor, -10.0f); + this->actor.home.pos.y = this->actor.world.pos.y; + Actor_SetFocus(&this->actor, -10.0f); this->collider.dim.radius = 13; this->collider.dim.height = 30; this->collider.dim.yShift = 0; - this->collider.dim.pos.x = this->actor.posRot.pos.x; - this->collider.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - this->collider.dim.pos.z = this->actor.posRot.pos.z; + this->collider.dim.pos.x = this->actor.world.pos.x; + this->collider.dim.pos.y = this->actor.world.pos.y - 20.0f; + this->collider.dim.pos.z = this->actor.world.pos.z; this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; this->actor.textId = 0x5005; this->actionTimer = 400; @@ -367,7 +367,7 @@ void EnPoField_SetupSoulDisappear(EnPoField* this) { void EnPoField_SetupInteractWithSoul(EnPoField* this) { this->actionFunc = EnPoField_SoulInteract; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y - 15.0f; + this->actor.home.pos.y = this->actor.world.pos.y - 15.0f; } void EnPoField_CorrectYPos(EnPoField* this, GlobalContext* globalCtx) { @@ -379,26 +379,27 @@ void EnPoField_CorrectYPos(EnPoField* this, GlobalContext* globalCtx) { if (this->unk_194 != 0) { this->unk_194 -= 1; } - if (this->actor.groundY == BGCHECK_Y_MIN) { + if (this->actor.floorHeight == BGCHECK_Y_MIN) { EnPoField_SetupDisappear(this); return; } Math_ApproachF( - &this->actor.initPosRot.pos.y, - ((player->actor.posRot.pos.y > this->actor.groundY) ? player->actor.posRot.pos.y : this->actor.groundY) + 13.0f, + &this->actor.home.pos.y, + ((player->actor.world.pos.y > this->actor.floorHeight) ? player->actor.world.pos.y : this->actor.floorHeight) + + 13.0f, 0.2f, 5.0f); - this->actor.posRot.pos.y = Math_SinS(this->unk_194 * 0x800) * 13.0f + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = Math_SinS(this->unk_194 * 0x800) * 13.0f + this->actor.home.pos.y; } f32 EnPoField_SetFleeSpeed(EnPoField* this, GlobalContext* globalCtx) { Player* player = PLAYER; f32 speed = ((player->stateFlags1 & 0x800000) && player->rideActor != NULL) ? player->rideActor->speedXZ : 12.0f; - if (this->actor.xzDistToLink < 300.0f) { + if (this->actor.xzDistToPlayer < 300.0f) { this->actor.speedXZ = speed * 1.5f + 2.0f; - } else if (this->actor.xzDistToLink < 400.0f) { + } else if (this->actor.xzDistToPlayer < 400.0f) { this->actor.speedXZ = speed * 1.25f + 2.0f; - } else if (this->actor.xzDistToLink < 500.0f) { + } else if (this->actor.xzDistToPlayer < 500.0f) { this->actor.speedXZ = speed + 2.0f; } else { this->actor.speedXZ = 12.0f; @@ -417,8 +418,8 @@ void EnPoField_WaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { } if (this->actionTimer == 0) { for (i = 0; i < sNumSpawned; i++) { - if (fabsf(sSpawnPositions[i].x - player->actor.posRot.pos.x) < 150.0f && - fabsf(sSpawnPositions[i].z - player->actor.posRot.pos.z) < 150.0f) { + if (fabsf(sSpawnPositions[i].x - player->actor.world.pos.x) < 150.0f && + fabsf(sSpawnPositions[i].z - player->actor.world.pos.z) < 150.0f) { if (Flags_GetSwitch(globalCtx, sSpawnSwitchFlags[i])) { if (player->stateFlags1 & 0x800000) { // Player riding Epona return; @@ -434,15 +435,13 @@ void EnPoField_WaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { this->actor.params = EN_PO_FIELD_SMALL; spawnDist = 300.0f; } - this->actor.posRot.pos.x = - Math_SinS(player->actor.shape.rot.y) * spawnDist + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = - Math_CosS(player->actor.shape.rot.y) * spawnDist + player->actor.posRot.pos.z; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 1000.0f; - this->actor.posRot.pos.y = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, - &bgId, &this->actor, &this->actor.posRot.pos); - if (this->actor.posRot.pos.y != BGCHECK_Y_MIN) { - this->actor.shape.rot.y = func_8002DA78(&this->actor, &player->actor); + this->actor.world.pos.x = Math_SinS(player->actor.shape.rot.y) * spawnDist + player->actor.world.pos.x; + this->actor.world.pos.z = Math_CosS(player->actor.shape.rot.y) * spawnDist + player->actor.world.pos.z; + this->actor.world.pos.y = player->actor.world.pos.y + 1000.0f; + this->actor.world.pos.y = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &bgId, + &this->actor, &this->actor.world.pos); + if (this->actor.world.pos.y != BGCHECK_Y_MIN) { + this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &player->actor); EnPoField_SetupAppear(this); } else { return; @@ -468,10 +467,10 @@ void EnPoField_Appear(EnPoField* this, GlobalContext* globalCtx) { this->actor.scale.y = this->actor.scale.x; this->actor.scale.z = this->actor.scale.x; } - this->actor.shape.unk_14 = this->lightColor.a; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.shadowAlpha = this->lightColor.a; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (this->actor.params == EN_PO_FIELD_BIG) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; EnPoField_SetFleeSpeed(this, globalCtx); } } @@ -485,26 +484,24 @@ void EnPoField_CirclePlayer(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer--; } if (ABS(temp_v1) < 16) { - this->actor.posRot.rot.y += 512.0f * fabsf(Math_SinS(this->unk_194 * 0x800)); + this->actor.world.rot.y += 512.0f * fabsf(Math_SinS(this->unk_194 * 0x800)); } Math_ApproachF(&this->scaleModifier, 180.0f, 0.5f, 10.0f); - Math_ApproachF(&this->actor.initPosRot.pos.x, player->actor.posRot.pos.x, 0.2f, 6.0f); - Math_ApproachF(&this->actor.initPosRot.pos.z, player->actor.posRot.pos.z, 0.2f, 6.0f); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 1, 0x800, 0x200); - if (this->actor.initPosRot.pos.x - player->actor.posRot.pos.x > 100.0f) { - this->actor.initPosRot.pos.x = player->actor.posRot.pos.x + 100.0f; - } else if (this->actor.initPosRot.pos.x - player->actor.posRot.pos.x < -100.0f) { - this->actor.initPosRot.pos.x = player->actor.posRot.pos.x + -100.0f; + Math_ApproachF(&this->actor.home.pos.x, player->actor.world.pos.x, 0.2f, 6.0f); + Math_ApproachF(&this->actor.home.pos.z, player->actor.world.pos.z, 0.2f, 6.0f); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 1, 0x800, 0x200); + if (this->actor.home.pos.x - player->actor.world.pos.x > 100.0f) { + this->actor.home.pos.x = player->actor.world.pos.x + 100.0f; + } else if (this->actor.home.pos.x - player->actor.world.pos.x < -100.0f) { + this->actor.home.pos.x = player->actor.world.pos.x + -100.0f; } - if (this->actor.initPosRot.pos.z - player->actor.posRot.pos.z > 100.0f) { - this->actor.initPosRot.pos.z = player->actor.posRot.pos.z + 100.0f; - } else if (this->actor.initPosRot.pos.z - player->actor.posRot.pos.z < -100.0f) { - this->actor.initPosRot.pos.z = player->actor.posRot.pos.z + -100.0f; + if (this->actor.home.pos.z - player->actor.world.pos.z > 100.0f) { + this->actor.home.pos.z = player->actor.world.pos.z + 100.0f; + } else if (this->actor.home.pos.z - player->actor.world.pos.z < -100.0f) { + this->actor.home.pos.z = player->actor.world.pos.z + -100.0f; } - this->actor.posRot.pos.x = - this->actor.initPosRot.pos.x - (Math_SinS(this->actor.posRot.rot.y) * this->scaleModifier); - this->actor.posRot.pos.z = - this->actor.initPosRot.pos.z - (Math_CosS(this->actor.posRot.rot.y) * this->scaleModifier); + this->actor.world.pos.x = this->actor.home.pos.x - (Math_SinS(this->actor.world.rot.y) * this->scaleModifier); + this->actor.world.pos.z = this->actor.home.pos.z - (Math_CosS(this->actor.world.rot.y) * this->scaleModifier); if (this->actionTimer == 0) { EnPoField_SetupDisappear(this); } else { @@ -522,18 +519,19 @@ void EnPoField_Flee(EnPoField* this, GlobalContext* globalCtx) { if (this->actionTimer != 0) { this->actionTimer--; } - if (func_8002DBB0(&this->actor, &sFieldMiddle) > 3000.0f) { - phi_t0 = (s16)(this->actor.yawTowardsLink - func_8002DAC0(&this->actor, &sFieldMiddle) - 0x8000) * 0.2f; + if (Actor_WorldDistXZToPoint(&this->actor, &sFieldMiddle) > 3000.0f) { + phi_t0 = (s16)(this->actor.yawTowardsPlayer - Actor_WorldYawTowardPoint(&this->actor, &sFieldMiddle) - 0x8000) * + 0.2f; } else { phi_t0 = 0; } - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink - phi_t0, 6, 0x400); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - phi_t0, 6, 0x400); EnPoField_SetFleeSpeed(this, globalCtx); - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; temp_f6 = Math_SinS(this->actionTimer * 0x800) * 3.0f; - this->actor.posRot.pos.x -= temp_f6 * Math_CosS(this->actor.shape.rot.y); - this->actor.posRot.pos.z += temp_f6 * Math_SinS(this->actor.shape.rot.y); - if (this->actionTimer == 0 || this->actor.xzDistToLink > 1500.0f) { + this->actor.world.pos.x -= temp_f6 * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.z += temp_f6 * Math_SinS(this->actor.shape.rot.y); + if (this->actionTimer == 0 || this->actor.xzDistToPlayer > 1500.0f) { EnPoField_SetupDisappear(this); } else { EnPoField_CorrectYPos(this, globalCtx); @@ -564,23 +562,23 @@ void EnPoField_Death(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer++; if (this->actionTimer < 8) { if (this->actionTimer < 5) { - sp6C.y = Math_SinS(this->actionTimer * 0x1000 - 0x4000) * 23.0f + (this->actor.posRot.pos.y + 40.0f); + sp6C.y = Math_SinS(this->actionTimer * 0x1000 - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f); sp68 = Math_CosS(this->actionTimer * 0x1000 - 0x4000) * 23.0f; - sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.posRot.pos.x; - sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.posRot.pos.z; + sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.world.pos.x; + sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * sp68 + this->actor.world.pos.z; } else { - sp6C.y = this->actor.posRot.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); - sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.x; - sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.z; + sp6C.y = this->actor.world.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); + sp6C.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.x; + sp6C.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.z; } EffectSsDeadDb_Spawn(globalCtx, &sp6C, &D_80AD7114, &D_80AD7120, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - sp6C.x = (this->actor.posRot.pos.x + this->actor.posRot.pos.x) - sp6C.x; - sp6C.z = (this->actor.posRot.pos.z + this->actor.posRot.pos.z) - sp6C.z; + sp6C.x = (this->actor.world.pos.x + this->actor.world.pos.x) - sp6C.x; + sp6C.z = (this->actor.world.pos.z + this->actor.world.pos.z) - sp6C.z; EffectSsDeadDb_Spawn(globalCtx, &sp6C, &D_80AD7114, &D_80AD7120, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - sp6C.x = this->actor.posRot.pos.x; - sp6C.z = this->actor.posRot.pos.z; + sp6C.x = this->actor.world.pos.x; + sp6C.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &sp6C, &D_80AD7114, &D_80AD7120, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); if (this->actionTimer == 1) { @@ -590,7 +588,7 @@ void EnPoField_Death(EnPoField* this, GlobalContext* globalCtx) { EnPoField_SetupSoulIdle(this, globalCtx); } else if (this->actionTimer >= 19) { temp_f0 = (28 - this->actionTimer) * 0.001f; - this->actor.posRot.pos.y += 5.0f; + this->actor.world.pos.y += 5.0f; this->actor.scale.z = temp_f0; this->actor.scale.y = temp_f0; this->actor.scale.x = temp_f0; @@ -607,7 +605,7 @@ void EnPoField_Disappear(EnPoField* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += 0x1000; this->lightColor.a = this->actionTimer * 15.9375f; - this->actor.shape.unk_14 = this->lightColor.a; + this->actor.shape.shadowAlpha = this->lightColor.a; if (this->actionTimer == 0) { EnPoField_SetupWaitForSpawn(this, globalCtx); } @@ -618,14 +616,13 @@ void EnPoField_SoulIdle(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer--; } if (this->actor.bgCheckFlags & 1) { - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO_FIELD, 10, - D_06004BA0); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO_FIELD, 10, D_06004BA0); func_80AD42B0(this); } else if (this->actionTimer == 0) { EnPoField_SetupWaitForSpawn(this, globalCtx); } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); } void EnPoField_SoulUpdateProperties(EnPoField* this, s32 arg1) { @@ -643,18 +640,18 @@ void EnPoField_SoulUpdateProperties(EnPoField* this, s32 arg1) { this->actor.scale.z = this->lightColor.a * 2.7450982e-05f; this->actor.scale.y = this->lightColor.a * 2.7450982e-05f; this->actor.scale.x = this->lightColor.a * 2.7450982e-05f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (0.05882353f * this->lightColor.a); + this->actor.world.pos.y = this->actor.home.pos.y + (0.05882353f * this->lightColor.a); } this->lightColor.r = info->lightColor.r * multiplier; this->lightColor.g = info->lightColor.g * multiplier; this->lightColor.b = info->lightColor.b * multiplier; - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, info->lightColor.r, info->lightColor.g, info->lightColor.b, + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, info->lightColor.r, info->lightColor.g, info->lightColor.b, this->lightColor.a * 0.78431373f); } void func_80AD587C(EnPoField* this, GlobalContext* globalCtx) { - this->actor.initPosRot.pos.y += 2.0f; + this->actor.home.pos.y += 2.0f; EnPoField_SoulUpdateProperties(this, 20); if (this->lightColor.a == 255) { func_80AD4384(this); @@ -682,17 +679,17 @@ void func_80AD58D4(EnPoField* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10000; CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - this->actor.posRot.pos.y = Math_SinS(this->unk_194 * 0x800) * 5.0f + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = Math_SinS(this->unk_194 * 0x800) * 5.0f + this->actor.home.pos.y; if (this->unk_194 != 0) { this->unk_194 -= 1; } if (this->unk_194 == 0) { this->unk_194 = 32; } - this->collider.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - Actor_SetHeight(&this->actor, -10.0f); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->lightInfo.params.point.color[0], + this->collider.dim.pos.y = this->actor.world.pos.y - 20.0f; + Actor_SetFocus(&this->actor, -10.0f); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->lightInfo.params.point.color[0], this->lightInfo.params.point.color[1], this->lightInfo.params.point.color[2], this->lightColor.a * 0.78431374f); } @@ -827,7 +824,7 @@ void func_80AD619C(EnPoField* this) { temp_var = this->lightColor.b + 5; this->lightColor.b = CLAMP_MAX(temp_var, 225); } else if (this->actionFunc == EnPoField_Damage) { - if (this->actor.dmgEffectTimer & 2) { + if (this->actor.colorFilterTimer & 2) { this->lightColor.r = 0; this->lightColor.g = 0; this->lightColor.b = 0; @@ -876,8 +873,8 @@ void EnPoField_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); } if (this->actionFunc != EnPoField_WaitForSpawn) { - Actor_SetHeight(&this->actor, 42.0f); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); + Actor_SetFocus(&this->actor, 42.0f); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); func_80AD619C(this); func_80AD6330(this); Collider_UpdateCylinder(&this->actor, &this->collider); @@ -926,9 +923,9 @@ void EnPoField_PostLimDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList } Matrix_Get(&sLimb7Mtx); if (this->actionFunc == EnPoField_Death && this->actionTimer == 27) { - this->actor.posRot.pos.x = sLimb7Mtx.wx; - this->actor.posRot.pos.y = sLimb7Mtx.wy; - this->actor.posRot.pos.z = sLimb7Mtx.wz; + this->actor.world.pos.x = sLimb7Mtx.wx; + this->actor.world.pos.y = sLimb7Mtx.wy; + this->actor.world.pos.z = sLimb7Mtx.wz; } Lights_PointGlowSetInfo(&this->lightInfo, vec.x, vec.y, vec.z, this->soulColor.r, this->soulColor.g, this->soulColor.b, this->soulColor.a * 0.7843137383460999f); @@ -994,8 +991,8 @@ void EnPoField_DrawSoul(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x0A, Gfx_EnvColor(globalCtx->state.gfxCtx, info->envColor.r, info->envColor.g, info->envColor.b, 255)); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->soulColor.r, this->soulColor.g, this->soulColor.b, 200); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->soulColor.r, this->soulColor.g, this->soulColor.b, 200); gDPSetEnvColor(POLY_OPA_DISP++, this->soulColor.r, this->soulColor.g, this->soulColor.b, 255); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_po_field.c", 2104), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); 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 219c8216bc..9ca2820ecc 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 @@ -36,7 +36,7 @@ Vec3s D_80AD8C30[] = { const ActorInit En_Po_Relay_InitVars = { ACTOR_EN_PO_RELAY, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TK, sizeof(EnPoRelay), @@ -70,7 +70,7 @@ static s32 D_80AD8D24 = 0; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x4F, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 1500, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 1500, ICHAIN_STOP), }; static Vec3f D_80AD8D30 = { 0.0f, 1.5f, 0.0f }; @@ -95,13 +95,13 @@ void EnPoRelay_Init(Actor* thisx, GlobalContext* globalCtx) { s32 temp; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 42.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 42.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600BE40, &D_06003768, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 200); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 200); this->lightColor.a = 255; temp = 1; if (D_80AD8D24 != 0) { @@ -127,7 +127,7 @@ void EnPoRelay_SetupIdle(EnPoRelay* this) { this->pathIndex = 0; this->actor.room = -1; this->actor.shape.rot.y = 0; - this->actor.posRot.rot.y = -0x8000; + this->actor.world.rot.y = -0x8000; this->actor.colChkInfo.mass = MASS_HEAVY; this->actionFunc = EnPoRelay_Idle; } @@ -142,34 +142,33 @@ void EnPoRelay_SetupRace(EnPoRelay* this) { Vec3f vec; EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]); - this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.posRot.rot.y - 0x8000) >> 0xB) % 32U; + this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.world.rot.y - 0x8000) >> 0xB) % 32U; func_80088B34(0); this->hookshotSlotFull = INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE; - this->unk_19A = func_8002DAC0(&this->actor, &vec); + this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); this->actor.flags |= 0x8000000; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = EnPoRelay_Race; } void EnPoRelay_SetupEndRace(EnPoRelay* this) { - this->actor.posRot.rot.y = this->actor.initPosRot.rot.y + 0xC000; + this->actor.world.rot.y = this->actor.home.rot.y + 0xC000; this->actor.flags &= ~0x08000000; this->actor.speedXZ = 0.0f; this->actionFunc = EnPoRelay_EndRace; } void EnPoRelay_CorrectY(EnPoRelay* this) { - Math_StepToF(&this->actor.initPosRot.pos.y, D_80AD8C30[(this->pathIndex >= 28) ? 27 : this->pathIndex].y + 45.0f, - 2.0f); - this->actor.posRot.pos.y = Math_SinS(this->unk_195 * 0x800) * 8.0f + this->actor.initPosRot.pos.y; + Math_StepToF(&this->actor.home.pos.y, D_80AD8C30[(this->pathIndex >= 28) ? 27 : this->pathIndex].y + 45.0f, 2.0f); + this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 8.0f + this->actor.home.pos.y; } void EnPoRelay_Idle(EnPoRelay* this, GlobalContext* globalCtx) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (func_8002F194(&this->actor, globalCtx) != 0) { this->actor.flags &= ~0x10000; this->actionFunc = EnPoRelay_Talk; - } else if (this->actor.xzDistToLink < 250.0f) { + } else if (this->actor.xzDistToPlayer < 250.0f) { this->actor.flags |= 0x10000; this->actor.textId = this->textId; func_8002F2CC(&this->actor, globalCtx, 250.0f); @@ -178,7 +177,7 @@ void EnPoRelay_Idle(EnPoRelay* this, GlobalContext* globalCtx) { } void EnPoRelay_Talk(EnPoRelay* this, GlobalContext* globalCtx) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (func_8002F334(&this->actor, globalCtx) != 0) { Actor_SetTextWithPrefix(globalCtx, &this->actor, 0x2F); this->textId = this->actor.textId; @@ -209,32 +208,32 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { } speed = 30.0f * multiplier; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HONOTRAP, - Math_CosS(this->unk_19A) * speed + this->actor.posRot.pos.x, this->actor.posRot.pos.y, - Math_SinS(this->unk_19A) * speed + this->actor.posRot.pos.z, 0, + Math_CosS(this->unk_19A) * speed + this->actor.world.pos.x, this->actor.world.pos.y, + Math_SinS(this->unk_19A) * speed + this->actor.world.pos.z, 0, (this->unk_19A + 0x8000) - (0x2000 * multiplier), 0, HONOTRAP_FLAME_DROP); } } - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->unk_19A, 2, 0x1000, 0x100); - this->actor.shape.rot.y = this->actor.posRot.rot.y + (this->actionTimer * 0x800) + 0x8000; + Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_19A, 2, 0x1000, 0x100); + this->actor.shape.rot.y = this->actor.world.rot.y + (this->actionTimer * 0x800) + 0x8000; if (this->pathIndex < 23) { // If the player travels along a different path to Dampé that converges later - if ((Math3D_PointInSquare2D(660.0f, 840.0f, -4480.0f, -3760.0f, player->actor.posRot.pos.x, - player->actor.posRot.pos.z) != 0) || - (Math3D_PointInSquare2D(1560.0f, 1740.0f, -4030.0f, -3670.0f, player->actor.posRot.pos.x, - player->actor.posRot.pos.z) != 0) || - (Math3D_PointInSquare2D(1580.0f, 2090.0f, -3030.0f, -2500.0f, player->actor.posRot.pos.x, - player->actor.posRot.pos.z) != 0)) { + if ((Math3D_PointInSquare2D(660.0f, 840.0f, -4480.0f, -3760.0f, player->actor.world.pos.x, + player->actor.world.pos.z) != 0) || + (Math3D_PointInSquare2D(1560.0f, 1740.0f, -4030.0f, -3670.0f, player->actor.world.pos.x, + player->actor.world.pos.z) != 0) || + (Math3D_PointInSquare2D(1580.0f, 2090.0f, -3030.0f, -2500.0f, player->actor.world.pos.x, + player->actor.world.pos.z) != 0)) { speed = (this->hookshotSlotFull) ? player->actor.speedXZ * 1.4f : player->actor.speedXZ * 1.2f; - } else if (this->actor.xzDistToLink < 150.0f) { + } else if (this->actor.xzDistToPlayer < 150.0f) { speed = (this->hookshotSlotFull) ? player->actor.speedXZ * 1.2f : player->actor.speedXZ; - } else if (this->actor.xzDistToLink < 300.0f) { + } else if (this->actor.xzDistToPlayer < 300.0f) { speed = (this->hookshotSlotFull) ? player->actor.speedXZ : player->actor.speedXZ * 0.8f; } else if (this->hookshotSlotFull) { speed = 4.5f; } else { speed = 3.5f; } - multiplier = 250.0f - this->actor.xzDistToLink; + multiplier = 250.0f - this->actor.xzDistToPlayer; multiplier = CLAMP_MIN(multiplier, 0.0f); speed += multiplier * 0.02f + 1.0f; Math_ApproachF(&this->actor.speedXZ, speed, 0.5f, 1.5f); @@ -242,7 +241,7 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.speedXZ, 3.5f, 0.5f, 1.5f); } EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]); - if (func_8002DBB0(&this->actor, &vec) < 40.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &vec) < 40.0f) { this->pathIndex++; EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]); if (this->pathIndex == 28) { @@ -255,7 +254,7 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { Flags_SetSwitch(globalCtx, 0x37); } } - this->unk_19A = func_8002DAC0(&this->actor, &vec); + this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); } @@ -274,7 +273,7 @@ void EnPoRelay_EndRace(EnPoRelay* this, GlobalContext* globalCtx) { } void EnPoRelay_Talk2(EnPoRelay* this, GlobalContext* globalCtx) { - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0x100); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100); if (func_8010BDBC(&globalCtx->msgCtx) == 5) { if (func_80106BC8(globalCtx) != 0) { if (this->hookshotSlotFull != 0) { @@ -303,23 +302,23 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx) { this->actionTimer++; if (this->actionTimer < 8) { if (this->actionTimer < 5) { - vec.y = Math_SinS((this->actionTimer * 0x1000) - 0x4000) * 23.0f + (this->actor.posRot.pos.y + 40.0f); + vec.y = Math_SinS((this->actionTimer * 0x1000) - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f); multiplier = Math_CosS((this->actionTimer * 0x1000) - 0x4000) * 23.0f; - vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.posRot.pos.x; - vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.posRot.pos.z; + vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.world.pos.x; + vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier) + this->actor.world.pos.z; } else { - vec.y = this->actor.posRot.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); - vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.posRot.pos.x; - vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.posRot.pos.z; + vec.y = this->actor.world.pos.y + 40.0f + 15.0f * (this->actionTimer - 5); + vec.x = (Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.world.pos.x; + vec.z = (Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f) + this->actor.world.pos.z; } EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AD8D30, &D_80AD8D3C, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); - vec.x = (this->actor.posRot.pos.x + this->actor.posRot.pos.x) - vec.x; - vec.z = (this->actor.posRot.pos.z + this->actor.posRot.pos.z) - vec.z; + vec.x = (this->actor.world.pos.x + this->actor.world.pos.x) - vec.x; + vec.z = (this->actor.world.pos.z + this->actor.world.pos.z) - vec.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AD8D30, &D_80AD8D3C, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); - vec.x = this->actor.posRot.pos.x; - vec.z = this->actor.posRot.pos.z; + vec.x = this->actor.world.pos.x; + vec.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AD8D30, &D_80AD8D3C, this->actionTimer * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, true); if (this->actionTimer == 1) { @@ -328,9 +327,9 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx) { } if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.001f) != 0) { if (this->hookshotSlotFull != 0) { - sp60.x = this->actor.posRot.pos.x; - sp60.y = this->actor.groundY; - sp60.z = this->actor.posRot.pos.z; + sp60.x = this->actor.world.pos.x; + sp60.y = this->actor.floorHeight; + sp60.z = this->actor.world.pos.z; if (gSaveContext.timer1Value < HIGH_SCORE(HS_DAMPE_RACE)) { HIGH_SCORE(HS_DAMPE_RACE) = gSaveContext.timer1Value; } @@ -347,7 +346,7 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx) { } this->actor.scale.y = this->actor.scale.x; this->actor.scale.z = this->actor.scale.x; - this->actor.posRot.pos.y += 10.0f; + this->actor.world.pos.y += 10.0f; } void EnPoRelay_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -358,10 +357,10 @@ void EnPoRelay_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); EnPoRelay_CorrectY(this); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 27.0f, 60.0f, 4); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); if (this->unk_195 != 0) { this->unk_195 -= 1; } 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 572b2e6455..d1089914ec 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 @@ -63,7 +63,7 @@ static Color_RGBA8 D_80ADD700[4] = { const ActorInit En_Po_Sisters_InitVars = { ACTOR_EN_PO_SISTERS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_PO_SISTERS, sizeof(EnPoSisters), @@ -134,7 +134,7 @@ static s32 D_80ADD784 = 0; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 7, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 6000, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 6000, ICHAIN_STOP), }; static Vec3f sZeroVector = { 0.0f, 0.0f, 0.0f }; @@ -182,15 +182,15 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060065C8, &D_060014CC, this->jointTable, this->morphTable, 12); this->unk_22E.r = 255; this->unk_22E.g = 255; this->unk_22E.b = 210; this->unk_22E.a = 255; this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 0, 0, 0, 0); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, + 0, 0, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -286,14 +286,14 @@ void func_80AD94E0(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f); } this->unk_19A = 5; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->unk_199 |= 8; this->actionFunc = func_80ADA8C0; } void func_80AD9568(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); - this->actor.posRot.rot.y = this->actor.yawTowardsLink + 0x8000; + this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000; if (this->unk_194 != 0) { this->collider.base.colType = COLTYPE_HIT3; this->collider.base.acFlags &= ~AC_HARD; @@ -304,9 +304,9 @@ void func_80AD9568(EnPoSisters* this) { void func_80AD95D8(EnPoSisters* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_060008C0, -3.0f); if (this->collider.base.ac != NULL) { - this->actor.posRot.rot.y = (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) - ? this->collider.base.ac->posRot.rot.y - : func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1F824) + ? this->collider.base.ac->world.rot.y + : Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } if (this->unk_194 != 0) { this->actor.speedXZ = 10.0f; @@ -318,7 +318,7 @@ void func_80AD95D8(EnPoSisters* this) { void func_80AD96A4(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000A54, -3.0f); - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->unk_19A = 5; this->unk_199 |= 0xB; this->actor.speedXZ = 5.0f; @@ -330,7 +330,7 @@ void func_80AD9718(EnPoSisters* this) { -3.0f); this->actor.speedXZ = 0.0f; this->unk_19C = 100; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 &= ~5; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); @@ -343,17 +343,17 @@ void func_80AD97C8(EnPoSisters* this, GlobalContext* globalCtx) { if (this->unk_195 == 0 || this->actionFunc != func_80ADAAA4) { if ((player->swordState == 0 || player->swordAnimation >= 24) && - player->actor.posRot.pos.y - player->actor.groundY < 1.0f) { + player->actor.world.pos.y - player->actor.floorHeight < 1.0f) { Math_StepToF(&this->unk_294, 110.0f, 3.0f); } else { Math_StepToF(&this->unk_294, 170.0f, 10.0f); } sp20 = this->unk_294; } else if (this->unk_195 != 0) { - sp20 = this->actor.parent->xzDistToLink; + sp20 = this->actor.parent->xzDistToPlayer; } - this->actor.posRot.pos.x = (Math_SinS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = (Math_CosS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.posRot.pos.z; + this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.world.pos.x; + this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y + 0x8000) * sp20) + player->actor.world.pos.z; } void func_80AD98F4(EnPoSisters* this, GlobalContext* globalCtx) { @@ -365,7 +365,7 @@ void func_80AD98F4(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 0; this->actor.draw = EnPoSisters_Draw; } else { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } this->unk_19A = 15; this->actor.speedXZ = 0.0f; @@ -377,8 +377,8 @@ void func_80AD98F4(EnPoSisters* this, GlobalContext* globalCtx) { void func_80AD99D4(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A = 0; this->actor.speedXZ = 0.0f; - this->actor.posRot.pos.y += 42.0f; - this->actor.shape.unk_08 = -6000.0f; + this->actor.world.pos.y += 42.0f; + this->actor.shape.yOffset = -6000.0f; this->actor.flags &= -2; this->unk_199 = 0; this->actionFunc = func_80ADAFC0; @@ -387,19 +387,19 @@ void func_80AD99D4(EnPoSisters* this, GlobalContext* globalCtx) { void func_80AD9A54(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A = 0; - this->actor.posRot.pos.y = this->unk_234[0].y; - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x80); + this->actor.world.pos.y = this->unk_234[0].y; + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x80); this->actionFunc = func_80ADB17C; } // Meg spawning fakes void func_80AD9AA8(EnPoSisters* this, GlobalContext* globalCtx) { - Actor* actor1 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0x400); - Actor* actor2 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0x800); - Actor* actor3 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0xC00); + Actor* actor1 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x400); + Actor* actor2 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x800); + Actor* actor3 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PO_SISTERS, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0xC00); s32 pad; s32 pad1; @@ -435,9 +435,9 @@ void func_80AD9C24(EnPoSisters* this, GlobalContext* globalCtx) { this->collider.base.colType = COLTYPE_HIT3; this->collider.base.acFlags &= ~AC_HARD; if (globalCtx != NULL) { - vec.x = this->actor.posRot.pos.x; - vec.y = this->actor.posRot.pos.y + 45.0f; - vec.z = this->actor.posRot.pos.z; + vec.x = this->actor.world.pos.x; + vec.y = this->actor.world.pos.y + 45.0f; + vec.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &sZeroVector, &sZeroVector, 150, 0, 255, 255, 255, 155, 150, 150, 150, 1, 9, 0); } @@ -470,10 +470,10 @@ void func_80AD9E60(EnPoSisters* this) { Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); this->unk_19A = Animation_GetLastFrame(&D_06000D40) * 7 + 7; if (this->actor.parent != NULL) { - this->actor.posRot.pos = this->actor.parent->posRot.pos; + this->actor.world.pos = this->actor.parent->world.pos; this->actor.shape.rot.y = this->actor.parent->shape.rot.y; } else { - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_19A++; } if (this->unk_195 == 0) { @@ -494,11 +494,11 @@ void func_80AD9F1C(EnPoSisters* this) { void func_80AD9F90(EnPoSisters* this) { if (this->unk_194 == 1) { - this->actor.initPosRot.pos.x = -632.0f; - this->actor.initPosRot.pos.z = -3440.0f; + this->actor.home.pos.x = -632.0f; + this->actor.home.pos.z = -3440.0f; } else { - this->actor.initPosRot.pos.x = 752.0f; - this->actor.initPosRot.pos.z = -3440.0f; + this->actor.home.pos.x = 752.0f; + this->actor.home.pos.z = -3440.0f; } Animation_PlayLoop(&this->skelAnime, &D_06000D40); this->unk_199 |= 0xA; @@ -520,8 +520,8 @@ void func_80ADA094(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 0; this->unk_199 = 128; this->unk_19A = 50; - this->unk_234[0] = this->actor.initPosRot.pos; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + this->unk_234[0] = this->actor.home.pos; + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); this->actionFunc = func_80ADBC88; } @@ -552,7 +552,7 @@ void func_80ADA25C(EnPoSisters* this) { Animation_PlayLoop(&this->skelAnime, &D_060014CC); this->unk_198 = 8; this->unk_19A = 32; - func_80AD9240(this, this->unk_19A, &this->actor.initPosRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.home.pos); this->actionFunc = func_80ADBEE8; } @@ -562,8 +562,8 @@ void func_80ADA2BC(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_199 = 40; this->unk_19A = 90; this->unk_196 = 32; - this->actor.posRot.rot.y = D_80ADD79C[this->unk_194]; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.world.rot.y = D_80ADD79C[this->unk_194]; + this->actor.home.pos.y = this->actor.world.pos.y; if (this->unk_194 == 0) { Flags_SetSwitch(globalCtx, 0x1B); } @@ -576,20 +576,20 @@ void func_80ADA35C(EnPoSisters* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (this->actionFunc == func_80ADBF58) { - targetY = this->actor.initPosRot.pos.y; + targetY = this->actor.home.pos.y; } else if (this->unk_194 == 0 || this->unk_194 == 3) { - targetY = player->actor.posRot.pos.y + 5.0f; + targetY = player->actor.world.pos.y + 5.0f; } else { targetY = 832.0f; } - Math_ApproachF(&this->actor.posRot.pos.y, targetY, 0.5f, 3.0f); + Math_ApproachF(&this->actor.world.pos.y, targetY, 0.5f, 3.0f); if (!this->unk_196) { this->unk_196 = 32; } if (this->unk_196 != 0) { this->unk_196--; } - this->actor.posRot.pos.y += (2.0f + 0.5f * Rand_ZeroOne()) * Math_SinS(this->unk_196 * 0x800); + this->actor.world.pos.y += (2.0f + 0.5f * Rand_ZeroOne()) * Math_SinS(this->unk_196 * 0x800); if (this->unk_22E.a == 255 && this->actionFunc != func_80ADA8C0 && this->actionFunc != func_80ADA7F0) { if (this->actionFunc == func_80ADAC70) { func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); @@ -604,7 +604,7 @@ void func_80ADA4A8(EnPoSisters* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } - if (this->unk_19A == 0 || this->actor.xzDistToLink < 200.0f) { + if (this->unk_19A == 0 || this->actor.xzDistToPlayer < 200.0f) { func_80AD93C4(this); } } @@ -615,15 +615,17 @@ void func_80ADA530(EnPoSisters* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } - if (this->actor.xzDistToLink < 200.0f && fabsf(this->actor.yDistToLink + 5.0f) < 30.0f) { + if (this->actor.xzDistToPlayer < 200.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD943C(this); } else if (this->unk_19A == 0 && Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f) != 0) { func_80AD9368(this); } if (this->actor.bgCheckFlags & 8) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x71C); - } else if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) > 300.0f) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x71C); + } else if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 300.0f) { + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 0x71C); } } @@ -632,18 +634,18 @@ void func_80ADA6A0(EnPoSisters* this, GlobalContext* globalCtx) { s16 temp_v0; SkelAnime_Update(&this->skelAnime); - temp_v0 = this->actor.yawTowardsLink - player->actor.shape.rot.y; + temp_v0 = this->actor.yawTowardsPlayer - player->actor.shape.rot.y; Math_StepToF(&this->actor.speedXZ, 2.0f, 0.2f); if (temp_v0 > 0x3000) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); } else if (temp_v0 < -0x3000) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink - 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); } - if (this->actor.xzDistToLink < 160.0f && fabsf(this->actor.yDistToLink + 5.0f) < 30.0f) { + if (this->actor.xzDistToPlayer < 160.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD944C(this); - } else if (this->actor.xzDistToLink > 240.0f) { + } else if (this->actor.xzDistToPlayer > 240.0f) { func_80AD93C4(this); } } @@ -670,7 +672,7 @@ void func_80ADA8C0(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A--; } this->actor.shape.rot.y += (384.0f * this->skelAnime.endFrame) * 3.0f; - if (this->unk_19A == 0 && ABS((s16)(this->actor.shape.rot.y - this->actor.posRot.rot.y)) < 0x1000) { + if (this->unk_19A == 0 && ABS((s16)(this->actor.shape.rot.y - this->actor.world.rot.y)) < 0x1000) { if (this->unk_194 != 0) { this->collider.base.colType = COLTYPE_HIT3; this->collider.base.acFlags &= ~AC_HARD; @@ -689,7 +691,7 @@ void func_80ADA9E8(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->actor.shape.rot.y -= (this->actor.speedXZ * 10.0f) * 128.0f; if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f) != 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->unk_194 != 0) { func_80AD93C4(this); } else { @@ -717,7 +719,7 @@ void func_80ADAAA4(EnPoSisters* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.parent->shape.rot.y, (this->unk_195 == 2) ? 0x800 : 0x400); this->unk_22E.a = ((this->skelAnime.endFrame - this->skelAnime.curFrame) * 255.0f) / this->skelAnime.endFrame; - this->actor.posRot.pos.y = this->actor.parent->posRot.pos.y; + this->actor.world.pos.y = this->actor.parent->world.pos.y; func_80AD97C8(this, globalCtx); } else if (this->unk_194 != 0) { Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f); @@ -726,16 +728,16 @@ void func_80ADAAA4(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADAC70(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 1820); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 1820); if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_19A != 0) { this->unk_19A--; } if (this->actor.bgCheckFlags & 8) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 |= 2; func_80AD9718(this); - } else if (this->unk_19A == 0 && 240.0f < this->actor.xzDistToLink) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + } else if (this->unk_19A == 0 && 240.0f < this->actor.xzDistToPlayer) { + this->actor.world.rot.y = this->actor.shape.rot.y; func_80AD93C4(this); } } @@ -787,10 +789,10 @@ void func_80ADAFC0(EnPoSisters* this, GlobalContext* globalCtx) { } this->unk_234[0].x = (Math_SinS((this->actor.shape.rot.y + this->unk_19A * 0x3000) - 0x4000) * (3000.0f * this->actor.scale.x)) + - this->actor.posRot.pos.x; + this->actor.world.pos.x; this->unk_234[0].z = (Math_CosS((this->actor.shape.rot.y + this->unk_19A * 0x3000) - 0x4000) * (3000.0f * this->actor.scale.x)) + - this->actor.posRot.pos.z; + this->actor.world.pos.z; if (this->unk_19A < 8) { this->unk_234[0].y = this->unk_234[1].y - 9.0f; } else { @@ -812,7 +814,7 @@ void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A++; if (this->unk_19A == 64) { Flags_SetSwitch(globalCtx, this->actor.params); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EV_FLAME_IGNITION); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EV_FLAME_IGNITION); if (this->unk_194 == 0) { Flags_UnsetSwitch(globalCtx, 0x1B); } @@ -820,26 +822,26 @@ void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) { func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->actor); } else if (this->unk_19A < 32) { - func_80AD9240(this, this->unk_19A, &this->actor.posRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.world.pos); } else { - func_80AD9240(this, 64 - this->unk_19A, &this->actor.posRot.pos); + func_80AD9240(this, 64 - this->unk_19A, &this->actor.world.pos); } if (this->unk_19A == 32) { - this->actor.posRot.pos.x = D_80ADD7A4[this->unk_194].x; - this->actor.posRot.pos.y = D_80ADD7A4[this->unk_194].y; - this->actor.posRot.pos.z = D_80ADD7A4[this->unk_194].z; + this->actor.world.pos.x = D_80ADD7A4[this->unk_194].x; + this->actor.world.pos.y = D_80ADD7A4[this->unk_194].y; + this->actor.world.pos.z = D_80ADD7A4[this->unk_194].z; } } void func_80ADB2B8(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->actor.xzDistToLink < 130.0f) { + if (this->actor.xzDistToPlayer < 130.0f) { func_80AD9DF0(this, globalCtx); } if (Animation_OnFrame(&this->skelAnime, 0.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_CRY); } - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; } void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { @@ -847,7 +849,7 @@ void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { EnPoSisters* realMeg = (EnPoSisters*)this->actor.parent; if (this->unk_195 == 0) { - if (func_8002DBB0(&player->actor, &this->actor.initPosRot.pos) < 600.0f) { + if (Actor_WorldDistXZToPoint(&player->actor, &this->actor.home.pos) < 600.0f) { if (this->unk_19C != 0) { this->unk_19C--; } @@ -855,8 +857,8 @@ void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19C = 100; } if (this->unk_19C == 0) { - this->actor.shape.rot.y = (s32)(4.0f * Rand_ZeroOne()) * 0x4000 + this->actor.yawTowardsLink; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 5.0f; + this->actor.shape.rot.y = (s32)(4.0f * Rand_ZeroOne()) * 0x4000 + this->actor.yawTowardsPlayer; + this->actor.world.pos.y = player->actor.world.pos.y + 5.0f; func_80AD98F4(this, globalCtx); } } else { @@ -865,7 +867,7 @@ void func_80ADB338(EnPoSisters* this, GlobalContext* globalCtx) { func_80AD9E60(this); } else if (realMeg->actionFunc == func_80ADAE6C) { this->actor.shape.rot.y = this->actor.parent->shape.rot.y + this->unk_195 * 0x4000; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 5.0f; + this->actor.world.pos.y = player->actor.world.pos.y + 5.0f; func_80AD98F4(this, globalCtx); } else if (realMeg->actionFunc == func_80ADAFC0) { Actor_Kill(&this->actor); @@ -878,8 +880,8 @@ void func_80ADB4B0(EnPoSisters* this, GlobalContext* globalCtx) { func_80AD9E60(this); } func_80AD97C8(this, globalCtx); - this->actor.posRot.pos.y += 1.0f; - Actor_SetHeight(&this->actor, 40.0f); + this->actor.world.pos.y += 1.0f; + Actor_SetFocus(&this->actor, 40.0f); } void func_80ADB51C(EnPoSisters* this, GlobalContext* globalCtx) { @@ -895,13 +897,13 @@ void func_80ADB51C(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A -= 1; } if (this->unk_19A == 0) { - this->actor.posRot.rot.y = this->actor.shape.rot.y += 0x4000 * (s32)(Rand_ZeroOne() * 4.0f); + this->actor.world.rot.y = this->actor.shape.rot.y += 0x4000 * (s32)(Rand_ZeroOne() * 4.0f); if (this->unk_195 == 0) { func_800F5ACC(0x38); } func_80AD9F1C(this); } else { - this->actor.posRot.pos.y += 0.1f; + this->actor.world.pos.y += 0.1f; temp = this->unk_195; if (temp != 0) { if (this->unk_19A > 90) { @@ -930,7 +932,7 @@ void func_80ADB51C(EnPoSisters* this, GlobalContext* globalCtx) { } } func_80AD97C8(this, globalCtx); - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } void func_80ADB770(EnPoSisters* this, GlobalContext* globalCtx) { @@ -965,7 +967,7 @@ void func_80ADB770(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_199 &= ~0x40; } } - if (func_8002DBB0(&PLAYER->actor, &this->actor.initPosRot.pos) > 600.0f) { + if (Actor_WorldDistXZToPoint(&PLAYER->actor, &this->actor.home.pos) > 600.0f) { this->unk_199 &= ~0x40; func_80AD9C24(this, globalCtx); } else if (this->unk_19A == 0) { @@ -997,8 +999,8 @@ void func_80ADB9F0(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_22E.a = 255; if (this->unk_194 == 3) { this->actor.flags |= 1; - this->actor.initPosRot.pos.x = 1992.0f; - this->actor.initPosRot.pos.z = -1440.0f; + this->actor.home.pos.x = 1992.0f; + this->actor.home.pos.z = -1440.0f; this->unk_199 |= 0x18; func_80AD93C4(this); } else { @@ -1011,22 +1013,23 @@ void func_80ADB9F0(EnPoSisters* this, GlobalContext* globalCtx) { if (this->unk_194 != 3 && Animation_OnFrame(&this->skelAnime, 1.0f)) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); } - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } void func_80ADBB6C(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) < 10.0f) { + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) < 10.0f) { func_80ADA028(this); } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 1820); + Math_ScaledStepToS(&this->actor.world.rot.y, Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos), + 1820); } } void func_80ADBBF4(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1820); - if (this->actor.xzDistToLink < 240.0f && fabsf(this->actor.yDistToLink + 5.0f) < 30.0f) { + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1820); + if (this->actor.xzDistToPlayer < 240.0f && fabsf(this->actor.yDistToPlayer + 5.0f) < 30.0f) { func_80AD93C4(this); } } @@ -1051,7 +1054,7 @@ void func_80ADBC88(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADBD38(EnPoSisters* this, GlobalContext* globalCtx) { this->unk_19A++; - func_80AD9240(this, this->unk_19A, &this->actor.initPosRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.home.pos); if (this->unk_19A == 32) { func_80ADA1B8(this); } @@ -1081,7 +1084,7 @@ void func_80ADBEE8(EnPoSisters* this, GlobalContext* globalCtx) { if (this->unk_19A != 0) { this->unk_19A--; } - func_80AD9240(this, this->unk_19A, &this->actor.initPosRot.pos); + func_80AD9240(this, this->unk_19A, &this->actor.home.pos); if (this->unk_19A == 0) { func_80ADA2BC(this, globalCtx); } @@ -1090,7 +1093,7 @@ void func_80ADBEE8(EnPoSisters* this, GlobalContext* globalCtx) { void func_80ADBF58(EnPoSisters* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->unk_19A--; - Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 0x500); + Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0x500); if (this->unk_19A == 0 && this->unk_194 == 0) { globalCtx->envCtx.unk_BF = 4; } @@ -1106,7 +1109,7 @@ void func_80ADBF58(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80ADC034(EnPoSisters* this, GlobalContext* globalCtx) { - if (this->actor.unk_10C != 0 && this->unk_22E.a == 255) { + if (this->actor.isTargeted && this->unk_22E.a == 255) { if (this->unk_197 != 0) { this->unk_197--; } @@ -1138,9 +1141,9 @@ void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); func_80AD9C24(this, globalCtx); if (Rand_ZeroOne() < 0.2f) { - sp24.x = this->actor.posRot.pos.x; - sp24.y = this->actor.posRot.pos.y; - sp24.z = this->actor.posRot.pos.z; + sp24.x = this->actor.world.pos.x; + sp24.y = this->actor.world.pos.y; + sp24.z = this->actor.world.pos.z; Item_DropCollectible(globalCtx, &sp24, ITEM00_ARROWS_SMALL); } } else if (this->collider.base.colType == 9 || @@ -1149,7 +1152,7 @@ void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) { this->actor.freezeTimer = 0; } } else if (this->actor.colChkInfo.damageEffect == 0xF) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_199 |= 2; func_80AD98F4(this, globalCtx); } else if (this->unk_194 == 0 && this->actor.colChkInfo.damageEffect == 0xE && @@ -1190,15 +1193,15 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if (this->unk_199 & 0x10) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5); } else { Vec3f vec; UNK_TYPE sp34; - vec.x = this->actor.posRot.pos.x; - vec.y = this->actor.posRot.pos.y + 10.0f; - vec.z = this->actor.posRot.pos.z; - this->actor.groundY = + vec.x = this->actor.world.pos.x; + vec.y = this->actor.world.pos.y + 10.0f; + vec.z = this->actor.world.pos.z; + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp34, &this->actor, &vec); } @@ -1220,11 +1223,11 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != func_80ADB338) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); if (this->actionFunc == func_80ADAC70) { - this->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } else if (this->unk_199 & 2) { - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } } } @@ -1243,7 +1246,7 @@ void func_80ADC55C(EnPoSisters* this) { temp_var = this->unk_22E.b + 5; this->unk_22E.b = CLAMP_MAX(temp_var, 225); } else if (this->skelAnime.animation == &D_060008C0) { - if (this->actor.dmgEffectTimer & 2) { + if (this->actor.colorFilterTimer & 2) { this->unk_22E.r = 0; this->unk_22E.g = 0; this->unk_22E.b = 0; @@ -1311,7 +1314,7 @@ void EnPoSisters_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi } Matrix_MultVec3f(&D_80ADD7F8, &this->unk_234[0]); } else if (this->actionFunc == func_80ADBD8C) { - Matrix_MultVec3f(&D_80ADD7F8, &this->actor.initPosRot.pos); + Matrix_MultVec3f(&D_80ADD7F8, &this->actor.home.pos); } if (this->unk_198 > 0) { Color_RGBA8* color = &D_80ADD6F0[this->unk_194]; 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 fc15d97d8c..44a620f1b6 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -44,7 +44,7 @@ static s16 D_80AE1A50 = 0; const ActorInit En_Poh_InitVars = { ACTOR_EN_POH, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnPoh), @@ -175,7 +175,7 @@ static Color_RGBA8 D_80AE1B54 = { 90, 85, 50, 255 }; static Color_RGBA8 D_80AE1B58 = { 100, 90, 100, 255 }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 3200, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 3200, ICHAIN_STOP), }; static Vec3f D_80AE1B60 = { 0.0f, 3.0f, 0.0f }; @@ -204,13 +204,13 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { EnPoh* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); Collider_InitJntSph(globalCtx, &this->colliderSph); Collider_SetJntSph(globalCtx, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem); this->colliderSph.elements[0].dim.worldSphere.radius = 0; - this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.posRot.pos.x; - this->colliderSph.elements[0].dim.worldSphere.center.y = this->actor.posRot.pos.y; - this->colliderSph.elements[0].dim.worldSphere.center.z = this->actor.posRot.pos.z; + this->colliderSph.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->colliderSph.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y; + this->colliderSph.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; Collider_InitCylinder(globalCtx, &this->colliderCyl); Collider_SetCylinder(globalCtx, &this->colliderCyl, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -218,8 +218,8 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_195 = 32; this->visibilityTimer = Rand_S16Offset(700, 300); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, - this->actor.initPosRot.pos.z, 255, 255, 255, 0); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, + 255, 255, 255, 0); if (this->actor.params >= 4) { this->actor.params = EN_POH_NORMAL; } @@ -228,7 +228,7 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { if (D_80AE1A50 >= 3) { Actor_Kill(&this->actor); } else { - collectible = Item_DropCollectible(globalCtx, &this->actor.posRot.pos, 0x4000 | ITEM00_RUPEE_BLUE); + collectible = Item_DropCollectible(globalCtx, &this->actor.world.pos, 0x4000 | ITEM00_RUPEE_BLUE); if (collectible != NULL) { collectible->actor.speedXZ = 0.0f; } @@ -311,9 +311,9 @@ void func_80ADE28C(EnPoh* this) { Animation_PlayOnce(&this->skelAnime, &D_06000570); } if (this->colliderCyl.info.acHitInfo->toucher.dmgFlags & 0x0001F824) { - this->actor.posRot.rot.y = this->colliderCyl.base.ac->posRot.rot.y; + this->actor.world.rot.y = this->colliderCyl.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->colliderCyl.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->colliderCyl.base.ac) + 0x8000; } this->colliderCyl.base.acFlags &= ~AC_ON; this->actor.speedXZ = 5.0f; @@ -324,7 +324,7 @@ void func_80ADE28C(EnPoh* this) { void func_80ADE368(EnPoh* this) { Animation_MorphToLoop(&this->skelAnime, this->info->unk_18, -5.0f); this->actor.speedXZ = 5.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000; + this->actor.world.rot.y = this->actor.shape.rot.y + 0x8000; this->colliderCyl.base.acFlags |= AC_ON; this->unk_198 = 200; this->actionFunc = func_80ADF894; @@ -338,7 +338,7 @@ void EnPoh_SetupInitialAction(EnPoh* this) { this->actionFunc = func_80ADEF38; } else { Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06000FE4, 1.0f); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f; + this->actor.world.pos.y = this->actor.home.pos.y + 20.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); this->actionFunc = EnPoh_ComposerAppear; @@ -347,7 +347,7 @@ void EnPoh_SetupInitialAction(EnPoh* this) { void func_80ADE48C(EnPoh* this) { this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->unk_198 = 0; this->actor.naviEnemyId = 0xFF; this->actor.flags &= ~1; @@ -362,7 +362,7 @@ void func_80ADE4C8(EnPoh* this) { void func_80ADE514(EnPoh* this) { Animation_PlayLoop(&this->skelAnime, this->info->unk_C); - this->unk_19C = this->actor.posRot.rot.y + 0x8000; + this->unk_19C = this->actor.world.rot.y + 0x8000; this->actionFunc = func_80ADF5E0; this->actor.speedXZ = 0.0f; } @@ -370,7 +370,7 @@ void func_80ADE514(EnPoh* this) { void EnPoh_SetupDisappear(EnPoh* this) { this->unk_194 = 32; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_DISAPPEAR); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); this->actionFunc = EnPoh_Disappear; @@ -387,28 +387,28 @@ void EnPoh_SetupAppear(EnPoh* this) { void EnPoh_SetupDeath(EnPoh* this, GlobalContext* globalCtx) { this->actor.update = EnPoh_UpdateDead; this->actor.draw = EnPoh_DrawSoul; - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; Actor_SetScale(&this->actor, 0.01f); this->actor.flags |= 0x10; this->actor.gravity = -1.0f; - this->actor.shape.unk_08 = 1500.0f; - this->actor.posRot.pos.y -= 15.0f; + this->actor.shape.yOffset = 1500.0f; + this->actor.world.pos.y -= 15.0f; if (this->infoIdx != EN_POH_INFO_COMPOSER) { this->actor.shape.rot.x = -0x8000; } - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, 8); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, 8); this->unk_198 = 60; this->actionFunc = EnPoh_Death; } void func_80ADE6D4(EnPoh* this) { - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->visibilityTimer = 0; this->actor.shape.rot.y = 0; this->lightColor.r = 0; this->lightColor.a = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->actor.gravity = 0.0f; this->actor.velocity.y = 0.0f; if (this->actor.params >= EN_POH_SHARP) { @@ -421,20 +421,20 @@ void func_80ADE6D4(EnPoh* this) { this->actor.scale.x = 0.0f; this->actor.scale.y = 0.0f; this->actor.shape.rot.x = 0; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; + this->actor.home.pos.y = this->actor.world.pos.y; Audio_PlayActorSound2(&this->actor, NA_SE_EV_METAL_BOX_BOUND); this->actionFunc = func_80ADFE28; } void EnPoh_Talk(EnPoh* this, GlobalContext* globalCtx) { - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y; - Actor_SetHeight(&this->actor, -10.0f); + this->actor.home.pos.y = this->actor.world.pos.y; + Actor_SetFocus(&this->actor, -10.0f); this->colliderCyl.dim.radius = 13; this->colliderCyl.dim.height = 30; this->colliderCyl.dim.yShift = 0; - this->colliderCyl.dim.pos.x = this->actor.posRot.pos.x; - this->colliderCyl.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - this->colliderCyl.dim.pos.z = this->actor.posRot.pos.z; + this->colliderCyl.dim.pos.x = this->actor.world.pos.x; + this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f; + this->colliderCyl.dim.pos.z = this->actor.world.pos.z; this->colliderCyl.base.ocFlags1 = OC1_ON | OC1_TYPE_PLAYER; if (this->actor.params == EN_POH_FLAT || this->actor.params == EN_POH_SHARP) { if (CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { @@ -466,7 +466,7 @@ void func_80ADE950(EnPoh* this, s32 arg1) { void func_80ADE998(EnPoh* this) { this->actionFunc = EnPoh_TalkRegular; - this->actor.initPosRot.pos.y = this->actor.posRot.pos.y - 15.0f; + this->actor.home.pos.y = this->actor.world.pos.y - 15.0f; } void func_80ADE9BC(EnPoh* this) { @@ -476,8 +476,8 @@ void func_80ADE9BC(EnPoh* this) { void EnPoh_MoveTowardsPlayerHeight(EnPoh* this, GlobalContext* globalCtx) { Player* player = PLAYER; - Math_StepToF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y, 1.0f); - this->actor.posRot.pos.y += 2.5f * Math_SinS(this->unk_195 * 0x800); + Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 1.0f); + this->actor.world.pos.y += 2.5f * Math_SinS(this->unk_195 * 0x800); if (this->unk_195 != 0) { this->unk_195 -= 1; } @@ -487,10 +487,10 @@ void EnPoh_MoveTowardsPlayerHeight(EnPoh* this, GlobalContext* globalCtx) { } void func_80ADEA5C(EnPoh* this) { - if (func_8002DBB0(&this->actor, &this->actor.initPosRot.pos) > 400.0f) { - this->unk_19C = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); + if (Actor_WorldDistXZToPoint(&this->actor, &this->actor.home.pos) > 400.0f) { + this->unk_19C = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); } - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_19C, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 0x71C); } void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) { @@ -499,7 +499,7 @@ void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) { this->unk_198--; } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { func_80ADE1BC(this); } else if (this->unk_198 == 0) { EnPoh_SetupIdle(this); @@ -517,7 +517,7 @@ void EnPoh_Idle(EnPoh* this, GlobalContext* globalCtx) { } func_80ADEA5C(this); EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->actor.xzDistToLink < 200.0f && this->unk_198 < 19) { + if (this->actor.xzDistToPlayer < 200.0f && this->unk_198 < 19) { func_80ADE1BC(this); } else if (this->unk_198 == 0) { if (Rand_ZeroOne() < 0.1f) { @@ -540,18 +540,18 @@ void func_80ADEC9C(EnPoh* this, GlobalContext* globalCtx) { if (this->unk_198 != 0) { this->unk_198--; } - facingDiff = this->actor.yawTowardsLink - player->actor.shape.rot.y; + facingDiff = this->actor.yawTowardsPlayer - player->actor.shape.rot.y; if (facingDiff >= 0x3001) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x3000, 0x71C); } else if (facingDiff < -0x3000) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink - 0x3000, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer - 0x3000, 0x71C); } else { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0x71C); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C); } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->actor.xzDistToLink > 280.0f) { + if (this->actor.xzDistToPlayer > 280.0f) { EnPoh_SetupIdle(this); - } else if (this->unk_198 == 0 && this->actor.xzDistToLink < 140.0f && + } else if (this->unk_198 == 0 && this->actor.xzDistToPlayer < 140.0f && func_8002DFC8(&this->actor, 0x2AAA, globalCtx) == 0) { EnPoh_SetupAttack(this); } @@ -570,7 +570,7 @@ void EnPoh_Attack(EnPoh* this, GlobalContext* globalCtx) { } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); if (this->unk_198 >= 10) { - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0xE38); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xE38); } else if (this->unk_198 == 9) { this->actor.speedXZ = 5.0f; this->skelAnime.playSpeed = 2.0f; @@ -600,7 +600,7 @@ void func_80ADEF38(EnPoh* this, GlobalContext* globalCtx) { } else if (this->skelAnime.curFrame > 10.0f) { this->lightColor.a = ((this->skelAnime.curFrame - 10.0f) * 0.05f) * 255.0f; } - if (this->skelAnime.playSpeed < 0.5f && this->actor.xzDistToLink < 280.0f) { + if (this->skelAnime.playSpeed < 0.5f && this->actor.xzDistToPlayer < 280.0f) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR); this->skelAnime.playSpeed = 1.0f; } @@ -627,23 +627,23 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) { this->unk_198++; if (this->unk_198 < 8) { if (this->unk_198 < 5) { - vec.y = Math_SinS((this->unk_198 * 0x1000) - 0x4000) * 23.0f + (this->actor.posRot.pos.y + 40.0f); + vec.y = Math_SinS((this->unk_198 * 0x1000) - 0x4000) * 23.0f + (this->actor.world.pos.y + 40.0f); multiplier = Math_CosS((this->unk_198 * 0x1000) - 0x4000) * 23.0f; - vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.posRot.pos.x; - vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.posRot.pos.z; + vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.x; + vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * multiplier + this->actor.world.pos.z; } else { - vec.y = (this->actor.posRot.pos.y + 40.0f) + (15.0f * (this->unk_198 - 5)); - vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.x; - vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.posRot.pos.z; + vec.y = (this->actor.world.pos.y + 40.0f) + (15.0f * (this->unk_198 - 5)); + vec.x = Math_SinS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.x; + vec.z = Math_CosS(Camera_GetCamDirYaw(ACTIVE_CAM) + 0x4800) * 23.0f + this->actor.world.pos.z; } EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - vec.x = (this->actor.posRot.pos.x + this->actor.posRot.pos.x) - vec.x; - vec.z = (this->actor.posRot.pos.z + this->actor.posRot.pos.z) - vec.z; + vec.x = (this->actor.world.pos.x + this->actor.world.pos.x) - vec.x; + vec.z = (this->actor.world.pos.z + this->actor.world.pos.z) - vec.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); - vec.x = this->actor.posRot.pos.x; - vec.z = this->actor.posRot.pos.z; + vec.x = this->actor.world.pos.x; + vec.z = this->actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &vec, &D_80AE1B60, &D_80AE1B6C, this->unk_198 * 10 + 80, 0, 255, 255, 255, 255, 0, 0, 255, 1, 9, 1); if (this->unk_198 == 1) { @@ -653,7 +653,7 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) { EnPoh_SetupDeath(this, globalCtx); } else if (this->unk_198 >= 19) { newScale = (28 - this->unk_198) * 0.001f; - this->actor.posRot.pos.y += 5.0f; + this->actor.world.pos.y += 5.0f; this->actor.scale.z = newScale; this->actor.scale.y = newScale; this->actor.scale.x = newScale; @@ -665,7 +665,7 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) { void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnPoh_SetupIdle(this); this->unk_198 = 23; } else { @@ -676,10 +676,10 @@ void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) { void func_80ADF5E0(EnPoh* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_19C, 1820) != 0) { + if (Math_ScaledStepToS(&this->actor.world.rot.y, this->unk_19C, 1820) != 0) { EnPoh_SetupIdle(this); } - if (this->actor.xzDistToLink < 200.0f) { + if (this->actor.xzDistToPlayer < 200.0f) { func_80ADE1BC(this); } EnPoh_MoveTowardsPlayerHeight(this, globalCtx); @@ -689,7 +689,7 @@ void EnPoh_Disappear(EnPoh* this, GlobalContext* globalCtx) { if (this->unk_194 != 0) { this->unk_194--; } - this->actor.posRot.rot.y += 0x1000; + this->actor.world.rot.y += 0x1000; EnPoh_MoveTowardsPlayerHeight(this, globalCtx); this->lightColor.a = this->unk_194 * 7.96875f; if (this->unk_194 == 0) { @@ -700,7 +700,7 @@ void EnPoh_Disappear(EnPoh* this, GlobalContext* globalCtx) { void EnPoh_Appear(EnPoh* this, GlobalContext* globalCtx) { this->unk_194++; - this->actor.posRot.rot.y -= 0x1000; + this->actor.world.rot.y -= 0x1000; EnPoh_MoveTowardsPlayerHeight(this, globalCtx); this->lightColor.a = this->unk_194 * 7.96875f; if (this->unk_194 == 32) { @@ -715,12 +715,12 @@ void func_80ADF894(EnPoh* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); multiplier = Math_SinS(this->unk_195 * 0x800) * 3.0f; - this->actor.posRot.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y); - this->actor.posRot.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y); - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 0x71C); + this->actor.world.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y); + this->actor.world.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0x71C); EnPoh_MoveTowardsPlayerHeight(this, globalCtx); - if (this->unk_198 == 0 || this->actor.xzDistToLink > 250.0f) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + if (this->unk_198 == 0 || this->actor.xzDistToPlayer > 250.0f) { + this->actor.world.rot.y = this->actor.shape.rot.y; EnPoh_SetupIdle(this); } func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG); @@ -734,14 +734,14 @@ void EnPoh_Death(EnPoh* this, GlobalContext* globalCtx) { } if (this->actor.bgCheckFlags & 1) { objId = (this->infoIdx == EN_POH_INFO_COMPOSER) ? OBJECT_PO_COMPOSER : OBJECT_POH; - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 6.0f, 0, 1, 1, 15, objId, 10, this->info->unk_1C); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, objId, 10, this->info->unk_1C); func_80ADE6D4(this); } else if (this->unk_198 == 0) { Actor_Kill(&this->actor); return; } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4); } void func_80ADFA90(EnPoh* this, s32 arg1) { @@ -758,18 +758,18 @@ void func_80ADFA90(EnPoh* this, s32 arg1) { this->actor.scale.z = this->lightColor.a * 2.7450982e-05f; this->actor.scale.y = this->lightColor.a * 2.7450982e-05f; this->actor.scale.x = this->lightColor.a * 2.7450982e-05f; - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 0.05882353f * this->lightColor.a; + this->actor.world.pos.y = this->actor.home.pos.y + 0.05882353f * this->lightColor.a; } this->lightColor.r = this->info->lightColor.r * multiplier; this->lightColor.g = this->info->lightColor.g * multiplier; this->lightColor.b = this->info->lightColor.b * multiplier; - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->info->lightColor.r, this->info->lightColor.g, + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->info->lightColor.r, this->info->lightColor.g, this->info->lightColor.b, this->lightColor.a * 0.78431373f); } void func_80ADFE28(EnPoh* this, GlobalContext* globalCtx) { - this->actor.initPosRot.pos.y += 2.0f; + this->actor.home.pos.y += 2.0f; func_80ADFA90(this, 20); if (this->lightColor.a == 255) { EnPoh_Talk(this, globalCtx); @@ -800,17 +800,17 @@ void func_80ADFE80(EnPoh* this, GlobalContext* globalCtx) { this->actor.flags &= ~0x10000; CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base); } - this->actor.posRot.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.initPosRot.pos.y; + this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.home.pos.y; if (this->unk_195 != 0) { this->unk_195 -= 1; } if (this->unk_195 == 0) { this->unk_195 = 32; } - this->colliderCyl.dim.pos.y = this->actor.posRot.pos.y - 20.0f; - Actor_SetHeight(&this->actor, -10.0f); - Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->info->lightColor.r, this->info->lightColor.g, + this->colliderCyl.dim.pos.y = this->actor.world.pos.y - 20.0f; + Actor_SetFocus(&this->actor, -10.0f); + Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->info->lightColor.r, this->info->lightColor.g, this->info->lightColor.b, this->lightColor.a * 0.78431373f); } @@ -900,7 +900,7 @@ void EnPoh_UpdateVisibility(EnPoh* this) { this->visibilityTimer--; } if (this->lightColor.a == 255) { - if (this->actor.unk_10C != 0) { + if (this->actor.isTargeted) { this->unk_194++; this->unk_194 = CLAMP_MAX(this->unk_194, 20); } else { @@ -937,7 +937,7 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.draw = EnPoh_DrawComposer; this->colliderSph.elements[0].dim.limb = 9; this->colliderSph.elements[0].dim.modelSphere.center.y *= -1; - this->actor.shape.rot.y = this->actor.posRot.rot.y = -0x4000; + this->actor.shape.rot.y = this->actor.world.rot.y = -0x4000; this->colliderCyl.dim.radius = 20; this->colliderCyl.dim.height = 55; this->colliderCyl.dim.yShift = 15; @@ -961,7 +961,7 @@ void func_80AE067C(EnPoh* this) { temp_var = this->lightColor.b + 5; this->lightColor.b = CLAMP_MAX(temp_var, 225); } else if (this->actionFunc == func_80ADEECC) { - if (this->actor.dmgEffectTimer & 2) { + if (this->actor.colorFilterTimer & 2) { this->lightColor.r = 0; this->lightColor.g = 0; this->lightColor.b = 0; @@ -1023,21 +1023,21 @@ void EnPoh_UpdateLiving(Actor* thisx, GlobalContext* globalCtx) { } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCyl.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base); - Actor_SetHeight(&this->actor, 42.0f); + Actor_SetFocus(&this->actor, 42.0f); if (this->actionFunc != func_80ADEECC && this->actionFunc != func_80ADF574) { if (this->actionFunc == func_80ADF894) { - this->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } else { - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } } - vec.x = this->actor.posRot.pos.x; - vec.y = this->actor.posRot.pos.y + 20.0f; - vec.z = this->actor.posRot.pos.z; - this->actor.groundY = + vec.x = this->actor.world.pos.x; + vec.y = this->actor.world.pos.y + 20.0f; + vec.z = this->actor.world.pos.z; + this->actor.floorHeight = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->actor.floorPoly, &sp38, &this->actor, &vec); func_80AE089C(this); - this->actor.shape.unk_14 = this->lightColor.a; + this->actor.shape.shadowAlpha = this->lightColor.a; } s32 EnPoh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx, @@ -1073,9 +1073,9 @@ void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve } Matrix_Get(&this->unk_368); if (this->actionFunc == func_80ADF15C && this->unk_198 == 27) { - this->actor.posRot.pos.x = this->unk_368.wx; - this->actor.posRot.pos.y = this->unk_368.wy; - this->actor.posRot.pos.z = this->unk_368.wz; + this->actor.world.pos.x = this->unk_368.wx; + this->actor.world.pos.y = this->unk_368.wy; + this->actor.world.pos.z = this->unk_368.wz; } Lights_PointGlowSetInfo(&this->lightInfo, this->colliderSph.elements[0].dim.worldSphere.center.x, this->colliderSph.elements[0].dim.worldSphere.center.y, @@ -1184,8 +1184,8 @@ void EnPoh_DrawSoul(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc == EnPoh_Death) { func_80093D18(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_OPA_DISP++, this->envColor.r, this->envColor.g, this->envColor.b, 255); - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->envColor.r, this->envColor.g, this->envColor.b, 200); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->envColor.r, this->envColor.g, this->envColor.b, 200); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_poh.c", 2854), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, this->info->unk_1C); 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 0441709c66..a21b419978 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 @@ -18,7 +18,7 @@ void EnPubox_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Pu_box_InitVars = { ACTOR_EN_PU_BOX, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_PU_BOX, sizeof(EnPubox), @@ -48,14 +48,14 @@ void EnPubox_Init(Actor* thisx, GlobalContext* globalCtx) { break; } this->unk_164 = 1; - thisx->colChkInfo.unk_10 = 0x14; - thisx->colChkInfo.unk_12 = 0x32; + thisx->colChkInfo.cylRadius = 20; + thisx->colChkInfo.cylHeight = 50; thisx->uncullZoneDownward = 1200.0f; thisx->uncullZoneScale = 720.0f; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 6.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 6.0f); this->dyna.unk_160 = 0; this->dyna.unk_15C = DPM_UNK; - thisx->unk_1F = 1; + thisx->targetMode = 1; thisx->gravity = -2.0f; CollisionHeader_GetVirtual(&gPuBoxCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); @@ -71,7 +71,7 @@ void EnPubox_Update(Actor* thisx, GlobalContext* globalCtx) { EnPubox* this = THIS; thisx->speedXZ += this->dyna.unk_150; - thisx->posRot.rot.y = this->dyna.unk_158; + thisx->world.rot.y = this->dyna.unk_158; thisx->speedXZ = (thisx->speedXZ < -2.5f) ? -2.5f : ((thisx->speedXZ > 2.5f) ? 2.5f : thisx->speedXZ); Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); if (thisx->speedXZ != 0.0f) { @@ -81,8 +81,9 @@ void EnPubox_Update(Actor* thisx, GlobalContext* globalCtx) { this->dyna.unk_154 = 0.0f; this->dyna.unk_150 = 0.0f; Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, thisx->colChkInfo.unk_12, thisx->colChkInfo.unk_10, thisx->colChkInfo.unk_10, 0x1D); - thisx->posRot2.pos = thisx->posRot.pos; + Actor_UpdateBgCheckInfo(globalCtx, thisx, thisx->colChkInfo.cylHeight, thisx->colChkInfo.cylRadius, + thisx->colChkInfo.cylRadius, 0x1D); + thisx->focus.pos = thisx->world.pos; } void EnPubox_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 982797112e..f80910436d 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -32,7 +32,7 @@ void func_80AE3ECC(EnRd* this, GlobalContext* globalCtx); const ActorInit En_Rd_InitVars = { ACTOR_EN_RD, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_RD, sizeof(EnRd), @@ -98,7 +98,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), }; @@ -139,12 +139,12 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) { EnRd* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - thisx->unk_1F = 0; + thisx->targetMode = 0; thisx->colChkInfo.damageTable = &sDamageTable; ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); this->unk_310 = this->unk_30E = 0; - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 50.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 50.0f; thisx->colChkInfo.mass = MASS_HEAVY; thisx->colChkInfo.health = 8; this->unk_314 = this->unk_31D = 0xFF; @@ -192,7 +192,7 @@ void EnRd_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80AE2630(GlobalContext* globalCtx, Actor* thisx, s32 arg2) { - Actor* enemyIt = globalCtx->actorCtx.actorList[ACTORTYPE_ENEMY].first; + Actor* enemyIt = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].head; while (enemyIt != NULL) { if ((enemyIt->id != ACTOR_EN_RD) || (enemyIt == thisx) || (enemyIt->params < 0)) { @@ -219,7 +219,7 @@ void func_80AE269C(EnRd* this) { this->unk_31B = 0; this->unk_30C = (Rand_ZeroOne() * 10.0f) + 5.0f; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnRd_SetupAction(this, func_80AE2744); } @@ -260,7 +260,7 @@ void func_80AE2744(EnRd* this, GlobalContext* globalCtx) { } this->unk_305 = 0; - if ((this->actor.xzDistToLink <= 150.0f) && func_8002DDE4(globalCtx)) { + if ((this->actor.xzDistToPlayer <= 150.0f) && func_8002DDE4(globalCtx)) { if ((this->actor.params != 2) && (this->unk_305 == 0)) { func_80AE37BC(this); } else { @@ -280,7 +280,7 @@ void func_80AE2970(EnRd* this) { this->unk_30C = 6; this->actor.shape.rot.x = -0x4000; this->actor.gravity = 0.0f; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->actor.speedXZ = 0.0f; EnRd_SetupAction(this, func_80AE2A10); } @@ -289,16 +289,15 @@ void func_80AE2970(EnRd* this) { void func_80AE2A10(EnRd* this, GlobalContext* globalCtx) { if (this->actor.shape.rot.x != -0x4000) { Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0); - if (Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y, 0.3f, 2.0f, 0.3f) == 0.0f) { + if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.3f, 2.0f, 0.3f) == 0.0f) { this->actor.gravity = -3.5f; func_80AE269C(this); } } else { - if (this->actor.posRot.pos.y == this->actor.initPosRot.pos.y) { + if (this->actor.world.pos.y == this->actor.home.pos.y) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_CRY); } - if (Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == - 0.0f) { + if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) { if (this->unk_30C != 0) { this->unk_30C--; Math_SmoothStepToF(&this->actor.speedXZ, 6.0f, 0.3f, 1.0f, 0.3f); @@ -323,27 +322,27 @@ void func_80AE2C1C(EnRd* this, GlobalContext* globalCtx) { Color_RGBA8 sp3C = D_80AE4928; Player* player = PLAYER; s32 pad; - s16 sp32 = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->unk_30E - this->unk_310; + s16 sp32 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->unk_30E - this->unk_310; this->skelAnime.playSpeed = this->actor.speedXZ; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xFA, 0); Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); - if (func_8002DB6C(&player->actor, &this->actor.initPosRot.pos) >= 150.0f) { + if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { func_80AE2F50(this, globalCtx); } - if ((ABS(sp32) < 0x1554) && (func_8002DB48(&this->actor, &player->actor) <= 150.0f)) { + if ((ABS(sp32) < 0x1554) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 150.0f)) { if (!(player->stateFlags1 & 0x2C6080) && !(player->stateFlags2 & 0x80)) { if (this->unk_306 == 0) { if (!(this->unk_312 & 0x80)) { player->actor.freezeTimer = 40; func_8008EEAC(globalCtx, &this->actor); PLAYER->unk_684 = &this->actor; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); } this->unk_306 = 0x3C; Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); @@ -355,7 +354,7 @@ void func_80AE2C1C(EnRd* this, GlobalContext* globalCtx) { DECR(this->unk_307); - if ((this->unk_307 == 0) && (func_8002DB48(&this->actor, &player->actor) <= 45.0f) && + if ((this->unk_307 == 0) && (Actor_WorldDistXYZToActor(&this->actor, &player->actor) <= 45.0f) && (func_8002E084(&this->actor, 0x38E3))) { player->actor.freezeTimer = 0; if (globalCtx->grabPlayer(globalCtx, player)) { @@ -387,13 +386,13 @@ void func_80AE2F50(EnRd* this, GlobalContext* globalCtx) { void func_80AE2FD0(EnRd* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 pad; - s16 targetY = func_8002DAC0(&this->actor, &this->actor.initPosRot.pos); + s16 targetY = Actor_WorldYawTowardPoint(&this->actor, &this->actor.home.pos); - if (func_8002DB6C(&this->actor, &this->actor.initPosRot.pos) >= 5.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &this->actor.home.pos) >= 5.0f) { Math_SmoothStepToS(&this->actor.shape.rot.y, targetY, 1, 0x1C2, 0); } else { this->actor.speedXZ = 0.0f; - if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.initPosRot.rot.y, 1, 0x1C2, 0) == 0) { + if (Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 0x1C2, 0) == 0) { if (this->actor.params != 2) { func_80AE269C(this); } else { @@ -404,12 +403,12 @@ void func_80AE2FD0(EnRd* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x64, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x64, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); if (!(player->stateFlags1 & 0x2C6080) && !(player->stateFlags2 & 0x80) && - (func_8002DB6C(&player->actor, &this->actor.initPosRot.pos) < 150.0f)) { - this->actor.unk_1F = 0; + (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) { + this->actor.targetMode = 0; func_80AE2B90(this, globalCtx); } else if (this->actor.params > 0) { if (this->actor.parent != NULL) { @@ -438,13 +437,13 @@ void func_80AE3260(EnRd* this, GlobalContext* globalCtx) { if (this->actor.parent != NULL) { s32 pad; s16 targetY; - Vec3f thisPos = this->actor.parent->posRot.pos; + Vec3f thisPos = this->actor.parent->world.pos; - targetY = func_8002DAC0(&this->actor, &thisPos); + targetY = Actor_WorldYawTowardPoint(&this->actor, &thisPos); Math_SmoothStepToS(&this->actor.shape.rot.y, targetY, 1, 0xFA, 0); - if (func_8002DB6C(&this->actor, &thisPos) >= 45.0f) { + if (Actor_WorldDistXYZToPoint(&this->actor, &thisPos) >= 45.0f) { this->actor.speedXZ = 0.4f; } else { this->actor.speedXZ = 0.0f; @@ -462,7 +461,7 @@ void func_80AE3260(EnRd* this, GlobalContext* globalCtx) { func_80AE2B90(this, globalCtx); } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; SkelAnime_Update(&this->skelAnime); if (this->skelAnime.curFrame == 10.0f || this->skelAnime.curFrame == 22.0f) { @@ -494,7 +493,7 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { Animation_PlayLoop(&this->skelAnime, &D_06004268); this->unk_304++; globalCtx->damagePlayer(globalCtx, -8); - func_800AA000(this->actor.xzDistToLink, 0xFF, 1, 0xC); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 1, 0xC); this->unk_319 = 0x14; case 0: Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x5DC, 0); @@ -509,16 +508,16 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { } if (LINK_IS_CHILD) { - Math_SmoothStepToF(&this->actor.shape.unk_08, -1500.0f, 1.0f, 150.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f); } - Math_SmoothStepToF(&this->actor.posRot.pos.x, - (Math_SinS(player->actor.shape.rot.y) * -25.0f) + player->actor.posRot.pos.x, 1.0f, - 10.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y, 1.0f, 10.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, - (Math_CosS(player->actor.shape.rot.y) * -25.0f) + player->actor.posRot.pos.z, 1.0f, - 10.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.x, + (Math_SinS(player->actor.shape.rot.y) * -25.0f) + player->actor.world.pos.x, 1.0f, 10.0f, + 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, player->actor.world.pos.y, 1.0f, 10.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.z, + (Math_CosS(player->actor.shape.rot.y) * -25.0f) + player->actor.world.pos.z, 1.0f, 10.0f, + 0.0f); Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 0x1770, 0); if (this->skelAnime.curFrame == 0.0f) { @@ -528,21 +527,21 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { if (this->unk_319 == 0) { globalCtx->damagePlayer(globalCtx, -8); - func_800AA000(this->actor.xzDistToLink, 0xF0, 1, 0xC); + func_800AA000(this->actor.xzDistToPlayer, 0xF0, 1, 0xC); this->unk_319 = 0x14; func_8002F7DC(&player->actor, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92); } break; case 3: if (LINK_IS_CHILD) { - Math_SmoothStepToF(&this->actor.shape.unk_08, 0, 1.0f, 400.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, 0, 1.0f, 400.0f, 0.0f); } break; case 4: if (LINK_IS_CHILD) { - Math_SmoothStepToF(&this->actor.shape.unk_08, 0, 1.0f, 400.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, 0, 1.0f, 400.0f, 0.0f); } - this->actor.unk_1F = 0; + this->actor.targetMode = 0; this->actor.flags |= 1; this->unk_306 = 0xA; this->unk_307 = 0xF; @@ -563,12 +562,12 @@ void func_80AE3834(EnRd* this, GlobalContext* globalCtx) { Color_RGBA8 sp30 = D_80AE4938; Color_RGBA8 sp2C = D_80AE493C; Player* player = PLAYER; - s16 temp_v0 = this->actor.yawTowardsLink - this->actor.shape.rot.y - this->unk_30E - this->unk_310; + s16 temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y - this->unk_30E - this->unk_310; if (ABS(temp_v0) < 0x2008) { if (!(this->unk_312 & 0x80)) { player->actor.freezeTimer = 60; - func_800AA000(this->actor.xzDistToLink, 0xFF, 0x14, 0x96); + func_800AA000(this->actor.xzDistToPlayer, 0xFF, 0x14, 0x96); func_8008EEAC(globalCtx, &this->actor); } Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_AIM); @@ -625,15 +624,15 @@ void func_80AE3B18(EnRd* this, GlobalContext* globalCtx) { this->actor.speedXZ += 0.15f; } - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x12C, 0); Math_SmoothStepToS(&this->unk_310, 0, 1, 0x12C, 0); if (SkelAnime_Update(&this->skelAnime)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.parent != NULL) { func_80AE31DC(this); - } else if (func_8002DB6C(&player->actor, &this->actor.initPosRot.pos) >= 150.0f) { + } else if (Actor_WorldDistXYZToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) { func_80AE2F50(this, globalCtx); } else { func_80AE2B90(this, globalCtx); @@ -654,8 +653,8 @@ void func_80AE3C20(EnRd* this) { } void func_80AE3C98(EnRd* this, GlobalContext* globalCtx) { - if (this->actor.type != ACTORTYPE_PROP) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + if (this->actor.category != ACTORCAT_PROP) { + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); } Math_SmoothStepToS(&this->unk_30E, 0, 1, 0x7D0, 0); @@ -686,7 +685,7 @@ void func_80AE3C98(EnRd* this, GlobalContext* globalCtx) { void func_80AE3DE4(EnRd* this) { this->unk_31B = 1; this->actor.speedXZ = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (gSaveContext.unk_1422 != 0) { this->unk_318 = 1; this->unk_316 = 0x258; @@ -713,11 +712,11 @@ void func_80AE3ECC(EnRd* this, GlobalContext* globalCtx) { } } - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { if (this->actor.colChkInfo.health == 0) { func_80AE2630(globalCtx, &this->actor, 1); func_80AE3C20(this); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90); } else { func_80AE3A8C(this); } @@ -729,13 +728,13 @@ void func_80AE3F9C(EnRd* this, GlobalContext* globalCtx) { s16 temp2; s16 temp3; - temp1 = this->actor.yawTowardsLink - (s16)(this->actor.shape.rot.y + this->unk_310); + temp1 = this->actor.yawTowardsPlayer - (s16)(this->actor.shape.rot.y + this->unk_310); temp2 = CLAMP(temp1, -500, 500); temp1 -= this->unk_30E; temp3 = CLAMP(temp1, -500, 500); - if ((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y) >= 0) { + if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0) { this->unk_310 += ABS(temp2); this->unk_30E += ABS(temp3); } else { @@ -788,7 +787,7 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.health == 0) { func_80AE2630(globalCtx, &this->actor, 1); func_80AE3C20(this); - Item_DropCollectibleRandom(globalCtx, 0, &this->actor.posRot.pos, 0x90); + Item_DropCollectibleRandom(globalCtx, 0, &this->actor.world.pos, 0x90); } else { func_80AE3A8C(this); } @@ -820,7 +819,7 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actor.shape.rot.x == 0) && (this->unk_31B != 8) && (this->actor.speedXZ != 0.0f)) { - func_8002E4B4(globalCtx, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D); } if (this->unk_31B == 7) { @@ -828,8 +827,8 @@ void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) { } } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 50.0f; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 50.0f; if ((this->actor.colChkInfo.health > 0) && (this->unk_31B != 8)) { Collider_UpdateCylinder(&this->actor, &this->collider); @@ -858,7 +857,7 @@ void EnRd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec s32 idx = -1; Vec3f destPos; - if ((this->unk_31A != 0) || ((this->actor.dmgEffectTimer != 0) && (this->actor.dmgEffectParams & 0x4000))) { + if ((this->unk_31A != 0) || ((this->actor.colorFilterTimer != 0) && (this->actor.colorFilterParams & 0x4000))) { switch (limbIndex - 1) { case 23: idx = 0; @@ -904,7 +903,7 @@ void EnRd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnRd* this = THIS; - Vec3f thisPos = thisx->posRot.pos; + Vec3f thisPos = thisx->world.pos; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_rd.c", 1679); @@ -917,7 +916,7 @@ void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx) { POLY_OPA_DISP); func_80033C30(&thisPos, &D_80AE4958, 255, globalCtx); if (this->unk_31A != 0) { - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->unk_31A--; if (this->unk_31A % 4 == 0) { EffectSsEnFire_SpawnVec3s(globalCtx, thisx, &this->firePos[this->unk_31A >> 2], 0x4B, 0, 0, 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 f5a563e14a..9f89635400 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -68,7 +68,7 @@ static DamageTable sDamageTable = { const ActorInit En_Reeba_InitVars = { ACTOR_EN_REEBA, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_REEBA, sizeof(EnReeba), @@ -107,9 +107,9 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) { s32 surfaceType; this->actor.naviEnemyId = 0x47; - this->actor.unk_1F = 3; + this->actor.targetMode = 3; this->actor.gravity = -3.5f; - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; SkelAnime_Init(globalCtx, &this->skelanime, &D_06001EE8, &D_060001E4, this->jointTable, this->morphTable, 18); this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 4; @@ -126,15 +126,15 @@ void EnReeba_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.health = 20; this->collider.info.toucher.effect = 4; this->collider.info.toucher.damage = 16; - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); } - this->actor.shape.unk_08 = this->unk_284 = this->scale * -27500.0f; - ActorShape_Init(&this->actor.shape, this->actor.shape.unk_08, ActorShadow_DrawFunc_Circle, 0.0f); + this->actor.shape.yOffset = this->unk_284 = this->scale * -27500.0f; + ActorShape_Init(&this->actor.shape, this->actor.shape.yOffset, ActorShadow_DrawCircle, 0.0f); this->actor.colChkInfo.damageTable = &sDamageTable; - func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); - surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((surfaceType != 4) && (surfaceType != 7)) { Actor_Kill(&this->actor); @@ -182,7 +182,7 @@ void func_80AE4F40(EnReeba* this, GlobalContext* globalCtx) { } this->actor.flags &= ~0x08000000; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; if (this->isBig) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_BIG_APPEAR); @@ -200,34 +200,35 @@ void func_80AE5054(EnReeba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelanime); if ((globalCtx->gameplayFrames % 4) == 0) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.shape.unk_10, 1, 8.0f, 500, 10, 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, 10, + 1); } if (this->unk_278 == 0) { - Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 1.0f, 1.0f); - if (this->actor.shape.unk_08 < 0.0f) { - Math_ApproachZeroF(&this->actor.shape.unk_08, 1.0f, this->unk_288); + Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 1.0f, 1.0f); + if (this->actor.shape.yOffset < 0.0f) { + Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, this->unk_288); Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f); } else { this->unk_288 = 0.0f; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; playerLinearVel = player->linearVelocity; switch (this->unk_280) { case 0: - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; break; case 1: - this->actor.posRot.rot.y = this->actor.yawTowardsLink + (800.0f * playerLinearVel); + this->actor.world.rot.y = this->actor.yawTowardsPlayer + (800.0f * playerLinearVel); break; case 2: case 3: - this->actor.posRot.rot.y = - this->actor.yawTowardsLink + - (player->actor.shape.rot.y - this->actor.yawTowardsLink) * (playerLinearVel * 0.15f); + this->actor.world.rot.y = + this->actor.yawTowardsPlayer + + (player->actor.shape.rot.y - this->actor.yawTowardsPlayer) * (playerLinearVel * 0.15f); break; case 4: - this->actor.posRot.rot.y = this->actor.yawTowardsLink - (800.0f * playerLinearVel); + this->actor.world.rot.y = this->actor.yawTowardsPlayer - (800.0f * playerLinearVel); break; } @@ -247,16 +248,16 @@ void func_80AE5270(EnReeba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelanime); - if (this->actor.shape.unk_10 < 12.0f) { - Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 3.0f, 1.0f); + if (this->actor.shape.shadowScale < 12.0f) { + Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 3.0f, 1.0f); } - surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); if ((surfaceType != 4) && (surfaceType != 7)) { this->actor.speedXZ = 0.0f; this->actionfunc = func_80AE5688; - } else if ((this->unk_272 == 0) || (this->actor.xzDistToLink < 30.0f) || (this->actor.xzDistToLink > 400.0f) || + } else if ((this->unk_272 == 0) || (this->actor.xzDistToPlayer < 30.0f) || (this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & 8)) { this->actionfunc = func_80AE5688; } else if (this->unk_274 == 0) { @@ -278,21 +279,21 @@ void func_80AE53AC(EnReeba* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelanime); - if (this->actor.shape.unk_10 < 12.0f) { - Math_ApproachF(&this->actor.shape.unk_10, 12.0f, 3.0f, 1.0f); + if (this->actor.shape.shadowScale < 12.0f) { + Math_ApproachF(&this->actor.shape.shadowScale, 12.0f, 3.0f, 1.0f); } - surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + surfaceType = func_80041D4C(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); - if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToLink > 400.0f) || + if (((surfaceType != 4) && (surfaceType != 7)) || (this->actor.xzDistToPlayer > 400.0f) || (this->actor.bgCheckFlags & 8)) { this->actionfunc = func_80AE5688; } else { - if ((this->actor.xzDistToLink < 70.0f) && (this->unk_270 == 0)) { + if ((this->actor.xzDistToPlayer < 70.0f) && (this->unk_270 == 0)) { this->unk_270 = 30; } - speed = (this->actor.xzDistToLink - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f); + speed = (this->actor.xzDistToPlayer - 20.0f) / ((Rand_ZeroOne() * 50.0f) + 150.0f); this->actor.speedXZ += speed * 1.8f; if (this->actor.speedXZ >= 3.0f) { this->actor.speedXZ = 3.0f; @@ -301,10 +302,10 @@ void func_80AE53AC(EnReeba* this, GlobalContext* globalCtx) { this->actor.speedXZ = -3.0f; } - yawDiff = (this->unk_270 == 0) ? this->actor.yawTowardsLink : -this->actor.yawTowardsLink; - yawDiff -= this->actor.posRot.rot.y; + yawDiff = (this->unk_270 == 0) ? this->actor.yawTowardsPlayer : -this->actor.yawTowardsPlayer; + yawDiff -= this->actor.world.rot.y; yaw = (yawDiff > 0) ? ((yawDiff / 31.0f) + 10.0f) : ((yawDiff / 31.0f) - 10.0f); - this->actor.posRot.rot.y += yaw * 2.0f; + this->actor.world.rot.y += yaw * 2.0f; if (this->unk_274 == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_MOVE); @@ -334,17 +335,17 @@ void func_80AE5688(EnReeba* this, GlobalContext* globalCtx) { } void func_80AE56E0(EnReeba* this, GlobalContext* globalCtx) { - Math_ApproachZeroF(&this->actor.shape.unk_10, 1.0f, 0.3f); + Math_ApproachZeroF(&this->actor.shape.shadowScale, 1.0f, 0.3f); Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.3f); SkelAnime_Update(&this->skelanime); - if ((this->unk_284 + 10.0f) <= this->actor.shape.unk_08) { + if ((this->unk_284 + 10.0f) <= this->actor.shape.yOffset) { if ((globalCtx->gameplayFrames % 4) == 0) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, this->actor.shape.unk_10, 1, 8.0f, 500, 10, - 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale, 1, 8.0f, 500, + 10, 1); } - Math_ApproachF(&this->actor.shape.unk_08, this->unk_284, 1.0f, this->unk_288); + Math_ApproachF(&this->actor.shape.yOffset, this->unk_284, 1.0f, this->unk_288); Math_ApproachF(&this->unk_288, 300.0f, 1.0f, 5.0f); } else { Actor_Kill(&this->actor); @@ -354,7 +355,7 @@ void func_80AE56E0(EnReeba* this, GlobalContext* globalCtx) { void func_80AE57F0(EnReeba* this, GlobalContext* globalCtx) { this->unk_276 = 14; this->actor.speedXZ = -8.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); this->actionfunc = func_80AE5854; } @@ -378,7 +379,7 @@ void func_80AE5854(EnReeba* this, GlobalContext* globalCtx) { void func_80AE58EC(EnReeba* this, GlobalContext* globalCtx) { this->unk_278 = 14; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = -8.0f; this->actor.flags |= 0x8000000; this->actor.flags &= ~5; @@ -398,9 +399,9 @@ void func_80AE5938(EnReeba* this, GlobalContext* globalCtx) { if ((this->unk_27E == 4) || (this->actor.colChkInfo.health != 0)) { if (this->unk_27E == 2) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(20.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(20.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(20.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f); scale = 3.0f; if (this->isBig) { @@ -425,9 +426,9 @@ void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx) { if (this->unk_278 != 0) { if ((this->unk_27E == 2) && ((this->unk_278 & 0xF) == 0)) { - pos.x = this->actor.posRot.pos.x + Rand_CenteredFloat(20.0f); - pos.y = this->actor.posRot.pos.y + Rand_CenteredFloat(20.0f); - pos.z = this->actor.posRot.pos.z + Rand_CenteredFloat(20.0f); + pos.x = this->actor.world.pos.x + Rand_CenteredFloat(20.0f); + pos.y = this->actor.world.pos.y + Rand_CenteredFloat(20.0f); + pos.z = this->actor.world.pos.z + Rand_CenteredFloat(20.0f); scale = 3.0f; if (this->isBig) { @@ -445,7 +446,7 @@ void func_80AE5A9C(EnReeba* this, GlobalContext* globalCtx) { void func_80AE5BC4(EnReeba* this, GlobalContext* globalCtx) { this->actor.speedXZ = -8.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); this->unk_278 = 14; this->actor.flags &= ~1; @@ -466,9 +467,9 @@ void func_80AE5C38(EnReeba* this, GlobalContext* globalCtx) { Math_ApproachZeroF(&this->scale, 0.1f, 0.01f); if (this->scale < 0.01f) { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y; + pos.z = this->actor.world.pos.z; velocity.y = 4.0f; @@ -604,14 +605,14 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) { } Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 0x1D); if (this->collider.base.atFlags & AT_BOUNCED) { this->collider.base.atFlags &= ~AT_BOUNCED; if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) { this->actor.speedXZ = 8.0f; - this->actor.posRot.rot.y *= -1.0f; + this->actor.world.rot.y *= -1.0f; this->unk_272 = 14; this->actionfunc = func_80AE561C; return; @@ -625,21 +626,21 @@ void EnReeba_Update(Actor* thisx, GlobalContext* globalCtx2) { } } - this->actor.posRot2.pos = this->actor.posRot.pos; + this->actor.focus.pos = this->actor.world.pos; if (!this->isBig) { - this->actor.posRot2.pos.y += 15.0f; + this->actor.focus.pos.y += 15.0f; } else { - this->actor.posRot2.pos.y += 30.0f; + this->actor.focus.pos.y += 30.0f; } Collider_UpdateCylinder(&this->actor, &this->collider); - if ((this->actor.shape.unk_08 >= -700.0f) && (this->actor.colChkInfo.health > 0) && + if ((this->actor.shape.yOffset >= -700.0f) && (this->actor.colChkInfo.health > 0) && (this->actionfunc != func_80AE56E0)) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (!(this->actor.shape.unk_08 < 0.0f)) { + if (!(this->actor.shape.yOffset < 0.0f)) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if ((this->actionfunc == func_80AE5270) || (this->actionfunc == func_80AE53AC)) { @@ -670,10 +671,10 @@ void EnReeba_Draw(Actor* thisx, GlobalContext* globalCtx) { if (BREG(0)) { Vec3f debugPos; - debugPos.x = (Math_SinS(this->actor.posRot.rot.y) * 30.0f) + this->actor.posRot.pos.x; - debugPos.y = this->actor.posRot.pos.y + 20.0f; - debugPos.z = (Math_CosS(this->actor.posRot.rot.y) * 30.0f) + this->actor.posRot.pos.z; - DebugDisplay_AddObject(debugPos.x, debugPos.y, debugPos.z, this->actor.posRot.rot.x, this->actor.posRot.rot.y, - this->actor.posRot.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); + debugPos.x = (Math_SinS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.x; + debugPos.y = this->actor.world.pos.y + 20.0f; + debugPos.z = (Math_CosS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.z; + DebugDisplay_AddObject(debugPos.x, debugPos.y, debugPos.z, this->actor.world.rot.x, this->actor.world.rot.y, + this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } 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 cbc960cf29..63018b1ec0 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 @@ -18,7 +18,7 @@ void EnRiverSound_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_River_Sound_InitVars = { ACTOR_EN_RIVER_SOUND, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnRiverSound), 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 6c0af74f18..4fb1c4b997 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -63,7 +63,7 @@ void func_80AE7358(EnRl* this) { this->drawConfig = 0; this->alpha = 0; this->lightBallSpawned = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_19C = 0.0f; } @@ -83,7 +83,7 @@ void func_80AE73D8(EnRl* this, GlobalContext* globalCtx) { } void func_80AE744C(EnRl* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 func_80AE7494(EnRl* this) { @@ -128,9 +128,9 @@ void func_80AE7590(EnRl* this, GlobalContext* globalCtx) { globalCtx->csCtx.npcActions[6] != NULL && globalCtx->csCtx.npcActions[6]->action == 2 && !this->lightMedallionGiven) { player = PLAYER; - pos.x = player->actor.posRot.pos.x; - pos.y = player->actor.posRot.pos.y + 80.0f; - pos.z = player->actor.posRot.pos.z; + pos.x = player->actor.world.pos.x; + pos.y = player->actor.world.pos.y + 80.0f; + pos.z = player->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, pos.x, pos.y, pos.z, 0, 0, 0, 0xE); Item_Give(globalCtx, ITEM_MEDALLION_LIGHT); this->lightMedallionGiven = 1; @@ -142,7 +142,7 @@ void func_80AE7668(EnRl* this, GlobalContext* globalCtx) { this->drawConfig = 1; this->action = 1; - player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000; + player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; } void func_80AE7698(EnRl* this, GlobalContext* globalCtx) { @@ -196,12 +196,12 @@ void func_80AE7838(EnRl* this, GlobalContext* globalCtx) { void func_80AE7878(EnRl* this, GlobalContext* globalCtx) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007B38, &D_06000A3C, NULL, NULL, 0); this->action = 4; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AE78D4(EnRl* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(18) + 22.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 5); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(18) + 22.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 5); } void func_80AE7954(EnRl* this, GlobalContext* globalCtx) { @@ -209,7 +209,7 @@ void func_80AE7954(EnRl* this, GlobalContext* globalCtx) { this->action = 5; this->drawConfig = 2; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_19C = 0.0f; } } @@ -225,7 +225,7 @@ void func_80AE79A4(EnRl* this, GlobalContext* globalCtx) { this->drawConfig = 1; *unk_19C = kREG(5) + 10.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; return; } } else { @@ -235,13 +235,13 @@ void func_80AE79A4(EnRl* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_19C = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } alpha = (*unk_19C / (kREG(5) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } void func_80AE7AF8(EnRl* this, GlobalContext* globalCtx) { @@ -258,7 +258,7 @@ void func_80AE7AF8(EnRl* this, GlobalContext* globalCtx) { func_80AE78D4(this, globalCtx); this->lightBallSpawned = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -340,7 +340,7 @@ void EnRl_Update(Actor* thisx, GlobalContext* globalCtx) { void EnRl_Init(Actor* thisx, GlobalContext* globalCtx) { EnRl* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 50.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); if (this->actor.params == 2) { func_80AE7878(this, globalCtx); } else { @@ -388,7 +388,7 @@ void EnRl_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Rl_InitVars = { ACTOR_EN_RL, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_RL, sizeof(EnRl), 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 13874581e0..1b7dbe97cd 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -69,7 +69,7 @@ extern Gfx D_06000470[]; const ActorInit En_Rr_InitVars = { ACTOR_EN_RR, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_RR, sizeof(EnRr), @@ -159,8 +159,8 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 55, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; void EnRr_Init(Actor* thisx, GlobalContext* globalCtx2) { @@ -175,7 +175,7 @@ void EnRr_Init(Actor* thisx, GlobalContext* globalCtx2) { Collider_SetCylinderType1(globalCtx, &this->collider1, &this->actor, &sCylinderInit1); Collider_InitCylinder(globalCtx, &this->collider2); Collider_SetCylinderType1(globalCtx, &this->collider2, &this->actor, &sCylinderInit2); - Actor_SetHeight(&this->actor, 30.0f); + Actor_SetFocus(&this->actor, 30.0f); this->actor.scale.y = 0.013f; this->actor.scale.x = this->actor.scale.z = 0.014f; this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -326,7 +326,7 @@ void EnRr_SetupReleasePlayer(EnRr* this, GlobalContext* globalCtx) { } osSyncPrintf(VT_FGCOL(YELLOW) "%s[%d] : Rr_Catch_Cancel" VT_RST "\n", "../z_en_rr.c", 650); func_8002F6D4(globalCtx, &this->actor, 4.0f, this->actor.shape.rot.y, 12.0f, 8); - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->actionFunc = EnRr_Approach; Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_THROW); } else if (this->actor.colChkInfo.health != 0) { @@ -476,7 +476,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.health == 0) { this->dropType = RR_DROP_RANDOM_RUPEE; } - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->effectTimer = 20; func_8003426C(&this->actor, 0, 0xFF, 0x2000, 0x50); } @@ -497,7 +497,7 @@ void EnRr_CollisionCheck(EnRr* this, GlobalContext* globalCtx) { return; } } - if ((this->ocTimer == 0) && (this->actor.dmgEffectTimer == 0) && (player->invincibilityTimer == 0) && + if ((this->ocTimer == 0) && (this->actor.colorFilterTimer == 0) && (player->invincibilityTimer == 0) && !(player->stateFlags2 & 0x80) && ((this->collider1.base.ocFlags1 & OC1_HIT) || (this->collider2.base.ocFlags1 & OC1_HIT))) { this->collider1.base.ocFlags1 &= ~OC1_HIT; @@ -571,18 +571,18 @@ void EnRr_UpdateBodySegments(EnRr* this, GlobalContext* globalCtx) { } void EnRr_Approach(EnRr* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x1F4, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; - if ((this->actionTimer == 0) && (this->actor.xzDistToLink < 160.0f)) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1F4, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; + if ((this->actionTimer == 0) && (this->actor.xzDistToPlayer < 160.0f)) { EnRr_SetupReach(this); - } else if ((this->actor.xzDistToLink < 400.0f) && (this->actor.speedXZ == 0.0f)) { + } else if ((this->actor.xzDistToPlayer < 400.0f) && (this->actor.speedXZ == 0.0f)) { EnRr_SetSpeed(this, 2.0f); } } void EnRr_Reach(EnRr* this, GlobalContext* globalCtx) { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x1F4, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1F4, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; switch (this->reachState) { case REACH_EXTEND: if (this->actionTimer == 0) { @@ -621,7 +621,7 @@ void EnRr_Reach(EnRr* this, GlobalContext* globalCtx) { void EnRr_GrabPlayer(EnRr* this, GlobalContext* globalCtx) { Player* player = PLAYER; - func_800AA000(this->actor.xyzDistToLinkSq, 120, 2, 120); + func_800AA000(this->actor.xyzDistToPlayerSq, 120, 2, 120); if ((this->frameCount % 8) == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_EAT); } @@ -629,9 +629,9 @@ void EnRr_GrabPlayer(EnRr* this, GlobalContext* globalCtx) { if ((this->grabTimer == 0) || !(player->stateFlags2 & 0x80)) { EnRr_SetupReleasePlayer(this, globalCtx); } else { - Math_ApproachF(&player->actor.posRot.pos.x, this->mouthPos.x, 1.0f, 30.0f); - Math_ApproachF(&player->actor.posRot.pos.y, this->mouthPos.y + this->swallowOffset, 1.0f, 30.0f); - Math_ApproachF(&player->actor.posRot.pos.z, this->mouthPos.z, 1.0f, 30.0f); + Math_ApproachF(&player->actor.world.pos.x, this->mouthPos.x, 1.0f, 30.0f); + Math_ApproachF(&player->actor.world.pos.y, this->mouthPos.y + this->swallowOffset, 1.0f, 30.0f); + Math_ApproachF(&player->actor.world.pos.z, this->mouthPos.z, 1.0f, 30.0f); Math_ApproachF(&this->swallowOffset, -55.0f, 1.0f, 5.0f); } } @@ -639,9 +639,9 @@ void EnRr_GrabPlayer(EnRr* this, GlobalContext* globalCtx) { void EnRr_Damage(EnRr* this, GlobalContext* globalCtx) { s32 i; - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { EnRr_SetupApproach(this); - } else if ((this->actor.dmgEffectTimer & 8) != 0) { + } else if ((this->actor.colorFilterTimer & 8) != 0) { for (i = 1; i < 5; i++) { this->bodySegs[i].rotTarget.z = 5000.0f; } @@ -665,9 +665,9 @@ void EnRr_Death(EnRr* this, GlobalContext* globalCtx) { } else if (this->frameCount >= 95) { Vec3f dropPos; - dropPos.x = this->actor.posRot.pos.x; - dropPos.y = this->actor.posRot.pos.y; - dropPos.z = this->actor.posRot.pos.z; + dropPos.x = this->actor.world.pos.x; + dropPos.y = this->actor.world.pos.y; + dropPos.z = this->actor.world.pos.z; switch (this->eatenShield) { case PLAYER_SHIELD_DEKU: Item_DropCollectible(globalCtx, &dropPos, ITEM00_SHIELD_DEKU); @@ -713,9 +713,9 @@ void EnRr_Death(EnRr* this, GlobalContext* globalCtx) { Vec3f vel; Vec3f accel; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + 20.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + 20.0f; + pos.z = this->actor.world.pos.z; vel.x = 0.0f; vel.y = 0.0f; vel.z = 0.0f; @@ -736,8 +736,8 @@ void EnRr_Retreat(EnRr* this, GlobalContext* globalCtx) { this->retreat = false; this->actionFunc = EnRr_Approach; } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink + 0x8000, 0xA, 0x3E8, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0xA, 0x3E8, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.speedXZ == 0.0f) { EnRr_SetSpeed(this, 2.0f); } @@ -745,7 +745,7 @@ void EnRr_Retreat(EnRr* this, GlobalContext* globalCtx) { } void EnRr_Stunned(EnRr* this, GlobalContext* globalCtx) { - if (this->actor.dmgEffectTimer == 0) { + if (this->actor.colorFilterTimer == 0) { this->stopScroll = false; if (this->hasPlayer) { EnRr_SetupReleasePlayer(this, globalCtx); @@ -782,9 +782,9 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { this->effectTimer--; } - Actor_SetHeight(&this->actor, 30.0f); + Actor_SetFocus(&this->actor, 30.0f); EnRr_UpdateBodySegments(this, globalCtx); - if (!this->isDead && ((this->actor.dmgEffectTimer == 0) || !(this->actor.dmgEffectParams & 0x4000))) { + if (!this->isDead && ((this->actor.colorFilterTimer == 0) || !(this->actor.colorFilterParams & 0x4000))) { EnRr_CollisionCheck(this, globalCtx); } @@ -812,7 +812,7 @@ void EnRr_Update(Actor* thisx, GlobalContext* globalCtx) { this->collider1.base.ocFlags1 &= ~OC1_HIT; this->collider1.base.acFlags &= ~AC_HIT; } - func_8002E4B4(globalCtx, &this->actor, 20.0f, 30.0f, 20.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 30.0f, 20.0f, 7); if (!this->stopScroll) { Math_ApproachF(&this->segPhaseVel, this->segPhaseVelTarget, 1.0f, 50.0f); Math_ApproachF(&this->segPulsePhaseDiff, 4.0f, 1.0f, 5.0f); @@ -879,7 +879,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx) { segMtx++; Matrix_MultVec3f(&zeroVec, &this->effectPos[i]); } - this->effectPos[0] = this->actor.posRot.pos; + this->effectPos[0] = this->actor.world.pos; Matrix_MultVec3f(&zeroVec, &this->mouthPos); gSPDisplayList(POLY_XLU_DISP++, D_06000470); @@ -888,7 +888,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx) { Vec3f effectPos; s16 effectTimer = this->effectTimer - 1; - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; if ((effectTimer & 1) == 0) { s32 segIndex = 4 - (effectTimer >> 2); s32 offIndex = (effectTimer >> 1) & 3; @@ -896,7 +896,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx) { effectPos.x = this->effectPos[segIndex].x + sEffectOffsets[offIndex].x + Rand_CenteredFloat(10.0f); effectPos.y = this->effectPos[segIndex].y + sEffectOffsets[offIndex].y + Rand_CenteredFloat(10.0f); effectPos.z = this->effectPos[segIndex].z + sEffectOffsets[offIndex].z + Rand_CenteredFloat(10.0f); - if (this->actor.dmgEffectParams & 0x4000) { + if (this->actor.colorFilterParams & 0x4000) { EffectSsEnFire_SpawnVec3f(globalCtx, &this->actor, &effectPos, 100, 0, 0, -1); } else { EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &effectPos, 150, 150, 150, 250, 235, 245, 255, 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 818dbb5964..ada7fb287b 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -133,7 +133,7 @@ static EnRu1DrawFunc sDrawFuncs[] = { const ActorInit En_Ru1_InitVars = { ACTOR_EN_RU1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_RU1, sizeof(EnRu1), @@ -180,7 +180,7 @@ void func_80AEAC54(EnRu1* this, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider2); if (this->unk_34C != 0) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); - } else if (this->actor.xzDistToLink > 32.0f) { + } else if (this->actor.xzDistToPlayer > 32.0f) { this->unk_34C = 1; } } @@ -257,7 +257,7 @@ void func_80AEAECC(EnRu1* this, GlobalContext* globalCtx) { f32 velocityYHeld = *velocityY; *velocityY = -4.0f; - func_8002E4B4(globalCtx, &this->actor, 19.0f, 25.0f, 30.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 25.0f, 30.0f, 7); *velocityY = velocityYHeld; } @@ -297,7 +297,7 @@ s32 func_80AEAFE0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { } s32 func_80AEB020(EnRu1* this, GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; EnRu1* someEnRu1; while (actorIt != NULL) { @@ -315,7 +315,7 @@ s32 func_80AEB020(EnRu1* this, GlobalContext* globalCtx) { } BgBdanObjects* func_80AEB088(GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_BG].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_BG].head; while (actorIt != NULL) { if (actorIt->id == ACTOR_BG_BDAN_OBJECTS && actorIt->params == 0) { @@ -342,7 +342,7 @@ s32 func_80AEB104(EnRu1* this) { } Actor* func_80AEB124(GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { if ((actorIt->id == ACTOR_DEMO_EFFECT) && ((actorIt->params & 0xFF) == 0x15)) { @@ -449,9 +449,9 @@ void EnRu1_SpawnRipple(EnRu1* this, GlobalContext* globalCtx, s16 radiusMax, s16 Vec3f pos; Actor* thisx = &this->actor; - pos.x = thisx->posRot.pos.x; - pos.y = thisx->posRot.pos.y + thisx->yDistToWater; - pos.z = thisx->posRot.pos.z; + pos.x = thisx->world.pos.x; + pos.y = thisx->world.pos.y + thisx->yDistToWater; + pos.z = thisx->world.pos.z; EffectSsGRipple_Spawn(globalCtx, &pos, 100, radiusMax, life); } @@ -473,9 +473,9 @@ void func_80AEB680(EnRu1* this, GlobalContext* globalCtx) { Vec3f pos; Actor* thisx = &this->actor; - pos.x = thisx->posRot.pos.x; - pos.y = thisx->posRot.pos.y + thisx->yDistToWater; - pos.z = thisx->posRot.pos.z; + pos.x = thisx->world.pos.x; + pos.y = thisx->world.pos.y + thisx->yDistToWater; + pos.z = thisx->world.pos.z; EffectSsGSplash_Spawn(globalCtx, &pos, 0, 0, 1, 0); } @@ -528,10 +528,10 @@ void func_80AEB89C(EnRu1* this, GlobalContext* globalCtx) { if (npcAction != NULL) { npcActionRotY = npcAction->rot.y; thisx->shape.rot.y = npcActionRotY; - thisx->posRot.rot.y = npcActionRotY; - thisx->posRot.pos.x = npcAction->startPos.x; - thisx->posRot.pos.y = npcAction->startPos.y; - thisx->posRot.pos.z = npcAction->startPos.z; + thisx->world.rot.y = npcActionRotY; + thisx->world.pos.x = npcAction->startPos.x; + thisx->world.pos.y = npcAction->startPos.y; + thisx->world.pos.z = npcAction->startPos.z; } } @@ -555,7 +555,7 @@ void func_80AEB974(EnRu1* this, GlobalContext* globalCtx) { if (csCmdNPCAction != NULL) { sp30 = func_80AEB7E0(csCmdNPCAction, globalCtx); - thisPos = &thisx->posRot.pos; + thisPos = &thisx->world.pos; thisPos->x = func_80AEB87C(sp30, csCmdNPCAction->startPos.x, csCmdNPCAction->endPos.x); thisPos->y = func_80AEB87C(sp30, csCmdNPCAction->startPos.y, csCmdNPCAction->endPos.y); thisPos->z = func_80AEB87C(sp30, csCmdNPCAction->startPos.z, csCmdNPCAction->endPos.z); @@ -576,7 +576,7 @@ void func_80AEBA2C(EnRu1* this, GlobalContext* globalCtx) { if (csCmdNPCAction != NULL) { temp_ret_2 = func_80AEB7E0(csCmdNPCAction, globalCtx); - thisPos = &thisx->posRot.pos; + thisPos = &thisx->world.pos; thisPos->x = func_80AEB87C(temp_ret_2, unk_364->x, csCmdNPCAction->endPos.x); thisPos->y = func_80AEB87C(temp_ret_2, unk_364->y, csCmdNPCAction->endPos.y); thisPos->z = func_80AEB87C(temp_ret_2, unk_364->z, csCmdNPCAction->endPos.z); @@ -690,7 +690,7 @@ void func_80AEBF60(EnRu1* this, GlobalContext* globalCtx) { if (func_80AEB480(globalCtx, 6)) { func_80AEB7D0(this); this->action = 5; - this->unk_364 = this->actor.posRot.pos; + this->unk_364 = this->actor.world.pos; return; } else { func_80AEBA0C(this, globalCtx); @@ -851,10 +851,10 @@ void func_80AEC4F4(EnRu1* this) { s32 func_80AEC5FC(EnRu1* this, GlobalContext* globalCtx) { Player* player = PLAYER; Actor* thisx = &this->actor; - f32 thisPosZ = thisx->posRot.pos.z; - f32 playerPosZ = player->actor.posRot.pos.z; + f32 thisPosZ = thisx->world.pos.z; + f32 playerPosZ = player->actor.world.pos.z; - if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.posRot.pos.y >= thisx->posRot.pos.y)) { + if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.world.pos.y >= thisx->world.pos.y)) { return 1; } return 0; @@ -904,12 +904,12 @@ void func_80AEC81C(EnRu1* this, GlobalContext* globalCtx) { if (func_80AEAFE0(globalCtx, 1, 3)) { csCmdNPCAction = globalCtx->csCtx.npcActions[3]; - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; newRotY = csCmdNPCAction->rot.y; thisx->shape.rot.y = newRotY; - thisx->posRot.rot.y = newRotY; + thisx->world.rot.y = newRotY; this->action = 9; this->drawConfig = 1; } @@ -927,7 +927,7 @@ void func_80AEC93C(EnRu1* this, UNK_TYPE arg1) { if (arg1 != 0) { Animation_Change(&this->skelAnime, &D_060078E4, 1.0f, 0, Animation_GetLastFrame(&D_060078E4), ANIMMODE_LOOP, -8.0f); - this->actor.posRot.rot.y += 0x8000; + this->actor.world.rot.y += 0x8000; this->action = 0xB; this->unk_26C = 0.0f; } @@ -1020,41 +1020,41 @@ void func_80AECC84(EnRu1* this, GlobalContext* globalCtx) { void func_80AECCB0(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; Vec3f* pos; - s16 yawTowardsLink; + s16 yawTowardsPlayer; f32 spawnX; f32 spawnY; f32 spawnZ; s32 pad[2]; - yawTowardsLink = thisx->yawTowardsLink; - pos = &thisx->posRot.pos; - spawnX = ((kREG(1) + 12.0f) * Math_SinS(yawTowardsLink)) + pos->x; + yawTowardsPlayer = thisx->yawTowardsPlayer; + pos = &thisx->world.pos; + spawnX = ((kREG(1) + 12.0f) * Math_SinS(yawTowardsPlayer)) + pos->x; spawnY = pos->y; - spawnZ = ((kREG(1) + 12.0f) * Math_CosS(yawTowardsLink)) + pos->z; + spawnZ = ((kREG(1) + 12.0f) * Math_CosS(yawTowardsPlayer)) + pos->z; this->unk_278 = (DoorWarp1*)Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_DOOR_WARP1, spawnX, - spawnY, spawnZ, 0, yawTowardsLink, 0, 5); + spawnY, spawnZ, 0, yawTowardsPlayer, 0, 5); } void func_80AECDA0(EnRu1* this, GlobalContext* globalCtx) { func_80AEB264(this, &D_06000E54, 0, 0, 0); this->action = 15; - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; func_80AEAEA4(this, 5); func_80AEAEB8(this, 2); } void func_80AECE04(EnRu1* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += (250.0f / 3.0f); + this->actor.shape.yOffset += (250.0f / 3.0f); } void func_80AECE20(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; s16 shapeRotY = player->actor.shape.rot.y; s32 pad; f32 unk_27C = this->unk_27C; - Vec3f* pos = &thisx->posRot.pos; + Vec3f* pos = &thisx->world.pos; pos->x = (Math_SinS(shapeRotY) * unk_27C) + playerPos->x; pos->y = playerPos->y; @@ -1065,7 +1065,7 @@ void func_80AECEB4(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; Player* player = PLAYER; Vec3f* player_unk_450 = &player->unk_450; - Vec3f* pos = &thisx->posRot.pos; + Vec3f* pos = &thisx->world.pos; s16 shapeRotY = thisx->shape.rot.y; player_unk_450->x = ((kREG(2) + 30.0f) * Math_SinS(shapeRotY)) + pos->x; @@ -1084,16 +1084,16 @@ s32 func_80AECF6C(EnRu1* this, GlobalContext* globalCtx) { this->unk_26C += 1.0f; if ((player->actor.speedXZ == 0.0f) && (this->unk_26C >= 3.0f)) { otherPlayer = PLAYER; - player->actor.posRot.pos.x = otherPlayer->unk_450.x; - player->actor.posRot.pos.y = otherPlayer->unk_450.y; - player->actor.posRot.pos.z = otherPlayer->unk_450.z; + player->actor.world.pos.x = otherPlayer->unk_450.x; + player->actor.world.pos.y = otherPlayer->unk_450.y; + player->actor.world.pos.z = otherPlayer->unk_450.z; shapeRotY = &player->actor.shape.rot.y; - temp1 = this->actor.posRot.pos.x - player->actor.posRot.pos.x; - temp2 = this->actor.posRot.pos.z - player->actor.posRot.pos.z; + temp1 = this->actor.world.pos.x - player->actor.world.pos.x; + temp2 = this->actor.world.pos.z - player->actor.world.pos.z; temp_f16 = Math_FAtan2F(temp1, temp2) * 10430.3779296875f; if (*shapeRotY != temp_f16) { Math_SmoothStepToS(shapeRotY, temp_f16, 0x14, 0x1838, 0x64); - player->actor.posRot.rot.y = *shapeRotY; + player->actor.world.rot.y = *shapeRotY; } else { return 1; } @@ -1121,16 +1121,16 @@ void func_80AED0C8(EnRu1* this, GlobalContext* globalCtx) { void func_80AED0D8(EnRu1* this, GlobalContext* globalCtx) { this->action = 17; this->drawConfig = 1; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; - this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; func_80AECCB0(this, globalCtx); } void func_80AED110(EnRu1* this) { Actor* thisx = &this->actor; - if (thisx->shape.unk_08 >= 0.0f) { + if (thisx->shape.yOffset >= 0.0f) { this->action = 18; - thisx->shape.unk_08 = 0.0f; + thisx->shape.yOffset = 0.0f; func_80AED0B0(this, 1); } } @@ -1162,7 +1162,7 @@ void func_80AED218(EnRu1* this, UNK_TYPE arg1) { Animation_Change(&this->skelAnime, &D_06002990, 1.0f, 0, Animation_GetLastFrame(&D_06002990), ANIMMODE_ONCE, -8.0f); this->action = 21; - this->unk_27C = this->actor.xzDistToLink; + this->unk_27C = this->actor.xzDistToPlayer; } } @@ -1296,7 +1296,7 @@ void func_80AED738(EnRu1* this, GlobalContext* globalCtx) { if (this->unk_2A4 < 20.0f) { temp_v0 = ((20.0f - this->unk_2A4) * 255.0f) / 20.0f; this->unk_2A8 = temp_v0; - this->actor.shape.unk_14 = temp_v0; + this->actor.shape.shadowAlpha = temp_v0; } else { Actor_Kill(&this->actor); } @@ -1350,7 +1350,7 @@ void func_80AED8DC(EnRu1* this) { void func_80AEDAE0(EnRu1* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; - Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, thisx->floorPolySource); + Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, thisx->floorBgId); if (dyna == NULL || dyna->id == ACTOR_EN_BOX) { thisx->bgCheckFlags &= ~0x19; @@ -1362,7 +1362,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { f32* velocityY; f32* speedXZ; f32* gravity; - s16 wallPolyRot; + s16 wallYaw; s16 rotY; s32 temp_a1_2; s32 temp_a0; @@ -1370,7 +1370,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 1) { velocityY = &this->actor.velocity.y; - temp_dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorPolySource); + temp_dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId); if (*velocityY <= 0.0f) { speedXZ = &this->actor.speedXZ; if (temp_dyna != NULL) { @@ -1420,14 +1420,14 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 8) { speedXZ = &this->actor.speedXZ; if (*speedXZ != 0.0f) { - rotY = this->actor.posRot.rot.y; - wallPolyRot = this->actor.wallPolyRot; - temp_a0 = (wallPolyRot * 2) - rotY; + rotY = this->actor.world.rot.y; + wallYaw = this->actor.wallYaw; + temp_a0 = (wallYaw * 2) - rotY; temp_a1_2 = temp_a0 + 0x8000; - if ((s16)((temp_a0 - wallPolyRot) + 0x8000) >= 0) { - phi_v1 = (s16)(temp_a1_2 - wallPolyRot); + if ((s16)((temp_a0 - wallYaw) + 0x8000) >= 0) { + phi_v1 = (s16)(temp_a1_2 - wallYaw); } else { - phi_v1 = -(s16)(temp_a1_2 - wallPolyRot); + phi_v1 = -(s16)(temp_a1_2 - wallYaw); } if (phi_v1 < 0x4001) { if (*speedXZ >= (kREG(27) * 0.01f) + 3.0f) { @@ -1435,7 +1435,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { } else { *speedXZ = 0.0f; } - this->actor.posRot.rot.y = temp_a1_2; + this->actor.world.rot.y = temp_a1_2; func_80AED4FC(this); func_80AED5B8(this); } @@ -1445,7 +1445,7 @@ void func_80AEDB30(EnRu1* this, GlobalContext* globalCtx) { void func_80AEDEF4(EnRu1* this, GlobalContext* globalCtx) { f32* speedXZ = &this->actor.speedXZ; - Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorPolySource); + Actor* dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId); if (dyna != NULL && dyna->id == ACTOR_EN_BOX) { if (*speedXZ != 0.0f) { @@ -1491,7 +1491,7 @@ void func_80AEE050(EnRu1* this) { func_80AEE02C(this); this->unk_35C = 0; this->unk_358 = (this->actor.yDistToWater - 10.0f) * 0.5f; - this->unk_354 = this->actor.posRot.pos.y + thisx->unk_358; // thisx only used here + this->unk_354 = this->actor.world.pos.y + thisx->unk_358; // thisx only used here } else { this->actor.gravity = 0.0f; this->actor.minVelocityY *= 0.2f; @@ -1504,8 +1504,8 @@ void func_80AEE050(EnRu1* this) { if (this->actor.speedXZ <= 0.1f) { this->actor.speedXZ = 0.0f; } - this->actor.velocity.x = Math_SinS(this->actor.posRot.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.posRot.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; func_8002D7EC(this); } } else { @@ -1518,7 +1518,7 @@ void func_80AEE050(EnRu1* this) { sp28 = this->unk_358; sp24 = this->unk_354; temp_f10 = Math_CosS(this->unk_35C) * -sp28; - this->actor.posRot.pos.y = temp_f10 + sp24; + this->actor.world.pos.y = temp_f10 + sp24; this->unk_35C += 0x3E8; this->unk_358 *= 0.95f; } @@ -1553,10 +1553,10 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) { void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) { Actor* dyna; - s32 floorPolySource; - if ((this->actor.bgCheckFlags & 1) && (this->actor.floorPolySource != BGCHECK_SCENE)) { - floorPolySource = this->actor.floorPolySource; - dyna = DynaPoly_GetActor(&globalCtx->colCtx, floorPolySource); + s32 floorBgId; + if ((this->actor.bgCheckFlags & 1) && (this->actor.floorBgId != BGCHECK_SCENE)) { + floorBgId = this->actor.floorBgId; + dyna = DynaPoly_GetActor(&globalCtx->colCtx, floorBgId); if ((dyna != NULL) && (dyna->id == ACTOR_BG_BDAN_SWITCH)) { if (((dyna->params >> 8) & 0x3F) == 0x38) { gSaveContext.infTable[20] |= 1; @@ -1571,13 +1571,12 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) { s32 pad[2]; CollisionContext* colCtx; DynaPolyActor* dynaActor; - s32 floorPolySource; + s32 floorBgId; - if ((this->actor.bgCheckFlags & 1) && this->actor.floorPolySource != BGCHECK_SCENE) { + if ((this->actor.bgCheckFlags & 1) && this->actor.floorBgId != BGCHECK_SCENE) { colCtx = &globalCtx->colCtx; - floorPolySource = - this->actor.floorPolySource; // necessary match, can't move this out of this block unfortunately - dynaActor = DynaPoly_GetActor(colCtx, floorPolySource); + floorBgId = this->actor.floorBgId; // necessary match, can't move this out of this block unfortunately + dynaActor = DynaPoly_GetActor(colCtx, floorBgId); if (dynaActor != NULL && dynaActor->actor.id == ACTOR_BG_BDAN_OBJECTS && dynaActor->actor.params == 0 && !Player_InCsMode(globalCtx) && globalCtx->msgCtx.unk_E300 == 0) { func_80AEE02C(this); @@ -1586,7 +1585,7 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) { this->action = 36; this->drawConfig = 0; this->unk_28C = (BgBdanObjects*)dynaActor; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return 1; } } @@ -1829,7 +1828,7 @@ void func_80AEEF68(EnRu1* this, GlobalContext* globalCtx) { Player* player = PLAYER; s16 something; - this->unk_374.unk_18 = player->actor.posRot.pos; + this->unk_374.unk_18 = player->actor.world.pos; this->unk_374.unk_14 = kREG(16) - 3.0f; something = kREG(17) + 0xC; func_80034A14(&this->actor, &this->unk_374, something, 2); @@ -1839,11 +1838,11 @@ void func_80AEEFEC(EnRu1* this, GlobalContext* globalCtx) { Player* player = PLAYER; s16 something; - this->unk_374.unk_18 = player->actor.posRot.pos; + this->unk_374.unk_18 = player->actor.world.pos; this->unk_374.unk_14 = kREG(16) - 3.0f; something = kREG(17) + 0xC; func_80034A14(&this->actor, &this->unk_374, something, 4); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } void func_80AEF080(EnRu1* this) { @@ -1996,23 +1995,23 @@ void func_80AEF624(EnRu1* this, GlobalContext* globalCtx) { // this weird part with the redundant variable is necessary to match for some reason csCmdNPCAction2 = globalCtx->csCtx.npcActions[3]; csCmdNPCAction = csCmdNPCAction2; - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; newRotTmp = csCmdNPCAction->rot.x; thisx->shape.rot.x = newRotTmp; - thisx->posRot.rot.x = newRotTmp; + thisx->world.rot.x = newRotTmp; newRotTmp = csCmdNPCAction->rot.y; thisx->shape.rot.y = newRotTmp; - thisx->posRot.rot.y = newRotTmp; + thisx->world.rot.y = newRotTmp; newRotTmp = csCmdNPCAction->rot.z; thisx->shape.rot.z = newRotTmp; - thisx->posRot.rot.z = newRotTmp; + thisx->world.rot.z = newRotTmp; Animation_Change(&this->skelAnime, &D_060063F4, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); func_80AEB3A4(this, globalCtx); this->action = 37; this->drawConfig = 1; - thisx->shape.unk_14 = 0xFF; + thisx->shape.shadowAlpha = 0xFF; } } @@ -2270,7 +2269,7 @@ void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx) { EnRu1* this = THIS; s32 pad; - ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06012700, NULL, this->jointTable, this->morphTable, 17); func_80AEAD20(this, globalCtx); switch (func_80AEADF0(this)) { @@ -2341,12 +2340,12 @@ void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve if (limbIndex == 15) { vec1 = sMultVec; Matrix_MultVec3f(&vec1, &vec2); - this->actor.posRot2.pos.x = vec2.x; - this->actor.posRot2.pos.y = vec2.y; - this->actor.posRot2.pos.z = vec2.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = vec2.x; + this->actor.focus.pos.y = vec2.y; + this->actor.focus.pos.z = vec2.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } 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 5bfe126adc..21491829e7 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -79,7 +79,7 @@ static EnRu2DrawFunc sDrawFuncs[] = { const ActorInit En_Ru2_InitVars = { ACTOR_EN_RU2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_RU2, sizeof(EnRu2), @@ -150,7 +150,7 @@ void func_80AF26AC(EnRu2* this) { this->drawConfig = 0; this->alpha = 0; this->unk_2B8 = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_2B0 = 0.0f; } @@ -174,7 +174,7 @@ void func_80AF26D0(EnRu2* this, GlobalContext* globalCtx) { } void func_80AF2744(EnRu2* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 4); } s32 EnRu2_FrameUpdateMatrix(EnRu2* this) { @@ -212,12 +212,12 @@ void func_80AF2868(EnRu2* this, GlobalContext* globalCtx, u32 npcActionIdx) { Actor* thisx = &this->actor; if (csCmdNPCAction != NULL) { - thisx->posRot.pos.x = csCmdNPCAction->startPos.x; - thisx->posRot.pos.y = csCmdNPCAction->startPos.y; - thisx->posRot.pos.z = csCmdNPCAction->startPos.z; + thisx->world.pos.x = csCmdNPCAction->startPos.x; + thisx->world.pos.y = csCmdNPCAction->startPos.y; + thisx->world.pos.z = csCmdNPCAction->startPos.z; newRotY = csCmdNPCAction->rot.y; thisx->shape.rot.y = newRotY; - thisx->posRot.rot.y = newRotY; + thisx->world.rot.y = newRotY; } } @@ -241,28 +241,28 @@ void func_80AF28E8(EnRu2* this, AnimationHeader* animation, u8 arg2, f32 transit } void func_80AF2978(EnRu2* this, GlobalContext* globalCtx) { - this->actor.shape.unk_08 += 83.333336f; + this->actor.shape.yOffset += 83.333336f; } void func_80AF2994(EnRu2* this, GlobalContext* globalCtx) { func_80AF28E8(this, &D_06000DE8, 0, 0.0f, 0); - this->actor.shape.unk_08 = -10000.0f; + this->actor.shape.yOffset = -10000.0f; } void func_80AF29DC(EnRu2* this, GlobalContext* globalCtx) { Actor* thisx = &this->actor; - f32 posX = thisx->posRot.pos.x; - f32 posY = thisx->posRot.pos.y; - f32 posZ = thisx->posRot.pos.z; + f32 posX = thisx->world.pos.x; + f32 posY = thisx->world.pos.y; + f32 posZ = thisx->world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2); } void func_80AF2A38(EnRu2* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 posX = player->actor.posRot.pos.x; - f32 posY = player->actor.posRot.pos.y + 50.0f; - f32 posZ = player->actor.posRot.pos.z; + f32 posX = player->actor.world.pos.x; + f32 posY = player->actor.world.pos.y + 50.0f; + f32 posZ = player->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 10); Item_Give(globalCtx, ITEM_MEDALLION_WATER); @@ -279,9 +279,9 @@ void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = &D_80AF411C; gSaveContext.cutsceneTrigger = 2; Item_Give(globalCtx, ITEM_MEDALLION_WATER); - temp = this->actor.posRot.rot.y + 0x8000; + temp = this->actor.world.rot.y + 0x8000; player->actor.shape.rot.y = temp; - player->actor.posRot.rot.y = temp; + player->actor.world.rot.y = temp; } } @@ -300,9 +300,9 @@ void func_80AF2B44(EnRu2* this, GlobalContext* globalCtx) { } void func_80AF2B94(EnRu2* this) { - if (this->actor.shape.unk_08 >= 0.0f) { + if (this->actor.shape.yOffset >= 0.0f) { this->action = 3; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; } } @@ -385,7 +385,7 @@ void func_80AF2DEC(EnRu2* this, GlobalContext* globalCtx) { void func_80AF2E1C(EnRu2* this, GlobalContext* globalCtx) { func_80AF28E8(this, &D_060004CC, 2, 0.0f, 0); this->action = 7; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AF2E64() { @@ -393,8 +393,8 @@ void func_80AF2E64() { } void func_80AF2E84(EnRu2* this, GlobalContext* globalCtx) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x, - kREG(19) + 24.0f + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 8); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x, + kREG(19) + 24.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 8); } void func_80AF2F04(EnRu2* this, GlobalContext* globalCtx) { @@ -402,7 +402,7 @@ void func_80AF2F04(EnRu2* this, GlobalContext* globalCtx) { this->action = 8; this->drawConfig = 2; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; this->unk_2B0 = 0.0f; func_80AF2E64(); } @@ -419,7 +419,7 @@ void func_80AF2F58(EnRu2* this, GlobalContext* globalCtx) { this->drawConfig = 1; *unk_2B0 = kREG(5) + 10.0f; this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; return; } } else { @@ -429,13 +429,13 @@ void func_80AF2F58(EnRu2* this, GlobalContext* globalCtx) { this->drawConfig = 0; *unk_2B0 = 0.0f; this->alpha = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; return; } } alpha = (*unk_2B0 / (kREG(5) + 10.0f)) * 255.0f; this->alpha = alpha; - this->actor.shape.unk_14 = alpha; + this->actor.shape.shadowAlpha = alpha; } void func_80AF30AC(EnRu2* this, GlobalContext* globalCtx) { @@ -448,7 +448,7 @@ void func_80AF30AC(EnRu2* this, GlobalContext* globalCtx) { func_80AF2E84(this, globalCtx); this->unk_2B8 = 1; } - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } } @@ -498,7 +498,7 @@ void func_80AF3394(EnRu2* this, GlobalContext* globalCtx) { func_80AF28E8(this, &D_0600E630, 0, 0.0f, 0); this->action = 10; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80AF33E0(EnRu2* this) { @@ -511,11 +511,11 @@ void func_80AF33E0(EnRu2* this) { temp_f0 = kREG(17) + 10.0f; if (temp_f0 <= *unk_2B0) { this->alpha = 255; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } else { temp_f18 = (*unk_2B0 / temp_f0) * 255.0f; this->alpha = temp_f18; - this->actor.shape.unk_14 = temp_f18; + this->actor.shape.shadowAlpha = temp_f18; } } @@ -623,13 +623,13 @@ void func_80AF37CC(EnRu2* this) { this->unk_2C0 += 1; funcFloat = func_8006F9BC((kREG(2) + 0x96) & 0xFFFF, 0, this->unk_2C0, 8, 0); - this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + (300.0f * funcFloat); + this->actor.world.pos.y = this->actor.home.pos.y + (300.0f * funcFloat); } s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) { Player* player = PLAYER; - f32 thisPosX = this->actor.posRot.pos.x; - f32 playerPosX = player->actor.posRot.pos.x; + f32 thisPosX = this->actor.world.pos.x; + f32 playerPosX = player->actor.world.pos.x; if (playerPosX - thisPosX >= -202.0f) { return 1; @@ -681,9 +681,9 @@ void func_80AF39DC(EnRu2* this, GlobalContext* globalCtx) { player = PLAYER; osSyncPrintf("うおりゃー! \n"); func_8005B1A4(ACTIVE_CAM); - player->actor.posRot.pos.x = 820.0f; - player->actor.posRot.pos.y = 0.0f; - player->actor.posRot.pos.z = 180.0f; + player->actor.world.pos.x = 820.0f; + player->actor.world.pos.y = 0.0f; + player->actor.world.pos.z = 180.0f; } } } @@ -712,7 +712,7 @@ void func_80AF3B74(EnRu2* this, GlobalContext* globalCtx) { void func_80AF3BC8(EnRu2* this, GlobalContext* globalCtx) { func_80AF3878(this, globalCtx); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF259C(this, globalCtx); } @@ -721,7 +721,7 @@ void func_80AF3C04(EnRu2* this, GlobalContext* globalCtx) { func_80AF259C(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF38D0(this, globalCtx); } @@ -729,7 +729,7 @@ void func_80AF3C64(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF390C(this, globalCtx); } @@ -737,7 +737,7 @@ void func_80AF3CB8(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF39DC(this, globalCtx); } @@ -745,7 +745,7 @@ void func_80AF3D0C(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF3ADC(this, globalCtx); } @@ -754,7 +754,7 @@ void func_80AF3D60(EnRu2* this, GlobalContext* globalCtx) { func_80AF2744(this, globalCtx); EnRu2_FrameUpdateMatrix(this); func_80AF2608(this); - Actor_SetHeight(&this->actor, 50.0f); + Actor_SetFocus(&this->actor, 50.0f); func_80AF3B74(this, globalCtx); } @@ -771,7 +771,7 @@ void EnRu2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnRu2_Init(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); func_80AF2550(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C700, NULL, this->jointTable, this->morphTable, 23); 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 4f3a3e827e..3f6958bbc4 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_06012100; /* const ActorInit En_Sa_InitVars = { ACTOR_EN_SA, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SA, sizeof(EnSa), 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 b2037c6a48..36300e5fb9 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -28,7 +28,7 @@ void EnSb_Cooldown(EnSb* this, GlobalContext* globalCtx); const ActorInit En_Sb_InitVars = { ACTOR_EN_SB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SB, sizeof(EnSb), @@ -87,8 +87,8 @@ static DamageTable sDamageTable[] = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 39, ICHAIN_CONTINUE), - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; static Vec3f sFlamePosOffsets[] = { @@ -145,7 +145,7 @@ void EnSb_SpawnBubbles(GlobalContext* globalCtx, EnSb* this) { if (this->actor.yDistToWater > 0) { for (i = 0; i < 10; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 10.0f, 10.0f, 30.0f, 0.25f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 10.0f, 10.0f, 30.0f, 0.25f); } } } @@ -211,9 +211,9 @@ void EnSb_SetupCooldown(EnSb* this, s32 changeSpeed) { void EnSb_WaitClosed(EnSb* this, GlobalContext* globalCtx) { // always face toward link - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x7D0, 0x0); - if ((this->actor.xzDistToLink <= 160.0f) && (this->actor.xzDistToLink > 40.0f)) { + if ((this->actor.xzDistToPlayer <= 160.0f) && (this->actor.xzDistToPlayer > 40.0f)) { EnSb_SetupOpen(this); } } @@ -225,8 +225,8 @@ void EnSb_Open(EnSb* this, GlobalContext* globalCtx) { this->timer = 15; EnSb_SetupWaitOpen(this); } else { - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0); - if ((this->actor.xzDistToLink > 160.0f) || (this->actor.xzDistToLink <= 40.0f)) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x7D0, 0x0); + if ((this->actor.xzDistToPlayer > 160.0f) || (this->actor.xzDistToPlayer <= 40.0f)) { EnSb_SetupWaitClosed(this); } } @@ -235,9 +235,9 @@ void EnSb_Open(EnSb* this, GlobalContext* globalCtx) { void EnSb_WaitOpen(EnSb* this, GlobalContext* globalCtx) { s16 timer = this->timer; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 0xA, 0x7D0, 0x0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x7D0, 0x0); - if ((this->actor.xzDistToLink > 160.0f) || (this->actor.xzDistToLink <= 40.0f)) { + if ((this->actor.xzDistToPlayer > 160.0f) || (this->actor.xzDistToPlayer <= 40.0f)) { EnSb_SetupWaitClosed(this); } @@ -245,7 +245,7 @@ void EnSb_WaitOpen(EnSb* this, GlobalContext* globalCtx) { this->timer = timer - 1; } else { this->timer = 0; - this->attackYaw = this->actor.yawTowardsLink; + this->attackYaw = this->actor.yawTowardsPlayer; this->actionFunc = EnSb_TurnAround; } } @@ -257,7 +257,7 @@ void EnSb_TurnAround(EnSb* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->actor.shape.rot.y, invertedYaw, 0x1, 0x1F40, 0xA); if (this->actor.shape.rot.y == invertedYaw) { - this->actor.posRot.rot.y = this->attackYaw; + this->actor.world.rot.y = this->attackYaw; if (this->actor.yDistToWater > 0.0f) { this->actor.velocity.y = 3.0f; this->actor.speedXZ = 5.0f; @@ -392,8 +392,8 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { hitByWindArrow = true; case 15: // explosions, arrow, hammer, ice arrow, light arrow, spirit arrow, shadow arrow if (EnSb_IsVulnerable(this)) { - hitY = this->collider.info.bumper.hitPos.y - this->actor.posRot.pos.y; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + hitY = this->collider.info.bumper.hitPos.y - this->actor.world.pos.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); func_8003426C(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); @@ -410,8 +410,8 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { case 1: // hookshot/longshot case 13: // all sword damage if (EnSb_IsVulnerable(this)) { - hitY = this->collider.info.bumper.hitPos.y - this->actor.posRot.pos.y; - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + hitY = this->collider.info.bumper.hitPos.y - this->actor.world.pos.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if ((hitY < 30.0f) && (hitY > 10.0f) && (yawDiff >= -0x1FFF) && (yawDiff < 0x2000)) { Actor_ApplyDamage(&this->actor); func_8003426C(&this->actor, 0x4000, 0xFF, 0x2000, 0x50); @@ -428,7 +428,7 @@ s32 EnSb_UpdateDamage(EnSb* this, GlobalContext* globalCtx) { func_80032E24(&this->unk_1E0, 8, globalCtx); this->isDead = true; func_80032C7C(globalCtx, &this->actor); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EN_SHELL_DEAD); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_SHELL_DEAD); return 1; } @@ -456,18 +456,18 @@ void EnSb_Update(Actor* thisx, GlobalContext* globalCtx) { } if (func_8003305C(this, &this->unk_1E0, globalCtx, this->actor.params) != 0) { if (!this->hitByWindArrow) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x80); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x80); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, 8); + Item_DropCollectible(globalCtx, &this->actor.world.pos, 8); } Actor_Kill(&this->actor); } } else { - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); Actor_SetScale(&this->actor, 0.006f); Actor_MoveForward(&this->actor); this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5); EnSb_UpdateDamage(this, globalCtx); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -493,15 +493,15 @@ void EnSb_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, EnSb_PostLimbDraw, this); if (this->fire != 0) { - this->actor.dmgEffectTimer++; + this->actor.colorFilterTimer++; fireDecr = this->fire - 1; // this is intended to draw flames after being burned, but the condition is never met to run this code // fire gets set to 4 when burned, decrements to 3 and fails the "& 1" check and never stores the decrement if ((fireDecr & 1) == 0) { offset = &sFlamePosOffsets[(fireDecr & 3)]; - flamePos.x = Rand_CenteredFloat(5.0f) + (this->actor.posRot.pos.x + offset->x); - flamePos.y = Rand_CenteredFloat(5.0f) + (this->actor.posRot.pos.y + offset->y); - flamePos.z = Rand_CenteredFloat(5.0f) + (this->actor.posRot.pos.z + offset->z); + flamePos.x = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.x + offset->x); + flamePos.y = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.y + offset->y); + flamePos.z = Rand_CenteredFloat(5.0f) + (this->actor.world.pos.z + offset->z); EffectSsEnFire_SpawnVec3f(globalCtx, this, &flamePos, 100, 0, 0, -1); } } 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 f0b6da1a4f..de41f50e8b 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 @@ -19,7 +19,7 @@ void EnSceneChange_DoNothing(EnSceneChange* this, GlobalContext* globalCtx); const ActorInit En_Scene_Change_InitVars = { ACTOR_EN_SCENE_CHANGE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_JJ, sizeof(EnSceneChange), 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 7227ebf590..5c093b277c 100644 --- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c +++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c @@ -21,7 +21,7 @@ void func_80AF8F60(Player* player, u8* shadowTexture, f32 arg2); const ActorInit En_Sda_InitVars = { ACTOR_EN_SDA, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnSda), @@ -133,7 +133,7 @@ void EnSda_Update(Actor* thisx, GlobalContext* globalCtx) { player = PLAYER; } - this->actor.posRot.pos = player->actor.posRot.pos; + this->actor.world.pos = player->actor.world.pos; osSyncPrintf("SDA MOVE END\n"); } @@ -151,7 +151,7 @@ void EnSda_Draw(Actor* thisx, GlobalContext* globalCtx) { player = PLAYER; } - player->actor.shape.unk_14 = 0; + player->actor.shape.shadowAlpha = 0; func_80AF95C4(this, shadowTexture, player, globalCtx); if (KREG(0) < 5) { @@ -182,13 +182,13 @@ void func_80AF8F60(Player* player, u8* shadowTexture, f32 arg2) { lerp.y = D_80AFA660[i].y + (D_80AFA660[j].y - D_80AFA660[i].y) * arg2; lerp.z = D_80AFA660[i].z + (D_80AFA660[j].z - D_80AFA660[i].z) * arg2; - sp88.x = lerp.x - player->actor.posRot.pos.x; - sp88.y = lerp.y - player->actor.posRot.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; - sp88.z = lerp.z - player->actor.posRot.pos.z; + sp88.x = lerp.x - player->actor.world.pos.x; + sp88.y = lerp.y - player->actor.world.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; + sp88.z = lerp.z - player->actor.world.pos.z; } else { - sp88.x = D_80AFA660[i].x - player->actor.posRot.pos.x; - sp88.y = D_80AFA660[i].y - player->actor.posRot.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; - sp88.z = D_80AFA660[i].z - player->actor.posRot.pos.z; + sp88.x = D_80AFA660[i].x - player->actor.world.pos.x; + sp88.y = D_80AFA660[i].y - player->actor.world.pos.y + BREG(48) + 76.0f + 30.0f - 105.0f + 15.0f; + sp88.z = D_80AFA660[i].z - player->actor.world.pos.z; } Matrix_MultVec3f(&sp88, &sp7C); sp7C.x *= (1.0f + (BREG(49) / 100.0f)); @@ -324,9 +324,9 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, GlobalContext } Matrix_RotateX((BREG(50) + 70) / 100.0f, 0); for (i = 0; i < 22; i++) { - sp194.x = sp64[i].x - player->actor.posRot.pos.x; - sp194.y = sp64[i].y - player->actor.posRot.pos.y + KREG(80) + 16.0f; - sp194.z = sp64[i].z - player->actor.posRot.pos.z; + sp194.x = sp64[i].x - player->actor.world.pos.x; + sp194.y = sp64[i].y - player->actor.world.pos.y + KREG(80) + 16.0f; + sp194.z = sp64[i].z - player->actor.world.pos.z; Matrix_MultVec3f(&sp194, &sp188); sp188.x *= (1.0f + (KREG(90) / 100.0f)); sp188.y *= (1.0f + (KREG(90) / 100.0f)); @@ -374,12 +374,12 @@ void func_80AF9C70(u8* shadowTexture, Player* player, GlobalContext* globalCtx) func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x00, 0, 0, 0, (BREG(52) + 50)); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 0); - Matrix_Translate(player->actor.posRot.pos.x, player->actor.groundY, player->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(player->actor.world.pos.x, player->actor.floorHeight, player->actor.world.pos.z, MTXMODE_NEW); Matrix_RotateY(BREG(51) / 100.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, (BREG(63) / 10.0f) + 1.0f, MTXMODE_APPLY); tempx = (BREG(62) / 10.0f) + 2.0f; - tempz = - ((player->actor.posRot.pos.y - player->actor.groundY + BREG(54)) * (BREG(55) - 5) / 10.0f) + BREG(58) - 20.0f; + tempz = ((player->actor.world.pos.y - player->actor.floorHeight + BREG(54)) * (BREG(55) - 5) / 10.0f) + BREG(58) - + 20.0f; Matrix_Translate(tempx, 0.0f, tempz, MTXMODE_APPLY); Matrix_Scale(((BREG(56) - 250) / 1000.0f) + 0.6f, 1.0f, ((BREG(59) - 250) / 1000.0f) + 0.6f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_sda.c", 860), 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 ebab784faf..126d083a77 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -28,7 +28,7 @@ extern AnimationHeader D_06004574; const ActorInit En_Shopnuts_InitVars = { ACTOR_EN_SHOPNUTS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SHOPNUTS, sizeof(EnShopnuts), @@ -63,14 +63,14 @@ static CollisionCheckInfoInit sColChkInfoInit = { 1, 20, 40, 0xFE }; static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x4E, ICHAIN_CONTINUE), ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), }; void EnShopnuts_Init(Actor* thisx, GlobalContext* globalCtx) { EnShopnuts* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060041A8, &D_06004574, this->jointTable, this->morphTable, 18); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -150,19 +150,20 @@ void EnShopnuts_Wait(EnShopnuts* this, GlobalContext* globalCtx) { } this->collider.dim.height = ((CLAMP(this->skelAnime.curFrame, 9.0f, 13.0f) - 9.0f) * 9.0f) + 5.0f; - if (!hasSlowPlaybackSpeed && (this->actor.xzDistToLink < 120.0f)) { + if (!hasSlowPlaybackSpeed && (this->actor.xzDistToPlayer < 120.0f)) { EnShopnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { - if (this->actor.xzDistToLink < 120.0f) { + if (this->actor.xzDistToPlayer < 120.0f) { EnShopnuts_SetupBurrow(this); - } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToLink > 320.0f)) { + } else if ((this->animFlagAndTimer == 0) && (this->actor.xzDistToPlayer > 320.0f)) { EnShopnuts_SetupLookAround(this); } else { EnShopnuts_SetupStand(this); } } - if (hasSlowPlaybackSpeed && ((this->actor.xzDistToLink > 160.0f) && (fabsf(this->actor.yDistToLink) < 120.0f)) && - ((this->animFlagAndTimer == 0) || (this->actor.xzDistToLink < 480.0f))) { + if (hasSlowPlaybackSpeed && + ((this->actor.xzDistToPlayer > 160.0f) && (fabsf(this->actor.yDistToPlayer) < 120.0f)) && + ((this->animFlagAndTimer == 0) || (this->actor.xzDistToPlayer < 480.0f))) { this->skelAnime.playSpeed = 1.0f; } } @@ -172,7 +173,7 @@ void EnShopnuts_LookAround(EnShopnuts* this, GlobalContext* globalCtx) { if (Animation_OnFrame(&this->skelAnime, 0.0f) && (this->animFlagAndTimer != 0)) { this->animFlagAndTimer--; } - if ((this->actor.xzDistToLink < 120.0f) || (this->animFlagAndTimer == 0)) { + if ((this->actor.xzDistToPlayer < 120.0f) || (this->animFlagAndTimer == 0)) { EnShopnuts_SetupBurrow(this); } } @@ -183,9 +184,9 @@ void EnShopnuts_Stand(EnShopnuts* this, GlobalContext* globalCtx) { this->animFlagAndTimer--; } if (!(this->animFlagAndTimer & 0x1000)) { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } - if ((this->actor.xzDistToLink < 120.0f) || (this->animFlagAndTimer == 0x1000)) { + if ((this->actor.xzDistToPlayer < 120.0f) || (this->animFlagAndTimer == 0x1000)) { EnShopnuts_SetupBurrow(this); } else if (this->animFlagAndTimer == 0) { EnShopnuts_SetupThrowNut(this); @@ -195,15 +196,15 @@ void EnShopnuts_Stand(EnShopnuts* this, GlobalContext* globalCtx) { void EnShopnuts_ThrowNut(EnShopnuts* this, GlobalContext* globalCtx) { Vec3f spawnPos; - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); - if (this->actor.xzDistToLink < 120.0f) { + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); + if (this->actor.xzDistToPlayer < 120.0f) { EnShopnuts_SetupBurrow(this); } else if (SkelAnime_Update(&this->skelAnime)) { EnShopnuts_SetupStand(this); } else if (Animation_OnFrame(&this->skelAnime, 6.0f)) { - spawnPos.x = this->actor.posRot.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); - spawnPos.y = this->actor.posRot.pos.y + 12.0f; - spawnPos.z = this->actor.posRot.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); + spawnPos.x = this->actor.world.pos.x + (Math_SinS(this->actor.shape.rot.y) * 23.0f); + spawnPos.y = this->actor.world.pos.y + 12.0f; + spawnPos.z = this->actor.world.pos.z + (Math_CosS(this->actor.shape.rot.y) * 23.0f); if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_NUTSBALL, spawnPos.x, spawnPos.y, spawnPos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, 2) != NULL) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_THROW); @@ -224,12 +225,12 @@ void EnShopnuts_Burrow(EnShopnuts* this, GlobalContext* globalCtx) { void EnShopnuts_SpawnSalesman(EnShopnuts* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_DNS, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_DNS, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z, this->actor.params); Actor_Kill(&this->actor); } else { - Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xE38); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); } } @@ -248,18 +249,18 @@ void EnShopnuts_Update(Actor* thisx, GlobalContext* globalCtx) { EnShopnuts_ColliderCheck(this, globalCtx); this->actionFunc(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->collider.dim.radius, this->collider.dim.height, 4); if (this->collider.base.acFlags & AC_ON) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actionFunc == EnShopnuts_Wait) { - Actor_SetHeight(&this->actor, this->skelAnime.curFrame); + Actor_SetFocus(&this->actor, this->skelAnime.curFrame); } else if (this->actionFunc == EnShopnuts_Burrow) { - Actor_SetHeight(&this->actor, - 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_0600039C))); + Actor_SetFocus(&this->actor, + 20.0f - ((this->skelAnime.curFrame * 20.0f) / Animation_GetLastFrame(&D_0600039C))); } else { - Actor_SetHeight(&this->actor, 20.0f); + Actor_SetFocus(&this->actor, 20.0f); } } 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 a2d55a86e7..60b91ce022 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -44,7 +44,7 @@ static CollisionCheckInfoInit2 D_80AFBADC = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_Si_InitVars = { ACTOR_EN_SI, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_ST, sizeof(EnSi), @@ -63,7 +63,7 @@ void EnSi_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.025f); this->unk_19C = 0; this->actionFunc = func_80AFB768; - this->actor.shape.unk_08 = 42.0f; + this->actor.shape.yOffset = 42.0f; } void EnSi_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -144,9 +144,9 @@ void EnSi_Update(Actor* thisx, GlobalContext* globalCtx) { EnSi* this = THIS; Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, 16.0f); + Actor_SetFocus(&this->actor, 16.0f); } void EnSi_Draw(Actor* thisx, 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 91511ff069..98581cb9e3 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -21,7 +21,7 @@ void func_80AFC478(EnSiofuki* this, GlobalContext* globalCtx); const ActorInit En_Siofuki_InitVars = { ACTOR_EN_SIOFUKI, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_SIOFUKI, sizeof(EnSiofuki), @@ -61,7 +61,7 @@ void EnSiofuki_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - this->initPosY = thisx->posRot.pos.y; + this->initPosY = thisx->world.pos.y; this->unk_174 = 35.0f; this->unk_170 = -6058.0f + this->unk_174; @@ -78,9 +78,9 @@ void EnSiofuki_Init(Actor* thisx, GlobalContext* globalCtx) { thisx->scale.z = thisx->shape.rot.z * 0.5f * 0.1f; } - thisx->posRot.rot.x = 0; - thisx->posRot.rot.y = 0; - thisx->posRot.rot.z = 0; + thisx->world.rot.x = 0; + thisx->world.rot.y = 0; + thisx->world.rot.z = 0; thisx->shape.rot.x = 0; thisx->shape.rot.y = 0; thisx->shape.rot.z = 0; @@ -112,7 +112,7 @@ void func_80AFBDC8(EnSiofuki* this, GlobalContext* globalCtx) { this->oscillation = sinf((globalCtx->gameplayFrames & 0x1F) / 32.0f * M_PI * 2.0f) * 4.0f; this->unk_170 = this->unk_174 * 10.0f + -6058.0f - this->oscillation * 10.0f; this->unk_174 = 35.0f; - this->dyna.actor.posRot.pos.y = this->initPosY + this->currentHeight + this->oscillation; + this->dyna.actor.world.pos.y = this->initPosY + this->currentHeight + this->oscillation; } void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { @@ -125,15 +125,15 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { f32 dist2d; f32 speedScale; - dX = player->actor.posRot.pos.x - this->dyna.actor.posRot.pos.x; - dY = player->actor.posRot.pos.y - this->dyna.actor.posRot.pos.y; - dZ = player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z; + dX = player->actor.world.pos.x - this->dyna.actor.world.pos.x; + dY = player->actor.world.pos.y - this->dyna.actor.world.pos.y; + dZ = player->actor.world.pos.z - this->dyna.actor.world.pos.z; if ((dX > (this->dyna.actor.scale.x * -346.0f)) && (dX < (this->dyna.actor.scale.x * 346.0f)) && (dZ > (this->dyna.actor.scale.z * -400.0f)) && (dZ < (this->dyna.actor.scale.z * 400.0f)) && (dY < 0.0f)) { if (func_8004356C(&this->dyna)) { if (this->splashTimer <= 0) { - EffectSsGSplash_Spawn(globalCtx, &player->actor.posRot.pos, NULL, NULL, 1, 1); + EffectSsGSplash_Spawn(globalCtx, &player->actor.world.pos, NULL, NULL, 1, 1); this->splashTimer = 10; } else { this->splashTimer--; @@ -147,13 +147,13 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { this->applySpeed = true; this->splashTimer = 0; angle = Math_FAtan2F(dX, dZ) * (0x8000 / M_PI); - dAngle = (player->actor.posRot.rot.y ^ 0x8000) - angle; + dAngle = (player->actor.world.rot.y ^ 0x8000) - angle; player->actor.gravity = 0.0f; player->actor.velocity.y = 0.0f; - Math_SmoothStepToF(&player->actor.posRot.pos.y, this->dyna.actor.posRot.pos.y, 0.5f, 4.0f, 1.0f); + Math_SmoothStepToF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.5f, 4.0f, 1.0f); if ((dAngle < 0x4000) && (dAngle > -0x4000)) { - this->appliedYaw = player->actor.posRot.rot.y ^ 0x8000; + this->appliedYaw = player->actor.world.rot.y ^ 0x8000; speedScale = dist2d / (this->dyna.actor.scale.x * 40.0f * 10.0f); speedScale = CLAMP_MIN(speedScale, 0.0f); speedScale = CLAMP_MAX(speedScale, 1.0f); @@ -161,7 +161,7 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) { Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f); Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.3f * speedScale); } else { - this->appliedYaw = player->actor.posRot.rot.y; + this->appliedYaw = player->actor.world.rot.y; player->linearVelocity /= 2.0f; Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f); Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.1f); 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 23e761f692..309d4f140c 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_060047E0; /* const ActorInit En_Skb_InitVars = { ACTOR_EN_SKB, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SKB, sizeof(EnSkb), 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 c5997cab00..6601dbbb93 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -19,7 +19,7 @@ extern UNK_TYPE D_06007128; /* const ActorInit En_Skj_InitVars = { ACTOR_EN_SKJ, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SKJ, sizeof(EnSkj), 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 7ef4782be3..d056cd9421 100644 --- a/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c +++ b/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.c @@ -21,7 +21,7 @@ extern Gfx D_06000EB0[]; const ActorInit En_Skjneedle_InitVars = { ACTOR_EN_SKJNEEDLE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SKJ, sizeof(EnSkjneedle), @@ -44,8 +44,8 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 30, ICHAIN_STOP), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; void EnSkjneedle_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -54,7 +54,7 @@ void EnSkjneedle_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 20.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 20.0f); thisx->flags &= ~0x1; Actor_SetScale(&this->actor, 0.01f); } @@ -90,7 +90,7 @@ void EnSkjneedle_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 7); } } 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 4f07c3f4bf..b8d19014f0 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -57,7 +57,7 @@ static Gfx D_80B04400[] = { const ActorInit En_Ssh_InitVars = { ACTOR_EN_SSH, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_SSH, sizeof(EnSsh), @@ -144,9 +144,9 @@ void EnSsh_SpawnShockwave(EnSsh* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f pos; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.groundY; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.floorHeight; + pos.z = this->actor.world.pos.z; EffectSsBlast_SpawnWhiteCustomScale(globalCtx, &pos, &zeroVec, &zeroVec, 100, 220, 8); } @@ -179,10 +179,10 @@ s32 EnSsh_CheckCeilingPos(EnSsh* this, GlobalContext* globalCtx) { s32 bgId; Vec3f posB; - posB.x = this->actor.posRot.pos.x; - posB.y = this->actor.posRot.pos.y + 1000.0f; - posB.z = this->actor.posRot.pos.z; - if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &posB, &this->ceilingPos, &poly, false, + posB.x = this->actor.world.pos.x; + posB.y = this->actor.world.pos.y + 1000.0f; + posB.z = this->actor.world.pos.z; + if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &posB, &this->ceilingPos, &poly, false, false, true, true, &bgId)) { return false; } else { @@ -263,7 +263,7 @@ void EnSsh_SetReturnAnimation(EnSsh* this) { } void EnSsh_SetLandAnimation(EnSsh* this) { - this->actor.posRot.pos.y = this->groundYoffset + this->actor.groundY; + this->actor.world.pos.y = this->floorHeightOffset + this->actor.floorHeight; this->animTimer = EnSsh_SetAnimation(this, SSH_ANIM_LAND); } @@ -278,7 +278,7 @@ void EnSsh_SetStunned(EnSsh* this) { if (this->stunTimer == 0) { this->stateFlags |= SSH_STATE_ATTACKED; this->stunTimer = 120; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; } } @@ -305,7 +305,7 @@ void EnSsh_SetColliderScale(EnSsh* this, f32 scale, f32 radiusMod) { this->colCylinder[i].dim.height = height; } Actor_SetScale(&this->actor, 0.04f * scale); - this->groundYoffset = 40.0f * scale; + this->floorHeightOffset = 40.0f * scale; this->colliderScale = scale * 1.5f; } @@ -334,18 +334,18 @@ void EnSsh_Turn(EnSsh* this, GlobalContext* globalCtx) { this->hitTimer--; } if (DECR(this->spinTimer) != 0) { - this->actor.posRot.rot.y += 10000.0f * (this->spinTimer / 30.0f); + this->actor.world.rot.y += 10000.0f * (this->spinTimer / 30.0f); } else if ((this->swayTimer == 0) && (this->stunTimer == 0)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 4, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 4, 0x2710, 1); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnSsh_Stunned(EnSsh* this, GlobalContext* globalCtx) { if ((this->swayTimer == 0) && (this->stunTimer == 0)) { - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink ^ 0x8000, 4, this->maxTurnRate, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer ^ 0x8000, 4, this->maxTurnRate, 1); } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; if (this->stunTimer < 30) { if (this->stunTimer & 1) { this->actor.shape.rot.y += 0x7D0; @@ -389,16 +389,16 @@ s32 EnSsh_IsCloseToLink(EnSsh* this, GlobalContext* globalCtx) { return true; } - if (this->actor.xzDistToLink > 160.0f) { + if (this->actor.xzDistToPlayer > 160.0f) { return false; } - yDist = this->actor.posRot.pos.y - player->actor.posRot.pos.y; + yDist = this->actor.world.pos.y - player->actor.world.pos.y; if (yDist < 0.0f || yDist > 400.0f) { return false; } - if (player->actor.posRot.pos.y < this->actor.groundY) { + if (player->actor.world.pos.y < this->actor.floorHeight) { return false; } return true; @@ -406,9 +406,9 @@ s32 EnSsh_IsCloseToLink(EnSsh* this, GlobalContext* globalCtx) { s32 EnSsh_IsCloseToHome(EnSsh* this) { f32 vel = this->actor.velocity.y; - f32 nextY = this->actor.posRot.pos.y + 2.0f * this->actor.velocity.y; + f32 nextY = this->actor.world.pos.y + 2.0f * this->actor.velocity.y; - if (nextY >= this->actor.initPosRot.pos.y) { + if (nextY >= this->actor.home.pos.y) { return 1; } return 0; @@ -416,9 +416,9 @@ s32 EnSsh_IsCloseToHome(EnSsh* this) { s32 EnSsh_IsCloseToGround(EnSsh* this) { f32 vel = this->actor.velocity.y; - f32 nextY = this->actor.posRot.pos.y + 2.0f * this->actor.velocity.y; + f32 nextY = this->actor.world.pos.y + 2.0f * this->actor.velocity.y; - if ((nextY - this->actor.groundY) <= this->groundYoffset) { + if ((nextY - this->actor.floorHeight) <= this->floorHeightOffset) { return 1; } return 0; @@ -438,18 +438,18 @@ void EnSsh_Sway(EnSsh* this) { } temp = this->swayTimer * (1.0f / 6); swayAngle = temp * (0x10000 / 360.0f) * Math_SinS(this->swayAngle); - temp = this->actor.posRot.pos.y - this->ceilingPos.y; + temp = this->actor.world.pos.y - this->ceilingPos.y; swayVecBase.x = Math_SinS(swayAngle) * temp; swayVecBase.y = Math_CosS(swayAngle) * temp; swayVecBase.z = 0.0f; Matrix_Push(); Matrix_Translate(this->ceilingPos.x, this->ceilingPos.y, this->ceilingPos.z, MTXMODE_NEW); - Matrix_RotateY(this->actor.posRot.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); + Matrix_RotateY(this->actor.world.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); Matrix_MultVec3f(&swayVecBase, &swayVec); Matrix_Pull(); this->actor.shape.rot.z = -(swayAngle * 2); - this->actor.posRot.pos.x = swayVec.x; - this->actor.posRot.pos.z = swayVec.z; + this->actor.world.pos.x = swayVec.x; + this->actor.world.pos.z = swayVec.z; } } @@ -491,7 +491,7 @@ s32 EnSsh_CheckHitLink(EnSsh* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_ROLL); Audio_PlayActorSound2(&this->actor, NA_SE_VO_ST_ATTACK); globalCtx->damagePlayer(globalCtx, -8); - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); this->hitCount--; return true; } @@ -570,7 +570,7 @@ void EnSsh_SetBodyCylinderAC(EnSsh* this, GlobalContext* globalCtx) { } void EnSsh_SetLegsCylinderAC(EnSsh* this, GlobalContext* globalCtx) { - s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); + s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); if (angleTowardsLink < 90 * (0x10000 / 360)) { Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]); @@ -591,7 +591,7 @@ s32 EnSsh_SetCylinderOC(EnSsh* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - cylPos = this->actor.posRot.pos; + cylPos = this->actor.world.pos; cyloffsets[i].x *= this->colliderScale; cyloffsets[i].y *= this->colliderScale; cyloffsets[i].z *= this->colliderScale; @@ -638,7 +638,7 @@ void EnSsh_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_060052E0, NULL, this->jointTable, this->morphTable, 30); Animation_Change(&this->skelAnime, &D_06000304, 1.0f, 0.0f, frameCount, ANIMMODE_LOOP_INTERP, 0.0f); this->blureIdx = EnSsh_CreateBlureEffect(globalCtx); @@ -652,7 +652,7 @@ void EnSsh_Init(Actor* thisx, GlobalContext* globalCtx) { EnSsh_SetColliderScale(this, 0.75f, 1.0f); } this->actor.gravity = 0.0f; - this->initialYaw = this->actor.posRot.rot.y; + this->initialYaw = this->actor.world.rot.y; EnSsh_SetupAction(this, EnSsh_Start); } @@ -749,7 +749,7 @@ void EnSsh_Land(EnSsh* this, GlobalContext* globalCtx) { if ((this->animTimer != 0) && (DECR(this->animTimer) == 0)) { EnSsh_SetAnimation(this, SSH_ANIM_WAIT); } - if ((this->actor.groundY + this->groundYoffset) <= this->actor.posRot.pos.y) { + if ((this->actor.floorHeight + this->floorHeightOffset) <= this->actor.world.pos.y) { EnSsh_SetupAction(this, EnSsh_Idle); } else { Math_SmoothStepToF(&this->actor.velocity.y, 2.0f, 0.6f, 1000.0f, 0.0f); @@ -837,7 +837,7 @@ void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx) { } else { SkelAnime_Update(&this->skelAnime); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->actionFunc(this, globalCtx); } EnSsh_UpdateYaw(this, globalCtx); @@ -849,7 +849,7 @@ void EnSsh_Update(Actor* thisx, GlobalContext* globalCtx) { this->blinkState = 0; } EnSsh_SetColliders(this, globalCtx); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } s32 EnSsh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { diff --git a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index 8559d72b5f..df81956296 100644 --- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -29,7 +29,7 @@ typedef struct EnSsh { /* 0x0536 */ s16 swayTimer; /* 0x0538 */ s32 blureIdx; /* 0x053C */ f32 colliderScale; - /* 0x0540 */ f32 groundYoffset; + /* 0x0540 */ f32 floorHeightOffset; /* 0x0544 */ Vec3f ceilingPos; /* 0x0558 */ char unk_558[0x78]; /* 0x05C8 */ s16 swayAngle; 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 dba76af959..d864bb2092 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -38,7 +38,7 @@ static Gfx sUnusedDList[] = { const ActorInit En_St_InitVars = { ACTOR_EN_ST, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ST, sizeof(EnSt), @@ -147,12 +147,12 @@ void EnSt_SpawnDust(EnSt* this, GlobalContext* globalCtx, s32 dustCnt) { s32 i; yAngle = (Rand_ZeroOne() - 0.5f) * 65536.0f; - dustPos.y = this->actor.groundY; + dustPos.y = this->actor.floorHeight; for (i = dustCnt; i >= 0; i--, yAngle += (s16)(0x10000 / dustCnt)) { dustAccel.x = (Rand_ZeroOne() - 0.5f) * 4.0f; dustAccel.z = (Rand_ZeroOne() - 0.5f) * 4.0f; - dustPos.x = this->actor.posRot.pos.x + (Math_SinS(yAngle) * 22.0f); - dustPos.z = this->actor.posRot.pos.z + (Math_CosS(yAngle) * 22.0f); + dustPos.x = this->actor.world.pos.x + (Math_SinS(yAngle) * 22.0f); + dustPos.z = this->actor.world.pos.z + (Math_CosS(yAngle) * 22.0f); func_8002836C(globalCtx, &dustPos, &dustVel, &dustAccel, &primColor, &envColor, 120, 40, 10); } } @@ -161,9 +161,9 @@ void EnSt_SpawnBlastEffect(EnSt* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f blastPos; - blastPos.x = this->actor.posRot.pos.x; - blastPos.y = this->actor.groundY; - blastPos.z = this->actor.posRot.pos.z; + blastPos.x = this->actor.world.pos.x; + blastPos.y = this->actor.floorHeight; + blastPos.z = this->actor.world.pos.z; EffectSsBlast_SpawnWhiteCustomScale(globalCtx, &blastPos, &zeroVec, &zeroVec, 100, 220, 8); } @@ -172,9 +172,9 @@ void EnSt_SpawnDeadEffect(EnSt* this, GlobalContext* globalCtx) { Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f firePos; - firePos.x = this->actor.posRot.pos.x + ((Rand_ZeroOne() - 0.5f) * 60.0f); - firePos.y = (this->actor.posRot.pos.y + 10.0f) + ((Rand_ZeroOne() - 0.5f) * 45.0f); - firePos.z = this->actor.posRot.pos.z + ((Rand_ZeroOne() - 0.5f) * 60.0f); + firePos.x = this->actor.world.pos.x + ((Rand_ZeroOne() - 0.5f) * 60.0f); + firePos.y = (this->actor.world.pos.y + 10.0f) + ((Rand_ZeroOne() - 0.5f) * 45.0f); + firePos.z = this->actor.world.pos.z + ((Rand_ZeroOne() - 0.5f) * 60.0f); EffectSsDeadDb_Spawn(globalCtx, &firePos, &zeroVec, &zeroVec, 100, 0, 255, 255, 255, 255, 255, 0, 0, 1, 9, true); } @@ -211,14 +211,14 @@ s32 EnSt_CheckCeilingPos(EnSt* this, GlobalContext* globalCtx) { s32 bgId; Vec3f checkPos; - checkPos.x = this->actor.posRot.pos.x; - checkPos.y = this->actor.posRot.pos.y + 1000.0f; - checkPos.z = this->actor.posRot.pos.z; - if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &checkPos, &this->ceilingPos, &poly, 0, 0, + checkPos.x = this->actor.world.pos.x; + checkPos.y = this->actor.world.pos.y + 1000.0f; + checkPos.z = this->actor.world.pos.z; + if (!BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &checkPos, &this->ceilingPos, &poly, 0, 0, 1, 1, &bgId)) { return false; } - this->unusedPos = this->actor.posRot.pos; + this->unusedPos = this->actor.world.pos; this->unusedPos.y -= 100.0f; return true; } @@ -258,7 +258,7 @@ void EnSt_SetReturnToCeilingAnimation(EnSt* this) { } void EnSt_SetLandAnimation(EnSt* this) { - this->actor.posRot.pos.y = this->actor.groundY + this->groundYOffset; + this->actor.world.pos.y = this->actor.floorHeight + this->floorHeightOffset; func_80034EC0(&this->skelAnime, sAnimations, 4); this->sfxTimer = 0; this->animFrames = this->skelAnime.animLength; @@ -323,7 +323,7 @@ void EnSt_SetBodyCylinderAC(EnSt* this, GlobalContext* globalCtx) { } void EnSt_SetLegsCylinderAC(EnSt* this, GlobalContext* globalCtx) { - s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)); + s16 angleTowardsLink = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)); if (angleTowardsLink < 0x3FFC) { Collider_UpdateCylinder(&this->actor, &this->colCylinder[2]); @@ -344,7 +344,7 @@ s32 EnSt_SetCylinderOC(EnSt* this, GlobalContext* globalCtx) { s32 i; for (i = 0; i < 3; i++) { - cylPos = this->actor.posRot.pos; + cylPos = this->actor.world.pos; cyloffsets[i].x *= this->colliderScale; cyloffsets[i].y *= this->colliderScale; cyloffsets[i].z *= this->colliderScale; @@ -402,7 +402,7 @@ s32 EnSt_CheckHitLink(EnSt* this, GlobalContext* globalCtx) { this->gaveDamageSpinTimer = 30; globalCtx->damagePlayer(globalCtx, -8); Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); - func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsLink, 6.0f); + func_8002F71C(globalCtx, &this->actor, 4.0f, this->actor.yawTowardsPlayer, 6.0f); return true; } @@ -535,7 +535,7 @@ void EnSt_SetColliderScale(EnSt* this) { } Actor_SetScale(&this->actor, 0.04f * scaleAmount); this->colliderScale = scaleAmount; - this->groundYOffset = 32.0f * scaleAmount; + this->floorHeightOffset = 32.0f * scaleAmount; } s32 EnSt_SetTeethColor(EnSt* this, s16 redTarget, s16 greenTarget, s16 blueTarget, s16 minMaxStep) { @@ -621,7 +621,7 @@ void EnSt_UpdateYaw(EnSt* this, GlobalContext* globalCtx) { // calculate the new yaw to or away from the player. rot = this->actor.shape.rot; - yawTarget = (this->actionFunc == EnSt_WaitOnGround ? this->actor.yawTowardsLink : this->initalYaw); + yawTarget = (this->actionFunc == EnSt_WaitOnGround ? this->actor.yawTowardsPlayer : this->initalYaw); yawDiff = rot.y - (yawTarget ^ yawDir); if (ABS(yawDiff) <= 0x4000) { Math_SmoothStepToS(&rot.y, yawTarget ^ yawDir, 4, 0x2000, 1); @@ -629,7 +629,7 @@ void EnSt_UpdateYaw(EnSt* this, GlobalContext* globalCtx) { rot.y += 0x2000; } - this->actor.shape.rot = this->actor.posRot.rot = rot; + this->actor.shape.rot = this->actor.world.rot = rot; // Do the shaking animation. if (yawDir == 0 && this->rotAwayTimer < 0xA) { @@ -693,19 +693,19 @@ s32 EnSt_IsCloseToPlayer(EnSt* this, GlobalContext* globalCtx) { if (this->takeDamageSpinTimer != 0) { // skull is spinning from damage. return false; - } else if (this->actor.xzDistToLink > 160.0f) { + } else if (this->actor.xzDistToPlayer > 160.0f) { // player is more than 160 xz units from the skulltulla return false; } - yDist = this->actor.posRot.pos.y - player->actor.posRot.pos.y; + yDist = this->actor.world.pos.y - player->actor.world.pos.y; if (yDist < 0.0f || yDist > 400.0f) { // player is above the skulltulla or more than 400 units below // the skulltulla return false; } - if (player->actor.posRot.pos.y < this->actor.groundY) { + if (player->actor.world.pos.y < this->actor.floorHeight) { // player is below the Skulltulla's ground position return false; } @@ -714,9 +714,9 @@ s32 EnSt_IsCloseToPlayer(EnSt* this, GlobalContext* globalCtx) { s32 EnSt_IsCloseToInitalPos(EnSt* this) { f32 velY = this->actor.velocity.y; - f32 checkY = this->actor.posRot.pos.y + (velY * 2.0f); + f32 checkY = this->actor.world.pos.y + (velY * 2.0f); - if (checkY >= this->actor.initPosRot.pos.y) { + if (checkY >= this->actor.home.pos.y) { return true; } return false; @@ -724,9 +724,9 @@ s32 EnSt_IsCloseToInitalPos(EnSt* this) { s32 EnSt_IsCloseToGround(EnSt* this) { f32 velY = this->actor.velocity.y; - f32 checkY = this->actor.posRot.pos.y + (velY * 2.0f); + f32 checkY = this->actor.world.pos.y + (velY * 2.0f); - if (checkY - this->actor.groundY <= this->groundYOffset) { + if (checkY - this->actor.floorHeight <= this->floorHeightOffset) { return true; } return false; @@ -769,12 +769,12 @@ void EnSt_Sway(EnSt* this) { amtToTranslate.z = 0.0f; Matrix_Push(); Matrix_Translate(this->ceilingPos.x, this->ceilingPos.y, this->ceilingPos.z, MTXMODE_NEW); - Matrix_RotateY(this->actor.posRot.rot.y * (M_PI / 32768.0f), MTXMODE_APPLY); + Matrix_RotateY(this->actor.world.rot.y * (M_PI / 32768.0f), MTXMODE_APPLY); Matrix_MultVec3f(&amtToTranslate, &translatedPos); Matrix_Pull(); this->actor.shape.rot.z = -(rotAngle * 2); - this->actor.posRot.pos.x = translatedPos.x; - this->actor.posRot.pos.z = translatedPos.z; + this->actor.world.pos.x = translatedPos.x; + this->actor.world.pos.z = translatedPos.z; } } @@ -782,7 +782,7 @@ void EnSt_Init(Actor* thisx, GlobalContext* globalCtx) { EnSt* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 14.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005298, NULL, this->jointTable, this->morphTable, 30); func_80034EC0(&this->skelAnime, sAnimations, 0); this->blureIdx = EnSt_CreateBlureEffect(globalCtx); @@ -800,7 +800,7 @@ void EnSt_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x1000000; EnSt_SetColliderScale(this); this->actor.gravity = 0.0f; - this->initalYaw = this->actor.posRot.rot.y; + this->initalYaw = this->actor.world.rot.y; EnSt_SetupAction(this, EnSt_StartOnCeilingOrGround); } @@ -881,7 +881,7 @@ void EnSt_LandOnGround(EnSt* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALTU_DOWN_SET); } - if ((this->actor.groundY + this->groundYOffset) < this->actor.posRot.pos.y) { + if ((this->actor.floorHeight + this->floorHeightOffset) < this->actor.world.pos.y) { // the skulltulla has hit the ground. this->sfxTimer = 0; EnSt_SetupAction(this, EnSt_WaitOnGround); @@ -938,18 +938,18 @@ void EnSt_ReturnToCeiling(EnSt* this, GlobalContext* globalCtx) { * The skulltulla has been killed, bounce around */ void EnSt_BounceAround(EnSt* this, GlobalContext* globalCtx) { - this->actor.dmgEffectTimer = this->deathTimer; + this->actor.colorFilterTimer = this->deathTimer; func_8002D868(&this->actor); - this->actor.posRot.rot.x += 0x800; - this->actor.posRot.rot.z -= 0x800; - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.world.rot.x += 0x800; + this->actor.world.rot.z -= 0x800; + this->actor.shape.rot = this->actor.world.rot; if (EnSt_IsDoneBouncing(this, globalCtx)) { - this->actor.shape.unk_08 = 400.0f; + this->actor.shape.yOffset = 400.0f; this->actor.speedXZ = 1.0f; this->actor.gravity = -2.0f; EnSt_SetupAction(this, EnSt_FinishBouncing); } else { - Math_SmoothStepToF(&this->actor.shape.unk_08, 400.0f, 0.4f, 10000.0f, 0.0f); + Math_SmoothStepToF(&this->actor.shape.yOffset, 400.0f, 0.4f, 10000.0f, 0.0f); } } @@ -967,15 +967,15 @@ void EnSt_FinishBouncing(EnSt* this, GlobalContext* globalCtx) { } if (DECR(this->setTargetYawTimer) == 0) { - this->deathYawTarget = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->actor.initPosRot.pos); + this->deathYawTarget = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos); this->setTargetYawTimer = 8; } - Math_SmoothStepToS(&this->actor.posRot.rot.x, 0x3FFC, 4, 0x2710, 1); - Math_SmoothStepToS(&this->actor.posRot.rot.z, 0, 4, 0x2710, 1); - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->deathYawTarget, 0xA, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.x, 0x3FFC, 4, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.z, 0, 4, 0x2710, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, this->deathYawTarget, 0xA, 0x2710, 1); - this->actor.shape.rot = this->actor.posRot.rot; + this->actor.shape.rot = this->actor.world.rot; func_8002D868(&this->actor); this->groundBounces = 2; @@ -989,7 +989,7 @@ void EnSt_Die(EnSt* this, GlobalContext* globalCtx) { if (DECR(this->finishDeathTimer) != 0) { EnSt_SpawnDeadEffect(this, globalCtx); } else { - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0xE0); Actor_Kill(&this->actor); } } @@ -1024,7 +1024,7 @@ void EnSt_Update(Actor* thisx, GlobalContext* globalCtx) { func_8002D7EC(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if ((this->stunTimer == 0) && (this->swayTimer == 0)) { // run the current action if the skulltulla isn't stunned @@ -1048,7 +1048,7 @@ void EnSt_Update(Actor* thisx, GlobalContext* globalCtx) { EnSt_SetTeethColor(this, color.r, color.g, color.b, 8); EnSt_UpdateCylinders(this, globalCtx); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); } } diff --git a/src/overlays/actors/ovl_En_St/z_en_st.h b/src/overlays/actors/ovl_En_St/z_en_st.h index 98a4bac635..ad2d435afc 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/src/overlays/actors/ovl_En_St/z_en_st.h @@ -41,7 +41,7 @@ typedef struct EnSt { /* 0x03FC */ char unk_3FC[0x8]; /* 0x0404 */ s32 blureIdx; /* 0x0408 */ f32 colliderScale; - /* 0x040C */ f32 groundYOffset; + /* 0x040C */ f32 floorHeightOffset; /* 0x0410 */ s16 swayAngle; /* 0x0412 */ Vec3s jointTable[30]; /* 0x04C6 */ Vec3s morphTable[30]; 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 d2b21b2397..e7a81cb505 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -11,7 +11,7 @@ void EnSth_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Sth_InitVars = { ACTOR_EN_STH, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnSth), 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 52f3af44b5..5c12e729e3 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -20,7 +20,7 @@ extern Gfx D_06000950[]; const ActorInit En_Stream_InitVars = { ACTOR_EN_STREAM, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_STREAM, sizeof(EnStream), @@ -91,16 +91,16 @@ void EnStream_SuckPlayer(EnStream* this, GlobalContext* globalCtx) { s32 pad30; s32 pad2C; - if (func_80B0B81C(&this->actor.posRot.pos, &player->actor.posRot.pos, &posDifference, this->actor.scale.y) != 0) { + if (func_80B0B81C(&this->actor.world.pos, &player->actor.world.pos, &posDifference, this->actor.scale.y) != 0) { xzDist = sqrtf(SQ(posDifference.x) + SQ(posDifference.z)); - yDistWithOffset = player->actor.posRot.pos.y - (this->actor.posRot.pos.y - 90.0f); + yDistWithOffset = player->actor.world.pos.y - (this->actor.world.pos.y - 90.0f); player->windDirection = Math_FAtan2F(-posDifference.x, -posDifference.z) * 10430.378f; if (xzDist > 3.0f) { Math_SmoothStepToF(&player->windSpeed, 3.0f, 0.5f, xzDist, 0.0f); } else { player->windSpeed = 0.0f; - Math_SmoothStepToF(&player->actor.posRot.pos.x, this->actor.posRot.pos.x, 0.5f, 3.0f, 0.0f); - Math_SmoothStepToF(&player->actor.posRot.pos.z, this->actor.posRot.pos.z, 0.5f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->actor.world.pos.x, this->actor.world.pos.x, 0.5f, 3.0f, 0.0f); + Math_SmoothStepToF(&player->actor.world.pos.z, this->actor.world.pos.z, 0.5f, 3.0f, 0.0f); } if (yDistWithOffset > 0.0f) { Math_SmoothStepToF(&player->actor.velocity.y, -3.0f, 0.7f, yDistWithOffset, 0.0f); @@ -118,7 +118,7 @@ void EnStream_WaitForPlayer(EnStream* this, GlobalContext* globalCtx) { s16 pad; Vec3f temp; - if (func_80B0B81C(&this->actor.posRot.pos, &player->actor.posRot.pos, &temp, this->actor.scale.y) != 0) { + if (func_80B0B81C(&this->actor.world.pos, &player->actor.world.pos, &temp, this->actor.scale.y) != 0) { EnStream_SetupAction(this, EnStream_SuckPlayer); } } 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 8b93e11559..b547c8f41f 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -25,7 +25,7 @@ extern UNK_TYPE D_06005298; /* const ActorInit En_Sw_InitVars = { ACTOR_EN_SW, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ST, sizeof(EnSw), 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 a4895c1b06..c51f5065b9 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 @@ -31,7 +31,7 @@ void EnSyatekiItm_EndGame(EnSyatekiItm* this, GlobalContext* globalCtx); const ActorInit En_Syateki_Itm_InitVars = { ACTOR_EN_SYATEKI_ITM, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnSyatekiItm), @@ -105,12 +105,12 @@ void EnSyatekiItm_Idle(EnSyatekiItm* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (this->signal == ENSYATEKI_START) { - player->actor.posRot.pos.x = -12.0f; - player->actor.posRot.pos.y = 20.0f; - player->actor.posRot.pos.z = 182.0f; - player->currentYaw = player->actor.posRot.rot.y = player->actor.shape.rot.y = 0x7F03; - player->actor.posRot.rot.x = player->actor.shape.rot.x = player->actor.posRot.rot.z = - player->actor.shape.rot.z = 0; + player->actor.world.pos.x = -12.0f; + player->actor.world.pos.y = 20.0f; + player->actor.world.pos.z = 182.0f; + player->currentYaw = player->actor.world.rot.y = player->actor.shape.rot.y = 0x7F03; + player->actor.world.rot.x = player->actor.shape.rot.x = player->actor.world.rot.z = player->actor.shape.rot.z = + 0; func_8008EF44(globalCtx, 15); this->roundNum = this->hitCount = 0; for (i = 0; i < 6; i++) { @@ -346,8 +346,8 @@ void EnSyatekiItm_Update(Actor* thisx, GlobalContext* globalCtx) { this->unkTimer--; } if (BREG(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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, globalCtx->state.gfxCtx); } } 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 4ab59cd0ad..ebb2ec4875 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 @@ -49,7 +49,7 @@ extern FlexSkeletonHeader D_06009B38; const ActorInit En_Syateki_Man_InitVars = { ACTOR_EN_SYATEKI_MAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_OSSAN, sizeof(EnSyatekiMan), @@ -77,7 +77,7 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Old man appeared!! Muhohohohohohohon osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 親父登場!!むほほほほほほほーん ☆☆☆☆☆ \n" VT_RST); - this->actor.unk_1F = 1; + this->actor.targetMode = 1; Actor_SetScale(&this->actor, 0.01f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009B38, &D_06000338, this->jointTable, this->morphTable, 9); if (LINK_IS_CHILD) { @@ -86,7 +86,7 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) { this->blinkTimer = 20; this->eyeState = 0; this->blinkFunc = EnSyatekiMan_BlinkWait; - this->actor.colChkInfo.unk_10 = 100; + this->actor.colChkInfo.cylRadius = 100; this->actionFunc = EnSyatekiMan_Start; } @@ -389,9 +389,9 @@ void EnSyatekiMan_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); EnSyatekiMan_SetBgm(); this->blinkFunc(this); - this->actor.posRot2.pos.y = 70.0f; - Actor_SetHeight(&this->actor, 70.0f); - func_80038290(globalCtx, &this->actor, &this->headRot, &this->bodyRot, this->actor.posRot2.pos); + this->actor.focus.pos.y = 70.0f; + Actor_SetFocus(&this->actor, 70.0f); + func_80038290(globalCtx, &this->actor, &this->headRot, &this->bodyRot, this->actor.focus.pos); } s32 func_80B1148C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { 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 d2f49aaf00..28e09b4e6b 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 @@ -34,7 +34,7 @@ extern FlexSkeletonHeader D_06002530; const ActorInit En_Syateki_Niw_InitVars = { ACTOR_EN_SYATEKI_NIW, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_NIW, sizeof(EnSyatekiNiw), @@ -65,9 +65,9 @@ static ColliderCylinderInit sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 1, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 0, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -75,7 +75,7 @@ void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.flags &= ~1; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, 16); this->unk_29E = this->actor.params; @@ -98,8 +98,8 @@ void EnSyatekiNiw_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); } - this->unk_2DC = this->actor.posRot.pos; - this->unk_2E8 = this->actor.posRot.pos; + this->unk_2DC = this->actor.world.pos; + this->unk_2E8 = this->actor.world.pos; this->actionFunc = func_80B11DEC; } @@ -315,11 +315,11 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) { } if (this->unk_25C != 0) { sp4A = 1; - Math_ApproachF(&this->actor.posRot.pos.x, this->unk_2E8.x, 1.0f, this->unk_2C8.y); - Math_ApproachF(&this->actor.posRot.pos.z, this->unk_2E8.z, 1.0f, this->unk_2C8.y); + Math_ApproachF(&this->actor.world.pos.x, this->unk_2E8.x, 1.0f, this->unk_2C8.y); + Math_ApproachF(&this->actor.world.pos.z, this->unk_2E8.z, 1.0f, this->unk_2C8.y); Math_ApproachF(&this->unk_2C8.y, 3.0f, 1.0f, 0.3f); - tmpf1 = this->unk_2E8.x - this->actor.posRot.pos.x; - tmpf2 = this->unk_2E8.z - this->actor.posRot.pos.z; + tmpf1 = this->unk_2E8.x - this->actor.world.pos.x; + tmpf2 = this->unk_2E8.z - this->actor.world.pos.z; if (fabsf(tmpf1) < 10.0f) { tmpf1 = 0; @@ -334,7 +334,7 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) { this->unk_294 = 7; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(tmpf1, tmpf2) * 10430.378f, 3, this->unk_2C8.z, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(tmpf1, tmpf2) * 10430.378f, 3, this->unk_2C8.z, 0); Math_ApproachF(&this->unk_2C8.z, 10000.0f, 1.0f, 1000.0f); } @@ -346,7 +346,7 @@ void func_80B11E78(EnSyatekiNiw* this, GlobalContext* globalCtx) { if ((globalCtx->gameplayFrames % 4) == 0) { dustVelocity.y = Rand_CenteredFloat(5.0f); dustAccel.y = 0.2f; - dustPos = this->actor.posRot.pos; + dustPos = this->actor.world.pos; func_8002836C(globalCtx, &dustPos, &dustVelocity, &dustAccel, &dustPrimColor, &dustEnvColor, 600, 40, 30); } } @@ -394,7 +394,7 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { } phi_f16 = (this->unk_298 == 0) ? 5000.0f : -5000.0f; - if (this->actor.posRot.pos.z > 100.0f) { + if (this->actor.world.pos.z > 100.0f) { this->actor.speedXZ = 2.0f; this->actor.gravity = -0.3f; this->actor.velocity.y = 5.0f; @@ -403,11 +403,11 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { break; case 2: - if ((player->actor.posRot.pos.z - 40.0f) < this->actor.posRot.pos.z) { + if ((player->actor.world.pos.z - 40.0f) < this->actor.world.pos.z) { this->actor.speedXZ = 0.0f; } - if ((this->actor.bgCheckFlags & 1) && (this->actor.posRot.pos.z > 110.0f)) { + if ((this->actor.bgCheckFlags & 1) && (this->actor.world.pos.z > 110.0f)) { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; this->unk_284 = 0.0f; @@ -424,7 +424,7 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { break; case 3: - if ((player->actor.posRot.pos.z - 50.0f) < this->actor.posRot.pos.z) { + if ((player->actor.world.pos.z - 50.0f) < this->actor.world.pos.z) { this->actor.speedXZ = 0.0f; this->unk_262 = 0x3C; this->unk_25A = 0x14; @@ -458,7 +458,7 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { this->actor.speedXZ = 1.0f; } - if ((this->unk_25A == 0) && ((player->actor.posRot.pos.z - 30.0f) < this->actor.posRot.pos.z)) { + if ((this->unk_25A == 0) && ((player->actor.world.pos.z - 30.0f) < this->actor.world.pos.z)) { Audio_PlaySoundGeneral(NA_SE_VO_LI_DOWN, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->unk_25E = 0x14; @@ -479,9 +479,9 @@ void func_80B12460(EnSyatekiNiw* this, GlobalContext* globalCtx) { break; } - Math_SmoothStepToS(&this->actor.posRot.rot.y, - (s16)(Math_FAtan2F(player->actor.posRot.pos.x - this->actor.posRot.pos.x, - player->actor.posRot.pos.z - this->actor.posRot.pos.z) * + Math_SmoothStepToS(&this->actor.world.rot.y, + (s16)(Math_FAtan2F(player->actor.world.pos.x - this->actor.world.pos.x, + player->actor.world.pos.z - this->actor.world.pos.z) * 10430.378f) + phi_f16, 5, this->unk_2C8.y, 0); @@ -504,7 +504,7 @@ void func_80B128F8(EnSyatekiNiw* this, GlobalContext* globalCtx) { s16 sp26; s16 sp24; - Actor_SetHeight(&this->actor, this->unk_2D4); + Actor_SetFocus(&this->actor, this->unk_2D4); func_8002F374(globalCtx, &this->actor, &sp26, &sp24); if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) && (sp26 > 0) && (sp26 < SCREEN_WIDTH) && (sp24 > 0) && (sp24 < SCREEN_HEIGHT)) { @@ -524,7 +524,7 @@ void func_80B129EC(EnSyatekiNiw* this, GlobalContext* globalCtx) { s16 sp2C; f32 tmpf2; - Actor_SetHeight(&this->actor, this->unk_2D4); + Actor_SetFocus(&this->actor, this->unk_2D4); func_8002F374(globalCtx, &this->actor, &sp2E, &sp2C); if ((this->unk_25E == 0) || (this->actor.projectedPos.z < -70.0f) || (sp2E < 0) || (sp2E > SCREEN_WIDTH) || (sp2C < 0) || (sp2C > SCREEN_HEIGHT)) { @@ -544,7 +544,7 @@ void func_80B129EC(EnSyatekiNiw* this, GlobalContext* globalCtx) { phi_f2 = (this->unk_298 == 0) ? 5000.0f : -5000.0f; tmpf2 = this->unk_2D8 + phi_f2; - Math_SmoothStepToS(&this->actor.posRot.rot.y, tmpf2, 3, this->unk_2C8.y, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, tmpf2, 3, this->unk_2C8.y, 0); Math_ApproachF(&this->unk_2C8.y, 3000.0f, 1.0f, 500.0f); func_80B11A94(this, globalCtx, 2); } @@ -620,18 +620,18 @@ void EnSyatekiNiw_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_260--; } - this->actor.shape.rot = this->actor.posRot.rot; - this->actor.shape.unk_10 = 15.0f; + this->actor.shape.rot = this->actor.world.rot; + this->actor.shape.shadowScale = 15.0f; this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); if (this->unk_2A0 != 0) { for (i = 0; i < 20; i++) { - sp78.x = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.x; - sp78.y = Rand_CenteredFloat(10.0f) + (this->actor.posRot.pos.y + 20.0f); - sp78.z = Rand_CenteredFloat(10.0f) + this->actor.posRot.pos.z; + sp78.x = Rand_CenteredFloat(10.0f) + this->actor.world.pos.x; + sp78.y = Rand_CenteredFloat(10.0f) + (this->actor.world.pos.y + 20.0f); + sp78.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z; sp6C.x = Rand_CenteredFloat(3.0f); sp6C.y = (Rand_ZeroFloat(2.0f) * 0.5f) + 2.0f; sp6C.z = Rand_CenteredFloat(3.0f); 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 6fab5e935f..01f6c19021 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -34,7 +34,7 @@ void func_80B16938(EnTa* this); const ActorInit En_Ta_InitVars = { ACTOR_EN_TA, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TA, sizeof(EnTa), @@ -125,7 +125,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { EnTa* this = THIS; GlobalContext* globalCtx2 = globalCtx; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); SkelAnime_InitFlex(globalCtx2, &this->skelAnime, &D_0600B7B8, &D_06001C94, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx2, &this->collider); Collider_SetCylinder(globalCtx2, &this->collider, &this->actor, &sCylinderInit); @@ -137,7 +137,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B6 = 20; this->unk_2B0 = func_80B166CC; Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actor.velocity.y = -4.0f; this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; @@ -159,7 +159,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } break; case 2: @@ -193,7 +193,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } } else if (globalCtx2->sceneNum == SCENE_SOUKO) { osSyncPrintf(VT_FGCOL(CYAN) " ロンロン牧場の倉庫 の タロン\n" VT_RST); @@ -206,14 +206,14 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x10; this->unk_2C4[0] = this->unk_2C4[1] = this->unk_2C4[2] = 7; this->unk_2B8[0] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.posRot.pos.x + 5.0f, - this->actor.posRot.pos.y + 3.0f, this->actor.posRot.pos.z + 26.0f, 0, 0, 0, 0xD); + &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x + 5.0f, + this->actor.world.pos.y + 3.0f, this->actor.world.pos.z + 26.0f, 0, 0, 0, 0xD); this->unk_2B8[1] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.posRot.pos.x - 20.0f, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z - 30.0f, 0, 0, 0, 0xD); + &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x - 20.0f, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z - 30.0f, 0, 0, 0, 0xD); this->unk_2B8[2] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.posRot.pos.x + 20.0f, - this->actor.posRot.pos.y + 40.0f, this->actor.posRot.pos.z - 30.0f, 0, 0, 0, 0xD); + &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x + 20.0f, + this->actor.world.pos.y + 40.0f, this->actor.world.pos.z - 30.0f, 0, 0, 0, 0xD); func_80B13AAC(this, globalCtx2); if (gSaveContext.eventInf[0] & 0x400) { @@ -233,7 +233,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } } } else { @@ -241,15 +241,15 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2B4 = 2; Animation_PlayOnce(&this->skelAnime, &D_0600CD50); this->unk_2E4 = &D_0600CD50; - this->actor.shape.unk_10 = 54.0f; + this->actor.shape.shadowScale = 54.0f; } break; } } void func_80B14248(EnTa* this) { - if (this->actor.shape.unk_10 > 36.0f) { - this->actor.shape.unk_10 -= 0.8f; + if (this->actor.shape.shadowScale > 36.0f) { + this->actor.shape.shadowScale -= 0.8f; } } @@ -274,8 +274,8 @@ s32 func_80B142F4(EnTa* this, GlobalContext* globalCtx, u16 textId) { this->actor.textId = textId; - if ((ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) && - (this->actor.xzDistToLink < 100.0f)) { + if ((ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) && + (this->actor.xzDistToPlayer < 100.0f)) { this->unk_2E0 |= 1; func_8002F2CC(&this->actor, globalCtx, 100.0f); } @@ -416,7 +416,7 @@ void func_80B14818(EnTa* this, GlobalContext* globalCtx) { } void func_80B14898(EnTa* this, GlobalContext* globalCtx) { - func_80033480(globalCtx, &this->actor.posRot.pos, 50.0f, 2, 250, 20, 1); + func_80033480(globalCtx, &this->actor.world.pos, 50.0f, 2, 250, 20, 1); func_80B14818(this, globalCtx); if (this->unk_2CC == 0) { @@ -425,7 +425,7 @@ void func_80B14898(EnTa* this, GlobalContext* globalCtx) { } void func_80B1490C(EnTa* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y += 0xC00; + this->actor.world.rot.y += 0xC00; this->actor.shape.rot.y += 0xC00; if (this->unk_2CC == 0) { @@ -435,7 +435,7 @@ void func_80B1490C(EnTa* this, GlobalContext* globalCtx) { } void func_80B1496C(EnTa* this, GlobalContext* globalCtx) { - func_80033480(globalCtx, &this->actor.posRot.pos, 50.0f, 2, 250, 20, 1); + func_80033480(globalCtx, &this->actor.world.pos, 50.0f, 2, 250, 20, 1); func_80B14818(this, globalCtx); if (this->unk_2CC == 0) { @@ -445,7 +445,7 @@ void func_80B1496C(EnTa* this, GlobalContext* globalCtx) { } void func_80B149F4(EnTa* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y -= 0xD00; + this->actor.world.rot.y -= 0xD00; this->actor.shape.rot.y -= 0xD00; if (this->unk_2CC == 0) { @@ -455,7 +455,7 @@ void func_80B149F4(EnTa* this, GlobalContext* globalCtx) { } void func_80B14A54(EnTa* this, GlobalContext* globalCtx) { - func_80033480(globalCtx, &this->actor.posRot.pos, 50.0f, 2, 250, 20, 1); + func_80033480(globalCtx, &this->actor.world.pos, 50.0f, 2, 250, 20, 1); func_80B14818(this, globalCtx); if (this->unk_2CC == 20) { @@ -468,7 +468,7 @@ void func_80B14A54(EnTa* this, GlobalContext* globalCtx) { } void func_80B14AF4(EnTa* this, GlobalContext* globalCtx) { - this->actor.posRot.rot.y -= 0xC00; + this->actor.world.rot.y -= 0xC00; this->actor.shape.rot.y -= 0xC00; if (this->unk_2CC == 0) { @@ -781,8 +781,8 @@ void func_80B1585C(EnTa* this, GlobalContext* globalCtx) { if (this->unk_2CC > 35) { for (i = 1; i < ARRAY_COUNT(this->unk_2B8); i++) { if (this->unk_2B8[i] != NULL) { - Math_SmoothStepToS(&this->unk_2B8[i]->actor.posRot.rot.y, i * -10000 - 3000, 2, 0x800, 0x100); - this->unk_2B8[i]->actor.shape.rot.y = this->unk_2B8[i]->actor.posRot.rot.y; + Math_SmoothStepToS(&this->unk_2B8[i]->actor.world.rot.y, i * -10000 - 3000, 2, 0x800, 0x100); + this->unk_2B8[i]->actor.shape.rot.y = this->unk_2B8[i]->actor.world.rot.y; } } } else if (this->unk_2CC == 35) { @@ -1157,7 +1157,7 @@ void EnTa_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); this->unk_260(this); this->unk_25C(this, globalCtx); @@ -1166,7 +1166,7 @@ void EnTa_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->unk_2E0 & 1) { - func_80038290(globalCtx, &this->actor, &this->unk_2D4, &this->unk_2DA, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_2D4, &this->unk_2DA, this->actor.focus.pos); } else { Math_SmoothStepToS(&this->unk_2D4.x, 0, 6, 6200, 100); Math_SmoothStepToS(&this->unk_2D4.y, 0, 6, 6200, 100); @@ -1210,7 +1210,7 @@ void EnTa_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec EnTa* this = THIS; if (limbIndex == 15) { - Matrix_MultVec3f(&D_80B16E7C, &this->actor.posRot2.pos); + Matrix_MultVec3f(&D_80B16E7C, &this->actor.focus.pos); } } 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 d9b678c921..a0b9a62fc3 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 @@ -25,7 +25,7 @@ void func_80B17AC4(EnTakaraMan* this, GlobalContext* globalCtx); const ActorInit En_Takara_Man_InitVars = { ACTOR_EN_TAKARA_MAN, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TS, sizeof(EnTakaraMan), @@ -59,17 +59,17 @@ void EnTakaraMan_Init(Actor* thisx, GlobalContext* globalCtx) { globalCtx->actorCtx.flags.chest = 0; gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = -1; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004FE0, &D_06000498, this->jointTable, this->morphTable, 10); - thisx->posRot2.pos = thisx->posRot.pos; - this->pos = thisx->posRot.pos; - thisx->posRot.pos.x = 133.0f; - thisx->posRot.pos.y = -12.0f; - thisx->posRot.pos.z = 102.0f; + thisx->focus.pos = thisx->world.pos; + this->pos = thisx->world.pos; + thisx->world.pos.x = 133.0f; + thisx->world.pos.y = -12.0f; + thisx->world.pos.z = 102.0f; Actor_SetScale(&this->actor, 0.013f); this->height = 90.0f; this->originalRoomNum = thisx->room; thisx->room = -1; - thisx->posRot.rot.y = thisx->shape.rot.y = -0x4E20; - thisx->unk_1F = 1; + thisx->world.rot.y = thisx->shape.rot.y = -0x4E20; + thisx->targetMode = 1; this->actionFunc = func_80B176E0; } @@ -96,7 +96,7 @@ void func_80B1778C(EnTakaraMan* this, GlobalContext* globalCtx) { this->actionFunc = func_80B17B14; } } else { - yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y; + yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (globalCtx->roomCtx.curRoom.num == 6 && !this->unk_21A) { this->actor.textId = 0x6E; // "Great! You are a real gambler!" this->unk_21A = 1; @@ -187,8 +187,8 @@ void EnTakaraMan_Update(Actor* thisx, GlobalContext* globalCtx) { this->eyeTimer--; } - Actor_SetHeight(&this->actor, this->height); - func_80038290(globalCtx, &this->actor, &this->unk_22C, &this->unk_232, this->actor.posRot2.pos); + Actor_SetFocus(&this->actor, this->height); + func_80038290(globalCtx, &this->actor, &this->unk_22C, &this->unk_232, this->actor.focus.pos); if (this->eyeTimer == 0) { this->eyeTextureIdx++; if (this->eyeTextureIdx >= 2) { 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 aef58d5b72..6808f9646e 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -18,7 +18,7 @@ void func_80B1809C(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Tana_InitVars = { ACTOR_EN_TANA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SHOP_DUNGEN, sizeof(EnTana), 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 416e681db0..ae069e51ec 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -64,7 +64,7 @@ extern UNK_TYPE D_0600E2B0; /* const ActorInit En_Test_InitVars = { ACTOR_EN_TEST, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_SK2, sizeof(EnTest), 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 374fd04f03..7188b70fea 100644 --- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c +++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_0600AE40; /* const ActorInit En_Tg_InitVars = { ACTOR_EN_TG, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_MU, sizeof(EnTg), 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 64b82d23cf..fee2ec3a9f 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -92,7 +92,7 @@ extern u32 D_06002100; const ActorInit En_Tite_InitVars = { ACTOR_EN_TITE, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_TITE, sizeof(EnTite), @@ -166,7 +166,7 @@ static DamageTable sDamageTable[] = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 69, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32(minVelocityY, 65496, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 64536, ICHAIN_STOP), }; @@ -193,16 +193,16 @@ void EnTite_Init(Actor* thisx, GlobalContext* globalCtx) { EnTite* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - thisx->unk_1F = 3; + thisx->targetMode = 3; Actor_SetScale(thisx, 0.01f); SkelAnime_Init(globalCtx, &this->skelAnime, &D_06003A20, &D_060012E4, this->jointTable, this->morphTable, 25); - ActorShape_Init(&thisx->shape, -200.0f, ActorShadow_DrawFunc_Circle, 70.0f); + ActorShape_Init(&thisx->shape, -200.0f, ActorShadow_DrawCircle, 70.0f); this->flipState = TEKTITE_INITIAL; thisx->colChkInfo.damageTable = sDamageTable; this->actionVar1 = 0; // value immediately overwritten in SetupIdle this->unk_2C4.unk_10 = 0; - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 20.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 20.0f; thisx->colChkInfo.health = 2; thisx->colChkInfo.mass = MASS_HEAVY; Collider_InitJntSph(globalCtx, &this->collider); @@ -249,8 +249,8 @@ void EnTite_Idle(EnTite* this, GlobalContext* globalCtx) { // Float on water surface this->actor.gravity = 0.0f; Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.posRot.pos.y + this->actor.yDistToWater, 1.0f, - 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f, + 0.0f); } else { this->actor.gravity = -1.0f; } @@ -260,7 +260,7 @@ void EnTite_Idle(EnTite* this, GlobalContext* globalCtx) { } if (this->vIdleTimer > 0) { this->vIdleTimer--; - } else if ((this->actor.xzDistToLink < 300.0f) && (this->actor.yDistToLink <= 80.0f)) { + } else if ((this->actor.xzDistToPlayer < 300.0f) && (this->actor.yDistToPlayer <= 80.0f)) { EnTite_SetupTurnTowardPlayer(this); } } @@ -273,7 +273,7 @@ void EnTite_SetupAttack(EnTite* this) { this->vQueuedJumps = Rand_S16Offset(1, 3); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; EnTite_SetupAction(this, EnTite_Attack); } @@ -289,12 +289,12 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { // Snap to ground or water, then lunge into the air with some initial speed this->vAttackState = TEKTITE_MID_LUNGE; if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } Audio_PlayActorSound2(&this->actor, NA_SE_EN_STAL_JUMP); } else { - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; Audio_PlayActorSound2(&this->actor, NA_SE_EN_TEKU_JUMP_WATER); } this->actor.velocity.y = 8.0f; @@ -310,15 +310,15 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { if (this->actor.velocity.y <= 0.0f) { this->vAttackState = TEKTITE_LANDED; if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (BGCHECK_Y_MIN < this->actor.groundY) { - this->actor.posRot.pos.y = this->actor.groundY; + if (BGCHECK_Y_MIN < this->actor.floorHeight) { + this->actor.world.pos.y = this->actor.floorHeight; } this->actor.velocity.y = 0.0f; this->actor.speedXZ = 0.0f; } else { this->actor.gravity = 0.0f; if (this->actor.velocity.y < -8.0f) { - ripplePos = this->actor.posRot.pos; + ripplePos = this->actor.world.pos; ripplePos.y += this->actor.yDistToWater; this->vAttackState++; // TEKTITE_SUBMERGED this->actor.velocity.y *= 0.75f; @@ -329,7 +329,7 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; } } - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; } } break; @@ -360,10 +360,10 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { switch (this->vAttackState) { case TEKTITE_BEGIN_LUNGE: // Slightly turn to player and switch to turning/idling action if the player is too far - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 1000, 0); - this->actor.shape.rot.y = this->actor.posRot.rot.y; - angleToPlayer = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if ((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f)) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 1000, 0); + this->actor.shape.rot.y = this->actor.world.rot.y; + angleToPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if ((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f)) { EnTite_SetupIdle(this); } else if (ABS(angleToPlayer) >= 9000) { EnTite_SetupTurnTowardPlayer(this); @@ -386,7 +386,7 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { this->collider.base.atFlags &= ~AT_HIT; Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f); this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (&player->actor == this->collider.base.at) { if (!(this->collider.base.atFlags & AT_BOUNCED)) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); @@ -397,14 +397,14 @@ void EnTite_Attack(EnTite* this, GlobalContext* globalCtx) { break; case TEKTITE_LANDED: // Slightly turn to player - Math_SmoothStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 1, 1500, 0); + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 1500, 0); break; case TEKTITE_SUBMERGED: // Float up to water surface Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.posRot.pos.y + this->actor.yDistToWater, 1.0f, - 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f, + 0.0f); break; } // Create ripples on water surface where tektite feet landed @@ -461,15 +461,15 @@ void EnTite_TurnTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } // Calculate turn velocity and animation speed based on angle to player if ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)) { - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; } - angleToPlayer = func_8002DA78(&this->actor, &PLAYER->actor) - this->actor.posRot.rot.y; + angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &PLAYER->actor) - this->actor.world.rot.y; if (angleToPlayer > 0) { turnVelocity = (angleToPlayer / 42.0f) + 10.0f; - this->actor.posRot.rot.y += (turnVelocity * 2); + this->actor.world.rot.y += (turnVelocity * 2); } else { turnVelocity = (angleToPlayer / 42.0f) - 10.0f; - this->actor.posRot.rot.y += (turnVelocity * 2); + this->actor.world.rot.y += (turnVelocity * 2); } if (angleToPlayer > 0) { this->skelAnime.playSpeed = turnVelocity * 0.01f; @@ -490,11 +490,11 @@ void EnTite_TurnTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } // Idle if player is far enough away from the tektite, move or attack if almost facing player - this->actor.shape.rot.y = this->actor.posRot.rot.y; - if ((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f)) { + this->actor.shape.rot.y = this->actor.world.rot.y; + if ((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f)) { EnTite_SetupIdle(this); } else if (func_8002E084(&this->actor, 3640)) { - if ((this->actor.xzDistToLink <= 180.0f) && (this->actor.yDistToLink <= 80.0f)) { + if ((this->actor.xzDistToPlayer <= 180.0f) && (this->actor.yDistToPlayer <= 80.0f)) { EnTite_SetupAttack(this); } else { EnTite_SetupMoveTowardPlayer(this); @@ -548,14 +548,14 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { (this->actor.velocity.y <= 0.0f)) { // slightly turn toward player upon landing and snap to ground or water. this->actor.speedXZ = 0.0f; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 4000, 0); - this->actor.posRot.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 4000, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } } else if (this->actor.bgCheckFlags & 0x40) { - Vec3f ripplePos = this->actor.posRot.pos; + Vec3f ripplePos = this->actor.world.pos; this->actor.bgCheckFlags &= ~0x40; ripplePos.y += this->actor.yDistToWater; this->actor.gravity = 0.0f; @@ -565,8 +565,8 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } else { // If submerged, float to surface Math_SmoothStepToF(&this->actor.velocity.y, 0.0f, 1.0f, 2.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.y, this->actor.posRot.pos.y + this->actor.yDistToWater, 1.0f, - 2.0f, 0.0f); + Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.world.pos.y + this->actor.yDistToWater, 1.0f, 2.0f, + 0.0f); if (this->actor.yDistToWater != 0.0f) { // Do not change state until tekite has floated to surface return; @@ -574,9 +574,9 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } // Idle or turn if player is too far away, otherwise keep jumping - if (((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f))) { + if (((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f))) { EnTite_SetupIdle(this); - } else if (((this->actor.xzDistToLink <= 180.0f)) && ((this->actor.yDistToLink <= 80.0f))) { + } else if (((this->actor.xzDistToPlayer <= 180.0f)) && ((this->actor.yDistToPlayer <= 80.0f))) { if (this->vQueuedJumps <= 0) { EnTite_SetupTurnTowardPlayer(this); } else { @@ -605,7 +605,7 @@ void EnTite_MoveTowardPlayer(EnTite* this, GlobalContext* globalCtx) { } else { // Turn slowly toward player this->actor.flags |= 0x1000000; - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 1000, 0); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 1000, 0); if (this->actor.velocity.y >= 6.0f) { if (this->actor.bgCheckFlags & 1) { func_800355B8(globalCtx, &this->frontLeftFootPos); @@ -621,7 +621,7 @@ void EnTite_SetupRecoil(EnTite* this) { this->action = TEKTITE_RECOIL; Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f); this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.gravity = -1.0f; EnTite_SetupAction(this, EnTite_Recoil); } @@ -637,13 +637,13 @@ void EnTite_Recoil(EnTite* this, GlobalContext* globalCtx) { if (((this->actor.bgCheckFlags & 3) || (this->actor.params == TEKTITE_BLUE && (this->actor.bgCheckFlags & 0x20))) && (this->actor.velocity.y <= 0.0f)) { if ((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20)) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } } else { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; } } @@ -662,17 +662,17 @@ void EnTite_Recoil(EnTite* this, GlobalContext* globalCtx) { } // If player is far away, idle. Otherwise attack or move - angleToPlayer = (this->actor.yawTowardsLink - this->actor.shape.rot.y); + angleToPlayer = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y); if ((this->actor.speedXZ == 0.0f) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->collider.base.atFlags &= ~AT_HIT; - if ((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f) && + if ((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f) && (ABS(this->actor.shape.rot.x) < 4000) && (ABS(this->actor.shape.rot.z) < 4000) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { EnTite_SetupIdle(this); - } else if ((this->actor.xzDistToLink < 180.0f) && (this->actor.yDistToLink <= 80.0f) && + } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.yDistToPlayer <= 80.0f) && (ABS(angleToPlayer) <= 6000)) { EnTite_SetupAttack(this); } else { @@ -687,7 +687,7 @@ void EnTite_SetupStunned(EnTite* this) { 4.0f); this->action = TEKTITE_STUNNED; this->actor.speedXZ = -6.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->damageEffect == 0xF) { this->spawnIceTimer = 48; } @@ -707,13 +707,13 @@ void EnTite_Stunned(EnTite* this, GlobalContext* globalCtx) { ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20))) && (this->actor.velocity.y <= 0.0f)) { if (((this->actor.params != TEKTITE_BLUE) || !(this->actor.bgCheckFlags & 0x20))) { - if (this->actor.groundY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = this->actor.groundY; + if (this->actor.floorHeight > BGCHECK_Y_MIN) { + this->actor.world.pos.y = this->actor.floorHeight; } } else { this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; - this->actor.posRot.pos.y += this->actor.yDistToWater; + this->actor.world.pos.y += this->actor.yDistToWater; } } // Play sounds and spawn dirt effects upon landing @@ -730,21 +730,21 @@ void EnTite_Stunned(EnTite* this, GlobalContext* globalCtx) { } } // Decide on next action based on health, flip state and player distance - angleToPlayer = this->actor.yawTowardsLink - this->actor.shape.rot.y; - if (((this->actor.dmgEffectTimer == 0) && (this->actor.speedXZ == 0.0f)) && + angleToPlayer = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + if (((this->actor.colorFilterTimer == 0) && (this->actor.speedXZ == 0.0f)) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (this->actor.colChkInfo.health == 0) { EnTite_SetupDeathCry(this); } else if (this->flipState == TEKTITE_FLIPPED) { EnTite_SetupFlipUpright(this); - } else if (((this->actor.xzDistToLink > 300.0f) && (this->actor.yDistToLink > 80.0f) && + } else if (((this->actor.xzDistToPlayer > 300.0f) && (this->actor.yDistToPlayer > 80.0f) && (ABS(this->actor.shape.rot.x) < 4000) && (ABS(this->actor.shape.rot.z) < 4000)) && ((this->actor.bgCheckFlags & 1) || ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & 0x20)))) { EnTite_SetupIdle(this); - } else if ((this->actor.xzDistToLink < 180.0f) && (this->actor.yDistToLink <= 80.0f) && + } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.yDistToPlayer <= 80.0f) && (ABS(angleToPlayer) <= 6000)) { EnTite_SetupAttack(this); } else { @@ -756,7 +756,7 @@ void EnTite_Stunned(EnTite* this, GlobalContext* globalCtx) { void EnTite_SetupDeathCry(EnTite* this) { this->action = TEKTITE_DEATH_CRY; - this->actor.dmgEffectTimer = 0; + this->actor.colorFilterTimer = 0; this->actor.speedXZ = 0.0f; EnTite_SetupAction(this, EnTite_DeathCry); } @@ -778,9 +778,9 @@ void EnTite_DeathCry(EnTite* this, GlobalContext* globalCtx) { void EnTite_FallApart(EnTite* this, GlobalContext* globalCtx) { if (func_8003305C(&this->actor, &this->unk_2C4, globalCtx, (this->actor.params + 0xB))) { if (this->actor.params == TEKTITE_BLUE) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xE0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); } else { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0x40); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x40); } Actor_Kill(&this->actor); } @@ -814,7 +814,7 @@ void EnTite_FlipOnBack(EnTite* this, GlobalContext* globalCtx) { if (this->actor.bgCheckFlags & 3) { // Upon landing, spawn dust and make noise if (this->actor.bgCheckFlags & 2) { - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 20.0f, 0xB, 4.0f, 0, 0, 0); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 20.0f, 0xB, 4.0f, 0, 0, 0); Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); } this->vOnBackTimer--; @@ -823,8 +823,8 @@ void EnTite_FlipOnBack(EnTite* this, GlobalContext* globalCtx) { } } else { // Gradually increase y offset during flip so that the actor position is at tektite's back instead of feet - if (this->actor.shape.unk_08 < 2800.0f) { - this->actor.shape.unk_08 += 400.0f; + if (this->actor.shape.yOffset < 2800.0f) { + this->actor.shape.yOffset += 400.0f; } } } @@ -847,8 +847,8 @@ void EnTite_FlipUpright(EnTite* this, GlobalContext* globalCtx) { func_80033480(globalCtx, &this->frontRightFootPos, 1.0f, 2, 80, 15, 1); func_80033480(globalCtx, &this->backRightFootPos, 1.0f, 2, 80, 15, 1); func_80033480(globalCtx, &this->backLeftFootPos, 1.0f, 2, 80, 15, 1); - this->actor.shape.unk_08 = 0.0f; - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.shape.yOffset = 0.0f; + this->actor.world.pos.y = this->actor.floorHeight; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND); EnTite_SetupIdle(this); } @@ -871,7 +871,7 @@ void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) { } // Otherwise apply damage and handle death where necessary } else { - if ((thisx->dmgEffectTimer == 0) || ((thisx->dmgEffectParams & 0x4000) == 0)) { + if ((thisx->colorFilterTimer == 0) || ((thisx->colorFilterParams & 0x4000) == 0)) { func_8003426C(thisx, 0x4000, 0xFF, 0, 8); Actor_ApplyDamage(thisx); } @@ -890,7 +890,7 @@ void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) { } // If hammer has recently hit the floor and player is close to tektite, flip over } else if ((thisx->colChkInfo.health != 0) && (globalCtx->actorCtx.unk_02 != 0) && - (thisx->xzDistToLink <= 400.0f) && (thisx->bgCheckFlags & 1)) { + (thisx->xzDistToPlayer <= 400.0f) && (thisx->bgCheckFlags & 1)) { if (this->flipState == TEKTITE_FLIPPED) { EnTite_SetupFlipUpright(this); } else if ((this->action >= TEKTITE_IDLE) || (this->action >= TEKTITE_IDLE)) { @@ -912,7 +912,7 @@ void EnTite_Update(Actor* thisx, GlobalContext* globalCtx) { if (thisx->colChkInfo.damageEffect != 0xE) { this->actionFunc(this, globalCtx); Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, 25.0f, 40.0f, 20.0f, this->unk_2DC); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 25.0f, 40.0f, 20.0f, this->unk_2DC); // If on water, snap feet to surface and spawn ripples if ((this->actor.params == TEKTITE_BLUE) && (thisx->bgCheckFlags & 0x20)) { floorPoly = thisx->floorPoly; @@ -958,14 +958,14 @@ void EnTite_Update(Actor* thisx, GlobalContext* globalCtx) { Math_SmoothStepToS(&thisx->shape.rot.x, 0, 1, 1000, 0); if (this->flipState <= TEKTITE_UNFLIPPED) { Math_SmoothStepToS(&thisx->shape.rot.z, 0, 1, 1000, 0); - if (thisx->shape.unk_08 > 0) { - thisx->shape.unk_08 -= 400.0f; + if (thisx->shape.yOffset > 0) { + thisx->shape.yOffset -= 400.0f; } } } } - thisx->posRot2.pos = thisx->posRot.pos; - thisx->posRot2.pos.y += 20.0f; + thisx->focus.pos = thisx->world.pos; + thisx->focus.pos.y += 20.0f; CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -1014,14 +1014,14 @@ void EnTite_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->spawnIceTimer != 0) { // Spawn chunks of ice all over the tektite's body - thisx->dmgEffectTimer++; + thisx->colorFilterTimer++; this->spawnIceTimer--; if ((this->spawnIceTimer & 3) == 0) { Vec3f iceChunk; s32 idx = this->spawnIceTimer >> 2; - iceChunk.x = thisx->posRot.pos.x + sIceChunks[idx].x; - iceChunk.y = thisx->posRot.pos.y + sIceChunks[idx].y; - iceChunk.z = thisx->posRot.pos.z + sIceChunks[idx].z; + iceChunk.x = thisx->world.pos.x + sIceChunks[idx].x; + iceChunk.y = thisx->world.pos.y + sIceChunks[idx].y; + iceChunk.z = thisx->world.pos.z + sIceChunks[idx].z; EffectSsEnIce_SpawnFlyingVec3f(globalCtx, &this->actor, &iceChunk, 150, 150, 150, 250, 235, 245, 255, 1.0f); } } 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 13b49dc81a..459ed39515 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -41,7 +41,7 @@ extern FlexSkeletonHeader D_0600BE40; const ActorInit En_Tk_InitVars = { ACTOR_EN_TK, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TK, sizeof(EnTk), @@ -227,7 +227,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) { s16 v0; s16 v1; - if (this->actor.xyzDistToLinkSq > 10000.0f) { + if (this->actor.xyzDistToPlayerSq > 10000.0f) { return 0; } @@ -235,7 +235,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) { v0 -= this->h_21E; v0 -= this->headRot; - v1 = this->actor.yawTowardsLink - v0; + v1 = this->actor.yawTowardsPlayer - v0; if (ABS(v1) < 0x1554) { return 1; } else { @@ -248,7 +248,7 @@ s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) { f32 dxz; f32 dy; - prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (prop != NULL) { if (prop->id != ACTOR_EN_IT) { @@ -261,8 +261,8 @@ s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) { continue; } - dy = prop->posRot.pos.y - this->actor.groundY; - dxz = func_8002DB8C(&this->actor, prop); + dy = prop->world.pos.y - this->actor.floorHeight; + dxz = Actor_WorldDistXZToActor(&this->actor, prop); if (dxz > 40.0f || dy > 10.0f) { prop = prop->next; continue; @@ -280,8 +280,8 @@ void EnTk_CheckCurrentSpot(EnTk* this) { f32 dy; if (this->currentSpot != NULL) { - dy = this->currentSpot->posRot.pos.y - this->actor.groundY; - dxz = func_8002DB8C(&this->actor, this->currentSpot); + dy = this->currentSpot->world.pos.y - this->actor.floorHeight; + dxz = Actor_WorldDistXZToActor(&this->actor, this->currentSpot); if (dxz > 40.0f || dy > 10.0f) { this->currentSpot = NULL; } @@ -329,11 +329,11 @@ s32 EnTk_Orient(EnTk* this, GlobalContext* globalCtx) { point = SEGMENTED_TO_VIRTUAL(path->points); point += this->currentWaypoint; - dx = point->x - this->actor.posRot.pos.x; - dz = point->z - this->actor.posRot.pos.z; + dx = point->x - this->actor.world.pos.x; + dz = point->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 10, 1000, 1); - this->actor.posRot.rot = this->actor.shape.rot; + this->actor.world.rot = this->actor.shape.rot; if (SQ(dx) + SQ(dz) < 10.0f) { this->currentWaypoint++; @@ -497,7 +497,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { EnTk* this = THIS; s32 pad; - ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.0f); + ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600BE40, NULL, this->jointTable, this->morphTable, 18); Animation_Change(&this->skelAnime, &D_06002F84, 1.0f, 0.0f, Animation_GetLastFrame(&D_06002F84), ANIMMODE_LOOP, @@ -516,7 +516,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actor.gravity = -0.1f; this->currentReward = -1; this->currentSpot = NULL; @@ -536,7 +536,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { if (this->h_1E0 != 0) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; - v1 = this->actor.yawTowardsLink - v1; + v1 = this->actor.yawTowardsPlayer - v1; if (this->h_1E0 == 2) { EnTk_DigAnim(this, globalCtx); @@ -550,7 +550,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { } else if (EnTk_CheckFacingPlayer(this)) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; - v1 = this->actor.yawTowardsLink - v1; + v1 = this->actor.yawTowardsPlayer - v1; this->actionCountdown = 0; func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.0f, func_80B1C54C, @@ -558,7 +558,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) { } else if (func_8002F194(&this->actor, globalCtx)) { v1 = this->actor.shape.rot.y; v1 -= this->h_21E; - v1 = this->actor.yawTowardsLink - v1; + v1 = this->actor.yawTowardsPlayer - v1; this->actionCountdown = 0; this->h_1E0 = 1; @@ -617,9 +617,9 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW); Matrix_MultVec3f(&rewardOrigin, &rewardPos); - rewardPos.x += this->actor.posRot.pos.x; - rewardPos.y += this->actor.posRot.pos.y; - rewardPos.z += this->actor.posRot.pos.z; + rewardPos.x += this->actor.world.pos.x; + rewardPos.y += this->actor.world.pos.y; + rewardPos.z += this->actor.world.pos.z; this->currentReward = EnTk_ChooseReward(this); if (this->currentReward == 3) { @@ -679,7 +679,7 @@ void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 40.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 10.0f, 0.0f, 5); this->actionFunc(this, globalCtx); @@ -721,7 +721,7 @@ void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec /* Limb 16 - Jaw */ if (limbIndex == 16) { - Matrix_MultVec3f(&sp1C, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sp1C, &this->actor.focus.pos); } /* Limb 14 - Neck */ 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 87d4f04c3e..0b8e35ca8e 100644 --- a/src/overlays/actors/ovl_En_Torch/z_en_torch.c +++ b/src/overlays/actors/ovl_En_Torch/z_en_torch.c @@ -14,7 +14,7 @@ void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Torch_InitVars = { ACTOR_EN_TORCH, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnTorch), @@ -34,8 +34,8 @@ void EnTorch_Init(Actor* thisx, GlobalContext* globalCtx) { /* Spawn chest with desired contents. Contents are passed to en_torch from grotto params via Save Context. */ - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOX, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, (sChestContents[(returnData >> 0x5) & 0x7] << 0x5) | 0x5000 | (returnData & 0x1F)); Actor_Kill(&this->actor); 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 7603c20257..20f4d1f68a 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -57,7 +57,7 @@ extern FlexSkeletonHeader D_06004764; const ActorInit En_Torch2_InitVars = { ACTOR_EN_TORCH2, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_TORCH2, sizeof(Player), @@ -144,8 +144,8 @@ void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) { this->shieldQuad.base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.health = gSaveContext.healthCapacity >> 3; - this->actor.colChkInfo.unk_10 = 60; - this->actor.colChkInfo.unk_12 = 100; + this->actor.colChkInfo.cylRadius = 60; + this->actor.colChkInfo.cylHeight = 100; globalCtx->func_11D54(this, globalCtx); sActionState = ENTORCH2_WAIT; @@ -157,7 +157,7 @@ void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) { sCounterState = sStaggerTimer = sStaggerCount = 0; sLastSwordAnim = 0; sAlpha = 95; - sSpawnPoint = this->actor.initPosRot.pos; + sSpawnPoint = this->actor.home.pos; } void EnTorch2_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -220,8 +220,8 @@ s32 EnTorch2_SwingSword(GlobalContext* globalCtx, Input* input, Player* this) { } void EnTorch2_Backflip(Player* this, Input* input, Actor* thisx) { - thisx->posRot.rot.y = thisx->shape.rot.y = thisx->yawTowardsLink; - sStickAngle = thisx->yawTowardsLink + 0x8000; + thisx->world.rot.y = thisx->shape.rot.y = thisx->yawTowardsPlayer; + sStickAngle = thisx->yawTowardsPlayer + 0x8000; sStickTilt = 127.0f; sZTargetFlag = true; input->cur.button = BTN_A; @@ -262,16 +262,16 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { attackItem = EnTorch2_GetAttackItem(globalCtx, this); switch (sActionState) { case ENTORCH2_WAIT: - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->skelAnime.curFrame = 0.0f; this->skelAnime.playSpeed = 0.0f; - this->actor.posRot.pos.x = (Math_SinS(this->actor.posRot.rot.y) * 25.0f) + sSpawnPoint.x; - this->actor.posRot.pos.z = (Math_CosS(this->actor.posRot.rot.y) * 25.0f) + sSpawnPoint.z; - if ((this->actor.xzDistToLink <= 120.0f) || func_80033A84(globalCtx, &this->actor) || + this->actor.world.pos.x = (Math_SinS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.x; + this->actor.world.pos.z = (Math_CosS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.z; + if ((this->actor.xzDistToPlayer <= 120.0f) || func_80033A84(globalCtx, &this->actor) || (attackItem != NULL)) { if (attackItem != NULL) { sDodgeRollState = 1; - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; input->cur.button = BTN_A; sZTargetFlag = false; @@ -330,7 +330,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { sStickTilt = 127.0f; } else if (attackItem != NULL) { sDodgeRollState = 1; - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; input->cur.button = BTN_A; } else if (sJumpslashTimer == 0) { @@ -339,12 +339,12 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { if (((player->swordState != 0) || (player->actor.velocity.y > -3.0f)) && (player->swordAnimation == JUMPSLASH_START)) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (globalCtx->gameplayFrames % 2) { - sStickAngle = this->actor.yawTowardsLink + 0x4000; + sStickAngle = this->actor.yawTowardsPlayer + 0x4000; } else { - sStickAngle = this->actor.yawTowardsLink - 0x4000; + sStickAngle = this->actor.yawTowardsPlayer - 0x4000; } sStickTilt = 127.0f; // Does not store with pointer sJumpslashFlag = false; // Does not store with POinter @@ -356,22 +356,22 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (sSwordJumpState != 0) { sStickTilt = 0.0f; player->stateFlags3 |= 4; - Math_SmoothStepToF(&this->actor.posRot.pos.x, + Math_SmoothStepToF(&this->actor.world.pos.x, (Math_SinS(player->actor.shape.rot.y - 0x3E8) * 45.0f) + - player->actor.posRot.pos.x, + player->actor.world.pos.x, 1.0f, 5.0f, 0.0f); - Math_SmoothStepToF(&this->actor.posRot.pos.z, + Math_SmoothStepToF(&this->actor.world.pos.z, (Math_CosS(player->actor.shape.rot.y - 0x3E8) * 45.0f) + - player->actor.posRot.pos.z, + player->actor.world.pos.z, 1.0f, 5.0f, 0.0f); sSwordJumpTimer--; if ((sSwordJumpTimer == 0) || ((player->invincibilityTimer > 0) && (this->swordState == 0))) { - this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; input->cur.button = BTN_A; player->stateFlags3 &= ~4; sStickTilt = 127.0f; player->skelAnime.curFrame = 3.0f; - sStickAngle = this->actor.yawTowardsLink + 0x8000; + sStickAngle = this->actor.yawTowardsPlayer + 0x8000; sSwordJumpTimer = sSwordJumpState = 0; this->actor.flags |= 1; } else if (sSwordJumpState == 1) { @@ -391,15 +391,15 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles Dark Link's reaction to sword attack other than jumpslashes - if (func_800354B4(globalCtx, &this->actor, 120.0f, 0x7FFF, 0x7FFF, this->actor.posRot.rot.y)) { + if (func_800354B4(globalCtx, &this->actor, 120.0f, 0x7FFF, 0x7FFF, this->actor.world.rot.y)) { // Loads arguments in wrong order. Probably related to static variables problem. - if ((player->swordAnimation == STAB_1H) && (this->actor.xzDistToLink < 90.0f)) { + if ((player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer < 90.0f)) { // Handles the reaction to a one-handed stab. If the conditions are satisfied, // Dark Link jumps on Link's sword. Otherwise he backflips away. if ((this->swordState == 0) && (sCounterState == 0) && (player->invincibilityTimer == 0) && - (player->swordAnimation == STAB_1H) && (this->actor.xzDistToLink <= 85.0f) && + (player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer <= 85.0f) && func_80033A84(globalCtx, &this->actor)) { sStickTilt = 0.0f; @@ -422,7 +422,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles reactions to all other sword attacks - sStickAngle = this->actor.yawTowardsLink; // Not loaded into pointer + sStickAngle = this->actor.yawTowardsPlayer; // Not loaded into pointer input->cur.button = BTN_B; if (player->swordAnimation <= FORWARD_COMBO_2H) { @@ -449,31 +449,30 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles movement and attacks when not reacting to Link's actions - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sp50 = 0.0f; - if ((90.0f >= this->actor.xzDistToLink) && (this->actor.xzDistToLink > 70.0f) && - (ABS(sp5A) >= 0x7800) && - ((this->actor.unk_10C != 0) || !(player->stateFlags1 & 0x00400000))) { + if ((90.0f >= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 70.0f) && + (ABS(sp5A) >= 0x7800) && (this->actor.isTargeted || !(player->stateFlags1 & 0x00400000))) { EnTorch2_SwingSword(globalCtx, input, this); - } else if (((this->actor.xzDistToLink <= 70.0f) || - ((this->actor.xzDistToLink <= 80.0f + sp50) && (player->swordState != 0))) && + } else if (((this->actor.xzDistToPlayer <= 70.0f) || + ((this->actor.xzDistToPlayer <= 80.0f + sp50) && (player->swordState != 0))) && (this->swordState == 0)) { if (!EnTorch2_SwingSword(globalCtx, input, this) && (this->swordState == 0) && (sCounterState == 0)) { EnTorch2_Backflip(this, input, &this->actor); } - } else if (this->actor.xzDistToLink <= 50 + sp50) { + } else if (this->actor.xzDistToPlayer <= 50 + sp50) { sStickTilt = 127.0f; - sStickAngle = this->actor.yawTowardsLink; - if (this->actor.unk_10C == 0) { + sStickAngle = this->actor.yawTowardsPlayer; + if (!this->actor.isTargeted) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } - } else if (this->actor.xzDistToLink > 100.0f + sp50) { + } else if (this->actor.xzDistToPlayer > 100.0f + sp50) { if ((player->swordState == 0) || (player->swordAnimation < SPIN_ATTACK_1H) || - (player->swordAnimation > BIG_SPIN_2H) || (this->actor.xzDistToLink >= 280.0f)) { + (player->swordAnimation > BIG_SPIN_2H) || (this->actor.xzDistToPlayer >= 280.0f)) { sStickTilt = 127.0f; - sStickAngle = this->actor.yawTowardsLink; - if (this->actor.unk_10C == 0) { + sStickAngle = this->actor.yawTowardsPlayer; + if (!this->actor.isTargeted) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } else { @@ -481,9 +480,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } } else if (((ABS(sp5A) < 0x7800) && (ABS(sp5A) >= 0x3000)) || !EnTorch2_SwingSword(globalCtx, input, this)) { - sStickAngle = this->actor.yawTowardsLink; + sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; - if (this->actor.unk_10C == 0) { + if (!this->actor.isTargeted) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } @@ -495,7 +494,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } else if (sJumpslashFlag && (sAlpha == 255) && (this->actor.velocity.y > 0)) { input->cur.button |= BTN_B; } else if (!sJumpslashFlag && (this->actor.bgCheckFlags & 1)) { - sStickAngle = this->actor.posRot.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsLink; + sStickAngle = this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (sAlpha != 255) { sStickAngle += 0x8000; sStickTilt = 127.0f; // Not loaded from pointer @@ -521,30 +520,28 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { case ENTORCH2_DAMAGE: this->swordState = 0; input->cur.stick_x = input->cur.stick_y = 0; - if ((this->invincibilityTimer > 0) && (this->actor.posRot.pos.y < (this->actor.groundY - 160.0f))) { + if ((this->invincibilityTimer > 0) && (this->actor.world.pos.y < (this->actor.floorHeight - 160.0f))) { this->stateFlags3 &= ~1; this->actor.flags |= 1; this->invincibilityTimer = 0; this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y = sSpawnPoint.y + 40.0f; - this->actor.posRot.pos.x = - (Math_SinS(player->actor.shape.rot.y) * -120.0f) + player->actor.posRot.pos.x; - this->actor.posRot.pos.z = - (Math_CosS(player->actor.shape.rot.y) * -120.0f) + player->actor.posRot.pos.z; - if (func_8002DB6C(&this->actor, &sSpawnPoint) > 800.0f) { + this->actor.world.pos.y = sSpawnPoint.y + 40.0f; + this->actor.world.pos.x = (Math_SinS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.x; + this->actor.world.pos.z = (Math_CosS(player->actor.shape.rot.y) * -120.0f) + player->actor.world.pos.z; + if (Actor_WorldDistXYZToPoint(&this->actor, &sSpawnPoint) > 800.0f) { sp50 = Rand_ZeroOne() * 20.0f; sp4E = Rand_CenteredFloat(4000.0f); - this->actor.shape.rot.y = this->actor.posRot.rot.y = - Math_Vec3f_Yaw(&sSpawnPoint, &player->actor.posRot.pos); - this->actor.posRot.pos.x = - (Math_SinS(this->actor.posRot.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.x; - this->actor.posRot.pos.z = - (Math_CosS(this->actor.posRot.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.z; - this->actor.posRot.pos.y = sSpawnPoint.y; + this->actor.shape.rot.y = this->actor.world.rot.y = + Math_Vec3f_Yaw(&sSpawnPoint, &player->actor.world.pos); + this->actor.world.pos.x = + (Math_SinS(this->actor.world.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.x; + this->actor.world.pos.z = + (Math_CosS(this->actor.world.rot.y + sp4E) * (25.0f + sp50)) + sSpawnPoint.z; + this->actor.world.pos.y = sSpawnPoint.y; } else { - this->actor.posRot.pos.y = this->actor.groundY; + this->actor.world.pos.y = this->actor.floorHeight; } - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); globalCtx->func_11D54(this, globalCtx); sActionState = ENTORCH2_ATTACK; sStickTilt = 0.0f; @@ -562,7 +559,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { return; } sAlpha -= 13; - this->actor.shape.unk_14 -= 13; + this->actor.shape.shadowAlpha -= 13; break; } @@ -576,7 +573,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { input->cur.button = BTN_R; } - if ((sActionState == ENTORCH2_ATTACK) && (this->actor.xzDistToLink <= 610.0f) && sZTargetFlag) { + if ((sActionState == ENTORCH2_ATTACK) && (this->actor.xzDistToPlayer <= 610.0f) && sZTargetFlag) { input->cur.button |= BTN_Z; } @@ -619,11 +616,11 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_8A4 = 6.0f; this->unk_8A8 = 6.0f; this->unk_8A0 = this->actor.colChkInfo.damage; - this->unk_8A2 = this->actor.yawTowardsLink + 0x8000; + this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; sDeathFlag++; sActionState = ENTORCH2_DEATH; func_80032C7C(globalCtx, &this->actor); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xC0); this->stateFlags3 &= ~4; } else { func_800F5ACC(0x38); @@ -639,7 +636,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_8A8 = 6.0f; this->unk_8A0 = this->actor.colChkInfo.damage; this->unk_8A4 = 8.0f; - this->unk_8A2 = this->actor.yawTowardsLink + 0x8000; + this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; func_80035650(&this->actor, &this->cylinder.info, 1); this->stateFlags3 &= ~4; this->stateFlags3 |= 1; @@ -657,7 +654,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { // Handles being frozen by a deku nut - if ((this->actor.dmgEffectTimer == 0) || (this->actor.dmgEffectParams & 0x4000)) { + if ((this->actor.colorFilterTimer == 0) || (this->actor.colorFilterParams & 0x4000)) { this->stateFlags3 &= ~4; } else { this->stateFlags3 |= 4; @@ -685,9 +682,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { if (gSaveContext.health < 0x50) { staggerThreshold = (u32)Rand_CenteredFloat(2.0f) + 3; } - if (this->actor.xzDistToLink > 80.0f) { + if (this->actor.xzDistToPlayer > 80.0f) { this->linearVelocity = 1.2f; - } else if (this->actor.xzDistToLink < 70.0f) { + } else if (this->actor.xzDistToPlayer < 70.0f) { this->linearVelocity = -1.5f; } else { this->linearVelocity = 1.0f; @@ -700,9 +697,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { } } if (player->linearVelocity == -18.0f) { - if (this->actor.xzDistToLink > 80.0f) { + if (this->actor.xzDistToPlayer > 80.0f) { player->linearVelocity = 1.2f; - } else if (this->actor.xzDistToLink < 70.0f) { + } else if (this->actor.xzDistToPlayer < 70.0f) { player->linearVelocity = -1.5f; } else { player->linearVelocity = 1.0f; @@ -753,7 +750,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { Math_SmoothStepToF(&sSwordJumpHeight, 2630.0f, 1.0f, 2000.0f, 0.0f); this->actor.velocity.y -= 0.6f; } else if (sSwordJumpHeight != 0) { - this->actor.posRot.pos.y += sSwordJumpHeight * 0.01f; + this->actor.world.pos.y += sSwordJumpHeight * 0.01f; sSwordJumpHeight = 0; } if ((sActionState == ENTORCH2_WAIT) || (this->invincibilityTimer < 0)) { @@ -764,9 +761,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { if (sJumpslashTimer != 0) { sJumpslashTimer--; } - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += 20.0f; - this->actor.shape.unk_08 = sSwordJumpHeight; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += 20.0f; + this->actor.shape.yOffset = sSwordJumpHeight; } #else #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Torch2/EnTorch2_Update.s") 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 a1c00b5f96..09abd21944 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -21,7 +21,7 @@ void EnToryo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, const ActorInit En_Toryo_InitVars = { ACTOR_EN_TORYO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TORYO, sizeof(EnToryo), @@ -127,17 +127,17 @@ void EnToryo_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 42.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 42.0f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, NULL, this->jointTable, this->morphTable, 17); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Animation_Change(&this->skelAnime, sEnToryoAnimation.anim, 1.0f, 0.0f, Animation_GetLastFrame(sEnToryoAnimation.anim), sEnToryoAnimation.mode, sEnToryoAnimation.transitionRate); this->stateFlags |= 8; - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->actionFunc = func_80B20914; } @@ -367,16 +367,16 @@ void EnToryo_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if ((this->stateFlags & 8)) { - this->unk_1EC.unk_18.x = player->actor.posRot2.pos.x; - this->unk_1EC.unk_18.y = player->actor.posRot2.pos.y; - this->unk_1EC.unk_18.z = player->actor.posRot2.pos.z; + this->unk_1EC.unk_18.x = player->actor.focus.pos.x; + this->unk_1EC.unk_18.y = player->actor.focus.pos.y; + this->unk_1EC.unk_18.z = player->actor.focus.pos.z; if ((this->stateFlags & 0x10)) { func_80034A14(thisx, &this->unk_1EC, 0, 4); return; } - rot = thisx->yawTowardsLink - thisx->shape.rot.y; + rot = thisx->yawTowardsPlayer - thisx->shape.rot.y; if ((rot < 14563.0f) && (rot > -14563.0f)) { func_80034A14(thisx, &this->unk_1EC, 0, 2); } else { @@ -417,7 +417,7 @@ void EnToryo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, switch (limbIndex) { case 15: - Matrix_MultVec3f(&sMultVec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&sMultVec, &this->actor.focus.pos); break; } } 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 c55abf968c..6179091291 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -22,7 +22,7 @@ extern UNK_TYPE D_06000C68; /* const ActorInit En_Tp_InitVars = { ACTOR_EN_TP, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_TP, sizeof(EnTp), 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 03fb8292bf..8a1497bd75 100644 --- a/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -26,7 +26,7 @@ extern UNK_TYPE D_06011688; /* const ActorInit En_Tr_InitVars = { ACTOR_EN_TR, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_TR, sizeof(EnTr), 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 c5f15a9238..d14cc71d7d 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_06001400; /* const ActorInit En_Trap_InitVars = { ACTOR_EN_TRAP, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_TRAP, sizeof(EnTrap), 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 d2d2489c2e..f2a96cf564 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 @@ -43,7 +43,7 @@ static ColliderCylinderInit sCylinderInit = { const ActorInit En_Tubo_Trap_InitVars = { ACTOR_EN_TUBO_TRAP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(EnTuboTrap), @@ -59,7 +59,7 @@ extern Gfx D_05017870[]; void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx) { EnTuboTrap* this = THIS; - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 2.0f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 2.0f); osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 壷トラップ ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); // "Urn Trap" Collider_InitCylinder(globalCtx, &this->collider); @@ -79,7 +79,7 @@ void EnTuboTrap_DropCollectible(EnTuboTrap* this, GlobalContext* globalCtx) { s16 param3FF = (params >> 6) & 0x3FF; if (param3FF >= 0 && param3FF < 0x1A) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, param3FF | ((params & 0x3F) << 8)); + Item_DropCollectible(globalCtx, &this->actor.world.pos, param3FF | ((params & 0x3F) << 8)); } } @@ -92,7 +92,7 @@ void EnTuboTrap_SpawnEffectsOnLand(EnTuboTrap* this, GlobalContext* globalCtx) { s16 var; s32 arg5; s32 i; - Vec3f* actorPos = &this->actor.posRot.pos; + Vec3f* actorPos = &this->actor.world.pos; for (i = 0, var = 0; i < 15; i++, var += 20000) { sin = Math_SinS(var); @@ -135,7 +135,7 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, GlobalContext* globalCtx) s16 var; s32 arg5; s32 i; - Vec3f* actorPos = &this->actor.posRot.pos; + Vec3f* actorPos = &this->actor.world.pos; pos = *actorPos; pos.y += this->actor.yDistToWater; @@ -176,7 +176,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 15.0f)) { EnTuboTrap_SpawnEffectsInWater(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_BOMB_DROP_WATER); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -185,8 +185,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if (this->collider.base.atFlags & AT_BOUNCED) { this->collider.base.atFlags &= ~AT_BOUNCED; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_IT_SHIELD_REFLECT_SW); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -195,8 +195,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_EXPLOSION); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_EXPLOSION); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -206,8 +206,8 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { this->collider.base.atFlags &= ~AT_HIT; if (this->collider.base.at == &player->actor) { EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); - Audio_PlaySoundAtPosition(globalCtx, &player2->actor.posRot.pos, 40, NA_SE_PL_BODY_HIT); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &player2->actor.world.pos, 40, NA_SE_PL_BODY_HIT); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -216,7 +216,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 8) || (this->actor.bgCheckFlags & 1)) { EnTuboTrap_SpawnEffectsOnLand(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, globalCtx); Actor_Kill(&this->actor); return; @@ -228,22 +228,22 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) { f32 targetHeight; if (BREG(2) != 0) { - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わて ☆☆☆☆☆ %f\n" VT_RST, this->actor.posRot.pos.y); // "You" - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ おいどん ☆☆☆☆☆ %f\n" VT_RST, player->actor.posRot.pos.y); // "Me" + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わて ☆☆☆☆☆ %f\n" VT_RST, this->actor.world.pos.y); // "You" + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ おいどん ☆☆☆☆☆ %f\n" VT_RST, player->actor.world.pos.y); // "Me" osSyncPrintf("\n\n"); } - if (this->actor.xzDistToLink < 200.0f && this->actor.posRot.pos.y <= player->actor.posRot.pos.y) { - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_ENEMY); + if (this->actor.xzDistToPlayer < 200.0f && this->actor.world.pos.y <= player->actor.world.pos.y) { + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY); this->actor.flags |= 1; targetHeight = 40.0f + -10.0f * gSaveContext.linkAge; - this->targetY = player->actor.posRot.pos.y + targetHeight; - if (this->targetY < this->actor.posRot.pos.y) { - this->targetY = this->actor.posRot.pos.y + targetHeight; + this->targetY = player->actor.world.pos.y + targetHeight; + if (this->targetY < this->actor.world.pos.y) { + this->targetY = this->actor.world.pos.y + targetHeight; } - this->originPos = this->actor.posRot.pos; + this->originPos = this->actor.world.pos; Audio_PlayActorSound2(&this->actor, NA_SE_EV_POT_MOVE_START); this->actionFunc = EnTuboTrap_Levitate; } @@ -251,19 +251,19 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) { void EnTuboTrap_Levitate(EnTuboTrap* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += 5000; - Math_ApproachF(&this->actor.posRot.pos.y, this->targetY, 0.8f, 3.0f); + Math_ApproachF(&this->actor.world.pos.y, this->targetY, 0.8f, 3.0f); - if (fabsf(this->actor.posRot.pos.y - this->targetY) < 10.0f) { + if (fabsf(this->actor.world.pos.y - this->targetY) < 10.0f) { this->actor.speedXZ = 10.0f; - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actionFunc = EnTuboTrap_Fly; } } void EnTuboTrap_Fly(EnTuboTrap* this, GlobalContext* globalCtx) { - f32 dx = this->originPos.x - this->actor.posRot.pos.x; - f32 dy = this->originPos.y - this->actor.posRot.pos.y; - f32 dz = this->originPos.z - this->actor.posRot.pos.z; + f32 dx = this->originPos.x - this->actor.world.pos.x; + f32 dy = this->originPos.y - this->actor.world.pos.y; + f32 dz = this->originPos.z - this->actor.world.pos.z; Audio_PlayActorSound2(&this->actor, NA_SE_EN_TUBOOCK_FLY - SFX_FLAG); @@ -281,8 +281,8 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) { 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); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 20.0f, 0x1D); + Actor_SetFocus(&this->actor, 0.0f); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 1e41a67d06..fed63c2ee7 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -27,7 +27,7 @@ extern UNK_TYPE D_06004848; /* const ActorInit En_Vali_InitVars = { ACTOR_EN_VALI, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_VALI, sizeof(EnVali), 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 85bf977e1f..fe49bf9b70 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -17,7 +17,7 @@ void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit En_Vase_InitVars = { ACTOR_EN_VASE, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_VASE, sizeof(EnVase), @@ -31,8 +31,8 @@ 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); + this->actor.focus.pos = this->actor.world.pos; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 6.0f); } void EnVase_Destroy(Actor* thisx, GlobalContext* globalCtx) { 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 e968639180..d39556df84 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 @@ -18,7 +18,7 @@ void EnVbBall_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Vb_Ball_InitVars = { 0, - ACTORTYPE_BOSS, + ACTORCAT_BOSS, FLAGS, OBJECT_FD, sizeof(EnVbBall), 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 e3a78a5cdf..f894f64a41 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -93,7 +93,7 @@ u8 D_80B2CEC0 = false; const ActorInit En_Viewer_InitVars = { ACTOR_EN_VIEWER, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnViewer), @@ -129,8 +129,8 @@ EnViewerAnimFunc sAnimFuncs[] = { static void* sActorShadowDrawFunc[] = { NULL, - ActorShadow_DrawFunc_Circle, - ActorShadow_DrawFunc_Squiggly, + ActorShadow_DrawCircle, + ActorShadow_DrawHorse, }; // timer @@ -762,9 +762,9 @@ void EnViewer_GetCutsceneNextPos(EnViewer* this, GlobalContext* globalCtx) { endPos.z = globalCtx->csCtx.npcActions[0]->endPos.z; interpolated = func_8006F93C(globalCtx->csCtx.npcActions[0]->endFrame, globalCtx->csCtx.npcActions[0]->startFrame, globalCtx->csCtx.frames); - this->actor.posRot.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; - this->actor.posRot.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; - this->actor.posRot.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; + this->actor.world.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; + this->actor.world.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; + this->actor.world.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; } } else { if (globalCtx->csCtx.state != 0 && globalCtx->csCtx.npcActions[1] != NULL && @@ -777,19 +777,19 @@ void EnViewer_GetCutsceneNextPos(EnViewer* this, GlobalContext* globalCtx) { endPos.z = globalCtx->csCtx.npcActions[1]->endPos.z; interpolated = func_8006F93C(globalCtx->csCtx.npcActions[1]->endFrame, globalCtx->csCtx.npcActions[1]->startFrame, globalCtx->csCtx.frames); - this->actor.posRot.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; - this->actor.posRot.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; - this->actor.posRot.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; + this->actor.world.pos.x = ((endPos.x - startPos.x) * interpolated) + startPos.x; + this->actor.world.pos.y = ((endPos.y - startPos.y) * interpolated) + startPos.y; + this->actor.world.pos.z = ((endPos.z - startPos.z) * interpolated) + startPos.z; if (globalCtx->csCtx.npcActions[1]->action == 12) { yaw = Math_Vec3f_Yaw(&startPos, &endPos); - Math_SmoothStepToS(&this->actor.posRot.rot.y, yaw, 10, 1000, 1); + Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 10, 1000, 1); Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 10, 1000, 1); } if (params == 9) { - this->actor.posRot.rot.x = globalCtx->csCtx.npcActions[1]->urot.x; - this->actor.posRot.rot.y = globalCtx->csCtx.npcActions[1]->urot.y; - this->actor.posRot.rot.z = globalCtx->csCtx.npcActions[1]->urot.z; + this->actor.world.rot.x = globalCtx->csCtx.npcActions[1]->urot.x; + this->actor.world.rot.y = globalCtx->csCtx.npcActions[1]->urot.y; + this->actor.world.rot.z = globalCtx->csCtx.npcActions[1]->urot.z; this->actor.shape.rot.x = globalCtx->csCtx.npcActions[1]->urot.x; this->actor.shape.rot.y = globalCtx->csCtx.npcActions[1]->urot.y; this->actor.shape.rot.z = globalCtx->csCtx.npcActions[1]->urot.z; 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 fe39bf63f6..257de1df2e 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -25,7 +25,7 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx); const ActorInit En_Vm_InitVars = { ACTOR_EN_VM, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_VM, sizeof(EnVm), @@ -185,19 +185,19 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { switch (this->unk_25E) { case 0: Math_SmoothStepToS(&this->beamRot.x, 0, 10, 1500, 0); - headRot = this->actor.yawTowardsLink - this->headRotY - this->actor.shape.rot.y; - pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos); + headRot = this->actor.yawTowardsPlayer - this->headRotY - this->actor.shape.rot.y; + pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos); if (pitch > 0x1B91) { pitch = 0x1B91; } - dist = this->beamSightRange - this->actor.xzDistToLink; + dist = this->beamSightRange - this->actor.xzDistToPlayer; - if (this->actor.xzDistToLink <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 && - this->actor.yDistToLink <= 80.0f && this->actor.yDistToLink >= -160.0f) { + if (this->actor.xzDistToPlayer <= this->beamSightRange && ABS(headRot) <= 0x2710 && pitch >= 0xE38 && + this->actor.yDistToPlayer <= 80.0f && this->actor.yDistToPlayer >= -160.0f) { Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xFA0, 0); - if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, + if (Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, (ABS((s16)(dist * 180.0f)) / 3) + 0xFA0, 0) <= 5460) { this->timer--; if (this->timer == 0) { @@ -220,7 +220,7 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { return; } - Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsLink - this->actor.shape.rot.y, 1, 0x1F40, 0); + Math_SmoothStepToS(&this->headRotY, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 1, 0x1F40, 0); if (SkelAnime_Update(&this->skelAnime)) { this->unk_260++; @@ -228,8 +228,8 @@ void EnVm_Wait(EnVm* this, GlobalContext* globalCtx) { } if (this->unk_260 == 2) { - this->beamRot.y = this->actor.yawTowardsLink; - this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos); + this->beamRot.y = this->actor.yawTowardsPlayer; + this->beamRot.x = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos); if (this->beamRot.x > 0x1B91) { this->beamRot.x = 0x1B91; @@ -261,7 +261,7 @@ void EnVm_SetupAttack(EnVm* this) { void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { Player* player = PLAYER; - s16 pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.posRot.pos); + s16 pitch = Math_Vec3f_Pitch(&this->beamPos1, &player->actor.world.pos); f32 dist; Vec3f playerPos; @@ -291,13 +291,13 @@ void EnVm_Attack(EnVm* this, GlobalContext* globalCtx) { return; } - Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsLink, 10, 0xDAC, 0); - Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsLink, 10, 0xDAC, 0); + Math_SmoothStepToS(&this->headRotY, -this->actor.shape.rot.y + this->actor.yawTowardsPlayer, 10, 0xDAC, 0); + Math_SmoothStepToS(&this->beamRot.y, this->actor.yawTowardsPlayer, 10, 0xDAC, 0); Math_SmoothStepToS(&this->beamRot.x, pitch, 10, 0xDAC, 0); - playerPos = player->actor.posRot.pos; + playerPos = player->actor.world.pos; - if (player->actor.groundY > BGCHECK_Y_MIN) { - playerPos.y = player->actor.groundY; + if (player->actor.floorHeight > BGCHECK_Y_MIN) { + playerPos.y = player->actor.floorHeight; } dist = Math_Vec3f_DistXYZ(&this->beamPos1, &playerPos); @@ -360,12 +360,12 @@ void EnVm_SetupDie(EnVm* this) { this->unk_21C = 3; this->beamScale.z = 0.0f; this->beamScale.y = 0.0f; - this->actor.shape.unk_08 = -5000.0f; - this->actor.posRot.pos.y += 5000.0f * this->actor.scale.y; + this->actor.shape.yOffset = -5000.0f; + this->actor.world.pos.y += 5000.0f * this->actor.scale.y; this->actor.velocity.y = 8.0f; this->actor.gravity = -0.5f; this->actor.speedXZ = Rand_ZeroOne() + 1.0f; - this->actor.posRot.rot.y = Rand_CenteredFloat(65535.0f); + this->actor.world.rot.y = Rand_CenteredFloat(65535.0f); EnVm_SetupAction(this, EnVm_Die); } @@ -377,14 +377,14 @@ void EnVm_Die(EnVm* this, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if (--this->timer == 0) { - bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0x6FF, BOMB_BODY); + bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0x6FF, BOMB_BODY); if (bomb != NULL) { bomb->timer = 0; } - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xA0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xA0); Actor_Kill(&this->actor); } } @@ -406,8 +406,8 @@ void EnVm_CheckHealth(EnVm* this, GlobalContext* globalCtx) { func_8003426C(&this->actor, 0x4000, 0xFF, 0, 8); EnVm_SetupStun(this); } else { - bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 20.0f, this->actor.posRot.pos.z, 0, 0, 0x601, BOMB_BODY); + bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x, + this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 0, 0, 0x601, BOMB_BODY); if (bomb != NULL) { bomb->timer = 0; @@ -441,13 +441,13 @@ void EnVm_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->colliderCylinder); CollisionCheck_SetOC(globalCtx, colChkCtx, &this->colliderCylinder.base); - if (this->actor.dmgEffectTimer == 0 && this->actor.colChkInfo.health != 0) { + if (this->actor.colorFilterTimer == 0 && this->actor.colChkInfo.health != 0) { CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderCylinder.base); } CollisionCheck_SetAC(globalCtx, colChkCtx, &this->colliderQuad2.base); - this->actor.posRot2.pos = this->actor.posRot.pos; - this->actor.posRot2.pos.y += (6500.0f + this->actor.shape.unk_08) * this->actor.scale.y; + this->actor.focus.pos = this->actor.world.pos; + this->actor.focus.pos.y += (6500.0f + this->actor.shape.yOffset) * this->actor.scale.y; } s32 EnVm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) { @@ -527,7 +527,7 @@ void EnVm_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnVm_OverrideLimbDraw, EnVm_PostLimbDraw, this); - actorPos = this->actor.posRot.pos; + actorPos = this->actor.world.pos; func_80033C30(&actorPos, &D_80B2EB7C, 255, globalCtx); if (this->unk_260 >= 3) { 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 b8cdb50244..e548ef021e 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 @@ -24,7 +24,7 @@ void EnWallTubo_SetWallFall(EnWallTubo* this, GlobalContext* globalCtx); const ActorInit En_Wall_Tubo_InitVars = { ACTOR_EN_WALL_TUBO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWallTubo), @@ -40,7 +40,7 @@ void EnWallTubo_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); // Wall Target osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 壁のツボ ☆☆☆☆☆ \n" VT_RST); - this->unk_164 = this->actor.posRot.pos; + this->unk_164 = this->actor.world.pos; this->actionFunc = EnWallTubo_FindGirl; } @@ -50,7 +50,7 @@ void EnWallTubo_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnWallTubo_FindGirl(EnWallTubo* this, GlobalContext* globalCtx) { Actor* lookForGirl; - lookForGirl = globalCtx->actorCtx.actorList[ACTORTYPE_NPC].first; + lookForGirl = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].head; while (lookForGirl != NULL) { if (lookForGirl->id != ACTOR_EN_BOM_BOWL_MAN) { @@ -74,7 +74,7 @@ void EnWallTubo_DetectChu(EnWallTubo* this, GlobalContext* globalCtx) { if (this->chuGirl->minigamePlayStatus != 0) { if (globalCtx->cameraPtrs[0]->setting == 0x15) { - chu = (EnBomChu*)globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first; + chu = (EnBomChu*)globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].head; while (chu != NULL) { if ((&chu->actor == &this->actor) || (chu->actor.id != ACTOR_EN_BOM_CHU)) { @@ -82,9 +82,9 @@ void EnWallTubo_DetectChu(EnWallTubo* this, GlobalContext* globalCtx) { continue; } - chuPosDiff.x = chu->actor.posRot.pos.x - this->actor.posRot.pos.x; - chuPosDiff.y = chu->actor.posRot.pos.y - this->actor.posRot.pos.y; - chuPosDiff.z = chu->actor.posRot.pos.z - this->actor.posRot.pos.z; + chuPosDiff.x = chu->actor.world.pos.x - this->actor.world.pos.x; + chuPosDiff.y = chu->actor.world.pos.y - this->actor.world.pos.y; + chuPosDiff.z = chu->actor.world.pos.z - this->actor.world.pos.z; if (((fabsf(chuPosDiff.x) < 40.0f) || (BREG(2))) && ((fabsf(chuPosDiff.y) < 40.0f) || (BREG(2))) && (fabsf(chuPosDiff.z) < 40.0f || (BREG(2)))) { @@ -149,8 +149,8 @@ void EnWallTubo_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); if (BREG(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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } 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 7eede7d024..b117168f4d 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -42,7 +42,7 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx); const ActorInit En_Wallmas_InitVars = { ACTOR_EN_WALLMAS, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_WALLMASTER, sizeof(EnWallmas), @@ -111,7 +111,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x30, 1), - ICHAIN_F32(unk_4C, 0x157C, 1), + ICHAIN_F32(targetArrowOffset, 0x157C, 1), ICHAIN_F32_DIV1000(gravity, -1500, 0), }; @@ -167,8 +167,8 @@ void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) { this->actor.flags |= 0x20; this->timer = 0x82; this->actor.velocity.y = 0.0f; - this->actor.posRot.pos.y = player->actor.posRot.pos.y; - this->actor.groundY = player->actor.groundY; + this->actor.world.pos.y = player->actor.world.pos.y; + this->actor.floorHeight = player->actor.floorHeight; this->actor.draw = EnWallmas_Draw; this->actionFunc = EnWallmas_WaitToDrop; } @@ -180,10 +180,10 @@ void EnWallmas_SetupDrop(EnWallmas* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, objSegChangee, 0.0f, 20.0f, Animation_GetLastFrame(&D_0600299C), ANIMMODE_ONCE, 0.0f); - this->yTarget = player->actor.posRot.pos.y; - this->actor.posRot.pos.y = player->actor.posRot.pos.y + 300.0f; - this->actor.posRot.rot.y = player->actor.shape.rot.y + 0x8000; - this->actor.groundY = player->actor.groundY; + this->yTarget = player->actor.world.pos.y; + this->actor.world.pos.y = player->actor.world.pos.y + 300.0f; + this->actor.world.rot.y = player->actor.shape.rot.y + 0x8000; + this->actor.floorHeight = player->actor.floorHeight; this->actor.flags |= 1; this->actor.flags &= ~0x20; this->actionFunc = EnWallmas_Drop; @@ -196,7 +196,7 @@ void EnWallmas_SetupLand(EnWallmas* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, objSegChangee, 1.0f, 41.0f, Animation_GetLastFrame(objSegFrameCount), ANIMMODE_ONCE, -3.0f); - func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); + func_80033260(globalCtx, &this->actor, &this->actor.world.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1); Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_LAND); this->actionFunc = EnWallmas_Land; } @@ -233,9 +233,9 @@ void EnWallmas_SetupReturnToCeiling(EnWallmas* this) { void EnWallmas_SetupTakeDamage(EnWallmas* this) { Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x0001F824) { - this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y; + this->actor.world.rot.y = this->collider.base.ac->world.rot.y; } else { - this->actor.posRot.rot.y = func_8002DA78(&this->actor, this->collider.base.ac) + 0x8000; + this->actor.world.rot.y = Actor_WorldYawTowardActor(&this->actor, this->collider.base.ac) + 0x8000; } func_8003426C(&this->actor, 0x4000, 0xFF, 0, 0x14); @@ -248,7 +248,7 @@ void EnWallmas_SetupCooldown(EnWallmas* this) { Animation_PlayOnce(&this->skelAnime, &D_06000EA4); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnWallmas_Cooldown; } @@ -257,10 +257,10 @@ void EnWallmas_SetupDie(EnWallmas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - EffectSsDeadDb_Spawn(globalCtx, &this->actor.posRot.pos, &zeroVec, &zeroVec, 250, -10, 255, 255, 255, 255, 0, 0, - 255, 1, 9, true); + EffectSsDeadDb_Spawn(globalCtx, &this->actor.world.pos, &zeroVec, &zeroVec, 250, -10, 255, 255, 255, 255, 0, 0, 255, + 1, 9, true); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xC0); this->actionFunc = EnWallmas_Die; } @@ -271,7 +271,7 @@ void EnWallmas_SetupTakePlayer(EnWallmas* this, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - this->yTarget = this->actor.yDistToLink; + this->yTarget = this->actor.yDistToPlayer; func_8002DF38(globalCtx, &this->actor, 0x25); func_800800F8(globalCtx, 0x251C, 0x270F, &this->actor, 0); } @@ -304,10 +304,10 @@ void EnWallmas_SetupStun(EnWallmas* this) { void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; - this->actor.posRot.pos = *playerPos; - this->actor.groundY = player->actor.groundY; + this->actor.world.pos = *playerPos; + this->actor.floorHeight = player->actor.floorHeight; this->actor.floorPoly = player->actor.floorPoly; if (this->timer != 0) { @@ -315,7 +315,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) { } if ((player->stateFlags1 & 0x100000) || (player->stateFlags1 & 0x8000000) || !(player->actor.bgCheckFlags & 1) || - ((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, playerPos)))) { + ((this->actor.params == 1) && (320.0f < Math_Vec3f_DistXZ(&this->actor.home.pos, playerPos)))) { func_800F8D04(NA_SE_EN_FALL_AIM); this->timer = 0x82; } @@ -333,8 +333,8 @@ void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (!Player_InCsMode(globalCtx) && !(player->stateFlags2 & 0x10) && (player->invincibilityTimer >= 0) && - (this->actor.xzDistToLink < 30.0f) && (this->actor.yDistToLink < -5.0f) && - (-(f32)(player->cylinder.dim.height + 10) < this->actor.yDistToLink)) { + (this->actor.xzDistToPlayer < 30.0f) && (this->actor.yDistToPlayer < -5.0f) && + (-(f32)(player->cylinder.dim.height + 10) < this->actor.yDistToPlayer)) { EnWallmas_SetupTakePlayer(this, globalCtx); } } @@ -350,7 +350,7 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) { EnWallmas_SetupWalk(this); } - Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink + 0x8000, 0xB6); + Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer + 0x8000, 0xB6); } void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { @@ -358,7 +358,7 @@ void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) { EnWallmas_SetupJumpToCeiling(this); } - Math_ScaledStepToS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.yawTowardsLink + 0x8000), 0xB6); + Math_ScaledStepToS(&this->actor.world.rot.y, (s16)((s32)this->actor.yawTowardsPlayer + 0x8000), 0xB6); if ((Animation_OnFrame(&this->skelAnime, 0.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 12.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 24.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 36.0f) != 0)) { @@ -377,21 +377,21 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if (this->skelAnime.curFrame > 20.0f) { this->timer += 9; - this->actor.posRot.pos.y = this->actor.posRot.pos.y + 30.0f; + this->actor.world.pos.y = this->actor.world.pos.y + 30.0f; } if (Animation_OnFrame(&this->skelAnime, 20.0f) != 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_UP); } - if (this->actor.yDistToLink < -900.0f) { + if (this->actor.yDistToPlayer < -900.0f) { if (this->actor.params == WMT_FLAG) { Actor_Kill(&this->actor); return; } if (this->actor.params == WMT_TIMER || - Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) { + Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f) { EnWallmas_TimerInit(this, globalCtx); } else { EnWallmas_ProximityOrSwitchInit(this); @@ -423,7 +423,7 @@ void EnWallmas_Cooldown(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx) { if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0015) != 0) { Actor_SetScale(&this->actor, 0.01f); - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, 0xC0); + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xC0); Actor_Kill(&this->actor); } this->actor.scale.z = this->actor.scale.x; @@ -443,19 +443,19 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_CATCH); } if (SkelAnime_Update(&this->skelAnime) != 0) { - player->actor.posRot.pos.x = this->actor.posRot.pos.x; - player->actor.posRot.pos.z = this->actor.posRot.pos.z; + player->actor.world.pos.x = this->actor.world.pos.x; + player->actor.world.pos.z = this->actor.world.pos.z; if (this->timer < 0) { - this->actor.posRot.pos.y = this->actor.posRot.pos.y + 2.0f; + this->actor.world.pos.y = this->actor.world.pos.y + 2.0f; } else { - this->actor.posRot.pos.y = this->actor.posRot.pos.y + 10.0f; + this->actor.world.pos.y = this->actor.world.pos.y + 10.0f; } if (LINK_IS_CHILD) { - player->actor.posRot.pos.y = this->actor.posRot.pos.y - 30.0f; + player->actor.world.pos.y = this->actor.world.pos.y - 30.0f; } else { - player->actor.posRot.pos.y = this->actor.posRot.pos.y - 50.0f; + player->actor.world.pos.y = this->actor.world.pos.y - 50.0f; } if (this->timer == -0x1E) { @@ -471,11 +471,11 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { this->timer = this->timer + 2; } else { - Math_StepToF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y + (LINK_IS_CHILD ? 30.0f : 50.0f), 5.0f); + Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y + (LINK_IS_CHILD ? 30.0f : 50.0f), 5.0f); } - Math_StepToF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 3.0f); - Math_StepToF(&this->actor.posRot.pos.z, player->actor.posRot.pos.z, 3.0f); + Math_StepToF(&this->actor.world.pos.x, player->actor.world.pos.x, 3.0f); + Math_StepToF(&this->actor.world.pos.z, player->actor.world.pos.z, 3.0f); if (this->timer == 0x1E) { func_80078884(NA_SE_OC_ABYSS); @@ -485,7 +485,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_WaitForProximity(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) { + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f) { EnWallmas_TimerInit(this, globalCtx); } } @@ -534,7 +534,7 @@ void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { } } else { if (this->actor.colChkInfo.damageEffect == DAMAGE_EFFECT_BURN) { - EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.posRot.pos, 40, 40); + EffectSsFCircle_Spawn(globalCtx, &this->actor, &this->actor.world.pos, 40, 40); } EnWallmas_SetupTakeDamage(this); @@ -560,9 +560,9 @@ void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->actionFunc != EnWallmas_Drop) { - func_8002E4B4(globalCtx, &this->actor, 20.0f, 25.0f, 0.0f, 0x1D); - } else if (this->actor.posRot.pos.y <= this->yTarget) { - this->actor.posRot.pos.y = this->yTarget; + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 25.0f, 0.0f, 0x1D); + } else if (this->actor.world.pos.y <= this->yTarget) { + this->actor.world.pos.y = this->yTarget; this->actor.velocity.y = 0.0f; EnWallmas_SetupLand(this, globalCtx); } @@ -577,13 +577,13 @@ void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) { } } - Actor_SetHeight(&this->actor, 25.0f); + Actor_SetFocus(&this->actor, 25.0f); if (this->actionFunc == EnWallmas_TakeDamage) { return; } - this->actor.shape.rot.y = this->actor.posRot.rot.y; + this->actor.shape.rot.y = this->actor.world.rot.y; } void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) { @@ -600,7 +600,8 @@ void EnWallmas_DrawXlu(EnWallmas* this, GlobalContext* globalCtx) { func_80094044(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255); - func_80038A28(this->actor.floorPoly, this->actor.posRot.pos.x, this->actor.groundY, this->actor.posRot.pos.z, &mf); + func_80038A28(this->actor.floorPoly, this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z, + &mf); Matrix_Mult(&mf, MTXMODE_NEW); if ((this->actionFunc != EnWallmas_WaitToDrop) && (this->actionFunc != EnWallmas_ReturnToCeiling) && 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 27e02cdee7..23846eefbd 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 @@ -33,7 +33,7 @@ void func_80B31CC0(EnWeatherTag* this, GlobalContext* globalCtx); const ActorInit En_Weather_Tag_InitVars = { ACTOR_EN_WEATHER_TAG, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWeatherTag), @@ -134,7 +134,7 @@ u8 func_80B312C8(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 ret = 0; Player* player = PLAYER; - if (func_8002DB8C(&player->actor, &this->actor) < (this->actor.params >> 8) * 100.0f) { + if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < (this->actor.params >> 8) * 100.0f) { if ((globalCtx->envCtx.unk_1E != 0) || (!D_8011FB3C || !(globalCtx->skyboxId == 1 || globalCtx->envCtx.unk_1F != globalCtx->envCtx.unk_20))) { D_8011FB38 = 1; @@ -175,7 +175,7 @@ u8 func_80B3149C(EnWeatherTag* this, GlobalContext* globalCtx, u8 arg2, u8 arg3, u8 ret = 0; Player* player = PLAYER; - if ((((this->actor.params >> 8) * 100.0f) + 100.0f) < func_8002DB8C(&player->actor, &this->actor)) { + if ((((this->actor.params >> 8) * 100.0f) + 100.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) { if ((globalCtx->envCtx.unk_1E != 0) || (!D_8011FB3C || !(globalCtx->skyboxId == 1 || globalCtx->envCtx.unk_1F != globalCtx->envCtx.unk_20))) { D_8011FB38 = 1; @@ -293,7 +293,7 @@ void func_80B31AA0(EnWeatherTag* this, GlobalContext* globalCtx) { void func_80B31B24(EnWeatherTag* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (func_8002DB8C(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { + if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { Math_SmoothStepToS(&globalCtx->envCtx.unk_9E, -0x50, 1, 2, 1); Math_SmoothStepToS(&globalCtx->envCtx.unk_A0, -0x7D0, 1, 0x32, 1); } else { @@ -305,7 +305,7 @@ void func_80B31B24(EnWeatherTag* this, GlobalContext* globalCtx) { void func_80B31C20(EnWeatherTag* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if (func_8002DB8C(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { + if (Actor_WorldDistXZToActor(&player->actor, &this->actor) < ((this->actor.params >> 8) * 100.0f)) { func_80077624(globalCtx); globalCtx->envCtx.lightning = 1; globalCtx->envCtx.unk_EE[0] = 0x19; @@ -316,7 +316,7 @@ void func_80B31C20(EnWeatherTag* this, GlobalContext* globalCtx) { void func_80B31CC0(EnWeatherTag* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((((this->actor.params >> 8) * 100.0f) + 10.0f) < func_8002DB8C(&player->actor, &this->actor)) { + if ((((this->actor.params >> 8) * 100.0f) + 10.0f) < Actor_WorldDistXZToActor(&player->actor, &this->actor)) { func_80077684(globalCtx); globalCtx->envCtx.lightning = 2; globalCtx->envCtx.unk_EE[0] = 0; @@ -330,8 +330,8 @@ void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) { 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, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, 1.0f, 1.0f, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } 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 4c1fe4786a..0552dc9b28 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -23,7 +23,7 @@ extern UNK_TYPE D_06003410; /* const ActorInit En_Weiyer_InitVars = { ACTOR_EN_WEIYER, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_EI, sizeof(EnWeiyer), 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 e112e76b8a..8ea84f7ace 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -28,7 +28,7 @@ extern UNK_TYPE D_0600A4AC; /* const ActorInit En_Wf_InitVars = { ACTOR_EN_WF, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_WF, sizeof(EnWf), 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 11e02ccc5d..f250e374af 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 @@ -45,7 +45,7 @@ static ColliderCylinderInit sCylinderInit = { const ActorInit En_Wonder_Item_InitVars = { ACTOR_EN_WONDER_ITEM, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWonderItem), @@ -84,16 +84,16 @@ void EnWonderItem_DropCollectible(EnWonderItem* this, GlobalContext* globalCtx, for (i = this->dropCount; i > 0; i--) { if (this->itemDrop < WONDERITEM_DROP_RANDOM) { if ((this->itemDrop == WONDERITEM_DROP_FLEXIBLE) || !autoCollect) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, dropTable[this->itemDrop]); + Item_DropCollectible(globalCtx, &this->actor.world.pos, dropTable[this->itemDrop]); } else { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, dropTable[this->itemDrop] | 0x8000); + Item_DropCollectible(globalCtx, &this->actor.world.pos, dropTable[this->itemDrop] | 0x8000); } } else { randomDrop = this->itemDrop - WONDERITEM_DROP_RANDOM; if (!autoCollect) { - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, randomDrop); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, randomDrop); } else { - Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.posRot.pos, randomDrop | 0x8000); + Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, randomDrop | 0x8000); } } } @@ -125,7 +125,7 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.unk_1F = 1; + this->actor.targetMode = 1; if ((this->switchFlag >= 0) && Flags_GetSwitch(globalCtx, this->switchFlag)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); Actor_Kill(&this->actor); @@ -133,27 +133,27 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { } switch (this->wonderMode) { case WONDERITEM_MULTITAG_FREE: - this->numTagPoints = this->actor.posRot.rot.z & 0xF; + this->numTagPoints = this->actor.world.rot.z & 0xF; rotZover10 = 0; - if (this->actor.posRot.rot.z >= 10) { - rotZover10 = this->actor.posRot.rot.z / 10; + if (this->actor.world.rot.z >= 10) { + rotZover10 = this->actor.world.rot.z / 10; this->timerMod = rotZover10 * 20; } - this->numTagPoints = this->actor.posRot.rot.z - rotZover10 * 10; + this->numTagPoints = this->actor.world.rot.z - rotZover10 * 10; // i.e timerMod = rot.z / 10 seconds, numTagPoints = rot.z % 10 this->updateFunc = EnWonderItem_MultitagFree; break; case WONDERITEM_TAG_POINT_FREE: - tagIndex = this->actor.posRot.rot.z & 0xFF; - sTagPointsFree[tagIndex] = this->actor.posRot.pos; + tagIndex = this->actor.world.rot.z & 0xFF; + sTagPointsFree[tagIndex] = this->actor.world.pos; Actor_Kill(&this->actor); break; case WONDERITEM_PROXIMITY_DROP: - this->dropCount = this->actor.posRot.rot.z & 0xFF; + this->dropCount = this->actor.world.rot.z & 0xFF; this->updateFunc = EnWonderItem_ProximityDrop; break; case WONDERITEM_INTERACT_SWITCH: - colTypeIndex = this->actor.posRot.rot.z & 0xFF; + colTypeIndex = this->actor.world.rot.z & 0xFF; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->collider.info.bumper.dmgFlags = collisionTypes[colTypeIndex]; @@ -164,19 +164,19 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { case WONDERITEM_UNUSED: break; case WONDERITEM_MULTITAG_ORDERED: - this->numTagPoints = this->actor.posRot.rot.z & 0xF; + this->numTagPoints = this->actor.world.rot.z & 0xF; rotZover10 = 0; - if (this->actor.posRot.rot.z >= 10) { - rotZover10 = this->actor.posRot.rot.z / 10; + if (this->actor.world.rot.z >= 10) { + rotZover10 = this->actor.world.rot.z / 10; this->timerMod = rotZover10 * 20; } - this->numTagPoints = this->actor.posRot.rot.z - rotZover10 * 10; + this->numTagPoints = this->actor.world.rot.z - rotZover10 * 10; // i.e timerMod = rot.z / 10 seconds, numTagPoints = rot.z % 10 this->updateFunc = EnWonderItem_MultitagOrdered; break; case WONDERITEM_TAG_POINT_ORDERED: - tagIndex = this->actor.posRot.rot.z & 0xFF; - sTagPointsOrdered[tagIndex] = this->actor.posRot.pos; + tagIndex = this->actor.world.rot.z & 0xFF; + sTagPointsOrdered[tagIndex] = this->actor.world.pos; Actor_Kill(&this->actor); break; case WONDERITEM_PROXIMITY_SWITCH: @@ -186,13 +186,13 @@ void EnWonderItem_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->collider.info.bumper.dmgFlags = 0x00000004; // slingshot - this->unkPos = this->actor.posRot.pos; + this->unkPos = this->actor.world.pos; this->collider.dim.radius = 35; this->collider.dim.height = 75; this->updateFunc = EnWonderItem_BombSoldier; break; case WONDERITEM_ROLL_DROP: - this->dropCount = this->actor.posRot.rot.z & 0xFF; + this->dropCount = this->actor.world.rot.z & 0xFF; this->updateFunc = EnWonderItem_RollDrop; break; default: @@ -209,9 +209,9 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, GlobalContext* globalCtx) { for (i = 0, mask = 1; i < this->numTagPoints; i++, mask <<= 1) { if (!(prevTagFlags & mask)) { - f32 dx = player->actor.posRot.pos.x - sTagPointsFree[i].x; - f32 dy = player->actor.posRot.pos.y - sTagPointsFree[i].y; - f32 dz = player->actor.posRot.pos.z - sTagPointsFree[i].z; + f32 dx = player->actor.world.pos.x - sTagPointsFree[i].x; + f32 dy = player->actor.world.pos.y - sTagPointsFree[i].y; + f32 dz = player->actor.world.pos.z - sTagPointsFree[i].z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 50.0f) { this->tagFlags |= mask; @@ -221,8 +221,8 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, GlobalContext* globalCtx) { } if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 0, 255, 0, 255, 4, globalCtx->state.gfxCtx); + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 0, 255, 0, 255, 4, globalCtx->state.gfxCtx); } } } @@ -241,7 +241,7 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, GlobalContext* globalCtx) { void EnWonderItem_ProximityDrop(EnWonderItem* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->actor.xzDistToLink < 50.0f) && (fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 30.0f)) { + if ((this->actor.xzDistToPlayer < 50.0f) && (fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 30.0f)) { EnWonderItem_DropCollectible(this, globalCtx, true); } } @@ -256,7 +256,7 @@ void EnWonderItem_InteractSwitch(EnWonderItem* this, GlobalContext* globalCtx) { void EnWonderItem_ProximitySwitch(EnWonderItem* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->actor.xzDistToLink < 50.0f) && (fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 30.0f)) { + if ((this->actor.xzDistToPlayer < 50.0f) && (fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 30.0f)) { if (this->switchFlag >= 0) { Flags_SetSwitch(globalCtx, this->switchFlag); } @@ -272,9 +272,9 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, GlobalContext* globalCtx) for (i = 0, mask = 1; i < this->numTagPoints; i++, mask <<= 1) { if (!(prevTagFlags & mask)) { - f32 dx = player->actor.posRot.pos.x - sTagPointsOrdered[i].x; - f32 dy = player->actor.posRot.pos.y - sTagPointsOrdered[i].y; - f32 dz = player->actor.posRot.pos.z - sTagPointsOrdered[i].z; + f32 dx = player->actor.world.pos.x - sTagPointsOrdered[i].x; + f32 dy = player->actor.world.pos.y - sTagPointsOrdered[i].y; + f32 dz = player->actor.world.pos.z - sTagPointsOrdered[i].z; if (sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 50.0f) { if (prevTagFlags & mask) { @@ -291,8 +291,8 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, GlobalContext* globalCtx) } } else if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].z, - this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z, - 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } } @@ -308,8 +308,8 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, GlobalContext* globalCtx) void EnWonderItem_BombSoldier(EnWonderItem* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HEISHI2, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.yawTowardsLink, 0, + if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HEISHI2, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.yawTowardsPlayer, 0, 9) != NULL) { // Careless soldier spawned osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ うっかり兵セット完了 ☆☆☆☆☆ \n" VT_RST); @@ -324,8 +324,8 @@ void EnWonderItem_BombSoldier(EnWonderItem* this, GlobalContext* globalCtx) { void EnWonderItem_RollDrop(EnWonderItem* this, GlobalContext* globalCtx) { Player* player = PLAYER; - if ((this->actor.xzDistToLink < 50.0f) && (player->invincibilityTimer < 0) && - (fabsf(this->actor.posRot.pos.y - player->actor.posRot.pos.y) < 30.0f)) { + if ((this->actor.xzDistToPlayer < 50.0f) && (player->invincibilityTimer < 0) && + (fabsf(this->actor.world.pos.y - player->actor.world.pos.y) < 30.0f)) { EnWonderItem_DropCollectible(this, globalCtx, true); } } @@ -345,7 +345,7 @@ void EnWonderItem_Update(Actor* thisx, GlobalContext* globalCtx) { this->updateFunc(this, globalCtx); if (this->wonderMode == WONDERITEM_UNUSED) { - Actor_SetHeight(&this->actor, this->unkHeight); + Actor_SetFocus(&this->actor, this->unkHeight); } if ((this->wonderMode == WONDERITEM_INTERACT_SWITCH) || (this->wonderMode == WONDERITEM_BOMB_SOLDIER)) { Collider_UpdateCylinder(&this->actor, &this->collider); @@ -357,8 +357,8 @@ void EnWonderItem_Update(Actor* thisx, GlobalContext* globalCtx) { colorIndex = 0; } 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, debugArrowColors[colorIndex], debugArrowColors[colorIndex + 1], debugArrowColors[colorIndex + 2], 255, 4, globalCtx->state.gfxCtx); } 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 fd3cea808c..2ecf6dadaa 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 @@ -21,7 +21,7 @@ void func_80B3943C(EnWonderTalk* this, GlobalContext* globalCtx); const ActorInit En_Wonder_Talk_InitVars = { ACTOR_EN_WONDER_TALK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWonderTalk), @@ -47,7 +47,7 @@ void EnWonderTalk_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->switchFlag == 0x3F) { this->switchFlag = -1; } - this->actor.unk_1F = 1; + this->actor.targetMode = 1; if (this->switchFlag >= 0) { if (Flags_GetSwitch(globalCtx, this->switchFlag)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); @@ -150,8 +150,8 @@ void func_80B3943C(EnWonderTalk* this, GlobalContext* globalCtx) { } this->actionFunc = func_80B391CC; } - } else if (!(this->unk_15C < this->actor.xzDistToLink)) { - yawDiffTemp = (this->actor.yawTowardsLink - this->actor.posRot.rot.y); + } else if (!(this->unk_15C < this->actor.xzDistToPlayer)) { + yawDiffTemp = (this->actor.yawTowardsPlayer - this->actor.world.rot.y); yawDiff = ABS(yawDiffTemp); if (yawDiff < 0x4000) { @@ -164,7 +164,7 @@ void func_80B3943C(EnWonderTalk* this, GlobalContext* globalCtx) { // Actual message type osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); // Specified range - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); osSyncPrintf("\n\n"); } this->unk_15A = 0; @@ -213,8 +213,8 @@ void func_80B395F0(EnWonderTalk* this, GlobalContext* globalCtx) { case 3: func_80106CCC(globalCtx); if (this->unk_164 == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 2); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 2); this->unk_164 = 1; } @@ -223,8 +223,8 @@ void func_80B395F0(EnWonderTalk* this, GlobalContext* globalCtx) { case 5: func_80106CCC(globalCtx); if (this->unk_164 == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 3); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 3); this->unk_164 = 1; } this->actionFunc = func_80B391CC; @@ -241,18 +241,18 @@ void EnWonderTalk_Update(Actor* thisx, GlobalContext* globalCtx) { this->unk_158--; } this->actionFunc(this, globalCtx); - Actor_SetHeight(&this->actor, this->height); + Actor_SetFocus(&this->actor, this->height); if (BREG(0) != 0) { if (this->unk_15A != 0) { if ((this->unk_15A & 1) == 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, 1.0f, 10, 10, 10, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 10, 10, 10, 255, 4, globalCtx->state.gfxCtx); } } else { - 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 255, 0, 255, 4, globalCtx->state.gfxCtx); } } 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 5a458bac40..0e2a7eba84 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 @@ -23,7 +23,7 @@ void EnWonderTalk2_DoNothing(EnWonderTalk2* this, GlobalContext* globalCtx); const ActorInit En_Wonder_Talk2_InitVars = { ACTOR_EN_WONDER_TALK2, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnWonderTalk2), @@ -46,9 +46,9 @@ void EnWonderTalk2_Init(Actor* thisx, GlobalContext* globalCtx) { // Transparent message osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->baseMsgId = (this->actor.params >> 6) & 0xFF; - if (this->actor.posRot.rot.z > 0) { + if (this->actor.world.rot.z > 0) { s32 rangeIndex = 0; - s16 rotZmod10 = this->actor.posRot.rot.z; + s16 rotZmod10 = this->actor.world.rot.z; while (rotZmod10 > 10) { rotZmod10 -= 10; @@ -60,13 +60,13 @@ void EnWonderTalk2_Init(Actor* thisx, GlobalContext* globalCtx) { rangeIndex = 0; } - this->actor.unk_1F = D_80B3A8E0[rangeIndex]; + this->actor.targetMode = D_80B3A8E0[rangeIndex]; osSyncPrintf("\n\n"); // originally? - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元は? ☆☆☆☆☆ %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 元は? ☆☆☆☆☆ %d\n" VT_RST, this->actor.world.rot.z); // The range is? - osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n" VT_RST, this->actor.unk_1F); + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? ☆☆☆☆☆ %d\n" VT_RST, this->actor.targetMode); // Is the range? osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ は、範囲わ? ☆☆☆☆☆ %f\n" VT_RST, this->triggerRange); osSyncPrintf("\n\n"); @@ -74,7 +74,7 @@ void EnWonderTalk2_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("\n\n"); } - this->initPos = this->actor.posRot.pos; + this->initPos = this->actor.world.pos; this->switchFlag = (this->actor.params & 0x3F); this->talkMode = ((this->actor.params >> 0xE) & 3); @@ -128,10 +128,10 @@ void func_80B3A15C(EnWonderTalk2* this, GlobalContext* globalCtx) { this->actionFunc = func_80B3A10C; } else { - s16 yawDiff = ABS((s16)(this->actor.yawTowardsLink - this->actor.posRot.rot.y)); + s16 yawDiff = ABS((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y)); - if (!((this->actor.xzDistToLink > 40.0f + this->triggerRange) || - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) > 100.0f) || (yawDiff >= 0x4000))) { + if (!((this->actor.xzDistToPlayer > 40.0f + this->triggerRange) || + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || (yawDiff >= 0x4000))) { if (this->unk_158 >= 2) { osSyncPrintf("\n\n"); // Transparent Message Kimi Set @@ -143,7 +143,7 @@ void func_80B3A15C(EnWonderTalk2* this, GlobalContext* globalCtx) { // Actual message type osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); // Specified range - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); // Processing range osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 処理範囲 %f\n" VT_RST, this->triggerRange); switch (this->talkMode) { @@ -215,10 +215,10 @@ void func_80B3A4F8(EnWonderTalk2* this, GlobalContext* globalCtx) { } else if ((this->talkMode != 4) || !this->unk_15A) { if (BREG(2) != 0) { // distance - osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ きょり %f\n" VT_RST, this->actor.xzDistToLink); + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ きょり %f\n" VT_RST, this->actor.xzDistToPlayer); } - if (((this->actor.xzDistToLink < (40.0f + this->triggerRange)) && - (fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f)) && + if (((this->actor.xzDistToPlayer < (40.0f + this->triggerRange)) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f)) && !Gameplay_InCsMode(globalCtx)) { if (this->unk_158 >= 2) { osSyncPrintf("\n\n"); @@ -231,11 +231,11 @@ void func_80B3A4F8(EnWonderTalk2* this, GlobalContext* globalCtx) { // Real message type osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 実質メッセージ種類 %x\n" VT_RST, this->actor.textId); // Specified range - osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.posRot.rot.z); + osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 指定範囲 %d\n" VT_RST, this->actor.world.rot.z); // Processing range osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 処理範囲 %f\n" VT_RST, this->triggerRange); // What is your range? - osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? \t\t %d\n" VT_RST, this->actor.unk_1F); + osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ レンジは? \t\t %d\n" VT_RST, this->actor.targetMode); osSyncPrintf("\n\n"); osSyncPrintf("\n\n"); switch (this->talkMode) { @@ -273,20 +273,20 @@ void EnWonderTalk2_Update(Actor* thisx, GlobalContext* globalCtx) { EnWonderTalk2* this = THIS; this->actionFunc(this, globalCtx); - this->actor.posRot.pos.y = this->initPos.y; + this->actor.world.pos.y = this->initPos.y; - Actor_SetHeight(&this->actor, this->height); + Actor_SetFocus(&this->actor, this->height); if (BREG(0) != 0) { if (this->unk_158 != 0) { if ((this->unk_158 & 1) == 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, 1.0f, 70, 70, 70, 255, 4, globalCtx->state.gfxCtx); + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, + 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx->state.gfxCtx); } } else { - 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, + DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, + this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, globalCtx->state.gfxCtx); } } 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 aaa84f1f59..9187929538 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -36,7 +36,7 @@ typedef enum { const ActorInit En_Wood02_InitVars = { ACTOR_EN_WOOD02, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_WOOD02, sizeof(EnWood02), @@ -71,7 +71,7 @@ static f32 sSpawnDistance[] = { 707.0f, 525.0f, 510.0f, 500.0f, 566.0f, 141.0f } static s16 sSpawnAngle[] = { 0x1FFF, 0x4C9E, 0x77F5, 0xA5C9, 0xD6C3, 0xA000 }; static InitChainEntry sInitChain[] = { - ICHAIN_F32(unk_4C, 5600, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 5600, ICHAIN_STOP), }; static Gfx* D_80B3BF54[] = { @@ -123,11 +123,11 @@ void EnWood02_SpawnOffspring(EnWood02* this, GlobalContext* globalCtx) { extraRot = 0x4000; } childSpawnAngle = &sSpawnAngle[i]; - sSpawnCos = Math_CosS(*childSpawnAngle + this->actor.posRot.rot.y + extraRot); - sSpawnSin = Math_SinS(*childSpawnAngle + this->actor.posRot.rot.y + extraRot); - childPos.x = (sSpawnDistance[i] * sSpawnSin) + this->actor.initPosRot.pos.x; - childPos.y = this->actor.initPosRot.pos.y; - childPos.z = (sSpawnDistance[i] * sSpawnCos) + this->actor.initPosRot.pos.z; + sSpawnCos = Math_CosS(*childSpawnAngle + this->actor.world.rot.y + extraRot); + sSpawnSin = Math_SinS(*childSpawnAngle + this->actor.world.rot.y + extraRot); + childPos.x = (sSpawnDistance[i] * sSpawnSin) + this->actor.home.pos.x; + childPos.y = this->actor.home.pos.y; + childPos.z = (sSpawnDistance[i] * sSpawnCos) + this->actor.home.pos.z; if (EnWood02_SpawnZoneCheck(this, globalCtx, &childPos)) { if ((this->unk_14E[i] & 0x80) != 0) { childParams = (0xFF00 | (this->actor.params + 1)); @@ -136,7 +136,7 @@ void EnWood02_SpawnOffspring(EnWood02* this, GlobalContext* globalCtx) { } childWood = (EnWood02*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_WOOD02, childPos.x, childPos.y, childPos.z, - this->actor.posRot.rot.x, *childSpawnAngle, 0, childParams); + this->actor.world.rot.x, *childSpawnAngle, 0, childParams); if (childWood != NULL) { childWood->unk_14E[0] = i; this->unk_14E[i] |= 1; @@ -163,10 +163,10 @@ void EnWood02_Init(Actor* thisx, GlobalContext* globalCtx2) { actorScale = 1.0f; this->unk_14C = (this->actor.params >> 8) & 0xFF; - if (this->actor.initPosRot.rot.z != 0) { - this->actor.initPosRot.rot.z = (this->actor.initPosRot.rot.z << 8) | this->unk_14C; + if (this->actor.home.rot.z != 0) { + this->actor.home.rot.z = (this->actor.home.rot.z << 8) | this->unk_14C; this->unk_14C = -1; - this->actor.posRot.rot.z = this->actor.shape.rot.z = 0; + this->actor.world.rot.z = this->actor.shape.rot.z = 0; } else if (this->unk_14C & 0x80) { this->unk_14C = -1; } @@ -257,28 +257,27 @@ void EnWood02_Init(Actor* thisx, GlobalContext* globalCtx2) { if (spawnType == WOOD_SPAWN_SPAWNER) { this->drawType |= this->unk_14C << 4; EnWood02_SpawnOffspring(this, globalCtx); - sSpawnCos = Math_CosS(sSpawnAngle[5] + this->actor.posRot.rot.y + extraRot); - sSpawnSin = Math_SinS(sSpawnAngle[5] + this->actor.posRot.rot.y + extraRot); - this->actor.posRot.pos.x += (sSpawnSin * sSpawnDistance[5]); - this->actor.posRot.pos.z += (sSpawnCos * sSpawnDistance[5]); + sSpawnCos = Math_CosS(sSpawnAngle[5] + this->actor.world.rot.y + extraRot); + sSpawnSin = Math_SinS(sSpawnAngle[5] + this->actor.world.rot.y + extraRot); + this->actor.world.pos.x += (sSpawnSin * sSpawnDistance[5]); + this->actor.world.pos.z += (sSpawnCos * sSpawnDistance[5]); } else { this->actor.flags |= 0x10; } // Snap to floor, or remove if over void - this->actor.posRot.pos.y += 200.0f; - floorY = - BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &outPoly, &bgId, &this->actor, &this->actor.posRot.pos); + this->actor.world.pos.y += 200.0f; + floorY = BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &outPoly, &bgId, &this->actor, &this->actor.world.pos); if (floorY > BGCHECK_Y_MIN) { - this->actor.posRot.pos.y = floorY; + this->actor.world.pos.y = floorY; } else { Actor_Kill(&this->actor); return; } } ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - this->actor.initPosRot.rot.y = 0; + this->actor.home.rot.y = 0; this->actor.colChkInfo.mass = MASS_IMMOVABLE; } @@ -325,19 +324,19 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_REFLECTION_WOOD); } - if (this->actor.initPosRot.rot.y != 0) { - dropsSpawnPt = this->actor.posRot.pos; + if (this->actor.home.rot.y != 0) { + dropsSpawnPt = this->actor.world.pos; dropsSpawnPt.y += 200.0f; if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { Item_DropCollectibleRandom(globalCtx, &this->actor, &dropsSpawnPt, this->unk_14C << 4); } else { - if (this->actor.initPosRot.rot.z != 0) { - this->actor.initPosRot.rot.z &= 0x1FFF; - this->actor.initPosRot.rot.z |= 0xE000; + if (this->actor.home.rot.z != 0) { + this->actor.home.rot.z &= 0x1FFF; + this->actor.home.rot.z |= 0xE000; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, dropsSpawnPt.x, dropsSpawnPt.y, - dropsSpawnPt.z, 0, this->actor.posRot.rot.y, 0, this->actor.initPosRot.rot.z); - this->actor.initPosRot.rot.z = 0; + dropsSpawnPt.z, 0, this->actor.world.rot.y, 0, this->actor.home.rot.z); + this->actor.home.rot.z = 0; } } @@ -357,10 +356,10 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { } } this->unk_14C = -0x15; - this->actor.initPosRot.rot.y = 0; + this->actor.home.rot.y = 0; } - if (this->actor.xzDistToLink < 600.0f) { + if (this->actor.xzDistToPlayer < 600.0f) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -369,12 +368,12 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { Player* player = PLAYER; if (this->unk_14C >= -1) { - if (((player->rideActor == NULL) && (sqrt(this->actor.xyzDistToLinkSq) < 20.0) && + if (((player->rideActor == NULL) && (sqrt(this->actor.xyzDistToPlayerSq) < 20.0) && (player->linearVelocity != 0.0f)) || - ((player->rideActor != NULL) && (sqrt(this->actor.xyzDistToLinkSq) < 60.0) && + ((player->rideActor != NULL) && (sqrt(this->actor.xyzDistToPlayerSq) < 60.0) && (player->rideActor->speedXZ != 0.0f))) { if ((this->unk_14C >= 0) && (this->unk_14C < 0x64)) { - Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.posRot.pos, + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, ((this->unk_14C << 4) | 0x8000)); } this->unk_14C = -0x15; @@ -398,8 +397,8 @@ void EnWood02_Update(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_14C < -1) { this->unk_14C++; wobbleAmplitude = Math_SinS((this->unk_14C ^ 0xFFFF) * 0x3332) * 250.0f; - this->actor.shape.rot.x = (Math_CosS(this->actor.yawTowardsLink - this->actor.shape.rot.y) * wobbleAmplitude); - this->actor.shape.rot.z = (Math_SinS(this->actor.yawTowardsLink - this->actor.shape.rot.y) * wobbleAmplitude); + this->actor.shape.rot.x = (Math_CosS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) * wobbleAmplitude); + this->actor.shape.rot.z = (Math_SinS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) * wobbleAmplitude); } } 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 21deafa2a2..95773b6b2a 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -49,7 +49,7 @@ extern UNK_TYPE D_0601C0E8; /* const ActorInit En_Xc_InitVars = { ACTOR_EN_XC, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_XC, sizeof(EnXc), 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 742edf8d77..10abcdbc44 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 @@ -17,7 +17,7 @@ void EnYabusameMark_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_Yabusame_Mark_InitVars = { ACTOR_EN_YABUSAME_MARK, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EnYabusameMark), 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 67fcd4499e..99e2c543e1 100644 --- a/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -21,7 +21,7 @@ void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx); const ActorInit En_Yukabyun_InitVars = { ACTOR_EN_YUKABYUN, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_YUKABYUN, sizeof(EnYukabyun), @@ -53,7 +53,7 @@ static ColliderCylinderInit sCylinderInit = { static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE), - ICHAIN_F32(unk_4C, 16, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 16, ICHAIN_STOP), }; static UNK_PTR D_80B43F64[] = { 0x06000AF0, 0x06000000 }; @@ -65,7 +65,7 @@ void EnYukabyun_Init(Actor* thisx, GlobalContext* globalCtx) { EnYukabyun* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 0.4f); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.4f); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.params++; @@ -93,17 +93,17 @@ void func_80B43AD4(EnYukabyun* this, GlobalContext* globalCtx) { this->unk_150 += 0xA0; this->actor.shape.rot.y += this->unk_150; if (this->unk_150 >= 0x2000) { - this->actor.posRot.rot.y = this->actor.yawTowardsLink; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.speedXZ = 10.0f; this->actionfunc = func_80B43B6C; } - Math_StepToF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + 30.0f, 1.0f); + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 30.0f, 1.0f); func_8002F974(&this->actor, NA_SE_EN_YUKABYUN_FLY - SFX_FLAG); } void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx) { this->actor.shape.rot.y += this->unk_150; - if (this->actor.xzDistToLink > 5000.0f) { + if (this->actor.xzDistToPlayer > 5000.0f) { Actor_Kill(&this->actor); return; } @@ -111,7 +111,7 @@ void func_80B43B6C(EnYukabyun* this, GlobalContext* globalCtx) { } void EnYukabyun_Break(EnYukabyun* this, GlobalContext* globalCtx) { - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.posRot.pos, 8.0f, 0, 1300, 300, 15, OBJECT_YUKABYUN, 10, + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 8.0f, 0, 1300, 300, 15, OBJECT_YUKABYUN, 10, D_06000A60); Actor_Kill(&this->actor); } @@ -127,7 +127,7 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_HIT; this->collider.base.ocFlags1 &= ~OC1_HIT; this->actor.flags &= ~0x5; - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 30, NA_SE_EN_OCTAROCK_ROCK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_OCTAROCK_ROCK); this->actionfunc = EnYukabyun_Break; } @@ -135,7 +135,7 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_MoveForward(&this->actor); if (!(this->actionfunc == func_80B43A94 || this->actionfunc == EnYukabyun_Break)) { - func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 8.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 5.0f, 20.0f, 8.0f, 5); Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.flags |= 0x1000000; @@ -144,7 +144,7 @@ void EnYukabyun_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Actor_SetHeight(&this->actor, 4.0f); + Actor_SetFocus(&this->actor, 4.0f); } void EnYukabyun_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 c3eabcda58..edf2c03922 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -33,7 +33,7 @@ extern UNK_TYPE D_06016388; /* const ActorInit En_Zf_InitVars = { ACTOR_EN_ZF, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_ZF, sizeof(EnZf), 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 e89ccb0427..5075ea9af6 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c @@ -28,7 +28,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx); const ActorInit En_Zl1_InitVars = { ACTOR_EN_ZL1, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL1, sizeof(EnZl1), @@ -92,8 +92,8 @@ void EnZl1_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Actor_SetScale(&this->actor, 0.01f); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f); - this->actor.unk_1F = 0; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); + this->actor.targetMode = 0; if (gSaveContext.sceneSetupIndex >= 4) { frameCount = Animation_GetLastFrame(&D_06000438); @@ -147,7 +147,7 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) { Player* player = PLAYER; s32 pad; - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); if (this->unk_1E6 != 0) { if (func_8002F334(&this->actor, globalCtx)) { @@ -155,7 +155,7 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) { } } else if (func_8002F194(&this->actor, globalCtx)) { this->unk_1E6 = 1; - } else if (this->actor.posRot.pos.y <= player->actor.posRot.pos.y) { + } else if (this->actor.world.pos.y <= player->actor.world.pos.y) { func_8002F2F4(&this->actor, globalCtx); } @@ -189,15 +189,15 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) { Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 30.0f); ShrinkWindow_SetVal(0x20); Interface_ChangeAlpha(2); - player->actor.posRot.pos = playerPos; + player->actor.world.pos = playerPos; player->actor.speedXZ = 0.0f; this->unk_1E2 = 0; this->actionFunc = func_80B4B240; func_800F5C64(0x51); } else { if (1) {} // necessary to match - rotDiff = ABS(this->actor.yawTowardsLink - this->actor.shape.rot.y); - if ((rotDiff < 0x238E) && !(player->actor.posRot.pos.y < this->actor.posRot.pos.y)) { + rotDiff = ABS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y); + if ((rotDiff < 0x238E) && !(player->actor.world.pos.y < this->actor.world.pos.y)) { func_8002F2F4(&this->actor, globalCtx); } } @@ -241,7 +241,7 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) { globalCtx->envCtx.unk_E1 = 0; Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp74, &sp68); Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 25.0f); - player->actor.posRot.pos = sp58; + player->actor.world.pos = sp58; this->actor.textId = 0x702F; func_8010B720(globalCtx, this->actor.textId); this->unk_1E2++; @@ -336,7 +336,7 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) { frameCount = Animation_GetLastFrame(animHeaderSeg); Animation_Change(&this->skelAnime, animHeaderSeg, 1.0f, 0.0f, frameCount, sp54[sp3C], -10.0f); } - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); } void func_80B4B7F4(CsCmdActorAction* npcAction, Vec3f* pos) { @@ -389,8 +389,8 @@ void func_80B4B8B4(EnZl1* this, GlobalContext* globalCtx) { func_80B4B834(npcAction, &sp68); if (this->unk_1E6 == 0) { sp48 = sp74; - this->actor.initPosRot.pos = sp48; - this->actor.posRot.pos = sp48; + this->actor.home.pos = sp48; + this->actor.world.pos = sp48; } if (this->unk_1E6 != npcAction->action) { frameCount = Animation_GetLastFrame(spB0[npcAction->action]); @@ -409,7 +409,7 @@ void func_80B4B8B4(EnZl1* this, GlobalContext* globalCtx) { } this->actor.velocity.z = (sp68.z - sp74.z) / actionLength; } - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp98, &sp8C); Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 70.0f); } @@ -456,7 +456,7 @@ void func_80B4BC78(EnZl1* this, GlobalContext* globalCtx) { func_80B4B7F4(npcAction, &sp70); func_80B4B834(npcAction, &sp64); if (this->unk_1E6 == 0) { - this->actor.posRot.pos = this->actor.initPosRot.pos = sp70; + this->actor.world.pos = this->actor.home.pos = sp70; } if (this->unk_1E6 != npcAction->action) { @@ -529,7 +529,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) { } break; case 4: - if (player->actor.posRot.pos.y < this->actor.posRot.pos.y) { + if (player->actor.world.pos.y < this->actor.world.pos.y) { break; } else { if (func_8002F194(&this->actor, globalCtx)) { @@ -553,7 +553,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) { } break; } - func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos); + func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos); } void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -563,15 +563,15 @@ void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->actionFunc != func_80B4B8B4) && (this->actionFunc != func_80B4BC78)) { SkelAnime_Update(&this->skelAnime); } - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 5); this->actionFunc(this, globalCtx); if (this->actionFunc != func_80B4B8B4) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x, 0xA, 0x3E8, 1); - Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 0xA, 0x3E8, 1); - Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.posRot.rot.z, 0xA, 0x3E8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 0xA, 0x3E8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0xA, 0x3E8, 1); + Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 0xA, 0x3E8, 1); func_80B4AE18(this); } @@ -601,7 +601,7 @@ void func_80B4C400(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* EnZl1* this = THIS; if (limbIndex == 17) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } 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 3d65933671..681c44073d 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -91,7 +91,7 @@ static EnZl2DrawFunc sDrawFuncs[] = { const ActorInit En_Zl2_InitVars = { ACTOR_EN_ZL2, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL2, sizeof(EnZl2), @@ -236,7 +236,7 @@ void func_80B4ED18(EnZl2* this, s16 arg1) { } void func_80B4ED2C(EnZl2* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } s32 EnZl2_FrameUpdateMatrix(EnZl2* this) { @@ -254,10 +254,10 @@ void func_80B4EDB8(EnZl2* this, GlobalContext* globalCtx, s32 arg2) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, arg2); if (npcAction != NULL) { - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; } } @@ -661,9 +661,9 @@ void EnZl2_GiveLightArrows(EnZl2* this, GlobalContext* globalCtx) { if (this->unk_244 == 0) { player = PLAYER; - posX = player->actor.posRot.pos.x; - posY = player->actor.posRot.pos.y + 80.0f; - posZ = player->actor.posRot.pos.z; + posX = player->actor.world.pos.x; + posY = player->actor.world.pos.y + 80.0f; + posZ = player->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0, 0x17); Item_Give(globalCtx, ITEM_ARROW_LIGHT); this->unk_244 = 1; @@ -676,9 +676,9 @@ void func_80B4FF84(EnZl2* this, GlobalContext* globalCtx) { f32 posZ; if (this->unk_250 == 0) { - posX = this->actor.posRot.pos.x; - posY = this->actor.posRot.pos.y; - posZ = this->actor.posRot.pos.z; + posX = this->actor.world.pos.x; + posY = this->actor.world.pos.y; + posZ = this->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 4); this->unk_250 = 1; @@ -691,9 +691,9 @@ void func_80B4FFF0(EnZl2* this, GlobalContext* globalCtx) { f32 posZ; if (this->unk_248 == 0) { - posX = this->actor.posRot.pos.x; - posY = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - posZ = this->actor.posRot.pos.z; + posX = this->actor.world.pos.x; + posY = this->actor.world.pos.y + (kREG(5) + -26.0f); + posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0x4000, 0, 3); @@ -705,15 +705,15 @@ void func_80B5008C(EnZl2* this) { Actor* child = this->actor.child; if (child != NULL) { - child->posRot.pos.x = this->actor.posRot.pos.x; - child->posRot.pos.y = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - child->posRot.pos.z = this->actor.posRot.pos.z; + child->world.pos.x = this->actor.world.pos.x; + child->world.pos.y = this->actor.world.pos.y + (kREG(5) + -26.0f); + child->world.pos.z = this->actor.world.pos.z; } } void func_80B500E0(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 startX; f32 startY; f32 startZ; @@ -746,7 +746,7 @@ void func_80B501E8(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); if (npcAction != NULL) { - this->actor.shape.unk_14 = this->alpha = + this->actor.shape.shadowAlpha = this->alpha = (1.0f - func_8006F93C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames)) * 255.0f; func_80B501C4(this, this->alpha); } @@ -755,24 +755,24 @@ void func_80B501E8(EnZl2* this, GlobalContext* globalCtx) { void func_80B50260(EnZl2* this, GlobalContext* globalCtx) { this->action = 1; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B50278(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); - this->actor.posRot.pos.x = npcAction->startPos.x; - this->actor.posRot.pos.y = npcAction->startPos.y; - this->actor.posRot.pos.z = npcAction->startPos.z; - this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y; - this->actor.shape.unk_14 = 0xFF; + this->actor.world.pos.x = npcAction->startPos.x; + this->actor.world.pos.y = npcAction->startPos.y; + this->actor.world.pos.z = npcAction->startPos.z; + this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y; + this->actor.shape.shadowAlpha = 0xFF; this->action = 2; this->drawConfig = 1; } void func_80B50304(EnZl2* this, GlobalContext* globalCtx) { s32 pad[2]; - ActorShape* actorShape = &this->actor.shape; + ActorShape* shape = &this->actor.shape; CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); f32 actionXDelta; f32 actionZDelta; @@ -783,8 +783,8 @@ void func_80B50304(EnZl2* this, GlobalContext* globalCtx) { this->action = 3; this->drawConfig = 1; this->unk_23C = 0.0f; - actorShape->unk_14 = 0xFF; - this->actor.posRot.rot.y = actorShape->rot.y = Math_FAtan2F(actionXDelta, actionZDelta) * 10430.3779296875f; + shape->shadowAlpha = 255; + this->actor.world.rot.y = shape->rot.y = Math_FAtan2F(actionXDelta, actionZDelta) * 10430.3779296875f; } void func_80B503DC(EnZl2* this, GlobalContext* globalCtx) { @@ -799,7 +799,7 @@ void func_80B5042C(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_060022D0, 2, -8.0f, 0); this->action = 5; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -817,7 +817,7 @@ void func_80B504D4(EnZl2* this, GlobalContext* globalCtx) { this->drawConfig = 1; this->unk_27C = 0.0f; func_80B4ED18(this, 1); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B5053C(EnZl2* this, s32 arg1) { @@ -831,7 +831,7 @@ void func_80B50580(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_06000A50, 2, -8.0f, 0); this->action = 9; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B505D4(EnZl2* this, s32 arg1) { @@ -855,7 +855,7 @@ void func_80B50670(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_0600B5FC, 0, -8.0f, 0); this->action = 13; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B506C4(EnZl2* this, GlobalContext* globalCtx) { @@ -864,7 +864,7 @@ void func_80B506C4(EnZl2* this, GlobalContext* globalCtx) { this->drawConfig = 1; func_80B4ECE8(this, 4); func_80B4ED18(this, 2); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; func_80B4FE90(this); } @@ -879,7 +879,7 @@ void func_80B50780(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_06001670, 2, -8.0f, 0); this->action = 16; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; func_80B4FFF0(this, globalCtx); func_80B4ECE8(this, 3); } @@ -895,7 +895,7 @@ void func_80B5082C(EnZl2* this, GlobalContext* globalCtx) { func_80B4FD00(this, &D_06002B14, 2, -8.0f, 0); this->action = 18; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B50880(EnZl2* this, s32 arg1) { @@ -911,7 +911,7 @@ void func_80B508C8(EnZl2* this, GlobalContext* globalCtx) { this->action = 20; this->drawConfig = 1; func_80B4ECE8(this, 6); - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B50928(EnZl2* this, s32 arg1) { @@ -1211,9 +1211,9 @@ void func_80B513A8(EnZl2* this, GlobalContext* globalCtx) { if (this->unk_250 == 0) { player = PLAYER; - posX = player->actor.posRot.pos.x; - posY = player->actor.posRot.pos.y; - posZ = player->actor.posRot.pos.z; + posX = player->actor.world.pos.x; + posY = player->actor.world.pos.y; + posZ = player->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 7); this->unk_250 = 1; } @@ -1272,7 +1272,7 @@ void func_80B5154C(EnZl2* this, GlobalContext* globalCtx) { void func_80B515C4(EnZl2* this) { this->action = 25; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B515D8(EnZl2* this, GlobalContext* globalCtx) { @@ -1280,7 +1280,7 @@ void func_80B515D8(EnZl2* this, GlobalContext* globalCtx) { func_80B4EDB8(this, globalCtx, 0); this->action = 26; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1294,7 +1294,7 @@ void func_80B51678(EnZl2* this) { func_80B4FD00(this, &D_06007D0C, 2, -8.0f, 0); this->action = 27; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1308,7 +1308,7 @@ void func_80B51704(EnZl2* this) { func_80B4FD00(this, &D_060090D8, 2, -8.0f, 0); this->action = 28; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1322,7 +1322,7 @@ void func_80B51790(EnZl2* this) { func_80B4FD00(this, &D_06005F40, 2, -8.0f, 0); this->action = 29; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; } void func_80B517E0(EnZl2* this, s32 arg1) { @@ -1336,7 +1336,7 @@ void func_80B51824(EnZl2* this) { func_80B4FD00(this, &D_060022D0, 2, -8.0f, 0); this->action = 30; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1351,7 +1351,7 @@ void func_80B518C0(EnZl2* this) { func_80B4FD00(this, SEGMENTED_TO_VIRTUAL(&D_06004900), 2, -8.0f, 0); this->action = 32; this->drawConfig = 1; - this->actor.shape.unk_14 = 0xFF; + this->actor.shape.shadowAlpha = 0xFF; this->unk_27C = 0.0f; } @@ -1459,7 +1459,7 @@ void func_80B51CA8(EnZl2* this, GlobalContext* globalCtx) { void func_80B51D0C(EnZl2* this, GlobalContext* globalCtx) { this->action = 33; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B51D24(EnZl2* this, GlobalContext* globalCtx) { @@ -1470,7 +1470,7 @@ void func_80B51D24(EnZl2* this, GlobalContext* globalCtx) { if ((Animation_OnFrame(skelAnime, 6.0f)) || (Animation_OnFrame(skelAnime, 0.0f))) { if (this->actor.bgCheckFlags & 1) { sfxId = SFX_FLAG; - sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); func_80078914(&this->actor.projectedPos, sfxId); } } @@ -1478,7 +1478,7 @@ void func_80B51D24(EnZl2* this, GlobalContext* globalCtx) { void func_80B51DA4(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 startX; f32 startY; f32 startZ; @@ -1507,7 +1507,7 @@ void func_80B51DA4(EnZl2* this, GlobalContext* globalCtx) { void func_80B51EA8(EnZl2* this) { this->action = 33; this->drawConfig = 0; - this->actor.shape.unk_14 = 0; + this->actor.shape.shadowAlpha = 0; } void func_80B51EBC(EnZl2* this, GlobalContext* globalCtx) { @@ -1515,11 +1515,11 @@ void func_80B51EBC(EnZl2* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnZl2_GetNpcAction(globalCtx, 0); s32 pad[2]; - this->actor.posRot.rot.y = shape->rot.y = npcAction->rot.y; + this->actor.world.rot.y = shape->rot.y = npcAction->rot.y; func_80B4FD00(this, &D_0600B224, 0, 0.0f, 0); this->action = 34; this->drawConfig = 1; - shape->unk_14 = 0xFF; + shape->shadowAlpha = 255; } void func_80B51F38(EnZl2* this, GlobalContext* globalCtx) { @@ -1627,11 +1627,11 @@ void EnZl2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnZl2_Init(Actor* thisx, GlobalContext* globalCtx) { EnZl2* this = THIS; - ActorShape* actorShape = &thisx->shape; + ActorShape* shape = &thisx->shape; s32 pad; - ActorShape_Init(actorShape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); - actorShape->unk_14 = 0; + ActorShape_Init(shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + shape->shadowAlpha = 0; SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D70, NULL, NULL, NULL, 0); switch (thisx->params) { 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 00e10bd645..23675a6904 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -129,7 +129,7 @@ void func_80B53468(void) { BossGanon2* func_80B53488(EnZl3* this, GlobalContext* globalCtx) { if (this->unk_3D4 == NULL) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_BOSS].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { if (actorIt->id == ACTOR_BOSS_GANON2) { @@ -165,7 +165,7 @@ void func_80B53568(EnZl3* this, s16 arg1) { } void func_80B5357C(EnZl3* this, GlobalContext* globalCtx) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; Vec3f sp20; sp20.x = thisPos->x + ((Rand_ZeroOne() - 0.5f) * 10.0f); @@ -179,7 +179,7 @@ void func_80B53614(EnZl3* this, GlobalContext* globalCtx) { } void func_80B5366C(EnZl3* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5); } void func_80B536B4(EnZl3* this) { @@ -200,29 +200,29 @@ void func_80B536C4(EnZl3* this) { void func_80B53764(EnZl3* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_3F8.unk_18 = player->actor.posRot.pos; + this->unk_3F8.unk_18 = player->actor.world.pos; this->unk_3F8.unk_14 = kREG(16) - 16.0f; func_80034A14(&this->actor, &this->unk_3F8, kREG(17) + 0xC, 2); } s32 func_80B537E8(EnZl3* this) { - s16 yawTowardsLink = this->actor.yawTowardsLink; - s16* rotY = &this->actor.posRot.rot.y; + s16 yawTowardsPlayer = this->actor.yawTowardsPlayer; + s16* rotY = &this->actor.world.rot.y; s16* unk_3D0 = &this->unk_3D0; s16 pad[3]; - Math_SmoothStepToS(unk_3D0, ABS((s16)(yawTowardsLink - *rotY)), 5, 6200, 100); - Math_SmoothStepToS(rotY, yawTowardsLink, 5, *unk_3D0, 100); + Math_SmoothStepToS(unk_3D0, ABS((s16)(yawTowardsPlayer - *rotY)), 5, 6200, 100); + Math_SmoothStepToS(rotY, yawTowardsPlayer, 5, *unk_3D0, 100); this->actor.shape.rot.y = *rotY; // no return statement despite being of type s32 // the function directly below needs this to not be void I guess } void func_80B538B0(EnZl3* this) { - s16 yawTowardsLink = this->actor.yawTowardsLink; - s16* rotY = &this->actor.posRot.rot.y; + s16 yawTowardsPlayer = this->actor.yawTowardsPlayer; + s16* rotY = &this->actor.world.rot.y; - if (ABS((s16)(yawTowardsLink - *rotY)) >= 0x1556) { + if (ABS((s16)(yawTowardsPlayer - *rotY)) >= 0x1556) { D_80B5A468 = 1; } @@ -751,12 +751,12 @@ void EnZl3_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve } else if (limbIndex == 14) { sp24 = D_80B5A478; Matrix_MultVec3f(&sp24, &sp18); - this->actor.posRot2.pos.x = sp18.x; - this->actor.posRot2.pos.y = sp18.y; - this->actor.posRot2.pos.z = sp18.z; - this->actor.posRot2.rot.x = this->actor.posRot.rot.x; - this->actor.posRot2.rot.y = this->actor.posRot.rot.y; - this->actor.posRot2.rot.z = this->actor.posRot.rot.z; + this->actor.focus.pos.x = sp18.x; + this->actor.focus.pos.y = sp18.y; + this->actor.focus.pos.z = sp18.z; + this->actor.focus.rot.x = this->actor.world.rot.x; + this->actor.focus.rot.y = this->actor.world.rot.y; + this->actor.focus.rot.z = this->actor.world.rot.z; } } @@ -804,9 +804,9 @@ void func_80B54E14(EnZl3* this, AnimationHeader* animation, u8 arg2, f32 transit } void func_80B54EA4(EnZl3* this, GlobalContext* globalCtx) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y; - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y; + f32 posZ = this->actor.world.pos.z; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_EG, posX, posY, posZ, 0, 0, 0, 0); } @@ -817,9 +817,9 @@ void func_80B54EF4(EnZl3* this) { void func_80B54F18(EnZl3* this, GlobalContext* globalCtx) { if (this->unk_2F8 == 0) { - f32 posX = this->actor.posRot.pos.x; - f32 posY = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - f32 posZ = this->actor.posRot.pos.z; + f32 posX = this->actor.world.pos.x; + f32 posY = this->actor.world.pos.y + (kREG(5) + -26.0f); + f32 posZ = this->actor.world.pos.z; Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0x4000, 0, 3); @@ -836,8 +836,8 @@ void func_80B54FB4(EnZl3* this, GlobalContext* globalCtx) { this->drawConfig = 1; func_80B54F18(this, globalCtx); this->actor.shape.rot.z = 0; - this->unk_3C4 = this->actor.posRot.rot.z; - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->unk_3C4 = this->actor.world.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; osSyncPrintf("ゼルダ姫のEn_Zl3_Actor_inFinal_Initは通った!!!!!!!!!!!!!!!!!!!!!!!!!\n"); } @@ -863,9 +863,9 @@ void func_80B550F0(EnZl3* this) { Actor* child = this->actor.child; if (child != NULL) { - child->posRot.pos.x = this->actor.posRot.pos.x; - child->posRot.pos.y = this->actor.posRot.pos.y + (kREG(5) + -26.0f); - child->posRot.pos.z = this->actor.posRot.pos.z; + child->world.pos.x = this->actor.world.pos.x; + child->world.pos.y = this->actor.world.pos.y + (kREG(5) + -26.0f); + child->world.pos.z = this->actor.world.pos.z; } } @@ -1067,9 +1067,9 @@ void func_80B5585C(EnZl3* this) { void func_80B558A8(EnZl3* this) { s32 pad[4]; - s16 thisRotY = this->actor.posRot.rot.y; + s16 thisRotY = this->actor.world.rot.y; Vec3f* unk_338 = &this->unk_338; - Vec3f thisPos = this->actor.posRot.pos; + Vec3f thisPos = this->actor.world.pos; this->unk_32C = thisPos; *unk_338 = thisPos; @@ -1080,7 +1080,7 @@ void func_80B558A8(EnZl3* this) { } void func_80B559C4(EnZl3* this) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; Vec3f* unk_32C = &this->unk_32C; Vec3f* unk_338 = &this->unk_338; f32 temp_f0 = func_8006F9BC(Animation_GetLastFrame(&D_06005248), 0, (s32)this->skelAnime.curFrame, 3, 3); @@ -1157,7 +1157,7 @@ void func_80B55CCC(EnZl3* this, s32 arg1) { void func_80B55D00(EnZl3* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->action = 13; - } else if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) { + } else if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) { this->actor.flags |= 9; this->actor.flags |= 1; this->actor.textId = 0x70D5; @@ -1213,7 +1213,7 @@ void func_80B55F38(EnZl3* this, s32 arg1) { void func_80B55F6C(EnZl3* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->action = 0x12; - } else if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) { + } else if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) { BossGanon2* bossGanon2 = func_80B53488(this, globalCtx); if ((bossGanon2 != NULL) && (bossGanon2->unk_324 <= 0.12345679104328156f)) { @@ -1274,7 +1274,7 @@ void func_80B561E0(EnZl3* this, s32 arg1) { void func_80B56214(EnZl3* this, GlobalContext* globalCtx) { if (func_8002F194(&this->actor, globalCtx)) { this->action = 21; - } else if (ABS((s16)(this->actor.yawTowardsLink - this->actor.shape.rot.y)) <= 0x4300) { + } else if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) <= 0x4300) { BossGanon2* bossGanon2 = func_80B53488(this, globalCtx); if (bossGanon2 != NULL) { @@ -1595,7 +1595,7 @@ void func_80B56E38(EnZl3* this, GlobalContext* globalCtx) { if ((Animation_OnFrame(sp20, 6.0f) || Animation_OnFrame(sp20, 0.0f)) && (this->actor.bgCheckFlags & 1)) { sfxId = 0x800; - sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource); + sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); func_80078914(&this->actor.projectedPos, sfxId); } } @@ -1660,8 +1660,8 @@ s16 func_80B57104(EnZl3* this, s32 arg1) { Vec3s* point = func_80B56FAC(this, arg1); if (point != NULL) { - f32 xDiff = point->x - this->actor.posRot.pos.x; - f32 zDiff = point->z - this->actor.posRot.pos.z; + f32 xDiff = point->x - this->actor.world.pos.x; + f32 zDiff = point->z - this->actor.world.pos.z; if ((xDiff != 0.0f) || (zDiff != 0.0f)) { return Math_FAtan2F(xDiff, zDiff) * (0x8000 / M_PI); @@ -1695,14 +1695,14 @@ s32 func_80B571FC(EnZl3* this) { void func_80B57240(EnZl3* this) { s32 temp_a1 = func_80B571FC(this); - s16* rotY = &this->actor.posRot.rot.y; + s16* rotY = &this->actor.world.rot.y; Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000); this->actor.shape.rot.y = *rotY; } void func_80B57298(EnZl3* this) { - s16* rotY = &this->actor.posRot.rot.y; + s16* rotY = &this->actor.world.rot.y; s16 temp_a1 = func_80B571A8(this); Math_SmoothStepToS(rotY, temp_a1, 2, 6400, 1000); @@ -1731,7 +1731,7 @@ s32 func_80B57324(EnZl3* this, GlobalContext* globalCtx) { } void func_80B57350(EnZl3* this, GlobalContext* globalCtx) { - s16 temp_v0 = this->actor.yawTowardsLink - this->actor.shape.rot.y; + s16 temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (ABS(temp_v0) <= 0x4300) { this->actor.flags |= 9; @@ -1749,10 +1749,10 @@ s32 func_80B573C8(EnZl3* this, GlobalContext* globalCtx) { s32 func_80B573FC(EnZl3* this, GlobalContext* globalCtx, f32 arg2) { Player* player = PLAYER; - f32 playerX = player->actor.posRot.pos.x; - f32 playerZ = player->actor.posRot.pos.z; - f32 thisX = this->actor.posRot.pos.x; - f32 thisZ = this->actor.posRot.pos.z; + f32 playerX = player->actor.world.pos.x; + f32 playerZ = player->actor.world.pos.z; + f32 thisX = this->actor.world.pos.x; + f32 thisZ = this->actor.world.pos.z; if (SQ(playerX - thisX) + SQ(playerZ - thisZ) < SQ(arg2)) { return 1; @@ -1761,11 +1761,11 @@ s32 func_80B573FC(EnZl3* this, GlobalContext* globalCtx, f32 arg2) { } s32 func_80B57458(EnZl3* this, GlobalContext* globalCtx) { - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 thisX = thisPos->x; f32 thisZ = thisPos->z; Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; s32 pad; f32 playerX = playerPos->x; f32 playerZ = playerPos->z; @@ -1850,8 +1850,8 @@ void func_80B5772C(EnZl3* this, GlobalContext* globalCtx) { void func_80B57754(EnZl3* this, GlobalContext* globalCtx) { if (gSaveContext.unk_13F0 == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OCEFF_WIPE4, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OCEFF_WIPE4, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1); func_80B56DA4(this); } } @@ -1859,7 +1859,7 @@ void func_80B57754(EnZl3* this, GlobalContext* globalCtx) { void func_80B577BC(GlobalContext* globalCtx, Vec3f* vec) { s32 pad; Player* player = PLAYER; - Vec3f* playerPos = &player->actor.posRot.pos; + Vec3f* playerPos = &player->actor.world.pos; f32 posX = vec->x; f32 posY = vec->y; f32 posZ = vec->z; @@ -1925,7 +1925,7 @@ s32 func_80B57890(EnZl3* this, GlobalContext* globalCtx) { } void func_80B57A74(GlobalContext* globalCtx) { - Actor* actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first; + Actor* actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (actorIt != NULL) { if (actorIt->id == ACTOR_EN_ENCOUNT2) { @@ -1956,7 +1956,7 @@ void func_80B57AE0(EnZl3* this, GlobalContext* globalCtx) { this->unk_360 = 0.0f; this->unk_364 = 0.0f; this->unk_368 = 0.0f; - *unk_348 = this->actor.posRot.pos; + *unk_348 = this->actor.world.pos; temp_v0 = func_80B56FAC(this, this->unk_314); if (temp_v0 != NULL) { @@ -1992,7 +1992,7 @@ s32 func_80B57C8C(EnZl3* this) { void func_80B57CB4(EnZl3* this, GlobalContext* globalCtx) { Vec3f* unk_348 = &this->unk_348; Vec3f* unk_354 = &this->unk_354; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; f32 temp_f0; this->unk_344 += 1; @@ -2016,19 +2016,19 @@ s32 func_80B57D80(EnZl3* this, GlobalContext* globalCtx) { s32 pad2; s16 phi_v1; - unk_3F8->unk_18.y = player->actor.posRot.pos.y; - unk_3F8->unk_18.x = (Math_SinS(temp_v0) * this->actor.xzDistToLink) + this->actor.posRot.pos.x; - unk_3F8->unk_18.z = (Math_CosS(temp_v0) * this->actor.xzDistToLink) + this->actor.posRot.pos.z; + unk_3F8->unk_18.y = player->actor.world.pos.y; + unk_3F8->unk_18.x = (Math_SinS(temp_v0) * this->actor.xzDistToPlayer) + this->actor.world.pos.x; + unk_3F8->unk_18.z = (Math_CosS(temp_v0) * this->actor.xzDistToPlayer) + this->actor.world.pos.z; unk_3F8->unk_14 = kREG(16) - 16.0f; func_80034A14(&this->actor, unk_3F8, kREG(17) + 0xC, 4); phi_v1 = ABS(temp_v0 - *sp32); if (phi_v1 <= 0x320) { *sp32 = temp_v0; - this->actor.posRot.rot.y = *sp32; + this->actor.world.rot.y = *sp32; phi_v1 = 0; } - this->actor.posRot.rot.y = *sp32; + this->actor.world.rot.y = *sp32; return phi_v1; } @@ -2150,7 +2150,7 @@ void func_80B584B4(EnZl3* this, GlobalContext* globalCtx) { s32 pad; Player* player = PLAYER; s8 invincibilityTimer = player->invincibilityTimer; - Actor* nearbyEnTest = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_TEST, ACTORTYPE_ENEMY, 8000.0f); + Actor* nearbyEnTest = Actor_FindNearby(globalCtx, &this->actor, ACTOR_EN_TEST, ACTORCAT_ENEMY, 8000.0f); if (D_80B5A4BC == 0) { if ((nearbyEnTest == NULL) && (!Gameplay_InCsMode(globalCtx))) { @@ -2288,7 +2288,7 @@ void func_80B58C08(EnZl3* this, GlobalContext* globalCtx) { s32 pad[2]; Vec3f* unk_348 = &this->unk_348; Vec3f* unk_354 = &this->unk_354; - Vec3f* thisPos = &this->actor.posRot.pos; + Vec3f* thisPos = &this->actor.world.pos; s32 unk_344; s32 unk_346; s32 sp28; @@ -2335,7 +2335,7 @@ void func_80B58DB0(EnZl3* this, GlobalContext* globalCtx) { void func_80B58E10(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2437,7 +2437,7 @@ void func_80B5922C(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); func_80B536C4(this); func_80B57298(this); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2449,7 +2449,7 @@ void func_80B592A8(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); func_80B536C4(this); func_80B57298(this); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2462,7 +2462,7 @@ void func_80B59340(EnZl3* this, GlobalContext* globalCtx) { func_80B54DE0(this, globalCtx); func_80B536C4(this); func_80B57298(this); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B533FC(this, globalCtx); func_80B5366C(this, globalCtx); func_80B534CC(this); @@ -2476,7 +2476,7 @@ void func_80B593D0(EnZl3* this, GlobalContext* globalCtx) { func_80B57298(this); func_80B5366C(this, globalCtx); func_80B56E38(this, globalCtx); - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); func_80B534CC(this); EnZl3_FrameUpdateMatrix(this); func_80B58C08(this, globalCtx); @@ -2560,10 +2560,10 @@ void func_80B59828(EnZl3* this, GlobalContext* globalCtx) { func_80B56F10(this, globalCtx); newRotY = func_80B571A8(this); this->actor.shape.rot.y = newRotY; - this->actor.posRot.rot.y = newRotY; - this->unk_3C4 = this->actor.posRot.rot.z; + this->actor.world.rot.y = newRotY; + this->unk_3C4 = this->actor.world.rot.z; this->actor.shape.rot.z = 0; - this->actor.posRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.z = this->actor.shape.rot.z; this->action = 28; this->drawConfig = 1; } else { @@ -2696,8 +2696,8 @@ void EnZl3_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; osSyncPrintf("ゼルダ姫のEn_Zl3_Actor_ct通すよ!!!!!!!!!!!!!!!!!!!!!!!!!\n"); - ActorShape_Init(shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f); - shape->unk_14 = 0; + ActorShape_Init(shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + shape->shadowAlpha = 0; func_80B533B0(thisx, globalCtx); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D70, NULL, this->jointTable, this->morphTable, 15); @@ -2801,7 +2801,7 @@ void EnZl3_Draw(Actor* thisx, GlobalContext* globalCtx) { const ActorInit En_Zl3_InitVars = { ACTOR_EN_ZL3, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL2, sizeof(EnZl3), 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 a06dff8c6d..b2c7adfa7e 100644 --- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -39,7 +39,7 @@ extern UNK_TYPE D_0601CE08; /* const ActorInit En_Zl4_InitVars = { ACTOR_EN_ZL4, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZL4, sizeof(EnZl4), 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 c16e726c5d..c425bc1561 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -73,7 +73,7 @@ void EnZo_Bubble(EnZo* this, Vec3f* pos) { for (i = 0; i < ARRAY_COUNT(this->effects); i++) { if (1) {} if (effect->type == ENZO_EFFECT_NONE) { - waterSurface = this->actor.posRot.pos.y + this->actor.yDistToWater; + waterSurface = this->actor.world.pos.y + this->actor.yDistToWater; if (!(waterSurface <= pos->y)) { effect->type = ENZO_EFFECT_BUBBLE; effect->pos = *pos; @@ -142,7 +142,7 @@ void EnZo_UpdateBubbles(EnZo* this) { effect->pos.y += effect->vel.y; // Bubbles turn into ripples when they reach the surface - waterSurface = this->actor.posRot.pos.y + this->actor.yDistToWater; + waterSurface = this->actor.world.pos.y + this->actor.yDistToWater; if (waterSurface <= effect->pos.y) { effect->type = ENZO_EFFECT_NONE; effect->pos.y = waterSurface; @@ -173,7 +173,7 @@ void EnZo_UpdateSplashes(EnZo* this) { } // Splash particles turn into ripples when they hit the surface - waterSurface = this->actor.posRot.pos.y + this->actor.yDistToWater; + waterSurface = this->actor.world.pos.y + this->actor.yDistToWater; if (effect->pos.y < waterSurface) { effect->type = ENZO_EFFECT_NONE; effect->pos.y = waterSurface; @@ -285,9 +285,9 @@ void EnZo_DrawSplashes(EnZo* this, GlobalContext* globalCtx) { void EnZo_TreadWaterRipples(EnZo* this, f32 scale, f32 targetScale, u8 alpha) { Vec3f pos = { 0.0f, 0.0f, 0.0f }; - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + this->actor.yDistToWater; + pos.z = this->actor.world.pos.z; EnZo_Ripple(this, &pos, scale, targetScale, alpha); } @@ -315,7 +315,7 @@ static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_Zo_InitVars = { ACTOR_EN_ZO, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_ZO, sizeof(EnZo), @@ -347,7 +347,7 @@ void EnZo_SpawnSplashes(EnZo* this) { vel.x = sinf(angle) * speed; vel.z = cosf(angle) * speed; - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.x += vel.x * 6.0f; pos.z += vel.z * 6.0f; pos.y += this->actor.yDistToWater; @@ -505,12 +505,12 @@ void EnZo_Blink(EnZo* this) { void EnZo_Dialog(EnZo* this, GlobalContext* globalCtx) { Player* player = PLAYER; - this->unk_194.unk_18 = player->actor.posRot.pos; + this->unk_194.unk_18 = player->actor.world.pos; if (this->actionFunc == EnZo_Standing) { // Look down at link if young, look up if old this->unk_194.unk_14 = LINK_IS_CHILD ? 10.0f : -10.0f; } else { - this->unk_194.unk_18.y = this->actor.posRot.pos.y; + this->unk_194.unk_18.y = this->actor.world.pos.y; } func_80034A14(&this->actor, &this->unk_194, 11, this->unk_64C); if (this->canSpeak == true) { @@ -524,12 +524,12 @@ s32 EnZo_PlayerInProximity(EnZo* this, GlobalContext* globalCtx) { f32 yDist; f32 hDist; - surfacePos.x = this->actor.posRot.pos.x; - surfacePos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - surfacePos.z = this->actor.posRot.pos.z; + surfacePos.x = this->actor.world.pos.x; + surfacePos.y = this->actor.world.pos.y + this->actor.yDistToWater; + surfacePos.z = this->actor.world.pos.z; - hDist = Math_Vec3f_DistXZ(&surfacePos, &player->actor.posRot.pos); - yDist = fabsf(player->actor.posRot.pos.y - surfacePos.y); + hDist = Math_Vec3f_DistXZ(&surfacePos, &player->actor.world.pos); + yDist = fabsf(player->actor.world.pos.y - surfacePos.y); if (hDist < 240.0f && yDist < 80.0f) { return 1; @@ -583,16 +583,17 @@ void EnZo_Init(Actor* thisx, GlobalContext* globalCtx) { func_80034EC0(&this->skelAnime, sAnimations, 2); Actor_SetScale(&this->actor, 0.01f); - this->actor.unk_1F = 6; + this->actor.targetMode = 6; this->dialogRadius = this->collider.dim.radius + 30.0f; this->unk_64C = 1; this->canSpeak = false; this->unk_194.unk_00 = 0; - func_8002E4B4(globalCtx, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, + 5); if (this->actor.yDistToWater < 54.0f || (this->actor.params & 0x3F) == 8) { - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Circle; - this->actor.shape.unk_10 = 24.0f; + this->actor.shape.shadowDraw = ActorShadow_DrawCircle; + this->actor.shape.shadowScale = 24.0f; func_80034EC0(&this->skelAnime, sAnimations, 1); this->canSpeak = true; this->alpha = 255.0f; @@ -616,7 +617,7 @@ void EnZo_Standing(EnZo* this, GlobalContext* globalCtx) { return; } - angle = ABS((s16)((f32)this->actor.yawTowardsLink - (f32)this->actor.shape.rot.y)); + angle = ABS((s16)((f32)this->actor.yawTowardsPlayer - (f32)this->actor.shape.rot.y)); if (angle < 0x4718) { if (EnZo_PlayerInProximity(this, globalCtx)) { this->unk_64C = 2; @@ -706,7 +707,7 @@ void EnZo_Dive(EnZo* this, GlobalContext* globalCtx) { if ((s16)this->alpha == 0) { func_80034EC0(&this->skelAnime, sAnimations, 2); - this->actor.posRot.pos = this->actor.initPosRot.pos; + this->actor.world.pos = this->actor.home.pos; this->alpha = 0.0f; this->actionFunc = EnZo_Submerged; } @@ -723,13 +724,13 @@ void EnZo_Update(Actor* thisx, GlobalContext* globalCtx) { } Actor_MoveForward(thisx); - func_8002E4B4(globalCtx, thisx, this->collider.dim.radius, this->collider.dim.height * 0.25f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, thisx, this->collider.dim.radius, this->collider.dim.height * 0.25f, 0.0f, 5); this->actionFunc(this, globalCtx); EnZo_Dialog(this, globalCtx); // Spawn air bubbles if (globalCtx->state.frames & 8) { - pos = this->actor.posRot.pos; + pos = this->actor.world.pos; pos.y += (Rand_ZeroOne() - 0.5f) * 10.0f + 18.0f; pos.x += (Rand_ZeroOne() - 0.5f) * 28.0f; @@ -779,7 +780,7 @@ void EnZo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec Vec3f vec = { 0.0f, 600.0f, 0.0f }; if (limbIndex == 15) { - Matrix_MultVec3f(&vec, &this->actor.posRot2.pos); + Matrix_MultVec3f(&vec, &this->actor.focus.pos); } } 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 5ade725b77..207a55e926 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -18,7 +18,7 @@ void EnfHG_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit En_fHG_InitVars = { ACTOR_EN_FHG, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_FHG, sizeof(EnfHG), 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 da6b35f9c4..e77f9aac96 100644 --- a/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -18,7 +18,7 @@ void func_80B65DA8(Actor* thisx, GlobalContext* globalCtx); const ActorInit End_Title_InitVars = { ACTOR_END_TITLE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(EndTitle), diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 7b9b971225..55def2cee2 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -61,7 +61,7 @@ extern UNK_TYPE D_06015470; /* const ActorInit Fishing_InitVars = { ACTOR_FISHING, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_FISH, sizeof(Fishing), 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 60557a6788..194163b52f 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 @@ -22,7 +22,7 @@ extern Gfx D_06001470[]; const ActorInit Item_B_Heart_InitVars = { ACTOR_ITEM_B_HEART, - ACTORTYPE_MISC, + ACTORCAT_MISC, FLAGS, OBJECT_GI_HEARTS, sizeof(ItemBHeart), @@ -57,7 +57,7 @@ void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) { ItemBHeart* this = THIS; func_80B85264(this, globalCtx); - func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (Actor_HasParent(&this->actor, globalCtx)) { Flags_SetCollectible(globalCtx, 0x1F); Actor_Kill(&this->actor); @@ -71,7 +71,7 @@ void func_80B85264(ItemBHeart* this, GlobalContext* globalCtx) { this->unk_164 += 1; temp = ((Math_SinS(this->unk_164 * 1548) * 5.0f) + 20.0f); - Math_ApproachF(&this->actor.posRot.pos.y, this->actor.initPosRot.pos.y + temp, 0.1f, this->unk_158); + Math_ApproachF(&this->actor.world.pos.y, this->actor.home.pos.y + temp, 0.1f, this->unk_158); Math_ApproachF(&this->unk_158, 2.0f, 1.0f, 0.1f); this->actor.shape.rot.y += 0x400; @@ -86,7 +86,7 @@ void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_item_b_heart.c", 506); - actorIt = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first; + actorIt = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (actorIt != NULL) { if ((actorIt->id == ACTOR_DOOR_WARP1) && (actorIt->projectedPos.z > this->actor.projectedPos.z)) { 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 8d66e9596f..7fd405e56b 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -26,7 +26,7 @@ void ItemEtcetera_UpdateFireArrow(ItemEtcetera* this, GlobalContext* globalCtx); const ActorInit Item_Etcetera_InitVars = { ACTOR_ITEM_ETCETERA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ItemEtcetera), @@ -89,7 +89,7 @@ void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx) { this->futureActionFunc = ItemEtcetera_UpdateFireArrow; Actor_SetScale(&this->actor, 0.5f); this->actor.draw = NULL; - this->actor.shape.unk_08 = 50.0f; + this->actor.shape.yOffset = 50.0f; break; case ITEM_ETC_RUPEE_GREEN_CHEST_GAME: case ITEM_ETC_RUPEE_BLUE_CHEST_GAME: @@ -100,7 +100,7 @@ void ItemEtcetera_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.5f); this->futureActionFunc = func_80B85B28; this->drawFunc = ItemEtcetera_DrawThroughLens; - this->actor.posRot.pos.y += 15.0f; + this->actor.world.pos.y += 15.0f; break; } } @@ -139,7 +139,7 @@ void func_80B858B4(ItemEtcetera* this, GlobalContext* globalCtx) { if (0) {} // Necessary to match func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f); if ((globalCtx->gameplayFrames & 0xD) == 0) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 0.0f, 0.0f, 10.0f, 0.13f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f); } } } @@ -155,14 +155,14 @@ void ItemEtcetera_SpawnSparkles(ItemEtcetera* this, GlobalContext* globalCtx) { velocity.z = Rand_CenteredFloat(3.0f); velocity.y = -0.05f; accel.y = -0.025f; - pos.x = Rand_CenteredFloat(12.0f) + this->actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() * 6.0f) + this->actor.posRot.pos.y; - pos.z = Rand_CenteredFloat(12.0f) + this->actor.posRot.pos.z; + pos.x = Rand_CenteredFloat(12.0f) + this->actor.world.pos.x; + pos.y = (Rand_ZeroOne() * 6.0f) + this->actor.world.pos.y; + pos.z = Rand_CenteredFloat(12.0f) + this->actor.world.pos.z; EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, 5000, 16); } void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, GlobalContext* globalCtx) { - func_8002E4B4(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 0.0f, 5); Actor_MoveForward(&this->actor); if (!(this->actor.bgCheckFlags & 1)) { ItemEtcetera_SpawnSparkles(this, globalCtx); 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 6c981bb662..47fdd74df2 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -19,7 +19,7 @@ void ItemInbox_Wait(ItemInbox* this, GlobalContext* globalCtx); const ActorInit Item_Inbox_InitVars = { ACTOR_ITEM_INBOX, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ItemInbox), 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 b884593995..19780cff9d 100644 --- a/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -25,7 +25,7 @@ void ItemOcarina_DoNothing(ItemOcarina* this, GlobalContext* globalCtx); const ActorInit Item_Ocarina_InitVars = { ACTOR_ITEM_OCARINA, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GI_OCARINA, sizeof(ItemOcarina), @@ -94,17 +94,17 @@ void ItemOcarina_Fly(ItemOcarina* this, GlobalContext* globalCtx) { } if (globalCtx->csCtx.frames == 881) { - this->actor.posRot.pos.x = 250.0f; - this->actor.posRot.pos.y = 60.0f; - this->actor.posRot.pos.z = 1075.0f; + this->actor.world.pos.x = 250.0f; + this->actor.world.pos.y = 60.0f; + this->actor.world.pos.z = 1075.0f; this->actor.velocity.x = 1.0f; this->actor.velocity.y = -5.0f; this->actor.velocity.z = -7.0f; } if (globalCtx->csCtx.frames == 897) { - EffectSsGRipple_Spawn(globalCtx, &this->actor.posRot.pos, 100, 500, 0); - EffectSsGSplash_Spawn(globalCtx, &this->actor.posRot.pos, 0, 0, 1, 0); + EffectSsGRipple_Spawn(globalCtx, &this->actor.world.pos, 100, 500, 0); + EffectSsGSplash_Spawn(globalCtx, &this->actor.world.pos, 0, 0, 1, 0); this->actor.velocity.x = 0.0f; this->actor.velocity.y = 0.0f; this->actor.velocity.z = 0.0f; @@ -146,9 +146,9 @@ void func_80B864EC(ItemOcarina* this, GlobalContext* globalCtx) { } if (globalCtx->csCtx.frames == 220) { - this->actor.posRot.pos.x = 144.0f; - this->actor.posRot.pos.y = 80.0f; - this->actor.posRot.pos.z = 1686.0f; + this->actor.world.pos.x = 144.0f; + this->actor.world.pos.y = 80.0f; + this->actor.world.pos.z = 1686.0f; this->actor.velocity.x = 1.0f; this->actor.velocity.y = 2.0f; this->actor.velocity.z = -7.0f; @@ -186,7 +186,7 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, GlobalContext* globalCtx) { func_8002F434(&this->actor, globalCtx, GI_OCARINA_OOT, 30.0f, 50.0f); if ((globalCtx->gameplayFrames & 13) == 0) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 0.0f, 0.0f, 10.0f, 0.13f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f); } } } 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 40b94ab725..169a33d212 100644 --- a/src/overlays/actors/ovl_Item_Shield/z_item_shield.c +++ b/src/overlays/actors/ovl_Item_Shield/z_item_shield.c @@ -20,7 +20,7 @@ extern UNK_TYPE D_060224F8; /* const ActorInit Item_Shield_InitVars = { ACTOR_ITEM_SHIELD, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_LINK_CHILD, sizeof(ItemShield), 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 09adad2501..ad6a2c6010 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -22,7 +22,7 @@ void MagicDark_DimLighting(GlobalContext* globalCtx, f32 intensity); const ActorInit Magic_Dark_InitVars = { ACTOR_MAGIC_DARK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(MagicDark), @@ -47,7 +47,7 @@ void MagicDark_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale = 0.6f; } - thisx->posRot.pos = player->actor.posRot.pos; + thisx->world.pos = player->actor.world.pos; Actor_SetScale(&this->actor, 0.0f); thisx->room = -1; @@ -123,8 +123,8 @@ void MagicDark_DiamondUpdate(Actor* thisx, GlobalContext* globalCtx) { this->primAlpha = phi_a0; } - thisx->posRot.rot.y += 0x3E8; - thisx->shape.rot.y = thisx->posRot.rot.y + Camera_GetCamDirYaw(ACTIVE_CAM); + thisx->world.rot.y += 0x3E8; + thisx->shape.rot.y = thisx->world.rot.y + Camera_GetCamDirYaw(ACTIVE_CAM); this->timer++; gSaveContext.nayrusLoveTimer = nayrusLoveTimer + 1; @@ -206,15 +206,15 @@ void MagicDark_DiamondDraw(Actor* thisx, GlobalContext* globalCtx) { Player* player = PLAYER; f32 heightDiff; - this->actor.posRot.pos.x = player->bodyPartsPos[0].x; - this->actor.posRot.pos.z = player->bodyPartsPos[0].z; - heightDiff = player->bodyPartsPos[0].y - this->actor.posRot.pos.y; + this->actor.world.pos.x = player->bodyPartsPos[0].x; + this->actor.world.pos.z = player->bodyPartsPos[0].z; + heightDiff = player->bodyPartsPos[0].y - this->actor.world.pos.y; if (heightDiff < -2.0f) { - this->actor.posRot.pos.y = player->bodyPartsPos[0].y + 2.0f; + this->actor.world.pos.y = player->bodyPartsPos[0].y + 2.0f; } else if (heightDiff > 2.0f) { - this->actor.posRot.pos.y = player->bodyPartsPos[0].y - 2.0f; + this->actor.world.pos.y = player->bodyPartsPos[0].y - 2.0f; } - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_RotateY(this->actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_magic_dark.c", 553), 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 69378f85e6..4692637751 100644 --- a/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -18,7 +18,7 @@ void MagicFire_Draw(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Magic_Fire_InitVars = { ACTOR_MAGIC_FIRE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(MagicFire), 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 661dac4b59..1c93d3087a 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -23,7 +23,7 @@ void MagicWind_Grow(MagicWind* this, GlobalContext* globalCtx); const ActorInit Magic_Wind_InitVars = { ACTOR_MAGIC_WIND, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(MagicWind), 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 5b4b82d7ca..a3dcd25a31 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -33,7 +33,7 @@ typedef enum { const ActorInit Mir_Ray_InitVars = { ACTOR_MIR_RAY, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_MIR_RAY, sizeof(MirRay), @@ -136,12 +136,12 @@ void MirRay_MakeShieldLight(MirRay* this, GlobalContext* globalCtx) { Vec3f reflectionPt; Vec3s lightPt; - if (MirRay_CheckInFrustum(&this->sourcePt, &this->poolPt, player->actor.posRot.pos.x, - player->actor.posRot.pos.y + 30.0f, player->actor.posRot.pos.z, this->sourceEndRad, + if (MirRay_CheckInFrustum(&this->sourcePt, &this->poolPt, player->actor.world.pos.x, + player->actor.world.pos.y + 30.0f, player->actor.world.pos.z, this->sourceEndRad, this->poolEndRad)) { if (dataEntry->params & 8) { // Light beams from mirrors - Math_Vec3f_Diff(&player->actor.posRot.pos, &this->sourcePt, &reflectionPt); + Math_Vec3f_Diff(&player->actor.world.pos, &this->sourcePt, &reflectionPt); } else { // Light beams from windows Math_Vec3f_Diff(&this->poolPt, &this->sourcePt, &reflectionPt); } 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 2f0fee0c81..c644aaad9a 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -24,7 +24,7 @@ extern UNK_TYPE D_06000650; /* const ActorInit Obj_Bean_InitVars = { ACTOR_OBJ_BEAN, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_MAMENOKI, sizeof(ObjBean), 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 4a2fa9d1dc..fdbe56ef8e 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -17,7 +17,7 @@ void ObjBlockstop_Update(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Blockstop_InitVars = { ACTOR_OBJ_BLOCKSTOP, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjBlockstop), @@ -33,7 +33,7 @@ void ObjBlockstop_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, this->actor.params)) { Actor_Kill(&this->actor); } else { - this->actor.posRot.pos.y += 1; + this->actor.world.pos.y += 1; } } @@ -47,7 +47,7 @@ void ObjBlockstop_Update(Actor* thisx, GlobalContext* globalCtx) { s32 bgId; s32 pad; - if (BgCheck_EntityLineTest2(&globalCtx->colCtx, &this->actor.initPosRot.pos, &this->actor.posRot.pos, &sp4C, + if (BgCheck_EntityLineTest2(&globalCtx->colCtx, &this->actor.home.pos, &this->actor.world.pos, &sp4C, &this->actor.floorPoly, 0, 0, 1, 1, &bgId, &this->actor)) { dynaActor = DynaPoly_GetActor(&globalCtx->colCtx, bgId); 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 ec3ea8626d..5b52c1eb13 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -21,7 +21,7 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx); const ActorInit Obj_Bombiwa_InitVars = { ACTOR_OBJ_BOMBIWA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_BOMBIWA, sizeof(ObjBombiwa), @@ -83,11 +83,11 @@ void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); if (thisx->shape.rot.y == 0) { s16 rand = (s16)Rand_ZeroFloat(65536.0f); - thisx->posRot.rot.y = rand; + thisx->world.rot.y = rand; thisx->shape.rot.y = rand; } - thisx->shape.unk_08 = -200.0f; - thisx->posRot.pos.y = thisx->initPosRot.pos.y + 20.0f; + thisx->shape.yOffset = -200.0f; + thisx->world.pos.y = thisx->home.pos.y + 20.0f; } } @@ -108,9 +108,9 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { dlist = D_060009E0; for (i = 0; i < ARRAY_COUNT(sEffectScales); i++) { - pos.x = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.x; - pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.initPosRot.pos.y) + 8.0f; - pos.z = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.initPosRot.pos.z; + pos.x = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.x; + pos.y = ((Rand_ZeroOne() * 5.0f) + this->actor.home.pos.y) + 8.0f; + pos.z = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.z; velocity.x = (Rand_ZeroOne() - 0.5f) * 15.0f; velocity.y = (Rand_ZeroOne() * 16.0f) + 5.0f; velocity.z = (Rand_ZeroOne() - 0.5f) * 15.0f; @@ -119,7 +119,7 @@ void ObjBombiwa_Break(ObjBombiwa* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, -400, arg5, 10, 2, 0, scale, 1, 0, 80, KAKERA_COLOR_NONE, OBJECT_BOMBIWA, dlist); } - func_80033480(globalCtx, &this->actor.posRot.pos, 60.0f, 8, 100, 160, 1); + func_80033480(globalCtx, &this->actor.world.pos, 60.0f, 8, 100, 160, 1); } void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { @@ -130,14 +130,14 @@ void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) { ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & 0x40000040))) { ObjBombiwa_Break(this, globalCtx); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 80, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); if (((this->actor.params >> 0xF) & 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); } else { this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.xzDistToLink < 800.0f) { + if (this->actor.xzDistToPlayer < 800.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } 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 72a42bebf7..95c37fe2bf 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -23,7 +23,7 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx); const ActorInit Obj_Comb_InitVars = { ACTOR_OBJ_COMB, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(ObjComb), @@ -92,7 +92,7 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { pos1.y = (i - 15) * 0.7f; pos1.z = Math_CosS(angle) * rand1; - Math_Vec3f_Sum(&pos1, &this->actor.posRot.pos, &pos); + Math_Vec3f_Sum(&pos1, &this->actor.world.pos, &pos); velocity.x = (Rand_ZeroOne() - 0.5f) + pos1.x * 0.5f; velocity.y = (Rand_ZeroOne() - 0.5f) + pos1.y * 0.6f; @@ -125,9 +125,9 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) { KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, dlist); } - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y - 10.0f; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y - 10.0f; + pos.z = this->actor.world.pos.z; func_80033480(globalCtx, &pos, 40.0f, 6, 70, 60, 1); } @@ -145,7 +145,7 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) { params = -1; } if (params >= 0) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, params); + Item_DropCollectible(globalCtx, &this->actor.world.pos, params); } } } @@ -202,7 +202,7 @@ void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx) { 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; + this->actor.shape.rot.x = Math_SinS(this->unk_1B2) * this->unk_1B0 + this->actor.home.rot.x; } void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { @@ -212,8 +212,8 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); - Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (118.0f * this->actor.scale.y), - this->actor.posRot.pos.z, 0); + Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + (118.0f * this->actor.scale.y), + this->actor.world.pos.z, 0); Matrix_RotateY(this->actor.shape.rot.y * 0.0000958738f, 1); Matrix_RotateX(this->actor.shape.rot.x * 0.0000958738f, 1); Matrix_RotateZ(this->actor.shape.rot.z * 0.0000958738f, 1); 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 3bce721557..d49677cc46 100644 --- a/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -19,7 +19,7 @@ void ObjDekujr_ComeUp(ObjDekujr* this, GlobalContext* globalCtx); const ActorInit Obj_Dekujr_InitVars = { ACTOR_OBJ_DEKUJR, - ACTORTYPE_NPC, + ACTORCAT_NPC, FLAGS, OBJECT_DEKUJR, sizeof(ObjDekujr), @@ -107,7 +107,7 @@ void ObjDekujr_ComeUp(ObjDekujr* this, GlobalContext* globalCtx) { ObjDekujr_SetInitialPos(csCmdNPCAction, &initPos); ObjDekujr_SetFinalPos(csCmdNPCAction, &finalPos); if (this->unk_19C == 0) { - this->actor.posRot.pos = initPos; + this->actor.world.pos = initPos; this->unk_19C = 1; } this->actor.shape.rot.x = csCmdNPCAction->urot.x; @@ -141,12 +141,12 @@ void ObjDekujr_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->unk_19B == 1) { ObjDekujr_ComeUp(this, globalCtx); - this->actor.posRot.pos.x += this->actor.velocity.x; - this->actor.posRot.pos.y += this->actor.velocity.y; - this->actor.posRot.pos.z += this->actor.velocity.z; + this->actor.world.pos.x += this->actor.velocity.x; + this->actor.world.pos.y += this->actor.velocity.y; + this->actor.world.pos.z += this->actor.velocity.z; } else { func_80037D98(globalCtx, &this->actor, 0xF, &this->unk_1A0); - Actor_SetHeight(&this->actor, 40.0f); + Actor_SetFocus(&this->actor, 40.0f); } } 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 e58bf131a8..d6aa0eb025 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -22,7 +22,7 @@ void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx); const ActorInit Obj_Elevator_InitVars = { ACTOR_OBJ_ELEVATOR, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_D_ELEVATOR, sizeof(ObjElevator), @@ -90,11 +90,11 @@ void func_80B92C80(ObjElevator* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; if ((this->dyna.unk_160 & 2) && !(this->unk_170 & 2)) { - sub = thisx->posRot.pos.y - thisx->initPosRot.pos.y; + sub = thisx->world.pos.y - thisx->home.pos.y; if (fabsf(sub) < 0.1f) { - this->unk_168 = thisx->initPosRot.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f; + this->unk_168 = thisx->home.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f; } else { - this->unk_168 = thisx->initPosRot.pos.y; + this->unk_168 = thisx->home.pos.y; } func_80B92D20(this); } @@ -107,7 +107,7 @@ void func_80B92D20(ObjElevator* this) { void func_80B92D44(ObjElevator* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - if (fabsf(Math_SmoothStepToF(&thisx->posRot.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) { + if (fabsf(Math_SmoothStepToF(&thisx->world.pos.y, this->unk_168, 1.0f, this->unk_16C, 0.0f)) < 0.001f) { Audio_PlayActorSound2(thisx, NA_SE_EV_FOOT_SWITCH); func_80B92C5C(this); } else { 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 7dd37a5598..80b2e1b2df 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -20,7 +20,7 @@ extern Gfx D_0500A5E8[]; const ActorInit Obj_Hamishi_InitVars = { ACTOR_OBJ_HAMISHI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(ObjHamishi), @@ -80,19 +80,17 @@ void ObjHamishi_Shake(ObjHamishi* this) { Math_StepToF(&this->shakePosSize, 0.0f, 0.15f); Math_StepToF(&this->shakeRotSize, 0.0f, 40.0f); - this->actor.posRot.pos.x = - this->actor.initPosRot.pos.x + (Math_SinS(this->shakePosPhase * 4) * this->shakePosSize); - this->actor.posRot.pos.z = - this->actor.initPosRot.pos.z + (Math_CosS(this->shakePosPhase * 7) * this->shakePosSize); + this->actor.world.pos.x = this->actor.home.pos.x + (Math_SinS(this->shakePosPhase * 4) * this->shakePosSize); + this->actor.world.pos.z = this->actor.home.pos.z + (Math_CosS(this->shakePosPhase * 7) * this->shakePosSize); this->actor.shape.rot.x = - this->actor.initPosRot.rot.x + (s16)(Math_SinS(this->shakeRotPhase * 4) * this->shakeRotSize); + this->actor.home.rot.x + (s16)(Math_SinS(this->shakeRotPhase * 4) * this->shakeRotSize); this->actor.shape.rot.z = - this->actor.initPosRot.rot.z + (s16)(Math_CosS(this->shakeRotPhase * 7) * this->shakeRotSize); + this->actor.home.rot.z + (s16)(Math_CosS(this->shakeRotPhase * 7) * this->shakeRotSize); } else { - Math_StepToF(&this->actor.posRot.pos.x, this->actor.initPosRot.pos.x, 1.0f); - Math_StepToF(&this->actor.posRot.pos.z, this->actor.initPosRot.pos.z, 1.0f); - Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.initPosRot.rot.x, 0xBB8); - Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.initPosRot.rot.z, 0xBB8); + Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 1.0f); + Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 1.0f); + Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.home.rot.x, 0xBB8); + Math_ScaledStepToS(&this->actor.shape.rot.z, this->actor.home.rot.z, 0xBB8); } } @@ -111,9 +109,9 @@ void ObjHamishi_Break(ObjHamishi* this, GlobalContext* globalCtx) { phi_s0 += 20000; temp_f20 = Rand_ZeroOne() * 10.0f; - pos.x = (Math_SinS(phi_s0) * temp_f20) + this->actor.posRot.pos.x; - pos.y = (Rand_ZeroOne() * 40.0f) + this->actor.posRot.pos.y + 5.0f; - pos.z = (Math_CosS(phi_s0) * temp_f20) + this->actor.posRot.pos.z; + pos.x = (Math_SinS(phi_s0) * temp_f20) + this->actor.world.pos.x; + pos.y = (Rand_ZeroOne() * 40.0f) + this->actor.world.pos.y + 5.0f; + pos.z = (Math_CosS(phi_s0) * temp_f20) + this->actor.world.pos.z; temp_f20 = (Rand_ZeroOne() * 10.0f) + 2.0f; velocity.x = Math_SinS(phi_s0) * temp_f20; @@ -132,12 +130,12 @@ void ObjHamishi_Break(ObjHamishi* this, GlobalContext* globalCtx) { gravity = -320; } - EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.posRot.pos, gravity, phi_v0, 30, 5, 0, + EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &this->actor.world.pos, gravity, phi_v0, 30, 5, 0, sEffectScales[i], 3, 0, 70, 1, OBJECT_GAMEPLAY_FIELD_KEEP, D_0500A5E8); } - func_80033480(globalCtx, &this->actor.posRot.pos, 140.0f, 6, 180, 90, 1); - func_80033480(globalCtx, &this->actor.posRot.pos, 140.0f, 12, 80, 90, 1); + func_80033480(globalCtx, &this->actor.world.pos, 140.0f, 6, 180, 90, 1); + func_80033480(globalCtx, &this->actor.world.pos, 140.0f, 12, 80, 90, 1); } void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -149,7 +147,7 @@ void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.uncullZoneForward += 1000.0f; } if (this->actor.shape.rot.y == 0) { - this->actor.shape.rot.y = this->actor.posRot.rot.y = this->actor.initPosRot.rot.y = Rand_ZeroFloat(65536.0f); + this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.home.rot.y = Rand_ZeroFloat(65536.0f); } ObjHamishi_InitCollision(&this->actor, globalCtx); @@ -160,7 +158,7 @@ void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { return; } - this->actor.shape.unk_08 = 80.0f; + this->actor.shape.yOffset = 80.0f; } void ObjHamishi_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -185,14 +183,14 @@ void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) { this->shakeRotSize = 400.0f; } else { ObjHamishi_Break(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_WALL_BROKEN); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Flags_SetSwitch(globalCtx, this->actor.params & 0x3F); Actor_Kill(&this->actor); } } else { this->collider.base.acFlags &= ~AC_HIT; - if (this->actor.xzDistToLink < 600.0f) { + if (this->actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(globalCtx, colChkCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, colChkCtx, &this->collider.base); } 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 8dca0f5d64..bcb0219f9b 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -17,7 +17,7 @@ void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Hana_InitVars = { ACTOR_OBJ_HANA, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_FIELD_KEEP, sizeof(ObjHana), @@ -77,7 +77,7 @@ void ObjHana_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetScale(&this->actor, params->scale); - this->actor.shape.unk_08 = params->yOffset; + this->actor.shape.yOffset = params->yOffset; if (params->radius >= 0) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -103,7 +103,7 @@ void ObjHana_Destroy(Actor* thisx, GlobalContext* globalCtx) { void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx) { ObjHana* this = THIS; - if (sHanaParams[this->actor.params & 3].radius >= 0 && this->actor.xzDistToLink < 400.0f) { + if (sHanaParams[this->actor.params & 3].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } 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 009e2f0586..de45b513c1 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -24,7 +24,7 @@ void func_80B93E38(ObjHsblock* this); const ActorInit Obj_Hsblock_InitVars = { ACTOR_OBJ_HSBLOCK, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_D_HSBLOCK, sizeof(ObjHsblock), @@ -69,9 +69,9 @@ void func_80B93B68(ObjHsblock* this, GlobalContext* globalCtx, CollisionHeader* void func_80B93BF0(ObjHsblock* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 5) & 1) { - Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, this->dyna.actor.posRot.rot.x, - this->dyna.actor.posRot.rot.y, this->dyna.actor.posRot.rot.z, 1); + Actor_SpawnAsChild(&globalCtx->actorCtx, this, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, + this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1); } } @@ -112,7 +112,7 @@ void func_80B93D90(ObjHsblock* this) { void func_80B93DB0(ObjHsblock* this) { this->dyna.actor.flags |= 0x10; - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y - 105.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 105.0f; ObjHsblock_SetupAction(this, func_80B93DF4); } @@ -128,9 +128,9 @@ void func_80B93E38(ObjHsblock* this) { void func_80B93E5C(ObjHsblock* this, GlobalContext* globalCtx) { Math_SmoothStepToF(&this->dyna.actor.velocity.y, 16.0f, 0.1f, 0.8f, 0.0f); - if (fabsf(Math_SmoothStepToF(&this->dyna.actor.posRot.pos.y, this->dyna.actor.initPosRot.pos.y, 0.3f, + if (fabsf(Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.3f, this->dyna.actor.velocity.y, 0.3f)) < 0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; func_80B93D90(this); this->dyna.actor.flags &= ~0x10; } @@ -142,7 +142,7 @@ void ObjHsblock_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); } - Actor_SetHeight(thisx, D_80B940C0[thisx->params & 3]); + Actor_SetFocus(thisx, D_80B940C0[thisx->params & 3]); } void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx) { 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 3e79a7f7db..cbc41deec9 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 @@ -22,7 +22,7 @@ extern Gfx* D_04033EE0[]; const ActorInit Obj_Ice_Poly_InitVars = { ACTOR_OBJ_ICE_POLY, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjIcePoly), @@ -87,7 +87,7 @@ void ObjIcePoly_Init(Actor* thisx, GlobalContext* globalCtx) { return; } Actor_SetScale(thisx, sScale[thisx->params]); - thisx->posRot.pos.y = sOffsetY[thisx->params] + thisx->initPosRot.pos.y; + thisx->world.pos.y = sOffsetY[thisx->params] + thisx->home.pos.y; Collider_InitCylinder(globalCtx, &this->colliderIce); Collider_SetCylinder(globalCtx, &this->colliderIce, thisx, &sCylinderInitIce); Collider_InitCylinder(globalCtx, &this->colliderHard); @@ -100,7 +100,7 @@ void ObjIcePoly_Init(Actor* thisx, GlobalContext* globalCtx) { this->colliderIce.dim.height *= thisx->scale.y; this->colliderHard.dim.radius *= thisx->scale.x; this->colliderHard.dim.height *= thisx->scale.y; - Actor_SetHeight(thisx, thisx->scale.y * 30.0f); + Actor_SetFocus(thisx, thisx->scale.y * 30.0f); this->actionFunc = ObjIcePoly_Idle; } @@ -121,7 +121,7 @@ void ObjIcePoly_Idle(ObjIcePoly* this, GlobalContext* globalCtx) { if (this->colliderIce.base.acFlags & AC_HIT) { this->meltTimer = -this->colliderIce.info.acHitInfo->toucher.damage; - this->actor.posRot2.rot.y = this->actor.yawTowardsLink; + this->actor.focus.rot.y = this->actor.yawTowardsPlayer; func_800800F8(globalCtx, 0x1400, 40, &this->actor, 0); this->actionFunc = ObjIcePoly_Melt; } else if (this->actor.parent != NULL) { @@ -133,11 +133,9 @@ void ObjIcePoly_Idle(ObjIcePoly* this, GlobalContext* globalCtx) { } else { Actor_Kill(&this->actor); } - pos.x = - this->actor.posRot.pos.x + this->actor.scale.x * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); - pos.y = this->actor.posRot.pos.y + this->actor.scale.y * Rand_S16Offset(10, 90); - pos.z = - this->actor.posRot.pos.z + this->actor.scale.z * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.x = this->actor.world.pos.x + this->actor.scale.x * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.y = this->actor.world.pos.y + this->actor.scale.y * Rand_S16Offset(10, 90); + pos.z = this->actor.world.pos.z + this->actor.scale.z * (Rand_S16Offset(15, 15) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); if ((globalCtx->gameplayFrames % 7) == 0) { EffectSsKiraKira_SpawnDispersed(globalCtx, &pos, &zeroVec, &zeroVec, &sColorWhite, &sColorGray, 2000, 5); } @@ -157,11 +155,11 @@ void ObjIcePoly_Melt(ObjIcePoly* this, GlobalContext* globalCtx) { vel.z = 0.0f; for (i = 0; i < 2; i++) { - pos.x = this->actor.posRot.pos.x + - this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); - pos.y = this->actor.posRot.pos.y + this->actor.scale.y * Rand_ZeroOne() * 50.0f; - pos.z = this->actor.posRot.pos.z + - this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.x = + this->actor.world.pos.x + this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); + pos.y = this->actor.world.pos.y + this->actor.scale.y * Rand_ZeroOne() * 50.0f; + pos.z = + this->actor.world.pos.z + this->actor.scale.x * (Rand_S16Offset(20, 20) * (Rand_ZeroOne() < 0.5f ? -1 : 1)); func_8002829C(globalCtx, &pos, &vel, &accel, &sColorWhite, &sColorGray, Rand_S16Offset(0x15E, 0x64) * this->actor.scale.x, this->actor.scale.x * 20.0f); } 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 9b312ae001..550f7f8524 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -28,7 +28,7 @@ extern Gfx D_05005380[]; const ActorInit Obj_Kibako_InitVars = { ACTOR_OBJ_KIBAKO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjKibako), @@ -72,7 +72,7 @@ void ObjKibako_SpawnCollectible(ObjKibako* this, GlobalContext* globalCtx) { collectible = this->actor.params & 0x1F; if ((collectible >= 0) && (collectible <= 0x19)) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, + Item_DropCollectible(globalCtx, &this->actor.world.pos, collectible | (((this->actor.params >> 8) & 0x3F) << 8)); } } @@ -116,7 +116,7 @@ void ObjKibako_Destroy(Actor* thisx, GlobalContext* globalCtx2) { void ObjKibako_AirBreak(ObjKibako* this, GlobalContext* globalCtx) { s16 angle; s32 i; - Vec3f* breakPos = &this->actor.posRot.pos; + Vec3f* breakPos = &this->actor.world.pos; Vec3f pos; Vec3f velocity; @@ -147,13 +147,13 @@ void ObjKibako_AirBreak(ObjKibako* this, GlobalContext* globalCtx) { (Rand_ZeroOne() * 30.0f) + 10.0f, 0, 32, 60, KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05005380); } - func_80033480(globalCtx, &this->actor.posRot.pos, 40.0f, 3, 50, 140, 1); + func_80033480(globalCtx, &this->actor.world.pos, 40.0f, 3, 50, 140, 1); } void ObjKibako_WaterBreak(ObjKibako* this, GlobalContext* globalCtx) { s16 angle; s32 i; - Vec3f* breakPos = &this->actor.posRot.pos; + Vec3f* breakPos = &this->actor.world.pos; Vec3f pos; Vec3f velocity; @@ -196,28 +196,28 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) { ObjKibako_SetupHeld(this); } else if ((this->actor.bgCheckFlags & 0x20) && (this->actor.yDistToWater > 19.0f)) { ObjKibako_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else if (this->collider.base.acFlags & AC_HIT) { ObjKibako_AirBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else { Actor_MoveForward(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); - if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToLink > 28.0f)) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); + if (!(this->collider.base.ocFlags1 & OC1_TYPE_PLAYER) && (this->actor.xzDistToPlayer > 28.0f)) { this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER; } - if (this->actor.xzDistToLink < 600.0f) { + if (this->actor.xzDistToPlayer < 600.0f) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); - if (this->actor.xzDistToLink < 180.0f) { + if (this->actor.xzDistToPlayer < 180.0f) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } - if (this->actor.xzDistToLink < 100.0f) { + if (this->actor.xzDistToPlayer < 100.0f) { func_8002F580(&this->actor, globalCtx); } } @@ -241,13 +241,13 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx) { ObjKibako_ApplyGravity(this); func_8002D7EC(&this->actor); } - func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); } } void ObjKibako_SetupThrown(ObjKibako* this) { - this->actor.velocity.x = Math_SinS(this->actor.posRot.rot.y) * this->actor.speedXZ; - this->actor.velocity.z = Math_CosS(this->actor.posRot.rot.y) * this->actor.speedXZ; + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; this->actor.colChkInfo.mass = 240; this->actionFunc = ObjKibako_Thrown; } @@ -258,18 +258,18 @@ void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 0xB) || (this->collider.base.atFlags & AT_HIT)) { ObjKibako_AirBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else if (this->actor.bgCheckFlags & 0x40) { ObjKibako_WaterBreak(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); ObjKibako_SpawnCollectible(this, globalCtx); Actor_Kill(&this->actor); } else { ObjKibako_ApplyGravity(this); func_8002D7EC(&this->actor); - func_8002E4B4(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 19.0f, 20.0f, 0.0f, 5); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); 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 1da76f9390..6d42214f55 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -24,7 +24,7 @@ extern Gfx D_06001000[]; const ActorInit Obj_Kibako2_InitVars = { ACTOR_OBJ_KIBAKO2, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_KIBAKO2, sizeof(ObjKibako2), @@ -77,7 +77,7 @@ void ObjKibako2_Break(ObjKibako2* this, GlobalContext* globalCtx) { s16 angle; s32 i; - thisPos = &this->dyna.actor.posRot.pos; + thisPos = &this->dyna.actor.world.pos; for (i = 0, angle = 0; i < 0x10; i++, angle += 0x4E20) { f32 sn = Math_SinS(angle); f32 cs = Math_CosS(angle); @@ -113,9 +113,9 @@ void ObjKibako2_SpawnCollectible(ObjKibako2* this, GlobalContext* globalCtx) { s16 collectibleFlagTemp; collectibleFlagTemp = this->collectibleFlag; - itemDropped = this->dyna.actor.initPosRot.rot.x; + itemDropped = this->dyna.actor.home.rot.x; if (itemDropped >= 0 && itemDropped < 0x1A) { - Item_DropCollectible(globalCtx, &this->dyna.actor.posRot.pos, itemDropped | (collectibleFlagTemp << 8)); + Item_DropCollectible(globalCtx, &this->dyna.actor.world.pos, itemDropped | (collectibleFlagTemp << 8)); } } @@ -130,14 +130,14 @@ void ObjKibako2_Init(Actor* thisx, GlobalContext* globalCtx) { ObjKibako2_InitCollider(thisx, globalCtx); CollisionHeader_GetVirtual(&D_06000B70, &colHeader); bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - this->collectibleFlag = this->dyna.actor.initPosRot.rot.z & 0x3F; + this->collectibleFlag = this->dyna.actor.home.rot.z & 0x3F; this->dyna.bgId = bgId; this->actionFunc = ObjKibako2_Idle; - this->dyna.actor.initPosRot.rot.z = this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z = - this->dyna.actor.posRot.rot.x = this->dyna.actor.shape.rot.x = 0; + this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = + this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0; // Wooden box (stationary) osSyncPrintf("木箱(据置)(arg %04xH)(item %04xH %d)\n", this->dyna.actor.params, this->collectibleFlag, - this->dyna.actor.initPosRot.rot.x); + this->dyna.actor.home.rot.x); } void ObjKibako2_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -148,15 +148,15 @@ void ObjKibako2_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ObjKibako2_Idle(ObjKibako2* this, GlobalContext* globalCtx) { - if ((this->collider.base.acFlags & AC_HIT) || (this->dyna.actor.initPosRot.rot.z != 0) || + if ((this->collider.base.acFlags & AC_HIT) || (this->dyna.actor.home.rot.z != 0) || func_80033684(globalCtx, &this->dyna.actor) != NULL) { ObjKibako2_Break(this, globalCtx); - Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.posRot.pos, 20, NA_SE_EV_WOODBOX_BREAK); + Audio_PlaySoundAtPosition(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK); this->dyna.actor.flags |= 0x10; func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->dyna.actor.draw = NULL; this->actionFunc = ObjKibako2_Kill; - } else if (this->dyna.actor.xzDistToLink < 600.0f) { + } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } @@ -165,8 +165,8 @@ void ObjKibako2_Kill(ObjKibako2* this, GlobalContext* globalCtx) { s16 params = this->dyna.actor.params; if ((params & 0x8000) == 0) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, 0, this->dyna.actor.shape.rot.y, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, params | 0x8000); } ObjKibako2_SpawnCollectible(this, globalCtx); 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 94425981bb..83ac69ace3 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -21,7 +21,7 @@ extern UNK_TYPE D_060003D0; /* const ActorInit Obj_Lift_InitVars = { ACTOR_OBJ_LIFT, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_D_LIFT, sizeof(ObjLift), 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 250b8c5c51..ef763fef6a 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -45,7 +45,7 @@ extern UNK_TYPE D_06001420[]; // rgba16 32x32 eyes open, smiling const ActorInit Obj_Lightswitch_InitVars = { ACTOR_OBJ_LIGHTSWITCH, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_LIGHTSWITCH, sizeof(ObjLightswitch), @@ -100,8 +100,8 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, GlobalContext* globalCtx) Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderItems); - func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y), - this->actor.posRot.pos.z, &this->actor.shape.rot); + func_800D1694(this->actor.world.pos.x, this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y), + this->actor.world.pos.z, &this->actor.shape.rot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Collider_UpdateSpheres(0, &this->collider); } @@ -158,9 +158,9 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, GlobalContext* g } x = 2.0f * (x * (Rand_ZeroOne() - 0.5f)); z = (30.0f - fabsf(x)) * 0.5f + 10.0f * Rand_ZeroOne(); - pos.x = this->actor.posRot.pos.x + ((z * s) + (x * c)); - pos.y = this->actor.posRot.pos.y + y + 10.0f; - pos.z = this->actor.posRot.pos.z + ((z * c) - (x * s)); + pos.x = this->actor.world.pos.x + ((z * s) + (x * c)); + pos.y = this->actor.world.pos.y + y + 10.0f; + pos.z = this->actor.world.pos.z + ((z * c) - (x * s)); EffectSsDeadDb_Spawn(globalCtx, &pos, &D_80B97F74, &D_80B97F74, 100, 0, 255, 255, 160, 160, 255, 0, 0, 1, 9, true); } @@ -172,7 +172,7 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { s32 removeSelf = false; Actor_ProcessInitChain(&this->actor, sInitChain); - Actor_SetHeight(&this->actor, 0.0f); + Actor_SetFocus(&this->actor, 0.0f); if (switchFlagSet) { if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN) { removeSelf = true; @@ -184,17 +184,17 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { } if ((this->actor.params & 1) == 1) { if (switchFlagSet) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &D_80B97F68); - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &D_80B97F68); + Math_Vec3f_Copy(&this->actor.world.pos, &D_80B97F68); + Math_Vec3f_Copy(&this->actor.home.pos, &D_80B97F68); } this->actor.shape.rot.x = -0x4000; this->actor.shape.rot.z = 0; - this->actor.posRot.rot.x = this->actor.initPosRot.rot.x = this->actor.shape.rot.x; - this->actor.posRot.rot.z = this->actor.initPosRot.rot.z = this->actor.shape.rot.z; + this->actor.world.rot.x = this->actor.home.rot.x = this->actor.shape.rot.x; + this->actor.world.rot.z = this->actor.home.rot.z = this->actor.shape.rot.z; this->actor.flags |= 0x20; if (Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_OBJ_OSHIHIKI, - this->actor.initPosRot.pos.x, this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, - 0, this->actor.initPosRot.rot.y, 0, (0xFF << 8) | PUSHBLOCK_SMALL_START_ON) == NULL) { + this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, + this->actor.home.rot.y, 0, (0xFF << 8) | PUSHBLOCK_SMALL_START_ON) == NULL) { osSyncPrintf(VT_COL(RED, WHITE)); // Push-pull block occurrence failure osSyncPrintf("押引ブロック発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_obj_lightswitch.c", 452, @@ -260,7 +260,7 @@ void ObjLightswitch_SetupTurnOn(ObjLightswitch* this) { } void ObjLightswitch_TurnOn(ObjLightswitch* this, GlobalContext* globalCtx) { - if (func_8005B198() == this->actor.type || this->toggleDelay <= 0) { + if (func_8005B198() == this->actor.category || this->toggleDelay <= 0) { if (this->timer == 0) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRIFORCE_FLASH); } @@ -332,7 +332,7 @@ void ObjLightswitch_SetupTurnOff(ObjLightswitch* this) { } void ObjLightswitch_TurnOff(ObjLightswitch* this, GlobalContext* globalCtx) { - if ((this->actor.params >> 4 & 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.type || + if ((this->actor.params >> 4 & 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || this->toggleDelay <= 0) { this->timer--; @@ -357,7 +357,7 @@ void ObjLightswitch_SetupDisappearDelay(ObjLightswitch* this) { } void ObjLightswitch_DisappearDelay(ObjLightswitch* this, GlobalContext* globalCtx) { - if (func_8005B198() == this->actor.type || this->toggleDelay <= 0) { + if (func_8005B198() == this->actor.category || this->toggleDelay <= 0) { ObjLightswitch_SetupDisappear(this); } } @@ -387,10 +387,10 @@ void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.update != NULL) { if ((this->actor.params & 1) == 1) { - this->actor.posRot.pos.x = this->actor.child->posRot.pos.x; - this->actor.posRot.pos.y = this->actor.child->posRot.pos.y + 60.0f; - this->actor.posRot.pos.z = this->actor.child->posRot.pos.z; - Actor_SetHeight(&this->actor, 0.0f); + this->actor.world.pos.x = this->actor.child->world.pos.x; + this->actor.world.pos.y = this->actor.child->world.pos.y + 60.0f; + this->actor.world.pos.z = this->actor.child->world.pos.z; + Actor_SetFocus(&this->actor, 0.0f); } this->prevFrameACflags = this->collider.base.acFlags; @@ -414,16 +414,16 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) { if ((this->actor.params & 1) == 1) { child = this->actor.child; - this->actor.posRot.pos.x = child->posRot.pos.x; - this->actor.posRot.pos.y = child->posRot.pos.y + 60.0f; - this->actor.posRot.pos.z = child->posRot.pos.z; - Math_Vec3f_Copy(&pos, &this->actor.posRot.pos); + this->actor.world.pos.x = child->world.pos.x; + this->actor.world.pos.y = child->world.pos.y + 60.0f; + this->actor.world.pos.z = child->world.pos.z; + Math_Vec3f_Copy(&pos, &this->actor.world.pos); func_800D1694(pos.x, pos.y, pos.z, &this->actor.shape.rot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); } else { - pos.x = this->actor.posRot.pos.x; - pos.y = this->actor.posRot.pos.y + this->actor.shape.unk_08 * this->actor.scale.y; - pos.z = this->actor.posRot.pos.z; + pos.x = this->actor.world.pos.x; + pos.y = this->actor.world.pos.y + this->actor.shape.yOffset * this->actor.scale.y; + pos.z = this->actor.world.pos.z; } gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 841), @@ -462,9 +462,9 @@ void ObjLightswitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) { (u8)(this->alpha >> 6)); gSPSegment(POLY_XLU_DISP++, 0x09, D_80116280); - sp68.x = this->actor.posRot.pos.x; - sp68.y = this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->actor.scale.y); - sp68.z = this->actor.posRot.pos.z; + sp68.x = this->actor.world.pos.x; + sp68.y = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y); + sp68.z = this->actor.world.pos.z; gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 912), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); 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 ac2020d8ca..7c9698a8cf 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -19,7 +19,7 @@ void ObjMakekinsuta_DoNothing(ObjMakekinsuta* this, GlobalContext* globalCtx); const ActorInit Obj_Makekinsuta_InitVars = { ACTOR_OBJ_MAKEKINSUTA, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMakekinsuta), @@ -49,9 +49,8 @@ void ObjMakekinsuta_Init(Actor* thisx, GlobalContext* globalCtx) { void func_80B98320(ObjMakekinsuta* this, GlobalContext* globalCtx) { if (this->unk_152 != 0) { if (this->timer >= 60 && !func_8002DEEC(PLAYER)) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, - (this->actor.params | 0x8000)); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, (this->actor.params | 0x8000)); this->actionFunc = ObjMakekinsuta_DoNothing; } else { this->timer++; 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 3d884045f7..e720d14d4e 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -16,7 +16,7 @@ void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx); void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Makeoshihiki_InitVars = { - ACTOR_OBJ_MAKEOSHIHIKI, ACTORTYPE_PROP, FLAGS, + ACTOR_OBJ_MAKEOSHIHIKI, ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjMakeoshihiki), (ActorFunc)ObjMakeoshihiki_Init, (ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)ObjMakeoshihiki_Draw, }; @@ -51,7 +51,7 @@ static u32 sFlags[3][2] = { { 0, 0 }, { 1, 0 }, { 0, 1 } }; static void (*sFlagSwitchFuncs[])(GlobalContext* globalCtx, s32 flag) = { Flags_UnsetSwitch, Flags_SetSwitch }; void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) { - BlockConfig* block = &sBlocks[thisx->initPosRot.rot.z & 1]; + BlockConfig* block = &sBlocks[thisx->home.rot.z & 1]; s32 typeIdx; Vec3f* spawnPos; @@ -78,13 +78,12 @@ void ObjMakeoshihiki_Init(Actor* thisx, GlobalContext* globalCtx) { if (block->unk_24[typeIdx] & 2) { ((ObjOshihiki*)thisx->child)->cantMove = true; } - thisx->posRot.rot.z = thisx->shape.rot.z = 0; - osSyncPrintf("(%s)(arg_data %04xF)(angleZ %d)\n", "../z_obj_makeoshihiki.c", thisx->params, - thisx->initPosRot.rot.z); + thisx->world.rot.z = thisx->shape.rot.z = 0; + osSyncPrintf("(%s)(arg_data %04xF)(angleZ %d)\n", "../z_obj_makeoshihiki.c", thisx->params, thisx->home.rot.z); } void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) { - BlockConfig* block = &sBlocks[thisx->initPosRot.rot.z & 1]; + BlockConfig* block = &sBlocks[thisx->home.rot.z & 1]; s32 i; s32 sfxCond1; s32 sfxCond2; @@ -92,7 +91,7 @@ void ObjMakeoshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 cond2; for (i = 0; i < 3; i++) { - if (Math3D_Vec3fDistSq(&thisx->child->posRot.pos, &block->posVecs[i]) < 0.001f) { + if (Math3D_Vec3fDistSq(&thisx->child->world.pos, &block->posVecs[i]) < 0.001f) { if (block->unk_24[i] & 1) { if ((thisx->params >> 6) & 1) { sfxCond1 = false; 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 6e10540c47..efce7a4db0 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -17,7 +17,7 @@ void ObjMure_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Mure_InitVars = { ACTOR_OBJ_MURE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMure), 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 327144a17e..b9b42c4e19 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -32,7 +32,7 @@ void func_80B9A6E8(ObjMure2* this); const ActorInit Obj_Mure2_InitVars = { ACTOR_OBJ_MURE2, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMure2), @@ -56,9 +56,9 @@ void ObjMure2_SetPosShrubCircle(Vec3f* vec, ObjMure2* this) { Vec3f* vecPtr = vec; s32 i; - Math_Vec3f_Copy(vecPtr, &this->actor.posRot.pos); + Math_Vec3f_Copy(vecPtr, &this->actor.world.pos); for (i = 1, vecPtr++; i < D_80B9A818[this->actor.params & 3]; vecPtr++, i++) { - Math_Vec3f_Copy(vecPtr, &this->actor.posRot.pos); + Math_Vec3f_Copy(vecPtr, &this->actor.world.pos); vecPtr->x += (80.0f * Math_SinS((i - 1) * 0x2000)); vecPtr->z += (80.0f * Math_CosS((i - 1) * 0x2000)); } @@ -76,8 +76,8 @@ void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { Vec3f* vecPtr; s32 i; - Vec3f* actorPos = &this->actor.posRot.pos; // Required to match - ObjMure2* this2 = this; // Required to match + Vec3f* actorPos = &this->actor.world.pos; // Required to match + ObjMure2* this2 = this; // Required to match for (vecPtr = vec, i = 0; i < D_80B9A818[this2->actor.params & 3]; vecPtr++, i++) { Math_Vec3f_Copy(vecPtr, actorPos); @@ -92,7 +92,7 @@ void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { s32 i; for (i = 0; i < D_80B9A818[this->actor.params & 3]; vecPtr++, i++) { - Math_Vec3f_Copy(vecPtr, &this->actor.posRot.pos); + Math_Vec3f_Copy(vecPtr, &this->actor.world.pos); vecPtr->x += (80.0f * Math_SinS(i * 0x2000)); vecPtr->z += (80.0f * Math_CosS(i * 0x2000)); } @@ -134,7 +134,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, GlobalContext* globalCtx) { if (((this->currentActorNum >> i) & 1) == 0) { this->actorSpawnPtrList[i] = Actor_Spawn(&globalCtx->actorCtx, globalCtx, sActorSpawnIDs[actorNum], spawnPos[i].x, spawnPos[i].y, - spawnPos[i].z, this->actor.posRot.rot.x, 0, this->actor.posRot.rot.z, params); + spawnPos[i].z, this->actor.world.rot.x, 0, this->actor.world.rot.z, params); if (this->actorSpawnPtrList[i] != NULL) { this->actorSpawnPtrList[i]->room = this->actor.room; } 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 050f8982ab..d58642b1fd 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -17,7 +17,7 @@ void ObjMure3_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Mure3_InitVars = { ACTOR_OBJ_MURE3, - ACTORTYPE_BG, + ACTORCAT_BG, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjMure3), 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 d67d1d52c6..863bc26df5 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -33,7 +33,7 @@ extern Gfx D_05004CD0[]; const ActorInit Obj_Oshihiki_InitVars = { ACTOR_OBJ_OSHIHIKI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjOshihiki), @@ -151,7 +151,7 @@ ObjOshihiki* ObjOshihiki_GetBlockUnder(ObjOshihiki* this, GlobalContext* globalC Actor* dyna; if ((this->floorBgIds[this->highestFloor] != BGCHECK_SCENE) && - (fabsf(this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) < 0.001f)) { + (fabsf(this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) < 0.001f)) { dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]); if ((dyna != NULL) && (dyna->id == ACTOR_OBJ_OSHIHIKI)) { return (ObjOshihiki*)dyna; @@ -161,22 +161,22 @@ ObjOshihiki* ObjOshihiki_GetBlockUnder(ObjOshihiki* this, GlobalContext* globalC } void ObjOshihiki_UpdateInitPos(ObjOshihiki* this) { - if (this->dyna.actor.initPosRot.pos.x < this->dyna.actor.posRot.pos.x) { - while ((this->dyna.actor.posRot.pos.x - this->dyna.actor.initPosRot.pos.x) >= 20.0f) { - this->dyna.actor.initPosRot.pos.x += 20.0f; + if (this->dyna.actor.home.pos.x < this->dyna.actor.world.pos.x) { + while ((this->dyna.actor.world.pos.x - this->dyna.actor.home.pos.x) >= 20.0f) { + this->dyna.actor.home.pos.x += 20.0f; } } else { - while ((this->dyna.actor.initPosRot.pos.x - this->dyna.actor.posRot.pos.x) >= 20.0f) { - this->dyna.actor.initPosRot.pos.x -= 20.0f; + while ((this->dyna.actor.home.pos.x - this->dyna.actor.world.pos.x) >= 20.0f) { + this->dyna.actor.home.pos.x -= 20.0f; } } - if (this->dyna.actor.initPosRot.pos.z < this->dyna.actor.posRot.pos.z) { - while ((this->dyna.actor.posRot.pos.z - this->dyna.actor.initPosRot.pos.z) >= 20.0f) { - this->dyna.actor.initPosRot.pos.z += 20.0f; + if (this->dyna.actor.home.pos.z < this->dyna.actor.world.pos.z) { + while ((this->dyna.actor.world.pos.z - this->dyna.actor.home.pos.z) >= 20.0f) { + this->dyna.actor.home.pos.z += 20.0f; } } else { - while ((this->dyna.actor.initPosRot.pos.z - this->dyna.actor.posRot.pos.z) >= 20.0f) { - this->dyna.actor.initPosRot.pos.z -= 20.0f; + while ((this->dyna.actor.home.pos.z - this->dyna.actor.world.pos.z) >= 20.0f) { + this->dyna.actor.home.pos.z -= 20.0f; } } } @@ -334,9 +334,9 @@ void ObjOshihiki_SetFloors(ObjOshihiki* this, GlobalContext* globalCtx) { colCheckOffset.y = sColCheckPoints[i].y * (this->dyna.actor.scale.y * 10.0f); colCheckOffset.z = sColCheckPoints[i].z * (this->dyna.actor.scale.z * 10.0f); ObjOshihiki_RotateXZ(&colCheckPoint, &colCheckOffset, this->yawSin, this->yawCos); - colCheckPoint.x += this->dyna.actor.posRot.pos.x; - colCheckPoint.y += this->dyna.actor.pos4.y; - colCheckPoint.z += this->dyna.actor.posRot.pos.z; + colCheckPoint.x += this->dyna.actor.world.pos.x; + colCheckPoint.y += this->dyna.actor.prevPos.y; + colCheckPoint.z += this->dyna.actor.world.pos.z; floorPoly = &this->floorPolys[i]; floorBgId = &this->floorBgIds[i]; @@ -380,14 +380,14 @@ void ObjOshihiki_SetGround(ObjOshihiki* this, GlobalContext* globalCtx) { ObjOshihiki_ResetFloors(this); ObjOshihiki_SetFloors(this, globalCtx); this->highestFloor = ObjOshihiki_GetHighestFloor(this); - this->dyna.actor.groundY = this->floorHeights[this->highestFloor]; + this->dyna.actor.floorHeight = this->floorHeights[this->highestFloor]; } s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, GlobalContext* globalCtx) { ObjOshihiki_SetGround(this, globalCtx); - if ((this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) >= -0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; return 1; } @@ -395,15 +395,15 @@ s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, GlobalContext* globalCtx) { } s32 ObjOshihiki_CheckGround(ObjOshihiki* this, GlobalContext* globalCtx) { - if (this->dyna.actor.posRot.pos.y <= -31990.0f) { + if (this->dyna.actor.world.pos.y <= -31990.0f) { // Warning : Push-pull block fell too much osSyncPrintf("Warning : 押し引きブロック落ちすぎた(%s %d)(arg_data 0x%04x)\n", "../z_obj_oshihiki.c", 809, this->dyna.actor.params); Actor_Kill(&this->dyna.actor); return 0; } - if ((this->dyna.actor.groundY - this->dyna.actor.posRot.pos.y) >= -0.001f) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; return 1; } return 0; @@ -427,9 +427,9 @@ s32 ObjOshihiki_CheckWall(GlobalContext* globalCtx, s16 angle, f32 direction, Ob faceVtxOffset.y = (sFaceVtx[i].y * this->dyna.actor.scale.y * 10.0f) + sFaceDirection[i].y; faceVtxOffset.z = 0.0f; ObjOshihiki_RotateXZ(&faceVtx, &faceVtxOffset, sn, cs); - faceVtx.x += this->dyna.actor.posRot.pos.x; - faceVtx.y += this->dyna.actor.posRot.pos.y; - faceVtx.z += this->dyna.actor.posRot.pos.z; + faceVtx.x += this->dyna.actor.world.pos.x; + faceVtx.y += this->dyna.actor.world.pos.y; + faceVtx.z += this->dyna.actor.world.pos.z; faceVtxNext.x = faceVtx.x + maxDist * sn; faceVtxNext.y = faceVtx.y; faceVtxNext.z = faceVtx.z + maxDist * cs; @@ -452,10 +452,10 @@ s32 ObjOshihiki_MoveWithBlockUnder(ObjOshihiki* this, GlobalContext* globalCtx) if ((this->stateFlags & PUSHBLOCK_MOVE_UNDER) && (this->blockUnder != NULL)) { if (this->blockUnder->stateFlags & PUSHBLOCK_PUSH) { - this->underDistX = this->blockUnder->dyna.actor.posRot.pos.x - this->blockUnder->dyna.actor.pos4.x; - this->underDistZ = this->blockUnder->dyna.actor.posRot.pos.z - this->blockUnder->dyna.actor.pos4.z; - this->dyna.actor.posRot.pos.x += this->underDistX; - this->dyna.actor.posRot.pos.z += this->underDistZ; + this->underDistX = this->blockUnder->dyna.actor.world.pos.x - this->blockUnder->dyna.actor.prevPos.x; + this->underDistZ = this->blockUnder->dyna.actor.world.pos.z - this->blockUnder->dyna.actor.prevPos.z; + this->dyna.actor.world.pos.x += this->underDistX; + this->dyna.actor.world.pos.z += this->underDistZ; ObjOshihiki_UpdateInitPos(this); return 1; } else if (!(this->blockUnder->stateFlags & PUSHBLOCK_SETUP_PUSH)) { @@ -547,7 +547,7 @@ void ObjOshihiki_OnActor(ObjOshihiki* this, GlobalContext* globalCtx) { if ((dynaActor != NULL) && (dynaActor->unk_15C & 1)) { func_800434A8(dynaActor); func_80043538(dynaActor); - this->dyna.actor.posRot.pos.y = this->dyna.actor.groundY; + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } else { ObjOshihiki_SetupFall(this, globalCtx); } @@ -572,12 +572,12 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f); stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed); pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist; - thisx->posRot.pos.x = thisx->initPosRot.pos.x + (pushDistSigned * this->yawSin); - thisx->posRot.pos.z = thisx->initPosRot.pos.z + (pushDistSigned * this->yawCos); + thisx->world.pos.x = thisx->home.pos.x + (pushDistSigned * this->yawSin); + thisx->world.pos.z = thisx->home.pos.z + (pushDistSigned * this->yawCos); if (!ObjOshihiki_CheckFloor(this, globalCtx)) { - thisx->initPosRot.pos.x = thisx->posRot.pos.x; - thisx->initPosRot.pos.z = thisx->posRot.pos.z; + thisx->home.pos.x = thisx->world.pos.x; + thisx->home.pos.z = thisx->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; @@ -589,8 +589,8 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(thisx, NA_SE_EV_BLOCK_BOUND); } - thisx->initPosRot.pos.x = thisx->posRot.pos.x; - thisx->initPosRot.pos.z = thisx->posRot.pos.z; + thisx->home.pos.x = thisx->world.pos.x; + thisx->home.pos.z = thisx->world.pos.z; player->stateFlags2 &= ~0x10; this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; @@ -649,10 +649,10 @@ void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx) { this->timer--; } - this->dyna.actor.posRot.rot.y = this->dyna.unk_158; + this->dyna.actor.world.rot.y = this->dyna.unk_158; - this->yawSin = Math_SinS(this->dyna.actor.posRot.rot.y); - this->yawCos = Math_CosS(this->dyna.actor.posRot.rot.y); + this->yawSin = Math_SinS(this->dyna.actor.world.rot.y); + this->yawCos = Math_CosS(this->dyna.actor.world.rot.y); if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); 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 fe64164fe3..325f7b29a0 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -19,7 +19,7 @@ void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx); const ActorInit Obj_Roomtimer_InitVars = { ACTOR_OBJ_ROOMTIMER, - ACTORTYPE_ENEMY, + ACTORCAT_ENEMY, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjRoomtimer), @@ -61,7 +61,7 @@ void func_80B9D054(ObjRoomtimer* this, GlobalContext* globalCtx) { func_80088B34(this->actor.params); } - Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP); + Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP); this->actionFunc = func_80B9D0B0; } 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 d440aa8d34..899fba8df5 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -59,7 +59,7 @@ extern UNK_TYPE D_05014CB0[]; // blue plasma/cloud const ActorInit Obj_Switch_InitVars = { ACTOR_OBJ_SWITCH, - ACTORTYPE_SWITCH, + ACTORCAT_SWITCH, FLAGS, OBJECT_GAMEPLAY_DANGEON_KEEP, sizeof(ObjSwitch), @@ -212,9 +212,9 @@ void ObjSwitch_InitJntSphCollider(ObjSwitch* this, GlobalContext* globalCtx, Col Collider_InitJntSph(globalCtx, colliderJntSph); Collider_SetJntSph(globalCtx, colliderJntSph, &this->dyna.actor, colliderJntSphInit, this->jntSph.items); - func_800D1694(this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y + this->dyna.actor.shape.unk_08 * this->dyna.actor.scale.y, - this->dyna.actor.posRot.pos.z, &this->dyna.actor.shape.rot); + func_800D1694(this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y + this->dyna.actor.shape.yOffset * this->dyna.actor.scale.y, + this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot); Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY); Collider_UpdateSpheres(0, colliderJntSph); } @@ -230,8 +230,8 @@ void ObjSwitch_InitTrisCollider(ObjSwitch* this, GlobalContext* globalCtx, Colli for (i = 0; i < 2; i++) { for (j = 0; j < 3; j++) { - ObjSwitch_RotateY(&pos[j], &colliderTrisInit->elements[i].dim.vtx[j], this->dyna.actor.initPosRot.rot.y); - Math_Vec3f_Sum(&pos[j], &this->dyna.actor.posRot.pos, &pos[j]); + ObjSwitch_RotateY(&pos[j], &colliderTrisInit->elements[i].dim.vtx[j], this->dyna.actor.home.rot.y); + Math_Vec3f_Sum(&pos[j], &this->dyna.actor.world.pos, &pos[j]); } Collider_SetTrisVertices(colliderTris, i, &pos[0], &pos[1], &pos[2]); @@ -241,9 +241,9 @@ void ObjSwitch_InitTrisCollider(ObjSwitch* this, GlobalContext* globalCtx, Colli Actor* ObjSwitch_SpawnIce(ObjSwitch* this, GlobalContext* globalCtx) { Actor* thisx = &this->dyna.actor; - return Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_ICE_POLY, thisx->posRot.pos.x, - thisx->posRot.pos.y, thisx->posRot.pos.z, thisx->posRot.rot.x, thisx->posRot.rot.y, - thisx->posRot.rot.z, (this->dyna.actor.params >> 8 & 0x3F) << 8); + return Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_OBJ_ICE_POLY, thisx->world.pos.x, + thisx->world.pos.y, thisx->world.pos.z, thisx->world.rot.x, thisx->world.rot.y, + thisx->world.rot.z, (this->dyna.actor.params >> 8 & 0x3F) << 8); } void ObjSwitch_SetOn(ObjSwitch* this, GlobalContext* globalCtx) { @@ -301,10 +301,10 @@ void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) { - this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + 1.0f; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 1.0f; } - Actor_SetHeight(&this->dyna.actor, sHeights[type]); + Actor_SetFocus(&this->dyna.actor, sHeights[type]); if (type == OBJSWITCH_TYPE_FLOOR_RUSTY) { ObjSwitch_InitTrisCollider(this, globalCtx, &sRustyFloorTrisInit); @@ -316,7 +316,7 @@ void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { if (type == OBJSWITCH_TYPE_CRYSTAL_TARGETABLE) { this->dyna.actor.flags |= 1; - this->dyna.actor.unk_1F = 4; + this->dyna.actor.targetMode = 4; } this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -426,12 +426,12 @@ void ObjSwitch_FloorPressInit(ObjSwitch* this) { void ObjSwitch_FloorPress(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_FLOOR_3 || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->dyna.actor.scale.y -= 99.0f / 2000.0f; if (this->dyna.actor.scale.y <= 33.0f / 2000.0f) { ObjSwitch_FloorDownInit(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 120, 20, 10); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10); } } } @@ -482,13 +482,13 @@ void ObjSwitch_FloorRelease(ObjSwitch* this, GlobalContext* globalCtx) { s16 subType = (this->dyna.actor.params >> 4 & 7); if (((subType != OBJSWITCH_SUBTYPE_FLOOR_1) && (subType != OBJSWITCH_SUBTYPE_FLOOR_3)) || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->dyna.actor.scale.y += 99.0f / 2000.0f; if (this->dyna.actor.scale.y >= 33.0f / 200.0f) { ObjSwitch_FloorUpInit(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH); if (subType == OBJSWITCH_SUBTYPE_FLOOR_1) { - func_800AA000(this->dyna.actor.xyzDistToLinkSq, 120, 20, 10); + func_800AA000(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10); } } } @@ -501,7 +501,7 @@ s32 ObjSwitch_EyeIsHit(ObjSwitch* this) { if ((this->tris.col.base.acFlags & AC_HIT) && !(this->unk_17F & 2)) { collidingActor = this->tris.col.base.ac; if (collidingActor != NULL) { - yawDiff = collidingActor->posRot.rot.y - this->dyna.actor.shape.rot.y; + yawDiff = collidingActor->world.rot.y - this->dyna.actor.shape.rot.y; if (ABS(yawDiff) > 0x5000) { return 1; } @@ -541,7 +541,7 @@ void ObjSwitch_EyeClosingInit(ObjSwitch* this) { } void ObjSwitch_EyeClosing(ObjSwitch* this, GlobalContext* globalCtx) { - if (!this->cooldownOn || func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + if (!this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->eyeTexIndex++; if (this->eyeTexIndex >= 3) { ObjSwitch_EyeClosedInit(this); @@ -580,7 +580,7 @@ void ObjSwitch_EyeOpeningInit(ObjSwitch* this) { void ObjSwitch_EyeOpening(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 4 & 7) != OBJSWITCH_SUBTYPE_EYE_1 || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->eyeTexIndex--; if (this->eyeTexIndex <= 0) { ObjSwitch_EyeOpenInit(this); @@ -631,7 +631,7 @@ void ObjSwitch_CrystalTurnOnInit(ObjSwitch* this) { } void ObjSwitch_CrystalTurnOn(ObjSwitch* this, GlobalContext* globalCtx) { - if (!this->cooldownOn || func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + if (!this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOnInit(this); if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_CRYSTAL_1) { ObjSwitch_UpdateTwoTexScrollXY(this); @@ -675,7 +675,7 @@ void ObjSwitch_CrystalTurnOffInit(ObjSwitch* this) { void ObjSwitch_CrystalTurnOff(ObjSwitch* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 4 & 7) != OBJSWITCH_SUBTYPE_CRYSTAL_1 || !this->cooldownOn || - func_8005B198() == this->dyna.actor.type || this->cooldownTimer <= 0) { + func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOffInit(this); ObjSwitch_UpdateTwoTexScrollXY(this); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_DIAMOND_SWITCH); 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 ffba831462..914a0f3548 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -20,7 +20,7 @@ extern Gfx D_0404D4E0[]; const ActorInit Obj_Syokudai_InitVars = { ACTOR_OBJ_SYOKUDAI, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_SYOKUDAI, sizeof(ObjSyokudai), @@ -97,8 +97,8 @@ void ObjSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; - Lights_PointGlowSetInfo(&this->lightInfo, this->actor.posRot.pos.x, this->actor.posRot.pos.y + 70.0f, - this->actor.posRot.pos.z, 255, 255, 180, -1); + Lights_PointGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y + 70.0f, + this->actor.world.pos.z, 255, 255, 180, -1); this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); if ((this->actor.params & 0x400) || ((torchType != 2) && Flags_GetSwitch(globalCtx, this->actor.params & 0x3F))) { @@ -107,7 +107,7 @@ void ObjSyokudai_Init(Actor* thisx, GlobalContext* globalCtx) { this->flameTexScroll = (s32)(Rand_ZeroOne() * 20.0f); sLitTorchCount = 0; - Actor_SetHeight(&this->actor, 60.0f); + Actor_SetFocus(&this->actor, 60.0f); } void ObjSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -142,9 +142,9 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { if (torchCount == 10) { torchCount = 24; } - if (WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.posRot.pos.x, this->actor.posRot.pos.z, + if (WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &waterSurface, &dummy) && - ((waterSurface - this->actor.posRot.pos.y) > 52.0f)) { + ((waterSurface - this->actor.world.pos.y) > 52.0f)) { this->litTimer = 0; if (torchType == 1) { Flags_UnsetSwitch(globalCtx, switchFlag); @@ -178,7 +178,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) { interactionType = 1; } } else if (player->heldItemActionParam == 6) { - Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.posRot.pos, &tipToFlame); + Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.world.pos, &tipToFlame); tipToFlame.y -= 67.0f; if ((SQ(tipToFlame.x) + SQ(tipToFlame.y) + SQ(tipToFlame.z)) < SQ(20.0f)) { interactionType = -1; 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 fbe9cf3f9c..8d03d921ad 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -31,7 +31,7 @@ extern CollisionHeader D_06000B30; const ActorInit Obj_Timeblock_InitVars = { ACTOR_OBJ_TIMEBLOCK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_TIMEBLOCK, sizeof(ObjTimeblock), @@ -55,7 +55,7 @@ static ObjTimeblockSizeOptions sSizeOptions[] = { static f32 sRanges[] = { 60.0, 100.0, 140.0, 180.0, 220.0, 260.0, 300.0, 300.0 }; static InitChainEntry sInitChain[] = { - ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE), + ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 1800, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 1500, ICHAIN_STOP), @@ -85,8 +85,8 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { } void ObjTimeblock_SpawnDemoEffect(ObjTimeblock* this, GlobalContext* globalCtx) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->dyna.actor.posRot.pos.x, - this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, 0, 0, 0, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, + this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, 0, 0, sSizeOptions[(this->dyna.actor.params >> 8) & 1].demoEffectParams); } @@ -104,7 +104,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z = 0; + this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; CollisionHeader_GetVirtual(&D_06000B30, &colHeader); @@ -121,7 +121,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) { this->songObserverFunc = ObjTimeblock_WaitForOcarina; - Actor_SetHeight(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height); + Actor_SetFocus(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height); this->unk_174 = (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) ? true : false; this->unk_175 = ((this->dyna.actor.params >> 15) & 1) ? true : false; @@ -137,7 +137,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) { // "Block of time" osSyncPrintf("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params, - this->unk_177, this->dyna.actor.initPosRot.rot.z & 7, (this->dyna.actor.params >> 11) & 7, + this->unk_177, this->dyna.actor.home.rot.z & 7, (this->dyna.actor.params >> 11) & 7, (this->dyna.actor.params >> 10) & 1); } @@ -153,11 +153,11 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, GlobalContext* globalCtx) { return false; } - if (this->dyna.actor.xzDistToLink <= sRanges[(this->dyna.actor.params >> 11) & 7]) { + if (this->dyna.actor.xzDistToPlayer <= sRanges[(this->dyna.actor.params >> 11) & 7]) { Vec3f distance; f32 blockSize; - func_8002DBD0(&this->dyna.actor, &distance, &PLAYER->actor.posRot.pos); + func_8002DBD0(&this->dyna.actor, &distance, &PLAYER->actor.world.pos); blockSize = this->dyna.actor.scale.x * 50.0f + 6.0f; // Return true if player's xz position is not inside the block if (blockSize < fabsf(distance.x) || blockSize < fabsf(distance.z)) { @@ -333,7 +333,7 @@ void ObjTimeblock_Update(Actor* thisx, GlobalContext* globalCtx) { void ObjTimeblock_Draw(Actor* thisx, GlobalContext* globalCtx) { if (((ObjTimeblock*)thisx)->isVisible) { - Color_RGB8* primColor = &sPrimColors[thisx->initPosRot.rot.z & 7]; + Color_RGB8* primColor = &sPrimColors[thisx->home.rot.z & 7]; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_timeblock.c", 762); 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 55bcf88b4e..f0c097cf92 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -17,7 +17,7 @@ void ObjTsubo_Update(Actor* thisx, GlobalContext* globalCtx); /* const ActorInit Obj_Tsubo_InitVars = { ACTOR_OBJ_TSUBO, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjTsubo), 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 247127a54d..fabaf2dc32 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -34,7 +34,7 @@ extern UNK_TYPE D_06000B30; /* const ActorInit Obj_Warp2block_InitVars = { ACTOR_OBJ_WARP2BLOCK, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_TIMEBLOCK, sizeof(ObjWarp2block), 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 8ca5397443..ed8dc8753a 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -28,7 +28,7 @@ extern UNK_TYPE D_06009620; /* const ActorInit Object_Kankyo_InitVars = { ACTOR_OBJECT_KANKYO, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ObjectKankyo), 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 0b3521a620..31b16fdee1 100644 --- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -20,7 +20,7 @@ void OceffSpot_GrowCylinder(OceffSpot* this, GlobalContext* globalCtx); const ActorInit Oceff_Spot_InitVars = { ACTOR_OCEFF_SPOT, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffSpot), @@ -48,12 +48,12 @@ void OceffSpot_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); OceffSpot_SetupAction(this, OceffSpot_GrowCylinder); - Lights_PointNoGlowSetInfo(&this->lightInfo1, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo1, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->lightNode1 = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo1); - Lights_PointNoGlowSetInfo(&this->lightInfo2, this->actor.posRot.pos.x, this->actor.posRot.pos.y, - this->actor.posRot.pos.z, 0, 0, 0, 0); + Lights_PointNoGlowSetInfo(&this->lightInfo2, this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, 0, 0, 0); this->lightNode2 = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo2); if (YREG(15)) { this->actor.scale.y = 2.4f; @@ -72,7 +72,7 @@ void OceffSpot_Destroy(Actor* thisx, GlobalContext* globalCtx) { LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode1); LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode2); func_800876C8(globalCtx); - if ((gSaveContext.nayrusLoveTimer != 0) && (globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].length != 0)) { + if ((gSaveContext.nayrusLoveTimer != 0) && (globalCtx->actorCtx.actorLists[ACTORCAT_PLAYER].length != 0)) { player->stateFlags3 |= 0x40; } } @@ -129,20 +129,20 @@ void OceffSpot_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.scale.z = 0.42f * temp; this->actor.scale.x = 0.42f * temp; - this->actor.posRot.pos = player->actor.posRot.pos; - this->actor.posRot.pos.y += 5.0f; + this->actor.world.pos = player->actor.world.pos; + this->actor.world.pos.y += 5.0f; temp = (2.0f - this->unk_174) * this->unk_174; func_800773A8(globalCtx, temp * 0.5F, 880.0f, 0.2f, 0.9f); - Lights_PointNoGlowSetInfo(&this->lightInfo1, (s16)this->actor.posRot.pos.x, (s16)this->actor.posRot.pos.y + 55.0f, - (s16)this->actor.posRot.pos.z, (s32)(255.0f * temp), (s32)(255.0f * temp), + Lights_PointNoGlowSetInfo(&this->lightInfo1, (s16)this->actor.world.pos.x, (s16)this->actor.world.pos.y + 55.0f, + (s16)this->actor.world.pos.z, (s32)(255.0f * temp), (s32)(255.0f * temp), (s32)(200.0f * temp), (s16)(100.0f * temp)); Lights_PointNoGlowSetInfo(&this->lightInfo2, - (s16)this->actor.posRot.pos.x + Math_SinS(player->actor.shape.rot.y) * 20.0f, - (s16)this->actor.posRot.pos.y + 20.0f, - (s16)this->actor.posRot.pos.z + Math_CosS(player->actor.shape.rot.y) * 20.0f, + (s16)this->actor.world.pos.x + Math_SinS(player->actor.shape.rot.y) * 20.0f, + (s16)this->actor.world.pos.y + 20.0f, + (s16)this->actor.world.pos.z + Math_CosS(player->actor.shape.rot.y) * 20.0f, (s32)(255.0f * temp), (s32)(255.0f * temp), (s32)(200.0f * temp), (s16)(100.0f * temp)); } 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 0419b964e4..c219a8239f 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -22,7 +22,7 @@ void OceffStorm_UnkAction(OceffStorm* this, GlobalContext* globalCtx); const ActorInit Oceff_Storm_InitVars = { ACTOR_OCEFF_STORM, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffStorm), @@ -54,8 +54,8 @@ void OceffStorm_Init(Actor* thisx, GlobalContext* globalCtx) { OceffStorm_SetupAction(this, OceffStorm_UnkAction); this->actor.draw = OceffStorm_Draw2; } else { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OKARINA_EFFECT, this->actor.posRot.pos.x, - this->actor.posRot.pos.y - 30.0f, this->actor.posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OKARINA_EFFECT, this->actor.world.pos.x, + this->actor.world.pos.y - 30.0f, this->actor.world.pos.z, 0, 0, 0, 1); } } @@ -96,7 +96,7 @@ void OceffStorm_DefaultAction(OceffStorm* this, GlobalContext* globalCtx) { } if (this->counter > 60) { - this->actor.posRot.pos.y += this->posYOff * 0.01f; + this->actor.world.pos.y += this->posYOff * 0.01f; this->posYOff += this->posYOffAdd; this->posYOffAdd += 10; } @@ -119,7 +119,7 @@ void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx) { OceffStorm* this = THIS; Player* player = PLAYER; - this->actor.posRot.pos = player->actor.posRot.pos; + this->actor.world.pos = player->actor.world.pos; this->actor.shape.rot.y = Camera_GetCamDirYaw(ACTIVE_CAM); this->actionFunc(this, globalCtx); } 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 1cc40ceb6a..d821665ee5 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -18,7 +18,7 @@ void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe_InitVars = { ACTOR_OCEFF_WIPE, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe), @@ -40,7 +40,7 @@ void OceffWipe_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; osSyncPrintf(VT_FGCOL(CYAN) " WIPE arg_data = %d\n" VT_RST, this->actor.params); } @@ -57,7 +57,7 @@ void OceffWipe_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe* this = THIS; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 100) { this->counter++; } else { 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 7e0b81107d..8289661391 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -18,7 +18,7 @@ void OceffWipe2_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe2_InitVars = { ACTOR_OCEFF_WIPE2, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe2), @@ -34,7 +34,7 @@ void OceffWipe2_Init(Actor* thisx, GlobalContext* globalCtx) { OceffWipe2* this = THIS; Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; osSyncPrintf(VT_FGCOL(CYAN) " WIPE2 arg_data = %d\n" VT_RST, this->actor.params); } @@ -50,7 +50,7 @@ void OceffWipe2_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe2_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe2* this = THIS; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 100) { this->counter++; } else { 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 6d33abc9c2..47fdd66a52 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -18,7 +18,7 @@ void OceffWipe3_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe3_InitVars = { ACTOR_OCEFF_WIPE3, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe3), @@ -34,7 +34,7 @@ void OceffWipe3_Init(Actor* thisx, GlobalContext* globalCtx) { OceffWipe3* this = THIS; Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; // it's actually WIPE3... osSyncPrintf(VT_FGCOL(CYAN) " WIPE2 arg_data = %d\n" VT_RST, this->actor.params); } @@ -51,7 +51,7 @@ void OceffWipe3_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe3_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe3* this = THIS; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 100) { this->counter++; } else { 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 b51872f64d..94c337f432 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -18,7 +18,7 @@ void OceffWipe4_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Oceff_Wipe4_InitVars = { ACTOR_OCEFF_WIPE4, - ACTORTYPE_ITEMACTION, + ACTORCAT_ITEMACTION, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(OceffWipe4), @@ -35,7 +35,7 @@ void OceffWipe4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.1f); this->counter = 0; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; osSyncPrintf(VT_FGCOL(CYAN) " WIPE4 arg_data = %d\n" VT_RST, this->actor.params); } @@ -48,7 +48,7 @@ void OceffWipe4_Destroy(Actor* thisx, GlobalContext* globalCtx) { void OceffWipe4_Update(Actor* thisx, GlobalContext* globalCtx) { OceffWipe4* this = THIS; - this->actor.posRot.pos = ACTIVE_CAM->eye; + this->actor.world.pos = ACTIVE_CAM->eye; if (this->counter < 50) { this->counter++; } else { 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 d7c6261165..338c9aeb77 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -25,7 +25,7 @@ extern CutsceneData D_02007020[]; const ActorInit Shot_Sun_InitVars = { ACTOR_SHOT_SUN, - ACTORTYPE_PROP, + ACTORCAT_PROP, FLAGS, OBJECT_GAMEPLAY_KEEP, sizeof(ShotSun), @@ -104,19 +104,19 @@ void ShotSun_SpawnFairy(ShotSun* this, GlobalContext* globalCtx) { } //! @bug fairyType may be uninitialized - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, 0, 0, 0, fairyType); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, this->actor.home.pos.x, this->actor.home.pos.y, + this->actor.home.pos.z, 0, 0, 0, fairyType); Actor_Kill(&this->actor); } void ShotSun_TriggerFairy(ShotSun* this, GlobalContext* globalCtx) { - if ((func_8005B198() == this->actor.type) || (this->timer != 0)) { + if ((func_8005B198() == this->actor.category) || (this->timer != 0)) { this->actionFunc = ShotSun_SpawnFairy; this->timer = 50; - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->actor.initPosRot.pos.x, - this->actor.initPosRot.pos.y, this->actor.initPosRot.pos.z, 0, 0, 0, 0x11); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_KANKYO, this->actor.home.pos.x, this->actor.home.pos.y, + this->actor.home.pos.z, 0, 0, 0, 0x11); func_80078914(&this->actor.projectedPos, NA_SE_EV_TRE_BOX_APPEAR); } @@ -127,7 +127,7 @@ void func_80BADF0C(ShotSun* this, GlobalContext* globalCtx) { s32 pad; s32 params = this->actor.params & 0xFF; - if (Math3D_Vec3fDistSq(&this->actor.posRot.pos, &player->actor.posRot.pos) > 22500.0f) { + if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > 22500.0f) { this->unk_1A4 = 0; } else { if (this->unk_1A4 == 0) { @@ -186,7 +186,7 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) { } Actor_Kill(&this->actor); } else { - if (!(120.0f < this->actor.xzDistToLink) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) { + if (!(120.0f < this->actor.xzDistToPlayer) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) { cylinderPos.x = player->bodyPartsPos[7].x + globalCtx->envCtx.unk_04.x * 0.16666667f; cylinderPos.y = player->bodyPartsPos[7].y - 30.0f + globalCtx->envCtx.unk_04.y * 0.16666667f; cylinderPos.z = player->bodyPartsPos[7].z + globalCtx->envCtx.unk_04.z * 0.16666667f; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 35c55aa61e..d11c43c2b9 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1294,7 +1294,7 @@ void func_80832440(GlobalContext* globalCtx, Player* this) { this->stateFlags2 &= ~0x40090; this->actor.shape.rot.x = 0; - this->actor.shape.unk_08 = 0.0f; + this->actor.shape.yOffset = 0.0f; this->unk_845 = this->unk_844 = 0; } @@ -1332,13 +1332,13 @@ void func_80832630(GlobalContext* globalCtx) { } void func_8083264C(Player* this, s32 arg1, s32 arg2, s32 arg3, s32 arg4) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_800AA000(arg4, arg1, arg2, arg3); } } void func_80832698(Player* this, u16 sfxId) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_8002F7DC(&this->actor, sfxId + this->ageProperties->unk_92); } else { func_800F4190(&this->actor.projectedPos, sfxId); @@ -1523,15 +1523,15 @@ void func_80832E48(Player* this, s32 flags) { pos.x *= 0.64f; pos.z *= 0.64f; } - this->actor.posRot.pos.x += pos.x * this->actor.scale.x; - this->actor.posRot.pos.z += pos.z * this->actor.scale.z; + this->actor.world.pos.x += pos.x * this->actor.scale.x; + this->actor.world.pos.z += pos.z * this->actor.scale.z; } if (flags & 2) { if (!(flags & 4)) { pos.y *= this->ageProperties->unk_08; } - this->actor.posRot.pos.y += pos.y * this->actor.scale.y; + this->actor.world.pos.y += pos.y * this->actor.scale.y; } func_808322FC(this); @@ -1783,7 +1783,7 @@ void func_808337D4(GlobalContext* globalCtx, Player* this) { explosiveInfo = &sExplosiveInfos[explosiveType]; spawnedActor = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, explosiveInfo->actorId, - this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 0); if (spawnedActor != NULL) { if ((explosiveType != 0) && (globalCtx->bombchuBowlingStatus != 0)) { @@ -1808,8 +1808,8 @@ void func_80833910(GlobalContext* globalCtx, Player* this) { this->unk_860 = -3; this->heldActor = - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_ARMS_HOOK, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, 0); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_ARMS_HOOK, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 0); } void func_80833984(GlobalContext* globalCtx, Player* this) { @@ -2030,7 +2030,7 @@ void func_808340DC(Player* this, GlobalContext* globalCtx) { } void func_80834298(Player* this, GlobalContext* globalCtx) { - if ((this->actor.type == ACTORTYPE_PLAYER) && !(this->stateFlags1 & 0x100) && + if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & 0x100) && ((this->heldItemActionParam == this->itemActionParam) || (this->stateFlags1 & 0x400000)) && (gSaveContext.health != 0) && (globalCtx->csCtx.state == 0) && (this->csMode == 0) && (globalCtx->shootingGalleryStatus == 0) && (globalCtx->activeCamera == 0) && @@ -2092,8 +2092,8 @@ s32 func_8083442C(Player* this, GlobalContext* globalCtx) { } this->heldActor = Actor_SpawnAsChild( - &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ARROW, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, this->actor.shape.rot.y, 0, arrowType); + &globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ARROW, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, arrowType); } } } @@ -2511,7 +2511,7 @@ void func_808355DC(Player* this) { this->stateFlags1 |= 0x20000; if (!(this->skelAnime.moveFlags & 0x80) && (this->actor.bgCheckFlags & 0x200) && (D_80853608 < 0x2000)) { - this->currentYaw = this->actor.shape.rot.y = this->actor.wallPolyRot + 0x8000; + this->currentYaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; } this->targetYaw = this->actor.shape.rot.y; @@ -2553,7 +2553,7 @@ s32 func_808356E8(Player* this, GlobalContext* globalCtx) { if ((heldActor->id == ACTOR_EN_NIW) && (this->actor.velocity.y <= 0.0f)) { this->actor.minVelocityY = -2.0f; this->actor.gravity = -0.5f; - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; } return 1; @@ -2617,12 +2617,12 @@ s32 func_808359FC(Player* this, GlobalContext* globalCtx) { func_80833638(this, func_80835B60); this->unk_834 = 0; } else if (LinkAnimation_OnFrame(&this->skelAnime2, 6.0f)) { - f32 posX = (Math_SinS(this->actor.shape.rot.y) * 10.0f) + this->actor.posRot.pos.x; - f32 posZ = (Math_CosS(this->actor.shape.rot.y) * 10.0f) + this->actor.posRot.pos.z; + f32 posX = (Math_SinS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.x; + f32 posZ = (Math_CosS(this->actor.shape.rot.y) * 10.0f) + this->actor.world.pos.z; s32 yaw = (this->unk_664 != NULL) ? this->actor.shape.rot.y + 14000 : this->actor.shape.rot.y; EnBoom* boomerang = - (EnBoom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOOM, posX, this->actor.posRot.pos.y + 30.0f, - posZ, this->actor.posRot2.rot.x, yaw, 0, 0); + (EnBoom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOOM, posX, this->actor.world.pos.y + 30.0f, + posZ, this->actor.focus.rot.x, yaw, 0, 0); this->boomerangActor = &boomerang->actor; if (boomerang != NULL) { @@ -2771,7 +2771,7 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) { ((actionParam == PLAYER_AP_BEAN) && (AMMO(ITEM_BEAN) == 0)) || (temp = Player_ActionToExplosive(this, actionParam), ((temp >= 0) && ((AMMO(sExplosiveInfos[temp].itemId) == 0) || - (globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].length >= 3)))))) { + (globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3)))))) { func_80078884(NA_SE_SY_ERROR); return; } @@ -2871,7 +2871,7 @@ void func_80836448(GlobalContext* globalCtx, Player* this, LinkAnimationHeader* func_80832224(this); func_80832698(this, NA_SE_VO_LI_DOWN); - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_800F47BC(); if (Inventory_ConsumeFairy(globalCtx)) { @@ -2955,9 +2955,9 @@ void func_808368EC(Player* this, GlobalContext* globalCtx) { if (!(this->stateFlags2 & 0x60)) { if ((this->unk_664 != NULL) && - ((globalCtx->actorCtx.targetCtx.unk_4B != 0) || (this->actor.type != ACTORTYPE_PLAYER))) { + ((globalCtx->actorCtx.targetCtx.unk_4B != 0) || (this->actor.category != ACTORCAT_PLAYER))) { Math_ScaledStepToS(&this->actor.shape.rot.y, - Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_664->posRot2.pos), 4000); + Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos), 4000); } else if ((this->stateFlags1 & 0x20000) && !(this->stateFlags2 & 0x60)) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->targetYaw, 4000); } @@ -2994,17 +2994,16 @@ s32 func_80836AB8(Player* this, s32 arg1) { var = this->actor.shape.rot.y; if (arg1 != 0) { - var = this->actor.posRot2.rot.y; - this->unk_6BC = this->actor.posRot2.rot.x; + var = this->actor.focus.rot.y; + this->unk_6BC = this->actor.focus.rot.x; this->unk_6AE |= 0x41; } else { - func_808369C8( - &this->unk_6BC, - func_808369C8(&this->unk_6B6, this->actor.posRot2.rot.x, 600, 10000, this->actor.posRot2.rot.x, 0), 200, - 4000, this->unk_6B6, 10000); - sp36 = this->actor.posRot2.rot.y - var; + func_808369C8(&this->unk_6BC, + func_808369C8(&this->unk_6B6, this->actor.focus.rot.x, 600, 10000, this->actor.focus.rot.x, 0), + 200, 4000, this->unk_6B6, 10000); + sp36 = this->actor.focus.rot.y - var; func_808369C8(&sp36, 0, 200, 24000, this->unk_6BE, 8000); - var = this->actor.posRot2.rot.y - sp36; + var = this->actor.focus.rot.y - sp36; func_808369C8(&this->unk_6B8, sp36 - this->unk_6BE, 200, 8000, sp36, 8000); func_808369C8(&this->unk_6BE, sp36, 200, 8000, this->unk_6B8, 8000); this->unk_6AE |= 0xD9; @@ -3051,17 +3050,17 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { ((this->heldItemActionParam != PLAYER_AP_FISHING_POLE) || (this->unk_860 == 0)) && CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { actorToTarget = globalCtx->actorCtx.targetCtx.arrowPointedActor; } else { actorToTarget = &PLAYER->actor; } - holdTarget = (gSaveContext.zTargetSetting != 0) || (this->actor.type != ACTORTYPE_PLAYER); + holdTarget = (gSaveContext.zTargetSetting != 0) || (this->actor.category != ACTORCAT_PLAYER); this->stateFlags1 |= 0x8000; if ((actorToTarget != NULL) && !(actorToTarget->flags & 0x8000000)) { - if ((actorToTarget == this->unk_664) && (this->actor.type == ACTORTYPE_PLAYER)) { + if ((actorToTarget == this->unk_664) && (this->actor.category == ACTORCAT_PLAYER)) { actorToTarget = globalCtx->actorCtx.targetCtx.unk_94; } @@ -3087,12 +3086,12 @@ void func_80836BEC(Player* this, GlobalContext* globalCtx) { } if (this->unk_664 != NULL) { - if ((this->actor.type == ACTORTYPE_PLAYER) && (this->unk_664 != this->unk_684) && + if ((this->actor.category == ACTORCAT_PLAYER) && (this->unk_664 != this->unk_684) && func_8002F0C8(this->unk_664, this, sp1C)) { func_8008EDF0(this); this->stateFlags1 |= 0x40000000; } else if (this->unk_664 != NULL) { - this->unk_664->unk_10D = 40; + this->unk_664->targetPriority = 40; } } else if (this->unk_684 != NULL) { this->unk_664 = this->unk_684; @@ -3173,7 +3172,7 @@ s32 func_80837268(Player* this, f32* arg1, s16* arg2, f32 arg3, GlobalContext* g if (this->unk_664 != NULL) { if ((globalCtx->actorCtx.targetCtx.unk_4B != 0) && !(this->stateFlags2 & 0x40)) { - *arg2 = Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_664->posRot2.pos); + *arg2 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_664->focus.pos); return 0; } } else if (func_80833B2C(this)) { @@ -3263,7 +3262,7 @@ void func_80837530(GlobalContext* globalCtx, Player* this, s32 arg2) { this->stateFlags1 |= 0x1000; - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_M_THUNDER, this->bodyPartsPos[0].x, this->bodyPartsPos[0].y, this->bodyPartsPos[0].z, 0, 0, 0, Player_GetSwordHeld(this) | arg2); } @@ -3445,7 +3444,7 @@ void func_80837AFC(Player* this, s32 timer) { } s32 func_80837B18(GlobalContext* globalCtx, Player* this, s32 damage) { - if ((this->invincibilityTimer != 0) || (this->actor.type != ACTORTYPE_PLAYER)) { + if ((this->invincibilityTimer != 0) || (this->actor.category != ACTORCAT_PLAYER)) { return 1; } @@ -3551,7 +3550,7 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f sp2C = &D_04002DB0; } - if ((this->actor.type != ACTORTYPE_PLAYER) && (this->actor.colChkInfo.health == 0)) { + if ((this->actor.category != ACTORCAT_PLAYER) && (this->actor.colChkInfo.health == 0)) { func_80832698(this, NA_SE_VO_BL_DOWN); } else { func_80832698(this, NA_SE_VO_LI_FALL_L); @@ -3596,7 +3595,7 @@ void func_80837C0C(GlobalContext* globalCtx, Player* this, s32 arg2, f32 arg3, f this->actor.shape.rot.y += arg5; this->currentYaw = this->actor.shape.rot.y; - this->actor.posRot.rot.y = this->actor.shape.rot.y; + this->actor.world.rot.y = this->actor.shape.rot.y; if (ABS(arg5) > 0x4000) { this->actor.shape.rot.y += 0x8000; } @@ -3627,8 +3626,8 @@ s32 func_8083816C(s32 arg0) { void func_8083819C(Player* this, GlobalContext* globalCtx) { if (this->currentShield == PLAYER_SHIELD_DEKU) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_SHIELD, this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 1); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ITEM_SHIELD, this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1); Inventory_DeleteEquipment(globalCtx, EQUIP_SHIELD); func_8010B680(globalCtx, 0x305F, NULL); // "Your shield is gone!" } @@ -3788,7 +3787,7 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { sp4C = 0; } - func_80837C0C(globalCtx, this, sp4C, 4.0f, 5.0f, func_8002DA78(ac, &this->actor), 20); + func_80837C0C(globalCtx, this, sp4C, 4.0f, 5.0f, Actor_WorldYawTowardActor(ac, &this->actor), 20); } else if (this->invincibilityTimer != 0) { return 0; } else { @@ -3796,9 +3795,9 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { s32 sp48 = func_80838144(D_808535E4); if (((this->actor.wallPoly != NULL) && - SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource)) || + SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) || ((sp48 >= 0) && - SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource) && + SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) && (this->unk_A79 >= D_808544F4[sp48])) || ((sp48 >= 0) && ((this->currentTunic != PLAYER_TUNIC_GORON) || (this->unk_A79 >= D_808544F4[sp48])))) { @@ -3862,7 +3861,7 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { return 0; } - if ((this->actor.wallPolySource != BGCHECK_SCENE) && (D_808535F0 & 0x40)) { + if ((this->actor.wallBgId != BGCHECK_SCENE) && (D_808535F0 & 0x40)) { if (this->unk_88D >= 6) { this->stateFlags2 |= 4; if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { @@ -3902,11 +3901,11 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { sp34 -= (41.0f * this->ageProperties->unk_08); } - this->actor.shape.unk_08 -= sp34 * 100.0f; + this->actor.shape.yOffset -= sp34 * 100.0f; - this->actor.posRot.pos.x -= sp24 * sp2C; - this->actor.posRot.pos.y += this->wallHeight; - this->actor.posRot.pos.z -= sp24 * sp28; + this->actor.world.pos.x -= sp24 * sp2C; + this->actor.world.pos.y += this->wallHeight; + this->actor.world.pos.z -= sp24 * sp28; func_80832224(this); } @@ -3916,7 +3915,7 @@ s32 func_80838A14(Player* this, GlobalContext* globalCtx) { LinkAnimation_PlayOnceSetSpeed(globalCtx, &this->skelAnime, sp38, 1.3f); AnimationContext_DisableQueue(globalCtx); - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; return 1; } @@ -3938,8 +3937,8 @@ void func_80838E70(GlobalContext* globalCtx, Player* this, f32 arg2, s16 arg3) { this->unk_84F = 1; this->unk_850 = 1; - this->unk_450.x = (Math_SinS(arg3) * arg2) + this->actor.posRot.pos.x; - this->unk_450.z = (Math_CosS(arg3) * arg2) + this->actor.posRot.pos.z; + this->unk_450.x = (Math_SinS(arg3) * arg2) + this->actor.world.pos.x; + this->unk_450.z = (Math_CosS(arg3) * arg2) + this->actor.world.pos.z; func_80832264(globalCtx, this, func_80833338(this)); } @@ -3984,7 +3983,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s if (1) {} - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { sp3C = 0; if (!(this->stateFlags1 & 0x80) && (globalCtx->sceneLoadFlag == 0) && (this->csMode == 0) && @@ -3992,7 +3991,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s (((poly != NULL) && (sp3C = SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, poly, bgId), sp3C != 0)) || (func_8083816C(D_808535E4) && (this->unk_A7A == 12)))) { - sp34 = this->unk_A84 - (s32)this->actor.posRot.pos.y; + sp34 = this->unk_A84 - (s32)this->actor.world.pos.y; if (!(this->stateFlags1 & 0x28800000) && !(this->actor.bgCheckFlags & 1) && (sp34 < 100) && (D_80853600 > 100.0f)) { @@ -4038,7 +4037,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s linearVel = this->linearVelocity; if (linearVel < 0.0f) { - this->actor.posRot.rot.y += 0x8000; + this->actor.world.rot.y += 0x8000; linearVel = -linearVel; } @@ -4051,7 +4050,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s if (D_808535F4 != 0) { yaw = D_808535FC; } else { - yaw = this->actor.posRot.rot.y; + yaw = this->actor.world.rot.y; } func_80838E70(globalCtx, this, 400.0f, yaw); } @@ -4069,7 +4068,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s } else { if (globalCtx->sceneLoadFlag == 0) { - if ((this->actor.posRot.pos.y < -4000.0f) || + if ((this->actor.world.pos.y < -4000.0f) || (((this->unk_A7A == 5) || (this->unk_A7A == 12)) && ((D_80853600 < 100.0f) || (this->fallDistance > 400.0f) || ((globalCtx->sceneNum != SCENE_HAKADAN) && (this->fallDistance > 200.0f)))) || @@ -4094,7 +4093,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, s } } - this->unk_A84 = this->actor.posRot.pos.y; + this->unk_A84 = this->actor.world.pos.y; } } } @@ -4120,7 +4119,7 @@ Actor* Player_SpawnFairy(GlobalContext* globalCtx, Player* this, Vec3f* arg2, Ve } f32 func_808396F4(GlobalContext* globalCtx, Player* this, Vec3f* arg2, Vec3f* arg3, CollisionPoly** arg4, s32* arg5) { - func_808395DC(this, &this->actor.posRot.pos, arg2, arg3); + func_808395DC(this, &this->actor.world.pos, arg2, arg3); return BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, arg4, arg5, arg3); } @@ -4136,11 +4135,11 @@ s32 func_80839768(GlobalContext* globalCtx, Player* this, Vec3f* arg2, Collision Vec3f sp44; Vec3f sp38; - sp44.x = this->actor.posRot.pos.x; - sp44.y = this->actor.posRot.pos.y + arg2->y; - sp44.z = this->actor.posRot.pos.z; + sp44.x = this->actor.world.pos.x; + sp44.y = this->actor.world.pos.y + arg2->y; + sp44.z = this->actor.world.pos.z; - func_808395DC(this, &this->actor.posRot.pos, arg2, &sp38); + func_808395DC(this, &this->actor.world.pos, arg2, &sp38); return BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp44, &sp38, arg5, arg3, 1, 0, 0, 1, arg4); } @@ -4178,7 +4177,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { if (this->doorType == 2) { doorShutter = (DoorShutter*)doorActor; - this->currentYaw = doorShutter->dyna.actor.initPosRot.rot.y; + this->currentYaw = doorShutter->dyna.actor.home.rot.y; if (sp7C > 0) { this->currentYaw -= 0x8000; } @@ -4194,10 +4193,10 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { this->unk_447 = this->doorType; this->stateFlags1 |= 0x20000000; - this->unk_450.x = this->actor.posRot.pos.x + ((sp7C * 20.0f) * sp74); - this->unk_450.z = this->actor.posRot.pos.z + ((sp7C * 20.0f) * sp78); - this->unk_45C.x = this->actor.posRot.pos.x + ((sp7C * -120.0f) * sp74); - this->unk_45C.z = this->actor.posRot.pos.z + ((sp7C * -120.0f) * sp78); + this->unk_450.x = this->actor.world.pos.x + ((sp7C * 20.0f) * sp74); + this->unk_450.z = this->actor.world.pos.z + ((sp7C * 20.0f) * sp78); + this->unk_45C.x = this->actor.world.pos.x + ((sp7C * -120.0f) * sp74); + this->unk_45C.z = this->actor.world.pos.z + ((sp7C * -120.0f) * sp78); doorShutter->unk_164 = 1; func_80832224(this); @@ -4210,7 +4209,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { this->linearVelocity = 0.1f; } - if (doorShutter->dyna.actor.type == ACTORTYPE_DOOR) { + if (doorShutter->dyna.actor.category == ACTORCAT_DOOR) { this->unk_46A = globalCtx->transitionActorList[(u16)doorShutter->dyna.actor.params >> 10] .sides[(sp7C > 0) ? 0 : 1] .effects; @@ -4244,8 +4243,8 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { this->currentYaw = this->actor.shape.rot.y; sp6C = (sp7C * 22.0f); - this->actor.posRot.pos.x = doorActor->posRot.pos.x + sp6C * sp74; - this->actor.posRot.pos.z = doorActor->posRot.pos.z + sp6C * sp78; + this->actor.world.pos.x = doorActor->world.pos.x + sp6C * sp74; + this->actor.world.pos.z = doorActor->world.pos.z + sp6C * sp78; func_8083328C(globalCtx, this, sp5C); @@ -4267,9 +4266,9 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { func_800304B0(globalCtx); if (((doorActor->params >> 7) & 7) == 3) { - sp4C.x = doorActor->posRot.pos.x - (sp6C * sp74); - sp4C.y = doorActor->posRot.pos.y + 10.0f; - sp4C.z = doorActor->posRot.pos.z - (sp6C * sp78); + sp4C.x = doorActor->world.pos.x - (sp6C * sp74); + sp4C.y = doorActor->world.pos.y + 10.0f; + sp4C.z = doorActor->world.pos.z - (sp6C * sp78); BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &sp58, &sp4C); @@ -4287,7 +4286,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { } } - if ((this->doorType != 3) && (doorActor->type == ACTORTYPE_DOOR)) { + if ((this->doorType != 3) && (doorActor->category == ACTORCAT_DOOR)) { frontRoom = globalCtx->transitionActorList[(u16)doorActor->params >> 10].sides[(sp7C > 0) ? 0 : 1].room; if ((frontRoom >= 0) && (frontRoom != globalCtx->roomCtx.curRoom.num)) { @@ -4394,11 +4393,11 @@ void func_8083A0F4(GlobalContext* globalCtx, Player* this) { } else if (((interactActorId == ACTOR_EN_BOMBF) || (interactActorId == ACTOR_EN_KUSA)) && (Player_GetStrength() <= PLAYER_STR_NONE)) { func_80835C58(globalCtx, this, func_80846408, 0); - this->actor.posRot.pos.x = - (Math_SinS(interactRangeActor->yawTowardsLink) * 20.0f) + interactRangeActor->posRot.pos.x; - this->actor.posRot.pos.z = - (Math_CosS(interactRangeActor->yawTowardsLink) * 20.0f) + interactRangeActor->posRot.pos.z; - this->currentYaw = this->actor.shape.rot.y = interactRangeActor->yawTowardsLink + 0x8000; + this->actor.world.pos.x = + (Math_SinS(interactRangeActor->yawTowardsPlayer) * 20.0f) + interactRangeActor->world.pos.x; + this->actor.world.pos.z = + (Math_CosS(interactRangeActor->yawTowardsPlayer) * 20.0f) + interactRangeActor->world.pos.z; + this->currentYaw = this->actor.shape.rot.y = interactRangeActor->yawTowardsPlayer + 0x8000; anim = &D_04003060; } else { func_80835C58(globalCtx, this, func_80846050, 0); @@ -4494,8 +4493,8 @@ void func_8083A5C4(GlobalContext* globalCtx, Player* this, CollisionPoly* arg2, func_80832564(globalCtx, this); func_80832264(globalCtx, this, arg4); - this->actor.posRot.pos.x -= (arg3 + 1.0f) * sp24; - this->actor.posRot.pos.z -= (arg3 + 1.0f) * sp20; + this->actor.world.pos.x -= (arg3 + 1.0f) * sp24; + this->actor.world.pos.z -= (arg3 + 1.0f) * sp20; this->actor.shape.rot.y = this->currentYaw = Math_Atan2S(sp20, sp24); func_80832224(this); @@ -4510,8 +4509,8 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { f32 temp1; if ((this->actor.yDistToWater < -80.0f) && (ABS(this->unk_898) < 2730) && (ABS(this->unk_89A) < 2730)) { - sp74.x = this->actor.pos4.x - this->actor.posRot.pos.x; - sp74.z = this->actor.pos4.z - this->actor.posRot.pos.z; + sp74.x = this->actor.prevPos.x - this->actor.world.pos.x; + sp74.z = this->actor.prevPos.z - this->actor.world.pos.z; temp1 = sqrtf(SQ(sp74.x) + SQ(sp74.z)); if (temp1 != 0.0f) { @@ -4520,11 +4519,11 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { temp1 = 0.0f; } - sp74.x = this->actor.pos4.x + (sp74.x * temp1); - sp74.y = this->actor.posRot.pos.y; - sp74.z = this->actor.pos4.z + (sp74.z * temp1); + sp74.x = this->actor.prevPos.x + (sp74.x * temp1); + sp74.y = this->actor.world.pos.y; + sp74.z = this->actor.prevPos.z + (sp74.z * temp1); - if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.posRot.pos, &sp74, &sp68, &sp84, 1, 0, 0, 1, + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp74, &sp68, &sp84, 1, 0, 0, 1, &sp80) && (ABS(sp84->normal.y) < 600)) { f32 nx = COLPOLY_GET_NORMAL(sp84->normal.x); @@ -4533,7 +4532,7 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { f32 sp54; s32 sp50; - sp54 = Math3D_UDistPlaneToPos(nx, ny, nz, sp84->dist, &this->actor.posRot.pos); + sp54 = Math3D_UDistPlaneToPos(nx, ny, nz, sp84->dist, &this->actor.world.pos); sp50 = D_80853604 == 6; if (!sp50 && (func_80041DB8(&globalCtx->colCtx, sp84, sp80) & 8)) { @@ -4583,13 +4582,13 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { f32 sp40; f32 sp3C; - this->fallDistance = this->fallStartHeight - (s32)this->actor.posRot.pos.y; + this->fallDistance = this->fallStartHeight - (s32)this->actor.world.pos.y; if (!(this->stateFlags1 & 0x28000000) && !(this->actor.bgCheckFlags & 1)) { if (!func_80838FB8(globalCtx, this)) { if (D_80853604 == 8) { - this->actor.posRot.pos.x = this->actor.pos4.x; - this->actor.posRot.pos.z = this->actor.pos4.z; + this->actor.world.pos.x = this->actor.prevPos.x; + this->actor.world.pos.z = this->actor.prevPos.z; return; } @@ -4597,7 +4596,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { (func_80844A44 != this->func_674)) { if ((D_80853604 == 7) || (this->swordState != 0)) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &this->actor.pos4); + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); func_80832210(this); return; } @@ -4622,7 +4621,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { if ((D_80853604 == 11) && !(this->stateFlags1 & 0x800)) { sp40 = func_808396F4(globalCtx, this, &D_8085451C, &sp44, &sp58, &sp54); - sp3C = this->actor.posRot.pos.y; + sp3C = this->actor.world.pos.y; if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, sp44.x, sp44.z, &sp3C, &sp50) && ((sp3C - sp40) > 50.0f)) { @@ -4644,7 +4643,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) { } } } else { - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; } } @@ -4720,10 +4719,10 @@ void func_8083AF44(GlobalContext* globalCtx, Player* this, s32 magicSpell) { } void func_8083B010(Player* this) { - this->actor.posRot2.rot.x = this->actor.posRot2.rot.z = this->unk_6B6 = this->unk_6B8 = this->unk_6BA = - this->unk_6BC = this->unk_6BE = this->unk_6C0 = 0; + this->actor.focus.rot.x = this->actor.focus.rot.z = this->unk_6B6 = this->unk_6B8 = this->unk_6BA = this->unk_6BC = + this->unk_6BE = this->unk_6C0 = 0; - this->actor.posRot2.rot.y = this->actor.shape.rot.y; + this->actor.focus.rot.y = this->actor.shape.rot.y; } u8 D_80854528[] = { @@ -5008,7 +5007,7 @@ void func_8083BA90(GlobalContext* globalCtx, Player* this, s32 arg2, f32 xzVeloc s32 func_8083BB20(Player* this) { if (!(this->stateFlags1 & 0x400000) && (Player_GetSwordHeld(this) != 0)) { if (D_80853614 || - ((this->actor.type != ACTORTYPE_PLAYER) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B))) { + ((this->actor.category != ACTORCAT_PLAYER) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B))) { return 1; } } @@ -5060,12 +5059,12 @@ s32 func_8083BDBC(Player* this, GlobalContext* globalCtx) { if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (globalCtx->roomCtx.curRoom.unk_03 != 2) && (D_808535E4 != 7) && - (SurfaceType_GetSlope(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource) != 1)) { + (SurfaceType_GetSlope(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) != 1)) { sp2C = this->unk_84B[this->unk_846]; if (sp2C <= 0) { if (func_80833BCC(this)) { - if (this->actor.type != ACTORTYPE_PLAYER) { + if (this->actor.category != ACTORCAT_PLAYER) { if (sp2C < 0) { func_808389E8(this, &D_04002FE0, REG(69) / 100.0f, globalCtx); } else { @@ -5281,10 +5280,10 @@ s32 func_8083C6B8(GlobalContext* globalCtx, Player* this) { } if (this->heldItemActionParam == PLAYER_AP_FISHING_POLE) { - sp24 = this->actor.posRot.pos; + sp24 = this->actor.world.pos; sp24.y += 50.0f; - if (!(this->actor.bgCheckFlags & 1) || (this->actor.posRot.pos.z > 1300.0f) || + if (!(this->actor.bgCheckFlags & 1) || (this->actor.world.pos.z > 1300.0f) || BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &sp24, 20.0f)) { func_80078884(NA_SE_SY_ERROR); return 0; @@ -5328,10 +5327,10 @@ s32 func_8083C910(GlobalContext* globalCtx, Player* this, f32 arg2) { WaterBox* sp2C; f32 sp28; - sp28 = this->actor.posRot.pos.y; - if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.posRot.pos.x, this->actor.posRot.pos.z, &sp28, + sp28 = this->actor.world.pos.y; + if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp28, &sp2C) != 0) { - sp28 -= this->actor.posRot.pos.y; + sp28 -= this->actor.world.pos.y; if (this->ageProperties->unk_24 <= sp28) { func_80835C58(globalCtx, this, func_8084D7C4, 0); func_80832C6C(globalCtx, this, &D_040032F0); @@ -5464,9 +5463,9 @@ s32 func_8083CFA8(GlobalContext* globalCtx, Player* this, f32 arg2, s32 splashSc if (sp3C > 2.0f) { splashPos.x = this->bodyPartsPos[0].x; splashPos.z = this->bodyPartsPos[0].z; - sp34 = this->actor.posRot.pos.y; + sp34 = this->actor.world.pos.y; if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, splashPos.x, splashPos.z, &sp34, &sp38)) { - if ((sp34 - this->actor.posRot.pos.y) < 100.0f) { + if ((sp34 - this->actor.world.pos.y) < 100.0f) { splashType = (sp3C <= 10.0f) ? 0 : 1; splashPos.y = sp34; EffectSsGSplash_Spawn(globalCtx, &splashPos, NULL, NULL, splashType, splashScale); @@ -5676,13 +5675,13 @@ void func_8083D6EC(GlobalContext* globalCtx, Player* this) { if (this->unk_854 > 15.0f) { this->unk_854 = 0.0f; - ripplePos.x = (Rand_ZeroOne() * 10.0f) + this->actor.posRot.pos.x; - ripplePos.y = this->actor.posRot.pos.y + this->actor.yDistToWater; - ripplePos.z = (Rand_ZeroOne() * 10.0f) + this->actor.posRot.pos.z; + ripplePos.x = (Rand_ZeroOne() * 10.0f) + this->actor.world.pos.x; + ripplePos.y = this->actor.world.pos.y + this->actor.yDistToWater; + ripplePos.z = (Rand_ZeroOne() * 10.0f) + this->actor.world.pos.z; EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 0); if ((this->linearVelocity > 4.0f) && !func_808332B8(this) && - ((this->actor.posRot.pos.y + this->actor.yDistToWater) < this->bodyPartsPos[0].y)) { + ((this->actor.world.pos.y + this->actor.yDistToWater) < this->bodyPartsPos[0].y)) { func_8083CFA8(globalCtx, this, 20.0f, (fabsf(this->linearVelocity) * 50.0f) + (this->actor.yDistToWater * 5.0f)); } @@ -5702,7 +5701,7 @@ void func_8083D6EC(GlobalContext* globalCtx, Player* this) { } for (i = 0; i < numBubbles; i++) { - EffectSsBubble_Spawn(globalCtx, &this->actor.posRot.pos, 20.0f, 10.0f, 20.0f, 0.13f); + EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 20.0f, 10.0f, 20.0f, 0.13f); } } } @@ -5714,13 +5713,13 @@ s32 func_8083DB98(Player* this, s32 arg1) { s16 sp2E; s16 sp2C; - sp30.x = this->actor.posRot.pos.x; + sp30.x = this->actor.world.pos.x; sp30.y = this->bodyPartsPos[7].y + 3.0f; - sp30.z = this->actor.posRot.pos.z; - sp2E = Math_Vec3f_Pitch(&sp30, &unk_664->posRot2.pos); - sp2C = Math_Vec3f_Yaw(&sp30, &unk_664->posRot2.pos); - Math_SmoothStepToS(&this->actor.posRot2.rot.y, sp2C, 4, 10000, 0); - Math_SmoothStepToS(&this->actor.posRot2.rot.x, sp2E, 4, 10000, 0); + sp30.z = this->actor.world.pos.z; + sp2E = Math_Vec3f_Pitch(&sp30, &unk_664->focus.pos); + sp2C = Math_Vec3f_Yaw(&sp30, &unk_664->focus.pos); + Math_SmoothStepToS(&this->actor.focus.rot.y, sp2C, 4, 10000, 0); + Math_SmoothStepToS(&this->actor.focus.rot.x, sp2E, 4, 10000, 0); this->unk_6AE |= 2; return func_80836AB8(this, arg1); @@ -5744,16 +5743,16 @@ void func_8083DC54(Player* this, GlobalContext* globalCtx) { } if (D_808535E4 == 11) { - Math_SmoothStepToS(&this->actor.posRot2.rot.x, -20000, 10, 4000, 800); + Math_SmoothStepToS(&this->actor.focus.rot.x, -20000, 10, 4000, 800); } else { sp46 = 0; temp1 = func_8083973C(globalCtx, this, &D_8085456C, &sp34); if (temp1 > BGCHECK_Y_MIN) { - temp2 = Math_Atan2S(40.0f, this->actor.posRot.pos.y - temp1); + temp2 = Math_Atan2S(40.0f, this->actor.world.pos.y - temp1); sp46 = CLAMP(temp2, -4000, 4000); } - this->actor.posRot2.rot.y = this->actor.shape.rot.y; - Math_SmoothStepToS(&this->actor.posRot2.rot.x, sp46, 14, 4000, 30); + this->actor.focus.rot.y = this->actor.shape.rot.y; + Math_SmoothStepToS(&this->actor.focus.rot.x, sp46, 14, 4000, 30); } func_80836AB8(this, func_8002DD78(this) || func_808334B4(this)); @@ -5830,12 +5829,12 @@ s32 func_8083E0FC(Player* this, GlobalContext* globalCtx) { unk_04 = D_80854578[temp].unk_04; unk_08 = D_80854578[temp].unk_08; - this->actor.posRot.pos.x = - rideActor->actor.posRot.pos.x + rideActor->unk_258.x + ((unk_04 * sp38) + (unk_08 * sp34)); - this->actor.posRot.pos.z = - rideActor->actor.posRot.pos.z + rideActor->unk_258.z + ((unk_08 * sp38) - (unk_04 * sp34)); + this->actor.world.pos.x = + rideActor->actor.world.pos.x + rideActor->unk_258.x + ((unk_04 * sp38) + (unk_08 * sp34)); + this->actor.world.pos.z = + rideActor->actor.world.pos.z + rideActor->unk_258.z + ((unk_08 * sp38) - (unk_04 * sp34)); - this->unk_878 = rideActor->actor.posRot.pos.y - this->actor.posRot.pos.y; + this->unk_878 = rideActor->actor.world.pos.y - this->actor.world.pos.y; this->currentYaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; func_8002DECC(globalCtx, this, &rideActor->actor); @@ -5873,7 +5872,7 @@ s32 func_8083E318(GlobalContext* globalCtx, Player* this, CollisionPoly* arg2) { s16 temp3; if (!Player_InBlockingCsMode(globalCtx, this) && (func_8084F390 != this->func_674) && - (SurfaceType_GetSlope(&globalCtx->colCtx, arg2, this->actor.floorPolySource) == 1)) { + (SurfaceType_GetSlope(&globalCtx->colCtx, arg2, this->actor.floorBgId) == 1)) { sp4A = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x); func_8083E298(arg2, &sp3C, &sp3A); temp3 = sp3A - sp4A; @@ -5911,7 +5910,7 @@ void func_8083E4C4(GlobalContext* globalCtx, Player* this, GetItemEntry* giEntry s32 sp1C = giEntry->field & 0x1F; if (!(giEntry->field & 0x80)) { - Item_DropCollectible(globalCtx, &this->actor.posRot.pos, sp1C | 0x8000); + Item_DropCollectible(globalCtx, &this->actor.world.pos, sp1C | 0x8000); if ((sp1C != 4) && (sp1C != 8) && (sp1C != 9) && (sp1C != 0xA) && (sp1C != 0) && (sp1C != 1) && (sp1C != 2) && (sp1C != 0x14) && (sp1C != 0x13)) { Item_Give(globalCtx, giEntry->itemId); @@ -5977,10 +5976,10 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) { func_80836898(globalCtx, this, func_8083A434); this->stateFlags1 |= 0x20000C00; func_8083AE40(this, giEntry->objectId); - this->actor.posRot.pos.x = - chest->dyna.actor.posRot.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.434299469f); - this->actor.posRot.pos.z = - chest->dyna.actor.posRot.pos.z - (Math_CosS(chest->dyna.actor.shape.rot.y) * 29.434299469f); + this->actor.world.pos.x = + chest->dyna.actor.world.pos.x - (Math_SinS(chest->dyna.actor.shape.rot.y) * 29.434299469f); + this->actor.world.pos.z = + chest->dyna.actor.world.pos.z - (Math_CosS(chest->dyna.actor.shape.rot.y) * 29.434299469f); this->currentYaw = this->actor.shape.rot.y = chest->dyna.actor.shape.rot.y; func_80832224(this); @@ -6071,7 +6070,7 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { s32 sp8C = (arg2 & 8) ? 2 : 0; if ((sp8C != 0) || (arg2 & 2) || - func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource)) { + func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) { f32 phi_f20; CollisionPoly* sp84 = this->actor.wallPoly; f32 sp80; @@ -6082,8 +6081,8 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { phi_f20 = phi_f12 = 0.0f; if (sp8C != 0) { - sp80 = this->actor.posRot.pos.x; - sp7C = this->actor.posRot.pos.z; + sp80 = this->actor.world.pos.x; + sp7C = this->actor.world.pos.z; } else { Vec3f sp50[3]; s32 i; @@ -6091,7 +6090,7 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { Vec3f* sp44 = &sp50[0]; s32 pad; - CollisionPoly_GetVerticesByBgId(sp84, this->actor.wallPolySource, &globalCtx->colCtx, sp50); + CollisionPoly_GetVerticesByBgId(sp84, this->actor.wallBgId, &globalCtx->colCtx, sp50); sp80 = phi_f12 = sp44->x; sp7C = phi_f14 = sp44->z; @@ -6118,9 +6117,9 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { sp80 = (sp80 + phi_f12) * 0.5f; sp7C = (sp7C + phi_f14) * 0.5f; - phi_f12 = ((this->actor.posRot.pos.x - sp80) * COLPOLY_GET_NORMAL(sp84->normal.z)) - - ((this->actor.posRot.pos.z - sp7C) * COLPOLY_GET_NORMAL(sp84->normal.x)); - sp48 = this->actor.posRot.pos.y - phi_f20; + phi_f12 = ((this->actor.world.pos.x - sp80) * COLPOLY_GET_NORMAL(sp84->normal.z)) - + ((this->actor.world.pos.z - sp7C) * COLPOLY_GET_NORMAL(sp84->normal.x)); + sp48 = this->actor.world.pos.y - phi_f20; phi_f20 = ((f32)(s32)((sp48 / 15.000000223517418) + 0.5) * 15.000000223517418) - sp48; phi_f12 = fabsf(phi_f12); @@ -6149,18 +6148,18 @@ s32 func_8083EC18(Player* this, GlobalContext* globalCtx, u32 arg2) { sp34 = sp34 - 1.0f; } this->unk_850 = -2; - this->actor.posRot.pos.y += phi_f20; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->actor.world.pos.y += phi_f20; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; } else { sp30 = this->ageProperties->unk_A8; this->unk_850 = -4; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw; } - this->actor.posRot.pos.x = (sp34 * sp3C) + sp80; - this->actor.posRot.pos.z = (sp34 * sp38) + sp7C; + this->actor.world.pos.x = (sp34 * sp3C) + sp80; + this->actor.world.pos.z = (sp34 * sp38) + sp7C; func_80832224(this); - Math_Vec3f_Copy(&this->actor.pos4, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.world.pos); func_80832264(globalCtx, this, sp30); func_80832F54(globalCtx, this, 0x9F); @@ -6189,7 +6188,7 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { if (LINK_IS_CHILD && !(this->stateFlags1 & 0x8000000) && (arg2 & 0x30)) { wallPoly = this->actor.wallPoly; - CollisionPoly_GetVerticesByBgId(wallPoly, this->actor.wallPolySource, &globalCtx->colCtx, &sp50); + CollisionPoly_GetVerticesByBgId(wallPoly, this->actor.wallBgId, &globalCtx->colCtx, &sp50); sp4C = phi_f2 = sp50[0].x; sp44 = phi_f12 = sp50[0].z; @@ -6210,8 +6209,8 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { sp4C = (sp4C + phi_f2) * 0.5f; sp44 = (sp44 + phi_f12) * 0.5f; - phi_f2 = ((this->actor.posRot.pos.x - sp4C) * COLPOLY_GET_NORMAL(wallPoly->normal.z)) - - ((this->actor.posRot.pos.z - sp44) * COLPOLY_GET_NORMAL(wallPoly->normal.x)); + phi_f2 = ((this->actor.world.pos.x - sp4C) * COLPOLY_GET_NORMAL(wallPoly->normal.z)) - + ((this->actor.world.pos.z - sp44) * COLPOLY_GET_NORMAL(wallPoly->normal.x)); if (fabsf(phi_f2) < 8.0f) { this->stateFlags2 |= 0x10000; @@ -6223,11 +6222,11 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { func_80836898(globalCtx, this, func_8083A40C); this->stateFlags2 |= 0x40000; - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; - this->actor.posRot.pos.x = sp4C + (sp30 * sp38); - this->actor.posRot.pos.z = sp44 + (sp30 * sp34); + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; + this->actor.world.pos.x = sp4C + (sp30 * sp38); + this->actor.world.pos.z = sp44 + (sp30 * sp34); func_80832224(this); - this->actor.pos4 = this->actor.posRot.pos; + this->actor.prevPos = this->actor.world.pos; func_80832264(globalCtx, this, &D_04002708); func_80832F54(globalCtx, this, 0x9D); @@ -6254,17 +6253,17 @@ s32 func_8083F360(GlobalContext* globalCtx, Player* this, f32 arg1, f32 arg2, f3 yawCos = Math_CosS(this->actor.shape.rot.y); yawSin = Math_SinS(this->actor.shape.rot.y); - sp6C.x = this->actor.posRot.pos.x + (arg4 * yawSin); - sp6C.z = this->actor.posRot.pos.z + (arg4 * yawCos); - sp60.x = this->actor.posRot.pos.x + (arg3 * yawSin); - sp60.z = this->actor.posRot.pos.z + (arg3 * yawCos); - sp60.y = sp6C.y = this->actor.posRot.pos.y + arg1; + sp6C.x = this->actor.world.pos.x + (arg4 * yawSin); + sp6C.z = this->actor.world.pos.z + (arg4 * yawCos); + sp60.x = this->actor.world.pos.x + (arg3 * yawSin); + sp60.z = this->actor.world.pos.z + (arg3 * yawCos); + sp60.y = sp6C.y = this->actor.world.pos.y + arg1; if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp6C, &sp60, &sp54, &this->actor.wallPoly, 1, 0, 0, 1, &sp78)) { wallPoly = this->actor.wallPoly; this->actor.bgCheckFlags |= 0x200; - this->actor.wallPolySource = sp78; + this->actor.wallBgId = sp78; D_808535F0 = func_80041DB8(&globalCtx->colCtx, wallPoly, sp78); @@ -6274,8 +6273,8 @@ s32 func_8083F360(GlobalContext* globalCtx, Player* this, f32 arg1, f32 arg2, f3 Math_ScaledStepToS(&this->actor.shape.rot.y, temp, 800); this->currentYaw = this->actor.shape.rot.y; - this->actor.posRot.pos.x = sp54.x - (Math_SinS(this->actor.shape.rot.y) * arg2); - this->actor.posRot.pos.z = sp54.z - (Math_CosS(this->actor.shape.rot.y) * arg2); + this->actor.world.pos.x = sp54.x - (Math_SinS(this->actor.shape.rot.y) * arg2); + this->actor.world.pos.z = sp54.z - (Math_CosS(this->actor.shape.rot.y) * arg2); return 1; } @@ -6294,7 +6293,7 @@ s32 func_8083F570(Player* this, GlobalContext* globalCtx) { if ((this->linearVelocity != 0.0f) && (this->actor.bgCheckFlags & 8) && (D_808535F0 & 0x30)) { - temp = this->actor.shape.rot.y - this->actor.wallPolyRot; + temp = this->actor.shape.rot.y - this->actor.wallYaw; if (this->linearVelocity < 0.0f) { temp += 0x8000; } @@ -6303,12 +6302,12 @@ s32 func_8083F570(Player* this, GlobalContext* globalCtx) { func_80835C58(globalCtx, this, func_8084C81C, 0); if (this->linearVelocity > 0.0f) { - this->actor.shape.rot.y = this->actor.wallPolyRot + 0x8000; + this->actor.shape.rot.y = this->actor.wallYaw + 0x8000; func_80832264(globalCtx, this, &D_04002700); func_80832F54(globalCtx, this, 0x9D); func_800800F8(globalCtx, 0x2581, 999, NULL, 0); } else { - this->actor.shape.rot.y = this->actor.wallPolyRot; + this->actor.shape.rot.y = this->actor.wallYaw; LinkAnimation_Change(globalCtx, &this->skelAnime, &D_04002708, -1.0f, Animation_GetLastFrame(&D_04002708), 0.0f, ANIMMODE_ONCE, 0.0f); func_80832F54(globalCtx, this, 0x9D); @@ -6333,7 +6332,7 @@ void func_8083F72C(Player* this, LinkAnimationHeader* anim, GlobalContext* globa func_80832264(globalCtx, this, anim); func_80832224(this); - this->actor.shape.rot.y = this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; } s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { @@ -6353,8 +6352,8 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)) { - if ((this->actor.wallPolySource != BGCHECK_SCENE) && - ((wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource)) != NULL)) { + if ((this->actor.wallBgId != BGCHECK_SCENE) && + ((wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId)) != NULL)) { if (wallPolyActor->actor.id == ACTOR_BG_HEAVY_BLOCK) { if (Player_GetStrength() < PLAYER_STR_GOLD_G) { @@ -6365,7 +6364,7 @@ s32 func_8083F7BC(Player* this, GlobalContext* globalCtx) { this->stateFlags1 |= 0x800; this->interactRangeActor = &wallPolyActor->actor; this->getItemId = GI_NONE; - this->currentYaw = this->actor.wallPolyRot + 0x8000; + this->currentYaw = this->actor.wallYaw + 0x8000; func_80832224(this); return 1; @@ -6391,8 +6390,8 @@ s32 func_8083F9D0(GlobalContext* globalCtx, Player* this) { ((this->stateFlags2 & 0x10) || CHECK_BTN_ALL(sControlInput->cur.button, BTN_A))) { DynaPolyActor* wallPolyActor = NULL; - if (this->actor.wallPolySource != BGCHECK_SCENE) { - wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + if (this->actor.wallBgId != BGCHECK_SCENE) { + wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); } if (&wallPolyActor->actor == this->unk_3C4) { @@ -6431,7 +6430,7 @@ void func_8083FB7C(Player* this, GlobalContext* globalCtx) { s32 func_8083FBC0(Player* this, GlobalContext* globalCtx) { if (!CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (this->actor.bgCheckFlags & 0x200) && ((D_808535F0 & 8) || (D_808535F0 & 2) || - func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource))) { + func_80041E4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId))) { return 0; } @@ -6475,7 +6474,7 @@ s32 func_8083FD78(Player* this, f32* arg1, s16* arg2, GlobalContext* globalCtx) if (this->unk_664 != NULL) { func_8083DB98(this, 1); } else { - Math_SmoothStepToS(&this->actor.posRot2.rot.x, sControlInput->rel.stick_y * 240.0f, 14, 4000, 30); + Math_SmoothStepToS(&this->actor.focus.rot.x, sControlInput->rel.stick_y * 240.0f, 14, 4000, 30); func_80836AB8(this, 1); } } else { @@ -7409,10 +7408,12 @@ s32 func_8084269C(GlobalContext* globalCtx, Player* this) { Vec3f sp2C; if ((this->unk_89E == 0) || (this->unk_89E == 1)) { - func_8084260C(&this->actor.unk_CC[0], &sp2C, this->actor.groundY - this->actor.unk_CC[0].y, 7.0f, 5.0f); + func_8084260C(&this->actor.shape.feetPos[FOOT_LEFT], &sp2C, + this->actor.floorHeight - this->actor.shape.feetPos[FOOT_LEFT].y, 7.0f, 5.0f); func_800286CC(globalCtx, &sp2C, &D_808545B4, &D_808545C0, 50, 30); - func_8084260C(&this->actor.unk_CC[1], &sp2C, this->actor.groundY - this->actor.unk_CC[1].y, 7.0f, 5.0f); - func_800286CC(globalCtx, &this->actor.unk_CC[1], &D_808545B4, &D_808545C0, 50, 30); + func_8084260C(&this->actor.shape.feetPos[FOOT_RIGHT], &sp2C, + this->actor.floorHeight - this->actor.shape.feetPos[FOOT_RIGHT].y, 7.0f, 5.0f); + func_800286CC(globalCtx, &this->actor.shape.feetPos[FOOT_RIGHT], &D_808545B4, &D_808545C0, 50, 30); return 1; } @@ -7672,7 +7673,7 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { sp4C = 3500; } - sp48 = ABS(sp4C - this->actor.posRot2.rot.x) * 0.25f; + sp48 = ABS(sp4C - this->actor.focus.rot.x) * 0.25f; if (sp48 < 100) { sp48 = 100; } @@ -7682,8 +7683,8 @@ void func_80843188(Player* this, GlobalContext* globalCtx) { sp46 = 50; } - Math_ScaledStepToS(&this->actor.posRot2.rot.x, sp4C, sp48); - this->unk_6BC = this->actor.posRot2.rot.x; + Math_ScaledStepToS(&this->actor.focus.rot.x, sp4C, sp48); + this->unk_6BC = this->actor.focus.rot.x; Math_ScaledStepToS(&this->unk_6BE, sp4A, sp46); if (this->unk_84F != 0) { @@ -7882,7 +7883,7 @@ void func_80843AE8(GlobalContext* globalCtx, Player* this) { } } else if (this->unk_84F != 0) { this->unk_850 = 60; - Player_SpawnFairy(globalCtx, this, &this->actor.posRot.pos, &D_808545E4, FAIRY_REVIVE_DEATH); + Player_SpawnFairy(globalCtx, this, &this->actor.world.pos, &D_808545E4, FAIRY_REVIVE_DEATH); func_8002F7DC(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); func_800800F8(globalCtx, 0x26B4, 125, &this->actor, 0); } else if (globalCtx->unk_10A20 == 2) { @@ -7901,7 +7902,7 @@ void func_80843CEC(Player* this, GlobalContext* globalCtx) { if (this->currentTunic != PLAYER_TUNIC_GORON) { if ((globalCtx->roomCtx.curRoom.unk_02 == 3) || (D_808535E4 == 9) || ((func_80838144(D_808535E4) >= 0) && - !SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource))) { + !SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId))) { func_8083821C(this); } } @@ -7909,7 +7910,7 @@ void func_80843CEC(Player* this, GlobalContext* globalCtx) { func_8083721C(this); if (LinkAnimation_Update(globalCtx, &this->skelAnime)) { - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { func_80843AE8(globalCtx, this); } return; @@ -7998,7 +7999,7 @@ void func_8084409C(GlobalContext* globalCtx, Player* this, f32 speedXZ, f32 velo Actor* heldActor = this->heldActor; if (!func_80835644(globalCtx, this, heldActor)) { - heldActor->posRot.rot.y = this->actor.shape.rot.y; + heldActor->world.rot.y = this->actor.shape.rot.y; heldActor->speedXZ = speedXZ; heldActor->velocity.y = velocityY; func_80834644(globalCtx, this); @@ -8061,7 +8062,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { if ((this->wallHeight >= 150.0f) && (this->unk_84B[this->unk_846] == 0)) { func_8083EC18(this, globalCtx, D_808535F0); } else if ((this->unk_88C >= 2) && (this->wallHeight < 150.0f) && - (((this->actor.posRot.pos.y - this->actor.groundY) + this->wallHeight) > + (((this->actor.world.pos.y - this->actor.floorHeight) + this->wallHeight) > (70.0f * this->ageProperties->unk_08))) { AnimationContext_DisableQueue(globalCtx); if (this->stateFlags1 & 4) { @@ -8069,7 +8070,7 @@ void func_8084411C(Player* this, GlobalContext* globalCtx) { } else { func_80832698(this, NA_SE_VO_LI_HANG); } - this->actor.posRot.pos.y += this->wallHeight; + this->actor.world.pos.y += this->wallHeight; func_8083A5C4(globalCtx, this, this->actor.wallPoly, this->wallDistance, D_80853CBC[this->modelAnimType]); this->actor.shape.rot.y = this->currentYaw += 0x8000; @@ -8156,14 +8157,14 @@ void func_80844708(Player* this, GlobalContext* globalCtx) { ((this->cylinder.base.ocFlags1 & OC1_HIT) && (cylinderOc = this->cylinder.base.oc, ((cylinderOc->id == ACTOR_EN_WOOD02) && - (ABS((s16)(this->actor.posRot.rot.y - cylinderOc->yawTowardsLink)) > 0x6000))))) { + (ABS((s16)(this->actor.world.rot.y - cylinderOc->yawTowardsPlayer)) > 0x6000))))) { if (cylinderOc != NULL) { - cylinderOc->initPosRot.rot.y = 1; - } else if (this->actor.wallPolySource != BGCHECK_SCENE) { - wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + cylinderOc->home.rot.y = 1; + } else if (this->actor.wallBgId != BGCHECK_SCENE) { + wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); if ((wallPolyActor != NULL) && (wallPolyActor->actor.id == ACTOR_OBJ_KIBAKO2)) { - wallPolyActor->actor.initPosRot.rot.z = 1; + wallPolyActor->actor.home.rot.z = 1; } } @@ -8545,7 +8546,7 @@ void func_80845668(Player* this, GlobalContext* globalCtx) { func_80832854(this); this->unk_850 = 1; } - Math_StepToF(&this->actor.shape.unk_08, 0.0f, 150.0f); + Math_StepToF(&this->actor.shape.yOffset, 0.0f, 150.0f); } } } @@ -8567,8 +8568,8 @@ s32 func_80845964(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2 if (arg5 != 2) { f32 sp34 = R_UPDATE_RATE * 0.5f; - f32 selfDistX = arg2->endPos.x - this->actor.posRot.pos.x; - f32 selfDistZ = arg2->endPos.z - this->actor.posRot.pos.z; + f32 selfDistX = arg2->endPos.x - this->actor.world.pos.x; + f32 selfDistZ = arg2->endPos.z - this->actor.world.pos.z; f32 sp28 = sqrtf(SQ(selfDistX) + SQ(selfDistZ)) / sp34; s32 sp24 = (arg2->endFrame - globalCtx->csCtx.frames) + 1; @@ -8602,10 +8603,10 @@ s32 func_80845964(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2 } s32 func_80845BA0(GlobalContext* arg0, Player* arg1, f32* arg2, s32 arg3) { - f32 dx = arg1->unk_450.x - arg1->actor.posRot.pos.x; - f32 dz = arg1->unk_450.z - arg1->actor.posRot.pos.z; + f32 dx = arg1->unk_450.x - arg1->actor.world.pos.x; + f32 dz = arg1->unk_450.z - arg1->actor.world.pos.z; s32 sp2C = sqrtf(SQ(dx) + SQ(dz)); - s16 yaw = Math_Vec3f_Yaw(&arg1->actor.posRot.pos, &arg1->unk_450); + s16 yaw = Math_Vec3f_Yaw(&arg1->actor.world.pos, &arg1->unk_450); if (sp2C < arg3) { *arg2 = 0.0f; @@ -8660,8 +8661,8 @@ void func_80845CA4(Player* this, GlobalContext* globalCtx) { sp34 = gSaveContext.entranceSpeed; if (D_808535F4 != 0) { - this->unk_450.x = (Math_SinS(D_808535FC) * 400.0f) + this->actor.posRot.pos.x; - this->unk_450.z = (Math_CosS(D_808535FC) * 400.0f) + this->actor.posRot.pos.z; + this->unk_450.x = (Math_SinS(D_808535FC) * 400.0f) + this->actor.world.pos.x; + this->unk_450.z = (Math_CosS(D_808535FC) * 400.0f) + this->actor.world.pos.z; } } else if (this->unk_850 < 0) { this->unk_850++; @@ -8821,7 +8822,7 @@ void func_80846358(Player* this, GlobalContext* globalCtx) { if (LinkAnimation_OnFrame(&this->skelAnime, 6.0f)) { Actor* heldActor = this->heldActor; - heldActor->posRot.rot.y = this->actor.shape.rot.y; + heldActor->world.rot.y = this->actor.shape.rot.y; heldActor->speedXZ = 10.0f; heldActor->velocity.y = 20.0f; func_80834644(globalCtx, this); @@ -8961,7 +8962,7 @@ void func_80846660(GlobalContext* globalCtx, Player* this) { } this->stateFlags1 |= 0x20000000; LinkAnimation_Change(globalCtx, &this->skelAnime, &D_04003298, 2.0f / 3.0f, 0.0f, 24.0f, ANIMMODE_ONCE, 0.0f); - this->actor.posRot.pos.y += 800.0f; + this->actor.world.pos.y += 800.0f; } u8 D_808546F0[] = { ITEM_SWORD_MASTER, ITEM_SWORD_KOKIRI }; @@ -8989,7 +8990,7 @@ Vec3f D_808546F4 = { -1.0f, 69.0f, 20.0f }; void func_808467D4(GlobalContext* globalCtx, Player* this) { func_80835C58(globalCtx, this, func_8084E9AC, 0); this->stateFlags1 |= 0x20000000; - Math_Vec3f_Copy(&this->actor.posRot.pos, &D_808546F4); + Math_Vec3f_Copy(&this->actor.world.pos, &D_808546F4); this->currentYaw = this->actor.shape.rot.y = -0x8000; LinkAnimation_Change(globalCtx, &this->skelAnime, this->ageProperties->unk_A0, 2.0f / 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f); @@ -9009,7 +9010,7 @@ void func_808468E8(GlobalContext* globalCtx, Player* this) { func_808389E8(this, &D_04002FE0, 12.0f, globalCtx); func_80835C58(globalCtx, this, func_8084F9C0, 0); this->stateFlags1 |= 0x20000000; - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; func_800800F8(globalCtx, 0x13F6, 40, &this->actor, 0); } @@ -9026,8 +9027,8 @@ void func_808469BC(GlobalContext* globalCtx, Player* this) { s16 D_80854700[] = { ACTOR_MAGIC_WIND, ACTOR_MAGIC_DARK, ACTOR_MAGIC_FIRE }; Actor* func_80846A00(GlobalContext* globalCtx, Player* this, s32 arg2) { - return Actor_Spawn(&globalCtx->actorCtx, globalCtx, D_80854700[arg2], this->actor.posRot.pos.x, - this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 0); + return Actor_Spawn(&globalCtx->actorCtx, globalCtx, D_80854700[arg2], this->actor.world.pos.x, + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } void func_80846A68(GlobalContext* globalCtx, Player* this) { @@ -9037,7 +9038,7 @@ void func_80846A68(GlobalContext* globalCtx, Player* this) { } InitChainEntry D_80854708[] = { - ICHAIN_F32(unk_4C, 500, ICHAIN_STOP), + ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; EffectBlureInit2 D_8085470C = { @@ -9051,7 +9052,7 @@ void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeade this->ageProperties = &sAgeProperties[gSaveContext.linkAge]; Actor_ProcessInitChain(&this->actor, D_80854708); this->swordEffectIndex = TOTAL_EFFECT_COUNT; - this->currentYaw = this->actor.posRot.rot.y; + this->currentYaw = this->actor.world.rot.y; func_80834644(globalCtx, this); SkelAnime_InitLink(globalCtx, &this->skelAnime, skelHeader, D_80853914[this->modelAnimType], 9, this->jointTable, @@ -9062,7 +9063,7 @@ void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeade this->skelAnime2.baseTransl = D_80854730; Effect_Add(globalCtx, &this->swordEffectIndex, EFFECT_BLURE2, 0, 0, &D_8085470C); - ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Teardrop, this->ageProperties->unk_04); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, this->ageProperties->unk_04); this->unk_46C = -1; Collider_InitCylinder(globalCtx, &this->cylinder); @@ -9131,10 +9132,10 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { sp4C = 0; } else { sp4C = sp50 - 1; - Math_Vec3f_Copy(&thisx->posRot.pos, &gSaveContext.respawn[sp50 - 1].pos); - Math_Vec3f_Copy(&thisx->initPosRot.pos, &thisx->posRot.pos); - Math_Vec3f_Copy(&thisx->pos4, &thisx->posRot.pos); - this->fallStartHeight = thisx->posRot.pos.y; + Math_Vec3f_Copy(&thisx->world.pos, &gSaveContext.respawn[sp50 - 1].pos); + Math_Vec3f_Copy(&thisx->home.pos, &thisx->world.pos); + Math_Vec3f_Copy(&thisx->prevPos, &thisx->world.pos); + this->fallStartHeight = thisx->world.pos.y; this->currentYaw = thisx->shape.rot.y = gSaveContext.respawn[sp4C].yaw; thisx->params = gSaveContext.respawn[sp4C].playerParams; } @@ -9178,7 +9179,7 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { if (initMode != 0) { if ((gSaveContext.gameMode == 0) || (gSaveContext.gameMode == 3)) { - this->naviActor = Player_SpawnFairy(globalCtx, this, &thisx->posRot.pos, &D_80854778, FAIRY_NAVI); + this->naviActor = Player_SpawnFairy(globalCtx, this, &thisx->world.pos, &D_80854778, FAIRY_NAVI); if (gSaveContext.dogParams != 0) { gSaveContext.dogParams |= 0x8000; } @@ -9216,13 +9217,13 @@ void func_80847298(Player* this) { s16 sp26; if (!(this->unk_6AE & 2)) { - sp26 = this->actor.posRot2.rot.y - this->actor.shape.rot.y; + sp26 = this->actor.focus.rot.y - this->actor.shape.rot.y; func_808471F4(&sp26); - this->actor.posRot2.rot.y = this->actor.shape.rot.y + sp26; + this->actor.focus.rot.y = this->actor.shape.rot.y + sp26; } if (!(this->unk_6AE & 1)) { - func_808471F4(&this->actor.posRot2.rot.x); + func_808471F4(&this->actor.focus.rot.x); } if (!(this->unk_6AE & 8)) { @@ -9234,7 +9235,7 @@ void func_80847298(Player* this) { } if (!(this->unk_6AE & 4)) { - func_808471F4(&this->actor.posRot2.rot.z); + func_808471F4(&this->actor.focus.rot.z); } if (!(this->unk_6AE & 0x10)) { @@ -9265,7 +9266,7 @@ f32 D_80854784[] = { 120.0f, 240.0f, 360.0f }; u8 D_80854790[] = { 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C }; void func_808473D4(GlobalContext* globalCtx, Player* this) { - if ((func_8010BDBC(&globalCtx->msgCtx) == 0) && (this->actor.type == ACTORTYPE_PLAYER)) { + if ((func_8010BDBC(&globalCtx->msgCtx) == 0) && (this->actor.category == ACTORCAT_PLAYER)) { Actor* heldActor = this->heldActor; Actor* interactRangeActor = this->interactRangeActor; s32 sp24; @@ -9301,7 +9302,7 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { } else if ((this->stateFlags1 & 0x800000) && !EN_HORSE_CHECK_4((EnHorse*)this->rideActor) && (func_8084D3E4 != this->func_674)) { if ((this->stateFlags2 & 2) && (this->targetActor != NULL)) { - if (this->targetActor->type == ACTORTYPE_NPC) { + if (this->targetActor->category == ACTORCAT_NPC) { doAction = 0xF; } else { doAction = 1; @@ -9310,7 +9311,7 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) { doAction = 8; } } else if ((this->stateFlags2 & 2) && (this->targetActor != NULL)) { - if (this->targetActor->type == ACTORTYPE_NPC) { + if (this->targetActor->category == ACTORCAT_NPC) { doAction = 0xF; } else { doAction = 1; @@ -9433,7 +9434,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { if (this->stateFlags1 & 0x80000000) { this->actor.bgCheckFlags &= ~1; spA4 = 0x38; - } else if ((this->stateFlags1 & 1) && ((this->unk_A84 - (s32)this->actor.posRot.pos.y) >= 100)) { + } else if ((this->stateFlags1 & 1) && ((this->unk_A84 - (s32)this->actor.world.pos.y) >= 100)) { spA4 = 0x39; } else if (!(this->stateFlags1 & 1) && ((func_80845EF8 == this->func_674) || (func_80845CA4 == this->func_674))) { @@ -9454,20 +9455,20 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { this->stateFlags3 |= 0x10; } - Math_Vec3f_Copy(&spB4, &this->actor.posRot.pos); - func_8002E4B4(globalCtx, &this->actor, spAC, spB0, spA8, spA4); + Math_Vec3f_Copy(&spB4, &this->actor.world.pos); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, spAC, spB0, spA8, spA4); if (this->actor.bgCheckFlags & 0x10) { this->actor.velocity.y = 0.0f; } - D_80853600 = this->actor.posRot.pos.y - this->actor.groundY; + D_80853600 = this->actor.world.pos.y - this->actor.floorHeight; D_808535F4 = 0; spC0 = this->actor.floorPoly; if (spC0 != NULL) { - this->unk_A7A = func_80041EA4(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + this->unk_A7A = func_80041EA4(&globalCtx->colCtx, spC0, this->actor.floorBgId); this->unk_A82 = this->unk_89E; if (this->actor.bgCheckFlags & 0x20) { @@ -9480,36 +9481,35 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { if (this->stateFlags2 & 0x200) { this->unk_89E = 1; } else { - this->unk_89E = SurfaceType_GetSfx(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + this->unk_89E = SurfaceType_GetSfx(&globalCtx->colCtx, spC0, this->actor.floorBgId); } } - if (this->actor.type == ACTORTYPE_PLAYER) { - func_800F66DC(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorPolySource)); + if (this->actor.category == ACTORCAT_PLAYER) { + func_800F66DC(SurfaceType_GetEcho(&globalCtx->colCtx, spC0, this->actor.floorBgId)); - if (this->actor.floorPolySource == BGCHECK_SCENE) { + if (this->actor.floorBgId == BGCHECK_SCENE) { func_80074CE8(globalCtx, - SurfaceType_GetLightSettingIndex(&globalCtx->colCtx, spC0, this->actor.floorPolySource)); + SurfaceType_GetLightSettingIndex(&globalCtx->colCtx, spC0, this->actor.floorBgId)); } else { - func_80043508(&globalCtx->colCtx, this->actor.floorPolySource); + func_80043508(&globalCtx->colCtx, this->actor.floorBgId); } } - D_808535F4 = SurfaceType_GetConveyorSpeed(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + D_808535F4 = SurfaceType_GetConveyorSpeed(&globalCtx->colCtx, spC0, this->actor.floorBgId); if (D_808535F4 != 0) { - D_808535F8 = SurfaceType_IsConveyor(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + D_808535F8 = SurfaceType_IsConveyor(&globalCtx->colCtx, spC0, this->actor.floorBgId); if (((D_808535F8 == 0) && (this->actor.yDistToWater > 20.0f) && (this->currentBoots != PLAYER_BOOTS_IRON)) || ((D_808535F8 != 0) && (this->actor.bgCheckFlags & 1))) { - D_808535FC = SurfaceType_GetConveyorDirection(&globalCtx->colCtx, spC0, this->actor.floorPolySource) - << 10; + D_808535FC = SurfaceType_GetConveyorDirection(&globalCtx->colCtx, spC0, this->actor.floorBgId) << 10; } else { D_808535F4 = 0; } } } - func_80839034(globalCtx, this, spC0, this->actor.floorPolySource); + func_80839034(globalCtx, this, spC0, this->actor.floorBgId); this->actor.bgCheckFlags &= ~0x200; @@ -9526,18 +9526,18 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { this->actor.bgCheckFlags |= 0x200; if (this->actor.wallPoly != spA0) { this->actor.wallPoly = spA0; - this->actor.wallPolySource = sp9C; - this->actor.wallPolyRot = Math_Atan2S(spA0->normal.z, spA0->normal.x); + this->actor.wallBgId = sp9C; + this->actor.wallYaw = Math_Atan2S(spA0->normal.z, spA0->normal.x); } } - sp9A = this->actor.shape.rot.y - (s16)(this->actor.wallPolyRot + 0x8000); + sp9A = this->actor.shape.rot.y - (s16)(this->actor.wallYaw + 0x8000); - D_808535F0 = func_80041DB8(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallPolySource); + D_808535F0 = func_80041DB8(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId); D_80853608 = ABS(sp9A); - sp9A = this->currentYaw - (s16)(this->actor.wallPolyRot + 0x8000); + sp9A = this->currentYaw - (s16)(this->actor.wallYaw + 0x8000); D_8085360C = ABS(sp9A); @@ -9568,30 +9568,30 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { f32 sp60; s32 temp3; - this->wallDistance = Math3D_UDistPlaneToPos(sp8C, sp88, sp84, wallPoly->dist, &this->actor.posRot.pos); + this->wallDistance = Math3D_UDistPlaneToPos(sp8C, sp88, sp84, wallPoly->dist, &this->actor.world.pos); spB0 = this->wallDistance + 10.0f; - sp68.x = this->actor.posRot.pos.x - (spB0 * sp8C); - sp68.z = this->actor.posRot.pos.z - (spB0 * sp84); - sp68.y = this->actor.posRot.pos.y + this->ageProperties->unk_0C; + sp68.x = this->actor.world.pos.x - (spB0 * sp8C); + sp68.z = this->actor.world.pos.z - (spB0 * sp84); + sp68.y = this->actor.world.pos.y + this->ageProperties->unk_0C; sp64 = BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &sp7C, &sp68); - wallHeight = sp64 - this->actor.posRot.pos.y; + wallHeight = sp64 - this->actor.world.pos.y; this->wallHeight = wallHeight; if ((this->wallHeight < 18.0f) || - BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp60, &this->actor.posRot.pos, - (sp64 - this->actor.posRot.pos.y) + 20.0f, &sp78, &sp74, &this->actor)) { + BgCheck_EntityCheckCeiling(&globalCtx->colCtx, &sp60, &this->actor.world.pos, + (sp64 - this->actor.world.pos.y) + 20.0f, &sp78, &sp74, &this->actor)) { this->wallHeight = 399.96002f; } else { - D_80854798.y = (sp64 + 5.0f) - this->actor.posRot.pos.y; + D_80854798.y = (sp64 + 5.0f) - this->actor.world.pos.y; if (func_80839768(globalCtx, this, &D_80854798, &sp78, &sp74, &D_80858AA8) && - (temp3 = this->actor.wallPolyRot - Math_Atan2S(sp78->normal.z, sp78->normal.x), + (temp3 = this->actor.wallYaw - Math_Atan2S(sp78->normal.z, sp78->normal.x), ABS(temp3) < 0x4000) && !func_80041E18(&globalCtx->colCtx, sp78, sp74)) { this->wallHeight = 399.96002f; - } else if (func_80041DE4(&globalCtx->colCtx, wallPoly, this->actor.wallPolySource) == 0) { + } else if (func_80041DE4(&globalCtx->colCtx, wallPoly, this->actor.wallBgId) == 0) { if (this->ageProperties->unk_1C <= this->wallHeight) { if (ABS(sp7C->normal.y) > 28000) { if (this->ageProperties->unk_14 <= this->wallHeight) { @@ -9625,7 +9625,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { } if (this->actor.bgCheckFlags & 1) { - D_808535E4 = func_80041D4C(&globalCtx->colCtx, spC0, this->actor.floorPolySource); + D_808535E4 = func_80041D4C(&globalCtx->colCtx, spC0, this->actor.floorBgId); if (!func_80847A78(this)) { f32 sp58; @@ -9636,8 +9636,8 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { f32 sp44; s32 pad3; - if (this->actor.floorPolySource != BGCHECK_SCENE) { - func_800434C8(&globalCtx->colCtx, this->actor.floorPolySource); + if (this->actor.floorBgId != BGCHECK_SCENE) { + func_800434C8(&globalCtx->colCtx, this->actor.floorBgId); } sp58 = COLPOLY_GET_NORMAL(spC0->normal.x); @@ -9675,7 +9675,7 @@ void func_808486A8(GlobalContext* globalCtx, Player* this) { Actor* unk_664; s32 camMode; - if (this->actor.type == ACTORTYPE_PLAYER) { + if (this->actor.category == ACTORCAT_PLAYER) { sp27 = 0; if (this->csMode != 0) { @@ -9745,7 +9745,7 @@ void func_808486A8(GlobalContext* globalCtx, Player* this) { if (globalCtx->actorCtx.targetCtx.unk_90 != NULL) { sp27 = 1; - func_800F6114(sqrtf(globalCtx->actorCtx.targetCtx.unk_90->xyzDistToLinkSq)); + func_800F6114(sqrtf(globalCtx->actorCtx.targetCtx.unk_90->xyzDistToPlayerSq)); } if (globalCtx->sceneNum != SCENE_TURIBORI) { @@ -9802,9 +9802,9 @@ void func_80848B44(GlobalContext* globalCtx, Player* this) { } randBodyPart = this->bodyPartsPos + (s32)Rand_ZeroFloat(17.9f); - shockPos.x = (Rand_CenteredFloat(5.0f) + randBodyPart->x) - this->actor.posRot.pos.x; - shockPos.y = (Rand_CenteredFloat(5.0f) + randBodyPart->y) - this->actor.posRot.pos.y; - shockPos.z = (Rand_CenteredFloat(5.0f) + randBodyPart->z) - this->actor.posRot.pos.z; + shockPos.x = (Rand_CenteredFloat(5.0f) + randBodyPart->x) - this->actor.world.pos.x; + shockPos.y = (Rand_CenteredFloat(5.0f) + randBodyPart->y) - this->actor.world.pos.y; + shockPos.z = (Rand_CenteredFloat(5.0f) + randBodyPart->z) - this->actor.world.pos.z; EffectSsFhgFlash_SpawnShock(globalCtx, &this->actor, &shockPos, shockScale, FHGFLASH_SHOCK_PLAYER); func_8002F8F0(&this->actor, NA_SE_PL_SPARK - SFX_FLAG); @@ -9920,7 +9920,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } } - Math_Vec3f_Copy(&this->actor.pos4, &this->actor.initPosRot.pos); + Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.home.pos); if (this->unk_A73 != 0) { this->unk_A73--; @@ -10018,7 +10018,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { Math_ScaledStepToS(&this->unk_6C2, 0, 400); func_80032CB4(this->unk_3A8, 20, 80, 6); - this->actor.shape.unk_06 = this->unk_3A8[0] + ((globalCtx->gameplayFrames & 32) ? 0 : 3); + this->actor.shape.face = this->unk_3A8[0] + ((globalCtx->gameplayFrames & 32) ? 0 : 3); if (this->currentMask == PLAYER_MASK_BUNNY) { func_8085002C(this); @@ -10033,7 +10033,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->stateFlags1 & 0x28000000))) { f32 sp70 = this->linearVelocity; s16 sp6E = this->currentYaw; - s16 yawDiff = this->actor.posRot.rot.y - sp6E; + s16 yawDiff = this->actor.world.rot.y - sp6E; s32 pad; if ((ABS(yawDiff) > 0x6000) && (this->actor.speedXZ != 0.0f)) { @@ -10042,7 +10042,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } if (Math_StepToF(&this->actor.speedXZ, sp70, 0.35f) && (sp70 == 0.0f)) { - this->actor.posRot.rot.y = this->currentYaw; + this->actor.world.rot.y = this->currentYaw; } if (this->linearVelocity != 0.0f) { @@ -10051,7 +10051,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { phi_v0 = (fabsf(this->linearVelocity) * 700.0f) - (fabsf(this->actor.speedXZ) * 100.0f); phi_v0 = CLAMP(phi_v0, 0, 1350); - Math_ScaledStepToS(&this->actor.posRot.rot.y, sp6E, phi_v0); + Math_ScaledStepToS(&this->actor.world.rot.y, sp6E, phi_v0); } if ((this->linearVelocity == 0.0f) && (this->actor.speedXZ != 0.0f)) { @@ -10059,7 +10059,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { } } else { this->actor.speedXZ = this->linearVelocity; - this->actor.posRot.rot.y = this->currentYaw; + this->actor.world.rot.y = this->currentYaw; } func_8002D868(&this->actor); @@ -10086,7 +10086,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { func_808396F4(globalCtx, this, &D_80854814, &sp4C, &sp5C, &sp58); } else { sp5C = rideActor->actor.floorPoly; - sp58 = rideActor->actor.floorPolySource; + sp58 = rideActor->actor.floorBgId; } if ((sp5C != NULL) && func_80839034(globalCtx, this, sp5C, sp58)) { @@ -10128,7 +10128,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { if (!Player_InBlockingCsMode(globalCtx, this) && !(this->stateFlags2 & 0x40000)) { func_8083D53C(globalCtx, this); - if ((this->actor.type == ACTORTYPE_PLAYER) && (gSaveContext.health == 0)) { + if ((this->actor.category == ACTORCAT_PLAYER) && (gSaveContext.health == 0)) { if (this->stateFlags1 & 0x206000) { func_80832440(globalCtx, this); func_80837B9C(this, globalCtx); @@ -10142,14 +10142,14 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { ((globalCtx->sceneLoadFlag == 0x14) || (this->unk_A87 != 0) || !func_808382DC(this, globalCtx))) { func_8083AA10(this, globalCtx); } else { - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; } func_80848EF8(this); } } if ((globalCtx->csCtx.state != 0) && (this->csMode != 6) && !(this->stateFlags1 & 0x800000) && - !(this->stateFlags2 & 0x80) && (this->actor.type == ACTORTYPE_PLAYER)) { + !(this->stateFlags2 & 0x80) && (this->actor.category == ACTORCAT_PLAYER)) { CsCmdActorAction* linkActionCsCmd = globalCtx->csCtx.linkAction; if ((linkActionCsCmd != NULL) && (D_808547C4[linkActionCsCmd->action] != 0)) { @@ -10233,7 +10233,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->stateFlags2 &= ~0x800000; this->unk_6A4 = FLT_MAX; - temp_f0 = this->actor.posRot.pos.y - this->actor.pos4.y; + temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y; this->doorType = 0; this->unk_8A1 = 0; @@ -10249,7 +10249,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { this->cylinder.dim.height = -this->cylinder.dim.height; } - this->cylinder.dim.yShift = phi_f12 - this->actor.posRot.pos.y; + this->cylinder.dim.yShift = phi_f12 - this->actor.world.pos.y; if (this->stateFlags1 & 0x400000) { this->cylinder.dim.height = this->cylinder.dim.height * 0.8f; @@ -10274,7 +10274,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { AnimationContext_SetNextQueue(globalCtx); } - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[0]); if (this->stateFlags1 & 0x30000080) { @@ -10310,7 +10310,7 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) { gSaveContext.dogParams = 0; } else { gSaveContext.dogParams &= 0x7FFF; - func_808395DC(this, &this->actor.posRot.pos, &D_80854838, &sDogSpawnPos); + func_808395DC(this, &this->actor.world.pos, &D_80854838, &sDogSpawnPos); dogParams = gSaveContext.dogParams; dog = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_DOG, sDogSpawnPos.x, sDogSpawnPos.y, @@ -10342,10 +10342,10 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) { Player_UpdateCommon(this, globalCtx, &sp44); } - MREG(52) = this->actor.posRot.pos.x; - MREG(53) = this->actor.posRot.pos.y; - MREG(54) = this->actor.posRot.pos.z; - MREG(55) = this->actor.posRot.rot.y; + MREG(52) = this->actor.world.pos.x; + MREG(53) = this->actor.world.pos.y; + MREG(54) = this->actor.world.pos.z; + MREG(55) = this->actor.world.rot.y; } struct_80858AC8 D_80858AC8; @@ -10367,7 +10367,7 @@ void func_8084A0E8(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* cullDLi gSPSegment(POLY_XLU_DISP++, 0x0C, cullDList); func_8008F470(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, lod, - this->currentTunic, this->currentBoots, this->actor.shape.unk_06, overrideLimbDraw, func_80090D20, + this->currentTunic, this->currentBoots, this->actor.shape.face, overrideLimbDraw, func_80090D20, this); if ((overrideLimbDraw == func_80090014) && (this->currentMask != PLAYER_MASK_NONE)) { @@ -10415,7 +10415,7 @@ void func_8084A0E8(GlobalContext* globalCtx, Player* this, s32 lod, Gfx* cullDLi D_8085486C = D_8085486C * (sp5C * 0.11111111f); } - func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + 2.0f, this->actor.posRot.pos.z, + func_800D1694(this->actor.world.pos.x, this->actor.world.pos.y + 2.0f, this->actor.world.pos.z, &D_80854864); Matrix_Scale(4.0f, 4.0f, 4.0f, MTXMODE_APPLY); @@ -10467,7 +10467,7 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_6AD != 0) { Vec3f sp7C; - SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->mf_11D60, &this->actor.posRot2.pos, &sp7C); + SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->mf_11D60, &this->actor.focus.pos, &sp7C); if (sp7C.z < -4.0f) { overrideLimbDraw = func_800902F0; } @@ -10483,10 +10483,10 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Push(); this->actor.scale.y = -this->actor.scale.y; - func_800D1694(this->actor.posRot.pos.x, - (this->actor.groundY + (this->actor.groundY - this->actor.posRot.pos.y)) + - (this->actor.shape.unk_08 * this->actor.scale.y), - this->actor.posRot.pos.z, &this->actor.shape.rot); + func_800D1694(this->actor.world.pos.x, + (this->actor.floorHeight + (this->actor.floorHeight - this->actor.world.pos.y)) + + (this->actor.shape.yOffset * this->actor.scale.y), + this->actor.world.pos.z, &this->actor.shape.rot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); Matrix_RotateX(sp78, MTXMODE_APPLY); Matrix_RotateY(sp74, MTXMODE_APPLY); @@ -10551,24 +10551,24 @@ s16 func_8084ABD8(GlobalContext* globalCtx, Player* this, s32 arg2, s16 arg3) { if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) { temp2 = sControlInput->rel.stick_y * 240.0f; - Math_SmoothStepToS(&this->actor.posRot2.rot.x, temp2, 14, 4000, 30); + Math_SmoothStepToS(&this->actor.focus.rot.x, temp2, 14, 4000, 30); temp2 = sControlInput->rel.stick_x * -16.0f; temp2 = CLAMP(temp2, -3000, 3000); - this->actor.posRot2.rot.y += temp2; + this->actor.focus.rot.y += temp2; } else { temp1 = (this->stateFlags1 & 0x800000) ? 3500 : 14000; temp3 = ((sControlInput->rel.stick_y >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_y * 200)) * 1500.0f); - this->actor.posRot2.rot.x += temp3; - this->actor.posRot2.rot.x = CLAMP(this->actor.posRot2.rot.x, -temp1, temp1); + this->actor.focus.rot.x += temp3; + this->actor.focus.rot.x = CLAMP(this->actor.focus.rot.x, -temp1, temp1); temp1 = 19114; - temp2 = this->actor.posRot2.rot.y - this->actor.shape.rot.y; + temp2 = this->actor.focus.rot.y - this->actor.shape.rot.y; temp3 = ((sControlInput->rel.stick_x >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_x * 200)) * -1500.0f); temp2 += temp3; - this->actor.posRot2.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; + this->actor.focus.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; } this->unk_6AE |= 2; @@ -10772,7 +10772,8 @@ void func_8084B530(Player* this, GlobalContext* globalCtx) { } else if (!func_8008E9C4(this) && LinkAnimation_Update(globalCtx, &this->skelAnime)) { if (this->skelAnime.moveFlags != 0) { func_80832DBC(this); - if ((this->targetActor->type == ACTORTYPE_NPC) && (this->heldItemActionParam != PLAYER_AP_FISHING_POLE)) { + if ((this->targetActor->category == ACTORCAT_NPC) && + (this->heldItemActionParam != PLAYER_AP_FISHING_POLE)) { func_808322D0(globalCtx, this, &D_040031A0); } else { func_80832284(globalCtx, this, func_80833338(this)); @@ -10809,11 +10810,11 @@ void func_8084B78C(Player* this, GlobalContext* globalCtx) { } void func_8084B840(GlobalContext* globalCtx, Player* this, f32 arg2) { - if (this->actor.wallPolySource != BGCHECK_SCENE) { - DynaPolyActor* dynaActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + if (this->actor.wallBgId != BGCHECK_SCENE) { + DynaPolyActor* dynaActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); if (dynaActor != NULL) { - func_8002DFA4(dynaActor, arg2, this->actor.posRot.rot.y); + func_8002DFA4(dynaActor, arg2, this->actor.world.rot.y); } } } @@ -10908,10 +10909,10 @@ void func_8084B9E4(Player* this, GlobalContext* globalCtx) { } if (this->stateFlags2 & 0x10) { - temp2 = func_8083973C(globalCtx, this, &D_80854880, &sp5C) - this->actor.posRot.pos.y; + temp2 = func_8083973C(globalCtx, this, &D_80854880, &sp5C) - this->actor.world.pos.y; if (fabsf(temp2) < 20.0f) { - sp44.x = this->actor.posRot.pos.x; - sp44.z = this->actor.posRot.pos.z; + sp44.x = this->actor.world.pos.x; + sp44.z = this->actor.world.pos.z; sp44.y = sp5C.y; if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp44, &sp5C, &sp38, &sp54, 1, 0, 0, 1, &sp50) == 0) { func_8084B840(globalCtx, this, -2.0f); @@ -10965,7 +10966,7 @@ void func_8084BBE4(Player* this, GlobalContext* globalCtx) { return; } - if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) || (this->actor.shape.unk_15 != 0)) { + if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A) || (this->actor.shape.feetFloorFlags != 0)) { func_80837B60(this); if (this->unk_84F < 0) { this->linearVelocity = -0.8f; @@ -11016,7 +11017,7 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { sp84 = sControlInput->rel.stick_y; sp80 = sControlInput->rel.stick_x; - this->fallStartHeight = this->actor.posRot.pos.y; + this->fallStartHeight = this->actor.world.pos.y; this->stateFlags2 |= 0x40; if ((this->unk_84F != 0) && (ABS(sp84) < ABS(sp80))) { @@ -11042,15 +11043,15 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { this->skelAnime.playSpeed = phi_f2 * phi_f0; if (this->unk_850 >= 0) { - if ((this->actor.wallPoly != NULL) && (this->actor.wallPolySource != BGCHECK_SCENE)) { - DynaPolyActor* wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallPolySource); + if ((this->actor.wallPoly != NULL) && (this->actor.wallBgId != BGCHECK_SCENE)) { + DynaPolyActor* wallPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->actor.wallBgId); if (wallPolyActor != NULL) { - Math_Vec3f_Diff(&wallPolyActor->actor.posRot.pos, &wallPolyActor->actor.pos4, &sp6C); - Math_Vec3f_Sum(&this->actor.posRot.pos, &sp6C, &this->actor.posRot.pos); + Math_Vec3f_Diff(&wallPolyActor->actor.world.pos, &wallPolyActor->actor.prevPos, &sp6C); + Math_Vec3f_Sum(&this->actor.world.pos, &sp6C, &this->actor.world.pos); } } - func_8002E4B4(globalCtx, &this->actor, 26.0f, 6.0f, this->ageProperties->unk_00, 7); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 26.0f, 6.0f, this->ageProperties->unk_00, 7); func_8083F360(globalCtx, this, 26.0f, this->ageProperties->unk_3C, 50.0f, -20.0f); } @@ -11068,9 +11069,9 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { D_8085488C.y = this->ageProperties->unk_40; temp_f0 = func_8083973C(globalCtx, this, &D_8085488C, &sp5C); - if (this->actor.posRot.pos.y < temp_f0) { + if (this->actor.world.pos.y < temp_f0) { if (this->unk_84F != 0) { - this->actor.posRot.pos.y = temp_f0; + this->actor.world.pos.y = temp_f0; this->stateFlags1 &= ~0x200000; func_8083A5C4(globalCtx, this, this->actor.wallPoly, this->ageProperties->unk_3C, &D_04003000); @@ -11086,7 +11087,7 @@ void func_8084BF1C(Player* this, GlobalContext* globalCtx) { func_80832264(globalCtx, this, this->ageProperties->unk_AC[sp68]); } } else { - if ((this->actor.posRot.pos.y - this->actor.groundY) < 15.0f) { + if ((this->actor.world.pos.y - this->actor.floorHeight) < 15.0f) { if (this->unk_84F != 0) { func_8083FB7C(this, globalCtx); } else { @@ -11181,9 +11182,9 @@ void func_8084C5F8(Player* this, GlobalContext* globalCtx) { } if (LinkAnimation_OnFrame(&this->skelAnime, sp38[0]) || LinkAnimation_OnFrame(&this->skelAnime, sp38[1])) { - sp24.x = this->actor.posRot.pos.x; - sp24.y = this->actor.posRot.pos.y + 20.0f; - sp24.z = this->actor.posRot.pos.z; + sp24.x = this->actor.world.pos.x; + sp24.y = this->actor.world.pos.y + 20.0f; + sp24.z = this->actor.world.pos.z; if (BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &sp34, &sp30, &sp24) != 0.0f) { this->unk_89E = func_80041F10(&globalCtx->colCtx, sp34, sp30); func_808328A0(this); @@ -11257,8 +11258,8 @@ s32 func_8084C89C(GlobalContext* globalCtx, Player* this, s32 arg2, f32* arg3) { CollisionPoly* sp30; u32 sp2C; - sp50 = rideActor->actor.posRot.pos.y + 20.0f; - sp4C = rideActor->actor.posRot.pos.y - 20.0f; + sp50 = rideActor->actor.world.pos.y + 20.0f; + sp4C = rideActor->actor.world.pos.y - 20.0f; *arg3 = func_8083973C(globalCtx, this, &D_808548FC[arg2], &sp40); @@ -11293,7 +11294,7 @@ s32 func_8084C9BC(Player* this, GlobalContext* globalCtx) { (EN_HORSE_CHECK_4(rideActor) && CHECK_BTN_ALL(sControlInput->press.button, BTN_A))) { rideActor->actor.child = NULL; func_80835DAC(globalCtx, this, func_8084D3E4, 0); - this->unk_878 = sp34 - rideActor->actor.posRot.pos.y; + this->unk_878 = sp34 - rideActor->actor.world.pos.y; func_80832264(globalCtx, this, (this->unk_43C < 0) ? &D_04003390 : &D_040033A0); return 1; } @@ -11318,7 +11319,7 @@ void func_8084CBF4(Player* this, f32 arg1, f32 arg2) { } else { temp = this->unk_878; } - this->actor.posRot.pos.y += temp; + this->actor.world.pos.y += temp; this->unk_878 -= temp; } } @@ -11436,9 +11437,9 @@ void func_8084CC98(Player* this, GlobalContext* globalCtx) { } } - this->actor.posRot.pos.x = rideActor->actor.posRot.pos.x + rideActor->unk_258.x; - this->actor.posRot.pos.y = (rideActor->actor.posRot.pos.y + rideActor->unk_258.y) - 27.0f; - this->actor.posRot.pos.z = rideActor->actor.posRot.pos.z + rideActor->unk_258.z; + this->actor.world.pos.x = rideActor->actor.world.pos.x + rideActor->unk_258.x; + this->actor.world.pos.y = (rideActor->actor.world.pos.y + rideActor->unk_258.y) - 27.0f; + this->actor.world.pos.z = rideActor->actor.world.pos.z + rideActor->unk_258.z; this->currentYaw = this->actor.shape.rot.y = rideActor->actor.shape.rot.y; @@ -11505,7 +11506,7 @@ void func_8084CC98(Player* this, GlobalContext* globalCtx) { if (func_8002DD78(this) != 0) { this->unk_6BE = func_8083DB98(this, 1) - this->actor.shape.rot.y; this->unk_6BE = CLAMP(this->unk_6BE, -0x4AAA, 0x4AAA); - this->actor.posRot2.rot.y = this->actor.shape.rot.y + this->unk_6BE; + this->actor.focus.rot.y = this->actor.shape.rot.y + this->unk_6BE; this->unk_6BE += 5000; this->unk_6AE |= 0x80; } else { @@ -11541,9 +11542,9 @@ void func_8084D3E4(Player* this, GlobalContext* globalCtx) { AREG(6) = 0; if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) { - gSaveContext.horseData.pos.x = rideActor->actor.posRot.pos.x; - gSaveContext.horseData.pos.y = rideActor->actor.posRot.pos.y; - gSaveContext.horseData.pos.z = rideActor->actor.posRot.pos.z; + gSaveContext.horseData.pos.x = rideActor->actor.world.pos.x; + gSaveContext.horseData.pos.y = rideActor->actor.world.pos.y; + gSaveContext.horseData.pos.z = rideActor->actor.world.pos.z; gSaveContext.horseData.angle = rideActor->actor.shape.rot.y; } } else { @@ -12003,8 +12004,8 @@ void func_8084E6D4(Player* this, GlobalContext* globalCtx) { this->stateFlags1 &= ~0xC00; if (this->getItemId != GI_ICE_TRAP) { - Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.posRot.pos.x, - this->actor.posRot.pos.y + 100.0f, this->actor.posRot.pos.z, 0, 0, 0, 0); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, + this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, 0, 0, 0, 0); func_8083C0E8(this, globalCtx); } else { this->actor.colChkInfo.damage = 0; @@ -12370,7 +12371,7 @@ void func_8084F390(Player* this, GlobalContext* globalCtx) { sp4C = (sp50 * sp50) * 0.015f; sp48 = sp38.y * 0.01f; - if (SurfaceType_GetSlope(&globalCtx->colCtx, floorPoly, this->actor.floorPolySource) != 1) { + if (SurfaceType_GetSlope(&globalCtx->colCtx, floorPoly, this->actor.floorBgId) != 1) { sp50 = 0; sp48 = sp38.y * 10.0f; } @@ -12437,9 +12438,9 @@ void func_8084F710(Player* this, GlobalContext* globalCtx) { } if ((globalCtx->csCtx.state != 0) && (globalCtx->csCtx.linkAction != NULL)) { - f32 sp28 = this->actor.posRot.pos.y; + f32 sp28 = this->actor.world.pos.y; func_808529D0(globalCtx, this, globalCtx->csCtx.linkAction); - this->actor.posRot.pos.y = sp28; + this->actor.world.pos.y = sp28; } } @@ -12513,7 +12514,7 @@ void func_8084FB10(Player* this, GlobalContext* globalCtx) { if (func_80832594(this, 1, 100)) { this->unk_84F = -1; - EffectSsIcePiece_SpawnBurst(globalCtx, &this->actor.posRot.pos, this->actor.scale.x); + EffectSsIcePiece_SpawnBurst(globalCtx, &this->actor.world.pos, this->actor.scale.x); func_8002F7DC(&this->actor, NA_SE_PL_ICE_BROKEN); } else { this->stateFlags2 |= 0x4000; @@ -12571,9 +12572,9 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { if (!CHECK_BTN_ALL(sControlInput->cur.button, BTN_L)) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { - this->actor.posRot.pos.y += speed; + this->actor.world.pos.y += speed; } else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_A)) { - this->actor.posRot.pos.y -= speed; + this->actor.world.pos.y -= speed; } if (CHECK_BTN_ANY(sControlInput->cur.button, BTN_DUP | BTN_DLEFT | BTN_DDOWN | BTN_DRIGHT)) { @@ -12590,8 +12591,8 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { angle = temp - 0x4000; } - this->actor.posRot.pos.x += speed * Math_SinS(angle); - this->actor.posRot.pos.z += speed * Math_CosS(angle); + this->actor.world.pos.x += speed * Math_SinS(angle); + this->actor.world.pos.z += speed * Math_CosS(angle); } } @@ -12606,7 +12607,7 @@ s32 func_8084FCAC(Player* this, GlobalContext* globalCtx) { Flags_SetTempClear(globalCtx, globalCtx->roomCtx.curRoom.num); } - Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos); return 0; } @@ -12638,7 +12639,7 @@ void func_8085002C(Player* this) { D_80858AC8.unk_06 += -D_80858AC8.unk_00 >> 2; D_80858AC8.unk_08 += -D_80858AC8.unk_02 >> 2; - sp26 = this->actor.posRot.rot.y - this->actor.shape.rot.y; + sp26 = this->actor.world.rot.y - this->actor.shape.rot.y; sp28 = (s32)(this->actor.speedXZ * -200.0f * Math_CosS(sp26) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; sp2A = (s32)(this->actor.speedXZ * 100.0f * Math_SinS(sp26) * (Rand_CenteredFloat(2.0f) + 10.0f)) & 0xFFFF; @@ -12741,9 +12742,9 @@ void func_808502D0(Player* this, GlobalContext* globalCtx) { f32 sp2C; shockwavePos.y = func_8083973C(globalCtx, this, &D_80854A40, &shockwavePos); - sp2C = this->actor.posRot.pos.y - shockwavePos.y; + sp2C = this->actor.world.pos.y - shockwavePos.y; - Math_ScaledStepToS(&this->actor.posRot2.rot.x, Math_Atan2S(45.0f, sp2C), 800); + Math_ScaledStepToS(&this->actor.focus.rot.x, Math_Atan2S(45.0f, sp2C), 800); func_80836AB8(this, 1); if ((((this->swordAnimation == 0x16) && LinkAnimation_OnFrame(&this->skelAnime, 7.0f)) || @@ -12806,7 +12807,7 @@ void func_8085076C(Player* this, GlobalContext* globalCtx) { if (this->unk_850 > 20) { this->actor.draw = Player_Draw; - this->actor.posRot.pos.y += 60.0f; + this->actor.world.pos.y += 60.0f; func_80837B9C(this, globalCtx); return; } @@ -12934,19 +12935,19 @@ void func_80850AEC(Player* this, GlobalContext* globalCtx) { func_80832284(globalCtx, this, &D_04002C98); } - Math_Vec3f_Sum(&this->actor.posRot.pos, &this->actor.velocity, &this->actor.posRot.pos); + Math_Vec3f_Sum(&this->actor.world.pos, &this->actor.velocity, &this->actor.world.pos); if (func_80834FBC(this)) { - Math_Vec3f_Copy(&this->actor.pos4, &this->actor.posRot.pos); + Math_Vec3f_Copy(&this->actor.prevPos, &this->actor.world.pos); func_80847BA0(globalCtx, this); - temp = this->actor.posRot.pos.y - this->actor.groundY; + temp = this->actor.world.pos.y - this->actor.floorHeight; if (temp > 20.0f) { temp = 20.0f; } - this->actor.posRot.rot.x = this->actor.shape.rot.x = 0; - this->actor.posRot.pos.y -= temp; + this->actor.world.rot.x = this->actor.shape.rot.x = 0; + this->actor.world.pos.y -= temp; this->linearVelocity = 1.0f; this->actor.velocity.y = 0.0f; func_80837B9C(this, globalCtx); @@ -12958,7 +12959,7 @@ void func_80850AEC(Player* this, GlobalContext* globalCtx) { if ((this->skelAnime.animation != &D_04002C90) || (4.0f <= this->skelAnime.curFrame)) { this->actor.gravity = 0.0f; - Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x, 0x800); + Math_ScaledStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 0x800); func_8083264C(this, 100, 2, 100, 0); } } @@ -13297,8 +13298,8 @@ void func_80851750(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg void func_80851788(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { this->stateFlags1 &= ~0x2000000; - this->currentYaw = this->actor.shape.rot.y = this->actor.posRot.rot.y = - Math_Vec3f_Yaw(&this->actor.posRot.pos, &this->unk_450); + this->currentYaw = this->actor.shape.rot.y = this->actor.world.rot.y = + Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_450); if (this->linearVelocity <= 0.0f) { this->linearVelocity = 0.1f; @@ -13366,7 +13367,7 @@ LinkAnimationHeader* D_80855190[] = { Vec3f D_80855198 = { -1.0f, 70.0f, 20.0f }; void func_808519EC(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - Math_Vec3f_Copy(&this->actor.posRot.pos, &D_80855198); + Math_Vec3f_Copy(&this->actor.world.pos, &D_80855198); this->actor.shape.rot.y = -0x8000; func_808322D0(globalCtx, this, this->ageProperties->unk_9C); func_80832F54(globalCtx, this, 0x28F); @@ -13468,12 +13469,12 @@ void func_80851D80(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg void func_80851DEC(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { LinkAnimation_Update(globalCtx, &this->skelAnime); - Math_StepToS(&this->actor.shape.unk_06, 0, 1); + Math_StepToS(&this->actor.shape.face, 0, 1); } void func_80851E28(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { LinkAnimation_Update(globalCtx, &this->skelAnime); - Math_StepToS(&this->actor.shape.unk_06, 2, 1); + Math_StepToS(&this->actor.shape.face, 2, 1); } void func_80851E64(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { @@ -13501,7 +13502,7 @@ void func_80851F14(GlobalContext* globalCtx, Player* this, LinkAnimationHeader* } void func_80851F84(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - this->actor.shape.shadowDrawFunc = NULL; + this->actor.shape.shadowDraw = NULL; func_80851134(globalCtx, this, &D_04002420); } @@ -13518,7 +13519,7 @@ void func_80851FB0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg } else if (this->unk_850 == 0) { func_80832924(this, D_808551BC); if (LinkAnimation_OnFrame(&this->skelAnime, 240.0f)) { - this->actor.shape.shadowDrawFunc = ActorShadow_DrawFunc_Teardrop; + this->actor.shape.shadowDraw = ActorShadow_DrawFeet; } } } @@ -13549,9 +13550,9 @@ void func_808520BC(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg f32 distZ = (arg2->endPos.z - startZ); f32 sp4 = (f32)(globalCtx->csCtx.frames - arg2->startFrame) / (f32)(arg2->endFrame - arg2->startFrame); - this->actor.posRot.pos.x = distX * sp4 + startX; - this->actor.posRot.pos.y = distY * sp4 + startY; - this->actor.posRot.pos.z = distZ * sp4 + startZ; + this->actor.world.pos.x = distX * sp4 + startX; + this->actor.world.pos.y = distY * sp4 + startY; + this->actor.world.pos.z = distZ * sp4 + startZ; } struct_80832924 D_808551D8[] = { @@ -13787,19 +13788,19 @@ void func_80852944(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg } void func_808529D0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - this->actor.posRot.pos.x = arg2->startPos.x; - this->actor.posRot.pos.y = arg2->startPos.y; + this->actor.world.pos.x = arg2->startPos.x; + this->actor.world.pos.y = arg2->startPos.y; if ((globalCtx->sceneNum == SCENE_SPOT04) && LINK_IS_CHILD) { - this->actor.posRot.pos.y -= 1.0f; + this->actor.world.pos.y -= 1.0f; } - this->actor.posRot.pos.z = arg2->startPos.z; + this->actor.world.pos.z = arg2->startPos.z; this->currentYaw = this->actor.shape.rot.y = arg2->rot.y; } void func_80852A54(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { - f32 dx = arg2->startPos.x - (s32)this->actor.posRot.pos.x; - f32 dy = arg2->startPos.y - (s32)this->actor.posRot.pos.y; - f32 dz = arg2->startPos.z - (s32)this->actor.posRot.pos.z; + f32 dx = arg2->startPos.x - (s32)this->actor.world.pos.x; + f32 dy = arg2->startPos.y - (s32)this->actor.world.pos.y; + f32 dz = arg2->startPos.z - (s32)this->actor.world.pos.z; f32 dist = sqrtf(SQ(dx) + SQ(dy) + SQ(dz)); s16 yawDiff = arg2->rot.y - this->actor.shape.rot.y; @@ -13984,11 +13985,11 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { if (func_808332B8(this)) { func_80836898(globalCtx, this, func_8083A2F8); func_80832C6C(globalCtx, this, &D_04003328); - } else if ((actor->type != ACTORTYPE_NPC) || (this->heldItemActionParam == PLAYER_AP_FISHING_POLE)) { + } else if ((actor->category != ACTORCAT_NPC) || (this->heldItemActionParam == PLAYER_AP_FISHING_POLE)) { func_8083A2F8(globalCtx, this); if (!func_8008E9C4(this)) { - if ((actor != this->naviActor) && (actor->xzDistToLink < 40.0f)) { + if ((actor != this->naviActor) && (actor->xzDistToPlayer < 40.0f)) { func_808322D0(globalCtx, this, &D_04002DF0); } else { func_80832284(globalCtx, this, func_80833338(this)); @@ -13996,7 +13997,7 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { } } else { func_80836898(globalCtx, this, func_8083A2F8); - func_808322D0(globalCtx, this, (actor->xzDistToLink < 40.0f) ? &D_04002DF0 : &D_040031A0); + func_808322D0(globalCtx, this, (actor->xzDistToPlayer < 40.0f) ? &D_04002DF0 : &D_040031A0); } if (this->skelAnime.animation == &D_04002DF0) { diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c index 7fac9d0ce2..79b8003789 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.c @@ -44,10 +44,10 @@ u32 EffectSsEnFire_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, voi this->rUnused = -15; if (initParams->bodyPart < 0) { - this->rYaw = Math_Vec3f_Yaw(&initParams->actor->posRot.pos, &initParams->pos) - initParams->actor->shape.rot.y; + this->rYaw = Math_Vec3f_Yaw(&initParams->actor->world.pos, &initParams->pos) - initParams->actor->shape.rot.y; this->rPitch = - Math_Vec3f_Pitch(&initParams->actor->posRot.pos, &initParams->pos) - initParams->actor->shape.rot.x; - this->vec.z = Math_Vec3f_DistXYZ(&initParams->pos, &initParams->actor->posRot.pos); + Math_Vec3f_Pitch(&initParams->actor->world.pos, &initParams->pos) - initParams->actor->shape.rot.x; + this->vec.z = Math_Vec3f_DistXYZ(&initParams->pos, &initParams->actor->world.pos); } this->rScaleMax = initParams->scale; @@ -120,14 +120,14 @@ void EffectSsEnFire_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) this->rScroll++; if (this->actor != NULL) { - if (this->actor->dmgEffectTimer >= 22) { + if (this->actor->colorFilterTimer >= 22) { this->life++; } if (this->actor->update != NULL) { Math_SmoothStepToS(&this->rScale, this->rScaleMax, 1, this->rScaleMax >> 3, 0); if (this->rBodyPart < 0) { - Matrix_Translate(this->actor->posRot.pos.x, this->actor->posRot.pos.y, this->actor->posRot.pos.z, + Matrix_Translate(this->actor->world.pos.x, this->actor->world.pos.y, this->actor->world.pos.z, MTXMODE_NEW); Matrix_RotateY((this->rYaw + this->actor->shape.rot.y) * 0.0000958738f, MTXMODE_APPLY); Matrix_RotateX((this->rPitch + this->actor->shape.rot.x) * 0.0000958738f, MTXMODE_APPLY); diff --git a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c index 0e5caa4840..07178c36ce 100644 --- a/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c +++ b/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.c @@ -39,9 +39,9 @@ u32 EffectSsEnIce_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; this->pos = initParams->pos; - this->vec.x = this->pos.x - initParams->actor->posRot.pos.x; - this->vec.y = this->pos.y - initParams->actor->posRot.pos.y; - this->vec.z = this->pos.z - initParams->actor->posRot.pos.z; + this->vec.x = this->pos.x - initParams->actor->world.pos.x; + this->vec.y = this->pos.y - initParams->actor->world.pos.y; + this->vec.z = this->pos.z - initParams->actor->world.pos.z; this->velocity = zeroVec; this->accel = zeroVec; this->life = 10; @@ -138,14 +138,14 @@ void EffectSsEnIce_UpdateFlying(GlobalContext* globalCtx, u32 index, EffectSs* t s16 rand; if ((this->actor != NULL) && (this->actor->update != NULL)) { - if ((this->life >= 9) && (this->actor->dmgEffectTimer != 0) && (!(this->actor->dmgEffectParams & 0xC000))) { - this->pos.x = this->actor->posRot.pos.x + this->vec.x; - this->pos.y = this->actor->posRot.pos.y + this->vec.y; - this->pos.z = this->actor->posRot.pos.z + this->vec.z; + if ((this->life >= 9) && (this->actor->colorFilterTimer != 0) && (!(this->actor->colorFilterParams & 0xC000))) { + this->pos.x = this->actor->world.pos.x + this->vec.x; + this->pos.y = this->actor->world.pos.y + this->vec.y; + this->pos.z = this->actor->world.pos.z + this->vec.z; this->life++; } else if (this->life == 9) { - this->accel.x = Math_SinS(Math_Vec3f_Yaw(&this->actor->posRot.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); - this->accel.z = Math_CosS(Math_Vec3f_Yaw(&this->actor->posRot.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); + this->accel.x = Math_SinS(Math_Vec3f_Yaw(&this->actor->world.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); + this->accel.z = Math_CosS(Math_Vec3f_Yaw(&this->actor->world.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f); this->accel.y = -1.5f; this->velocity.y = 5.0f; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c index ed3fc838ef..b8fa5dd544 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.c @@ -28,9 +28,9 @@ u32 EffectSsFcircle_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo this->pos = initParams->pos; this->actor = initParams->actor; - this->vec.x = initParams->pos.x - initParams->actor->posRot.pos.x; - this->vec.y = initParams->pos.y - initParams->actor->posRot.pos.y; - this->vec.z = initParams->pos.z - initParams->actor->posRot.pos.z; + this->vec.x = initParams->pos.x - initParams->actor->world.pos.x; + this->vec.y = initParams->pos.y - initParams->actor->world.pos.y; + this->vec.z = initParams->pos.z - initParams->actor->world.pos.z; this->gfx = D_040184B0; this->life = 20; this->draw = EffectSsFcircle_Draw; @@ -77,15 +77,15 @@ void EffectSsFcircle_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) if (actor != NULL) { if (actor->update != NULL) { - this->pos.x = actor->posRot.pos.x + this->vec.x; - this->pos.y = actor->posRot.pos.y + this->vec.y; - this->pos.z = actor->posRot.pos.z + this->vec.z; + this->pos.x = actor->world.pos.x + this->vec.x; + this->pos.y = actor->world.pos.y + this->vec.y; + this->pos.z = actor->world.pos.z + this->vec.z; this->rYaw = actor->shape.rot.y; - if (actor->dmgEffectTimer > 20) { + if (actor->colorFilterTimer > 20) { this->life = 20; } else { - this->life = actor->dmgEffectTimer; + this->life = actor->colorFilterTimer; } Math_StepToS(&this->rScale, 100, 20); diff --git a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c index 56f29f956c..0db7f20ffa 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.c @@ -85,8 +85,8 @@ void EffectSsFireTail_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) this->vec = this->actor->velocity; if (this->rBodyPart < 0) { - Matrix_Translate(this->pos.x + this->actor->posRot.pos.x, this->pos.y + this->actor->posRot.pos.y, - this->pos.z + this->actor->posRot.pos.z, MTXMODE_NEW); + Matrix_Translate(this->pos.x + this->actor->world.pos.x, this->pos.y + this->actor->world.pos.y, + this->pos.z + this->actor->world.pos.z, MTXMODE_NEW); } else { Player* player = PLAYER; s16 bodyPart = this->rBodyPart; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c index 9613bbfdb7..122b190643 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.c @@ -40,9 +40,9 @@ u32 EffectSsGSpk_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* if (initParams->updateMode == 0) { this->life = 10; - this->vec.x = initParams->pos.x - initParams->actor->posRot.pos.x; - this->vec.y = initParams->pos.y - initParams->actor->posRot.pos.y; - this->vec.z = initParams->pos.z - initParams->actor->posRot.pos.z; + this->vec.x = initParams->pos.x - initParams->actor->world.pos.x; + this->vec.y = initParams->pos.y - initParams->actor->world.pos.y; + this->vec.z = initParams->pos.z - initParams->actor->world.pos.z; this->update = EffectSsGSpk_Update; } else { this->life = 5; @@ -114,10 +114,10 @@ void EffectSsGSpk_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { this->accel.z = (Rand_ZeroOne() - 0.5f) * 3.0f; if (this->actor != NULL) { - if ((this->actor->type == ACTORTYPE_EXPLOSIVES) && (this->actor->update != NULL)) { - this->pos.x = this->actor->posRot.pos.x + this->vec.x; - this->pos.y = this->actor->posRot.pos.y + this->vec.y; - this->pos.z = this->actor->posRot.pos.z + this->vec.z; + if ((this->actor->category == ACTORCAT_EXPLOSIVE) && (this->actor->update != NULL)) { + this->pos.x = this->actor->world.pos.x + this->vec.x; + this->pos.y = this->actor->world.pos.y + this->vec.y; + this->pos.z = this->actor->world.pos.z + this->vec.z; } } @@ -133,9 +133,9 @@ void EffectSsGSpk_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { // with this update mode, the sparks dont move randomly in the xz plane, appearing to be on top of each other void EffectSsGSpk_UpdateNoAccel(GlobalContext* globalCtx, u32 index, EffectSs* this) { if (this->actor != NULL) { - if ((this->actor->type == ACTORTYPE_EXPLOSIVES) && (this->actor->update != NULL)) { - this->pos.x += (Math_SinS(this->actor->posRot.rot.y) * this->actor->speedXZ); - this->pos.z += (Math_CosS(this->actor->posRot.rot.y) * this->actor->speedXZ); + if ((this->actor->category == ACTORCAT_EXPLOSIVE) && (this->actor->update != NULL)) { + this->pos.x += (Math_SinS(this->actor->world.rot.y) * this->actor->speedXZ); + this->pos.z += (Math_CosS(this->actor->world.rot.y) * this->actor->speedXZ); } } diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c index a71735a9d2..6c3f1b378d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c @@ -124,7 +124,7 @@ void EffectSsHahen_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) { this->rPitch += 55; this->rYaw += 10; - if ((this->pos.y <= player->actor.groundY) && (this->life < this->rMinLife)) { + if ((this->pos.y <= player->actor.floorHeight) && (this->life < this->rMinLife)) { this->life = 0; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index 5d4caec916..d795fc7be8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -352,7 +352,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) { if (this->rReg8 == 0) { if ((((this->rReg4 >> 4) & 1) * 0x10) == 0x10) { - if (this->pos.y <= (player->actor.groundY - ((this->rReg4 >> 2) & 3))) { + if (this->pos.y <= (player->actor.floorHeight - ((this->rReg4 >> 2) & 3))) { this->rReg9 = 0; this->rReg0 = 0; this->rReg4 &= ~0x60; @@ -362,7 +362,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) { this->rGravity = this->rReg9; } } else { - if (this->pos.y <= ((player->actor.groundY - ((this->rReg4 >> 2) & 3)) - 600.0f)) { + if (this->pos.y <= ((player->actor.floorHeight - ((this->rReg4 >> 2) & 3)) - 600.0f)) { this->life = 0; } } diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c index bb79b0a561..2b0467a8ae 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c @@ -87,7 +87,7 @@ void EffectSsSibuki_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) s16 yaw; Player* player = PLAYER; - if (this->pos.y <= player->actor.groundY) { + if (this->pos.y <= player->actor.floorHeight) { this->life = 0; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index d03a35b442..61ee5e3701 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -39,9 +39,9 @@ void EffectSsSolderSrchBall_Update(GlobalContext* globalCtx, u32 index, EffectSs linkDetected = this->actor; - playerPosDiffX = player->actor.posRot.pos.x - this->pos.x; - playerPosDiffY = player->actor.posRot.pos.y - this->pos.y; - playerPosDiffZ = player->actor.posRot.pos.z - this->pos.z; + playerPosDiffX = player->actor.world.pos.x - this->pos.x; + playerPosDiffY = player->actor.world.pos.y - this->pos.y; + playerPosDiffZ = player->actor.world.pos.z - this->pos.z; if (!BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &this->pos, 30.0f)) { if (sqrtf(SQ(playerPosDiffX) + SQ(playerPosDiffY) + SQ(playerPosDiffZ)) < 70.0f) { diff --git a/tools/ZAPD/.gitrepo b/tools/ZAPD/.gitrepo index 0fe928caf7..66581a7145 100644 --- a/tools/ZAPD/.gitrepo +++ b/tools/ZAPD/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/zeldaret/ZAPD.git branch = master - commit = 6e6ad445a69089b721bea75f6e43b23b14a553b6 - parent = cf6d96f133d98c6b69066c5ff195dc8a4d029444 + commit = 0305ec2c27412557fe831cc8ce23b7d8649809fa + parent = db66460dbb2522a1a9822582f8b7d5205415af93 method = merge cmdver = 0.4.3 diff --git a/tools/ZAPD/ZAPD/ZCollision.cpp b/tools/ZAPD/ZAPD/ZCollision.cpp index 10aace8542..caaf9e9e40 100644 --- a/tools/ZAPD/ZAPD/ZCollision.cpp +++ b/tools/ZAPD/ZAPD/ZCollision.cpp @@ -24,23 +24,23 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con absMaxZ = BitConverter::ToInt16BE(data, rawDataIndex + 10); numVerts = BitConverter::ToInt16BE(data, rawDataIndex + 12); - vtxSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 16) & 0x00FFFFFF; + vtxSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 16); numPolygons = BitConverter::ToInt16BE(data, rawDataIndex + 20); - polySegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 24) & 0x00FFFFFF; - polyTypeDefSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 28) & 0x00FFFFFF; - camDataSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 32) & 0x00FFFFFF; + polySegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 24); + polyTypeDefSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 28); + camDataSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 32); numWaterBoxes = BitConverter::ToInt16BE(data, rawDataIndex + 36); waterBoxSegmentOffset = BitConverter::ToInt32BE(data, rawDataIndex + 40) & 0x00FFFFFF; // HOTSPOT for (int i = 0; i < numVerts; i++) - vertices.push_back(new VertexEntry(rawData, vtxSegmentOffset + (i * 6))); + vertices.push_back(new VertexEntry(rawData, SEG2FILESPACE(vtxSegmentOffset) + (i * 6))); // HOTSPOT for (int i = 0; i < numPolygons; i++) - polygons.push_back(new PolygonEntry(rawData, polySegmentOffset + (i * 16))); + polygons.push_back(new PolygonEntry(rawData, SEG2FILESPACE(polySegmentOffset) + (i * 16))); int highestPolyType = 0; @@ -53,7 +53,7 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con //if (highestPolyType > 0) { for (int i = 0; i < highestPolyType + 1; i++) - polygonTypes.push_back(BitConverter::ToUInt64BE(data, polyTypeDefSegmentOffset + (i * 8))); + polygonTypes.push_back(BitConverter::ToUInt64BE(data, SEG2FILESPACE(polyTypeDefSegmentOffset) + (i * 8))); } //else //{ @@ -64,7 +64,7 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con //} if (camDataSegmentOffset != 0) - camData = new CameraDataList(parent, prefix, rawData, camDataSegmentOffset, polyTypeDefSegmentOffset, polygonTypes.size()); + camData = new CameraDataList(parent, prefix, rawData, SEG2FILESPACE(camDataSegmentOffset), SEG2FILESPACE(polyTypeDefSegmentOffset), polygonTypes.size()); for (int i = 0; i < numWaterBoxes; i++) waterBoxes.push_back(new WaterBoxHeader(rawData, waterBoxSegmentOffset + (i * 16))); @@ -76,7 +76,7 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con { for (int i = 0; i < waterBoxes.size(); i++) { - sprintf(line, "\t{ %i, %i, %i, %i, %i, 0x%08X },\n", waterBoxes[i]->xMin, waterBoxes[i]->ySurface, waterBoxes[i]->zMin, waterBoxes[i]->xLength, waterBoxes[i]->zLength, waterBoxes[i]->properties); + sprintf(line, " { %i, %i, %i, %i, %i, 0x%08X },\n", waterBoxes[i]->xMin, waterBoxes[i]->ySurface, waterBoxes[i]->zMin, waterBoxes[i]->xLength, waterBoxes[i]->zLength, waterBoxes[i]->properties); declaration += line; } } @@ -91,27 +91,29 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con for (int i = 0; i < polygons.size(); i++) { - sprintf(line, "\t{ 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X }, // 0x%08X\n", + sprintf(line, " { 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X }, // 0x%08X\n", (uint16_t)polygons[i]->type, (uint16_t)polygons[i]->vtxA, (uint16_t)polygons[i]->vtxB, (uint16_t)polygons[i]->vtxC, - (uint16_t)polygons[i]->a, (uint16_t)polygons[i]->b, (uint16_t)polygons[i]->c, (uint16_t)polygons[i]->d, polySegmentOffset + (i * 16)); + (uint16_t)polygons[i]->a, (uint16_t)polygons[i]->b, (uint16_t)polygons[i]->c, (uint16_t)polygons[i]->d, SEG2FILESPACE(polySegmentOffset) + (i * 16)); declaration += line; } if (polySegmentOffset != 0) { - parent->AddDeclarationArray(polySegmentOffset, DeclarationAlignment::None, polygons.size() * 16, "CollisionPoly", StringHelper::Sprintf("%s_polygons_%08X", prefix.c_str(), polySegmentOffset), 0, declaration); + parent->AddDeclarationArray(SEG2FILESPACE(polySegmentOffset), DeclarationAlignment::None, polygons.size() * 16, "CollisionPoly", StringHelper::Sprintf("%s_polygons_%08X", prefix.c_str(), SEG2FILESPACE(polySegmentOffset)), 0, declaration); } } declaration = ""; for (int i = 0; i < polygonTypes.size(); i++) { - sprintf(line, "\t 0x%08lX, 0x%08lX, \n", polygonTypes[i] >> 32, polygonTypes[i] & 0xFFFFFFFF); - declaration += line; + declaration += StringHelper::Sprintf(" 0x%08lX, 0x%08lX,", polygonTypes[i] >> 32, polygonTypes[i] & 0xFFFFFFFF); + + if (i < polygonTypes.size() - 1) + declaration += "\n"; } if (polyTypeDefSegmentOffset != 0) - parent->AddDeclarationArray(polyTypeDefSegmentOffset, DeclarationAlignment::None, polygonTypes.size() * 8, - "u32", StringHelper::Sprintf("%s_polygonTypes_%08X", prefix.c_str(), polyTypeDefSegmentOffset), 0, declaration); + parent->AddDeclarationArray(SEG2FILESPACE(polyTypeDefSegmentOffset), DeclarationAlignment::None, polygonTypes.size() * 8, + "u32", StringHelper::Sprintf("%s_polygonTypes_%08X", prefix.c_str(), SEG2FILESPACE(polyTypeDefSegmentOffset)), 0, declaration); declaration = ""; @@ -121,14 +123,15 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con for (int i = 0; i < vertices.size(); i++) { + declaration += StringHelper::Sprintf(" { %i, %i, %i }, // 0x%08X", vertices[i]->x, vertices[i]->y, vertices[i]->z, SEG2FILESPACE(vtxSegmentOffset) + (i * 6)); - sprintf(line, "{ %i, %i, %i }, // 0x%08X\n", vertices[i]->x, vertices[i]->y, vertices[i]->z, vtxSegmentOffset + (i * 6)); - declaration += line; + if (i < vertices.size() - 1) + declaration += "\n"; } if (vtxSegmentOffset != 0) - parent->AddDeclarationArray(vtxSegmentOffset, DeclarationAlignment::None, vertices.size() * 6, - "Vec3s", StringHelper::Sprintf("%s_vtx_%08X", prefix.c_str(), vtxSegmentOffset), 0, declaration); + parent->AddDeclarationArray(SEG2FILESPACE(vtxSegmentOffset), DeclarationAlignment::None, vertices.size() * 6, + "Vec3s", StringHelper::Sprintf("%s_vtx_%08X", prefix.c_str(), SEG2FILESPACE(vtxSegmentOffset)), 0, declaration); declaration = ""; } @@ -144,9 +147,9 @@ ZCollisionHeader::ZCollisionHeader(ZFile* parent, const std::string& prefix, con declaration += StringHelper::Sprintf("%i, %i, %i, %i, %i, %i, %i, %s_vtx_%08X, %i, %s_polygons_%08X, %s_polygonTypes_%08X, &%s_camDataList_%08X, %i, %s", absMinX, absMinY, absMinZ, absMaxX, absMaxY, absMaxZ, - numVerts, prefix.c_str(), vtxSegmentOffset, numPolygons, - prefix.c_str(), polySegmentOffset, prefix.c_str(), polyTypeDefSegmentOffset, - prefix.c_str(), camDataSegmentOffset, numWaterBoxes, waterBoxStr); + numVerts, prefix.c_str(), SEG2FILESPACE(vtxSegmentOffset), numPolygons, + prefix.c_str(), SEG2FILESPACE(polySegmentOffset), prefix.c_str(), SEG2FILESPACE(polyTypeDefSegmentOffset), + prefix.c_str(), SEG2FILESPACE(camDataSegmentOffset), numWaterBoxes, waterBoxStr); parent->AddDeclaration(rawDataIndex, DeclarationAlignment::None, DeclarationPadding::Pad16, 44, "CollisionHeader", StringHelper::Sprintf("%s", prefix.c_str(), rawDataIndex), declaration); @@ -250,7 +253,10 @@ CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix, const s else sprintf(camSegLine, "0x%08X", entries[i]->cameraPosDataSeg); - declaration += StringHelper::Sprintf("\t{ 0x%04X, %i, %s }, // 0x%08X\n", entries[i]->cameraSType, entries[i]->numData, camSegLine, rawDataIndex + (i * 8)); + declaration += StringHelper::Sprintf("\t{ 0x%04X, %i, %s },", entries[i]->cameraSType, entries[i]->numData, camSegLine, rawDataIndex + (i * 8)); + + if (i < entries.size() - 1) + declaration += "\n"; } parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::None, entries.size() * 8, "CamData", StringHelper::Sprintf("%s_camDataList_%08X", prefix.c_str(), rawDataIndex), entries.size(), declaration); diff --git a/tools/ZAPD/ZAPD/ZCollision.h b/tools/ZAPD/ZAPD/ZCollision.h index 83290ffd98..22402fe805 100644 --- a/tools/ZAPD/ZAPD/ZCollision.h +++ b/tools/ZAPD/ZAPD/ZCollision.h @@ -67,11 +67,11 @@ public: int16_t absMinX, absMinY, absMinZ; int16_t absMaxX, absMaxY, absMaxZ; int16_t numVerts; - int32_t vtxSegmentOffset; + segptr_t vtxSegmentOffset; int16_t numPolygons; - int32_t polySegmentOffset; - int32_t polyTypeDefSegmentOffset; - int32_t camDataSegmentOffset; + segptr_t polySegmentOffset; + segptr_t polyTypeDefSegmentOffset; + segptr_t camDataSegmentOffset; int32_t numWaterBoxes; int32_t waterBoxSegmentOffset; diff --git a/tools/ZAPD/ZAPD/ZCutscene.cpp b/tools/ZAPD/ZAPD/ZCutscene.cpp index 983b0de722..9d71a79d94 100644 --- a/tools/ZAPD/ZAPD/ZCutscene.cpp +++ b/tools/ZAPD/ZAPD/ZCutscene.cpp @@ -126,6 +126,21 @@ int ZCutscene::GetRawDataSize() return size; } +ZCutscene* ZCutscene::ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath) +{ + ZCutscene* cs = new ZCutscene(nRawData, rawDataIndex, 9999); + cs->rawData = nRawData; + cs->rawDataIndex = rawDataIndex; + cs->ParseXML(reader); + cs->ParseRawData(); + + return cs; +} + +void ZCutscene::ParseRawData() +{ +} + CutsceneCommands ZCutscene::GetCommandFromID(int id) { switch (id) diff --git a/tools/ZAPD/ZAPD/ZCutscene.h b/tools/ZAPD/ZAPD/ZCutscene.h index f054e499c7..c57f0613e4 100644 --- a/tools/ZAPD/ZAPD/ZCutscene.h +++ b/tools/ZAPD/ZAPD/ZCutscene.h @@ -408,8 +408,12 @@ public: std::string GetSourceOutputCode(const std::string& prefix); int GetRawDataSize(); -private: + + static ZCutscene* ExtractFromXML(tinyxml2::XMLElement* reader, const std::vector& nRawData, const int rawDataIndex, const std::string& nRelPath); +protected: int numCommands; int endFrame; std::vector commands; + + void ParseRawData(); }; diff --git a/tools/ZAPD/ZAPD/ZDisplayList.cpp b/tools/ZAPD/ZAPD/ZDisplayList.cpp index aaf9e53f4a..300c09082f 100644 --- a/tools/ZAPD/ZAPD/ZDisplayList.cpp +++ b/tools/ZAPD/ZAPD/ZDisplayList.cpp @@ -165,7 +165,7 @@ int ZDisplayList::OptimizationCheck_LoadTextureBlock(int startIndex, string& out Declaration* texDecl = nullptr; - if (parent != nullptr) + if (parent != nullptr && segmentNumber != 2) // HACK: Until we have declarations use segment addresses, we'll exclude scene references... { texDecl = parent->GetDeclaration(texAddr); @@ -345,22 +345,20 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (parent != nullptr) dListDecl = parent->GetDeclaration(SEG2FILESPACE(data)); - // TEST - if (segNum != 8 && scene != nullptr && scene->parent->GetDeclarationName(data & 0x00FFFFFF) != "ERROR_COULD_NOT_FIND_DECLARATION") - { - int bp = 0; - } - if (pp != 0) { - if (dListDecl != nullptr) + if (!Globals::Instance->HasSegment(segNum)) + sprintf(line, "gsSPBranchList(0x%08lX),", data & 0xFFFFFFFF); + else if (dListDecl != nullptr) sprintf(line, "gsSPBranchList(%s),", dListDecl->varName.c_str()); else sprintf(line, "gsSPBranchList(%sDlist0x%06lX),", prefix.c_str(), SEG2FILESPACE(data)); } else { - if (dListDecl != nullptr) + if (!Globals::Instance->HasSegment(segNum)) + sprintf(line, "gsSPDisplayList(0x%08lX),", data & 0xFFFFFFFF); + else if (dListDecl != nullptr) sprintf(line, "gsSPDisplayList(%s),", dListDecl->varName.c_str()); else sprintf(line, "gsSPDisplayList(%sDlist0x%06lX),", prefix.c_str(), SEG2FILESPACE(data)); @@ -379,6 +377,7 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) { ZDisplayList* nList = new ZDisplayList(fileData, data & 0x00FFFFFF, GetDListLength(fileData, data & 0x00FFFFFF)); nList->scene = scene; + nList->parent = parent; otherDLists.push_back(nList); } } @@ -446,27 +445,55 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (GETSEGNUM(data) == 0x80) // Are these vertices defined in code? vtxAddr -= SEG2FILESPACE(parent->baseAddress); - sprintf(line, "gsSPVertex(%sVtx_%06X, %i, %i),", prefix.c_str(), vtxAddr, nn, ((aa >> 1) - nn)); + //sprintf(line, "gsSPVertex(%sVtx_%06X, %i, %i),", prefix.c_str(), vtxAddr, nn, ((aa >> 1) - nn)); + sprintf(line, "gsSPVertex(@r, %i, %i),", nn, ((aa >> 1) - nn)); + references.push_back(vtxAddr); { - uint32_t currentPtr = data & 0x00FFFFFF; + uint32_t currentPtr = SEG2FILESPACE(data); if (GETSEGNUM(data) == 0x80) // Are these vertices defined in code? currentPtr -= SEG2FILESPACE(parent->baseAddress); - vector vtxList = vector(); - - vtxList.reserve(nn); - - for (int i = 0; i < nn; i++) + // Check for vertex intersections from other display lists + // TODO: These two could probably be condenced to one... + if (parent->GetDeclarationRanged(vtxAddr + (nn * 16)) != nullptr) { - Vertex vtx = Vertex(fileData, currentPtr); - vtxList.push_back(vtx); - - currentPtr += 16; + Declaration* decl = parent->GetDeclarationRanged(vtxAddr + (nn * 16)); + uint32_t addr = parent->GetDeclarationRangedAddress(vtxAddr + (nn * 16)); + int diff = addr - vtxAddr; + if (diff > 0) + nn = diff / 16; + else + nn = 0; } - vertices[vtxAddr] = vtxList; + if (parent->GetDeclarationRanged(vtxAddr) != nullptr) + { + Declaration* decl = parent->GetDeclarationRanged(vtxAddr); + uint32_t addr = parent->GetDeclarationRangedAddress(vtxAddr); + int diff = addr - vtxAddr; + if (diff > 0) + nn = diff / 16; + else + nn = 0; + } + + if (nn > 0) + { + vector vtxList = vector(); + vtxList.reserve(nn); + + for (int i = 0; i < nn; i++) + { + Vertex vtx = Vertex(fileData, currentPtr); + vtxList.push_back(vtx); + + currentPtr += 16; + } + + vertices[vtxAddr] = vtxList; + } } } @@ -502,6 +529,9 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) int32_t texAddress = SEG2FILESPACE(data); Declaration* texDecl = nullptr; + if (segmentNumber == 0x80) // Is this texture defined in code? + texAddress -= SEG2FILESPACE(parent->baseAddress); + if (parent != nullptr) { if (Globals::Instance->HasSegment(segmentNumber)) @@ -523,11 +553,13 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) //} //else { - sprintf(texStr, "0x%08lX", data); + sprintf(texStr, "0x%08lX", data & 0xFFFFFFFF); } } sprintf(line, "gsDPSetTextureImage(%s, %s, %i, %s),", fmtTbl[fmt].c_str(), sizTbl[siz].c_str(), www + 1, texStr); + //sprintf(line, "gsDPSetTextureImage(%s, %s, %i, @r),", fmtTbl[fmt].c_str(), sizTbl[siz].c_str(), www + 1); + //references.push_back(data & 0x00FFFFFF); } else { @@ -1002,6 +1034,7 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) ZDisplayList* nList = new ZDisplayList(fileData, h & 0x00FFFFFF, GetDListLength(fileData, h & 0x00FFFFFF)); nList->scene = scene; + nList->parent = parent; otherDLists.push_back(nList); i++; @@ -1056,9 +1089,9 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) vector>> verticesSorted(vertices.begin(), vertices.end()); sort(verticesSorted.begin(), verticesSorted.end(), [](const auto& lhs, const auto& rhs) - { - return lhs.first < rhs.first; - }); + { + return lhs.first < rhs.first; + }); for (int i = 0; i < verticesSorted.size() - 1; i++) { @@ -1075,7 +1108,7 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) vertices[verticesSorted[i].first].push_back(verticesSorted[i + 1].second[j]); } - defines += StringHelper::Sprintf("#define %sVtx_%06X ((u32)%sVtx_%06X + 0x%06X)\n", prefix.c_str(), verticesSorted[i + 1].first, prefix.c_str(), verticesSorted[i].first, verticesSorted[i + 1].first - verticesSorted[i].first); + //defines += StringHelper::Sprintf("#define %sVtx_%06X ((u32)%sVtx_%06X + 0x%06X)\n", prefix.c_str(), verticesSorted[i + 1].first, prefix.c_str(), verticesSorted[i].first, verticesSorted[i + 1].first - verticesSorted[i].first); int nSize = (int)vertices[verticesSorted[i].first].size(); @@ -1111,10 +1144,11 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (parent != nullptr) { - parent->AddDeclarationArray(item.first, DeclarationAlignment::None, item.second.size() * 16, "static Vtx", + parent->AddDeclarationArray(item.first, DeclarationAlignment::None, item.second.size() * 16, "static Vtx", StringHelper::Sprintf("%sVtx_%06X", prefix.c_str(), item.first, item.second.size()), item.second.size(), declaration); } } + } // Check for texture intersections { @@ -1153,9 +1187,9 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) vector> texturesSorted(textures.begin(), textures.end()); sort(texturesSorted.begin(), texturesSorted.end(), [](const auto& lhs, const auto& rhs) - { - return lhs.first < rhs.first; - }); + { + return lhs.first < rhs.first; + }); for (int i = 0; i < texturesSorted.size() - 1; i++) { @@ -1163,15 +1197,15 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) break; int texSize = textures[texturesSorted[i].first]->GetRawDataSize(); - + if ((texturesSorted[i].first + texSize) > texturesSorted[i + 1].first) { int intersectAmt = (texturesSorted[i].first + texSize) - texturesSorted[i + 1].first; - + // If we're working with a palette, resize it to its "real" dimensions if (texturesSorted[i].second->isPalette) { - texturesSorted[i].second->SetWidth(intersectAmt / 2); + texturesSorted[i].second->SetWidth((texturesSorted[i + 1].first - texturesSorted[i].first) / 2); texturesSorted[i].second->SetHeight(1); } else @@ -1187,7 +1221,6 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) } } } - } // Generate Texture Declarations for (pair item : textures) @@ -1218,7 +1251,8 @@ string ZDisplayList::GetSourceOutputCode(const std::string& prefix) if (parent != nullptr) { - parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), "Gfx", StringHelper::Sprintf("%s", name.c_str()), 0, sourceOutput); + Declaration* decl = parent->AddDeclarationArray(rawDataIndex, DeclarationAlignment::None, GetRawDataSize(), "Gfx", StringHelper::Sprintf("%s", name.c_str()), 0, sourceOutput); + decl->references = references; return ""; } @@ -1244,7 +1278,7 @@ bool ZDisplayList::TextureGenCheck(vector fileData, mapverbosity >= VERBOSITY_DEBUG) printf("TextureGenCheck seg=%i width=%i height=%i ispal=%i addr=0x%06X\n", segmentNumber, texWidth, texHeight, texIsPalette, texAddr); - if (texAddr != 0 && texWidth != 0 && texHeight != 0 && texLoaded && Globals::Instance->HasSegment(segmentNumber)) + if ((texSeg != 0 || texAddr != 0) && texWidth != 0 && texHeight != 0 && texLoaded && Globals::Instance->HasSegment(segmentNumber)) { if (segmentNumber != 2) // Not from a scene file { diff --git a/tools/ZAPD/ZAPD/ZDisplayList.h b/tools/ZAPD/ZAPD/ZDisplayList.h index cb8a75f111..38bff7d4f6 100644 --- a/tools/ZAPD/ZAPD/ZDisplayList.h +++ b/tools/ZAPD/ZAPD/ZDisplayList.h @@ -244,6 +244,8 @@ public: std::map textures; std::map texDeclarations; + std::vector references; + std::string defines; // Hack for special cases where vertex arrays intersect... std::vector fileData; diff --git a/tools/ZAPD/ZAPD/ZFile.cpp b/tools/ZAPD/ZAPD/ZFile.cpp index 0c48d6bf16..98120a8171 100644 --- a/tools/ZAPD/ZAPD/ZFile.cpp +++ b/tools/ZAPD/ZAPD/ZFile.cpp @@ -8,6 +8,7 @@ #include "ZCollision.h" #include "ZScalar.h" #include "ZVector.h" +#include "ZCutscene.h" #include "Path.h" #include "File.h" #include "Directory.h" @@ -288,6 +289,20 @@ void ZFile::ParseXML(ZFileMode mode, XMLElement* reader, bool placeholderMode) printf("No ZVector created!!"); } } + else if (string(child->Name()) == "Cutscene") + { + ZCutscene* cs = nullptr; + + if (mode == ZFileMode::Extract) + cs = ZCutscene::ExtractFromXML(child, rawData, rawDataIndex, folderName); + + if (cs != nullptr) + { + cs->parent = this; + resources.push_back(cs); + rawDataIndex += cs->GetRawDataSize(); + } + } else { if (Globals::Instance->verbosity >= VERBOSITY_DEBUG) @@ -394,7 +409,7 @@ Declaration* ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignm return decl; } -void ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, std::string body) +Declaration* ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, std::string body) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -406,9 +421,10 @@ void ZFile::AddDeclaration(uint32_t address, DeclarationAlignment alignment, Dec AddDeclarationDebugChecks(address); declarations[address] = new Declaration(alignment, padding, size, varType, varName, false, body); + return declarations[address]; } -void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body) +Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -420,10 +436,11 @@ void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment AddDeclarationDebugChecks(address); declarations[address] = new Declaration(alignment, size, varType, varName, true, arrayItemCnt, body); + return declarations[address]; } -void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, int arrayItemCnt, std::string body) +Declaration* ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, string varType, string varName, int arrayItemCnt, std::string body) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -435,34 +452,41 @@ void ZFile::AddDeclarationArray(uint32_t address, DeclarationAlignment alignment AddDeclarationDebugChecks(address); declarations[address] = new Declaration(alignment, padding, size, varType, varName, true, arrayItemCnt, body); + return declarations[address]; } -void ZFile::AddDeclarationPlaceholder(uint32_t address) +Declaration* ZFile::AddDeclarationPlaceholder(uint32_t address) { AddDeclarationDebugChecks(address); if (declarations.find(address) == declarations.end()) declarations[address] = new Declaration(DeclarationAlignment::None, 0, "", "", false, ""); + + return declarations[address]; } -void ZFile::AddDeclarationPlaceholder(uint32_t address, string varName) +Declaration* ZFile::AddDeclarationPlaceholder(uint32_t address, string varName) { AddDeclarationDebugChecks(address); if (declarations.find(address) == declarations.end()) declarations[address] = new Declaration(DeclarationAlignment::None, 0, "", varName, false, ""); + + return declarations[address]; } -void ZFile::AddDeclarationInclude(uint32_t address, string includePath, uint32_t size, string varType, string varName) +Declaration* ZFile::AddDeclarationInclude(uint32_t address, string includePath, uint32_t size, string varType, string varName) { AddDeclarationDebugChecks(address); if (declarations.find(address) == declarations.end()) declarations[address] = new Declaration(includePath, size, varType, varName); + + return declarations[address]; } -void ZFile::AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt) +Declaration* ZFile::AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt) { #if _DEBUG if (declarations.find(address) != declarations.end()) @@ -479,12 +503,13 @@ void ZFile::AddDeclarationIncludeArray(uint32_t address, std::string includePath decl->arrayItemCnt = arrayItemCnt; declarations[address] = decl; + return declarations[address]; } void ZFile::AddDeclarationDebugChecks(uint32_t address) { #ifdef _DEBUG - if (address == 0xB888E0) + if (address == 0x5600) { int bp = 0; } @@ -516,15 +541,24 @@ Declaration* ZFile::GetDeclarationRanged(uint32_t address) { for (const auto decl : declarations) { - if (address >= decl.first && address <= decl.first + decl.second->size) - { + if (address >= decl.first && address < decl.first + decl.second->size) return decl.second; - } } return nullptr; } +uint32_t ZFile::GetDeclarationRangedAddress(uint32_t address) +{ + for (const auto decl : declarations) + { + if (address >= decl.first && address < decl.first + decl.second->size) + return decl.first; + } + + return 0xFFFFFFFF; +} + bool ZFile::HasDeclaration(uint32_t address) { return (declarations.find(address) != declarations.end()); @@ -661,6 +695,41 @@ string ZFile::ProcessDeclarations() //printf("RANGE START: 0x%06X - RANGE END: 0x%06X\n", rangeStart, rangeEnd); + // Optimization: See if there are any arrays side by side that can be merged... + //pair lastItem = declarationKeysSorted[0]; + + //for (int i = 1; i < declarationKeysSorted.size(); i++) + //{ + // pair curItem = declarationKeysSorted[i]; + + // if (curItem.second->isArray && lastItem.second->isArray) + // { + // if (curItem.second->varType == lastItem.second->varType) + // { + // // TEST: For now just do Vtx declarations... + // if (lastItem.second->varType == "static Vtx") + // { + // lastItem.second->size += curItem.second->size; + // lastItem.second->arrayItemCnt += curItem.second->arrayItemCnt; + // lastItem.second->text += "\n" + curItem.second->text; + // declarations.erase(curItem.first); + // declarationKeysSorted.erase(declarationKeysSorted.begin() + i); + // i--; + // continue; + + // int bp = 0; + // } + // } + // } + + // lastItem = curItem; + //} + + for (pair item : declarations) + { + ProcessDeclarationText(item.second); + } + for (pair item : declarationKeysSorted) { while (declarations[item.first]->size % 4 != 0) @@ -756,7 +825,7 @@ string ZFile::ProcessDeclarations() uint8_t* rawDataArr = rawData.data(); - if (lastAddr + lastSize != item.first) + if (lastAddr + lastSize != item.first && lastAddr >= rangeStart && lastAddr + lastSize < rangeEnd) { //int diff = item.first - (lastAddr + declarations[lastAddr]->size); int diff = item.first - (lastAddr + lastSize); @@ -887,6 +956,44 @@ string ZFile::ProcessDeclarations() return output; } +void ZFile::ProcessDeclarationText(Declaration* decl) +{ + int refIndex = 0; + + if (decl->references.size() > 0) + { + for (int i = 0; i < decl->text.size() - 1; i++) + { + char c = decl->text[i]; + char c2 = decl->text[i + 1]; + + if (c == '@' && c2 == 'r') + { + Declaration* refDecl = GetDeclarationRanged(decl->references[refIndex]); + uint32_t refDeclAddr = GetDeclarationRangedAddress(decl->references[refIndex]); + + if (refDecl != nullptr) + { + if (refDecl->isArray) + { + int itemSize = refDecl->size / refDecl->arrayItemCnt; + int itemIndex = (decl->references[refIndex] - refDeclAddr) / itemSize; + + decl->text.replace(i, 2, StringHelper::Sprintf("&%s[%i]", refDecl->varName.c_str(), itemIndex)); + } + else + { + decl->text.replace(i, 2, refDecl->varName); + } + } + else + decl->text.replace(i, 2, "ERROR"); + + refIndex++; + } + } + } +} string ZFile::ProcessExterns() { diff --git a/tools/ZAPD/ZAPD/ZFile.h b/tools/ZAPD/ZAPD/ZFile.h index 68b34dd8d0..aa642d810f 100644 --- a/tools/ZAPD/ZAPD/ZFile.h +++ b/tools/ZAPD/ZAPD/ZFile.h @@ -37,17 +37,18 @@ public: void AddResource(ZResource* res); Declaration* AddDeclaration(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, std::string body); - void AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, std::string body); - void AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); - void AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); - void AddDeclarationPlaceholder(uint32_t address); - void AddDeclarationPlaceholder(uint32_t address, std::string varName); - void AddDeclarationInclude(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName); - void AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt); + Declaration* AddDeclaration(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, std::string body); + Declaration* AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); + Declaration* AddDeclarationArray(uint32_t address, DeclarationAlignment alignment, DeclarationPadding padding, uint32_t size, std::string varType, std::string varName, int arrayItemCnt, std::string body); + Declaration* AddDeclarationPlaceholder(uint32_t address); + Declaration* AddDeclarationPlaceholder(uint32_t address, std::string varName); + Declaration* AddDeclarationInclude(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName); + Declaration* AddDeclarationIncludeArray(uint32_t address, std::string includePath, uint32_t size, std::string varType, std::string varName, int arrayItemCnt); std::string GetDeclarationName(uint32_t address); std::string GetDeclarationName(uint32_t address, std::string defaultResult); Declaration* GetDeclaration(uint32_t address); Declaration* GetDeclarationRanged(uint32_t address); + uint32_t GetDeclarationRangedAddress(uint32_t address); bool HasDeclaration(uint32_t address); std::string GetHeaderInclude(); void GeneratePlaceholderDeclarations(); @@ -65,5 +66,6 @@ protected: void GenerateHLIntermediette(); void AddDeclarationDebugChecks(uint32_t address); std::string ProcessDeclarations(); + void ProcessDeclarationText(Declaration* decl); std::string ProcessExterns(); }; \ No newline at end of file diff --git a/tools/ZAPD/ZAPD/ZResource.h b/tools/ZAPD/ZAPD/ZResource.h index c786339d9d..ff25bdcfef 100644 --- a/tools/ZAPD/ZAPD/ZResource.h +++ b/tools/ZAPD/ZAPD/ZResource.h @@ -16,6 +16,8 @@ #define SEG2FILESPACE(x) (x & 0x00FFFFFF) #define GETSEGNUM(x) ((x >> 24) & 0xFF) +typedef uint32_t segptr_t; + class ZFile; class HLFileIntermediette; @@ -108,6 +110,7 @@ public: std::string includePath; bool isArray; int arrayItemCnt; + std::vector references; Declaration(DeclarationAlignment nAlignment, uint32_t nSize, std::string nVarType, std::string nVarName, bool nIsArray, std::string nText); Declaration(DeclarationAlignment nAlignment, DeclarationPadding nPadding, uint32_t nSize, std::string nVarType, std::string nVarName, bool nIsArray, std::string nText); diff --git a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp index b0c2f58a82..1f343c64ff 100644 --- a/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp +++ b/tools/ZAPD/ZAPD/ZRoom/Commands/SetMesh.cpp @@ -47,6 +47,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->opaqueDList = new ZDisplayList(rawData, entry->opaqueDListAddr, ZDisplayList::GetDListLength(rawData, entry->opaqueDListAddr)); entry->opaqueDList->scene = zRoom->scene; + entry->opaqueDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->opaqueDList); } @@ -54,6 +55,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->translucentDList = new ZDisplayList(rawData, entry->translucentDListAddr, ZDisplayList::GetDListLength(rawData, entry->translucentDListAddr)); entry->translucentDList->scene = zRoom->scene; + entry->translucentDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->translucentDList); } @@ -206,6 +208,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->opaqueDList = new ZDisplayList(rawData, entry->opaqueDListAddr, ZDisplayList::GetDListLength(rawData, entry->opaqueDListAddr)); entry->opaqueDList->scene = zRoom->scene; + entry->opaqueDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->opaqueDList); // HOTSPOT } @@ -213,6 +216,7 @@ SetMesh::SetMesh(ZRoom* nZRoom, std::vector rawData, int rawDataIndex, { entry->translucentDList = new ZDisplayList(rawData, entry->translucentDListAddr, ZDisplayList::GetDListLength(rawData, entry->translucentDListAddr)); entry->translucentDList->scene = zRoom->scene; + entry->translucentDList->parent = zRoom->parent; GenDListDeclarations(rawData, entry->translucentDList); // HOTSPOT } @@ -291,16 +295,17 @@ SetMesh::~SetMesh() void SetMesh::GenDListDeclarations(std::vector rawData, ZDisplayList* dList) { - string sourceOutput = dList->GetSourceOutputCode(zRoom->GetName()); // HOTSPOT - string srcVarName = ""; - if (Globals::Instance->includeFilePrefix) + //if (Globals::Instance->includeFilePrefix) srcVarName = StringHelper::Sprintf("%s%s", zRoom->GetName().c_str(), dList->GetName().c_str()); - else - srcVarName = StringHelper::Sprintf("%s", dList->GetName().c_str()); + //else + //srcVarName = StringHelper::Sprintf("%s", dList->GetName().c_str()); - zRoom->parent->AddDeclarationArray(dList->GetRawDataIndex(), DeclarationAlignment::None, dList->GetRawDataSize(), "static Gfx", srcVarName, dList->GetRawDataSize() / 8, sourceOutput); + dList->SetName(srcVarName); + string sourceOutput = dList->GetSourceOutputCode(zRoom->GetName()); // HOTSPOT + + //zRoom->parent->AddDeclarationArray(dList->GetRawDataIndex(), DeclarationAlignment::None, dList->GetRawDataSize(), "static Gfx", srcVarName, dList->GetRawDataSize() / 8, sourceOutput); for (ZDisplayList* otherDList : dList->otherDLists) GenDListDeclarations(rawData, otherDList); @@ -324,7 +329,7 @@ void SetMesh::GenDListDeclarations(std::vector rawData, ZDisplayList* d zRoom->parent->AddDeclarationIncludeArray(texEntry.first, StringHelper::Sprintf("%s/%s.%s.inc.c", Globals::Instance->outputPath.c_str(), Path::GetFileNameWithoutExtension(zRoom->textures[texEntry.first]->GetName()).c_str(), zRoom->textures[texEntry.first]->GetExternalExtension().c_str()), - zRoom->textures[texEntry.first]->GetRawDataSize(), "u64", StringHelper::Sprintf("%sTex_%06X", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0); + zRoom->textures[texEntry.first]->GetRawDataSize(), "u64", StringHelper::Sprintf("%s", zRoom->textures[texEntry.first]->GetName().c_str(), texEntry.first), 0); } } diff --git a/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp b/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp index 95d9fff027..dafc8109da 100644 --- a/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp +++ b/tools/ZAPD/ZAPD/ZRoom/ZRoom.cpp @@ -81,8 +81,10 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r for (XMLElement* child = reader->FirstChildElement(); child != NULL; child = child->NextSiblingElement()) { + // TODO: Bunch of repeated code between all of these that needs to be combined. if (string(child->Name()) == "DListHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -92,11 +94,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r int address = strtol(StringHelper::Split(addressStr, "0x")[1].c_str(), NULL, 16); ZDisplayList* dList = new ZDisplayList(room->rawData, address, ZDisplayList::GetDListLength(room->rawData, address)); - dList->GetSourceOutputCode(room->name); + + if (child->Attribute("Name") != NULL) + name = string(child->Attribute("Name")); + else + name = room->name; + + dList->GetSourceOutputCode(name); delete dList; } else if (string(child->Name()) == "BlobHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -109,10 +118,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r int size = strtol(StringHelper::Split(sizeStr, "0x")[1].c_str(), NULL, 16); ZBlob* blob = new ZBlob(room->rawData, address, size, StringHelper::Sprintf("%sBlob0x%06X", room->name.c_str(), address)); - room->parent->AddDeclarationArray(address, DeclarationAlignment::None, blob->GetRawDataSize(), "u8", StringHelper::Sprintf("%s_%s", room->name.c_str(), blob->GetName().c_str()), 0, blob->GetSourceOutputCode(room->name)); + + if (child->Attribute("Name") != NULL) + name = string(child->Attribute("Name")); + else + name = StringHelper::Sprintf("%s_%s", room->name.c_str(), blob->GetName().c_str()); + + room->parent->AddDeclarationArray(address, DeclarationAlignment::None, blob->GetRawDataSize(), "u8", name, 0, blob->GetSourceOutputCode(room->name)); + delete blob; } else if (string(child->Name()) == "CutsceneHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -123,11 +140,18 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r ZCutscene* cutscene = new ZCutscene(room->rawData, address, 9999); + if (child->Attribute("Name") != NULL) + name = string(child->Attribute("Name")); + else + name = StringHelper::Sprintf("%sCutsceneData0x%06X", room->name.c_str(), cutscene->segmentOffset); + room->parent->AddDeclarationArray(address, DeclarationAlignment::None, DeclarationPadding::Pad16, cutscene->GetRawDataSize(), "s32", - StringHelper::Sprintf("%sCutsceneData0x%06X", room->name.c_str(), cutscene->segmentOffset), 0, cutscene->GetSourceOutputCode(room->name)); + name, 0, cutscene->GetSourceOutputCode(room->name)); + delete cutscene; } else if (string(child->Name()) == "AltHeaderHint") { + string name = ""; string comment = ""; if (child->Attribute("Comment") != NULL) @@ -180,6 +204,7 @@ ZRoom* ZRoom::ExtractFromXML(XMLElement* reader, vector nRawData, int r ZTexture* tex = ZTexture::FromBinary(ZTexture::GetTextureTypeFromString(typeStr), room->rawData, address, StringHelper::Sprintf("%sTex_%06X", room->name.c_str(), address), width, height); room->parent->AddDeclarationArray(address, DeclarationAlignment::None, tex->GetRawDataSize(), "u64", StringHelper::Sprintf("%s", tex->GetName().c_str()), 0, tex->GetSourceOutputCode(room->name)); + delete tex; } } @@ -533,6 +558,7 @@ Declaration::Declaration(DeclarationAlignment nAlignment, DeclarationPadding nPa isArray = false; arrayItemCnt = 0; includePath = ""; + references = vector(); } Declaration::Declaration(DeclarationAlignment nAlignment, uint32_t nSize, string nVarType, string nVarName, bool nIsArray, string nText) : Declaration(nAlignment, DeclarationPadding::None, nSize, nText) diff --git a/tools/bootstrap_actors.py b/tools/bootstrap_actors.py index e09aef6a59..fc7f2d4eb8 100644 --- a/tools/bootstrap_actors.py +++ b/tools/bootstrap_actors.py @@ -34,7 +34,7 @@ def get_actor_id_name(actor_id): def get_actor_type_name(actor_type): matches = re.findall(actor_type + " .*\n", z64actor_text) for m in matches: - if "ACTORTYPE" in m: + if "ACTORCAT" in m: match = m.replace(",", "").strip().split(" ")[-1] return match return "0x" + actor_type