use object enum in object creation

This commit is contained in:
Henny022p
2021-05-02 02:27:18 +02:00
parent 0cfa5a9a06
commit f477e63fa4
36 changed files with 98 additions and 65 deletions
+3 -2
View File
@@ -3,8 +3,9 @@
#include "flags.h"
#include "screen.h"
#include "manager.h"
#include "functions.h"
#include "object.h"
#include "structures.h"
#include "functions.h"
typedef struct {
Manager manager;
@@ -159,7 +160,7 @@ void sub_0805A4B4(Manager15* this) {
void sub_0805A4CC(Manager15* this, u32 unk_0) {
Entity* tmp;
tmp = CreateObject(0x8e, unk_0, 0);
tmp = CreateObject(OBJECT_8E, unk_0, 0);
if (tmp) {
tmp->x.HALF.HI = this->unk_38 + gRoomControls.roomOriginX;
tmp->y.HALF.HI = this->unk_3a + gRoomControls.roomOriginY - 0x30;
+3 -2
View File
@@ -5,6 +5,7 @@
#include "room.h"
#include "screen.h"
#include "utils.h"
#include "object.h"
#include "functions.h"
typedef struct {
@@ -100,14 +101,14 @@ void sub_0805B048(Manager1A* this) {
}
if (!tmp->unk_10)
return;
obj = CreateObject(0x28, tmp->unk_10->unk_00, tmp->unk_10->unk_01);
obj = CreateObject(OBJECT_28, tmp->unk_10->unk_00, tmp->unk_10->unk_01);
if (obj) {
obj->x.HALF.HI = tmp->unk_10->unk_04 + gRoomControls.roomOriginX;
obj->y.HALF.HI = tmp->unk_10->unk_06 + gRoomControls.roomOriginY;
}
if (this->manager.unk_0a != 0xa || CheckLocalFlag(0x4B))
return;
obj = CreateObject(0x28, 3, 3);
obj = CreateObject(OBJECT_28, 3, 3);
if (obj) {
obj->x.HALF.HI = tmp->unk_10->unk_04 + gRoomControls.roomOriginX;
obj->y.HALF.HI = tmp->unk_10->unk_06 + gRoomControls.roomOriginY;
+2 -1
View File
@@ -3,6 +3,7 @@
#include "entity.h"
#include "flags.h"
#include "room.h"
#include "object.h"
#include "functions.h"
typedef struct {
@@ -37,7 +38,7 @@ void sub_0805C6D0(Manager26* this) {
this->unk_29 = 0;
while (tmp->unk_00 != 0xFF && this->manager.unk_0e < 0x20) {
Entity* obj;
obj = CreateObject(0x4C, tmp->unk_01, tmp->unk_02);
obj = CreateObject(PUSHABLE_FURNITURE, tmp->unk_01, tmp->unk_02);
if (obj) {
obj->actionDelay = tmp->unk_03;
obj->x.HALF.HI = gRoomControls.roomOriginX + tmp->unk_04;
+2 -1
View File
@@ -6,6 +6,7 @@
#include "player.h"
#include "random.h"
#include "audio.h"
#include "object.h"
// Facilitates the usage of minish portals.
@@ -75,7 +76,7 @@ void sub_080577AC(u32 baseX, u32 baseY, u32 layer) {
r = Random();
if ((r & 0x7) != 0)
return;
spark = CreateObject(0xF, 0x26, 0);
spark = CreateObject(SPECIAL_FX, 0x26, 0);
if (!spark)
return;
offsetX = (r >> 0x8) & 0xF;