aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-06-07 18:21:18 +0530
committerEugene Sandulenko2019-09-03 17:16:44 +0200
commit19eefe2ceadca9cf0e51a87d5a8e419e0acdc52f (patch)
tree74aacec582e6c814a01ef8db49dad534f981c87d /engines/hdb
parent0e58f9c9d1d21348f9fa5b68c5038bebf03e54c6 (diff)
downloadscummvm-rg350-19eefe2ceadca9cf0e51a87d5a8e419e0acdc52f.tar.gz
scummvm-rg350-19eefe2ceadca9cf0e51a87d5a8e419e0acdc52f.tar.bz2
scummvm-rg350-19eefe2ceadca9cf0e51a87d5a8e419e0acdc52f.zip
HDB: Fix variables according to Naming Conventions
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/file-manager.cpp12
-rw-r--r--engines/hdb/file-manager.h4
-rw-r--r--engines/hdb/hdb.cpp24
-rw-r--r--engines/hdb/hdb.h4
-rw-r--r--engines/hdb/lua-script.cpp4
-rw-r--r--engines/hdb/map-loader.cpp2
-rw-r--r--engines/hdb/map-loader.h6
7 files changed, 27 insertions, 29 deletions
diff --git a/engines/hdb/file-manager.cpp b/engines/hdb/file-manager.cpp
index 603c11b970..b3945b3456 100644
--- a/engines/hdb/file-manager.cpp
+++ b/engines/hdb/file-manager.cpp
@@ -39,14 +39,14 @@ bool FileMan::openMPC(const Common::String &filename) {
return false;
}
- dataHeader.id = _mpcFile->readUint32BE();
+ _dataHeader.id = _mpcFile->readUint32BE();
- if (dataHeader.id == MKTAG('M', 'P', 'C', 'C')) {
+ if (_dataHeader.id == MKTAG('M', 'P', 'C', 'C')) {
_compressed = true;
debug("COMPRESSED FILE");
return false;
}
- else if (dataHeader.id == MKTAG('M', 'P', 'C', 'U')) {
+ else if (_dataHeader.id == MKTAG('M', 'P', 'C', 'U')) {
_compressed = false;
offset = _mpcFile->readUint32LE();
@@ -55,11 +55,11 @@ bool FileMan::openMPC(const Common::String &filename) {
// Note: The MPC archive format assumes the offset to be uint32,
// but Common::File::seek() takes the offset as int32.
- dataHeader.dirSize = _mpcFile->readUint32LE();
+ _dataHeader.dirSize = _mpcFile->readUint32LE();
- debug(8, "MPC: Read %d entries", dataHeader.dirSize);
+ debug(8, "MPC: Read %d entries", _dataHeader.dirSize);
- for (uint32 fileIndex = 0; fileIndex < dataHeader.dirSize; fileIndex++) {
+ for (uint32 fileIndex = 0; fileIndex < _dataHeader.dirSize; fileIndex++) {
MPCEntry *dirEntry = new MPCEntry();
for (int i = 0; i < 64; i++) {
diff --git a/engines/hdb/file-manager.h b/engines/hdb/file-manager.h
index db04ce4e1b..492f97ed75 100644
--- a/engines/hdb/file-manager.h
+++ b/engines/hdb/file-manager.h
@@ -68,9 +68,7 @@ public:
struct {
uint32 id;
uint32 dirSize;
- } dataHeader;
-
- uint32 readOffset;
+ } _dataHeader;
bool openMPC(const Common::String &filename);
void closeMPC();
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index c65b5606d7..edf875a192 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -42,8 +42,8 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst
_console = nullptr;
_systemInit = false;
g_hdb = this;
- fileMan = new FileMan;
- lua = new LuaScript;
+ _fileMan = new FileMan;
+ _lua = new LuaScript;
//mapLoader = new MapLoader;
DebugMan.addDebugChannel(kDebugExample1, "Example1", "This is just an example to test");
@@ -52,8 +52,8 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst
HDBGame::~HDBGame() {
delete _console;
- delete fileMan;
- delete lua;
+ delete _fileMan;
+ delete _lua;
//delete mapLoader;
DebugMan.clearAllDebugChannels();
}
@@ -65,11 +65,11 @@ bool HDBGame::init() {
// Init fileMan
- if (!fileMan->openMPC(getGameFile())) {
+ if (!_fileMan->openMPC(getGameFile())) {
error("FileMan::openMPC: Cannot find the hyperspace.mpc data file.");
return false;
}
- if (!lua->init()) {
+ if (!_lua->init()) {
error("LuaScript::init: Couldn't load the GLOBAL_LUA code.");
return false;
}
@@ -123,7 +123,7 @@ Common::Error HDBGame::run() {
_console = new Console();
- Common::SeekableReadStream *titleStream = fileMan->findFirstData("monkeylogoscreen", TYPE_PIC);
+ Common::SeekableReadStream *titleStream = _fileMan->findFirstData("monkeylogoscreen", TYPE_PIC);
if (titleStream == NULL) {
debug("The TitleScreen MPC entry can't be found.");
return Common::kReadingFailed;
@@ -132,7 +132,7 @@ Common::Error HDBGame::run() {
Picture *titlePic = new Picture;
Graphics::Surface surf = titlePic->load(titleStream);
- Common::SeekableReadStream *tileStream = fileMan->findFirstData("t32_ground1", TYPE_TILE32);
+ Common::SeekableReadStream *tileStream = _fileMan->findFirstData("t32_ground1", TYPE_TILE32);
if (tileStream == NULL) {
debug("The t32_shipwindow_lr MPC entry can't be found.");
return Common::kReadingFailed;
@@ -141,16 +141,16 @@ Common::Error HDBGame::run() {
Tile *tile = new Tile;
Graphics::Surface surf2 = tile->load(tileStream);
- Common::SeekableReadStream *luaStream = fileMan->findFirstData("MAP00_DEMO_LUA", TYPE_BINARY);
- int32 luaLength = fileMan->getLength("MAP00_DEMO_LUA", TYPE_BINARY);
+ Common::SeekableReadStream *luaStream = _fileMan->findFirstData("MAP00_DEMO_LUA", TYPE_BINARY);
+ int32 luaLength = _fileMan->getLength("MAP00_DEMO_LUA", TYPE_BINARY);
if (luaStream == NULL) {
debug("The MAP00_DEMO_LUA MPC entry can't be found.");
return Common::kReadingFailed;
}
- lua->initScript(luaStream, "MAP00_DEMO_LUA", luaLength);
+ _lua->initScript(luaStream, "MAP00_DEMO_LUA", luaLength);
- Common::SeekableReadStream *mapStream = fileMan->findFirstData("MAP00_DEMO_MSM", TYPE_BINARY);
+ Common::SeekableReadStream *mapStream = _fileMan->findFirstData("MAP00_DEMO_MSM", TYPE_BINARY);
if (mapStream == NULL) {
debug("The MAP00_DEMO_MSM MPC entry can't be found.");
return Common::kReadingFailed;
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index a07e77ec0c..19f7156480 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -82,8 +82,8 @@ public:
Game System Pointers
*/
- FileMan *fileMan;
- LuaScript *lua;
+ FileMan *_fileMan;
+ LuaScript *_lua;
// Game related members;
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp
index ec0848ce63..d8c39a7fe8 100644
--- a/engines/hdb/lua-script.cpp
+++ b/engines/hdb/lua-script.cpp
@@ -54,8 +54,8 @@ LuaScript::~LuaScript() {
bool LuaScript::init() {
// Load Global Lua Code
- _globalLuaStream = g_hdb->fileMan->findFirstData("GLOBAL_LUA", TYPE_BINARY);
- _globalLuaLength = g_hdb->fileMan->getLength("GLOBAL_LUA", TYPE_BINARY);
+ _globalLuaStream = g_hdb->_fileMan->findFirstData("GLOBAL_LUA", TYPE_BINARY);
+ _globalLuaLength = g_hdb->_fileMan->getLength("GLOBAL_LUA", TYPE_BINARY);
if (_globalLuaStream == NULL || _globalLuaLength == 0) {
error("LuaScript::initScript: 'global code' failed to load");
return false;
diff --git a/engines/hdb/map-loader.cpp b/engines/hdb/map-loader.cpp
index c2828dc5a2..984062fa59 100644
--- a/engines/hdb/map-loader.cpp
+++ b/engines/hdb/map-loader.cpp
@@ -88,7 +88,7 @@ bool Map::load(Common::SeekableReadStream *stream) {
_mapLaserBeams = new char[_width * _height];
- mapX = mapY = 0;
+ _mapX = _mapY = 0;
_mapLoaded = true;
diff --git a/engines/hdb/map-loader.h b/engines/hdb/map-loader.h
index 741241061b..5ac3dae7f8 100644
--- a/engines/hdb/map-loader.h
+++ b/engines/hdb/map-loader.h
@@ -53,9 +53,9 @@ public:
bool load(Common::SeekableReadStream *stream);
int loadTiles();
- int mapX, mapY; // Coordinates of Map
- int mapTileX, mapTileY; // Tile Coordinates of Map
- int mapTileXOff, mapTileYOff; // Tile Coordinates Offset (0-31)
+ int _mapX, _mapY; // Coordinates of Map
+ int _mapTileX, _mapTileY; // Tile Coordinates of Map
+ int _mapTileXOff, _mapTileYOff; // Tile Coordinates Offset (0-31)
private:
char _name[32];