more cleanup

This commit is contained in:
Henny022p 2021-03-15 23:40:11 +01:00
parent a2cdfd6d8d
commit a563bfbc28
52 changed files with 46 additions and 67 deletions

8
include/createObject.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef CREATEOBJECT_H
#define CREATEOBJECT_H
// maybe a dedicated (create)Effect.h/c
void CreateDust(Entity* parent);
void CreateDustSmall(Entity* parent);
#endif // CREATEOBJECT_H

View File

@ -109,6 +109,5 @@ extern void Enemy66(Entity*);
extern u32 GetNextFunction(Entity*);
extern void EnemyFunctionHandler(Entity*, void (*const func[])(Entity*));
extern void sub_0804AA30(Entity*, void (*const func[])(Entity*));
extern void sub_08001324(Entity*);
#endif

View File

@ -7,8 +7,8 @@
#include "manager.h"
#include "position.h"
#include "player.h"
#include "structures.h"
#include "room.h"
#include "structures.h"
// Identified - to be sorted into header files
extern void SoundReq(u32);
@ -17,7 +17,7 @@ extern u32 __modsi3(u32, u32);
extern void DoFade(u32, u32);
extern u32 CheckKinstoneFused(u32);
extern void ForceEquipItem(u32, u8);
extern void LoadRoomEntityList();
extern void LoadRoomEntityList(EntityData* listPtr);
extern u32 GetAnimationState(Entity*);
extern void SetChildOffset(Entity*, s32, s32, s32);
extern Entity* CreatePlayerItem(u32, u32, u32, u32);
@ -29,7 +29,6 @@ extern void SetDirtTile(u32);
extern void LoadRoomTileEntities(); // tba
extern Entity* CreateDeathFx(Entity*, u32, u32);
extern void UpdateAnimationVariableFrames(Entity*, u32);
extern void CopyPositionAndSpriteOffset(Entity*, Entity*);
extern u8* GetSpriteSubEntryOffsetDataPointer(u32, u32);
extern u32 LoadFixedGFX(Entity*, u32);
extern Entity* CreateItemEntity(u32, u32, u32);
@ -42,19 +41,15 @@ extern Manager* GetEmptyManager(void);
extern void LoadGfxGroup(u32);
extern void EnqueueSFX(u32);
extern void ResetPlayer(void);
extern void CreateDust(Entity*);
extern u32 IsItemEquipped(u32);
extern void DeleteManager(Manager*);
extern bool32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
extern u32 CheckIsDungeon();
extern u32 GetTileTypeByEntity(Entity*);
// Unidentified
extern u32 sub_0806ED78(Entity*);
extern void sub_0806920C(Entity*);
extern u32 sub_0805ACC0(Entity*);
extern u32 sub_0801E99C(Entity*);
extern void sub_0806924C(Entity*);
extern Entity* sub_080873AC(Entity*, u32, u32);
extern void sub_08078778(Entity*);
extern void sub_080787A8(Entity*, u32);

6
include/game.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GAME_H
#define GAME_H
u32 CheckIsDungeon(void);
#endif // GAME_H

View File

@ -7,6 +7,7 @@
void CopyPosition(Entity*, Entity*);
void PositionEntityOnTop(Entity*, Entity*);
void PositionRelative(Entity*, Entity*, s32, s32);
void CopyPositionAndSpriteOffset(Entity* param_1, Entity* param_2);
void sub_0806FA90(Entity*, Entity*, s32, s32);
void ResolveEntityOnTop(Entity*, Entity*);
void sub_0806FAD8(Entity*, Entity*);

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "entity.h"
extern u32 SetTileType(u32 tileID, u32 tilePos, u32 layerID);

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "entity.h"
#include "dma.h"
#include "functions.h"

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "entity.h"
#include "player.h"
#include "room.h"
#include "menu.h"

View File

