feat: Update dungeon coordinate conversion to use 8x8 pixel tiles and replace DungeonEditor with DungeonEditorV2

This commit is contained in:
scawful
2025-10-04 14:46:50 -04:00
parent 405fd43931
commit a3719201d0
4 changed files with 16 additions and 10 deletions

View File

@@ -270,11 +270,13 @@ bool DungeonObjectInteraction::IsObjectInSelectBox(
}
std::pair<int, int> DungeonObjectInteraction::RoomToCanvasCoordinates(int room_x, int room_y) const {
return {room_x * 16, room_y * 16};
// Dungeon tiles are 8x8 pixels, convert room coordinates (tiles) to pixels
return {room_x * 8, room_y * 8};
}
std::pair<int, int> DungeonObjectInteraction::CanvasToRoomCoordinates(int canvas_x, int canvas_y) const {
return {canvas_x / 16, canvas_y / 16};
// Convert canvas pixels back to room coordinates (tiles)
return {canvas_x / 8, canvas_y / 8};
}
bool DungeonObjectInteraction::IsWithinCanvasBounds(int canvas_x, int canvas_y, int margin) const {