diff options
| author | Henny022p <info@henny022.de> | 2021-05-02 02:27:18 +0200 |
|---|---|---|
| committer | Henny022p <info@henny022.de> | 2021-05-02 02:27:18 +0200 |
| commit | f477e63fa46717afd632283bcc141513183bccb3 (patch) | |
| tree | 82105c348c8593723a72d1ebcff51b2c6e006aef /src/object | |
| parent | 0cfa5a9a066b33f8b4896edfcd29bc13986f0c27 (diff) | |
use object enum in object creation
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/bakerOven.c | 3 | ||||
| -rw-r--r-- | src/object/bigVortex.c | 7 | ||||
| -rw-r--r-- | src/object/bird.c | 3 | ||||
| -rw-r--r-- | src/object/cloud.c | 5 | ||||
| -rw-r--r-- | src/object/greatFairy.c | 5 | ||||
| -rw-r--r-- | src/object/houseDoorExterior.c | 3 | ||||
| -rw-r--r-- | src/object/itemOnGround.c | 5 | ||||
| -rw-r--r-- | src/object/object1A.c | 3 | ||||
| -rw-r--r-- | src/object/object49.c | 5 | ||||
| -rw-r--r-- | src/object/object9E.c | 3 | ||||
| -rw-r--r-- | src/object/pot.c | 5 | ||||
| -rw-r--r-- | src/object/smoke.c | 3 |
12 files changed, 31 insertions, 19 deletions
diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index 12cbf897..f9de2600 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -1,5 +1,6 @@ #include "global.h" #include "entity.h" +#include "object.h" #include "functions.h" extern void sub_0800449C(Entity*, u32); @@ -23,7 +24,7 @@ void sub_0809CC74(Entity* this) { this->spritePriority.b0 = 5; /* Create steam clouds */ for (i = 0; i < 3; i++) { - ent = CreateObject(0x92, 1, i); + ent = CreateObject(BAKER_OVEN, 1, i); if (ent) { ent->parent = this; PositionRelative(this, ent, (((i + 1) / 2) * 0x100000) - 0x80000, -0xe0000); diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index fb771024..866309ae 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -1,7 +1,8 @@ #include "global.h" #include "entity.h" -#include "functions.h" #include "flags.h" +#include "object.h" +#include "functions.h" extern void sub_08098E3C(Entity*); extern void sub_08098E88(Entity*); @@ -98,12 +99,12 @@ void sub_08098E88(Entity* this) { Entity* ent1; Entity* ent2; - ent1 = CreateObject(0x82, 1, 0); + ent1 = CreateObject(BIG_VORTEX, 1, 0); if (ent1 != NULL) { PositionRelative(this, ent1, 0, -0x10000); ent1->spriteOffsetY = 8; } - ent2 = CreateObject(0x82, 2, 0); + ent2 = CreateObject(BIG_VORTEX, 2, 0); if (ent2 != NULL) { PositionRelative(this, ent2, 0, -0x20000); ent2->spriteOffsetY = 0x10; diff --git a/src/object/bird.c b/src/object/bird.c index 6e8cf037..3d1558e3 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -4,6 +4,7 @@ #include "flags.h" #include "save.h" #include "random.h" +#include "object.h" #include "functions.h" extern void (*const gUnk_08123EC0[])(Entity*); @@ -37,7 +38,7 @@ void sub_0809CF54(Entity* this) { SoundReq(SFX_123); UpdateSpriteForCollisionLayer(this); InitAnimationForceUpdate(this, 0); - target = CreateObject(0x95, 1, 0); + target = CreateObject(BIRD, 1, 0); if (target != NULL) { target->parent = this; PositionRelative(this, target, 0, 0x80000); diff --git a/src/object/cloud.c b/src/object/cloud.c index 20247c76..a2c20ff6 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -5,8 +5,9 @@ #include "player.h" #include "flags.h" #include "random.h" -#include "functions.h" +#include "object.h" #include "structures.h" +#include "functions.h" extern void sub_0809F7BC(Entity*); extern void sub_0809F7F4(Entity*); @@ -148,7 +149,7 @@ Entity* sub_0809F770(Entity* this) { Entity* cloud; int uVar1; - cloud = CreateObject(163, 1, 0); + cloud = CreateObject(CLOUD, 1, 0); if (cloud) { PositionEntityOnTop(this, cloud); uVar1 = Random(); diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index 08ac1cd2..9ad2c2a3 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -8,6 +8,7 @@ #include "save.h" #include "random.h" #include "script.h" +#include "object.h" #include "structures.h" #include "functions.h" @@ -481,7 +482,7 @@ Entity* GreatFairy_CreateForm(Entity* this, u32 curForm, u32 parameter) { nextForm = this->type; nextForm /= 11; - ent = CreateObject(0x1b, (u8)nextForm * 11 + curForm, parameter); + ent = CreateObject(GREAT_FAIRY, (u8)nextForm * 11 + curForm, parameter); return ent; } @@ -514,7 +515,7 @@ void sub_08087424(Entity* this, ScriptExecutionContext* context) { Entity* ent; sub_080791D0(); - ent = CreateObject(0x64, 0, 0); + ent = CreateObject(OBJECT_64, 0, 0); if (ent != NULL) { ent->parent = &gPlayerEntity; CopyPosition(&gPlayerEntity, ent); diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index c800b29a..876fdc6a 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -4,6 +4,7 @@ #include "room.h" #include "script.h" #include "audio.h" +#include "object.h" #include "functions.h" typedef struct { @@ -53,7 +54,7 @@ void sub_080866D8(Entity* this) { int mask = 1 << i; if ((*((u32*)(&this->field_0x68)) & mask) == 0 && sub_080867CC(prop->unk5) && sub_080562CC(prop->unk0, prop->unk2, 32, 32)) { - entity = CreateObject(0x19, prop->unk7, prop->unk6); + entity = CreateObject(HOUSE_DOOR_EXT, prop->unk7, prop->unk6); if (entity) { entity->field_0x6c.HALF.LO = i; entity->x.HALF.HI = gRoomControls.roomOriginX + prop->unk0 + 16; diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index 4ed95a19..493ed137 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -2,8 +2,9 @@ #include "audio.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "player.h" +#include "object.h" +#include "functions.h" void sub_08081150(Entity*); u8 sub_0808147C(u32); @@ -124,7 +125,7 @@ void sub_08080F20(Entity* this) { this->field_0x1c = sub_0808147C(this->type); gUnk_0811E7E8[this->field_0x68.HALF.HI](this); } else { - Entity* entity = CreateObject(0x40, 0x60, 0); + Entity* entity = CreateObject(FAIRY, 0x60, 0); if (entity) { entity->actionDelay = 0; if (this->actionDelay == 1) { diff --git a/src/object/object1A.c b/src/object/object1A.c index f028481d..ad3b1389 100644 --- a/src/object/object1A.c +++ b/src/object/object1A.c @@ -1,6 +1,7 @@ #include "global.h" #include "entity.h" #include "random.h" +#include "object.h" #include "functions.h" extern void sub_08086A6C(); @@ -21,7 +22,7 @@ void sub_080869DC(Entity* ent) { ent->spriteSettings.b.draw = 0; ent->hitbox = &gUnk_080FD1A8; ent->field_0x3c |= 16; - itemEntity = CreateObject(0, ent->type, 0); + itemEntity = CreateObject(GROUND_ITEM, ent->type, 0); if (itemEntity != NULL) { itemEntity->actionDelay = 10; itemEntity->parent = ent; diff --git a/src/object/object49.c b/src/object/object49.c index c945f632..0be4c477 100644 --- a/src/object/object49.c +++ b/src/object/object49.c @@ -1,10 +1,11 @@ #include "global.h" #include "audio.h" #include "entity.h" -#include "functions.h" #include "coord.h" #include "random.h" +#include "object.h" #include "structures.h" +#include "functions.h" static void sub_0808F2B0(Entity*); void sub_0808F14C(Entity*); @@ -32,7 +33,7 @@ void sub_0808F0D0(Entity* this) { Entity* ent; u32 uVar3; - ent = CreateObjectWithParent(this, 0x49, 2, 0); + ent = CreateObjectWithParent(this, OBJECT_49, 2, 0); this->attachedEntity = ent; if (ent == NULL) { DeleteThisEntity(); diff --git a/src/object/object9E.c b/src/object/object9E.c index f8e89b4e..771f7e80 100644 --- a/src/object/object9E.c +++ b/src/object/object9E.c @@ -2,6 +2,7 @@ #include "entity.h" #include "coord.h" #include "room.h" +#include "object.h" #include "functions.h" extern Hitbox gUnk_080FD168; @@ -28,7 +29,7 @@ void Object9E(Entity* this) { SetTile(0x4066, tilePos - 1, *layer); SetTile(0x4065, tilePos, *layer); UpdateSpriteForCollisionLayer(this); - ent = CreateObject(0x9e, 1, 0); + ent = CreateObject(OBJECT_9E, 1, 0); if (ent != NULL) { this->attachedEntity = ent; CopyPosition(this, ent); diff --git a/src/object/pot.c b/src/object/pot.c index 2a1a1e23..7aff3672 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -1,9 +1,10 @@ #include "global.h" #include "entity.h" -#include "functions.h" #include "flags.h" #include "player.h" #include "room.h" +#include "object.h" +#include "functions.h" void sub_08082824(Entity*); static void sub_08082850(Entity*, Entity*); @@ -283,7 +284,7 @@ u32 sub_0808288C(Entity* this, u32 form, u32 arg2, u32 arg3) { result = 0x80; break; default: - entity = CreateObjectWithParent(this, 0, form, arg2); + entity = CreateObjectWithParent(this, GROUND_ITEM, form, arg2); if (entity) { if (arg3 == 2) { entity->actionDelay = 5; diff --git a/src/object/smoke.c b/src/object/smoke.c index 86c75efc..565daa79 100644 --- a/src/object/smoke.c +++ b/src/object/smoke.c @@ -1,6 +1,7 @@ #include "global.h" #include "entity.h" #include "random.h" +#include "object.h" #include "functions.h" extern void (*const gUnk_08121060[])(Entity*); @@ -21,7 +22,7 @@ void sub_0808A40C(Entity* this) { } if (--this->actionDelay == 0) { this->actionDelay = 0x40 - (Random() & 0x1f); - ent = CreateObject(0x2d, 1, 0); + ent = CreateObject(SMOKE, 1, 0); if (ent != NULL) { CopyPosition(this, ent); ent->x.HALF.HI += gUnk_08121068[(Random() & 7)]; |
