Commit graph

18848 commits

Author SHA1 Message Date
Limyx826
47e899cf75 Add: Malaysia Ringgit as Currency
Cause why not

*Update the formating
2021-03-01 21:56:26 +00:00
Charles Pigott
64686b53ff Change: Zero out the gameloop timers when the game is paused 2021-03-01 21:55:51 +00:00
Charles Pigott
ef5cea0e06 Change: De-limit framerate window's framerate 2021-03-01 21:55:51 +00:00
Owen Rudge
838fd61f29 Fix: [OSX] Hide dock when entering fullscreen 2021-03-01 21:03:18 +00:00
translators
02e7bc7e0a Update: Translations from eints
swedish: 4 changes by kustridaren
norwegian (bokmal): 3 changes by buzzCraft
spanish (mexican): 12 changes by absay
korean: 4 changes by telk5093
greek: 85 changes by sntovas
german: 4 changes by MagnumSociety
catalan: 5 changes by J0anJosep
tamil: 16 changes by Ramesh78dev
dutch: 4 changes by rcpaul
polish: 5 changes by pAter-exe
2021-03-01 19:01:41 +00:00
Patric Stout
40505e645a Fix: terraform limit acted random when maxing out per_64k_frames setting
uint32 + uint32 can overflow, so cast it to uint64 first.
2021-03-01 16:35:16 +01:00
Patric Stout
25e5a92286 Fix 9b800a96: (a << 16) is unsigned, so don't remove the cast 2021-03-01 16:35:16 +01:00
Patric Stout
8bc0089fc4
Fix c3dc27e3: put the max-value of fast-forward-speed-limit to within the storage size (#8769) 2021-02-28 21:53:14 +01:00
translators
2545b24118 Update: Translations from eints
czech: 1 change by LubosKolouch
2021-02-28 19:00:53 +00:00
Patric Stout
c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
2021-02-28 18:04:51 +00:00
dP
73fd634209 Fix #6266: Ugly lists in network lobby windows on double/quad interface sizes with custom fonts 2021-02-28 17:43:30 +00:00
Patric Stout
2d9062bfc1 Fix: [Network] don't desync if client leaves before you finish downloading map
When you are downloading a map, all the commands are queued up
for you. Clients joining/leaving is done by the network protocol,
and as such are processed immediately. This means that by the
time you are processing the commands, a client that triggered
it, might already have left.

So, all commands that do something with ClientID, shouldn't
error on an invalid ClientID when DC_EXEC is set, but
gracefully handle the command anyway, to make sure the
game-state is kept in sync with all the clients that did
execute the DoCommand while the now-gone client was still
there.

Additionally, in the small chance a client disconnects between
the server validating a DoCommand and the command being
executed, also just process the command as if the client was
still there. Otherwise, lag or latency can cause clients that
did not receive the disconnect yet to desync.
2021-02-28 12:27:04 +01:00
Patric Stout
13889b6554 Fix: [Network] don't show "server doesn't respond" while in queue
Send all clients in the queue every game-day a packet that they
are still in the queue.
2021-02-28 12:27:04 +01:00
Patric Stout
8d199b1bbc Fix: [Network] send map to next client if current client disconnects
Also terminate creating of the savegame, as the client is gone,
there really is no need for that anymore.
2021-02-28 12:27:04 +01:00
Patric Stout
3677418225 Fix: [Network] also count the person downloading the map in the queue
Strictly seen, there are "N" people -waiting- in front of you
in the queue, but it is nicer to show "N + 1" for the person that
is currently downloading the map. Avoids it showing:
"0 clients in front of you". That just feels a bit off.
2021-02-28 12:27:04 +01:00
Charles Pigott
6b8f9b50b9 Fix: Vehicle list windows did not update when this year's profit changed
Remove caching from vehicle group object. and recalculate it whenever
required instead.
2021-02-28 11:24:09 +00:00
Michael Lutz
d79398a1d5 Fix #8763: [OpenGL] Cursor sprite origin can be negative. 2021-02-28 11:12:13 +01:00
Pavel Stupnikov
4fd2eecb8b
Change: Improve console warnings on invalid network commands (#8753) 2021-02-27 20:26:51 +01:00
translators
cd756e6f01 Update: Translations from eints
swedish: 60 changes by kustridaren
norwegian (bokmal): 12 changes by buzzCraft
czech: 82 changes by PatrikSamuelTauchim, 1 change by tomas-vl
italian: 86 changes by AlphaJack, 9 changes by federico1564S
german: 16 changes by ebla71
romanian: 10 changes by ALEX11BR
ukrainian: 3 changes by StepanIvasyn
spanish: 1 change by MontyMontana
2021-02-27 19:01:06 +00:00
Michael Lutz
77854d561b Fix: [OpenGL] Don't use OpenGL on MESA software renderers.
Performance in this case is worse than not using OpenGL, so just let
OTTD fall back to a different video driver.
2021-02-27 19:01:34 +01:00
Patric Stout
1b5d1d074e
Fix: [SDL2] set GL attributes to get the best GL context possible (#8759) 2021-02-27 18:51:20 +01:00
frosch
dfa141818b Fix: OpenGL cursor did not consider sprite offsets of cursor sprites. 2021-02-27 14:52:11 +01:00
frosch
d236c57600 Fix: yet another place where the vehicle-cursor did not account for the interface zoom level. 2021-02-27 14:52:11 +01:00
Michael Lutz
ef4cec9382 Fix #8750: [OpenGL] Line drawing did not set proper RGB/mask colours. 2021-02-27 13:09:38 +01:00
Patric Stout
fe451b8dc7 Codechange: remove _realtime_tick variable 2021-02-27 00:36:14 +01:00
Patric Stout
853bfc3562 Codechange: replace _realtime_tick with std::chrono for mouse events 2021-02-27 00:36:14 +01:00
Patric Stout
53c28a8ec9 Codechange: [Network] replace _realtime_tick with std::chrono 2021-02-27 00:36:14 +01:00
Patric Stout
d068d61f3c
Fix bddfcaef: don't tell twice that a client left because of a timeout etc (#8746)
SendError() notifies all clients of the disconnect. This calls
CloseConnection() at the end, which also notified the clients
of the disconnect. Really no need to do it twice.

The status NETWORK_RECV_STATUS_SERVER_ERROR is only set by
SendError(), so in case that is the status, don't let
ClientConnection() send another notification.
2021-02-27 00:32:51 +01:00
translators
af326753a9 Update: Translations from eints
swedish: 1 change by kustridaren
english (us): 15 changes by 2TallTyler
catalan: 1 change by J0anJosep
dutch: 1 change by Afoklala
2021-02-26 19:01:33 +00:00
Michael Lutz
3cbbaa62db Change: Never auto-select an 8bpp blitter unless explicitly allowed by the 'support8bpp' setting. 2021-02-26 19:26:52 +01:00
Patric Stout
9a3dbf3122
Fix 02e770ff: allow estimating CloneVehicle if short on money (#8748)
CheckCompanyHasMoney() was also executed when not using DC_EXEC,
resulting in an error about shortage of money instead of the
estimation.
This mostly is a problem for AI players, as they will have no
way to know how much it would have cost.
2021-02-26 16:22:58 +01:00
Patric Stout
d4583fa64c
Fix #8123: trams on half-tiles couldn't find depots (#8738)
Basically, follow_track.hpp contains a fix for half-tiles, but
this wasn't duplicated for when trying to find a depot and in
a few other places. This makes sure all places act the same.
2021-02-25 22:46:46 +01:00
translators
9209807d66 Update: Translations from eints
swedish: 19 changes by kustridaren
german: 1 change by Wuzzy2
slovak: 3 changes by FuryPapaya
2021-02-25 19:01:49 +00:00
Michael Lutz
311df31fb1 Codechange: [OpenGL] Load all OpenGL functions dynamically. 2021-02-25 00:34:49 +01:00
Michael Lutz
a0c1a3f736 Codechange: [OpenGL] Simplify loading OpenGL extension functions. 2021-02-25 00:34:49 +01:00
Michael Lutz
e1e8cc3851
Fix #8734: [OpenGL] Apply palette remap to cursor sprites. (#8742) 2021-02-24 22:10:25 +01:00
Patric Stout
6a8c461e38 Codechange: [OSX] GameLoop is really more like MainLoop
MainLoop() is used to bootstrap OSX, where later a callback is
done to GameLoop() to execute OpenTTD. All other video drivers
don't need that, so what is in GameLoop is in MainLoop for all
other drivers. This is rather confusing. So, instead, name
GameLoop MainLoopReal to be more in sync with the other drivers.
2021-02-24 21:58:47 +01:00
Patric Stout
67d3c6aa71 Codechange: [Video] move InteractiveRandom() to the VideoDriver 2021-02-24 21:58:47 +01:00
Patric Stout
c409f45ddd Codechange: [Video] make the prototype of PollEvent() the same for all drivers
Additionally, call it from the draw-tick.
2021-02-24 21:58:47 +01:00
Tyler Trahan
8476f12432
Change: Improve graph period markings (#8732) 2021-02-24 09:18:15 +01:00
frosch
79c2b81ffd Fix: vehicle-cursor size-limit did not account for the interface zoom level. 2021-02-24 08:00:42 +00:00
Michael Lutz
46e13313e4 Fix #8731: Always use a 32bpp blitter if font anti-aliasing is enabled. 2021-02-23 22:15:03 +01:00
translators
c93c9c099e Update: Translations from eints
estonian: 7 changes by siimsoni
polish: 2 changes by yazalo
2021-02-23 18:59:47 +00:00
Niels Martin Hansen
cc465efa67 Change: [Win32] Use more modern way of getting free disk space 2021-02-23 11:25:39 +01:00
Niels Martin Hansen
b427ddce88 Codechange: Switch to explicit wide strings 2021-02-23 11:25:39 +01:00
Niels Martin Hansen
beeb9e0a1b Remove: [Win32] Last pretenses of being able to build for Windows 95 2021-02-23 11:25:39 +01:00
Michael Lutz
06ca147a82 Fix 8706c36f: Change RELEASE code, too. 2021-02-22 23:16:46 +01:00
Michael Lutz
7af1fd3ffb Add: [OSX] OpenGL video driver. 2021-02-22 22:16:07 +01:00
Michael Lutz
b4a3bc1ffe Codechange: [OpenGL] Separate context state setup from general init. 2021-02-22 22:16:07 +01:00
Michael Lutz
7f55f0a264 Codechange: [OSX] Add support for (un)locking the video buffer. 2021-02-22 22:16:07 +01:00
Michael Lutz
2f25e9bdf8 Codechange: [OSX] Separate video driver into a base and a Quartz implementation. 2021-02-22 22:16:07 +01:00
Michael Lutz
421b599541 Codechange: [SDL2] Split driver in base-part and default backend 2021-02-22 22:16:07 +01:00
Patric Stout
a303940372 Feature: [SDL2] OpenGL support 2021-02-22 22:16:07 +01:00
Michael Lutz
a77b202767 Codechange: [SDL] Move dirty_rect to class scope. 2021-02-22 22:16:07 +01:00
Patric Stout
e75858ce5e Codechange: [SDL2] Allow several places to hook into the SDL driver
This allows future subdrivers to use these to manage their
own flow.
2021-02-22 22:16:07 +01:00
Patric Stout
101e394475 Codechange: [SDL2] Move functions and variables to class-scope
This allows future subdrivers to override them.
2021-02-22 22:16:07 +01:00
Patric Stout
0d58bc9384 Codechange: [SDL2] Move SDLSurface code to its own function
This increases readability, and allow future subdrivers to not
use SDLSurface to draw.
2021-02-22 22:16:07 +01:00
Patric Stout
6098811b49 Codechange: [SDL2] Split Start() in a few more functions
This makes it a bit easier to follow what is going on, and
allow future subdrivers to hook into a few of these functions.

Reworked the code slighly while at it, to return early where
possible.
2021-02-22 22:16:07 +01:00
Michael Lutz
86c309ea75 Codechange: [OpenGL] Let OpenGL clear the pixel buffer if possible. 2021-02-22 22:16:07 +01:00
Michael Lutz
94d8acb7d0 Add: A 32 bpp blitter that uses the animation buffer from the video backend to speed up palette animation. 2021-02-22 22:16:07 +01:00
Michael Lutz
ae7c63cc35 Codechange: [OpenGL] Use persistently mapped pixel buffers when supported. 2021-02-22 22:16:07 +01:00
Michael Lutz
200be7d20c Add: [OpenGL] Support for a separate animation buffer that stores the palette values of the screen in addition to the colour buffer. 2021-02-22 22:16:07 +01:00
Michael Lutz
01ef44fa4f Codechange: Allow blitter factories to decide at runtime if the blitter is usable. 2021-02-22 22:16:07 +01:00
Michael Lutz
d62e302768 Change: [Win32] Prioritize the OpenGL video driver over the GDI one. 2021-02-22 22:16:07 +01:00
Michael Lutz
6bcc4884c2 Add: [OpenGL] Accelerated mouse cursor drawing. 2021-02-22 22:16:07 +01:00
Michael Lutz
d4dbb3f46e Fix: Don't trash video buffer alpha in SSE3/4 blitters. 2021-02-22 22:16:07 +01:00
Michael Lutz
bcd15b4dd2 Codechange: [OpenGL] Initialize backing store to opaque alpha to allow blending effects. 2021-02-22 22:16:07 +01:00
Michael Lutz
1e1a9f3999 Add: A simple, templated cache map that uses a least recently used eviction strategy. 2021-02-22 22:16:07 +01:00
Michael Lutz
3e49aff35c Codechange: Allow video drivers to handle the cursor themselves. 2021-02-22 22:16:07 +01:00
Michael Lutz
6776229047 Codechange: Make the simple Malloc sprite allocator globally usable. 2021-02-22 22:16:07 +01:00
Michael Lutz
70aa3b4011 Codechange: Give sprite encoders a hint which colour components of a sprite are filled with useful information. 2021-02-22 22:16:07 +01:00
Michael Lutz
e7e5316340 Add: Allow sprite encoders (blitters) to specify an alignment for sprite width and height. 2021-02-22 22:16:07 +01:00
Michael Lutz
02e8741457 Codechange: Allow for using a sprite encoder that is not the currently active blitter when loading a sprite. 2021-02-22 22:16:07 +01:00
Michael Lutz
f94b2e73e1 Codechange: [Win32] Use an OpenGL core context instead of a compatibility one. 2021-02-22 22:16:07 +01:00
Michael Lutz
e8fc050b6e Add: [OpenGL] Support for 8bpp blitters. 2021-02-22 22:16:07 +01:00
Michael Lutz
320072c8dc Codechange: [OpenGL] Explicitly assign which framebuffer target receives the colour values. 2021-02-22 22:16:07 +01:00
Michael Lutz
821f30f735 Codechange: [OpenGL] Use GLSL version 1.50 if available. 2021-02-22 22:16:07 +01:00
Michael Lutz
90fd8f8cda Codechange: [OpenGL] Use generic vertex attributes in the shader program. 2021-02-22 22:16:07 +01:00
Michael Lutz
acf59f6b68 Codechange: [OpenGL] Use shaders to display the video buffer on screen. 2021-02-22 22:16:07 +01:00
Michael Lutz
b181859629 Change: [Win32] Disable VSync for OpenGL by default. 2021-02-22 22:16:07 +01:00
Michael Lutz
9a069faa01 Codechange: [Win32] Try to get an OpenGL 3.2+ context if possible. 2021-02-22 22:16:07 +01:00
Michael Lutz
a990c497b5 Codechange: [OpenGL] Use a pixel buffer object to store the video buffer. 2021-02-22 22:16:07 +01:00
Michael Lutz
5af0cfd902 Codechange: [OpenGL] Use a vertex array object to store the vertex state for the video buffer. 2021-02-22 22:16:07 +01:00
Michael Lutz
acf2ce35f7 Codechange: [OpenGL] Use a vertex buffer object to store the vertex data for the video buffer. 2021-02-22 22:16:07 +01:00
Michael Lutz
8706c36fc0 Codechange: [Win32] Move remaing global _wnd variables into the video driver. 2021-02-22 22:16:07 +01:00
Michael Lutz
d6b6775888 Change: Lock the video buffer when drawing inside the game loop to properly account for threaded drawing. 2021-02-22 22:16:07 +01:00
Michael Lutz
73ed748deb Codechange: [Win32] Move the global video buffer pointer into the driver class. 2021-02-22 22:16:07 +01:00
Michael Lutz
5ad545dcc1 Codechange: [OpenGL] Only update the dirty parts of the video buffer texture. 2021-02-22 22:16:07 +01:00
Michael Lutz
3a77ade6b2 Codechange: [OpenGL] Enable driver debug messages if supported. 2021-02-22 22:16:07 +01:00
Michael Lutz
d7b96a424f Codechange: [OpenGL] Use new-style extension testing introduced with OpenGL 3.0. 2021-02-22 22:16:07 +01:00
Michael Lutz
ef478ade64 Add: [Win32] Video driver that uses OpenGL to transfer the video buffer to the screen. 2021-02-22 22:16:07 +01:00
Michael Lutz
af4d32357c Codechange: [Win32] Move common initialization and finalization to the video driver base class. 2021-02-22 22:16:07 +01:00
Michael Lutz
78b8fc3e4f Codechange: [Win32] Move GDI-specific variables and related functions into the GDI video driver class. 2021-02-22 22:16:07 +01:00
Michael Lutz
8b90d4abe0 Codechange: [Win32] Move GDI specific drawing code into the GDI video driver class. 2021-02-22 22:16:07 +01:00
Michael Lutz
59e0d9618b Codechange: [Win32] Split the video driver into a base class and a GDI backend class. 2021-02-22 22:16:07 +01:00
Patric Stout
78d96dad2a
Fix #6319: [Win32] don't use clipping; draw whole screen every frame (#8726)
When we clip the region that is only been redrawn, something
weird happens on Windows. When pushing 60 frames per second on a
60Hz monitor, it appears that the clipped region is often shown
of another frame, instead of the current.

Examples of this are:
- pause the game, move your mouse to the left, and at the right
  speed it totally disappears.
- fast aircrafts seem to be in several places at once, weirdly
  lagging behind.
- in title screen, moving your mouse gives you the idea it is
  jumping places, instead of smooth movements.

In the end, if you do nothing, everything is correct, so it is
eventually consistent. Just when we are firing many BitBlt in
a clipped region, the in-between is not.

What goes wrong exactly, I honestly do not know. On every frame
that we push to the DC is a mouse painted, but visually it
sometimes appears like it is not. Recording with external software
shows it really is there.
It is also not our eyes playing tricks on us, as the first example
makes it really clear the mouse pointer really is not painted.

And to be clear, with the mouse this is easiest reproduceable,
as high-speed objects are influences by this most. But this happens
for all movement that redraws small regions.

Either way, not using clipped regions resolves the issue completely,
and there appears to be little to no penalty (I failed to measure
any impact of drawing the full screen). So better have a good game
than fast code, I guess?
2021-02-22 21:17:55 +01:00
translators
c136dd2b32 Update: Translations from eints
english (us): 78 changes by 2TallTyler
polish: 1 change by yazalo
2021-02-22 19:01:17 +00:00
Charles Pigott
6af49b7885 Fix #8724: Got wrong DepotID/StationID for airports, causing crash 2021-02-22 14:20:21 +00:00
Charles Pigott
80fb1c74f0 Change: Make pathfinder account for maximum order speed, if set 2021-02-22 00:25:47 +00:00
translators
e74069e4c2 Update: Translations from eints
estonian: 19 changes by siimsoni
french: 3 changes by glx22
2021-02-21 19:00:19 +00:00
Charles Pigott
8157af6d68 Fix #8276: Crash when a NewGRF object's size was not set 2021-02-21 18:16:09 +00:00
Charles Pigott
3af407340e Fix #8349: Close depot vehicle list windows when closing the depot window 2021-02-21 17:58:19 +00:00
Patric Stout
88959f5595
Codechange: [OSX] remove final bits of old debugging code (#8714) 2021-02-21 15:58:26 +01:00
Charles Pigott
1d6a0c7b52 Fix: [YAPF] Road pathfinder did not account for length of tunnel/bridge in path cost
Copy calculations from the rail pathfinder
2021-02-21 10:53:25 +00:00
Charles Pigott
c461999b2b Fix #8594: [NRT] Road pathfinder did not account for roadtype speed limits 2021-02-21 10:53:25 +00:00
Patric Stout
e1b1608dc6
Fix ec1dd0bf: missing override causing compiler warnings (#8708) 2021-02-20 22:14:26 +01:00
Michael Lutz
d16dc22fdf Codechange: Use C++-ism for zeroing. 2021-02-20 21:14:44 +01:00
Michael Lutz
5ca979b1e2 Fix: [OSX] Don't wait on the event loop for drawing. 2021-02-20 21:14:44 +01:00
Michael Lutz
f3c192c63d Codechange: [OSX] Only keep a total dirty rect for drawing.
When drawing an 8bpp screen buffer, palette resolving was done for each
dirty rectangle. In areas with high activity, this would mean a pixel might
have been resolved multiple times. Also, if too many individual updates
were queued, the whole screen would be refreshed, even if unnecessary.

All other drivers only keep one overall dirty rect, so do it here as well.
2021-02-20 21:14:44 +01:00
translators
61275df7da Update: Translations from eints
estonian: 62 changes by siimsoni
korean: 1 change by telk5093
russian: 2 changes by Ln-Wolf
finnish: 2 changes by hpiirai
2021-02-20 19:00:44 +00:00
frosch
d9b4413bc9
Codechange: rename sound ids to make more sense. (#8701) 2021-02-20 19:01:04 +01:00
SamuXarick
cb95b1d2e7 Codechange: Apply coding style 2021-02-20 17:59:04 +00:00
Patric Stout
058f13bdf9 Remove: [SDL] SDL 1.3 never happened, so remove all the special code for it 2021-02-20 17:08:44 +01:00
Patric Stout
0e76d965f1 Codechange: deduplicate tick-handlers of all video drivers
They were all identical, so better put this in a single place
hoping it is less likely to break.
2021-02-20 17:08:44 +01:00
Patric Stout
7996fadb91 Change: [Win32] Remove force_full_redraw and display_hz settings
These were special settings only for the win32-drivers, and
introduced in the very first version we track.

Time kinda had caught up with those variables, so it is time to
say farewell.

force_full_redraw was most likely a debug functionality "in case
our dirty-rect fails". This should no longer be needed.

display_hz was cute, as it had a max of 120. That is kinda
out-dated information, but I also doubt anyone was really using
this.
2021-02-20 17:08:44 +01:00
Patric Stout
23d6f4eac9 Codechange: [Win32] simplify when/where GdiFlush() is called 2021-02-20 17:08:44 +01:00
Patric Stout
ec1dd0bf61 Codechange: be consistent in what CheckPaletteAnim() does and when it is called
Additionally, make sure this is a class method. Later commits
will make use of this.
2021-02-20 17:08:44 +01:00
Patric Stout
790fa7102e Codechange: be consistent in naming the paint function Paint()
Also move this function to be a class member. This to allow
further deduplicating of code in a later commit.
2021-02-20 17:08:44 +01:00
Patric Stout
761efbb457 Codechange: use (Un)LockVideoBuffer() to manage video buffer 2021-02-20 17:08:44 +01:00
Patric Stout
661eb39ecc Codechange: move all input-handling of video-drivers into InputLoop 2021-02-20 17:08:44 +01:00
Patric Stout
38b4ae1c0e Codechange: [Win32] make fast-forward check the same as with other drivers
It was of all the drivers the only one doing this slightly different.
When trying to unify more code, that was rather annoying.
2021-02-20 17:08:44 +01:00
Joe Stringer
d21442941c Fix: [Cygwin] Fix missing uint definition
In file included from src/settingsgen/../string_func.h:30,
                 from src/settingsgen/settingsgen.cpp:11:
src/settingsgen/../core/bitmath_func.hpp:34:15: error: 'uint' does not name a type; did you mean 'uint8'?
   34 | static inline uint GB(const T x, const uint8 s, const uint8 n)
      |               ^~~~
      |               uint8
2021-02-20 14:54:57 +00:00
Patric Stout
08821f82b6 Fix: [Win32] run InteractiveRandom() once every tick, not once every message
Win32 was the only video driver doing this. It is just a bit too
much random.
2021-02-20 14:25:56 +01:00
Patric Stout
19fdbac287 Fix: [Win32] now we are drawing on a tick, no longer use WM_PAINT
WM_PAINT hits when-ever Windows feels like, but always after we
marked the screen as dirty. In result, it was lagging behind,
giving a sub-60fps experience.

With the new draw-tick there is no longer a need to be driven by
WM_PAINT, so it is better anyway to drive the drawing ourself. As
an added bonus this makes the win32 driver more like the others.
2021-02-20 14:25:56 +01:00
translators
5fc983a1bb Update: Translations from eints
german: 1 change by Wuzzy2
russian: 11 changes by Ln-Wolf
catalan: 2 changes by J0anJosep
spanish: 14 changes by perezdidac
2021-02-19 19:01:10 +00:00
Patric Stout
8bf8c0f251 Fix d437445c: also use std::chrono for the GRFFileScanner modal window
For some reason I only converted one of the two modal windows we
have, and completely forgot the other.

While at it, synchronize the way those two modal windows work
in terms of "next_update".
2021-02-19 19:56:40 +01:00
Patric Stout
932abe6d5c Fix fa170b9: [SDL2] forgot to use GetGameInterval where needed 2021-02-19 11:34:00 +01:00
Patric Stout
15a0ac2735 Fix cd4f0f95: [Allegro] driver failed to build because of missing include 2021-02-19 11:34:00 +01:00
Patric Stout
c4df0f95ae Fix: during switching of game-mode, drawing could show closed windows that shouldn't be closed yet
The higher your refresh-rate, the more likely this is. Mostly you
notice this when creating a new game or when abandoning a game.

This is a bit of a hack to keep the old behaviour, as before this
patch the game was already freezing your mouse while it was changing
game-mode, and it does this too after this patch. Just now it
freezes too a few frames earlier, to prevent not drawing windows
people still expect to see.
2021-02-19 10:43:15 +01:00
Patric Stout
fa170b9ace Feature: configurable refresh-rate and change default to 60fps
Most modern games run on 60 fps, and for good reason. This gives
a much smoother experiences.

As some people have monitors that can do 144Hz or even 240Hz, allow
people to configure the refresh rate. Of course, the higher you
set the value, the more time the game spends on drawing pixels
instead of simulating the game, which has an effect on simulation
speed.

The simulation will still always run at 33.33 fps, and is not
influences by this setting.
2021-02-19 10:43:15 +01:00
Patric Stout
eb9b1ad68d Change: sleep till the next tick in the main loop
Sleep for 1ms (which is always (a lot) more than 1ms) is just
randomly guessing and hoping you hit your deadline, give or take.

But given we can calculate when our next frame is happening, we
can just sleep for that exact amount. As these values are often
a bit larger, it is also more likely the OS can schedule us back
in close to our requested target. This means it is more likely we
hit our deadlines, which makes the FPS a lot more stable.
2021-02-19 10:43:15 +01:00
Patric Stout
ae7a2b9f02 Change: allow video-drivers to miss deadlines slightly
Before, every next frame was calculated from the current time.
If for some reason the current frame was drifting a bit, the
next would too, and the next more, etc etc. This meant we rarely
hit the targets we would like, like 33.33fps.

Instead, allow video-drivers to drift slightly, and schedule the
next frame based on the time the last should have happened. Only
if the drift gets too much, that deadlines are missed for longer
period of times, schedule the next frame based on the current
time.

This makes the FPS a lot smoother, as sleeps aren't as exact as
you might think.
2021-02-19 10:43:15 +01:00
Patric Stout
c81c6e5eb7 Add: draw the screen at a steady pace, also during fast-forward
During fast-forward, the game was drawing as fast as it could. This
means that the fast-forward was limited also by how fast we could
draw, something that people in general don't expect.

To give an extreme case, if you are fully zoomed out on a busy
map, fast-forward would be mostly limited because of the time it
takes to draw the screen.

By decoupling the draw-tick and game-tick, we can keep the pace
of the draw-tick the same while speeding up the game-tick. To use
the extreme case as example again, if you are fully zoomed out
now, the screen only redraws 33.33 times per second, fast-forwarding
or not. This means fast-forward is much more likely to go at the
same speed, no matter what you are looking at.
2021-02-19 10:43:15 +01:00
Patric Stout
5bfa014505 Codechange: track _realtime_tick more accurate
_realtime_tick was reset every time the diff was calculated. This
means if it would trigger, say, every N.9 milliseconds, it would
after two iterations already drift a millisecond. This adds up
pretty quick.
2021-02-19 10:43:15 +01:00
Patric Stout
25f6851ca1 Codechange: switch all video drivers to std::chrono for keeping time
On all OSes we tested the std::chrono::steady_clock is of a high
enough resolution to do millisecond measurements, which is all we
need.

By accident, this fixes a Win32 driver bug, where we would never
hit our targets, as the resolution of the clock was too low to
do accurate millisecond measurements with (it was ~16ms resolution
instead).
2021-02-19 10:43:15 +01:00
Patric Stout
d437445c67 Codechange: use std::chrono to track time in modal windows
Adding to _realtime_ticks in a random place is a bit of a hack,
and by using modern C++, we can avoid this hack.
2021-02-19 10:43:15 +01:00
Tegas Aziz
1f6fb8c290
Add: Indonesia Rupiah as in-game currency (#8616)
The exchange rate is actually more like 19,000, but OpenTTD
doesn't handle such high exchange rates kindly.
2021-02-19 10:27:41 +01:00
Didac Perez Parera
96990b2ea7
Feature: Object class selection string filtering (#8603) 2021-02-19 10:26:54 +01:00
SamuXarick
7577dfa575 Codechange: Apply coding style 2021-02-19 00:14:30 +00:00
translators
259c04f41c Update: Translations from eints
russian: 1 change by Ln-Wolf
polish: 2 changes by yazalo
2021-02-18 19:01:52 +00:00
Tyler Trahan
fa88cb62e1
Fix cc39fa9: New orders are non-stop by default (#8689) 2021-02-18 18:42:28 +01:00
Jonathan G Rennison
15b99f2e7a
Fix: Whole status bar instead of money widget refreshed on money change (#8692)
This could result in the rest of the status bar being
redrawn unnecessarily frequently
2021-02-18 12:29:30 +01:00
Jonathan G Rennison
55ed7d16f7
Fix: Unnecessary status bar redraws when there is no news to show (#8691)
InvalidateWindowData with mode SBI_NEWS_DELETED was called on the
status bar when checking for a new item of news to be shown in the
ticker, even if there is no news queued and no change occurs.
2021-02-18 12:17:51 +01:00
Jonathan G Rennison
e059a88533
Fix: Autorenew failure advice due to bad refit being shown to all companies (#8681) 2021-02-18 10:50:33 +01:00
Tyler Trahan
d5e18feed9
Change: Darken graph grid lines for legibility (#8690) 2021-02-18 10:15:58 +01:00
Wuzzy
27b4d6390b
Change: "(Business/Chair)man" to "...person" (#8659) 2021-02-17 21:34:31 +01:00
Patric Stout
8e0d48a0f6
Fix: [SDL2] simplify what to redraw to prevent tearing (#8685)
When there are a lot of rects to redraw, of which one of the last
ones is almost the full screen, visual tearing happens over the
vertical axis. This is most visible when scrolling the map.

This can be prevented by using less rects. To simplify the situation,
and as solutions like OpenGL need this anyway, keep a single rect
that shows the biggest size that updates everything correctly.

Although this means it needs a bit more time redrawing where it
is strictly seen not needed, it also means less commands have
to be executed in the backend. In the end, this is a trade-off,
and from experiments it seems the approach of this commit gives
a better result.
2021-02-17 21:19:32 +01:00
Michael Lutz
8bd2349ab6 Fix #8676, a2c3197f: GUI-visible settings may not be part of misc settings. 2021-02-17 21:01:21 +01:00
Michael Lutz
00c66e7096 Codechange: Allow early-load settings that are not misc settings. 2021-02-17 21:01:21 +01:00
translators
8f5b8fd769 Update: Translations from eints
german: 2 changes by Wuzzy2
slovak: 5 changes by FuryPapaya
dutch: 4 changes by LouisDeconinck
spanish: 1 change by MontyMontana
2021-02-17 18:54:08 +00:00
Patric Stout
6de188d025
Fix 52317bb7: [SDL2] ensure we don't try to blit out of bounds (#8684)
During resizing, there can still be dirty-rects ready to blit based
on the old dimensions. X11 with shared memory enabled crashes if
you try to do this. So, instead, if we resize, reset the dirty-rects.

This is fine, as moments later we mark the whole (new) screen as
dirty anyway.
2021-02-17 14:06:12 +01:00
Patric Stout
7bdb2e79ed
Fix: framerate window showed a slightly higher rate than actually measured (#8682)
The first point was counted, but also initialized as "last". As
such, it didn't add to "total", but did add to "count", which made
the "count" 1 more than the total actually represents.
2021-02-16 20:37:58 +01:00
translators
c9bcc12265 Update: Translations from eints
korean: 2 changes by telk5093
indonesian: 11 changes by dimaspaf14
russian: 2 changes by Ln-Wolf
finnish: 3 changes by hpiirai
french: 4 changes by glx22
2021-02-16 19:01:08 +00:00
translators
db246b82ac Update: Translations from eints
korean: 2 changes by telk5093
german: 56 changes by Wuzzy2
finnish: 2 changes by hpiirai
catalan: 2 changes by J0anJosep
polish: 9 changes by yazalo
2021-02-15 19:01:52 +00:00
glx22
45e8b7a5bd Add: Allow translation of "(Directory)" and "(Parent directory)" 2021-02-15 00:08:37 +01:00
Tyler Trahan
ce06b03fac
Fix: Stopped ships shouldn't block depots (#8578) 2021-02-14 23:42:29 +01:00
dP
91cc414588 Feature: [GS] Allow non-question type windows to have no buttons 2021-02-14 23:21:43 +01:00
milek7
751f595bb6 Fix: VkMapping declarations violated C++ ODR rule. 2021-02-14 23:19:50 +01:00
frosch
5a1fa18509 Change: move the 'road drive side' selection to settings tree, and give it the same 'basic' visibilty as 'signal side'. 2021-02-14 23:14:07 +01:00
frosch
c71d0f5e7f Change: move townname generator selection to mapgen GUI. 2021-02-14 23:14:07 +01:00
frosch
f513a807db Codechange: move non-GUI code to non-GUI source files. 2021-02-14 23:14:07 +01:00
frosch
4ce941bbc2 Codechange: turn a constant variable into a real constant. 2021-02-14 23:14:07 +01:00
frosch
d17226910d Codechange: minor rearrangement of settings in random map and heightmap GUI. 2021-02-14 23:14:07 +01:00
frosch
81e47277e7 Change: move the 'tree placer algorithm' selection to the settings tree window, and give it the same 'basic' visibility as 'in-game tree placement'. 2021-02-14 23:14:07 +01:00
translators
6b04b7cf18 Update: Translations from eints
slovak: 13 changes by FuryPapaya
catalan: 7 changes by J0anJosep
french: 1 change by arikover
2021-02-14 19:01:09 +00:00
Michael Lutz
8d780e0607 Add: [OSX] Automatic zoom level suggestion for Cocoa video driver. 2021-02-14 14:16:40 +01:00
Michael Lutz
f175e38666 Add: [Win32] Automatic zoom level suggestion for Win32 video driver.
The zoom level suggestion is based on the DPI scaling set in Windows.
We use 150% scaling as the threshold for 2X zoom and 300% scaling
as the threshold for 4X zoom.
2021-02-14 14:16:40 +01:00
Michael Lutz
f137b3057a Codechange: [Win32] Increase SDK version for 32-bit target.
Use the same Windows XP target as for 64-bit. Current MSVC version will
not produce a binary that works on anything earlier anyway.
2021-02-14 14:16:40 +01:00
Michael Lutz
33099355b8 Codechange: Re-init GUI zoom only when really changed. 2021-02-14 14:16:40 +01:00
Michael Lutz
22f5aeab07 Feature: Automatic UI and font zoom levels when supported by the OS. 2021-02-14 14:16:40 +01:00
Michael Lutz
a2c3197f42 Codechange: Make the settings for min/max zoom early load settings. 2021-02-14 14:16:40 +01:00
Michael Lutz
f5555a6d26 Fix 9c872192: [OSX] Clear mouse button emulation flag. 2021-02-14 12:58:45 +01:00
Michael Lutz
e5c3253642 Add: [OSX] Setting to disable HiDPI graphics rendering. 2021-02-14 11:50:18 +01:00
Michael Lutz
0fc763bc55 Change: [OSX] Render screen in full native resolution on HiDPI displays. 2021-02-14 11:50:18 +01:00
Michael Lutz
8906e9e0fd Codechange: Consistently use screen size and not driver resolution for determining window sizes. 2021-02-14 11:50:18 +01:00
Michael Lutz
b66e977acd Change: [OSX] When auto-detecting a font, try for sans-serif first.
On a display, especially with small fonts or low pixel sizes, sans-serif
fonts are usually easier to read than serif fonts.
2021-02-14 11:48:58 +01:00
Michael Lutz
6755ff63e1 Add: [OSX] Native font rendering without using FreeType. 2021-02-14 11:48:58 +01:00
Michael Lutz
21a2cd7bc3 Codechange: Replace magic numbers by constants. 2021-02-14 11:48:58 +01:00
Charles Pigott
8121706b89 Fix #8620: Scale spacing between date & news in history window according to font scaling 2021-02-13 22:15:25 +00:00
Charles Pigott
2b08f21625 Fix #8625: Wrong ending year was displayed in highscore table 2021-02-13 22:15:16 +00:00
Charles Pigott
f1fc083f2b Change: Make order window hotkeys toggle for load & unload variants 2021-02-13 22:14:58 +00:00
Michael Lutz
acca56b6a5 Cleanup: [OSX] Improve some comments. 2021-02-13 22:21:17 +01:00
Michael Lutz
c78e559e88 Codechange: [OSX] Remove unused 'app active' flag. 2021-02-13 22:21:17 +01:00
Michael Lutz
9c8721922b Fix: [OSX] An emulated right mouse down event has to be followed by right mouse up. 2021-02-13 22:21:17 +01:00
Michael Lutz
649ff5f9f9 Codechange: [OSX] Use relative mouse handling during scrolling. 2021-02-13 22:21:17 +01:00
Michael Lutz
43326d11d8 Change: [OSX] Use a layer-backed view to speed up drawing. 2021-02-13 22:21:17 +01:00
Michael Lutz
2a8c3a2cf6 Codechange: [OSX] Align backing buffer pitch for a tiny bit performance. 2021-02-13 22:21:17 +01:00
Michael Lutz
94b76ce9a4 Cleanup: [OSX] Move event loop into video driver file. 2021-02-13 22:21:17 +01:00
Michael Lutz
23389e9491 Remove: [OSX] Startup splash screen.
It wasn't displayed anyway as it was never copied to the bundle.
2021-02-13 22:21:17 +01:00
Michael Lutz
063b90b97d Codechange: [OSX] Move key event handling to our view. 2021-02-13 22:21:17 +01:00
Michael Lutz
f4bd54fedd Codechange: [OSX] Move mouse event handling to our NSView. 2021-02-13 22:21:17 +01:00
Michael Lutz
bd42fc94cc Codechange: [OSX] Move some things from video driver to our NSView. 2021-02-13 22:21:17 +01:00
Michael Lutz
965ce12947 Codechange: [OSX] Use newer mouse tracking API. 2021-02-13 22:21:17 +01:00
Michael Lutz
42af13c141 Codechange: [OSX] Split drawing into its own subview.
This allows the drawing backend code to be independent
of any event or command handling.
2021-02-13 22:21:17 +01:00
Michael Lutz
60f30036f1 Codechange: [OSX] Drain autoreleased objects in each game loop cycle. 2021-02-13 22:21:17 +01:00
Michael Lutz
8aaf4ea098 Codechange: [OSX] Split Window and back buffer creation in Cocoa video driver. 2021-02-13 22:21:17 +01:00
Michael Lutz
0eff7de659 Cleanup: [OSX] Doxygen comment style in video driver. 2021-02-13 22:21:17 +01:00
Michael Lutz
8ced72ab10 Codechange: [OSX] Inline some functions that are used in only one place. 2021-02-13 22:21:17 +01:00
Michael Lutz
13134f9d64 Codechange: [OSX] Replace #define with modern code. 2021-02-13 22:21:17 +01:00
Michael Lutz
88f6c7a9f3 Codechange: [OSX] Fold remaining Cocoa video subdriver into the main driver. 2021-02-13 22:21:17 +01:00
Michael Lutz
e6bea3961f Change: [OSX] Replace screen resolution list with suggested window sizes.
We never change the real screen resolution on OSX. As such, offering a list
of resolutions is pointless. Instead of that, offer the user a list of
commonly used window sizes up to the current screen size.
2021-02-13 22:21:17 +01:00
Michael Lutz
4db7837d06 Codechange: [OSX] There is only one subdriver left, remove virtual dispatch. 2021-02-13 22:21:17 +01:00
Michael Lutz
63ed3f3575 Codechange: Move Fontconfig-specific code to a seperate file. 2021-02-13 20:09:14 +01:00
Michael Lutz
f2294851e6 Codechange: [OSX] Move OSX-specific font code to a separate file. 2021-02-13 20:09:14 +01:00
Michael Lutz
c6af8f16f6 Codechange: [Win32] Move Win32-specific font code to a seperate file. 2021-02-13 20:09:14 +01:00
Michael Lutz
5ad1640984 Codechange: Make OS font handle of the FontCache read-only. 2021-02-13 20:09:14 +01:00
Michael Lutz
2b0200d429 Codechange: OS-specific data for font search is not used outside of searching. 2021-02-13 20:09:14 +01:00
Michael Lutz
84636fc2af Codechange: Remove all remaining uses of cpp_offset. 2021-02-13 20:08:53 +01:00
Michael Lutz
7845434270 Codechange: Don't use cpp_offsetof in the save/load code.
Many of the member variables that are used in save/load are inside types
that are not standard layout types. Using pointer arithmetics to determine
addresses of members inside types that are not standard layout is generally
undefined behaviour. If we'd use C++17, it is conditionally supported, which means
each compiler may or may not support it. And even then using it for individual
array elements is syntactically not supported the the standard offsetof function.

Unfortunately, the trickery employed for saving linkgraph settings causes quite some
clutter in the settings ini files.
2021-02-13 20:08:53 +01:00
Michael Lutz
9c9292949f Codechange: Don't use cpp_offsetof in the TTO/TTD savegame loader.
Many of the member variables that are used in the oldloader are inside types
that are not standard layout types. Using pointer arithmetics to determine
addresses of members inside types that are not standard layout is generally
undefined behaviour. If we'd use C++17, it is conditionally supported, which means
each compiler may or may not support it. And even then using it for individual
array elements is syntactically not supported the the standard offsetof function.
2021-02-13 20:08:53 +01:00
translators
0f621b4956 Update: Translations from eints
portuguese (brazilian): 36 changes by AKANexus
2021-02-13 18:59:59 +00:00
SamuXarick
36ab9c64ef Fix: Desert/rainforest data coordinate 'y' is off by 1 when their 'x' coordinate is negative 2021-02-13 19:18:41 +01:00
Charles Pigott
d9df20d102 Change: Use a more specific error message when attempting to bulldoze your own HQ 2021-02-13 18:10:13 +00:00
glx22
348f322df1 Fix f1f281b31: [Win32] MinGW doesn't know timeapi.h 2021-02-13 19:07:42 +01:00
glx22
5a4d5f03b0 Codechange: Implement a constructor for CurrencySpec 2021-02-13 17:31:57 +01:00
Johannes E. Krause
3ac43582c2 Codechange: [NewGRF] Make it more explicit which parts of the TTD vehicle structure (var 80+) are not implemented 2021-02-13 16:07:23 +00:00
translators
fa0704138d Update: Translations from eints
spanish (mexican): 7 changes by absay
dutch: 7 changes by Afoklala
french: 7 changes by arikover
2021-02-12 19:00:59 +00:00
Patric Stout
52317bb7df Change: [SDL2] Remove unneeded delay of redrawing the screen
In testing, I could find no reason why this statement is here.

The comment is rather unclear (it states what it does, but not
why it would be needed).

This line of code was introduced with f4f40448, which gives no
further insight on why it would be needed to have it here.

As such, let's remove it and see if anyone else reports any
problems with it. If so, this commit can be reverted and a more
clear comment should be added what this line of code is dealing
with (the WHY, not the WHAT).
2021-02-11 20:23:53 +01:00
Patric Stout
2e1535389a Codechange: [SDL2] Don't use globals if we can do with locals 2021-02-11 20:23:53 +01:00
Patric Stout
2bbef6b5cf Codechange: [SDL2] Name paint function Paint(), like other drivers do
This reduces confusion when reading different drivers.
2021-02-11 20:23:53 +01:00
Patric Stout
569ce6c7b4 Fix 30e69c51: palette was not marked dirty when creating a new
This means the code depended that the caller did this for us
before MakePalette() is executed, which is neither a
requirement nor a promise the code makes.
2021-02-11 20:23:53 +01:00
translators
64e2d6b672 Update: Translations from eints
korean: 7 changes by telk5093
russian: 11 changes by Ln-Wolf
finnish: 7 changes by hpiirai
2021-02-11 19:01:10 +00:00
Kuhnovic
83ddb1501f
Feature: Remove all industries button in scenario editor (#8550) 2021-02-10 16:35:50 +01:00
Loïc Guilloux
f1f281b318
Fix: [Win32] Set minimum resolution for timers to 1ms. (#8660) 2021-02-09 21:21:57 +01:00
embeddedt
6c8f2227cd
Fix: [Emscripten] open links in browser (#8655) 2021-02-08 19:18:30 +01:00
Patric Stout
ac2b5e57cf
Fix: mention our websites with https:// (instead of http://) (#8657)
It is 2021. Nobody should advertise http anymore. Not even us.
2021-02-08 19:07:34 +01:00
glx22
2cbfcd2327 Change: [CMake] Bump minimum version to 3.9 2021-02-07 16:21:13 +01:00
Loïc Guilloux
b927da73c1
Fix 81d335b081: Use non-pulsating red highlight for coverage (#8622) 2021-02-07 16:20:26 +01:00
Matt Kimber
2a6da319b2
Fix 0125892: Don't crash when towns upgrade road tiles during expansion (#8651) 2021-02-07 16:15:46 +01:00
Patric Stout
2c9084d48c
Fix #8029: [SDL2] disable draw-thread on wayland SDL video driver (#8648)
When the wayland SDL video driver is used, an EGL context is
created in the main thread. It is not allowed to update this
context from another thread, which is exactly what our draw-thread
is trying.

The other solution would be to move all of SDL into the
draw-thread, but that would introduce a whole scala of different
problems.

The wayland SDL backend is significantly faster than the
X11 SDL backend, but there is a performance hit nevertheless.
2021-02-06 14:09:45 +01:00
SamuXarick
a4035af337
Codechange: Apply coding style (#8640)
* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
2021-02-05 11:00:36 +01:00
translators
5b3fe4ae27 Update: Translations from eints
german: 4 changes by Wuzzy2
2021-02-02 18:17:17 +00:00
glx22
144991990e Fix: [CMake] Language files should depend on english.txt 2021-02-02 17:33:18 +01:00
translators
696b6990ea Update: Translations from eints
estonian: 110 changes by siimsoni
2021-02-01 18:17:06 +00:00
translators
069fb54253 Update: Translations from eints
estonian: 17 changes by siimsoni
german: 410 changes by Wuzzy2
2021-01-31 18:14:37 +00:00
Patric Stout
7fbf705c41
Fix 2db88953: default Network Server List sorter put compatible servers in wrong order (#8626)
If a server is compatible, it falls back to sorting by clients.
This used to be in reverse, so full servers are on top. With
the codechange commit, this was removed by accident, and as
such empty servers were on top. This is silly.
2021-01-31 10:36:07 +01:00
Tyler Trahan
1dda7d6486
Fix: don't walk out of the map when trying to build tunnels (#8600) 2021-01-31 10:04:22 +01:00
Patric Stout
0e54c32452 Codechange: [SDL2] Use MakeDirty() to force a redraw
The original code is "strictly correct", but just reads really
weird, and we use MakeDirty() in several other places instead too.
2021-01-30 21:43:59 +01:00
Patric Stout
30e69c518b Codechange: [SDL2] Rework how palette is updated
It now follows more what the Win32 driver does, and has far less
exceptions and special casing.

MakePalette creates the Palette and prepares surface.
UpdatePalette updates the Palette.
CheckPaletteAnim checks if UpdatePalette needs to be called and
  marks the whole screen dirty so DrawSurfaceToScreen will do a
  full redraw.
2021-01-30 21:43:59 +01:00
Patric Stout
eb80fefd1d Fix: [SDL2] Display why SDL_CreateWindow() failed in case it does
All SDL_NNN errors print SDL_GetError, except for this one place.
2021-01-30 21:43:59 +01:00
Patric Stout
19345908cb Codechange: [SDL2] Split away CreateMainWindow from CreateMainSurface
This makes the code a bit more readable, as both intentions are
more clear, and there is less nesting in the main function.
2021-01-30 21:43:59 +01:00
Patric Stout
8c37e5c526 Codechange: [SDL2] reworked the different surfaces to make it more readable 2021-01-30 21:43:59 +01:00
Patric Stout
8de325f256 Codechange: [SDL2] Only prepare "caption" if you are going to us it 2021-01-30 21:43:59 +01:00
Patric Stout
e41ec5b42e Codechange: [SDL2] Minor code cleanup to remove silly variable 2021-01-30 21:43:59 +01:00
Patric Stout
678031f9b3 Codechange: [SDL2] Only set _cur_palette, never _local_palette 2021-01-30 21:43:59 +01:00
Patric Stout
f31b65825f Codechange: [SDL2] Move FindStartupDisplay to its own function 2021-01-30 21:43:59 +01:00
Patric Stout
6916fc76bd Codechange: [SDL2] reworked FindResolutions to be more like the rest
There was no default resolution fallback, and the code was different
from the win32 driver. It is now named the same and much more
similar.
2021-01-30 21:43:59 +01:00
Patric Stout
a52d716c88 Codechange: [SDL2] remove include-protection
This is already done by CMake: if SDL2 is not detected, this file
is not included.
2021-01-30 21:43:59 +01:00
translators
5ae2c1552b Update: Translations from eints
estonian: 353 changes by siimsoni
2021-01-30 18:14:36 +00:00
translators
48698403a8 Update: Translations from eints
estonian: 85 changes by siimsoni
korean: 30 changes by telk5093
portuguese: 24 changes by CheapWebdesign
2021-01-29 18:17:44 +00:00
translators
3dac139b00 Update: Translations from eints
estonian: 5 changes by siimsoni
hungarian: 7 changes by andrejmoltok
2021-01-28 18:16:32 +00:00
translators
da78b5c130 Update: Translations from eints
estonian: 117 changes by siimsoni
german: 5 changes by Wuzzy2
slovak: 23 changes by FuryPapaya
2021-01-27 18:14:58 +00:00
translators
027452fef8 Update: Translations from eints
german: 11 changes by Wuzzy2
2021-01-26 18:14:06 +00:00
translators
67fa5a23b9 Update: Translations from eints
estonian: 7 changes by siimsoni
2021-01-25 18:42:15 +00:00
translators
b2d9a2dc79 Update: Translations from eints
estonian: 12 changes by siimsoni
finnish: 1 change by hpiirai
2021-01-23 18:39:34 +00:00
glx22
6b8ad5a9b1 Change: Apply some consistency to singleplayer related comments 2021-01-22 22:19:55 +01:00
glx22
07385c3662 Fix: Use the same safety checks as 'stop_ai' for 'reload_ai' 2021-01-22 22:19:55 +01:00
glx22
485aafc1b7 Fix: Never delete the last existing company in singleplayer mode 2021-01-22 22:19:55 +01:00
dP
b17177bd20 Fix: Center text and image in vehicle statusbar vertically 2021-01-22 22:18:17 +01:00
translators
8fe79e153d Update: Translations from eints
estonian: 8 changes by siimsoni
german: 89 changes by Wuzzy2
finnish: 2 changes by hpiirai
dutch: 27 changes by Afoklala
2021-01-22 18:43:56 +00:00
dP
bab7de6cf2 Feature: Allow GameScripts to add additional text to Industry view window 2021-01-22 09:50:53 +00:00
Pavel Stupnikov
4b42ecb0f6
Feature: Add tile parameter for GSCompany.ChangeBankBalance to show text effect if needed (#8573) 2021-01-22 10:28:26 +01:00
translators
33e27e9480 Update: Translations from eints
estonian: 15 changes by siimsoni
russian: 23 changes by Ln-Wolf
2021-01-21 18:42:13 +00:00
translators
6e1581a17d Update: Translations from eints
german: 2 changes by Wuzzy2
russian: 13 changes by Ln-Wolf
2021-01-20 18:44:27 +00:00
translators
27caabdb91 Update: Translations from eints
german: 23 changes by Wuzzy2
russian: 70 changes by Ln-Wolf
2021-01-19 18:41:55 +00:00
frosch
b3d048dfcf
Change: [NewGRF] industry special flag 19 now specifically targets only passenger production, instead of the second cargo of any water-based industry. (#8590)
This behavior is less surprising to NewGRF authors, and may even be intentional behavior for some industries.
2021-01-18 22:42:10 +01:00
Michael Lutz
7da224d29d
Fix #8589, 653e7fa548: Motion counter is NewGRF-visible but not saved, leading to desyncs. (#8591) 2021-01-18 21:11:38 +01:00
Owen Rudge
6d95ed53dc Feature: Add support for rdtsc for ARM-based Windows (MSVC) 2021-01-18 08:57:58 +00:00
Patric Stout
1eceee915e Codechange: [SDL2/Win32] Be consistent how 0bpp blitters are not allowed
Sometimes it returned an usererror(), sometimes Start() failed.
Now it always fails on Start(), so nothing else has to check again
what blitter is used.

AfterBlitterChange() can never change to a 0bpp, so it is sufficient
to guard this with an assert().
2021-01-17 19:57:36 +01:00
Patric Stout
49df9c4155 Codechange: [Win32] Use _local_palette for most operations
Other drivers do this too, and this makes the world a bit more
the same.
2021-01-17 19:57:36 +01:00
Patric Stout
881d17d8f1 Codechange: [Win32] use CSleep() instead of Sleep() like everywhere else
Functional it is identical. Just helps future-us when searching
for sleeps.
2021-01-17 19:57:36 +01:00
Patric Stout
689404a4a1 Codechange: [Win32] Use return-early in RegisterWndClass() 2021-01-17 19:57:36 +01:00
Michael Lutz
7415964a4d Codechange: [Win32] Remove Windows 95 specific mouse tracking work-around. 2021-01-17 19:57:36 +01:00
Matt Kimber
40d5fe1631
Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds (#8540) 2021-01-17 19:57:16 +01:00
translators
120c6fda61 Update: Translations from eints
catalan: 11 changes by J0anJosep
2021-01-17 18:39:39 +00:00
frosch
540fdfbf5a
Fix 0e62a398c7: Only center the window, when it is smaller than the screen. (#8581) 2021-01-16 23:36:15 +01:00
translators
c91a7b5e2e Update: Translations from eints
norwegian (bokmal): 65 changes by fnutt
french: 1 change by glx22
2021-01-16 18:40:42 +00:00
frosch
0e62a398c7
Add: [SDL2] video driver parameter to put OpenTTD on a particular display on start. By default use the display where the mouse cursor is. (#8572) 2021-01-14 23:29:29 +01:00
Michael Lutz
fa60c1f8b9
Feature: Choose a sensible window size on a fresh OTTD config file. (#8536) 2021-01-14 21:53:06 +01:00
translators
711723d738 Update: Translations from eints
norwegian (bokmal): 10 changes by buzzCraft
spanish (mexican): 7 changes by absay
korean: 1 change by telk5093
indonesian: 30 changes by dimaspaf14
finnish: 1 change by hpiirai
catalan: 2 changes by gerardnll
portuguese (brazilian): 4 changes by AKANexus
polish: 1 change by yazalo
2021-01-14 18:44:37 +00:00
glx22
86818e5ae8
Fix #7670: prevent useless pathfinder run for blocked vehicles 2021-01-14 18:41:38 +01:00
Jonathan G Rennison
1411f878ab
Add: Console command to dump debugging information (#8548) 2021-01-13 21:16:47 +01:00
translators
b99eafbfb0 Update: Translations from eints
korean: 14 changes by telk5093
finnish: 1 change by hpiirai
spanish: 41 changes by MontyMontana
polish: 5 changes by yazalo
2021-01-13 18:48:46 +00:00
Charles Pigott
ebaecebc68 Fix #8560: Planes were landing at the wrong height at airports with lowered hangar tiles 2021-01-13 16:41:30 +00:00
SamuXarick
f9dee5aaa0 Feature: Show rainforest under vegetation on small map 2021-01-13 15:05:15 +00:00
Patric Stout
de44ce2092
Change: darken the background of all graph to increase contrast (#8557)
Now lines like Mauve, Dark Green and Purple are much more visible
without hurting the other colours.
2021-01-13 14:55:55 +01:00
Patric Stout
c6fd6cfd15 Fix: tell the user if a font fails to load and fallback is about to be used
Additionally, tell exactly why the font failed to load, which
glyph was missing from the font. This hopefully helps the user
a bit more in the right direction.
2021-01-13 14:27:39 +01:00
Patric Stout
98400974a9 Codechange: nobody was using "str" parameter, so remove it 2021-01-13 14:27:39 +01:00
translators
57c45a2c01 Update: Translations from eints
spanish (mexican): 64 changes by absay
indonesian: 7 changes by dimaspaf14
finnish: 94 changes by hpiirai
slovak: 25 changes by gpalino
french: 11 changes by glx22
polish: 11 changes by yazalo
2021-01-12 18:38:08 +00:00
translators
3e7c757398 Update: Translations from eints
spanish (mexican): 1 change by absay
2021-01-11 21:23:47 +00:00
frosch
e339188ded Add: a go-to-location button to the LandInfo window. 2021-01-11 22:15:58 +01:00
frosch
1432dbac53 Add: another go-to-location button to the sign window. 2021-01-11 22:15:58 +01:00
frosch
5bfcd742b8 Change: Relocate rename and location buttons in all windows. 2021-01-11 22:15:58 +01:00
frosch
589feba0eb Change: Relocate vehicle rename and location buttons. 2021-01-11 22:15:58 +01:00
frosch
8dda0ec4ff Add: [NewGRF] new GUI sprites for 'rename' and 'go to location'. 2021-01-11 22:15:58 +01:00
Patric Stout
cd36e17160
Fix: don't allow free-wagon-chains to exceed max-train-length (#8533)
This makes no sense, that a free-wagon-chain could be larger than
the maximum length of a train, as you cannot put an engine in
front of that anyway. And it prevents run-away AIs making very
silly long free-wagon-chains.
2021-01-11 20:58:00 +01:00
Patric Stout
760b0cdc11 Change: change console command "restart" and add "reload"
The current "restart" command is now called "reload", as that is
what it does.
The old "restart" command is now called "restart", as that is what
it did.

As this has not been in any official release yet, this shouldn't
harm any kitten.
2021-01-11 20:11:08 +01:00
Patric Stout
ff89f5f4c6 Fix 8f3d1ec: "restart" did not always restart your current game
In the sequence:
- Load a game
- Start a newgame (via console)
- Restart a game (via console)
Gave you the loaded game back, not the new game.
2021-01-11 20:11:08 +01:00
Patric Stout
fe86bf8bf6
Fix #7619: nudge fast planes sooner towards their target (#8531)
For non-NewGRF planes, "count" is never above 1. So planes can
smoothly be guided to their destination. For NewGRF planes, they
can go as quick as "count" values of 20. This easily overshoots
the target. So, calculate if the plane will overshoot, and start
nudging him to the destination earlier. You won't notice this
either way, as it all happens within a single tick.
2021-01-11 20:10:53 +01:00
translators
eb23a6921b Update: Translations from eints
arabic (egypt): 30 changes by AviationGamerX
indonesian: 30 changes by dimaspaf14
german: 12 changes by MagnumSociety
french: 5 changes by glx22
2021-01-11 18:33:36 +00:00
SamuXarick
6298d9221a Fix 218f40e: Warning about 32-bit shift implicitly converted to 64 bits 2021-01-10 22:31:01 +01:00
frosch
f6abc81cf1 Fix: add missing variables to NewGRF inspect window. 2021-01-10 21:24:38 +01:00
Johannes E. Krause
f1bc4d8407 Add: [NewGRF] Vehicle variable 4A now also returns, whether the current tile has catenary. 2021-01-10 21:24:38 +01:00
frosch
868d84bbfc Add: [NewGRF] vehicle variable 63 to test the tracktype of the current tile against a given tracktype. 2021-01-10 21:24:38 +01:00
frosch
5b08960560 Fix: [NewGRF] industry variables 69 to 71 did not check, whether the queried cargo is valid. 2021-01-10 21:24:38 +01:00
frosch
0078554d6a Fix: GetCargoTranslation could return out-of-bounds index for old-style NewGRF using cargo-slots. 2021-01-10 21:24:38 +01:00
translators
63288f80f3 Update: Translations from eints
korean: 1 change by telk5093
finnish: 1 change by hpiirai
polish: 5 changes by yazalo
2021-01-10 18:31:52 +00:00
glx22
1fb4ed8eef Fix: Use realtime for error message and console backlog timeouts 2021-01-10 14:07:17 +01:00
glx
c0d7949d7c Fix: Don't use a timer for hundredth tick determination 2021-01-10 14:07:17 +01:00
Patric Stout
5f1154e076
Fix #8272: vehicle destination text colour when mousing over (#8543)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2021-01-09 23:43:06 +01:00
translators
928276a66e Update: Translations from eints
korean: 4 changes by telk5093
finnish: 4 changes by hpiirai
catalan: 11 changes by J0anJosep
2021-01-09 18:30:51 +00:00
Patric Stout
218f40eea2
Add: [Script] ScriptCargo::GetName, to get the human readable name of a cargo (#8544)
Of course this translates into AICargo.GetName() for AIs and
GSCargo.GetName() for GameScripts.
2021-01-09 15:15:14 +01:00
Patric Stout
3dbdb1c7e3
Change: remove warning in cheat window and reduce it to a note (#8538)
Although meant as a funny joke towards the player, our social
standards have changed since 2004, and such "jokes" are no
longer acceptable by the community as a whole.

The only value of the message is that people are informed the
information is stored in the savegame. This is mostly useful for
us, developers, as some of those cheats can have side-effects
which people report.

While at it, styled the GUI a bit better, as the way the text
was presented was odd.
2021-01-09 15:14:59 +01:00
SamuXarick
8da5cff210
Fix #8462: Don't check whether to grow a town road on water (#8471) 2021-01-09 12:18:31 +01:00
Patric Stout
8e6574dcdb
Revert 78f92130: "Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535)" (#8541)
As per https://github.com/OpenTTD/OpenTTD/pull/8535#issuecomment-757122918,
jumped the gun here.
2021-01-09 12:14:23 +01:00
Tyler Trahan
b0456669c9
Fix #8506: Towns shouldn't add junctions to NewGRF roads they cannot build (#8535) 2021-01-09 10:06:31 +01:00
Patric Stout
b6ac5a3ab9
Fix 85a49a0d3: hotkeys were enabled outside of GM_NORMAL (#8534) 2021-01-08 23:28:46 +01:00
Patric Stout
5f591c86fe
Fix 85a49a0d: invalidate airport toolbar when new planes become available (#8532)
Otherwise if the airport button is disabled, it will remain disabled
until you close/open the toolbar again.
2021-01-08 22:34:21 +01:00
frosch
31d1968004
Fix: Start the inactivity-timeout for the content server only after the connection has been established. (#8530)
When connecting took long due to the first N resolve-addresses timing out, OpenTTD would immediately close the connection, without sending anything.
2021-01-08 20:20:54 +01:00
Patric Stout
7ba0fa4bf0
Fix af22a4f2: scenario editor doesn't have build station/depot/etc (#8529) 2021-01-08 19:48:39 +01:00
translators
0f1d338dda Update: Translations from eints
korean: 2 changes by telk5093
finnish: 2 changes by hpiirai
dutch: 49 changes by Afoklala
spanish: 16 changes by Luis45ccs
french: 7 changes by dimensi0n
polish: 2 changes by yazalo
2021-01-08 18:26:47 +00:00
Tyler Trahan
b08c66a796
Fix 7bdfb38: Drive-thru road stations can be connected at either end (#8528) 2021-01-08 18:56:39 +01:00
Tyler Trahan
9c0da686da
Add: Towns can build tunnels (#8473) 2021-01-08 18:32:44 +01:00
Charles Pigott
188bf0fbc9 Change: Remove disable_unsuitable_building setting
This setting is no longer useful, as you can now always build roads,
canals, etc.
2021-01-08 16:43:51 +01:00
Charles Pigott
b9f3e45af7 Cleanup: Remove unused (and mostly duplicated) function 2021-01-08 16:43:51 +01:00
Patric Stout
af22a4f2cd Add: show in the tooltip of disabled toolbar buttons why they are disabled 2021-01-08 16:43:51 +01:00
Patric Stout
85a49a0d36 Change: always allow to click on the toolbar icons for road/rail/dock/airport
This change allows a user to see what is available and what will become
available before it is available, instead of only disabling the button
with no further explanation. It also always allows building roads and
canals, even if no vehicles are available for road / water.

For rail/road/tram, a dropdown with available types is shown. If
none are available, it reads "None". If the type is not yet available,
it is greyed out.

For dock/airport, this always open the toolbar, but building airports,
docks, and depots buttons are disabled till vehicles are available
for those.

Road is the only exception, with the primary road always being
available. Here too, stations and depots are disabled till vehicles
become available. It does mean you can now always build roads to
for example help towns grow.
2021-01-08 16:43:51 +01:00
Chris Stevens
a6aec252b1
Fix #8153: Report incompatible cargo/order when autoreplace fails (#8169) 2021-01-08 16:05:49 +01:00
Patric Stout
9aa39d0af9
Fix #7972: show invalid orders to stations that don't accept your vehicle (#8516)
Before it was shown as a normal order, but the vehicle was skipping
it. This was rather unclear to the user. Now it is red and contains
text with some hints what is going on.

The text is prefixed rather than post-fixed, as we have many
post-fixes already.
2021-01-08 16:04:44 +01:00
Patric Stout
fda1fbf61c
Revert c1fddb9, 639cfa4: "Codechange: Check if access __attribute__ is supported before trying to use it." (#8526)
This reverts commit c1fddb9a6a and 639cfa43d2.

access_mode "none" is only supported by GCC11, but introduced
after it branched. So there are GCC11.0s out there that do not
support it. We will have to wait for GCC11.1 to hit before we
can re-add this.
2021-01-08 15:25:44 +01:00
Patric Stout
7463c46a54
Fix: for arctic and tropic, make sure we have at least a few hills (#8513)
Without hills, not all industries can be generated, which means
that with a default configuration you get errors. This is far from
optimal, of course.

This now forces that there is at least some hills, even when you
are using very-flat. This is a stopgap solution, but a proper
solution requires a full rewrite of the terrain generator, which
is not a 2 minute (or even 2 week) job.

To make sure flat is still flat-ish, reduce the default
snow-line-height to 10, making it look a lot better on smaller maps.
This is a compromise between being able to have flat maps and
still having all industries on arctic.
2021-01-08 12:02:38 +01:00
Patric Stout
aac8c28d73 Fix #7656: destroying a tunnel/bridge now first removes the tracks for cost calculation
This means that for rail tunnel/bridges, the rail is first sold,
and the tunnel/bridge is destroyed after. This means destroying
tunnels/ bridges now often makes you money, instead of costing.

Similar, with road/tram tracks. Destroying a road+tram
tunnel/bridge now costs the same amount of money as first
removing the tram tracks and than destroying the road
tunnel/bridge. Especially as tram tracks generate money when
removing, this is a noticeable difference.
2021-01-08 12:02:25 +01:00
Patric Stout
ebd9f26c15 Fix: replacing a bridge didn't charge for clearing last tile
It only considered the end-tile (or start-tile) for the bridge,
instead of both. This is obvious in the rest of the code which
constantly does "+ 2"; this being the only place that does a "+ 1".
2021-01-08 12:02:25 +01:00
Patric Stout
ef6b17baf7 Fix 2fd871e2af: load correct ending-year for old (pre 0.7) savegames
Despite what it looked like, you could never really change the
ending-year (it was always reset to 2050 on start-up). See commit
683b65ee1 for details. As a side-effect, the variable that was
suppose to store the ending-year was just zero, never containing
a real ending-year.
2021-01-08 11:17:08 +01:00
Patric Stout
a1987df96a Fix #8050: never show the highscore when disabled, not even if you start in year zero
Using zero as "never" value can have its drawbacks ;)
2021-01-08 11:17:08 +01:00
Patric Stout
d9ec8053d7 Fix #8050: ending-year of 5000000 allows you to get to year 5000001 and beyond
MAX_YEAR is set to 5000000, but having an ending-year set to the
same meant you could bypass this, and play till the uint32 wrapped.

The game can either show highscore or wrap year, not both. When
you would do both, every year you get the highscore dialog.

By changing the maximum value of ending-year to 4999999 we prevent
this issue.
2021-01-08 11:17:08 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
milek7
c1fddb9a6a Codechange: Check if access __attribute__ is supported before trying to use it. 2021-01-08 09:12:37 +00:00
milek7
639cfa43d2 Codechange: Use access __attribute__ to silence warnings in GCC 2021-01-08 00:40:45 +00:00
SamuXarick
79d938b957 Fix 0125892: Warning about unsigned unary minus 2021-01-07 21:42:10 +00:00
Patric Stout
725d793be1
Fix: don't allow cloning vehicles if cloning orders is failing (#8515)
Before this fix, any failing clone order was silently ignored
and you as user would never know till you checked the order list.
Evil.
2021-01-07 19:58:04 +01:00
translators
51e22515a8 Update: Translations from eints
spanish (mexican): 5 changes by absay
korean: 5 changes by telk5093
finnish: 5 changes by hpiirai
latvian: 14 changes by lexuslatvia
spanish: 23 changes by SeveralCircles, 10 changes by Luis45ccs
polish: 5 changes by yazalo
2021-01-07 18:28:27 +00:00
SamuXarick
f84a466ca5
Fix #7945: Add cost of clearing the sloped tile when placing a dock (#7947) 2021-01-07 10:35:09 +01:00
Patric Stout
c988b4d62b
Fix #8332: aborting group drag&drop could cause crashes with vehicle drag&drop (#8511)
The selected group was not reset when drag&drop was aborted. When
after that vehicle drag&drop was successful, group drag&drop code
was still executed, causing weird behaviour or even crashes.
2021-01-07 10:32:24 +01:00
Kuhnovic
a3a7928372
Feature: option to auto remove signals when in the way during rail construction (#8274) 2021-01-07 10:17:05 +01:00
Patric Stout
1b675e7075
Fix #8068: always allow removal of tram track if that generates money (#8509)
Even if you are completely broke, generating money should always
be allowed.
2021-01-07 08:01:46 +01:00
Patric Stout
c7609e767f
Fix #7604: prevent houses to wander too far from town center when rebuilding (#8507)
When a multi-tile house is rebuild, it always used the most northern
tile to build the new house. This can very easily lead to houses
wandering off in the north-ish direction (either NW or NE).

To prevent this, pick the tile closest to town center when rebuilding
on a multi-tile house. This still means a house can be build away
from a road, but it is no longer wandering around finding another
town to call home.
2021-01-07 08:01:23 +01:00
Patric Stout
28c13ec90f
Fix #8168: allow relocating of HQ partial over existing HQ (#8510)
Just in case you want to move it SLIGHTLY to the right.
2021-01-06 22:37:57 +01:00
Patric Stout
a4e34e824c Change: towns can now bridge 4 rails (up from 3)
Having 4 rails is a pretty common design, and towns now couldn't
bridge out of this common design.
2021-01-06 21:39:34 +01:00
Didac Perez Parera
64eddaeb49 Feature: Make maximum length of town bridges depend on population. 2021-01-06 21:39:34 +01:00
translators
c3faec4e9a Update: Translations from eints
polish: 7 changes by yazalo
2021-01-06 18:27:36 +00:00
Patric Stout
62cdadb582 Change: move "give money" from client-list to company window
This is a much better location for this button, as you send
money from one company to another company, not from player
to player.

This is based on work done by JGRPP in:
f820543391
and surrounding commits, which took the work from estys:
https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311

We did modify it to fix several bugs and clean up the code while
here anyway.

The callback was removed, as it meant a modified client could
prevent anyone from seeing money was transfered. The message
is now generated in the command itself, making that impossible.
2021-01-05 21:56:24 +01:00
Patric Stout
d6e15d4943 Fix: make the "password" button the same size as the other buttons in Company window
Currently password-lock icon + button was the same size, but this
looks really weird. Now they are in sync, even with other fonts
and languages.
2021-01-05 21:56:24 +01:00
Patric Stout
a3f0ee3b63 Codechange: fix alignment of Company GUI
Code acted as if WWT_TEXT starts a scope; it does not.
2021-01-05 21:56:24 +01:00
Patric Stout
fc474b02fa Fix: change all Company planes on paint, not only the first that needs changing
Otherwise it can take a few OnPaint() calls before all planes are
set correctly when switching companies.
2021-01-05 21:56:24 +01:00
Patric Stout
dff7ee8e1c
Fix #7611: keeps news about accidents around after vehicle is cleaned up (#8497)
When a vehicle is cleaned up, all news that points to the news is
also removed. This was a bit evil, as it would also remove any
news related to crashed, acting like the crash never happened.
This left players a bit in the dark what was going on exactly.
2021-01-05 21:39:23 +01:00
translators
0fd2108f7f Update: Translations from eints
persian: 24 changes by alisaffari97
2021-01-05 18:27:57 +00:00
Patric Stout
f2fa2a14d7
Fix: allow input of numbers greater than INT32_MAX for GiveMoney (#8499)
Based on patch by JGR.
2021-01-05 19:00:05 +01:00
Patric Stout
bb28ff7226
Codechange: DC_NO_RAIL_OVERLAP is a remnant of the OldAI. (#8496)
The OldAI was removed in 2009. Pretty sure we can remove this flag
now too.
2021-01-05 12:36:57 +01:00
gooball
c017a3662a
Change: converting town-owned road types now require town rating (#8457) 2021-01-05 11:45:07 +01:00
Charles Pigott
e21302f481 Fix #8437: Crash when using certain heliports with rotated airports 2021-01-05 11:42:51 +01:00
Charles Pigott
619d714923 Fix #8437: Planes landing at non-rectangular airports could be drawn at the wrong height
Only the rotated intercontinental airport, don't get excited
2021-01-05 11:42:51 +01:00
Matt Kimber
5728f9c7d0 Codechange: consider vehicle co-ordinates when identifying viewport candidate as using only the hash generates false positives 2021-01-05 11:42:25 +01:00
Matt Kimber
9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 2021-01-05 11:42:25 +01:00
Matt Kimber
eeb88e87d8 Codechange: improve performance for complex vehicle chains by resolving sprites less often 2021-01-05 11:42:25 +01:00
Michael Lutz
979b4af6ca Revert 4ce53cb8: [OSX] Delayed fullscreen switch is not needed anymore.
The fix for #8067 solves the real issue, making this workaround unneeded.
2021-01-03 22:24:04 +01:00
Michael Lutz
6e8be3b03e Fix #8067: [OSX] Calculate title bar height instead of assuming a fixed value. 2021-01-03 22:24:04 +01:00
Andy
0f91cb0479
Fix: GetCurveSpeedLimit needs railtype from current tile (#8466) 2021-01-03 22:19:06 +01:00
Michael Lutz
4ce53cb851 Fix: [OSX] Quitting in fullscreen mode would loose the original window size.
This replicates the behaviour on e.g. Windows, which saves the original window size.
2021-01-03 21:20:28 +01:00
Michael Lutz
c860a247d3 Change: [OSX] Hide Dock and menu during fullscreen mode. 2021-01-03 21:20:28 +01:00
translators
784a4ef9b5 Update: Translations from eints
spanish (mexican): 14 changes by absay
finnish: 32 changes by hpiirai
polish: 2 changes by yazalo
2021-01-03 18:25:04 +00:00
frosch
b08d8c7edb Cleanup 9f42358: Make also reliability_start randomised independent of introduction date. 2021-01-03 14:56:43 +00:00
frosch
d24a9a9df5 Cleanup 8139b14: Move a comment back to the line it belongs to, and add a comment for new code. 2021-01-03 14:56:43 +00:00
Michael Lutz
6ad5489d01 Codechange: [OSX] Silence some annoying warnings. 2021-01-03 13:25:32 +01:00
Michael Lutz
7bdaabf5f1 Cleanup: [OSX] Remove cargo cult back-buffer alpha setting on show/hide and instead simply initialise the buffer on allocation. 2021-01-03 13:25:32 +01:00
Michael Lutz
a61a741683 Change: [OSX] Compiling the Cocoa/Quartz video driver cannot be disabled anymore. 2021-01-03 13:25:32 +01:00
Michael Lutz
9ccef816f9 Codechange: [OSX] Re-arrange the OSX video driver code by combining all drawing code and moving the window/event handling to a different file.
This is just a code move/rename, not a functionality change.
2021-01-03 13:25:32 +01:00
Patric Stout
ab7da117e0
Add: always set PERSONAL_DIR "/content_download" in search path (#8481)
This means that if you start OpenTTD with "-c" to indicate another
location to store files, it can still read the content you already
downloaded from your PERSONAL_DIR. This folder is, however,
read-only.

This is useful for situations where you downloaded OpenGFX via
the content-service, but want to run the regression or want to
run with a clean configuration. With this change, you no longer
need to download OpenGFX again.
2021-01-03 11:10:56 +01:00
Michael Lutz
8c24b2b6ce Fix: [OSX] Fonts loaded directly from a file have to be registered with CoreText for proper text layout. 2021-01-03 01:00:28 +01:00
Patric Stout
4bd3d18f34 Add: use our search-paths to find fonts based on relative filenames too
This allows "small_font = ./myfont.ttf", with "myfont.ttf" located
in "~/.openttd".
2021-01-02 23:44:37 +01:00
2TallTyler
fe51051b7c Change: Default settings improved for new players 2021-01-02 19:50:22 +00:00
Charles Pigott
3dfee979a7 Codechange: Drop libxdg-basedir dependency in favour of finding the directories ourselves 2021-01-02 19:46:08 +00:00
Patric Stout
c288eba813
Fix: prevent clients making emergency saves twice if server disconnects (#8477)
This was clearly overlooked during the initial implementation.
2021-01-02 20:34:55 +01:00
translators
46e13e7f0b Update: Translations from eints
finnish: 3 changes by hpiirai
catalan: 29 changes by J0anJosep
2021-01-02 18:24:09 +00:00
Patric Stout
8596b43b2b
Codechange: move some DEBUG-levels and remove some others in saveload routine (#8474)
When running with -dsl=2 it is very easy to miss important information
as there was a lot of noise in between too. This tunes the debug
levels a bit to be less noisy while keeping the important bits.
2021-01-01 14:41:14 +01:00
glx22
7222bc5814 Cleanup 2db88953e7: Remove VL_FIRST_SORT as it's useless 2021-01-01 01:04:27 +01:00
translators
a7fee48b7f Update: Translations from eints
finnish: 4 changes by hpiirai
french: 1 change by glx22
2020-12-31 18:27:03 +00:00
SamuXarick
9f423586ad
Change #8325: Make engine reliability independent of introduction date (#8470) 2020-12-31 17:06:48 +01:00
translators
18fccba410 Update: Translations from eints
spanish (mexican): 42 changes by absay
russian: 4 changes by Ln-Wolf
finnish: 2 changes by hpiirai
french: 35 changes by glx22
polish: 25 changes by yazalo
2020-12-30 18:26:18 +00:00
Jonathan G Rennison
15fd63b1b8 Fix: Assert fail when using restart command after opening save/load GUI 2020-12-30 00:57:09 +01:00
translators
80a7d0365b Update: Translations from eints
korean: 4 changes by telk5093
german: 84 changes by UnsuspiciousGooball
finnish: 4 changes by hpiirai
slovak: 7 changes by FuryPapaya
2020-12-29 18:26:06 +00:00
gooball
0125892f04
Fix #8297: Infrastructure counters for road tunnels, bridges, depots … (#8454)
The previous fix 887e9481ff0e70df6bf93ce15a3899a03f124c50 only worked for roads and failed to consider a multiplier used for the infrastructure totals for tunnels/bridges.
Also, depots and bus/truck stops are counted as 2 road pieces on creation but were only counted as 1 road piece on conversion because the function DiagDirToRoadBits() was used, which only ever returns single-piece road segments.

Co-authored-by: A. S <admin-git@sotai.tk>
2020-12-28 22:54:28 +01:00
translators
b30c3f6498 Update: Translations from eints
korean: 6 changes by telk5093
finnish: 6 changes by hpiirai
slovak: 47 changes by FuryPapaya
2020-12-28 18:21:37 +00:00
glx22
f7e48cac87 Fix #8453: [Script] Don't truncate loan variation to 32bit 2020-12-28 16:51:15 +01:00
dP
94057e9b18 Change: Add some style to GameScript question windows depending on the type 2020-12-28 11:27:42 +00:00
J0anJosep
edbb5f4f73 Doc: Remove some SmallVector references from documentation. 2020-12-27 18:40:18 +00:00
Charles Pigott
e0161cf8da Fix b408fe7: Don't try to construct a std::string from nullptr 2020-12-27 18:30:53 +00:00
translators
1bb0e6ed8c Update: Translations from eints
russian: 19 changes by lexuslatvia
finnish: 1 change by hpiirai
latvian: 19 changes by lexuslatvia
2020-12-27 18:18:16 +00:00
Michael Lutz
4f8e7b2a2b
Fix 65f65ad2: Missing path separator that fell over a cliff. 2020-12-27 15:07:06 +01:00
SamuXarick
dc5b8020cc
Fix #6452: Reset only editable and visible settings from GUI (#7890)
Also enables the Reset button while in-game for AI configs.
2020-12-27 15:05:47 +01:00
Michael Lutz
b408fe77f7 Codechange: Use std::string in file scanners. 2020-12-27 13:19:25 +01:00
Michael Lutz
358056ec42 Codechange: Keep filenames of loaded Fio files in std::strings. 2020-12-27 13:19:25 +01:00
Michael Lutz
024a3f6259 Codechange: Use automatic memory management for language pack reading. 2020-12-27 13:19:25 +01:00
Michael Lutz
5cbb2da794 Codechange: Even more std::string usage in file IO. 2020-12-27 13:19:25 +01:00
Michael Lutz
65f65ad2ad Codechange: Convert some more FIO functions to take std::string. 2020-12-27 13:19:25 +01:00
Michael Lutz
f3326d34e7 Codechange: Use std::string in FIO search path handling. 2020-12-27 13:19:25 +01:00
Michael Lutz
0c6e8a8123 Codechange: Store file search paths as std::string. 2020-12-27 13:19:25 +01:00
Michael Lutz
dd138fc460 Codechange: Stringify config file paths. 2020-12-27 13:19:25 +01:00
Charles Pigott
860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
cirdan
395a5d9991 Cleanup: Remove unused ChunkType flag CH_AUTO_LENGTH
CH_AUTO_LENGTH is no longer used anywhere, so remove all code
that depends on it.
2020-12-27 10:30:55 +00:00
cirdan
46ff7d918b Cleanup: Remove save-only autolength flag from economy chunk handlers
CH_AUTO_LENGTH is only used when saving chunks; it makes no sense
to set it for chunks without a save handler.
2020-12-27 10:30:55 +00:00
Jonathan G Rennison
0e017f6233 Codechange: Enable FINAL, (un)likely, __attribute__ when building with clang 2020-12-27 10:30:55 +00:00
Jonathan G Rennison
fc52d3df50 Codechange: Use likely/__builtin_expect for assertion macros 2020-12-27 10:30:55 +00:00
Jonathan G Rennison
5cf28be742 Codechange: Add support for verbose asserts 2020-12-27 10:30:55 +00:00
Jonathan G Rennison
eb74179c6d Codechange: Unconditionally use static_assert
We're well past having to support non-C++11 compliant compilers now.
2020-12-27 10:30:55 +00:00
Charles Pigott
52f3abba6e Cleanup: Remove unnecessary assert_tcompile macro 2020-12-27 10:30:55 +00:00
glx22
d8605ad18d Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loops 2020-12-27 10:28:46 +00:00
Michael Lutz
1478fa93b3 Add: [NewGRF] Patch flag to test if inflation is on or off. 2020-12-27 10:28:39 +00:00
Michael Lutz
5a5d613ee3 Change: Disable changing the inflation setting in network games. 2020-12-27 10:28:39 +00:00
Niels Martin Hansen
2d9fa81bd0 Feature: Plant clumps of trees in editor by dragging on the landscape 2020-12-27 01:03:27 +01:00
Niels Martin Hansen
e0ee2d530a Change: Switch tree GUI to use dynamically generated buttons
This makes it look a bit better in climates with fewer tree types.
2020-12-27 01:03:27 +01:00
Niels Martin Hansen
4d0f19406b Fix: Wrong tree sprite in tree toolbar 2020-12-27 01:03:27 +01:00
translators
2c8c6d423c Update: Translations from eints
korean: 18 changes by telk5093
2020-12-26 18:16:26 +00:00
Patric Stout
8fa2a67f6b Fix f66baa44: for-loop is no longer increasing "i"
During conversion it was overlooked that the for-loop used to do
this. Oops.
2020-12-26 13:32:25 +00:00
Patric Stout
6aef1164a4 Fix: [Emscripten] using TIC/TOC on this platform is silly
Stop throwing a warning about this, as it is not likely we will
ever implement it.
2020-12-25 20:56:25 +01:00
Michael Lutz
79cb9efa7f
Change: Always apply inflation from 1920 to 2090, no matter the game start year. (#7589) 2020-12-25 20:36:14 +01:00
Patric Stout
e6e91a345c
Fix f66baa44: index was off by one (#8433)
i++ in the 3rd part of a for() is post, not pre. Oops.
2020-12-25 19:57:13 +01:00
Patric Stout
f66baa444f
Codechange: use C++11 constructs for for-each loops (#8432) 2020-12-25 19:38:18 +01:00
translators
9add62796c Update: Translations from eints
finnish: 10 changes by hpiirai
2020-12-25 18:16:29 +00:00
Patric Stout
4319d31036 Fix #6468: don't store version of AIs-started-via-console in name
You can do: "startai myai.3", which starts version 3 of "myai".
This is very useful for testing save/load code between different
versions of your AI.

However, when using this syntax, the AI got saved as "myai.3" as
name of the AI, instead of "myai". This caused several problems,
like indicating to the user the AI could not be found, but still
load the AI. But in all cases, the AI never got the chance to
load the saved data, making the whole reason this exists pointless.

By splitting the name and version already in the console command,
the code becomes simpler and AIs started this way now follow the
normal flow after initialization.
2020-12-25 17:03:44 +01:00
Patric Stout
29e3331055 Codechange: move block a bit lower to increase readability
It was rather confusing that "library_name" was calculated, and
then not used to do the FindLibrary() call. Flipping those two
blocks around makes it a bit more sane to read.
2020-12-25 17:03:44 +01:00
Patric Stout
8c0e4ab07f
Doc: for over 10 years now, we do not load the exact AI version first (#8431)
See commit fae34ee7 for details. The documentation simply never
got updated.
2020-12-25 17:03:31 +01:00
translators
7b515fa0e2 Update: Translations from eints 2020-12-25 13:07:40 +00:00
frosch
ba49fa3b82 Codechange: Rename strings to match their usage. 2020-12-25 00:40:35 +01:00
frosch
2bb691f50e Change: Remove the LAN/Internet combobox from the server list in favour of adding two separate search buttons. 2020-12-25 00:40:35 +01:00
Tyler Trahan
7bdfb382a8
Change: Towns don't build dead-end road bridges (#8401) 2020-12-25 00:37:13 +01:00
Pavel Stupnikov
22b9dec960
Feature: Add an option to disable tree growth completely (#8415) 2020-12-25 00:36:54 +01:00
Pavel Stupnikov
04e572933d
Fix: Don't lower tree density if spreading is not enabled (#8413) 2020-12-25 00:36:45 +01:00
Jonathan G Rennison
94d629d79b
Change: [Linkgraph] Allow job threads to be aborted early when clearing schedule (#8416)
When link graph jobs are cleared due to abandoning the game or exiting,
flag the job as aborted.
The link graph job running in a separate thread checks the aborted flag
periodically and terminates processing early if set.
This reduces the delay at game abandon or exit if a long-running job
would otherwise still be running.
2020-12-25 00:36:36 +01:00
translators
ad47e3d9e6 Update: Translations from eints
finnish: 1 change by hpiirai
2020-12-24 18:19:47 +00:00
translators
2e6f37ecf1 Update: Translations from eints
arabic (egypt): 15 changes by AviationGamerX
korean: 15 changes by telk5093
finnish: 12 changes by hpiirai
2020-12-23 18:17:50 +00:00
translators
cc8301449e Update: Translations from eints
korean: 2 changes by telk5093
catalan: 13 changes by perezdidac
2020-12-22 18:13:57 +00:00
Jonathan G Rennison
7f0fefddcf Change: [Linkgraph] Only acquire thread join performance measurements on network clients
Network servers and single player clients do not block on thread joins
due to instead pausing shortly before the join is due.
2020-12-22 15:17:57 +01:00
Jonathan G Rennison
0c5dc5d41e Change: [Linkgraph] Pause the game when linkgraph jobs lag (#6470)
Check if the job is still running two date fract ticks before it is due
to join, and if so pause the game until its done.
When loading a game, check if the game would block immediately due to
a job which is scheduled to be joined within two date fract ticks,
and if so pause the game until its done.
This avoids the main thread being blocked on a thread join, which appears
to the user as if the game is unresponsive, as the UI does not repaint
and cannot be interacted with.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
2020-12-22 15:17:57 +01:00
Pavel Stupnikov
9a45a0f535
Feature: Set exclusive access to industry from GS (#8115) 2020-12-22 14:29:48 +01:00
Niels Martin Hansen
b7751c483e
Feature: Influence industry production changes from GS (#7912) 2020-12-22 14:21:31 +01:00
Patric Stout
547e5fdb65
Fix 86e08aa: STR_CARGO_PLURAL_CANDY with cases was not renamed (#8412) 2020-12-22 13:12:47 +01:00
Patric Stout
d8c8f4e72d
Fix: next 67 savegame versions are used in PatchPacks; skip them (#8411)
Various of PatchPacks (Spring 2013, Joker, ChillPP) used versions
slightly higher than ours. Of course, as time went by, this
caught up with us, and we are now almost pushing a new version
that would conflict with them. To avoid users creating unneeded
issues about "why can I not load my savegame", lets be ahead of
the curve and flat-out refuse to load them.

Version-wise, this is totally fine. We have ~32k versions to go
before we run out (0x8000 is masked by JGRPP; we should avoid
using that). At the rate we bump savegames, this is not going to
happen in any sane reality.
2020-12-22 10:44:07 +01:00
Matt Kimber
6c3a5b5b17
Fix c02ef3e4: [NewGRF] Variable 0x44 was always HZB_TOWN_EDGE for road stops. (#8400) 2020-12-21 23:46:38 +01:00
Bernard Teo
981c540201 Change: Place "Group by" above "Sort by" in station window for consistency 2020-12-21 23:15:53 +01:00
Bernard Teo
4af1acfe92 Feature: Drag-and-drop vehicles in group GUI for shared order groups 2020-12-21 23:15:53 +01:00
Bernard Teo
a5047b7566 Cleanup: Use range-based for-loop in group_gui.cpp 2020-12-21 23:15:53 +01:00
Bernard Teo
61fb1cac54 Cleanup: Move EndContainer() for empty WWT_PANEL to the same line 2020-12-21 23:15:53 +01:00
Bernard Teo
e59c400ca6 Feature: Option to group vehicle lists by shared orders
This applies to all kinds of vehicle lists, as well as the "vehicle groups" window.
2020-12-21 23:15:53 +01:00
Bernard Teo
584df548f1 Codechange: Make vehicle lists internally support grouping of vehicles
This is in preparation for the new UI feature that allows grouping by shared orders.
2020-12-21 23:15:53 +01:00
Xaroth Brook
86e08aa8ef Update: Apply name changes to all languages. 2020-12-21 23:12:58 +01:00
Xaroth Brook
d05be2cff5 Cleanup: Rework the CargoSpec macro for improved readability. 2020-12-21 23:12:58 +01:00
Patric Stout
34051c10df
Doc: some comments for the win32 video driver (#8409)
Co-authored-by: Niels Martin Hansen <nielsm@indvikleren.dk>
2020-12-21 22:28:56 +01:00
translators
f24bc8b509 Update: Translations from eints
vietnamese: 3 changes by KhoiCanDev
russian: 4 changes by Ln-Wolf
polish: 11 changes by yazalo
2020-12-21 18:08:31 +00:00
Michael Lutz
5575cb9133 Remove: Remnants of PSP support.
No active target is that limited in concurrent file descriptors.
2020-12-21 18:34:19 +01:00
translators
914fb4c987 Update: Translations from eints
korean: 1 change by telk5093
slovak: 6 changes by FuryPapaya
latvian: 9 changes by lexuslatvia
2020-12-20 19:04:18 +00:00
dP
e82333cf77 Feature #7962: Improve rendering of large viewports 2020-12-20 10:13:35 +01:00
dP
5ca8a0bda9 Feature #7962: Significantly improve sprite sorter performance 2020-12-20 10:13:35 +01:00
Michael Lutz
4c1ee264a6
Fix: [OSX] Warning about ambiguous method (-Wobjc-multiple-method-names). (#8399) 2020-12-19 21:59:27 +01:00
translators
2714e0a33f Update: Translations from eints
russian: 10 changes by Ln-Wolf
finnish: 4 changes by hpiirai
slovak: 16 changes by FuryPapaya
french: 1 change by glx22
2020-12-18 18:08:06 +00:00
translators
40269f5df2 Update: Translations from eints
finnish: 47 changes by hpiirai
2020-12-17 18:01:12 +00:00
Pavel Stupnikov
b2895dfcd0
Change: extend the allowed range for max loan setting (#8386) 2020-12-16 21:56:32 +01:00
Pavel Stupnikov
d989fb516b
Change: send network error to the server before making an emergency save (#8387) 2020-12-16 21:23:12 +01:00
frosch
d5f05fb781
Fix: [NewGRF] Action 7/9 conditions 0x0F to 0x12 failed, if 'param' was 0x88. (#8382)
Fix: [NewGRF] Action 7/9 conditions 0x0B to 0x12 failed, if 'param' was 0x85.
These conditions are supposed to ignore 'param' entirely.
2020-12-15 22:42:03 +01:00
Byoungchan Lee
0471de2d92
Fix: Remove unnessary reference to suppress warning (#8337)
Apple Clang version 12 (bundled with Xcode 12) complaints about copying
small objects in range loop (-Wrange-loop-analysis introduced by -Wall).
This warning can be easily avoided by removing the reference from
the const pointer type.
2020-12-15 22:39:51 +01:00
SamuXarick
1d85d71d29
Fix: for original terrain generator, keep a single gap of water at the borders (#7883)
This means that for NE/NW, it should have one more in case of
freeform-edges, and in case of SE/SW it should have one less.

Reminder: freeform-edges only adds VOID tiles on X=0 and Y=0.
2020-12-15 21:52:41 +01:00
Patric Stout
e07afaeffb
Fix: a cargos sneaked in; should be cargoes for consistency (#8383) 2020-12-15 21:39:29 +01:00
Patric Stout
f7b8e7e46c Fix: prefix the Nth vehicle with "#" when ungrouped
This is for consistency; most other objects add a # to indicate
it is the Nth of that object, except for Trains / RVs / Ships /
Aircrafts.
This becomes painfully apparent with unnamed vehicles in groups,
which do get a "#".
2020-12-15 21:18:03 +01:00
stormcone
ca65f19b03 Feature: Show group name as part of the default vehicle name.
Only if the vehicle is member of a group and does not have a user defined name.
2020-12-15 21:18:03 +01:00
translators
1a67954ff9 Update: Translations from eints
korean: 29 changes by telk5093
finnish: 8 changes by hpiirai
slovak: 6 changes by FuryPapaya
french: 6 changes by glx22
2020-12-15 17:57:40 +00:00
Patric Stout
8fbf5bef60 Fix: workarounds for two emscripten bugs in the network stack 2020-12-15 15:46:39 +01:00
Patric Stout
d5b9f7ac37 Add: [Emscripten] use "relative mouse mode" with SDL2
This mode doesn't wrap the mouse constantly, but requests SDL
to lock the mouse pointer. This is needed, as with Emscripten
you are not allowed to change the mouse poisition (only to lock
it into place).
2020-12-15 15:46:39 +01:00
Patric Stout
d15dc9f40f Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.

Co-authored-by: milek7 <me@milek7.pl>
2020-12-15 15:46:39 +01:00
Patric Stout
2da07f7615 Codechange: unroll the SDL2 main loop
This commit prepares for the next commit, as Emscripten needs to
have a way to trigger a single iteration of the main loop. To
keep the real changes more clear, this commit only unrolls the
loop, and makes no changes to the logic itself.
2020-12-15 15:46:39 +01:00
Tyler Trahan
f2a93dba0d
Change: set the default setting for autorenew to on for new games (#8352) 2020-12-15 09:58:37 +01:00
translators
8c42f3a8d4 Update: Translations from eints
french: 1 change by glx22
2020-12-14 23:45:41 +00:00
jostephd
b1cf79da5b
Feature: new velocity unit "tiles/day" (#8278) 2020-12-15 00:39:57 +01:00
Michael Lutz
79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 2020-12-15 00:29:30 +01:00
frosch
cc1679e317 Codechange: Apple LLVM fails to implement std::optional::value() also on pretty recent version. Use operator* instead. 2020-12-14 23:50:50 +01:00
frosch
484ea62a62 Cleanup: use std::optional instead of custom implementation. 2020-12-14 23:50:50 +01:00
Pavel Stupnikov
c9fd85528a
Add: new economy "frozen" that stops production changes and industry closures (#8282) 2020-12-14 23:35:07 +01:00
Patric Stout
68f9925cd4
Codechange: use \u to indicate unicode chars in strings (#8379)
With \x, we sometimes had to do the "" trick, as the length is not
predefined. With C++11 bringing \u to the specs, which has a preset
length, we no longer need the "" trick.

We set the strings to u8, to ensure all compilers use UTF-8 encoding
for the \u characters.

This was triggered by newer CLangs, which start to warn if you
use "" in the middle of a string, wondering if that was your
intention. It is a good question. And this is our answer :)
2020-12-14 20:25:01 +01:00
glx22
d1fa6b129c Add: [CMake] Option to only build tools/docs 2020-12-13 22:46:46 +01:00
Patric Stout
b7851e51ad Fix: set SP_WORKING_DIR earlier with '-c'
On Windows, relative folders don't work so well. So we need to
lookup the full path. This is best done in DetermineBasePaths()
and as a bonus that only sets SP_WORKING_DIR once.
2020-12-13 22:45:50 +01:00
Patric Stout
5d0331ecdc
Fix 8bef06a2: don't use "extern" when you want to implement a global (#8373) 2020-12-13 16:56:33 +01:00
Patric Stout
da7c74ba7e Fix: change the working-dir searchpath when using '-c'
Basically, with '-c' you now create a sandbox. It will still use
your personal-dir and global-dir to find files you installed there,
but all new files are stored with a base folder identical to the
folder the configuration is in.

This is a bit of an old bug, that we many have tried to solve in
various of different ways. The code has grown sufficiently complex
that it is hard to see what consequences of actions are. This is
in my opinion the most harmless solution, while increasing the
usefulness of the '-c' flag.

In essence, the problem was that empty folders were always created
in the directory where the configuration was, but as that directory
wasn't added to any searchpath, files weren't stored there, unless
by accident it was a folder already on the searchpath. For example,
if you do './openttd -c local.cfg', it did work as expected. But
in the more generic variant, it did not.

With this patch, you can run './openttd -c /new/folder/local.cfg',
and it will create and prepare that folder to receive new files.

'content_download' is also stored in the directory the
configuration is in; this was already the case. Important to
note that there is only one search-path for 'content_download'.
In other words, when using '-c', it will not look in '~/.openttd'
inside the 'content_download' folder.
2020-12-13 16:40:56 +01:00
Patric Stout
4e12aac9c0 Codechange: to create or not to create a folder, that is the question
This was just weird. With XDG _personal_dir was created already,
but later on it was checked if it was different from config_dir,
and the creation was skipped. All this checking and validation
makes my head spin .. let's make it a bit more simple.
2020-12-13 16:40:56 +01:00
Patric Stout
c66bd18a10
Add: save openttd.cfg immediately on changing a setting (#8358)
Formally it was only done on exit. This means that if it crashes
changes in settings were not stored. This is often rather
frustrating. Additionally, targets (like emscripten) where people
are unlike to use "Exit Game", will never see their configuration
stored.

The drawback is that on every setting change there is some minor
I/O of writing the ini file to disk again.
2020-12-13 16:28:06 +01:00
translators
40edc2863c Update: Translations from eints
finnish: 1 change by hpiirai
2020-12-12 17:52:42 +00:00
glx22
6fae0b83d9 Add: [CMake] targets to generate documentation 2020-12-12 15:48:04 +01:00
translators
7f5afbfdf5 Update: Translations from eints
slovak: 2 changes by FuryPapaya
2020-12-10 17:53:08 +00:00
translators
20151e41ea Update: Translations from eints
korean: 1 change by telk5093
french: 1 change by glx22
2020-12-09 17:50:24 +00:00
translators
819ce1bf49 Update: Translations from eints
slovak: 30 changes by FuryPapaya
lithuanian: 37 changes by devastatorius
2020-12-09 13:42:08 +00:00
Owen Rudge
535e18b54e Change: Don't display OS name when the user is exiting the game 2020-12-09 09:21:34 +00:00
Patric Stout
2864d019f0
Fix: useless warning with -snull and no BaseSounds available (#8361)
If I explicitly tell the system I do not want sound, I still get
presented a nice message I do not have any BaseSounds available
on my system, and that I should download one to enjoy sound. Well,
let me tell you, with "-snull" that is really really not going to
help. So please, be quiet, and let me enjoy the game without
"boooooo" and "DING DING DING".

Thank you.
2020-12-08 10:24:59 +01:00
Patric Stout
dddf885fb4
Remove: console command "content select all" (#8363)
The intention of this function was that you could download
everything after a filter was applied; but this never really
took off. Instead, a select few people used this functionality
to download every available package on BaNaNaS. This is not in
the spirit of this service. Additionally, these few people were
good for 70% of the consumed bandwidth of BaNaNaS.
2020-12-07 14:48:13 +01:00
frosch
6198a4776b Change: [NewGRF] Use aircraft property 12 also for helicopters.
Due to keeping compatibility we can only do this for NewGRF-defined sound effects.
2020-12-06 20:31:54 +01:00
Charles Pigott
cfa1b1e006 Fix: Compile warnings when asserts are disabled 2020-12-06 19:27:39 +00:00
Patric Stout
731af1f1f3 Codechange: don't do work GetVariableAddress() is already doing 2020-12-06 16:10:58 +01:00
Patric Stout
c98717cb45 Fix: do not add an offset to a nullptr
This is, by specs, undefined behaviour. See
https://reviews.llvm.org/D67122

In cases where this is done, optimizations done by LLVM can
generate code that causes crashes.

GetVariableAddress() had two (legit) ways this could happen:
- For SaveLoad set to global
- For SaveLoad set to SLE_VAR_NULL, where sld->address is always
  a nullptr, and object could or could not be a nullptr.
2020-12-06 16:10:58 +01:00
Michael Lutz
c558936ec3
Fix 63ccb36ef3: Crash trying to load TTO/TTD savegames. (#8356) 2020-12-06 00:29:27 +01:00
Patric Stout
6ad3cca4ca
Fix a49fdb7ebb: bootstrap crash when trying to load new baseset (#8353)
Using nullptr as "name" crashes on "name.empty()". Use an empty
string instead.
2020-12-05 15:03:16 +01:00
glx22
a06fe8e8a7 Fix: [CMake] cross-compiling requires native tools 2020-12-04 09:49:31 +00:00
Rasmus Jonsson
0b2dd2c5cd Fix: [NoAI] don't notify caught exceptions 2020-12-02 17:11:36 +00:00
translators
d19f7b94fb Update: Translations from eints
norwegian (bokmal): 8 changes by buzzCraft
lithuanian: 5 changes by devastatorius
2020-11-28 17:51:55 +00:00
Charles Pigott
b8ec88f6af Codechange: Suppress compiler warning about signed/unsigned printf values 2020-11-26 19:06:03 +00:00
translators
6ef1eaf1f5 Update: Translations from eints
norwegian (bokmal): 9 changes by buzzCraft
2020-11-26 17:51:49 +00:00
translators
821592ddeb Update: Translations from eints
norwegian (bokmal): 10 changes by buzzCraft
2020-11-25 17:51:48 +00:00
translators
92236ccd2f Update: Translations from eints
indonesian: 117 changes by dimaspaf14
2020-11-12 17:51:47 +00:00
translators
8e4a3a0e76 Update: Translations from eints
danish: 1 change by achton
2020-11-11 17:51:36 +00:00
translators
79f00277c4 Update: Translations from eints
slovak: 16 changes by FuryPapaya
2020-11-10 17:51:54 +00:00
translators
4dc986f32d Update: Translations from eints
slovak: 19 changes by FuryPapaya
2020-11-09 17:51:50 +00:00
translators
918857e03b Update: Translations from eints
korean: 1 change by telk5093
slovak: 86 changes by FuryPapaya
2020-11-08 17:51:33 +00:00
translators
f23a7a59b6 Update: Translations from eints
slovak: 26 changes by FuryPapaya
polish: 1 change by yazalo
2020-11-07 17:52:16 +00:00
translators
9bd2e5bf49 Update: Translations from eints
slovak: 86 changes by FuryPapaya
polish: 57 changes by yazalo
2020-11-06 17:51:41 +00:00
Lars Wendler
cf29d23ba4 Fix: build with icu-68.1
icu-68.1 removed public macro definitions for TRUE and FALSE

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2020-10-30 18:07:58 +00:00
translators
421304c850 Update: Translations from eints
afrikaans: 3 changes by Gwenney
2020-10-30 17:51:52 +00:00
translators
4797e095d9 Update: Translations from eints
hungarian: 1 change by andrejmoltok
portuguese (brazilian): 64 changes by JuniuSeifero
2020-10-29 17:51:43 +00:00
translators
a441973d17 Update: Translations from eints
romanian: 1 change by ALEX11BR
2020-10-27 17:51:56 +00:00
translators
59ae40af53 Update: Translations from eints
vietnamese: 24 changes by KhoiCanDev
2020-10-26 17:52:01 +00:00
translators
97d7c0a8e1 Update: Translations from eints
tamil: 76 changes by Aswn
2020-10-24 17:51:58 +00:00
translators
eb01f2e08d Update: Translations from eints
romanian: 10 changes by ALEX11BR
tamil: 26 changes by Aswn
2020-10-18 17:51:49 +00:00
translators
d9e7e8cec0 Update: Translations from eints
german: 17 changes by Luensche
2020-10-17 17:51:59 +00:00
translators
b3362c526a Update: Translations from eints
german: 5 changes by Luensche
2020-10-16 17:51:43 +00:00
translators
5043f6feff Update: Translations from eints
slovak: 16 changes by FuryPapaya
2020-10-15 17:51:56 +00:00
translators
b99fec1e4d Update: Translations from eints
slovak: 29 changes by FuryPapaya
polish: 7 changes by yazalo
2020-10-14 17:51:50 +00:00
translators
313141d2f1 Update: Translations from eints
slovak: 33 changes by FuryPapaya
2020-10-13 17:51:59 +00:00
translators
86ec74347d Update: Translations from eints
german: 4 changes by matthiasradde
slovak: 23 changes by FuryPapaya
2020-10-12 17:51:42 +00:00
translators
dcdcf6d57c Update: Translations from eints
slovak: 57 changes by FuryPapaya
tamil: 1 change by Ramesh78dev
2020-10-11 17:53:38 +00:00
translators
b607f54462 Update: Translations from eints
slovak: 35 changes by FuryPapaya
tamil: 1 change by Ramesh78dev
2020-10-10 17:51:52 +00:00
FuryPapaya
f1ab41e337
Fix: Slovak ownname was using the wrong form (#8326)
Noun vs Adjective
2020-10-10 13:34:21 +01:00
translators
50417ab0c5 Update: Translations from eints
slovak: 131 changes by FuryPapaya
2020-10-09 17:51:37 +00:00
translators
6e53bf00c4 Update: Translations from eints
slovak: 56 changes by FuryPapaya
2020-10-08 17:51:56 +00:00
translators
a36a1b5ff5 Update: Translations from eints
slovak: 193 changes by FuryPapaya
spanish: 46 changes by MontyMontana
2020-10-06 17:51:50 +00:00
translators
e01143edf8 Update: Translations from eints
italian: 1 change by AlphaJack
romanian: 13 changes by ALEX11BR
finnish: 6 changes by VeeraKoo
slovak: 202 changes by FuryPapaya
spanish: 240 changes by MontyMontana
2020-10-05 17:51:44 +00:00
translators
3723207d64 Update: Translations from eints
slovak: 23 changes by FuryPapaya
turkish: 66 changes by ozcanakdora
2020-10-04 17:51:56 +00:00
translators
80f7937e42 Update: Translations from eints
korean: 8 changes by telk5093
2020-10-03 17:51:47 +00:00
translators
53f36f4afa Update: Translations from eints
czech: 1 change by LubosKolouch
german: 18 changes by matthiasradde
2020-10-01 17:52:06 +00:00
translators
bdaf596373 Update: Translations from eints
german: 1 change by matthiasradde
polish: 17 changes by yazalo
2020-09-30 17:52:14 +00:00
translators
d9b0e6c550 Update: Translations from eints
romanian: 7 changes by ALEX11BR
portuguese (brazilian): 44 changes by Lucas559-noob
2020-09-28 17:52:03 +00:00
translators
5584bf6bbb Update: Translations from eints
portuguese (brazilian): 22 changes by Lucas559-noob
polish: 6 changes by pAter-exe
2020-09-27 17:51:48 +00:00
translators
4279620aef Update: Translations from eints
turkish: 28 changes by nullaf
dutch: 1 change by rcpaul
2020-09-26 17:51:50 +00:00
translators
d58531ec84 Update: Translations from eints
german: 1 change by frosch123
2020-09-26 10:12:43 +00:00
Galigator
933d02dce2 Change: Service depot also reset breakdown chance. 2020-09-25 22:38:58 +02:00
stormcone
49b75d67bd
Fix 70f9c3c6: The *_filter_criteria variables contain an index, not a cargo. (#8320) 2020-09-25 15:35:48 +01:00
Charles Pigott
348c231e12 Codechange: Make codestyle for CMake files consistent for 'control' statements 2020-09-25 14:43:13 +01:00
frosch
df5362a008 Fix #8311, b98c7763de: Industry probability at map generation was scaled differently when set via property or callback. 2020-09-24 19:29:52 +02:00
dP
0110fa12da Feature: Make news and errors close hotkeys configurable 2020-09-24 19:23:12 +02:00
Berbe
8f3d1ec970 Feature: Improve restart command
When the restart command is issued, a normal map is always spawned.

This improvement takes into account the current state of _file_to_saveload to check if a savegame/scenario/heightmap was previously loaded, and loads the same resource again.
2020-09-24 19:17:18 +02:00
dP
3ad4a6e3da Fix 380fd8c: Only check houses for cargo when generating subsidies with towns 2020-09-24 17:57:09 +01:00
translators
beaa7c7894 Update: Translations from eints
korean: 1 change by telk5093
2020-09-23 19:45:38 +02:00
translators
53a3d940b1 Update: Translations from eints
ukrainian: 11 changes by Strategy
2020-09-02 19:45:39 +02:00
dP
ab420d8cc0 Change: Use key names instead of characters in hotkey.cfg 2020-09-01 09:33:17 +01:00
translators
dacec76c1b Update: Translations from eints
catalan: 57 changes by juanjo
2020-08-30 19:45:38 +02:00
translators
9340fe9c7c Update: Translations from eints
ukrainian: 18 changes by Strategy
2020-08-21 19:45:38 +02:00
dP
3db7cf54fd Fix: sprite preview in sprite aligner is too small with scaled UI 2020-08-13 20:50:11 +02:00
translators
2693a901f9 Update: Translations from eints
swedish: 1 change by Joel_A
2020-08-04 19:45:41 +02:00
Niels Martin Hansen
84efde8ee3 Change: Log when rejecting a TAR archive for extraction
Based on report in <https://www.tt-forums.net/viewtopic.php?f=31&t=87374>
2020-07-28 19:20:13 +02:00
Łukasz Hryniuk
3effad0bea
Fix: Properly invalidate mouse-over station coverage highlight (#8263) 2020-07-27 17:37:47 +01:00
dP
452e1e3328 Codechange #8258: Remove unused town cargo caches from the savegame 2020-07-27 17:32:00 +01:00
TechGeekNZ
a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
TechGeekNZ
c0bf7cc840 Fix: GCC warns about possibly uninitialized data in signal.cpp
When compiling with '-Og', GCC warns about variables that are
initialized by reference in the condition of a 'while' loop.

This commit silences the warning by explicitly initializing the
variables in question to their respective 'invalid value' markers,
which will most likely be optimized out when the compiler realizes
the values are never used.
2020-07-27 17:25:58 +01:00
translators
a56bf35409 Update: Translations from eints
french: 1 change by glx
2020-07-25 19:45:38 +02:00
translators
82672342b7 Update: Translations from eints
belarusian: 35 changes by KorneySan
2020-07-24 19:45:41 +02:00
translators
663c301e7c Update: Translations from eints
belarusian: 64 changes by KorneySan
russian: 2 changes by KorneySan
2020-07-22 19:45:40 +02:00
translators
808fbaa767 Update: Translations from eints
belarusian: 11 changes by KorneySan
2020-07-21 19:45:40 +02:00
glx
4079c47b6c Change: rewrote squirrel_export in CMake 2020-07-16 00:53:26 +02:00
glx
8794c61f25 Change: rewrote generate_widget in CMake 2020-07-16 00:53:26 +02:00
Pavel Stupnikov
26b91192a3
Feature: Center text and icons in the status bar vertically (#8273) 2020-07-15 16:57:31 +02:00
dP
706c47265e Fix: Set invalid road and tram types for rail tunnel ends 2020-07-13 16:38:21 +02:00
translators
954d0b4e5b Update: Translations from eints
korean: 1 change by telk5093
2020-07-12 19:45:40 +02:00
Abdurrahmaan Iqbal
7d2db99bfd Fix #7772: Show destination on mouseover when vehicle stopped (and not in depot) 2020-07-10 14:48:22 +01:00
TrevorShelton
c39d62c245 Update: Disuse of STR_ERROR_INCOMPATIBLE_ROAD 2020-07-10 14:47:55 +01:00
TrevorShelton
c7e391da93 Change #8162: Conversion of Town Road, Impr. Error
This changes the error when you attempt to convert a road owned by a town to another road, specifying that it's owned by the town rather than simply being incompatible. As the original poster of the issue pointed out, these seemed to be the only occurences of the incompatible road string, so now it's unused, but they would be left untouched in case of future use or since changing it to a different error would do the work of removing it then. If requested, it likely wouldn't be too difficult to remove the string entirely.
2020-07-10 14:47:55 +01:00
Jonathan G Rennison
053d4f3bff Fix: Thread unsafe use of SendPacket for PACKET_SERVER_MAP_SIZE
NetworkTCPSocketHandler::SendPacket is not thread safe and may not
be used concurrently from multiple threads without suitable locking
2020-07-09 16:08:01 +01:00
TechGeekNZ
716c883737 Fix: Globally apply preprocessor directive coding style
Global; except for the 32-bit SSE blitter, which has some #DEFINEs
in not-very-nice places.
2020-07-03 09:08:46 +02:00
stormcone
816fada2b1
Fix #8250: [NRT] Company infrastructure window always omits last road/tramtype 2020-07-02 12:35:28 +02:00
translators
94d5fcab4b Update: Translations from eints
czech: 3 changes by djst
2020-07-01 19:45:39 +02:00
dP
7045186594 Change #8159: Remove now unused town cargo caches without bumping the savegame version 2020-06-28 18:23:59 +02:00
dP
380fd8cab4 Fix: Make subsidies scan tiles for town acceptance and production instead of using desync-prone town caches 2020-06-28 18:23:59 +02:00
dP
ca2604c4e2 Revert #8157: Redundant change 2020-06-28 18:23:59 +02:00
Michael Lutz
6d3c2edc59 Add: [NewGRF] Industry behaviour flag to override second cargo production clamping for water industries when using smooth economy.
Smooth economy is only used when the corresponding setting is enabled and the industries does not use the production callback.
2020-06-28 15:33:37 +02:00
Jonathan G Rennison
7a09413a1a Fix: Incorrect save/load array size of Town::cargo_accepted
In 11ab3c4e the number of cargo types was changed from 32 to 64.
The save/load of Town::cargo_accepted was not updated, such that
only half of the data structure is saved/loaded in savegame versions
199 to 218.
Discard and regenerate data from all savegame versions prior to 219.
2020-06-28 15:32:53 +02:00
Jonathan G Rennison
54237b0e98 Codechange: Move SlSkipBytes to saveload.h 2020-06-28 15:32:53 +02:00
ilayaraja97
cf8ccf4b08 Fix #8131: small bridges also have pillars drawn 2020-06-28 13:54:04 +01:00
TrevorShelton
a4a9908a51
Fix #8221: Missing specific error message for bridge too long (#8240) 2020-06-28 12:53:56 +01:00
Charles Pigott
218db00c4c Fix #8216: Don't show floating text on autoreplace if cost is 0 2020-06-28 00:00:28 +01:00
duck
1bc7047af7
Doc: Acknowledge integer type mismatch in certain admin packets using AdminUpdateType (#8238) 2020-06-27 18:21:17 +02:00
Charles Pigott
75a2ae2f48 Change: Also make roadside trees match the tree transparency option 2020-06-27 16:07:17 +01:00
Charles Pigott
4c45448fa9 Fix #8129: Crash if a news message expires while viewing the endgame screen 2020-06-27 16:07:08 +01:00
Charles Pigott
dc8d0089e9 Codechange: Make sure script enums are the same size as their normal counterparts 2020-06-27 14:51:14 +01:00
Charles Pigott
e5f931ef42 Fix: Warning about using the wrong enum type 2020-06-27 14:51:14 +01:00
Charles Pigott
64b1c70fdd Codechange: Add WARN_FORMAT to vseprintf and fix the cascade of warnings that followed 2020-06-27 14:51:14 +01:00
Charles Pigott
224acb78b0 Fix: Compiler warnings about memsetting non-trivial classes 2020-06-27 14:51:14 +01:00
Abdurrahmaan Iqbal
8a655c7fb6 Fix #8232: 'Huge screenshot' warning being shown incorrectly 2020-06-27 14:19:35 +01:00