summarylogtreecommitdiffstats
path: root/tsc-2.0.0-mga-rename-custom-filesystem-relative.patch
blob: 8889782e4ab45ccd1d36c3732995daee261e2423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
diff -Naur TSC-2.0.0/tsc/src/core/filesystem/boost_relative.cpp TSC-2.0.0-patch/tsc/src/core/filesystem/boost_relative.cpp
--- TSC-2.0.0/tsc/src/core/filesystem/boost_relative.cpp	2015-03-31 14:36:44.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/core/filesystem/boost_relative.cpp	1970-01-01 01:00:00.000000000 +0100
@@ -1,81 +0,0 @@
-/***************************************************************************
- * boost_relative.cpp - Implementation of boost::filesystem::relvative()
- *
- * Copyright © 2013 - 2014 The TSC Contributors
- ***************************************************************************/
-/*
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "boost_relative.hpp"
-
-namespace boost {
-namespace filesystem {
-
-/**
- * Returns the path you need to walk in order to go from `start_path' to
- * `target_path'. Examples:
- *
- * /foo/bar/baz to /foo/blubb/zubb/xx => ../../blubb/zubb/xx
- * /foo/bar to /foo => ..
- * /foo to /foo/bar => bar
- * /foo/bar to /foo/bar => .
- *
- * Only works with absolute pathes. If relative ones are passed, boost::filesystem::absolute()
- * is called on them previously.
- */
-boost::filesystem::path relative(boost::filesystem::path start_path, boost::filesystem::path target_path)
-{
-    start_path  = boost::filesystem::absolute(start_path);
-    target_path = boost::filesystem::absolute(target_path);
-
-    if (start_path == target_path)
-        return boost::filesystem::path(".");
-
-    boost::filesystem::path result;
-    boost::filesystem::path::iterator startpath_iter = start_path.begin();
-    boost::filesystem::path::iterator targetpath_iter = target_path.begin();
-
-    while(true) {
-        if (targetpath_iter == target_path.end()) {
-            /* /foo/bar
-             * /foo
-             */
-            for(; startpath_iter != start_path.end(); startpath_iter++) {
-                result /= "..";
-            }
-            break;
-        }
-        else if (startpath_iter == start_path.end()) {
-            /* /foo
-             * /foo/bar
-             */
-            for(; targetpath_iter != target_path.end(); targetpath_iter++) {
-                result /= (*targetpath_iter);
-            }
-            break;
-        }
-        else if (*startpath_iter != *targetpath_iter) {
-            // Both are inequal at this part, but not terminal
-            result /= "..";
-        }
-        else {
-            // Both are equal at this part of the path (part of common root), skip to next one
-            // (ignore)
-        }
-
-        startpath_iter++;
-        targetpath_iter++;
-    }
-
-    return result;
-}
-
-}
-}
diff -Naur TSC-2.0.0/tsc/src/core/filesystem/boost_relative.hpp TSC-2.0.0-patch/tsc/src/core/filesystem/boost_relative.hpp
--- TSC-2.0.0/tsc/src/core/filesystem/boost_relative.hpp	2015-03-31 14:36:44.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/core/filesystem/boost_relative.hpp	1970-01-01 01:00:00.000000000 +0100
@@ -1,33 +0,0 @@
-/***************************************************************************
- * boost_relative.hpp - Implementation of boost::filesystem::relvative()
- *
- * Copyright © 2013 - 2014 The TSC Contributors
- ***************************************************************************/
-/*
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/*
- * This file adds a function make_relative() to boost::filesystem that
- * allows us to create a relative path from a given “root”, i.e. the
- * common parts of both paths are missing in the returned path object.
- */
-
-#ifndef TSC_BOOST_RELATIVE_HPP
-#define TSC_BOOST_RELATIVE_HPP
-#include <boost/filesystem.hpp>
-
-namespace boost {
-
-    namespace filesystem {
-        /// Find the relative path from start_path to target_path.
-        boost::filesystem::path relative(boost::filesystem::path start_path, boost::filesystem::path target_path);
-    }
-}
-#endif
diff -Naur TSC-2.0.0/tsc/src/core/filesystem/relative.cpp TSC-2.0.0-patch/tsc/src/core/filesystem/relative.cpp
--- TSC-2.0.0/tsc/src/core/filesystem/relative.cpp	1970-01-01 01:00:00.000000000 +0100
+++ TSC-2.0.0-patch/tsc/src/core/filesystem/relative.cpp	2016-01-12 08:31:43.537609273 +0100
@@ -0,0 +1,89 @@
+/***************************************************************************
+ * boost_relative.cpp - Implementation of boost::filesystem::relvative()
+ *
+ * Copyright © 2013 - 2014 The TSC Contributors
+ ***************************************************************************/
+/*
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <boost/version.hpp>
+#include <boost/filesystem.hpp>
+#include "relative.hpp"
+
+/**
+ * Returns the path you need to walk in order to go from `start_path' to
+ * `target_path'. Examples:
+ *
+ * /foo/bar/baz to /foo/blubb/zubb/xx => ../../blubb/zubb/xx
+ * /foo/bar to /foo => ..
+ * /foo to /foo/bar => bar
+ * /foo/bar to /foo/bar => .
+ *
+ * Only works with absolute pathes. If relative ones are passed, boost::filesystem::absolute()
+ * is called on them previously.
+ *
+ * With boost >= 1.60.0 this function is implemented on top of
+ * boost::filesystem::relative(). With boost versions below that
+ * we provide our own implementation.
+ *
+ * TODO: If boost 1.60.0 becomes common enough among distros, remove
+ * our custom implementation.
+ */
+boost::filesystem::path TSC::fs_relative(boost::filesystem::path start_path, boost::filesystem::path target_path)
+{
+#if BOOST_VERSION >= 106000
+    // Boost 1.60.0 has fs::relative(). Beware inverted argument order.
+    return boost::filesystem::relative(target_path, start_path);
+#else
+    start_path  = boost::filesystem::absolute(start_path);
+    target_path = boost::filesystem::absolute(target_path);
+
+    if (start_path == target_path)
+        return boost::filesystem::path(".");
+
+    boost::filesystem::path result;
+    boost::filesystem::path::iterator startpath_iter = start_path.begin();
+    boost::filesystem::path::iterator targetpath_iter = target_path.begin();
+
+    while(true) {
+        if (targetpath_iter == target_path.end()) {
+            /* /foo/bar
+             * /foo
+             */
+            for(; startpath_iter != start_path.end(); startpath_iter++) {
+                result /= "..";
+            }
+            break;
+        }
+        else if (startpath_iter == start_path.end()) {
+            /* /foo
+             * /foo/bar
+             */
+            for(; targetpath_iter != target_path.end(); targetpath_iter++) {
+                result /= (*targetpath_iter);
+            }
+            break;
+        }
+        else if (*startpath_iter != *targetpath_iter) {
+            // Both are inequal at this part, but not terminal
+            result /= "..";
+        }
+        else {
+            // Both are equal at this part of the path (part of common root), skip to next one
+            // (ignore)
+        }
+
+        startpath_iter++;
+        targetpath_iter++;
+    }
+
+    return result;
+#endif
+}
diff -Naur TSC-2.0.0/tsc/src/core/filesystem/relative.hpp TSC-2.0.0-patch/tsc/src/core/filesystem/relative.hpp
--- TSC-2.0.0/tsc/src/core/filesystem/relative.hpp	1970-01-01 01:00:00.000000000 +0100
+++ TSC-2.0.0-patch/tsc/src/core/filesystem/relative.hpp	2016-01-12 08:31:45.176534981 +0100
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * relative.hpp - Implementation of relative path detector
+ *
+ * Copyright © 2013 - 2014 The TSC Contributors
+ ***************************************************************************/
+/*
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/*
+ * This file adds a function fs_relative() to boost::filesystem that
+ * allows us to create a relative path from a given “root”, i.e. the
+ * common parts of both paths are missing in the returned path object.
+ *
+ * Boost >= 1.60.0 includes such a function, but for the sake of
+ * supporting older versions as well we provide our own version
+ * here.
+ */
+
+#ifndef TSC_RELATIVE_HPP
+#define TSC_RELATIVE_HPP
+
+namespace TSC {
+
+    /// Find the relative path from start_path to target_path.
+    boost::filesystem::path fs_relative(boost::filesystem::path start_path, boost::filesystem::path target_path);
+}
+#endif
diff -Naur TSC-2.0.0/tsc/src/core/global_basic.hpp TSC-2.0.0-patch/tsc/src/core/global_basic.hpp
--- TSC-2.0.0/tsc/src/core/global_basic.hpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/core/global_basic.hpp	2016-01-12 08:32:15.508164917 +0100
@@ -75,7 +75,6 @@
 #include <boost/thread/thread.hpp>
 #include <boost/chrono.hpp>
 #include <boost/system/error_code.hpp>
