aboutsummaryrefslogtreecommitdiff
path: root/engines/dm/dm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dm/dm.cpp')
-rw-r--r--engines/dm/dm.cpp49
1 files changed, 36 insertions, 13 deletions
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index ba6c326db8..d6fc1f3d7d 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -1,16 +1,17 @@
#include "common/scummsys.h"
+#include "common/system.h"
-#include "common/config-manager.h"
#include "common/debug.h"
#include "common/debug-channels.h"
#include "common/error.h"
-#include "gui/EventRecorder.h"
-#include "common/file.h"
-#include "common/fs.h"
#include "engines/util.h"
+#include "engines/engine.h"
+#include "graphics/palette.h"
+#include "common/file.h"
#include "dm/dm.h"
+#include "dm/gfx.h"
namespace DM {
@@ -36,26 +37,48 @@ DMEngine::~DMEngine() {
// dispose of resources
delete _rnd;
+ delete _console;
+ delete _displayMan;
// clear debug channels
DebugMan.clearAllDebugChannels();
}
Common::Error DMEngine::run() {
- // Init graphics
initGraphics(320, 200, false);
-
- // Create debug console (it requirese GFX to be inited)
_console = new Console(this);
+ _displayMan = new DisplayMan(this);
+ _displayMan->setUpScreens(320, 200);
+ _displayMan->loadGraphics();
+
+
+ byte *palette = new byte[256 * 3];
+ for (int i = 0; i < 16; ++i)
+ palette[i * 3] = palette[i * 3 + 1] = palette[i * 3 + 2] = i * 16;
+
+ _displayMan->setPalette(palette, 16);
+
+ byte *buffer = new byte[320 * 200];
+ for (int i = 0; i < 320 * 100; ++i)
+ buffer[i] = 4;
+ for (int i = 320 * 100; i < 320 * 200; ++i)
+ buffer[i] = 6;
+
+ _system->copyRectToScreen(buffer, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+
+
+ uint16 width = _displayMan->getImageWidth(75);
+ uint16 height = _displayMan->getImageHeight(75);
+ byte *cleanByteImg0Data = new byte[width * height];
+ _displayMan->loadIntoBitmap(75, cleanByteImg0Data);
+ _displayMan->blitToScreen(cleanByteImg0Data, width, height, 30, 30);
- // Additional setup
- debug("DMEngine::init");
- // Run main loop
- debug("DMEngine:: start main loop");
+ while (true) {
+ _displayMan->updateScreen();
+ }
- while (true)
- debug("Run!");
return Common::kNoError;
}