diff --git a/src/app/gfx/bitmap.cc b/src/app/gfx/bitmap.cc index 826adf9b..619f8963 100644 --- a/src/app/gfx/bitmap.cc +++ b/src/app/gfx/bitmap.cc @@ -116,6 +116,14 @@ absl::Status Bitmap::CreateFromTiles(const std::vector &tiles) { return absl::OkStatus(); } +absl::Status Bitmap::WritePixel(int pos, uchar pixel) { + if (!surface_) { + return absl::InternalError("Surface not loaded"); + } + surface_->pixels[pos] = pixel; + return absl::OkStatus(); +} + } // namespace gfx } // namespace app } // namespace yaze diff --git a/src/app/gfx/bitmap.h b/src/app/gfx/bitmap.h index 416a3dca..1b9df30f 100644 --- a/src/app/gfx/bitmap.h +++ b/src/app/gfx/bitmap.h @@ -31,6 +31,8 @@ class Bitmap { absl::StatusOr> CreateTiles(); absl::Status CreateFromTiles(const std::vector &tiles); + + absl::Status WritePixel(int pos, uchar pixel); int GetWidth() const { return width_; } int GetHeight() const { return height_; }