aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hdb/detection.cpp11
-rw-r--r--engines/hdb/draw-manager.cpp5
-rw-r--r--engines/hdb/draw-manager.h1
-rw-r--r--engines/hdb/file-manager.cpp19
-rw-r--r--engines/hdb/file-manager.h7
-rw-r--r--engines/hdb/hdb.cpp39
-rw-r--r--engines/hdb/hdb.h1
7 files changed, 59 insertions, 24 deletions
diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp
index ed458475ee..b3a9d9cf8c 100644
--- a/engines/hdb/detection.cpp
+++ b/engines/hdb/detection.cpp
@@ -47,6 +47,15 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_DEMO,
GUIO1(GUIO_NONE)
},
+ {
+ "hdb",
+ "",
+ AD_ENTRY1s("hyperdemo.mpc", "f3bc878e179f00b8666a9846f3d9f9f5", 5236568),
+ Common::EN_ANY,
+ Common::kPlatformUnknown,
+ ADGF_DEMO,
+ GUIO1(GUIO_NONE)
+ },
AD_TABLE_END_MARKER
};
} // End of namespace HDB
@@ -85,4 +94,4 @@ bool HDBMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD
REGISTER_PLUGIN_DYNAMIC(HDB, PLUGIN_TYPE_ENGINE, HDBMetaEngine);
#else
REGISTER_PLUGIN_STATIC(HDB, PLUGIN_TYPE_ENGINE, HDBMetaEngine);
-#endif
+#endif \ No newline at end of file
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp
index 86586f58b8..03c9174924 100644
--- a/engines/hdb/draw-manager.cpp
+++ b/engines/hdb/draw-manager.cpp
@@ -31,6 +31,11 @@ DrawMan::DrawMan() {
bool DrawMan::init() {
_systemInit = true;
+ return true;
+}
+
+void DrawMan::loadTile32(char *name, uint32 *length) {
+
}
} \ No newline at end of file
diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h
index d85b7a86b7..c9b94c1c6f 100644
--- a/engines/hdb/draw-manager.h
+++ b/engines/hdb/draw-manager.h
@@ -48,6 +48,7 @@ public:
bool init();
// void saveToFile(const Common::String &filename);
// void loadFromFile(const Common::String &filename);
+ void loadTile32(char *name, uint32 *length);
bool cursorDisplay;
int cursorX, cursorY;
diff --git a/engines/hdb/file-manager.cpp b/engines/hdb/file-manager.cpp
index a6c12f32b5..13ea4584d8 100644
--- a/engines/hdb/file-manager.cpp
+++ b/engines/hdb/file-manager.cpp
@@ -31,9 +31,13 @@ bool FileMan::openMPC(const Common::String &filename) {
uint32 offset;
if (!_mpcFile->open(filename)) {
+ debug("The MPC file doesn't exist.");
error("FileMan::openMSD(): Error reading the MSD file");
return false;
}
+ else {
+ debug("The MPC file exists");
+ }
_mpcFile->read(&dataHeader.id, 4);
@@ -82,17 +86,20 @@ void FileMan::closeMPC() {
_mpcFile->close();
}
-MPCEntry **FileMan::findFirstData(char *string, DataType type) {
+MPCEntry *FileMan::findFirstData(const char *string, DataType type) {
Common::String fileString;
-
- for (MPCIterator it = _dir.begin(); it != _dir.end(); it++) {
+
+ debug("Hello");
+
+ int i = 0;
+ /*for (MPCIterator it = _dir.begin(); it != _dir.end(); it++) {
fileString = (*it)->filename;
if (fileString.contains(string)) {
if ((*it)->type == type) {
return it;
}
}
- }
+ }*/
return NULL;
}
@@ -109,7 +116,7 @@ MPCEntry **FileMan::findNextData(MPCIterator begin) {
}
return NULL;
}
-
+/*
int FileMan::findAmount(char *string, DataType type) {
int count = 0;
@@ -120,6 +127,6 @@ int FileMan::findAmount(char *string, DataType type) {
}
return count;
-}
+}*/
} // End of Namespace HDB
diff --git a/engines/hdb/file-manager.h b/engines/hdb/file-manager.h
index 38be6844fd..2a13f288cd 100644
--- a/engines/hdb/file-manager.h
+++ b/engines/hdb/file-manager.h
@@ -26,6 +26,8 @@
#include "common/array.h"
#include "common/file.h"
#include "common/error.h"
+#include "common/stream.h"
+#include "common/memstream.h"
#define MPCIterator Common::Array<MPCEntry *>::iterator
@@ -112,9 +114,10 @@ public:
void loadData(char *string, uint32 *length);
*/
- MPCEntry **findFirstData(char *string, DataType type);
+
+ MPCEntry *findFirstData(const char *string, DataType type);
MPCEntry **findNextData(MPCIterator it);
- int findAmount(char *string, DataType type);
+ //int findAmount(char *string, DataType type);
};
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 528eff88e1..310dd7c412 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -28,6 +28,8 @@
#include "common/file.h"
#include "common/error.h"
#include "graphics/surface.h"
+#include "common/stream.h"
+#include "common/memstream.h"
#include "hdb.h"
#include "console.h"
@@ -36,6 +38,7 @@ namespace HDB {
HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
_console = nullptr;
+ _systemInit = false;
DebugMan.addDebugChannel(kDebugExample1, "Example1", "This is just an example to test");
DebugMan.addDebugChannel(kDebugExample2, "Example2", "This is also an example");
@@ -53,9 +56,10 @@ bool HDBGame::init() {
Game Subsystem Initializations
*/
- // Init _fileMan
+ // Init fileMan
if (fileMan->openMPC("hyperdemo.mpc")) {
gameShutdown = false;
+ _systemInit = true;
return true;
}
@@ -92,22 +96,27 @@ void HDBGame::changeGameState() {
}
Common::Error HDBGame::run() {
- // Initializes Graphics
- Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0);
- initGraphics(640, 320, &format);
- _console = new Console();
- /*
- if (!_game->init()) {
- error("Couldn't initialize Game.");
- return Common::kUnknownError;
+ // Initialize System
+ if (!_systemInit) {
+ init();
}
- _game->start();
-
- _game->mainLoop();
- */
+ // Initializes Graphics
+ Graphics::PixelFormat format(4, 8, 8, 8, 8, 24, 16, 8, 0);
+ initGraphics(640, 480, &format);
+ _console = new Console();
+ MPCEntry *titleScreen = fileMan->findFirstData("monkeylogoscreen", DataType::TYPE_PIC);
+ debug("Hi");
+ //Common::MemoryReadStream *stream = new Common::MemoryReadStream((byte *)titleScreen, titleScreen->ulength);
+ //if (titleScreen == NULL) {
+ //debug("titleScreen: NULL");
+ //}
+ //else {
+ //debug("Works.");
+ //}
+
while (!shouldQuit()) {
Common::Event event;
@@ -125,10 +134,10 @@ Common::Error HDBGame::run() {
}
Graphics::Surface screen;
- screen.create(800, 600, g_system->getScreenFormat());
+ screen.create(640, 480, 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->copyRectToScreen(screen.getBasePtr(0, 0), screen.pitch, 0, 0, 640, 480);
g_system->updateScreen();
g_system->delayMillis(10);
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index eb94cd73b9..dc7a7af705 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -90,6 +90,7 @@ private:
// Game Variables
+ bool _systemInit;
GameState _gameState;
bool _voiceless;