diff --git a/src/.gitignore b/src/.gitignore index 6eb25f6..2bd1165 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,2 +1,3 @@ *.o Makefile +config.h diff --git a/src/Logger.h b/src/Logger.h index 188799e..52d4c50 100644 --- a/src/Logger.h +++ b/src/Logger.h @@ -1,4 +1,9 @@ -#pragma once +#ifndef __Logger_h__ +#define __Logger_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif namespace OpenArena { @@ -87,3 +92,5 @@ namespace OpenArena virtual void Log(const char* message, const char* classification, MessageType type=MESSAGETYPE_INFORMATION) = 0; }; }; + +#endif diff --git a/src/Makefile.linux b/src/Makefile.linux index bbd8cc4..34d91f0 100644 --- a/src/Makefile.linux +++ b/src/Makefile.linux @@ -1,14 +1,13 @@ #Dependencies soooo need to be fixed/finished CPP = g++ -g -INCLUDES = +INCLUDES = -I/usr/X11R6/include LD = g++ -INCLUDEPATH = ../include OBJECTS = screen.o bmp.o camera.o ctrls.o level.o mygl.o myglFont.o myglTexture.o physics.o player.o strmanip.o tga.o vector.o window.o keys.o main.o LIBS = -L/usr/X11R6/lib -lGL -lGLU -lXxf86vm LIBRARIES = SO_LIBS = SO_LIBRARIES = oa_game.so oa_audio.so oa_net.so oa_video.so oa_input.so -CPPFLAGS = +CPPFLAGS = -DHAVE_CONFIG_H LDFLAGS = $(LIBS) .Phony: all clean install @@ -37,53 +36,50 @@ oa_video.so: oa_input.so: #Object Files -screen.o: screen.cpp $(INCLUDEPATH)/screen.h - $(CPP) -c -o screen.o screen.cpp +screen.o: screen.cpp screen.h config.h + $(CPP) $(CPPFLAGS)-c -o screen.o screen.cpp -bmp.o: bmp.cpp $(INCLUDEPATH)/bmp.h $(INCLUDEPATH)/mygl.h $(INCLUDEPATH)/datatypes.h $(INCLUDEPATH)/texture.h - $(CPP) -c -o bmp.o bmp.cpp +bmp.o: bmp.cpp bmp.h mygl.h datatypes.h texture.h config.h + $(CPP) $(CPPFLAGS)-c -o bmp.o bmp.cpp -camera.o: camera.cpp $(INCLUDEPATH)/camera.h $(INCLUDEPATH)/vector.h $(INCLUDEPATH)/mygl.h $(INCLUDEPATH)/screen.h - $(CPP) -c -o camera.o camera.cpp +camera.o: camera.cpp camera.h vector.h mygl.h screen.h config.h + $(CPP) $(CPPFLAGS)-c -o camera.o camera.cpp -ctrls.o: ctrls.cpp $(INCLUDEPATH)/ctrls.h $(INCLUDEPATH)/keys.h $(INCLUDEPATH)/physics.h $(INCLUDEPATH)/datatypes.h $(INCLUDEPATH)/list.h - $(CPP) -c -o ctrls.o ctrls.cpp +ctrls.o: ctrls.cpp ctrls.h keys.h physics.h datatypes.h list.h config.h + $(CPP) $(CPPFLAGS)-c -o ctrls.o ctrls.cpp -level.o: level.cpp $(INCLUDEPATH)/level.h $(INCLUDEPATH)/version.h - $(CPP) -c -o level.o level.cpp +level.o: level.cpp level.h version.h config.h + $(CPP) $(CPPFLAGS)-c -o level.o level.cpp -$(INCLUDEPATH)/level.h: $(INCLUDEPATH)/myglFont.h - touch $(INCLUDEPATH)/level.h +mygl.o: mygl.cpp mygl.h config.h + $(CPP) $(CPPFLAGS)-c -o mygl.o mygl.cpp + +myglFont.o: myglFont.cpp myglFont.h config.h + $(CPP) $(CPPFLAGS)-c -o myglFont.o myglFont.cpp + +myglTexture.o: myglTexture.cpp myglTexture.h config.h + $(CPP) $(CPPFLAGS)-c -o myglTexture.o myglTexture.cpp + +physics.o: physics.cpp physics.h config.h + $(CPP) $(CPPFLAGS)-c -o physics.o physics.cpp + +player.o: player.cpp player.h config.h + $(CPP) $(CPPFLAGS)-c -o player.o player.cpp + +strmanip.o: strmanip.cpp strmanip.h config.h + $(CPP) $(CPPFLAGS)-c -o strmanip.o strmanip.cpp + +tga.o: tga.cpp tga.h config.h + $(CPP) $(CPPFLAGS)-c -o tga.o tga.cpp + +vector.o: vector.cpp vector.h config.h + $(CPP) $(CPPFLAGS)-c -o vector.o vector.cpp + +window.o: window.cpp window.h config.h + $(CPP) $(CPPFLAGS)-c -o window.o window.cpp -mygl.o: mygl.cpp $(INCLUDEPATH)/mygl.h - $(CPP) -c -o mygl.o mygl.cpp +keys.o: keys.cpp keys.h config.h + $(CPP) $(CPPFLAGS)-c -o keys.o keys.cpp -myglFont.o: myglFont.cpp $(INCLUDEPATH)/myglFont.h - $(CPP) -c -o myglFont.o myglFont.cpp - -myglTexture.o: myglTexture.cpp $(INCLUDEPATH)/myglTexture.h - $(CPP) -c -o myglTexture.o myglTexture.cpp - -physics.o: physics.cpp $(INCLUDEPATH)/physics.h - $(CPP) -c -o physics.o physics.cpp - -player.o: player.cpp $(INCLUDEPATH)/player.h - $(CPP) -c -o player.o player.cpp - -strmanip.o: strmanip.cpp $(INCLUDEPATH)/strmanip.h - $(CPP) -c -o strmanip.o strmanip.cpp - -tga.o: tga.cpp $(INCLUDEPATH)/tga.h - $(CPP) -c -o tga.o tga.cpp - -vector.o: vector.cpp $(INCLUDEPATH)/vector.h - $(CPP) -c -o vector.o vector.cpp - -window.o: window.cpp $(INCLUDEPATH)/window.h - $(CPP) -c -o window.o window.cpp - -keys.o: keys.cpp $(INCLUDEPATH)/keys.h - $(CPP) -c -o keys.o keys.cpp - -main.o: linux.cpp $(INCLUDEPATH)/main.h - $(CPP) -c -o main.o linux.cpp +main.o: linux.cpp main.h config.h + $(CPP) $(CPPFLAGS)-c -o main.o linux.cpp diff --git a/src/Makefile.macosx b/src/Makefile.macosx index 9efefa6..79de566 100644 --- a/src/Makefile.macosx +++ b/src/Makefile.macosx @@ -4,7 +4,7 @@ INCLUDES = LD = g++ X11INCLUDEDIR = /usr/X11R6/include X11LIBDIR = /usr/X11R6/lib -INCLUDE_DIRS = -I$(X11INCLUDEDIR) +INCLUDE_DIRS = -I$(X11INCLUDEDIR) -DHAVE_CONFIG_H LIBRARY_DIRS = -L$(X11LIBDIR) OBJECTS = screen.o bmp.o camera.o ctrls.o level.o mygl.o myglFont.o myglTexture.o player.o strmanip.o tga.o vector.o window.o keys.o main.o LIBS = $(LIBRARY_DIRS) -lGL -lGLU -lXxf86vm -lX11 @@ -19,7 +19,7 @@ all: ../OpenArena clean: rm -f *.o - if [ -f ../OpenArena/OpenArena ]; then rm ../OpenArena/OpenArena; fi + if [ -f ../OpenArena ]; then rm ../OpenArena; fi install: @@ -39,47 +39,47 @@ oa_video.so: oa_input.so: #Object Files -screen.o: screen.cpp screen.h +screen.o: screen.cpp screen.h config.h $(CPP) -c $(INCLUDE_DIRS) -o screen.o screen.cpp -bmp.o: bmp.cpp bmp.h mygl.h datatypes.h texture.h +bmp.o: bmp.cpp bmp.h mygl.h datatypes.h texture.h config.h $(CPP) -c $(INCLUDE_DIRS) -o bmp.o bmp.cpp -camera.o: camera.cpp camera.h vector.h mygl.h screen.h +camera.o: camera.cpp camera.h vector.h mygl.h screen.h config.h $(CPP) -c $(INCLUDE_DIRS) -o camera.o camera.cpp -ctrls.o: ctrls.cpp ctrls.h keys.h datatypes.h list.h +ctrls.o: ctrls.cpp ctrls.h keys.h datatypes.h list.h config.h $(CPP) -c $(INCLUDE_DIRS) -o ctrls.o ctrls.cpp -level.o: level.cpp level.h version.h +level.o: level.cpp level.h version.h config.h $(CPP) -c $(INCLUDE_DIRS) -o level.o level.cpp -mygl.o: mygl.cpp mygl.h +mygl.o: mygl.cpp mygl.h config.h $(CPP) -c $(INCLUDE_DIRS) -o mygl.o mygl.cpp -myglFont.o: myglFont.cpp myglFont.h +myglFont.o: myglFont.cpp myglFont.h config.h $(CPP) -c $(INCLUDE_DIRS) -o myglFont.o myglFont.cpp -myglTexture.o: myglTexture.cpp myglTexture.h +myglTexture.o: myglTexture.cpp myglTexture.h config.h $(CPP) -c $(INCLUDE_DIRS) -o myglTexture.o myglTexture.cpp -player.o: player.cpp player.h +player.o: player.cpp player.h config.h $(CPP) -c $(INCLUDE_DIRS) -o player.o player.cpp -strmanip.o: strmanip.cpp strmanip.h +strmanip.o: strmanip.cpp strmanip.h config.h $(CPP) -c $(INCLUDE_DIRS) -o strmanip.o strmanip.cpp -tga.o: tga.cpp tga.h +tga.o: tga.cpp tga.h config.h $(CPP) -c $(INCLUDE_DIRS) -o tga.o tga.cpp -vector.o: vector.cpp vector.h +vector.o: vector.cpp vector.h config.h $(CPP) -c $(INCLUDE_DIRS) -o vector.o vector.cpp -window.o: window.cpp window.h +window.o: window.cpp window.h config.h $(CPP) -c $(INCLUDE_DIRS) -o window.o window.cpp -keys.o: keys.cpp keys.h +keys.o: keys.cpp keys.h config.h $(CPP) -c $(INCLUDE_DIRS) -o keys.o keys.cpp -main.o: macosx.cpp main.h +main.o: macosx.cpp main.h config.h $(CPP) -c $(INCLUDE_DIRS) -o main.o macosx.cpp diff --git a/src/Model.h b/src/Model.h index d84d715..831f5a1 100644 --- a/src/Model.h +++ b/src/Model.h @@ -1,6 +1,10 @@ #ifndef MODEL_H_ #define MODEL_H_ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + namespace OpenArena { diff --git a/src/NullVideoPlugin.h b/src/NullVideoPlugin.h index 6ed067d..2dcf571 100644 --- a/src/NullVideoPlugin.h +++ b/src/NullVideoPlugin.h @@ -1,4 +1,10 @@ -#pragma once +#ifndef __NullVideoPlugin_h__ +#define __NullVideoPlugin_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "VideoPlugin.h" namespace OpenArena @@ -90,3 +96,5 @@ namespace OpenArena }; }; + +#endif diff --git a/src/Plugin.h b/src/Plugin.h index 0551ff4..8df6e0f 100644 --- a/src/Plugin.h +++ b/src/Plugin.h @@ -1,4 +1,9 @@ -#pragma once +#ifndef __Plugin_h__ +#define __Plugin_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif namespace OpenArena { @@ -41,4 +46,6 @@ namespace OpenArena }; -}; \ No newline at end of file +}; + +#endif diff --git a/src/PluginManager.h b/src/PluginManager.h index 3e1f12e..f10c45a 100644 --- a/src/PluginManager.h +++ b/src/PluginManager.h @@ -1,4 +1,9 @@ -#pragma once +#ifndef __PluginManager_h__ +#define __PluginManager_h___ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif #include "list.h" #include "Plugin.h" @@ -104,4 +109,6 @@ namespace OpenArena */ VideoPlugin* GetDefaultVideoPlugin(void); }; -}; \ No newline at end of file +}; + +#endif diff --git a/src/VideoPlugin.h b/src/VideoPlugin.h index 5501d8f..3a91caf 100644 --- a/src/VideoPlugin.h +++ b/src/VideoPlugin.h @@ -1,4 +1,10 @@ -#pragma once +#ifndef __VideoPlugin_h__ +#define __VideoPlugin_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "Plugin.h" #include "window.h" #include "datatypes.h" @@ -76,4 +82,6 @@ namespace OpenArena bool fullscreen = false, const char* title = NULL) = 0; }; -}; \ No newline at end of file +}; + +#endif diff --git a/src/WindowsLogger.h b/src/WindowsLogger.h index 358783b..38454d6 100644 --- a/src/WindowsLogger.h +++ b/src/WindowsLogger.h @@ -1,4 +1,10 @@ -#pragma once +#ifndef __WindowsLogger_h__ +#define __WindowsLogger_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "logger.h" #include "datatypes.h" @@ -143,4 +149,6 @@ namespace OpenArena */ virtual ~WindowsLogger(); }; -}; \ No newline at end of file +}; + +#endif diff --git a/src/bmp.h b/src/bmp.h index cbc35ae..fa6fe67 100644 --- a/src/bmp.h +++ b/src/bmp.h @@ -1,6 +1,10 @@ #ifndef __bmp_h__ #define __bmp_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "texture.h" namespace OpenArena{ diff --git a/src/camera.h b/src/camera.h index 254bbb7..8e433fd 100644 --- a/src/camera.h +++ b/src/camera.h @@ -6,6 +6,10 @@ #ifndef __camera_h__ #define __camera_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include #ifdef WIN32 #include //Currently used for mouse stuff this should be replaced by oa_input diff --git a/src/ctrls.h b/src/ctrls.h index f6d397f..303a428 100644 --- a/src/ctrls.h +++ b/src/ctrls.h @@ -1,3 +1,10 @@ +#ifndef __ctrls_h__ +#define __ctrls_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "keys.h" #include "datatypes.h" #include "list.h" @@ -98,3 +105,5 @@ namespace OpenArena{ list rollRight; }; }; + +#endif diff --git a/src/datatypes.h b/src/datatypes.h index d022f07..4d48831 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -1,6 +1,10 @@ #ifndef __datatypes_h__ #define __datatypes_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef WIN32 //Make this MSVC something typedef unsigned __int8 uint8; typedef unsigned __int16 uint16; diff --git a/src/geometry.h b/src/geometry.h index c6e98fb..e869321 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -1,3 +1,10 @@ +#ifndef __geometry_h__ +#define __geometry_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "vector.h" #include "myglTexture.h" @@ -34,3 +41,5 @@ namespace OpenArena }; }; + +#endif diff --git a/src/image.h b/src/image.h index 2a3eed0..e88d099 100644 --- a/src/image.h +++ b/src/image.h @@ -1,4 +1,9 @@ -#pragma once +#ifndef __image_h__ +#define __image_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif #include "datatypes.h" @@ -154,3 +159,4 @@ namespace OpenArena }; }; +#endif diff --git a/src/keys.h b/src/keys.h index 6199e0d..27d8396 100644 --- a/src/keys.h +++ b/src/keys.h @@ -1,6 +1,10 @@ #ifndef __keys_h__ #define __keys_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + namespace OpenArena { /*! diff --git a/src/level.h b/src/level.h index f6e4f9d..d00e56a 100644 --- a/src/level.h +++ b/src/level.h @@ -1,6 +1,10 @@ #ifndef __LEVEL_H__ #define __LEVEL_H__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef WIN32 #include //prolly used for alot but should be removed #endif diff --git a/src/list.h b/src/list.h index 0fa92bd..fb09253 100644 --- a/src/list.h +++ b/src/list.h @@ -1,6 +1,10 @@ #ifndef __list_h__ #define __list_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include #pragma warning(disable:4715) diff --git a/src/main.h b/src/main.h index 93c7979..daef564 100644 --- a/src/main.h +++ b/src/main.h @@ -1,6 +1,10 @@ #ifndef __main_h__ #define __main_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef WIN32 #include // Header file for windows #endif diff --git a/src/mydefs.h b/src/mydefs.h index d268601..f85fbb9 100644 --- a/src/mydefs.h +++ b/src/mydefs.h @@ -1,7 +1,13 @@ #ifndef __mydefs_h__ #define __mydefs_h__ + +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef WIN32 //This whole file is windows specific right now #include static HWND g_hWnd = NULL; #endif + #endif diff --git a/src/mygl.h b/src/mygl.h index b0579eb..95466d1 100644 --- a/src/mygl.h +++ b/src/mygl.h @@ -1,6 +1,10 @@ #ifndef __MYGL_H__ #define __MYGL_H__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #ifdef WIN32 #include //Remove if possible #include diff --git a/src/myglFont.h b/src/myglFont.h index b5a5054..ec241e5 100644 --- a/src/myglFont.h +++ b/src/myglFont.h @@ -1,6 +1,10 @@ #ifndef __glPrint_h__ #define __glPrint_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "mygl.h" namespace OpenArena diff --git a/src/myglTexture.h b/src/myglTexture.h index e215ca4..a4b8e1a 100644 --- a/src/myglTexture.h +++ b/src/myglTexture.h @@ -1,6 +1,10 @@ #ifndef __myglTexture_h__ #define __myglTexture_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include #include "datatypes.h" #include "mygl.h" diff --git a/src/player.h b/src/player.h index 0c4814b..8f23c46 100644 --- a/src/player.h +++ b/src/player.h @@ -1,6 +1,10 @@ #ifndef __PLAYER_H__ #define __PLAYER_H__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "camera.h" #include "ctrls.h" diff --git a/src/screen.h b/src/screen.h index e6318d4..0e690b5 100644 --- a/src/screen.h +++ b/src/screen.h @@ -2,6 +2,10 @@ #define __screen_h__ #include +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + using namespace std; namespace OpenArena { diff --git a/src/strmanip.h b/src/strmanip.h index 71d2ebc..e3ee2e8 100644 --- a/src/strmanip.h +++ b/src/strmanip.h @@ -1,6 +1,10 @@ #ifndef __strmanip_h__ #define __strmanip_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include "keys.h" diff --git a/src/texture.h b/src/texture.h index b8bc247..7ce9c03 100644 --- a/src/texture.h +++ b/src/texture.h @@ -1,6 +1,10 @@ #ifndef __texture_h__ #define __texture_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + namespace OpenArena { /*! diff --git a/src/tga.h b/src/tga.h index 2b38df9..93d10a6 100644 --- a/src/tga.h +++ b/src/tga.h @@ -1,6 +1,10 @@ #ifndef __TGA_H__ #define __TGA_H__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #pragma comment(lib, "OpenGL32.lib") #ifdef WIN32 #include //I think this was only needed because gl.h uses it diff --git a/src/vector.h b/src/vector.h index f545669..f70a7b9 100644 --- a/src/vector.h +++ b/src/vector.h @@ -1,6 +1,10 @@ #ifndef __vector_h__ #define __vector_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include namespace OpenArena{ /*! diff --git a/src/worlddefs.h b/src/worlddefs.h index add134a..803c728 100644 --- a/src/worlddefs.h +++ b/src/worlddefs.h @@ -1,6 +1,10 @@ #ifndef __WorldDefs_h__ #define __WorldDefs_h__ +#if defined HAVE_CONFIG_H +#include "config.h" +#endif + #include "level.h" static OpenArena::Level level;