From 2cb9d1e737fc6ebd98800af47dce3b7c09c71d48 Mon Sep 17 00:00:00 2001 From: safety0ff Date: Sun, 20 Feb 2011 19:36:28 -0500 Subject: [PATCH] Fix glew cross compilation. --- lib/framework/opengl.h | 7 +++++++ lib/ivis_opengl/piedraw.cpp | 2 +- lib/ivis_opengl/piemode.cpp | 2 +- lib/ivis_opengl/piestate.cpp | 1 - lib/ivis_opengl/tex.cpp | 2 +- src/terrain.cpp | 4 ++-- src/texture.cpp | 7 +++---- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/framework/opengl.h b/lib/framework/opengl.h index 8b4c93a85..e728d97e9 100644 --- a/lib/framework/opengl.h +++ b/lib/framework/opengl.h @@ -24,6 +24,13 @@ #ifndef __INCLUDED_LIB_FRAMEWORK_OPENGL_H__ #define __INCLUDED_LIB_FRAMEWORK_OPENGL_H__ +/* + * glew.h includes inttypes.h under mingw and cygwin + * inttypes.h includes stdint.h + * We need to include wzglobal.h because we must + * define __STDC_LIMIT_MACROS before including stdint.h + */ +#include "lib/framework/wzglobal.h" #include #endif diff --git a/lib/ivis_opengl/piedraw.cpp b/lib/ivis_opengl/piedraw.cpp index 9fb962df1..5e0691722 100644 --- a/lib/ivis_opengl/piedraw.cpp +++ b/lib/ivis_opengl/piedraw.cpp @@ -21,10 +21,10 @@ * Render routines for 3D coloured and shaded transparency rendering. */ -#include #include #include "lib/framework/frame.h" +#include "lib/framework/opengl.h" #include "lib/ivis_opengl/ivisdef.h" #include "lib/ivis_opengl/imd.h" #include "lib/ivis_opengl/piefunc.h" diff --git a/lib/ivis_opengl/piemode.cpp b/lib/ivis_opengl/piemode.cpp index 7f4652a55..d3d95779e 100644 --- a/lib/ivis_opengl/piemode.cpp +++ b/lib/ivis_opengl/piemode.cpp @@ -26,8 +26,8 @@ */ /***************************************************************************/ -#include #include "lib/framework/frame.h" +#include "lib/framework/opengl.h" // for glew macros #include diff --git a/lib/ivis_opengl/piestate.cpp b/lib/ivis_opengl/piestate.cpp index 4d49af4fe..512ef890e 100644 --- a/lib/ivis_opengl/piestate.cpp +++ b/lib/ivis_opengl/piestate.cpp @@ -21,7 +21,6 @@ * Renderer setup and state control routines for 3D rendering. */ -#include #include "lib/framework/frame.h" #include diff --git a/lib/ivis_opengl/tex.cpp b/lib/ivis_opengl/tex.cpp index ce1151469..49e7393d0 100644 --- a/lib/ivis_opengl/tex.cpp +++ b/lib/ivis_opengl/tex.cpp @@ -18,8 +18,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "lib/framework/frame.h" +#include "lib/framework/opengl.h" #if defined(WZ_OS_MAC) # include diff --git a/src/terrain.cpp b/src/terrain.cpp index 9f89c1664..5788b1a50 100644 --- a/src/terrain.cpp +++ b/src/terrain.cpp @@ -26,13 +26,13 @@ * The technique used it called "texture splatting". * Every layer only draws the spots where that terrain is, and additive blending is used to make transitions smooth. * Decals are a kind of hack now, as for some tiles (where decal == true) the old tile is just drawn. - * The water is drawn using the hardcoded page-80 and page-81 textures. + * The water is drawn using the hardcoded page-80 and page-81 textures. */ -#include #include #include "lib/framework/frame.h" +#include "lib/framework/opengl.h" #include "lib/ivis_opengl/ivisdef.h" #include "lib/ivis_opengl/imd.h" #include "lib/ivis_opengl/piefunc.h" diff --git a/src/texture.cpp b/src/texture.cpp index b68bea132..18b3dadb7 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -23,17 +23,16 @@ * This is where we do texture atlas generation. */ -#include -#include "lib/framework/frame.h" - - #include +#include "lib/framework/frame.h" + #include #include "lib/framework/file.h" #include "lib/framework/string_ext.h" +#include "lib/framework/opengl.h" #include "lib/ivis_opengl/pietypes.h" #include "lib/ivis_opengl/piestate.h" #include "lib/ivis_opengl/tex.h"