From 9ab8716137e1eba9ac90b5bc4cc4e677362935ec Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Fri, 7 Jun 2019 19:46:16 +0530 Subject: HDB: Add DrawMan::init to count number of tiles --- engines/hdb/draw-manager.cpp | 12 +++++++----- engines/hdb/draw-manager.h | 20 +------------------- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 1ab2868d9a..85ee4ec9aa 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -26,18 +26,20 @@ namespace HDB { DrawMan::DrawMan() { _systemInit = false; - cursorDisplay = true; } bool DrawMan::init() { + + _numTiles = g_hdb->_fileMan->getCount("t32_", TYPE_TILE32); + + if (!_numTiles) { + return false; + } + _systemInit = true; return true; } -void DrawMan::loadTile32(char *name, uint32 *length) { - -} - Picture::~Picture() { _surface.free(); } diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index 8dcca5ee72..f0895d175e 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -23,8 +23,6 @@ #ifndef HDB_DRAW_MANAGER_H #define HDB_DRAW_MANAGER_H -#include "common/array.h" -#include "common/file.h" #include "graphics/surface.h" #include "hdb/hdb.h" @@ -35,27 +33,11 @@ class DrawMan { public: DrawMan(); - /* - struct Tile { - MPCEntry *mpcData; - Tile32Type *tileData; - uint32 flags; - uint16 loaded; - uint16 skyIndex; - uint16 animIndex; - };*/ 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; -// Common::Array tileArray; private: - + int _numTiles; bool _systemInit; }; -- cgit v1.2.3