aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/menu.cpp18
-rw-r--r--engines/mortevielle/mortevielle.h1
-rw-r--r--engines/mortevielle/var_mor.cpp15
3 files changed, 28 insertions, 6 deletions
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index a43372063e..11c7c34b00 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -30,6 +30,7 @@
#include "common/textconsole.h"
#include "mortevielle/level15.h"
#include "mortevielle/menu.h"
+#include "mortevielle/mortevielle.h"
#include "mortevielle/mouse.h"
#include "mortevielle/sprint.h"
#include "mortevielle/var_mor.h"
@@ -255,6 +256,11 @@ void menu_down(int ii) {
int xco, nb_lig;
/* debug('menu_down'); */
+
+ // Make a copy of the current screen surface for later restore
+ g_vm->_backgroundSurface.copyFrom(g_vm->_screenSurface);
+
+ // Draw the menu
xco = don[ii][1];
nb_lig = don[ii][4];
hide_mouse();
@@ -307,6 +313,18 @@ void menu_up(int xx) {
/* debug('menu_up'); */
if (test0) {
charecr(10, succ(byte, don[xx][2]) << 1);
+
+ /* Restore the background area */
+ assert(g_vm->_screenSurface.pitch == g_vm->_backgroundSurface.pitch);
+
+ // Get a pointer to the source and destination of the area to restore
+ const byte *pSrc = (const byte *)g_vm->_backgroundSurface.getBasePtr(0, 10);
+ Graphics::Surface destArea = g_vm->_screenSurface.lockArea(Common::Rect(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT));
+ byte *pDest = (byte *)destArea.getBasePtr(0, 0);
+
+ // Copy the data
+ Common::copy(pSrc, pSrc + (400 - 10) * SCREEN_WIDTH, pDest);
+
test0 = false;
}
}
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 0555f302ab..9974d1c40e 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -64,6 +64,7 @@ private:
public:
ScreenSurface _screenSurface;
PaletteManager _paletteManager;
+ GfxSurface _backgroundSurface;
public:
MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc);
~MortevielleEngine();
diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp
index 9de3d94137..444d9c6d5d 100644
--- a/engines/mortevielle/var_mor.cpp
+++ b/engines/mortevielle/var_mor.cpp
@@ -319,8 +319,16 @@ char get_ch() {
return g_vm->getChar();
}
+/**
+ * Restore a screen sectio
+ */
+void s_sauv(int Gd, int y, int dy) {
+ // Note: May no longer be necessary, since the backgorund restore code
+ // is being handled slightly differently now in the menu_up() method
+}
+
void palette(int v1) {
- warning("TODO: s_sauv");
+ warning("TODO: palette");
}
// (* external 'c:\mc\charecr.com'; *)
@@ -328,11 +336,6 @@ void s_char(int Gd, int y, int dy) {
warning("TODO: s_char");
}
-// (* external 'c:\mc\sauvecr.com'; *)
-void s_sauv(int Gd, int y, int dy) {
- warning("TODO: s_sauv");
-}
-
// (* external 'c:\mc\boite.com'; *)
void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) {
debugC(1, kMortevielleCore, "TODO: box deprecated in favour of GfxSurface::fillBox");