aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_graphics.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2018-06-15 00:48:00 +0200
committerBastien Bouclet2018-06-29 13:31:54 +0200
commit0ca52f62a4b475081f77eb933934c8f3448f33e2 (patch)
tree575770bfee6b8d5204f4085c8d6a6d52291373e0 /engines/mohawk/riven_graphics.cpp
parent1e9b58ab4bf864456de315c03c3cf3d0d2a81b2e (diff)
downloadscummvm-rg350-0ca52f62a4b475081f77eb933934c8f3448f33e2.tar.gz
scummvm-rg350-0ca52f62a4b475081f77eb933934c8f3448f33e2.tar.bz2
scummvm-rg350-0ca52f62a4b475081f77eb933934c8f3448f33e2.zip
MOHAWK: RIVEN: Draw menu with TTF fonts
Diffstat (limited to 'engines/mohawk/riven_graphics.cpp')
-rw-r--r--engines/mohawk/riven_graphics.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/mohawk/riven_graphics.cpp b/engines/mohawk/riven_graphics.cpp
index e19a56da92..cc5105b15c 100644
--- a/engines/mohawk/riven_graphics.cpp
+++ b/engines/mohawk/riven_graphics.cpp
@@ -366,6 +366,26 @@ void RivenGraphics::copyImageToScreen(uint16 image, uint32 left, uint32 top, uin
applyScreenUpdate();
}
+void RivenGraphics::copySurfaceToScreen(Graphics::Surface *src, uint32 x, uint32 y) {
+ beginScreenUpdate();
+
+ int w = src->w;
+ int h = src->h;
+
+ // Clip the width to fit on the screen. Fixes some images.
+ if (x + w > 608)
+ w = 608 - x;
+
+ if (y + h > 436)
+ h = 346 - y;
+
+ for (uint16 i = 0; i < h; i++)
+ memcpy(_mainScreen->getBasePtr(x, i + y), src->getBasePtr(0, i), w * src->format.bytesPerPixel);
+
+ _dirtyScreen = true;
+ applyScreenUpdate();
+}
+
void RivenGraphics::updateScreen() {
if (_dirtyScreen) {
// Copy to screen if there's no transition. Otherwise transition.