aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-03-10 10:06:44 +0100
committerStrangerke2012-04-06 08:23:08 +0200
commitb5d2fa7e5f11ed02bc8b52459265a07c9d61440b (patch)
tree4ef960f66d76a15e471281dd6e207a432ecc098d
parent79dd91803338380c62a6a1aa2ba3dd0690e565be (diff)
downloadscummvm-rg350-b5d2fa7e5f11ed02bc8b52459265a07c9d61440b.tar.gz
scummvm-rg350-b5d2fa7e5f11ed02bc8b52459265a07c9d61440b.tar.bz2
scummvm-rg350-b5d2fa7e5f11ed02bc8b52459265a07c9d61440b.zip
MORTEVIELLE: Merge prog and mor files
-rw-r--r--engines/mortevielle/actions.cpp1
-rw-r--r--engines/mortevielle/module.mk1
-rw-r--r--engines/mortevielle/mor.cpp210
-rw-r--r--engines/mortevielle/mor.h10
-rw-r--r--engines/mortevielle/mortevielle.cpp1
-rw-r--r--engines/mortevielle/prog.cpp250
-rw-r--r--engines/mortevielle/prog.h44
-rw-r--r--engines/mortevielle/saveload.cpp1
8 files changed, 220 insertions, 298 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index 5f511fc7ee..59a99ef811 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -38,7 +38,6 @@
namespace Mortevielle {
-
/**
* Engine function - Move
* @remarks Originally called 'taller'
diff --git a/engines/mortevielle/module.mk b/engines/mortevielle/module.mk
index 103a4fcd4e..07631ea264 100644
--- a/engines/mortevielle/module.mk
+++ b/engines/mortevielle/module.mk
@@ -13,7 +13,6 @@ MODULE_OBJS := \
mouse.o \
outtext.o \
ovd1.o \
- prog.o \
saveload.o \
sound.o \
speech.o \
diff --git a/engines/mortevielle/mor.cpp b/engines/mortevielle/mor.cpp
index 7c92d9aab0..ef55e316a8 100644
--- a/engines/mortevielle/mor.cpp
+++ b/engines/mortevielle/mor.cpp
@@ -30,6 +30,7 @@
#include "common/str.h"
#include "common/system.h"
#include "common/textconsole.h"
+#include "mortevielle/actions.h"
#include "mortevielle/dialogs.h"
#include "mortevielle/graphics.h"
#include "mortevielle/menu.h"
@@ -2425,4 +2426,213 @@ void aldepl() {
Alert::show(g_vm->getEngineString(S_USE_DEP_MENU), 1);
}
+/**
+ * Engine function - Change Graphical Device
+ * @remarks Originally called 'change_gd'
+ */
+void changeGraphicalDevice(int newDevice) {
+ hideMouse();
+ g_vm->_currGraphicalDevice = newDevice;
+ hirs();
+ initMouse();
+ showMouse();
+ dessine_rouleau();
+ tinke();
+ drawClock();
+ if (g_ipers != 0)
+ showPeoplePresent(g_ipers);
+ else
+ displayAloneText();
+ clearScreenType2();
+ clsf3();
+ g_maff = 68;
+ afdes(0);
+ repon(2, g_crep);
+ g_vm->_menu.displayMenu();
+}
+
+/**
+ * Called when a savegame has been loaded.
+ * @remarks Originally called 'antegame'
+ */
+void MortevielleEngine::gameLoaded() {
+ hideMouse();
+ _menu._menuDisplayed = false;
+ _loseGame = true;
+ _anyone = false;
+ _okdes = true;
+ _col = false;
+ _hiddenHero = false;
+ _brt = false;
+ g_maff = 68;
+ g_mnumo = 0;
+ g_prebru = 0;
+ g_x = 0;
+ g_y = 0;
+ g_num = 0;
+ g_hdb = 0;
+ g_hfb = 0;
+ g_cs = 0;
+ g_is = 0;
+ g_ment = 0;
+ _syn = true;
+ _heroSearching = true;
+ g_mchai = 0;
+ g_inei = 0;
+ initouv();
+ g_iouv = 0;
+ g_dobj = 0;
+ affrep();
+ g_hintPctMessage = deline(580);
+
+ _okdes = false;
+ _endGame = true;
+ _loseGame = false;
+ _heroSearching = false;
+
+ displayAloneText();
+ tinke();
+ drawClock();
+ afdes(0);
+ repon(2, g_crep);
+ clsf3();
+ _endGame = false;
+ tmlieu(g_s._currPlace);
+ modinv();
+ if (g_s._selectedObjectId != 0)
+ modobj(g_s._selectedObjectId + 400);
+ showMouse();
+}
+
+
+/* NIVEAU 3 */
+/* procedure PROGRAMME */
+void tmaj3() {
+ int day, hour, minute;
+
+ updateHour(day, hour, minute);
+ if (minute == 30)
+ minute = 1;
+ hour += day * 24;
+ minute += hour * 2;
+ g_s._heure = chr(minute);
+}
+
+void tsitu() {
+ if (!g_vm->_col)
+ clearScreenType2();
+ g_vm->_syn = false;
+ g_vm->_keyPressedEsc = false;
+ if (!g_vm->_anyone) {
+ if (g_vm->_brt)
+ if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
+ g_ctrm = 4;
+ mennor();
+ return;
+ }
+ if (g_msg[3] == MENU_MOVE)
+ fctMove();
+ if (g_msg[3] == MENU_DISCUSS)
+ fctDiscuss();
+ if (g_msg[3] == MENU_INVENTORY)
+ fctInventoryTake();
+ if (g_msg[4] == OPCODE_ATTACH)
+ fctAttach();
+ if (g_msg[4] == OPCODE_WAIT)
+ fctWait();
+ if (g_msg[4] == OPCODE_FORCE)
+ fctForce();
+ if (g_msg[4] == OPCODE_SLEEP)
+ fctSleep();
+ if (g_msg[4] == OPCODE_LISTEN)
+ fctListen();
+ if (g_msg[4] == OPCODE_ENTER)
+ fctEnter();
+ if (g_msg[4] == OPCODE_CLOSE)
+ fctClose();
+ if (g_msg[4] == OPCODE_SEARCH)
+ fctSearch();
+ if (g_msg[4] == OPCODE_KNOCK)
+ fctKnock();
+ if (g_msg[4] == OPCODE_SCRATCH)
+ fctScratch();
+ if (g_msg[4] == OPCODE_READ)
+ fctRead();
+ if (g_msg[4] == OPCODE_EAT)
+ fctEat();
+ if (g_msg[4] == OPCODE_PLACE)
+ fctPlace();
+ if (g_msg[4] == OPCODE_OPEN)
+ fctOpen();
+ if (g_msg[4] == OPCODE_TAKE)
+ fctTake();
+ if (g_msg[4] == OPCODE_LOOK)
+ fctLook();
+ if (g_msg[4] == OPCODE_SMELL)
+ fctSmell();
+ if (g_msg[4] == OPCODE_SOUND)
+ fctSound();
+ if (g_msg[4] == OPCODE_LEAVE)
+ fctLeave();
+ if (g_msg[4] == OPCODE_LIFT)
+ fctLift();
+ if (g_msg[4] == OPCODE_TURN)
+ fctTurn();
+ if (g_msg[4] == OPCODE_SSEARCH)
+ fctSelfSearch();
+ if (g_msg[4] == OPCODE_SREAD)
+ fctSelfRead();
+ if (g_msg[4] == OPCODE_SPUT)
+ fctSelfPut();
+ if (g_msg[4] == OPCODE_SLOOK)
+ fctSelftLook();
+ g_vm->_hiddenHero = false;
+
+ if (g_msg[4] == OPCODE_SHIDE)
+ fctSelfHide();
+ } else {
+ if (g_vm->_anyone) {
+ quelquun();
+ g_vm->_anyone = false;
+ mennor();
+ return;
+ }
+ }
+ int hour, day, minute;
+ updateHour(day, hour, minute);
+ if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
+ ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
+ ++g_s._faithScore;
+ if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
+ && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
+ if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
+ g_crep = 1501;
+ tperd();
+ }
+ if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
+ g_crep = 1508;
+ tperd();
+ }
+ if ((day > 1) && (hour > 8) && (!g_vm->_loseGame)) {
+ g_crep = 1502;
+ tperd();
+ }
+ }
+ mennor();
+}
+
+/* NIVEAU 1 */
+
+void theure() {
+ g_vj = ord(g_s._heure);
+ g_vh = g_vj % 48;
+ g_vj /= 48;
+ g_vm__ = g_vh % 2;
+ g_vh /= 2;
+ g_hour = g_vh;
+ if (g_vm__ == 1)
+ g_minute = 30;
+ else
+ g_minute = 0;
+}
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mor.h b/engines/mortevielle/mor.h
index 73f6df22b7..d7d5c8739f 100644
--- a/engines/mortevielle/mor.h
+++ b/engines/mortevielle/mor.h
@@ -178,5 +178,15 @@ extern void t23coul(int &l);
extern void maivid();
extern void st13(int ob);
extern void aldepl();
+
+extern void changeGraphicalDevice(int newDevice);
+
+/* NIVEAU 3 */
+/* procedure PROGRAMME */
+extern void tmaj3();
+extern void tsitu();
+
+/* NIVEAU 1 */
+extern void theure();
} // End of namespace Mortevielle
#endif
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 509301349d..4b8c2678b3 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -38,7 +38,6 @@
#include "mortevielle/mouse.h"
#include "mortevielle/outtext.h"
#include "mortevielle/ovd1.h"
-#include "mortevielle/prog.h"
#include "mortevielle/saveload.h"
#include "mortevielle/outtext.h"
#include "mortevielle/var_mor.h"
diff --git a/engines/mortevielle/prog.cpp b/engines/mortevielle/prog.cpp
deleted file mode 100644
index a6ccfcb143..0000000000
--- a/engines/mortevielle/prog.cpp
+++ /dev/null
@@ -1,250 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#include "mortevielle/actions.h"
-#include "mortevielle/dialogs.h"
-#include "mortevielle/menu.h"
-#include "mortevielle/mor.h"
-#include "mortevielle/mortevielle.h"
-#include "mortevielle/prog.h"
-#include "mortevielle/var_mor.h"
-#include "mortevielle/mouse.h"
-#include "mortevielle/outtext.h"
-
-namespace Mortevielle {
-
-/**
- * Engine function - Change Graphical Device
- * @remarks Originally called 'change_gd'
- */
-void changeGraphicalDevice(int newDevice) {
- hideMouse();
- g_vm->_currGraphicalDevice = newDevice;
- hirs();
- initMouse();
- showMouse();
- dessine_rouleau();
- tinke();
- drawClock();
- if (g_ipers != 0)
- showPeoplePresent(g_ipers);
- else
- displayAloneText();
- clearScreenType2();
- clsf3();
- g_maff = 68;
- afdes(0);
- repon(2, g_crep);
- g_vm->_menu.displayMenu();
-}
-
-/**
- * Called when a savegame has been loaded.
- * @remarks Originally called 'antegame'
- */
-void MortevielleEngine::gameLoaded() {
- hideMouse();
- _menu._menuDisplayed = false;
- _loseGame = true;
- _anyone = false;
- _okdes = true;
- _col = false;
- _hiddenHero = false;
- _brt = false;
- g_maff = 68;
- g_mnumo = 0;
- g_prebru = 0;
- g_x = 0;
- g_y = 0;
- g_num = 0;
- g_hdb = 0;
- g_hfb = 0;
- g_cs = 0;
- g_is = 0;
- g_ment = 0;
- _syn = true;
- _heroSearching = true;
- g_mchai = 0;
- g_inei = 0;
- initouv();
- g_iouv = 0;
- g_dobj = 0;
- affrep();
- g_hintPctMessage = deline(580);
-
- _okdes = false;
- _endGame = true;
- _loseGame = false;
- _heroSearching = false;
-
- displayAloneText();
- tinke();
- drawClock();
- afdes(0);
- repon(2, g_crep);
- clsf3();
- _endGame = false;
- tmlieu(g_s._currPlace);
- modinv();
- if (g_s._selectedObjectId != 0)
- modobj(g_s._selectedObjectId + 400);
- showMouse();
-}
-
-
-/* NIVEAU 3 */
-/* procedure PROGRAMME */
-void tmaj3() {
- int day, hour, minute;
-
- updateHour(day, hour, minute);
- if (minute == 30)
- minute = 1;
- hour += day * 24;
- minute += hour * 2;
- g_s._heure = chr(minute);
-}
-
-void tsitu() {
- if (!g_vm->_col)
- clearScreenType2();
- g_vm->_syn = false;
- g_vm->_keyPressedEsc = false;
- if (!g_vm->_anyone) {
- if (g_vm->_brt)
- if ((g_msg[3] == MENU_MOVE) || (g_msg[4] == OPCODE_LEAVE) || (g_msg[4] == OPCODE_SLEEP) || (g_msg[4] == OPCODE_EAT)) {
- g_ctrm = 4;
- mennor();
- return;
- }
- if (g_msg[3] == MENU_MOVE)
- fctMove();
- if (g_msg[3] == MENU_DISCUSS)
- fctDiscuss();
- if (g_msg[3] == MENU_INVENTORY)
- fctInventoryTake();
- if (g_msg[4] == OPCODE_ATTACH)
- fctAttach();
- if (g_msg[4] == OPCODE_WAIT)
- fctWait();
- if (g_msg[4] == OPCODE_FORCE)
- fctForce();
- if (g_msg[4] == OPCODE_SLEEP)
- fctSleep();
- if (g_msg[4] == OPCODE_LISTEN)
- fctListen();
- if (g_msg[4] == OPCODE_ENTER)
- fctEnter();
- if (g_msg[4] == OPCODE_CLOSE)
- fctClose();
- if (g_msg[4] == OPCODE_SEARCH)
- fctSearch();
- if (g_msg[4] == OPCODE_KNOCK)
- fctKnock();
- if (g_msg[4] == OPCODE_SCRATCH)
- fctScratch();
- if (g_msg[4] == OPCODE_READ)
- fctRead();
- if (g_msg[4] == OPCODE_EAT)
- fctEat();
- if (g_msg[4] == OPCODE_PLACE)
- fctPlace();
- if (g_msg[4] == OPCODE_OPEN)
- fctOpen();
- if (g_msg[4] == OPCODE_TAKE)
- fctTake();
- if (g_msg[4] == OPCODE_LOOK)
- fctLook();
- if (g_msg[4] == OPCODE_SMELL)
- fctSmell();
- if (g_msg[4] == OPCODE_SOUND)
- fctSound();
- if (g_msg[4] == OPCODE_LEAVE)
- fctLeave();
- if (g_msg[4] == OPCODE_LIFT)
- fctLift();
- if (g_msg[4] == OPCODE_TURN)
- fctTurn();
- if (g_msg[4] == OPCODE_SSEARCH)
- fctSelfSearch();
- if (g_msg[4] == OPCODE_SREAD)
- fctSelfRead();
- if (g_msg[4] == OPCODE_SPUT)
- fctSelfPut();
- if (g_msg[4] == OPCODE_SLOOK)
- fctSelftLook();
- g_vm->_hiddenHero = false;
-
- if (g_msg[4] == OPCODE_SHIDE)
- fctSelfHide();
- } else {
- if (g_vm->_anyone) {
- quelquun();
- g_vm->_anyone = false;
- mennor();
- return;
- }
- }
- int hour, day, minute;
- updateHour(day, hour, minute);
- if ((((hour == 12) || (hour == 13) || (hour == 19)) && (g_s._currPlace != 10)) ||
- ((hour > 0) && (hour < 6) && (g_s._currPlace != 0)))
- ++g_s._faithScore;
- if (((g_s._currPlace < CRYPT) || (g_s._currPlace > MOUNTAIN)) && (g_s._currPlace != 23)
- && (g_s._currPlace != 0) && (g_s._selectedObjectId != 152) && (!g_vm->_loseGame)) {
- if ((g_s._faithScore > 99) && (hour > 8) && (hour < 16)) {
- g_crep = 1501;
- tperd();
- }
- if ((g_s._faithScore > 99) && (hour > 0) && (hour < 9)) {
- g_crep = 1508;
- tperd();
- }
- if ((day > 1) && (hour > 8) && (!g_vm->_loseGame)) {
- g_crep = 1502;
- tperd();
- }
- }
- mennor();
-}
-
-/* NIVEAU 1 */
-
-void theure() {
- g_vj = ord(g_s._heure);
- g_vh = g_vj % 48;
- g_vj /= 48;
- g_vm__ = g_vh % 2;
- g_vh /= 2;
- g_hour = g_vh;
- if (g_vm__ == 1)
- g_minute = 30;
- else
- g_minute = 0;
-}
-
-} // End of namespace Mortevielle
diff --git a/engines/mortevielle/prog.h b/engines/mortevielle/prog.h
deleted file mode 100644
index c6ccca8920..0000000000
--- a/engines/mortevielle/prog.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This code is based on original Mortville Manor DOS source code
- * Copyright (c) 1988-1989 Lankhor
- */
-
-#ifndef MORTEVIELLE_PROG_H
-#define MORTEVIELLE_PROG_H
-
-namespace Mortevielle {
-
-extern void changeGraphicalDevice(int newDevice);
-
-/* NIVEAU 3 */
-/* procedure PROGRAMME */
-extern void tmaj3();
-extern void tsitu();
-
-/* NIVEAU 1 */
-extern void theure();
-
-} // End of namespace Mortevielle
-#endif
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index 2c2af49a5f..a86432253c 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -32,7 +32,6 @@
#include "mortevielle/mortevielle.h"
#include "mortevielle/mouse.h"
#include "mortevielle/ovd1.h"
-#include "mortevielle/prog.h"
#include "mortevielle/saveload.h"
#include "mortevielle/var_mor.h"