-#include "filesystem/boost_relative.hpp"
 
 // libxml++ (with its prerequisite glibmm)
 #include <glibmm.h>
diff -Naur TSC-2.0.0/tsc/src/enemies/static.cpp TSC-2.0.0-patch/tsc/src/enemies/static.cpp
--- TSC-2.0.0/tsc/src/enemies/static.cpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/enemies/static.cpp	2016-01-12 08:32:15.512164737 +0100
@@ -25,11 +25,9 @@
 #include "../objects/path.hpp"
 #include "../core/filesystem/filesystem.hpp"
 #include "../core/filesystem/resource_manager.hpp"
-#include "../core/filesystem/boost_relative.hpp"
+#include "../core/filesystem/relative.hpp"
 #include "../core/xml_attributes.hpp"
 
-namespace fs = boost::filesystem;
-
 namespace TSC {
 
 /* *** *** *** *** *** *** cStaticEnemy *** *** *** *** *** *** *** *** *** *** *** */
@@ -292,7 +290,7 @@
     CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_static_enemy_image"));
     Editor_Add(UTF8_("Image"), UTF8_("Image filename"), editbox, 200);
 
-    editbox->setText(path_to_utf8(fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_image->Get_Path())).c_str());
+    editbox->setText(path_to_utf8(fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_image->Get_Path())).c_str());
     editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cStaticEnemy::Editor_Image_Text_Changed, this));
 
     // rotation speed
