Skip to content

Commit

Permalink
MORTEVIELLE: Some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke committed Oct 10, 2012
1 parent b504a56 commit b6fc1fe
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 47 deletions.
50 changes: 25 additions & 25 deletions engines/mortevielle/actions.cpp
Expand Up @@ -72,9 +72,9 @@ void MortevielleEngine::fctMove() {
_coreVar._currPlace = ROOM26;

if ((_num > 1) && (_num < 6))
_ment = _num - 1;
_roomDoorId = _num - 1;
else if (_num > 7)
_ment = _num - 3;
_roomDoorId = _num - 3;

if (_num != 6)
affrep();
Expand Down Expand Up @@ -207,10 +207,10 @@ void MortevielleEngine::fctTake() {
} else {
_tabdon[kAcha + ((_mchai - 1) * 10) + _cs - 1] = 0;
tsuiv();
++_dobj;
if (_dobj > 6) {
++_takeObjCount;
if (_takeObjCount > 6) {
_coreVar._faithScore += 2;
_dobj = 0;
_takeObjCount = 0;
}
}
}
Expand Down Expand Up @@ -583,7 +583,7 @@ void MortevielleEngine::fctOpen() {
ecr3(getEngineString(S_OPEN));

if (_caff == ROOM26) {
if (_ment != 0) {
if (_roomDoorId != OWN_ROOM) {
_msg[4] = OPCODE_ENTER;
_syn = true;
} else
Expand All @@ -604,7 +604,7 @@ void MortevielleEngine::fctOpen() {
if (_num != 0) {
if (_currBitIndex > 0)
_coreVar._faithScore += 2;
++_iouv;
++_openObjCount;
int tmpPlace = 0;
do {
++tmpPlace;
Expand Down Expand Up @@ -880,9 +880,9 @@ void MortevielleEngine::fctClose() {
aniof(2, _num);
_crep = 998;
_touv[cx] = chr(0);
--_iouv;
if (_iouv < 0)
_iouv = 0;
--_openObjCount;
if (_openObjCount < 0)
_openObjCount = 0;
int chai = 9999;
rechai(chai);
if (_mchai == chai)
Expand Down Expand Up @@ -924,8 +924,8 @@ void MortevielleEngine::fctKnock() {
if (_coreVar._currPlace == ROOM26) {
int rand = (getRandomNumber(0, 8)) - 4;
_speechManager.startSpeech(11, rand, 1);
int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
int l = _ment;
int p = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
int l = _roomDoorId;
if (l != OWN_ROOM) {
if (p != -500) {
if (rand > p)
Expand All @@ -938,7 +938,7 @@ void MortevielleEngine::fctKnock() {
getKnockAnswer();
}

if (_ment == GREEN_ROOM2)
if (_roomDoorId == GREEN_ROOM2)
_crep = 190;
}
}
Expand Down Expand Up @@ -1048,8 +1048,8 @@ void MortevielleEngine::fctListen() {
if (_currBitIndex != 0)
++_coreVar._faithScore;
int rand;
int p = getPresenceStats(rand, _coreVar._faithScore, _ment);
int l = _ment;
int p = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
int l = _roomDoorId;
if (l != OWN_ROOM) {
if (p != -500) {
if (rand > p)
Expand Down Expand Up @@ -1126,17 +1126,17 @@ void MortevielleEngine::fctEnter() {
_menu.setDestinationText(_coreVar._currPlace);
} else if (_coreVar._currPlace == LANDING)
showMoveMenuAlert();
else if (_ment == 0)
else if (_roomDoorId == OWN_ROOM)
_crep = 997;
else if ((_ment == 9) && (_coreVar._selectedObjectId != 136)) {
else if ((_roomDoorId == ROOM9) && (_coreVar._selectedObjectId != 136)) {
_crep = 189;
_coreVar._teauto[8] = '*';
} else {
int z = 0;
if (!_blo)
z = getPresence(_ment);
z = getPresence(_roomDoorId);
if (z != 0) {
if ((_ment == 3) || (_ment == 7))
if ((_roomDoorId == TOILETS) || (_roomDoorId == BATHROOM))
_crep = 179;
else {
_x = (getRandomNumber(0, 10)) - 5;
Expand All @@ -1149,26 +1149,26 @@ void MortevielleEngine::fctEnter() {
_msg[3] = MENU_DISCUSS;
_msg[4] = _menu._discussMenu[_x];
_syn = true;
if (_ment == 9) {
if (_roomDoorId == ROOM9) {
_col = true;
_caff = 70;
afdes();
repon(2, _caff);
} else
_col = false;
resetRoomVariables(_ment);
_ment = 0;
resetRoomVariables(_roomDoorId);
_roomDoorId = OWN_ROOM;
}
} else {
_x = (getRandomNumber(0, 10)) - 5;
_speechManager.startSpeech(7, _x, 1);
aniof(1, 1);

_coreVar._currPlace = _ment;
_coreVar._currPlace = _roomDoorId;
affrep();
resetRoomVariables(_coreVar._currPlace);
_menu.setDestinationText(_coreVar._currPlace);
_ment = 0;
_roomDoorId = OWN_ROOM;
_savedBitIndex = 0;
_currBitIndex = 0;
}
Expand Down Expand Up @@ -1460,7 +1460,7 @@ void MortevielleEngine::fctDiscuss() {
if (_col) {
_col = false;
_coreVar._currPlace = 15;
if (_iouv > 0)
if (_openObjCount > 0)
max = 8;
else
max = 4;
Expand Down
30 changes: 15 additions & 15 deletions engines/mortevielle/mortevielle.cpp
Expand Up @@ -111,7 +111,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
_newGraphicalDevice = -1;
_place = -1;

_c_zzz = -1;
_x26KeyCount = -1;
_caff = -1;
_day = 0;

Expand Down Expand Up @@ -207,7 +207,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
loadCFIPH();
loadCFIEC();
decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
_c_zzz = 1;
_x26KeyCount = 1;
init_nbrepm();
initMouse();

Expand Down Expand Up @@ -587,7 +587,7 @@ void MortevielleEngine::mainGame() {
if (_reloadCFIEC)
loadCFIEC();

for (_crep = 1; _crep <= _c_zzz; ++_crep)
for (_crep = 1; _crep <= _x26KeyCount; ++_crep)
decodeNumber(&_cfiecBuffer[161 * 16], ((822 * 128) - (161 * 16)) / 64);

loadBRUIT5();
Expand Down Expand Up @@ -1679,8 +1679,8 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
*/
void MortevielleEngine::loseGame() {
initouv();
_ment = 0;
_iouv = 0;
_roomDoorId = OWN_ROOM;
_openObjCount = 0;
_mchai = 0;
_menu.unsetSearchMenu();
if (!_blo)
Expand Down Expand Up @@ -1892,14 +1892,14 @@ void MortevielleEngine::gameLoaded() {
_endHour = 0;
_cs = 0;
_is = 0;
_ment = 0;
_roomDoorId = OWN_ROOM;
_syn = true;
_heroSearching = true;
_mchai = 0;
_manorDistance = 0;
initouv();
_iouv = 0;
_dobj = 0;
_openObjCount = 0;
_takeObjCount = 0;
affrep();
_hintPctMessage = getString(580);

Expand Down Expand Up @@ -3393,7 +3393,7 @@ void MortevielleEngine::affrep() {
* @remarks Originally called 'tsort'
*/
void MortevielleEngine::exitRoom() {
if ((_iouv > 0) && (_coreVar._currPlace != OWN_ROOM)) {
if ((_openObjCount > 0) && (_coreVar._currPlace != OWN_ROOM)) {
if (_coreVar._faithScore < 50)
_coreVar._faithScore += 2;
else
Expand All @@ -3402,8 +3402,8 @@ void MortevielleEngine::exitRoom() {

for (int cx = 1; cx <= 7; ++cx)
_touv[cx] = chr(0);
_ment = 0;
_iouv = 0;
_roomDoorId = OWN_ROOM;
_openObjCount = 0;
_mchai = 0;
resetRoomVariables(_coreVar._currPlace);
}
Expand Down Expand Up @@ -3523,7 +3523,7 @@ void MortevielleEngine::interactNPC() {
else
_speechManager.startSpeech(4, 4, 1);

if (_iouv == 0)
if (_openObjCount == 0)
_coreVar._faithScore += 2;
else if (_coreVar._faithScore < 50)
_coreVar._faithScore += 4;
Expand Down Expand Up @@ -3568,7 +3568,7 @@ void MortevielleEngine::tsuiv() {
tbcl = _tabdon[cl];
} while ((tbcl == 0) && (_cs <= 9));

if ((tbcl != 0) && (_cs < 11)) {
if ((tbcl != 0) && (_cs < 11)) { // 2nd check useless as _cs is <= 10
++_is;
_caff = tbcl;
_crep = _caff + 400;
Expand Down Expand Up @@ -3759,9 +3759,9 @@ int MortevielleEngine::testou() {
_soundOff = !_soundOff;
break;
case '\26' :
if ((_c_zzz == 1) || (_c_zzz == 2)) {
if ((_x26KeyCount == 1) || (_x26KeyCount == 2)) {
decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
++_c_zzz;
++_x26KeyCount;

return 61;
}
Expand Down
14 changes: 7 additions & 7 deletions engines/mortevielle/mortevielle.h
Expand Up @@ -157,7 +157,7 @@ static const int _actionMenu[12] = { OPCODE_NONE,
26 "A photograph$",
27 "The coat of arms$",
*/
enum places {
enum Places {
OWN_ROOM = 0, GREEN_ROOM = 1, PURPLE_ROOM = 2, TOILETS = 3, DARKBLUE_ROOM = 4,
BLUE_ROOM = 5, RED_ROOM = 6, BATHROOM = 7, GREEN_ROOM2 = 8, ROOM9 = 9,
DINING_ROOM = 10, BUREAU = 11, KITCHEN = 12, ATTIC = 13, CELLAR = 14,
Expand All @@ -173,7 +173,7 @@ struct nhom {
byte _hom[4];
};

struct t_pcga {
struct CgaPalette {
byte _p;
nhom _a[16];
};
Expand Down Expand Up @@ -260,12 +260,12 @@ class MortevielleEngine : public Engine {
int _startHour;
int _endHour;
Common::Point _stdPal[91][17];
t_pcga _cgaPal[91];
CgaPalette _cgaPal[91];

int _c_zzz;
int _ment;
int _iouv;
int _dobj;
int _x26KeyCount;
int _roomDoorId;
int _openObjCount;
int _takeObjCount;
int _num;
int _cs;
int _prebru;
Expand Down

0 comments on commit b6fc1fe

Please sign in to comment.