summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manualPorts/openttd-git/.md5sum2
-rw-r--r--manualPorts/openttd-git/.signature4
-rw-r--r--manualPorts/openttd-git/underground.patch139
3 files changed, 80 insertions, 65 deletions
diff --git a/manualPorts/openttd-git/.md5sum b/manualPorts/openttd-git/.md5sum
index aae494d..0e6cc93 100644
--- a/manualPorts/openttd-git/.md5sum
+++ b/manualPorts/openttd-git/.md5sum
@@ -4,4 +4,4 @@
6e3a5cf97fe69e3a351c3e0615a14b04 opensfx-0.2.3.zip
e206897de51f145a3cffcef4f2579d45 signaltunnel.patch
cfc6052be34fee0e37da3bcc18fa1099 sloped-stations.patch
-fc940628c7e0af96f867645144a4f41a underground.patch
+555687ad2dd24207dca6e2482815a87b underground.patch
diff --git a/manualPorts/openttd-git/.signature b/manualPorts/openttd-git/.signature
index c9cc6da..9a18b87 100644
--- a/manualPorts/openttd-git/.signature
+++ b/manualPorts/openttd-git/.signature
@@ -1,5 +1,5 @@
untrusted comment: verify with /etc/ports/deepthought.pub
-RWQxCptPusLGGoG/vvCQ2Bi8TBRfo/Xjnju8//Zgr+31DOOGzCVVRZ06v5tYAqGaIqgQfqxxfoXVgPTMhO2YA5ruO18noJgfhw4=
+RWQxCptPusLGGvD+LSu14lD81OCjZvs001UUBrHDAAFlAQxy74nxWofD2miQQLQluObamphHYTBkn4O9TKYwtlLJZG+PGbzsqAg=
SHA256 (Pkgfile) = d55c7e21830544dceed6ec0935c34ad0674da476cd5d3b35a46e071edcbd022b
SHA256 (.footprint) = b8b31b1b4b0487754b23c992bfd08ec39a569702579069de7fda397110b28fae
SHA256 (opengfx-0.5.4.zip) = 3d136d776906dbe8b5df1434cb9a68d1249511a3c4cfaca55cc24cc0028ae078
@@ -7,5 +7,5 @@ SHA256 (opensfx-0.2.3.zip) = 3574745ac0c138bae53b56972591db8d778ad9faffd51deae37
SHA256 (openmsx-0.3.1.zip) = 92e293ae89f13ad679f43185e83fb81fb8cad47fe63f4af3d3d9f955130460f5
SHA256 (signaltunnel.patch) = a75db5fa2fde1da0c9f5a34402f7a913f6fe2614cb7596a2e0f71f2bc80c287c
SHA256 (sloped-stations.patch) = d375e73e14a4d76b90131f23362c61f75064557c2ebc7e91908f8a00c2a36896
-SHA256 (underground.patch) = 097b83ba79a68eca1d98a852b11a4f3b06e0b276449e921376ac4221804f6a8a
+SHA256 (underground.patch) = ab7aac239ccbb5f83daed639a3b58a55c5eb630cce1420928e42526b9ee43a09
SHA256 (476643bfa5.tar.gz) = 8e89c1f685a37543aefee2a94331669d3982f7e9244e7c8dea2e6319231069ec
diff --git a/manualPorts/openttd-git/underground.patch b/manualPorts/openttd-git/underground.patch
index 2e45041..e5b40fe 100644
--- a/manualPorts/openttd-git/underground.patch
+++ b/manualPorts/openttd-git/underground.patch
@@ -1420,10 +1420,10 @@ index 0000000000..7228fb4b66
+
diff --git a/src/layer_func.h b/src/layer_func.h
new file mode 100644
-index 0000000000..be060cc27c
+index 0000000000..d472d23b50
--- /dev/null
+++ b/src/layer_func.h
-@@ -0,0 +1,161 @@
+@@ -0,0 +1,102 @@
+/* $Id: layer_func.h 2012-09-07 18:11:11 constructor $ */
+
+/*
@@ -1454,65 +1454,6 @@ index 0000000000..be060cc27c
+
+#define FOR_ALL_LAYERS(var) for (uint var = 0; var < LayerCount(); var++)
+
-+
-+/**
-+ * Get the size of the layer along the X
-+ * @return the number of tiles along the X of the layer
-+ */
-+static inline uint LayerSizeX()
-+{
-+ extern uint _map_size_x;
-+ return _map_size_x;
-+}
-+
-+/**
-+ * Get the size of the layer along the Y
-+ * @return the number of tiles along the Y of the layer
-+ */
-+static inline uint LayerSizeY()
-+{
-+ extern uint _layer_size_y;
-+ return _layer_size_y;
-+}
-+
-+/**
-+ * Gets the maximum X coordinate within the map, including MP_VOID
-+ * @return the maximum X coordinate
-+ */
-+static inline uint LayerMaxX()
-+{
-+ return LayerSizeX() - 1;
-+}
-+
-+/**
-+ * Gets the maximum Y coordinate within the map, including MP_VOID
-+ * @return the maximum Y coordinate
-+ */
-+static inline uint LayerMaxY()
-+{
-+ return LayerSizeY() - 1;
-+}
-+
-+/**
-+ * Get the layer counts
-+ * @return the number of layers
-+ */
-+static inline uint LayerCount()
-+{
-+ extern uint _layer_count;
-+ return _layer_count;
-+}
-+
-+/**
-+ * Get the layer counts
-+ * @return the number of layers
-+ */
-+static inline uint LayerCountLog()
-+{
-+ extern uint _layer_count_log;
-+ return _layer_count_log;
-+}
-+
+/**
+ * Get the X component of a tile
+ * @param tile the tile to get the X component of
@@ -1736,7 +1677,7 @@ index 85590c3e88..c00faa18c1 100644
} else {
return CircularTileSearch(tile, size / 2, 0, 0, proc, user_data);
diff --git a/src/map_func.h b/src/map_func.h
-index 21d69b1382..08cf12b5f0 100644
+index 21d69b1382..b0a59eb148 100644
--- a/src/map_func.h
+++ b/src/map_func.h
@@ -43,7 +43,7 @@ extern Tile *_m;
@@ -1748,6 +1689,80 @@ index 21d69b1382..08cf12b5f0 100644
/**
* Logarithm of the map size along the X side.
+@@ -115,6 +115,64 @@ static inline uint MapMaxY()
+ return MapSizeY() - 1;
+ }
+
++/**
++ * Get the size of the layer along the X
++ * @return the number of tiles along the X of the layer
++ */
++static inline uint LayerSizeX()
++{
++ extern uint _map_size_x;
++ return _map_size_x;
++}
++
++/**
++ * Get the size of the layer along the Y
++ * @return the number of tiles along the Y of the layer
++ */
++static inline uint LayerSizeY()
++{
++ extern uint _layer_size_y;
++ return _layer_size_y;
++}
++
++/**
++ * Gets the maximum X coordinate within the map, including MP_VOID
++ * @return the maximum X coordinate
++ */
++static inline uint LayerMaxX()
++{
++ return LayerSizeX() - 1;
++}
++
++/**
++ * Gets the maximum Y coordinate within the map, including MP_VOID
++ * @return the maximum Y coordinate
++ */
++static inline uint LayerMaxY()
++{
++ return LayerSizeY() - 1;
++}
++
++/**
++ * Get the layer counts
++ * @return the number of layers
++ */
++static inline uint LayerCount()
++{
++ extern uint _layer_count;
++ return _layer_count;
++}
++
++/**
++ * Get the layer counts
++ * @return the number of layers
++ */
++static inline uint LayerCountLog()
++{
++ extern uint _layer_count_log;
++ return _layer_count_log;
++}
++
+ /**
+ * Scales the given value by the map size, where the given value is
+ * for a 256 by 256 map.
+@@ -125,7 +183,7 @@ static inline uint ScaleByMapSize(uint n)
+ {
+ /* Subtract 12 from shift in order to prevent integer overflow
+ * for large values of n. It's safe since the min mapsize is 64x64. */
+- return CeilDiv(n << (MapLogX() + MapLogY() - 12), 1 << 4);
++ return CeilDiv(n << (MapLogX() + MapLogY() - LayerCountLog() - 12), 1 << 4);
+ }
+
+
diff --git a/src/misc.cpp b/src/misc.cpp
index d9d506993f..f5184c0581 100644
--- a/src/misc.cpp