diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 3712f0a61..8e5a8261c 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -256,7 +256,7 @@ endif OPTIMIZATIONS=-O$(OPTLEVEL) $(OPTOPT) DEBUGFLAG=-g -ifneq (0,$(CLANG)) +ifeq (0,$(CLANG)) ifneq ($(PLATFORM),WII) DEBUGFLAG=-ggdb endif @@ -678,6 +678,8 @@ ifeq ($(PLATFORM),DARWIN) COMPILERFLAGS+= -DUNDERSCORES ASFORMAT=macho$(SYSBITS) ASFLAGS+= -DUNDERSCORES + # ASM on OS X crashes in mmxoverlay() + override NOASM=1 # LIBDIRS+= -Lplatform/Apple/lib # COMPILERFLAGS+= -Iplatform/Apple/include @@ -715,9 +717,6 @@ ifeq ($(PLATFORM),DARWIN) ifeq (1,$(BUILD32_ON_64)) ARCH=-arch i386 - else - # ASM won't work on PowerPC or x86_64 - override NOASM=1 endif ifneq ($(findstring x86_64,$(ARCH)),x86_64) @@ -730,7 +729,9 @@ ifeq ($(PLATFORM),DARWIN) endif endif - COMMONFLAGS += -fno-pic + ifeq (0,$(CLANG)) + COMMONFLAGS += -fno-pic + endif endif ifeq ($(PLATFORM),WINDOWS) COMPILERFLAGS+= -DUNDERSCORES -DHAVE_INTTYPES -Iplatform/Windows/include diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index ca11d0cf2..99463048b 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -378,6 +378,8 @@ FORCE_INLINE void B_BUF32(uint8_t *buf, uint32_t x) buf[2] = (x & 0x00FF0000) >> 16; buf[3] = (x & 0xFF000000) >> 24; } +#if 0 +// i686-apple-darwin11-llvm-gcc-4.2 complains "integer constant is too large for 'long' type" FORCE_INLINE void B_BUF64(uint8_t *buf, uint64_t x) { buf[0] = (x & 0x00000000000000FF); @@ -389,6 +391,7 @@ FORCE_INLINE void B_BUF64(uint8_t *buf, uint64_t x) buf[6] = (x & 0x00FF000000000000) >> 48; buf[7] = (x & 0xFF00000000000000) >> 56; } +#endif FORCE_INLINE uint16_t B_UNBUF16(const uint8_t *buf) { return (buf[1] << 8) | (buf[0]); } FORCE_INLINE uint32_t B_UNBUF32(const uint8_t *buf) diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index df5625eaf..e2ee4e39e 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -7,6 +7,10 @@ #include "hightile.h" #include "baselayer.h" // glinfo +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { uint8_t r, g, b, a; } coltype; extern int32_t rendmode; @@ -189,7 +193,7 @@ extern int32_t drawingskybox; extern int32_t hicprecaching; extern float gyxscale, gxyaspect, ghalfx, grhalfxdown10; extern float fcosglobalang, fsinglobalang; -extern float fxdim, fydim, fxdimen, fydimen, fviewingrange; +extern float fxdim, fydim, fydimen, fviewingrange; extern char ptempbuf[MAXWALLSB<<1]; @@ -198,6 +202,10 @@ extern char ptempbuf[MAXWALLSB<<1]; extern void polymost_setupglowtexture(int32_t texunits, int32_t tex); extern void polymost_setupdetailtexture(int32_t texunits, int32_t tex); +#ifdef __cplusplus +} +#endif + #endif #endif diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 37873a2ad..5edb3d51d 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -2263,6 +2263,7 @@ static int32_t smostwall[MAXWALLSB], smostwallcnt = -1; static vec3_t spritesxyz[MAXSPRITESONSCREEN+1]; int32_t xdimen = -1, xdimenrecip, halfxdimen, xdimenscale, xdimscale; +float fxdimen = -1.f; int32_t ydimen; static int32_t wx1, wy1, wx2, wy2; intptr_t frameoffset; @@ -14867,8 +14868,8 @@ void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2) xdimenrecip = divscale32(1L,xdimen); ydimen = (y2-y1)+1; -#ifdef USE_OPENGL fxdimen = (float) xdimen; +#ifdef USE_OPENGL fydimen = (float) ydimen; #endif setaspect_new(); diff --git a/polymer/eduke32/build/src/engine_priv.h b/polymer/eduke32/build/src/engine_priv.h index 6cbdb4748..4beddb9b4 100644 --- a/polymer/eduke32/build/src/engine_priv.h +++ b/polymer/eduke32/build/src/engine_priv.h @@ -24,6 +24,10 @@ extern "C" { } #endif +#ifdef __cplusplus +extern "C" { +#endif + extern uint8_t basepalcount; extern uint8_t curbasepal; @@ -32,6 +36,7 @@ extern int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB]; extern int16_t maskwall[MAXWALLSB], maskwallcnt; extern spritetype *tspriteptr[MAXSPRITESONSCREEN + 1]; extern int32_t xdimen, xdimenrecip, halfxdimen, xdimenscale, xdimscale, ydimen; +extern float fxdimen; extern intptr_t frameoffset; extern int32_t globalposx, globalposy, globalposz, globalhoriz; extern float fglobalposx, fglobalposy, fglobalposz; @@ -232,4 +237,8 @@ static inline void set_globalpos(int32_t x, int32_t y, int32_t z) globalposz = z, fglobalposz = (float)z; } +#ifdef __cplusplus +} +#endif + #endif /* ENGINE_PRIV_H */ diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 412348855..f47ec5ca0 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -129,7 +129,7 @@ static double guo, gux, guy; //Screen-based texture mapping parameters static double gvo, gvx, gvy; static double gdo, gdx, gdy; float fcosglobalang, fsinglobalang; -float fxdim, fydim, fxdimen, fydimen, fviewingrange; +float fxdim, fydim, fydimen, fviewingrange; static int32_t preview_mouseaim=0; // when 1, displays a CROSSHAIR tsprite at the _real_ aimed position #ifdef USE_OPENGL diff --git a/polymer/eduke32/build/src/rawinput.c b/polymer/eduke32/build/src/rawinput.c index 894d4dcac..1a7a72cee 100644 --- a/polymer/eduke32/build/src/rawinput.c +++ b/polymer/eduke32/build/src/rawinput.c @@ -1,5 +1,6 @@ #define WIN32_LEAN_AND_MEAN #define _WIN32_WINNT 0x0501 +#include #include #include "rawinput.h" #include "winlayer.h" diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 19b494dec..7cc800b65 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -28,6 +28,8 @@ # define bREFIID & #endif +#include + #ifdef _MSC_VER #include #endif @@ -2800,8 +2802,10 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) if (!Bstrcmp(glinfo.vendor,"Microsoft Corporation")) err = 1; else if (!Bstrcmp(glinfo.vendor,"SiS")) err = 1; else if (!Bstrcmp(glinfo.vendor,"3Dfx Interactive Inc.")) err = 1; +#ifdef POLYMER else if (!Bstrcmp(glinfo.vendor, "Intel")) pr_ati_fboworkaround = 1; +#endif else { if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc.")) @@ -2829,8 +2833,10 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) #endif } +#ifdef POLYMER if (pr_ati_fboworkaround) initprintf("Enabling Intel/ATI FBO color attachment workaround.\n"); +#endif if (!forcegl && err) {