mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-01 05:11:09 +00:00
1. Replaced the $Header$ tags in the Kyra files
2. Added code to let the player skip past dialogue by leftclicking or hitting '.' 3. Removed the waitTicks() function and replaced all usage with delay() 4. Corrected various speed issues, the intro should run at the correct pace now 5. Talkie versions will no longer display the story screen during the intro, as in the original. 6. Moved the delay() function adjacent to other delay functions. svn-id: r20438
This commit is contained in:
parent
56d918edbe
commit
60bbd5e470
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
232
kyra/kyra.cpp
232
kyra/kyra.cpp
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -347,7 +348,6 @@ int KyraEngine::init(GameDetector &detector) {
|
||||
|
||||
memset(_flagsTable, 0, sizeof(_flagsTable));
|
||||
|
||||
_fastMode = false;
|
||||
_abortWalkFlag = false;
|
||||
_abortWalkFlag2 = false;
|
||||
_talkingCharNum = -1;
|
||||
@ -416,6 +416,9 @@ int KyraEngine::init(GameDetector &detector) {
|
||||
|
||||
_lastMusicCommand = 0;
|
||||
|
||||
_gameSpeed = 60;
|
||||
_tickLength = (uint8)(1000.0 / _gameSpeed);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -553,9 +556,6 @@ void KyraEngine::startup() {
|
||||
_animator->initAnimStateList();
|
||||
setCharactersInDefaultScene();
|
||||
|
||||
_gameSpeed = 50;
|
||||
_tickLength = (uint8)(1000.0 / _gameSpeed);
|
||||
|
||||
if (!_scriptInterpreter->loadScript("_STARTUP.EMC", _npcScriptData, _opcodeTable, _opcodeTableSize, 0)) {
|
||||
error("Could not load \"_STARTUP.EMC\" script");
|
||||
}
|
||||
@ -576,7 +576,7 @@ void KyraEngine::startup() {
|
||||
snd_setSoundEffectFile(1);
|
||||
enterNewScene(_currentCharacter->sceneId, _currentCharacter->facing, 0, 0, 1);
|
||||
|
||||
if (_abortIntroFlag && _skipIntroFlag) {
|
||||
if (_abortIntroFlag && _skipFlag) {
|
||||
_menuDirectlyToLoad = true;
|
||||
_screen->setMouseCursor(1, 1, _shapes[4]);
|
||||
buttonMenuCallback(0);
|
||||
@ -585,116 +585,13 @@ void KyraEngine::startup() {
|
||||
saveGame(getSavegameFilename(0), "New game");
|
||||
}
|
||||
|
||||
void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
|
||||
OSystem::Event event;
|
||||
char saveLoadSlot[20];
|
||||
char savegameName[14];
|
||||
|
||||
_mousePressFlag = false;
|
||||
uint32 start = _system->getMillis();
|
||||
do {
|
||||
while (_system->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case OSystem::EVENT_KEYDOWN:
|
||||
if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
|
||||
(event.kbd.flags == OSystem::KBD_CTRL || event.kbd.flags == OSystem::KBD_ALT) && isMainLoop) {
|
||||
sprintf(saveLoadSlot, "%s.00%d", _targetName.c_str(), event.kbd.keycode - '0');
|
||||
if (event.kbd.flags == OSystem::KBD_CTRL)
|
||||
loadGame(saveLoadSlot);
|
||||
else {
|
||||
sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0');
|
||||
saveGame(saveLoadSlot, savegameName);
|
||||
}
|
||||
} else if (event.kbd.flags == OSystem::KBD_CTRL) {
|
||||
if (event.kbd.keycode == 'f')
|
||||
_fastMode = !_fastMode;
|
||||
else if (event.kbd.keycode == 'd')
|
||||
_debugger->attach();
|
||||
else if (event.kbd.keycode == 'q')
|
||||
_quitFlag = true;
|
||||
}
|
||||
break;
|
||||
case OSystem::EVENT_MOUSEMOVE:
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
_system->updateScreen();
|
||||
break;
|
||||
case OSystem::EVENT_QUIT:
|
||||
quitGame();
|
||||
break;
|
||||
case OSystem::EVENT_LBUTTONDOWN:
|
||||
_mousePressFlag = true;
|
||||
if (_abortWalkFlag2) {
|
||||
_abortWalkFlag = true;
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
}
|
||||
if (_handleInput) {
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
_handleInput = false;
|
||||
processInput(_mouseX, _mouseY);
|
||||
_handleInput = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_debugger->isAttached())
|
||||
_debugger->onFrame();
|
||||
|
||||
_sprites->updateSceneAnims();
|
||||
if (update)
|
||||
_animator->updateAllObjectShapes();
|
||||
|
||||
if (_currentCharacter->sceneId == 210) {
|
||||
_animator->updateKyragemFading();
|
||||
}
|
||||
|
||||
if (amount > 0) {
|
||||
_system->delayMillis((amount > 10) ? 10 : amount);
|
||||
}
|
||||
} while (!_fastMode && _system->getMillis() < start + amount);
|
||||
}
|
||||
|
||||
void KyraEngine::waitForEvent() {
|
||||
bool finished = false;
|
||||
OSystem::Event event;
|
||||
while (!finished) {
|
||||
while (_system->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case OSystem::EVENT_KEYDOWN:
|
||||
finished = true;
|
||||
break;
|
||||
case OSystem::EVENT_MOUSEMOVE:
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
break;
|
||||
case OSystem::EVENT_QUIT:
|
||||
quitGame();
|
||||
break;
|
||||
case OSystem::EVENT_LBUTTONDOWN:
|
||||
finished = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_debugger->isAttached())
|
||||
_debugger->onFrame();
|
||||
|
||||
_system->delayMillis(10);
|
||||
}
|
||||
}
|
||||
|
||||
void KyraEngine::mainLoop() {
|
||||
debug(9, "KyraEngine::mainLoop()");
|
||||
|
||||
while (!_quitFlag) {
|
||||
int32 frameTime = (int32)_system->getMillis();
|
||||
_skipFlag = false;
|
||||
|
||||
if (_currentCharacter->sceneId == 210) {
|
||||
_animator->updateKyragemFading();
|
||||
if (seq_playEnd()) {
|
||||
@ -746,37 +643,120 @@ void KyraEngine::quitGame() {
|
||||
_system->quit();
|
||||
}
|
||||
|
||||
void KyraEngine::waitTicks(int ticks) {
|
||||
debug(9, "KyraEngine::waitTicks(%d)", ticks);
|
||||
const uint32 end = _system->getMillis() + ticks * 1000 / 60;
|
||||
void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
|
||||
OSystem::Event event;
|
||||
char saveLoadSlot[20];
|
||||
char savegameName[14];
|
||||
|
||||
_mousePressFlag = false;
|
||||
uint32 start = _system->getMillis();
|
||||
do {
|
||||
OSystem::Event event;
|
||||
while (_system->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case OSystem::EVENT_KEYDOWN:
|
||||
if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
|
||||
(event.kbd.flags == OSystem::KBD_CTRL || event.kbd.flags == OSystem::KBD_ALT) && isMainLoop) {
|
||||
sprintf(saveLoadSlot, "%s.00%d", _targetName.c_str(), event.kbd.keycode - '0');
|
||||
if (event.kbd.flags == OSystem::KBD_CTRL)
|
||||
loadGame(saveLoadSlot);
|
||||
else {
|
||||
sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0');
|
||||
saveGame(saveLoadSlot, savegameName);
|
||||
}
|
||||
} else if (event.kbd.flags == OSystem::KBD_CTRL) {
|
||||
if (event.kbd.keycode == 'd')
|
||||
_debugger->attach();
|
||||
else if (event.kbd.keycode == 'q')
|
||||
_quitFlag = true;
|
||||
} else if (event.kbd.keycode == '.')
|
||||
_skipFlag = true;
|
||||
else if (event.kbd.keycode == 13 || event.kbd.keycode == 32 || event.kbd.keycode == 27) {
|
||||
_abortIntroFlag = true;
|
||||
_skipFlag = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case OSystem::EVENT_MOUSEMOVE:
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
_system->updateScreen();
|
||||
break;
|
||||
case OSystem::EVENT_QUIT:
|
||||
_quitFlag = true;
|
||||
quitGame();
|
||||
break;
|
||||
case OSystem::EVENT_KEYDOWN:
|
||||
if (event.kbd.flags == OSystem::KBD_CTRL) {
|
||||
if (event.kbd.keycode == 'f') {
|
||||
_fastMode = !_fastMode;
|
||||
}
|
||||
} else if (event.kbd.keycode == 13 || event.kbd.keycode == 32 || event.kbd.keycode == 27) {
|
||||
_abortIntroFlag = true;
|
||||
case OSystem::EVENT_LBUTTONDOWN:
|
||||
_mousePressFlag = true;
|
||||
if (_abortWalkFlag2) {
|
||||
_abortWalkFlag = true;
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
}
|
||||
if (_handleInput) {
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
_handleInput = false;
|
||||
processInput(_mouseX, _mouseY);
|
||||
_handleInput = true;
|
||||
} else
|
||||
_skipFlag = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_debugger->isAttached())
|
||||
_debugger->onFrame();
|
||||
|
||||
if (update)
|
||||
_sprites->updateSceneAnims();
|
||||
_animator->updateAllObjectShapes();
|
||||
|
||||
if (_currentCharacter && _currentCharacter->sceneId == 210) {
|
||||
_animator->updateKyragemFading();
|
||||
}
|
||||
|
||||
if (amount > 0 && !_skipFlag) {
|
||||
_system->delayMillis((amount > 10) ? 10 : amount);
|
||||
}
|
||||
} while (!_skipFlag && _system->getMillis() < start + amount);
|
||||
|
||||
}
|
||||
|
||||
void KyraEngine::waitForEvent() {
|
||||
bool finished = false;
|
||||
OSystem::Event event;
|
||||
while (!finished) {
|
||||
while (_system->pollEvent(event)) {
|
||||
switch (event.type) {
|
||||
case OSystem::EVENT_KEYDOWN:
|
||||
finished = true;
|
||||
break;
|
||||
case OSystem::EVENT_MOUSEMOVE:
|
||||
_mouseX = event.mouse.x;
|
||||
_mouseY = event.mouse.y;
|
||||
break;
|
||||
case OSystem::EVENT_QUIT:
|
||||
quitGame();
|
||||
break;
|
||||
case OSystem::EVENT_LBUTTONDOWN:
|
||||
finished = true;
|
||||
_skipFlag = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (_debugger->isAttached())
|
||||
_debugger->onFrame();
|
||||
|
||||
_system->delayMillis(10);
|
||||
} while (!_fastMode && _system->getMillis() < end);
|
||||
}
|
||||
}
|
||||
|
||||
void KyraEngine::delayWithTicks(int ticks) {
|
||||
uint32 nextTime = _system->getMillis() + ticks * _tickLength;
|
||||
while (_system->getMillis() < nextTime) {
|
||||
while (_system->getMillis() < nextTime && !_skipFlag) {
|
||||
_sprites->updateSceneAnims();
|
||||
_animator->updateAllObjectShapes();
|
||||
if (_currentCharacter->sceneId == 210) {
|
||||
@ -1247,7 +1227,7 @@ int KyraEngine::handleMalcolmFlag() {
|
||||
while (_system->getMillis() < timer2) {}
|
||||
}
|
||||
snd_playWanderScoreViaMap(51, 1);
|
||||
waitTicks(60);
|
||||
delay(60*_tickLength);
|
||||
_malcolmFlag = 0;
|
||||
return 1;
|
||||
break;
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -266,6 +267,7 @@ public:
|
||||
const uint8 **palTable2() { return const_cast<const uint8 **>(&_specialPalettes[29]); }
|
||||
|
||||
bool seq_skipSequence() const;
|
||||
void delay(uint32 millis, bool update = false, bool mainLoop = false);
|
||||
void quitGame();
|
||||
void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData);
|
||||
|
||||
@ -600,7 +602,6 @@ protected:
|
||||
void res_freeLangTable(char ***sting, int *size);
|
||||
|
||||
void waitForEvent();
|
||||
void delay(uint32 millis, bool update = false, bool mainLoop = false);
|
||||
void loadPalette(const char *filename, uint8 *palData);
|
||||
void loadMouseShapes();
|
||||
void loadCharacterShapes();
|
||||
@ -676,8 +677,8 @@ protected:
|
||||
void gui_restorePalette();
|
||||
|
||||
uint8 _game;
|
||||
bool _fastMode;
|
||||
bool _quitFlag;
|
||||
bool _skipFlag;
|
||||
bool _skipIntroFlag;
|
||||
bool _abortIntroFlag;
|
||||
bool _menuDirectlyToLoad;
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -225,7 +226,8 @@ void Screen::fadePalette(const uint8 *palData, int delay) {
|
||||
}
|
||||
setScreenPalette(fadePal);
|
||||
_system->updateScreen();
|
||||
_system->delayMillis((delayAcc >> 8) * 1000 / 60);
|
||||
//_system->delayMillis((delayAcc >> 8) * 1000 / 60);
|
||||
_vm->delay((delayAcc >> 8) * 1000 / 60);
|
||||
delayAcc &= 0xFF;
|
||||
}
|
||||
}
|
||||
@ -416,7 +418,10 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag
|
||||
SWAP(y_offs[y], y_offs[i]);
|
||||
}
|
||||
|
||||
int32 start, now;
|
||||
int wait;
|
||||
for (y = 0; y < h; ++y) {
|
||||
start = (int32)_system->getMillis();
|
||||
int y_cur = y;
|
||||
for (x = 0; x < w; ++x) {
|
||||
int i = sx + x_offs[x];
|
||||
@ -431,7 +436,11 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag
|
||||
}
|
||||
}
|
||||
updateScreen();
|
||||
_system->delayMillis(ticks * 1000 / 60);
|
||||
now = (int32)_system->getMillis();
|
||||
wait = ticks * _vm->tickLength() - (now - start);
|
||||
if (wait > 0) {
|
||||
_vm->delay(wait);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -40,14 +41,7 @@ int KyraEngine::cmd_magicInMouseItem(ScriptState *script) {
|
||||
}
|
||||
|
||||
int KyraEngine::cmd_characterSays(ScriptState *script) {
|
||||
// Japanese version?
|
||||
/*const char *str1 = "âuâëâôââôüAé?é¢ùêé¢é+é®üH";
|
||||
const char *str2 = "âuâëâôâ\\âôüAé?é¢ùêé¢é+é®üH";
|
||||
|
||||
if (strcmp(stackPosString(0), str1) == 0)
|
||||
characterSays((char *)str2, stackPos(1), stackPos(2));
|
||||
else*/
|
||||
|
||||
_skipFlag = false;
|
||||
if (_features & GF_TALKIE) {
|
||||
debug(3, "cmd_characterSays(0x%X) (%d, '%s', %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
|
||||
snd_voiceWaitForFinish();
|
||||
@ -351,8 +345,9 @@ int KyraEngine::cmd_setBrandonStatusBit(ScriptState *script) {
|
||||
|
||||
int KyraEngine::cmd_pauseSeconds(ScriptState *script) {
|
||||
debug(3, "cmd_pauseSeconds(0x%X) (%d)", script, stackPos(0));
|
||||
if (stackPos(0) > 0)
|
||||
if (stackPos(0) > 0 && !_skipFlag)
|
||||
delay(stackPos(0)*1000, true);
|
||||
_skipFlag = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -489,7 +484,7 @@ int KyraEngine::cmd_displayWSAFrame(ScriptState *script) {
|
||||
_movieObjects[wsaIndex]->displayFrame(frame);
|
||||
_animator->_updateScreen = true;
|
||||
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
|
||||
while (_system->getMillis() < continueTime) {
|
||||
while (_system->getMillis() < continueTime && !_skipFlag) {
|
||||
_sprites->updateSceneAnims();
|
||||
_animator->updateAllObjectShapes();
|
||||
if (continueTime - _system->getMillis() >= 10)
|
||||
@ -617,12 +612,14 @@ int KyraEngine::cmd_customPrintTalkString(ScriptState *script) {
|
||||
debug(3, "cmd_customPrintTalkString(0x%X) (%d, '%s', %d, %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
|
||||
snd_voiceWaitForFinish();
|
||||
snd_playVoiceFile(stackPos(0));
|
||||
_skipFlag = false;
|
||||
_text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2);
|
||||
} else {
|
||||
debug(3, "cmd_customPrintTalkString(0x%X) ('%s', %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF);
|
||||
_skipFlag = false;
|
||||
_text->printTalkTextMessage(stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF, 0, 2);
|
||||
}
|
||||
_animator->_updateScreen = true;
|
||||
_screen->updateScreen();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -755,7 +752,7 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) {
|
||||
_movieObjects[wsaIndex]->displayFrame(frame);
|
||||
_animator->_updateScreen = true;
|
||||
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
|
||||
while (_system->getMillis() < continueTime) {
|
||||
while (_system->getMillis() < continueTime && !_skipFlag) {
|
||||
_sprites->updateSceneAnims();
|
||||
_animator->updateAllObjectShapes();
|
||||
if (continueTime - _system->getMillis() >= 10)
|
||||
@ -769,7 +766,7 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) {
|
||||
_movieObjects[wsaIndex]->displayFrame(frame);
|
||||
_animator->_updateScreen = true;
|
||||
uint32 continueTime = waitTime * _tickLength + _system->getMillis();
|
||||
while (_system->getMillis() < continueTime) {
|
||||
while (_system->getMillis() < continueTime && !_skipFlag) {
|
||||
_sprites->updateSceneAnims();
|
||||
_animator->updateAllObjectShapes();
|
||||
if (continueTime - _system->getMillis() >= 10)
|
||||
@ -778,7 +775,10 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) {
|
||||
--frame;
|
||||
}
|
||||
}
|
||||
++curTime;
|
||||
if (!_skipFlag)
|
||||
break;
|
||||
else
|
||||
++curTime;
|
||||
}
|
||||
_screen->showMouse();
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -170,7 +171,7 @@ void SeqPlayer::s1_drawShape() {
|
||||
|
||||
void SeqPlayer::s1_waitTicks() {
|
||||
uint16 ticks = READ_LE_UINT16(_seqData); _seqData += 2;
|
||||
_vm->waitTicks(ticks);
|
||||
_vm->delay(ticks);
|
||||
}
|
||||
|
||||
void SeqPlayer::s1_copyWaitTicks() {
|
||||
@ -373,7 +374,7 @@ void SeqPlayer::s1_fillRect() {
|
||||
|
||||
void SeqPlayer::s1_playEffect() {
|
||||
uint8 track = *_seqData++;
|
||||
_vm->waitTicks(3);
|
||||
_vm->delay(3 * _vm->tickLength());
|
||||
_sound->playSoundEffect(track);
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -43,7 +44,7 @@ void KyraEngine::seq_demo() {
|
||||
_screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0);
|
||||
_system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
|
||||
_screen->fadeFromBlack();
|
||||
waitTicks(60);
|
||||
delay(60 * _tickLength);
|
||||
_screen->fadeToBlack();
|
||||
|
||||
_screen->clearPage(0);
|
||||
@ -55,8 +56,7 @@ void KyraEngine::seq_demo() {
|
||||
_screen->fadeFromBlack();
|
||||
|
||||
_seq->playSequence(_seq_WestwoodLogo, true);
|
||||
waitTicks(60);
|
||||
|
||||
delay(60 * _tickLength);
|
||||
_seq->playSequence(_seq_KyrandiaLogo, true);
|
||||
|
||||
_screen->fadeToBlack();
|
||||
@ -80,13 +80,14 @@ void KyraEngine::seq_demo() {
|
||||
_screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0);
|
||||
_system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
|
||||
_screen->fadeFromBlack();
|
||||
waitTicks(60);
|
||||
delay(60 * _tickLength);
|
||||
_screen->fadeToBlack();
|
||||
_sound->stopMusic();
|
||||
}
|
||||
|
||||
void KyraEngine::seq_intro() {
|
||||
debug(9, "KyraEngine::seq_intro()");
|
||||
|
||||
if (_features & GF_TALKIE) {
|
||||
_res->loadPakFile("INTRO.VRM");
|
||||
}
|
||||
@ -115,7 +116,7 @@ void KyraEngine::seq_intro() {
|
||||
(this->*introProcTable[i])();
|
||||
}
|
||||
_text->setTalkCoords(136);
|
||||
waitTicks(30);
|
||||
delay(30 * _tickLength);
|
||||
_seq->setCopyViewOffs(false);
|
||||
_sound->stopMusic();
|
||||
if (_features & GF_TALKIE) {
|
||||
@ -135,13 +136,13 @@ void KyraEngine::seq_introLogos() {
|
||||
_system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
|
||||
_screen->fadeFromBlack();
|
||||
|
||||
if (_seq->playSequence(_seq_WestwoodLogo, _skipIntroFlag)) {
|
||||
if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag)) {
|
||||
_screen->fadeToBlack();
|
||||
_screen->clearPage(0);
|
||||
return;
|
||||
}
|
||||
waitTicks(60);
|
||||
if (_seq->playSequence(_seq_KyrandiaLogo, _skipIntroFlag)) {
|
||||
delay(60 * _tickLength);
|
||||
if (_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) {
|
||||
_screen->fadeToBlack();
|
||||
_screen->clearPage(0);
|
||||
return;
|
||||
@ -152,9 +153,12 @@ void KyraEngine::seq_introLogos() {
|
||||
int h1 = 175;
|
||||
int y2 = 176;
|
||||
int h2 = 0;
|
||||
int32 start, now;
|
||||
int wait;
|
||||
_screen->copyRegion(0, 91, 0, 8, 320, 103, 6, 2);
|
||||
_screen->copyRegion(0, 0, 0, 111, 320, 64, 6, 2);
|
||||
do {
|
||||
start = (int32)_system->getMillis();
|
||||
if (h1 > 0) {
|
||||
_screen->copyRegion(0, y1, 0, 8, 320, h1, 2, 0);
|
||||
}
|
||||
@ -166,7 +170,11 @@ void KyraEngine::seq_introLogos() {
|
||||
--y2;
|
||||
++h2;
|
||||
_screen->updateScreen();
|
||||
waitTicks(1);
|
||||
now = (int32)_system->getMillis();
|
||||
wait = _tickLength - (now - start);
|
||||
if (wait > 0) {
|
||||
delay(wait);
|
||||
}
|
||||
} while (y2 >= 64);
|
||||
|
||||
_seq->playSequence(_seq_Forest, true);
|
||||
@ -176,22 +184,23 @@ void KyraEngine::seq_introStory() {
|
||||
debug(9, "KyraEngine::seq_introStory()");
|
||||
_screen->clearPage(3);
|
||||
_screen->clearPage(0);
|
||||
if ((_features & GF_ENGLISH) && (_features & GF_TALKIE)) {
|
||||
loadBitmap("TEXT_ENG.CPS", 3, 3, 0);
|
||||
if (_features & GF_TALKIE) {
|
||||
return;
|
||||
} else if (_features & GF_ENGLISH) {
|
||||
loadBitmap("TEXT.CPS", 3, 3, 0);
|
||||
} else if (_features & GF_GERMAN) {
|
||||
loadBitmap("TEXT_GER.CPS", 3, 3, 0);
|
||||
} else if (_features & GF_FRENCH) {
|
||||
loadBitmap("TEXT_FRE.CPS", 3, 3, 0);
|
||||
} else if (_features & GF_SPANISH) {
|
||||
loadBitmap("TEXT_SPA.CPS", 3, 3, 0);
|
||||
} else if ((_features & GF_ENGLISH) && (_features & GF_FLOPPY)) {
|
||||
loadBitmap("TEXT.CPS", 3, 3, 0);
|
||||
} else {
|
||||
warning("no story graphics file found");
|
||||
}
|
||||
_screen->copyRegion(0, 0, 0, 0, 320, 200, 3, 0);
|
||||
_screen->updateScreen();
|
||||
waitTicks(360);
|
||||
debug("skipFlag %i, %i", _skipFlag, _tickLength);
|
||||
delay(360 * _tickLength);
|
||||
}
|
||||
|
||||
void KyraEngine::seq_introMalcolmTree() {
|
||||
@ -852,7 +861,7 @@ int KyraEngine::seq_playEnd() {
|
||||
_screen->_curPage = 0;
|
||||
checkAmuletAnimFlags();
|
||||
seq_brandonToStone();
|
||||
waitTicks(60);
|
||||
delay(60 * _tickLength);
|
||||
return 1;
|
||||
} else {
|
||||
_endSequenceSkipFlag = 1;
|
||||
@ -862,7 +871,7 @@ int KyraEngine::seq_playEnd() {
|
||||
_screen->_curPage = 0;
|
||||
_screen->hideMouse();
|
||||
_screen->fadeSpecialPalette(32, 228, 20, 60);
|
||||
waitTicks(60);
|
||||
delay(60 * _tickLength);
|
||||
loadBitmap("GEMHEAL.CPS", 3, 3, _screen->_currentPalette);
|
||||
_screen->setScreenPalette(_screen->_currentPalette);
|
||||
_screen->shuffleScreen(8, 8, 304, 128, 2, 0, 1, 0);
|
||||
@ -954,7 +963,7 @@ void KyraEngine::seq_playCredits() {
|
||||
// delete
|
||||
_screen->updateScreen();
|
||||
// XXX
|
||||
waitTicks(120); // wait until user presses escape normally
|
||||
delay(120 * _tickLength); // wait until user presses escape normally
|
||||
_screen->fadeToBlack();
|
||||
_screen->clearCurPage();
|
||||
_screen->showMouse();
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -421,7 +422,7 @@ void KyraEngine::snd_playVoiceFile(int id) {
|
||||
|
||||
void KyraEngine::snd_voiceWaitForFinish(bool ingame) {
|
||||
debug(9, "KyraEngine::snd_voiceWaitForFinish(%d)", ingame);
|
||||
while (_sound->voiceIsPlaying() && !_fastMode) {
|
||||
while (_sound->voiceIsPlaying() && !_skipFlag) {
|
||||
if (ingame) {
|
||||
delay(10, true);
|
||||
} else {
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
@ -92,6 +93,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch
|
||||
currPage = _screen->_curPage;
|
||||
_screen->_curPage = 2;
|
||||
_text->printCharacterText(chatStr, charNum, _characterList[charNum].x1);
|
||||
_animator->_updateScreen = true;
|
||||
_screen->_curPage = currPage;
|
||||
|
||||
_animator->copyChangedObjectsForward(0);
|
||||
@ -104,7 +106,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch
|
||||
switch (event.type) {
|
||||
case OSystem::EVENT_KEYDOWN:
|
||||
if (event.kbd.keycode == '.')
|
||||
runLoop = false;
|
||||
_skipFlag = true;
|
||||
break;
|
||||
case OSystem::EVENT_QUIT:
|
||||
quitGame();
|
||||
@ -116,7 +118,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch
|
||||
}
|
||||
}
|
||||
|
||||
if (_fastMode)
|
||||
if (_skipFlag)
|
||||
runLoop = false;
|
||||
|
||||
delayTime = (loopStart + _gameSpeed) - _system->getMillis();
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* $Header$
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user