diff options
Diffstat (limited to 'engines/prince/prince.cpp')
-rw-r--r-- | engines/prince/prince.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 9cd7056a41..c82dfd6723 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -47,10 +47,12 @@ #include "prince/font.h"
#include "prince/mhwanh.h"
#include "prince/graphics.h"
+#include "prince/script.h"
namespace Prince {
-PrinceEngine::PrinceEngine(OSystem *syst, const PrinceGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
+PrinceEngine::PrinceEngine(OSystem *syst, const PrinceGameDescription *gameDesc) :
+ Engine(syst), _gameDescription(gameDesc), _graph(NULL), _script(NULL) {
_rnd = new Common::RandomSource("prince");
}
@@ -96,22 +98,33 @@ Common::Error PrinceEngine::run() { _system->getPaletteManager()->setPalette(roomBmp.getPalette(), 0, 256);
//font1.drawString(_frontScreen, "Hello World", 10, 10, 640, 1);
-
- MhwanhDecoder walizkaBmp;
+ //
+ _graph->_roomBackground = roomBmp.getSurface();
+#if 1
+ MhwanhDecoder *walizkaBmp = new MhwanhDecoder();
if (walizka) {
debug("Loading walizka");
- if (walizkaBmp.loadStream(*walizka)) {
- _graph->_roomBackground = walizkaBmp.getSurface();
- _graph->setPalette(walizkaBmp.getPalette());
+ if (walizkaBmp->loadStream(*walizka)) {
+ _graph->_roomBackground = walizkaBmp->getSurface();
+ _graph->setPalette(walizkaBmp->getPalette());
}
}
-
+#endif
_graph->change();
+
+ Common::SeekableReadStream * skryptStream = SearchMan.createReadStreamForMember("skrypt.dat");
+ if (!skryptStream)
+ return Common::kPathNotFile;
+ _script = new Script(this);
+ _script->loadFromStream(*skryptStream);
+
+ delete skryptStream;
mainLoop();
+ delete room;
+ delete walizkaBmp;
}
- delete room;
return Common::kNoError;
}
@@ -145,6 +158,8 @@ void PrinceEngine::mainLoop() { if (shouldQuit())
return;
+ _script->step();
+
_graph->update();
_system->delayMillis(40);
|