@ -1,6 +1,5 @@
#include "entity.h"
#include "global.h"
#include "functions.h"
#include "entity.h"
Entity* CreateEnemy(u32 subtype, u32 form) {
Entity* enemy;

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
Entity* CreateNPC(u32 subtype, u32 form, u32 parameter) {
Entity* entity;

View File

@ -2,7 +2,7 @@
#include "entity.h"
#include "position.h"
#include "room.h"
#include "functions.h"
#include "createObject.h"
Entity* CreateObject(u32 subtype, u32 form, u32 parameter) {
Entity* entity;

View File

@ -1,8 +1,8 @@
#include "enemy.h"
#include "random.h"
#include "createObject.h"
#include "functions.h"
extern void CreateDustSmall(Entity*);
extern void sub_08078930(Entity*);
extern void sub_08078954(Entity*);

View File

@ -3,7 +3,6 @@
#include "player.h"
#include "room.h"
#include "trig.h"
#include "structures.h"
#include "fileScreen.h"
#include "random.h"
#include "functions.h"

View File

@ -3,6 +3,7 @@
#include "textbox.h"
#include "save.h"
#include "random.h"
#include "createObject.h"
#include "functions.h"
extern bool32 sub_080544B4(u32);

View File

@ -1,7 +1,6 @@
#include "global.h"
#include "entity.h"
#include "enemy.h"
#include "room.h"
#include "random.h"
#include "functions.h"

View File

@ -1,6 +1,8 @@
#include "enemy.h"
#include "entity.h"
#include "random.h"
#include "createObject.h"
#include "game.h"
#include "functions.h"
extern u32 sub_080002E0(u16, u32);

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "entity.h"
#include "sprite.h"
#include "enemy.h"
#include "random.h"
#include "functions.h"

View File

@ -1,11 +1,11 @@
#include "global.h"
#include "entity.h"
#include "enemy.h"
#include "functions.h"
#include "npc.h"
#include "structures.h"
#include "player.h"
#include "save.h"
#include "createObject.h"
#include "functions.h"
extern void sub_080293DC(Entity*);
extern void sub_080296D8(Entity*);

View File

@ -1,7 +1,8 @@
#include "entity.h"
#include "player.h"
#include "functions.h"
#include "screen.h"
#include "createObject.h"
#include "functions.h"
typedef struct {
s8 h, v;

View File

@ -1,10 +1,10 @@
#include "global.h"
#include "entity.h"
#include "enemy.h"
#include "structures.h"
#include "player.h"
#include "save.h"
#include "random.h"
#include "createObject.h"
#include "functions.h"
extern void (*const gUnk_080CEB74[])(Entity*);

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
#include "textbox.h"
#include "structures.h"

View File

@ -2,7 +2,6 @@
#include "room.h"
#include "flags.h"
#include "area.h"
#include "room.h"
extern u32 ReadBit(u32*, u32);
extern u32 CheckBits(u32*, u32, u32);

View File

@ -300,7 +300,7 @@ u32 sub_08052654() {
return (gArea >> 7) & 1;
}
u32 CheckIsDungeon() {
u32 CheckIsDungeon(void) {
return (gArea >> 2) & 1;
}

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "entity.h"
#include "readKeyInput.h"
static void StoreKeyInput(Input*, u32);

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "menu.h"
#include "main.h"
#include "entity.h"
#include "dma.h"

View File

@ -78,7 +78,7 @@ extern Entity gUnk_080E4C08;
void sub_0805A370(Manager15* this) {
if (this->manager.unk_0d) {
LoadRoomEntityList(&gUnk_080E4C08);
LoadRoomEntityList((EntityData*)&gUnk_080E4C08);
this->manager.action = 3;
SoundReq(0x80100000);
}

View File

@ -1,7 +1,6 @@
#include "global.h"
#include "manager.h"
#include "flags.h"
#include "player.h"
#include "functions.h"
typedef struct {

View File

@ -4,6 +4,7 @@
#include "area.h"
#include "textbox.h"
#include "dma.h"
#include "game.h"
#include "functions.h"
typedef struct {

View File

@ -3,7 +3,6 @@
#include "flags.h"
#include "structures.h"
#include "room.h"
#include "area.h"
#include "screen.h"
#include "trig.h"
#include "functions.h"

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "functions.h"
#include "entity.h"
#include "npc.h"

View File

@ -1,10 +1,6 @@
#include "global.h"
#include "entity.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
#include "textbox.h"
#include "npc.h"
#include "script.h"
#include "functions.h"

View File

@ -1,15 +1,9 @@
#include "global.h"
#include "entity.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
#include "textbox.h"
#include "npc.h"
#include "structures.h"
#include "functions.h"
#include "script.h"
#include "functions.h"
void Carlov(Entity* this) {
if (this->action == 0) {

View File

@ -5,6 +5,9 @@
#include "npc.h"
#include "functions.h"
void sub_0806920C(Entity* ent);
void sub_0806924C(Entity* ent);
extern void (*gUnk_08111914[])(Entity*);
extern void (*gUnk_08111928[])(Entity*);
extern Dialog gUnk_08111938[];

View File

@ -3,7 +3,6 @@
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
#include "textbox.h"
#include "npc.h"
#include "functions.h"

View File

@ -7,6 +7,7 @@
#include "save.h"
#include "script.h"
#include "random.h"
#include "createObject.h"
#include "structures.h"
#include "functions.h"

View File

@ -1,10 +1,7 @@
#include "global.h"
#include "entity.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
#include "textbox.h"
#include "npc.h"
#include "structures.h"
#include "functions.h"

View File

@ -1,13 +1,7 @@
#include "global.h"
#include "entity.h"
#include "player.h"
#include "room.h"
#include "flags.h"
#include "sprite.h"
#include "textbox.h"
#include "npc.h"
#include "script.h"
#include "functions.h"
void MoblinLady(Entity* this) {
if (this->action == 0) {

View File

@ -7,7 +7,7 @@
#include "npc.h"
#include "functions.h"
extern void sub_08078850(u32, u32, u32, u32*);
extern void sub_08078850(Entity*, u32, u32, u32*);
extern void (*const gUnk_08110360[])(Entity*);
extern void (*const gUnk_0811036C[])(Entity*);

View File

@ -1,7 +1,6 @@
#include "global.h"
#include "entity.h"
#include "sprite.h"
#include "functions.h"
#include "game.h"
void Archway(Entity* this) {
u32 v1;

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "entity.h"
#include "flags.h"
extern void sub_080842D8(Entity*);
extern void sub_08078828(Entity*);

View File

@ -60,7 +60,7 @@ void sub_0809F5B0(Entity* this) {
if (--this->actionDelay == 0) {
SoundReq(115);
SetGlobalFlag(KUMOTATSUMAKI);
LoadRoomEntityList(&gUnk_080DD750);
LoadRoomEntityList((EntityData*)&gUnk_080DD750);
DeleteThisEntity();
}
}

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
void FloatingBlock(Entity* this) {
if (this->action == 0) {

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "entity.h"
#include "game.h"
#include "functions.h"
extern void (*const gUnk_08122254[])(Entity*);

View File

@ -2,6 +2,7 @@
#include "entity.h"
#include "room.h"
#include "flags.h"
#include "createObject.h"
#include "functions.h"
extern Hitbox gUnk_080FD170;

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
#include "flags.h"
#include "functions.h"
#include "createObject.h"
extern u32 ReadBit(u32*, u32);

View File

@ -1,7 +1,6 @@
#include "global.h"
#include "entity.h"
#include "random.h"
#include "functions.h"
void WindTribeFlag(Entity* this) {
if (this->action == 0) {

View File

@ -2,10 +2,11 @@
#include "entity.h"
#include "player.h"
#include "textbox.h"
#include "functions.h"
#include "readKeyInput.h"
#include "area.h"
#include "save.h"
#include "game.h"
#include "functions.h"
extern const void (*const gUnk_0811B9E0[])(Entity*);
extern const void (*const gUnk_0811BA60[])(Entity*);

View File

@ -1,7 +1,6 @@
#include "global.h"
#include "entity.h"
#include "position.h"
#include "functions.h"
extern u8 gUnk_08114F78[];
extern u8 gUnk_08114F80[];

View File

@ -4497,7 +4497,7 @@ void sub_0804E3C4() {
}
r = Random();
index = gUnk_080F0D58[index][r & 0x1f];
LoadRoomEntityList(gUnk_080F0CB8[index & 0xF]);
LoadRoomEntityList((EntityData*)gUnk_080F0CB8[index & 0xF]);
index >>= 4;
r >>= 8;
index = gUnk_080F0E08[index][r & 0x1F];

View File

@ -703,7 +703,7 @@ void ScriptCommand_CallWithArg(Entity* entity, ScriptExecutionContext* context)
}
void ScriptCommand_LoadRoomEntityList(Entity* entity, ScriptExecutionContext* context) {
LoadRoomEntityList(GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer));
LoadRoomEntityList((EntityData*)GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer));
}
void ScriptCommand_TestBit(Entity* entity, ScriptExecutionContext* context) {

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "functions.h"
extern const u8 gUnk_020176E0[];

View File

@ -1,5 +1,4 @@
#include "global.h"
#include "entity.h"
extern void sub_0807C960();
extern u16 gMetatilesBottom[];