aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
authorPaul Gilbert2012-09-09 00:12:27 +1000
committerPaul Gilbert2012-09-09 00:12:27 +1000
commit42a09f00b336ce3405ff7558719f07e6f15326aa (patch)
tree75d26955059f04017b6f2fdbb4ab61484cc24315 /engines/hopkins
parentecee539bfde463648d69e0330500ab5ad3cde080 (diff)
downloadscummvm-rg350-42a09f00b336ce3405ff7558719f07e6f15326aa.tar.gz
scummvm-rg350-42a09f00b336ce3405ff7558719f07e6f15326aa.tar.bz2
scummvm-rg350-42a09f00b336ce3405ff7558719f07e6f15326aa.zip
HOPKINS: Implemented screen lock, unlock, and clear screen
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/graphics.cpp26
-rw-r--r--engines/hopkins/graphics.h6
-rw-r--r--engines/hopkins/hopkins.cpp8
3 files changed, 34 insertions, 6 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 7b04e1f1ba..21c5d6c478 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -21,6 +21,7 @@
*/
#include "common/system.h"
+#include "common/rect.h"
#include "engines/util.h"
#include "hopkins/files.h"
#include "hopkins/globals.h"
@@ -161,10 +162,16 @@ int ObjectManager::AJOUTE_OBJET(int objIndex) {
return arrIndex;
}
+/*------------------------------------------------------------------------*/
+
GraphicsManager::GraphicsManager() {
SDL_MODEYES = false;
}
+GraphicsManager::~GraphicsManager() {
+}
+
+
void GraphicsManager::SET_MODE(int width, int height) {
if (!SDL_MODEYES) {
SDL_ECHELLE = 0;
@@ -192,13 +199,14 @@ void GraphicsManager::SET_MODE(int width, int height) {
//height = Reel_Zoom(a2, SDL_ECHELLE);
}
- if (bpp == 8)
+ if (bpp == 8) {
initGraphics(width, height, true);
- else {
+ } else {
Graphics::PixelFormat pixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
initGraphics(width, height, true, &pixelFormat);
}
+ VideoPtr = NULL;
XSCREEN = width;
YSCREEN = height;
@@ -219,4 +227,18 @@ void GraphicsManager::SET_MODE(int width, int height) {
}
}
+void GraphicsManager::DD_Lock() {
+ VideoPtr = g_system->lockScreen();
+}
+
+void GraphicsManager::DD_Unlock() {
+ g_system->unlockScreen();
+}
+
+void GraphicsManager::Cls_Video() {
+ assert(VideoPtr);
+
+ VideoPtr->fillRect(Common::Rect(0, 0, XSCREEN, YSCREEN), 0);
+}
+
} // End of namespace Hopkins
diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h
index de80160dda..18cb44254e 100644
--- a/engines/hopkins/graphics.h
+++ b/engines/hopkins/graphics.h
@@ -26,6 +26,7 @@
#include "common/scummsys.h"
#include "common/endian.h"
#include "common/str.h"
+#include "graphics/surface.h"
namespace Hopkins {
@@ -63,10 +64,15 @@ public:
int nbrligne;
RGB8 cmap[256];
bool Linear;
+ Graphics::Surface *VideoPtr;
public:
GraphicsManager();
+ ~GraphicsManager();
void SET_MODE(int width, int height);
+ void DD_Lock();
+ void DD_Unlock();
+ void Cls_Video();
};
} // End of namespace Hopkins
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 342d7d2361..af8cd668ef 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -66,10 +66,10 @@ Common::Error HopkinsEngine::run() {
GLOBALS.HELICO = 0;
_mouse.hideCursor();
- /*
- DD_Lock();
- Cls_Video();
- DD_Unlock();
+ _graphicsManager.DD_Lock();
+ _graphicsManager.Cls_Video();
+ _graphicsManager.DD_Unlock();
+ /*
LOAD_IMAGE("LINUX");
FADE_INW();
SDL_Delay(1500);