diff options
author | Andre Heider | 2009-02-24 18:31:05 +0000 |
---|---|---|
committer | Andre Heider | 2009-02-24 18:31:05 +0000 |
commit | 357299c5705d6856e070e537610275f1943e6653 (patch) | |
tree | 3a778bb49af51f3633d594af46e39e3bd0323c5d /engines/sci/tools.cpp | |
parent | 3082586230688f27badf707faf95cadc8f761b21 (diff) | |
download | scummvm-rg350-357299c5705d6856e070e537610275f1943e6653.tar.gz scummvm-rg350-357299c5705d6856e070e537610275f1943e6653.tar.bz2 scummvm-rg350-357299c5705d6856e070e537610275f1943e6653.zip |
substitute all time related functions, removing sci_gettime sci_get_current_time altogether.
svn-id: r38845
Diffstat (limited to 'engines/sci/tools.cpp')
-rw-r--r-- | engines/sci/tools.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/engines/sci/tools.cpp b/engines/sci/tools.cpp index 757190e277..58c86cd73a 100644 --- a/engines/sci/tools.cpp +++ b/engines/sci/tools.cpp @@ -29,7 +29,6 @@ # include <windows.h> # include <errno.h> # include <mmsystem.h> -# include <sys/timeb.h> # include <sys/types.h> # include <sys/stat.h> # include <direct.h> @@ -44,10 +43,6 @@ namespace Sci { -#ifndef _MSC_VER -# include <sys/time.h> -#endif - int script_debug_flag = 0; // Defaulting to running mode int sci_debug_flags = 0; // Special flags @@ -132,47 +127,4 @@ void _SCIGNUkdebug(const char *funcname, EngineState *s, const char *file, int l } } - -#ifndef _MSC_VER -void sci_gettime(long *seconds, long *useconds) { - struct timeval tv; - - assert(!gettimeofday(&tv, NULL)); - *seconds = tv.tv_sec; - *useconds = tv.tv_usec; -} -#elif defined (WIN32) - -/*WARNING(Incorrect)*/ -/* Warning: This function only retrieves the amount of mseconds since the start of -** the Win32 kernel; it does /not/ provide the number of seconds since the epoch! -** There are no known cases where this causes problems, though. */ -void sci_gettime(long *seconds, long *useconds) { - DWORD tm; - - if (TIMERR_NOERROR != timeBeginPeriod(1)) { - fprintf(stderr, "timeBeginPeriod(1) failed in sci_gettime\n"); - } - - tm = timeGetTime(); - - if (TIMERR_NOERROR != timeEndPeriod(1)) { - fprintf(stderr, "timeEndPeriod(1) failed in sci_gettime\n"); - } - - *seconds = tm / 1000; - *useconds = (tm % 1000) * 1000; -} -#else -# error "You need to provide a microsecond resolution sci_gettime implementation for your platform!" -#endif - - -void sci_get_current_time(GTimeVal *val) { - long foo, bar; - sci_gettime(&foo, &bar); - val->tv_sec = foo; - val->tv_usec = bar; -} - } // End of namespace Sci |