Treat map data as const

This commit is contained in:
GriffinR
2023-03-16 12:46:46 -04:00
parent 9b6fa95778
commit ac9bd3ec8f
7 changed files with 57 additions and 57 deletions
+2 -2
View File
@@ -33,8 +33,8 @@ void GetCameraCoords(u16 *, u16 *);
bool8 MapGridGetCollisionAt(s32, s32);
s32 GetMapBorderIdAt(s32, s32);
bool32 CanCameraMoveInDirection(s32);
const struct MapHeader * GetMapHeaderFromConnection(struct MapConnection * connection);
struct MapConnection * GetMapConnectionAtPos(s16 x, s16 y);
const struct MapHeader * GetMapHeaderFromConnection(const struct MapConnection * connection);
const struct MapConnection * GetMapConnectionAtPos(s16 x, s16 y);
void ApplyGlobalTintToPaletteSlot(u8 slot, u8 count);
void SaveMapView(void);
u32 ExtractMetatileAttribute(u32 attributes, u8 attributeType);
+11 -11
View File
@@ -92,10 +92,10 @@ struct MapLayout
{
/*0x00*/ s32 width;
/*0x04*/ s32 height;
/*0x08*/ u16 *border;
/*0x0c*/ u16 *map;
/*0x10*/ struct Tileset *primaryTileset;
/*0x14*/ struct Tileset *secondaryTileset;
/*0x08*/ const u16 *border;
/*0x0c*/ const u16 *map;
/*0x10*/ const struct Tileset *primaryTileset;
/*0x14*/ const struct Tileset *secondaryTileset;
/*0x18*/ u8 borderWidth;
/*0x19*/ u8 borderHeight;
};
@@ -148,7 +148,7 @@ struct CoordEvent
u8 elevation;
u16 trigger;
u16 index;
u8 *script;
const u8 *script;
};
struct BgEvent
@@ -157,7 +157,7 @@ struct BgEvent
u8 elevation;
u8 kind; // The "kind" field determines how to access bgUnion union below.
union {
u8 *script;
const u8 *script;
u32 hiddenItem; // Contains all the hidden item data. See GET_HIDDEN_ITEM_* defines further up
} bgUnion;
};
@@ -168,10 +168,10 @@ struct MapEvents
u8 warpCount;
u8 coordEventCount;
u8 bgEventCount;
struct ObjectEventTemplate *objectEvents;
struct WarpEvent *warps;
struct CoordEvent *coordEvents;
struct BgEvent *bgEvents;
const struct ObjectEventTemplate *objectEvents;
const struct WarpEvent *warps;
const struct CoordEvent *coordEvents;
const struct BgEvent *bgEvents;
};
struct MapConnection
@@ -185,7 +185,7 @@ struct MapConnection
struct MapConnections
{
s32 count;
struct MapConnection *connections;
const struct MapConnection *connections;
};
struct MapHeader