diff options
author | Eugene Sandulenko | 2016-12-15 18:18:12 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-12-15 18:18:12 +0100 |
commit | d6126ffcfacb7bb29986196e5826e9ca7e34ad70 (patch) | |
tree | a42d00aa4bf67296334b04a9e15d4f567ef43ed6 | |
parent | 2f7879d1183cd327219a8a6f1521ed5332db90d9 (diff) | |
download | scummvm-rg350-d6126ffcfacb7bb29986196e5826e9ca7e34ad70.tar.gz scummvm-rg350-d6126ffcfacb7bb29986196e5826e9ca7e34ad70.tar.bz2 scummvm-rg350-d6126ffcfacb7bb29986196e5826e9ca7e34ad70.zip |
GRAPHICS: Implemented blitting code for MacText
-rw-r--r-- | graphics/macgui/mactext.cpp | 11 | ||||
-rw-r--r-- | graphics/macgui/mactext.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 4807e19dbb..fde79f910e 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -94,4 +94,15 @@ void MacText::render() { } } +void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) { + render(); + + if (x + w < _surface.w || y + h < _surface.h) { + g->fillRect(Common::Rect(x, y, x + w, y + w), _bgcolor); + } + + g->blitFrom(_surface, Common::Rect(MIN<int>(_surface.w, x), MIN<int>(_surface.h, y), + MIN<int>(_surface.w, x + w), MIN<int>(_surface.w, y + w)), Common::Point(xoff, yoff)); +} + } // End of namespace Graphics diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h index 7831e65c46..4add3948fa 100644 --- a/graphics/macgui/mactext.h +++ b/graphics/macgui/mactext.h @@ -34,6 +34,9 @@ public: void setInterLinear(int interLinear) { _interLinear = interLinear; } + void draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff); + + private: void splitString(); void render(); |