2020-10-20 05:08:28 +02:00
|
|
|
#ifndef _MAP_H_
|
|
|
|
#define _MAP_H_
|
|
|
|
|
|
|
|
#include "common_structs.h"
|
|
|
|
#include "enums.h"
|
2022-10-01 03:44:48 +02:00
|
|
|
#include "world/entrances.h"
|
2020-10-20 05:08:28 +02:00
|
|
|
#include "script_api/map.h"
|
2021-10-29 19:57:15 +02:00
|
|
|
#include "npc.h"
|
2020-10-20 05:08:28 +02:00
|
|
|
|
2022-10-01 03:44:48 +02:00
|
|
|
// temporary: some standard script names
|
|
|
|
#define EVS_MakeEntities EVS_MakeEntities
|
|
|
|
#define EVS_SetupMusic EVS_SetupMusic
|
2023-01-02 02:58:39 +01:00
|
|
|
#define EVS_SetupRooms EVS_SetupRooms
|
2022-10-05 22:11:24 +02:00
|
|
|
#define EVS_SetupFoliage EVS_SetupFoliage
|
2022-10-01 03:44:48 +02:00
|
|
|
#define EVS_BindExitTriggers EVS_BindExitTriggers
|
2022-10-05 22:11:24 +02:00
|
|
|
#define EVS_EnterMap EVS_EnterMap
|
2022-10-01 03:44:48 +02:00
|
|
|
|
2022-10-07 20:45:58 +02:00
|
|
|
#define CLONED_MODEL(idx) (10000+(idx))
|
|
|
|
|
2020-10-20 05:08:28 +02:00
|
|
|
// TODO: consider moving Npc here
|
|
|
|
|
|
|
|
#define ENTRY_COUNT(entryList) (sizeof(entryList) / sizeof(Vec4f))
|
2021-04-03 19:21:49 +02:00
|
|
|
typedef Vec4f EntryList[];
|
2020-10-20 05:08:28 +02:00
|
|
|
|
2020-10-29 23:41:43 +01:00
|
|
|
/// Fields other than main, entryList, entryCount, background, and tattle are initialised when the map loads.
|
2022-09-08 14:12:26 +02:00
|
|
|
typedef struct MapSettings {
|
2021-10-29 19:57:15 +02:00
|
|
|
/* 0x00 */ struct ModelNode* modelTreeRoot;
|
2022-01-08 11:11:20 +01:00
|
|
|
/* 0x04 */ s32 hitAssetCollisionOffset;
|
|
|
|
/* 0x08 */ s32 hitAssetZoneOffset;
|
2021-07-16 13:08:22 +02:00
|
|
|
/* 0x0C */ char unk_0C[4];
|
2022-01-16 14:28:09 +01:00
|
|
|
/* 0x10 */ EvtScript* main;
|
2020-10-20 05:08:28 +02:00
|
|
|
/* 0x14 */ EntryList* entryList;
|
|
|
|
/* 0x18 */ s32 entryCount;
|
2020-10-29 23:41:43 +01:00
|
|
|
/* 0x1C */ char unk_1C[12];
|
|
|
|
/* 0x28 */ char** modelNameList;
|
|
|
|
/* 0x2C */ char** colliderNameList;
|
|
|
|
/* 0x30 */ char** zoneNameList;
|
|
|
|
/* 0x34 */ char unk_34[4];
|
2020-10-20 08:33:40 +02:00
|
|
|
/* 0x38 */ BackgroundHeader* background;
|
|
|
|
/* 0x3C */ union {
|
2021-10-03 19:42:38 +02:00
|
|
|
s32 msgID;
|
2022-01-03 18:36:01 +01:00
|
|
|
s32 (*get)(void);
|
2020-10-20 08:33:40 +02:00
|
|
|
} tattle;
|
2022-09-08 14:12:26 +02:00
|
|
|
} MapSettings; // size = 0x40
|
2020-10-20 05:08:28 +02:00
|
|
|
|
2021-01-15 23:26:03 +01:00
|
|
|
typedef s32(*MapInit)(void);
|
2020-10-30 18:43:12 +01:00
|
|
|
|
2020-10-29 23:41:43 +01:00
|
|
|
#define MAP_ID_MAX_LEN 7 ///< "xxx_yyy" excluding null terminator.
|
2022-09-08 14:12:26 +02:00
|
|
|
typedef struct MapConfig {
|
2020-10-29 23:41:43 +01:00
|
|
|
/* 0x00 */ char* id; ///< @see MAP_ID_MAX_LEN
|
2022-09-08 14:12:26 +02:00
|
|
|
/* 0x04 */ MapSettings* settings;
|
2020-10-29 23:41:43 +01:00
|
|
|
/* 0x08 */ void* dmaStart;
|
|
|
|
/* 0x0C */ void* dmaEnd;
|
|
|
|
/* 0x10 */ void* dmaDest;
|
|
|
|
/* 0x14 */ char* bgName;
|
2021-01-12 20:45:50 +01:00
|
|
|
/* 0x18 */ MapInit init; ///< Return TRUE to skip normal asset (shape/hit/bg/tex) loading.
|
2022-12-06 00:29:22 +01:00
|
|
|
/* 0x1C */ char unk_1C[0x2];
|
|
|
|
/* 0x1E */ s8 songVariation; ///< 0 or 1. @see bgm_get_map_default_variation
|
|
|
|
/* 0x1F */ s8 sfxReverb;
|
2022-09-08 14:12:26 +02:00
|
|
|
} MapConfig; // size = 0x20
|
2020-10-29 23:41:43 +01:00
|
|
|
|
2022-09-08 14:12:26 +02:00
|
|
|
typedef struct AreaConfig {
|
2020-10-29 23:41:43 +01:00
|
|
|
/* 0x00 */ s32 mapCount;
|
2022-09-08 14:12:26 +02:00
|
|
|
/* 0x04 */ MapConfig* maps;
|
2020-10-29 23:41:43 +01:00
|
|
|
/* 0x08 */ char* id; ///< "area_xxx"
|
|
|
|
/* 0x0C */ char* name; ///< JP debug name.
|
2022-09-08 14:12:26 +02:00
|
|
|
} AreaConfig; // size = 0x10
|
2020-11-20 05:08:05 +01:00
|
|
|
|
2022-09-08 14:12:26 +02:00
|
|
|
MapSettings* get_current_map_settings(void);
|
2020-10-20 05:08:28 +02:00
|
|
|
|
2020-10-29 23:41:43 +01:00
|
|
|
/// Zero-terminated.
|
2022-09-08 14:12:26 +02:00
|
|
|
extern AreaConfig gAreas[29];
|
2020-10-29 23:41:43 +01:00
|
|
|
|
2022-10-11 00:02:54 +02:00
|
|
|
extern EvtScript EVS_NpcHitRecoil;
|
|
|
|
extern EvtScript EVS_800936C0;
|
|
|
|
|
2020-10-20 05:08:28 +02:00
|
|
|
#endif
|