From 1fd875421fd8e757fd79c6ceebe4f9b8ba57425e Mon Sep 17 00:00:00 2001 From: Justin Scofield <47263509+scawful@users.noreply.github.com> Date: Sun, 10 Jul 2022 15:41:21 -0400 Subject: [PATCH] Add ApplyPalette routine to Bitmap class --- src/app/gfx/bitmap.cc | 4 ++++ src/app/gfx/bitmap.h | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/gfx/bitmap.cc b/src/app/gfx/bitmap.cc index ec5be1bb..c38be4e0 100644 --- a/src/app/gfx/bitmap.cc +++ b/src/app/gfx/bitmap.cc @@ -57,6 +57,10 @@ void Bitmap::CreateTexture(std::shared_ptr renderer) { texture_ = SDL_CreateTextureFromSurface(renderer.get(), surface_); } +void Bitmap::ApplyPalette(const SNESPalette& palette) { + palette_ = palette; +} + } // namespace gfx } // namespace app } // namespace yaze diff --git a/src/app/gfx/bitmap.h b/src/app/gfx/bitmap.h index 5fd16c44..90ea454b 100644 --- a/src/app/gfx/bitmap.h +++ b/src/app/gfx/bitmap.h @@ -17,9 +17,12 @@ class Bitmap { void Create(int width, int height, int depth, uchar *data); void Create(int width, int height, int depth, int data_size); + void CreateTexture(std::shared_ptr renderer); + + void ApplyPalette(const SNESPalette& palette); + int GetWidth() const { return width_; } int GetHeight() const { return height_; } - void CreateTexture(std::shared_ptr renderer); uchar *GetData() const { return pixel_data_; } SDL_Texture *GetTexture() const { return texture_; }