From: Ryan C. Gordon Date: Fri, 5 Aug 2005 15:50:23 +0000 (+0000) Subject: More work: compiles, missing like 5 symbols. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=85c66654b25752485c9a4b4c534263df78e0ff78;p=lugaru.git More work: compiles, missing like 5 symbols. --- diff --git a/Source/Game.h b/Source/Game.h index 5be8ce4..92bac48 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -38,15 +38,6 @@ extern GLuint rabbittexture; -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - - class Game { public: diff --git a/Source/MacCompatibility.cpp b/Source/MacCompatibility.cpp index 0559257..fa28ba0 100644 --- a/Source/MacCompatibility.cpp +++ b/Source/MacCompatibility.cpp @@ -2,12 +2,21 @@ /**> HEADER FILES <**/ #include "MacCompatibility.h" + +#ifdef WIN32 #include +#endif + #include #include #include +#include +#include #if PLATFORM_UNIX +#include +#include +#include typedef long long __int64; typedef __int64 LARGE_INTEGER; static int QueryPerformanceFrequency(LARGE_INTEGER *liptr) @@ -18,7 +27,7 @@ static int QueryPerformanceFrequency(LARGE_INTEGER *liptr) return(1); } -static void QueryPerformanceCounter(LARGE_INTEGER *liptr) +static int QueryPerformanceCounter(LARGE_INTEGER *liptr) { struct timeval tv; gettimeofday(&tv, NULL); diff --git a/Source/SDLInput.cpp b/Source/SDLInput.cpp index 26bf03f..f796077 100644 --- a/Source/SDLInput.cpp +++ b/Source/SDLInput.cpp @@ -2,7 +2,9 @@ /**> HEADER FILES <**/ #include "SDLInput.h" -#include "String.h" +#include +#include +#include extern bool keyboardfrozen; extern bool buttons[3]; diff --git a/Source/Skybox.cpp b/Source/Skybox.cpp index 4c46628..8920263 100644 --- a/Source/Skybox.cpp +++ b/Source/Skybox.cpp @@ -1,4 +1,4 @@ -#include "skybox.h" +#include "Skybox.h" #include "Game.h" extern float viewdistance; @@ -347,13 +347,13 @@ SkyBox::SkyBox() } SkyBox::~SkyBox() { - if (front) glDeleteTextures( 1, (const unsigned long *)&front ); - if (left) glDeleteTextures( 1, (const unsigned long *)&left ); - if (back) glDeleteTextures( 1, (const unsigned long *)&back ); - if (right) glDeleteTextures( 1, (const unsigned long *)&right ); - if (up) glDeleteTextures( 1, (const unsigned long *)&up ); - if (down) glDeleteTextures( 1, (const unsigned long *)&down ); - if (cloud) glDeleteTextures( 1, (const unsigned long *)&cloud ); - if (reflect) glDeleteTextures( 1, (const unsigned long *)&reflect ); + if (front) glDeleteTextures( 1, &front ); + if (left) glDeleteTextures( 1, &left ); + if (back) glDeleteTextures( 1, &back ); + if (right) glDeleteTextures( 1, &right ); + if (up) glDeleteTextures( 1, &up ); + if (down) glDeleteTextures( 1, &down ); + if (cloud) glDeleteTextures( 1, &cloud ); + if (reflect) glDeleteTextures( 1, &reflect ); }; diff --git a/Source/Sprites.cpp b/Source/Sprites.cpp index adf7c70..2d6d4a0 100644 --- a/Source/Sprites.cpp +++ b/Source/Sprites.cpp @@ -429,16 +429,16 @@ Sprites::Sprites() } Sprites::~Sprites() { - if (toothtexture) glDeleteTextures( 1, (const unsigned long *)&toothtexture ); - if (cloudtexture) glDeleteTextures( 1, (const unsigned long *)&cloudtexture ); - if (cloudimpacttexture) glDeleteTextures( 1, (const unsigned long *)&cloudimpacttexture ); - if (bloodtexture) glDeleteTextures( 1, (const unsigned long *)&bloodtexture ); - if (flametexture) glDeleteTextures( 1, (const unsigned long *)&flametexture ); - if (bloodflametexture) glDeleteTextures( 1, (const unsigned long *)&bloodflametexture ); - if (smoketexture) glDeleteTextures( 1, (const unsigned long *)&smoketexture ); - if (snowflaketexture) glDeleteTextures( 1, (const unsigned long *)&snowflaketexture ); - if (shinetexture) glDeleteTextures( 1, (const unsigned long *)&shinetexture ); - if (splintertexture) glDeleteTextures( 1, (const unsigned long *)&splintertexture ); - if (leaftexture) glDeleteTextures( 1, (const unsigned long *)&leaftexture ); + if (toothtexture) glDeleteTextures( 1, &toothtexture ); + if (cloudtexture) glDeleteTextures( 1, &cloudtexture ); + if (cloudimpacttexture) glDeleteTextures( 1, &cloudimpacttexture ); + if (bloodtexture) glDeleteTextures( 1, &bloodtexture ); + if (flametexture) glDeleteTextures( 1, &flametexture ); + if (bloodflametexture) glDeleteTextures( 1, &bloodflametexture ); + if (smoketexture) glDeleteTextures( 1, &smoketexture ); + if (snowflaketexture) glDeleteTextures( 1, &snowflaketexture ); + if (shinetexture) glDeleteTextures( 1, &shinetexture ); + if (splintertexture) glDeleteTextures( 1, &splintertexture ); + if (leaftexture) glDeleteTextures( 1, &leaftexture ); } diff --git a/Source/TGALoader.cpp b/Source/TGALoader.cpp index 7c722d7..b9c1b91 100644 --- a/Source/TGALoader.cpp +++ b/Source/TGALoader.cpp @@ -19,7 +19,7 @@ bool upload_image(const unsigned char* filePath, bool hasalpha) pgame->LoadingScreen(); } -#ifdef WIN32 +#if !PLATFORM_MACOSX // for Windows, just use TGA loader for now char fileName[ 256]; diff --git a/Source/Terrain.cpp b/Source/Terrain.cpp index 0ba1ddd..a102e52 100644 --- a/Source/Terrain.cpp +++ b/Source/Terrain.cpp @@ -1530,12 +1530,12 @@ Terrain::Terrain() } Terrain::~Terrain() { - if(terraintexture)glDeleteTextures( 1, (const unsigned long *)&terraintexture ); - if(shadowtexture) glDeleteTextures( 1, (const unsigned long *)&shadowtexture ); - if(bodyprinttexture) glDeleteTextures( 1, (const unsigned long *)&bodyprinttexture ); - if(footprinttexture) glDeleteTextures( 1, (const unsigned long *)&footprinttexture ); - if(bloodtexture) glDeleteTextures( 1, (const unsigned long *)&bloodtexture ); - if(bloodtexture2) glDeleteTextures( 1, (const unsigned long *)&bloodtexture2 ); - if(breaktexture) glDeleteTextures( 1, (const unsigned long *)&breaktexture ); + if(terraintexture)glDeleteTextures( 1, &terraintexture ); + if(shadowtexture) glDeleteTextures( 1, &shadowtexture ); + if(bodyprinttexture) glDeleteTextures( 1, &bodyprinttexture ); + if(footprinttexture) glDeleteTextures( 1, &footprinttexture ); + if(bloodtexture) glDeleteTextures( 1, &bloodtexture ); + if(bloodtexture2) glDeleteTextures( 1, &bloodtexture2 ); + if(breaktexture) glDeleteTextures( 1, &breaktexture ); } diff --git a/Source/Text.cpp b/Source/Text.cpp index 221fc22..cc8ba27 100644 --- a/Source/Text.cpp +++ b/Source/Text.cpp @@ -257,6 +257,6 @@ Text::~Text() glDeleteLists(base, 512); base = 0; } - if (FontTexture) glDeleteTextures( 1, (const unsigned long *)&FontTexture ); + if (FontTexture) glDeleteTextures( 1, &FontTexture ); } diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index 390dbd3..2916ddf 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -1333,12 +1333,12 @@ Weapons::Weapons() Weapons::~Weapons() { - if (stafftextureptr) glDeleteTextures( 1, (const unsigned long *)&stafftextureptr ); - if (knifetextureptr) glDeleteTextures( 1, (const unsigned long *)&knifetextureptr ); - if (lightbloodknifetextureptr) glDeleteTextures( 1, (const unsigned long *)&lightbloodknifetextureptr ); - if (bloodknifetextureptr) glDeleteTextures( 1, (const unsigned long *)&bloodknifetextureptr ); - if (swordtextureptr) glDeleteTextures( 1, (const unsigned long *)&swordtextureptr ); - if (lightbloodswordtextureptr) glDeleteTextures( 1, (const unsigned long *)&lightbloodswordtextureptr ); - if (bloodswordtextureptr) glDeleteTextures( 1, (const unsigned long *)&bloodswordtextureptr ); + if (stafftextureptr) glDeleteTextures( 1, &stafftextureptr ); + if (knifetextureptr) glDeleteTextures( 1, &knifetextureptr ); + if (lightbloodknifetextureptr) glDeleteTextures( 1, &lightbloodknifetextureptr ); + if (bloodknifetextureptr) glDeleteTextures( 1, &bloodknifetextureptr ); + if (swordtextureptr) glDeleteTextures( 1, &swordtextureptr ); + if (lightbloodswordtextureptr) glDeleteTextures( 1, &lightbloodswordtextureptr ); + if (bloodswordtextureptr) glDeleteTextures( 1, &bloodswordtextureptr ); } diff --git a/Source/binio.h b/Source/binio.h index 4896813..d2d3534 100644 --- a/Source/binio.h +++ b/Source/binio.h @@ -45,6 +45,8 @@ extern "C" { N network byte order */ +#ifndef ALREADY_DID_BINIO_STDINT +#define ALREADY_DID_BINIO_STDINT #if defined(BinIO_STDINT_HEADER) #include BinIO_STDINT_HEADER typedef float float32_t; @@ -60,6 +62,7 @@ extern "C" { #endif typedef float float32_t; typedef double float64_t; +#endif #endif typedef struct diff --git a/Source/private.h b/Source/private.h index 97bdd16..79edf26 100644 --- a/Source/private.h +++ b/Source/private.h @@ -17,6 +17,8 @@ #define BinIO_HOST_BYTE_ORDER 'H' #define BinIO_NETWORK_BYTE_ORDER 'N' +#ifndef ALREADY_DID_BINIO_STDINT +#define ALREADY_DID_BINIO_STDINT #if defined(BinIO_STDINT_HEADER) #include BinIO_STDINT_HEADER typedef float float32_t; @@ -33,6 +35,7 @@ typedef unsigned long uint32_t; typedef float float32_t; typedef double float64_t; #endif +#endif #ifndef BinIO_INLINE #if defined(__GNUC__) diff --git a/makefile b/makefile index 8838d7b..7356dd3 100644 --- a/makefile +++ b/makefile @@ -28,6 +28,9 @@ DEFINES := \ -DPLATFORM_UNIX=1 \ -DPLATFORM_LINUX=1 \ -DUSE_SDL=1 \ + -DTRUE=1 \ + -DFALSE=0 \ + -Dstricmp=strcasecmp \ INCLUDES := \ -I./SDL12/include \ @@ -46,7 +49,7 @@ ifeq ($(strip $(macosx)),true) else CFLAGS += -DPLATFORM_LINUX=1 #CFLAGS += -msse -mmmx - LDFLAGS := -lSDL + LDFLAGS := -lSDL -lGL -lGLU -L$(RUNDIR) -lfmod endif CXXFLAGS := $(CFLAGS) @@ -60,7 +63,6 @@ SRCS := \ Lights.cpp \ Models.cpp \ Objects.cpp \ - OpenGL_Windows.cpp \ pack.c \ pack_private.c \ Person.cpp \ @@ -77,14 +79,17 @@ SRCS := \ unpack_private.c \ Weapons.cpp \ MacCompatibility.cpp \ - WinInput.cpp \ logger/logger.cpp \ - Driver.cc \ - Md5.cc \ + DRIVER.CC \ + MD5.CC \ SDLInput.cpp \ +UNUSED_SRCS := \ + OpenGL_Windows.cpp \ -OBJS := $(SRCS:.cpp=.o) +OBJS := $(SRCS:.CC=.o) +OBJS := $(OBJS:.cc=.o) +OBJS := $(OBJS:.cpp=.o) OBJS := $(OBJS:.c=.o) OBJS := $(OBJS:.m=.o) OBJS := $(foreach f,$(OBJS),$(BINDIR)/$(f)) @@ -101,6 +106,9 @@ $(BINDIR)/%.o : $(SRCDIR)/%.cpp $(BINDIR)/%.o : $(SRCDIR)/%.CC $(CXX) -o $@ $(CXXFLAGS) $< +$(BINDIR)/%.o : $(SRCDIR)/%.cc + $(CXX) -o $@ $(CXXFLAGS) $< + $(BINDIR)/%.o : $(SRCDIR)/%.m $(CC) -o $@ $(CFLAGS) $< @@ -116,6 +124,7 @@ endif clean: rm -rf $(BINDIR)/*.o + rm -rf $(BINDIR)/logger/*.o rm -rf $(EXE) # end of makefile ...