Browse Source

Moved #ifdef LOVE_WINDOWS to Timer.cpp.

rude 15 years ago
parent
commit
16f6219957
2 changed files with 15 additions and 9 deletions
  1. 15 3
      src/modules/timer/sdl/Timer.cpp
  2. 0 6
      src/modules/timer/sdl/Timer.h

+ 15 - 3
src/modules/timer/sdl/Timer.cpp

@@ -18,6 +18,15 @@
 * 3. This notice may not be removed or altered from any source distribution.
 **/
 
+#include <common/config.h>
+
+#ifdef LOVE_WINDOWS
+#	include <windows.h>
+#	include <time.h>
+#else
+#	include <sys/time.h>
+#endif
+
 #include "Timer.h"
 
 namespace love
@@ -92,18 +101,21 @@ namespace sdl
 
 	float Timer::getMicroTime() const
 	{
-		#ifdef LOVE_WINDOWS
+#ifdef LOVE_WINDOWS
+		/*
 			long ticks, freq;
 			QueryPeformanceCounter(&ticks);
 			QueryPeformanceFrequency(&freq);
 			long secs = ticks/freq;
 			long usecs = (ticks%freq)/(freq/1000000.0f);
 			return secs%86400 + usecs/1000000.0f;
-		#else
+		*/
+			return 0;
+#else
 			timeval t;
 			gettimeofday(&t, NULL);
 			return t.tv_sec%86400 + t.tv_usec/1000000.0f;
-		#endif
+#endif
 	}
 
 } // sdl

+ 0 - 6
src/modules/timer/sdl/Timer.h

@@ -24,12 +24,6 @@
 // SDL
 #include <SDL.h>
 
-#ifdef LOVE_WINDOWS
-	#include <time.h>
-#else
-	#include <sys/time.h>
-#endif
-
 // LOVE
 #include <common/Module.h>