Merge pull request #613 from GriffinRichards/const-map
Treat map data as const
This commit is contained in:
+2
-2
@@ -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
@@ -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
|
||||
|
||||
+20
-20
@@ -67,9 +67,9 @@ static void SetObjectEventDynamicGraphicsId(struct ObjectEvent *);
|
||||
static void RemoveObjectEventInternal(struct ObjectEvent *);
|
||||
static u16 GetObjectEventFlagIdByObjectEventId(u8);
|
||||
static void UpdateObjectEventVisibility(struct ObjectEvent *, struct Sprite *);
|
||||
static void MakeObjectTemplateFromObjectEventTemplate(struct ObjectEventTemplate *, struct SpriteTemplate *, const struct SubspriteTable **);
|
||||
static void MakeObjectTemplateFromObjectEventTemplate(const struct ObjectEventTemplate *, struct SpriteTemplate *, const struct SubspriteTable **);
|
||||
static void GetObjectEventMovingCameraOffset(s16 *, s16 *);
|
||||
static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8);
|
||||
static const struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8, u8, u8);
|
||||
static void LoadObjectEventPalette(u16);
|
||||
static void RemoveObjectEventIfOutsideView(struct ObjectEvent *);
|
||||
static void SpawnObjectEventOnReturnToField(u8 objectEventId, s16 x, s16 y);
|
||||
@@ -84,13 +84,13 @@ static void ObjectCB_CameraObject(struct Sprite *);
|
||||
static void CameraObject_0(struct Sprite *);
|
||||
static void CameraObject_1(struct Sprite *);
|
||||
static void CameraObject_2(struct Sprite *);
|
||||
static struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId, struct ObjectEventTemplate *templates, u8 count);
|
||||
static const struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId, const struct ObjectEventTemplate *templates, u8 count);
|
||||
static void ClearObjectEventMovement(struct ObjectEvent *, struct Sprite *);
|
||||
static void ObjectEventSetSingleMovement(struct ObjectEvent *, struct Sprite *, u8);
|
||||
static bool8 ShouldInitObjectEventStateFromTemplate(struct ObjectEventTemplate *, u8, s16, s16);
|
||||
static bool8 TemplateIsObstacleAndWithinView(struct ObjectEventTemplate *, s16, s16);
|
||||
static bool8 TemplateIsObstacleAndVisibleFromConnectingMap(struct ObjectEventTemplate *, s16, s16);
|
||||
static void SetHideObstacleFlag(struct ObjectEventTemplate *);
|
||||
static bool8 ShouldInitObjectEventStateFromTemplate(const struct ObjectEventTemplate *, u8, s16, s16);
|
||||
static bool8 TemplateIsObstacleAndWithinView(const struct ObjectEventTemplate *, s16, s16);
|
||||
static bool8 TemplateIsObstacleAndVisibleFromConnectingMap(const struct ObjectEventTemplate *, s16, s16);
|
||||
static void SetHideObstacleFlag(const struct ObjectEventTemplate *);
|
||||
static bool8 MovementType_Disguise_Callback(struct ObjectEvent *, struct Sprite *);
|
||||
static bool8 MovementType_Buried_Callback(struct ObjectEvent *, struct Sprite *);
|
||||
static u8 MovementType_RaiseHandAndStop_Callback(struct ObjectEvent *, struct Sprite *);
|
||||
@@ -1309,7 +1309,7 @@ static u8 GetObjectEventIdByLocalId(u8 localId)
|
||||
return OBJECT_EVENTS_COUNT;
|
||||
}
|
||||
|
||||
static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template, u8 mapNum, u8 mapGroup)
|
||||
static u8 InitObjectEventStateFromTemplate(const struct ObjectEventTemplate *template, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
struct ObjectEvent *objectEvent;
|
||||
const struct MapHeader *mapHeader;
|
||||
@@ -1388,7 +1388,7 @@ static u8 InitObjectEventStateFromTemplate(struct ObjectEventTemplate *template,
|
||||
return objectEventId;
|
||||
}
|
||||
|
||||
static bool8 ShouldInitObjectEventStateFromTemplate(struct ObjectEventTemplate *template, bool8 isClone, s16 x, s16 y)
|
||||
static bool8 ShouldInitObjectEventStateFromTemplate(const struct ObjectEventTemplate *template, bool8 isClone, s16 x, s16 y)
|
||||
{
|
||||
if (isClone && !TemplateIsObstacleAndWithinView(template, x, y))
|
||||
return FALSE;
|
||||
@@ -1399,7 +1399,7 @@ static bool8 ShouldInitObjectEventStateFromTemplate(struct ObjectEventTemplate *
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool8 TemplateIsObstacleAndWithinView(struct ObjectEventTemplate *template, s16 x, s16 y)
|
||||
static bool8 TemplateIsObstacleAndWithinView(const struct ObjectEventTemplate *template, s16 x, s16 y)
|
||||
{
|
||||
if (template->graphicsId == OBJ_EVENT_GFX_CUT_TREE || template->graphicsId == OBJ_EVENT_GFX_ROCK_SMASH_ROCK)
|
||||
{
|
||||
@@ -1422,7 +1422,7 @@ static bool8 TemplateIsObstacleAndWithinView(struct ObjectEventTemplate *templat
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool8 TemplateIsObstacleAndVisibleFromConnectingMap(struct ObjectEventTemplate *template, s16 unused1, s16 unused2)
|
||||
static bool8 TemplateIsObstacleAndVisibleFromConnectingMap(const struct ObjectEventTemplate *template, s16 unused1, s16 unused2)
|
||||
{
|
||||
if (IsMapTypeOutdoors(GetCurrentMapType()))
|
||||
{
|
||||
@@ -1459,7 +1459,7 @@ static bool8 TemplateIsObstacleAndVisibleFromConnectingMap(struct ObjectEventTem
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void SetHideObstacleFlag(struct ObjectEventTemplate *template)
|
||||
static void SetHideObstacleFlag(const struct ObjectEventTemplate *template)
|
||||
{
|
||||
if (template->flagId >= FLAG_TEMP_11 && template->flagId <= FLAG_TEMP_1F)
|
||||
FlagSet(template->flagId);
|
||||
@@ -1549,7 +1549,7 @@ void Unref_RemoveAllObjectEventsExceptPlayer(void)
|
||||
}
|
||||
}
|
||||
|
||||
static u8 TrySetupObjectEventSprite(struct ObjectEventTemplate *objectEventTemplate, struct SpriteTemplate *spriteTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
|
||||
static u8 TrySetupObjectEventSprite(const struct ObjectEventTemplate *objectEventTemplate, struct SpriteTemplate *spriteTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
|
||||
{
|
||||
u8 spriteId;
|
||||
u8 objectEventId;
|
||||
@@ -1599,7 +1599,7 @@ static u8 TrySetupObjectEventSprite(struct ObjectEventTemplate *objectEventTempl
|
||||
return objectEventId;
|
||||
}
|
||||
|
||||
static u8 TrySpawnObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
|
||||
static u8 TrySpawnObjectEventTemplate(const struct ObjectEventTemplate *objectEventTemplate, u8 mapNum, u8 mapGroup, s16 cameraX, s16 cameraY)
|
||||
{
|
||||
u8 objectEventId;
|
||||
struct SpriteTemplate spriteTemplate;
|
||||
@@ -1653,7 +1653,7 @@ int SpawnSpecialObjectEventParameterized(u8 graphicsId, u8 movementBehavior, u8
|
||||
|
||||
u8 TrySpawnObjectEvent(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
struct ObjectEventTemplate *objectEventTemplate;
|
||||
const struct ObjectEventTemplate *objectEventTemplate;
|
||||
s16 cameraX, cameraY;
|
||||
|
||||
objectEventTemplate = GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup);
|
||||
@@ -1691,7 +1691,7 @@ static void CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(u16 graphics
|
||||
CopyObjectGraphicsInfoToSpriteTemplate(graphicsId, sMovementTypeCallbacks[movementType], spriteTemplate, subspriteTables);
|
||||
}
|
||||
|
||||
static void MakeObjectTemplateFromObjectEventTemplate(struct ObjectEventTemplate *objectEventTemplate, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables)
|
||||
static void MakeObjectTemplateFromObjectEventTemplate(const struct ObjectEventTemplate *objectEventTemplate, struct SpriteTemplate *spriteTemplate, const struct SubspriteTable **subspriteTables)
|
||||
{
|
||||
CopyObjectGraphicsInfoToSpriteTemplate_WithMovementType(objectEventTemplate->graphicsId, objectEventTemplate->objUnion.normal.movementType, spriteTemplate, subspriteTables);
|
||||
}
|
||||
@@ -2516,7 +2516,7 @@ const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId)
|
||||
|
||||
static u16 GetObjectEventFlagIdByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
struct ObjectEventTemplate *obj = GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup);
|
||||
const struct ObjectEventTemplate *obj = GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup);
|
||||
#ifdef UBFIX
|
||||
// BUG: The function may return NULL, and attempting to read from NULL may freeze the game using modern compilers.
|
||||
if (obj == NULL)
|
||||
@@ -2571,9 +2571,9 @@ u8 GetObjectEventBerryTreeId(u8 objectEventId)
|
||||
return gObjectEvents[objectEventId].trainerRange_berryTreeId;
|
||||
}
|
||||
|
||||
static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
static const struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup)
|
||||
{
|
||||
struct ObjectEventTemplate *templates;
|
||||
const struct ObjectEventTemplate *templates;
|
||||
const struct MapHeader *mapHeader;
|
||||
u8 count;
|
||||
|
||||
@@ -2591,7 +2591,7 @@ static struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u8 loca
|
||||
return FindObjectEventTemplateByLocalId(localId, templates, count);
|
||||
}
|
||||
|
||||
static struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId, struct ObjectEventTemplate *templates, u8 count)
|
||||
static const struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId, const struct ObjectEventTemplate *templates, u8 count)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
|
||||
@@ -1008,7 +1008,7 @@ static bool8 TryDoorWarp(struct MapPosition *position, u16 metatileBehavior, u8
|
||||
static s8 GetWarpEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 elevation)
|
||||
{
|
||||
s32 i;
|
||||
struct WarpEvent *warpEvent = mapHeader->events->warps;
|
||||
const struct WarpEvent *warpEvent = mapHeader->events->warps;
|
||||
u8 warpCount = mapHeader->events->warpCount;
|
||||
|
||||
for (i = 0; i < warpCount; i++, warpEvent++)
|
||||
@@ -1022,7 +1022,7 @@ static s8 GetWarpEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 e
|
||||
return -1;
|
||||
}
|
||||
|
||||
static const u8 *TryRunCoordEventScript(struct CoordEvent *coordEvent)
|
||||
static const u8 *TryRunCoordEventScript(const struct CoordEvent *coordEvent)
|
||||
{
|
||||
if (coordEvent != NULL)
|
||||
{
|
||||
@@ -1045,7 +1045,7 @@ static const u8 *TryRunCoordEventScript(struct CoordEvent *coordEvent)
|
||||
static const u8 *GetCoordEventScriptAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 elevation)
|
||||
{
|
||||
s32 i;
|
||||
struct CoordEvent *coordEvents = mapHeader->events->coordEvents;
|
||||
const struct CoordEvent *coordEvents = mapHeader->events->coordEvents;
|
||||
u8 coordEventCount = mapHeader->events->coordEventCount;
|
||||
|
||||
for (i = 0; i < coordEventCount; i++)
|
||||
@@ -1101,7 +1101,7 @@ const u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position)
|
||||
static const struct BgEvent *GetBackgroundEventAtPosition(struct MapHeader *mapHeader, u16 x, u16 y, u8 elevation)
|
||||
{
|
||||
u8 i;
|
||||
struct BgEvent *bgEvents = mapHeader->events->bgEvents;
|
||||
const struct BgEvent *bgEvents = mapHeader->events->bgEvents;
|
||||
u8 bgEventCount = mapHeader->events->bgEventCount;
|
||||
|
||||
for (i = 0; i < bgEventCount; i++)
|
||||
|
||||
+15
-15
@@ -24,15 +24,15 @@ EWRAM_DATA u8 gGlobalFieldTintMode = QL_TINT_NONE;
|
||||
static const struct ConnectionFlags sDummyConnectionFlags = {};
|
||||
|
||||
static void InitMapLayoutData(struct MapHeader *);
|
||||
static void InitBackupMapLayoutData(u16 *, u16, u16);
|
||||
static void InitBackupMapLayoutData(const u16 *, u16, u16);
|
||||
static void InitBackupMapLayoutConnections(struct MapHeader *);
|
||||
static void FillSouthConnection(struct MapHeader const *, struct MapHeader const *, s32);
|
||||
static void FillNorthConnection(struct MapHeader const *, struct MapHeader const *, s32);
|
||||
static void FillWestConnection(struct MapHeader const *, struct MapHeader const *, s32);
|
||||
static void FillEastConnection(struct MapHeader const *, struct MapHeader const *, s32);
|
||||
static void LoadSavedMapView(void);
|
||||
static struct MapConnection *GetIncomingConnection(u8, s32, s32);
|
||||
static bool8 IsPosInIncomingConnectingMap(u8, s32, s32, struct MapConnection *);
|
||||
static const struct MapConnection *GetIncomingConnection(u8, s32, s32);
|
||||
static bool8 IsPosInIncomingConnectingMap(u8, s32, s32, const struct MapConnection *);
|
||||
static bool8 IsCoordInIncomingConnectingMap(s32, s32, s32, s32);
|
||||
static u32 GetAttributeByMetatileIdAndMapLayout(const struct MapLayout *, u16, u8);
|
||||
|
||||
@@ -82,7 +82,7 @@ static const u8 sMetatileAttrShifts[METATILE_ATTRIBUTE_COUNT] = {
|
||||
[METATILE_ATTRIBUTE_7] = 31
|
||||
};
|
||||
|
||||
const struct MapHeader * GetMapHeaderFromConnection(struct MapConnection * connection)
|
||||
const struct MapHeader * GetMapHeaderFromConnection(const struct MapConnection * connection)
|
||||
{
|
||||
return Overworld_GetMapHeaderByGroupAndId(connection->mapGroup, connection->mapNum);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ static void InitMapLayoutData(struct MapHeader * mapHeader)
|
||||
InitBackupMapLayoutConnections(mapHeader);
|
||||
}
|
||||
|
||||
static void InitBackupMapLayoutData(u16 *map, u16 width, u16 height)
|
||||
static void InitBackupMapLayoutData(const u16 *map, u16 width, u16 height)
|
||||
{
|
||||
s32 y;
|
||||
u16 *dest = VMap.map;
|
||||
@@ -129,7 +129,7 @@ static void InitBackupMapLayoutData(u16 *map, u16 width, u16 height)
|
||||
static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader)
|
||||
{
|
||||
s32 count;
|
||||
struct MapConnection *connection;
|
||||
const struct MapConnection *connection;
|
||||
s32 i;
|
||||
|
||||
gMapConnectionFlags = sDummyConnectionFlags;
|
||||
@@ -173,7 +173,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader)
|
||||
static void FillConnection(s32 x, s32 y, const struct MapHeader *connectedMapHeader, s32 x2, s32 y2, s32 width, s32 height)
|
||||
{
|
||||
s32 i;
|
||||
u16 *src;
|
||||
const u16 *src;
|
||||
u16 *dest;
|
||||
s32 mapWidth;
|
||||
|
||||
@@ -628,7 +628,7 @@ bool32 CanCameraMoveInDirection(s32 direction)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void SetPositionFromConnection(struct MapConnection *connection, int direction, s32 x, s32 y)
|
||||
static void SetPositionFromConnection(const struct MapConnection *connection, int direction, s32 x, s32 y)
|
||||
{
|
||||
struct MapHeader const *mapHeader;
|
||||
mapHeader = GetMapHeaderFromConnection(connection);
|
||||
@@ -656,7 +656,7 @@ static void SetPositionFromConnection(struct MapConnection *connection, int dire
|
||||
bool8 CameraMove(s32 x, s32 y)
|
||||
{
|
||||
s32 direction;
|
||||
struct MapConnection *connection;
|
||||
const struct MapConnection *connection;
|
||||
s32 old_x, old_y;
|
||||
gCamera.active = FALSE;
|
||||
direction = GetPostCameraMoveMapBorderId(x, y);
|
||||
@@ -683,10 +683,10 @@ bool8 CameraMove(s32 x, s32 y)
|
||||
return gCamera.active;
|
||||
}
|
||||
|
||||
struct MapConnection *GetIncomingConnection(u8 direction, s32 x, s32 y)
|
||||
const struct MapConnection *GetIncomingConnection(u8 direction, s32 x, s32 y)
|
||||
{
|
||||
s32 count;
|
||||
struct MapConnection *connection;
|
||||
const struct MapConnection *connection;
|
||||
const struct MapConnections *connections = gMapHeader.connections;
|
||||
s32 i;
|
||||
|
||||
@@ -705,7 +705,7 @@ struct MapConnection *GetIncomingConnection(u8 direction, s32 x, s32 y)
|
||||
|
||||
}
|
||||
|
||||
static bool8 IsPosInIncomingConnectingMap(u8 direction, s32 x, s32 y, struct MapConnection *connection)
|
||||
static bool8 IsPosInIncomingConnectingMap(u8 direction, s32 x, s32 y, const struct MapConnection *connection)
|
||||
{
|
||||
struct MapHeader const *mapHeader;
|
||||
mapHeader = GetMapHeaderFromConnection(connection);
|
||||
@@ -742,7 +742,7 @@ static bool32 IsCoordInConnectingMap(s32 coord, s32 max)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static s32 IsPosInConnectingMap(struct MapConnection *connection, s32 x, s32 y)
|
||||
static s32 IsPosInConnectingMap(const struct MapConnection *connection, s32 x, s32 y)
|
||||
{
|
||||
struct MapHeader const *mapHeader;
|
||||
mapHeader = GetMapHeaderFromConnection(connection);
|
||||
@@ -758,10 +758,10 @@ static s32 IsPosInConnectingMap(struct MapConnection *connection, s32 x, s32 y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y)
|
||||
const struct MapConnection *GetMapConnectionAtPos(s16 x, s16 y)
|
||||
{
|
||||
s32 count;
|
||||
struct MapConnection *connection;
|
||||
const struct MapConnection *connection;
|
||||
s32 i;
|
||||
u8 direction;
|
||||
if (!gMapHeader.connections)
|
||||
|
||||
+3
-3
@@ -287,7 +287,7 @@ static void SetNormalHiddenItem(u8 taskId)
|
||||
static bool8 HiddenItemAtPos(const struct MapEvents * events, s16 x, s16 y)
|
||||
{
|
||||
u8 bgEventCount = events->bgEventCount;
|
||||
struct BgEvent * bgEvents = events->bgEvents;
|
||||
const struct BgEvent * bgEvents = events->bgEvents;
|
||||
u16 eventFlag;
|
||||
int i;
|
||||
|
||||
@@ -309,7 +309,7 @@ static bool8 HiddenItemAtPos(const struct MapEvents * events, s16 x, s16 y)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool8 HiddenItemInConnectedMapAtPos(struct MapConnection * connection, s32 x, s32 y)
|
||||
static bool8 HiddenItemInConnectedMapAtPos(const struct MapConnection * connection, s32 x, s32 y)
|
||||
{
|
||||
const struct MapHeader * mapHeader;
|
||||
u16 localX, localY;
|
||||
@@ -372,7 +372,7 @@ static void FindHiddenItemsInConnectedMaps(u8 taskId)
|
||||
|| var2 > curY
|
||||
|| curY >= height)
|
||||
{
|
||||
struct MapConnection * conn = GetMapConnectionAtPos(curX, curY);
|
||||
const struct MapConnection * conn = GetMapConnectionAtPos(curX, curY);
|
||||
if (conn != NULL && HiddenItemInConnectedMapAtPos(conn, curX, curY) == TRUE)
|
||||
RegisterHiddenItemRelativeCoordsIfCloser(taskId, curX - x, curY - y);
|
||||
}
|
||||
|
||||
+2
-2
@@ -95,7 +95,7 @@ static u8 TeachyTvGrassAnimationCheckIfNeedsToGenerateGrassObj(s16 x, s16 y);
|
||||
static void TeachyTvGrassAnimationObjCallback(struct Sprite *sprite);
|
||||
static void TeachyTvRestorePlayerPartyCallback(void);
|
||||
static void TeachyTvPreBattleAnimAndSetBattleCallback(u8 taskId);
|
||||
static void TeachyTvLoadMapTilesetToBuffer(struct Tileset *ts, u8 *dstBuffer, u16 size);
|
||||
static void TeachyTvLoadMapTilesetToBuffer(const struct Tileset *ts, u8 *dstBuffer, u16 size);
|
||||
static void TeachyTvPushBackNewMapPalIndexArrayEntry(const struct MapLayout *mStruct, u16 *buf1, u8 *palIndexArray, u16 mapEntry, u16 offset);
|
||||
static void TeachyTvComputeMapTilesFromTilesetAndMetaTiles(const u16 *metaTilesArray, u8 *blockBuf, u8 *tileset);
|
||||
static void TeachyTvComputeSingleMapTileBlockFromTilesetAndMetaTiles(u8 *blockBuf, u8 *tileset, u8 metaTile);
|
||||
@@ -1276,7 +1276,7 @@ static void TeachyTvLoadBg3Map(u16 *buffer)
|
||||
Free(blockIndicesBuffer);
|
||||
}
|
||||
|
||||
static void TeachyTvLoadMapTilesetToBuffer(struct Tileset *ts, u8 *dstBuffer, u16 size)
|
||||
static void TeachyTvLoadMapTilesetToBuffer(const struct Tileset *ts, u8 *dstBuffer, u16 size)
|
||||
{
|
||||
if (ts)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user