From c7c1d1cb0cd4c26d0736483a31547e6d68811722 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 24 Aug 2019 19:45:40 +0200 Subject: [PATCH 01/29] Update: Translations from eints spanish: 1 change by lpenap --- src/lang/spanish.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lang/spanish.txt b/src/lang/spanish.txt index f4f5447095..c439b70acd 100644 --- a/src/lang/spanish.txt +++ b/src/lang/spanish.txt @@ -3123,6 +3123,7 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Renombrar Munic # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}{TOWN} autoridad local +STR_LOCAL_AUTHORITY_ZONE :{BLACK}Zona STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Calificación de empresas de transporte: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Acciones disponibles: From 14bca191631f557b555d027f352824e6ee2a54f8 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 31 Aug 2019 19:45:40 +0200 Subject: [PATCH 02/29] Update: Translations from eints italian: 4 changes by lorenzodv --- src/lang/italian.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lang/italian.txt b/src/lang/italian.txt index c3e23286c3..d634592b19 100644 --- a/src/lang/italian.txt +++ b/src/lang/italian.txt @@ -1350,8 +1350,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :Tipo di terreno STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(Solo TerraGenesis) Tipo di dislivelli presenti nel paesaggio STR_CONFIG_SETTING_INDUSTRY_DENSITY :Densità delle industrie: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Determina quante industrie sono generate e attorno a quale livello sono mantenute nel corso della partita -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Massima distanza delle raffinerie dal bordo della mappa: {STRING} -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Le raffinerie sono costruite solo vicino ai bordi della mappa, ovvero sulla costa nel caso di mappe insulari +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Massima distanza delle industrie petrolifere dal bordo della mappa: {STRING} +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limita la distanza dal bordo della mappa entro cui possono essere costruite raffinerie e piattaforme petrolifere. Nelle mappe insulari sono comunque sempre vicino alla costa. Su mappe più grandi di 256 riquadri il valore è aumentato in proporzione. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Altezza delle nevi perenni: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Determina la quota alla quale appare la neve nei paesaggi sub-artici. La neve ha anche l'effetto di influenzare la generazione delle industrie e i requisiti per la crescita delle città STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Irregolarità del terreno: {STRING} @@ -3152,6 +3152,8 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Rinomina città # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}Autorità locale di {TOWN} +STR_LOCAL_AUTHORITY_ZONE :{BLACK}Zona +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}Mostra la zona di competenza dall'autorità locale STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Valutazione delle compagnie di trasporto: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Azioni disponibili: From c655f89d845a4d670c7b30575c5b8de799b12363 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Wed, 28 Aug 2019 17:45:36 -0400 Subject: [PATCH 03/29] Fix: Allow git worktree in version detection; drop svn, hg. If $ROOT_DIR is a linked working tree from git-worktree(1), then $ROOT_DIR/.git is a regular file instead of a directory. Allow this when deciding whether to use git to detect OpenTTD's version. Drop checks for svn and hg in config.lib, because findversion.sh hasn't used svn nor hg since 192770e6da. --- config.lib | 12 +----------- findversion.sh | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/config.lib b/config.lib index e8f77adc78..495921fe43 100644 --- a/config.lib +++ b/config.lib @@ -1059,18 +1059,8 @@ check_params() { fi fi - if [ -d "$ROOT_DIR/.svn" ] && [ -n "`svn help 2>/dev/null`" ]; then - log 1 "checking revision... svn detection" - elif [ -d "$ROOT_DIR/../.svn" ] && [ -n "`svn help 2>/dev/null`" ] && [ -n "`LC_ALL=C svn info $ROOT_DIR/.. | grep '^URL:.*tags$'`" ]; then - # subversion changed its behaviour; now not all folders have a .svn folder, - # but only the root folder. Since making tags requires a (sparse) checkout - # of the tags folder, the folder of the tag does not have a .svn folder - # anymore and this fails to detect the subversion repository checkout. - log 1 "checking revision... svn detection (tag)" - elif [ -d "$ROOT_DIR/.git" ] && [ -n "`git help 2>/dev/null`" ]; then + if { [ -d "$ROOT_DIR/.git" ] || [ -f "$ROOT_DIR/.git" ]; } && [ -n "`git help 2>/dev/null`" ]; then log 1 "checking revision... git detection" - elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`HGPLAIN= hg help 2>/dev/null`" ]; then - log 1 "checking revision... hg detection" elif [ -f "$ROOT_DIR/.ottdrev" ]; then log 1 "checking revision... source tarball" else diff --git a/findversion.sh b/findversion.sh index 95a041bac0..0da382476a 100755 --- a/findversion.sh +++ b/findversion.sh @@ -59,7 +59,7 @@ ROOT_DIR=`pwd` # Determine if we are using a modified version # Assume the dir is not modified MODIFIED="0" -if [ -d "$ROOT_DIR/.git" ]; then +if [ -d "$ROOT_DIR/.git" ] || [ -f "$ROOT_DIR/.git" ]; then # We are a git checkout # Refresh the index to make sure file stat info is in sync, then look for modifications git update-index --refresh >/dev/null From 1be42c6cb88fca9de926a8b74c88fbfc98ef4090 Mon Sep 17 00:00:00 2001 From: Roger Date: Sat, 31 Aug 2019 15:20:24 -0400 Subject: [PATCH 04/29] Add: [GitHub] sponsor button on github.com (#7700) --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..231b93314c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://www.openttd.org/donate.html From 28e11623bd22fcf933350aae980b28008f113286 Mon Sep 17 00:00:00 2001 From: Nikolas Nyby Date: Tue, 6 Aug 2019 07:19:19 -0400 Subject: [PATCH 05/29] Codechange: math functions - use cpp-style casts --- src/core/bitmath_func.hpp | 10 +++++----- src/core/math_func.hpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/bitmath_func.hpp b/src/core/bitmath_func.hpp index fd05aa3f59..8fdc7100e8 100644 --- a/src/core/bitmath_func.hpp +++ b/src/core/bitmath_func.hpp @@ -367,12 +367,12 @@ static inline T ROR(const T x, const uint8 n) * (since it will use hardware swapping if available). * Even though they should return uint16 and uint32, we get * warnings if we don't cast those (why?) */ - #define BSWAP32(x) ((uint32)CFSwapInt32(x)) - #define BSWAP16(x) ((uint16)CFSwapInt16(x)) +# define BSWAP32(x) (static_cast(CFSwapInt32(x))) +# define BSWAP16(x) (static_cast(CFSwapInt16(x))) #elif defined(_MSC_VER) /* MSVC has intrinsics for swapping, resulting in faster code */ - #define BSWAP32(x) (_byteswap_ulong(x)) - #define BSWAP16(x) (_byteswap_ushort(x)) +# define BSWAP32(x) (_byteswap_ulong(x)) +# define BSWAP16(x) (_byteswap_ushort(x)) #else /** * Perform a 32 bits endianness bitswap on x. @@ -383,7 +383,7 @@ static inline T ROR(const T x, const uint8 n) { #if !defined(__ICC) && defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ >= 3)) /* GCC >= 4.3 provides a builtin, resulting in faster code */ - return (uint32)__builtin_bswap32((int32)x); + return static_cast(__builtin_bswap32(static_cast(x))); #else return ((x >> 24) & 0xFF) | ((x >> 8) & 0xFF00) | ((x << 8) & 0xFF0000) | ((x << 24) & 0xFF000000); #endif /* defined(__GNUC__) */ diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp index 0b51d6bbff..570f54c232 100644 --- a/src/core/math_func.hpp +++ b/src/core/math_func.hpp @@ -115,7 +115,7 @@ template static inline T *AlignPtr(T *x, uint n) { assert_compile(sizeof(size_t) == sizeof(void *)); - return (T *)Align((size_t)x, n); + return reinterpret_cast(Align((size_t)x, n)); } /** @@ -202,7 +202,7 @@ static inline uint ClampU(const uint a, const uint min, const uint max) */ static inline int32 ClampToI32(const int64 a) { - return (int32)Clamp(a, INT32_MIN, INT32_MAX); + return static_cast(Clamp(a, INT32_MIN, INT32_MAX)); } /** @@ -218,7 +218,7 @@ static inline uint16 ClampToU16(const uint64 a) * match for min(uint64, uint) than uint64 min(uint64, uint64). As such we * need to cast the UINT16_MAX to prevent MSVC from displaying its * infinite loads of warnings. */ - return (uint16)min(a, (uint64)UINT16_MAX); + return static_cast(min(a, static_cast(UINT16_MAX))); } /** @@ -339,10 +339,10 @@ static inline int RoundDivSU(int a, uint b) { if (a > 0) { /* 0.5 is rounded to 1 */ - return (a + (int)b / 2) / (int)b; + return (a + static_cast(b) / 2) / static_cast(b); } else { /* -0.5 is rounded to 0 */ - return (a - ((int)b - 1) / 2) / (int)b; + return (a - (static_cast(b) - 1) / 2) / static_cast(b); } } From a933afabfda2986f88e27ea512253227cc629252 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Mon, 22 Jul 2019 19:03:40 +0200 Subject: [PATCH 06/29] Add: [Win32] Select MIDI device by port name --- src/music/win32_m.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/music/win32_m.cpp b/src/music/win32_m.cpp index 21ffe1ed3d..cb6301a576 100644 --- a/src/music/win32_m.cpp +++ b/src/music/win32_m.cpp @@ -370,6 +370,26 @@ const char *MusicDriver_Win32::Start(const char * const *parm) int resolution = GetDriverParamInt(parm, "resolution", 5); int port = GetDriverParamInt(parm, "port", -1); + const char *portname = GetDriverParam(parm, "portname"); + + /* Enumerate ports either for selecting port by name, or for debug output */ + if (portname != nullptr || _debug_driver_level > 0) { + uint numports = midiOutGetNumDevs(); + DEBUG(driver, 1, "Win32-MIDI: Found %d output devices:", numports); + for (uint tryport = 0; tryport < numports; tryport++) { + MIDIOUTCAPS moc{}; + if (midiOutGetDevCaps(tryport, &moc, sizeof(moc)) == MMSYSERR_NOERROR) { + char tryportname[128]; + convert_from_fs(moc.szPname, tryportname, lengthof(tryportname)); + + /* Compare requested and detected port name. + * If multiple ports have the same name, this will select the last matching port, and the debug output will be confusing. */ + if (portname != nullptr && strncmp(tryportname, portname, lengthof(tryportname)) == 0) port = tryport; + + DEBUG(driver, 1, "MIDI port %2d: %s%s", tryport, tryportname, (tryport == port) ? " [selected]" : ""); + } + } + } UINT devid; if (port < 0) { From ead772324e0fb9df502022397d06150c218c9d21 Mon Sep 17 00:00:00 2001 From: uvealonso <39194608+uvealonso@users.noreply.github.com> Date: Sun, 25 Aug 2019 23:01:33 +0100 Subject: [PATCH 07/29] Fix #7704: [OSX] Handle malformed UTF8 strings --- src/os/macosx/string_osx.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 6d90b91a8e..4c33d54970 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -306,6 +306,13 @@ int MacOSStringCompare(const char *s1, const char *s2) CFStringRef cf1 = CFStringCreateWithCString(kCFAllocatorDefault, s1, kCFStringEncodingUTF8); CFStringRef cf2 = CFStringCreateWithCString(kCFAllocatorDefault, s2, kCFStringEncodingUTF8); + /* If any CFString could not be created (e.g., due to UTF8 invalid chars), return OS unsupported functionality */ + if (cf1 == nullptr || cf2 == nullptr) { + if (cf1 != nullptr) CFRelease(cf1); + if (cf2 != nullptr) CFRelease(cf2); + return 0; + } + CFComparisonResult res = CFStringCompareWithOptionsAndLocale(cf1, cf2, CFRangeMake(0, CFStringGetLength(cf1)), flags, _osx_locale); CFRelease(cf1); From cf86c39be5c0dd67ac6568d47b096264166c34e2 Mon Sep 17 00:00:00 2001 From: glx22 Date: Sun, 1 Sep 2019 18:54:01 +0200 Subject: [PATCH 08/29] Fix b870596f153c17d9aa915ca67b8f6414d73cb31f: forgotten squirrel_export run (#7715) --- src/script/api/game/game_window.hpp.sq | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq index fe665a4ad0..cd95607e02 100644 --- a/src/script/api/game/game_window.hpp.sq +++ b/src/script/api/game/game_window.hpp.sq @@ -1259,6 +1259,7 @@ void SQGSWindow_Register(Squirrel *engine) SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_SCROLLBAR, "WID_TD_SCROLLBAR"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_WORLD_POPULATION, "WID_TD_WORLD_POPULATION"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TA_CAPTION, "WID_TA_CAPTION"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TA_ZONE_BUTTON, "WID_TA_ZONE_BUTTON"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TA_RATING_INFO, "WID_TA_RATING_INFO"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TA_COMMAND_LIST, "WID_TA_COMMAND_LIST"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TA_SCROLLBAR, "WID_TA_SCROLLBAR"); From d649011dfcac34e1b325424418ab5ca708af6361 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 1 Sep 2019 16:43:32 +0200 Subject: [PATCH 09/29] Fix #7702: Scaling for highscore screen --- src/highscore_gui.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index b0a93aac99..c353f6ebcc 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -22,6 +22,7 @@ #include "company_base.h" #include "strings_func.h" #include "hotkeys.h" +#include "zoom_func.h" #include "widgets/highscore_widget.h" @@ -132,7 +133,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { void OnPaint() override { this->SetupHighScoreEndWindow(); - Point pt = this->GetTopLeft(640, 480); + Point pt = this->GetTopLeft(ScaleGUITrad(640), ScaleGUITrad(480)); const Company *c = Company::GetIfValid(_local_company); if (c == nullptr) return; @@ -143,11 +144,11 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { SetDParam(0, c->index); SetDParam(1, c->index); SetDParam(2, EndGameGetPerformanceTitleFromValue(c->old_economy[0].performance_history)); - DrawStringMultiLine(pt.x + 15, pt.x + 640 - 25, pt.y + 90, pt.y + 160, STR_HIGHSCORE_PRESIDENT_OF_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(pt.x + ScaleGUITrad(15), pt.x + ScaleGUITrad(640) - ScaleGUITrad(25), pt.y + ScaleGUITrad(90), pt.y + ScaleGUITrad(160), STR_HIGHSCORE_PRESIDENT_OF_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); } else { SetDParam(0, c->index); SetDParam(1, EndGameGetPerformanceTitleFromValue(c->old_economy[0].performance_history)); - DrawStringMultiLine(pt.x + 36, pt.x + 640, pt.y + 140, pt.y + 206, STR_HIGHSCORE_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(pt.x + ScaleGUITrad(36), pt.x + ScaleGUITrad(640), pt.y + ScaleGUITrad(140), pt.y + ScaleGUITrad(206), STR_HIGHSCORE_COMPANY_ACHIEVES_STATUS, TC_FROMSTRING, SA_CENTER); } } }; @@ -182,24 +183,24 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { const HighScore *hs = _highscore_table[this->window_number]; this->SetupHighScoreEndWindow(); - Point pt = this->GetTopLeft(640, 480); + Point pt = this->GetTopLeft(ScaleGUITrad(640), ScaleGUITrad(480)); SetDParam(0, ORIGINAL_END_YEAR); - DrawStringMultiLine(pt.x + 70, pt.x + 570, pt.y, pt.y + 140, !_networking ? STR_HIGHSCORE_TOP_COMPANIES_WHO_REACHED : STR_HIGHSCORE_TOP_COMPANIES_NETWORK_GAME, TC_FROMSTRING, SA_CENTER); + DrawStringMultiLine(pt.x + ScaleGUITrad(70), pt.x + ScaleGUITrad(570), pt.y, pt.y + ScaleGUITrad(140), !_networking ? STR_HIGHSCORE_TOP_COMPANIES_WHO_REACHED : STR_HIGHSCORE_TOP_COMPANIES_NETWORK_GAME, TC_FROMSTRING, SA_CENTER); /* Draw Highscore peepz */ for (uint8 i = 0; i < lengthof(_highscore_table[0]); i++) { SetDParam(0, i + 1); - DrawString(pt.x + 40, pt.x + 600, pt.y + 140 + (i * 55), STR_HIGHSCORE_POSITION); + DrawString(pt.x + ScaleGUITrad(40), pt.x + ScaleGUITrad(600), pt.y + ScaleGUITrad(140 + i * 55), STR_HIGHSCORE_POSITION); if (hs[i].company[0] != '\0') { TextColour colour = (this->rank == i) ? TC_RED : TC_BLACK; // draw new highscore in red SetDParamStr(0, hs[i].company); - DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + (i * 55), STR_JUST_BIG_RAW_STRING, colour); + DrawString(pt.x + ScaleGUITrad(71), pt.x + ScaleGUITrad(569), pt.y + ScaleGUITrad(140 + i * 55), STR_JUST_BIG_RAW_STRING, colour); SetDParam(0, hs[i].title); SetDParam(1, hs[i].score); - DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + FONT_HEIGHT_LARGE + (i * 55), STR_HIGHSCORE_STATS, colour); + DrawString(pt.x + ScaleGUITrad(71), pt.x + ScaleGUITrad(569), pt.y + ScaleGUITrad(140) + FONT_HEIGHT_LARGE + ScaleGUITrad(i * 55), STR_HIGHSCORE_STATS, colour); } } } From 03aaf695a5875d5a83c25142b7a78a8641af97d3 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 1 Sep 2019 00:45:45 +0200 Subject: [PATCH 10/29] Fix: [DorpsGek] don't report all pushes, but just those done by DorpsGek Those are most often the translator updates, which are pushed directly to master (and not via a Pull Request). --- .dorpsgek.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.dorpsgek.yml b/.dorpsgek.yml index a8b976f5c7..8f1b813156 100644 --- a/.dorpsgek.yml +++ b/.dorpsgek.yml @@ -1,13 +1,13 @@ notifications: + global: + irc: + - openttd + - openttd.notice + push: - irc: - - openttd - - openttd.notice + only: + - master + only-by: + - DorpsGek pull-request: - irc: - - openttd - - openttd.notice issue: - irc: - - openttd - - openttd.notice From c4850475c3b91099afc6b7149fc77d0b4746cf72 Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 4 Sep 2019 19:45:39 +0200 Subject: [PATCH 11/29] Update: Translations from eints slovenian: 4 changes by matej1245 --- src/lang/slovenian.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lang/slovenian.txt b/src/lang/slovenian.txt index 6e38e90b06..7ab44e1258 100644 --- a/src/lang/slovenian.txt +++ b/src/lang/slovenian.txt @@ -963,6 +963,7 @@ STR_NEWS_MERGER_TAKEOVER_TITLE :{BIG_FONT}{BLAC STR_PRESIDENT_NAME_MANAGER :{BLACK}{PRESIDENT_NAME}{}(Direktor) STR_NEWS_NEW_TOWN :{BLACK}{BIG_FONT}{STRING} sponzorirana gradnja novega mesta {TOWN}! +STR_NEWS_NEW_TOWN_UNSPONSORED :{BLACK}{BIG_FONT}Novo mesto z imenom {TOWN} je bilo zgrajeno! STR_NEWS_INDUSTRY_CONSTRUCTION :{BIG_FONT}{BLACK}Na novo se gradi {STRING} blizu mesta {TOWN}! STR_NEWS_INDUSTRY_PLANTED :{BIG_FONT}{BLACK}Postavlja se {STRING} blizu mesta {TOWN}! @@ -1951,6 +1952,7 @@ STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Spremeni STR_CHEAT_SETUP_PROD :{LTBLUE}Omogoči spreminjanje proizvodnih vrednosti: {ORANGE}{STRING} # Livery window +STR_LIVERY_CAPTION :{WHITE}{COMPANY} - Barvna shema STR_LIVERY_GENERAL_TOOLTIP :{BLACK}Prikaz glavnih barvnih shem STR_LIVERY_TRAIN_TOOLTIP :{BLACK}Prikaz barvnih shem vlakov @@ -3928,6 +3930,7 @@ STR_ORDER_CONDITIONAL_AGE :Starost (leta) STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Potrebuje servis STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Vedno STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Preostala življenjska doba (let) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Največja zanesljivost STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Kako primerjati podatke vozila na podano vrednost STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :je enaka @@ -4611,6 +4614,7 @@ STR_BASESOUNDS_DOS_DESCRIPTION :Originalni zvok STR_BASESOUNDS_WIN_DESCRIPTION :Originalni zvoki Transport Tycoon Deluxe različice oken(windows). STR_BASESOUNDS_NONE_DESCRIPTION :Zvočni paket brez zvoka. STR_BASEMUSIC_WIN_DESCRIPTION :Originalna glasba Transport Tycoon Deluxe različice oken(windows). +STR_BASEMUSIC_DOS_DESCRIPTION :Originalna glasba Transport Tycoon Deluxe DOS različice STR_BASEMUSIC_NONE_DESCRIPTION :Glasbeni paket z vključeno glasbo. ##id 0x2000 From fbbbc6e1931df7d4281432c5a14d10c17f4464aa Mon Sep 17 00:00:00 2001 From: JMcKiern Date: Wed, 4 Sep 2019 21:47:21 +0100 Subject: [PATCH 12/29] Fix #7692: Added industry tile to GetOrderCmdFromTile() (#7709) Sending order command to an industry tile now checks if a neutral_station is available and sends the order to that station --- src/order_gui.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 7cf7a9ba9b..fa56f70cbd 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -24,6 +24,7 @@ #include "tilehighlight_func.h" #include "network/network.h" #include "station_base.h" +#include "industry.h" #include "waypoint_base.h" #include "core/geometry_func.hpp" #include "hotkeys.h" @@ -389,11 +390,17 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) return order; } - if (IsTileType(tile, MP_STATION)) { - StationID st_index = GetStationIndex(tile); - const Station *st = Station::Get(st_index); + /* check for station or industry with neutral station */ + if (IsTileType(tile, MP_STATION) || IsTileType(tile, MP_INDUSTRY)) { + const Station *st = nullptr; - if (st->owner == _local_company || st->owner == OWNER_NONE) { + if (IsTileType(tile, MP_STATION)) { + st = Station::GetByTile(tile); + } else { + const Industry *in = Industry::GetByTile(tile); + st = in->neutral_station; + } + if (st != nullptr && (st->owner == _local_company || st->owner == OWNER_NONE)) { byte facil; switch (v->type) { case VEH_SHIP: facil = FACIL_DOCK; break; @@ -403,6 +410,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) default: NOT_REACHED(); } if (st->facilities & facil) { + StationID st_index = GetStationIndex(st->xy); order.MakeGoToStation(st_index); if (_ctrl_pressed) order.SetLoadType(OLF_FULL_LOAD_ANY); if (_settings_client.gui.new_nonstop && v->IsGroundVehicle()) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS); From 058dadf315c3f9e2dac06a5c59866036ccc8e190 Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 6 Sep 2019 19:45:39 +0200 Subject: [PATCH 13/29] Update: Translations from eints french: 4 changes by glx --- src/lang/french.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lang/french.txt b/src/lang/french.txt index e21dcfccb1..d5ffb78e2c 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -1327,8 +1327,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :Type de terrain STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(TerraGenesis only) Vallonnement du paysage STR_CONFIG_SETTING_INDUSTRY_DENSITY :Densité des industries{NBSP}: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Définit combien d'industries doivent être générée et quel niveau doit être maintenu pendant la partie -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Distance maximum depuis les bords pour les raffineries{NBSP}: {STRING} -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Les raffineries pétrolières ne sont construites que près du bord de la carte, ou sur la côte pour les cartes d'îles. +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Distance maximum depuis les bords pour les industries pétrolières{NBSP}: {STRING} +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limite de distance par rapport au bord de la carte où les raffineries et les plateformes pétrolières peuvent être construites. Sur les cartes d'îles cela assure qu'elles sont près de la côte. Sur les cartes plus large que 256 tuiles, cette valeur est mise à l'échelle. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Altitude d'enneigement{NBSP}: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Contrôle à quelle altitude la neige commence dans le climat sub-arctique.La neige affecte aussi la génération des industries et les exigences pour la croissance des villes STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Rugosité du terrain{NBSP}: {STRING} @@ -3123,6 +3123,8 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Renommer la vil # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}Municipalité de {TOWN} +STR_LOCAL_AUTHORITY_ZONE :{BLACK}Zone +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}Affiche la zone dans les limites de la municipalité STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Qualité de service des compagnies{NBSP}: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}{NBSP}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Actions disponibles{NBSP}: From 2d9eb1c41742dee2b1d978302d97b6ab6ee6e2e6 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 26 Jun 2019 03:17:17 +0100 Subject: [PATCH 14/29] Fix #7626: Allow building drive-through stops over one-way/blocked roads owned by towns (instead of crashing). --- src/station_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 46ded9a1dd..b85c1e8876 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1005,7 +1005,7 @@ static CommandCost CheckFlatLandRoadStop(TileArea tile_area, DoCommandFlag flags if (RoadTypeIsRoad(rt) && !HasPowerOnRoad(rt, road_rt)) return_cmd_error(STR_ERROR_NO_SUITABLE_ROAD); - if (GetDisallowedRoadDirections(cur_tile) != DRD_NONE) { + if (GetDisallowedRoadDirections(cur_tile) != DRD_NONE && road_owner != OWNER_TOWN) { CommandCost ret = CheckOwnership(road_owner); if (ret.Failed()) return ret; } From 381c2a45875206afe43241d0c76619638cf613fc Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Wed, 4 Sep 2019 19:46:44 +0200 Subject: [PATCH 15/29] Add: [DorpsGek] also announce comments on commits --- .dorpsgek.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.dorpsgek.yml b/.dorpsgek.yml index 8f1b813156..8cee58a999 100644 --- a/.dorpsgek.yml +++ b/.dorpsgek.yml @@ -9,5 +9,6 @@ notifications: - master only-by: - DorpsGek + commit-comment: pull-request: issue: From b3fd7879596defeb6af78acb4ea45e4418821bdf Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 7 Sep 2019 18:37:01 +0200 Subject: [PATCH 16/29] Fix #7188: check the validity of command callback for scripts (#7701) --- src/ai/ai_instance.cpp | 8 +++++--- src/airport_gui.cpp | 2 +- src/bridge_gui.cpp | 3 ++- src/command.cpp | 2 +- src/command_type.h | 2 +- src/depot_gui.cpp | 3 ++- src/dock_gui.cpp | 4 ++-- src/game/game_instance.cpp | 8 +++++--- src/group_gui.cpp | 8 +++++--- src/industry_gui.cpp | 3 ++- src/main_gui.cpp | 4 ++-- src/rail_gui.cpp | 8 ++++---- src/road_gui.cpp | 10 ++++++---- src/script/api/script_object.cpp | 20 ++++++++++++++++++++ src/script/api/script_object.hpp | 10 ++++++++++ src/script/script_instance.cpp | 8 +++++++- src/script/script_instance.hpp | 4 +++- src/script/script_storage.hpp | 9 +++++++++ src/signs_cmd.cpp | 3 ++- src/terraform_gui.cpp | 2 +- src/town_gui.cpp | 4 ++-- src/train_gui.cpp | 3 ++- src/vehicle_gui.cpp | 5 +++-- 23 files changed, 97 insertions(+), 36 deletions(-) diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index edb7ebce0b..18a549aa14 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -251,8 +251,9 @@ ScriptInfo *AIInstance::FindLibrary(const char *library, int version) * @param tile The tile on which the command was executed. * @param p1 p1 as given to DoCommandPInternal. * @param p2 p2 as given to DoCommandPInternal. + * @param cmd cmd as given to DoCommandPInternal. */ -void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { /* * The company might not exist anymore. Check for this. @@ -263,8 +264,9 @@ void CcAI(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) const Company *c = Company::GetIfValid(_current_company); if (c == nullptr || c->ai_instance == nullptr) return; - c->ai_instance->DoCommandCallback(result, tile, p1, p2); - c->ai_instance->Continue(); + if (c->ai_instance->DoCommandCallback(result, tile, p1, p2, cmd)) { + c->ai_instance->Continue(); + } } CommandCallback *AIInstance::GetDoCommandCallback() diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 0fff03a3cf..ecf9147a99 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -42,7 +42,7 @@ static void ShowBuildAirportPicker(Window *parent); SpriteID GetCustomAirportSprite(const AirportSpec *as, byte layout); -void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcBuildAirport(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 710c591caa..fc4df84abb 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -58,8 +58,9 @@ typedef GUIList GUIBridgeList; ///< List of bridges, used in #B * - p2 = (bit 0- 7) - bridge type (hi bh) * - p2 = (bit 8-13) - rail type or road types. * - p2 = (bit 15-16) - transport type. + * @param cmd unused */ -void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2) +void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_BLACKSMITH_ANVIL, end_tile); diff --git a/src/command.cpp b/src/command.cpp index d81e639b08..2a0e264736 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -598,7 +598,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac } if (!estimate_only && !only_sending && callback != nullptr) { - callback(res, tile, p1, p2); + callback(res, tile, p1, p2, cmd); } return res.Succeeded(); diff --git a/src/command_type.h b/src/command_type.h index e24467b0a3..4b4f0cec6c 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -469,7 +469,7 @@ struct Command { * @param p1 Additional data of the command * @see CommandProc */ -typedef void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2); +typedef void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd); /** * Structure for buffering the build command when selecting a station to join. diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 021195127f..8e7ad3ecd0 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -117,8 +117,9 @@ extern void DepotSortList(VehicleList *list); * @param tile unused * @param p1 unused * @param p2 unused + * @param cmd unused */ -void CcCloneVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcCloneVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index e99d456765..785bbc5fb9 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -40,7 +40,7 @@ static void ShowBuildDocksDepotPicker(Window *parent); static Axis _ship_depot_direction; -void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; @@ -48,7 +48,7 @@ void CcBuildDocks(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcPlaySound_SPLAT_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_SPLAT_WATER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_SPLAT_WATER, tile); } diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index be093ca00c..8d4f5f2b22 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -257,11 +257,13 @@ void GameInstance::Died() * @param tile The tile on which the command was executed. * @param p1 p1 as given to DoCommandPInternal. * @param p2 p2 as given to DoCommandPInternal. + * @param cmd cmd as given to DoCommandPInternal. */ -void CcGame(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcGame(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { - Game::GetGameInstance()->DoCommandCallback(result, tile, p1, p2); - Game::GetGameInstance()->Continue(); + if (Game::GetGameInstance()->DoCommandCallback(result, tile, p1, p2, cmd)) { + Game::GetGameInstance()->Continue(); + } } CommandCallback *GameInstance::GetDoCommandCallback() diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 8cca332684..828a061606 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -1046,9 +1046,10 @@ static inline VehicleGroupWindow *FindVehicleGroupWindow(VehicleType vt, Owner o * @param tile Unused. * @param p1 Vehicle type. * @param p2 Unused. + * @param cmd Unused. * @see CmdCreateGroup */ -void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; assert(p1 <= VEH_AIRCRAFT); @@ -1063,13 +1064,14 @@ void CcCreateGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 * @param tile Unused. * @param p1 Unused. * @param p2 Bit 0-19: Vehicle ID. + * @param cmd Unused. */ -void CcAddVehicleNewGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcAddVehicleNewGroup(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; assert(Vehicle::IsValidID(GB(p2, 0, 20))); - CcCreateGroup(result, 0, Vehicle::Get(GB(p2, 0, 20))->type, 0); + CcCreateGroup(result, 0, Vehicle::Get(GB(p2, 0, 20))->type, 0, cmd); } /** diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index f341f76d62..c662bfef9e 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -222,8 +222,9 @@ void SortIndustryTypes() * @param tile Tile where the industry is placed. * @param p1 Additional data of the #CMD_BUILD_INDUSTRY command. * @param p2 Additional data of the #CMD_BUILD_INDUSTRY command. + * @param cmd Unused. */ -void CcBuildIndustry(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcBuildIndustry(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded()) return; diff --git a/src/main_gui.cpp b/src/main_gui.cpp index b6cf616d17..a833714cd9 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -51,7 +51,7 @@ static int _rename_id = 1; static int _rename_what = -1; -void CcGiveMoney(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcGiveMoney(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed() || !_settings_game.economy.give_money) return; @@ -115,7 +115,7 @@ bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyl } -void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_EXPLOSION(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index b024625fa1..d39cc8ba0f 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -86,7 +86,7 @@ static bool IsStationAvailable(const StationSpec *statspec) return Convert8bitBooleanCallback(statspec->grf_prop.grffile, CBID_STATION_AVAILABILITY, cb_res); } -void CcPlaySound_SPLAT_RAIL(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_SPLAT_RAIL(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_RAIL, tile); } @@ -129,7 +129,7 @@ static const DiagDirection _place_depot_extra_dir[12] = { DIAGDIR_NW, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_NE, }; -void CcRailDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcRailDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; @@ -170,7 +170,7 @@ static void PlaceRail_Waypoint(TileIndex tile) } } -void CcStation(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcStation(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; @@ -272,7 +272,7 @@ static void PlaceRail_Bridge(TileIndex tile, Window *w) } /** Command callback for building a tunnel */ -void CcBuildRailTunnel(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcBuildRailTunnel(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_RAIL, tile); diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 67132f0938..b215d519fd 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -68,7 +68,7 @@ static RoadType _cur_roadtype; static DiagDirection _road_depot_orientation; static DiagDirection _road_station_picker_orientation; -void CcPlaySound_SPLAT_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaySound_SPLAT_OTHER(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT_OTHER, tile); } @@ -96,8 +96,9 @@ static void PlaceRoad_Bridge(TileIndex tile, Window *w) * @param p1 bit 0-3 railtype or roadtypes * bit 8-9 transport type * @param p2 unused + * @param cmd unused */ -void CcBuildRoadTunnel(const CommandCost &result, TileIndex start_tile, uint32 p1, uint32 p2) +void CcBuildRoadTunnel(const CommandCost &result, TileIndex start_tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT_OTHER, start_tile); @@ -130,7 +131,7 @@ void ConnectRoadToStructure(TileIndex tile, DiagDirection direction) } } -void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; @@ -153,9 +154,10 @@ void CcRoadDepot(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 * bit 3: #Axis of the road for drive-through stops. * bit 5..9: The roadtype. * bit 16..31: Station ID to join (NEW_STATION if build new one). + * @param cmd Unused. * @see CmdBuildRoadStop */ -void CcRoadStop(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcRoadStop(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index 62a71574ff..ac06c4c2d0 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -83,6 +83,23 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->mode_instance; } +/* static */ void ScriptObject::SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +{ + GetStorage()->last_tile = tile; + GetStorage()->last_p1 = p1; + GetStorage()->last_p2 = p2; + GetStorage()->last_cmd = cmd; +} + +/* static */ bool ScriptObject::CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) +{ + if (GetStorage()->last_tile != tile) return false; + if (GetStorage()->last_p1 != p1) return false; + if (GetStorage()->last_p2 != p2) return false; + if (GetStorage()->last_cmd != cmd) return false; + return true; +} + /* static */ void ScriptObject::SetDoCommandCosts(Money value) { GetStorage()->costs = CommandCost(value); @@ -304,6 +321,9 @@ ScriptObject::ActiveInstance::~ActiveInstance() /* Only set p2 when the command does not come from the network. */ if (GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = UINT32_MAX; + /* Store the command for command callback validation. */ + if (!estimate_only && _networking && !_generating_world) SetLastCommand(tile, p1, p2, cmd); + /* Try to perform the command. */ CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, text, false, estimate_only); diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index 55dd5e39b7..fba4b69f22 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -73,6 +73,16 @@ protected: */ static bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const char *text = nullptr, Script_SuspendCallbackProc *callback = nullptr); + /** + * Store the latest command executed by the script. + */ + static void SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd); + + /** + * Check if it's the latest command executed by the script. + */ + static bool CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd); + /** * Sets the DoCommand costs counter to a value. */ diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 5734c2c83b..64ae51cf36 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -680,10 +680,12 @@ SQInteger ScriptInstance::GetOpsTillSuspend() return this->engine->GetOpsTillSuspend(); } -void ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { ScriptObject::ActiveInstance active(this); + if (!ScriptObject::CheckLastCommand(tile, p1, p2, cmd)) return false; + ScriptObject::SetLastCommandRes(result.Succeeded()); if (result.Failed()) { @@ -692,6 +694,10 @@ void ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile ScriptObject::IncreaseDoCommandCosts(result.GetCost()); ScriptObject::SetLastCost(result.GetCost()); } + + ScriptObject::SetLastCommand(INVALID_TILE, 0, 0, CMD_END); + + return true; } void ScriptInstance::InsertEvent(class ScriptEvent *event) diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index 653ec38840..dc5b28dfbb 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -182,8 +182,10 @@ public: * @param tile The tile on which the command was executed. * @param p1 p1 as given to DoCommandPInternal. * @param p2 p2 as given to DoCommandPInternal. + * @param cmd cmd as given to DoCommandPInternal. + * @return true if we handled result. */ - void DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2); + bool DoCommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd); /** * Insert an event for this script. diff --git a/src/script/script_storage.hpp b/src/script/script_storage.hpp index ef7d81ed72..d06cc9efa0 100644 --- a/src/script/script_storage.hpp +++ b/src/script/script_storage.hpp @@ -46,6 +46,11 @@ private: uint last_error; ///< The last error of the command. bool last_command_res; ///< The last result of the command. + TileIndex last_tile; ///< The last tile passed to a command. + uint32 last_p1; ///< The last p1 passed to a command. + uint32 last_p2; ///< The last p2 passed to a command. + uint32 last_cmd; ///< The last cmd passed to a command. + VehicleID new_vehicle_id; ///< The ID of the new Vehicle. SignID new_sign_id; ///< The ID of the new Sign. GroupID new_group_id; ///< The ID of the new Group. @@ -73,6 +78,10 @@ public: last_cost (0), last_error (STR_NULL), last_command_res (true), + last_tile (INVALID_TILE), + last_p1 (0), + last_p2 (0), + last_cmd (CMD_END), new_vehicle_id (0), new_sign_id (0), new_group_id (0), diff --git a/src/signs_cmd.cpp b/src/signs_cmd.cpp index 22b781b589..6ae2124d8d 100644 --- a/src/signs_cmd.cpp +++ b/src/signs_cmd.cpp @@ -117,8 +117,9 @@ CommandCost CmdRenameSign(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 * @param tile unused * @param p1 unused * @param p2 unused + * @param cmd unused */ -void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcPlaceSign(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 70c7be1492..f582ab2687 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -40,7 +40,7 @@ #include "safeguards.h" -void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded()) { if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT_OTHER, tile); diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 0436e87e09..e32e967f7a 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -1050,7 +1050,7 @@ void ShowTownDirectory() new TownDirectoryWindow(&_town_directory_desc); } -void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; @@ -1058,7 +1058,7 @@ void CcFoundTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } -void CcFoundRandomTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcFoundRandomTown(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(_new_town_id)->xy); } diff --git a/src/train_gui.cpp b/src/train_gui.cpp index c927d42cee..c0f976d6e1 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -27,8 +27,9 @@ * @param tile The tile the command was executed on. * @param p1 Additional data for the command (for the #CommandProc) * @param p2 Additional data for the command (for the #CommandProc) + * @param cmd Unused. */ -void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 85be7629e4..32eb2cc05d 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2377,7 +2377,7 @@ static const uint32 _vehicle_command_translation_table[][4] = { * @param p1 vehicle ID * @param p2 unused */ -void CcStartStopVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcStartStopVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; @@ -2822,8 +2822,9 @@ void StopGlobalFollowVehicle(const Vehicle *v) * @param tile unused * @param p1 unused * @param p2 unused + * @param cmd unused */ -void CcBuildPrimaryVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) +void CcBuildPrimaryVehicle(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { if (result.Failed()) return; From 0549a81c30be09529ab8a1f9acb4e435100c7c26 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sat, 7 Sep 2019 19:16:31 +0200 Subject: [PATCH 17/29] Fix b3fd7879: Ignore command flags when verifying script commands Multiplayer games has the server add some flags to the cmd value during the handling. These flags should not be included in the verification, mask them out. Without this masking out, scripts tend to die when executing their first command in multiplayer. --- src/script/api/script_object.cpp | 21 +++++++++++++-------- src/script/script_instance.cpp | 5 ++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index ac06c4c2d0..6714782e1a 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -23,6 +23,7 @@ #include "../script_instance.hpp" #include "../script_fatalerror.hpp" #include "script_error.hpp" +#include "../../debug.h" #include "../../safeguards.h" @@ -85,18 +86,22 @@ ScriptObject::ActiveInstance::~ActiveInstance() /* static */ void ScriptObject::SetLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { - GetStorage()->last_tile = tile; - GetStorage()->last_p1 = p1; - GetStorage()->last_p2 = p2; - GetStorage()->last_cmd = cmd; + ScriptStorage *s = GetStorage(); + DEBUG(script, 6, "SetLastCommand company=%02d tile=%06x p1=%08x p2=%08x cmd=%d", s->root_company, tile, p1, p2, cmd); + s->last_tile = tile; + s->last_p1 = p1; + s->last_p2 = p2; + s->last_cmd = cmd & CMD_ID_MASK; } /* static */ bool ScriptObject::CheckLastCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) { - if (GetStorage()->last_tile != tile) return false; - if (GetStorage()->last_p1 != p1) return false; - if (GetStorage()->last_p2 != p2) return false; - if (GetStorage()->last_cmd != cmd) return false; + ScriptStorage *s = GetStorage(); + DEBUG(script, 6, "CheckLastCommand company=%02d tile=%06x p1=%08x p2=%08x cmd=%d", s->root_company, tile, p1, p2, cmd); + if (s->last_tile != tile) return false; + if (s->last_p1 != p1) return false; + if (s->last_p2 != p2) return false; + if (s->last_cmd != (cmd & CMD_ID_MASK)) return false; return true; } diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 64ae51cf36..3468bff446 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -684,7 +684,10 @@ bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile { ScriptObject::ActiveInstance active(this); - if (!ScriptObject::CheckLastCommand(tile, p1, p2, cmd)) return false; + if (!ScriptObject::CheckLastCommand(tile, p1, p2, cmd)) { + DEBUG(script, 1, "DoCommandCallback terminating a script, last command does not match expected command"); + return false; + } ScriptObject::SetLastCommandRes(result.Succeeded()); From 901463386671defe899505f4dd593d1de4b90a5c Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 4 Sep 2019 21:11:30 +0100 Subject: [PATCH 18/29] Fix: change Quartz driver colorSpace handling to address certain macOS performance issues (#7644) --- src/video/cocoa/wnd_quartz.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm index 4245a3c183..bd5d8bdaa0 100644 --- a/src/video/cocoa/wnd_quartz.mm +++ b/src/video/cocoa/wnd_quartz.mm @@ -113,7 +113,7 @@ static CGColorSpaceRef QZ_GetCorrectColorSpace() if (colorSpace == NULL) { #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) if (MacOSVersionIsAtLeast(10, 5, 0)) { - colorSpace = CGDisplayCopyColorSpace(CGMainDisplayID()); + colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); } else #endif { @@ -289,7 +289,9 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp) styleMask:style backing:NSBackingStoreBuffered defer:NO ]; - + if ([ this->window respondsToSelector:@selector(setColorSpace:) ]) { + [ this->window setColorSpace:[ [ [ NSColorSpace alloc ] initWithCGColorSpace:QZ_GetCorrectColorSpace() ] autorelease ] ]; + } if (this->window == nil) { DEBUG(driver, 0, "Could not create the Cocoa window."); this->setup = false; From e4414471dd10c3afebc49f3cc7c51f76852b08e0 Mon Sep 17 00:00:00 2001 From: Max Maton Date: Tue, 3 Sep 2019 22:50:58 +0200 Subject: [PATCH 19/29] Add: Allow GameScript to demolish without a company This allows GameScripts to shrink towns as well as grow them. --- src/command.cpp | 2 +- src/script/api/ai_changelog.hpp | 3 +++ src/script/api/script_tile.cpp | 1 - src/script/api/script_tile.hpp | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 2a0e264736..c4d3fa7ce1 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -216,7 +216,7 @@ static const Command _command_proc_table[] = { DEF_CMD(CmdRemoveRailroadTrack, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_RAILROAD_TRACK DEF_CMD(CmdBuildSingleRail, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_SINGLE_RAIL DEF_CMD(CmdRemoveSingleRail, CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_REMOVE_SINGLE_RAIL - DEF_CMD(CmdLandscapeClear, 0, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_LANDSCAPE_CLEAR + DEF_CMD(CmdLandscapeClear, CMD_DEITY, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_LANDSCAPE_CLEAR DEF_CMD(CmdBuildBridge, CMD_DEITY | CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_BRIDGE DEF_CMD(CmdBuildRailStation, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_RAIL_STATION DEF_CMD(CmdBuildTrainDepot, CMD_NO_WATER | CMD_AUTO, CMDT_LANDSCAPE_CONSTRUCTION), // CMD_BUILD_TRAIN_DEPOT diff --git a/src/script/api/ai_changelog.hpp b/src/script/api/ai_changelog.hpp index 5aacf8e8c8..7258cf74e5 100644 --- a/src/script/api/ai_changelog.hpp +++ b/src/script/api/ai_changelog.hpp @@ -35,6 +35,9 @@ * \li AIEngine::HasPowerOnRoad * \li AIRoadTypeList::RoadTypeList * + * Other changes: + * \li AITile::DemolishTile works without a selected company + * * \b 1.9.0 * * API additions: diff --git a/src/script/api/script_tile.cpp b/src/script/api/script_tile.cpp index 3d10b7d515..0f62406668 100644 --- a/src/script/api/script_tile.cpp +++ b/src/script/api/script_tile.cpp @@ -262,7 +262,6 @@ /* static */ bool ScriptTile::DemolishTile(TileIndex tile) { - EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); diff --git a/src/script/api/script_tile.hpp b/src/script/api/script_tile.hpp index f4a2f0970e..2aa23bf24d 100644 --- a/src/script/api/script_tile.hpp +++ b/src/script/api/script_tile.hpp @@ -445,7 +445,6 @@ public: * Destroy everything on the given tile. * @param tile The tile to demolish. * @pre ScriptMap::IsValidTile(tile). - * @game @pre Valid ScriptCompanyMode active in scope. * @exception ScriptError::ERR_AREA_NOT_CLEAR * @return True if and only if the tile was demolished. */ From 7bdde8b41d348b0df9e3d29c511cb1181823ebc6 Mon Sep 17 00:00:00 2001 From: Juriy Petrochenkov Date: Sat, 7 Sep 2019 13:43:50 +0300 Subject: [PATCH 20/29] Fix: Use natural sort when sorting the file list. --- src/fios.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fios.cpp b/src/fios.cpp index 30a505ef7e..9153c53f17 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -57,7 +57,7 @@ bool FiosItem::operator< (const FiosItem &other) const if ((_savegame_sort_order & SORT_BY_NAME) == 0 && (*this).mtime != other.mtime) { r = (*this).mtime - other.mtime; } else { - r = strcasecmp((*this).title, other.title); + r = strnatcmp((*this).title, other.title); } if (r == 0) return false; return (_savegame_sort_order & SORT_DESCENDING) ? r > 0 : r < 0; From b30994168d651c63b951c9e33342c7f29adf5335 Mon Sep 17 00:00:00 2001 From: translators Date: Tue, 10 Sep 2019 19:45:38 +0200 Subject: [PATCH 21/29] Update: Translations from eints korean: 34 changes by telk5093 --- src/lang/korean.txt | 66 +++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index c91b052cff..8b2ee36588 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -1032,26 +1032,26 @@ STR_ERROR_FULLSCREEN_FAILED :{WHITE}전체 STR_CURRENCY_WINDOW :{WHITE}사용자 화폐 단위 STR_CURRENCY_EXCHANGE_RATE :{LTBLUE}환율: {ORANGE}{CURRENCY_LONG} = {COMMA}파운드 -STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}(1 파운드(£)에 대한) 사용자 화폐 단위양을 감소시킵니다. -STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}(1 파운드(£)에 대한) 사용자 화폐 단위양을 증가시킵니다. -STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP :{BLACK}1 파운드(£)에 해당하는 사용자 화폐 단위의 환율을 설정하십시오. +STR_CURRENCY_DECREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}(1 파운드(£)에 대한) 사용자 화폐 단위 양을 감소시킵니다 +STR_CURRENCY_INCREASE_EXCHANGE_RATE_TOOLTIP :{BLACK}(1 파운드(£)에 대한) 사용자 화폐 단위 양을 증가시킵니다 +STR_CURRENCY_SET_EXCHANGE_RATE_TOOLTIP :{BLACK}1 파운드(£)에 해당하는 사용자 화폐 단위의 환율을 설정하십시오 STR_CURRENCY_SEPARATOR :{LTBLUE}단위 구분: {ORANGE}{STRING} -STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP :{BLACK}사용자 화폐 단위의 단위 구분자를 설정하십시오. +STR_CURRENCY_SET_CUSTOM_CURRENCY_SEPARATOR_TOOLTIP :{BLACK}사용자 화폐 단위의 단위 구분자를 설정하십시오 STR_CURRENCY_PREFIX :{LTBLUE}접두어: {ORANGE}{STRING} -STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP :{BLACK}사용자 화폐 단위 앞에 붙는 문구를 설정하십시오. +STR_CURRENCY_SET_CUSTOM_CURRENCY_PREFIX_TOOLTIP :{BLACK}사용자 화폐 단위 앞에 붙는 문구를 설정하십시오 STR_CURRENCY_SUFFIX :{LTBLUE}접미어: {ORANGE}{STRING} -STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP :{BLACK}사용자 화폐 단위 뒤에 붙는 문구를 설정하십시오. +STR_CURRENCY_SET_CUSTOM_CURRENCY_SUFFIX_TOOLTIP :{BLACK}사용자 화폐 단위 뒤에 붙는 문구를 설정하십시오 STR_CURRENCY_SWITCH_TO_EURO :{LTBLUE}유로화로 전환: {ORANGE}{NUM} STR_CURRENCY_SWITCH_TO_EURO_NEVER :{LTBLUE}유로화로 전환: {ORANGE}전환하지 않음 -STR_CURRENCY_SET_CUSTOM_CURRENCY_TO_EURO_TOOLTIP :{BLACK}유로화(€) 전환 연도를 설정하십시오. +STR_CURRENCY_SET_CUSTOM_CURRENCY_TO_EURO_TOOLTIP :{BLACK}유로화(€) 전환 연도를 설정하십시오 STR_CURRENCY_DECREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP :{BLACK}유로화(€) 전환 연도를 앞으로 당깁니다. -STR_CURRENCY_INCREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP :{BLACK}유로화(€) 전환 연도를 늦춥니다. +STR_CURRENCY_INCREASE_CUSTOM_CURRENCY_TO_EURO_TOOLTIP :{BLACK}유로화(€) 전환 연도를 늦춥니다 STR_CURRENCY_PREVIEW :{LTBLUE}미리보기: {ORANGE}{CURRENCY_LONG} -STR_CURRENCY_CUSTOM_CURRENCY_PREVIEW_TOOLTIP :{BLACK}10000 파운드(£)에 해당하는 사용자 화폐 단위입니다. +STR_CURRENCY_CUSTOM_CURRENCY_PREVIEW_TOOLTIP :{BLACK}10000 파운드(£)에 해당하는 사용자 화폐 단위입니다 STR_CURRENCY_CHANGE_PARAMETER :{BLACK}사용자 화폐 변수 변경 STR_DIFFICULTY_LEVEL_SETTING_MAXIMUM_NO_COMPETITORS :{LTBLUE}최대 경쟁자수: {ORANGE}{COMMA} @@ -1168,7 +1168,7 @@ STR_CONFIG_SETTING_MAXIMUM_INITIAL_LOAN_HELPTEXT :한 회사가 STR_CONFIG_SETTING_INTEREST_RATE :대출 금리: {STRING} STR_CONFIG_SETTING_INTEREST_RATE_HELPTEXT :대출 금리입니다. 인플레이션 설정이 켜져있는 경우 인플레이션의 영향을 받습니다. STR_CONFIG_SETTING_RUNNING_COSTS :유지비: {STRING} -STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :차량과 기반시설의 유지비 수준을 설정하십시오. +STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :차량과 기반시설의 유지비 수준을 설정하십시오 STR_CONFIG_SETTING_CONSTRUCTION_SPEED :건설 속도: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :인공지능의 건설 행동량을 제한하여 건설 속도를 조절할 수 있습니다. STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :차량 고장 빈도수: {STRING} @@ -1327,8 +1327,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :지형 종류: STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(천지창조 전용) 지형의 언덕 모양을 결정합니다. STR_CONFIG_SETTING_INDUSTRY_DENSITY :산업시설 수: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :게임을 플레이하는 동안 얼마나 많은 산업시설이 생성되고 유지되어야 할 지를 설정합니다. -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :정유 공장의 최대 건설 범위: 지도 맨 끝에서부터 {STRING} 이내 -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :정유 공장은 지도의 동서남북 끝 경계 근처에만 건설할 수 있습니다. +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :석유 관련 산업 시설의 최대 건설 범위: 지도 맨 끝에서부터 {STRING} 이내 +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :정유 공장과 유전이 맵 가장자리에서 얼마나 멀리 떨어진 곳까지 건설될 수 있는지를 나타냅니다. 섬 맵에서는 이 설정을 이용해서 해당 산업 시설이 해안에 가까이 있도록 조정할 수 있습니다. 256칸보다 큰 맵의 경우에는 이 값은 더 크게 조정됩니다. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :설선 고도: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :아한대 기후의 설선 고도를 조절합니다. 눈은 산업시설의 생성과 도시 성장에 영향을 미칩니다. STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :지형의 거친 정도: {STRING} @@ -1375,7 +1375,7 @@ STR_CONFIG_SETTING_SCROLLMODE_LMB :마우스 왼 STR_CONFIG_SETTING_SMOOTH_SCROLLING :게임 화면을 이동시킬 때 부드럽게 이동: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :소형 지도를 클릭하여 특정 지역으로 스크롤되거나 지도 상의 특정 장소로 이동하는 경우에 주 화면이 어떻게 스크롤 되는지를 설정합니다. 이 설정을 켜면, 화면이 목표 지점까지 부드럽게 이동하고, 설정을 끄면 목표 지점으로 곧바로 넘어가게 됩니다. STR_CONFIG_SETTING_MEASURE_TOOLTIP :건설도구 사용시 거리 도움말 표시: {STRING} -STR_CONFIG_SETTING_MEASURE_TOOLTIP_HELPTEXT :철도/도로 등의 기반시설을 건설할 때 거리와 높이 차이 등을 표시합니다. +STR_CONFIG_SETTING_MEASURE_TOOLTIP_HELPTEXT :철도/도로 등의 기반시설을 건설할 때 거리와 높이 차이 등을 표시합니다 STR_CONFIG_SETTING_LIVERIES :차량 종류에 따라 회사의 색상을 구분하여 표시: {STRING} STR_CONFIG_SETTING_LIVERIES_HELPTEXT :회사 고유 색상을 따르지 않고 차량 종류에 따라 다른 차량 색상을 사용하는 것을 허용합니다. STR_CONFIG_SETTING_LIVERIES_NONE :없음 @@ -2230,18 +2230,18 @@ STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}서버 # Content downloading window STR_CONTENT_TITLE :{WHITE}콘텐츠 다운로드 STR_CONTENT_TYPE_CAPTION :{BLACK}종류 -STR_CONTENT_TYPE_CAPTION_TOOLTIP :{BLACK}콘텐츠의 종류 +STR_CONTENT_TYPE_CAPTION_TOOLTIP :{BLACK}콘텐츠의 종류입니다 STR_CONTENT_NAME_CAPTION :{BLACK}이름 STR_CONTENT_NAME_CAPTION_TOOLTIP :{BLACK}콘텐츠의 이름 STR_CONTENT_MATRIX_TOOLTIP :{BLACK}항목을 클릭하면 자세히 볼 수 있습니다{}다운로드할 항목을 누르세요 STR_CONTENT_SELECT_ALL_CAPTION :{BLACK}모두 선택 STR_CONTENT_SELECT_ALL_CAPTION_TOOLTIP :{BLACK}모든 콘텐츠를 선택합니다 STR_CONTENT_SELECT_UPDATES_CAPTION :{BLACK}업데이트 선택 -STR_CONTENT_SELECT_UPDATES_CAPTION_TOOLTIP :{BLACK}업데이트 항목이 있는 컨텐츠를 선택합니다. +STR_CONTENT_SELECT_UPDATES_CAPTION_TOOLTIP :{BLACK}업데이트 항목이 있는 컨텐츠를 선택합니다 STR_CONTENT_UNSELECT_ALL_CAPTION :{BLACK}모두 선택 해제 STR_CONTENT_UNSELECT_ALL_CAPTION_TOOLTIP :{BLACK}모든 콘텐츠의 선택을 해제합니다. STR_CONTENT_SEARCH_EXTERNAL :{BLACK}외부 사이트에서 검색 -STR_CONTENT_SEARCH_EXTERNAL_TOOLTIP :{BLACK}OpenTTD의 온라인 콘텐츠 서비스에서 다운로드할 수 없는 콘텐츠를 OpenTTD와 관련이 없는 외부 사이트에서 검색합니다. +STR_CONTENT_SEARCH_EXTERNAL_TOOLTIP :{BLACK}OpenTTD의 온라인 콘텐츠 서비스에서 다운로드할 수 없는 콘텐츠를 OpenTTD와 관련이 없는 외부 사이트에서 검색합니다 STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER_CAPTION :{WHITE}OpenTTD를 종료하는 중입니다! STR_CONTENT_SEARCH_EXTERNAL_DISCLAIMER :{WHITE}외부 웹사이트에서 콘텐츠를 다운로드할 때에는 그에 대한 약관과 조건이 다양합니다.{}이 콘텐츠를 OpenTTD에 설치하는 방법은 외부 사이트에서 찾아보아야 합니다.{}계속하시겠습니까? STR_CONTENT_FILTER_TITLE :{BLACK}태그/이름 검색: @@ -2390,22 +2390,22 @@ STR_STATION_CLASS_WAYP :경유지 # Signal window STR_BUILD_SIGNAL_CAPTION :{WHITE}신호기 선택 -STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}폐색 신호기 (구식){}가장 기본적인 신호기 형식입니다. 단 한 대의 열차만이 이 폐색 구간을 통과할 수 있습니다. -STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}입구 신호기 (구식){}다음 폐색 구간에 있는 출구 신호기가 하나라도 파란불이면 파란불이 되며, 그렇지 않은 경우에는 빨간불이 됩니다. -STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}출구 신호기 (구식){}일반 신호기와 기능이 똑같지만, 입구 & 복합 신호기와 올바르게 연계되어야 합니다. -STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP :{BLACK}복합 신호기 (구식){}복합 신호기는 입구 신호기와 출구 신호기의 역할을 동시에 합니다. 이 신호기는 사전 신호기의 거대한 "나뭇가지 구조"를 건설할 수 있도록 도와줍니다. -STR_BUILD_SIGNAL_SEMAPHORE_PBS_TOOLTIP :{BLACK}경로 신호기 (구식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 경로 신호기는 반대편에서 통과가 가능합니다. -STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TOOLTIP :{BLACK}단방향 경로 신호기 (구식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 단방향 경로 신호기는 반대편에서 통과가 불가능합니다. -STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP :{BLACK}폐색 신호기 (전자식){}가장 기본적인 신호기 형식입니다. 단 한 대의 열차만이 이 폐색 구간을 통과할 수 있습니다. -STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP :{BLACK}입구 신호기 (전자식){}다음 폐색 구간에 있는 출구 신호기가 하나라도 파란불이면 파란불이 되며, 그렇지 않은 경우에는 빨간불이 됩니다. -STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}출구 신호기 (전자식){}일반 신호기와 기능이 똑같지만, 입구 & 복합 신호기와 올바르게 연계되어야 합니다. -STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}복합 신호기 (전자식){}복합 신호기는 입구 신호기와 출구 신호기의 역할을 동시에 합니다. 이 신호기는 사전 신호기의 거대한 "나뭇가지식 구조"를 건설할 수 있도록 도와줍니다. -STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}경로 신호기 (전자식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 경로 신호기는 반대편에서 통과가 가능합니다. -STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}단방향 경로 신호기 (전자식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 단방향 경로 신호기는 반대편에서 통과가 불가능합니다. +STR_BUILD_SIGNAL_SEMAPHORE_NORM_TOOLTIP :{BLACK}폐색 신호기 (구식){}가장 기본적인 신호기 형식입니다. 단 한 대의 열차만이 이 폐색 구간을 통과할 수 있습니다 +STR_BUILD_SIGNAL_SEMAPHORE_ENTRY_TOOLTIP :{BLACK}입구 신호기 (구식){}다음 폐색 구간에 있는 출구 신호기가 하나라도 파란불이면 파란불이 되며, 그렇지 않은 경우에는 빨간불이 됩니다 +STR_BUILD_SIGNAL_SEMAPHORE_EXIT_TOOLTIP :{BLACK}출구 신호기 (구식){}일반 신호기와 기능이 똑같지만, 입구 & 복합 신호기와 올바르게 연계되어야 합니다 +STR_BUILD_SIGNAL_SEMAPHORE_COMBO_TOOLTIP :{BLACK}복합 신호기 (구식){}복합 신호기는 입구 신호기와 출구 신호기의 역할을 동시에 합니다. 이 신호기는 사전 신호기의 거대한 "나뭇가지 구조"를 건설할 수 있도록 도와줍니다 +STR_BUILD_SIGNAL_SEMAPHORE_PBS_TOOLTIP :{BLACK}경로 신호기 (구식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 경로 신호기는 반대편에서 통과가 가능합니다 +STR_BUILD_SIGNAL_SEMAPHORE_PBS_OWAY_TOOLTIP :{BLACK}단방향 경로 신호기 (구식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 단방향 경로 신호기는 반대편에서 통과가 불가능합니다 +STR_BUILD_SIGNAL_ELECTRIC_NORM_TOOLTIP :{BLACK}폐색 신호기 (전자식){}가장 기본적인 신호기 형식입니다. 단 한 대의 열차만이 이 폐색 구간을 통과할 수 있습니다 +STR_BUILD_SIGNAL_ELECTRIC_ENTRY_TOOLTIP :{BLACK}입구 신호기 (전자식){}다음 폐색 구간에 있는 출구 신호기가 하나라도 파란불이면 파란불이 되며, 그렇지 않은 경우에는 빨간불이 됩니다 +STR_BUILD_SIGNAL_ELECTRIC_EXIT_TOOLTIP :{BLACK}출구 신호기 (전자식){}일반 신호기와 기능이 똑같지만, 입구 & 복합 신호기와 올바르게 연계되어야 합니다 +STR_BUILD_SIGNAL_ELECTRIC_COMBO_TOOLTIP :{BLACK}복합 신호기 (전자식){}복합 신호기는 입구 신호기와 출구 신호기의 역할을 동시에 합니다. 이 신호기는 사전 신호기의 거대한 "나뭇가지식 구조"를 건설할 수 있도록 도와줍니다 +STR_BUILD_SIGNAL_ELECTRIC_PBS_TOOLTIP :{BLACK}경로 신호기 (전자식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 경로 신호기는 반대편에서 통과가 가능합니다 +STR_BUILD_SIGNAL_ELECTRIC_PBS_OWAY_TOOLTIP :{BLACK}단방향 경로 신호기 (전자식){}경로 신호기는 경로가 겹치지 않는 경우에 한 대 이상의 열차가 한 폐색 구간에 동시에 들어갈 수 있게 해줍니다. 단방향 경로 신호기는 반대편에서 통과가 불가능합니다 STR_BUILD_SIGNAL_CONVERT_TOOLTIP :{BLACK}신호기 변환{}이 버튼을 선택한 뒤 이미 설치된 신호기를 클릭하면, 신호기의 종류(일반/입구/출구/복합/경로)와 형식(구식↔전자식)을 변경하고, CTRL+클릭하면 신호기의 형식을 변경합니다. SHIFT+클릭을 사용하면 예상 비용을 볼 수 있습니다 -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}드래그로 신호기를 설치하는 간격 -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}드래그로 신호기를 설치하는 간격 감소 -STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}드래그로 신호기를 설치하는 간격 증가 +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_TOOLTIP :{BLACK}드래그로 설치할 때 신호기 사이의 간격입니다 +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_DECREASE_TOOLTIP :{BLACK}드래그로 설치할 신호기 간격을 줄입니다 +STR_BUILD_SIGNAL_DRAG_SIGNALS_DENSITY_INCREASE_TOOLTIP :{BLACK}드래그로 설치할 신호기 간격을 늘입니다 # Bridge selection window STR_SELECT_RAIL_BRIDGE_CAPTION :{WHITE}철교 선택 @@ -3123,6 +3123,8 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :도시 이름 # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}{TOWN} 지역 당국 +STR_LOCAL_AUTHORITY_ZONE :{BLACK}구역 +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}지역 당국의 범위 안에 있는 구역을 보여줍니다 STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}회사에 대한 이 도시의 평판: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}가능한 행동: @@ -4165,7 +4167,7 @@ STR_AI_LIST_VERSION :{LTBLUE}버전: STR_AI_LIST_URL :{LTBLUE}주소: {ORANGE}{STRING} STR_AI_LIST_ACCEPT :{BLACK}적용 -STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}선택한 스크립트를 적용합니다. +STR_AI_LIST_ACCEPT_TOOLTIP :{BLACK}선택한 스크립트를 적용합니다 STR_AI_LIST_CANCEL :{BLACK}취소 STR_AI_LIST_CANCEL_TOOLTIP :{BLACK}인공지능 스크립트를 바꾸지 않습니다 From f81cb0a90dd0de517be773b2ef2347ba255fc361 Mon Sep 17 00:00:00 2001 From: translators Date: Wed, 11 Sep 2019 19:45:38 +0200 Subject: [PATCH 22/29] Update: Translations from eints korean: 1 change by telk5093 --- src/lang/korean.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/korean.txt b/src/lang/korean.txt index 8b2ee36588..fbf5ac9bbd 100644 --- a/src/lang/korean.txt +++ b/src/lang/korean.txt @@ -4333,7 +4333,7 @@ STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... 이 STR_ERROR_TOO_MANY_INDUSTRIES :{WHITE}... 산업시설이 너무 많습니다 STR_ERROR_CAN_T_GENERATE_INDUSTRIES :{WHITE}산업시설을 생성할 수 없습니다... STR_ERROR_CAN_T_BUILD_HERE :{WHITE}여기에 {STRING}{G 0 "을" "를"} 건설할 수 없습니다... -STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY :{WHITE}여기는 산업시설을 건설할 수 없는 곳입니다... +STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY :{WHITE}여기에 산업시설을 건설할 수 없습니다... STR_ERROR_INDUSTRY_TOO_CLOSE :{WHITE}... 다른 산업시설과 너무 가깝습니다 STR_ERROR_MUST_FOUND_TOWN_FIRST :{WHITE}... 도시를 먼저 만들어야 합니다 STR_ERROR_ONLY_ONE_ALLOWED_PER_TOWN :{WHITE}... 한 도시에 하나만 지을 수 있습니다 From 165eae0e8003662d4311de1e1e748e9ba6805348 Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Wed, 11 Sep 2019 21:57:12 +0100 Subject: [PATCH 23/29] Fix: Avoid using stat to retrieve file modification times on Windows (#7731) --- src/fios.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/fios.cpp b/src/fios.cpp index 9153c53f17..4e614e498b 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -300,13 +300,29 @@ bool FiosFileScanner::AddFile(const char *filename, size_t basepath_length, cons FiosItem *fios = file_list.Append(); #ifdef _WIN32 - struct _stat sb; - if (_tstat(OTTD2FS(filename), &sb) == 0) { + // Retrieve the file modified date using GetFileTime rather than stat to work around an obscure MSVC bug that affects Windows XP + HANDLE fh = CreateFile(OTTD2FS(filename), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr); + + if (fh != INVALID_HANDLE_VALUE) { + FILETIME ft; + ULARGE_INTEGER ft_int64; + + if (GetFileTime(fh, nullptr, nullptr, &ft) != 0) { + ft_int64.HighPart = ft.dwHighDateTime; + ft_int64.LowPart = ft.dwLowDateTime; + + // Convert from hectonanoseconds since 01/01/1601 to seconds since 01/01/1970 + fios->mtime = ft_int64.QuadPart / 10000000ULL - 11644473600ULL; + } else { + fios->mtime = 0; + } + + CloseHandle(fh); #else struct stat sb; if (stat(filename, &sb) == 0) { -#endif fios->mtime = sb.st_mtime; +#endif } else { fios->mtime = 0; } From 2ed88d689894814474385b58595ad041e06aebbf Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 14 Sep 2019 16:52:35 +0200 Subject: [PATCH 24/29] Fix: inconsistent description for 32bpp-sse4-anim blitter (#7740) --- src/blitter/32bpp_anim_sse4.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blitter/32bpp_anim_sse4.hpp b/src/blitter/32bpp_anim_sse4.hpp index 2fefd3001f..1a39a26fb6 100644 --- a/src/blitter/32bpp_anim_sse4.hpp +++ b/src/blitter/32bpp_anim_sse4.hpp @@ -46,7 +46,7 @@ public: /** Factory for the SSE4 32 bpp blitter (with palette animation). */ class FBlitter_32bppSSE4_Anim: public BlitterFactory { public: - FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {} + FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "32bpp SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {} Blitter *CreateInstance() override { return new Blitter_32bppSSE4_Anim(); } }; From 1978b9122bad2cde548846e3e4daadbe517db7a3 Mon Sep 17 00:00:00 2001 From: "Johannes E. Krause" Date: Thu, 12 Sep 2019 21:46:48 +0200 Subject: [PATCH 25/29] Fix #7737, afbf6a5: missing return --- src/news_gui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 34cfa7a589..8f3dfaca29 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -678,6 +678,7 @@ static void MoveToNextNewsItem() ShowNewspaper(ni); break; } + return; } } From d35254139ab6a829e523e76ae902ef8b9ba610f3 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 8 Sep 2019 10:26:09 +0200 Subject: [PATCH 26/29] Fix #7479: Don't close construction windows when changing client name --- src/company_cmd.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index af7913e2cc..f4eb7fb3e1 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -104,15 +104,18 @@ void SetLocalCompany(CompanyID new_company) /* company could also be COMPANY_SPECTATOR or OWNER_NONE */ assert(Company::IsValidID(new_company) || new_company == COMPANY_SPECTATOR || new_company == OWNER_NONE); + /* If actually changing to another company, several windows need closing */ + bool switching_company = _local_company != new_company; + /* Delete the chat window, if you were team chatting. */ - InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company); + if (switching_company) InvalidateWindowData(WC_SEND_NETWORK_MSG, DESTTYPE_TEAM, _local_company); assert(IsLocalCompany()); _current_company = _local_company = new_company; /* Delete any construction windows... */ - DeleteConstructionWindows(); + if (switching_company) DeleteConstructionWindows(); /* ... and redraw the whole screen. */ MarkWholeScreenDirty(); From 994664dec590b7b8f406d3c2ecc153e77630b1db Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 14 Sep 2019 16:31:37 +0200 Subject: [PATCH 27/29] Fix #7644: [OSX] Try to use system colour space to avoid video output performance degradation. --- src/video/cocoa/wnd_quartz.mm | 53 +++++++++++++---------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm index bd5d8bdaa0..4115113cdc 100644 --- a/src/video/cocoa/wnd_quartz.mm +++ b/src/video/cocoa/wnd_quartz.mm @@ -106,35 +106,6 @@ public: }; -static CGColorSpaceRef QZ_GetCorrectColorSpace() -{ - static CGColorSpaceRef colorSpace = NULL; - - if (colorSpace == NULL) { -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) - if (MacOSVersionIsAtLeast(10, 5, 0)) { - colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); - } else -#endif - { -#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) && !defined(HAVE_OSX_1011_SDK) - CMProfileRef sysProfile; - if (CMGetSystemProfile(&sysProfile) == noErr) { - colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysProfile); - CMCloseProfile(sysProfile); - } -#endif - } - - if (colorSpace == NULL) colorSpace = CGColorSpaceCreateDeviceRGB(); - - if (colorSpace == NULL) error("Could not get system colour space. You might need to recalibrate your monitor."); - } - - return colorSpace; -} - - @implementation OTTD_QuartzView - (void)setDriver:(WindowQuartzSubdriver*)drv @@ -289,9 +260,7 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp) styleMask:style backing:NSBackingStoreBuffered defer:NO ]; - if ([ this->window respondsToSelector:@selector(setColorSpace:) ]) { - [ this->window setColorSpace:[ [ [ NSColorSpace alloc ] initWithCGColorSpace:QZ_GetCorrectColorSpace() ] autorelease ] ]; - } + if (this->window == nil) { DEBUG(driver, 0, "Could not create the Cocoa window."); this->setup = false; @@ -598,20 +567,36 @@ bool WindowQuartzSubdriver::WindowResized() this->window_width = (int)newframe.size.width; this->window_height = (int)newframe.size.height; + /* Get screen colour space. */ + CGColorSpaceRef color_space = NULL; + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) + if ([ this->window respondsToSelector:@selector(colorSpace) ]) { + color_space = [ [ this->window colorSpace ] CGColorSpace ]; + CGColorSpaceRetain(color_space); + } +#endif +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + if (color_space == NULL && MacOSVersionIsAtLeast(10, 5, 0)) color_space = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); +#endif + if (color_space == NULL) color_space = CGColorSpaceCreateDeviceRGB(); + if (color_space == NULL) error("Could not get system colour space. You might need to recalibrate your monitor."); + /* Create Core Graphics Context */ free(this->window_buffer); this->window_buffer = (uint32*)malloc(this->window_width * this->window_height * 4); CGContextRelease(this->cgcontext); this->cgcontext = CGBitmapContextCreate( - this->window_buffer, // data + this->window_buffer, // data this->window_width, // width this->window_height, // height 8, // bits per component this->window_width * 4, // bytes per row - QZ_GetCorrectColorSpace(), // color space + color_space, // color space kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host ); + CGColorSpaceRelease(color_space); assert(this->cgcontext != NULL); CGContextSetShouldAntialias(this->cgcontext, FALSE); From ed6a427fcc2da79827fdb63d8a9945fcf2cd643e Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 14 Sep 2019 17:57:26 +0200 Subject: [PATCH 28/29] Change: [OSX] Recreate backing store if the colour profile of the screen (or the screen) the game window is one changes. This will result in changing colours if moving OpenTTD from one screen to another, but should avoid performance problems if the window is moved. --- src/video/cocoa/cocoa_v.h | 1 + src/video/cocoa/cocoa_v.mm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index 2614eef537..dc0bbeecc4 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -271,6 +271,7 @@ uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_i - (BOOL)windowShouldClose:(id)sender; - (void)windowDidEnterFullScreen:(NSNotification *)aNotification; +- (void)windowDidChangeScreenProfile:(NSNotification *)aNotification; @end diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 17bca028ba..afbca6501a 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -1360,6 +1360,11 @@ static const char *Utf8AdvanceByUtf16Units(const char *str, NSUInteger count) [ e release ]; } } +/** The colour profile of the screen the window is on changed. */ +- (void)windowDidChangeScreenProfile:(NSNotification *)aNotification +{ + if (!driver->setup) driver->WindowResized(); +} @end From 1f418555a13b63379e4ce52ec96cbed6e04dca7d Mon Sep 17 00:00:00 2001 From: glx Date: Tue, 17 Sep 2019 02:52:36 +0200 Subject: [PATCH 29/29] Fix #7742, 66dd7c3: widget position can be negative --- src/widget.cpp | 2 +- src/widget_type.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index 71c874a529..f0d53fe6b6 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -2494,7 +2494,7 @@ void NWidgetLeaf::Draw(const Window *w) case WWT_RESIZEBOX: assert(this->widget_data == 0); - DrawResizeBox(r, this->colour, this->pos_x < (uint)(w->width / 2), !!(w->flags & WF_SIZING)); + DrawResizeBox(r, this->colour, this->pos_x < (w->width / 2), !!(w->flags & WF_SIZING)); break; case WWT_CLOSEBOX: diff --git a/src/widget_type.h b/src/widget_type.h index 9d17024886..6372ed799e 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -174,8 +174,8 @@ public: uint current_x; ///< Current horizontal size (after resizing). uint current_y; ///< Current vertical size (after resizing). - uint pos_x; ///< Horizontal position of top-left corner of the widget in the window. - uint pos_y; ///< Vertical position of top-left corner of the widget in the window. + int pos_x; ///< Horizontal position of top-left corner of the widget in the window. + int pos_y; ///< Vertical position of top-left corner of the widget in the window. NWidgetBase *next; ///< Pointer to next widget in container. Managed by parent container widget. NWidgetBase *prev; ///< Pointer to previous widget in container. Managed by parent container widget.