gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / mars-sfml-2.3.patch
1 This is a concatenation of the following two patches:
2
3 https://github.com/jcowgill/M.A.R.S./commit/33d5affabf8ff84f2c028b9303c6a9e83cc824ad.patch
4 https://patch-diff.githubusercontent.com/raw/thelaui/M.A.R.S./pull/2.patch
5
6 Their purpose is to allow Mars to be built against the latest version of SFML.
7
8 From 33d5affabf8ff84f2c028b9303c6a9e83cc824ad Mon Sep 17 00:00:00 2001
9 From: James Cowgill <james410@cowgill.org.uk>
10 Date: Sat, 9 May 2015 01:54:14 +0100
11 Subject: [PATCH] Remove dependency on GLU - fixes build with SFML 2.3
12
13 ---
14 premake4.lua | 8 ++++----
15 src/Shaders/postFX.cpp | 2 +-
16 src/System/window.cpp | 12 ++++++------
17 3 files changed, 11 insertions(+), 11 deletions(-)
18
19 diff --git a/premake4.lua b/premake4.lua
20 index 023dddd..5af4495 100755
21 --- a/premake4.lua
22 +++ b/premake4.lua
23 @@ -11,11 +11,11 @@ project "mars"
24 defines { "NDEBUG" }
25 flags { "Optimize" }
26 if os.get() == "windows" then
27 - links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" }
28 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" }
29 elseif os.get() == "macosx" then
30 links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" }
31 else
32 - links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
33 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
34 libdirs { "/usr/lib", "/usr/local/lib" }
35 end
36
37 @@ -23,10 +23,10 @@ project "mars"
38 defines { "_DEBUG", "DEBUG" }
39 flags { "Symbols" }
40 if os.get() == "windows" then
41 - links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" }
42 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" }
43 elseif os.get() == "macosx" then
44 links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" }
45 else
46 - links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
47 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
48 libdirs { "/usr/lib", "/usr/local/lib" }
49 end
50 diff --git a/src/Shaders/postFX.cpp b/src/Shaders/postFX.cpp
51 index 987f411..f767a47 100644
52 --- a/src/Shaders/postFX.cpp
53 +++ b/src/Shaders/postFX.cpp
54 @@ -78,7 +78,7 @@ namespace postFX {
55 postFX_.loadFromFile(settings::C_dataPath + "shaders/bump.frag", sf::Shader::Fragment);
56 bumpMap_.create(SPACE_X_RESOLUTION*0.5f, SPACE_Y_RESOLUTION*0.5f);
57 glViewport(0,0,SPACE_X_RESOLUTION*0.5f,SPACE_Y_RESOLUTION*0.5f);
58 - gluOrtho2D(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0);
59 + glOrtho(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0, -1, 1);
60 glEnable(GL_BLEND);
61 glMatrixMode(GL_MODELVIEW);
62 postFX_.setParameter("BumpMap", bumpMap_.getTexture());
63 diff --git a/src/System/window.cpp b/src/System/window.cpp
64 index e9a099a..8e12dcc 100644
65 --- a/src/System/window.cpp
66 +++ b/src/System/window.cpp
67 @@ -222,7 +222,7 @@ namespace window {
68 glLoadIdentity();
69
70 // Setup translation (according to left-upper corner)
71 - gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f);
72 + glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1);
73
74 // probably improves performance...
75 glDisable(GL_LIGHTING);
76 @@ -247,7 +247,7 @@ namespace window {
77
78 glMatrixMode(GL_PROJECTION);
79 glLoadIdentity();
80 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
81 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
82 glMatrixMode(GL_MODELVIEW);
83 glLoadIdentity();
84
85 @@ -255,7 +255,7 @@ namespace window {
86
87 glMatrixMode(GL_PROJECTION);
88 glLoadIdentity();
89 - gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f);
90 + glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1);
91 glMatrixMode(GL_MODELVIEW);
92 glLoadIdentity();
93 }
94 @@ -270,7 +270,7 @@ namespace window {
95 glLoadIdentity();
96 setViewPort();
97
98 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
99 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
100
101 glMatrixMode(GL_MODELVIEW);
102 glLoadIdentity();
103 @@ -284,7 +284,7 @@ namespace window {
104 glLoadIdentity();
105 setViewPort();
106
107 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
108 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
109
110 glMatrixMode(GL_MODELVIEW);
111 glLoadIdentity();
112 @@ -294,7 +294,7 @@ namespace window {
113 else {
114 glMatrixMode(GL_PROJECTION);
115 glLoadIdentity();
116 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
117 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
118 glMatrixMode(GL_MODELVIEW);
119 glLoadIdentity();
120 }
121
122 From a97d0d6a19b5b43e3c53081e36f1f1747b6674e6 Mon Sep 17 00:00:00 2001
123 From: Sylvain BOILARD <boilard@crans.org>
124 Date: Wed, 23 Jan 2013 02:02:47 +0100
125 Subject: [PATCH] Use sf::Shader::Bind() correctly after latest update of the
126 SFML's API.
127
128 ---
129 src/System/window.cpp | 6 ++----
130 1 file changed, 2 insertions(+), 4 deletions(-)
131
132 diff --git a/src/System/window.cpp b/src/System/window.cpp
133 index e9a099a..3ffcf65 100644
134 --- a/src/System/window.cpp
135 +++ b/src/System/window.cpp
136 @@ -307,13 +307,11 @@ namespace window {
137 window_.setActive(true);
138 glEnable(GL_TEXTURE_2D);
139
140 - if (shader)
141 - shader->bind();
142 + sf::Shader::bind(shader);
143
144 window_.draw(toBeDrawn, states);
145
146 - if (shader)
147 - shader->unbind();
148 + sf::Shader::bind(NULL);
149
150 window_.popGLStates();
151 glPopMatrix();