2018-02-13 03:10:24 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "xeen/swordsofxeen/swordsofxeen.h"
|
2018-03-04 03:00:57 +00:00
|
|
|
#include "xeen/swordsofxeen/swordsofxeen_menu.h"
|
2018-02-13 03:10:24 +00:00
|
|
|
|
|
|
|
namespace Xeen {
|
|
|
|
namespace SwordsOfXeen {
|
|
|
|
|
|
|
|
SwordsOfXeenEngine::SwordsOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
|
|
|
|
: XeenEngine(syst, gameDesc) {
|
|
|
|
}
|
|
|
|
|
2018-02-27 00:15:00 +00:00
|
|
|
void SwordsOfXeenEngine::showMainMenu() {
|
2018-03-04 03:00:57 +00:00
|
|
|
MainMenu::show(this);
|
2018-02-13 03:10:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwordsOfXeenEngine::death() {
|
2018-02-24 20:42:58 +00:00
|
|
|
Windows &windows = *g_vm->_windows;
|
|
|
|
|
|
|
|
_screen->loadBackground("blank.raw");
|
|
|
|
windows[28].setBounds(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
|
|
|
|
_screen->fadeIn(0x81);
|
|
|
|
_screen->loadPalette("scr.pal");
|
|
|
|
_screen->fadeIn(0x81);
|
|
|
|
|
|
|
|
SpriteResource lose("lose.int");
|
|
|
|
lose.draw(0, 0, Common::Point(0, 0));
|
|
|
|
lose.draw(0, 1, Common::Point(160, 0));
|
|
|
|
_sound->playSound("laff1.voc");
|
|
|
|
|
|
|
|
bool breakFlag = false;
|
2018-03-18 00:27:42 +00:00
|
|
|
for (int idx = 0, idx2 = 0; idx < (_files->_ccNum ? 10 : 23); ++idx) {
|
2018-02-24 20:42:58 +00:00
|
|
|
_events->updateGameCounter();
|
|
|
|
|
2018-03-18 00:27:42 +00:00
|
|
|
if (_files->_ccNum) {
|
2018-02-24 20:42:58 +00:00
|
|
|
breakFlag = _events->wait(2);
|
|
|
|
} else {
|
|
|
|
if (idx == 1 || idx == 11)
|
|
|
|
_sound->playFX(33);
|
|
|
|
breakFlag = _events->wait(2);
|
|
|
|
|
|
|
|
if (idx == 15)
|
|
|
|
_sound->playFX(34);
|
|
|
|
}
|
|
|
|
|
2018-03-18 00:27:42 +00:00
|
|
|
if ((_files->_ccNum ? 9 : 10) == idx) {
|
|
|
|
if ((_files->_ccNum ? 2 : 1) > idx2) {
|
2018-02-24 20:42:58 +00:00
|
|
|
// Restart loop
|
|
|
|
idx = -1;
|
|
|
|
++idx2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wait for press
|
|
|
|
if (!breakFlag)
|
|
|
|
_events->waitForPress();
|
|
|
|
|
|
|
|
_screen->fadeOut(4);
|
|
|
|
_screen->loadBackground("blank.raw");
|
|
|
|
_screen->loadPalette("dark.pal");
|
|
|
|
_sound->stopAllAudio();
|
2018-02-13 03:10:24 +00:00
|
|
|
}
|
|
|
|
|
2018-03-27 23:14:13 +00:00
|
|
|
bool SwordsOfXeenEngine::showEnding() {
|
|
|
|
Windows &windows = *_windows;
|
|
|
|
SpriteResource win("win.int");
|
|
|
|
|
|
|
|
_screen->loadBackground("blank.raw");
|
|
|
|
windows[28].setBounds(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
|
|
|
|
_screen->fadeIn(0x81);
|
|
|
|
_screen->loadPalette("scr.pal");
|
|
|
|
_screen->fadeIn(0x81);
|
|
|
|
|
|
|
|
win.draw(0, 0, Common::Point(0, 0));
|
|
|
|
win.draw(0, 1, Common::Point(160, 0));
|
|
|
|
_sound->playSound("ch1.voc");
|
|
|
|
_events->waitForPress();
|
|
|
|
|
|
|
|
_screen->fadeOut();
|
|
|
|
_screen->loadBackground("blank.raw");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-02-14 02:33:02 +00:00
|
|
|
void SwordsOfXeenEngine::dream() {
|
2018-02-24 20:50:23 +00:00
|
|
|
// Swords of Xeen doesn't have any dreams
|
2018-02-14 02:33:02 +00:00
|
|
|
}
|
|
|
|
|
2018-02-13 03:10:24 +00:00
|
|
|
void SwordsOfXeenEngine::showCutscene(const Common::String &name, int status, uint score) {
|
2018-03-27 23:14:13 +00:00
|
|
|
_sound->stopAllAudio();
|
|
|
|
_events->clearEvents();
|
|
|
|
|
|
|
|
if (name != "ENDGAME")
|
|
|
|
error("Unknown cutscene specified");
|
|
|
|
|
|
|
|
showEnding();
|
|
|
|
|
|
|
|
_screen->freePages();
|
|
|
|
_sound->stopAllAudio();
|
|
|
|
_events->clearEvents();
|
2018-02-27 00:15:00 +00:00
|
|
|
_gameMode = GMODE_MENU;
|
2018-03-27 23:14:13 +00:00
|
|
|
|
2018-02-13 03:10:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace SwordsOfXeen
|
|
|
|
} // End of namespace Xeen
|