HOPKINS: Implemented screen lock, unlock, and clear screen

This commit is contained in:
Paul Gilbert 2012-09-09 00:12:27 +10:00
parent ecee539bfd
commit 42a09f00b3
3 changed files with 34 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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);