selected tile tracks cursor, loads tile gfx

This commit is contained in:
scawful
2023-01-01 13:45:50 -06:00
parent 6902102402
commit a6099674d1
5 changed files with 112 additions and 87 deletions

View File

@@ -39,6 +39,7 @@ Bitmap::Bitmap(int width, int height, int depth, uchar *data, int data_size) {
// Pass raw pixel data directly to the surface
void Bitmap::Create(int width, int height, int depth, uchar *data) {
active_ = true;
width_ = width;
height_ = height;
depth_ = depth;
@@ -53,6 +54,7 @@ void Bitmap::Create(int width, int height, int depth, uchar *data) {
// Reserves data to later draw to surface via pointer
void Bitmap::Create(int width, int height, int depth, int size) {
active_ = true;
width_ = width;
height_ = height;
depth_ = depth;
@@ -69,6 +71,7 @@ void Bitmap::Create(int width, int height, int depth, int size) {
// Pass raw pixel data directly to the surface
void Bitmap::Create(int width, int height, int depth, uchar *data, int size) {
active_ = true;
width_ = width;
height_ = height;
depth_ = depth;
@@ -83,6 +86,7 @@ void Bitmap::Create(int width, int height, int depth, uchar *data, int size) {
}
void Bitmap::Create(int width, int height, int depth, Bytes data) {
active_ = true;
width_ = width;
height_ = height;
depth_ = depth;

View File

@@ -45,6 +45,7 @@ class Bitmap {
auto GetByte(int i) const { return pixel_data_[i]; }
auto GetTexture() const { return texture_.get(); }
auto GetSurface() const { return surface_.get(); }
auto IsActive() const { return active_; }
private:
struct SDL_Texture_Deleter {
@@ -71,6 +72,7 @@ class Bitmap {
int depth_ = 0;
int data_size_ = 0;
bool freed_ = false;
bool active_ = false;
uchar *pixel_data_;
Bytes data_;
gfx::SNESPalette palette_;