diff options
author | Paul Gilbert | 2012-05-03 22:49:30 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-03 22:49:30 +1000 |
commit | a2982a0b20027f658c9b47266a8ddbec74a15878 (patch) | |
tree | c324455bc893fbc48ffb6b13fa4b153e30b93a7d /engines/tony/tony.cpp | |
parent | ba2711b5e39e495c4cfb1187710605bb9fbf10b1 (diff) | |
download | scummvm-rg350-a2982a0b20027f658c9b47266a8ddbec74a15878.tar.gz scummvm-rg350-a2982a0b20027f658c9b47266a8ddbec74a15878.tar.bz2 scummvm-rg350-a2982a0b20027f658c9b47266a8ddbec74a15878.zip |
TONY: Engine is now compiling and linking again
Diffstat (limited to 'engines/tony/tony.cpp')
-rw-r--r-- | engines/tony/tony.cpp | 79 |
1 files changed, 76 insertions, 3 deletions
diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index ea555972d0..0a2143ba8b 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -139,7 +139,7 @@ int flipflop=0; OSystem::MutexRef csMusic; -void TonyEngine::PlayMusic(int nChannel, char* fn, int nFX, bool bLoop, int nSync) { +void TonyEngine::PlayMusic(int nChannel, const char *fn, int nFX, bool bLoop, int nSync) { warning("TonyEngine::PlayMusic"); } @@ -202,6 +202,46 @@ int TonyEngine::GetMusicVolume(int nChannel) { return 255; } + +void TonyEngine::GetSaveStateFileName(int n, char *buf) { + RMString name; + + if (n > 0) + name.Format("%02d", n); + else + name.Format("autosave"); + + name += ".sav"; +} + +void TonyEngine::AutoSave(void) { + char buf[256]; + + GrabThumbnail(); + MainWaitFrame(); + MainWaitFrame(); + MainFreeze(); + GetSaveStateFileName(0,buf); + _theEngine.SaveState(buf, (byte *)m_curThumbnail, "Autosave", true); + MainUnfreeze(); +} + + +void TonyEngine::SaveState(int n, const char *name) { + char buf[256]; + + GetSaveStateFileName(n, buf); + _theEngine.SaveState(buf,(byte *)m_curThumbnail, name); +} + + +void TonyEngine::LoadState(int n) { + char buf[256]; + + GetSaveStateFileName(n, buf); + _theEngine.LoadState(buf); +} + bool TonyEngine::OpenVoiceDatabase() { char id[4]; uint32 numfiles; @@ -251,6 +291,21 @@ void TonyEngine::GrabThumbnail(void) { warning("TODO: TonyEngine::GrabThumbnail"); } +void TonyEngine::OptionScreen(void) { +} + +void TonyEngine::OpenInitLoadMenu(void) { + _theEngine.OpenOptionScreen(1); +} + +void TonyEngine::OpenInitOptions(void) { + _theEngine.OpenOptionScreen(2); +} + +void TonyEngine::Abort(void) { + m_bQuitNow = true; +} + void TonyEngine::Play(void) { warning("TODO TonyEngine::Play"); @@ -314,14 +369,14 @@ void TonyEngine::PauseLoop(void) { MSG msg; int st,et; - st = timeGetTime(); + st = GetTime(); while (m_bPaused && GetMessage(&msg,m_wnd,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); } - et = timeGetTime(); + et = GetTime(); m_startTime += et - st; #endif @@ -345,4 +400,22 @@ warning("TODO: TonyEninge::Pause"); */ } +void TonyEngine::FreezeTime(void) { + m_bTimeFreezed = true; + m_nTimeFreezed = GetTime() - m_startTime; +} + +void TonyEngine::UnfreezeTime(void) +{ + m_bTimeFreezed = false; +} + + +/** + * Returns the millisecond timer + */ +uint32 TonyEngine::GetTime() { + return g_system->getMillis(); +} + } // End of namespace Tony |