* Move GetTickCount() hacks to porting.h and replace by a real call to SDL_GetTicks().
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 08:31:47 +0000 (10:31 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 08:31:47 +0000 (10:31 +0200)
 * Link against SDL.

ABM2/Engine/GlobalTimer.h
ABM2/Engine/profiler.h
ABM2/Makefile
ABM2/porting.h

index 57ee7525c38492815b4827eb2eddc26feb228109..e644210504aa84a80790de83d8c1413fca5d678f 100755 (executable)
@@ -9,9 +9,6 @@
 #pragma once\r
 #endif // _MSC_VER > 1000\r
 \r
 #pragma once\r
 #endif // _MSC_VER > 1000\r
 \r
-/* HACK to make things compile */\r
-#define GetTickCount() 0\r
-\r
 #include "engine.h"\r
 \r
 class CGlobalTimer : public ITask\r
 #include "engine.h"\r
 \r
 class CGlobalTimer : public ITask\r
index 5a5ad32991c8fa18c5af37b3b2b3d0c7610629d7..5d12b9fbc98b22cde8aed8361bd6c410bb1022ec 100755 (executable)
@@ -3,8 +3,6 @@
 \r
 #define MAX_PROFILER_SAMPLES 50\r
 \r
 \r
 #define MAX_PROFILER_SAMPLES 50\r
 \r
-/* HACK to make things compile */\r
-#define GetTickCount() 0\r
 \r
 class IProfilerOutputHandler;\r
 class CProfileSample;\r
 \r
 class IProfilerOutputHandler;\r
 class CProfileSample;\r
index 3bbe6e47be74d7f3016b2c6693a93306cb9d91bf..9f5c3b705bdf02a4026359bc036b42b1d9901f1f 100644 (file)
@@ -1,10 +1,11 @@
-CFLAGS:=-I.
+CFLAGS  := -I. -DWITH_SDL
+LDFLAGS := -lSDL
 OBJS:=main.o Engine/Log.o SchemeReader.o Engine/Settings.o Engine/mmanager.o Engine/Kernel.o Engine/ProfileLogHandler.o Engine/VideoUpdate.o Engine/GlobalTimer.o Engine/SoundTask.o Engine/profiler.o Playground.o Engine/InputTask.o
 
 all: abm2
 
 abm2: $(OBJS)
 OBJS:=main.o Engine/Log.o SchemeReader.o Engine/Settings.o Engine/mmanager.o Engine/Kernel.o Engine/ProfileLogHandler.o Engine/VideoUpdate.o Engine/GlobalTimer.o Engine/SoundTask.o Engine/profiler.o Playground.o Engine/InputTask.o
 
 all: abm2
 
 abm2: $(OBJS)
-       g++ -o abm2 $(OBJS)
+       g++ $(LDFLAGS) -o abm2 $(OBJS)
 
 %.o: %.cpp
        g++ $(CFLAGS) -c $< -o $@
 
 %.o: %.cpp
        g++ $(CFLAGS) -c $< -o $@
index 02d7c33238569604ba45baaa28a82c8242cee9a5..6ee3006e2ceaf96d45cd1c2a57b49c5641311689 100644 (file)
@@ -1,3 +1,6 @@
+#if !defined(AFX_PORTING_H__90C3FE42_3400_4978_8BC5_7D905F3C8E63__INCLUDED_)
+#define AFX_PORTING_H__90C3FE42_3400_4978_8BC5_7D905F3C8E63__INCLUDED_
+
 #ifndef WIN32
        #define vsprintf_s vsnprintf
        #define sprintf_s snprintf
 #ifndef WIN32
        #define vsprintf_s vsnprintf
        #define sprintf_s snprintf
@@ -7,3 +10,10 @@
        #define BYTE unsigned char
        #define DWORD unsigned int
 #endif // !WIN32
        #define BYTE unsigned char
        #define DWORD unsigned int
 #endif // !WIN32
+
+#ifdef WITH_SDL
+       #include <SDL/SDL.h>
+       #define GetTickCount SDL_GetTicks
+#endif // WITH_SDL
+
+#endif // !defined(AFX_PORTING_H__90C3FE42_3400_4978_8BC5_7D905F3C8E63__INCLUDED_)