Add ApplyPalette routine to Bitmap class

This commit is contained in:
Justin Scofield
2022-07-10 15:41:21 -04:00
parent 1e7b986adb
commit 1fd875421f
2 changed files with 8 additions and 1 deletions

View File

@@ -57,6 +57,10 @@ void Bitmap::CreateTexture(std::shared_ptr<SDL_Renderer> renderer) {
texture_ = SDL_CreateTextureFromSurface(renderer.get(), surface_);
}
void Bitmap::ApplyPalette(const SNESPalette& palette) {
palette_ = palette;
}
} // namespace gfx
} // namespace app
} // namespace yaze

View File

@@ -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<SDL_Renderer> renderer);
void ApplyPalette(const SNESPalette& palette);
int GetWidth() const { return width_; }
int GetHeight() const { return height_; }
void CreateTexture(std::shared_ptr<SDL_Renderer> renderer);
uchar *GetData() const { return pixel_data_; }
SDL_Texture *GetTexture() const { return texture_; }