diff -Naur TSC-2.0.0/tsc/src/level/level_background.cpp TSC-2.0.0-patch/tsc/src/level/level_background.cpp
--- TSC-2.0.0/tsc/src/level/level_background.cpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/level/level_background.cpp	2016-01-12 08:32:15.509164872 +0100
@@ -20,7 +20,7 @@
 #include "../video/gl_surface.hpp"
 #include "../core/framerate.hpp"
 #include "../core/filesystem/resource_manager.hpp"
-#include "../core/filesystem/boost_relative.hpp"
+#include "../core/filesystem/relative.hpp"
 #include "../core/xml_attributes.hpp"
 
 namespace fs = boost::filesystem;
@@ -195,7 +195,7 @@
 
     // Make the path relative to pixmaps/ if it isn’t yet
     if (m_image_1_filename.is_absolute())
-        m_image_1_filename = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_image_1_filename);
+        m_image_1_filename = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_image_1_filename);
 
     m_image_1 = pVideo->Get_Surface(m_image_1_filename);
 }
diff -Naur TSC-2.0.0/tsc/src/level/level.cpp TSC-2.0.0-patch/tsc/src/level/level.cpp
--- TSC-2.0.0/tsc/src/level/level.cpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/level/level.cpp	2016-01-12 08:32:15.509164872 +0100
@@ -56,7 +56,7 @@
 #include "../objects/path.hpp"
 #include "../core/filesystem/filesystem.hpp"
 #include "../core/filesystem/resource_manager.hpp"
-#include "../core/filesystem/boost_relative.hpp"
+#include "../core/filesystem/relative.hpp"
 #include "../overworld/world_editor.hpp"
 #include "../scripting/events/key_down_event.hpp"
 
