aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2012-03-14 23:29:42 +0100
committerStrangerke2012-04-06 08:23:23 +0200
commit01e899b965721a21704746948ed2541a950f31df (patch)
tree434af1102aaef280a667a636cb5c8aa1e52d48ba /engines
parent09195469171fe713964af8478c1cc4e5e28dc7cb (diff)
downloadscummvm-rg350-01e899b965721a21704746948ed2541a950f31df.tar.gz
scummvm-rg350-01e899b965721a21704746948ed2541a950f31df.tar.bz2
scummvm-rg350-01e899b965721a21704746948ed2541a950f31df.zip
MORTEVIELLE: Remove some useless g_vm uses, some more renaming
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/mor.cpp45
-rw-r--r--engines/mortevielle/mor.h3
-rw-r--r--engines/mortevielle/mortevielle.h2
-rw-r--r--engines/mortevielle/saveload.cpp10
4 files changed, 31 insertions, 29 deletions
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index a3a0ef7e96..8b27833211 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -1106,14 +1106,14 @@ int MortevielleEngine::setPresenceLanding() {
int rand = 0;
do {
rand = getRandomNumber(1, 8);
- test = (((rand == 1) && (g_vm->_purpleRoomPresenceLeo || g_vm->_room9PresenceLeo)) ||
- ((rand == 2) && g_vm->_roomPresencePat) ||
- ((rand == 3) && g_vm->_roomPresenceGuy) ||
- ((rand == 4) && g_vm->_roomPresenceEva) ||
- ((rand == 5) && g_vm->_roomPresenceBob) ||
- ((rand == 6) && g_vm->_roomPresenceLuc) ||
- ((rand == 7) && g_vm->_roomPresenceIda) ||
- ((rand == 8) && g_vm->_roomPresenceMax));
+ test = (((rand == 1) && (_purpleRoomPresenceLeo || _room9PresenceLeo)) ||
+ ((rand == 2) && _roomPresencePat) ||
+ ((rand == 3) && _roomPresenceGuy) ||
+ ((rand == 4) && _roomPresenceEva) ||
+ ((rand == 5) && _roomPresenceBob) ||
+ ((rand == 6) && _roomPresenceLuc) ||
+ ((rand == 7) && _roomPresenceIda) ||
+ ((rand == 8) && _roomPresenceMax));
} while (test);
int retVal = convertCharacterIndexToBitIndex(rand);
@@ -1404,7 +1404,7 @@ void MortevielleEngine::setRandomPresencePurpleRoom(int cf) {
* @remarks Originally called 'pl5'
*/
void MortevielleEngine::setRandomPresenceBlueRoom(int cf) {
- if (!g_vm->_roomPresenceMax) {
+ if (!_roomPresenceMax) {
int p = getPresenceStatsBlueRoom();
int rand;
@@ -2032,7 +2032,11 @@ bool MortevielleEngine::checkInventory(int objectId) {
return retVal;
}
-void st1sama() {
+/**
+ * Engine function - Display Dining Room
+ * @remarks Originally called 'st1sama'
+ */
+void MortevielleEngine::displayDiningRoom() {
g_s._currPlace = DINING_ROOM;
affrep();
}
@@ -2141,13 +2145,13 @@ void MortevielleEngine::gotoDiningRoom() {
g_crep = 1511;
loseGame();
} else
- st1sama();
+ displayDiningRoom();
} else if (!g_s._alreadyEnteredManor) { //Is it your first time?
_currBitIndex = 255; // Everybody is present
- g_vm->showPeoplePresent(_currBitIndex);
+ showPeoplePresent(_currBitIndex);
g_caff = 77;
afdes(0);
- g_vm->_screenSurface.drawBox(223, 47, 155, 91, 15);
+ _screenSurface.drawBox(223, 47, 155, 91, 15);
repon(2, 33);
tkey1(false);
mennor();
@@ -2160,19 +2164,14 @@ void MortevielleEngine::gotoDiningRoom() {
showMouse();
g_s._currPlace = OWN_ROOM;
affrep();
- g_vm->resetPresenceInRooms(DINING_ROOM);
- if (!g_vm->_blo)
+ resetPresenceInRooms(DINING_ROOM);
+ if (!_blo)
minute = t11(OWN_ROOM);
_currBitIndex = 0;
g_mpers = 0;
g_s._alreadyEnteredManor = true;
} else
- st1sama();
-}
-
-void t1vier() {
- g_s._currPlace = SECRET_PASSAGE;
- affrep();
+ displayDiningRoom();
}
/**
@@ -2216,7 +2215,7 @@ void MortevielleEngine::gotoManorBack() {
*/
void MortevielleEngine::floodedInWell() {
g_crep = 1503;
- g_vm->loseGame();
+ loseGame();
}
void tctrm() {
@@ -2552,7 +2551,7 @@ void MortevielleEngine::gameLoaded() {
repon(2, g_crep);
clearScreenType3();
_endGame = false;
- g_vm->_menu.setDestinationMenuText(g_s._currPlace);
+ _menu.setDestinationMenuText(g_s._currPlace);
modinv();
if (g_s._selectedObjectId != 0)
modobj(g_s._selectedObjectId + 400);
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 43413b3a89..da1f447bb9 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -111,7 +111,7 @@ extern void affrep();
/* NIVEAU 6 */
extern void tsort();
extern void st4(int ob);
-extern void st1sama();
+extern void displayDiningRoom();
extern void modinv();
extern void sparl(float adr, float rep);
extern void endSearch();
@@ -120,7 +120,6 @@ extern void premtet();
/* NIVEAU 5 */
extern void ajchai();
extern void ajjer(int ob);
-extern void t1vier();
extern void tctrm();
extern void quelquun();
extern void tsuiv();
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 52c68fa44d..57de236f8d 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -269,7 +269,7 @@ public:
bool checkInventory(int objectId);
void loseGame();
void floodedInWell();
-
+ void displayDiningRoom();
};
extern MortevielleEngine *g_vm;
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 9e17252734..4113ff0e01 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -48,9 +48,13 @@ Common::String SavegameManager::generateSaveName(int slotNumber) {
*/
void SavegameManager::sync_save(Common::Serializer &sz) {
sz.syncAsSint16LE(g_s1._faithScore);
- sz.syncBytes((byte *)&g_s1._pourc[0], 11);
- sz.syncBytes((byte *)&g_s1._teauto[0], 43);
- sz.syncBytes((byte *)&g_s1._sjer[0], 31);
+ for (int i = 0; i < 11; ++i)
+ sz.syncAsByte(g_s1._pourc[i]);
+ for (int i = 0; i < 43; ++i)
+ sz.syncAsByte(g_s1._teauto[i]);
+ for (int i = 0; i < 31; ++i)
+ sz.syncAsByte(g_s1._sjer[i]);
+
sz.syncAsSint16LE(g_s1._currPlace);
sz.syncAsSint16LE(g_s1._atticBallHoleObjectId);
sz.syncAsSint16LE(g_s1._atticRodHoleObjectId);