2012-09-23 00:59:52 +00:00
|
|
|
/* 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.
|
|
|
|
*
|
2012-10-29 22:38:31 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
2012-09-23 00:59:52 +00:00
|
|
|
* modify it under the terms of the GNU General Public License
|
2012-10-29 22:38:31 +00:00
|
|
|
* as published by the Free Software Foundation; either version 2
|
2012-09-23 00:59:52 +00:00
|
|
|
* 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
|
2012-10-29 22:38:31 +00:00
|
|
|
* along with this program; if not, write to the Free Software
|
2012-10-27 17:08:53 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2012-09-23 00:59:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2012-11-11 04:21:30 +00:00
|
|
|
#include "common/config-manager.h"
|
2012-09-23 00:59:52 +00:00
|
|
|
#include "common/events.h"
|
2012-10-24 09:37:42 +00:00
|
|
|
#include "common/file.h"
|
2012-09-23 00:59:52 +00:00
|
|
|
#include "common/util.h"
|
|
|
|
#include "hopkins/dialogs.h"
|
|
|
|
#include "hopkins/events.h"
|
|
|
|
#include "hopkins/files.h"
|
|
|
|
#include "hopkins/globals.h"
|
|
|
|
#include "hopkins/graphics.h"
|
|
|
|
#include "hopkins/hopkins.h"
|
|
|
|
#include "hopkins/sound.h"
|
|
|
|
|
|
|
|
namespace Hopkins {
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
DialogsManager::DialogsManager() {
|
|
|
|
INVENTFLAG = false;
|
2012-12-10 06:54:03 +00:00
|
|
|
_inventDisplayedFl = false;
|
2012-10-24 09:37:42 +00:00
|
|
|
VIRE_INVENT = false;
|
2012-12-10 06:54:03 +00:00
|
|
|
_inventX = _inventY = 0;
|
|
|
|
_inventWidth = _inventHeight = 0;
|
2012-10-24 09:37:42 +00:00
|
|
|
Winventaire = NULL;
|
|
|
|
inventaire2 = g_PTRNUL;
|
|
|
|
}
|
|
|
|
|
|
|
|
DialogsManager::~DialogsManager() {
|
|
|
|
_vm->_globals.dos_free2(Winventaire);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogsManager::setParent(HopkinsEngine *vm) {
|
|
|
|
_vm = vm;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogsManager::showOptionsDialog() {
|
2012-09-23 00:59:52 +00:00
|
|
|
bool doneFlag;
|
|
|
|
|
|
|
|
doneFlag = false;
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_eventsManager.CHANGE_MOUSE(0);
|
|
|
|
_vm->_eventsManager.VBL();
|
|
|
|
if (_vm->_globals.FR == 1)
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIFR.SPR");
|
|
|
|
else if (!_vm->_globals.FR)
|
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIAN.SPR");
|
|
|
|
else if (_vm->_globals.FR == 2)
|
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "OPTIES.SPR");
|
2012-09-23 00:59:52 +00:00
|
|
|
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_globals.OPTION_SPR = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER);
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.OPTION_FLAG = true;
|
2012-09-23 00:59:52 +00:00
|
|
|
|
|
|
|
do {
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_eventsManager.BMOUSE()) {
|
|
|
|
Common::Point mousePos(_vm->_eventsManager.XMOUSE(), _vm->_eventsManager.YMOUSE());
|
|
|
|
mousePos.x = _vm->_eventsManager.XMOUSE();
|
|
|
|
mousePos.y = _vm->_eventsManager.YMOUSE();
|
2012-09-23 00:59:52 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!_vm->_soundManager.MUSICOFF) {
|
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 113 && mousePos.x <= _vm->_graphicsManager.ofscroll + 327 && mousePos.y <= 138) {
|
2012-11-11 04:21:30 +00:00
|
|
|
// Change the music volume
|
2012-10-24 09:37:42 +00:00
|
|
|
++_vm->_soundManager.MUSICVOL;
|
|
|
|
_vm->_soundManager.OLD_MUSICVOL = _vm->_soundManager.MUSICVOL;
|
2012-09-23 00:59:52 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_soundManager.MUSICVOL <= 12)
|
|
|
|
_vm->_soundManager.PLAY_SOUND("bruit2.wav");
|
2012-09-23 00:59:52 +00:00
|
|
|
else
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.MUSICVOL = 12;
|
|
|
|
_vm->_soundManager.MODSetMusicVolume(_vm->_soundManager.MUSICVOL);
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!_vm->_soundManager.MUSICOFF && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 113 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 138) {
|
|
|
|
--_vm->_soundManager.MUSICVOL;
|
|
|
|
if (_vm->_soundManager.MUSICVOL >= 0)
|
|
|
|
_vm->_soundManager.PLAY_SOUND("bruit2.wav");
|
2012-09-23 00:59:52 +00:00
|
|
|
else
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.MUSICVOL = 0;
|
2012-09-23 00:59:52 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.OLD_MUSICVOL = _vm->_soundManager.MUSICVOL;
|
|
|
|
_vm->_soundManager.MODSetMusicVolume(_vm->_soundManager.MUSICVOL);
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
}
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!_vm->_soundManager.SOUNDOFF) {
|
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 140 && mousePos.x <= _vm->_graphicsManager.ofscroll + 327 && mousePos.y <= 165) {
|
|
|
|
++_vm->_soundManager.SOUNDVOL;
|
|
|
|
if (_vm->_soundManager.SOUNDVOL <= 16)
|
|
|
|
_vm->_soundManager.PLAY_SOUND("bruit2.wav");
|
2012-09-23 00:59:52 +00:00
|
|
|
else
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.SOUNDVOL = 16;
|
|
|
|
_vm->_soundManager.OLD_SOUNDVOL = _vm->_soundManager.SOUNDVOL;
|
|
|
|
_vm->_soundManager.MODSetSampleVolume();
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!_vm->_soundManager.SOUNDOFF && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 140 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 165) {
|
|
|
|
--_vm->_soundManager.SOUNDVOL;
|
|
|
|
if (_vm->_soundManager.SOUNDVOL >= 0)
|
|
|
|
_vm->_soundManager.PLAY_SOUND("bruit2.wav");
|
2012-09-23 00:59:52 +00:00
|
|
|
else
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.SOUNDVOL = 0;
|
|
|
|
_vm->_soundManager.OLD_SOUNDVOL = _vm->_soundManager.SOUNDVOL;
|
|
|
|
_vm->_soundManager.MODSetSampleVolume();
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!_vm->_soundManager.VOICEOFF) {
|
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 167 && mousePos.x <= _vm->_graphicsManager.ofscroll + 327 && mousePos.y <= 192) {
|
|
|
|
++_vm->_soundManager.VOICEVOL;
|
2012-09-23 00:59:52 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_soundManager.VOICEVOL <= 16)
|
|
|
|
_vm->_soundManager.PLAY_SOUND("bruit2.wav");
|
2012-09-23 00:59:52 +00:00
|
|
|
else
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.VOICEVOL = 16;
|
|
|
|
_vm->_soundManager.OLD_VOICEVOL = _vm->_soundManager.VOICEVOL;
|
|
|
|
_vm->_soundManager.MODSetVoiceVolume();
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!_vm->_soundManager.VOICEOFF && mousePos.x >= _vm->_graphicsManager.ofscroll + 331 && mousePos.y > 167 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 192) {
|
|
|
|
--_vm->_soundManager.VOICEVOL;
|
|
|
|
if (_vm->_soundManager.VOICEVOL >= 0)
|
|
|
|
_vm->_soundManager.PLAY_SOUND("bruit2.wav");
|
2012-09-23 00:59:52 +00:00
|
|
|
else
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.VOICEVOL = 0;
|
|
|
|
_vm->_soundManager.OLD_VOICEVOL = _vm->_soundManager.VOICEVOL;
|
|
|
|
_vm->_soundManager.MODSetVoiceVolume();
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 431) {
|
|
|
|
if (mousePos.y > 194 && mousePos.x <= _vm->_graphicsManager.ofscroll + 489 && mousePos.y <= 219)
|
|
|
|
_vm->_soundManager.TEXTOFF = _vm->_soundManager.TEXTOFF != 1;
|
|
|
|
|
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 431) {
|
2012-11-11 04:21:30 +00:00
|
|
|
if (mousePos.y > 167 && mousePos.x <= _vm->_graphicsManager.ofscroll + 489 && mousePos.y <= 192) {
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.VOICEOFF = _vm->_soundManager.VOICEOFF != 1;
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
|
|
|
}
|
2012-10-24 09:37:42 +00:00
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 431) {
|
|
|
|
if (mousePos.y > 113 && mousePos.x <= _vm->_graphicsManager.ofscroll + 489 && mousePos.y <= 138) {
|
|
|
|
if (_vm->_soundManager.MUSICOFF == 1) {
|
|
|
|
_vm->_soundManager.MUSICOFF = 0;
|
|
|
|
_vm->_soundManager.MODSetMusicVolume(_vm->_soundManager.MUSICVOL);
|
2012-09-23 00:59:52 +00:00
|
|
|
} else {
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.MUSICOFF = 1;
|
|
|
|
_vm->_soundManager.MODSetMusicVolume(0);
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
|
2012-11-11 04:21:30 +00:00
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 431 && mousePos.y > 140 && mousePos.x <= _vm->_graphicsManager.ofscroll + 489 && mousePos.y <= 165) {
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_soundManager.SOUNDOFF = _vm->_soundManager.SOUNDOFF != 1;
|
2012-11-11 04:21:30 +00:00
|
|
|
|
|
|
|
_vm->_soundManager.updateScummVMSoundSettings();
|
|
|
|
}
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 175 && mousePos.y > 285 && mousePos.x <= _vm->_graphicsManager.ofscroll + 281 && mousePos.y <= 310) {
|
|
|
|
_vm->_globals.SORTIE = 300;
|
2012-09-23 00:59:52 +00:00
|
|
|
doneFlag = true;
|
|
|
|
}
|
2012-10-24 09:37:42 +00:00
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 355 && mousePos.y > 285 && mousePos.x <= _vm->_graphicsManager.ofscroll + 490 && mousePos.y <= 310)
|
2012-10-15 09:49:17 +00:00
|
|
|
doneFlag = true;
|
2012-10-24 09:37:42 +00:00
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 194 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 219) {
|
|
|
|
switch (_vm->_graphicsManager.SPEED_SCROLL) {
|
2012-09-23 00:59:52 +00:00
|
|
|
case 1:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 2;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 4;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 8;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 8:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 16;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 16:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 32;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 32:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 48;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 48:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 64;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 64:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 128;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 128:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 160;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 160:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 320;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
case 320:
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SPEED_SCROLL = 1;
|
2012-09-23 00:59:52 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 348 && mousePos.y > 248 && mousePos.x <= _vm->_graphicsManager.ofscroll + 394 && mousePos.y <= 273)
|
|
|
|
_vm->_globals.vitesse = 2;
|
|
|
|
if (mousePos.x >= _vm->_graphicsManager.ofscroll + 300 && mousePos.y > 221 && mousePos.x <= _vm->_graphicsManager.ofscroll + 358 && mousePos.y <= 246)
|
|
|
|
_vm->_globals.SVGA = 2;
|
|
|
|
if (mousePos.x < _vm->_graphicsManager.ofscroll + 165 || mousePos.x > _vm->_graphicsManager.ofscroll + 496 || (uint)(mousePos.y - 107) > 0xD3u)
|
2012-09-23 00:59:52 +00:00
|
|
|
doneFlag = true;
|
|
|
|
}
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!_vm->_graphicsManager.MANU_SCROLL)
|
|
|
|
_vm->_globals.opt_scrtype = 2;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.MANU_SCROLL == 1)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrtype = 1;
|
2012-11-21 21:42:51 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_globals.vitesse == 1)
|
|
|
|
_vm->_globals.opt_vitesse = 6;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_globals.vitesse == 2)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_vitesse = 5;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_globals.vitesse == 3)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_vitesse = 4;
|
|
|
|
|
|
|
|
_vm->_globals.opt_txt = !_vm->_soundManager.TEXTOFF ? 7 : 8;
|
|
|
|
_vm->_globals.opt_voice = !_vm->_soundManager.VOICEOFF ? 7 : 8;
|
|
|
|
_vm->_globals.opt_sound = !_vm->_soundManager.SOUNDOFF ? 7 : 8;
|
|
|
|
_vm->_globals.opt_music = !_vm->_soundManager.MUSICOFF ? 7 : 8;
|
2012-10-15 09:49:17 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_globals.SVGA == 1)
|
|
|
|
_vm->_globals.opt_anm = 10;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_globals.SVGA == 2)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_anm = 9;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_globals.SVGA == 3)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_anm = 11;
|
2012-11-21 21:42:51 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_graphicsManager.SPEED_SCROLL == 1)
|
|
|
|
_vm->_globals.opt_scrspeed = 12;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 2)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 13;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 4)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 14;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 8)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 15;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 16)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 16;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 32)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 17;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 48)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 18;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 64)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 19;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 128)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 20;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 160)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 21;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 320)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 22;
|
2012-11-21 21:42:51 +00:00
|
|
|
else if (_vm->_graphicsManager.SPEED_SCROLL == 640)
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.opt_scrspeed = 23;
|
|
|
|
|
|
|
|
_vm->_eventsManager.VBL();
|
2012-09-23 00:59:52 +00:00
|
|
|
} while (!doneFlag);
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_graphicsManager.ofscroll + 164,
|
|
|
|
107, 335, 215, _vm->_graphicsManager.VESA_BUFFER, _vm->_graphicsManager.ofscroll + 164, 107);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_graphicsManager.ofscroll + 164, 107,
|
|
|
|
_vm->_graphicsManager.ofscroll + 498, 320);
|
|
|
|
|
|
|
|
_vm->_globals.OPTION_SPR = _vm->_globals.dos_free2(_vm->_globals.OPTION_SPR);
|
|
|
|
_vm->_globals.OPTION_FLAG = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogsManager::showInventory() {
|
2012-12-10 06:54:03 +00:00
|
|
|
if (!VIRE_INVENT && !_inventDisplayedFl && !_vm->_globals.DESACTIVE_INVENT) {
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 1;
|
|
|
|
_vm->_objectsManager.FLAG_VISIBLE_EFFACE = 4;
|
2012-10-29 22:08:23 +00:00
|
|
|
_vm->_objectsManager.FLAG_VISIBLE = false;
|
2012-11-21 07:04:50 +00:00
|
|
|
for (int v1 = 0; v1 <= 1; v1++) {
|
2012-10-24 09:37:42 +00:00
|
|
|
INVENT_ANIM();
|
|
|
|
_vm->_eventsManager.XMOUSE();
|
|
|
|
_vm->_eventsManager.YMOUSE();
|
|
|
|
_vm->_eventsManager.VBL();
|
2012-11-21 07:04:50 +00:00
|
|
|
}
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_dialogsManager.Winventaire = g_PTRNUL;
|
|
|
|
|
|
|
|
LABEL_7:
|
|
|
|
_vm->_eventsManager.souris_bb = 0;
|
|
|
|
_vm->_eventsManager.souris_b = 0;
|
2012-10-28 21:38:34 +00:00
|
|
|
_vm->_globals.DESACTIVE_INVENT = true;
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100);
|
|
|
|
|
|
|
|
switch (_vm->_globals.FR) {
|
|
|
|
case 0:
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTAN.SPR");
|
2012-10-24 09:37:42 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTFR.SPR");
|
2012-10-24 09:37:42 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENTES.SPR");
|
2012-10-24 09:37:42 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-11-23 21:21:35 +00:00
|
|
|
Common::File f;
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!f.open(_vm->_globals.NFICHIER))
|
|
|
|
error("Error opening file - %s", _vm->_globals.NFICHIER.c_str());
|
|
|
|
|
2012-11-23 21:21:35 +00:00
|
|
|
size_t filesize = f.size();
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_dialogsManager.Winventaire = _vm->_globals.dos_malloc2(filesize);
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.readStream(f, _vm->_dialogsManager.Winventaire, filesize);
|
2012-10-24 09:37:42 +00:00
|
|
|
f.close();
|
|
|
|
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "INVENT2.SPR");
|
|
|
|
inventaire2 = _vm->_fileManager.loadFile(_vm->_globals.NFICHIER);
|
2012-12-10 06:54:03 +00:00
|
|
|
|
|
|
|
int v19 = _inventX = _vm->_graphicsManager.ofscroll + 152;
|
|
|
|
_inventY = 114;
|
|
|
|
int v18 = _inventWidth = _vm->_objectsManager.getWidth(_vm->_dialogsManager.Winventaire, 0);
|
|
|
|
int v17 = _inventHeight = _vm->_objectsManager.getHeight(_vm->_dialogsManager.Winventaire, 0);
|
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager.VESA_BUFFER, _vm->_dialogsManager.Winventaire,
|
|
|
|
v19 + 300, 414, 0, 0, 0, 0);
|
2012-11-23 21:21:35 +00:00
|
|
|
int v15 = 0;
|
|
|
|
int v4 = 0;
|
2012-11-21 07:04:50 +00:00
|
|
|
for (int v14 = 1; v14 <= 5; v14++) {
|
2012-11-23 21:21:35 +00:00
|
|
|
int v16 = 0;
|
2012-11-21 07:04:50 +00:00
|
|
|
for (int v5 = 1; v5 <= 6; v5++) {
|
2012-10-24 09:37:42 +00:00
|
|
|
++v4;
|
2012-11-23 21:21:35 +00:00
|
|
|
int v6 = _vm->_globals.INVENTAIRE[v4];
|
2012-10-24 09:37:42 +00:00
|
|
|
if (v6 && v4 <= 29) {
|
2012-11-23 21:21:35 +00:00
|
|
|
byte *v7 = _vm->_objectsManager.CAPTURE_OBJET(v6, 0);
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, v7, v19 + v16 + 6,
|
|
|
|
v15 + 120, _vm->_globals.OBJL, _vm->_globals.OBJH);
|
|
|
|
_vm->_globals.dos_free2(v7);
|
|
|
|
}
|
|
|
|
v16 += 54;
|
2012-11-21 07:04:50 +00:00
|
|
|
};
|
2012-10-24 09:37:42 +00:00
|
|
|
v15 += 38;
|
2012-11-21 07:04:50 +00:00
|
|
|
}
|
2012-12-10 06:54:03 +00:00
|
|
|
_vm->_graphicsManager.Capture_Mem(_vm->_graphicsManager.VESA_BUFFER, _vm->_dialogsManager.Winventaire, _inventX, _inventY, _inventWidth, _inventHeight);
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_eventsManager.souris_bb = 0;
|
2012-11-23 21:21:35 +00:00
|
|
|
bool v20 = false;
|
|
|
|
int v13 = 0;
|
2012-10-24 09:37:42 +00:00
|
|
|
|
|
|
|
// Main loop to select an inventory item
|
|
|
|
while (!_vm->shouldQuit()) {
|
|
|
|
// Turn on drawing the inventory dialog in the event manager
|
2012-12-10 06:54:03 +00:00
|
|
|
_inventDisplayedFl = true;
|
2012-10-24 09:37:42 +00:00
|
|
|
|
2012-11-23 21:21:35 +00:00
|
|
|
int v8 = _vm->_eventsManager.XMOUSE();
|
|
|
|
int v9 = _vm->_eventsManager.YMOUSE();
|
|
|
|
int v12 = _vm->_eventsManager.BMOUSE();
|
|
|
|
int v10 = v13;
|
|
|
|
int v11 = _vm->_linesManager.ZONE_OBJET(v8, v9);
|
2012-10-24 09:37:42 +00:00
|
|
|
v13 = v11;
|
|
|
|
if (v11 != v10)
|
|
|
|
_vm->_objectsManager.PARAMCADRE(v11);
|
|
|
|
if (_vm->_eventsManager.btsouris != 16) {
|
|
|
|
if ((uint16)(_vm->_eventsManager.btsouris - 1) > 1u) {
|
|
|
|
if (_vm->_eventsManager.btsouris != 3) {
|
|
|
|
if (v12 == 2) {
|
|
|
|
_vm->_objectsManager.OBJETPLUS(v13);
|
|
|
|
if (_vm->_eventsManager.btsouris != 23)
|
|
|
|
_vm->_eventsManager.CHANGE_MOUSE(_vm->_eventsManager.btsouris);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (v12 == 1) {
|
|
|
|
if (_vm->_eventsManager.btsouris == 1 || _vm->_eventsManager.btsouris == 16 || !_vm->_eventsManager.btsouris || (uint16)(_vm->_eventsManager.btsouris - 2) <= 1u)
|
|
|
|
break;
|
|
|
|
v9 = v13;
|
|
|
|
_vm->_objectsManager.VALID_OBJET(_vm->_globals.INVENTAIRE[v13]);
|
|
|
|
if (_vm->_eventsManager.btsouris == 8)
|
2012-11-23 21:21:35 +00:00
|
|
|
v20 = true;
|
|
|
|
if (!v20) {
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_scriptManager.TRAVAILOBJET = 1;
|
|
|
|
_vm->_globals.SAUVEGARDE->data[svField3] = _vm->_globals.OBJET_EN_COURS;
|
|
|
|
_vm->_globals.SAUVEGARDE->data[svField8] = _vm->_globals.INVENTAIRE[v13];
|
|
|
|
_vm->_globals.SAUVEGARDE->data[svField9] = _vm->_eventsManager.btsouris;
|
|
|
|
_vm->_objectsManager.OPTI_OBJET();
|
|
|
|
_vm->_scriptManager.TRAVAILOBJET = 0;
|
|
|
|
|
|
|
|
if (_vm->_soundManager.VOICEOFF == 1) {
|
|
|
|
do
|
|
|
|
_vm->_eventsManager.VBL();
|
|
|
|
while (!_vm->_globals.SORTIE && _vm->_eventsManager.BMOUSE() != 1);
|
|
|
|
_vm->_fontManager.TEXTE_OFF(9);
|
|
|
|
}
|
|
|
|
if (_vm->_globals.SORTIE) {
|
|
|
|
if (_vm->_globals.SORTIE == 2)
|
2012-11-23 21:21:35 +00:00
|
|
|
v20 = true;
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_globals.SORTIE = 0;
|
2012-11-23 21:21:35 +00:00
|
|
|
if (!v20) {
|
2012-10-24 09:37:42 +00:00
|
|
|
inventaire2 = _vm->_globals.dos_free2(inventaire2);
|
|
|
|
if (g_PTRNUL != _vm->_dialogsManager.Winventaire)
|
|
|
|
_vm->_dialogsManager.Winventaire = _vm->_globals.dos_free2(_vm->_dialogsManager.Winventaire);
|
|
|
|
goto LABEL_7;
|
|
|
|
}
|
2012-11-23 21:21:35 +00:00
|
|
|
} else if (!v20) {
|
2012-12-10 06:54:03 +00:00
|
|
|
_inventDisplayedFl = true;
|
2012-10-24 09:37:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-10-29 21:54:35 +00:00
|
|
|
if (VIRE_INVENT == true)
|
2012-11-23 21:21:35 +00:00
|
|
|
v20 = true;
|
|
|
|
if (v20)
|
2012-10-24 09:37:42 +00:00
|
|
|
break;
|
|
|
|
_vm->_eventsManager.VBL();
|
|
|
|
if ((uint16)(_vm->_globals.ECRAN - 35) <= 5u)
|
|
|
|
_vm->_objectsManager.SPECIAL_JEU();
|
|
|
|
}
|
|
|
|
_vm->_fontManager.TEXTE_OFF(9);
|
2012-12-10 06:54:03 +00:00
|
|
|
if (_inventDisplayedFl) {
|
|
|
|
_inventDisplayedFl = false;
|
2012-11-23 21:21:35 +00:00
|
|
|
// v9 = 114;
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, v19, 114, v18, v17, _vm->_graphicsManager.VESA_BUFFER, v19, 114);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(v19, 114, v19 + v18, v18 + 114);
|
2012-10-29 22:08:23 +00:00
|
|
|
_vm->_objectsManager.BOBTOUS = true;
|
2012-10-24 09:37:42 +00:00
|
|
|
}
|
|
|
|
if (_vm->_dialogsManager.Winventaire != g_PTRNUL)
|
|
|
|
_vm->_dialogsManager.Winventaire = _vm->_globals.dos_free2(_vm->_dialogsManager.Winventaire);
|
|
|
|
inventaire2 = _vm->_globals.dos_free2(inventaire2);
|
|
|
|
|
|
|
|
if (_vm->_eventsManager.btsouris == 1)
|
|
|
|
showOptionsDialog();
|
2012-12-10 06:54:03 +00:00
|
|
|
else if (_vm->_eventsManager.btsouris == 3)
|
|
|
|
_vm->_dialogsManager.showLoadGame();
|
|
|
|
else if (_vm->_eventsManager.btsouris == 2)
|
|
|
|
_vm->_dialogsManager.showSaveGame();
|
2012-10-27 09:19:21 +00:00
|
|
|
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_eventsManager.btsouris = 4;
|
|
|
|
_vm->_eventsManager.CHANGE_MOUSE(4);
|
|
|
|
_vm->_objectsManager.old_cady = 0;
|
|
|
|
_vm->_objectsManager.cady = 0;
|
|
|
|
_vm->_objectsManager.old_cadx = 0;
|
|
|
|
_vm->_objectsManager.cadx = 0;
|
2012-10-28 21:38:34 +00:00
|
|
|
_vm->_globals.DESACTIVE_INVENT = false;
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void DialogsManager::INVENT_ANIM() {
|
2012-11-28 10:03:11 +00:00
|
|
|
if (!_vm->_globals.DESACTIVE_INVENT) {
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_objectsManager.FLAG_VISIBLE_EFFACE && !_vm->_objectsManager.FLAG_VISIBLE) {
|
|
|
|
_vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_objectsManager.I_old_x, 27, 48, 38,
|
|
|
|
_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.I_old_x, 27);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65);
|
|
|
|
--_vm->_objectsManager.FLAG_VISIBLE_EFFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_vm->_objectsManager.FLAG_VISIBLE) {
|
|
|
|
if (_vm->_objectsManager.I_old_x <= 1)
|
|
|
|
_vm->_objectsManager.I_old_x = 2;
|
|
|
|
_vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_objectsManager.I_old_x, 27, 48, 38,
|
|
|
|
_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.I_old_x, 27);
|
|
|
|
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65);
|
2012-11-23 21:21:35 +00:00
|
|
|
int v0 = _vm->_graphicsManager.ofscroll + 2;
|
|
|
|
int v1 = _vm->_graphicsManager.ofscroll + 2;
|
2012-10-24 09:37:42 +00:00
|
|
|
_vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager.VESA_BUFFER, _vm->_globals.ICONE, v1 + 300, 327, 0);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(v1, 27, v1 + 45, 62);
|
|
|
|
_vm->_objectsManager.I_old_x = v0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_vm->_globals.SAUVEGARDE->data[svField357] == 1) {
|
|
|
|
if (_vm->_globals.SAUVEGARDE->data[svField353] == 1)
|
|
|
|
_vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager.VESA_BUFFER, _vm->_globals.TETE, 832, 325, 0, 0, 0, 0);
|
|
|
|
if (_vm->_globals.SAUVEGARDE->data[svField355] == 1)
|
|
|
|
_vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager.VESA_BUFFER, _vm->_globals.TETE, 866, 325, 1, 0, 0, 0);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(532, 25, 560, 60);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(566, 25, 594, 60);
|
|
|
|
}
|
|
|
|
if (_vm->_globals.SAUVEGARDE->data[svField356] == 1) {
|
|
|
|
_vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager.VESA_BUFFER, _vm->_globals.TETE, 832, 325, 0, 0, 0, 0);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(532, 25, 560, 60);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_vm->_globals.SAUVEGARDE->data[svField354] == 1) {
|
|
|
|
_vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager.VESA_BUFFER, _vm->_globals.TETE, 832, 325, 0, 0, 0, 0);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(532, 25, 560, 60);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-10 06:54:03 +00:00
|
|
|
/**
|
|
|
|
* Test dialog opening
|
|
|
|
*/
|
|
|
|
void DialogsManager::testDialogOpening() {
|
2012-10-24 09:37:42 +00:00
|
|
|
if (_vm->_globals.PLAN_FLAG)
|
2012-10-28 03:26:07 +00:00
|
|
|
_vm->_eventsManager.GAME_KEY = KEY_NONE;
|
|
|
|
|
|
|
|
if (_vm->_eventsManager.GAME_KEY != KEY_NONE) {
|
2012-10-24 09:37:42 +00:00
|
|
|
if (!INVENTFLAG) {
|
2012-10-28 11:17:55 +00:00
|
|
|
DIALOG_KEY key = _vm->_eventsManager.GAME_KEY;
|
2012-10-28 03:26:07 +00:00
|
|
|
_vm->_eventsManager.GAME_KEY = KEY_NONE;
|
2012-10-29 21:54:35 +00:00
|
|
|
INVENTFLAG = true;
|
2012-10-28 03:26:07 +00:00
|
|
|
|
|
|
|
switch (key) {
|
|
|
|
case KEY_INVENTORY:
|
|
|
|
_vm->_dialogsManager.showInventory();
|
|
|
|
break;
|
|
|
|
case KEY_OPTIONS:
|
2012-11-25 09:31:45 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 1;
|
2012-10-28 03:26:07 +00:00
|
|
|
_vm->_dialogsManager.showOptionsDialog();
|
2012-11-25 09:31:45 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 0;
|
2012-10-28 03:26:07 +00:00
|
|
|
break;
|
|
|
|
case KEY_LOAD:
|
2012-11-25 09:31:45 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 1;
|
2012-12-10 06:54:03 +00:00
|
|
|
_vm->_dialogsManager.showLoadGame();
|
2012-11-25 09:31:45 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 0;
|
2012-10-28 03:26:07 +00:00
|
|
|
break;
|
|
|
|
case KEY_SAVE:
|
2012-11-25 09:31:45 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 1;
|
2012-12-10 06:54:03 +00:00
|
|
|
_vm->_dialogsManager.showSaveGame();
|
2012-11-25 09:31:45 +00:00
|
|
|
_vm->_graphicsManager.no_scroll = 0;
|
2012-10-28 03:26:07 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-10-29 21:54:35 +00:00
|
|
|
INVENTFLAG = false;
|
2012-10-28 03:26:07 +00:00
|
|
|
_vm->_eventsManager.GAME_KEY = KEY_NONE;
|
2012-10-24 09:37:42 +00:00
|
|
|
}
|
|
|
|
}
|
2012-09-23 00:59:52 +00:00
|
|
|
}
|
|
|
|
|
2012-12-10 06:54:03 +00:00
|
|
|
/**
|
|
|
|
* Load Game dialog
|
|
|
|
*/
|
|
|
|
void DialogsManager::showLoadGame() {
|
2012-10-28 00:01:30 +00:00
|
|
|
int slotNumber;
|
2012-10-27 09:19:21 +00:00
|
|
|
|
|
|
|
_vm->_eventsManager.VBL();
|
2012-12-10 06:54:03 +00:00
|
|
|
showSaveLoad(2);
|
2012-10-27 09:19:21 +00:00
|
|
|
do {
|
|
|
|
do {
|
2012-12-10 06:54:03 +00:00
|
|
|
slotNumber = searchSavegames();
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_eventsManager.VBL();
|
|
|
|
} while (_vm->_eventsManager.BMOUSE() != 1);
|
2012-10-28 00:01:30 +00:00
|
|
|
} while (!slotNumber);
|
2012-10-29 22:08:23 +00:00
|
|
|
_vm->_objectsManager.SL_FLAG = false;
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x + 183, 60, 274, 353, _vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x + 183, 60);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_eventsManager.start_x + 183, 60, 457, 413);
|
2012-10-29 22:08:23 +00:00
|
|
|
_vm->_objectsManager.BOBTOUS = true;
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_SPR = _vm->_globals.dos_free2(_vm->_objectsManager.SL_SPR);
|
|
|
|
_vm->_objectsManager.SL_SPR2 = _vm->_globals.dos_free2(_vm->_objectsManager.SL_SPR2);
|
|
|
|
_vm->_objectsManager.SL_X = 0;
|
|
|
|
_vm->_objectsManager.SL_Y = 0;
|
2012-10-28 00:01:30 +00:00
|
|
|
|
|
|
|
if (slotNumber != 7) {
|
|
|
|
_vm->_saveLoadManager.restore(slotNumber);
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_vm->_objectsManager.CHANGE_OBJET(14);
|
|
|
|
}
|
|
|
|
|
2012-12-10 06:54:03 +00:00
|
|
|
/**
|
|
|
|
* Save Game dialog
|
|
|
|
*/
|
|
|
|
void DialogsManager::showSaveGame() {
|
2012-10-27 09:19:21 +00:00
|
|
|
int slotNumber;
|
2012-10-27 11:16:54 +00:00
|
|
|
Common::String saveName;
|
2012-10-27 09:19:21 +00:00
|
|
|
|
|
|
|
_vm->_eventsManager.VBL();
|
2012-10-27 11:16:54 +00:00
|
|
|
|
2012-12-10 06:54:03 +00:00
|
|
|
showSaveLoad(1);
|
2012-10-27 09:19:21 +00:00
|
|
|
do {
|
|
|
|
do {
|
2012-12-10 06:54:03 +00:00
|
|
|
slotNumber = searchSavegames();
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_eventsManager.VBL();
|
2012-10-27 11:16:54 +00:00
|
|
|
} while (!_vm->shouldQuit() && _vm->_eventsManager.BMOUSE() != 1);
|
|
|
|
} while (!_vm->shouldQuit() && !slotNumber);
|
|
|
|
|
2012-10-29 22:08:23 +00:00
|
|
|
_vm->_objectsManager.SL_FLAG = false;
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x + 183, 60, 274, 353, _vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x + 183, 60);
|
|
|
|
_vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_eventsManager.start_x + 183, 60, _vm->_eventsManager.start_x + 457, 413);
|
2012-10-29 22:08:23 +00:00
|
|
|
_vm->_objectsManager.BOBTOUS = true;
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_SPR = _vm->_globals.dos_free2(_vm->_objectsManager.SL_SPR);
|
|
|
|
_vm->_objectsManager.SL_SPR2 = _vm->_globals.dos_free2(_vm->_objectsManager.SL_SPR2);
|
|
|
|
_vm->_objectsManager.SL_X = 0;
|
|
|
|
_vm->_objectsManager.SL_Y = 0;
|
|
|
|
|
|
|
|
if (slotNumber != 7) {
|
2012-10-27 11:16:54 +00:00
|
|
|
// Since the original GUI doesn't support save names, use a default name
|
|
|
|
saveName = Common::String::format("Save #%d", slotNumber);
|
|
|
|
|
|
|
|
// Save the game
|
|
|
|
_vm->_saveLoadManager.save(slotNumber, saveName);
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-10 06:54:03 +00:00
|
|
|
/**
|
|
|
|
* Load/Save dialog
|
|
|
|
*/
|
|
|
|
void DialogsManager::showSaveLoad(int a1) {
|
2012-10-27 11:16:54 +00:00
|
|
|
int slotNumber;
|
|
|
|
hopkinsSavegameHeader header;
|
|
|
|
byte *thumb;
|
2012-10-27 09:19:21 +00:00
|
|
|
|
|
|
|
switch (_vm->_globals.FR) {
|
|
|
|
case 0:
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEAN.SPR");
|
2012-10-27 09:19:21 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEFR.SPR");
|
2012-10-27 09:19:21 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVEES.SPR");
|
2012-10-27 09:19:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
_vm->_objectsManager.SL_SPR = _vm->_objectsManager.CHARGE_SPRITE(_vm->_globals.NFICHIER);
|
2012-12-09 19:22:12 +00:00
|
|
|
_vm->_fileManager.constructFilename(_vm->_globals.HOPSYSTEM, "SAVE2.SPR");
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_SPR2 = _vm->_objectsManager.CHARGE_SPRITE(_vm->_globals.NFICHIER);
|
|
|
|
_vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.SL_SPR, _vm->_eventsManager.start_x + 483, 360, 0);
|
|
|
|
|
|
|
|
if (_vm->_globals.FR) {
|
|
|
|
if (a1 == 1)
|
|
|
|
_vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.SL_SPR, _vm->_eventsManager.start_x + 525, 375, 1);
|
|
|
|
if (a1 == 2)
|
|
|
|
_vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.SL_SPR, _vm->_eventsManager.start_x + 515, 375, 2);
|
|
|
|
} else {
|
|
|
|
if (a1 == 1)
|
|
|
|
_vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.SL_SPR, _vm->_eventsManager.start_x + 535, 372, 1);
|
|
|
|
if (a1 == 2)
|
|
|
|
_vm->_graphicsManager.Sprite_Vesa(_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.SL_SPR, _vm->_eventsManager.start_x + 539, 372, 2);
|
|
|
|
}
|
|
|
|
|
2012-10-27 11:16:54 +00:00
|
|
|
for (slotNumber = 1; slotNumber <= 6; ++slotNumber) {
|
|
|
|
if (_vm->_saveLoadManager.readSavegameHeader(slotNumber, header)) {
|
2012-11-30 12:15:47 +00:00
|
|
|
Graphics::Surface thumb8;
|
|
|
|
_vm->_saveLoadManager.convertThumb16To8(header.thumbnail, &thumb8);
|
|
|
|
|
|
|
|
thumb = (byte *)thumb8.pixels;
|
2012-10-27 11:16:54 +00:00
|
|
|
|
|
|
|
switch (slotNumber) {
|
|
|
|
case 1:
|
|
|
|
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, thumb, _vm->_eventsManager.start_x + 190, 112, 0x80u, 87);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, thumb, _vm->_eventsManager.start_x + 323, 112, 0x80u, 87);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, thumb, _vm->_eventsManager.start_x + 190, 203, 0x80u, 87);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, thumb, _vm->_eventsManager.start_x + 323, 203, 0x80u, 87);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, thumb, _vm->_eventsManager.start_x + 190, 294, 0x80u, 87);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, thumb, _vm->_eventsManager.start_x + 323, 294, 0x80u, 87);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2012-11-30 12:15:47 +00:00
|
|
|
thumb8.free();
|
|
|
|
header.thumbnail->free();
|
2012-10-27 11:16:54 +00:00
|
|
|
delete header.thumbnail;
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
2012-10-27 11:16:54 +00:00
|
|
|
}
|
|
|
|
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_graphicsManager.Capture_Mem(_vm->_graphicsManager.VESA_BUFFER, _vm->_objectsManager.SL_SPR, _vm->_eventsManager.start_x + 183, 60, 0x112u, 353);
|
2012-10-29 22:08:23 +00:00
|
|
|
_vm->_objectsManager.SL_FLAG = true;
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_MODE = a1;
|
|
|
|
_vm->_objectsManager.SL_X = 0;
|
|
|
|
_vm->_objectsManager.SL_Y = 0;
|
|
|
|
}
|
|
|
|
|
2012-12-10 06:54:03 +00:00
|
|
|
/**
|
|
|
|
* Search savegames
|
|
|
|
*/
|
|
|
|
int DialogsManager::searchSavegames() {
|
|
|
|
int slotNumber = 0;
|
|
|
|
int xp = _vm->_eventsManager.XMOUSE();
|
|
|
|
int yp = _vm->_eventsManager.YMOUSE();
|
2012-10-27 09:19:21 +00:00
|
|
|
|
|
|
|
_vm->_graphicsManager.ofscroll = _vm->_eventsManager.start_x;
|
2012-10-27 11:16:54 +00:00
|
|
|
if ((uint16)(yp - 112) <= 0x56u) {
|
|
|
|
if (xp > _vm->_eventsManager.start_x + 189 && xp < _vm->_eventsManager.start_x + 318)
|
|
|
|
slotNumber = 1;
|
|
|
|
if ((uint16)(yp - 112) <= 0x56u && xp > _vm->_graphicsManager.ofscroll + 322 && xp < _vm->_graphicsManager.ofscroll + 452)
|
|
|
|
slotNumber = 2;
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
2012-10-27 11:16:54 +00:00
|
|
|
if ((uint16)(yp - 203) <= 0x56u) {
|
|
|
|
if (xp > _vm->_graphicsManager.ofscroll + 189 && xp < _vm->_graphicsManager.ofscroll + 318)
|
|
|
|
slotNumber = 3;
|
|
|
|
if ((uint16)(yp - 203) <= 0x56u && xp > _vm->_graphicsManager.ofscroll + 322 && xp < _vm->_graphicsManager.ofscroll + 452)
|
|
|
|
slotNumber = 4;
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
2012-10-27 11:16:54 +00:00
|
|
|
if ((uint16)(yp - 294) <= 0x56u) {
|
|
|
|
if (xp > _vm->_graphicsManager.ofscroll + 189 && xp < _vm->_graphicsManager.ofscroll + 318)
|
|
|
|
slotNumber = 5;
|
|
|
|
if ((uint16)(yp - 294) <= 0x56u && xp > _vm->_graphicsManager.ofscroll + 322 && xp < _vm->_graphicsManager.ofscroll + 452)
|
|
|
|
slotNumber = 6;
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
2012-10-27 11:16:54 +00:00
|
|
|
if ((uint16)(yp - 388) <= 0x10u && xp > _vm->_graphicsManager.ofscroll + 273 && xp < _vm->_graphicsManager.ofscroll + 355)
|
|
|
|
slotNumber = 7;
|
2012-11-21 21:42:51 +00:00
|
|
|
|
|
|
|
switch (slotNumber) {
|
|
|
|
case 1:
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_X = 189;
|
|
|
|
_vm->_objectsManager.SL_Y = 111;
|
2012-11-21 21:42:51 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_X = 322;
|
|
|
|
_vm->_objectsManager.SL_Y = 111;
|
2012-11-21 21:42:51 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_X = 189;
|
|
|
|
_vm->_objectsManager.SL_Y = 202;
|
2012-11-21 21:42:51 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_X = 322;
|
|
|
|
_vm->_objectsManager.SL_Y = 202;
|
2012-11-21 21:42:51 +00:00
|
|
|
break;
|
|
|
|
case 5:
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_X = 189;
|
|
|
|
_vm->_objectsManager.SL_Y = 293;
|
2012-11-21 21:42:51 +00:00
|
|
|
break;
|
|
|
|
case 6:
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_X = 322;
|
|
|
|
_vm->_objectsManager.SL_Y = 293;
|
2012-11-21 21:42:51 +00:00
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
case 7:
|
2012-10-27 09:19:21 +00:00
|
|
|
_vm->_objectsManager.SL_X = 0;
|
|
|
|
_vm->_objectsManager.SL_Y = 0;
|
2012-11-21 21:42:51 +00:00
|
|
|
break;
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
2012-10-27 11:16:54 +00:00
|
|
|
return slotNumber;
|
2012-10-27 09:19:21 +00:00
|
|
|
}
|
|
|
|
|
2012-09-23 00:59:52 +00:00
|
|
|
} // End of namespace Hopkins
|