Fixed bugs

master
Joel Leclerc 2012-04-29 16:03:54 -06:00
parent 80036808f1
commit 383e7d2c9f
3 changed files with 19 additions and 27 deletions

View File

@ -31,15 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
gettime.h implementation
*/
#ifdef SERVER
u32 getTimeMs()
{
/* Use imprecise system calls directly (from porting.h) */
return porting::getTimeMs();
}
#else
#ifndef SERVER
// A precise irrlicht one
u32 IrrlichtTimeGetter::getTime()
@ -57,11 +49,4 @@ u32 SimpleTimeGetter::getTime()
return porting::getTimeMs();
}
u32 getTimeMs()
{
if(g_timegetter == NULL)
return 0;
return g_timegetter->getTime();
}
#endif

View File

@ -51,11 +51,7 @@ inline std::string getTimestamp()
return cs;
}
#ifdef SERVER
u32 getTimeMs();
#else
#ifndef SERVER
// A small helper class
class TimeGetter
@ -82,12 +78,6 @@ public:
u32 getTime();
};
// A pointer to a global instance of the time getter
// TODO: why?
TimeGetter *g_timegetter = NULL;
u32 getTimeMs();
#endif

View File

@ -117,6 +117,23 @@ bool noMenuActive()
// Passed to menus to allow disconnecting and exiting
MainGameCallback *g_gamecallback = NULL;
// A pointer to a global instance of the time getter
// TODO: why?
TimeGetter *g_timegetter = NULL;
u32 getTimeMs()
{
if(g_timegetter == NULL)
return 0;
return g_timegetter->getTime();
}
#else
u32 getTimeMs()
{
/* Use imprecise system calls directly (from porting.h) */
return porting::getTimeMs();
}
#endif
class StderrLogOutput: public ILogOutput