feat: Enhance Dungeon Rendering with Size Adjustments and Testing Initialization

- Added InitializeForTesting method in Rom class to facilitate testing setup.
- Updated DungeonCanvasViewer to adjust object and sprite sizes from 16x16 to 8x8, improving rendering accuracy.
- Modified rendering logic for various dungeon objects (chests, doors, walls, pots) to reflect new size calculations.
- Adjusted object position calculations in ObjectRenderer to align with the new size metrics, ensuring consistent rendering across the application.
- Updated integration tests to verify the new initialization method for ROM objects.
This commit is contained in:
scawful
2025-10-05 17:27:32 -04:00
parent c1d93ce0d2
commit b21aeeb663
6 changed files with 61 additions and 66 deletions

View File

@@ -149,8 +149,6 @@ if(YAZE_BUILD_TESTS AND NOT YAZE_BUILD_TESTS STREQUAL "OFF")
)
endif()
# Configure test executable only when tests are enabled
target_include_directories(
yaze_test PUBLIC
@@ -248,4 +246,4 @@ if(YAZE_BUILD_TESTS AND NOT YAZE_BUILD_TESTS STREQUAL "OFF")
endif()
endif()
include(test.cmake)
include(test.cmake)

View File

@@ -28,6 +28,7 @@ class DungeonEditorIntegrationTest : public ::testing::Test {
status = rom_->LoadFromFile("zelda3.sfc");
}
ASSERT_TRUE(status.ok()) << "Could not load zelda3.sfc from any location";
ASSERT_TRUE(rom_->InitializeForTesting().ok());
// Pass ROM to constructor so all components are initialized with it
dungeon_editor_ = std::make_unique<editor::DungeonEditor>(rom_.get());