aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle/mortevielle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mortevielle/mortevielle.cpp')
-rw-r--r--engines/mortevielle/mortevielle.cpp51
1 files changed, 35 insertions, 16 deletions
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index 0b6b82c1a9..d434150977 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -46,7 +46,7 @@ namespace Mortevielle {
MortevielleEngine *g_vm;
-MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *gameDesc):
+MortevielleEngine::MortevielleEngine(OSystem *system, const MortevielleGameDescription *gameDesc):
Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle"),
_soundManager(_mixer) {
g_vm = this;
@@ -57,11 +57,13 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
_text.setParent(this);
_soundManager.setParent(this);
_savegameManager.setParent(this);
+ _menu.setParent(this);
_lastGameFrame = 0;
_mouseClick = false;
_inMainGameLoop = false;
_quitGame = false;
+ _pauseStartTime = -1;
_roomPresenceLuc = false;
_roomPresenceIda = false;
@@ -91,8 +93,6 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const ADGameDescription *g
_uptodatePresence = false;
_textColor = 0;
- _currGraphicalDevice = -1;
- _newGraphicalDevice = -1;
_place = -1;
_x26KeyCount = -1;
@@ -166,6 +166,25 @@ Common::String MortevielleEngine::generateSaveFilename(const Common::String &tar
}
/**
+ * Pause the game.
+ */
+void MortevielleEngine::pauseEngineIntern(bool pause) {
+ Engine::pauseEngineIntern(pause);
+ if (pause) {
+ if (_pauseStartTime == -1)
+ _pauseStartTime = readclock();
+ } else {
+ if (_pauseStartTime != -1) {
+ int pauseEndTime = readclock();
+ _currentTime += (pauseEndTime - _pauseStartTime);
+ if (_uptodatePresence)
+ _startTime += (pauseEndTime - _pauseStartTime);
+ }
+ _pauseStartTime = -1;
+ }
+}
+
+/**
* Initialize the game state
*/
Common::ErrorCode MortevielleEngine::initialize() {
@@ -179,10 +198,6 @@ Common::ErrorCode MortevielleEngine::initialize() {
// Set up an intermediate screen surface
_screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
- // Set the screen mode
- _currGraphicalDevice = MODE_EGA;
- _resolutionScaler = 2;
-
_txxFileFl = false;
// Load texts from TXX files
loadTexts();
@@ -203,8 +218,6 @@ Common::ErrorCode MortevielleEngine::initialize() {
// Setup the mouse cursor
initMouse();
- _currGraphicalDevice = MODE_EGA;
- _newGraphicalDevice = _currGraphicalDevice;
loadPalette();
loadCFIPH();
loadCFIEC();
@@ -219,11 +232,8 @@ Common::ErrorCode MortevielleEngine::initialize() {
testKeyboard();
showConfigScreen();
- _newGraphicalDevice = _currGraphicalDevice;
testKeyboard();
- if (_newGraphicalDevice != _currGraphicalDevice)
- _currGraphicalDevice = _newGraphicalDevice;
- hirs();
+ clearScreen();
_soundManager.loadNoise();
_soundManager.loadAmbiantSounds();
@@ -273,6 +283,8 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
readStaticStrings(f, dataSize, kStaticStrings);
} else if ((!strncmp(dataType, "GSTR", 4)) && (!_txxFileFl)) {
readStaticStrings(f, dataSize, kGameStrings);
+ } else if (!strncmp(dataType, "VERB", 4)) {
+ _menu.readVerbNums(f, dataSize);
} else {
// Unknown section
f.skip(dataSize);
@@ -286,6 +298,7 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
return Common::kNoError;
}
+
/**
* Read in a static strings block, and if the language matches, load up the static strings
*/
@@ -354,10 +367,16 @@ Common::Error MortevielleEngine::run() {
if (loadSlot == 0)
// Show the game introduction
showIntroduction();
+ else {
+ _caff = 51;
+ _text.taffich();
+ }
// Either load the initial game state savegame, or the specified savegame number
adzon();
- _savegameManager.loadSavegame(generateSaveFilename(loadSlot));
+ resetVariables();
+ if (loadSlot != 0)
+ _savegameManager.loadSavegame(generateSaveFilename(loadSlot));
// Run the main game loop
mainGame();
@@ -400,11 +419,11 @@ void MortevielleEngine::mainGame() {
for (_crep = 1; _crep <= _x26KeyCount; ++_crep)
decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
- _menu.initMenu(this);
+ _menu.initMenu();
charToHour();
initGame();
- hirs();
+ clearScreen();
drawRightFrame();
_mouse.showMouse();