feat: Add layer visibility controls and BG2 layer type selection in DungeonCanvasViewer

- Implemented controls for toggling visibility of background layers BG1 and BG2 in the DungeonCanvasViewer.
- Added a dropdown for selecting the type of BG2 layer, allowing for different rendering effects (Normal, Translucent, Addition, Dark, Off).
- Updated rendering logic to respect visibility settings and apply the selected alpha values for BG2 layer rendering.
- Enhanced debug logging to provide detailed information about bitmap states and rendering processes for both background layers.
This commit is contained in:
scawful
2025-10-09 16:25:05 -04:00
parent 9d0b6737cd
commit b135948ba2
5 changed files with 109 additions and 14 deletions

View File

@@ -146,7 +146,14 @@ void BackgroundBuffer::DrawFloor(const std::vector<uint8_t>& rom_data,
uint8_t floor_graphics) {
// Create bitmap ONCE at the start if it doesn't exist
if (!bitmap_.is_active() || bitmap_.width() == 0) {
printf("[DrawFloor] Creating bitmap: %dx%d, active=%d, width=%d\n",
width_, height_, bitmap_.is_active(), bitmap_.width());
bitmap_.Create(width_, height_, 8, std::vector<uint8_t>(width_ * height_, 0));
printf("[DrawFloor] After Create: active=%d, width=%d, height=%d\n",
bitmap_.is_active(), bitmap_.width(), bitmap_.height());
} else {
printf("[DrawFloor] Bitmap already exists: active=%d, width=%d, height=%d\n",
bitmap_.is_active(), bitmap_.width(), bitmap_.height());
}
auto f = (uint8_t)(floor_graphics << 4);