aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMarcus Comstedt2007-09-20 12:47:04 +0000
committerMarcus Comstedt2007-09-20 12:47:04 +0000
commit6bf0df51a145835f1a290a70fd06630f890fcee7 (patch)
treeaaf3dfc72f405b7fd151d1a299f68a4ee391ffac /engines
parentc2de32292900675d2fda0cb9d4948daa55e593a8 (diff)
downloadscummvm-rg350-6bf0df51a145835f1a290a70fd06630f890fcee7.tar.gz
scummvm-rg350-6bf0df51a145835f1a290a70fd06630f890fcee7.tar.bz2
scummvm-rg350-6bf0df51a145835f1a290a70fd06630f890fcee7.zip
Don't use clock(). Don't busy-wait.
svn-id: r28985
Diffstat (limited to 'engines')
-rw-r--r--engines/drascula/drascula.cpp9
-rw-r--r--engines/drascula/drascula.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index eb7e33d17e..38b4150edd 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -4647,7 +4647,7 @@ void DrasculaEngine::para_grabar(char nom_game[]) {
void DrasculaEngine::OpenSSN(const char *Name, int Pause) {
MiVideoSSN = (byte *)malloc(64256);
- GlobalSpeed = CLOCKS_PER_SEC / Pause;
+ GlobalSpeed = 1000 / Pause;
FrameSSN = 0;
UsingMem = 0;
if (MiVideoSSN == NULL)
@@ -4655,7 +4655,7 @@ void DrasculaEngine::OpenSSN(const char *Name, int Pause) {
_Sesion = new Common::File;
_Sesion->open(Name);
mSesion = TryInMem(_Sesion);
- LastFrame = clock();
+ LastFrame = _system->getMillis();
}
int DrasculaEngine::PlayFrameSSN() {
@@ -4823,8 +4823,9 @@ void DrasculaEngine::MixVideo(byte *OldScreen, byte *NewScreen) {
}
void DrasculaEngine::WaitFrameSSN() {
- while ((int)clock() < LastFrame + GlobalSpeed)
- ;
+ uint32 now;
+ while ((now = _system->getMillis()) - LastFrame < GlobalSpeed)
+ _system->delayMillis(GlobalSpeed - (now - LastFrame));
LastFrame = LastFrame + GlobalSpeed;
}
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index c34048ed8e..c28510fc98 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -648,7 +648,7 @@ public:
byte *mSesion;
int FrameSSN;
int GlobalSpeed;
- int LastFrame;
+ uint32 LastFrame;
int frame_pen;
int flag_tv;