mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 05:01:43 +00:00
TONY: Rename variables and functions in tony.h
This commit is contained in:
parent
c17af63aac
commit
a1f6f8ceb1
@ -240,7 +240,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (i = 0; i < _vm->_voices.size(); i++)
|
for (i = 0; i < _vm->_voices.size(); i++)
|
||||||
if (_vm->_voices[i].code == code)
|
if (_vm->_voices[i]._code == code)
|
||||||
return &_vm->_voices[i];
|
return &_vm->_voices[i];
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -272,7 +272,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
|
|||||||
_ctx->voice = NULL;
|
_ctx->voice = NULL;
|
||||||
if (_ctx->curVoc) {
|
if (_ctx->curVoc) {
|
||||||
// Is positioned within the database of entries beginning at the first
|
// Is positioned within the database of entries beginning at the first
|
||||||
_ctx->curOffset = _ctx->curVoc->offset;
|
_ctx->curOffset = _ctx->curVoc->_offset;
|
||||||
|
|
||||||
// First time allocation
|
// First time allocation
|
||||||
_vm->_vdbFP.seek(_ctx->curOffset);
|
_vm->_vdbFP.seek(_ctx->curOffset);
|
||||||
@ -509,7 +509,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3
|
|||||||
CORO_INVOKE_0(GLOBALS.WaitWipeEnd);
|
CORO_INVOKE_0(GLOBALS.WaitWipeEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
_vm->StopMusic(4);
|
_vm->stopMusic(4);
|
||||||
|
|
||||||
// On exit, unload and unfreeze
|
// On exit, unload and unfreeze
|
||||||
CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL);
|
CORO_INVOKE_2(GLOBALS.UnloadLocation, true, NULL);
|
||||||
@ -532,7 +532,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) {
|
if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) {
|
||||||
_vm->StopMusic(4);
|
_vm->stopMusic(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// On exit, unfreeze
|
// On exit, unfreeze
|
||||||
@ -547,7 +547,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
|
|||||||
if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) {
|
if (GLOBALS.lastTappeto != GLOBALS.tappeti[nLoc]) {
|
||||||
GLOBALS.lastTappeto = GLOBALS.tappeti[nLoc];
|
GLOBALS.lastTappeto = GLOBALS.tappeti[nLoc];
|
||||||
if (GLOBALS.lastTappeto != 0)
|
if (GLOBALS.lastTappeto != 0)
|
||||||
_vm->PlayMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true, 2000);
|
_vm->playMusic(4, tappetiFile[GLOBALS.lastTappeto], 0, true, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GLOBALS.bNoOcchioDiBue) {
|
if (!GLOBALS.bNoOcchioDiBue) {
|
||||||
@ -1281,7 +1281,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui
|
|||||||
|
|
||||||
_ctx->startpt = GLOBALS.Loc->ScrollPosition();
|
_ctx->startpt = GLOBALS.Loc->ScrollPosition();
|
||||||
|
|
||||||
_ctx->dwStartTime = _vm->GetTime();
|
_ctx->dwStartTime = _vm->getTime();
|
||||||
|
|
||||||
if (sX)
|
if (sX)
|
||||||
_ctx->dwTotalTime = _ctx->dimx * (1000 / 35) / sX;
|
_ctx->dwTotalTime = _ctx->dimx * (1000 / 35) / sX;
|
||||||
@ -1289,7 +1289,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui
|
|||||||
_ctx->dwTotalTime = _ctx->dimy * (1000 / 35) / sY;
|
_ctx->dwTotalTime = _ctx->dimy * (1000 / 35) / sY;
|
||||||
|
|
||||||
while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) {
|
while ((_ctx->lx != 0 || _ctx->ly != 0) && !GLOBALS.bSkipIdle) {
|
||||||
_ctx->dwCurTime = _vm->GetTime() - _ctx->dwStartTime;
|
_ctx->dwCurTime = _vm->getTime() - _ctx->dwStartTime;
|
||||||
if (_ctx->dwCurTime > _ctx->dwTotalTime)
|
if (_ctx->dwCurTime > _ctx->dwTotalTime)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1362,11 +1362,11 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin
|
|||||||
|
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
_vm->AutoSave(coroParam);
|
_vm->autoSave(coroParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(Abort)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(AbortGame)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
_vm->Abort();
|
_vm->abortGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) {
|
||||||
@ -1378,12 +1378,12 @@ DECLARE_CUSTOM_FUNCTION(TremaSchermo)(CORO_PARAM, uint32 nScosse, uint32, uint32
|
|||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
_ctx->curTime = _vm->GetTime();
|
_ctx->curTime = _vm->getTime();
|
||||||
|
|
||||||
_ctx->dirx = 1;
|
_ctx->dirx = 1;
|
||||||
_ctx->diry = 1;
|
_ctx->diry = 1;
|
||||||
|
|
||||||
while (_vm->GetTime() < _ctx->curTime + nScosse) {
|
while (_vm->getTime() < _ctx->curTime + nScosse) {
|
||||||
CORO_INVOKE_0(GLOBALS.WaitFrame);
|
CORO_INVOKE_0(GLOBALS.WaitFrame);
|
||||||
|
|
||||||
GLOBALS.Freeze();
|
GLOBALS.Freeze();
|
||||||
@ -1482,8 +1482,8 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
|
|||||||
_ctx->voice = NULL;
|
_ctx->voice = NULL;
|
||||||
if (_ctx->curVoc) {
|
if (_ctx->curVoc) {
|
||||||
// Position within the database of entries, beginning at the first
|
// Position within the database of entries, beginning at the first
|
||||||
_vm->_vdbFP.seek(_ctx->curVoc->offset);
|
_vm->_vdbFP.seek(_ctx->curVoc->_offset);
|
||||||
_ctx->curOffset = _ctx->curVoc->offset;
|
_ctx->curOffset = _ctx->curVoc->_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
|
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
|
||||||
@ -1694,8 +1694,8 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
|
|||||||
if (_ctx->curVoc) {
|
if (_ctx->curVoc) {
|
||||||
// Position within the database of entries, beginning at the first
|
// Position within the database of entries, beginning at the first
|
||||||
// fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET);
|
// fseek(_vm->m_vdbFP, curVoc->offset, SEEK_SET);
|
||||||
_vm->_vdbFP.seek(_ctx->curVoc->offset);
|
_vm->_vdbFP.seek(_ctx->curVoc->_offset);
|
||||||
_ctx->curOffset = _ctx->curVoc->offset;
|
_ctx->curOffset = _ctx->curVoc->_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
|
for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) {
|
||||||
@ -1806,7 +1806,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
|
|||||||
|
|
||||||
if (_ctx->curVoc) {
|
if (_ctx->curVoc) {
|
||||||
// Position within the database of entries, beginning at the first
|
// Position within the database of entries, beginning at the first
|
||||||
_vm->_vdbFP.seek(_ctx->curVoc->offset);
|
_vm->_vdbFP.seek(_ctx->curVoc->_offset);
|
||||||
_vm->_theSound.CreateSfx(&_ctx->voice);
|
_vm->_theSound.CreateSfx(&_ctx->voice);
|
||||||
_ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP);
|
_ctx->voice->LoadVoiceFromVDB(_vm->_vdbFP);
|
||||||
_ctx->voice->SetLoop(false);
|
_ctx->voice->SetLoop(false);
|
||||||
@ -2083,11 +2083,11 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) {
|
|||||||
debug("Start FadeIn Music");
|
debug("Start FadeIn Music");
|
||||||
|
|
||||||
for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) {
|
for (_ctx->i = 0; _ctx->i < 16; _ctx->i++) {
|
||||||
_vm->SetMusicVolume(nChannel, _ctx->i * 4);
|
_vm->setMusicVolume(nChannel, _ctx->i * 4);
|
||||||
|
|
||||||
CORO_INVOKE_1(CoroScheduler.sleep, 100);
|
CORO_INVOKE_1(CoroScheduler.sleep, 100);
|
||||||
}
|
}
|
||||||
_vm->SetMusicVolume(nChannel, 64);
|
_vm->setMusicVolume(nChannel, 64);
|
||||||
|
|
||||||
debug("End FadeIn Music");
|
debug("End FadeIn Music");
|
||||||
|
|
||||||
@ -2106,23 +2106,23 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) {
|
|||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
_ctx->startVolume = _vm->GetMusicVolume(nChannel);
|
_ctx->startVolume = _vm->getMusicVolume(nChannel);
|
||||||
|
|
||||||
debug("Start FadeOut Music");
|
debug("Start FadeOut Music");
|
||||||
|
|
||||||
for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS.bFadeOutStop; _ctx->i--) {
|
for (_ctx->i = 16; _ctx->i > 0 && !GLOBALS.bFadeOutStop; _ctx->i--) {
|
||||||
if (_ctx->i * 4 < _ctx->startVolume)
|
if (_ctx->i * 4 < _ctx->startVolume)
|
||||||
_vm->SetMusicVolume(nChannel, _ctx->i * 4);
|
_vm->setMusicVolume(nChannel, _ctx->i * 4);
|
||||||
|
|
||||||
CORO_INVOKE_1(CoroScheduler.sleep, 100);
|
CORO_INVOKE_1(CoroScheduler.sleep, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GLOBALS.bFadeOutStop)
|
if (!GLOBALS.bFadeOutStop)
|
||||||
_vm->SetMusicVolume(nChannel, 0);
|
_vm->setMusicVolume(nChannel, 0);
|
||||||
|
|
||||||
// If there is a stacchetto, stop all
|
// If there is a stacchetto, stop all
|
||||||
if (nChannel == 2)
|
if (nChannel == 2)
|
||||||
_vm->StopMusic(2);
|
_vm->stopMusic(2);
|
||||||
|
|
||||||
debug("End FadeOut Music");
|
debug("End FadeOut Music");
|
||||||
|
|
||||||
@ -2152,28 +2152,28 @@ DECLARE_CUSTOM_FUNCTION(FadeInStacchetto)(CORO_PARAM, uint32, uint32, uint32, ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(StopSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
_vm->StopMusic(GLOBALS.curSonoriz);
|
_vm->stopMusic(GLOBALS.curSonoriz);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(StopStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
_vm->StopMusic(2);
|
_vm->stopMusic(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(MuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
_vm->SetMusicVolume(GLOBALS.curSonoriz, 0);
|
_vm->setMusicVolume(GLOBALS.curSonoriz, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(DemuteSonoriz)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
GLOBALS.bFadeOutStop = true;
|
GLOBALS.bFadeOutStop = true;
|
||||||
_vm->SetMusicVolume(GLOBALS.curSonoriz, 64);
|
_vm->setMusicVolume(GLOBALS.curSonoriz, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(MuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
_vm->SetMusicVolume(2, 0);
|
_vm->setMusicVolume(2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(CORO_PARAM, uint32, uint32, uint32, uint32) {
|
||||||
_vm->SetMusicVolume(2, 64);
|
_vm->setMusicVolume(2, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2288,7 +2288,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui
|
|||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
GLOBALS.Freeze();
|
GLOBALS.Freeze();
|
||||||
CORO_INVOKE_0(_vm->OpenInitLoadMenu);
|
CORO_INVOKE_0(_vm->openInitLoadMenu);
|
||||||
GLOBALS.Unfreeze();
|
GLOBALS.Unfreeze();
|
||||||
|
|
||||||
CORO_END_CODE;
|
CORO_END_CODE;
|
||||||
@ -2301,7 +2301,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin
|
|||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
GLOBALS.Freeze();
|
GLOBALS.Freeze();
|
||||||
CORO_INVOKE_0(_vm->OpenInitOptions);
|
CORO_INVOKE_0(_vm->openInitOptions);
|
||||||
GLOBALS.Unfreeze();
|
GLOBALS.Unfreeze();
|
||||||
|
|
||||||
CORO_END_CODE;
|
CORO_END_CODE;
|
||||||
@ -2357,13 +2357,13 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3
|
|||||||
GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]);
|
GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ctx->startTime = _vm->GetTime();
|
_ctx->startTime = _vm->getTime();
|
||||||
|
|
||||||
while (_ctx->startTime + dwTime * 1000 > _vm->GetTime()) {
|
while (_ctx->startTime + dwTime * 1000 > _vm->getTime()) {
|
||||||
CORO_INVOKE_0(GLOBALS.WaitFrame);
|
CORO_INVOKE_0(GLOBALS.WaitFrame);
|
||||||
if (GLOBALS.Input->MouseLeftClicked() || GLOBALS.Input->MouseRightClicked())
|
if (GLOBALS.Input->MouseLeftClicked() || GLOBALS.Input->MouseRightClicked())
|
||||||
break;
|
break;
|
||||||
if (_vm->GetEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB))
|
if (_vm->getEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2510,7 +2510,7 @@ ASSIGN(130, StacchettoFadeEnd)
|
|||||||
|
|
||||||
ASSIGN(120, TremaSchermo)
|
ASSIGN(120, TremaSchermo)
|
||||||
ASSIGN(121, AutoSave)
|
ASSIGN(121, AutoSave)
|
||||||
ASSIGN(122, Abort)
|
ASSIGN(122, AbortGame)
|
||||||
ASSIGN(131, NoOcchioDiBue)
|
ASSIGN(131, NoOcchioDiBue)
|
||||||
ASSIGN(132, SendFullscreenMsgStart)
|
ASSIGN(132, SendFullscreenMsgStart)
|
||||||
ASSIGN(133, SendFullscreenMsgEnd)
|
ASSIGN(133, SendFullscreenMsgEnd)
|
||||||
|
@ -146,7 +146,7 @@ int TonyMetaEngine::getMaximumSaveSlot() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TonyMetaEngine::removeSaveState(const char *target, int slot) const {
|
void TonyMetaEngine::removeSaveState(const char *target, int slot) const {
|
||||||
Common::String filename = Tony::TonyEngine::GetSaveStateFileName(slot);
|
Common::String filename = Tony::TonyEngine::getSaveStateFileName(slot);
|
||||||
|
|
||||||
g_system->getSavefileManager()->removeSavefile(filename);
|
g_system->getSavefileManager()->removeSavefile(filename);
|
||||||
}
|
}
|
||||||
|
@ -2079,14 +2079,14 @@ void RMTextDialog::RemoveThis(CORO_PARAM, bool &result) {
|
|||||||
if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE)) {
|
if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE)) {
|
||||||
if (GLOBALS.bCfgTimerizedText) {
|
if (GLOBALS.bCfgTimerizedText) {
|
||||||
if (!m_bForceNoTime) {
|
if (!m_bForceNoTime) {
|
||||||
if (_vm->GetTime() > (uint32)m_time + m_startTime)
|
if (_vm->getTime() > (uint32)m_time + m_startTime)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_bNoTab) {
|
if (!m_bNoTab) {
|
||||||
if (_vm->GetEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB))
|
if (_vm->getEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_TAB))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2100,14 +2100,14 @@ void RMTextDialog::RemoveThis(CORO_PARAM, bool &result) {
|
|||||||
// Erase the background
|
// Erase the background
|
||||||
else if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE)) {
|
else if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE)) {
|
||||||
if (!m_bForceNoTime) {
|
if (!m_bForceNoTime) {
|
||||||
if (_vm->GetTime() > (uint32)m_time + m_startTime)
|
if (_vm->getTime() > (uint32)m_time + m_startTime)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If time is forced
|
// If time is forced
|
||||||
if (m_bForceTime) {
|
if (m_bForceTime) {
|
||||||
if (_vm->GetTime() > (uint32)m_time + m_startTime)
|
if (_vm->getTime() > (uint32)m_time + m_startTime)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2143,7 +2143,7 @@ void RMTextDialog::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p
|
|||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
if (m_startTime == 0)
|
if (m_startTime == 0)
|
||||||
m_startTime = _vm->GetTime();
|
m_startTime = _vm->getTime();
|
||||||
|
|
||||||
if (m_bShowed) {
|
if (m_bShowed) {
|
||||||
if (GLOBALS.bCfgSottotitoli || m_bAlwaysDisplay) {
|
if (GLOBALS.bCfgSottotitoli || m_bAlwaysDisplay) {
|
||||||
@ -2483,7 +2483,7 @@ void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) {
|
|||||||
if (0) {
|
if (0) {
|
||||||
m_bShow = true;
|
m_bShow = true;
|
||||||
} else {
|
} else {
|
||||||
_ctx->starttime = _vm->GetTime();
|
_ctx->starttime = _vm->getTime();
|
||||||
_ctx->deltay = 480 - m_ptDrawPos.y;
|
_ctx->deltay = 480 - m_ptDrawPos.y;
|
||||||
_ctx->destpt = m_ptDrawPos;
|
_ctx->destpt = m_ptDrawPos;
|
||||||
m_ptDrawPos.Set(0, 480);
|
m_ptDrawPos.Set(0, 480);
|
||||||
@ -2496,7 +2496,7 @@ void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) {
|
|||||||
while (_ctx->elaps < 700) {
|
while (_ctx->elaps < 700) {
|
||||||
CORO_INVOKE_0(MainWaitFrame);
|
CORO_INVOKE_0(MainWaitFrame);
|
||||||
MainFreeze();
|
MainFreeze();
|
||||||
_ctx->elaps = _vm->GetTime() - _ctx->starttime;
|
_ctx->elaps = _vm->getTime() - _ctx->starttime;
|
||||||
m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * _ctx->elaps) / 100;
|
m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * _ctx->elaps) / 100;
|
||||||
MainUnfreeze();
|
MainUnfreeze();
|
||||||
}
|
}
|
||||||
@ -2533,14 +2533,14 @@ void RMDialogChoice::Hide(CORO_PARAM) {
|
|||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
if (1) {
|
if (1) {
|
||||||
_ctx->starttime = _vm->GetTime();
|
_ctx->starttime = _vm->getTime();
|
||||||
|
|
||||||
_ctx->deltay = 480 - m_ptDrawPos.y;
|
_ctx->deltay = 480 - m_ptDrawPos.y;
|
||||||
_ctx->elaps = 0;
|
_ctx->elaps = 0;
|
||||||
while (_ctx->elaps < 700) {
|
while (_ctx->elaps < 700) {
|
||||||
CORO_INVOKE_0(MainWaitFrame);
|
CORO_INVOKE_0(MainWaitFrame);
|
||||||
MainFreeze();
|
MainFreeze();
|
||||||
_ctx->elaps = _vm->GetTime() - _ctx->starttime;
|
_ctx->elaps = _vm->getTime() - _ctx->starttime;
|
||||||
m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * (700 - _ctx->elaps)) / 100;
|
m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * (700 - _ctx->elaps)) / 100;
|
||||||
MainUnfreeze();
|
MainUnfreeze();
|
||||||
}
|
}
|
||||||
|
@ -47,75 +47,75 @@ using namespace MPAL;
|
|||||||
/****************************************/
|
/****************************************/
|
||||||
|
|
||||||
uint32 MainLoadLocation(int nLoc, RMPoint pt, RMPoint start) {
|
uint32 MainLoadLocation(int nLoc, RMPoint pt, RMPoint start) {
|
||||||
return _vm->GetEngine()->LoadLocation(nLoc, pt, start);
|
return _vm->getEngine()->LoadLocation(nLoc, pt, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainUnloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) {
|
void MainUnloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) {
|
||||||
_vm->GetEngine()->UnloadLocation(coroParam, bDoOnExit, result);
|
_vm->getEngine()->UnloadLocation(coroParam, bDoOnExit, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainLinkGraphicTask(RMGfxTask *task) {
|
void MainLinkGraphicTask(RMGfxTask *task) {
|
||||||
_vm->GetEngine()->LinkGraphicTask(task);
|
_vm->getEngine()->LinkGraphicTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainFreeze(void) {
|
void MainFreeze(void) {
|
||||||
_vm->GetEngine()->Freeze();
|
_vm->getEngine()->Freeze();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainUnfreeze(void) {
|
void MainUnfreeze(void) {
|
||||||
_vm->GetEngine()->Unfreeze();
|
_vm->getEngine()->Unfreeze();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWaitFrame(CORO_PARAM) {
|
void MainWaitFrame(CORO_PARAM) {
|
||||||
CoroScheduler.waitForSingleObject(coroParam, _vm->m_hEndOfFrame, CORO_INFINITE);
|
CoroScheduler.waitForSingleObject(coroParam, _vm->_hEndOfFrame, CORO_INFINITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainShowMouse(void) {
|
void MainShowMouse(void) {
|
||||||
_vm->GetEngine()->EnableMouse();
|
_vm->getEngine()->EnableMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainHideMouse(void) {
|
void MainHideMouse(void) {
|
||||||
_vm->GetEngine()->DisableMouse();
|
_vm->getEngine()->DisableMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainPlayMusic(int nChannel, const char *filename, int nFX, bool bLoop, int nSync) {
|
void MainPlayMusic(int nChannel, const char *filename, int nFX, bool bLoop, int nSync) {
|
||||||
_vm->PlayMusic(nChannel, filename, nFX, bLoop, nSync);
|
_vm->playMusic(nChannel, filename, nFX, bLoop, nSync);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainDisableInput(void) {
|
void MainDisableInput(void) {
|
||||||
_vm->GetEngine()->DisableInput();
|
_vm->getEngine()->DisableInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainEnableInput(void) {
|
void MainEnableInput(void) {
|
||||||
_vm->GetEngine()->EnableInput();
|
_vm->getEngine()->EnableInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainInitWipe(int type) {
|
void MainInitWipe(int type) {
|
||||||
_vm->GetEngine()->InitWipe(type);
|
_vm->getEngine()->InitWipe(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainCloseWipe(void) {
|
void MainCloseWipe(void) {
|
||||||
_vm->GetEngine()->CloseWipe();
|
_vm->getEngine()->CloseWipe();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWaitWipeEnd(CORO_PARAM) {
|
void MainWaitWipeEnd(CORO_PARAM) {
|
||||||
_vm->GetEngine()->WaitWipeEnd(coroParam);
|
_vm->getEngine()->WaitWipeEnd(coroParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainEnableGUI(void) {
|
void MainEnableGUI(void) {
|
||||||
_vm->GetEngine()->m_bGUIInterface = true;
|
_vm->getEngine()->m_bGUIInterface = true;
|
||||||
_vm->GetEngine()->m_bGUIInventory = true;
|
_vm->getEngine()->m_bGUIInventory = true;
|
||||||
_vm->GetEngine()->m_bGUIOption = true;
|
_vm->getEngine()->m_bGUIOption = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainDisableGUI(void) {
|
void MainDisableGUI(void) {
|
||||||
_vm->GetEngine()->m_bGUIInterface = false;
|
_vm->getEngine()->m_bGUIInterface = false;
|
||||||
_vm->GetEngine()->m_bGUIInventory = false;
|
_vm->getEngine()->m_bGUIInventory = false;
|
||||||
_vm->GetEngine()->m_bGUIOption = false;
|
_vm->getEngine()->m_bGUIOption = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainSetPalesati(bool bPalesati) {
|
void MainSetPalesati(bool bPalesati) {
|
||||||
_vm->GetEngine()->SetPalesati(bPalesati);
|
_vm->getEngine()->SetPalesati(bPalesati);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************\
|
/****************************************************************************\
|
||||||
@ -491,7 +491,7 @@ void RMOptionScreen::RefreshAll(CORO_PARAM) {
|
|||||||
|
|
||||||
if (m_bEditSaveName) {
|
if (m_bEditSaveName) {
|
||||||
_ctx->thumb = new RMGfxSourceBuffer16;
|
_ctx->thumb = new RMGfxSourceBuffer16;
|
||||||
_ctx->thumb->Init((byte *)_vm->GetThumbnail(), 640 / 4, 480 / 4);
|
_ctx->thumb->Init((byte *)_vm->getThumbnail(), 640 / 4, 480 / 4);
|
||||||
|
|
||||||
if (m_nEditPos == 0)
|
if (m_nEditPos == 0)
|
||||||
AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(48, 57)));
|
AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(48, 57)));
|
||||||
@ -989,7 +989,7 @@ bool RMOptionScreen::Close(void) {
|
|||||||
|
|
||||||
// Start fade out
|
// Start fade out
|
||||||
m_FadeStep++;
|
m_FadeStep++;
|
||||||
m_FadeTime = _vm->GetTime();
|
m_FadeTime = _vm->getTime();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1097,7 +1097,7 @@ void RMOptionScreen::DoFrame(CORO_PARAM, RMInput *input) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define KEYPRESS(c) (_vm->GetEngine()->GetInput().GetAsyncKeyState(c))
|
#define KEYPRESS(c) (_vm->getEngine()->GetInput().GetAsyncKeyState(c))
|
||||||
#define PROCESS_CHAR(cod,c) if (KEYPRESS(cod)) { \
|
#define PROCESS_CHAR(cod,c) if (KEYPRESS(cod)) { \
|
||||||
m_EditName[strlen(m_EditName) +1 ] = '\0'; m_EditName[strlen(m_EditName)] = c; _ctx->bRefresh = true; }
|
m_EditName[strlen(m_EditName) +1 ] = '\0'; m_EditName[strlen(m_EditName)] = c; _ctx->bRefresh = true; }
|
||||||
|
|
||||||
@ -1154,7 +1154,7 @@ void RMOptionScreen::DoFrame(CORO_PARAM, RMInput *input) {
|
|||||||
// OK
|
// OK
|
||||||
if (KEYPRESS(Common::KEYCODE_RETURN)) {
|
if (KEYPRESS(Common::KEYCODE_RETURN)) {
|
||||||
m_bEditSaveName = false;
|
m_bEditSaveName = false;
|
||||||
_vm->SaveState(m_statePos + m_nEditPos, m_EditName);
|
_vm->saveState(m_statePos + m_nEditPos, m_EditName);
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1190,7 +1190,7 @@ void RMOptionScreen::DoFrame(CORO_PARAM, RMInput *input) {
|
|||||||
// There by saving or loading!!!
|
// There by saving or loading!!!
|
||||||
if (m_nState == MENULOAD && m_curThumb[_ctx->i] != NULL) {
|
if (m_nState == MENULOAD && m_curThumb[_ctx->i] != NULL) {
|
||||||
// Caricamento
|
// Caricamento
|
||||||
CORO_INVOKE_1(_vm->LoadState, m_statePos + _ctx->i);
|
CORO_INVOKE_1(_vm->loadState, m_statePos + _ctx->i);
|
||||||
Close();
|
Close();
|
||||||
} else if (m_nState == MENUSAVE && (m_statePos != 0 || _ctx->i != 0)) {
|
} else if (m_nState == MENUSAVE && (m_statePos != 0 || _ctx->i != 0)) {
|
||||||
// Turn on edit mode
|
// Turn on edit mode
|
||||||
@ -1214,7 +1214,7 @@ void RMOptionScreen::DoFrame(CORO_PARAM, RMInput *input) {
|
|||||||
m_bQuitConfirm = false;
|
m_bQuitConfirm = false;
|
||||||
_ctx->bRefresh = true;
|
_ctx->bRefresh = true;
|
||||||
|
|
||||||
_vm->Quit();
|
_vm->quitGame();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_ButtonQuit->IsActive()) {
|
if (m_ButtonQuit->IsActive()) {
|
||||||
@ -1280,7 +1280,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive
|
|||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
_ctx->curTime = _vm->GetTime();
|
_ctx->curTime = _vm->getTime();
|
||||||
|
|
||||||
#define FADE_SPEED 20
|
#define FADE_SPEED 20
|
||||||
#define SYNC (_ctx->curTime-m_FadeTime) / 25
|
#define SYNC (_ctx->curTime-m_FadeTime) / 25
|
||||||
@ -1336,7 +1336,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive
|
|||||||
if (m_FadeY > 480) {
|
if (m_FadeY > 480) {
|
||||||
m_FadeY = 480;
|
m_FadeY = 480;
|
||||||
m_FadeStep++;
|
m_FadeStep++;
|
||||||
_vm->HideLocation();
|
_vm->hideLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480));
|
prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480));
|
||||||
@ -1346,7 +1346,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive
|
|||||||
|
|
||||||
} else if (m_FadeStep == 7) {
|
} else if (m_FadeStep == 7) {
|
||||||
// Menu OFF
|
// Menu OFF
|
||||||
_vm->ShowLocation();
|
_vm->showLocation();
|
||||||
m_FadeStep++;
|
m_FadeStep++;
|
||||||
|
|
||||||
} else if (m_FadeStep == 8) {
|
} else if (m_FadeStep == 8) {
|
||||||
@ -1398,7 +1398,7 @@ bool RMOptionScreen::LoadThumbnailFromSaveState(int nState, byte *lpDestBuf, RMS
|
|||||||
diff = 10;
|
diff = 10;
|
||||||
|
|
||||||
// Get the savegame filename for the given slot
|
// Get the savegame filename for the given slot
|
||||||
buf = _vm->GetSaveStateFileName(nState);
|
buf = _vm->getSaveStateFileName(nState);
|
||||||
|
|
||||||
// Try and open the savegame
|
// Try and open the savegame
|
||||||
f = g_system->getSavefileManager()->openForLoading(buf);
|
f = g_system->getSavefileManager()->openForLoading(buf);
|
||||||
|
@ -109,7 +109,7 @@ void RMGfxEngine::OpenOptionScreen(CORO_PARAM, int type) {
|
|||||||
CORO_INVOKE_3(m_opt.InitSaveMenuOnly, m_bigBuf, false, _ctx->bRes);
|
CORO_INVOKE_3(m_opt.InitSaveMenuOnly, m_bigBuf, false, _ctx->bRes);
|
||||||
|
|
||||||
if (_ctx->bRes) {
|
if (_ctx->bRes) {
|
||||||
_vm->PauseSound(true);
|
_vm->pauseSound(true);
|
||||||
|
|
||||||
DisableInput();
|
DisableInput();
|
||||||
m_inv.EndCombine();
|
m_inv.EndCombine();
|
||||||
@ -119,7 +119,7 @@ void RMGfxEngine::OpenOptionScreen(CORO_PARAM, int type) {
|
|||||||
m_point.SetSpecialPointer(RMPointer::PTR_NONE);
|
m_point.SetSpecialPointer(RMPointer::PTR_NONE);
|
||||||
m_point.SetCustomPointer(NULL);
|
m_point.SetCustomPointer(NULL);
|
||||||
EnableMouse();
|
EnableMouse();
|
||||||
_vm->GrabThumbnail();
|
_vm->grabThumbnail();
|
||||||
|
|
||||||
// Exists the IDLE to avoid premature death in loading
|
// Exists the IDLE to avoid premature death in loading
|
||||||
m_bMustEnterMenu = true;
|
m_bMustEnterMenu = true;
|
||||||
@ -161,7 +161,7 @@ void RMGfxEngine::DoFrame(CORO_PARAM, bool bDrawLocation) {
|
|||||||
DisableMouse();
|
DisableMouse();
|
||||||
EnableInput();
|
EnableInput();
|
||||||
mpalStartIdlePoll(m_nCurLoc);
|
mpalStartIdlePoll(m_nCurLoc);
|
||||||
_vm->PauseSound(false);
|
_vm->pauseSound(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ bool RMInventory::LeftClick(const RMPoint &mpos, int &nCombineObj) {
|
|||||||
m_nCombine = m_inv[n - 1 + m_curPos];
|
m_nCombine = m_inv[n - 1 + m_curPos];
|
||||||
nCombineObj = m_nCombine + 10000;
|
nCombineObj = m_nCombine + 10000;
|
||||||
|
|
||||||
_vm->PlayUtilSFX(1);
|
_vm->playUtilSFX(1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -409,7 +409,7 @@ void RMInventory::RightClick(const RMPoint &mpos) {
|
|||||||
miniAction = 0;
|
miniAction = 0;
|
||||||
m_nSelectObj = n - 1;
|
m_nSelectObj = n - 1;
|
||||||
|
|
||||||
_vm->PlayUtilSFX(0);
|
_vm->playUtilSFX(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
g_system->unlockMutex(m_csModifyInterface);
|
g_system->unlockMutex(m_csModifyInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_vm->GetEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_i)) {
|
if (_vm->getEngine()->GetInput().GetAsyncKeyState(Common::KEYCODE_i)) {
|
||||||
GLOBALS.bCfgInvLocked = !GLOBALS.bCfgInvLocked;
|
GLOBALS.bCfgInvLocked = !GLOBALS.bCfgInvLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,7 +544,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
if (!GLOBALS.bCfgInvNoScroll) {
|
if (!GLOBALS.bCfgInvNoScroll) {
|
||||||
m_state = OPENING;
|
m_state = OPENING;
|
||||||
m_curPutY = RM_SY - 1;
|
m_curPutY = RM_SY - 1;
|
||||||
m_curPutTime = _vm->GetTime();
|
m_curPutTime = _vm->getTime();
|
||||||
} else {
|
} else {
|
||||||
m_state = OPENED;
|
m_state = OPENED;
|
||||||
m_curPutY = RM_SY - 68;
|
m_curPutY = RM_SY - 68;
|
||||||
@ -554,13 +554,13 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
if (!GLOBALS.bCfgInvNoScroll) {
|
if (!GLOBALS.bCfgInvNoScroll) {
|
||||||
m_state = CLOSING;
|
m_state = CLOSING;
|
||||||
m_curPutY = RM_SY - 68;
|
m_curPutY = RM_SY - 68;
|
||||||
m_curPutTime = _vm->GetTime();
|
m_curPutTime = _vm->getTime();
|
||||||
} else {
|
} else {
|
||||||
m_state = CLOSED;
|
m_state = CLOSED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (m_state == OPENING) {
|
} else if (m_state == OPENING) {
|
||||||
while (m_curPutTime + INVSPEED < _vm->GetTime()) {
|
while (m_curPutTime + INVSPEED < _vm->getTime()) {
|
||||||
m_curPutY -= 3;
|
m_curPutY -= 3;
|
||||||
m_curPutTime += INVSPEED;
|
m_curPutTime += INVSPEED;
|
||||||
}
|
}
|
||||||
@ -571,7 +571,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (m_state == CLOSING) {
|
} else if (m_state == CLOSING) {
|
||||||
while (m_curPutTime + INVSPEED < _vm->GetTime()) {
|
while (m_curPutTime + INVSPEED < _vm->getTime()) {
|
||||||
m_curPutY += 3;
|
m_curPutY += 3;
|
||||||
m_curPutTime += INVSPEED;
|
m_curPutTime += INVSPEED;
|
||||||
}
|
}
|
||||||
@ -584,7 +584,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
if (!GLOBALS.bCfgInvNoScroll) {
|
if (!GLOBALS.bCfgInvNoScroll) {
|
||||||
m_state = OPENING;
|
m_state = OPENING;
|
||||||
m_curPutY = - 68;
|
m_curPutY = - 68;
|
||||||
m_curPutTime = _vm->GetTime();
|
m_curPutTime = _vm->getTime();
|
||||||
} else {
|
} else {
|
||||||
m_state = OPENED;
|
m_state = OPENED;
|
||||||
m_curPutY = 0;
|
m_curPutY = 0;
|
||||||
@ -594,13 +594,13 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
if (!GLOBALS.bCfgInvNoScroll) {
|
if (!GLOBALS.bCfgInvNoScroll) {
|
||||||
m_state = CLOSING;
|
m_state = CLOSING;
|
||||||
m_curPutY = -2;
|
m_curPutY = -2;
|
||||||
m_curPutTime = _vm->GetTime();
|
m_curPutTime = _vm->getTime();
|
||||||
} else {
|
} else {
|
||||||
m_state = CLOSED;
|
m_state = CLOSED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (m_state == OPENING) {
|
} else if (m_state == OPENING) {
|
||||||
while (m_curPutTime + INVSPEED < _vm->GetTime()) {
|
while (m_curPutTime + INVSPEED < _vm->getTime()) {
|
||||||
m_curPutY += 3;
|
m_curPutY += 3;
|
||||||
m_curPutTime += INVSPEED;
|
m_curPutTime += INVSPEED;
|
||||||
}
|
}
|
||||||
@ -610,7 +610,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
m_curPutY = 0;
|
m_curPutY = 0;
|
||||||
}
|
}
|
||||||
} else if (m_state == CLOSING) {
|
} else if (m_state == CLOSING) {
|
||||||
while (m_curPutTime + INVSPEED < _vm->GetTime()) {
|
while (m_curPutTime + INVSPEED < _vm->getTime()) {
|
||||||
m_curPutY -= 3;
|
m_curPutY -= 3;
|
||||||
m_curPutTime += INVSPEED;
|
m_curPutTime += INVSPEED;
|
||||||
}
|
}
|
||||||
@ -635,19 +635,19 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
|
|||||||
if (miniAction != 1) {
|
if (miniAction != 1) {
|
||||||
miniInterface.SetPattern(2);
|
miniInterface.SetPattern(2);
|
||||||
miniAction = 1;
|
miniAction = 1;
|
||||||
_vm->PlayUtilSFX(1);
|
_vm->playUtilSFX(1);
|
||||||
}
|
}
|
||||||
} else if (mpos.x >= startx + 40 && mpos.x < startx + 80) {
|
} else if (mpos.x >= startx + 40 && mpos.x < startx + 80) {
|
||||||
if (miniAction != 2) {
|
if (miniAction != 2) {
|
||||||
miniInterface.SetPattern(3);
|
miniInterface.SetPattern(3);
|
||||||
miniAction = 2;
|
miniAction = 2;
|
||||||
_vm->PlayUtilSFX(1);
|
_vm->playUtilSFX(1);
|
||||||
}
|
}
|
||||||
} else if (mpos.x >= startx + 80 && mpos.x < startx + 108) {
|
} else if (mpos.x >= startx + 80 && mpos.x < startx + 108) {
|
||||||
if (miniAction != 3) {
|
if (miniAction != 3) {
|
||||||
miniInterface.SetPattern(4);
|
miniInterface.SetPattern(4);
|
||||||
miniAction = 3;
|
miniAction = 3;
|
||||||
_vm->PlayUtilSFX(1);
|
_vm->playUtilSFX(1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
miniInterface.SetPattern(1);
|
miniInterface.SetPattern(1);
|
||||||
@ -799,7 +799,7 @@ void RMInterface::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
|
|||||||
|
|
||||||
if (m_lastHotZone != _ctx->h) {
|
if (m_lastHotZone != _ctx->h) {
|
||||||
m_lastHotZone = _ctx->h;
|
m_lastHotZone = _ctx->h;
|
||||||
_vm->PlayUtilSFX(1);
|
_vm->playUtilSFX(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLOBALS.bCfgInterTips) {
|
if (GLOBALS.bCfgInterTips) {
|
||||||
@ -836,7 +836,7 @@ void RMInterface::Clicked(const RMPoint &mousepos) {
|
|||||||
if (m_openStart.y + m_dimy > RM_SY) m_openStart.y = RM_SY - m_dimy;
|
if (m_openStart.y + m_dimy > RM_SY) m_openStart.y = RM_SY - m_dimy;
|
||||||
|
|
||||||
// Play the sound effect
|
// Play the sound effect
|
||||||
_vm->PlayUtilSFX(0);
|
_vm->playUtilSFX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RMInterface::Released(const RMPoint &mousepos, RMTonyAction &action) {
|
bool RMInterface::Released(const RMPoint &mousepos, RMTonyAction &action) {
|
||||||
|
@ -156,7 +156,7 @@ int RMPattern::Init(RMSfx *sfx, bool bPlayP0, byte *bFlag) {
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Read the current time
|
// Read the current time
|
||||||
m_nStartTime = _vm->GetTime();
|
m_nStartTime = _vm->getTime();
|
||||||
m_nCurSlot = 0;
|
m_nCurSlot = 0;
|
||||||
|
|
||||||
// Find the first frame of the pattern
|
// Find the first frame of the pattern
|
||||||
@ -209,7 +209,7 @@ int RMPattern::Init(RMSfx *sfx, bool bPlayP0, byte *bFlag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int RMPattern::Update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx) {
|
int RMPattern::Update(uint32 hEndPattern, byte &bFlag, RMSfx *sfx) {
|
||||||
int CurTime = _vm->GetTime();
|
int CurTime = _vm->getTime();
|
||||||
|
|
||||||
// If the speed is 0, then the pattern never advances
|
// If the speed is 0, then the pattern never advances
|
||||||
if (m_speed == 0) {
|
if (m_speed == 0) {
|
||||||
@ -420,7 +420,7 @@ void RMSfx::ReadFromStream(RMDataStream &ds, bool bLOX) {
|
|||||||
ds.Read(raw, size);
|
ds.Read(raw, size);
|
||||||
|
|
||||||
// Create the sound effect
|
// Create the sound effect
|
||||||
m_fx = _vm->CreateSFX(raw);
|
m_fx = _vm->createSFX(raw);
|
||||||
m_fx->SetLoop(false);
|
m_fx->SetLoop(false);
|
||||||
|
|
||||||
// Close the read buffer which is no longer needed
|
// Close the read buffer which is no longer needed
|
||||||
@ -2085,10 +2085,10 @@ bool RMLocation::Load(RMDataStream &ds) {
|
|||||||
m_items = new RMItem[m_nItems];
|
m_items = new RMItem[m_nItems];
|
||||||
|
|
||||||
|
|
||||||
_vm->FreezeTime();
|
_vm->freezeTime();
|
||||||
for (i = 0; i < m_nItems && !ds.IsError(); i++)
|
for (i = 0; i < m_nItems && !ds.IsError(); i++)
|
||||||
ds >> m_items[i];
|
ds >> m_items[i];
|
||||||
_vm->UnfreezeTime();
|
_vm->unfreezeTime();
|
||||||
|
|
||||||
return ds.IsError();
|
return ds.IsError();
|
||||||
}
|
}
|
||||||
|
@ -621,7 +621,7 @@ void ScriptThread(CORO_PARAM, const void *param) {
|
|||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
_ctx->dwStartTime = _vm->GetTime();
|
_ctx->dwStartTime = _vm->getTime();
|
||||||
_ctx->numHandles = 0;
|
_ctx->numHandles = 0;
|
||||||
|
|
||||||
// debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Moments: %u\n",s->nMoments);
|
// debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Moments: %u\n",s->nMoments);
|
||||||
@ -629,9 +629,9 @@ void ScriptThread(CORO_PARAM, const void *param) {
|
|||||||
// Sleep for the required time
|
// Sleep for the required time
|
||||||
if (s->Moment[_ctx->i].dwTime == -1) {
|
if (s->Moment[_ctx->i].dwTime == -1) {
|
||||||
CORO_INVOKE_4(CoroScheduler.waitForMultipleObjects, _ctx->numHandles, cfHandles, true, CORO_INFINITE);
|
CORO_INVOKE_4(CoroScheduler.waitForMultipleObjects, _ctx->numHandles, cfHandles, true, CORO_INFINITE);
|
||||||
_ctx->dwStartTime = _vm->GetTime();
|
_ctx->dwStartTime = _vm->getTime();
|
||||||
} else {
|
} else {
|
||||||
_ctx->dwCurTime = _vm->GetTime();
|
_ctx->dwCurTime = _vm->getTime();
|
||||||
if (_ctx->dwCurTime < _ctx->dwStartTime + (s->Moment[_ctx->i].dwTime * 100)) {
|
if (_ctx->dwCurTime < _ctx->dwStartTime + (s->Moment[_ctx->i].dwTime * 100)) {
|
||||||
// debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Sleeping %lums\n",_ctx->dwStartTime+(s->Moment[_ctx->i].dwTime*100)-_ctx->dwCurTime);
|
// debugC(DEBUG_BASIC, kTonyDebugMPAL, "PlayScript(): Sleeping %lums\n",_ctx->dwStartTime+(s->Moment[_ctx->i].dwTime*100)-_ctx->dwCurTime);
|
||||||
CORO_INVOKE_1(CoroScheduler.sleep, _ctx->dwStartTime+(s->Moment[_ctx->i].dwTime * 100) - _ctx->dwCurTime);
|
CORO_INVOKE_1(CoroScheduler.sleep, _ctx->dwStartTime+(s->Moment[_ctx->i].dwTime * 100) - _ctx->dwCurTime);
|
||||||
@ -771,7 +771,7 @@ void ShutUpActionThread(CORO_PARAM, const void *param) {
|
|||||||
_ctx->slotNumber = _vm->_initialLoadSlotNumber;
|
_ctx->slotNumber = _vm->_initialLoadSlotNumber;
|
||||||
_vm->_initialLoadSlotNumber = -1;
|
_vm->_initialLoadSlotNumber = -1;
|
||||||
|
|
||||||
CORO_INVOKE_1(_vm->LoadState, _ctx->slotNumber);
|
CORO_INVOKE_1(_vm->loadState, _ctx->slotNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -903,7 +903,7 @@ void LocationPollThread(CORO_PARAM, const void *param) {
|
|||||||
CopyMemory(_ctx->MyActions[_ctx->k].CmdNum, _ctx->curItem->Action[_ctx->j].CmdNum,
|
CopyMemory(_ctx->MyActions[_ctx->k].CmdNum, _ctx->curItem->Action[_ctx->j].CmdNum,
|
||||||
MAX_COMMANDS_PER_ACTION * sizeof(uint16));
|
MAX_COMMANDS_PER_ACTION * sizeof(uint16));
|
||||||
|
|
||||||
_ctx->MyActions[_ctx->k].dwLastTime = _vm->GetTime();
|
_ctx->MyActions[_ctx->k].dwLastTime = _vm->getTime();
|
||||||
_ctx->k++;
|
_ctx->k++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -918,7 +918,7 @@ void LocationPollThread(CORO_PARAM, const void *param) {
|
|||||||
while (1) {
|
while (1) {
|
||||||
/* Cerchiamo tra tutte le idle actions quella a cui manca meno tempo per
|
/* Cerchiamo tra tutte le idle actions quella a cui manca meno tempo per
|
||||||
l'esecuzione */
|
l'esecuzione */
|
||||||
_ctx->curTime = _vm->GetTime();
|
_ctx->curTime = _vm->getTime();
|
||||||
_ctx->dwSleepTime = (uint32)-1L;
|
_ctx->dwSleepTime = (uint32)-1L;
|
||||||
|
|
||||||
for (_ctx->k = 0;_ctx->k<_ctx->nIdleActions;_ctx->k++)
|
for (_ctx->k = 0;_ctx->k<_ctx->nIdleActions;_ctx->k++)
|
||||||
@ -944,7 +944,7 @@ void LocationPollThread(CORO_PARAM, const void *param) {
|
|||||||
_ctx->MyThreads[_ctx->i].nItem = 0;
|
_ctx->MyThreads[_ctx->i].nItem = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_ctx->curTime = _vm->GetTime();
|
_ctx->curTime = _vm->getTime();
|
||||||
|
|
||||||
/* Loop through all the necessary idle actions */
|
/* Loop through all the necessary idle actions */
|
||||||
for (_ctx->k = 0; _ctx->k < _ctx->nIdleActions; _ctx->k++)
|
for (_ctx->k = 0; _ctx->k < _ctx->nIdleActions; _ctx->k++)
|
||||||
|
@ -59,7 +59,7 @@ TonyEngine::TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc) : Eng
|
|||||||
|
|
||||||
TonyEngine::~TonyEngine() {
|
TonyEngine::~TonyEngine() {
|
||||||
// Close the voice database
|
// Close the voice database
|
||||||
CloseVoiceDatabase();
|
closeVoiceDatabase();
|
||||||
|
|
||||||
// Reset the coroutine scheduler
|
// Reset the coroutine scheduler
|
||||||
CoroScheduler.reset();
|
CoroScheduler.reset();
|
||||||
@ -71,12 +71,12 @@ TonyEngine::~TonyEngine() {
|
|||||||
* Run the game
|
* Run the game
|
||||||
*/
|
*/
|
||||||
Common::Error TonyEngine::run() {
|
Common::Error TonyEngine::run() {
|
||||||
Common::ErrorCode result = Init();
|
Common::ErrorCode result = init();
|
||||||
if (result != Common::kNoError)
|
if (result != Common::kNoError)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
Play();
|
play();
|
||||||
Close();
|
close();
|
||||||
|
|
||||||
return Common::kNoError;
|
return Common::kNoError;
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ Common::Error TonyEngine::run() {
|
|||||||
/**
|
/**
|
||||||
* Initialise the game
|
* Initialise the game
|
||||||
*/
|
*/
|
||||||
Common::ErrorCode TonyEngine::Init() {
|
Common::ErrorCode TonyEngine::init() {
|
||||||
if (isCompressed()) {
|
if (isCompressed()) {
|
||||||
Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember("data1.cab");
|
Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember("data1.cab");
|
||||||
if (!stream)
|
if (!stream)
|
||||||
@ -97,11 +97,11 @@ Common::ErrorCode TonyEngine::Init() {
|
|||||||
SearchMan.add("data1.cab", cabinet);
|
SearchMan.add("data1.cab", cabinet);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hEndOfFrame = CoroScheduler.createEvent(false, false);
|
_hEndOfFrame = CoroScheduler.createEvent(false, false);
|
||||||
|
|
||||||
m_bPaused = false;
|
_bPaused = false;
|
||||||
m_bDrawLocation = true;
|
_bDrawLocation = true;
|
||||||
m_startTime = g_system->getMillis();
|
_startTime = g_system->getMillis();
|
||||||
|
|
||||||
// Init static class fields
|
// Init static class fields
|
||||||
RMText::InitStatics();
|
RMText::InitStatics();
|
||||||
@ -114,8 +114,8 @@ Common::ErrorCode TonyEngine::Init() {
|
|||||||
_window.Init();
|
_window.Init();
|
||||||
|
|
||||||
// Initialise the function list
|
// Initialise the function list
|
||||||
Common::fill(FuncList, FuncList + 300, (LPCUSTOMFUNCTION)NULL);
|
Common::fill(_funcList, _funcList + 300, (LPCUSTOMFUNCTION)NULL);
|
||||||
InitCustomFunctionMap();
|
initCustomFunctionMap();
|
||||||
|
|
||||||
// Initializes MPAL system, passing the custom functions list
|
// Initializes MPAL system, passing the custom functions list
|
||||||
Common::File f;
|
Common::File f;
|
||||||
@ -123,17 +123,17 @@ Common::ErrorCode TonyEngine::Init() {
|
|||||||
return Common::kReadingFailed;
|
return Common::kReadingFailed;
|
||||||
f.close();
|
f.close();
|
||||||
|
|
||||||
if (!mpalInit("ROASTED.MPC", "ROASTED.MPR", FuncList, FuncListStrings))
|
if (!mpalInit("ROASTED.MPC", "ROASTED.MPR", _funcList, _funcListStrings))
|
||||||
return Common::kUnknownError;
|
return Common::kUnknownError;
|
||||||
|
|
||||||
// Initialise the update resources
|
// Initialise the update resources
|
||||||
_resUpdate.Init("ROASTED.MPU");
|
_resUpdate.Init("ROASTED.MPU");
|
||||||
|
|
||||||
// Initialise the music
|
// Initialise the music
|
||||||
InitMusic();
|
initMusic();
|
||||||
|
|
||||||
// Initialise the voices database
|
// Initialise the voices database
|
||||||
if (!OpenVoiceDatabase())
|
if (!openVoiceDatabase())
|
||||||
return Common::kReadingFailed;
|
return Common::kReadingFailed;
|
||||||
|
|
||||||
// Initialise the boxes
|
// Initialise the boxes
|
||||||
@ -144,7 +144,7 @@ Common::ErrorCode TonyEngine::Init() {
|
|||||||
_theEngine.Init();
|
_theEngine.Init();
|
||||||
|
|
||||||
// Allocate space for thumbnails when saving the game
|
// Allocate space for thumbnails when saving the game
|
||||||
m_curThumbnail = new uint16[160 * 120];
|
_curThumbnail = new uint16[160 * 120];
|
||||||
|
|
||||||
// Set up global defaults
|
// Set up global defaults
|
||||||
GLOBALS.bCfgInvLocked = false;
|
GLOBALS.bCfgInvLocked = false;
|
||||||
@ -164,13 +164,13 @@ Common::ErrorCode TonyEngine::Init() {
|
|||||||
GLOBALS.nCfgDubbingVolume = 10;
|
GLOBALS.nCfgDubbingVolume = 10;
|
||||||
GLOBALS.nCfgMusicVolume = 7;
|
GLOBALS.nCfgMusicVolume = 7;
|
||||||
GLOBALS.nCfgSFXVolume = 10;
|
GLOBALS.nCfgSFXVolume = 10;
|
||||||
m_bQuitNow = false;
|
_bQuitNow = false;
|
||||||
|
|
||||||
return Common::kNoError;
|
return Common::kNoError;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::InitCustomFunctionMap() {
|
void TonyEngine::initCustomFunctionMap() {
|
||||||
INIT_CUSTOM_FUNCTION(FuncList, FuncListStrings);
|
INIT_CUSTOM_FUNCTION(_funcList, _funcListStrings);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -180,8 +180,8 @@ void TonyEngine::GUIError(const Common::String &msg) {
|
|||||||
GUIErrorMessage(msg);
|
GUIErrorMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, int nSync) {
|
void TonyEngine::playMusic(int nChannel, const char *fn, int nFX, bool bLoop, int nSync) {
|
||||||
warning("TODO: TonyEngine::PlayMusic");
|
warning("TODO: TonyEngine::playMusic");
|
||||||
// g_system->lockMutex(csMusic);
|
// g_system->lockMutex(csMusic);
|
||||||
|
|
||||||
if (nChannel < 4)
|
if (nChannel < 4)
|
||||||
@ -192,8 +192,8 @@ void TonyEngine::PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, in
|
|||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
m_stream[nChannel]->Stop();
|
_stream[nChannel]->Stop();
|
||||||
m_stream[nChannel]->UnloadFile();
|
_stream[nChannel]->UnloadFile();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 22:
|
case 22:
|
||||||
@ -222,7 +222,7 @@ void TonyEngine::PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, in
|
|||||||
else
|
else
|
||||||
nextChannel = nChannel + 1;
|
nextChannel = nChannel + 1;
|
||||||
DWORD id;
|
DWORD id;
|
||||||
HANDLE hThread = CreateThread(NULL, 10240, (LPTHREAD_START_ROUTINE)DoNextMusic, m_stream, 0, &id);
|
HANDLE hThread = CreateThread(NULL, 10240, (LPTHREAD_START_ROUTINE)DoNextMusic, _stream, 0, &id);
|
||||||
SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);
|
SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);
|
||||||
} else if (nFX == 44) { // Cambia canale e lascia finire il primo
|
} else if (nFX == 44) { // Cambia canale e lascia finire il primo
|
||||||
if (flipflop)
|
if (flipflop)
|
||||||
@ -230,103 +230,103 @@ void TonyEngine::PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, in
|
|||||||
else
|
else
|
||||||
nextChannel = nChannel + 1;
|
nextChannel = nChannel + 1;
|
||||||
|
|
||||||
m_stream[nextChannel]->Stop();
|
_stream[nextChannel]->Stop();
|
||||||
m_stream[nextChannel]->UnloadFile();
|
_stream[nextChannel]->UnloadFile();
|
||||||
|
|
||||||
if (!getIsDemo()) {
|
if (!getIsDemo()) {
|
||||||
if (!m_stream[nextChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync))
|
if (!_stream[nextChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync))
|
||||||
theGame.Abort();
|
theGame.Abort();
|
||||||
} else {
|
} else {
|
||||||
m_stream[nextChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync);
|
_stream[nextChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_stream[nextChannel]->SetLoop(bLoop);
|
_stream[nextChannel]->SetLoop(bLoop);
|
||||||
m_stream[nextChannel]->Play();
|
_stream[nextChannel]->Play();
|
||||||
|
|
||||||
flipflop = 1 - flipflop;
|
flipflop = 1 - flipflop;
|
||||||
} else {
|
} else {
|
||||||
if (!getIsDemo()) {
|
if (!getIsDemo()) {
|
||||||
if (!m_stream[nChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync))
|
if (!_stream[nChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync))
|
||||||
theGame.Abort();
|
theGame.Abort();
|
||||||
} else {
|
} else {
|
||||||
m_stream[nChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync);
|
_stream[nChannel]->LoadFile(path_buffer, FPCODEC_ADPCM, nSync);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_stream[nChannel]->SetLoop(bLoop);
|
_stream[nChannel]->SetLoop(bLoop);
|
||||||
m_stream[nChannel]->Play();
|
_stream[nChannel]->Play();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// g_system->unlockMutex(csMusic);
|
// g_system->unlockMutex(csMusic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::PlaySFX(int nChannel, int nFX) {
|
void TonyEngine::playSFX(int nChannel, int nFX) {
|
||||||
if (m_sfx[nChannel] == NULL)
|
if (_sfx[nChannel] == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (nFX) {
|
switch (nFX) {
|
||||||
case 0:
|
case 0:
|
||||||
m_sfx[nChannel]->SetLoop(false);
|
_sfx[nChannel]->SetLoop(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
m_sfx[nChannel]->SetLoop(true);
|
_sfx[nChannel]->SetLoop(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sfx[nChannel]->Play();
|
_sfx[nChannel]->Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::StopMusic(int nChannel) {
|
void TonyEngine::stopMusic(int nChannel) {
|
||||||
// g_system->lockMutex(csMusic);
|
// g_system->lockMutex(csMusic);
|
||||||
|
|
||||||
if (nChannel < 4)
|
if (nChannel < 4)
|
||||||
m_stream[nChannel + GLOBALS.flipflop]->Stop();
|
_stream[nChannel + GLOBALS.flipflop]->Stop();
|
||||||
else
|
else
|
||||||
m_stream[nChannel]->Stop();
|
_stream[nChannel]->Stop();
|
||||||
|
|
||||||
// g_system->unlockMutex(csMusic);
|
// g_system->unlockMutex(csMusic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::StopSFX(int nChannel) {
|
void TonyEngine::stopSFX(int nChannel) {
|
||||||
m_sfx[nChannel]->Stop();
|
_sfx[nChannel]->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::PlayUtilSFX(int nChannel, int nFX) {
|
void TonyEngine::playUtilSFX(int nChannel, int nFX) {
|
||||||
if (m_utilSfx[nChannel] == NULL)
|
if (_utilSfx[nChannel] == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (nFX) {
|
switch (nFX) {
|
||||||
case 0:
|
case 0:
|
||||||
m_utilSfx[nChannel]->SetLoop(false);
|
_utilSfx[nChannel]->SetLoop(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
m_utilSfx[nChannel]->SetLoop(true);
|
_utilSfx[nChannel]->SetLoop(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_utilSfx[nChannel]->SetVolume(52);
|
_utilSfx[nChannel]->SetVolume(52);
|
||||||
m_utilSfx[nChannel]->Play();
|
_utilSfx[nChannel]->Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::StopUtilSFX(int nChannel) {
|
void TonyEngine::stopUtilSFX(int nChannel) {
|
||||||
m_utilSfx[nChannel]->Stop();
|
_utilSfx[nChannel]->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::PreloadSFX(int nChannel, const char *fn) {
|
void TonyEngine::preloadSFX(int nChannel, const char *fn) {
|
||||||
if (m_sfx[nChannel] != NULL) {
|
if (_sfx[nChannel] != NULL) {
|
||||||
m_sfx[nChannel]->Stop();
|
_sfx[nChannel]->Stop();
|
||||||
m_sfx[nChannel]->Release();
|
_sfx[nChannel]->Release();
|
||||||
m_sfx[nChannel] = NULL;
|
_sfx[nChannel] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
_theSound.CreateSfx(&m_sfx[nChannel]);
|
_theSound.CreateSfx(&_sfx[nChannel]);
|
||||||
|
|
||||||
m_sfx[nChannel]->LoadFile(fn, FPCODEC_ADPCM);
|
_sfx[nChannel]->LoadFile(fn, FPCODEC_ADPCM);
|
||||||
}
|
}
|
||||||
|
|
||||||
FPSFX *TonyEngine::CreateSFX(byte *buf) {
|
FPSFX *TonyEngine::createSFX(byte *buf) {
|
||||||
FPSFX *sfx;
|
FPSFX *sfx;
|
||||||
|
|
||||||
_theSound.CreateSfx(&sfx);
|
_theSound.CreateSfx(&sfx);
|
||||||
@ -334,106 +334,105 @@ FPSFX *TonyEngine::CreateSFX(byte *buf) {
|
|||||||
return sfx;
|
return sfx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::PreloadUtilSFX(int nChannel, const char *fn) {
|
void TonyEngine::preloadUtilSFX(int nChannel, const char *fn) {
|
||||||
warning("TonyEngine::PreloadUtilSFX");
|
warning("TonyEngine::preloadUtilSFX");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::UnloadAllSFX(void) {
|
void TonyEngine::unloadAllSFX(void) {
|
||||||
warning("TonyEngine::UnloadAllSFX");
|
warning("TonyEngine::unloadAllSFX");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::UnloadAllUtilSFX(void) {
|
void TonyEngine::unloadAllUtilSFX(void) {
|
||||||
warning("TonyEngine::UnloadAllUtilSFX");
|
warning("TonyEngine::unloadAllUtilSFX");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::InitMusic() {
|
void TonyEngine::initMusic() {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
_theSound.Init(/*_window*/);
|
_theSound.Init(/*_window*/);
|
||||||
_theSound.SetMasterVolume(63);
|
_theSound.SetMasterVolume(63);
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
_theSound.CreateStream(&m_stream[i]);
|
_theSound.CreateStream(&_stream[i]);
|
||||||
|
|
||||||
for (i = 0; i < MAX_SFX_CHANNELS; i++) {
|
for (i = 0; i < MAX_SFX_CHANNELS; i++) {
|
||||||
m_sfx[i] = m_utilSfx[i] = NULL;
|
_sfx[i] = _utilSfx[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the mutex for controlling music access
|
// Create the mutex for controlling music access
|
||||||
// csMusic = g_system->createMutex();
|
// csMusic = g_system->createMutex();
|
||||||
|
|
||||||
// Preload sound effects
|
// Preload sound effects
|
||||||
PreloadUtilSFX(0, "U01.ADP"); // Reversed!!
|
preloadUtilSFX(0, "U01.ADP"); // Reversed!!
|
||||||
PreloadUtilSFX(1, "U02.ADP");
|
preloadUtilSFX(1, "U02.ADP");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::CloseMusic() {
|
void TonyEngine::closeMusic() {
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
m_stream[i]->Stop();
|
_stream[i]->Stop();
|
||||||
m_stream[i]->UnloadFile();
|
_stream[i]->UnloadFile();
|
||||||
m_stream[i]->Release();
|
_stream[i]->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
// g_system->deleteMutex(csMusic);
|
// g_system->deleteMutex(csMusic);
|
||||||
|
|
||||||
UnloadAllSFX();
|
unloadAllSFX();
|
||||||
UnloadAllUtilSFX();
|
unloadAllUtilSFX();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::PauseSound(bool bPause) {
|
void TonyEngine::pauseSound(bool bPause) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::SetMusicVolume(int nChannel, int volume) {
|
void TonyEngine::setMusicVolume(int nChannel, int volume) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int TonyEngine::GetMusicVolume(int nChannel) {
|
int TonyEngine::getMusicVolume(int nChannel) {
|
||||||
return 255;
|
return 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Common::String TonyEngine::getSaveStateFileName(int n) {
|
||||||
Common::String TonyEngine::GetSaveStateFileName(int n) {
|
|
||||||
return Common::String::format("tony.%03d", n);
|
return Common::String::format("tony.%03d", n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::AutoSave(CORO_PARAM) {
|
void TonyEngine::autoSave(CORO_PARAM) {
|
||||||
CORO_BEGIN_CONTEXT;
|
CORO_BEGIN_CONTEXT;
|
||||||
Common::String buf;
|
Common::String buf;
|
||||||
CORO_END_CONTEXT(_ctx);
|
CORO_END_CONTEXT(_ctx);
|
||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
GrabThumbnail();
|
grabThumbnail();
|
||||||
CORO_INVOKE_0(MainWaitFrame);
|
CORO_INVOKE_0(MainWaitFrame);
|
||||||
CORO_INVOKE_0(MainWaitFrame);
|
CORO_INVOKE_0(MainWaitFrame);
|
||||||
MainFreeze();
|
MainFreeze();
|
||||||
_ctx->buf = GetSaveStateFileName(0);
|
_ctx->buf = getSaveStateFileName(0);
|
||||||
_theEngine.SaveState(_ctx->buf, (byte *)m_curThumbnail, "Autosave");
|
_theEngine.SaveState(_ctx->buf, (byte *)_curThumbnail, "Autosave");
|
||||||
MainUnfreeze();
|
MainUnfreeze();
|
||||||
|
|
||||||
CORO_END_CODE;
|
CORO_END_CODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TonyEngine::SaveState(int n, const char *name) {
|
void TonyEngine::saveState(int n, const char *name) {
|
||||||
Common::String buf = GetSaveStateFileName(n);
|
Common::String buf = getSaveStateFileName(n);
|
||||||
_theEngine.SaveState(buf.c_str(), (byte *)m_curThumbnail, name);
|
_theEngine.SaveState(buf.c_str(), (byte *)_curThumbnail, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TonyEngine::LoadState(CORO_PARAM, int n) {
|
void TonyEngine::loadState(CORO_PARAM, int n) {
|
||||||
CORO_BEGIN_CONTEXT;
|
CORO_BEGIN_CONTEXT;
|
||||||
Common::String buf;
|
Common::String buf;
|
||||||
CORO_END_CONTEXT(_ctx);
|
CORO_END_CONTEXT(_ctx);
|
||||||
|
|
||||||
CORO_BEGIN_CODE(_ctx);
|
CORO_BEGIN_CODE(_ctx);
|
||||||
|
|
||||||
_ctx->buf = GetSaveStateFileName(n);
|
_ctx->buf = getSaveStateFileName(n);
|
||||||
CORO_INVOKE_1(_theEngine.LoadState, _ctx->buf.c_str());
|
CORO_INVOKE_1(_theEngine.LoadState, _ctx->buf.c_str());
|
||||||
|
|
||||||
CORO_END_CODE;
|
CORO_END_CODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TonyEngine::OpenVoiceDatabase() {
|
bool TonyEngine::openVoiceDatabase() {
|
||||||
char id[4];
|
char id[4];
|
||||||
uint32 numfiles;
|
uint32 numfiles;
|
||||||
|
|
||||||
@ -459,9 +458,9 @@ bool TonyEngine::OpenVoiceDatabase() {
|
|||||||
|
|
||||||
for (uint32 i = 0; i < numfiles; ++i) {
|
for (uint32 i = 0; i < numfiles; ++i) {
|
||||||
VoiceHeader vh;
|
VoiceHeader vh;
|
||||||
vh.offset = _vdbFP.readUint32LE();
|
vh._offset = _vdbFP.readUint32LE();
|
||||||
vh.code = _vdbFP.readUint32LE();
|
vh._code = _vdbFP.readUint32LE();
|
||||||
vh.parts = _vdbFP.readUint32LE();
|
vh._parts = _vdbFP.readUint32LE();
|
||||||
|
|
||||||
_voices.push_back(vh);
|
_voices.push_back(vh);
|
||||||
}
|
}
|
||||||
@ -469,7 +468,7 @@ bool TonyEngine::OpenVoiceDatabase() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::CloseVoiceDatabase() {
|
void TonyEngine::closeVoiceDatabase() {
|
||||||
if (_vdbFP.isOpen())
|
if (_vdbFP.isOpen())
|
||||||
_vdbFP.close();
|
_vdbFP.close();
|
||||||
|
|
||||||
@ -477,23 +476,23 @@ void TonyEngine::CloseVoiceDatabase() {
|
|||||||
_voices.clear();
|
_voices.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::GrabThumbnail(void) {
|
void TonyEngine::grabThumbnail(void) {
|
||||||
_window.GrabThumbnail(m_curThumbnail);
|
_window.GrabThumbnail(_curThumbnail);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::OptionScreen(void) {
|
void TonyEngine::optionScreen(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::OpenInitLoadMenu(CORO_PARAM) {
|
void TonyEngine::openInitLoadMenu(CORO_PARAM) {
|
||||||
_theEngine.OpenOptionScreen(coroParam, 1);
|
_theEngine.OpenOptionScreen(coroParam, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::OpenInitOptions(CORO_PARAM) {
|
void TonyEngine::openInitOptions(CORO_PARAM) {
|
||||||
_theEngine.OpenOptionScreen(coroParam, 2);
|
_theEngine.OpenOptionScreen(coroParam, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::Abort(void) {
|
void TonyEngine::abortGame(void) {
|
||||||
m_bQuitNow = true;
|
_bQuitNow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -504,7 +503,7 @@ void TonyEngine::Abort(void) {
|
|||||||
* process. If it ever proves a problem, we may have to look into whether it's feasible to have it still remain
|
* process. If it ever proves a problem, we may have to look into whether it's feasible to have it still remain
|
||||||
* in the outer 'main' process.
|
* in the outer 'main' process.
|
||||||
*/
|
*/
|
||||||
void TonyEngine::PlayProcess(CORO_PARAM, const void *param) {
|
void TonyEngine::playProcess(CORO_PARAM, const void *param) {
|
||||||
CORO_BEGIN_CONTEXT;
|
CORO_BEGIN_CONTEXT;
|
||||||
Common::String fn;
|
Common::String fn;
|
||||||
CORO_END_CONTEXT(_ctx);
|
CORO_END_CONTEXT(_ctx);
|
||||||
@ -517,7 +516,7 @@ void TonyEngine::PlayProcess(CORO_PARAM, const void *param) {
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
// If a savegame needs to be loaded, then do so
|
// If a savegame needs to be loaded, then do so
|
||||||
if (_vm->_loadSlotNumber != -1 && GLOBALS.GfxEngine != NULL) {
|
if (_vm->_loadSlotNumber != -1 && GLOBALS.GfxEngine != NULL) {
|
||||||
_ctx->fn = GetSaveStateFileName(_vm->_loadSlotNumber);
|
_ctx->fn = getSaveStateFileName(_vm->_loadSlotNumber);
|
||||||
CORO_INVOKE_1(GLOBALS.GfxEngine->LoadState, _ctx->fn);
|
CORO_INVOKE_1(GLOBALS.GfxEngine->LoadState, _ctx->fn);
|
||||||
_vm->_loadSlotNumber = -1;
|
_vm->_loadSlotNumber = -1;
|
||||||
}
|
}
|
||||||
@ -526,13 +525,13 @@ void TonyEngine::PlayProcess(CORO_PARAM, const void *param) {
|
|||||||
CORO_INVOKE_1(CoroScheduler.sleep, 50);
|
CORO_INVOKE_1(CoroScheduler.sleep, 50);
|
||||||
|
|
||||||
// Call the engine to handle the next frame
|
// Call the engine to handle the next frame
|
||||||
CORO_INVOKE_1(_vm->_theEngine.DoFrame, _vm->m_bDrawLocation);
|
CORO_INVOKE_1(_vm->_theEngine.DoFrame, _vm->_bDrawLocation);
|
||||||
|
|
||||||
// Warns that a frame is finished
|
// Warns that a frame is finished
|
||||||
CoroScheduler.pulseEvent(_vm->m_hEndOfFrame);
|
CoroScheduler.pulseEvent(_vm->_hEndOfFrame);
|
||||||
|
|
||||||
// Handle drawing the frame
|
// Handle drawing the frame
|
||||||
if (!_vm->m_bPaused) {
|
if (!_vm->_bPaused) {
|
||||||
if (!_vm->_theEngine.m_bWiping)
|
if (!_vm->_theEngine.m_bWiping)
|
||||||
_vm->_window.GetNewFrame(_vm->_theEngine, NULL);
|
_vm->_window.GetNewFrame(_vm->_theEngine, NULL);
|
||||||
else
|
else
|
||||||
@ -552,12 +551,12 @@ void TonyEngine::PlayProcess(CORO_PARAM, const void *param) {
|
|||||||
/**
|
/**
|
||||||
* Play the game
|
* Play the game
|
||||||
*/
|
*/
|
||||||
void TonyEngine::Play(void) {
|
void TonyEngine::play(void) {
|
||||||
// Create the game player process
|
// Create the game player process
|
||||||
CoroScheduler.createProcess(PlayProcess, NULL);
|
CoroScheduler.createProcess(playProcess, NULL);
|
||||||
|
|
||||||
// Loop through calling the scheduler until it's time for the game to quit
|
// Loop through calling the scheduler until it's time for the game to quit
|
||||||
while (!shouldQuit() && !m_bQuitNow) {
|
while (!shouldQuit() && !_bQuitNow) {
|
||||||
// Delay for a brief amount
|
// Delay for a brief amount
|
||||||
g_system->delayMillis(10);
|
g_system->delayMillis(10);
|
||||||
|
|
||||||
@ -566,18 +565,16 @@ void TonyEngine::Play(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TonyEngine::close(void) {
|
||||||
|
closeMusic();
|
||||||
void TonyEngine::Close(void) {
|
CoroScheduler.closeEvent(_hEndOfFrame);
|
||||||
CloseMusic();
|
|
||||||
CoroScheduler.closeEvent(m_hEndOfFrame);
|
|
||||||
_theBoxes.Close();
|
_theBoxes.Close();
|
||||||
_theEngine.Close();
|
_theEngine.Close();
|
||||||
_window.Close();
|
_window.Close();
|
||||||
delete[] m_curThumbnail;
|
delete[] _curThumbnail;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::SwitchFullscreen(bool bFull) {
|
void TonyEngine::switchFullscreen(bool bFull) {
|
||||||
_window.SwitchFullscreen(bFull);
|
_window.SwitchFullscreen(bFull);
|
||||||
_theEngine.SwitchFullscreen(bFull);
|
_theEngine.SwitchFullscreen(bFull);
|
||||||
}
|
}
|
||||||
@ -586,21 +583,20 @@ void TonyEngine::GDIControl(bool bCon) {
|
|||||||
_theEngine.GDIControl(bCon);
|
_theEngine.GDIControl(bCon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TonyEngine::freezeTime(void) {
|
||||||
void TonyEngine::FreezeTime(void) {
|
_bTimeFreezed = true;
|
||||||
m_bTimeFreezed = true;
|
_nTimeFreezed = getTime() - _startTime;
|
||||||
m_nTimeFreezed = GetTime() - m_startTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TonyEngine::UnfreezeTime(void) {
|
void TonyEngine::unfreezeTime(void) {
|
||||||
m_bTimeFreezed = false;
|
_bTimeFreezed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the millisecond timer
|
* Returns the millisecond timer
|
||||||
*/
|
*/
|
||||||
uint32 TonyEngine::GetTime() {
|
uint32 TonyEngine::getTime() {
|
||||||
return g_system->getMillis();
|
return g_system->getMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,9 +617,9 @@ Common::Error TonyEngine::saveGameState(int slot, const Common::String &desc) {
|
|||||||
return Common::kUnknownError;
|
return Common::kUnknownError;
|
||||||
|
|
||||||
RMSnapshot s;
|
RMSnapshot s;
|
||||||
s.GrabScreenshot(*GLOBALS.GfxEngine, 4, m_curThumbnail);
|
s.GrabScreenshot(*GLOBALS.GfxEngine, 4, _curThumbnail);
|
||||||
|
|
||||||
GLOBALS.GfxEngine->SaveState(GetSaveStateFileName(slot), (byte *)m_curThumbnail, desc);
|
GLOBALS.GfxEngine->SaveState(getSaveStateFileName(slot), (byte *)_curThumbnail, desc);
|
||||||
return Common::kNoError;
|
return Common::kNoError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,32 +72,32 @@ struct TonyGameDescription;
|
|||||||
#define MAX_SFX_CHANNELS 32
|
#define MAX_SFX_CHANNELS 32
|
||||||
|
|
||||||
struct VoiceHeader {
|
struct VoiceHeader {
|
||||||
int offset;
|
int _offset;
|
||||||
int code;
|
int _code;
|
||||||
int parts;
|
int _parts;
|
||||||
};
|
};
|
||||||
#define VOICE_HEADER_SIZE 12
|
#define VOICE_HEADER_SIZE 12
|
||||||
|
|
||||||
class TonyEngine : public Engine {
|
class TonyEngine : public Engine {
|
||||||
private:
|
private:
|
||||||
Common::ErrorCode Init();
|
Common::ErrorCode init();
|
||||||
void InitMusic();
|
void initMusic();
|
||||||
void CloseMusic();
|
void closeMusic();
|
||||||
bool OpenVoiceDatabase();
|
bool openVoiceDatabase();
|
||||||
void CloseVoiceDatabase();
|
void closeVoiceDatabase();
|
||||||
void InitCustomFunctionMap();
|
void initCustomFunctionMap();
|
||||||
static void PlayProcess(CORO_PARAM, const void *param);
|
static void playProcess(CORO_PARAM, const void *param);
|
||||||
protected:
|
protected:
|
||||||
// Engine APIs
|
// Engine APIs
|
||||||
virtual Common::Error run();
|
virtual Common::Error run();
|
||||||
virtual bool hasFeature(EngineFeature f) const;
|
virtual bool hasFeature(EngineFeature f) const;
|
||||||
public:
|
public:
|
||||||
LPCUSTOMFUNCTION FuncList[300];
|
LPCUSTOMFUNCTION _funcList[300];
|
||||||
Common::String FuncListStrings[300];
|
Common::String _funcListStrings[300];
|
||||||
Common::RandomSource _randomSource;
|
Common::RandomSource _randomSource;
|
||||||
MPAL::MemoryManager _memoryManager;
|
MPAL::MemoryManager _memoryManager;
|
||||||
RMResUpdate _resUpdate;
|
RMResUpdate _resUpdate;
|
||||||
uint32 m_hEndOfFrame;
|
uint32 _hEndOfFrame;
|
||||||
Common::File _vdbFP;
|
Common::File _vdbFP;
|
||||||
Common::Array<VoiceHeader> _voices;
|
Common::Array<VoiceHeader> _voices;
|
||||||
FPSOUND _theSound;
|
FPSOUND _theSound;
|
||||||
@ -115,14 +115,14 @@ public:
|
|||||||
DD_BASE2
|
DD_BASE2
|
||||||
};
|
};
|
||||||
|
|
||||||
FPSTREAM *m_stream[6];
|
FPSTREAM *_stream[6];
|
||||||
FPSFX *m_sfx[MAX_SFX_CHANNELS];
|
FPSFX *_sfx[MAX_SFX_CHANNELS];
|
||||||
FPSFX *m_utilSfx[MAX_SFX_CHANNELS];
|
FPSFX *_utilSfx[MAX_SFX_CHANNELS];
|
||||||
RMFont *fonts[2];
|
// RMFont *_fonts[2];
|
||||||
bool m_bPaused;
|
bool _bPaused;
|
||||||
bool m_bDrawLocation;
|
bool _bDrawLocation;
|
||||||
int m_startTime;
|
int _startTime;
|
||||||
uint16 *m_curThumbnail;
|
uint16 *_curThumbnail;
|
||||||
int _initialLoadSlotNumber;
|
int _initialLoadSlotNumber;
|
||||||
int _loadSlotNumber;
|
int _loadSlotNumber;
|
||||||
|
|
||||||
@ -131,9 +131,9 @@ public:
|
|||||||
RMWindow _window;
|
RMWindow _window;
|
||||||
RMGfxEngine _theEngine;
|
RMGfxEngine _theEngine;
|
||||||
|
|
||||||
bool m_bQuitNow;
|
bool _bQuitNow;
|
||||||
bool m_bTimeFreezed;
|
bool _bTimeFreezed;
|
||||||
int m_nTimeFreezed;
|
int _nTimeFreezed;
|
||||||
public:
|
public:
|
||||||
TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc);
|
TonyEngine(OSystem *syst, const TonyGameDescription *gameDesc);
|
||||||
virtual ~TonyEngine();
|
virtual ~TonyEngine();
|
||||||
@ -144,7 +144,7 @@ public:
|
|||||||
uint16 getVersion() const;
|
uint16 getVersion() const;
|
||||||
bool getIsDemo() const;
|
bool getIsDemo() const;
|
||||||
bool isCompressed() const;
|
bool isCompressed() const;
|
||||||
RMGfxEngine *GetEngine() {
|
RMGfxEngine *getEngine() {
|
||||||
return &_theEngine;
|
return &_theEngine;
|
||||||
}
|
}
|
||||||
void GUIError(const Common::String &msg);
|
void GUIError(const Common::String &msg);
|
||||||
@ -157,70 +157,70 @@ public:
|
|||||||
// Warn when are being controlled by the GDI
|
// Warn when are being controlled by the GDI
|
||||||
void GDIControl(bool bCon);
|
void GDIControl(bool bCon);
|
||||||
|
|
||||||
void Play();
|
void play();
|
||||||
void Close();
|
void close();
|
||||||
void Abort();
|
void abortGame();
|
||||||
|
|
||||||
void GetDataDirectory(DATADIR dir, char *path);
|
void getDataDirectory(DATADIR dir, char *path);
|
||||||
|
|
||||||
void SwitchFullscreen(bool bFull);
|
void switchFullscreen(bool bFull);
|
||||||
void OptionScreen(void);
|
void optionScreen(void);
|
||||||
|
|
||||||
void ShowLocation(void) {
|
void showLocation(void) {
|
||||||
m_bDrawLocation = true;
|
_bDrawLocation = true;
|
||||||
}
|
}
|
||||||
void HideLocation(void) {
|
void hideLocation(void) {
|
||||||
m_bDrawLocation = false;
|
_bDrawLocation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reads the time
|
// Reads the time
|
||||||
uint32 GetTime(void);
|
uint32 getTime(void);
|
||||||
void FreezeTime(void);
|
void freezeTime(void);
|
||||||
void UnfreezeTime(void);
|
void unfreezeTime(void);
|
||||||
|
|
||||||
// Music
|
// Music
|
||||||
// ******
|
// ******
|
||||||
void PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, int nSync);
|
void playMusic(int nChannel, const char *fn, int nFX, bool bLoop, int nSync);
|
||||||
void StopMusic(int nChannel);
|
void stopMusic(int nChannel);
|
||||||
|
|
||||||
void PlaySFX(int nSfx, int nFX = 0);
|
void playSFX(int nSfx, int nFX = 0);
|
||||||
void StopSFX(int nSfx);
|
void stopSFX(int nSfx);
|
||||||
|
|
||||||
void PlayUtilSFX(int nSfx, int nFX = 0);
|
void playUtilSFX(int nSfx, int nFX = 0);
|
||||||
void StopUtilSFX(int nSfx);
|
void stopUtilSFX(int nSfx);
|
||||||
|
|
||||||
FPSFX *CreateSFX(byte *buf);
|
FPSFX *createSFX(byte *buf);
|
||||||
|
|
||||||
void PreloadSFX(int nSfx, const char *fn);
|
void preloadSFX(int nSfx, const char *fn);
|
||||||
void UnloadAllSFX(void);
|
void unloadAllSFX(void);
|
||||||
|
|
||||||
void PreloadUtilSFX(int nSfx, const char *fn);
|
void preloadUtilSFX(int nSfx, const char *fn);
|
||||||
void UnloadAllUtilSFX(void);
|
void unloadAllUtilSFX(void);
|
||||||
|
|
||||||
// Stop all the audio
|
// Stop all the audio
|
||||||
void PauseSound(bool bPause);
|
void pauseSound(bool bPause);
|
||||||
|
|
||||||
void SetMusicVolume(int nChannel, int volume);
|
void setMusicVolume(int nChannel, int volume);
|
||||||
int GetMusicVolume(int nChannel);
|
int getMusicVolume(int nChannel);
|
||||||
|
|
||||||
// Handle saving
|
// Handle saving
|
||||||
void AutoSave(CORO_PARAM);
|
void autoSave(CORO_PARAM);
|
||||||
void SaveState(int n, const char *name);
|
void saveState(int n, const char *name);
|
||||||
void LoadState(CORO_PARAM, int n);
|
void loadState(CORO_PARAM, int n);
|
||||||
static Common::String GetSaveStateFileName(int n);
|
static Common::String getSaveStateFileName(int n);
|
||||||
|
|
||||||
// Get a thumbnail
|
// Get a thumbnail
|
||||||
void GrabThumbnail(void);
|
void grabThumbnail(void);
|
||||||
uint16 *GetThumbnail(void) {
|
uint16 *getThumbnail(void) {
|
||||||
return m_curThumbnail;
|
return _curThumbnail;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Quit(void) {
|
void quitGame(void) {
|
||||||
m_bQuitNow = true;
|
_bQuitNow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenInitLoadMenu(CORO_PARAM);
|
void openInitLoadMenu(CORO_PARAM);
|
||||||
void OpenInitOptions(CORO_PARAM);
|
void openInitOptions(CORO_PARAM);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Global reference to the TonyEngine object
|
// Global reference to the TonyEngine object
|
||||||
|
@ -119,7 +119,7 @@ void RMTony::Init(void) {
|
|||||||
ds.Close();
|
ds.Close();
|
||||||
m_body.SetPattern(0);
|
m_body.SetPattern(0);
|
||||||
|
|
||||||
m_nTimeLastStep = _vm->GetTime();
|
m_nTimeLastStep = _vm->getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) {
|
|||||||
SetSpeed(GLOBALS.nCfgTonySpeed);
|
SetSpeed(GLOBALS.nCfgTonySpeed);
|
||||||
|
|
||||||
// Runs the normal character movement
|
// Runs the normal character movement
|
||||||
_ctx->time = _vm->GetTime();
|
_ctx->time = _vm->getTime();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
m_nTimeLastStep += (1000 / 40);
|
m_nTimeLastStep += (1000 / 40);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user