diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-04-21 09:18:38 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-04-21 09:18:38 +0300 |
| commit | 1ac2d10b8d9666569f232f6b963741425eea406c (patch) | |
| tree | 125e02d00cd742c53ef6c631cad462fbcede0268 | |
| parent | 26b911018054f02d42374c1931164d727ab6057f (diff) | |
Put const data in playerItemFireRodProjectile
| -rw-r--r-- | assets/assets.json | 5 | ||||
| -rw-r--r-- | data/const/playerItem/playerItemFireRodProjectile.s | 13 | ||||
| -rw-r--r-- | linker.ld | 2 | ||||
| -rw-r--r-- | src/playerItem/playerItemFireRodProjectile.c | 13 |
4 files changed, 9 insertions, 24 deletions
diff --git a/assets/assets.json b/assets/assets.json index 16282cb7..d0a11d9f 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -44065,11 +44065,6 @@ "size": 8 }, { - "path": "playerItemFireRodProjectile/gUnk_08127278.bin", - "start": 1208952, - "size": 8 - }, - { "offsets": { "DEMO_USA": 2640 } diff --git a/data/const/playerItem/playerItemFireRodProjectile.s b/data/const/playerItem/playerItemFireRodProjectile.s deleted file mode 100644 index d38fda70..00000000 --- a/data/const/playerItem/playerItemFireRodProjectile.s +++ /dev/null @@ -1,13 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_08127270:: @ 08127270 - .4byte sub_080A3084 - .4byte sub_080A310C - -gUnk_08127278:: @ 08127278 - .incbin "playerItemFireRodProjectile/gUnk_08127278.bin" - @@ -1567,7 +1567,7 @@ SECTIONS { src/playerItemDefinitions.o(.rodata); data/data_08125104.o(.rodata); data/const/playerItem/playerItemShield.o(.rodata); - data/const/playerItem/playerItemFireRodProjectile.o(.rodata); + src/playerItem/playerItemFireRodProjectile.o(.rodata); #ifdef DEMO_USA src/demo.o(.rodata); #endif diff --git a/src/playerItem/playerItemFireRodProjectile.c b/src/playerItem/playerItemFireRodProjectile.c index 9e29cf46..072bedf1 100644 --- a/src/playerItem/playerItemFireRodProjectile.c +++ b/src/playerItem/playerItemFireRodProjectile.c @@ -15,22 +15,25 @@ typedef struct { extern u8 gUnk_08003E44; -extern void (*const gUnk_08127270[])(FireRodProjectileEntity*); - -extern Hitbox gUnk_08127278; +void sub_080A3084(FireRodProjectileEntity*); void sub_080A310C(FireRodProjectileEntity*); void PlayerItemFireRodProjectile(Entity* this) { - gUnk_08127270[this->action]((FireRodProjectileEntity*)this); + static void (*const actionFuncs[])(FireRodProjectileEntity*) = { + sub_080A3084, + sub_080A310C, + }; + actionFuncs[this->action]((FireRodProjectileEntity*)this); } void sub_080A3084(FireRodProjectileEntity* this) { + static const Hitbox gUnk_08127278 = { 0, 0, { 4, 2, 2, 4 }, 6, 6 }; super->spriteSettings.draw = 1; super->action = 0x01; CopyPosition(super->parent, super); if (super->type == 0) { super->collisionFlags = gPlayerEntity.collisionFlags + 1; - super->hitbox = &gUnk_08127278; + super->hitbox = (Hitbox*)&gUnk_08127278; super->speed = 0x400; if (super->collisionLayer == 0x02) { super->type2 = 0x01; |
