Add ApplyPalette routine to Bitmap class
This commit is contained in:
@@ -57,6 +57,10 @@ void Bitmap::CreateTexture(std::shared_ptr<SDL_Renderer> renderer) {
|
|||||||
texture_ = SDL_CreateTextureFromSurface(renderer.get(), surface_);
|
texture_ = SDL_CreateTextureFromSurface(renderer.get(), surface_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Bitmap::ApplyPalette(const SNESPalette& palette) {
|
||||||
|
palette_ = palette;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace gfx
|
} // namespace gfx
|
||||||
} // namespace app
|
} // namespace app
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ class Bitmap {
|
|||||||
|
|
||||||
void Create(int width, int height, int depth, uchar *data);
|
void Create(int width, int height, int depth, uchar *data);
|
||||||
void Create(int width, int height, int depth, int data_size);
|
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 GetWidth() const { return width_; }
|
||||||
int GetHeight() const { return height_; }
|
int GetHeight() const { return height_; }
|
||||||
void CreateTexture(std::shared_ptr<SDL_Renderer> renderer);
|
|
||||||
uchar *GetData() const { return pixel_data_; }
|
uchar *GetData() const { return pixel_data_; }
|
||||||
SDL_Texture *GetTexture() const { return texture_; }
|
SDL_Texture *GetTexture() const { return texture_; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user