2017-09-16 20:13:06 +01:00
|
|
|
#ifndef GUARD_FIELDMAP_H
|
|
|
|
#define GUARD_FIELDMAP_H
|
2017-09-16 18:54:33 +01:00
|
|
|
|
2018-09-18 16:03:24 +01:00
|
|
|
#define NUM_TILES_IN_PRIMARY 512
|
|
|
|
#define NUM_TILES_TOTAL 1024
|
|
|
|
#define NUM_METATILES_IN_PRIMARY 512
|
|
|
|
#define NUM_METATILES_TOTAL 1024
|
|
|
|
#define NUM_PALS_IN_PRIMARY 6
|
|
|
|
#define NUM_PALS_TOTAL 13
|
2022-01-16 22:22:28 +00:00
|
|
|
#define MAX_MAP_DATA_SIZE 10240
|
2018-09-18 16:03:24 +01:00
|
|
|
|
2022-12-03 22:29:02 +00:00
|
|
|
#define NUM_TILES_PER_METATILE 8
|
|
|
|
|
2021-10-09 17:12:18 +01:00
|
|
|
// Map coordinates are offset by 7 when using the map
|
|
|
|
// buffer because it needs to load sufficient border
|
|
|
|
// metatiles to fill the player's view (the player has
|
|
|
|
// 7 metatiles of view horizontally in either direction).
|
|
|
|
#define MAP_OFFSET 7
|
|
|
|
#define MAP_OFFSET_W (MAP_OFFSET * 2 + 1)
|
|
|
|
#define MAP_OFFSET_H (MAP_OFFSET * 2)
|
|
|
|
|
2019-03-02 07:44:02 +00:00
|
|
|
#include "main.h"
|
|
|
|
|
2018-12-28 17:18:23 +00:00
|
|
|
extern struct BackupMapLayout gBackupMapLayout;
|
2017-09-16 18:54:33 +01:00
|
|
|
|
2017-10-22 23:55:07 +01:00
|
|
|
u32 MapGridGetMetatileIdAt(int, int);
|
2017-10-13 16:09:36 +01:00
|
|
|
u32 MapGridGetMetatileBehaviorAt(int, int);
|
2017-10-12 08:06:19 +01:00
|
|
|
void MapGridSetMetatileIdAt(int, int, u16);
|
2017-10-22 23:55:07 +01:00
|
|
|
void MapGridSetMetatileEntryAt(int, int, u16);
|
2022-07-29 15:17:58 +01:00
|
|
|
void GetCameraCoords(u16 *, u16 *);
|
2022-08-03 19:21:13 +01:00
|
|
|
u8 MapGridGetCollisionAt(int, int);
|
2018-05-09 11:07:56 +01:00
|
|
|
int GetMapBorderIdAt(int x, int y);
|
2021-04-06 21:05:43 +01:00
|
|
|
bool32 CanCameraMoveInDirection(int direction);
|
2022-01-19 15:15:32 +00:00
|
|
|
u16 GetMetatileAttributesById(u16 metatileId);
|
2018-12-28 17:18:23 +00:00
|
|
|
void GetCameraFocusCoords(u16 *x, u16 *y);
|
2019-06-29 03:26:11 +01:00
|
|
|
u8 MapGridGetMetatileLayerTypeAt(int x, int y);
|
2022-01-21 17:48:19 +00:00
|
|
|
u8 MapGridGetElevationAt(int x, int y);
|
2019-06-29 03:26:11 +01:00
|
|
|
bool8 CameraMove(int deltaX, int deltaY);
|
2021-04-06 21:05:43 +01:00
|
|
|
void SaveMapView(void);
|
2020-06-24 21:27:00 +01:00
|
|
|
void SetCameraFocusCoords(u16 x, u16 y);
|
2018-12-28 17:18:23 +00:00
|
|
|
void InitMap(void);
|
|
|
|
void InitMapFromSavedGame(void);
|
|
|
|
void InitTrainerHillMap(void);
|
2019-02-07 02:01:29 +00:00
|
|
|
void InitBattlePyramidMap(bool8 setPlayerPosition);
|
2020-06-20 00:58:56 +01:00
|
|
|
void CopyMapTilesetsToVram(struct MapLayout const *mapLayout);
|
|
|
|
void LoadMapTilesetPalettes(struct MapLayout const *mapLayout);
|
|
|
|
void LoadSecondaryTilesetPalette(struct MapLayout const *mapLayout);
|
|
|
|
void CopySecondaryTilesetToVramUsingHeap(struct MapLayout const *mapLayout);
|
|
|
|
void CopyPrimaryTilesetToVram(const struct MapLayout *);
|
|
|
|
void CopySecondaryTilesetToVram(const struct MapLayout *);
|
2023-03-08 16:07:44 +00:00
|
|
|
const struct MapHeader *const GetMapHeaderFromConnection(const struct MapConnection *connection);
|
|
|
|
const struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y);
|
2020-06-01 15:23:12 +01:00
|
|
|
void MapGridSetMetatileImpassabilityAt(int x, int y, bool32 impassable);
|
2017-09-16 18:54:33 +01:00
|
|
|
|
2019-03-02 07:44:02 +00:00
|
|
|
// field_region_map.c
|
|
|
|
void FieldInitRegionMap(MainCallback callback);
|
|
|
|
|
2017-09-16 20:13:06 +01:00
|
|
|
#endif //GUARD_FIELDMAP_H
|