diff options
author | Filippos Karapetis | 2016-09-17 22:34:47 +0300 |
---|---|---|
committer | Filippos Karapetis | 2016-10-03 00:32:44 +0300 |
commit | 039261e731cc7eaf290a97ef096b2d3d1ee29da7 (patch) | |
tree | 40687e17ed98e809e329885d287818b694b44a1f /engines/chewy/chewy.cpp | |
parent | 9dd2e5d24ede940ab29b4abbaf823041910a893d (diff) | |
download | scummvm-rg350-039261e731cc7eaf290a97ef096b2d3d1ee29da7.tar.gz scummvm-rg350-039261e731cc7eaf290a97ef096b2d3d1ee29da7.tar.bz2 scummvm-rg350-039261e731cc7eaf290a97ef096b2d3d1ee29da7.zip |
CHEWY: Initial implementation of a resource manager, and a main loop
Diffstat (limited to 'engines/chewy/chewy.cpp')
-rw-r--r-- | engines/chewy/chewy.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/engines/chewy/chewy.cpp b/engines/chewy/chewy.cpp index a26a944674..130e31b64c 100644 --- a/engines/chewy/chewy.cpp +++ b/engines/chewy/chewy.cpp @@ -20,12 +20,16 @@ * */ +#include "common/config-manager.h" #include "common/error.h" +#include "common/events.h" +#include "common/system.h" #include "engines/engine.h" #include "engines/util.h" #include "chewy/chewy.h" +#include "chewy/resource.h" namespace Chewy { @@ -33,6 +37,16 @@ ChewyEngine::ChewyEngine(OSystem *syst, const ChewyGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _rnd("chewy") { + + const Common::FSNode gameDataDir(ConfMan.get("path")); + + SearchMan.addSubDirectoryMatching(gameDataDir, "back"); + SearchMan.addSubDirectoryMatching(gameDataDir, "cut"); + SearchMan.addSubDirectoryMatching(gameDataDir, "err"); + SearchMan.addSubDirectoryMatching(gameDataDir, "misc"); + SearchMan.addSubDirectoryMatching(gameDataDir, "room"); + SearchMan.addSubDirectoryMatching(gameDataDir, "sound"); + SearchMan.addSubDirectoryMatching(gameDataDir, "txt"); } ChewyEngine::~ChewyEngine() { @@ -44,6 +58,28 @@ Common::Error ChewyEngine::run() { initialize(); + Resource *res = new Resource("comic.tgp"); + TBFChunk *cur = res->getChunk(1); + + debug("Chunk 1: packed %d, type %d, pos %d, mode %d, comp %d, unpacked %d, width %d, height %d", + cur->packedSize, cur->type, cur->pos, cur->screenMode, cur->compressionFlag, cur->unpackedSize, + cur->width, cur->height + ); + + delete res; + + // Run a dummy loop + Common::Event event; + + while (!shouldQuit()) { + while (g_system->getEventManager()->pollEvent(event)) { + if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP) + g_engine->quitGame(); + } + + g_system->delayMillis(10); + } + return Common::kNoError; } |