From: Matthijs Kooijman Date: Mon, 11 Jun 2007 08:31:47 +0000 (+0200) Subject: * Move GetTickCount() hacks to porting.h and replace by a real call to SDL_GetTicks(). X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=0557fdb7b7567901ca7e82def55fe5ceab0ccef0;p=matthijs%2FABM2.git * Move GetTickCount() hacks to porting.h and replace by a real call to SDL_GetTicks(). * Link against SDL. --- diff --git a/ABM2/Engine/GlobalTimer.h b/ABM2/Engine/GlobalTimer.h index 57ee752..e644210 100755 --- a/ABM2/Engine/GlobalTimer.h +++ b/ABM2/Engine/GlobalTimer.h @@ -9,9 +9,6 @@ #pragma once #endif // _MSC_VER > 1000 -/* HACK to make things compile */ -#define GetTickCount() 0 - #include "engine.h" class CGlobalTimer : public ITask diff --git a/ABM2/Engine/profiler.h b/ABM2/Engine/profiler.h index 5a5ad32..5d12b9f 100755 --- a/ABM2/Engine/profiler.h +++ b/ABM2/Engine/profiler.h @@ -3,8 +3,6 @@ #define MAX_PROFILER_SAMPLES 50 -/* HACK to make things compile */ -#define GetTickCount() 0 class IProfilerOutputHandler; class CProfileSample; diff --git a/ABM2/Makefile b/ABM2/Makefile index 3bbe6e4..9f5c3b7 100644 --- a/ABM2/Makefile +++ b/ABM2/Makefile @@ -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) - g++ -o abm2 $(OBJS) + g++ $(LDFLAGS) -o abm2 $(OBJS) %.o: %.cpp g++ $(CFLAGS) -c $< -o $@ diff --git a/ABM2/porting.h b/ABM2/porting.h index 02d7c33..6ee3006 100644 --- a/ABM2/porting.h +++ b/ABM2/porting.h @@ -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 @@ -7,3 +10,10 @@ #define BYTE unsigned char #define DWORD unsigned int #endif // !WIN32 + +#ifdef WITH_SDL + #include + #define GetTickCount SDL_GetTicks +#endif // WITH_SDL + +#endif // !defined(AFX_PORTING_H__90C3FE42_3400_4978_8BC5_7D905F3C8E63__INCLUDED_)