replace old renderer access pattern

This commit is contained in:
scawful
2024-08-09 18:58:07 -04:00
parent a37f3bbd43
commit 9a2c8ae17a
16 changed files with 129 additions and 154 deletions

View File

@@ -1,5 +1,6 @@
#include "inventory.h"
#include "app/core/platform/renderer.h"
#include "app/gfx/bitmap.h"
#include "app/gfx/snes_tile.h"
#include "app/gui/canvas.h"
@@ -10,6 +11,8 @@ namespace app {
namespace zelda3 {
namespace screen {
using core::Renderer;
absl::Status Inventory::Create() {
data_.reserve(256 * 256);
for (int i = 0; i < 256 * 256; i++) {
@@ -65,7 +68,7 @@ absl::Status Inventory::Create() {
bitmap_.Create(256, 256, 8, data_);
RETURN_IF_ERROR(bitmap_.ApplyPalette(palette_));
rom()->RenderBitmap(&bitmap_);
Renderer::GetInstance().RenderBitmap(&bitmap_);
return absl::OkStatus();
}
@@ -84,7 +87,7 @@ absl::Status Inventory::BuildTileset() {
auto hud_pal_group = rom()->palette_group().hud;
palette_ = hud_pal_group[0];
RETURN_IF_ERROR(tilesheets_bmp_.ApplyPalette(palette_))
rom()->RenderBitmap(&tilesheets_bmp_);
Renderer::GetInstance().RenderBitmap(&tilesheets_bmp_);
return absl::OkStatus();
}