diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp index 9810067aef..8a41a5cd32 100644 --- a/src/blitter/32bpp_anim.cpp +++ b/src/blitter/32bpp_anim.cpp @@ -508,6 +508,11 @@ void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 colou } while (--height); } +void Blitter_32bppAnim::DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) +{ + this->Blitter_32bppAnim::DrawRect((Colour *)video + x + y * _screen.pitch, width, height, colour); +} + void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width, int height) { assert(!_screen_disable_anim); diff --git a/src/blitter/32bpp_anim.hpp b/src/blitter/32bpp_anim.hpp index b9322b924b..5367b940d2 100644 --- a/src/blitter/32bpp_anim.hpp +++ b/src/blitter/32bpp_anim.hpp @@ -43,6 +43,7 @@ public: void SetRect(void *video, int x, int y, const uint8 *colours, uint lines, uint width, uint pitch) override; void SetRect32(void *video, int x, int y, const uint32 *colours, uint lines, uint width, uint pitch) override; void DrawRect(void *video, int width, int height, uint8 colour) override; + void DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) override; void CopyFromBuffer(void *video, const void *src, int width, int height) override; void CopyToBuffer(const void *video, void *dst, int width, int height) override; void ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y) override; diff --git a/src/blitter/32bpp_base.cpp b/src/blitter/32bpp_base.cpp index bd2b0d9fc4..75c64d69cd 100644 --- a/src/blitter/32bpp_base.cpp +++ b/src/blitter/32bpp_base.cpp @@ -75,6 +75,11 @@ void Blitter_32bppBase::DrawRect(void *video, int width, int height, uint8 colou } while (--height); } +void Blitter_32bppBase::DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) +{ + this->Blitter_32bppBase::DrawRect((Colour *)video + x + y * _screen.pitch, width, height, colour); +} + void Blitter_32bppBase::CopyFromBuffer(void *video, const void *src, int width, int height) { uint32 *dst = (uint32 *)video; diff --git a/src/blitter/32bpp_base.hpp b/src/blitter/32bpp_base.hpp index 5cb1fe38b7..8f8020603b 100644 --- a/src/blitter/32bpp_base.hpp +++ b/src/blitter/32bpp_base.hpp @@ -26,6 +26,7 @@ public: void SetRect(void *video, int x, int y, const uint8 *colours, uint lines, uint width, uint pitch) override; void SetRect32(void *video, int x, int y, const uint32 *colours, uint lines, uint width, uint pitch) override; void DrawRect(void *video, int width, int height, uint8 colour) override; + void DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) override; void CopyFromBuffer(void *video, const void *src, int width, int height) override; void CopyToBuffer(const void *video, void *dst, int width, int height) override; void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override; diff --git a/src/blitter/40bpp_anim.cpp b/src/blitter/40bpp_anim.cpp index d39c746862..1f6ad2bb5c 100644 --- a/src/blitter/40bpp_anim.cpp +++ b/src/blitter/40bpp_anim.cpp @@ -109,6 +109,11 @@ void Blitter_40bppAnim::DrawRect(void *video, int width, int height, uint8 colou } while (--height); } +void Blitter_40bppAnim::DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) +{ + this->Blitter_40bppAnim::DrawRect((Colour *)video + x + y * _screen.pitch, width, height, colour); +} + void Blitter_40bppAnim::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) { if (_screen_disable_anim) { diff --git a/src/blitter/40bpp_anim.hpp b/src/blitter/40bpp_anim.hpp index 189ad310fa..60f5661ca8 100644 --- a/src/blitter/40bpp_anim.hpp +++ b/src/blitter/40bpp_anim.hpp @@ -24,6 +24,7 @@ public: void SetRect(void *video, int x, int y, const uint8 *colours, uint lines, uint width, uint pitch) override; void SetRect32(void *video, int x, int y, const uint32 *colours, uint lines, uint width, uint pitch) override; void DrawRect(void *video, int width, int height, uint8 colour) override; + void DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) override; void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override; void CopyFromBuffer(void *video, const void *src, int width, int height) override; void CopyToBuffer(const void *video, void *dst, int width, int height) override; diff --git a/src/blitter/8bpp_base.cpp b/src/blitter/8bpp_base.cpp index 450eb09aa4..edf040289e 100644 --- a/src/blitter/8bpp_base.cpp +++ b/src/blitter/8bpp_base.cpp @@ -64,6 +64,11 @@ void Blitter_8bppBase::DrawRect(void *video, int width, int height, uint8 colour } while (--height); } +void Blitter_8bppBase::DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) +{ + this->Blitter_8bppBase::DrawRect((uint8 *)video + x + y * _screen.pitch, width, height, colour); +} + void Blitter_8bppBase::CopyFromBuffer(void *video, const void *src, int width, int height) { uint8 *dst = (uint8 *)video; diff --git a/src/blitter/8bpp_base.hpp b/src/blitter/8bpp_base.hpp index cfdd7723eb..bc971954ef 100644 --- a/src/blitter/8bpp_base.hpp +++ b/src/blitter/8bpp_base.hpp @@ -23,6 +23,7 @@ public: void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override; void SetRect(void *video, int x, int y, const uint8 *colours, uint lines, uint width, uint pitch) override; void DrawRect(void *video, int width, int height, uint8 colour) override; + void DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) override; void CopyFromBuffer(void *video, const void *src, int width, int height) override; void CopyToBuffer(const void *video, void *dst, int width, int height) override; void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override; diff --git a/src/blitter/base.hpp b/src/blitter/base.hpp index 242fbbb435..fd640a28df 100644 --- a/src/blitter/base.hpp +++ b/src/blitter/base.hpp @@ -161,6 +161,17 @@ public: */ virtual void DrawRect(void *video, int width, int height, uint8 colour) = 0; + /** + * Make a single horizontal line in a single colour on the video-buffer. + * @param video The destination pointer (video-buffer). + * @param x The x position within video-buffer. + * @param y The y position within video-buffer. + * @param width The length of the line. + * @param height The height of the line. + * @param colour A 8bpp mapping colour. + */ + virtual void DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) = 0; + /** * Draw a line with a given colour. * @param video The destination pointer (video-buffer). diff --git a/src/blitter/null.hpp b/src/blitter/null.hpp index 5f1282bb0e..25f11a8432 100644 --- a/src/blitter/null.hpp +++ b/src/blitter/null.hpp @@ -23,6 +23,7 @@ public: void SetPixel(void *video, int x, int y, uint8 colour) override {}; void SetPixel32(void *video, int x, int y, uint8 colour, uint32 colour32) override {}; void DrawRect(void *video, int width, int height, uint8 colour) override {}; + void DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) override {}; void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override {}; void SetRect(void *video, int x, int y, const uint8 *colours, uint lines, uint width, uint pitch) override {}; void SetRect32(void *video, int x, int y, const uint32 *colours, uint lines, uint width, uint pitch) override {};