diff options
| author | Eugene Sandulenko | 2007-12-28 07:43:52 +0000 |
|---|---|---|
| committer | Eugene Sandulenko | 2007-12-28 07:43:52 +0000 |
| commit | ef319ad6745678275a4c5eb159d6d95fdf17649f (patch) | |
| tree | 216cba22fab48bcce82cdf12edcd95a74f6afb21 /common | |
| parent | d4d072fe0484918b6caf4571b933a9b374177e5b (diff) | |
| download | scummvm-rg350-ef319ad6745678275a4c5eb159d6d95fdf17649f.tar.gz scummvm-rg350-ef319ad6745678275a4c5eb159d6d95fdf17649f.tar.bz2 scummvm-rg350-ef319ad6745678275a4c5eb159d6d95fdf17649f.zip | |
Patch #1859448: Add OSystem::getTimeAndDate API
svn-id: r30034
Diffstat (limited to 'common')
| -rw-r--r-- | common/system.cpp | 7 | ||||
| -rw-r--r-- | common/system.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/common/system.cpp b/common/system.cpp index 9444c692d6..786b3cec1a 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -35,6 +35,8 @@ #include "gui/message.h" #include "sound/mixer.h" +#include <time.h> + OSystem *g_system = 0; OSystem::OSystem() { @@ -121,3 +123,8 @@ void OSystem::clearScreen() { memset(screen->pixels, 0, screen->h * screen->pitch); unlockScreen(); } + +void OSystem::getTimeAndDate(struct tm &t) const { + time_t curTime = time(0); + t = *localtime(&curTime); +} diff --git a/common/system.h b/common/system.h index 7246389bab..98ea02df20 100644 --- a/common/system.h +++ b/common/system.h @@ -724,6 +724,9 @@ public: /** Delay/sleep for the specified amount of milliseconds. */ virtual void delayMillis(uint msecs) = 0; + + /** Get the current time and date. Correspond to time()+localtime(). */ + virtual void getTimeAndDate(struct tm &t) const; /** * Return the timer manager singleton. For more information, refer |
