epic: refactor SDL2_Renderer usage to IRenderer and queued texture rendering

- Updated the testing guide to clarify the testing framework's organization and execution methods, improving user understanding.
- Refactored CMakeLists to include new platform-specific files, ensuring proper integration of the rendering backend.
- Modified main application files to utilize the new IRenderer interface, enhancing flexibility in rendering operations.
- Implemented deferred texture management in various components, allowing for more efficient graphics handling and improved performance.
- Introduced new methods for texture creation and updates, streamlining the rendering process across the application.
- Enhanced logging and error handling in the rendering pipeline to facilitate better debugging and diagnostics.
This commit is contained in:
scawful
2025-10-07 17:15:11 -04:00
parent 9e6f538520
commit 6c331f1fd0
101 changed files with 1401 additions and 2677 deletions

View File

@@ -321,8 +321,9 @@ void Room::RenderRoomGraphics() {
}
// CRITICAL: Recreate textures with the palette applied!
core::Renderer::Get().RenderBitmap(&bg1_buffer_.bitmap());
core::Renderer::Get().RenderBitmap(&bg2_buffer_.bitmap());
// TODO: Queue texture for later rendering.
// core::Renderer::Get().RenderBitmap(&bg1_buffer_.bitmap());
// core::Renderer::Get().RenderBitmap(&bg2_buffer_.bitmap());
}
void Room::RenderObjectsToBackground() {

View File

@@ -8,6 +8,7 @@
#include "app/gfx/bitmap.h"
#include "app/gfx/snes_tile.h"
#include "app/gfx/tilemap.h"
#include "app/gfx/backend/irenderer.h"
#include "app/snes.h"
#include "util/hex.h"
@@ -130,7 +131,8 @@ absl::Status LoadDungeonMapTile16(gfx::Tilemap &tile16_blockset, Rom &rom,
}
tile16_blockset.atlas.SetPalette(*rom.mutable_dungeon_palette(3));
core::Renderer::Get().RenderBitmap(&tile16_blockset.atlas);
// TODO: Queue texture for later rendering.
// core::Renderer::Get().RenderBitmap(&tile16_blockset.atlas);
return absl::OkStatus();
}
@@ -187,7 +189,8 @@ absl::Status LoadDungeonMapGfxFromBinary(Rom &rom,
converted_bin.begin() + ((i + 1) * 0x1000));
sheets[i] = gfx::Bitmap(128, 32, 8, gfx_sheets[i]);
sheets[i].SetPalette(*rom.mutable_dungeon_palette(3));
core::Renderer::Get().RenderBitmap(&sheets[i]);
// TODO: Queue texture for later rendering.
// core::Renderer::Get().RenderBitmap(&sheets[i]);
}
}
file.close();

View File

@@ -1,5 +1,6 @@
#include "inventory.h"
#include "app/gfx/backend/irenderer.h"
#include "app/core/window.h"
#include "app/gfx/bitmap.h"
#include "app/gfx/snes_tile.h"
@@ -8,8 +9,6 @@
namespace yaze {
namespace zelda3 {
using core::Renderer;
absl::Status Inventory::Create() {
data_.reserve(256 * 256);
for (int i = 0; i < 256 * 256; i++) {
@@ -69,7 +68,8 @@ absl::Status Inventory::Create() {
bitmap_.Create(256, 256, 8, data_);
bitmap_.SetPalette(palette_);
Renderer::Get().RenderBitmap(&bitmap_);
// TODO: Queue texture for later rendering.
// Renderer::Get().RenderBitmap(&bitmap_);
return absl::OkStatus();
}
@@ -88,7 +88,8 @@ absl::Status Inventory::BuildTileset() {
auto hud_pal_group = rom()->palette_group().hud;
palette_ = hud_pal_group[0];
tilesheets_bmp_.SetPalette(palette_);
Renderer::Get().RenderBitmap(&tilesheets_bmp_);
// TODO: Queue texture for later rendering.
// Renderer::Get().RenderBitmap(&tilesheets_bmp_);
return absl::OkStatus();
}