aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/actions.cpp139
-rw-r--r--engines/mortevielle/dialogs.cpp4
-rw-r--r--engines/mortevielle/mortevielle.cpp4
-rw-r--r--engines/mortevielle/mortevielle.h12
-rw-r--r--engines/mortevielle/utils.cpp94
5 files changed, 137 insertions, 116 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 233f252c79..2a66100e17 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -340,7 +340,7 @@ void MortevielleEngine::fctLift() {
++_coreVar._faithScore;
_crep = 997;
if ((_coreVar._currPlace == PURPLE_ROOM) && (_coreVar._purpleRoomObjectId != 0))
- treg(_coreVar._purpleRoomObjectId);
+ displayLookScreen(_coreVar._purpleRoomObjectId);
}
return;
}
@@ -409,29 +409,29 @@ void MortevielleEngine::fctLook() {
if (_num == 1) {
_crep = 164;
if (_coreVar._atticRodHoleObjectId != 0)
- treg(_coreVar._atticRodHoleObjectId);
+ displayLookScreen(_coreVar._atticRodHoleObjectId);
else if (_coreVar._atticBallHoleObjectId != 0)
- treg(_coreVar._atticBallHoleObjectId);
+ displayLookScreen(_coreVar._atticBallHoleObjectId);
} else {
_crep = 193;
if (_coreVar._atticRodHoleObjectId != 0)
- treg(_coreVar._atticRodHoleObjectId);
+ displayLookScreen(_coreVar._atticRodHoleObjectId);
}
}
if (_coreVar._currPlace == CELLAR) {
_crep = 164;
if (_coreVar._cellarObjectId != 0)
- treg(_coreVar._cellarObjectId);
+ displayLookScreen(_coreVar._cellarObjectId);
}
if (_coreVar._currPlace == SECRET_PASSAGE) {
_crep = 174;
if (_coreVar._secretPassageObjectId != 0)
- treg(_coreVar._secretPassageObjectId);
+ displayLookScreen(_coreVar._secretPassageObjectId);
}
if (_coreVar._currPlace == WELL) {
_crep = 131;
if (_coreVar._wellObjectId != 0)
- treg(_coreVar._wellObjectId);
+ displayLookScreen(_coreVar._wellObjectId);
}
}
return;
@@ -451,15 +451,15 @@ void MortevielleEngine::fctLook() {
if (_crep == 255)
_crep = 131;
if ((_coreVar._currPlace == GREEN_ROOM) && (_num == 1))
- treg(144);
+ displayLookScreen(144);
if ((_coreVar._currPlace == BLUE_ROOM) && (_num == 3))
- treg(147);
+ displayLookScreen(147);
if ((_coreVar._currPlace == GREEN_ROOM2) && (_num == 3))
- treg(149);
+ displayLookScreen(149);
if ((_coreVar._currPlace == JULIA_ROOM) && (_num == 2))
- treg(30);
+ displayLookScreen(30);
if ((_coreVar._currPlace == DINING_ROOM) && (_num == 3))
- treg(31);
+ displayLookScreen(31);
}
/**
@@ -468,7 +468,7 @@ void MortevielleEngine::fctLook() {
*/
void MortevielleEngine::fctSelftLook() {
if (_coreVar._selectedObjectId != 0)
- treg(_coreVar._selectedObjectId);
+ displayLookScreen(_coreVar._selectedObjectId);
else
_crep = 186;
}
@@ -529,12 +529,12 @@ void MortevielleEngine::fctSearch() {
if (_coreVar._currPlace == PURPLE_ROOM) {
_crep = 123;
if (_coreVar._purpleRoomObjectId != 0)
- treg(_coreVar._purpleRoomObjectId);
+ displayLookScreen(_coreVar._purpleRoomObjectId);
}
if (_coreVar._currPlace == CRYPT) {
_crep = 123;
if (_coreVar._cryptObjectId != 0)
- treg(_coreVar._cryptObjectId);
+ displayLookScreen(_coreVar._cryptObjectId);
}
}
}
@@ -709,7 +709,7 @@ void MortevielleEngine::fctPlace() {
bool enterPassageFl = _dialogManager.showKnowledgeCheck();
_mouse.hideMouse();
- hirs();
+ clearScreen();
drawRightFrame();
clearDescriptionBar();
clearVerbBar();
@@ -933,14 +933,13 @@ void MortevielleEngine::fctKnock() {
if (_coreVar._currPlace == ROOM26) {
int rand = (getRandomNumber(0, 8)) - 4;
_soundManager.startSpeech(11, rand, 1);
- int p = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
- int l = _roomDoorId;
- if (l != OWN_ROOM) {
- if (p != -500) {
- if (rand > p)
+ int pres = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
+ if (_roomDoorId != OWN_ROOM) {
+ if (pres != -500) {
+ if (rand > pres)
_crep = 190;
else {
- setPresenceFlags(l);
+ setPresenceFlags(_roomDoorId);
getKnockAnswer();
}
} else
@@ -1054,18 +1053,17 @@ void MortevielleEngine::fctListen() {
if (_currBitIndex != 0)
++_coreVar._faithScore;
int rand;
- int p = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
- int l = _roomDoorId;
- if (l != OWN_ROOM) {
- if (p != -500) {
- if (rand > p)
+ int pres = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
+ if (_roomDoorId != OWN_ROOM) {
+ if (pres != -500) {
+ if (rand > pres)
_crep = 101;
else {
- setPresenceFlags(l);
- int j, h, m;
- updateHour(j, h, m);
+ setPresenceFlags(_roomDoorId);
+ int day, hour, minute;
+ updateHour(day, hour, minute);
rand = getRandomNumber(1, 100);
- if ((h >= 0) && (h < 8)) {
+ if ((hour >= 0) && (hour < 8)) {
if (rand > 30)
_crep = 101;
else
@@ -1095,25 +1093,25 @@ void MortevielleEngine::fctEat() {
resetRoomVariables(_coreVar._currPlace);
_menu.setDestinationText(_coreVar._currPlace);
- int j, h, m;
- updateHour(j, h, m);
- if ((h == 12) || (h == 13) || (h == 19)) {
+ int day, hour, minute;
+ updateHour(day, hour, minute);
+ if ((hour == 12) || (hour == 13) || (hour == 19)) {
_coreVar._faithScore -= (_coreVar._faithScore / 7);
- if (h == 12) {
- if (m == 0)
- h = 4;
+ if (hour == 12) {
+ if (minute == 0)
+ hour = 4;
else
- h = 3;
+ hour = 3;
}
- if ((h == 13) || (h == 19)) {
- if (m == 0)
- h = 2;
+ if ((hour == 13) || (hour == 19)) {
+ if (minute == 0)
+ hour = 2;
else
- h = 1;
+ hour = 1;
}
- _currentHourCount += h;
+ _currentHourCount += hour;
_crep = 135;
prepareRoom();
} else {
@@ -1138,10 +1136,10 @@ void MortevielleEngine::fctEnter() {
_crep = 189;
_coreVar._availableQuestion[8] = '*';
} else {
- int z = 0;
+ int pres = 0;
if (!_blo)
- z = getPresence(_roomDoorId);
- if (z != 0) {
+ pres = getPresence(_roomDoorId);
+ if (pres != 0) {
if ((_roomDoorId == TOILETS) || (_roomDoorId == BATHROOM))
_crep = 179;
else {
@@ -1150,7 +1148,7 @@ void MortevielleEngine::fctEnter() {
displayAnimFrame(1, 1);
_soundManager.waitSpeech();
- int charIndex = convertBitIndexToCharacterIndex(z);
+ int charIndex = convertBitIndexToCharacterIndex(pres);
++_coreVar._faithScore;
_coreVar._currPlace = LANDING;
_currMenu = MENU_DISCUSS;
@@ -1188,8 +1186,6 @@ void MortevielleEngine::fctEnter() {
* @remarks Originally called 'tdormir'
*/
void MortevielleEngine::fctSleep() {
- int j, h, m;
-
if ((_coreVar._currPlace > LANDING) && (_coreVar._currPlace < ROOM26)) {
_crep = 148;
return;
@@ -1205,23 +1201,24 @@ void MortevielleEngine::fctSleep() {
clearVerbBar();
clearDescriptionBar();
prepareScreenType2();
- ecr2(getEngineString(S_WANT_TO_WAKE_UP));
- updateHour(j, h, m);
+ displayTextBlock(getEngineString(S_WANT_TO_WAKE_UP));
+ int day, hour, minute;
+ updateHour(day, hour, minute);
int answer;
do {
- if (h < 8) {
+ if (hour < 8) {
_coreVar._faithScore -= (_coreVar._faithScore / 20);
- int z = (7 - h) * 2;
- if (m == 30)
+ int z = (7 - hour) * 2;
+ if (minute == 30)
--z;
_currentHourCount += z;
- h = 7;
+ hour = 7;
}
_currentHourCount += 2;
- ++h;
- if (h > 23)
- h = 0;
+ ++hour;
+ if (hour > 23)
+ hour = 0;
prepareRoom();
answer = _dialogManager.show(getEngineString(S_YES_NO), 1);
_anyone = false;
@@ -1364,12 +1361,12 @@ void MortevielleEngine::fctDiscuss() {
displId = _caff + 60;
}
testKey(false);
- mennor();
+ menuUp();
_mouse.hideMouse();
- hirs();
- premtet();
+ clearScreen();
+ drawDiscussionBox();
startDialog(displId);
- hirs();
+ clearScreen();
for (int ix = 1; ix <= 46; ++ix)
questionAsked[ix] = false;
for (int ix = 1; ix <= 45; ++ix) {
@@ -1496,8 +1493,8 @@ void MortevielleEngine::fctDiscuss() {
displId = 139;
}
_mouse.hideMouse();
- hirs();
- premtet();
+ clearScreen();
+ drawDiscussionBox();
startDialog(displId);
_mouse.showMouse();
if ((displId == 84) || (displId == 86)) {
@@ -1514,15 +1511,15 @@ void MortevielleEngine::fctDiscuss() {
_coreVar._availableQuestion[32] = '*';
}
_mouse.hideMouse();
- hirs();
+ clearScreen();
_mouse.showMouse();
}
} while ((choice != 46) && (displId != 138));
if (_col) {
_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
_mouse.hideMouse();
- hirs();
- premtet();
+ clearScreen();
+ drawDiscussionBox();
startDialog(138);
_mouse.showMouse();
_col = false;
@@ -1530,7 +1527,7 @@ void MortevielleEngine::fctDiscuss() {
}
_controlMenu = 0;
_mouse.hideMouse();
- hirs();
+ clearScreen();
drawRightFrame();
_mouse.showMouse();
showPeoplePresent(_currBitIndex);
@@ -1580,7 +1577,7 @@ void MortevielleEngine::fctScratch() {
*/
void MortevielleEngine::endGame() {
_quitGame = true;
- tlu(13, 152);
+ displayNarrativePicture(13, 152);
displayEmptyHand();
clearUpperLeftPart();
clearDescriptionBar();
@@ -1590,8 +1587,8 @@ void MortevielleEngine::endGame() {
_mouse.hideMouse();
_caff = 70;
_text.taffich();
- hirs();
- premtet();
+ clearScreen();
+ drawDiscussionBox();
startDialog(141);
_mouse.showMouse();
clearUpperLeftPart();
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 264839c158..abaf38c59b 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -300,7 +300,7 @@ bool DialogManager::showKnowledgeCheck() {
for (int indx = 0; indx < 10; ++indx) {
_vm->_mouse.hideMouse();
- _vm->hirs();
+ _vm->clearScreen();
_vm->_mouse.showMouse();
int dialogHeight;
if (_vm->_resolutionScaler == 1)
@@ -434,7 +434,7 @@ void DialogManager::checkForF8(int SpeechNum, bool drawFrame2Fl) {
if (_vm->_newGraphicalDevice != _vm->_currGraphicalDevice) {
_vm->_currGraphicalDevice = _vm->_newGraphicalDevice;
- _vm->hirs();
+ _vm->clearScreen();
displayIntroScreen(drawFrame2Fl);
}
} while (_vm->_key != 66); // keycode for F8
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index d657bda7ab..7b2a648221 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -223,7 +223,7 @@ Common::ErrorCode MortevielleEngine::initialize() {
testKeyboard();
if (_newGraphicalDevice != _currGraphicalDevice)
_currGraphicalDevice = _newGraphicalDevice;
- hirs();
+ clearScreen();
_soundManager.loadNoise();
_soundManager.loadAmbiantSounds();
@@ -404,7 +404,7 @@ void MortevielleEngine::mainGame() {
charToHour();
initGame();
- hirs();
+ clearScreen();
drawRightFrame();
_mouse.showMouse();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 820046b17c..27a3d5697a 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -386,6 +386,7 @@ private:
void displayQuestionText(Common::String s, int cmd);
void displayTextInDescriptionBar(int x, int y, int nb, int mesgId);
void displayTextInVerbBar(Common::String text);
+ void displayTextBlock(Common::String text);
void mapMessageId(int &mesgId);
void resetOpenObjects();
void setCoordinates(int sx);
@@ -399,13 +400,12 @@ private:
void prepareNextObject();
void putObject();
void resetObjectPlace();
+ void drawDiscussionBox();
+ void displayNarrativePicture(int af, int ob);
+ void menuUp();
+ void displayLookScreen(int objId);
void adzon();
- void premtet();
- void ecr2(Common::String text);
- void tlu(int af, int ob);
- void mennor();
- void treg(int objId);
public:
Common::Point _prevPos;
@@ -492,7 +492,7 @@ public:
void handleDescriptionText(int f, int mesgId);
int getAnimOffset(int frameNum, int animNum);
- void hirs();
+ void clearScreen();
};
extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index eac4546fff..fff53dbc30 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -335,7 +335,7 @@ void MortevielleEngine::handleAction() {
_crep = 998;
} else
prepareNextObject();
- mennor();
+ menuUp();
}
}
}
@@ -1348,7 +1348,7 @@ void MortevielleEngine::startDialog(int16 rep) {
if (shouldQuit())
return;
} while (key != 66);
- hirs();
+ clearScreen();
_mouse.showMouse();
}
@@ -1385,10 +1385,10 @@ void MortevielleEngine::gotoDiningRoom() {
_screenSurface.drawBox(223, 47, 155, 92, 15);
handleDescriptionText(2, 33);
testKey(false);
- mennor();
+ menuUp();
_mouse.hideMouse();
- hirs();
- premtet();
+ clearScreen();
+ drawDiscussionBox();
startDialog(140);
drawRightFrame();
drawClock();
@@ -1456,7 +1456,7 @@ void MortevielleEngine::floodedInWell() {
void MortevielleEngine::changeGraphicalDevice(int newDevice) {
_mouse.hideMouse();
_currGraphicalDevice = newDevice;
- hirs();
+ clearScreen();
_mouse.initMouse();
_mouse.showMouse();
drawRightFrame();
@@ -1538,7 +1538,7 @@ void MortevielleEngine::handleOpcode() {
if (_uptodatePresence) {
if ((_currMenu == MENU_MOVE) || (_currAction == OPCODE_LEAVE) || (_currAction == OPCODE_SLEEP) || (_currAction == OPCODE_EAT)) {
_controlMenu = 4;
- mennor();
+ menuUp();
return;
}
}
@@ -1606,7 +1606,7 @@ void MortevielleEngine::handleOpcode() {
if (_anyone) {
interactNPC();
_anyone = false;
- mennor();
+ menuUp();
return;
}
}
@@ -1630,7 +1630,7 @@ void MortevielleEngine::handleOpcode() {
loseGame();
}
}
- mennor();
+ menuUp();
}
/**
@@ -2211,14 +2211,14 @@ void MortevielleEngine::music() {
* @remarks Originally called 'suite'
*/
void MortevielleEngine::showTitleScreen() {
- hirs();
+ clearScreen();
handleDescriptionText(7, 2035);
_caff = 51;
_text.taffich();
testKeyboard();
if (_newGraphicalDevice != _currGraphicalDevice)
_currGraphicalDevice = _newGraphicalDevice;
- hirs();
+ clearScreen();
draw(0, 0);
Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
@@ -2481,7 +2481,11 @@ Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t
return result;
}
-void MortevielleEngine::hirs() {
+/**
+ * Clear Screen
+ * @remarks Originally called 'hirs'
+ */
+void MortevielleEngine::clearScreen() {
// Note: The original used this to set the graphics mode and clear the screen, both at
// the start of the game, and whenever the screen need to be cleared. As such, this
// method is deprecated in favour of clearing the screen
@@ -2710,7 +2714,11 @@ void MortevielleEngine::resetOpenObjects() {
_openObjCount = 0;
}
-void MortevielleEngine::ecr2(Common::String text) {
+/**
+ * Display Text Block
+ * @remarks Originally called 'ecr2'
+ */
+void MortevielleEngine::displayTextBlock(Common::String text) {
// Some dead code was present in the original: removed
_screenSurface.putxy(8, 177);
int tlig = 59 + (_resolutionScaler - 1) * 36;
@@ -2878,11 +2886,11 @@ int MortevielleEngine::getPresence(int roomId) {
int retVal = 0;
int rand;
- int p = getPresenceStats(rand, _coreVar._faithScore, roomId);
+ int pres = getPresenceStats(rand, _coreVar._faithScore, roomId);
_place = roomId;
if ((roomId > OWN_ROOM) && (roomId < DINING_ROOM)) {
- if (p != -500) {
- if (rand > p) {
+ if (pres != -500) {
+ if (rand > pres) {
displayAloneText();
retVal = 0;
} else {
@@ -2899,34 +2907,34 @@ int MortevielleEngine::getPresence(int roomId) {
else {
int h = 0;
if (roomId == DINING_ROOM)
- p = getPresenceStatsDiningRoom(h);
+ pres = getPresenceStatsDiningRoom(h);
else if (roomId == BUREAU)
- p = getPresenceStatsBureau(h);
+ pres = getPresenceStatsBureau(h);
else if (roomId == KITCHEN)
- p = getPresenceStatsKitchen();
+ pres = getPresenceStatsKitchen();
else if ((roomId == ATTIC) || (roomId == CELLAR))
- p = getPresenceStatsAttic();
+ pres = getPresenceStatsAttic();
else if ((roomId == LANDING) || (roomId == ROOM26))
- p = getPresenceStatsLanding();
+ pres = getPresenceStatsLanding();
else if (roomId == CHAPEL)
- p = getPresenceStatsChapel(h);
- p += _coreVar._faithScore;
+ pres = getPresenceStatsChapel(h);
+ pres += _coreVar._faithScore;
rand = getRandomNumber(1, 100);
- if (rand > p) {
+ if (rand > pres) {
displayAloneText();
retVal = 0;
} else {
if (roomId == DINING_ROOM)
- p = setPresenceDiningRoom(h);
+ pres = setPresenceDiningRoom(h);
else if (roomId == BUREAU)
- p = setPresenceBureau(h);
+ pres = setPresenceBureau(h);
else if ((roomId == KITCHEN) || (roomId == ATTIC) || (roomId == CELLAR))
- p = setPresenceKitchen();
+ pres = setPresenceKitchen();
else if ((roomId == LANDING) || (roomId == ROOM26))
- p = setPresenceLanding();
+ pres = setPresenceLanding();
else if (roomId == CHAPEL)
- p = setPresenceChapel(h);
- retVal = p;
+ pres = setPresenceChapel(h);
+ retVal = pres;
}
}
}
@@ -3053,7 +3061,11 @@ void MortevielleEngine::testKey(bool d) {
_mouse.showMouse();
}
-void MortevielleEngine::tlu(int af, int ob) {
+/**
+ * Display Narrative Picture
+ * @remarks Originally called 'tlu'
+ */
+void MortevielleEngine::displayNarrativePicture(int af, int ob) {
_caff = 32;
drawPictureWithText();
handleDescriptionText(6, ob + 4000);
@@ -3119,7 +3131,7 @@ void MortevielleEngine::getReadDescription(int objId) {
case 157:
case 160:
case 161 :
- tlu(_caff, objId);
+ displayNarrativePicture(_caff, objId);
break;
default:
break;
@@ -3152,11 +3164,19 @@ void MortevielleEngine::getSearchDescription(int objId) {
}
}
-void MortevielleEngine::mennor() {
+/**
+ * Menu up
+ * @remarks Originally called 'mennor'
+ */
+void MortevielleEngine::menuUp() {
_menu.menuUp(_currMenu);
}
-void MortevielleEngine::premtet() {
+/**
+ * Draw discussion box
+ * @remarks Originally called 'premtet'
+ */
+void MortevielleEngine::drawDiscussionBox() {
draw(10, 80);
_screenSurface.drawBox(18, 79, 155, 92, 15);
}
@@ -3372,7 +3392,11 @@ void MortevielleEngine::setCoordinates(int sx) {
_crep = 997;
}
-void MortevielleEngine::treg(int objId) {
+/**
+ * Display LOOK Screen
+ * @remarks Originally called 'treg'
+ */
+void MortevielleEngine::displayLookScreen(int objId) {
int mdes = _caff;
_caff = objId;