Copy the map data

This commit is contained in:
louist103
2024-05-22 09:04:59 -05:00
committed by Garrett Cox
parent 5af9b7c77a
commit bcb7dcf6d7
+5 -4
View File
@@ -153,11 +153,13 @@ static const char* sMapGrandTextures[] = {
map_grand_static_Blob_034BB0, map_grand_static_Blob_034F50,
};
void MapDisp_GetMapITexture(void** dst, s32 mapCompactId) {
// BENTODO, can we just set dest insetead of doing a memcpy?
void MapDisp_GetMapITexture(void* dst, s32 mapCompactId) {
s32 mapSize = MapDisp_GetSizeOfMapITex(mapCompactId);
if (mapSize != 0) {
*dst = ResourceMgr_LoadTexOrDListByName(sMapTextures[mapCompactId]);
void* data = ResourceMgr_LoadTexOrDListByName(sMapTextures[mapCompactId]);
memcpy(dst, data, mapSize);
//CmpDma_LoadFile(SEGMENT_ROM_START(map_i_static), mapCompactId, dst, MapDisp_GetSizeOfMapITex(mapCompactId));
}
}
@@ -1262,8 +1264,7 @@ void* MapDisp_AllocDungeonMap(PlayState* play, void* heap) {
s32 mapCompactId = sPauseDungeonMap.mapI_mapCompactId[dungeonMapRoomIter];
// 2S2H [Port] directly set the pointer to the texture instead of using memcpy
// BENTODO, can we avoid using any game made heap since the textures are loaded as a resource?
MapDisp_GetMapITexture(&sPauseDungeonMap.mapI_roomTextures[dungeonMapRoomIter], mapCompactId);
MapDisp_GetMapITexture(sPauseDungeonMap.mapI_roomTextures[dungeonMapRoomIter], mapCompactId);
if (dungeonMapRoomIter + 1 < sPauseDungeonMap.textureCount) {
sPauseDungeonMap.mapI_roomTextures[dungeonMapRoomIter + 1] =
ALIGN16((intptr_t)sPauseDungeonMap.mapI_roomTextures[dungeonMapRoomIter] +