|
From: <ufo...@li...> - 2010-05-09 18:55:02
|
Revision: 1119
http://ufo2000.svn.sourceforge.net/ufo2000/?rev=1119&view=rev
Author: ssvb
Date: 2010-05-09 18:54:56 +0000 (Sun, 09 May 2010)
Log Message:
-----------
Fixed compilation issues when using more recent versions of mingw
An old and hackish 'usleep' define in 'stdafx.h' started to clash with
mingw headers for the recent versions of mingw (because now mingw
provides 'usleep' function itself). The solution was to just switch
to the use of allegro-specific 'rest' function which provides the same
functionality.
It's a temporary solution anyway, because any occurences of
usleep/rest functions should be eliminated completely in order to
reduce power consumption. Low power consumption is important
for battery powered devices (laptops and smartphones).
Author: Siarhei Siamashka <sia...@gm...>
Modified Paths:
--------------
trunk/src/mainmenu.cpp
trunk/src/music.cpp
trunk/src/server_gui.cpp
trunk/src/stdafx.h
Modified: trunk/src/mainmenu.cpp
===================================================================
--- trunk/src/mainmenu.cpp 2010-05-07 19:57:43 UTC (rev 1118)
+++ trunk/src/mainmenu.cpp 2010-05-09 18:54:56 UTC (rev 1119)
@@ -155,7 +155,7 @@
break;
case MSG_IDLE:
- usleep(5000);
+ rest(5);
break;
default:
Modified: trunk/src/music.cpp
===================================================================
--- trunk/src/music.cpp 2010-05-07 19:57:43 UTC (rev 1118)
+++ trunk/src/music.cpp 2010-05-09 18:54:56 UTC (rev 1119)
@@ -55,7 +55,7 @@
}
}
nlMutexUnlock(&mutex);
- usleep(10000);
+ rest(10);
}
nlMutexDestroy(&mutex);
return NULL;
Modified: trunk/src/server_gui.cpp
===================================================================
--- trunk/src/server_gui.cpp 2010-05-07 19:57:43 UTC (rev 1118)
+++ trunk/src/server_gui.cpp 2010-05-09 18:54:56 UTC (rev 1119)
@@ -730,7 +730,7 @@
}
}
// Do not load cpu so heavy
- usleep(10000);
+ rest(10);
}
show_mouse(NULL);
Modified: trunk/src/stdafx.h
===================================================================
--- trunk/src/stdafx.h 2010-05-07 19:57:43 UTC (rev 1118)
+++ trunk/src/stdafx.h 2010-05-09 18:54:56 UTC (rev 1119)
@@ -98,10 +98,6 @@
#include "LuaPlus/LuaPlusCD.h"
-#ifdef WIN32
-#define usleep(t) Sleep((t + 999) / 1000)
-#endif
-
/**
* Standard game errors are coded with these constants.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|