@@ -930,7 +930,7 @@
 
 fs::path cLevel::Get_Music_Filename() const
 {
-    return fs::relative(pResource_Manager->Get_Game_Music_Directory(), m_musicfile);
+    return fs_relative(pResource_Manager->Get_Game_Music_Directory(), m_musicfile);
 }
 
 void cLevel::Set_Music(fs::path filename)
diff -Naur TSC-2.0.0/tsc/src/objects/moving_platform.cpp TSC-2.0.0-patch/tsc/src/objects/moving_platform.cpp
--- TSC-2.0.0/tsc/src/objects/moving_platform.cpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/objects/moving_platform.cpp	2016-01-12 08:32:15.510164827 +0100
@@ -29,7 +29,7 @@
 #include "../objects/path.hpp"
 #include "../input/mouse.hpp"
 #include "../core/filesystem/resource_manager.hpp"
-#include "../core/filesystem/boost_relative.hpp"
+#include "../core/filesystem/relative.hpp"
 #include "../core/xml_attributes.hpp"
 
 namespace fs = boost::filesystem;
@@ -209,15 +209,15 @@
 
     fs::path rel;
     // image top left
-    rel = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[0].m_image->Get_Path());
+    rel = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[0].m_image->Get_Path());
     Convert_Path_Separators(rel);
     Add_Property(p_node, "image_top_left", path_to_utf8(rel));
     // image top middle
-    rel = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[1].m_image->Get_Path());
+    rel = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[1].m_image->Get_Path());
     Convert_Path_Separators(rel);
     Add_Property(p_node, "image_top_middle", path_to_utf8(rel));
     // image top right
-    rel = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[2].m_image->Get_Path());
+    rel = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[2].m_image->Get_Path());
     Convert_Path_Separators(rel);
     Add_Property(p_node, "image_top_right", path_to_utf8(rel));
 
@@ -1043,7 +1043,7 @@
     editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_moving_platform_image_top_left"));
     Editor_Add(UTF8_("Image top left"), UTF8_("Image top left"), editbox, 200);
 
-    rel = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[0].m_image->Get_Path());
+    rel = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[0].m_image->Get_Path());
     editbox->setText(path_to_utf8(rel));
     editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cMoving_Platform::Editor_Image_Top_Left_Text_Changed, this));
 
@@ -1051,7 +1051,7 @@
     editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_moving_platform_image_top_middle"));
     Editor_Add(UTF8_("Image top middle"), UTF8_("Image top middle"), editbox, 200);
 
-    rel = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[1].m_image->Get_Path());
+    rel = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[1].m_image->Get_Path());
     editbox->setText(path_to_utf8(rel));
     editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cMoving_Platform::Editor_Image_Top_Middle_Text_Changed, this));
 
@@ -1059,7 +1059,7 @@
     editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_moving_platform_image_top_right"));
     Editor_Add(UTF8_("Image top right"), UTF8_("Image top right"), editbox, 200);
 
-    rel = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[2].m_image->Get_Path());
+    rel = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_images[2].m_image->Get_Path());
     editbox->setText(path_to_utf8(rel));
     editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cMoving_Platform::Editor_Image_Top_Right_Text_Changed, this));
 
diff -Naur TSC-2.0.0/tsc/src/objects/sprite.cpp TSC-2.0.0-patch/tsc/src/objects/sprite.cpp
--- TSC-2.0.0/tsc/src/objects/sprite.cpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/objects/sprite.cpp	2016-01-12 08:32:15.510164827 +0100
@@ -28,6 +28,7 @@
 #include "../core/i18n.hpp"
 #include "../scripting/events/touch_event.hpp"
 #include "../level/level_editor.hpp"
+#include "../core/filesystem/relative.hpp"
 #include "../core/filesystem/resource_manager.hpp"
 #include "../core/xml_attributes.hpp"
 
@@ -462,7 +463,7 @@
     // Only save the relative part of the filename -- otherwise the
     // generated levels wouldn’t be portable.
     if (img_filename.is_absolute())
