commit de5dce1b90ec878baf81731094ad8121c81a4fd3
Author: Jan RÄ™korajski <[email protected]>
Date:   Mon Jul 20 19:50:51 2015 +0000

    - fix building with glew 1.12

 glew-1.12.patch  | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 warzone2100.spec |   2 +
 2 files changed, 127 insertions(+)
---
diff --git a/warzone2100.spec b/warzone2100.spec
index 30a5ae3..b1d2c27 100644
--- a/warzone2100.spec
+++ b/warzone2100.spec
@@ -7,6 +7,7 @@ License:        GPL v2+
 Group:         X11/Applications/Games/Strategy
 Source0:       
http://downloads.sourceforge.net/warzone2100/%{name}-%{version}.tar.xz
 # Source0-md5: 4e947125e9604821164f1ad9d1922447
+Patch0:                glew-1.12.patch
 URL:           http://www.wz2100.net/
 BuildRequires: OpenAL-devel >= 0.0.8-4
 BuildRequires: OpenGL-GLU-devel
@@ -52,6 +53,7 @@ artyleryjskich oraz obronie przeciwlotniczej.
 
 %prep
 %setup -q
+%patch0 -p1
 
 # et_EE -> et
 %{__sed} -e 's/et_EE/et/g' -i po/LINGUAS
