aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-03-26 01:32:21 +0530
committerEugene Sandulenko2019-09-03 17:16:41 +0200
commit9899cbc900368d45313db2a60e626ea39a05cc8b (patch)
tree652f27dc36ee6673ee06b0f7b0a74765490ec1ef /engines/hdb
parent374958f442e6dc473b778448d9a20e7a75e8c654 (diff)
downloadscummvm-rg350-9899cbc900368d45313db2a60e626ea39a05cc8b.tar.gz
scummvm-rg350-9899cbc900368d45313db2a60e626ea39a05cc8b.tar.bz2
scummvm-rg350-9899cbc900368d45313db2a60e626ea39a05cc8b.zip
HDB: Update HDB to the Code Formatting Conventions
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/configure.engine2
-rw-r--r--engines/hdb/detection.cpp2
-rw-r--r--engines/hdb/hdb.cpp35
-rw-r--r--engines/hdb/hdb.h8
-rw-r--r--engines/hdb/module.mk2
5 files changed, 22 insertions, 27 deletions
diff --git a/engines/hdb/configure.engine b/engines/hdb/configure.engine
index 6e8649012f..b5565e9290 100644
--- a/engines/hdb/configure.engine
+++ b/engines/hdb/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine hdb "Hyperspace Delivery Boy!" yes \ No newline at end of file
+add_engine hdb "Hyperspace Delivery Boy!" yes
diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp
index aae4ad9b5b..ed458475ee 100644
--- a/engines/hdb/detection.cpp
+++ b/engines/hdb/detection.cpp
@@ -85,4 +85,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 \ No newline at end of file
+#endif
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index b254d05e4f..c8d06a82b7 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -75,33 +75,28 @@ Common::Error HDBGame::run() {
}
void HDBGame::readMPC(const Common::String &filename) {
- if (!file.open(filename)) {
+ if (!_file.open(filename)) {
error("readMPC(): Error reading MPC file");
} else {
- dataHeader.signature[0] = file.readByte();
- dataHeader.signature[1] = file.readByte();
- dataHeader.signature[2] = file.readByte();
- dataHeader.signature[3] = file.readByte();
- dataHeader.signature[4] = '\0';
+ _dataHeader.signature[0] = _file.readByte();
+ _dataHeader.signature[1] = _file.readByte();
+ _dataHeader.signature[2] = _file.readByte();
+ _dataHeader.signature[3] = _file.readByte();
+ _dataHeader.signature[4] = '\0';
- if (dataHeader.isValid()) {
+ if (_dataHeader.isValid()) {
debug("Valid MPC file");
- dataHeader.dirOffset = file.readUint32LE();
+ _dataHeader.dirOffset = _file.readUint32LE();
- /* FIXME: Temporary Hack
-
- The MPC archive format uses uint32 to store the dirOffset,
- however, the File::seekg() function takes an int32 as the offset.
- This does not cause a problem yet because the offset is
- within the range of 2^31. Extending this functionality to another
- game file with a larger offset may cause problems.
- */
+ // FIXME: The MPC archive format considers dirOffset to be a uint32.
+ // However, File::seekg() takes an int32 as the offset, hence this
+ // would break if the dirOffset was larger than 2^31.
- file.seek((int32)dataHeader.dirOffset, SEEK_SET);
+ _file.seek((int32)_dataHeader.dirOffset, SEEK_SET);
- dataHeader.dirSize = file.readUint32LE();
+ _dataHeader.dirSize = _file.readUint32LE();
- for (uint32 fileIndex = 0; fileIndex < dataHeader.dirSize; fileIndex++) {
+ for (uint32 fileIndex = 0; fileIndex < _dataHeader.dirSize; fileIndex++) {
DataFile* dirEntry = new DataFile();
for (int fileNameIndex = 0; fileNameIndex < 64; fileNameIndex++) {
@@ -123,4 +118,4 @@ void HDBGame::readMPC(const Common::String &filename) {
}
}
-} // End of namespace HDB \ No newline at end of file
+} // End of namespace HDB
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index d03e61a513..72b13b0d05 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -58,7 +58,7 @@ public:
private:
Console *_console;
- Common::File file;
+ Common::File _file;
struct {
byte signature[5]; // 4 Bytes + '\0'
@@ -73,7 +73,7 @@ private:
(signature[4] == '\0');
}
- } dataHeader;
+ } _dataHeader;
struct DataFile {
byte fileName[65]; // 65 Bytes + '\0'
@@ -83,11 +83,11 @@ private:
uint32 unknownField2;
};
- Common::Array<DataFile*> gameData;
+ Common::Array<DataFile*> _gameData;
void readMPC(const Common::String &fileName);
};
}// End of namespace HDB
-#endif \ No newline at end of file
+#endif
diff --git a/engines/hdb/module.mk b/engines/hdb/module.mk
index 1136660aa1..1f8555f01e 100644
--- a/engines/hdb/module.mk
+++ b/engines/hdb/module.mk
@@ -14,4 +14,4 @@ PLUGIN := 1
endif
# Include common rules
-include $(srcdir)/rules.mk \ No newline at end of file
+include $(srcdir)/rules.mk