Refactor - Replaced magic number copies with main_bg_se_copy_rect() (#192)

This commit is contained in:
MeirGavish
2025-11-01 08:12:20 +02:00
committed by GitHub
parent 9dc0905c93
commit dfe6edad88
3 changed files with 24 additions and 26 deletions
+2 -2
View File
@@ -112,7 +112,7 @@ void main_bg_se_move_rect_1_tile_vert(Rect se_rect, int direction)
main_bg_se_copy_or_move_rect_1_tile_vert(se_rect, direction, true);
}
void main_bg_se_copy_rect(Rect se_rect, BG_POINT pos)
void main_bg_se_copy_rect(Rect se_rect, BG_POINT dest_pos)
{
if (se_rect.left > se_rect.right || se_rect.top > se_rect.bottom)
return;
@@ -136,7 +136,7 @@ void main_bg_se_copy_rect(Rect se_rect, BG_POINT pos)
// Copy the tilemap to the new rect position
for (int sy = 0; sy < height; sy++)
{
memcpy16(&se_mat[MAIN_BG_SBB][pos.y + sy][pos.x],
memcpy16(&se_mat[MAIN_BG_SBB][dest_pos.y + sy][dest_pos.x],
&tile_map[sy][0],
width);
}