aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2013-09-17 20:31:27 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2013-09-17 20:31:27 +0800
commitc5a632661144922950152af0b5fcdc945ba3ab1a (patch)
tree44e47c896ea2799b079a9b7e16caf3096ec826dd /games
parentbc1221b9d19500c068d62b4b03e2001f7a818336 (diff)
downloadfreebsd-ports-gnome-c5a632661144922950152af0b5fcdc945ba3ab1a.tar.gz
freebsd-ports-gnome-c5a632661144922950152af0b5fcdc945ba3ab1a.tar.zst
freebsd-ports-gnome-c5a632661144922950152af0b5fcdc945ba3ab1a.zip
Fix build with clang/libc++
Diffstat (limited to 'games')
-rw-r--r--games/flare/files/patch-src-Hazard.cpp34
-rw-r--r--games/flare/files/patch-src-MapCollision.cpp20
-rw-r--r--games/flare/files/patch-src-Utils.cpp20
-rw-r--r--games/flare/files/patch-src-Utils.h11
4 files changed, 85 insertions, 0 deletions
diff --git a/games/flare/files/patch-src-Hazard.cpp b/games/flare/files/patch-src-Hazard.cpp
new file mode 100644
index 000000000000..b512859354a9
--- /dev/null
+++ b/games/flare/files/patch-src-Hazard.cpp
@@ -0,0 +1,34 @@
+--- src/Hazard.cpp.orig 2013-04-01 18:21:13.000000000 +0400
++++ src/Hazard.cpp 2013-09-17 05:59:52.364226200 +0400
+@@ -91,17 +91,17 @@
+ activeAnimation->advanceFrame();
+
+ // handle movement
+- if (!(round(speed.x) == 0 && round(speed.y) == 0)) {
++ if (!(myround(speed.x) == 0 && myround(speed.y) == 0)) {
+ pos.x += speed.x;
+ pos.y += speed.y;
+
+ // very simplified collider, could skim around corners
+ // or even pass through thin walls if speed > tilesize
+- if (collider->is_wall(round(pos.x), round(pos.y))) {
++ if (collider->is_wall(myround(pos.x), myround(pos.y))) {
+ lifespan = 0;
+ hit_wall = true;
+
+- if (collider->is_outside_map(round(pos.x) >> TILE_SHIFT, round(pos.y) >> TILE_SHIFT))
++ if (collider->is_outside_map(myround(pos.x) >> TILE_SHIFT, myround(pos.y) >> TILE_SHIFT))
+ remove_now = true;
+ }
+ }
+@@ -143,8 +143,8 @@
+ {
+ if (delay_frames == 0 && activeAnimation) {
+ Renderable re = activeAnimation->getCurrentFrame(animationKind);
+- re.map_pos.x = round(pos.x);
+- re.map_pos.y = round(pos.y);
++ re.map_pos.x = myround(pos.x);
++ re.map_pos.y = myround(pos.y);
+ (floor ? r_dead : r).push_back(re);
+ }
+ }
diff --git a/games/flare/files/patch-src-MapCollision.cpp b/games/flare/files/patch-src-MapCollision.cpp
new file mode 100644
index 000000000000..1e2f22815b4b
--- /dev/null
+++ b/games/flare/files/patch-src-MapCollision.cpp
@@ -0,0 +1,20 @@
+--- src/MapCollision.cpp.orig 2013-04-01 18:21:13.000000000 +0400
++++ src/MapCollision.cpp 2013-09-17 06:00:27.655226476 +0400
+@@ -238,7 +238,7 @@
+ for (int i=0; i<steps; i++) {
+ x += step_x;
+ y += step_y;
+- if (is_wall(round(x), round(y)))
++ if (is_wall(myround(x), myround(y)))
+ return false;
+ }
+ }
+@@ -246,7 +246,7 @@
+ for (int i=0; i<steps; i++) {
+ x += step_x;
+ y += step_y;
+- if (!is_valid_position(round(x), round(y), movement_type))
++ if (!is_valid_position(myround(x), myround(y), movement_type))
+ return false;
+ }
+ }
diff --git a/games/flare/files/patch-src-Utils.cpp b/games/flare/files/patch-src-Utils.cpp
new file mode 100644
index 000000000000..32884f9361bd
--- /dev/null
+++ b/games/flare/files/patch-src-Utils.cpp
@@ -0,0 +1,20 @@
+--- src/Utils.cpp.orig 2013-04-01 18:21:13.000000000 +0400
++++ src/Utils.cpp 2013-09-17 05:57:39.713315065 +0400
+@@ -25,14 +25,14 @@
+ using namespace std;
+
+
+-int round(float f) {
++int myround(float f) {
+ return (int)(f + 0.5);
+ }
+
+ Point round(FPoint fp) {
+ Point result;
+- result.x = round(fp.x);
+- result.y = round(fp.y);
++ result.x = myround(fp.x);
++ result.y = myround(fp.y);
+ return result;
+ }
+
diff --git a/games/flare/files/patch-src-Utils.h b/games/flare/files/patch-src-Utils.h
new file mode 100644
index 000000000000..66d7d046c39b
--- /dev/null
+++ b/games/flare/files/patch-src-Utils.h
@@ -0,0 +1,11 @@
+--- src/Utils.h.orig 2013-04-01 18:21:13.000000000 +0400
++++ src/Utils.h 2013-09-17 05:57:30.563226254 +0400
+@@ -85,7 +85,7 @@
+ };
+
+ // Utility Functions
+-int round(float f);
++int myround(float f);
+ Point round(FPoint fp);
+ Point screen_to_map(int x, int y, int camx, int camy);
+ Point map_to_screen(int x, int y, int camx, int camy);