Fixed bugs
parent
80036808f1
commit
383e7d2c9f
|
@ -31,15 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
gettime.h implementation
|
gettime.h implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef SERVER
|
#ifndef SERVER
|
||||||
|
|
||||||
u32 getTimeMs()
|
|
||||||
{
|
|
||||||
/* Use imprecise system calls directly (from porting.h) */
|
|
||||||
return porting::getTimeMs();
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
// A precise irrlicht one
|
// A precise irrlicht one
|
||||||
u32 IrrlichtTimeGetter::getTime()
|
u32 IrrlichtTimeGetter::getTime()
|
||||||
|
@ -57,11 +49,4 @@ u32 SimpleTimeGetter::getTime()
|
||||||
return porting::getTimeMs();
|
return porting::getTimeMs();
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 getTimeMs()
|
|
||||||
{
|
|
||||||
if(g_timegetter == NULL)
|
|
||||||
return 0;
|
|
||||||
return g_timegetter->getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -51,11 +51,7 @@ inline std::string getTimestamp()
|
||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SERVER
|
#ifndef SERVER
|
||||||
|
|
||||||
u32 getTimeMs();
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
// A small helper class
|
// A small helper class
|
||||||
class TimeGetter
|
class TimeGetter
|
||||||
|
@ -82,12 +78,6 @@ public:
|
||||||
u32 getTime();
|
u32 getTime();
|
||||||
};
|
};
|
||||||
|
|
||||||
// A pointer to a global instance of the time getter
|
|
||||||
// TODO: why?
|
|
||||||
TimeGetter *g_timegetter = NULL;
|
|
||||||
|
|
||||||
u32 getTimeMs();
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
17
src/main.cpp
17
src/main.cpp
|
@ -117,6 +117,23 @@ bool noMenuActive()
|
||||||
|
|
||||||
// Passed to menus to allow disconnecting and exiting
|
// Passed to menus to allow disconnecting and exiting
|
||||||
MainGameCallback *g_gamecallback = NULL;
|
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
|
#endif
|
||||||
|
|
||||||
class StderrLogOutput: public ILogOutput
|
class StderrLogOutput: public ILogOutput
|
||||||
|
|
Loading…
Reference in New Issue