diff --git a/glew-1.12.patch b/glew-1.12.patch
new file mode 100644
index 0000000..29a7fa7
--- /dev/null
+++ b/glew-1.12.patch
@@ -0,0 +1,125 @@
+From 6a6c611ca3d9d6745e5343f2ee041892772ccae6 Mon Sep 17 00:00:00 2001
+From: vexed <[email protected]>
+Date: Thu, 16 Jul 2015 22:45:14 -0400
+Subject: [PATCH] Resync/backport the code base:
+
+3.1: Remove hack to support some pre-OpenGL-2.0 systems that made
+assumptions about internals in GLEW that breaks with GLEW 1.12.
+
+See ticket:4300 reported by pabs
+
+(cherry picked from commit d512d1dc9857e3c2bbfa0a7b5856bdf420412b8f)
+
+Conflicts:
+       lib/ivis_opengl/screen.cpp
+---
+ lib/ivis_opengl/screen.cpp | 61 ----------------------------------------------
+ lib/ivis_opengl/screen.h   |  1 -
+ src/init.cpp               |  3 ---
+ 3 files changed, 65 deletions(-)
+
+diff --git a/lib/ivis_opengl/screen.cpp b/lib/ivis_opengl/screen.cpp
+index b0aa0f5..b957227 100644
+--- a/lib/ivis_opengl/screen.cpp
++++ b/lib/ivis_opengl/screen.cpp
+@@ -175,7 +175,6 @@ bool screenInitialise()
+ 
+       if (canRunShaders)
+       {
+-              screen_EnableMissingFunctions();  // We need to do this before 
pie_LoadShaders(), but the effect of this call will be undone later by 
iV_TextInit(), so we will need to call it again.
+               if (pie_LoadShaders())
+               {
+                       pie_SetShaderAvailability(true);
+@@ -207,66 +206,6 @@ void screenShutDown(void)
+       return GLEW_VERSION_1_5 || GLEW_ARB_vertex_buffer_object;
+ }
+ 
+-// Make OpenGL's VBO functions available under the core names for drivers 
that support OpenGL 1.4 only but have the VBO extension
+-void screen_EnableMissingFunctions()
+-{
+-      if (!GLEW_VERSION_1_3 && GLEW_ARB_multitexture)
+-      {
+-              debug(LOG_WARNING, "Pre-OpenGL 1.3: Fixing ARB_multitexture 
extension function names.");
+-
+-              __glewActiveTexture = __glewActiveTextureARB;
+-              __glewMultiTexCoord2fv = __glewMultiTexCoord2fvARB;
+-      }
+-
+-      if (!GLEW_VERSION_1_5 && GLEW_ARB_vertex_buffer_object)
+-      {
+-              debug(LOG_WARNING, "Pre-OpenGL 1.5: Fixing 
ARB_vertex_buffer_object extension function names.");
+-
+-              __glewBindBuffer = __glewBindBufferARB;
+-              __glewBufferData = __glewBufferDataARB;
+-              __glewBufferSubData = __glewBufferSubDataARB;
+-              __glewDeleteBuffers = __glewDeleteBuffersARB;
+-              __glewGenBuffers = __glewGenBuffersARB;
+-              __glewGetBufferParameteriv = __glewGetBufferParameterivARB;
+-              __glewGetBufferPointerv = __glewGetBufferPointervARB;
+-              __glewGetBufferSubData = __glewGetBufferSubDataARB;
+-              __glewIsBuffer = __glewIsBufferARB;
+-              __glewMapBuffer = __glewMapBufferARB;
+-              __glewUnmapBuffer = __glewUnmapBufferARB;
+-      }
+-
+-      if (!GLEW_VERSION_2_0 && GLEW_ARB_shader_objects)
+-      {
+-              debug(LOG_WARNING, "Pre-OpenGL 2.0: Fixing ARB_shader_objects 
extension function names.");
+-
+-              __glewGetUniformLocation = __glewGetUniformLocationARB;
+-              __glewAttachShader = __glewAttachObjectARB;
+-              __glewCompileShader = __glewCompileShaderARB;
+-              __glewCreateProgram = __glewCreateProgramObjectARB;
+-              __glewCreateShader = __glewCreateShaderObjectARB;
+-              __glewGetProgramInfoLog = __glewGetInfoLogARB;
+-              __glewGetShaderInfoLog = __glewGetInfoLogARB;  // Same as 
previous.
+-              __glewGetProgramiv = __glewGetObjectParameterivARB;
+-              __glewUseProgram = __glewUseProgramObjectARB;
+-              __glewGetShaderiv = __glewGetObjectParameterivARB;
+-              __glewLinkProgram = __glewLinkProgramARB;
+-              __glewShaderSource = __glewShaderSourceARB;
+-              __glewUniform1f = __glewUniform1fARB;
+-              __glewUniform1i = __glewUniform1iARB;
+-              __glewUniform4fv = __glewUniform4fvARB;
+-      }
+-
+-      if ((GLEW_ARB_imaging || GLEW_EXT_blend_color) && __glewBlendColor == 
NULL)
+-      {
+-              __glewBlendColor = __glewBlendColorEXT;  // Shouldn't be needed 
if GLEW_ARB_imaging is true, but apparently is needed even in that case, with 
some drivers..?
+-              if (__glewBlendColor == NULL)
+-              {
+-                      debug(LOG_ERROR, "Your graphics driver is broken, and 
claims to support ARB_imaging or EXT_blend_color without exporting 
glBlendColor[EXT].");
+-                      __GLEW_ARB_imaging = __GLEW_EXT_blend_color = 0;
+-              }
+-      }
+-}
+-
+ void screen_SetBackDropFromFile(const char* filename)
+ {
+       // HACK : We should use a resource handler here!
+diff --git a/lib/ivis_opengl/screen.h b/lib/ivis_opengl/screen.h
+index 7cfc819..09235f4 100644
+--- a/lib/ivis_opengl/screen.h
++++ b/lib/ivis_opengl/screen.h
+@@ -62,7 +62,6 @@ extern void screenDoDumpToDiskIfRequired(void);
+ void screen_enableMapPreview(char *name, int width, int height, Vector2i 
*playerpositions);
+ void screen_disableMapPreview(void);
+ bool screen_getMapPreview(void);
+-void screen_EnableMissingFunctions();
+ 
+ struct OPENGL_DATA
+ {
+diff --git a/src/init.cpp b/src/init.cpp
+index aaf7003..3f42313 100644
+--- a/src/init.cpp
++++ b/src/init.cpp
+@@ -716,9 +716,6 @@ bool systemInitialise(void)
+       // Initialize the iVis text rendering module
+       iV_TextInit();
+ 
+-      // Fix badly named OpenGL functions. Must be done after iV_TextInit, to 
avoid the renames being clobbered by an extra glewInit() call.
+-      screen_EnableMissingFunctions();
+-
+       iV_Reset();                                                             
// Reset the IV library.
+       readAIs();
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/warzone2100.git/commitdiff/de5dce1b90ec878baf81731094ad8121c81a4fd3

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to