aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2014-06-03 07:42:17 +0200
committerStrangerke2014-06-03 07:42:17 +0200
commit7ef509608e957cb62cda7265e173f1a30a69b659 (patch)
treebf68685a334e8fa7aa67ff8f9cc4033fb71115c9 /engines
parent46d93eb780621392b563995c5c72ffb398e6206e (diff)
downloadscummvm-rg350-7ef509608e957cb62cda7265e173f1a30a69b659.tar.gz
scummvm-rg350-7ef509608e957cb62cda7265e173f1a30a69b659.tar.bz2
scummvm-rg350-7ef509608e957cb62cda7265e173f1a30a69b659.zip
CGE2: USe an int for sex instead of a boolean
Diffstat (limited to 'engines')
-rw-r--r--engines/cge2/cge2.cpp2
-rw-r--r--engines/cge2/cge2.h4
-rw-r--r--engines/cge2/cge2_main.cpp14
3 files changed, 10 insertions, 10 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
index f616a6064d..4bac09a1a0 100644
--- a/engines/cge2/cge2.cpp
+++ b/engines/cge2/cge2.cpp
@@ -77,7 +77,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
_music = true;
_startupMode = 1;
_now = 1;
- _sex = true;
+ _sex = 1;
_mouseTop = kWorldHeight / 3;
_dark = false;
_lastFrame = 0;
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h
index 69f8b758ae..2c34b0a1c3 100644
--- a/engines/cge2/cge2.h
+++ b/engines/cge2/cge2.h
@@ -140,7 +140,7 @@ public:
void qGame();
void loadPos();
void releasePocket(Sprite *spr);
- void switchHero(bool sex);
+ void switchHero(int sex);
void optionTouch(int opt, uint16 mask);
void offUse();
@@ -205,7 +205,7 @@ public:
bool _music;
int _startupMode;
int _now;
- bool _sex;
+ int _sex;
int _mouseTop;
bool _dark;
int _waitSeq;
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp
index 64f39a37ea..e379977d6c 100644
--- a/engines/cge2/cge2_main.cpp
+++ b/engines/cge2/cge2_main.cpp
@@ -573,7 +573,7 @@ void CGE2Engine::loadGame() {
Sprite *s;
Hero *h;
- // initialize Andzia
+ // initialize Andzia/Anna
s = _spare->take(142);
if (s) {
h = new Hero(this);
@@ -587,7 +587,7 @@ void CGE2Engine::loadGame() {
_vga->_showQ->insert(s);
_heroTab[0]->_face = s;
- // initialize Wacek
+ // initialize Wacek/Vincent
s = _spare->take(141);
if (s) {
h = new Hero(this);
@@ -795,7 +795,7 @@ void CGE2Engine::killText() {
_talk = NULL;
}
-void CGE2Engine::switchHero(bool sex) {
+void CGE2Engine::switchHero(int sex) {
if (sex != _sex) {
int scene = _heroTab[sex]->_ptr->_scene;
if (_blinkSprite) {
@@ -804,7 +804,7 @@ void CGE2Engine::switchHero(bool sex) {
}
if (scene >= 0) {
_commandHandler->addCommand(kCmdSeq, -1, 2, _heroTab[_sex]->_face);
- _sex = !_sex;
+ _sex ^= 1;
switchCave(scene);
}
}
@@ -843,10 +843,10 @@ void Sprite::touch(uint16 mask, int x, int y, Common::KeyCode keyCode) {
}
if (_vm->isHero(this) && !_vm->_blinkSprite) {
- _vm->switchHero(this == _vm->_heroTab[1]->_ptr);
+ _vm->switchHero((this == _vm->_heroTab[1]->_ptr) ? 1 : 0);
} else if (_flags._kept) { // sprite in pocket
- for (int sex = 0; sex < 2; sex++) {
- for (int p = 0; p < kPocketMax; p++) {
+ for (int sex = 0; sex < 2; ++sex) {
+ for (int p = 0; p < kPocketMax; ++p) {
if (_vm->_heroTab[sex]->_pocket[p] == this) {
_vm->switchHero(sex);
if (_vm->_sex == sex) {