Commit Graph

50513 Commits

Author SHA1 Message Date
Jonathan G Rennison
922e8554de Zstd: Fix infinite loop when input exhausted 2021-03-01 18:17:01 +00:00
Jonathan G Rennison
ee7f5ad44f Zstd: Indentation fixes 2021-03-01 18:16:29 +00:00
dP
b284d34277 Add: Support Zstandard(zstd) savegame compression
(cherry picked from commit 6f0aeaf2c5436550c93205e704624957e9abc969)
2021-03-01 18:08:28 +00:00
Jonathan G Rennison
0a31a3b923 Fix for crash when exiting whilst NewGRF scan still in progress
See: https://github.com/OpenTTD/OpenTTD/issues/8760
2021-03-01 18:04:12 +00:00
Patric Stout
f183ded9fe Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.

(cherry picked from commit c3dc27e37e)

# Conflicts:
#	src/gfx.cpp
#	src/gfx_func.h
#	src/settings_type.h
#	src/video/cocoa/cocoa_v.mm
#	src/video/video_driver.cpp
#	src/video/win32_v.cpp
2021-03-01 17:54:15 +00:00
Patric Stout
535fdb5c89 Codechange: remove _realtime_tick variable
(cherry picked from commit fe451b8dc7)

# Conflicts:
#	src/debug.cpp
#	src/debug.h
#	src/video/video_driver.cpp
2021-03-01 17:54:15 +00:00
Patric Stout
3744d71b13 Codechange: replace _realtime_tick with std::chrono for mouse events
(cherry picked from commit 853bfc3562)
2021-03-01 17:54:15 +00:00
Patric Stout
d4f208d9c1 Codechange: [Network] replace _realtime_tick with std::chrono
(cherry picked from commit 53c28a8ec9)
2021-03-01 17:54:15 +00:00
Patric Stout
729df75d3e 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.

(cherry picked from commit 2d9062bfc1)
2021-03-01 17:54:15 +00:00
Patric Stout
c13c201f72 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.

(cherry picked from commit 13889b6554)

# Conflicts:
#	src/network/network_server.cpp
2021-03-01 17:54:15 +00:00
Patric Stout
7da90af2f4 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.

(cherry picked from commit 8d199b1bbc)
2021-03-01 17:49:03 +00:00
Patric Stout
cfa1612766 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.

(cherry picked from commit 3677418225)
2021-03-01 17:49:03 +00:00
Charles Pigott
7e39d78fc3 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.

(cherry picked from commit 6b8f9b50b9)

# Conflicts:
#	src/vehicle_gui.cpp
2021-03-01 17:49:03 +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
Jonathan G Rennison
dbbe1bb3e4 Fix trains passing signals in original acceleration with braking models 2021-03-01 02:14:42 +00: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
Charles Pigott
f30f4b6892 Doc: 1.11.0-beta2 changelog 2021-02-28 18:49:21 +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
Jonathan G Rennison
c37beb78ee Check for broken custom bridge head states, and bump save version 2021-02-27 21:31:23 +00:00
Jonathan G Rennison
b931df9934 Add debug console command to delete a vehicle ID 2021-02-27 20:36:47 +00:00
Pavel Stupnikov
4fd2eecb8b
Change: Improve console warnings on invalid network commands (#8753) 2021-02-27 20:26:51 +01:00
Jonathan G Rennison
2cbb42f9a9 Add fast path to catenary drawing in MaskWireBits 2021-02-27 19:24:22 +00: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
Jonathan G Rennison
d58989f552 Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/english_US.txt
2021-02-27 18:38:02 +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
Jonathan G Rennison
056606d2b6 Fix ApplyLookAheadItem assuming current_order == order in order list
Fixes trains with no orders failing to brake in advance of stations
2021-02-27 17:49:59 +00:00
Jonathan G Rennison
460d504269 Fix order index wrapping when depth exceeded in AdvanceOrderIndex 2021-02-27 14:57:17 +00: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
Jonathan G Rennison
18471da6e1 Fix collision checks for ship collision avoidance
This fixes cases where ships could be redirected in a circle
2021-02-27 01:50:57 +00:00
glx22
54fb4c04e3 Fix: [CMake] libpng header/library mismatch for macos 2021-02-27 02:23:33 +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
dc7ba33b51
Fix: don't link to OpenGL with SDL2 as backend; SDL2 dynamically loads it (#8745)
Although for developers this doesn't change anything, for our
linux-generic binary it changes everything. Without this, the
OpenGL dynamic library is dragged in as dependency, and as it
depends on X11, that will be dragged in too. This is not
something we prefer to have, as that won't run on as many
machines as it could.

SDL2 doesn't depend on OpenGL directly, as it tries to load it
in on runtime. If found, it would work in exactly the same way
as if we would link to OpenGL ourselves. As such, this is
the best of both worlds: our linux-generics have less linked
dependencies, and developers won't notice any difference.

As a side-effect, if someone uses linux-generic on a machine
that does not have any OpenGL package installed, it will
gracefully fall back to the default backend of SDL instead.
2021-02-27 00:34:41 +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
Jonathan G Rennison
93f2d5e056 Add GUI setting for shading trees on slopes in viewports
Deafult on, only for non-map mode
(Slope shading is always on in map mode)
2021-02-26 18:03:00 +00:00