papermario/include/map.h
HailSanta 7b24d78503
area KZN and others (#795)
* kzn_01

* cleanup

* kzn_05

* sound name

* missed evt_ptr

* splat change

* broken :(

* pan params for other maps

* works, but not great

* some kzn funcs

* documentin

* minor

* kzn_07 funcs

* more matches

* kzn_08

* kzn_06 fixup

* kzn_01_fix

* kzn 5

* kzn_07

* surprisingly OK

* some matches

* letter choice

* refactor

* more maps

* check

* first area done!

* now with extra bonus map

* kzn23

* some camera stuff

* entrances adjustment

* kzn_22 OK

* kzn_22 cleanup

* kzn_20 ok

* kzn_20 cleanup

* kzn_18 ok

* kzn_18 cleanup

* kgr_01

* area kgr done

* kgr_02 renames

* kzn_11

* kzn_17 ok

* kzn_17 cleanup

* kzn_04 done

* kzn_03 ok

* kzn_19

* bad kzn_19

* funcs idk

* figured a thing out

* kzn_19 ok

* some matches

* kzn_19 cleanup

* all kzn funcs

* merg'd

* some kzn btl matches

* vine field renames

* kzn cleanup 1

* kzn cleanup 2

* tab patrol

* trailing space patrol

* piranha anims split

* actor type sounds

* example

* requests + remove hardcoded dma entries

* split vine image

Co-authored-by: HailSanta <Hail2Santa@gmail.com>
Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2022-09-30 21:44:48 -04:00

75 lines
2.1 KiB
C

#ifndef _MAP_H_
#define _MAP_H_
#include "common_structs.h"
#include "enums.h"
#include "world/entrances.h"
#include "script_api/map.h"
#include "npc.h"
// temporary: some standard script names
#define EVS_MakeEntities EVS_MakeEntities
#define EVS_SetupMusic EVS_SetupMusic
#define EVS_BindExitTriggers EVS_BindExitTriggers
// TODO: consider moving Npc here
#define ENTRY_COUNT(entryList) (sizeof(entryList) / sizeof(Vec4f))
typedef Vec4f EntryList[];
/// Fields other than main, entryList, entryCount, background, and tattle are initialised when the map loads.
typedef struct MapSettings {
/* 0x00 */ struct ModelNode* modelTreeRoot;
/* 0x04 */ s32 hitAssetCollisionOffset;
/* 0x08 */ s32 hitAssetZoneOffset;
/* 0x0C */ char unk_0C[4];
/* 0x10 */ EvtScript* main;
/* 0x14 */ EntryList* entryList;
/* 0x18 */ s32 entryCount;
/* 0x1C */ char unk_1C[12];
/* 0x28 */ char** modelNameList;
/* 0x2C */ char** colliderNameList;
/* 0x30 */ char** zoneNameList;
/* 0x34 */ char unk_34[4];
/* 0x38 */ BackgroundHeader* background;
/* 0x3C */ union {
s32 msgID;
s32 (*get)(void);
} tattle;
} MapSettings; // size = 0x40
typedef s32(*MapInit)(void);
#define MAP_ID_MAX_LEN 7 ///< "xxx_yyy" excluding null terminator.
typedef struct MapConfig {
/* 0x00 */ char* id; ///< @see MAP_ID_MAX_LEN
/* 0x04 */ MapSettings* settings;
/* 0x08 */ void* dmaStart;
/* 0x0C */ void* dmaEnd;
/* 0x10 */ void* dmaDest;
/* 0x14 */ char* bgName;
/* 0x18 */ MapInit init; ///< Return TRUE to skip normal asset (shape/hit/bg/tex) loading.
/* 0x1C */ union {
u32 word;
struct {
char unk_1C[0x2];
s8 songVariation; ///< 0 or 1. @see bgm_get_map_default_variation
s8 flags;
} bytes;
} unk_1C;
} MapConfig; // size = 0x20
typedef struct AreaConfig {
/* 0x00 */ s32 mapCount;
/* 0x04 */ MapConfig* maps;
/* 0x08 */ char* id; ///< "area_xxx"
/* 0x0C */ char* name; ///< JP debug name.
} AreaConfig; // size = 0x10
MapSettings* get_current_map_settings(void);
/// Zero-terminated.
extern AreaConfig gAreas[29];
#endif