diff --git a/os/debian/NEWS b/os/debian/NEWS new file mode 100644 index 0000000000..2a5c811019 --- /dev/null +++ b/os/debian/NEWS @@ -0,0 +1,25 @@ +openttd (1.0.0~rc3-2) unstable; urgency=low + + The openttd package has been moved from contrib into main. Since the + OpenGFX free graphics set has been packaged for Debian, one can now run + OpenTTD without needing any of the resources from the original game + (though the original resources are still supported). + + -- Matthijs Kooijman Thu, 18 Mar 2010 13:09:35 +0100 + +openttd (0.7.0-1) unstable; urgency=low + + Handling of AI players has changed in 0.7.0. This package no longer + contains any AI players, so playing against the computer is not possible + out of the box any longer. However, you can easily download AI players + through the new "Content Downloading Service", after which playing with + computer players is possible. + + Loading old savegames with computer players is supported (AI players will + be converted according to the current AI settings), but at this moment + there are no AIs that completely handle any existing infrastructure built + by the old AI, so starting a new game might be more fun (especially since + most of the new AIs are a lot less erratic). + + -- Matthijs Kooijman Mon, 13 Apr 2009 15:11:20 +0200 + diff --git a/os/debian/README.Debian b/os/debian/README.Debian index 10eee1f9e3..e7b4bdb135 100644 --- a/os/debian/README.Debian +++ b/os/debian/README.Debian @@ -2,28 +2,38 @@ OpenTTD for Debian ------------------ To properly play this game, you need a base graphics and sound set. -Currently, the graphics files from the original Transport Tycoon Deluxe -game (Windows and DOS versions) are supported, as well as the free -graphics replacement set "OpenGFX". +Currently, the graphics, sound and music files from the original +Transport Tycoon Deluxe game (Windows and DOS versions) are supported, +as well as the free graphics replacement set "OpenGFX", sound +replacement set "OpenSFX" (which is in non-free due to a restrictive +license) and the free music replacement set "OpenMSX". -See readme.txt, section 4.1 for instructions on how to install these -files. +Normally, installing the openttd package should automatically install +openttd-opengfx as well, allowing OpenTTD to run out of the box. If you +want sound, you'll have to enable non-free sources and install the +openttd-opensfx package manually (or install the original Transport +Tyccon Deluxe sound files). --Music - For in game music (optional), you should copy all files in the gm/ - subdir of your ttd installation to /usr/share/games/openttd/gm. You - should also install timidity and a soundfont (freepats is packaged in - Debian and works out of the box). +The easiest way to install the OpenMSX music files is to use the in-game +content download system, which should offer the latest version of the +music files. - Don't forget to use -m extmidi if you want music, and if you have - problems, remember that not all audio devices support multiple - audiostreams (music and sound), so you might have to use alsa - software mixing or pulseaudio. +To find out how to install the original Transport Tycoon Deluxe graphics +sound files and music files, see readme.txt, section 4.1. + +-Playing Music + In addition to installing a music set (see above), you'll also need + to install the timidity midi player, available in the timidity + package. + + Remember that not all audio devices support multiple audiostreams + (music and sound), so you might have to use alsa software mixing or + pulseaudio. -Scenarios There are no scenarios included in this release. Scenarios can be - downloaded using openttd's content service, which is available from - openttd's main menu. If you have obtained a scenario through other + downloaded using OpenTTD's content service, which is available from + OpenTTD's main menu. If you have obtained a scenario through other means, you can place it either in your ~/.openttd/scenario directory or in the system-wide /usr/share/games/openttd/scenario directory. diff --git a/os/debian/changelog b/os/debian/changelog index fefb691716..f33c7fcbfd 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1,164 +1,160 @@ -openttd (1.0.0) unstable; urgency=low +openttd (1.0.0-1) unstable; urgency=low + * [30a2162] New upstream release 1.0.0. (Closes: #570104) + * [102698a] Make openttd-wrapper work with older mktemp versions. + + -- Matthijs Kooijman Fri, 02 Apr 2010 23:36:21 +0200 + +openttd (1.0.0~rc3-2) unstable; urgency=low + + * [279c5ef] Recommend openttd-opengfx and suggest openttd-opensfx. + * [9330ad7] Update README.Debian concerning music files. + * [07bde24] Move openttd from contrib to main. (Closes: #560810) + + -- Matthijs Kooijman Thu, 18 Mar 2010 13:16:32 +0100 + +openttd (1.0.0~rc3-1) unstable; urgency=low + + * [412d153] New upstream release 1.0.0~rc3. + + -- Matthijs Kooijman Thu, 18 Mar 2010 10:09:33 +0100 + +openttd (1.0.0~rc2-1) unstable; urgency=low + + * [9c99af4] New upstream release 1.0.0~rc2. + + -- Matthijs Kooijman Thu, 04 Mar 2010 12:22:28 +0100 + +openttd (1.0.0~rc1-1) unstable; urgency=low + + * [fe4eb51] New upstream release 1.0.0~rc1. + * [6aa2be0] Note that the embedded md5 implementation has a different + license. + * [39eb336] Remove lintian override for empty gm directory. + + -- Matthijs Kooijman Fri, 19 Feb 2010 13:00:53 +0100 + +openttd (1.0.0~beta4-1) unstable; urgency=low + + * [6718224] New upstream release 1.0.0~beta4. + * [7b0fa8d] Remove some more docs that we don't want in the package. + * [bb9d744] Use liblzo2 instead of an embedded minilzo version. + * [949c06b] Explicitly disable iconv support. + + -- Matthijs Kooijman Fri, 19 Feb 2010 12:59:27 +0100 + +openttd (0.7.5-4) unstable; urgency=low + + * [174d0b1] Don't use deprecated < in Replaces. + + -- Matthijs Kooijman Mon, 15 Feb 2010 00:35:33 +0100 + +openttd (0.7.5-3) unstable; urgency=low + + * [d12fc5a] Make openttd-data replace openttd (< 0.7.5-2). + (Closes: #569679) + + -- Matthijs Kooijman Sun, 14 Feb 2010 16:56:31 +0100 + +openttd (0.7.5-2) unstable; urgency=low + + [ Matthijs Kooijman ] + * [fbab21d] Switch to source format 3.0 (quilt). + * [85c0c7d] No longer check for (and complain about missing) datafiles + on installation and upgrades. (Closes: #524651, 562574) + * [827eb61] Split the architecture independent data into openttd-data. + (Closes: #492462) + * [6fbd9c7] Update README.Debian. + * [76a5148] Support cross compilation. (Closes: #550951) + * [2005bf8] Simplify the rules file, make debhelper do more stuff. + * [fc0500e] Remove some configure arguments. + * [8ca38bb] Explicitly enable or disable all of the dependencies. + * [e38fb3e] Let the upstream Makefile install documentation. + * [5954fcf] Update the watch file to the new upstream url scheme. + * [7249594] Fix typo in copyright file. + * [660fb61] Bump the Standards-Version to 3.8.4, with no changes + required. + * [f94ab89] Move the packaging git repository to git.debian.org. + + -- Jordi Mallach Tue, 09 Feb 2010 21:40:24 +0100 + +openttd (0.7.5-1) unstable; urgency=high + + * [cdcb73a] Imported Upstream version 0.7.5. This release fixes + CVE-2009-4007. + + -- Matthijs Kooijman Thu, 24 Dec 2009 00:55:45 +0100 + +openttd (0.7.4-1) unstable; urgency=low + + * [a2c297b0] Imported Upstream version 0.7.4 + * [0232a645] Make Debian-specific patches executable. + * [76be04b] Switch the Debian packaging to git. + + -- Matthijs Kooijman Tue, 15 Dec 2009 22:11:52 +0100 + +openttd (0.7.3-1) unstable; urgency=low + + [ Matthijs Kooijman ] + * New upstream release + * Use printf instead of echo -en in openttd-wrapper to make it POSIX + compatible (Closes: #547758). + * Remove three patches that are now included in upstream. + + -- Matthijs Kooijman Thu, 01 Oct 2009 22:52:59 +0200 + +openttd (0.7.2-1) unstable; urgency=low + + [ Matthijs Kooijman ] + * New upstream release + * Bump Standards-Version to 3.8.3, with no changes required. + * Clean up the rules file a bit and add some lintian overrides. + * Explain why openttd is in contrib (Closes: #539381). + * Add the DM-Upload-Allowed control field. + * Re-add dpatch infrastructure. + * Fix the copyright file, since upstream only allows GPLv2, not later + versions. + * Add a section to the copyright file on the different license used by the + "Squirrel" programming language, which is shipped with OpenTTD since + 0.7.0. + * Backport upstream r17226, which removes the deprecated Encoding entry from + the .desktop file. + * Add a wrapper script for openttd, which captures any stderr output and + displays it when openttd returns an error code (Closes: #533557). + * Recommend x11-utils, since we use xmessage for displaying errors. Don't + depend on it, since openttd will still run fine without it, you just won't + see any errors. + * Backport upstream r17227 and r17229, which prevents terminal escape codes + from ending up in the captured error output. + * Backport upstream r17240, which improves stderr output when files are + missing or corrupt. + + -- Jordi Mallach Fri, 21 Aug 2009 15:27:26 +0200 + +openttd (0.7.1-1) unstable; urgency=low + + [ Matthijs Kooijman ] * New upstream release. + * Link against libicu to enable right-to-left language support. - -- Matthijs Kooijman Thu, 01 Apr 2010 00:01:02 +0200 + -- Jordi Mallach Tue, 09 Jun 2009 21:46:28 +0200 -openttd (1.0.0~RC3) unstable; urgency=low +openttd (0.7.0-1) unstable; urgency=low + [ Matthijs Kooijman ] * New upstream release. - - -- Matthijs Kooijman Thu, 18 Mar 2010 00:01:02 +0100 - -openttd (1.0.0~RC2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 04 Mar 2010 00:01:02 +0100 - -openttd (1.0.0~RC1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 18 Feb 2010 00:01:02 +0100 - -openttd (1.0.0~beta4) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 04 Feb 2010 18:36:02 +0100 - -openttd (1.0.0~beta3) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 21 Jan 2010 00:01:02 +0100 - -openttd (1.0.0~beta2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Tue, 05 Jan 2010 21:36:51 +0100 - -openttd (1.0.0~beta1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 24 Dec 2009 01:01:01 +0100 - -openttd (0.7.5) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Wed, 23 Dec 2009 20:52:34 +0100 - -openttd (0.7.5~RC1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Mon, 14 Dec 2009 19:28:37 +0100 - -openttd (0.7.4) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Tue, 01 Dec 2009 01:23:45 +0100 - -openttd (0.7.4~RC1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Sun, 15 Nov 2009 16:30:07 +0100 - -openttd (0.7.3) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 01 Oct 2009 12:35:47 +0200 - -openttd (0.7.3~RC2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 24 Sep 2009 21:30:43 +0200 - -openttd (0.7.3~RC1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Sun, 13 Sep 2009 10:25:56 +0200 - -openttd (0.7.2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Sat, 01 Aug 2009 00:19:43 +0200 - -openttd (0.7.2~RC2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Tue, 21 Jul 2009 20:25:56 +0200 - -openttd (0.7.2~RC1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Wed, 15 Jul 2009 22:25:56 +0200 - -openttd (0.7.1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Tue, 09 Jun 2009 01:34:56 +0200 - -openttd (0.7.1~RC3) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Wed, 03 Jun 2009 15:34:56 +0200 - -openttd (0.7.1~RC2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Thu, 21 Mar 2009 14:34:56 +0200 - -openttd (0.7.1~RC1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Mon, 11 Mar 2009 17:34:56 +0200 - -openttd (0.7.0) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Wed, 01 Apr 2009 13:37:42 +0000 - -openttd (0.7.0~RC2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Mon, 23 Mar 2009 00:42:00 +0200 - -openttd (0.7.0~RC1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Mon, 16 Mar 2009 00:07:00 +0200 - -openttd (0.7.0~beta2) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Tue, 10 Mar 2009 00:33:05 +0100 - -openttd (0.7.0~beta1) unstable; urgency=low - - * New upstream release. - - -- Matthijs Kooijman Mon, 16 Feb 2009 23:07:05 +0100 + * Remove Debian specific desktop file, upstream provides one now. + * Add debian/watch file. + + [ Jordi Mallach ] + * Bump Standards-Version to 3.8.1, with no changes required. + * Move to debhelper compat 7. Bump Build-Depends accordingly. + * Use dh_prep. + * Add "set -e" to config script. + * Remove a few extra doc files that get installed by upstream Makefile. + * Add more complete copyright information. + + -- Jordi Mallach Wed, 15 Apr 2009 18:22:10 +0200 openttd (0.6.3-1) unstable; urgency=low @@ -167,7 +163,7 @@ openttd (0.6.3-1) unstable; urgency=low [ Jordi Mallach ] * Add Spanish Debconf template translation, after fixing its corrupted - encoding. + encoding (thanks, Germana Oliveira, closes: #499214). -- Jordi Mallach Thu, 02 Oct 2008 16:59:03 +0200 diff --git a/os/debian/control b/os/debian/control index 6c5969f7db..5c0801542b 100644 --- a/os/debian/control +++ b/os/debian/control @@ -1,9 +1,10 @@ Source: openttd -Section: contrib/games +Section: games Priority: optional Maintainer: Matthijs Kooijman Uploaders: Jordi Mallach -Build-Depends: debhelper (>= 7.0.50), libsdl-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev, liblzo2-dev, libicu-dev +DM-Upload-Allowed: yes +Build-Depends: debhelper (>= 7.0.50), libsdl-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev, libicu-dev, liblzo2-dev Standards-Version: 3.8.4 Vcs-Browser: http://git.debian.org/?p=collab-maint/openttd.git Vcs-Git: git://git.debian.org/collab-maint/openttd.git @@ -12,12 +13,15 @@ Homepage: http://www.openttd.org/ Package: openttd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: openttd-opengfx, x11-utils Replaces: openttd-data Conflicts: openttd-data -Suggests: timidity, freepats +Suggests: openttd-opensfx, timidity, freepats Description: reimplementation of Transport Tycoon Deluxe with enhancements OpenTTD is a reimplementation of the Microprose game "Transport - Tycoon Deluxe" with lots of new features and enhancements. The data - files of the original Transport Tycoon Deluxe for Windows are - mandatory to play the game. They must be manually copied to the game - data directory (see README.Debian for details). + Tycoon Deluxe" with lots of new features and enhancements. + . + OpenTTD is playable with the free graphics files from the openttd-opengfx + package and optional sound files from the openttd-opensfx package (which is in + non-free). Alternatively, OpenTTD can use the graphics files from the original + Transport Tycoon Deluxe game (See README.Debian on how to set this up). diff --git a/os/debian/copyright b/os/debian/copyright index 5c58d007a0..c361d80dd2 100644 --- a/os/debian/copyright +++ b/os/debian/copyright @@ -1,11 +1,6 @@ This package was debianized by Matthijs Kooijman on Wed, 15 Sep 2004 00:24:01 +0200. -This package is not part of the main Debian GNU/Linux distribution, but -uploaded to the contrib section. This is because the openttd program is -non-functional by itself, it needs (non-free) graphical and sound -resources from the Transport Tycoon Deluxe game to work. - Upstream author: Ludvig Strigeus (ludde) and many others. Upstream homepage: http://www.openttd.org @@ -59,3 +54,24 @@ language, which is shipped under the following license: 3. This notice may not be removed or altered from any source distribution. + +This package contains an implementation of the md5 hash algorithm, which +is shipped under the following license: + + Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. diff --git a/os/debian/gbp.conf b/os/debian/gbp.conf new file mode 100644 index 0000000000..58b68d336b --- /dev/null +++ b/os/debian/gbp.conf @@ -0,0 +1,13 @@ +[DEFAULT] +# Use pristine-tar +pristine-tar = True + +[git-dch] +# We use metaheaders in commit messages. +meta = True +# Put git commit ids in the debian changelog. +id-length = 7 + +[git-import-orig] +# Use a custom commit message for upstream imports. +import-msg = New upstream release %(version)s. diff --git a/os/debian/openttd-wrapper b/os/debian/openttd-wrapper index 3c35f7d365..6f85f00b06 100644 --- a/os/debian/openttd-wrapper +++ b/os/debian/openttd-wrapper @@ -2,8 +2,10 @@ # This is a wrapper script that checks openttd's exit status and # displays its stderr output -# Get a file to capture stderr to -TMPFILE=`mktemp --tmpdir openttd.errout.XXXXXXXXX` +# Get a file to capture stderr to. Use the deprecated -t option, so this +# works on the old mktemp from the mktemp package (which has been +# replaced by the version from the coreutils package). +TMPFILE=`mktemp -t openttd.errout.XXXXXXXXX` if [ ! -w "$TMPFILE" ]; then xmessage "Could not create temporary file for error messages. Not starting OpenTTD." diff --git a/os/debian/patches/run-openttd-wrapper.patch b/os/debian/patches/run-openttd-wrapper.patch new file mode 100644 index 0000000000..1c81c78f42 --- /dev/null +++ b/os/debian/patches/run-openttd-wrapper.patch @@ -0,0 +1,19 @@ +From: Matthijs Kooijman +Subject: Use a wrapper script for running openttd + +The wrapper script captures stderr from openttd and displays this in +case of an error. This patch makes the the .desktop file call the +wrapper instead of the openttd binary directly. + +Index: media/openttd.desktop.in +=================================================================== +--- a/media/openttd.desktop.in (revision 17228) ++++ b/media/openttd.desktop.in (working copy) +@@ -6,6 +6,6 @@ + Name=!!MENU_NAME!! + Comment=A clone of Transport Tycoon Deluxe + Icon=openttd +-Exec=!!TTD!! ++Exec=/usr/share/games/openttd/openttd-wrapper + Terminal=false + Categories=!!MENU_GROUP!! diff --git a/os/debian/patches/series b/os/debian/patches/series new file mode 100644 index 0000000000..f7cf2d9d58 --- /dev/null +++ b/os/debian/patches/series @@ -0,0 +1 @@ +run-openttd-wrapper.patch diff --git a/os/debian/rules b/os/debian/rules index a8834ed36d..a34d520494 100755 --- a/os/debian/rules +++ b/os/debian/rules @@ -17,7 +17,7 @@ endif # to be explicit about the dependencies, in case we're not running in a # clean build root. override_dh_auto_configure: - ./configure $(CROSS) --prefix-dir=/usr --install-dir=debian/openttd --without-allegro --with-zlib --with-lzo2 --with-sdl --with-png --with-freetype --with-fontconfig --with-icu + ./configure $(CROSS) --prefix-dir=/usr --install-dir=debian/openttd --without-allegro --with-zlib --with-sdl --with-png --with-freetype --with-fontconfig --with-icu --with-liblzo2 --without-iconv # Do some extra installation override_dh_auto_install: diff --git a/os/debian/source/format b/os/debian/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/os/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/os/debian/watch b/os/debian/watch new file mode 100644 index 0000000000..776381b9c2 --- /dev/null +++ b/os/debian/watch @@ -0,0 +1,5 @@ +version=3 + +options=downloadurlmangle=s/(.*)\/index.html$/\1\/openttd-\1-source.tar.gz/ \ +http://master.binaries.openttd.org/releases/ \ +(\d+(?:\.\d+)*)/index.html diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 2e9027b1b3..b793c57f05 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -88,11 +88,11 @@ struct GraphLegendWindow : Window { ToggleBit(_legend_excluded_companies, widget - GLW_FIRST_COMPANY); this->ToggleWidgetLoweredState(widget); this->SetDirty(); - SetWindowDirty(WC_INCOME_GRAPH, 0); - SetWindowDirty(WC_OPERATING_PROFIT, 0); - SetWindowDirty(WC_DELIVERED_CARGO, 0); - SetWindowDirty(WC_PERFORMANCE_HISTORY, 0); - SetWindowDirty(WC_COMPANY_VALUE, 0); + InvalidateWindowData(WC_INCOME_GRAPH, 0); + InvalidateWindowData(WC_OPERATING_PROFIT, 0); + InvalidateWindowData(WC_DELIVERED_CARGO, 0); + InvalidateWindowData(WC_PERFORMANCE_HISTORY, 0); + InvalidateWindowData(WC_COMPANY_VALUE, 0); } virtual void OnInvalidateData(int data) @@ -526,6 +526,11 @@ public: this->UpdateStatistics(false); } + virtual void OnInvalidateData(int data) + { + this->OnTick(); + } + /** * Update the statistics. * @param initialize Initialize the data structure. @@ -898,6 +903,11 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { /* Override default OnTick */ } + virtual void OnInvalidateData(int data) + { + this->OnHundredthTick(); + } + virtual void OnHundredthTick() { this->excluded_data = _legend_excluded_cargo; diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index ca26adf8b3..b9f7d473ca 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -291,6 +291,9 @@ char *TranslateTTDPatchCodes(uint32 grfid, const char *str) case 8: d += Utf8Encode(d, SCC_NEWGRF_PRINT_HEX_DWORD); break; + case 0x0B: + d += Utf8Encode(d, SCC_NEWGRF_PRINT_HEX_QWORD); + break; default: grfmsg(1, "missing handler for extended format code"); @@ -610,7 +613,7 @@ void RewindTextRefStack() * @param argv the OpenTTD stack of values * @return the string control code to "execute" now */ -uint RemapNewGRFStringControlCode(uint scc, char **buff, const char **str, int64 *argv) +uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const char **str, int64 *argv) { if (_newgrf_textrefstack->used) { switch (scc) { @@ -624,6 +627,7 @@ uint RemapNewGRFStringControlCode(uint scc, char **buff, const char **str, int64 case SCC_NEWGRF_PRINT_HEX_BYTE: *argv = _newgrf_textrefstack->PopUnsignedByte(); break; case SCC_NEWGRF_PRINT_HEX_DWORD: *argv = _newgrf_textrefstack->PopUnsignedDWord(); break; + case SCC_NEWGRF_PRINT_HEX_QWORD: *argv = _newgrf_textrefstack->PopSignedQWord(); break; case SCC_NEWGRF_PRINT_HEX_WORD: case SCC_NEWGRF_PRINT_WORD_SPEED: @@ -637,7 +641,7 @@ uint RemapNewGRFStringControlCode(uint scc, char **buff, const char **str, int64 case SCC_NEWGRF_ROTATE_TOP_4_WORDS: _newgrf_textrefstack->RotateTop4Words(); break; case SCC_NEWGRF_PUSH_WORD: _newgrf_textrefstack->PushWord(Utf8Consume(str)); break; - case SCC_NEWGRF_UNPRINT: *buff -= Utf8Consume(str); break; + case SCC_NEWGRF_UNPRINT: *buff = max(*buff - Utf8Consume(str), buf_start); break; case SCC_NEWGRF_PRINT_STRING_ID: *argv = TTDPStringIDToOTTDStringIDMapping(_newgrf_textrefstack->PopUnsignedWord()); @@ -656,6 +660,7 @@ uint RemapNewGRFStringControlCode(uint scc, char **buff, const char **str, int64 case SCC_NEWGRF_PRINT_HEX_BYTE: case SCC_NEWGRF_PRINT_HEX_WORD: case SCC_NEWGRF_PRINT_HEX_DWORD: + case SCC_NEWGRF_PRINT_HEX_QWORD: return SCC_HEX; case SCC_NEWGRF_PRINT_DWORD_CURRENCY: diff --git a/src/newgrf_text.h b/src/newgrf_text.h index d75246e259..bfd308ca38 100644 --- a/src/newgrf_text.h +++ b/src/newgrf_text.h @@ -28,7 +28,7 @@ void StopTextRefStackUsage(); void SwitchToNormalRefStack(); void SwitchToErrorRefStack(); void RewindTextRefStack(); -uint RemapNewGRFStringControlCode(uint scc, char **buff, const char **str, int64 *argv); +uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const char **str, int64 *argv); StringID TTDPStringIDToOTTDStringIDMapping(StringID string); diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 3ba57e0e55..5030d003ae 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -621,6 +621,8 @@ private: */ void OrderClick_Nonstop(int non_stop) { + if (this->vehicle->type != VEH_TRAIN && this->vehicle->type != VEH_ROAD) return; + VehicleOrderID sel_ord = this->OrderGetSel(); const Order *order = this->vehicle->GetOrder(sel_ord); @@ -1277,7 +1279,7 @@ public: virtual void OnTimeout() { static const int raise_widgets[] = { - ORDER_WIDGET_SKIP, ORDER_WIDGET_DELETE, ORDER_WIDGET_REFIT, ORDER_WIDGET_SHARED_ORDER_LIST, WIDGET_LIST_END, + ORDER_WIDGET_TIMETABLE_VIEW, ORDER_WIDGET_SKIP, ORDER_WIDGET_DELETE, ORDER_WIDGET_REFIT, ORDER_WIDGET_SHARED_ORDER_LIST, WIDGET_LIST_END, }; /* Unclick all buttons in raise_widgets[]. */ diff --git a/src/stdafx.h b/src/stdafx.h index 649b80d8dc..16376e8c59 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -276,9 +276,11 @@ /* MSVCRT of course has to have a different syntax for long long *sigh* */ #if defined(_MSC_VER) || defined(__MINGW32__) #define OTTD_PRINTF64 "%I64d" + #define OTTD_PRINTFHEX64 "%I64x" #define PRINTF_SIZE "%Iu" #else #define OTTD_PRINTF64 "%lld" + #define OTTD_PRINTFHEX64 "%llx" #define PRINTF_SIZE "%zu" #endif diff --git a/src/strings.cpp b/src/strings.cpp index c673e54ff8..21767fcaf5 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -231,9 +231,9 @@ static char *FormatZerofillNumber(char *buff, int64 number, int64 count, const c return FormatNumber(buff, number, last, "", 20 - count); } -static char *FormatHexNumber(char *buff, int64 number, const char *last) +static char *FormatHexNumber(char *buff, uint64 number, const char *last) { - return buff + seprintf(buff, last, "0x%x", (uint32)number); + return buff + seprintf(buff, last, "0x" OTTD_PRINTFHEX64, number); } /** @@ -552,11 +552,12 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei, WChar b; int64 *argv_orig = argv; uint modifier = 0; + char *buf_start = buff; while ((b = Utf8Consume(&str)) != '\0') { if (SCC_NEWGRF_FIRST <= b && b <= SCC_NEWGRF_LAST) { /* We need to pass some stuff as it might be modified; oh boy. */ - b = RemapNewGRFStringControlCode(b, &buff, &str, argv); + b = RemapNewGRFStringControlCode(b, buf_start, &buff, &str, argv); if (b == 0) continue; } @@ -856,7 +857,7 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei, } break; case SCC_HEX: // {HEX} - buff = FormatHexNumber(buff, GetInt64(&argv), last); + buff = FormatHexNumber(buff, (uint64)GetInt64(&argv), last); break; case SCC_BYTES: // {BYTES} diff --git a/src/table/control_codes.h b/src/table/control_codes.h index 38c7f63622..29ad80b260 100644 --- a/src/table/control_codes.h +++ b/src/table/control_codes.h @@ -123,6 +123,7 @@ enum StringControlCode { SCC_NEWGRF_PRINT_HEX_BYTE, ///< Read 1 byte from the stack and print it as hex SCC_NEWGRF_PRINT_HEX_WORD, ///< Read 2 bytes from the stack and print it as hex SCC_NEWGRF_PRINT_HEX_DWORD, ///< Read 4 bytes from the stack and print it as hex + SCC_NEWGRF_PRINT_HEX_QWORD, ///< Read 8 bytes from the stack and print it as hex SCC_NEWGRF_PUSH_WORD, ///< Pushes 2 bytes onto the stack SCC_NEWGRF_UNPRINT, ///< "Unprints" the given number of bytes from the string SCC_NEWGRF_DISCARD_WORD, ///< Discard the next two bytes