summaryrefslogtreecommitdiff
path: root/manualPorts/openttd-git
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-01-01 22:45:07 +0100
committerErich Eckner <git@eckner.net>2021-01-01 22:45:07 +0100
commit1d3968cb1c251f9d44667d6878e566f25bcbb28a (patch)
tree8ec6bd7aec7640b3a8016ee0634c7e6f8105fbf7 /manualPorts/openttd-git
parent948690d0061ca3f7edce3d71ac3c954c5a026082 (diff)
downloadcrux-ports-1d3968cb1c251f9d44667d6878e566f25bcbb28a.tar.xz
openttd-git: chunnel.patch
Diffstat (limited to 'manualPorts/openttd-git')
-rw-r--r--manualPorts/openttd-git/.md5sum1
-rw-r--r--manualPorts/openttd-git/.signature5
-rw-r--r--manualPorts/openttd-git/Pkgfile4
-rw-r--r--manualPorts/openttd-git/chunnel.patch173
4 files changed, 180 insertions, 3 deletions
diff --git a/manualPorts/openttd-git/.md5sum b/manualPorts/openttd-git/.md5sum
index b5d2b59..5b9461f 100644
--- a/manualPorts/openttd-git/.md5sum
+++ b/manualPorts/openttd-git/.md5sum
@@ -1,4 +1,5 @@
0ffa0a12430f54ef62a440d1341b9ae2 8596b43b2.tar.gz
+baf45bd3f088439b66a3e1b9a5a37e87 chunnel.patch
4f4a6465cd5b84964b7ceecd1c06d686 opengfx-0.5.4.zip
858b79d44aea6de5e15d9d1439e86cc3 openmsx-0.3.1.zip
6e3a5cf97fe69e3a351c3e0615a14b04 opensfx-0.2.3.zip
diff --git a/manualPorts/openttd-git/.signature b/manualPorts/openttd-git/.signature
index 709ee57..d98fe6c 100644
--- a/manualPorts/openttd-git/.signature
+++ b/manualPorts/openttd-git/.signature
@@ -1,10 +1,11 @@
untrusted comment: verify with /etc/ports/deepthought.pub
-RWQxCptPusLGGn63wkqN7pHr03lfvzic41CeXs+orv1NgvSBFcSdHmB38F7zGcSCskDWQXNaSjDuYuHWpaB4yuCSHPAK/OgghwI=
-SHA256 (Pkgfile) = 31b71d68b36a82d11e1b16e53cf2d30407214c805da3f98573883ee5461f6c85
+RWQxCptPusLGGoGC4L5LtlbIoibuLpV25veY2Sq6qlZ8Psi9ypaJccED8fGmSLYm+Y1AJvhPkkJ6rgxjvRnIq5P8hCNRAZGfZwM=
+SHA256 (Pkgfile) = f44f25f5ec54d00e8ace36ac8da91d53893261d9a1f11fe1c558c81e5ff0c106
SHA256 (.footprint) = c9df484f7cd09eda02d1cdbb365d3a78a874a6b895a96d90146bb7a226666cbd
SHA256 (opengfx-0.5.4.zip) = 3d136d776906dbe8b5df1434cb9a68d1249511a3c4cfaca55cc24cc0028ae078
SHA256 (opensfx-0.2.3.zip) = 3574745ac0c138bae53b56972591db8d778ad9faffd51deae37a48a563e71662
SHA256 (openmsx-0.3.1.zip) = 92e293ae89f13ad679f43185e83fb81fb8cad47fe63f4af3d3d9f955130460f5
+SHA256 (chunnel.patch) = c7545b0423dd95cfa4f36076fed979b26bef58c5b78cf4e10725efa23cb11978
SHA256 (signaltunnel.patch) = d875acd1ebab6ea1decffcbd40a0810181200f0b482c53c8b3eb8eddc210e13b
SHA256 (sloped-stations.patch) = 2b232bf1efa8e14b1e10d40ee74a02c5918f539e7af78a10b2e37b3c63fd2149
SHA256 (underground.patch) = c2320b8ae0c705d788acc9084ab17921669f870e4bbcb3029d41ebbafc3083a5
diff --git a/manualPorts/openttd-git/Pkgfile b/manualPorts/openttd-git/Pkgfile
index 592b0e1..ea8bee4 100644
--- a/manualPorts/openttd-git/Pkgfile
+++ b/manualPorts/openttd-git/Pkgfile
@@ -10,10 +10,11 @@ version=29779.8596b43b2
gfxversion=0.5.4
sfxversion=0.2.3
msxversion=0.3.1
-release=1
+release=2
source=(http://bundles.openttdcoop.org/opengfx/releases/$gfxversion/opengfx-$gfxversion.zip
http://bundles.openttdcoop.org/opensfx/releases/$sfxversion/opensfx-$sfxversion.zip
http://bundles.openttdcoop.org/openmsx/releases/$msxversion/openmsx-$msxversion.zip
+ chunnel.patch
signaltunnel.patch
sloped-stations.patch
underground.patch
@@ -44,6 +45,7 @@ build() {
patch -p1 -i "$SRC/signaltunnel.patch"
# patch -p1 -i "$SRC/sloped-stations.patch" # broken!
patch -p1 -i "$SRC/underground.patch" # broken?
+ patch -p1 -i "$SRC/chunnel.patch"
mkdir build
cd build
diff --git a/manualPorts/openttd-git/chunnel.patch b/manualPorts/openttd-git/chunnel.patch
new file mode 100644
index 0000000..c26ea89
--- /dev/null
+++ b/manualPorts/openttd-git/chunnel.patch
@@ -0,0 +1,173 @@
+diff --git a/src/lang/english.txt b/src/lang/english.txt
+index 8a79d87ea6..c6169a78ec 100644
+--- a/src/lang/english.txt
++++ b/src/lang/english.txt
+@@ -2337,6 +2337,7 @@ STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Toggle t
+ STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Toggle transparency for structures like lighthouses and antennas. Ctrl+Click to lock
+ STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Toggle transparency for catenary. Ctrl+Click to lock
+ STR_TRANSPARENT_LOADING_TOOLTIP :{BLACK}Toggle transparency for loading indicators. Ctrl+Click to lock
++STR_TRANSPARENT_TUNNELS_TOOLTIP :{BLACK}Toggle transparency for vehicles in tunnels. Ctrl+Click to lock.
+ STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}Set objects invisible instead of transparent
+
+ # Linkgraph legend window
+diff --git a/src/table/misc_settings.ini b/src/table/misc_settings.ini
+index edad848165..f0322ee359 100644
+--- a/src/table/misc_settings.ini
++++ b/src/table/misc_settings.ini
+@@ -254,7 +254,7 @@ type = SLE_UINT
+ var = _transparency_opt
+ def = 0
+ min = 0
+-max = 0x1FF
++max = 0x3FF
+ cat = SC_BASIC
+
+ [SDTG_VAR]
+@@ -263,7 +263,7 @@ type = SLE_UINT
+ var = _transparency_lock
+ def = 0
+ min = 0
+-max = 0x1FF
++max = 0x3FF
+ cat = SC_BASIC
+
+ [SDTG_VAR]
+diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
+index 5d02764b55..6438e18661 100644
+--- a/src/train_cmd.cpp
++++ b/src/train_cmd.cpp
+@@ -3853,7 +3853,7 @@ static bool TrainLocoHandler(Train *v, bool mode)
+ }
+
+ for (Train *u = v; u != nullptr; u = u->Next()) {
+- if ((u->vehstatus & VS_HIDDEN) != 0) continue;
++ if (!u->IsDrawn()) continue;
+
+ u->UpdateViewport(false, false);
+ }
+diff --git a/src/transparency.h b/src/transparency.h
+index 54ba24e933..08b13ca9b9 100644
+--- a/src/transparency.h
++++ b/src/transparency.h
+@@ -29,6 +29,7 @@ enum TransparencyOption {
+ TO_STRUCTURES, ///< other objects such as transmitters and lighthouses
+ TO_CATENARY, ///< catenary
+ TO_LOADING, ///< loading indicators
++ TO_TUNNELS, ///< vehicles in tunnels
+ TO_END,
+ TO_INVALID, ///< Invalid transparency option
+ };
+diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp
+index 153dcb5d03..55ac1a75de 100644
+--- a/src/transparency_gui.cpp
++++ b/src/transparency_gui.cpp
+@@ -50,7 +50,8 @@ public:
+ case WID_TT_BRIDGES:
+ case WID_TT_STRUCTURES:
+ case WID_TT_CATENARY:
+- case WID_TT_LOADING: {
++ case WID_TT_LOADING:
++ case WID_TT_TUNNELS: {
+ uint i = widget - WID_TT_BEGIN;
+ if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, r.left + 1, r.top + 1);
+ break;
+@@ -58,6 +59,7 @@ public:
+ case WID_TT_BUTTONS:
+ for (uint i = WID_TT_BEGIN; i < WID_TT_END; i++) {
+ if (i == WID_TT_LOADING) continue; // Do not draw button for invisible loading indicators.
++ if (i == WID_TT_TUNNELS) continue; // Do not draw button for invisible vehicles in tunnels.
+
+ const NWidgetBase *wi = this->GetWidget<NWidgetBase>(i);
+ DrawFrameRect(wi->pos_x + 1, r.top + 2, wi->pos_x + wi->current_x - 2, r.bottom - 2, COLOUR_PALE_GREEN,
+@@ -69,7 +71,7 @@ public:
+
+ void OnClick(Point pt, int widget, int click_count) override
+ {
+- if (widget >= WID_TT_BEGIN && widget < WID_TT_END) {
++ if (IsInsideMM(widget, WID_TT_BEGIN, WID_TT_END)) {
+ if (_ctrl_pressed) {
+ /* toggle the bit of the transparencies lock variable */
+ ToggleTransparencyLock((TransparencyOption)(widget - WID_TT_BEGIN));
+@@ -139,6 +141,7 @@ static const NWidgetPart _nested_transparency_widgets[] = {
+ NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_STRUCTURES), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_TRANSMITTER, STR_TRANSPARENT_STRUCTURES_TOOLTIP),
+ NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_CATENARY), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_BUILD_X_ELRAIL, STR_TRANSPARENT_CATENARY_TOOLTIP),
+ NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_LOADING), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_TRAINLIST, STR_TRANSPARENT_LOADING_TOOLTIP),
++ NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_TUNNELS), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_ROAD_TUNNEL, STR_TRANSPARENT_TUNNELS_TOOLTIP),
+ NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetFill(1, 1), EndContainer(),
+ EndContainer(),
+ /* Panel with 'invisibility' buttons. */
+diff --git a/src/vehicle.cpp b/src/vehicle.cpp
+index 956b449602..abce02af64 100644
+--- a/src/vehicle.cpp
++++ b/src/vehicle.cpp
+@@ -286,6 +286,14 @@ uint Vehicle::Crash(bool flooded)
+ return RandomRange(pass + 1); // Randomise deceased passengers.
+ }
+
++bool Vehicle::IsDrawn() const
++{
++ return !(this->vehstatus & VS_HIDDEN) ||
++ (!IsTransparencySet(TO_TUNNELS) &&
++ ((this->type == VEH_TRAIN && Train::From(this)->track == TRACK_BIT_WORMHOLE) ||
++ (this->type == VEH_ROAD && RoadVehicle::From(this)->state == RVSB_WORMHOLE)));
++}
++
+
+ /**
+ * Displays a "NewGrf Bug" error message for a engine, and pauses the game if not networking.
+@@ -1083,7 +1091,7 @@ static void DoDrawVehicle(const Vehicle *v)
+ if (v->vehstatus & VS_DEFPAL) pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
+
+ /* Check whether the vehicle shall be transparent due to the game state */
+- bool shadowed = (v->vehstatus & VS_SHADOW) != 0;
++ bool shadowed = (v->vehstatus & (VS_SHADOW | VS_HIDDEN)) != 0;
+
+ if (v->type == VEH_EFFECT) {
+ /* Check whether the vehicle shall be transparent/invisible due to GUI settings.
+@@ -1141,7 +1149,7 @@ void ViewportAddVehicles(DrawPixelInfo *dpi)
+
+ while (v != nullptr) {
+ if (LayerIndex(v->tile) == dpi->layer)
+- if (!(v->vehstatus & VS_HIDDEN) &&
++ if (v->IsDrawn() &&
+ l <= v->coord.right &&
+ t <= v->coord.bottom &&
+ r >= v->coord.left &&
+@@ -1176,7 +1184,7 @@ Vehicle *CheckClickOnVehicle(const Viewport *vp, int x, int y)
+ y = ScaleByZoom(y, vp->zoom) + vp->virtual_top;
+
+ for (Vehicle *v : Vehicle::Iterate()) {
+- if ((v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) == 0 &&
++ if (v->IsDrawn() && !(v->vehstatus & VS_UNCLICKABLE) &&
+ x >= v->coord.left && x <= v->coord.right &&
+ y >= v->coord.top && y <= v->coord.bottom) {
+
+diff --git a/src/vehicle_base.h b/src/vehicle_base.h
+index 019c94a29a..2378b84473 100644
+--- a/src/vehicle_base.h
++++ b/src/vehicle_base.h
+@@ -351,6 +351,12 @@ public:
+
+ uint GetConsistTotalCapacity() const;
+
++ /**
++ * Is this vehicle drawn?
++ * @return true if it is drawn
++ */
++ bool IsDrawn() const;
++
+ /**
+ * Marks the vehicles to be redrawn and updates cached variables
+ *
+diff --git a/src/widgets/transparency_widget.h b/src/widgets/transparency_widget.h
+index 2b096e733b..099d48a339 100644
+--- a/src/widgets/transparency_widget.h
++++ b/src/widgets/transparency_widget.h
+@@ -23,6 +23,7 @@ enum TransparencyToolbarWidgets {
+ WID_TT_STRUCTURES, ///< Object structure transparency toggle button.
+ WID_TT_CATENARY, ///< Catenary transparency toggle button.
+ WID_TT_LOADING, ///< Loading indicators transparency toggle button.
++ WID_TT_TUNNELS, ///< Vehicles in tunnels toggle button.
+ WID_TT_END, ///< End of toggle buttons.
+
+ /* Panel with buttons for invisibility */