aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/files.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-03-17 20:27:42 -0400
committerPaul Gilbert2018-03-17 20:27:42 -0400
commit22456b345f4b39558cfc07ccd2e06ab6cfb98850 (patch)
treebb0e31433f624843f6addd563db48726be68dbaf /engines/xeen/files.cpp
parent562522e14414db68b77595de84d856c39e6cf00d (diff)
downloadscummvm-rg350-22456b345f4b39558cfc07ccd2e06ab6cfb98850.tar.gz
scummvm-rg350-22456b345f4b39558cfc07ccd2e06ab6cfb98850.tar.bz2
scummvm-rg350-22456b345f4b39558cfc07ccd2e06ab6cfb98850.zip
XEEN: Change bool _isDarkCc to int _ccNum
Originally the flag was whether the party was on the Dark Side, but as a bool I was having to cast it to an int side/cc number in more and more places. So now I've converted it to _ccNum, and it can be used directly as an int
Diffstat (limited to 'engines/xeen/files.cpp')
-rw-r--r--engines/xeen/files.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp
index 83a4ca9072..48c23d73c0 100644
--- a/engines/xeen/files.cpp
+++ b/engines/xeen/files.cpp
@@ -218,7 +218,7 @@ Common::SeekableReadStream *CCArchive::createReadStreamForMember(const Common::S
/*------------------------------------------------------------------------*/
FileManager::FileManager(XeenEngine *vm) {
- _isDarkCc = vm->getGameID() == GType_DarkSide;
+ _ccNum = vm->getGameID() == GType_DarkSide;
File::_xeenCc = File::_darkCc = File::_introCc = nullptr;
File::_xeenSave = File::_darkSave = nullptr;
File::_currentSave = nullptr;
@@ -277,7 +277,7 @@ void FileManager::setGameCc(int ccMode) {
}
File::setCurrentArchive(ccMode);
- _isDarkCc = ccMode != 0;
+ _ccNum = ccMode != 0;
}
void FileManager::load(Common::SeekableReadStream &stream) {
@@ -285,7 +285,7 @@ void FileManager::load(Common::SeekableReadStream &stream) {
}
void FileManager::save(Common::WriteStream &s) {
- s.writeByte(_isDarkCc ? 1 : 0);
+ s.writeByte(_ccNum ? 1 : 0);
}
/*------------------------------------------------------------------------*/
@@ -330,7 +330,7 @@ bool File::open(const Common::String &filename, Common::Archive &archive) {
bool File::open(const Common::String &filename, int ccMode) {
FileManager &files = *g_vm->_files;
- int oldMode = files._isDarkCc ? 1 : 0;
+ int oldNum = files._ccNum;
files.setGameCc(ccMode);
if (File::exists(filename, *_currentArchive))
@@ -338,7 +338,7 @@ bool File::open(const Common::String &filename, int ccMode) {
else
File::open(filename);
- files.setGameCc(oldMode);
+ files.setGameCc(oldNum);
return true;
}
@@ -390,11 +390,11 @@ bool File::exists(const Common::String &filename) {
bool File::exists(const Common::String &filename, int ccMode) {
FileManager &files = *g_vm->_files;
- int oldMode = files._isDarkCc ? 1 : 0;
+ int oldNum = files._ccNum;
files.setGameCc(ccMode);
bool result = exists(filename);
- files.setGameCc(oldMode);
+ files.setGameCc(oldNum);
return result;
}