diff options
author | Paul Gilbert | 2018-11-18 21:40:23 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | f7cb4170847373a84268479bd7487c20c58d5639 (patch) | |
tree | 30c883d3e81fc88dc3f972c11981e7ebc785648c /engines/glk/picture.cpp | |
parent | 5a05140ac34a6a177b90a22f8601f2adff4831d5 (diff) | |
download | scummvm-rg350-f7cb4170847373a84268479bd7487c20c58d5639.tar.gz scummvm-rg350-f7cb4170847373a84268479bd7487c20c58d5639.tar.bz2 scummvm-rg350-f7cb4170847373a84268479bd7487c20c58d5639.zip |
GLK: Add picture drawing
Diffstat (limited to 'engines/glk/picture.cpp')
-rw-r--r-- | engines/glk/picture.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/glk/picture.cpp b/engines/glk/picture.cpp index 89e75fa941..122d9c3f30 100644 --- a/engines/glk/picture.cpp +++ b/engines/glk/picture.cpp @@ -21,6 +21,8 @@ */ #include "glk/picture.h" +#include "glk/glk.h" +#include "glk/screen.h" #include "common/file.h" #include "image/jpeg.h" #include "image/png.h" @@ -29,8 +31,8 @@ namespace Glk { void Pictures::clear() { for (uint idx = 0; idx < _store.size(); ++idx) { - delete _store[idx]._picture; - delete _store[idx]._scaled; + _store[idx]._picture->decrement(); + _store[idx]._scaled->decrement(); } _store.clear(); @@ -139,6 +141,7 @@ Picture *Pictures::scale(Picture *src, size_t sx, size_t sy) { dst->transBlitFrom(*src, src->getBounds(), dst->getBounds(), (uint)-1); storeScaled(dst); + return dst; } /*--------------------------------------------------------------------------*/ @@ -154,9 +157,9 @@ void Picture::decrement() { } } -void Picture::drawPicture(int x0, int y0, int dx0, int dy0, int dx1, int dy1) { - // TODO: drawPicture +void Picture::drawPicture(const Common::Point &destPos, const Common::Rect &box) { + Graphics::Surface s = g_vm->_screen->getSubArea(box); + s.copyRectToSurface(*this, destPos.x - box.left, destPos.y, getBounds()); } - } // End of namespace Glk |