aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/hdb.cpp
diff options
context:
space:
mode:
authorNipun Garg2019-05-25 03:59:46 +0530
committerEugene Sandulenko2019-09-03 17:16:41 +0200
commit33332afbb2c80c34c4e90b10d86b8c4d11e25421 (patch)
tree9fb58ee3a1f215e446bfec90e8eaf7a946a88061 /engines/hdb/hdb.cpp
parent41e8724edae7b3111e2bf2727c1d2cc6fb458335 (diff)
downloadscummvm-rg350-33332afbb2c80c34c4e90b10d86b8c4d11e25421.tar.gz
scummvm-rg350-33332afbb2c80c34c4e90b10d86b8c4d11e25421.tar.bz2
scummvm-rg350-33332afbb2c80c34c4e90b10d86b8c4d11e25421.zip
HDB: Setup first Drawing Surface
Diffstat (limited to 'engines/hdb/hdb.cpp')
-rw-r--r--engines/hdb/hdb.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index a6c7013ea6..7c9aafbe7b 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -27,6 +27,8 @@
#include "common/debug-channels.h"
#include "common/file.h"
#include "common/error.h"
+#include "graphics/surface.h"
+#include "graphics/palette.h"
#include "hdb.h"
#include "console.h"
@@ -47,26 +49,34 @@ HDBGame::~HDBGame() {
Common::Error HDBGame::run() {
// Initializes Graphics
- initGraphics(800, 600);
+ Graphics::PixelFormat format = g_system->getScreenFormat();
+ initGraphics(800, 600, &format);
_console = new Console();
-
readMPC("hyperdemo.mpc");
+
+ while (!shouldQuit()) {
- bool quit = false;
-
- while (!quit) {
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_QUIT:
- quit = true;
+ case Common::EVENT_RTL:
+ break;
+ case Common::EVENT_KEYDOWN:
+ debug("Key was pressed.");
break;
default:
break;
}
}
-
+
+ Graphics::Surface screen;
+ screen.create(800, 600, g_system->getScreenFormat());
+ screen.drawLine(100, 100, 200, 200, 0xffffffff);
+
+ g_system->copyRectToScreen(screen.getBasePtr(0, 0), screen.pitch, 0, 0, 800, 600);
+
g_system->updateScreen();
g_system->delayMillis(10);
}
@@ -85,7 +95,6 @@ void HDBGame::readMPC(const Common::String &filename) {
_dataHeader.signature[4] = '\0';
if (_dataHeader.isValid()) {
- debug("Valid MPC file");
_dataHeader.dirOffset = _file.readUint32LE();
// FIXME: The MPC archive format considers dirOffset to be a uint32.