-        img_filename = boost::filesystem::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), img_filename);
+        img_filename = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), img_filename);
 
     Add_Property(p_node, "image", img_filename.generic_string());
 
@@ -1400,7 +1401,7 @@
     CEGUI::Editbox* editbox = static_cast<CEGUI::Editbox*>(wmgr.createWindow("TaharezLook/Editbox", "editor_sprite_image"));
     Editor_Add(UTF8_("Image"), UTF8_("Image filename"), editbox, 200);
 
-    fs::path rel = fs::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_start_image->Get_Path());
+    fs::path rel = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), m_start_image->Get_Path());
     editbox->setText(path_to_utf8(rel));
     editbox->subscribeEvent(CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber(&cSprite::Editor_Image_Text_Changed, this));
 
diff -Naur TSC-2.0.0/tsc/src/video/animation.cpp TSC-2.0.0-patch/tsc/src/video/animation.cpp
--- TSC-2.0.0/tsc/src/video/animation.cpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/video/animation.cpp	2016-01-12 08:32:15.511164782 +0100
@@ -23,7 +23,7 @@
 #include "../core/i18n.hpp"
 #include "../core/filesystem/filesystem.hpp"
 #include "../core/filesystem/resource_manager.hpp"
-#include "../core/filesystem/boost_relative.hpp"
+#include "../core/filesystem/relative.hpp"
 #include "../core/xml_attributes.hpp"
 #include "../input/mouse.hpp"
 
@@ -1149,7 +1149,7 @@
     // remember the filename for saving
     m_image_filename = filename;
     if (filename.is_absolute())
-        m_image_filename = boost::filesystem::relative(pResource_Manager->Get_Game_Pixmaps_Directory(), filename);
+        m_image_filename = fs_relative(pResource_Manager->Get_Game_Pixmaps_Directory(), filename);
 
     // set new image
     Set_Image(pVideo->Get_Surface(m_image_filename, 0));
diff -Naur TSC-2.0.0/tsc/src/video/video.cpp TSC-2.0.0-patch/tsc/src/video/video.cpp
--- TSC-2.0.0/tsc/src/video/video.cpp	2015-07-16 19:18:42.000000000 +0200
+++ TSC-2.0.0-patch/tsc/src/video/video.cpp	2016-01-12 08:32:15.511164782 +0100
@@ -29,6 +29,7 @@
 #include "../core/math/size.hpp"
 #include "../core/filesystem/filesystem.hpp"
 #include "../core/filesystem/resource_manager.hpp"
+#include "../core/filesystem/relative.hpp"
 #include "../gui/spinner.hpp"
 
 namespace fs = boost::filesystem;
@@ -663,7 +664,7 @@
     for (vector<fs::path>::iterator itr = image_files.begin(); itr != image_files.end(); ++itr) {
         // get filenames
         fs::path filename = (*itr);
-        fs::path cache_filename = imgcache_dir_active / fs::relative(pResource_Manager->Get_Game_Data_Directory(), filename);
+        fs::path cache_filename = imgcache_dir_active / fs_relative(pResource_Manager->Get_Game_Data_Directory(), filename);
 
         // if directory
         if (fs::is_directory(filename)) {
@@ -1011,7 +1012,7 @@
         if (fs::exists(settings_file) && fs::is_regular_file(settings_file)) {
             settings = pSettingsParser->Get(settings_file);
 
-            fs::path img_filename_cache = m_imgcache_dir / fs::relative(pResource_Manager->Get_Game_Data_Directory(), settings_file); // Why add .png here? Should be in the return value of fs::relative() anyway.
+            fs::path img_filename_cache = m_imgcache_dir / fs_relative(pResource_Manager->Get_Game_Data_Directory(), settings_file); // Why add .png here? Should be in the return value of fs_relative() anyway.
             // check if image cache file exists
             if (fs::exists(img_filename_cache) && fs::is_regular_file(img_filename_cache))
                 sdl_surface = IMG_Load(path_to_utf8(img_filename_cache).c_str());