summaryrefslogtreecommitdiff
path: root/src/manager
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2023-12-30 18:42:30 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2023-12-30 18:42:30 +0100
commit5676cb7890facded77c5cf32c6017fbf12a4d386 (patch)
treeb4c20f5d35f988becdb69dbd86b1aedef405286b /src/manager
parent3b87c0416294e830ad256226f315c6b416160493 (diff)
Use new entity structs in a few more files
Diffstat (limited to 'src/manager')
-rw-r--r--src/manager/fallingItemManager.c15
-rw-r--r--src/manager/goronMerchantShopManager.c25
-rw-r--r--src/manager/houseSignManager.c21
3 files changed, 32 insertions, 29 deletions
diff --git a/src/manager/fallingItemManager.c b/src/manager/fallingItemManager.c
index 49ba18e0..740c91a3 100644
--- a/src/manager/fallingItemManager.c
+++ b/src/manager/fallingItemManager.c
@@ -6,10 +6,11 @@
*
* If you leave the room without picking the item up and enter again, the item falls from the sky again.
*/
-#define ENT_DEPRECATED
#include "manager/fallingItemManager.h"
+
#include "flags.h"
#include "object.h"
+#include "object/itemOnGround.h"
#include "room.h"
void FallingItemManager_Init(FallingItemManager*);
@@ -33,13 +34,13 @@ void FallingItemManager_Init(FallingItemManager* this) {
void FallingItemManager_Action1(FallingItemManager* this) {
if (CheckFlags(this->field_0x3e)) {
- Entity* object = CreateObject(GROUND_ITEM, super->type, super->type2);
+ ItemOnGroundEntity* object = (ItemOnGroundEntity*)CreateObject(GROUND_ITEM, super->type, super->type2);
if (object != NULL) {
- object->timer = this->field_0x35;
- object->collisionLayer = this->field_0x36;
- object->x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
- object->y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
- object->field_0x86.HWORD = this->field_0x3c;
+ object->base.timer = this->field_0x35;
+ object->base.collisionLayer = this->field_0x36;
+ object->base.x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
+ object->base.y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
+ object->unk_86 = this->field_0x3c;
}
DeleteThisEntity();
}
diff --git a/src/manager/goronMerchantShopManager.c b/src/manager/goronMerchantShopManager.c
index b68ceb88..c2493c99 100644
--- a/src/manager/goronMerchantShopManager.c
+++ b/src/manager/goronMerchantShopManager.c
@@ -4,12 +4,13 @@
*
* @brief Spawns the shop items for the kinstones for the goron merchant.
*/
-#define ENT_DEPRECATED
#include "manager/goronMerchantShopManager.h"
+
#include "asm.h"
#include "flags.h"
-#include "object.h"
#include "item.h"
+#include "object.h"
+#include "object/itemForSale.h"
typedef struct {
u16 minType;
@@ -60,17 +61,17 @@ void GoronMerchantShopManager_Main(GoronMerchantShopManager* this) {
count = 0;
for (count = 0; count < 3;) {
if (CheckGlobalFlag(GORON_KAKERA_L + count) == 0) {
- Entity* object =
- CreateObject(SHOP_ITEM, ITEM_KINSTONE, ((s32)Random() % spawnData->numTypes) + spawnData->minType);
+ ItemForSaleEntity* object = (ItemForSaleEntity*)CreateObject(
+ SHOP_ITEM, ITEM_KINSTONE, ((s32)Random() % spawnData->numTypes) + spawnData->minType);
if (object != NULL) {
- object->timer = 1;
- object->subtimer = count;
- object->x.HALF.HI = spawnData->x + gRoomControls.origin_x;
- object->y.HALF.HI = spawnData->y + gRoomControls.origin_y;
- object->field_0x80.HWORD = spawnData->x;
- object->field_0x82.HWORD = spawnData->y;
- object->collisionLayer = 1;
- object->parent = (Entity*)this;
+ object->base.timer = 1;
+ object->base.subtimer = count;
+ object->base.x.HALF.HI = spawnData->x + gRoomControls.origin_x;
+ object->base.y.HALF.HI = spawnData->y + gRoomControls.origin_y;
+ object->unk_80 = spawnData->x;
+ object->unk_82 = spawnData->y;
+ object->base.collisionLayer = 1;
+ object->base.parent = (Entity*)this;
this->itemActive[count] = 1;
}
}
diff --git a/src/manager/houseSignManager.c b/src/manager/houseSignManager.c
index 48784225..c33bd50a 100644
--- a/src/manager/houseSignManager.c
+++ b/src/manager/houseSignManager.c
@@ -7,12 +7,13 @@
* Spawns HOUSE_SIGN objects that check this and unsets the value in the bitfield.
* Creates the signs on the houses in hyrule town.
*/
-#define ENT_DEPRECATED
#include "manager/houseSignManager.h"
+
#include "area.h"
+#include "asm.h"
#include "object.h"
+#include "object/houseSign.h"
#include "room.h"
-#include "asm.h"
typedef struct {
u16 x;
@@ -57,15 +58,15 @@ void HouseSignManager_Main(HouseSignManager* this) {
u32 bitfieldFlag = 1 << type2;
if ((((this->bitfield & bitfieldFlag) == 0) &&
(CheckRectOnScreen(spawnData->x, spawnData->y, 0x10, 0x10) != 0))) {
- Entity* object = CreateObject(HOUSE_SIGN, spawnData->type, type2);
+ HouseSignEntity* object = (HouseSignEntity*)CreateObject(HOUSE_SIGN, spawnData->type, type2);
if (object != NULL) {
- object->frameIndex = spawnData->frameIndex;
- object->x.HALF.HI = gRoomControls.origin_x + spawnData->x;
- object->y.HALF.HI = gRoomControls.origin_y + spawnData->y;
- object->parent = (Entity*)this;
- object->field_0x80.HWORD = spawnData->x;
- object->field_0x82.HWORD = spawnData->y;
- object->collisionLayer = spawnData->collisionLayer;
+ object->base.frameIndex = spawnData->frameIndex;
+ object->base.x.HALF.HI = gRoomControls.origin_x + spawnData->x;
+ object->base.y.HALF.HI = gRoomControls.origin_y + spawnData->y;
+ object->base.parent = (Entity*)this;
+ object->unk_80 = spawnData->x;
+ object->unk_82 = spawnData->y;
+ object->base.collisionLayer = spawnData->collisionLayer;
this->bitfield |= bitfieldFlag;
}
}