diff --git a/Makefile.in b/Makefile.in index 617178c64d..b44e53e82c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51,7 +51,7 @@ RES := $(shell if [ ! -f $(CONFIG_CACHE_SOURCE_LIST) ] || [ -n "`cmp $(CONFIG_CA all: config.pwd config.cache ifdef DISTCC - @if [ -z "`echo '$(MFLAGS)' | grep '\-j'`" ]; then echo; echo "WARNING: you enabled distcc support, but you don't seem to be using the -jN paramter"; echo; fi + @if [ -z "`echo '$(MFLAGS)' | grep '\-j'`" ]; then echo; echo "WARNING: you enabled distcc support, but you don't seem to be using the -jN parameter"; echo; fi endif @for dir in $(DIRS); do \ $(MAKE) -C $$dir all || exit 1; \ diff --git a/README.md b/README.md index b0dfe3a993..58aaff1bfb 100644 --- a/README.md +++ b/README.md @@ -879,32 +879,20 @@ no graphical user interface; you would be building a dedicated server. The following compilers are known to compile OpenTTD: - Microsoft Visual C++ (MSVC) 2015, 2017 and 2019. -- GNU Compiler Collection (GCC) 3.3 - 4.4, 4.6 - 4.8. - - Versions 4.1 and earlier give bogus warnings about uninitialised variables. - - Versions 4.4, 4.6 give bogus warnings about freeing non-heap objects. - - Versions 4.6 and later give invalid warnings when lto is enabled. -- Intel C++ Compiler (ICC) 12.0. -- Clang/LLVM 2.9 - 3.0 - Version 2.9 gives bogus warnings about code nonconformity. +- GNU Compiler Collection (GCC) 4.8 - 9. +- Clang/LLVM 3.9 - 8 The following compilers are known not to compile OpenTTD: +In general, this is because these old versions do not (fully) support modern +C++11 language features. + - Microsoft Visual C++ (MSVC) 2013 and earlier. - These old versions do not support modern C++ language features. -- GNU Compiler Collection (GCC) 3.2 and earlier. - These old versions fail due to OpenTTD's template usage. -- GNU Compiler Collection (GCC) 4.5. It optimizes enums too aggressively. - See https://github.com/OpenTTD/OpenTTD/issues/5513 and references therein. -- Intel C++ Compiler (ICC) 11.1 and earlier. - - Version 10.0 and earlier fail a configure check and fail with recent - system headers. - - Version 10.1 fails to compile station_gui.cpp. - - Version 11.1 fails with an internal error when compiling network.cpp. -- Clang/LLVM 2.8 and earlier. -- (Open) Watcom. - -If any of these compilers can compile OpenTTD again, please let us know. -Patches to support more compilers are welcome. +- GNU Compiler Collection (GCC) 4.7 and earlier. +- Clang/LLVM 3.8 and earlier. + +If any of these, or any other, compilers can compile OpenTTD, let us know. +Pull requests to support more compilers are welcome. ### 7.3) Compilation of base sets diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index bf2fb72324..43448f345c 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -41,8 +41,8 @@ jobs: matrix: commit-checker: Tag: 'commit-checker' - linux-amd64-clang-3.8: - Tag: 'linux-amd64-clang-3.8' + linux-amd64-clang-3.9: + Tag: 'linux-amd64-clang-3.9' linux-amd64-gcc-6: Tag: 'linux-amd64-gcc-6' linux-i386-gcc-6: diff --git a/bin/ai/regression/completeness.sh b/bin/ai/regression/completeness.sh index 9f5e96eb0b..2e42401550 100755 --- a/bin/ai/regression/completeness.sh +++ b/bin/ai/regression/completeness.sh @@ -46,9 +46,9 @@ cat ai/regression/tst_*/main.nut | tr ';' '\n' | awk ' } } } - # We want to remove everything before the FIRST occurence of AI. - # If we do not remove any other occurences of AI from the string - # we will remove everything before the LAST occurence of AI, so + # We want to remove everything before the FIRST occurrence of AI. + # If we do not remove any other occurrences of AI from the string + # we will remove everything before the LAST occurrence of AI, so # do some little magic to make it work the way we want. sub("AI", "AXXXXY") gsub("AI", "AXXXXX") diff --git a/changelog.txt b/changelog.txt index b181431ff6..2c0a62b383 100644 --- a/changelog.txt +++ b/changelog.txt @@ -186,7 +186,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Fix: [Win32] Right mouse scrolling didn't work properly with the Windows 10 Fall Creators Update [FS#6629] (r27935) - Fix: Forest, candyfloss forest and battery farm skipped the first animation frame [FS#6639] (r27932) - Fix: Glyphs in range U+0020 to U+00FF may only be defined in orig_extra.grf, not in openttd.grf [FS#6620] (r27915) -- Fix: 'unban' console command was not handling IPv6 adresses properly (r27914, r27913) +- Fix: 'unban' console command was not handling IPv6 addresses properly (r27914, r27913) - Fix: Keep the 'link' between industry chain and smallmap windows whenever possible [FS#6585] (r27905) - Fix: When the last vehicle is removed from a shared orders group, hide the 'Stop sharing' button in the vehicle orders window [FS#6593] (r27904) - Fix: Tooltip of 'increase service interval' said 'decrease' [FS#6606] (r27895) @@ -292,7 +292,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Fix: [Build] Force sorting to be locale independent, so files are always ordered the same and by that token better diff-able (r27562, r27558) - Fix: Typos in comments and string (r27561, r27560) - Fix: [Build] bashism that caused different CFLAGS with bash vs dash (r27557) -- Fix: Use a more appropiate sound effect for convert-rail (r27547) +- Fix: Use a more appropriate sound effect for convert-rail (r27547) - Fix: Remove SetFill from vehicle GUI buttons, so that the viewport is resized instead of them in case of long window titles (r27546) - Fix: [Script] Generation of API wrappers (r27545, r27544, r27543) - Fix: [Windows] ICU got disabled for Windows builds, breaking RTL support [FS#6427] (r27542) @@ -3183,7 +3183,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Fix: Improve corner case order handling: mark order as done only when actually done, obey non-stop orders, do only stop/refit at the depot in the order (r16240, r16228, r16199, r16198, r16187) - Fix: [NoAI] Use the stop/non-stop intermediate orderflags AIs can give for goto-depot orders (r16239) - Fix: [NewGRF] ActionB should use the online parameters from GRFFile instead of the initial user-specified values from GRFConfig. Also use the values as they were set when the ActionB was executed, not as they are set when the message is shown (r16223) -- Fix: Possible crashes when quiting OpenTTD or forcing resizes/redraws of the screen during map generation [FS#2862] (r16220) +- Fix: Possible crashes when quitting OpenTTD or forcing resizes/redraws of the screen during map generation [FS#2862] (r16220) - Fix: Shared orders without orders were not properly converted causing corrupt/invalid orders when loading pre 0.7 savegames [FS#2878] (r16214) - Fix: Hardcoded (old sized) MAX_COMPANIES constant (r16182) - Fix: [Squirrel] The traps variable was not restored, causing try/catch blocks to be 'forgotten' during a suspend (r16181) @@ -3191,7 +3191,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Fix: Forbid joining AI companies via the 'move' and 'join' console commands/multiplayer lobby (r16176, r16175) - Fix: [NoAI] AIOrder::GetOrderDestination and AIOrder::GetOrderFlags did not work on ORDER_CURRENT when the vehicle was loading/leaving in a station (r16165) - Fix: [NoAI] Change WAYPOINT_INVALID to 0xFFFF from -1 as that is the value the AIs got (due to casting) (r16150) -- Fix: The overflowsafe type did not like dividing by int64 larger than MAX_INT32 causing division by negative numbers and small anomolies when drawing graphs [FS#2855] (r16130) +- Fix: The overflowsafe type did not like dividing by int64 larger than MAX_INT32 causing division by negative numbers and small anomalies when drawing graphs [FS#2855] (r16130) - Fix: Road was removed when both the Remove button was active and Ctrl was pressed [FS#2582] (r16119) - Fix: [NoAI] Make sure AIOrder::GetDestination always returns a tile belonging to the station (16109) - Fix: [NoAI] When giving an aircraft a goto-hangar order do not let it be a normal goto-station order (r16108) @@ -3647,7 +3647,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Fix: Inconsistent use of 8/15-bitness of NewGRF callback results with respect to TTDP's implementation of the specification (r12819, r12818, r12759) - Fix: Possible out of bounds array access (r12809) - Fix: Enforce autorenew values range in command (r12808) -- Fix: Vehicles could break down during loading and keep loading. The intention of the break down code is not to break down when having zero speed, therefor break downs now do not happen when loading [FS#1938] (r12795) +- Fix: Vehicles could break down during loading and keep loading. The intention of the break down code is not to break down when having zero speed, therefore break downs now do not happen when loading [FS#1938] (r12795) - Fix: [OSX] In some rare cases when using an uncalibrated monitor the system colour space could not be retrieved. Show an error when this happens instead of just trying an assertion (r12776) - Fix: Slope checking for NewGRFs failed (r12759) - Fix: Check the TILE_NOT_SLOPED flag of the _north_ tile of multi-tile houses to decide if autoslope is allowed (r12717) @@ -3755,7 +3755,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Feature: Separate catenary transparency settings from building transparency settings (r12103) - Feature: Allow locking individual transparency settings so they will not be changed by pressing 'x' (r12102) - Feature: Add some missing VarAction2 variables (r12124) -- Feature: Make snow appear on rail tiles dependant on track height, not on height of the lowest part of the tile (r12098) +- Feature: Make snow appear on rail tiles dependent on track height, not on height of the lowest part of the tile (r12098) - Feature: [NewGRF] Specify the purchase, rail and road description of a bridge (r12069) - Feature: [NewGRF] Add support for var 12, Variational Action 2 (r12045) - Feature: Allow trees on shore (r12029) @@ -4036,7 +4036,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Feature: Add support for variable snow lines in the arctic climate, supplied by NewGRF files (r9371) - Feature: [NewGRF] Add support for newhouses (r9315) - Feature: [NewGRF] Add support for Action 13, which allows you to translate GRF-specific texts. The translations will only be shown if you are using a language with a GRF language id and if a string has not already been set specifically for the language you are using (r9037) -- Feature: Translation dependant formatting of dates (r8906) +- Feature: Translation dependent formatting of dates (r8906) - Feature: If an action 7/9 leads to skipping the rest of the file, disable the NewGRF if an action 8 has not been encountered yet (r8831) - Feature: Stop loading and disable the current NewGRF if a fatal error message in Action B is encountered. Also be more strict on the values accepted (r8830) - Feature: Build aircraft windows will no longer show aircraft that cannot use the airport in question (r8771) @@ -4157,7 +4157,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Fix: Do not display income/expenses when they do not belong to a 'valid' tile, like the money cheat and giving money [FS#1175] (r11021) - Fix: One could not give money when (s)he had too much money [FS#1174] (r11020) - Fix: Disallow buying/selling shares in your own company or a bankrupt company [FS#1169] (r11018) -- Fix: Crash when quiting the game in one of the end score windows [FS#1218] (r11071) +- Fix: Crash when quitting the game in one of the end score windows [FS#1218] (r11071) 0.5.3-RC3 (2007-08-30) @@ -4289,7 +4289,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe 0.5.1-RC1 (2007-03-20) ------------------------------------------------------------------------ -- Feature: Translation dependant formatting of dates (r8906) +- Feature: Translation dependent formatting of dates (r8906) - Feature: Kick inactive initial network connections after some time [FS#115] (r9038, r9061) - Feature: Add an extra news group for opening and closing of industries (r9097) - Codechange: Disable shares by default and increase the default maximum distance from edge for oil refineries (r9339) @@ -5252,7 +5252,7 @@ Note: OpenTTD was migrated to GitHub for 1.9, so SVN revision and FlySpray numbe - Fix: Wrong pathfinding when northern station tile is missing - Fix: You cannot take ownership of an oilrig by building right next to it - Fix: [Makefile] Fixed issue where sdl-config was needed even on systems without SDL -- Fix: [SDL] Performance fix fo palette animation and mouse jumping +- Fix: [SDL] Performance fix for palette animation and mouse jumping - Fix: [SDL] Same resolution was displayed more than once in game options - Fix: [SDL] Smoother mouse and performance fix, like in the Windows video driver - Fix: Wrong trains you can buy with scenarios [SF#963056] diff --git a/config.lib b/config.lib index 16dfd3d300..f273a7278b 100644 --- a/config.lib +++ b/config.lib @@ -568,8 +568,8 @@ check_params() { # Export some variables to be used by pkg-config # - # PKG_CONFIG_LIBDIR variable musn't be set if we are not willing to - # override the default pkg-config search path, it musn't be an empty + # PKG_CONFIG_LIBDIR variable mustn't be set if we are not willing to + # override the default pkg-config search path, it mustn't be an empty # string. If the variable is empty (e.g. when an empty string comes # from config.cache) then unset it. This way the "don't override" state # will be properly preserved when (re)configuring. @@ -781,7 +781,7 @@ check_params() { log 1 "checking GDI video driver... not Windows, skipping" fi - if [ -z "$allegro_config" ] && [ -z "$sdl_config" ] && [ "$with_cocoa" = 0 ] && [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ]; then + if [ -z "$allegro_config" ] && [ -z "$sdl2_config" ] && [ -z "$sdl_config" ] && [ "$with_cocoa" = 0 ] && [ "$os" != "MINGW" ] && [ "$os" != "CYGWIN" ]; then log 1 "configure: error: no video driver development files found" log 1 " If you want a dedicated server use --enable-dedicated as parameter" exit 1 @@ -1437,7 +1437,7 @@ make_compiler_cflags() { if [ $cc_version -ge 402 ]; then # GCC 4.2+ automatically assumes that signed overflows do - # not occur in signed arithmetics, whereas we are not + # not occur in signed arithmetic, whereas we are not # sure that they will not happen. It furthermore complains # about its own optimized code in some places. flags="$flags -fno-strict-overflow" @@ -2032,7 +2032,16 @@ EOL fi fi - if [ -n "$sdl_config" ]; then + if [ -n "$sdl2_config" ]; then + CFLAGS="$CFLAGS -DWITH_SDL2" + # SDL must not add _GNU_SOURCE as it breaks many platforms + CFLAGS="$CFLAGS `$sdl2_config --cflags | sed 's@-D_GNU_SOURCE[^ ]*@@'`" + if [ "$enable_static" != "0" ]; then + LIBS="$LIBS `$sdl2_config --static --libs`" + else + LIBS="$LIBS `$sdl2_config --libs`" + fi + elif [ -n "$sdl_config" ]; then CFLAGS="$CFLAGS -DWITH_SDL" # SDL must not add _GNU_SOURCE as it breaks many platforms CFLAGS="$CFLAGS `$sdl_config --cflags | sed 's@-D_GNU_SOURCE[^ ]*@@'`" @@ -2847,7 +2856,13 @@ detect_sdl() { sleep 5 fi - detect_pkg_config "$with_sdl" "sdl" "sdl_config" "1.2" + if [ $with_sdl = "sdl1" ]; then + detect_pkg_config "2" "sdl" "sdl_config" "1.2" + elif [ $with_sdl = "sdl2" ] || [ -x `which sdl2-config` ]; then + detect_pkg_config "2" "sdl2" "sdl2_config" "2.0" + else + detect_pkg_config "$with_sdl" "sdl" "sdl_config" "1.2" + fi } detect_osx_sdk() { @@ -3558,7 +3573,7 @@ detect_sse_capable_architecture() { else # It was forced, so it should be found. if [ "$with_sse" != "1" ]; then - log 1 "configure: error: SSE couln't be found" + log 1 "configure: error: SSE couldn't be found" log 1 "configure: error: you force enabled SSE, but it seems unavailable" exit 1 fi @@ -3936,7 +3951,7 @@ showhelp() { echo " --with-allegro[=\"pkg-config allegro\"]" echo " enables Allegro video driver support" echo " --with-cocoa enables COCOA video driver (OSX ONLY)" - echo " --with-sdl[=\"pkg-config sdl\"] enables SDL video driver support" + echo " --with-sdl[=\"sdl1|sdl2\"] enables SDL video driver support" echo " --with-zlib[=\"pkg-config zlib\"]" echo " enables zlib support" echo " --with-liblzma[=\"pkg-config liblzma\"]" diff --git a/configure b/configure index c5247f969f..33b5e9766a 100755 --- a/configure +++ b/configure @@ -110,6 +110,7 @@ AWKCOMMAND=' if ($0 == "ALLEGRO" && "'$allegro_config'" == "") { next; } if ($0 == "SDL" && "'$sdl_config'" == "") { next; } + if ($0 == "SDL2" && "'$sdl2_config'" == "") { next; } if ($0 == "PNG" && "'$png_config'" == "") { next; } if ($0 == "OSX" && "'$os'" != "OSX") { next; } if ($0 == "OS2" && "'$os'" != "OS2") { next; } diff --git a/docs/Readme_Windows_MSVC.md b/docs/Readme_Windows_MSVC.md index 247ad74e7e..4c69cdfe7d 100644 --- a/docs/Readme_Windows_MSVC.md +++ b/docs/Readme_Windows_MSVC.md @@ -26,7 +26,7 @@ Install the SDK by following the instructions as given. Dependencies for OpenTTD on Windows are handled via [vcpkg](https://github.com/Microsoft/vcpkg/). First you need to install vcpkg -by following the `Quick Start` intructions of their +by following the `Quick Start` instructions of their [README](https://github.com/Microsoft/vcpkg/blob/master/README.md). After this, you can install the dependencies OpenTTD needs. We advise to use diff --git a/docs/desync.txt b/docs/desync.txt index b0b6bd7d47..2049853a3d 100644 --- a/docs/desync.txt +++ b/docs/desync.txt @@ -30,7 +30,7 @@ Table of contents in the same way, and trees always grow the same. In OpenTTD multiplayer synchronisation works by creating a savegame - when clients join, and then transfering that savegame to the client, + when clients join, and then transferring that savegame to the client, so it has the complete gamestate at a fixed point in time. Afterwards clients only receive 'commands', that is: Stuff which is @@ -81,7 +81,7 @@ Table of contents that a vehicle picks the left line instead of the right line at a junction on one client. - The important thing here is, that noone notices when a Desync + The important thing here is, that no one notices when a Desync occurs. The desync client will continue to simulate the gamestate and execute commands from the server. Once the gamestate differs it will increasingly spiral out of control: If a vehicle picks a @@ -108,7 +108,7 @@ Table of contents indication on when the Desync happened. The Desync may after all have occurred long ago, and just did not affect the checksum up to now. The checksum may have matched 10 times or more - since the Desync happend, and only now the Desync has spiraled + since the Desync happened, and only now the Desync has spiraled enough to finally affect the checksum. (There was once a desync which was only noticed by the checksum after 20 game years.) @@ -140,7 +140,7 @@ Table of contents 2.1) Cache debugging ---- --------------- - Desyncs which are caused by inproper cache validation can + Desyncs which are caused by improper cache validation can often be found by enabling cache validation: - Start OpenTTD with '-d desync=2'. - This will enable validation of caches every tick. diff --git a/docs/landscape.html b/docs/landscape.html index 8e1306aedf..104b8f3931 100644 --- a/docs/landscape.html +++ b/docs/landscape.html @@ -16,7 +16,7 @@ Landscape grid page.

Nine attributes (counting "type" and - "height") hold the informations about a tile.
+ "height") hold the information about a tile.
These attributes are referred to as "type", "height", @@ -61,7 +61,7 @@ Bits 1..0: - + @@ -774,7 +774,7 @@ - Newhouses is the name englobing a newGRF feature developped by TTDPatch devs (mainly Csaboka).
+ Newhouses is the name englobing a newGRF feature developed by TTDPatch devs (mainly Csaboka).
It allows the replacement of the properties as well as the graphics of houses in the game.
To distinguish between the standard behaviour and the newGRF one, HouseID (m4 + m3[6]) is tested for anything above 110.
110 is the count of standard houses. So above 110 means there is a new definition of at least one house
diff --git a/known-bugs.txt b/known-bugs.txt index c02897e501..e59e0dcc27 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -220,7 +220,7 @@ Entry- and exit signals are not dragged [#4378]: Station build date is incorrect [#4415]: The tile query tool will show the date of the last (re)construction at the station and not the date of the first construction. This is - due to compatability reasons with NewGRFs and the fact that it is + due to compatibility reasons with NewGRFs and the fact that it is wrong to say that the station is built in a particular year when it was completely destroyed/rebuilt later on. The tile query tool can be fixed by changing the "Build date" text @@ -404,7 +404,7 @@ Some houses and industries are not affected by transparency [#5817]: Involuntary cargo exchange with cargodist via neutral station [#6114]: When two players serve a neutral station at an industry, a cross-company chain for cargo flow can and will be established which can only be - interrupted if one of the players stops competing for the ressources of + interrupted if one of the players stops competing for the resources of that industry. There is an easy fix for this: If you are loading at the shared station make the order "no unload" and if you're unloading make it "no load". Cargodist will then figure out that it should not create diff --git a/media/baseset/orig_win.obm b/media/baseset/orig_win.obm index b5d4b024ed..2171417830 100644 --- a/media/baseset/orig_win.obm +++ b/media/baseset/orig_win.obm @@ -90,7 +90,7 @@ GM_TT19.GM = Funk Central GM_TT20.GM = Jammit GM_TT21.GM = Movin' On -; MIDI timecodes where the playback should attemp to start and stop short. +; MIDI timecodes where the playback should attempt to start and stop short. ; This is to allow fixing undesired silences in original MIDI files. ; However not all music drivers may support this. [timingtrim] diff --git a/os/debian/changelog b/os/debian/changelog index 8c3b0cbf90..cede02cc77 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1033,7 +1033,7 @@ openttd (0.4.0-1) unstable; urgency=low openttd (0.3.6-1) unstable; urgency=low * New upstream release - * Modifed Makefile to install xpm icon and scenarios in /usr/share/games/openttd/ + * Modified Makefile to install xpm icon and scenarios in /usr/share/games/openttd/ * Added openttd.32.xpm, openttd.64.xpm was too big -- Matthijs Kooijman Tue, 25 Jan 2005 19:21:08 +0100 diff --git a/os/debian/control b/os/debian/control index 54e14ce5d4..01b66cc494 100644 --- a/os/debian/control +++ b/os/debian/control @@ -3,7 +3,7 @@ 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, libicu-dev, liblzma-dev, liblzo2-dev +Build-Depends: debhelper (>= 7.0.50), libsdl2-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev, libicu-dev, liblzma-dev, liblzo2-dev Standards-Version: 3.8.4 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/openttd.git Vcs-Git: git://anonscm.debian.org/collab-maint/openttd.git diff --git a/os/rpm/openttd.changes b/os/rpm/openttd.changes index b0a64dfe18..351f260799 100644 --- a/os/rpm/openttd.changes +++ b/os/rpm/openttd.changes @@ -46,7 +46,7 @@ Sat May 1 15:59:32 UTC 2010 - Marcel Gmür Thu Apr 1 08:53:54 UTC 2010 - Marcel Gmür - upstream update 1.0.0 (finally!) - * completely independend game but still working also + * completely independent game but still working also with ttd original gaphics, sounds and music - Add: Recommends openmsx - requires lzo2 @@ -54,7 +54,7 @@ Thu Apr 1 08:53:54 UTC 2010 - Marcel Gmür ------------------------------------------------------------------- Fri Dec 18 2009 Marcel Gmür - 0.7.4 -- support for differen branches +- support for different branches - easy support for dedicated branch - let openttd build system make the dektop file - split the package to data and gui diff --git a/os/rpm/openttd.spec b/os/rpm/openttd.spec index 09d19621fe..c8b51b0af6 100644 --- a/os/rpm/openttd.spec +++ b/os/rpm/openttd.spec @@ -61,7 +61,7 @@ BuildRequires: kernel BuildRequires: pkg-config %endif -# bulding openttd.grf is not required as it is a) part of source and +# building openttd.grf is not required as it is a) part of source and # b) required only, if you want to use the original set %if 0%{?with_grfcodec} BuildRequires: grfcodec @@ -91,7 +91,7 @@ Group: Amusements/Games/Strategy/Other Requires: %{name} Conflicts: %{name}-dedicated -BuildRequires: SDL-devel +BuildRequires: SDL2-devel BuildRequires: fontconfig-devel %if 0%{?rhel_version} != 600 diff --git a/os/windows/installer/install.nsi b/os/windows/installer/install.nsi index a0ca6ee6be..d08f6eb7b2 100644 --- a/os/windows/installer/install.nsi +++ b/os/windows/installer/install.nsi @@ -143,7 +143,7 @@ Section "!OpenTTD" Section1 Push "$INSTDIR\scripts\README.md" Call unix2dos - ; Copy some documention files + ; Copy some documentation files SetOutPath "$INSTDIR\docs\" File ${PATH_ROOT}docs\multiplayer.txt Push "$INSTDIR\docs\multiplayer.txt" diff --git a/source.list b/source.list index feaf7f30bd..cfa8392713 100644 --- a/source.list +++ b/source.list @@ -339,6 +339,7 @@ scope.h screenshot.h sound/sdl_s.h video/sdl_v.h +video/sdl2_v.h schdispatch.h settings_func.h settings_gui.h @@ -1154,6 +1155,9 @@ video/null_v.cpp #if SDL video/sdl_v.cpp #end + #if SDL2 + video/sdl2_v.cpp + #end #if WIN32 video/win32_v.cpp #end @@ -1196,6 +1200,9 @@ sound/null_s.cpp #if SDL sound/sdl_s.cpp #end + #if SDL2 + sound/sdl2_s.cpp + #end #if WIN32 sound/win32_s.cpp #if USE_XAUDIO2 diff --git a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp index ace9d201e9..854d080d2b 100644 --- a/src/3rdparty/squirrel/squirrel/sqcompiler.cpp +++ b/src/3rdparty/squirrel/squirrel/sqcompiler.cpp @@ -142,7 +142,7 @@ public: break; } Lex(); - return ret; + return std::move(ret); } bool IsEndOfStatement() { return ((_lex._prevtoken == '\n') || (_token == SQUIRREL_EOB) || (_token == '}') || (_token == ';')); } void OptionalSemicolon() diff --git a/src/3rdparty/squirrel/squirrel/sqfuncproto.h b/src/3rdparty/squirrel/squirrel/sqfuncproto.h index e58ccd2994..2966d06544 100644 --- a/src/3rdparty/squirrel/squirrel/sqfuncproto.h +++ b/src/3rdparty/squirrel/squirrel/sqfuncproto.h @@ -20,12 +20,6 @@ struct SQOuterVar _src=src; _type=t; } - SQOuterVar(const SQOuterVar &ov) - { - _type=ov._type; - _src=ov._src; - _name=ov._name; - } SQOuterType _type; SQObjectPtr _name; SQObjectPtr _src; @@ -34,13 +28,6 @@ struct SQOuterVar struct SQLocalVarInfo { SQLocalVarInfo():_start_op(0),_end_op(0), _pos(0){} - SQLocalVarInfo(const SQLocalVarInfo &lvi) - { - _name=lvi._name; - _start_op=lvi._start_op; - _end_op=lvi._end_op; - _pos=lvi._pos; - } SQObjectPtr _name; SQUnsignedInteger _start_op; SQUnsignedInteger _end_op; diff --git a/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp b/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp index 5415b566e8..c8548bac36 100644 --- a/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp +++ b/src/3rdparty/squirrel/squirrel/sqfuncstate.cpp @@ -502,14 +502,14 @@ SQObject SQFuncState::CreateString(const SQChar *s,SQInteger len) { SQObjectPtr ns(SQString::Create(_sharedstate,s,len)); _table(_strings)->NewSlot(ns,(SQInteger)1); - return ns; + return std::move(ns); } SQObject SQFuncState::CreateTable() { SQObjectPtr nt(SQTable::Create(_sharedstate,0)); _table(_strings)->NewSlot(nt,(SQInteger)1); - return nt; + return std::move(nt); } SQFunctionProto *SQFuncState::BuildProto() diff --git a/src/3rdparty/squirrel/squirrel/sqvm.h b/src/3rdparty/squirrel/squirrel/sqvm.h index 89a592e136..97557b1332 100644 --- a/src/3rdparty/squirrel/squirrel/sqvm.h +++ b/src/3rdparty/squirrel/squirrel/sqvm.h @@ -12,9 +12,8 @@ void sq_base_register(HSQUIRRELVM v); struct SQExceptionTrap{ - SQExceptionTrap() {} - SQExceptionTrap(SQInteger ss, SQInteger stackbase,SQInstruction *ip, SQInteger ex_target){ _stacksize = ss; _stackbase = stackbase; _ip = ip; _extarget = ex_target;} - SQExceptionTrap(const SQExceptionTrap &et) { (*this) = et; } + SQExceptionTrap(SQInteger ss, SQInteger stackbase,SQInstruction *ip, SQInteger ex_target) + : _stackbase(stackbase), _stacksize(ss), _ip(ip), _extarget(ex_target) {} SQInteger _stackbase; SQInteger _stacksize; SQInstruction *_ip; diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 2ca4b84e16..db9a9bbb29 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1891,7 +1891,7 @@ static bool AirportHasBlock(Aircraft *v, const AirportFTA *current_pos, const Ai * "reserve" a block for the plane * @param v airplane that requires the operation * @param current_pos of the vehicle in the list of blocks - * @param apc airport on which block is requsted to be set + * @param apc airport on which block is requested to be set * @returns true on success. Eg, next block was free and we have occupied it */ static bool AirportSetBlocks(Aircraft *v, const AirportFTA *current_pos, const AirportFTAClass *apc) diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index f687fec99a..cdd067f484 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -598,7 +598,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlag flags, bool wagon if ((flags & DC_EXEC) != 0) TransferCargo(w, new_head, true); /* Sell the vehicle. - * Note: This might temporarly construct new trains, so use DC_AUTOREPLACE to prevent + * Note: This might temporarily construct new trains, so use DC_AUTOREPLACE to prevent * it from failing due to engine limits. */ cost.AddCost(DoCommand(0, w->index, 0, flags | DC_AUTOREPLACE, GetCmdSellVeh(w))); if ((flags & DC_EXEC) != 0) { diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp index aa2242566e..c6476aac4a 100644 --- a/src/blitter/32bpp_anim.cpp +++ b/src/blitter/32bpp_anim.cpp @@ -44,7 +44,7 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel Colour *dst = (Colour *)bp->dst + bp->top * bp->pitch + bp->left; uint16 *anim = this->anim_buf + this->ScreenToAnimOffset((uint32 *)bp->dst) + bp->top * this->anim_buf_pitch + bp->left; - const byte *remap = bp->remap; // store so we don't have to access it via bp everytime + const byte *remap = bp->remap; // store so we don't have to access it via bp every time const int width = bp->width; const int pitch = bp->pitch; const int anim_pitch = this->anim_buf_pitch; diff --git a/src/blitter/32bpp_optimized.cpp b/src/blitter/32bpp_optimized.cpp index ec05a72328..82268fc15f 100644 --- a/src/blitter/32bpp_optimized.cpp +++ b/src/blitter/32bpp_optimized.cpp @@ -48,7 +48,7 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL /* skip lines in dst */ Colour *dst = (Colour *)bp->dst + bp->top * bp->pitch + bp->left; - /* store so we don't have to access it via bp everytime (compiler assumes pointer aliasing) */ + /* store so we don't have to access it via bp every time (compiler assumes pointer aliasing) */ const byte *remap = bp->remap; for (int y = 0; y < bp->height; y++) { @@ -66,7 +66,7 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL /* we will end this line when we reach this point */ Colour *dst_end = dst + bp->skip_left; - /* number of pixels with the same aplha channel class */ + /* number of pixels with the same alpha channel class */ uint n; while (dst < dst_end) { diff --git a/src/bmp.h b/src/bmp.h index cf2b538f39..adfbfa5fef 100644 --- a/src/bmp.h +++ b/src/bmp.h @@ -15,7 +15,7 @@ #include "gfx_type.h" struct BmpInfo { - uint32 offset; ///< offset of bitmap data from .bmp file begining + uint32 offset; ///< offset of bitmap data from .bmp file beginning uint32 width; ///< bitmap width uint32 height; ///< bitmap height bool os2_bmp; ///< true if OS/2 1.x or windows 2.x bitmap diff --git a/src/cargoaction.cpp b/src/cargoaction.cpp index fe2c6acc92..a85beffc40 100644 --- a/src/cargoaction.cpp +++ b/src/cargoaction.cpp @@ -162,7 +162,7 @@ bool CargoReturn::operator()(CargoPacket *cp) /** * Transfers some cargo from a vehicle to a station. - * @param cp Packet to be transfered. + * @param cp Packet to be transferred. * @return True if the packet was completely reserved, false if part of it was. */ bool CargoTransfer::operator()(CargoPacket *cp) diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index e0f9fea9af..5a2daae085 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -576,7 +576,7 @@ void VehicleCargoList::AgeCargo() } /** - * Sets loaded_at_xy to the current station for all cargo to be transfered. + * Sets loaded_at_xy to the current station for all cargo to be transferred. * This is done when stopping or skipping while the vehicle is unloading. In * that case the vehicle will get part of its transfer credits early and it may * get more transfer credits than it's entitled to. diff --git a/src/cargopacket.h b/src/cargopacket.h index a81aecb4b3..7fa5b6750f 100644 --- a/src/cargopacket.h +++ b/src/cargopacket.h @@ -299,7 +299,7 @@ protected: typedef CargoList Parent; Money feeder_share; ///< Cache for the feeder share. - uint action_counts[NUM_MOVE_TO_ACTION]; ///< Counts of cargo to be transfered, delivered, kept and loaded. + uint action_counts[NUM_MOVE_TO_ACTION]; ///< Counts of cargo to be transferred, delivered, kept and loaded. template void ShiftCargo(Taction action); diff --git a/src/command.cpp b/src/command.cpp index d849e7b2fc..27a379b77d 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -781,7 +781,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac tile, TileX(tile), TileY(tile), p1, p2, scope_dumper().CompanyInfo(_current_company), cmd, GetCommandName(cmd), my_cmd, cmd_text_info_dumper().CommandTextInfo(text, binary_length)); /* Cost estimation is generally only done when the - * local user presses shift while doing somthing. + * local user presses shift while doing something. * However, in case of incoming network commands, * map generation or the pause button we do want * to execute. */ diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index b452c1b639..4628c4c5e2 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -257,7 +257,7 @@ DEF_CONSOLE_CMD(ConResetTile) * Scroll to a tile on the map. * param x tile number or tile x coordinate. * param y optional y coordinate. - * @note When only one argument is given it is intepreted as the tile number. + * @note When only one argument is given it is interpreted as the tile number. * When two arguments are given, they are interpreted as the tile's x * and y coordinates. * @return True when either console help was shown or a proper amount of parameters given. diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 1f530d3395..5826b4a61b 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -281,7 +281,7 @@ struct IConsoleWindow : Window case WKC_RETURN: case WKC_NUM_ENTER: { /* We always want the ] at the left side; we always force these strings to be left - * aligned anyway. So enforce this in all cases by addding a left-to-right marker, + * aligned anyway. So enforce this in all cases by adding a left-to-right marker, * otherwise it will be drawn at the wrong side with right-to-left texts. */ IConsolePrintF(CC_COMMAND, LRM "] %s", _iconsole_cmdline.buf); const char *cmd = IConsoleHistoryAdd(_iconsole_cmdline.buf); diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 98db1ba40c..76db91218e 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -7,7 +7,7 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file pool_type.hpp Defintion of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle, Town, and other indexed items. */ +/** @file pool_type.hpp Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle, Town, and other indexed items. */ #ifndef POOL_TYPE_HPP #define POOL_TYPE_HPP diff --git a/src/crashlog.cpp b/src/crashlog.cpp index 02d349f5d3..666ac818a8 100644 --- a/src/crashlog.cpp +++ b/src/crashlog.cpp @@ -65,9 +65,9 @@ #ifdef WITH_LZO #include #endif -#ifdef WITH_SDL +#if defined(WITH_SDL) || defined(WITH_SDL2) # include -#endif /* WITH_SDL */ +#endif /* WITH_SDL || WITH_SDL2 */ #ifdef WITH_ZLIB # include #endif @@ -304,9 +304,13 @@ char *CrashLog::LogLibraries(char *buffer, const char *last) const #endif /* WITH_PNG */ #ifdef WITH_SDL - const SDL_version *v = SDL_Linked_Version(); - buffer += seprintf(buffer, last, " SDL: %d.%d.%d\n", v->major, v->minor, v->patch); -#endif /* WITH_SDL */ + const SDL_version *sdl_v = SDL_Linked_Version(); + buffer += seprintf(buffer, last, " SDL1: %d.%d.%d\n", sdl_v->major, sdl_v->minor, sdl_v->patch); +#elif defined(WITH_SDL2) + SDL_version sdl2_v; + SDL_GetVersion(&sdl2_v); + buffer += seprintf(buffer, last, " SDL2: %d.%d.%d\n", sdl2_v.major, sdl2_v.minor, sdl2_v.patch); +#endif #ifdef WITH_ZLIB buffer += seprintf(buffer, last, " Zlib: %s\n", zlibVersion()); diff --git a/src/debug.h b/src/debug.h index a6e6c4de17..70f0acbe56 100644 --- a/src/debug.h +++ b/src/debug.h @@ -92,7 +92,7 @@ const char *GetDebugString(); * TIC() / TOC() creates its own block, so make sure not the mangle * it with another block. * - * The output is counted in CPU cycles, and not comparable accross + * The output is counted in CPU cycles, and not comparable across * machines. Mainly useful for local optimisations. **/ #define TIC() {\ diff --git a/src/depend/depend.cpp b/src/depend/depend.cpp index 5f95ffc426..9321e573b5 100644 --- a/src/depend/depend.cpp +++ b/src/depend/depend.cpp @@ -292,7 +292,7 @@ public: } /** - * Read the currenty processed string. + * Read the currently processed string. * @return the string, can be nullptr. */ const char *GetString() const diff --git a/src/economy.cpp b/src/economy.cpp index 5635578003..c7b158bc9c 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1916,7 +1916,7 @@ static void LoadUnloadVehicle(Vehicle *front) dirty_station = true; if (!ge->HasRating()) { - /* Upon transfering cargo, make sure the station has a rating. Fake a pickup for the + /* Upon transferring cargo, make sure the station has a rating. Fake a pickup for the * first unload to prevent the cargo from quickly decaying after the initial drop. */ ge->time_since_pickup = 0; SetBit(ge->status, GoodsEntry::GES_RATING); diff --git a/src/error_gui.cpp b/src/error_gui.cpp index ea4dfcf591..0da3d24f41 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -72,9 +72,11 @@ static WindowDesc _errmsg_face_desc( * Copy the given data into our instance. * @param data The data to copy. */ -ErrorMessageData::ErrorMessageData(const ErrorMessageData &data) +ErrorMessageData::ErrorMessageData(const ErrorMessageData &data) : + duration(data.duration), textref_stack_grffile(data.textref_stack_grffile), textref_stack_size(data.textref_stack_size), + summary_msg(data.summary_msg), detailed_msg(data.detailed_msg), position(data.position), face(data.face) { - *this = data; + memcpy(this->textref_stack, data.textref_stack, sizeof(this->textref_stack)); for (size_t i = 0; i < lengthof(this->strings); i++) { if (this->strings[i] != nullptr) { this->strings[i] = stredup(this->strings[i]); diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 64ab96cf61..60bbd72152 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -986,7 +986,7 @@ static void LoadWin32Font(FontSize fs) if (AddFontResourceEx(fontPath, FR_PRIVATE, 0) != 0) { /* Try a nice little undocumented function first for getting the internal font name. - * Some documentation is fount at: http://www.undocprint.org/winspool/getfontresourceinfo */ + * Some documentation is found at: http://www.undocprint.org/winspool/getfontresourceinfo */ typedef BOOL(WINAPI * PFNGETFONTRESOURCEINFO)(LPCTSTR, LPDWORD, LPVOID, DWORD); #ifdef UNICODE static PFNGETFONTRESOURCEINFO GetFontResourceInfo = (PFNGETFONTRESOURCEINFO)GetProcAddress(GetModuleHandle(_T("Gdi32")), "GetFontResourceInfoW"); diff --git a/src/fontdetection.cpp b/src/fontdetection.cpp index 7b2a6756ca..75806c8fe8 100644 --- a/src/fontdetection.cpp +++ b/src/fontdetection.cpp @@ -399,7 +399,7 @@ FT_Error GetFontByFaceName(const char *font_name, FT_Face *face) #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) if (MacOSVersionIsAtLeast(10, 6, 0)) { /* Simply creating the font using CTFontCreateWithNameAndSize will *always* return - * something, no matter the name. As such, we can't use it to check for existance. + * something, no matter the name. As such, we can't use it to check for existence. * We instead query the list of all font descriptors that match the given name which * does not do this stupid name fallback. */ CTFontDescriptorRef name_desc = CTFontDescriptorCreateWithNameAndSize(name, 0.0); diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 10014b4f41..5c54eed5b1 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -918,7 +918,7 @@ struct FrametimeGraphWindow : Window { } } } - /* Draw divison lines and labels for the horizontal axis */ + /* Draw division lines and labels for the horizontal axis */ for (uint division = horz_divisions; division > 0; division--) { int x = Scinterlate(x_zero, x_max, 0, (int)horz_divisions, (int)horz_divisions - (int)division); GfxDrawLine(x, y_max, x, y_zero, c_grid); diff --git a/src/gfx.cpp b/src/gfx.cpp index 8cdfaba8df..855cc94c8d 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -214,7 +214,7 @@ static inline void GfxDoDrawLine(void *video, int x, int y, int x2, int y2, int * work the blitter has to do by shortening the effective line segment. * However, in order to get that right and prevent the flickering effects * of rounding errors so much additional code has to be run here that in - * the general case the effect is not noticable. */ + * the general case the effect is not noticeable. */ blitter->DrawLine(video, x, y, x2, y2, screen_width, screen_height, colour, width, dash); } @@ -1674,7 +1674,7 @@ bool CursorVars::UpdateCursorPosition(int x, int y, bool queued_warp) if (this->delta.x != 0 || this->delta.y != 0) { /* Trigger warp. * Note: We also trigger warping again, if there is already a pending warp. - * This makes it more tolerant about the OS or other software inbetween + * This makes it more tolerant about the OS or other software in between * botchering the warp. */ this->queued_warp = queued_warp; need_warp = true; diff --git a/src/gfx_func.h b/src/gfx_func.h index 4e12a4d946..5e290c2634 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -31,7 +31,7 @@ * VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some * later point (which is uninteresting, too) the video driver * repaints all these saved rectangle instead of the whole screen and drop the - * rectangle informations. Then a new round begins by marking objects "dirty". + * rectangle information. Then a new round begins by marking objects "dirty". * * @see VideoDriver::MakeDirty * @see _invalid_rect diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 4f8b3b621f..502eccbbc3 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -512,7 +512,7 @@ std::unique_ptr FallbackParagraphLayout::NextLine /* Only a newline. */ this->buffer = nullptr; l->emplace_back(this->runs.front().second, this->buffer, 0, 0); - return std::move(l); // Not supposed to be needed, but clang-3.8 barfs otherwise. + return l; } int offset = this->buffer - this->buffer_begin; @@ -562,7 +562,7 @@ std::unique_ptr FallbackParagraphLayout::NextLine /* The character is wider than allowed width; don't know * what to do with this case... bail out! */ this->buffer = nullptr; - return std::move(l); // Not supposed to be needed, but clang-3.8 barfs otherwise. + return l; } if (last_space == nullptr) { @@ -589,7 +589,7 @@ std::unique_ptr FallbackParagraphLayout::NextLine int w = l->GetWidth(); l->emplace_back(iter->second, begin, last_char - begin, w); } - return std::move(l); // Not supposed to be needed, but clang-3.8 barfs otherwise. + return l; } /** diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index b707974c4e..0d09ba43b1 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -140,7 +140,7 @@ int GroundVehicle::GetAcceleration() /* Power is stored in HP, we need it in watts. * Each vehicle can have U16 power, 128 vehicles, HP -> watt - * and km/h to m/s conversion below result in a maxium of + * and km/h to m/s conversion below result in a maximum of * about 1.1E11, way more than 4.3E9 of int32. */ int64 power = this->gcache.cached_power * 746ll; diff --git a/src/landscape.cpp b/src/landscape.cpp index b816ada263..ee6d88b10c 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -356,8 +356,8 @@ int GetSlopePixelZ(int x, int y) * Return world \c z coordinate of a given point of a tile, * also for tiles outside the map (virtual "black" tiles). * - * @param x World X coordinate in tile "units", may be ouside the map. - * @param y World Y coordinate in tile "units", may be ouside the map. + * @param x World X coordinate in tile "units", may be outside the map. + * @param y World Y coordinate in tile "units", may be outside the map. * @return World Z coordinate at tile ground level, including slopes and foundations. */ int GetSlopePixelZOutsideMap(int x, int y) diff --git a/src/lang/czech.txt b/src/lang/czech.txt index c40375fb7f..298006f66a 100644 --- a/src/lang/czech.txt +++ b/src/lang/czech.txt @@ -265,6 +265,7 @@ STR_COLOUR_BROWN :Hnědá STR_COLOUR_GREY :Šedá STR_COLOUR_WHITE :Bílá STR_COLOUR_RANDOM :Náhodná +STR_COLOUR_DEFAULT :Výchozí # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}m{P íle íle il}/h @@ -312,6 +313,7 @@ STR_BUTTON_SORT_BY :{BLACK}Řadit p STR_BUTTON_LOCATION :{BLACK}Umístění STR_BUTTON_RENAME :{BLACK}Přejmenovat STR_BUTTON_CATCHMENT :{BLACK}Pokrytí +STR_TOOLTIP_CATCHMENT :{BLACK}Zapnout/vypnout zvýrazňování oblasti pokrytí STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Zavřít okno STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Titulek okna - tahej pro posun okna @@ -340,6 +342,7 @@ STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT_TOOLTIP :{BLACK}Zapnutí STR_BUTTON_DEFAULT :{BLACK}Původní STR_BUTTON_CANCEL :{BLACK}Zrušit STR_BUTTON_OK :{BLACK}OK +STR_WARNING_PASSWORD_SECURITY :{YELLOW}Upozornění: Administrátor serveru může zjistit a přečíst jakýkoliv text sem vložený. # On screen keyboard window STR_OSK_KEYBOARD_LAYOUT :"+ěščřžýáíé=-\qwertyuiopú)asdfghjklů' zxcvbnm,./ . @@ -434,6 +437,7 @@ STR_SCENEDIT_TOOLBAR_LANDSCAPE_GENERATION :{BLACK}Generov STR_SCENEDIT_TOOLBAR_TOWN_GENERATION :{BLACK}Generování měst STR_SCENEDIT_TOOLBAR_INDUSTRY_GENERATION :{BLACK}Generování průmyslu STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION :{BLACK}Výstavba silniční sítě +STR_SCENEDIT_TOOLBAR_TRAM_CONSTRUCTION :{BLACK}Výstavba tramvajové tratě STR_SCENEDIT_TOOLBAR_PLANT_TREES :{BLACK}Vysadit stromy. Shift zobrazí odhad ceny STR_SCENEDIT_TOOLBAR_PLACE_SIGN :{BLACK}Umístit popisek STR_SCENEDIT_TOOLBAR_PLACE_OBJECT :{BLACK}Umisťte objekt. Shift zobrazí odhad ceny @@ -763,10 +767,12 @@ STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE :{BLACK}Zapnout/ STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION :{BLACK}Ukaž skladbu ve výběrovém okně # Playlist window +STR_PLAYLIST_MUSIC_SELECTION_SETNAME :{WHITE}Hudební program - '{STRING}' STR_PLAYLIST_TRACK_NAME :{TINY_FONT}{LTBLUE}{ZEROFILL_NUM} "{STRING}" STR_PLAYLIST_TRACK_INDEX :{TINY_FONT}{BLACK}Index skladeb STR_PLAYLIST_PROGRAM :{TINY_FONT}{BLACK}Program - '{STRING}' STR_PLAYLIST_CLEAR :{TINY_FONT}{BLACK}Vymazat +STR_PLAYLIST_CHANGE_SET :{BLACK}Změnit program STR_PLAYLIST_TOOLTIP_CLEAR_CURRENT_PROGRAM_CUSTOM1 :{BLACK}Vyprázdnit současný program (jen u Voleb 1 a 2) STR_PLAYLIST_TOOLTIP_CHANGE_SET :{BLACK}Změnit výběr hudby na jinou nainstalovanou sadu. STR_PLAYLIST_TOOLTIP_CLICK_TO_ADD_TRACK :{BLACK}Skladba se přidá do zvoleného programu (Volba 1 nebo 2) klepnutím na její název @@ -1018,7 +1024,9 @@ STR_GAME_OPTIONS_CURRENCY_CUSTOM :Vlastní... STR_GAME_OPTIONS_CURRENCY_GEL :Georgijské Lari (GEL) STR_GAME_OPTIONS_CURRENCY_IRR :Íránský Riál (IRR) STR_GAME_OPTIONS_CURRENCY_RUB :Ruský rubl (RUB) +STR_GAME_OPTIONS_CURRENCY_MXN :Mexické peso (MXN) STR_GAME_OPTIONS_CURRENCY_NTD :Nový taiwanský dolar (NTD) +STR_GAME_OPTIONS_CURRENCY_CNY :Čínský renminbi (CNY) STR_GAME_OPTIONS_CURRENCY_HKD :Hongkongský dolar (HKD) ############ end of currency region @@ -1076,14 +1084,18 @@ STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Zvolit r STR_GAME_OPTIONS_RESOLUTION_OTHER :jiné STR_GAME_OPTIONS_GUI_ZOOM_FRAME :{BLACK}Velikost rozhraní -STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Zvolil velikost prvků uživatelského rozhraní +STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Zvolit velikost prvků uživatelského rozhraní STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :Normální STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :Dvojnásobná velikost STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :Čtyřnásobná velikost +STR_GAME_OPTIONS_FONT_ZOOM :{BLACK}Velikost písma +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}Zvolit velikost písma STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_NORMAL :Běžné +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_2X_ZOOM :Dvojnásobná velikost +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_4X_ZOOM :Čtyřnásobná velikost STR_GAME_OPTIONS_BASE_GRF :{BLACK}Základní sada grafiky STR_GAME_OPTIONS_BASE_GRF_TOOLTIP :{BLACK}Zvol základní sadu grafiky @@ -1267,6 +1279,7 @@ STR_CONFIG_SETTING_AUTOSLOPE :Povolit srovná STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Povoluje změnu terénu pod budovami a tratěmi bez jejich odstranění STR_CONFIG_SETTING_CATCHMENT :Povolit u oblasti pokrytí realističtější velikost: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Rozdílná velikost oblasti pokrytí u různých stanic a letišť +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Obsluhovat průmysl s vlastní stanicí i prostřednictvím jiných stanic: {STRING} STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Pokud je zapnuto, průmysl s vlastní stanicí (např. ropné plošiny) může být obsluhován i prostřednictvím společnostmi vlastněných stanic v okolí. Pokud je vypnuto, tento průmysl může být obsluhován pouze prostřednictvím vlastní stanice. Společnostmi vlastněné stanice v okolí nebudou moci tento průmysl obsluhovat a vlastní stanice tohoto průmyslu nebude moci obsluhovat žádný jiný průmysl ani domy v okolí. STR_CONFIG_SETTING_EXTRADYNAMITE :Povolit bourání více městských silnic, mostů a tunelů: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Usnadňuje odstranění městských staveb a silnic @@ -1284,8 +1297,8 @@ STR_CONFIG_SETTING_TRAIN_SLOPE_STEEPNESS_HELPTEXT :Strnost svahů STR_CONFIG_SETTING_PERCENTAGE :{COMMA}% STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Strmost svahu pro silniční vozidla: {STRING} STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Vyšší hodnoty ztěžují vozidlům výjezd do kopce -STR_CONFIG_SETTING_FORBID_90_DEG :Zakázat vlakům a lodím otáčení o 90 stupňů: {STRING} -STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :90° zatočení nastane ve chvíli, kdy vodorovná kolej přímo navazuje na svislou kolej na vedlejším políčku. Vlak tak zatáčí o 90° místo klasických 45° u jiných kombinací kolejí. Ovlivní i zatáčení lodí. +STR_CONFIG_SETTING_FORBID_90_DEG :Zakázat vlakům otáčení o 90 stupňů: {STRING} +STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :90° zatočení nastane ve chvíli, kdy vodorovná kolej přímo navazuje na svislou kolej na vedlejším políčku. Vlak tak zatáčí o 90° místo klasických 45° u jiných kombinací kolejí. STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Umožnit spojení nesousedících stanic: {STRING} STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Povolit přidávání částí stanice, které se nedotýkají již existujících částí. Je potřeba stisknout Ctrl při přidávání nových částí. STR_CONFIG_SETTING_INFLATION :Inflace: {STRING} @@ -1341,8 +1354,8 @@ STR_CONFIG_SETTING_PLANE_SPEED :Poměr rychlost STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Nastavit poměr rychlostí letadel ku ostatním dopravním prostředům, pro snížení zisku z nákladu převáženého letadly. STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1 / {COMMA} STR_CONFIG_SETTING_PLANE_CRASHES :Počet leteckých havárií: {STRING} -STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Určuje šanci na havárii letadel -STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Žádný +STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Určuje pravděpodobnost leteckých neštěstí.{}* Při přistávání velkých letadel na malých letištích hrozí zvýšené nebezpeší havárie vždy. +STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Žádná* STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :Redukovaný STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :Obvyklý STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :Stavba průjezdných zastávek na obecních silnicích: {STRING} @@ -1353,6 +1366,8 @@ STR_CONFIG_SETTING_DYNAMIC_ENGINES_EXISTING_VEHICLES :{WHITE}Toto nas STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE :Udržování infrastruktury: {STRING} STR_CONFIG_SETTING_INFRASTRUCTURE_MAINTENANCE_HELPTEXT :Pokud je zapnuto, je třeba platit za údržbu infrastruktury. Náklady vzrůstají společně s velikostí dopravní sítě, takže velké společnosti platí více než malé. +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR :Počáteční barva společnosti: {STRING} +STR_CONFIG_SETTING_COMPANY_STARTING_COLOUR_HELPTEXT :Vyberte počáteční barvu společnosti STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Žádný druh letiště nezastará: {STRING} STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Povolení této možnosti způsobí, že všechny druhy letišť zůstanou po uvedení dostupné napořád. (nezastarají). @@ -1398,8 +1413,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :Druh terénu: { STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(pouze TerraGenesis) Hornatost terénu STR_CONFIG_SETTING_INDUSTRY_DENSITY :Množství průmyslu: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Nastavuje množství průmyslu, které bude nyní vytvořeno a udržováno v průběhu hry -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximální vzdálenost rafinerie od okraje mapy: {STRING} -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Ropné rafinerie jsou stavěny pouze blízko okrajům mapy. Pokud je mapa ostrov, pak je to pobřeží. +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Maximální vzdálenost ropného průmyslu od okraje mapy: {STRING} +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Omezení, jak daleko od okrajů mapy mohou být postaveny rafinerie a ropné vrty. Je-li při okraji mapy voda, toto omezení zajišťuje, že se rafinerie a ropné vrty vyskytují poblíž pobřeží. Na mapách větších než 256 polí je toto omezení úměrně přizpůsobeno. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Výška sněhové čáry: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Určuje o jaké výšky se vyskytuje sníh u subarktického klimatu. Sníh rovněž ovlivňuje vytváření průmyslu a požadavky na růst měst STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Členitost krajiny: {STRING} @@ -1437,7 +1452,12 @@ STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_HELPTEXT :Barva terénu n STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_GREEN :zelená STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_DARK_GREEN :tmavě zelená STR_CONFIG_SETTING_SMALLMAP_LAND_COLOUR_VIOLET :fialová +STR_CONFIG_SETTING_SCROLLMODE :Reakce pohledů na scrollování: {STRING} +STR_CONFIG_SETTING_SCROLLMODE_HELPTEXT :Reakce na scrollování v mapě +STR_CONFIG_SETTING_SCROLLMODE_DEFAULT :Pohyb v pohledu pomocí pravého tlačítka myši, poloha myši uzamčena STR_CONFIG_SETTING_SCROLLMODE_RMB_LOCKED :Pohyb v mapě pomocí pravého tlačítka myši, poloha myši uzamčena +STR_CONFIG_SETTING_SCROLLMODE_RMB :Pohyb v mapě pomocí pravého tlačítka myši +STR_CONFIG_SETTING_SCROLLMODE_LMB :Pohyb v mapě pomocí levého tlačítka myši STR_CONFIG_SETTING_SMOOTH_SCROLLING :Plynulé posouvání po mapě: {STRING} STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Ovládá jak se hlavní pohled posouvá na specifické místo na mapě, kliknutím na minimapu nebo spuštěním příkazu na posun na specifický objekt na mapě. Pokud zapnuto, pohled se posouvá plynule, pokud vypnuto, skáče pohled přímo na cílové místo STR_CONFIG_SETTING_MEASURE_TOOLTIP :Ukázat rozměry při použití stavebních nástrojů: {STRING} @@ -1558,6 +1578,8 @@ STR_CONFIG_SETTING_AI_IN_MULTIPLAYER :Povolit AI v s STR_CONFIG_SETTING_AI_IN_MULTIPLAYER_HELPTEXT :Umožňuje AI počítačem řízeným hráčům připojit se do hry s více hráči STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES :#opcodes před skripty než budou pozastaveny: {STRING} STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES_HELPTEXT :Maximální počet výpočetních kroků, které může skript vykonat za jeden tah +STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY :Max. využití paměti skriptem: {STRING} +STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_HELPTEXT :Určuje, kolik paměti může každý skript využít. Při překročení bude okamžitě ukončen. Pro větší mapy bude možná třeba tuto hodnotu zvýšit. STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY_VALUE :{COMMA} MiB STR_CONFIG_SETTING_SERVINT_ISPERCENT :Intervaly servisů v procentech: {STRING} @@ -1661,7 +1683,10 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_HELPTEXT :Povoluje hráč STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :Zakázáno STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :Povoleno STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :Povoleno s výběrem rozložení a velikosti města +STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Produkce nákladu městy: {STRING} +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Určuje, kolik nákladu je produkováno domy ve městě relativně k celkovému počtu obyvatel města.{}Kvadratická závislost: Dvakrát větší město produkuje čtyřikrát více cestujících.{}Lineární závislost: Dvakrát větší město produkuje dvakrát více cestujících. STR_CONFIG_SETTING_TOWN_CARGOGENMODE_ORIGINAL :Kvadratický (původní) +STR_CONFIG_SETTING_TOWN_CARGOGENMODE_BITCOUNT :Lineární STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT :Umístění stromů ve hře: {STRING} STR_CONFIG_SETTING_EXTRA_TREE_PLACEMENT_HELPTEXT :Náhodné umisťování stromů během hry. Může ovlivnit průmysl závisející na růstu stromů, například pily. @@ -1903,6 +1928,7 @@ STR_CHEAT_CHANGE_DATE_QUERY_CAPT :{WHITE}Změnit STR_CHEAT_SETUP_PROD :{LTBLUE}Povolit změnu produkce průmyslu: {ORANGE}{STRING} # Livery window +STR_LIVERY_CAPTION :{WHITE}{COMPANY} - barevné schéma STR_LIVERY_GENERAL_TOOLTIP :{BLACK}Zobrazit všeobecná barevná schémata STR_LIVERY_TRAIN_TOOLTIP :{BLACK}Zobrazit barevná schémata pro vlaky @@ -2162,6 +2188,7 @@ STR_NETWORK_CONNECTION_DISCONNECT :{BLACK}Odpojit STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Server je chráněný. Napiš heslo STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Společnost je chráněná. Napiš heslo +STR_NETWORK_COMPANY_LIST_CLIENT_LIST_CAPTION :Seznam klientů # Network company list added strings STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Seznam hráčů @@ -2207,7 +2234,7 @@ STR_NETWORK_CHAT_ALL :[Všichni] {STR STR_NETWORK_CHAT_OSKTITLE :{BLACK}Zadej zprávu # Network messages -STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Žádná síťová zařízení nebyla nalezena (nebo je hra zkompilována bez ENABLE_NETWORK) +STR_NETWORK_ERROR_NOTAVAILABLE :{WHITE}Žádná síťová zařízení nebyla nalezena STR_NETWORK_ERROR_NOSERVER :{WHITE}Nenalezena žádná síťová hra STR_NETWORK_ERROR_NOCONNECTION :{WHITE}Server neodpověděl na požadavek STR_NETWORK_ERROR_NEWGRF_MISMATCH :{WHITE}Nelze se připojit kvůli rozdílným grafikám @@ -2500,7 +2527,10 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}Postavit STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD :{BLACK}Stavět nebo bourat silnici nebo zastávku STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS :{BLACK}Přepínání mezi výstavbou a bouráním tramvajové tratě STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD :{BLACK}Změnit nebo vylepšit typ silnice (na tento). Stisknutý Shift pro zobrazení odhadu ceny +STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM :{BLACK}Změnit nebo vylepšit druh tramvajové tratě (na tento). Stisknutý Shift pro zobrazení odhadu ceny +STR_ROAD_NAME_ROAD :Silnice +STR_ROAD_NAME_TRAM :Tramvajová trať # Road depot construction window STR_BUILD_DEPOT_ROAD_ORIENTATION_CAPTION :{WHITE}Orientace garáže @@ -2695,6 +2725,7 @@ STR_LANG_AREA_INFORMATION_ROAD_TYPE :{BLACK}Typ siln STR_LANG_AREA_INFORMATION_TRAM_TYPE :{BLACK}Typ tramvaje: {LTBLUE}{STRING} STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Rychlostní omezení tratě: {LTBLUE}{VELOCITY} STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Rychlostní omezení silnice: {LTBLUE}{VELOCITY} +STR_LANG_AREA_INFORMATION_TRAM_SPEED_LIMIT :{BLACK}Omezení rychlosti pro tramvaje: {LTBLUE}{VELOCITY} # Description of land area of different tiles STR_LAI_CLEAR_DESCRIPTION_ROCKS :Kamení @@ -2795,34 +2826,59 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD # Framerate display window STR_FRAMERATE_CAPTION :{WHITE}Počet snímků za sekundu +STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) +STR_FRAMERATE_RATE_GAMELOOP :{BLACK}Rychlost simulace: {STRING} +STR_FRAMERATE_RATE_GAMELOOP_TOOLTIP :{BLACK}Počet kroků hry simulovaných za 1 sekundu. +STR_FRAMERATE_RATE_BLITTER :{BLACK}Počet snímků za sekundu: {STRING} STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}Počet snímků videa vykreslovaných za sekundu. -STR_FRAMERATE_SPEED_FACTOR :{WHITE}Aktuální činitel rychlosti hry: {DECIMAL}x +STR_FRAMERATE_SPEED_FACTOR :{BLACK}Aktuální činitel rychlosti hry: {DECIMAL}x STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}Rychlost, kterou hra právě běží, v porovnání s očekávanou rychlostí při běžné rychlosti simulace. STR_FRAMERATE_CURRENT :{WHITE}Aktuální STR_FRAMERATE_AVERAGE :{WHITE}Průměr +STR_FRAMERATE_MEMORYUSE :{WHITE}Paměť STR_FRAMERATE_DATA_POINTS :{BLACK}Podle {COMMA} měření STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms -STR_FRAMERATE_MS_BAD :{RED}{DECIMAL}{WHITE} ms -STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL}{WHITE} sním{P "ek" "ky" "ků"}/s -STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL}{WHITE} sním{P "ek" "ky" "ků"}/s +STR_FRAMERATE_MS_WARN :{YELLOW}{DECIMAL} ms +STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} ms +STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} sním{P "ek" "ky" "ků"}/s +STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} sním{P "ek" "ky" "ků"}/s +STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} sním{P "ek" "ky" "ků"}/s +STR_FRAMERATE_BYTES_GOOD :{LTBLUE}{BYTES} STR_FRAMERATE_BYTES_WARN :{YELLOW}{BYTES} STR_FRAMERATE_BYTES_BAD :{RED}{BYTES} STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms STR_FRAMERATE_GRAPH_SECONDS :{TINY_FONT}{COMMA} s ############ Leave those lines in this order!! -STR_FRAMERATE_GL_ECONOMY :{WHITE} Manipulace s nákladem: +STR_FRAMERATE_GAMELOOP :{BLACK}Herní smyčka celkem: +STR_FRAMERATE_GL_ECONOMY :{BLACK} Manipulace s nákladem: +STR_FRAMERATE_GL_TRAINS :{BLACK} Kroky vlaků: +STR_FRAMERATE_GL_ROADVEHS :{BLACK} Kroky silničních vozidel: +STR_FRAMERATE_GL_SHIPS :{BLACK} Kroky lodí: +STR_FRAMERATE_GL_AIRCRAFT :{BLACK} Kroky letadel: +STR_FRAMERATE_GL_LANDSCAPE :{BLACK} Kroky terénu: STR_FRAMERATE_GL_LINKGRAPH :{BLACK} Zpoždění grafu spojení: -STR_FRAMERATE_DRAWING :{WHITE}Vykreslování grafiky: +STR_FRAMERATE_DRAWING :{BLACK}Vykreslování grafiky: STR_FRAMERATE_DRAWING_VIEWPORTS :{BLACK} Pohledy: STR_FRAMERATE_VIDEO :{BLACK}Video: STR_FRAMERATE_SOUND :{BLACK}Míchání zvuků: +STR_FRAMERATE_ALLSCRIPTS :{BLACK} Skripty/AI celkem: STR_FRAMERATE_GAMESCRIPT :{BLACK} Herní skript: +STR_FRAMERATE_AI :{BLACK} AI {NUM} {STRING} ############ End of leave-in-this-order ############ Leave those lines in this order!! STR_FRAMETIME_CAPTION_GAMELOOP :Herní smyčka STR_FRAMETIME_CAPTION_GL_ECONOMY :Manipulace s nákladem +STR_FRAMETIME_CAPTION_GL_TRAINS :Kroky vlaků +STR_FRAMETIME_CAPTION_GL_ROADVEHS :Kroky silničních vozidel +STR_FRAMETIME_CAPTION_GL_SHIPS :Kroky lodí +STR_FRAMETIME_CAPTION_GL_AIRCRAFT :Kroky letadel +STR_FRAMETIME_CAPTION_GL_LANDSCAPE :Kroky terénu +STR_FRAMETIME_CAPTION_GL_LINKGRAPH :Zpoždění grafu spojení STR_FRAMETIME_CAPTION_DRAWING :Vykreslování grafiky +STR_FRAMETIME_CAPTION_DRAWING_VIEWPORTS :Vykreslování pohledů +STR_FRAMETIME_CAPTION_VIDEO :Video STR_FRAMETIME_CAPTION_SOUND :Míchání zvuků +STR_FRAMETIME_CAPTION_ALLSCRIPTS :Herní skripty/AI celkem STR_FRAMETIME_CAPTION_GAMESCRIPT :Herní skript STR_FRAMETIME_CAPTION_AI :AI {NUM} {STRING} ############ End of leave-in-this-order @@ -2852,6 +2908,7 @@ STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA} STR_SAVELOAD_DETAIL_GRFSTATUS :{SILVER}Grafiky: {WHITE}{STRING} STR_SAVELOAD_FILTER_TITLE :{BLACK}Filtr: STR_SAVELOAD_OVERWRITE_TITLE :{WHITE}Přepsat soubor +STR_SAVELOAD_OVERWRITE_WARNING :{YELLOW}Opravdu chcete přepsat existující soubor? STR_SAVELOAD_OSKTITLE :{BLACK}Zadej jméno pro uloženou hru @@ -2969,6 +3026,10 @@ STR_NEWGRF_SETTINGS_VERSION :{BLACK}Verze: { STR_NEWGRF_SETTINGS_MIN_VERSION :{BLACK}Minimální kompatibilní verze: {SILVER}{NUM} STR_NEWGRF_SETTINGS_MD5SUM :{BLACK}MD5sum: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PALETTE :{BLACK}Paleta: {SILVER}{STRING} +STR_NEWGRF_SETTINGS_PALETTE_DEFAULT :Výchozí (D) +STR_NEWGRF_SETTINGS_PALETTE_DEFAULT_32BPP :32 bpp +STR_NEWGRF_SETTINGS_PALETTE_LEGACY :Originální (W) +STR_NEWGRF_SETTINGS_PALETTE_LEGACY_32BPP :Originální (W) / 32 bpp STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}Parametry: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PARAMETER_NONE :Žádný @@ -3148,6 +3209,8 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Přejmenovat m # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}Místní správa města {TOWN} +STR_LOCAL_AUTHORITY_ZONE :{BLACK}Oblast +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}Zobrazit oblast působnosti místní správy STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Hodnocení společností: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Možné činnosti: @@ -3176,6 +3239,7 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Podplat # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Cíle STR_GOALS_SPECTATOR_CAPTION :{WHITE}Globální cíle +STR_GOALS_SPECTATOR :Globální cíle STR_GOALS_GLOBAL_TITLE :{BLACK}Globální cíle: STR_GOALS_TEXT :{ORANGE}{STRING} STR_GOALS_NONE :{ORANGE}- Žádné - @@ -3430,6 +3494,8 @@ STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Produkce STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Průmysl oznámila blížící se uzavření! STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}Vyžaduje: {YELLOW}{STRING}{STRING} +STR_INDUSTRY_VIEW_PRODUCES_N_CARGO :{BLACK}Produkuje: {YELLOW}{STRING}{STRING} +STR_INDUSTRY_VIEW_CARGO_LIST_EXTENSION :, {STRING}{STRING} STR_INDUSTRY_VIEW_REQUIRES :{BLACK}Vyžaduje: STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING} @@ -3489,6 +3555,7 @@ STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP :{BLACK}Skupiny STR_GROUP_CREATE_TOOLTIP :{BLACK}Kliknutím vytvoříš skupinu STR_GROUP_DELETE_TOOLTIP :{BLACK}Vymazat vybranou skupinu STR_GROUP_RENAME_TOOLTIP :{BLACK}Přejmenovat vybranou skupinu +STR_GROUP_LIVERY_TOOLTIP :{BLACK}Změnit nátěr vozidel vybrané skupiny STR_GROUP_REPLACE_PROTECTION_TOOLTIP :{BLACK}Kliknutím nebude na tuto skupinu mít vliv automatická výměna vozidel STR_QUERY_GROUP_DELETE_CAPTION :{WHITE}Smazat Skupinu @@ -3515,11 +3582,13 @@ STR_BUY_VEHICLE_TRAM_VEHICLE_CAPTION :Nové tramvaje ############ range for vehicle availability starts STR_BUY_VEHICLE_TRAIN_ALL_CAPTION :Nová železniční vozidla +STR_BUY_VEHICLE_ROAD_VEHICLE_ALL_CAPTION :Nová silniční vozidla STR_BUY_VEHICLE_SHIP_CAPTION :Nové lodě STR_BUY_VEHICLE_AIRCRAFT_CAPTION :Nové letadlo ############ range for vehicle availability ends STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}Cena: {GOLD}{CURRENCY_LONG}{BLACK} Hmotnost: {GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}Cena: {GOLD}{CURRENCY_LONG}{BLACK} (Cena přestavby: {GOLD}{CURRENCY_LONG}{BLACK}) Hmotnost: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}Rychlost: {GOLD}{VELOCITY}{BLACK} Výkon: {GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}Rychlost: {GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}Rychlost na moři: {GOLD}{VELOCITY} @@ -3530,6 +3599,7 @@ STR_PURCHASE_INFO_REFITTABLE :(lze přestavě STR_PURCHASE_INFO_DESIGNED_LIFE :{BLACK}Vyvinuto: {GOLD}{NUM}{BLACK} Životnost: {GOLD}{COMMA} {P rok roky let} STR_PURCHASE_INFO_RELIABILITY :{BLACK}Max. spolehlivost: {GOLD}{COMMA}% STR_PURCHASE_INFO_COST :{BLACK}Cena: {GOLD}{CURRENCY_LONG} +STR_PURCHASE_INFO_COST_REFIT :{BLACK}Náklady: {GOLD}{CURRENCY_LONG}{BLACK} (Náklady na přestavbu: {GOLD}{CURRENCY_LONG}{BLACK}) STR_PURCHASE_INFO_WEIGHT_CWEIGHT :{BLACK}Hmotnost: {GOLD}{WEIGHT_SHORT} ({WEIGHT_SHORT}) STR_PURCHASE_INFO_COST_SPEED :{BLACK}Cena: {GOLD}{CURRENCY_LONG}{BLACK} Rychlost: {GOLD}{VELOCITY} STR_PURCHASE_INFO_COST_REFIT_SPEED :{BLACK}Cena: {GOLD}{CURRENCY_LONG}{BLACK} (Cena přestavby: {GOLD}{CURRENCY_LONG}{BLACK}) Rychlost: {GOLD}{VELOCITY} @@ -3537,6 +3607,7 @@ STR_PURCHASE_INFO_AIRCRAFT_CAPACITY :{BLACK}Kapacita STR_PURCHASE_INFO_PWAGPOWER_PWAGWEIGHT :{BLACK}Poháněné vagony: {GOLD}+{POWER}{BLACK} Hmotnost: {GOLD}+{WEIGHT_SHORT} STR_PURCHASE_INFO_REFITTABLE_TO :{BLACK}Refitovatelné na: {GOLD}{STRING} STR_PURCHASE_INFO_ALL_TYPES :Všechny druhy nákladu +STR_PURCHASE_INFO_NONE :Žádné STR_PURCHASE_INFO_ALL_BUT :Všechny kromě {CARGO_LIST} STR_PURCHASE_INFO_MAX_TE :{BLACK}Max. tažná síla: {GOLD}{FORCE} STR_PURCHASE_INFO_AIRCRAFT_RANGE :{BLACK}Dosah: {GOLD}{COMMA} polí @@ -3552,7 +3623,10 @@ STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_BUTTON :{BLACK}Koupit v STR_BUY_VEHICLE_SHIP_BUY_VEHICLE_BUTTON :{BLACK}Koupit loď STR_BUY_VEHICLE_AIRCRAFT_BUY_VEHICLE_BUTTON :{BLACK}Koupit letadlo +STR_BUY_VEHICLE_TRAIN_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Koupit a přestavět vozy STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Koupit a přestavět vozidlo +STR_BUY_VEHICLE_SHIP_BUY_REFIT_VEHICLE_BUTTON :{BLACK}Koupit a přestavět loď +STR_BUY_VEHICLE_AIRCRAFT_BUY_REFIT_VEHICLE_BUTTON :Koupit a přestavět letadlo STR_BUY_VEHICLE_TRAIN_BUY_VEHICLE_TOOLTIP :{BLACK}Kup označený vagon/lokomotivu. Stisknutý Shift pro zobrazení odhadu ceny STR_BUY_VEHICLE_ROAD_VEHICLE_BUY_VEHICLE_TOOLTIP :{BLACK}Koupit označené vozidlo. Stisknutý Shift pro zobrazení odhadu ceny @@ -3727,6 +3801,7 @@ STR_REPLACE_ALL_RAILTYPE :Všechna dráž STR_REPLACE_ALL_ROADTYPE :Všechna silniční vozidla STR_REPLACE_HELP_RAILTYPE :{BLACK}Vyber typ kolejí, pro které chceš měnit lokomotivy +STR_REPLACE_HELP_ROADTYPE :{BLACK}Vyber typ silnice, pro které chceš nahrazovat vozidla STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}Tady je zobrazeno, za jakou lokomotivu se ta v levém seznamu vyměňuje STR_REPLACE_RAIL_VEHICLES :Železniční lokomotivy STR_REPLACE_ELRAIL_VEHICLES :Elektrické lokomotivy @@ -3879,7 +3954,7 @@ STR_REFIT_CAPTION :{WHITE}{VEHICLE STR_REFIT_TITLE :{GOLD}Zvolit druh nákladu: STR_REFIT_NEW_CAPACITY_COST_OF_REFIT :{BLACK}Nová kapacita: {GOLD}{CARGO_LONG}{}{BLACK}Cena přestavby: {RED}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT :{BLACK}Nová kapacita: {GOLD}{CARGO_LONG}{}{BLACK}Příjem za přestavbu: {GREEN}{CURRENCY_LONG} -STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}Nová kapacita: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Cena za předělání: {RED}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}Nová kapacita: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Cena přestavby: {RED}{CURRENCY_LONG} STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT :{BLACK}Nová kapacita: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Výnos z přestavby: {GREEN}{CURRENCY_LONG} STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Vybere vozidla k obnově. Tažení myší vybere více vozidel. Kliknutí na prázdné místo vybere celé vozidlo. Ctrl+Click vybere vozidlo a následující řetěz @@ -3955,6 +4030,7 @@ STR_ORDER_CONDITIONAL_AGE :Stáří vozidl STR_ORDER_CONDITIONAL_REQUIRES_SERVICE :Vyžaduje údržbu STR_ORDER_CONDITIONAL_UNCONDITIONALLY :Vždy STR_ORDER_CONDITIONAL_REMAINING_LIFETIME :Zbývající životnost (v letech) +STR_ORDER_CONDITIONAL_MAX_RELIABILITY :Nejvyšší dosažitelná spolehlivost STR_ORDER_CONDITIONAL_COMPARATOR_TOOLTIP :{BLACK}Jak porovnat vlastnost vozidla se zadanou hodnotou STR_ORDER_CONDITIONAL_COMPARATOR_EQUALS :se rovná @@ -4478,6 +4554,11 @@ STR_ERROR_CAN_T_REMOVE_TRAMWAY_FROM :{WHITE}Odsud ne STR_ERROR_THERE_IS_NO_ROAD :{WHITE}... není zde žádná silnice STR_ERROR_THERE_IS_NO_TRAMWAY :{WHITE}... není zde žádná tramvajová trať STR_ERROR_CAN_T_CONVERT_ROAD :{WHITE}Zde nelze změnit typ silnice... +STR_ERROR_CAN_T_CONVERT_TRAMWAY :{WHITE}Zde nelze změnit druh tramvajové tratě... +STR_ERROR_NO_SUITABLE_ROAD :{WHITE}Neexistuje vhodná silnice +STR_ERROR_NO_SUITABLE_TRAMWAY :{WHITE}Neexistuje vhodná tramvajová trať +STR_ERROR_INCOMPATIBLE_ROAD :{WHITE}... nevhodný druh silnice +STR_ERROR_INCOMPATIBLE_TRAMWAY :{WHITE}... nevhodný typ tramvajové tratě # Waterway construction errors STR_ERROR_CAN_T_BUILD_CANALS :{WHITE}Zde nelze postavit průplav... @@ -4537,6 +4618,7 @@ STR_ERROR_GROUP_CAN_T_CREATE :{WHITE}Nelze vy STR_ERROR_GROUP_CAN_T_DELETE :{WHITE}Nelze vymazat skupinu... STR_ERROR_GROUP_CAN_T_RENAME :{WHITE}Nelze přejmenovat skupinu... STR_ERROR_GROUP_CAN_T_SET_PARENT :{WHITE}Nelze nastavit nadřazenou skupinu +STR_ERROR_GROUP_CAN_T_SET_PARENT_RECURSION :{WHITE}... skupina nemůže patřit do skupiny, která patří pod ní STR_ERROR_GROUP_CAN_T_REMOVE_ALL_VEHICLES :{WHITE}Nelze odstranit všechna vozidla ze skupiny... STR_ERROR_GROUP_CAN_T_ADD_VEHICLE :{WHITE}Nelze přidat vozidlo do skupiny... STR_ERROR_GROUP_CAN_T_ADD_SHARED_VEHICLE :{WHITE}Nelze přidat sdílená vozidla do skupiny... diff --git a/src/lang/french.txt b/src/lang/french.txt index a7dd918136..691feaf522 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -39,7 +39,7 @@ STR_CARGO_PLURAL_WOOD :Bois STR_CARGO_PLURAL_IRON_ORE :Minerai de fer STR_CARGO_PLURAL_STEEL :Acier STR_CARGO_PLURAL_VALUABLES :Objets de valeur -STR_CARGO_PLURAL_COPPER_ORE :Cuivre +STR_CARGO_PLURAL_COPPER_ORE :Minerai de cuivre STR_CARGO_PLURAL_MAIZE :Maïs STR_CARGO_PLURAL_FRUIT :Fruits STR_CARGO_PLURAL_DIAMONDS :Diamants @@ -73,7 +73,7 @@ STR_CARGO_SINGULAR_WOOD :Bois STR_CARGO_SINGULAR_IRON_ORE :Minerai de fer STR_CARGO_SINGULAR_STEEL :Acier STR_CARGO_SINGULAR_VALUABLES :Objets de valeur -STR_CARGO_SINGULAR_COPPER_ORE :Cuivre +STR_CARGO_SINGULAR_COPPER_ORE :Minerai de cuivre STR_CARGO_SINGULAR_MAIZE :Maïs STR_CARGO_SINGULAR_FRUIT :Fruit STR_CARGO_SINGULAR_DIAMOND :Diamant @@ -107,7 +107,7 @@ STR_QUANTITY_WOOD :{WEIGHT_LONG} d STR_QUANTITY_IRON_ORE :{WEIGHT_LONG} de minerai de fer STR_QUANTITY_STEEL :{WEIGHT_LONG} d'acier STR_QUANTITY_VALUABLES :{COMMA}{NBSP}sac{P "" s} d'objets de valeur -STR_QUANTITY_COPPER_ORE :{WEIGHT_LONG} de cuivre +STR_QUANTITY_COPPER_ORE :{WEIGHT_LONG} de minerai de cuivre STR_QUANTITY_MAIZE :{WEIGHT_LONG} de maïs STR_QUANTITY_FRUIT :{WEIGHT_LONG} de fruits STR_QUANTITY_DIAMONDS :{COMMA}{NBSP}sac{P "" s} de diamants diff --git a/src/lang/hungarian.txt b/src/lang/hungarian.txt index 4834c826ab..fa73b18aa6 100644 --- a/src/lang/hungarian.txt +++ b/src/lang/hungarian.txt @@ -1390,8 +1390,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :Tereptípus: {S STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :A térkép domborzata STR_CONFIG_SETTING_INDUSTRY_DENSITY :Gazdasági épületek száma: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Mennyi gazdasági épület legyen, és mennyire legyenek fenntartva a játék folyamán -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Olajfúró tornyok maximális távolsága a térkép szélétől: {STRING} -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Olajfinomítók csak a térkép határaihoz közel építhetőek, ami sziget jellegű térképeknél a partvidék +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Olajfinomítók és olajfúró tornyok maximális távolsága a térkép szélétől: {STRING} +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Megadhatod, hogy a térkép szélétől milyen messze épülhetnek olajfinomítók és olajfúró tornyok. Sziget jellegű térképek esetén így a part közelében fognak épülni. 256 mezőnél szélesebb, ill. hosszabb térképek esetén ez az érték felszorzódik. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Hóhatár magassága: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Ezzel a beállítással szabályozhatod a szub-arktikus táj hóhatárát. A hó befolyással lehet a gazdasági épületek generálására és a települések növekedésére. STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :A terep durvasága: {STRING} @@ -3183,6 +3183,8 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Város átnevez # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}{TOWN} önkormányzata +STR_LOCAL_AUTHORITY_ZONE :{BLACK}Terület +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}A helyi önkormányzathoz tartozó terület mutatása STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Vélemény a szállítási vállalatokról: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Lehetséges intézkedések: diff --git a/src/lang/indonesian.txt b/src/lang/indonesian.txt index c44a528f3d..e56dba7f8f 100644 --- a/src/lang/indonesian.txt +++ b/src/lang/indonesian.txt @@ -235,6 +235,7 @@ STR_TOOLTIP_FILTER_CRITERIA :{BLACK}Pilih kr STR_BUTTON_SORT_BY :{BLACK}Urutkan STR_BUTTON_LOCATION :{BLACK}Lokasi STR_BUTTON_RENAME :{BLACK}Ubah nama +STR_BUTTON_CATCHMENT :{BLACK}Jangkauan STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Tutup window STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Judul Jendela - klik dan tahan disini untuk memindahkan jendela @@ -2716,6 +2717,7 @@ STR_FRAMERATE_GL_ROADVEHS :{WHITE} Titik k STR_FRAMERATE_GL_SHIPS :{WHITE} Titik kapal: STR_FRAMERATE_GL_AIRCRAFT :{WHITE} Titik pesawat: STR_FRAMERATE_GL_LANDSCAPE :{WHITE} Titik dunia: +STR_FRAMERATE_DRAWING :{BLACK}Render grafis: STR_FRAMERATE_DRAWING_VIEWPORTS :{WHITE} Viewport dunia: STR_FRAMERATE_VIDEO :{BLACK}Keluaran Video: STR_FRAMERATE_SOUND :{WHITE}Mixing suara: diff --git a/src/lang/simplified_chinese.txt b/src/lang/simplified_chinese.txt index 1ceaaff4b2..e26061a58d 100644 --- a/src/lang/simplified_chinese.txt +++ b/src/lang/simplified_chinese.txt @@ -189,6 +189,7 @@ STR_COLOUR_ORANGE :橘黄色 STR_COLOUR_BROWN :棕 色 STR_COLOUR_GREY :浅灰色 STR_COLOUR_WHITE :白 色 +STR_COLOUR_DEFAULT :默认 # Units used in OpenTTD STR_UNITS_VELOCITY_IMPERIAL :{COMMA}{NBSP}英里/小时 @@ -235,6 +236,8 @@ STR_TOOLTIP_FILTER_CRITERIA :{BLACK}选择 STR_BUTTON_SORT_BY :{BLACK}排序 STR_BUTTON_LOCATION :{BLACK}定位 STR_BUTTON_RENAME :{BLACK}重命名 +STR_BUTTON_CATCHMENT :{BLACK}覆盖范围 +STR_TOOLTIP_CATCHMENT :{BLACK}显示覆盖范围 STR_TOOLTIP_CLOSE_WINDOW :{BLACK}关闭窗口 STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}窗口标题 - 拖动这里可以移动该窗口 @@ -263,6 +266,7 @@ STR_SHOW_HIDDEN_ENGINES_VEHICLE_AIRCRAFT_TOOLTIP :{BLACK}如启 STR_BUTTON_DEFAULT :{BLACK}默认 STR_BUTTON_CANCEL :{BLACK}取消 STR_BUTTON_OK :{BLACK}确定 +STR_WARNING_PASSWORD_SECURITY :{YELLOW}注意:服务器管理员可以看到你所输入的文字 # On screen keyboard window STR_OSK_KEYBOARD_LAYOUT :`1234567890-=\qwertyuiop[]asdfghjkl;' zxcvbnm,./ . @@ -927,6 +931,7 @@ STR_GAME_OPTIONS_CURRENCY_ZAR :南非兰特( STR_GAME_OPTIONS_CURRENCY_CUSTOM :自定义… STR_GAME_OPTIONS_CURRENCY_GEL :格鲁吉亚拉里(GEL) STR_GAME_OPTIONS_CURRENCY_IRR :伊朗里亚尔(IRR) +STR_GAME_OPTIONS_CURRENCY_NTD :新台币 (NTD) ############ end of currency region STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}汽车行驶 @@ -989,6 +994,7 @@ STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_NORMAL :正常大小 STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_2X_ZOOM :两倍大小 STR_GAME_OPTIONS_GUI_ZOOM_DROPDOWN_4X_ZOOM :四倍大小 +STR_GAME_OPTIONS_FONT_ZOOM_DROPDOWN_TOOLTIP :{BLACK}选择此字体大小 STR_GAME_OPTIONS_BASE_GRF :{BLACK}基础图形组 @@ -1465,6 +1471,7 @@ STR_CONFIG_SETTING_AI_IN_MULTIPLAYER :联机游戏时 STR_CONFIG_SETTING_AI_IN_MULTIPLAYER_HELPTEXT :“打开”时联机游戏允许电脑玩家 STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES :可允许的最大的代码量(如超过则会令脚本被禁用):{STRING} STR_CONFIG_SETTING_SCRIPT_MAX_OPCODES_HELPTEXT :脚本在一个回合中可进行计算步数的最大值 +STR_CONFIG_SETTING_SCRIPT_MAX_MEMORY :每个脚本的内存上限: {STRING} STR_CONFIG_SETTING_SERVINT_ISPERCENT :保养周期(百分数): {STRING} STR_CONFIG_SETTING_SERVINT_ISPERCENT_HELPTEXT :选择触发车辆保养的条件,距离上一次保养的时间或者与最高可靠性的百分比 @@ -2403,6 +2410,7 @@ STR_ROAD_TOOLBAR_TOOLTIP_BUILD_TRAMWAY_TUNNEL :{BLACK}建设 STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_ROAD :{BLACK}建设/拆除 公路 STR_ROAD_TOOLBAR_TOOLTIP_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS :{BLACK}建设/拆除 电车轨道 +STR_ROAD_NAME_TRAM :电车轨道 # Road depot construction window STR_BUILD_DEPOT_ROAD_ORIENTATION_CAPTION :{WHITE}汽车车库的方向…… @@ -2690,14 +2698,18 @@ STR_ABOUT_COPYRIGHT_OPENTTD :{BLACK}OpenTTD # Framerate display window STR_FRAMERATE_CAPTION :{WHITE}帧率 STR_FRAMERATE_CAPTION_SMALL :{STRING}{WHITE} ({DECIMAL}x) +STR_FRAMERATE_RATE_GAMELOOP :{BLACK}模拟速率: {STRING} STR_FRAMERATE_RATE_BLITTER :{BLACK}帧率:{STRING} STR_FRAMERATE_RATE_BLITTER_TOOLTIP :{BLACK}每秒渲染更新的图像帧。 STR_FRAMERATE_SPEED_FACTOR :{BLACK}当前游戏速度:{DECIMAL}x +STR_FRAMERATE_SPEED_FACTOR_TOOLTIP :{BLACK}当前游戏运行速度,与正常速度之比率 STR_FRAMERATE_MS_GOOD :{LTBLUE}{DECIMAL} ms STR_FRAMERATE_MS_BAD :{RED}{DECIMAL} ms STR_FRAMERATE_FPS_GOOD :{LTBLUE}{DECIMAL} fps STR_FRAMERATE_FPS_WARN :{YELLOW}{DECIMAL} fps STR_FRAMERATE_FPS_BAD :{RED}{DECIMAL} fps +STR_FRAMERATE_BYTES_GOOD :{LTBLUE}{BYTES} +STR_FRAMERATE_BYTES_BAD :{RED}{BYTES} STR_FRAMERATE_GRAPH_MILLISECONDS :{TINY_FONT}{COMMA} ms ############ Leave those lines in this order!! STR_FRAMERATE_VIDEO :{BLACK}视频输出: @@ -2848,6 +2860,7 @@ STR_NEWGRF_SETTINGS_MIN_VERSION :{BLACK}最低 STR_NEWGRF_SETTINGS_MD5SUM :{BLACK}MD5 码:{SILVER}{STRING} STR_NEWGRF_SETTINGS_PALETTE :{BLACK}调色板: {SILVER}{STRING} STR_NEWGRF_SETTINGS_PARAMETER :{BLACK}参数:{SILVER}{STRING} +STR_NEWGRF_SETTINGS_PARAMETER_NONE :无 STR_NEWGRF_SETTINGS_NO_INFO :{BLACK}没有可用的信息 STR_NEWGRF_SETTINGS_NOT_FOUND :{RED}没有找到对应的文件 @@ -3303,6 +3316,7 @@ STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}将屏 STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}生产程度: {YELLOW}{COMMA}% STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}此工业已经宣布即刻停业倒闭! +STR_INDUSTRY_VIEW_REQUIRES_N_CARGO :{BLACK}需要: {YELLOW}{STRING}{STRING} STR_INDUSTRY_VIEW_ACCEPT_CARGO :{YELLOW}{STRING}{BLACK}{3:STRING} STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT :{YELLOW}{STRING}{BLACK}: {CARGO_SHORT} 等待中{STRING} @@ -3390,6 +3404,7 @@ STR_BUY_VEHICLE_AIRCRAFT_CAPTION :购买飞机 ############ range for vehicle availability ends STR_PURCHASE_INFO_COST_WEIGHT :{BLACK}售价:{GOLD}{CURRENCY_LONG}{BLACK} 重量:{GOLD}{WEIGHT_SHORT} +STR_PURCHASE_INFO_COST_REFIT_WEIGHT :{BLACK}售价: {GOLD}{CURRENCY_LONG}{BLACK} (改装花费: {GOLD}{CURRENCY_LONG}{BLACK}) 重量: {GOLD}{WEIGHT_SHORT} STR_PURCHASE_INFO_SPEED_POWER :{BLACK}速度:{GOLD}{VELOCITY}{BLACK} 功率:{GOLD}{POWER} STR_PURCHASE_INFO_SPEED :{BLACK}速度:{GOLD}{VELOCITY} STR_PURCHASE_INFO_SPEED_OCEAN :{BLACK}在海洋上的速度: {GOLD}{VELOCITY} @@ -3583,6 +3598,7 @@ STR_REPLACE_ENGINE_WAGON_SELECT_HELP :{BLACK}可以 STR_REPLACE_ENGINES :机车 STR_REPLACE_WAGONS :挂车 STR_REPLACE_ALL_RAILTYPE :所有铁路车辆 +STR_REPLACE_ALL_ROADTYPE :所有道路载具 STR_REPLACE_HELP_RAILTYPE :{BLACK}选择要更新的车辆对应的铁路类型 STR_REPLACE_HELP_REPLACE_INFO_TAB :{BLACK}显示用来替换左侧被选定车辆的新车辆 @@ -3677,6 +3693,7 @@ STR_VEHICLE_INFO_AGE_RED :{RED}{COMMA} STR_VEHICLE_INFO_MAX_SPEED :{BLACK}最大速度:{LTBLUE}{VELOCITY} STR_VEHICLE_INFO_MAX_SPEED_TYPE :{BLACK}最高速度: {LTBLUE}{VELOCITY} {BLACK}飞机种类: {LTBLUE}{STRING} +STR_VEHICLE_INFO_MAX_SPEED_TYPE_RANGE :{BLACK}最大速度: {LTBLUE}{VELOCITY} {BLACK}飞机类型: {LTBLUE}{STRING} {BLACK}续航里程: {LTBLUE}{COMMA} 格 STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED :{BLACK}重量:{LTBLUE}{WEIGHT_SHORT} {BLACK}功率:{LTBLUE}{POWER}{BLACK} 最大速度:{LTBLUE}{VELOCITY} STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :{BLACK}重量:{LTBLUE}{WEIGHT_SHORT} {BLACK}功率:{LTBLUE}{POWER}{BLACK} 最大速度:{LTBLUE}{VELOCITY} {BLACK}最大牵引力:{LTBLUE}{FORCE} @@ -4331,6 +4348,7 @@ STR_ERROR_CAN_T_REMOVE_ROAD_FROM :{WHITE}不能 STR_ERROR_CAN_T_REMOVE_TRAMWAY_FROM :{WHITE}无法移除此处的电车道... STR_ERROR_THERE_IS_NO_ROAD :{WHITE}... 这里没有道路 STR_ERROR_THERE_IS_NO_TRAMWAY :{WHITE}... 这里没有电车轨道 +STR_ERROR_CAN_T_CONVERT_ROAD :{WHITE}无法转换道路类型 # Waterway construction errors STR_ERROR_CAN_T_BUILD_CANALS :{WHITE}不能在这里兴建运河…… diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt index 9e96c75f8e..dcac435176 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -485,7 +485,7 @@ STR_ABOUT_MENU_ZOOMIN_SCREENSHOT :Captura con ace STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT :Captura con acercamiento predeterminado STR_ABOUT_MENU_GIANT_SCREENSHOT :Captura de mapa completo STR_ABOUT_MENU_SHOW_FRAMERATE :Mostrar FPS -STR_ABOUT_MENU_ABOUT_OPENTTD :Acerca de 'OpenTTD' +STR_ABOUT_MENU_ABOUT_OPENTTD :Acerca de OpenTTD STR_ABOUT_MENU_SPRITE_ALIGNER :Alineador de sprites STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Activar cajas delimitadoras STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Activar coloreado de bloques modificados @@ -939,6 +939,9 @@ STR_GAME_OPTIONS_CURRENCY_GEL :Lari georgiano STR_GAME_OPTIONS_CURRENCY_IRR :Rial iraní (IRR) STR_GAME_OPTIONS_CURRENCY_RUB :Nuevo rublo ruso (RUR) STR_GAME_OPTIONS_CURRENCY_MXN :Peso mexicano (MXN) +STR_GAME_OPTIONS_CURRENCY_NTD :Nuevo dólar taiwanés (NTD) +STR_GAME_OPTIONS_CURRENCY_CNY :Yuan chino (CNY) +STR_GAME_OPTIONS_CURRENCY_HKD :Dólar honkonés (HKD) ############ end of currency region STR_GAME_OPTIONS_ROAD_VEHICLES_FRAME :{BLACK}Vehículos de carretera @@ -1190,6 +1193,8 @@ STR_CONFIG_SETTING_AUTOSLOPE :Permitir modifi STR_CONFIG_SETTING_AUTOSLOPE_HELPTEXT :Modificar el terreno debajo de edificios y vías de tren sin quitarlos STR_CONFIG_SETTING_CATCHMENT :Permitir cambiar el tamaño del área de recolección a una forma más real: {STRING} STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Las áreas de recolección se adecúan a diferentes tamaños, según los tipos de estaciones y aeropuertos +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES :Las estaciones privadas pueden dar servicio a industrias con estaciones neutrales: {STRING} +STR_CONFIG_SETTING_SERVE_NEUTRAL_INDUSTRIES_HELPTEXT :Si se activa, las industrias con estaciones integradas (ej. plataformas petrolíferas) podrán aceptar cargamento de estaciones privadas construidas cerca. Si se desactiva, tales industrias solo recibirán cargamento en sus propias estaciones. No aceptarán cargamento de estaciones de compañías, y la estación integrada no brindará servicio a nada más que su industria STR_CONFIG_SETTING_EXTRADYNAMITE :Permitir quitar mayor cantidad de carreteras, puentes y túneles de los pueblos: {STRING} STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Hacer más fácil eliminar infraestructura y edificios que sean propiedad de los pueblos STR_CONFIG_SETTING_TRAIN_LENGTH :Longitud máxima de trenes: {STRING} @@ -1322,8 +1327,8 @@ STR_CONFIG_SETTING_TERRAIN_TYPE :Tipo de terreno STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT :(Solo TerraGenesis) Colinas del terreno STR_CONFIG_SETTING_INDUSTRY_DENSITY :Densidad industrial: {STRING} STR_CONFIG_SETTING_INDUSTRY_DENSITY_HELPTEXT :Número de industrias a generar y nivel a mantener durante el juego -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Distancia máxima de refinerías de petróleo con los bordes del mapa: {STRING} -STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Las refinerías de petróleo se construyen cerca del borde del mapa, el cual es costa en mapas con borde marítimo +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE :Distancia máxima de industrias petrolíferas al borde del mapa: {STRING} +STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Distancia límite desde el borde del mapa a partir del cual se pueden construir refinerías y plataformas de petróleo. En mapas con forma de isla esto garantiza que se ubiquen cerca de la costa. En mapas de más de 256 casillas el valor se amplía. STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Nivel de inicio de nieve: {STRING} STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :En los mapas de clima Subártico, la elevación a la cual la nieve comienza. La nieve también afecta la generación de industrias y los requisitos de crecimiento de los pueblos STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Irregularidad del terreno: {STRING} @@ -3042,7 +3047,7 @@ STR_NEWGRF_BROKEN :{WHITE}Es posib STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}Cambió el estado 'vagón con motor' para '{1:ENGINE}' cuando no estaba dentro de un depósito STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}cambió la longitud del vehículo para '{1:ENGINE}' cuando no estaba dentro de un depósito STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Cambió la capacidad del vehículo para '{1:ENGINE}' cuando no estaba dentro de un depósito o mientras no se estaba reformando -STR_BROKEN_VEHICLE_LENGTH :{WHITE}Tren '{VEHICLE}' perteneciente a '{COMPANY}' tiene una longitud no válida. Puede ser debido a problemas con los NewGRF. El juego puede fallar +STR_BROKEN_VEHICLE_LENGTH :{WHITE}Tren {VEHICLE} de {COMPANY} tiene una longitud no válida. Quizá es por problemas de los NewGRF, y puede provocar que el juego falle STR_NEWGRF_BUGGY :{WHITE}El NewGRF '{0:STRING}' da información incorrecta STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}La información de cargamento o reequipamiento para '{1:ENGINE}' difiere de la lista de compra después de la construcción. Esto puede causar que la renovación y el reemplazo automático no haga el reequipamiento correcta @@ -3115,6 +3120,8 @@ STR_TOWN_VIEW_RENAME_TOWN_BUTTON :Cambiar nombre # Town local authority window STR_LOCAL_AUTHORITY_CAPTION :{WHITE}Ayuntamiento de {TOWN} +STR_LOCAL_AUTHORITY_ZONE :{BLACK}Jurisdicción +STR_LOCAL_AUTHORITY_ZONE_TOOLTIP :{BLACK}Mostrar área dentro de jurisdicción local STR_LOCAL_AUTHORITY_COMPANY_RATINGS :{BLACK}Evaluación de empresas de transporte: STR_LOCAL_AUTHORITY_COMPANY_RATING :{YELLOW}{COMPANY} {COMPANY_NUM}: {ORANGE}{STRING} STR_LOCAL_AUTHORITY_ACTIONS_TITLE :{BLACK}Acciones disponibles: diff --git a/src/linkgraph/demands.h b/src/linkgraph/demands.h index 656ace2601..e4b7ffa713 100644 --- a/src/linkgraph/demands.h +++ b/src/linkgraph/demands.h @@ -26,7 +26,7 @@ private: }; /** - * Stateless, thread safe demand hander. Doesn't do anything but call DemandCalculator. + * Stateless, thread safe demand handler. Doesn't do anything but call DemandCalculator. */ class DemandHandler : public ComponentHandler { public: diff --git a/src/linkgraph/init.h b/src/linkgraph/init.h index a39a0f8205..377c886311 100644 --- a/src/linkgraph/init.h +++ b/src/linkgraph/init.h @@ -6,7 +6,7 @@ #include "linkgraphjob_base.h" /** - * Stateless, thread safe initialization hander. Initializes node and edge + * Stateless, thread safe initialization handler. Initializes node and edge * annotations. */ class InitHandler : public ComponentHandler { diff --git a/src/linkgraph/linkgraphjob.h b/src/linkgraph/linkgraphjob.h index 220c454d68..34f0bab1a4 100644 --- a/src/linkgraph/linkgraphjob.h +++ b/src/linkgraph/linkgraphjob.h @@ -457,7 +457,7 @@ public: protected: /** - * Some boundaries to clamp agains in order to avoid integer overflows. + * Some boundaries to clamp against in order to avoid integer overflows. */ enum PathCapacityBoundaries { PATH_CAP_MULTIPLIER = 16, diff --git a/src/linkgraph/refresh.cpp b/src/linkgraph/refresh.cpp index 927c66c90a..7cfd898bff 100644 --- a/src/linkgraph/refresh.cpp +++ b/src/linkgraph/refresh.cpp @@ -280,7 +280,7 @@ void LinkRefresher::RefreshStats(const Order *cur, const Order *next) /** * Iterate over orders starting at \a cur and \a next and refresh links * associated with them. \a cur and \a next can be equal. If they're not they - * must be "neigbours" in their order list, which means \a next must be directly + * must be "neighbours" in their order list, which means \a next must be directly * reachable from \a cur without passing any further OT_GOTO_STATION or * OT_IMPLICIT orders in between. * @param cur Current order being evaluated. diff --git a/src/misc/blob.hpp b/src/misc/blob.hpp index e725ccd279..fafeb80780 100644 --- a/src/misc/blob.hpp +++ b/src/misc/blob.hpp @@ -154,13 +154,13 @@ protected: header = &src[1]; } - /** blob header accessor - use it rather than using the pointer arithmetics directly - non-const version */ + /** blob header accessor - use it rather than using the pointer arithmetic directly - non-const version */ inline BlobHeader& Hdr() { return *(header - 1); } - /** blob header accessor - use it rather than using the pointer arithmetics directly - const version */ + /** blob header accessor - use it rather than using the pointer arithmetic directly - const version */ inline const BlobHeader& Hdr() const { return *(header - 1); diff --git a/src/misc/countedptr.hpp b/src/misc/countedptr.hpp index 83d0e036d3..1364197dc1 100644 --- a/src/misc/countedptr.hpp +++ b/src/misc/countedptr.hpp @@ -53,7 +53,7 @@ public: } protected: - /** add one ref to the underlaying object */ + /** add one ref to the underlying object */ inline void AddRef() { if (m_pT != nullptr) m_pT->AddRef(); diff --git a/src/misc/str.hpp b/src/misc/str.hpp index 1d9802288c..42e4631581 100644 --- a/src/misc/str.hpp +++ b/src/misc/str.hpp @@ -7,7 +7,7 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file str.hpp String formating? */ +/** @file str.hpp String formatting? */ #ifndef STR_HPP #define STR_HPP @@ -91,7 +91,7 @@ struct CStrA : public CBlobT return strcmp(base::Data(), other.Data()) < 0; } - /** Add formated string (like vsprintf) at the end of existing contents. */ + /** Add formatted string (like vsprintf) at the end of existing contents. */ int AddFormatL(const char *format, va_list args) { size_t addSize = max(strlen(format), 16); @@ -126,7 +126,7 @@ struct CStrA : public CBlobT return ret; } - /** Add formated string (like sprintf) at the end of existing contents. */ + /** Add formatted string (like sprintf) at the end of existing contents. */ int CDECL WARN_FORMAT(2, 3) AddFormat(const char *format, ...) { va_list args; @@ -136,7 +136,7 @@ struct CStrA : public CBlobT return ret; } - /** Assign formated string (like sprintf). */ + /** Assign formatted string (like sprintf). */ int CDECL WARN_FORMAT(2, 3) Format(const char *format, ...) { base::Free(); diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index 0bdb1c1c3a..30332415cd 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -229,7 +229,7 @@ CommandCost CmdChangeBankBalance(TileIndex tile, DoCommandFlag flags, uint32 p1, cur_company.Restore(); } - /* This command doesn't cost anyting for deity. */ + /* This command doesn't cost anything for deity. */ CommandCost zero_cost(expenses_type, 0); return zero_cost; } diff --git a/src/music/cocoa_m.cpp b/src/music/cocoa_m.cpp index c27a0a0927..fd3ff295e8 100644 --- a/src/music/cocoa_m.cpp +++ b/src/music/cocoa_m.cpp @@ -114,7 +114,7 @@ const char *MusicDriver_Cocoa::Start(const char * const *parm) /** - * Checks wether the player is active. + * Checks whether the player is active. */ bool MusicDriver_Cocoa::IsSongPlaying() { diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp index d48b927592..6048aa2d11 100644 --- a/src/music/dmusic.cpp +++ b/src/music/dmusic.cpp @@ -237,7 +237,7 @@ bool DLSFile::ReadDLSRegion(FILE *f, DWORD list_length, std::vector & break; default: - DEBUG(driver, 7, "DLS: Ignoring unkown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); + DEBUG(driver, 7, "DLS: Ignoring unknown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); fseek(f, chunk.length, SEEK_CUR); break; } @@ -260,7 +260,7 @@ bool DLSFile::ReadDLSRegionList(FILE *f, DWORD list_length, DLSInstrument &instr if (list_type == FOURCC_RGN) { this->ReadDLSRegion(f, chunk.length - sizeof(list_type), instrument.regions); } else { - DEBUG(driver, 7, "DLS: Ignoring unkown list chunk of type %c%c%c%c", (char)(list_type & 0xFF), (char)((list_type >> 8) & 0xFF), (char)((list_type >> 16) & 0xFF), (char)((list_type >> 24) & 0xFF)); + DEBUG(driver, 7, "DLS: Ignoring unknown list chunk of type %c%c%c%c", (char)(list_type & 0xFF), (char)((list_type >> 8) & 0xFF), (char)((list_type >> 16) & 0xFF), (char)((list_type >> 24) & 0xFF)); fseek(f, chunk.length - sizeof(list_type), SEEK_CUR); } } else { @@ -307,7 +307,7 @@ bool DLSFile::ReadDLSInstrument(FILE *f, DWORD list_length) break; default: - DEBUG(driver, 7, "DLS: Ignoring unkown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); + DEBUG(driver, 7, "DLS: Ignoring unknown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); fseek(f, chunk.length, SEEK_CUR); break; } @@ -332,7 +332,7 @@ bool DLSFile::ReadDLSInstrumentList(FILE *f, DWORD list_length) if (!this->ReadDLSInstrument(f, chunk.length - sizeof(list_type))) return false; } else { - DEBUG(driver, 7, "DLS: Ignoring unkown list chunk of type %c%c%c%c", (char)(list_type & 0xFF), (char)((list_type >> 8) & 0xFF), (char)((list_type >> 16) & 0xFF), (char)((list_type >> 24) & 0xFF)); + DEBUG(driver, 7, "DLS: Ignoring unknown list chunk of type %c%c%c%c", (char)(list_type & 0xFF), (char)((list_type >> 8) & 0xFF), (char)((list_type >> 16) & 0xFF), (char)((list_type >> 24) & 0xFF)); fseek(f, chunk.length - sizeof(list_type), SEEK_CUR); } } else { @@ -395,7 +395,7 @@ bool DLSFile::ReadDLSWave(FILE *f, DWORD list_length, long offset) break; default: - DEBUG(driver, 7, "DLS: Ignoring unkown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); + DEBUG(driver, 7, "DLS: Ignoring unknown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); fseek(f, chunk.length, SEEK_CUR); break; } @@ -424,7 +424,7 @@ bool DLSFile::ReadDLSWaveList(FILE *f, DWORD list_length) if (!this->ReadDLSWave(f, chunk.length - sizeof(list_type), chunk_offset - base_offset)) return false; } else { - DEBUG(driver, 7, "DLS: Ignoring unkown list chunk of type %c%c%c%c", (char)(list_type & 0xFF), (char)((list_type >> 8) & 0xFF), (char)((list_type >> 16) & 0xFF), (char)((list_type >> 24) & 0xFF)); + DEBUG(driver, 7, "DLS: Ignoring unknown list chunk of type %c%c%c%c", (char)(list_type & 0xFF), (char)((list_type >> 8) & 0xFF), (char)((list_type >> 16) & 0xFF), (char)((list_type >> 24) & 0xFF)); fseek(f, chunk.length - sizeof(list_type), SEEK_CUR); } } else { @@ -503,7 +503,7 @@ bool DLSFile::LoadFile(const TCHAR *file) break; default: - DEBUG(driver, 7, "DLS: Ignoring unkown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); + DEBUG(driver, 7, "DLS: Ignoring unknown chunk %c%c%c%c", (char)(chunk.type & 0xFF), (char)((chunk.type >> 8) & 0xFF), (char)((chunk.type >> 16) & 0xFF), (char)((chunk.type >> 24) & 0xFF)); fseek(f, chunk.length, SEEK_CUR); break; } diff --git a/src/music/qtmidi.cpp b/src/music/qtmidi.cpp index f8412a2dcc..e612604edd 100644 --- a/src/music/qtmidi.cpp +++ b/src/music/qtmidi.cpp @@ -34,11 +34,13 @@ #include "../debug.h" #include "../base_media_base.h" -#define Rect OTTDRect -#define Point OTTDPoint +#define Rect OTTD_Rect +#define Point OTTD_Point +#define WindowClass OTTD_WindowClass #include #undef Rect #undef Point +#undef WindowClass #include "../safeguards.h" @@ -154,7 +156,7 @@ static void InitQuickTimeIfNeeded() if (_quicktime_started) return; DEBUG(driver, 2, "qtmidi: initializing Quicktime"); - /* Be polite: check wether QuickTime is available and initialize it. */ + /* Be polite: check whether QuickTime is available and initialize it. */ _quicktime_started = (noErr == Gestalt(gestaltQuickTime, &dummy)) && (noErr == EnterMovies()); @@ -213,7 +215,7 @@ bool MusicDriver_QtMidi::IsSongPlaying() case QT_STATE_PLAY: MoviesTask(_quicktime_movie, 0); - /* Check wether movie ended. */ + /* Check whether movie ended. */ if (IsMovieDone(_quicktime_movie) || (GetMovieTime(_quicktime_movie, nullptr) >= GetMovieDuration(_quicktime_movie))) { diff --git a/src/music/win32_m.cpp b/src/music/win32_m.cpp index 31d61aebb9..24fb50b72a 100644 --- a/src/music/win32_m.cpp +++ b/src/music/win32_m.cpp @@ -87,7 +87,7 @@ static void TransmitSysex(const byte *&msg_start, size_t &remaining) /* prepare header */ MIDIHDR *hdr = CallocT(1); - hdr->lpData = (LPSTR)msg_start; + hdr->lpData = reinterpret_cast(const_cast(msg_start)); hdr->dwBufferLength = msg_end - msg_start; if (midiOutPrepareHeader(_midi.midi_out, hdr, sizeof(*hdr)) == MMSYSERR_NOERROR) { /* transmit - just point directly into the data buffer */ @@ -373,7 +373,7 @@ const char *MusicDriver_Win32::Start(const char * const *parm) DEBUG(driver, 2, "Win32-MIDI: Start: initializing"); int resolution = GetDriverParamInt(parm, "resolution", 5); - int port = GetDriverParamInt(parm, "port", -1); + uint port = (uint)GetDriverParamInt(parm, "port", UINT_MAX); const char *portname = GetDriverParam(parm, "portname"); /* Enumerate ports either for selecting port by name, or for debug output */ @@ -396,7 +396,7 @@ const char *MusicDriver_Win32::Start(const char * const *parm) } UINT devid; - if (port < 0) { + if (port == UINT_MAX) { devid = MIDI_MAPPER; } else { devid = (UINT)port; diff --git a/src/network/core/address.h b/src/network/core/address.h index 4dd0edbc08..2f27a083ac 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -91,15 +91,6 @@ public: this->SetPort(port); } - /** - * Make a clone of another address - * @param address the address to clone - */ - NetworkAddress(const NetworkAddress &address) - { - memcpy(this, &address, sizeof(*this)); - } - const char *GetHostname(); void GetAddressAsString(char *buffer, const char *last, bool with_family = true); const char *GetAddressAsString(bool with_family = true); diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index b5a7897f62..4f28c9330d 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -133,7 +133,7 @@ bool ClientNetworkContentSocketHandler::Receive_SERVER_INFO(Packet *p) ci->state = ContentInfo::UNSELECTED; } - /* Something we don't have and has filesize 0 does not exist in te system */ + /* Something we don't have and has filesize 0 does not exist in the system */ if (ci->state == ContentInfo::UNSELECTED && ci->filesize == 0) ci->state = ContentInfo::DOES_NOT_EXIST; /* Do we already have a stub for this? */ @@ -781,7 +781,7 @@ void ClientNetworkContentSocketHandler::SendReceive() if (this->CanSendReceive()) { if (this->ReceivePackets()) { - /* Only update activity once a packet is received, instead of everytime we try it. */ + /* Only update activity once a packet is received, instead of every time we try it. */ this->lastActivity = _realtime_tick; } } diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 875a5b77c6..9c58564e7b 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -289,7 +289,7 @@ struct ContentListFilterData { std::bitset types; ///< Content types displayed }; -/** Filter criterias for NetworkContentListWindow. */ +/** Filter criteria for NetworkContentListWindow. */ enum ContentListFilterCriteria { CONTENT_FILTER_TEXT = 0, ///< Filter by query sting CONTENT_FILTER_TYPE_OR_SELECTED,///< Filter by being of displayed type or selected for download diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index d1b5bdaa4c..b7dad4b3fb 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -240,7 +240,7 @@ protected: int lock_offset; ///< Left offset for lock icon. int blot_offset; ///< Left offset for green/yellow/red compatibility icon. - int flag_offset; ///< Left offset for langauge flag icon. + int flag_offset; ///< Left offset for language flag icon. /** * (Re)build the GUI network game list (a.k.a. this->servers) as some diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index ae3f407bdc..29a5b06d67 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1302,7 +1302,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_ACK(Packet *p) /* The client is trying to catch up with the server */ if (this->status == STATUS_PRE_ACTIVE) { - /* The client is not yet catched up? */ + /* The client is not yet caught up? */ if (frame + DAY_TICKS < _frame_counter) return NETWORK_RECV_STATUS_OKAY; /* Now he is! Unpause the game */ diff --git a/src/network/network_type.h b/src/network/network_type.h index 145bc05042..483250c9af 100644 --- a/src/network/network_type.h +++ b/src/network/network_type.h @@ -38,7 +38,7 @@ enum NetworkVehicleType { }; /** 'Unique' identifier to be given to clients */ -enum ClientID { +enum ClientID : uint32 { INVALID_CLIENT_ID = 0, ///< Client is not part of anything CLIENT_ID_SERVER = 1, ///< Servers always have this ID CLIENT_ID_FIRST = 2, ///< The first client ID diff --git a/src/newgrf.cpp b/src/newgrf.cpp index b73914c015..63251c8a51 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -108,7 +108,7 @@ public: byte grf_container_ver; ///< Container format of the current GRF file. /* Kind of return values when processing certain actions */ - int skip_sprites; ///< Number of psuedo sprites to skip before processing the next one. (-1 to skip to end of file) + int skip_sprites; ///< Number of pseudo sprites to skip before processing the next one. (-1 to skip to end of file) /* Currently referenceable spritegroups */ SpriteGroup *spritegroups[MAX_SPRITEGROUP + 1]; @@ -555,7 +555,7 @@ StringID MapGRFStringID(uint32 grfid, StringID str) { if (IsInsideMM(str, 0xD800, 0xE000)) { /* General text provided by NewGRF. - * In the specs this is called the 0xDCxx range (misc presistent texts), + * In the specs this is called the 0xDCxx range (misc persistent texts), * but we meanwhile extended the range to 0xD800-0xDFFF. * Note: We are not involved in the "persistent" business, since we do not store * any NewGRF strings in savegames. */ @@ -848,7 +848,7 @@ static void ReadSpriteLayoutRegisters(ByteReader *buf, TileLayoutFlags flags, bo * @param num_building_sprites Number of building sprites to read * @param use_cur_spritesets Whether to use currently referenceable action 1 sets. * @param feature GrfSpecFeature to use spritesets from. - * @param allow_var10 Whether the spritelayout may specifiy var10 values for resolving multiple action-1-2-3 chains + * @param allow_var10 Whether the spritelayout may specify var10 values for resolving multiple action-1-2-3 chains * @param no_z_position Whether bounding boxes have no Z offset * @param dts Layout container to output into * @return True on error (GRF was disabled). @@ -3531,7 +3531,7 @@ static ChangeInfoResult IndustriesChangeInfo(uint indid, int numinfo, int prop, indsp->grf_prop.local_id = indid + i; indsp->grf_prop.subst_id = subs_id; indsp->grf_prop.grffile = _cur.grffile; - /* If the grf industry needs to check its surounding upon creation, it should + /* If the grf industry needs to check its surrounding upon creation, it should * rely on callbacks, not on the original placement functions */ indsp->check_proc = CHECK_NOTHING; } @@ -6318,7 +6318,7 @@ static void GraphicsNew(ByteReader *buf) return; } - /* Load at most max_sprites sprites. Skip remaining sprites. (for compatibility with TTDP and future extentions) */ + /* Load at most max_sprites sprites. Skip remaining sprites. (for compatibility with TTDP and future extensions) */ uint16 skip_num = SanitizeSpriteOffset(num, offset, action5_type->max_sprites, action5_type->name); SpriteID replace = action5_type->sprite_base + offset; @@ -6944,7 +6944,7 @@ static void GRFLoadError(ByteReader *buf) { /* <0B> [ 00] [] 00 [] * - * B severity 00: notice, contine loading grf file + * B severity 00: notice, continue loading grf file * 01: warning, continue loading grf file * 02: error, but continue loading grf file, and attempt * loading grf again when loading or starting next game @@ -7123,7 +7123,7 @@ static uint32 GetPatchVariable(uint8 param) */ case 0x13: { byte map_bits = 0; - byte log_X = MapLogX() - 6; // substraction is required to make the minimal size (64) zero based + byte log_X = MapLogX() - 6; // subtraction is required to make the minimal size (64) zero based byte log_Y = MapLogY() - 6; byte max_edge = max(log_X, log_Y); @@ -7416,7 +7416,7 @@ static void ParamSet(ByteReader *buf) } break; - case 0x0A: // Signed divison + case 0x0A: // Signed division if (src2 == 0) { res = src1; } else { @@ -10364,7 +10364,7 @@ void LoadNewGRF(uint load_index, uint file_index, uint num_baseset) /* * Reset the status of all files, so we can 'retry' to load them. * This is needed when one for example rearranges the NewGRFs in-game - * and a previously disabled NewGRF becomes useable. If it would not + * and a previously disabled NewGRF becomes usable. If it would not * be reset, the NewGRF would remain disabled even though it should * have been enabled. */ diff --git a/src/newgrf.h b/src/newgrf.h index ef6b50faaa..798f1c5a41 100644 --- a/src/newgrf.h +++ b/src/newgrf.h @@ -253,7 +253,7 @@ struct GRFFile : ZeroedMemoryAllocator { struct LanguageMap *language_map; ///< Mappings related to the languages. - int traininfo_vehicle_pitch; ///< Vertical offset for draing train images in depot GUI and vehicle details + int traininfo_vehicle_pitch; ///< Vertical offset for drawing train images in depot GUI and vehicle details uint traininfo_vehicle_width; ///< Width (in pixels) of a 8/8 train vehicle in depot GUI and vehicle details uint32 grf_features; ///< Bitset of GrfSpecFeature the grf uses diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index 8ec390a4f3..e654dcc78c 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -132,7 +132,7 @@ bool AirportSpec::IsAvailable() const /** * Check if the airport would be within the map bounds at the given tile. - * @param table Selected layout table. This affects airport rotation, and therefore dimenions. + * @param table Selected layout table. This affects airport rotation, and therefore dimensions. * @param tile Top corner of the airport. * @return true iff the airport would be within the map bounds at the given tile. */ diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index c80f0e3502..6a6b4f015d 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -650,7 +650,7 @@ void NewGRFSpriteLayout::AllocateRegisters() /** * Prepares a sprite layout before resolving action-1-2-3 chains. * Integrates offsets into the layout and determines which chains to resolve. - * @note The function uses statically allocated temporary storage, which is reused everytime when calling the function. + * @note The function uses statically allocated temporary storage, which is reused every time when calling the function. * That means, you have to use the sprite layout before calling #PrepareLayout() the next time. * @param orig_offset Offset to apply to non-action-1 sprites. * @param newgrf_ground_offset Offset to apply to action-1 ground sprites. diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index bd93829867..9062bde28d 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -248,7 +248,7 @@ static byte MapAircraftMovementState(const Aircraft *v) return AMS_TTDP_TO_INWAY; case HELILANDING: - case HELIENDLANDING: // Helicoptor is decending. + case HELIENDLANDING: // Helicoptor is descending. if (amdflag & AMED_HELI_LOWER) { return afc->delta_z == 0 ? AMS_TTDP_HELI_LAND_AIRPORT : AMS_TTDP_HELI_LAND_HELIPORT; @@ -1078,7 +1078,7 @@ bool UsesWagonOverride(const Vehicle *v) * @param param1 First parameter of the callback * @param param2 Second parameter of the callback * @param engine Engine type of the vehicle to evaluate the callback for - * @param v The vehicle to evaluate the callback for, or nullptr if it doesnt exist yet + * @param v The vehicle to evaluate the callback for, or nullptr if it doesn't exist yet * @return The value the callback returned, or CALLBACK_FAILED if it failed */ uint16 GetVehicleCallback(CallbackID callback, uint32 param1, uint32 param2, EngineID engine, const Vehicle *v) diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index f9defad8a2..8c32efd55a 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -14,10 +14,14 @@ * holding everything that the newgrf action 04 will send over to OpenTTD. * One of the biggest problems is that Dynamic lang Array uses ISO codes * as way to identifying current user lang, while newgrf uses bit shift codes - * not related to ISO. So equivalence functionnality had to be set. + * not related to ISO. So equivalence functionality had to be set. */ #include "stdafx.h" + +#include +#include + #include "newgrf.h" #include "strings_func.h" #include "newgrf_storage.h" @@ -831,22 +835,14 @@ void CleanUpStrings() } struct TextRefStack { - byte stack[0x30]; + std::array stack; byte position; const GRFFile *grffile; bool used; TextRefStack() : position(0), grffile(nullptr), used(false) {} - TextRefStack(const TextRefStack &stack) : - position(stack.position), - grffile(stack.grffile), - used(stack.used) - { - memcpy(this->stack, stack.stack, sizeof(this->stack)); - } - - uint8 PopUnsignedByte() { assert(this->position < lengthof(this->stack)); return this->stack[this->position++]; } + uint8 PopUnsignedByte() { assert(this->position < this->stack.size()); return this->stack[this->position++]; } int8 PopSignedByte() { return (int8)this->PopUnsignedByte(); } uint16 PopUnsignedWord() @@ -884,9 +880,8 @@ struct TextRefStack { if (this->position >= 2) { this->position -= 2; } else { - for (int i = lengthof(stack) - 1; i >= this->position + 2; i--) { - this->stack[i] = this->stack[i - 2]; - } + // Rotate right 2 positions + std::rotate(this->stack.rbegin(), this->stack.rbegin() + 2, this->stack.rend()); } this->stack[this->position] = GB(word, 0, 8); this->stack[this->position + 1] = GB(word, 8, 8); @@ -958,12 +953,12 @@ void StartTextRefStackUsage(const GRFFile *grffile, byte numEntries, const uint3 _newgrf_textrefstack.ResetStack(grffile); - byte *p = _newgrf_textrefstack.stack; + auto stack_it = _newgrf_textrefstack.stack.begin(); for (uint i = 0; i < numEntries; i++) { uint32 value = values != nullptr ? values[i] : _temp_store.GetValue(0x100 + i); for (uint j = 0; j < 32; j += 8) { - *p = GB(value, j, 8); - p++; + *stack_it = GB(value, j, 8); + stack_it++; } } } diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 8f3dfaca29..0cf9e9e2a8 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -688,9 +688,9 @@ static void MoveToNextNewsItem() * @param type news category * @param flags display flags for the news * @param reftype1 Type of ref1 - * @param ref1 Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleteing the news when the object is deleted. + * @param ref1 Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleting the news when the object is deleted. * @param reftype2 Type of ref2 - * @param ref2 Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news when the object is deleted. + * @param ref2 Reference 2 to some object: Used for scrolling after clicking on the news, and for deleting the news when the object is deleted. * @param free_data Pointer to data that must be freed once the news message is cleared * * @see NewsSubtype diff --git a/src/news_type.h b/src/news_type.h index e91b4be3ae..0038d0f903 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -128,8 +128,8 @@ struct NewsItem { NewsReferenceType reftype1; ///< Type of ref1 NewsReferenceType reftype2; ///< Type of ref2 - uint32 ref1; ///< Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleteing the news when the object is deleted. - uint32 ref2; ///< Reference 2 to some object: Used for scrolling after clicking on the news, and for deleteing the news when the object is deleted. + uint32 ref1; ///< Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleting the news when the object is deleted. + uint32 ref2; ///< Reference 2 to some object: Used for scrolling after clicking on the news, and for deleting the news when the object is deleted. void *free_data; ///< Data to be freed when the news item has reached its end. diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 0366cb42c0..d79c0bfda4 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -855,7 +855,7 @@ static void ChangeTileOwner_Object(TileIndex tile, Owner old_owner, Owner new_ow if (do_clear) { ReallyClearObjectTile(Object::GetByTile(tile)); - /* When clearing objects, they may turn into canal, which may require transfering ownership. */ + /* When clearing objects, they may turn into canal, which may require transferring ownership. */ ChangeTileOwner(tile, old_owner, new_owner); } } diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index b3f1326e54..cd4493773b 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -575,7 +575,7 @@ const Order *OrderList::GetNextDecisionNode(const Order *next, uint hops, CargoT * @param CargoTypes cargo_mask Bit-set of the cargo IDs of interest. * @param first Order to start searching at or nullptr to start at cur_implicit_order_index + 1. * @param hops Number of orders we have already looked at. - * @return A CargoMaskedStationIDStack of the cargo mask the result is valid for, and the next stoppping station or INVALID_STATION. + * @return A CargoMaskedStationIDStack of the cargo mask the result is valid for, and the next stopping station or INVALID_STATION. * @pre The vehicle is currently loading and v->last_station_visited is meaningful. * @note This function may draw a random number. Don't use it from the GUI. */ diff --git a/src/os/macosx/osx_stdafx.h b/src/os/macosx/osx_stdafx.h index 4178bf2ff0..d61dd3fa8a 100644 --- a/src/os/macosx/osx_stdafx.h +++ b/src/os/macosx/osx_stdafx.h @@ -25,7 +25,7 @@ #define HAVE_OSX_1011_SDK #endif -/* It would seem that to ensure backward compability we have to ensure that we have defined MAC_OS_X_VERSION_10_x everywhere */ +/* It would seem that to ensure backward compatibility we have to ensure that we have defined MAC_OS_X_VERSION_10_x everywhere */ #ifndef MAC_OS_X_VERSION_10_3 #define MAC_OS_X_VERSION_10_3 1030 #endif diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index 76176344ef..6a6a765a4b 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -285,7 +285,7 @@ void MacOSSetCurrentLocaleName(const char *iso_code) if (_osx_locale != nullptr) CFRelease(_osx_locale); - CFStringRef iso = CFStringCreateWithCString(kCFAllocatorNull, iso_code, kCFStringEncodingUTF8); + CFStringRef iso = CFStringCreateWithCString(kCFAllocatorDefault, iso_code, kCFStringEncodingUTF8); _osx_locale = CFLocaleCreate(kCFAllocatorDefault, iso); CFRelease(iso); } diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index 2820599667..eaf666ff23 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -421,7 +421,7 @@ void ShowOnScreenKeyboard(Window *parent, int button) * Updates the original text of the OSK so when the 'parent' changes the * original and you press on cancel you won't get the 'old' original text * but the updated one. - * @param parent window that just updated its orignal text + * @param parent window that just updated its original text * @param button widget number of parent's textbox to update */ void UpdateOSKOriginalText(const Window *parent, int button) diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index 32d8f60f12..9fff893f2d 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -1009,7 +1009,7 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current) * When we are looking for one specific target (optionally multiple tiles), we * should use a good heuristic to perform aystar search. When we search for * multiple targets that are spread around, we should perform a breadth first - * search by specifiying CalcZero as our heuristic. + * search by specifying CalcZero as our heuristic. */ static NPFFoundTargetData NPFRouteInternal(AyStarNode *start1, bool ignore_start_tile1, AyStarNode *start2, bool ignore_start_tile2, NPFFindStationOrTileData *target, AyStar_EndNodeCheck target_proc, AyStar_CalculateH heuristic_proc, AyStarUserData *user, uint reverse_penalty, bool ignore_reserved = false, int max_penalty = 0) { diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp index fddaf96a3b..7f60a1fb84 100644 --- a/src/pathfinder/yapf/yapf_costrail.hpp +++ b/src/pathfinder/yapf/yapf_costrail.hpp @@ -48,14 +48,6 @@ protected: this->tile_type = GetTileType(tile); this->rail_type = GetTileRailTypeByTrack(tile, TrackdirToTrack(td)); } - - TILE(const TILE &src) - { - tile = src.tile; - td = src.td; - tile_type = src.tile_type; - rail_type = src.rail_type; - } }; protected: diff --git a/src/querystring_gui.h b/src/querystring_gui.h index f67809b784..6764a6c91a 100644 --- a/src/querystring_gui.h +++ b/src/querystring_gui.h @@ -79,7 +79,7 @@ public: /** * Get the currently marked text. * @param[out] length Length of the marked text. - * @return Begining of the marked area or nullptr if no text is marked. + * @return Beginning of the marked area or nullptr if no text is marked. */ const char *GetMarkedText(size_t *length) const { diff --git a/src/road.cpp b/src/road.cpp index f6d1ffe531..d307be466a 100644 --- a/src/road.cpp +++ b/src/road.cpp @@ -43,9 +43,9 @@ static bool IsPossibleCrossing(const TileIndex tile, Axis ax) } /** - * Clean up unnecessary RoadBits of a planed tile. + * Clean up unnecessary RoadBits of a planned tile. * @param tile current tile - * @param org_rb planed RoadBits + * @param org_rb planned RoadBits * @return optimised RoadBits */ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb) @@ -104,7 +104,7 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb) } } - /* If the neighbor tile is inconnective, remove the planed road connection to it */ + /* If the neighbor tile is inconnective, remove the planned road connection to it */ if (!connective) org_rb ^= target_rb; } } diff --git a/src/road_gui.cpp b/src/road_gui.cpp index c0854e6949..feb6ff4abc 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -271,7 +271,7 @@ static bool RoadToolbar_CtrlChanged(Window *w) /** Road toolbar window handler. */ struct BuildRoadToolbarWindow : Window { RoadType roadtype; ///< Road type to build. - const RoadTypeInfo *rti; ///< Informations about current road type + const RoadTypeInfo *rti; ///< Information about current road type int last_started_action; ///< Last started user action. BuildRoadToolbarWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 3293781b90..409c7eb6e7 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -244,7 +244,7 @@ void ClearAllCachedNames() * This is not done directly in AfterLoadGame because these * functions require that all saveload conversions have been * done. As people tend to add savegame conversion stuff after - * the intialization of the windows and caches quite some bugs + * the initialization of the windows and caches quite some bugs * had been made. * Moving this out of there is both cleaner and less bug-prone. */ diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 57b70743b4..7c54824668 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -1848,7 +1848,7 @@ bool SlObjectMemberGeneric(void *ptr, const SaveLoad *sld) break; /* SL_WRITEBYTE writes a value to the savegame to identify the type of an object. - * When loading, the value is read explictly with SlReadByte() to determine which + * When loading, the value is read explicitly with SlReadByte() to determine which * object description to use. */ case SL_WRITEBYTE: switch (action) { diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index c5fb6cdd45..aef5d4164d 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -271,7 +271,7 @@ enum SaveLoadVersion : uint16 { SLV_186, ///< 186 25833 Objects storage SLV_187, ///< 187 25899 Linkgraph - restricted flows SLV_188, ///< 188 26169 v1.4 FS#5831 Unify RV travel time - SLV_189, ///< 189 26450 Heirarchical vehicle subgroups + SLV_189, ///< 189 26450 Hierarchical vehicle subgroups SLV_190, ///< 190 26547 Separate order travel and wait times SLV_191, ///< 191 26636 FS#6026 Fix disaster vehicle storage (No bump) @@ -287,7 +287,7 @@ enum SaveLoadVersion : uint16 { SLV_EXTEND_CARGOTYPES, ///< 199 PR#6802 Extend cargotypes to 64 SLV_EXTEND_RAILTYPES, ///< 200 PR#6805 Extend railtypes to 64, adding uint16 to map array. - SLV_EXTEND_PERSISTENT_STORAGE, ///< 201 PR#6885 Extend NewGRF persistant storages. + SLV_EXTEND_PERSISTENT_STORAGE, ///< 201 PR#6885 Extend NewGRF persistent storages. SLV_EXTEND_INDUSTRY_CARGO_SLOTS, ///< 202 PR#6867 Increase industry cargo slots to 16 in, 16 out SLV_SHIP_PATH_CACHE, ///< 203 PR#7072 Add path cache for ships SLV_SHIP_ROTATION, ///< 204 PR#7065 Add extra rotation stages for ships. diff --git a/src/saveload/strings_sl.cpp b/src/saveload/strings_sl.cpp index 9e0351ae04..9c3f838a80 100644 --- a/src/saveload/strings_sl.cpp +++ b/src/saveload/strings_sl.cpp @@ -82,7 +82,7 @@ char *CopyFromOldName(StringID id) case 0xB8: c = 0x017E; break; // z with caron case 0xBC: c = 0x0152; break; // OE ligature case 0xBD: c = 0x0153; break; // oe ligature - case 0xBE: c = 0x0178; break; // Y with diaresis + case 0xBE: c = 0x0178; break; // Y with diaeresis default: break; } diff --git a/src/script/api/ai_changelog.hpp b/src/script/api/ai_changelog.hpp index 7258cf74e5..06ea548036 100644 --- a/src/script/api/ai_changelog.hpp +++ b/src/script/api/ai_changelog.hpp @@ -313,7 +313,7 @@ * destination it its catchment area. One industry tile or one town house * is enough as long as station accepts the cargo. Awarded subsidies are no * longer bound to stations used for first delivery, any station can be - * used for loading and unloading as long as cargo is transfered from + * used for loading and unloading as long as cargo is transferred from * source to destination. * \li Make AIEngine:CanRefitCargo() not report refittability to mail by * default for aircraft. It is not necessarily true. This means that even diff --git a/src/script/api/script_cargo.hpp b/src/script/api/script_cargo.hpp index d1bfdd1fcc..e977031a10 100644 --- a/src/script/api/script_cargo.hpp +++ b/src/script/api/script_cargo.hpp @@ -36,7 +36,7 @@ public: CC_LIQUID = ::CC_LIQUID, ///< Liquids (Oil, Water, Rubber) CC_REFRIGERATED = ::CC_REFRIGERATED, ///< Refrigerated cargo (Food, Fruit) CC_HAZARDOUS = ::CC_HAZARDOUS, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.) - CC_COVERED = ::CC_COVERED, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.) + CC_COVERED = ::CC_COVERED, ///< Covered/Sheltered Freight (Transportation in Box Vans, Silo Wagons, etc.) }; /** diff --git a/src/script/api/script_client.hpp b/src/script/api/script_client.hpp index 423f134c07..20cbdc7fee 100644 --- a/src/script/api/script_client.hpp +++ b/src/script/api/script_client.hpp @@ -26,7 +26,7 @@ class ScriptClient : public ScriptObject { public: /** Different constants related to ClientID. */ - enum ClientID { + enum ClientID : uint32 { CLIENT_INVALID = 0, ///< Client is not part of anything CLIENT_SERVER = 1, ///< Servers always have this ID CLIENT_FIRST = 2, ///< The first client ID diff --git a/src/script/api/script_event_types.hpp b/src/script/api/script_event_types.hpp index f13e588eed..f9b2fb87f8 100644 --- a/src/script/api/script_event_types.hpp +++ b/src/script/api/script_event_types.hpp @@ -799,8 +799,8 @@ private: /** * Event AircraftDestTooFar, indicating the next destination of an aircraft is too far away. - * This event can be trigger when the current oder of an aircraft changes, usually either when - * loading is done or when switch manually. + * This event can be triggered when the current order of an aircraft changes, usually either when + * loading is done or when switched manually. * @api ai */ class ScriptEventAircraftDestTooFar : public ScriptEvent { diff --git a/src/script/api/script_goal.cpp b/src/script/api/script_goal.cpp index 461911d3c5..4c0f5eb353 100644 --- a/src/script/api/script_goal.cpp +++ b/src/script/api/script_goal.cpp @@ -84,7 +84,7 @@ EnforcePrecondition(false, IsValidGoal(goal_id)); EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY); - /* Ensure null as used for emtpy string. */ + /* Ensure null as used for empty string. */ if (progress != nullptr && StrEmpty(progress->GetEncodedText())) { progress = nullptr; } diff --git a/src/script/api/script_road.hpp b/src/script/api/script_road.hpp index 39cf0420b6..bc230bda33 100644 --- a/src/script/api/script_road.hpp +++ b/src/script/api/script_road.hpp @@ -219,7 +219,7 @@ public: static bool AreRoadTilesConnected(TileIndex tile_from, TileIndex tile_to); /** - * Lookup function for building road parts independend on whether the + * Lookup function for building road parts independent of whether the * "building on slopes" setting is enabled or not. * This implementation can be used for abstract reasoning about a tile as * it needs the slope and existing road parts of the tile as information. @@ -250,10 +250,10 @@ public: static int32 CanBuildConnectedRoadParts(ScriptTile::Slope slope, struct Array *existing, TileIndex start, TileIndex end); /** - * Lookup function for building road parts independend on whether the + * Lookup function for building road parts independent of whether the * "building on slopes" setting is enabled or not. * This implementation can be used for reasoning about an existing tile. - * @param tile The the tile to examine. + * @param tile The tile to examine. * @param start The tile from where "tile" will be entered. * @param end The tile from where "tile" will be exited. * @pre start != end. diff --git a/src/script/api/script_story_page.hpp b/src/script/api/script_story_page.hpp index 772c162004..e806bb7664 100644 --- a/src/script/api/script_story_page.hpp +++ b/src/script/api/script_story_page.hpp @@ -92,7 +92,7 @@ public: * Create a new story page element. * @param story_page_id The page id of the story page which the page element should be appended to. * @param type Which page element type to create. - * @param reference A reference value to the object that is refered to by some page element types. When type is SPET_GOAL, this is the goal ID. When type is SPET_LOCATION, this is the TileIndex. + * @param reference A reference value to the object that is referred to by some page element types. When type is SPET_GOAL, this is the goal ID. When type is SPET_LOCATION, this is the TileIndex. * @param text The body text of page elements that allow custom text. (SPET_TEXT and SPET_LOCATION) * @return The new StoryPageElementID, or STORY_PAGE_ELEMENT_INVALID if it failed. * @pre No ScriptCompanyMode may be in scope. @@ -107,7 +107,7 @@ public: /** * Update the content of a page element * @param story_page_element_id The page id of the story page which the page element should be appended to. - * @param reference A reference value to the object that is refered to by some page element types. See also NewElement. + * @param reference A reference value to the object that is referred to by some page element types. See also NewElement. * @param text The body text of page elements that allow custom text. See also NewElement. * @return True if the action succeeded. * @pre No ScriptCompanyMode may be in scope. diff --git a/src/settings.cpp b/src/settings.cpp index 8699fd70ed..7576370ef1 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1896,7 +1896,7 @@ void LoadFromConfig(bool minimal) ValidateSettings(); - /* Display sheduled errors */ + /* Display scheduled errors */ extern void ScheduleErrorMessage(ErrorList &datas); ScheduleErrorMessage(_settings_error_list); if (FindWindowById(WC_ERRMSG, 0) == nullptr) ShowFirstError(); diff --git a/src/settings_type.h b/src/settings_type.h index fea9b1a007..0c28e78b4c 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -231,7 +231,7 @@ struct SoundSettings { bool news_ticker; ///< Play a ticker sound when a news item is published. bool news_full; ///< Play sound effects associated to certain news types. bool new_year; ///< Play sound on new year, summarising the performance during the last year. - bool confirm; ///< Play sound effect on succesful constructions or other actions. + bool confirm; ///< Play sound effect on successful constructions or other actions. bool click_beep; ///< Beep on a random selection of buttons. bool disaster; ///< Play disaster and accident sounds. bool vehicle; ///< Play vehicle sound effects. diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 5cb21952e7..18f448b739 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -872,7 +872,7 @@ static void ShipController(Ship *v) if (st->facilities & FACIL_DOCK) { // ugly, ugly workaround for problem with ships able to drop off cargo at wrong stations ShipArrivesAt(v, st); v->BeginLoading(); - } else { // leave stations without docks right aways + } else { // leave stations without docks right away v->current_order.MakeLeaveStation(); v->IncrementRealOrderIndex(); } @@ -948,7 +948,7 @@ static void ShipController(Ship *v) /* Bridge exit */ if (_settings_game.vehicle.ship_collision_avoidance && gp.new_tile != TileVirtXY(v->x_pos, v->y_pos)) HandleSpeedOnAqueduct(v, gp.new_tile, v->tile); - /* Ship is back on the bridge head, we need to comsume its path + /* Ship is back on the bridge head, we need to consume its path * cache entry here as we didn't have to choose a ship track. */ if (!v->path.empty()) v->path.pop_front(); } diff --git a/src/sound/allegro_s.h b/src/sound/allegro_s.h index 255be66c74..2ad3717401 100644 --- a/src/sound/allegro_s.h +++ b/src/sound/allegro_s.h @@ -7,7 +7,7 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file allegro_s.h Base fo playing sound via Allegro. */ +/** @file allegro_s.h Base for playing sound via Allegro. */ #ifndef SOUND_ALLEGRO_H #define SOUND_ALLEGRO_H diff --git a/src/sound/sdl2_s.cpp b/src/sound/sdl2_s.cpp new file mode 100644 index 0000000000..98839b1c22 --- /dev/null +++ b/src/sound/sdl2_s.cpp @@ -0,0 +1,70 @@ +/* $Id$ */ + +/* + * This file is part of OpenTTD. + * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file sdl2_s.cpp Playing sound via SDL2. */ + +#ifdef WITH_SDL2 + +#include "../stdafx.h" + +#include "../mixer.h" +#include "sdl_s.h" +#include + +#include "../safeguards.h" + +/** Factory for the SDL sound driver. */ +static FSoundDriver_SDL iFSoundDriver_SDL; + +/** + * Callback that fills the sound buffer. + * @param userdata Ignored. + * @param stream The stream to put data into. + * @param len The length of the stream in bytes. + */ +static void CDECL fill_sound_buffer(void *userdata, Uint8 *stream, int len) +{ + MxMixSamples(stream, len / 4); +} + +const char *SoundDriver_SDL::Start(const char * const *parm) +{ + SDL_AudioSpec spec; + SDL_AudioSpec spec_actual; + + /* Only initialise SDL if the video driver hasn't done it already */ + int ret_code = 0; + if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) { + ret_code = SDL_Init(SDL_INIT_AUDIO); + } else if (SDL_WasInit(SDL_INIT_AUDIO) == 0) { + ret_code = SDL_InitSubSystem(SDL_INIT_AUDIO); + } + if (ret_code == -1) return SDL_GetError(); + + spec.freq = GetDriverParamInt(parm, "hz", 44100); + spec.format = AUDIO_S16SYS; + spec.channels = 2; + spec.samples = GetDriverParamInt(parm, "samples", 1024); + spec.callback = fill_sound_buffer; + SDL_AudioDeviceID dev = SDL_OpenAudioDevice(nullptr, 0, &spec, &spec_actual, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE); + MxInitialize(spec_actual.freq); + SDL_PauseAudioDevice(dev, 0); + return nullptr; +} + +void SoundDriver_SDL::Stop() +{ + SDL_CloseAudio(); + SDL_QuitSubSystem(SDL_INIT_AUDIO); + if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) { + SDL_Quit(); // If there's nothing left, quit SDL + } +} + +#endif /* WITH_SDL2 */ diff --git a/src/sound/sdl_s.h b/src/sound/sdl_s.h index 2d36b46297..47352b5175 100644 --- a/src/sound/sdl_s.h +++ b/src/sound/sdl_s.h @@ -7,7 +7,7 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file sdl_s.h Base fo playing sound via SDL. */ +/** @file sdl_s.h Base for playing sound via SDL. */ #ifndef SOUND_SDL_H #define SOUND_SDL_H diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index d136bce544..d119341093 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3305,7 +3305,7 @@ void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, Ro /* Drive-through stop */ uint sprite_offset = 5 - image; - /* Road underlay takes precendence over tram */ + /* Road underlay takes precedence over tram */ if (rti->UsesOverlay()) { SpriteID ground = GetCustomRoadSprite(rti, INVALID_TILE, ROTSG_GROUND); DrawSprite(ground + sprite_offset, PAL_NONE, x, y); diff --git a/src/story.cpp b/src/story.cpp index 4c7063cf0c..d2a357b5fc 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -45,7 +45,7 @@ INSTANTIATE_POOL_METHODS(StoryPage) * @param tile The tile parameter of the DoCommand proc * @param reference The reference parameter of the DoCommand proc (p2) * @param text The text parameter of the DoCommand proc - * @return true, if and only if the given parameters are valid for the given page elment type and page id. + * @return true, if and only if the given parameters are valid for the given page element type and page id. */ static bool VerifyElementContentParameters(StoryPageID page_id, StoryPageElementType type, TileIndex tile, uint32 reference, const char *text) { diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 5ce77cc63b..316e79ebb9 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -263,7 +263,7 @@ protected: /** * Counts how many pixels of height that are used by Date and Title * (excluding marginal after Title, as each body element has - * an empty row before the elment). + * an empty row before the element). * @param max_width Available width to display content. * @return the height in pixels. */ @@ -412,7 +412,7 @@ public: this->vscroll = this->GetScrollbar(WID_SB_SCROLLBAR); this->vscroll->SetStepSize(FONT_HEIGHT_NORMAL); - /* Initalize page sort. */ + /* Initialize page sort. */ this->story_pages.SetSortFuncs(StoryBookWindow::page_sorter_funcs); this->story_pages.ForceRebuild(); this->BuildStoryPageList(); diff --git a/src/table/elrail_data.h b/src/table/elrail_data.h index 6915360035..df5788fa87 100644 --- a/src/table/elrail_data.h +++ b/src/table/elrail_data.h @@ -412,7 +412,7 @@ static const SortableSpriteStruct RailCatenarySpriteData_Tunnel[] = { * Identifiers for Wires: *
  1. Direction of the wire
  2. *
  3. Slope of the tile for diagonals, placement inside the track for horiz/vertical pieces
  4. - *
  5. Place where a pylon shoule be
+ *
  • Place where a pylon should be
  • * Identifiers for Pylons: *
    1. Direction of the wire
    2. *
    3. Slope of the tile
    4. diff --git a/src/table/gameopt_settings.ini b/src/table/gameopt_settings.ini index 1b52fac336..bc1ca7a7b6 100644 --- a/src/table/gameopt_settings.ini +++ b/src/table/gameopt_settings.ini @@ -12,7 +12,7 @@ static uint16 _old_diff_custom[GAME_DIFFICULTY_NUM]; uint8 _old_diff_level; ///< Old difficulty level from old savegames uint8 _old_units; ///< Old units from old savegames -/* Most of these strings are used both for gameopt-backward compatability +/* Most of these strings are used both for gameopt-backward compatibility * and the settings tables. The rest is here for consistency. */ static const char *_locale_currencies = "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|RON|RUR|SIT|SEK|YTL|SKK|BRL|EEK|custom"; static const char *_locale_units = "imperial|metric|si"; diff --git a/src/table/settings.h.preamble b/src/table/settings.h.preamble index 83de348c34..8e0a2c653d 100644 --- a/src/table/settings.h.preamble +++ b/src/table/settings.h.preamble @@ -33,7 +33,7 @@ static size_t ConvertLandscape(const char *value); * Thse are for members in the struct described by the current * #SettingDesc list / .ini file. Here, 'base' specifies type of the * struct while 'var' points out the member of the struct (the actual - * struct to store it in is implicitely defined by the #SettingDesc + * struct to store it in is implicitly defined by the #SettingDesc * list / .ini file preamble the entry is in). * * The something part defines the type of variable to store. There are a diff --git a/src/table/settings.ini b/src/table/settings.ini index 3e818613c3..035463238f 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -146,7 +146,7 @@ enumlist = ; Saved settings variables. -; Do not ADD or REMOVE something in this "difficulty.XXX" table or before it. It breaks savegame compatability. +; Do not ADD or REMOVE something in this "difficulty.XXX" table or before it. It breaks savegame compatibility. [SDT_VAR] base = GameSettings var = difficulty.max_no_competitors @@ -5256,7 +5256,7 @@ cat = SC_EXPERT ; Since the network code (CmdChangeSetting and friends) use the index in this array to decide ; which setting the server is talking about all conditional compilation of this array must be at the ; end. This isn't really the best solution, the settings the server can tell the client about should -; either use a seperate array or some other form of identifier. +; either use a separate array or some other form of identifier. ; ; We might need to emulate a right mouse button on mac diff --git a/src/table/sprites.h b/src/table/sprites.h index 5cc16b918e..d139043fdf 100644 --- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -27,10 +27,10 @@ * All sprites which are described here are referenced only one to a handful of times * throughout the code. When introducing new sprite enums, use meaningful names. * Don't be lazy and typing, and only use abbreviations when their meaning is clear or - * the length of the enum would get out of hand. In that case EXPLAIN THE ABBREVATION + * the length of the enum would get out of hand. In that case EXPLAIN THE ABBREVIATION * IN THIS FILE, and perhaps add some comments in the code where it is used. * Now, don't whine about this being too much typing work if the enums are like - * 30 characters in length. If your editor doen't help you simplifying your work, + * 30 characters in length. If your editor doesn't help you simplifying your work, * get a proper editor. If your Operating Systems don't have any decent editors, * get a proper Operating System. * diff --git a/src/tile_map.cpp b/src/tile_map.cpp index 5d85ef9668..a30d1e4426 100644 --- a/src/tile_map.cpp +++ b/src/tile_map.cpp @@ -76,8 +76,8 @@ Slope GetTileSlope(TileIndex tile, int *h) /** * Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles). * - * @param x X coordinate of the tile to compute slope of, may be ouside the map. - * @param y Y coordinate of the tile to compute slope of, may be ouside the map. + * @param x X coordinate of the tile to compute slope of, may be outside the map. + * @param y Y coordinate of the tile to compute slope of, may be outside the map. * @param h If not \c nullptr, pointer to storage of z height. * @return Slope of the tile, except for the HALFTILE part. */ diff --git a/src/tile_map.h b/src/tile_map.h index b67e85237c..07763e9434 100644 --- a/src/tile_map.h +++ b/src/tile_map.h @@ -40,8 +40,8 @@ static inline uint TileHeight(TileIndex tile) /** * Returns the height of a tile, also for tiles outside the map (virtual "black" tiles). * - * @param x X coordinate of the tile, may be ouside the map. - * @param y Y coordinate of the tile, may be ouside the map. + * @param x X coordinate of the tile, may be outside the map. + * @param y Y coordinate of the tile, may be outside the map. * @return The height in the same unit as TileHeight. */ static inline uint TileHeightOutsideMap(int x, int y) @@ -82,8 +82,8 @@ static inline uint TilePixelHeight(TileIndex tile) /** * Returns the height of a tile in pixels, also for tiles outside the map (virtual "black" tiles). * - * @param x X coordinate of the tile, may be ouside the map. - * @param y Y coordinate of the tile, may be ouside the map. + * @param x X coordinate of the tile, may be outside the map. + * @param y Y coordinate of the tile, may be outside the map. * @return The height in pixels in the same unit as TilePixelHeight. */ static inline uint TilePixelHeightOutsideMap(int x, int y) diff --git a/src/town.h b/src/town.h index ef5b9b43a2..93601f3596 100644 --- a/src/town.h +++ b/src/town.h @@ -41,7 +41,7 @@ static const TownID INVALID_TOWN = 0xFFFF; static const uint TOWN_GROWTH_WINTER = 0xFFFFFFFE; ///< The town only needs this cargo in the winter (any amount) static const uint TOWN_GROWTH_DESERT = 0xFFFFFFFF; ///< The town needs the cargo for growth when on desert (any amount) static const uint16 TOWN_GROWTH_RATE_NONE = 0xFFFF; ///< Special value for Town::growth_rate to disable town growth. -static const uint16 MAX_TOWN_GROWTH_TICKS = 930; ///< Max amount of original town ticks that still fit into uint16, about equal to UINT16_MAX / TOWN_GROWTH_TICKS but sligtly less to simplify calculations +static const uint16 MAX_TOWN_GROWTH_TICKS = 930; ///< Max amount of original town ticks that still fit into uint16, about equal to UINT16_MAX / TOWN_GROWTH_TICKS but slightly less to simplify calculations typedef Pool TownPool; extern TownPool _town_pool; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 4d5d791223..7bfcf86a07 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -966,7 +966,7 @@ public: this->vscroll->SetCapacityFromWidget(this, WID_TD_LIST); } - virtual void OnEditboxChanged(int wid) + void OnEditboxChanged(int wid) override { if (wid == WID_TD_FILTER) { this->string_filter.SetFilterTerm(this->townname_editbox.text.buf); @@ -1011,7 +1011,7 @@ public: this->towns.Sort(); this->towns.shrink_to_fit(); this->towns.RebuildDone(); - this->vscroll->SetCount(this->towns.size()); // Update scrollbar as well. + this->vscroll->SetCount((int)this->towns.size()); // Update scrollbar as well. } break; default: diff --git a/src/townname.cpp b/src/townname.cpp index d382adf349..6d30358868 100644 --- a/src/townname.cpp +++ b/src/townname.cpp @@ -124,7 +124,7 @@ bool GenerateTownName(uint32 *townnameparts, TownNames *town_names) TownNameParams par(_settings_game.game_creation.town_name); /* This function is called very often without entering the gameloop - * inbetween. So reset layout cache to prevent it from growing too big. */ + * in between. So reset layout cache to prevent it from growing too big. */ Layouter::ReduceLineCache(); /* Do not set i too low, since when we run out of names, we loop diff --git a/src/track_func.h b/src/track_func.h index 0e0a4d42e1..c221d73920 100644 --- a/src/track_func.h +++ b/src/track_func.h @@ -19,7 +19,7 @@ /** * Iterate through each set Track in a TrackBits value. - * For more informations see FOR_EACH_SET_BIT_EX. + * For more information see FOR_EACH_SET_BIT_EX. * * @param var Loop index variable that stores fallowing set track. Must be of type Track. * @param track_bits The value to iterate through (any expression). @@ -127,7 +127,7 @@ static inline TrackdirBits TrackdirToTrackdirBits(Trackdir trackdir) /** * Removes first Track from TrackBits and returns it * - * This function searchs for the first bit in the TrackBits, + * This function searches for the first bit in the TrackBits, * remove this bit from the parameter and returns the found * bit as Track value. It returns INVALID_TRACK if the * parameter was TRACK_BIT_NONE or INVALID_TRACK_BIT. This @@ -647,7 +647,7 @@ static inline bool IsDiagonalTrackdir(Trackdir trackdir) /** * Checks if the given tracks overlap, ie form a crossing. Basically this - * means when there is more than one track on the tile, exept when there are + * means when there is more than one track on the tile, except when there are * two parallel tracks. * @param bits The tracks present. * @return Whether the tracks present overlap in any way. diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index d8fe3079eb..fb6ad9c813 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1531,7 +1531,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u * b) the 'next' part is an engine that becomes a front engine. * c) there is no 'next' part, nothing else happens * 5) non front engine gets moved and becomes a new train, nothing else happens - * 6) non front engine gets moved within a train / to another train, nothing hapens + * 6) non front engine gets moved within a train / to another train, nothing happens * 7) wagon gets moved, nothing happens */ if (src == original_src_head && src->IsEngine() && (!src->IsFrontEngine() || new_head)) { diff --git a/src/tree_map.h b/src/tree_map.h index e524f825fb..47c7289a7b 100644 --- a/src/tree_map.h +++ b/src/tree_map.h @@ -100,8 +100,8 @@ static inline TreeGround GetTreeGround(TileIndex t) * that this value doesn't count the number of trees on a tile, use * #GetTreeCount instead. This function instead returns some kind of * groundtype of the tile. As the map-array is finite in size and - * the informations about the trees must be saved somehow other - * informations about a tile must be saved somewhere encoded in the + * the information about the trees must be saved somehow other + * information about a tile must be saved somewhere encoded in the * tile. So this function returns the density of a tile for sub arctic * and sub tropical games. This means for sub arctic the type of snowline * (0 to 3 for all 4 types of snowtiles) and for sub tropical the value @@ -264,7 +264,7 @@ static inline void SetTreeCounter(TileIndex t, uint c) /** * Make a tree-tile. * - * This functions change the tile to a tile with trees and all informations which belongs to it. + * This functions change the tile to a tile with trees and all information which belongs to it. * * @param t The tile to make a tree-tile from * @param type The type of the tree diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 2de9b763cd..1b2246cd44 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -1410,7 +1410,7 @@ static void DrawBridgeRoadBits(TileIndex head_tile, int x, int y, int z, int off static const SpriteID front_offsets[6] = { 97, 98, 103, 106, 104, 105 }; if (head || !IsInvisibilitySet(TO_BRIDGES)) { - /* Road underlay takes precendence over tram */ + /* Road underlay takes precedence over tram */ trans_back[0] = !head && IsTransparencySet(TO_BRIDGES); if (road_rti != nullptr) { if (road_rti->UsesOverlay()) { @@ -1444,7 +1444,7 @@ static void DrawBridgeRoadBits(TileIndex head_tile, int x, int y, int z, int off } } - /* Road catenary takes precendence over tram */ + /* Road catenary takes precedence over tram */ trans_back[3] = IsTransparencySet(TO_CATENARY); trans_front[0] = IsTransparencySet(TO_CATENARY); if (road_rti != nullptr && HasRoadCatenaryDrawn(road_rt)) { @@ -1689,7 +1689,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti) DrawRoadOverlays(ti, PAL_NONE, road_rti, tram_rti, sprite_offset, sprite_offset); - /* Road catenary takes precendence over tram */ + /* Road catenary takes precedence over tram */ SpriteID catenary_sprite_base = 0; if (road_rti != nullptr && HasRoadCatenaryDrawn(road_rt)) { catenary_sprite_base = GetCustomRoadSprite(road_rti, ti->tile, ROTSG_CATENARY_FRONT); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 1b1c6f8c1f..ab5e224d7f 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -3253,7 +3253,7 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command, Tile return CommandCost(); } - if (command & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancelation of depot orders + if (command & DEPOT_DONT_CANCEL) return CMD_ERROR; // Requested no cancellation of depot orders cancel_order(); return CommandCost(); } diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 55cd267462..5794ed1430 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -143,7 +143,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint /* Vehicle construction needs random bits, so we have to save the random * seeds to prevent desyncs. */ SavedRandomSeeds saved_seeds; - if (flags != subflags) SaveRandomSeeds(&saved_seeds); + SaveRandomSeeds(&saved_seeds); Vehicle *v = nullptr; switch (type) { @@ -194,6 +194,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint } } + /* Only restore if we actually did some refitting */ if (flags != subflags) RestoreRandomSeeds(saved_seeds); return value; diff --git a/src/video/cocoa/cocoa_keys.h b/src/video/cocoa/cocoa_keys.h index 426befd184..e2d5ee9fc0 100644 --- a/src/video/cocoa/cocoa_keys.h +++ b/src/video/cocoa/cocoa_keys.h @@ -126,7 +126,7 @@ #define QZ_KP0 0x52 #define QZ_KP_PERIOD 0x41 -/* Wierd, these keys are on my iBook under MacOS X */ +/* Weird, these keys are on my iBook under MacOS X */ #define QZ_IBOOK_ENTER 0x34 #define QZ_IBOOK_LEFT 0x3B #define QZ_IBOOK_RIGHT 0x3C diff --git a/src/video/sdl2_v.cpp b/src/video/sdl2_v.cpp new file mode 100644 index 0000000000..36fc03c387 --- /dev/null +++ b/src/video/sdl2_v.cpp @@ -0,0 +1,836 @@ +/* $Id$ */ + +/* + * This file is part of OpenTTD. + * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file sdl2_v.cpp Implementation of the SDL2 video driver. */ + +#ifdef WITH_SDL2 + +#include "../stdafx.h" +#include "../openttd.h" +#include "../gfx_func.h" +#include "../rev.h" +#include "../blitter/factory.hpp" +#include "../network/network.h" +#include "../thread.h" +#include "../progress.h" +#include "../core/random_func.hpp" +#include "../core/math_func.hpp" +#include "../fileio_func.h" +#include "../framerate_type.h" +#include "sdl2_v.h" +#include +#include +#include +#include +#if defined(__MINGW32__) +#include "../3rdparty/mingw-std-threads/mingw.mutex.h" +#include "../3rdparty/mingw-std-threads/mingw.condition_variable.h" +#endif + +#include "../safeguards.h" + +static FVideoDriver_SDL iFVideoDriver_SDL; + +static SDL_Window *_sdl_window; +static SDL_Surface *_sdl_surface; +static SDL_Surface *_sdl_realscreen; + +/** Whether the drawing is/may be done in a separate thread. */ +static bool _draw_threaded; +/** Mutex to keep the access to the shared memory controlled. */ +static std::recursive_mutex *_draw_mutex = nullptr; +/** Signal to draw the next frame. */ +static std::condition_variable_any *_draw_signal = nullptr; +/** Should we keep continue drawing? */ +static volatile bool _draw_continue; +static Palette _local_palette; +static SDL_Palette *_sdl_palette; + +#define MAX_DIRTY_RECTS 100 +static SDL_Rect _dirty_rects[MAX_DIRTY_RECTS]; +static int _num_dirty_rects; + +/* Size of window */ +static int _window_size_w; +static int _window_size_h; + +void VideoDriver_SDL::MakeDirty(int left, int top, int width, int height) +{ + if (_num_dirty_rects < MAX_DIRTY_RECTS) { + _dirty_rects[_num_dirty_rects].x = left; + _dirty_rects[_num_dirty_rects].y = top; + _dirty_rects[_num_dirty_rects].w = width; + _dirty_rects[_num_dirty_rects].h = height; + } + _num_dirty_rects++; +} + +static void UpdatePalette(bool init = false) +{ + SDL_Color pal[256]; + + for (int i = 0; i != _local_palette.count_dirty; i++) { + pal[i].r = _local_palette.palette[_local_palette.first_dirty + i].r; + pal[i].g = _local_palette.palette[_local_palette.first_dirty + i].g; + pal[i].b = _local_palette.palette[_local_palette.first_dirty + i].b; + pal[i].a = 0; + } + + SDL_SetPaletteColors(_sdl_palette, pal, _local_palette.first_dirty, _local_palette.count_dirty); + SDL_SetSurfacePalette(_sdl_surface, _sdl_palette); + + if (_sdl_surface != _sdl_realscreen && init) { + /* When using a shadow surface, also set our palette on the real screen. This lets SDL + * allocate as many colors (or approximations) as + * possible, instead of using only the default SDL + * palette. This allows us to get more colors exactly + * right and might allow using better approximations for + * other colors. + * + * Note that colors allocations are tried in-order, so + * this favors colors further up into the palette. Also + * note that if two colors from the same animation + * sequence are approximated using the same color, that + * animation will stop working. + * + * Since changing the system palette causes the colours + * to change right away, and allocations might + * drastically change, we can't use this for animation, + * since that could cause weird coloring between the + * palette change and the blitting below, so we only set + * the real palette during initialisation. + */ + SDL_SetSurfacePalette(_sdl_realscreen, _sdl_palette); + } + + if (_sdl_surface != _sdl_realscreen && !init) { + /* We're not using real hardware palette, but are letting SDL + * approximate the palette during shadow -> screen copy. To + * change the palette, we need to recopy the entire screen. + * + * Note that this operation can slow down the rendering + * considerably, especially since changing the shadow + * palette will need the next blit to re-detect the + * best mapping of shadow palette colors to real palette + * colors from scratch. + */ + SDL_BlitSurface(_sdl_surface, nullptr, _sdl_realscreen, nullptr); + SDL_UpdateWindowSurface(_sdl_window); + } +} + +static void InitPalette() +{ + _local_palette = _cur_palette; + _local_palette.first_dirty = 0; + _local_palette.count_dirty = 256; + UpdatePalette(true); +} + +static void CheckPaletteAnim() +{ + if (_cur_palette.count_dirty != 0) { + Blitter *blitter = BlitterFactory::GetCurrentBlitter(); + + switch (blitter->UsePaletteAnimation()) { + case Blitter::PALETTE_ANIMATION_VIDEO_BACKEND: + UpdatePalette(); + break; + + case Blitter::PALETTE_ANIMATION_BLITTER: + blitter->PaletteAnimate(_local_palette); + break; + + case Blitter::PALETTE_ANIMATION_NONE: + break; + + default: + NOT_REACHED(); + } + _cur_palette.count_dirty = 0; + } +} + +static void DrawSurfaceToScreen() +{ + PerformanceMeasurer framerate(PFE_VIDEO); + + int n = _num_dirty_rects; + if (n == 0) return; + + _num_dirty_rects = 0; + + if (n > MAX_DIRTY_RECTS) { + if (_sdl_surface != _sdl_realscreen) { + SDL_BlitSurface(_sdl_surface, nullptr, _sdl_realscreen, nullptr); + } + + SDL_UpdateWindowSurface(_sdl_window); + } else { + if (_sdl_surface != _sdl_realscreen) { + for (int i = 0; i < n; i++) { + SDL_BlitSurface( + _sdl_surface, &_dirty_rects[i], + _sdl_realscreen, &_dirty_rects[i]); + } + } + + SDL_UpdateWindowSurfaceRects(_sdl_window, _dirty_rects, n); + } +} + +static void DrawSurfaceToScreenThread() +{ + /* First tell the main thread we're started */ + std::unique_lock lock(*_draw_mutex); + _draw_signal->notify_one(); + + /* Now wait for the first thing to draw! */ + _draw_signal->wait(*_draw_mutex); + + while (_draw_continue) { + CheckPaletteAnim(); + /* Then just draw and wait till we stop */ + DrawSurfaceToScreen(); + _draw_signal->wait(lock); + } +} + +static void GetVideoModes() +{ + int modes = SDL_GetNumDisplayModes(0); + if (modes == 0) usererror("sdl: no modes available"); + + _resolutions.clear(); + + SDL_DisplayMode mode; + for (int i = 0; i < modes; i++) { + SDL_GetDisplayMode(0, i, &mode); + + uint w = mode.w; + uint h = mode.h; + + if (w < 640 || h < 480) continue; // reject too small resolutions + + if (std::find(_resolutions.begin(), _resolutions.end(), Dimension(w, h)) != _resolutions.end()) continue; + _resolutions.emplace_back(w, h); + } + if (_resolutions.empty()) usererror("No usable screen resolutions found!\n"); + SortResolutions(); +} + +static void GetAvailableVideoMode(uint *w, uint *h) +{ + /* All modes available? */ + if (!_fullscreen || _resolutions.empty()) return; + + /* Is the wanted mode among the available modes? */ + if (std::find(_resolutions.begin(), _resolutions.end(), Dimension(*w, *h)) != _resolutions.end()) return; + + /* Use the closest possible resolution */ + uint best = 0; + uint delta = Delta(_resolutions[0].width, *w) * Delta(_resolutions[0].height, *h); + for (uint i = 1; i != _resolutions.size(); ++i) { + uint newdelta = Delta(_resolutions[i].width, *w) * Delta(_resolutions[i].height, *h); + if (newdelta < delta) { + best = i; + delta = newdelta; + } + } + *w = _resolutions[best].width; + *h = _resolutions[best].height; +} + +bool VideoDriver_SDL::CreateMainSurface(uint w, uint h, bool resize) +{ + SDL_Surface *newscreen; + char caption[50]; + int bpp = BlitterFactory::GetCurrentBlitter()->GetScreenDepth(); + + GetAvailableVideoMode(&w, &h); + + DEBUG(driver, 1, "SDL2: using mode %ux%ux%d", w, h, bpp); + + if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals"); + + /* Free any previously allocated shadow surface */ + if (_sdl_surface != nullptr && _sdl_surface != _sdl_realscreen) SDL_FreeSurface(_sdl_surface); + + seprintf(caption, lastof(caption), "OpenTTD %s", _openttd_revision); + + if (_sdl_window == nullptr) { + Uint32 flags = SDL_WINDOW_SHOWN; + + if (_fullscreen) { + flags |= SDL_WINDOW_FULLSCREEN; + } else { + flags |= SDL_WINDOW_RESIZABLE; + } + + _sdl_window = SDL_CreateWindow( + caption, + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + w, h, + flags); + + if (_sdl_window == nullptr) { + DEBUG(driver, 0, "SDL2: Couldn't allocate a window to draw on"); + return false; + } + + char icon_path[MAX_PATH]; + if (FioFindFullPath(icon_path, lastof(icon_path), BASESET_DIR, "openttd.32.bmp") != nullptr) { + /* Give the application an icon */ + SDL_Surface *icon = SDL_LoadBMP(icon_path); + if (icon != nullptr) { + /* Get the colourkey, which will be magenta */ + uint32 rgbmap = SDL_MapRGB(icon->format, 255, 0, 255); + + SDL_SetColorKey(icon, SDL_TRUE, rgbmap); + SDL_SetWindowIcon(_sdl_window, icon); + SDL_FreeSurface(icon); + } + } + } + + if (resize) SDL_SetWindowSize(_sdl_window, w, h); + + newscreen = SDL_GetWindowSurface(_sdl_window); + if (newscreen == NULL) { + DEBUG(driver, 0, "SDL2: Couldn't get window surface: %s", SDL_GetError()); + return false; + } + + _sdl_realscreen = newscreen; + + if (bpp == 8) { + newscreen = SDL_CreateRGBSurfaceWithFormat(0, w, h, 8, SDL_PIXELFORMAT_INDEX8); + + if (newscreen == nullptr) { + DEBUG(driver, 0, "SDL2: Couldn't allocate shadow surface: %s", SDL_GetError()); + return false; + } + } + + if (_sdl_palette == nullptr) { + _sdl_palette = SDL_AllocPalette(256); + } + + if (_sdl_palette == nullptr) { + DEBUG(driver, 0, "SDL_AllocPalette() failed: %s", SDL_GetError()); + return false; + } + + /* Delay drawing for this cycle; the next cycle will redraw the whole screen */ + _num_dirty_rects = 0; + + _screen.width = newscreen->w; + _screen.height = newscreen->h; + _screen.pitch = newscreen->pitch / (bpp / 8); + _screen.dst_ptr = newscreen->pixels; + _sdl_surface = newscreen; + + /* When in full screen, we will always have the mouse cursor + * within the window, even though SDL does not give us the + * appropriate event to know this. */ + if (_fullscreen) _cursor.in_window = true; + + Blitter *blitter = BlitterFactory::GetCurrentBlitter(); + blitter->PostResize(); + + InitPalette(); + + GameSizeChanged(); + + return true; +} + +bool VideoDriver_SDL::ClaimMousePointer() +{ + SDL_ShowCursor(0); + return true; +} + +struct VkMapping { + SDL_Keycode vk_from; + byte vk_count; + byte map_to; +}; + +#define AS(x, z) {x, 0, z} +#define AM(x, y, z, w) {x, (byte)(y - x), z} + +static const VkMapping _vk_mapping[] = { + /* Pageup stuff + up/down */ + AM(SDLK_PAGEUP, SDLK_PAGEDOWN, WKC_PAGEUP, WKC_PAGEDOWN), + AS(SDLK_UP, WKC_UP), + AS(SDLK_DOWN, WKC_DOWN), + AS(SDLK_LEFT, WKC_LEFT), + AS(SDLK_RIGHT, WKC_RIGHT), + + AS(SDLK_HOME, WKC_HOME), + AS(SDLK_END, WKC_END), + + AS(SDLK_INSERT, WKC_INSERT), + AS(SDLK_DELETE, WKC_DELETE), + + /* Map letters & digits */ + AM(SDLK_a, SDLK_z, 'A', 'Z'), + AM(SDLK_0, SDLK_9, '0', '9'), + + AS(SDLK_ESCAPE, WKC_ESC), + AS(SDLK_PAUSE, WKC_PAUSE), + AS(SDLK_BACKSPACE, WKC_BACKSPACE), + + AS(SDLK_SPACE, WKC_SPACE), + AS(SDLK_RETURN, WKC_RETURN), + AS(SDLK_TAB, WKC_TAB), + + /* Function keys */ + AM(SDLK_F1, SDLK_F12, WKC_F1, WKC_F12), + + /* Numeric part. */ + AM(SDLK_KP_0, SDLK_KP_9, '0', '9'), + AS(SDLK_KP_DIVIDE, WKC_NUM_DIV), + AS(SDLK_KP_MULTIPLY, WKC_NUM_MUL), + AS(SDLK_KP_MINUS, WKC_NUM_MINUS), + AS(SDLK_KP_PLUS, WKC_NUM_PLUS), + AS(SDLK_KP_ENTER, WKC_NUM_ENTER), + AS(SDLK_KP_PERIOD, WKC_NUM_DECIMAL), + + /* Other non-letter keys */ + AS(SDLK_SLASH, WKC_SLASH), + AS(SDLK_SEMICOLON, WKC_SEMICOLON), + AS(SDLK_EQUALS, WKC_EQUALS), + AS(SDLK_LEFTBRACKET, WKC_L_BRACKET), + AS(SDLK_BACKSLASH, WKC_BACKSLASH), + AS(SDLK_RIGHTBRACKET, WKC_R_BRACKET), + + AS(SDLK_QUOTE, WKC_SINGLEQUOTE), + AS(SDLK_COMMA, WKC_COMMA), + AS(SDLK_MINUS, WKC_MINUS), + AS(SDLK_PERIOD, WKC_PERIOD) +}; + +static uint ConvertSdlKeyIntoMy(SDL_Keysym *sym, WChar *character) +{ + const VkMapping *map; + uint key = 0; + + for (map = _vk_mapping; map != endof(_vk_mapping); ++map) { + if ((uint)(sym->sym - map->vk_from) <= map->vk_count) { + key = sym->sym - map->vk_from + map->map_to; + break; + } + } + + /* check scancode for BACKQUOTE key, because we want the key left of "1", not anything else (on non-US keyboards) */ +#if defined(_WIN32) || defined(__OS2__) + if (sym->scancode == 41) key = WKC_BACKQUOTE; +#elif defined(__APPLE__) + if (sym->scancode == 10) key = WKC_BACKQUOTE; +#elif defined(__SVR4) && defined(__sun) + if (sym->scancode == 60) key = WKC_BACKQUOTE; + if (sym->scancode == 49) key = WKC_BACKSPACE; +#elif defined(__sgi__) + if (sym->scancode == 22) key = WKC_BACKQUOTE; +#else + if (sym->scancode == 49) key = WKC_BACKQUOTE; +#endif + + /* META are the command keys on mac */ + if (sym->mod & KMOD_GUI) key |= WKC_META; + if (sym->mod & KMOD_SHIFT) key |= WKC_SHIFT; + if (sym->mod & KMOD_CTRL) key |= WKC_CTRL; + if (sym->mod & KMOD_ALT) key |= WKC_ALT; + + /* The mod keys have no character. Prevent '?' */ + if (sym->mod & KMOD_GUI || + sym->mod & KMOD_SHIFT || + sym->mod & KMOD_CTRL || + sym->mod & KMOD_ALT) { + *character = WKC_NONE; + } else { + *character = sym->sym; + } + + return key; +} + +/** + * Like ConvertSdlKeyIntoMy(), but takes an SDL_Keycode as input + * instead of an SDL_Keysym. + */ +static uint ConvertSdlKeycodeIntoMy(SDL_Keycode kc) +{ + const VkMapping *map; + uint key = 0; + + for (map = _vk_mapping; map != endof(_vk_mapping); ++map) { + if ((uint)(kc - map->vk_from) <= map->vk_count) { + key = kc - map->vk_from + map->map_to; + break; + } + } + + /* check scancode for BACKQUOTE key, because we want the key left + of "1", not anything else (on non-US keyboards) */ + SDL_Scancode sc = SDL_GetScancodeFromKey(kc); + if (sc == SDL_SCANCODE_GRAVE) key = WKC_BACKQUOTE; + + return key; +} + +int VideoDriver_SDL::PollEvent() +{ + SDL_Event ev; + + if (!SDL_PollEvent(&ev)) return -2; + + switch (ev.type) { + case SDL_MOUSEMOTION: + if (_cursor.UpdateCursorPosition(ev.motion.x, ev.motion.y, true)) { + SDL_WarpMouseInWindow(_sdl_window, _cursor.pos.x, _cursor.pos.y); + } + HandleMouseEvents(); + break; + + case SDL_MOUSEWHEEL: + if (ev.wheel.y > 0) { + _cursor.wheel--; + } else if (ev.wheel.y < 0) { + _cursor.wheel++; + } + break; + + case SDL_MOUSEBUTTONDOWN: + if (_rightclick_emulate && SDL_GetModState() & KMOD_CTRL) { + ev.button.button = SDL_BUTTON_RIGHT; + } + + switch (ev.button.button) { + case SDL_BUTTON_LEFT: + _left_button_down = true; + break; + + case SDL_BUTTON_RIGHT: + _right_button_down = true; + _right_button_clicked = true; + break; + + default: break; + } + HandleMouseEvents(); + break; + + case SDL_MOUSEBUTTONUP: + if (_rightclick_emulate) { + _right_button_down = false; + _left_button_down = false; + _left_button_clicked = false; + } else if (ev.button.button == SDL_BUTTON_LEFT) { + _left_button_down = false; + _left_button_clicked = false; + } else if (ev.button.button == SDL_BUTTON_RIGHT) { + _right_button_down = false; + } + HandleMouseEvents(); + break; + + case SDL_QUIT: + HandleExitGameRequest(); + break; + + case SDL_KEYDOWN: // Toggle full-screen on ALT + ENTER/F + if ((ev.key.keysym.mod & (KMOD_ALT | KMOD_GUI)) && + (ev.key.keysym.sym == SDLK_RETURN || ev.key.keysym.sym == SDLK_f)) { + if (ev.key.repeat == 0) ToggleFullScreen(!_fullscreen); + } else { + WChar character; + + uint keycode = ConvertSdlKeyIntoMy(&ev.key.keysym, &character); + // Only handle non-text keys here. Text is handled in + // SDL_TEXTINPUT below. + if (keycode == WKC_DELETE || + keycode == WKC_NUM_ENTER || + keycode == WKC_LEFT || + keycode == WKC_RIGHT || + keycode & WKC_META || + keycode & WKC_SHIFT || + keycode & WKC_CTRL || + keycode & WKC_ALT || + (keycode >= WKC_F1 && keycode <= WKC_F12) || + !IsValidChar(character, CS_ALPHANUMERAL)) { + HandleKeypress(keycode, character); + } + } + break; + + case SDL_TEXTINPUT: { + WChar character; + SDL_Keycode kc = SDL_GetKeyFromName(ev.text.text); + uint keycode = ConvertSdlKeycodeIntoMy(kc); + + Utf8Decode(&character, ev.text.text); + HandleKeypress(keycode, character); + break; + } + case SDL_WINDOWEVENT: { + if (ev.window.event == SDL_WINDOWEVENT_EXPOSED) { + // Force a redraw of the entire screen. + _num_dirty_rects = MAX_DIRTY_RECTS + 1; + } else if (ev.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { + int w = max(ev.window.data1, 64); + int h = max(ev.window.data2, 64); + CreateMainSurface(w, h, w != ev.window.data1 || h != ev.window.data2); + } else if (ev.window.event == SDL_WINDOWEVENT_ENTER) { + // mouse entered the window, enable cursor + _cursor.in_window = true; + } else if (ev.window.event == SDL_WINDOWEVENT_LEAVE) { + // mouse left the window, undraw cursor + UndrawMouseCursor(); + _cursor.in_window = false; + } + break; + } + } + return -1; +} + +const char *VideoDriver_SDL::Start(const char * const *parm) +{ + /* Explicitly disable hardware acceleration. Enabling this causes + * UpdateWindowSurface() to update the window's texture instead of + * its surface. */ + SDL_SetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION , "0"); + + /* Just on the offchance the audio subsystem started before the video system, + * check whether any part of SDL has been initialised before getting here. + * Slightly duplicated with sound/sdl_s.cpp */ + int ret_code = 0; + if (SDL_WasInit(SDL_INIT_VIDEO) == 0) { + ret_code = SDL_InitSubSystem(SDL_INIT_VIDEO); + } + if (ret_code < 0) return SDL_GetError(); + + GetVideoModes(); + if (!CreateMainSurface(_cur_resolution.width, _cur_resolution.height, false)) { + return SDL_GetError(); + } + + const char *dname = SDL_GetVideoDriver(0); + DEBUG(driver, 1, "SDL2: using driver '%s'", dname); + + MarkWholeScreenDirty(); + + _draw_threaded = GetDriverParam(parm, "no_threads") == nullptr && GetDriverParam(parm, "no_thread") == nullptr; + + return nullptr; +} + +void VideoDriver_SDL::Stop() +{ + SDL_QuitSubSystem(SDL_INIT_VIDEO); + if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) { + SDL_Quit(); // If there's nothing left, quit SDL + } +} + +void VideoDriver_SDL::MainLoop() +{ + uint32 cur_ticks = SDL_GetTicks(); + uint32 last_cur_ticks = cur_ticks; + uint32 next_tick = cur_ticks + MILLISECONDS_PER_TICK; + uint32 mod; + int numkeys; + const Uint8 *keys; + + CheckPaletteAnim(); + + std::thread draw_thread; + std::unique_lock draw_lock; + if (_draw_threaded) { + /* Initialise the mutex first, because that's the thing we *need* + * directly in the newly created thread. */ + _draw_mutex = new std::recursive_mutex(); + if (_draw_mutex == nullptr) { + _draw_threaded = false; + } else { + draw_lock = std::unique_lock(*_draw_mutex); + _draw_signal = new std::condition_variable_any(); + _draw_continue = true; + + _draw_threaded = StartNewThread(&draw_thread, "ottd:draw-sdl", &DrawSurfaceToScreenThread); + + /* Free the mutex if we won't be able to use it. */ + if (!_draw_threaded) { + draw_lock.unlock(); + draw_lock.release(); + delete _draw_mutex; + delete _draw_signal; + _draw_mutex = nullptr; + _draw_signal = nullptr; + } else { + /* Wait till the draw mutex has started itself. */ + _draw_signal->wait(*_draw_mutex); + } + } + } + + DEBUG(driver, 1, "SDL2: using %sthreads", _draw_threaded ? "" : "no "); + + for (;;) { + uint32 prev_cur_ticks = cur_ticks; // to check for wrapping + InteractiveRandom(); // randomness + + while (PollEvent() == -1) {} + if (_exit_game) break; + + mod = SDL_GetModState(); + keys = SDL_GetKeyboardState(&numkeys); + +#if defined(_DEBUG) + if (_shift_pressed) +#else + /* Speedup when pressing tab, except when using ALT+TAB + * to switch to another application */ + if (keys[SDL_SCANCODE_TAB] && (mod & KMOD_ALT) == 0) +#endif /* defined(_DEBUG) */ + { + if (!_networking && _game_mode != GM_MENU) _fast_forward |= 2; + } else if (_fast_forward & 2) { + _fast_forward = 0; + } + + cur_ticks = SDL_GetTicks(); + if (SDL_TICKS_PASSED(cur_ticks, next_tick) || (_fast_forward && !_pause_mode) || cur_ticks < prev_cur_ticks) { + _realtime_tick += cur_ticks - last_cur_ticks; + last_cur_ticks = cur_ticks; + next_tick = cur_ticks + MILLISECONDS_PER_TICK; + + bool old_ctrl_pressed = _ctrl_pressed; + bool old_shift_pressed = _shift_pressed; + + _ctrl_pressed = !!(mod & KMOD_CTRL) != _invert_ctrl; + _shift_pressed = !!(mod & KMOD_SHIFT) != _invert_shift; + + /* determine which directional keys are down */ + _dirkeys = + (keys[SDL_SCANCODE_LEFT] ? 1 : 0) | + (keys[SDL_SCANCODE_UP] ? 2 : 0) | + (keys[SDL_SCANCODE_RIGHT] ? 4 : 0) | + (keys[SDL_SCANCODE_DOWN] ? 8 : 0); + if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged(); + if (old_shift_pressed != _shift_pressed) HandleShiftChanged(); + + /* The gameloop is the part that can run asynchronously. The rest + * except sleeping can't. */ + if (_draw_mutex != nullptr) draw_lock.unlock(); + + GameLoop(); + + if (_draw_mutex != nullptr) draw_lock.lock(); + + UpdateWindows(); + _local_palette = _cur_palette; + } else { + /* Release the thread while sleeping */ + if (_draw_mutex != nullptr) draw_lock.unlock(); + CSleep(1); + if (_draw_mutex != nullptr) draw_lock.lock(); + + NetworkDrawChatMessage(); + DrawMouseCursor(); + } + + /* End of the critical part. */ + if (_draw_mutex != nullptr && !HasModalProgress()) { + _draw_signal->notify_one(); + } else { + /* Oh, we didn't have threads, then just draw unthreaded */ + CheckPaletteAnim(); + DrawSurfaceToScreen(); + } + } + + if (_draw_mutex != nullptr) { + _draw_continue = false; + /* Sending signal if there is no thread blocked + * is very valid and results in noop */ + _draw_signal->notify_one(); + if (draw_lock.owns_lock()) draw_lock.unlock(); + draw_lock.release(); + draw_thread.join(); + + delete _draw_mutex; + delete _draw_signal; + + _draw_mutex = nullptr; + _draw_signal = nullptr; + } +} + +bool VideoDriver_SDL::ChangeResolution(int w, int h) +{ + std::unique_lock lock; + if (_draw_mutex != nullptr) lock = std::unique_lock(*_draw_mutex); + + return CreateMainSurface(w, h, true); +} + +bool VideoDriver_SDL::ToggleFullscreen(bool fullscreen) +{ + std::unique_lock lock; + if (_draw_mutex != nullptr) lock = std::unique_lock(*_draw_mutex); + + /* Remember current window size */ + if (fullscreen) { + SDL_GetWindowSize(_sdl_window, &_window_size_w, &_window_size_h); + + /* Find fullscreen window size */ + SDL_DisplayMode dm; + if (SDL_GetCurrentDisplayMode(0, &dm) < 0) { + DEBUG(driver, 0, "SDL_GetCurrentDisplayMode() failed: %s", SDL_GetError()); + } else { + SDL_SetWindowSize(_sdl_window, dm.w, dm.h); + } + } + + DEBUG(driver, 1, "SDL2: Setting %s", fullscreen ? "fullscreen" : "windowed"); + int ret = SDL_SetWindowFullscreen(_sdl_window, fullscreen ? SDL_WINDOW_FULLSCREEN : 0); + if (ret == 0) { + /* Switching resolution succeeded, set fullscreen value of window. */ + _fullscreen = fullscreen; + if (!fullscreen) SDL_SetWindowSize(_sdl_window, _window_size_w, _window_size_h); + } else { + DEBUG(driver, 0, "SDL_SetWindowFullscreen() failed: %s", SDL_GetError()); + } + + return ret == 0; +} + +bool VideoDriver_SDL::AfterBlitterChange() +{ + int w, h; + SDL_GetWindowSize(_sdl_window, &w, &h); + return CreateMainSurface(w, h, false); +} + +void VideoDriver_SDL::AcquireBlitterLock() +{ + if (_draw_mutex != nullptr) _draw_mutex->lock(); +} + +void VideoDriver_SDL::ReleaseBlitterLock() +{ + if (_draw_mutex != nullptr) _draw_mutex->unlock(); +} + +#endif /* WITH_SDL2 */ diff --git a/src/video/sdl2_v.h b/src/video/sdl2_v.h new file mode 100644 index 0000000000..ba7e322ed3 --- /dev/null +++ b/src/video/sdl2_v.h @@ -0,0 +1,53 @@ +/* $Id$ */ + +/* + * This file is part of OpenTTD. + * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. + * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . + */ + +/** @file sdl2_v.h Base of the SDL2 video driver. */ + +#ifndef VIDEO_SDL_H +#define VIDEO_SDL_H + +#include "video_driver.hpp" + +/** The SDL video driver. */ +class VideoDriver_SDL : public VideoDriver { +public: + const char *Start(const char * const *param) override; + + void Stop() override; + + void MakeDirty(int left, int top, int width, int height) override; + + void MainLoop() override; + + bool ChangeResolution(int w, int h) override; + + bool ToggleFullscreen(bool fullscreen) override; + + bool AfterBlitterChange() override; + + void AcquireBlitterLock() override; + + void ReleaseBlitterLock() override; + + bool ClaimMousePointer() override; + + const char *GetName() const override { return "sdl"; } +private: + int PollEvent(); + bool CreateMainSurface(uint w, uint h, bool resize); +}; + +/** Factory for the SDL video driver. */ +class FVideoDriver_SDL : public DriverFactoryBase { +public: + FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO, 5, "sdl", "SDL Video Driver") {} + Driver *CreateInstance() const override { return new VideoDriver_SDL(); } +}; + +#endif /* VIDEO_SDL_H */ diff --git a/src/void_cmd.cpp b/src/void_cmd.cpp index 9a0134f59a..56e7cc5261 100644 --- a/src/void_cmd.cpp +++ b/src/void_cmd.cpp @@ -28,7 +28,7 @@ static void DrawTile_Void(TileInfo *ti) static int GetSlopePixelZ_Void(TileIndex tile, uint x, uint y) { - /* This function may be called on tiles outside the map, don't asssume + /* This function may be called on tiles outside the map, don't assume * that 'tile' is a valid tile index. See GetSlopePixelZOutsideMap. */ int z; Slope tileh = GetTilePixelSlopeOutsideMap(x >> 4, y >> 4, &z); diff --git a/src/water_map.h b/src/water_map.h index bb006ba633..7526d79ef6 100644 --- a/src/water_map.h +++ b/src/water_map.h @@ -28,8 +28,8 @@ enum WaterTileTypeBitLayout { WBL_COAST_FLAG = 0, ///< Flag for coast. - WBL_LOCK_ORIENT_BEGIN = 0, ///< Start of lock orientiation bitfield. - WBL_LOCK_ORIENT_COUNT = 2, ///< Length of lock orientiation bitfield. + WBL_LOCK_ORIENT_BEGIN = 0, ///< Start of lock orientation bitfield. + WBL_LOCK_ORIENT_COUNT = 2, ///< Length of lock orientation bitfield. WBL_LOCK_PART_BEGIN = 2, ///< Start of lock part bitfield. WBL_LOCK_PART_COUNT = 2, ///< Length of lock part bitfield. diff --git a/src/widget_type.h b/src/widget_type.h index 6372ed799e..261e3cdf34 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -247,7 +247,7 @@ public: uint min_y; ///< Minimal vertical size of only this widget. }; -/** Nested widget flags that affect display and interaction withe 'real' widgets. */ +/** Nested widget flags that affect display and interaction with 'real' widgets. */ enum NWidgetDisplay { /* Generic. */ NDB_LOWERED = 0, ///< Widget is lowered (pressed down) bit. diff --git a/src/window.cpp b/src/window.cpp index e4d43847f0..fe7b00c937 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -122,7 +122,7 @@ WindowDesc::~WindowDesc() /** * Determine default width of window. - * This is either a stored user preferred size, or the build-in default. + * This is either a stored user preferred size, or the built-in default. * @return Width in pixels. */ int16 WindowDesc::GetDefaultWidth() const @@ -132,7 +132,7 @@ int16 WindowDesc::GetDefaultWidth() const /** * Determine default height of window. - * This is either a stored user preferred size, or the build-in default. + * This is either a stored user preferred size, or the built-in default. * @return Height in pixels. */ int16 WindowDesc::GetDefaultHeight() const
    Only meaningfull in tropic climate. It contains the definition of the available zones
    Only meaningful in tropic climate. It contains the definition of the available zones
    00normal
    01desert
    02rain forest