diff options
-rw-r--r-- | engines/mortevielle/alert.cpp | 6 | ||||
-rw-r--r-- | engines/mortevielle/graphics.cpp | 17 | ||||
-rw-r--r-- | engines/mortevielle/graphics.h | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/engines/mortevielle/alert.cpp b/engines/mortevielle/alert.cpp index 3895bad7fd..36a51b07ed 100644 --- a/engines/mortevielle/alert.cpp +++ b/engines/mortevielle/alert.cpp @@ -143,6 +143,8 @@ int do_alert(Common::String str_, int n) { bool newaff, test, test1, test2, test3, dum; Common::String cas; + // Make a copy of the current screen surface for later restore + g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface); /*debug('** do_alert **');*/ memset(&limit[0][0], 0, sizeof(int) * 3 * 3); @@ -258,6 +260,10 @@ int do_alert(Common::String str_, int n) { } charecr(50, succ(int, nligne) << 4); show_mouse(); + + /* Restore the background area */ + g_vm->_screenSurface.copyFrom(g_vm->_backgroundSurface, 0, 0); + do_alert_result = quoi; return do_alert_result; } diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index 3683afc57b..3450d41cf5 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -935,6 +935,23 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) { } /** + * Copys a given surface to the given position + */ +void ScreenSurface::copyFrom(Graphics::Surface &src, int x, int y) { + Graphics::Surface destSurface = lockArea(Common::Rect(x, y, x + src.w, y + src.h)); + + // Loop through writing + for (int yp = 0; yp < src.h; ++yp) { + if (((y + yp) < 0) || ((y + yp) >= SCREEN_HEIGHT)) + continue; + + const byte *pSrc = (const byte *)src.getBasePtr(0, yp); + byte *pDest = (byte *)getBasePtr(0, yp); + Common::copy(pSrc, pSrc + src.w, pDest); + } +} + +/** * Draws a character at the specified co-ordinates * @remarks Because the ScummVM surface is using a double height 640x400 surface to * simulate the original 640x400 surface, all Y values have to be doubled diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h index 376b9e5e85..0b265469df 100644 --- a/engines/mortevielle/graphics.h +++ b/engines/mortevielle/graphics.h @@ -82,6 +82,7 @@ public: Graphics::Surface lockArea(const Common::Rect &bounds); void updateScreen(); void drawPicture(GfxSurface &surface, int x, int y); + void copyFrom(Graphics::Surface &src, int x, int y); void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex); void drawBox(int x, int y, int dx, int dy, int col); void fillBox(int colour, const Common::Rect &bounds, int patt); |