2020-10-20 05:08:28 +02:00
|
|
|
#ifndef _MAP_H_
|
|
|
|
#define _MAP_H_
|
|
|
|
|
|
|
|
#include "common_structs.h"
|
|
|
|
#include "enums.h"
|
|
|
|
#include "script_api/map.h"
|
2021-10-29 19:57:15 +02:00
|
|
|
#include "npc.h"
|
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.
|
2020-10-20 08:36:05 +02:00
|
|
|
typedef struct MapConfig {
|
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];
|
2021-08-22 23:50:10 +02:00
|
|
|
/* 0x10 */ EvtSource* 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;
|
2020-10-20 08:36:05 +02:00
|
|
|
} MapConfig; // 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.
|
|
|
|
typedef struct Map {
|
|
|
|
/* 0x00 */ char* id; ///< @see MAP_ID_MAX_LEN
|
|
|
|
/* 0x04 */ MapConfig* config;
|
|
|
|
/* 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.
|
2021-04-01 20:00:29 +02:00
|
|
|
/* 0x1C */ union {
|
2021-08-22 23:55:26 +02:00
|
|
|
u32 word;
|
2021-04-01 20:00:29 +02:00
|
|
|
struct {
|
|
|
|
char unk_1C[0x2];
|
|
|
|
s8 songVariation; ///< 0 or 1. @see bgm_get_map_default_variation
|
|
|
|
s8 flags;
|
|
|
|
} bytes;
|
|
|
|
} unk_1C;
|
2020-10-29 23:41:43 +01:00
|
|
|
} Map; // size = 0x20
|
|
|
|
|
|
|
|
typedef struct Area {
|
|
|
|
/* 0x00 */ s32 mapCount;
|
|
|
|
/* 0x04 */ Map* maps;
|
|
|
|
/* 0x08 */ char* id; ///< "area_xxx"
|
|
|
|
/* 0x0C */ char* name; ///< JP debug name.
|
|
|
|
} Area; // size = 0x10
|
2020-11-20 05:08:05 +01:00
|
|
|
|
2020-11-22 02:31:57 +01:00
|
|
|
MapConfig* get_current_map_header(void);
|
2020-10-20 05:08:28 +02:00
|
|
|
|
2020-10-29 23:41:43 +01:00
|
|
|
/// Zero-terminated.
|
2021-04-24 20:56:22 +02:00
|
|
|
extern Area gAreas[29];
|
2020-10-29 23:41:43 +01:00
|
|
|
|
2020-10-30 18:43:12 +01:00
|
|
|
/// Lists the songs that are forced to use the variation determined by `map.songVariation & 1`.
|
2021-03-26 15:46:45 +01:00
|
|
|
/// @see bgm_get_map_default_variation
|
2021-10-03 19:42:38 +02:00
|
|
|
extern s32 gSongsUsingVariationFlag[6];
|
2020-11-27 07:14:28 +01:00
|
|
|
extern s16 D_8014F738;
|
2020-10-29 23:41:43 +01:00
|
|
|
|
2020-10-20 05:08:28 +02:00
|
|
|
#endif
|