diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/utils/timer.cpp | 4 | ||||
-rw-r--r-- | tmwserv.dev | 132 |
3 files changed, 100 insertions, 41 deletions
@@ -1,3 +1,8 @@ +2006-05-14 Eugenio Favalli <elvenprogrammer@gmail.com> + + * src/utils/timer.cpp, tmwserv.dev: Replaced nanosleep with Sleep in + Windows and updated Dev-C++ project file. + 2006-05-14 Guillaume Melquiond <guillaume.melquiond@gmail.com> * src/messagein.cpp: Replaced strnlen by memchr to avoid GNU diff --git a/src/utils/timer.cpp b/src/utils/timer.cpp index 0e9a6a7e..a476ebec 100644 --- a/src/utils/timer.cpp +++ b/src/utils/timer.cpp @@ -39,10 +39,14 @@ void Timer::sleep() if (!active) return; uint64_t now = getTimeInMillisec(); if (now - lastpulse >= interval) return; +#ifndef _WIN32 struct timespec req; req.tv_sec = 0; req.tv_nsec = (interval - (now - lastpulse)) * (1000 * 1000); nanosleep(&req, 0); +#else + Sleep(interval - (now - lastpulse)); +#endif } int Timer::poll() diff --git a/tmwserv.dev b/tmwserv.dev index e0f3b82b..67529412 100644 --- a/tmwserv.dev +++ b/tmwserv.dev @@ -1,7 +1,7 @@ [Project] FileName=tmwserv.dev Name=tmwserv -UnitCount=76 +UnitCount=79 Type=1 Ver=1 ObjFiles= @@ -12,7 +12,7 @@ ResourceIncludes= MakeIncludes= Compiler=_@@_ CppCompiler=-DSQLITE_SUPPORT_@@_ -Linker=-lmingw32_@@_-lSDL_@@_-lenet_@@_-lws2_32_@@_-lsqlite3_@@_-lxml2_@@_-lphysfs_@@_-lpthreadGC2_@@_-lz_@@_-mconsole_@@_-mwindows_@@_-lwinmm_@@_ +Linker=-lmingw32_@@_-lenet_@@_-lws2_32_@@_-lsqlite3_@@_-lxml2_@@_-lphysfs_@@_-lpthreadGC2_@@_-lz_@@_-mconsole_@@_-mwindows_@@_-lwinmm_@@_ IsCpp=1 Icon= ExeOutput= @@ -408,7 +408,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit54] -FileName=src\chathandler.h +FileName=src\chathandler.cpp CompileCpp=1 Folder=tmwserv Compile=1 @@ -418,7 +418,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit55] -FileName=src\chathandler.cpp +FileName=src\resourcemanager.h CompileCpp=1 Folder=tmwserv Compile=1 @@ -428,7 +428,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit56] -FileName=src\resourcemanager.h +FileName=src\map.cpp CompileCpp=1 Folder=tmwserv Compile=1 @@ -438,7 +438,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit58] -FileName=src\map.h +FileName=src\mapreader.h CompileCpp=1 Folder=tmwserv Compile=1 @@ -448,7 +448,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit59] -FileName=src\mapreader.h +FileName=src\resourcemanager.cpp CompileCpp=1 Folder=tmwserv Compile=1 @@ -458,7 +458,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit61] -FileName=src\utils\base64.h +FileName=src\utils\base64.cpp CompileCpp=1 Folder=utils Compile=1 @@ -468,9 +468,9 @@ OverrideBuildCmd=0 BuildCmd= [Unit62] -FileName=src\utils\base64.cpp +FileName=src\state.h CompileCpp=1 -Folder=utils +Folder=tmwserv Compile=1 Link=1 Priority=1000 @@ -478,7 +478,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit64] -FileName=src\state.cpp +FileName=src\gamehandler.h CompileCpp=1 Folder=tmwserv Compile=1 @@ -488,7 +488,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit65] -FileName=src\gamehandler.h +FileName=src\items.cpp CompileCpp=1 Folder=tmwserv Compile=1 @@ -588,7 +588,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit63] -FileName=src\state.h +FileName=src\state.cpp CompileCpp=1 Folder=tmwserv Compile=1 @@ -637,18 +637,8 @@ Priority=1000 OverrideBuildCmd=0 BuildCmd= -[Unit53] -FileName=src\SDL_win32_main.c -CompileCpp=1 -Folder=tmwserv -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - [Unit57] -FileName=src\map.cpp +FileName=src\map.h CompileCpp=1 Folder=tmwserv Compile=1 @@ -658,9 +648,9 @@ OverrideBuildCmd=0 BuildCmd= [Unit60] -FileName=src\resourcemanager.cpp +FileName=src\utils\base64.h CompileCpp=1 -Folder=tmwserv +Folder=utils Compile=1 Link=1 Priority=1000 @@ -668,7 +658,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit66] -FileName=src\items.cpp +FileName=src\gamehandler.cpp CompileCpp=1 Folder=tmwserv Compile=1 @@ -678,9 +668,9 @@ OverrideBuildCmd=0 BuildCmd= [Unit67] -FileName=src\gamehandler.cpp +FileName=src\mapmanager.h CompileCpp=1 -Folder=tmwserv +Folder= Compile=1 Link=1 Priority=1000 @@ -688,7 +678,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit68] -FileName=src\mapmanager.h +FileName=src\mapmanager.cpp CompileCpp=1 Folder= Compile=1 @@ -698,9 +688,9 @@ OverrideBuildCmd=0 BuildCmd= [Unit69] -FileName=src\mapmanager.cpp +FileName=src\mapreader.cpp CompileCpp=1 -Folder= +Folder=tmwserv Compile=1 Link=1 Priority=1000 @@ -708,7 +698,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit71] -FileName=src\utils\stringfilter.cpp +FileName=src\utils\stringfilter.h CompileCpp=1 Folder=utils Compile=1 @@ -728,7 +718,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit74] -FileName=src\chatchannelmanager.h +FileName=src\chatchannel.cpp CompileCpp=1 Folder=tmwserv Compile=1 @@ -758,9 +748,9 @@ OverrideBuildCmd=0 BuildCmd= [Unit72] -FileName=src\utils\stringfilter.h +FileName=src\chatchannelmanager.cpp CompileCpp=1 -Folder=utils +Folder=tmwserv Compile=1 Link=1 Priority=1000 @@ -768,7 +758,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit73] -FileName=src\chatchannelmanager.cpp +FileName=src\chatchannelmanager.h CompileCpp=1 Folder=tmwserv Compile=1 @@ -778,9 +768,9 @@ OverrideBuildCmd=0 BuildCmd= [Unit70] -FileName=src\mapreader.cpp +FileName=src\utils\stringfilter.cpp CompileCpp=1 -Folder=tmwserv +Folder=utils Compile=1 Link=1 Priority=1000 @@ -788,7 +778,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit75] -FileName=src\chatchannel.cpp +FileName=src\chatchannel.h CompileCpp=1 Folder=tmwserv Compile=1 @@ -798,7 +788,17 @@ OverrideBuildCmd=0 BuildCmd= [Unit76] -FileName=src\chatchannel.h +FileName=src\utils\wingettimeofday.h +CompileCpp=1 +Folder=utils +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit53] +FileName=src\chathandler.h CompileCpp=1 Folder=tmwserv Compile=1 @@ -807,3 +807,53 @@ Priority=1000 OverrideBuildCmd=0 BuildCmd= +[Unit79] +FileName=src\utils\wingettimeofday.cpp +CompileCpp=1 +Folder=utils +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit80] +FileName=src\utils\timer.h +CompileCpp=1 +Folder=utils +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit81] +FileName=src\utils\wingettimeofday.cpp +CompileCpp=1 +Folder=utils +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit77] +FileName=src\utils\timer.cpp +CompileCpp=1 +Folder=utils +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit78] +FileName=src\utils\timer.h +CompileCpp=1 +Folder=utils +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + |