Commit Graph

50317 Commits

Author SHA1 Message Date
Jonathan G Rennison
c2ae7580e0 Zstd: Use zstd for network joins if supported at both ends
See also: https://github.com/OpenTTD/OpenTTD/pull/8773
2021-03-01 18:59:03 +00:00
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
Jonathan G Rennison
dbbe1bb3e4 Fix trains passing signals in original acceleration with braking models 2021-03-01 02:14:42 +00: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
Jonathan G Rennison
2cbb42f9a9 Add fast path to catenary drawing in MaskWireBits 2021-02-27 19:24:22 +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
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
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
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
Jonathan G Rennison
4ef363422a Add 32bpp blitter support for adjusting brightness of drawn sprites 2021-02-26 18:02:13 +00:00
Jonathan G Rennison
42e57995dd Improve visibility of slopes under trees in viewport map vegetation mode
Loosely based on tree slope brightness adjustment from
https://github.com/nielsmh/OpenTTD/tree/tree-slope-brightness
2021-02-25 20:35:46 +00:00
Jonathan G Rennison
eabfae9d31 MacOS: Change bundle ID
See: #208
2021-02-25 12:15:37 +00: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
Jonathan G Rennison
19b7ecf95a Merge branch 'master' into jgrpp 2021-02-22 17:45:58 +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
milek7
b749d6f1cb Fix: Allow building with Allegro and without SDL on Linux 2021-02-21 23:05:50 +00:00
Jonathan G Rennison
4f74a83496 Add fast paths for clear/tree snow line checks in tile loop 2021-02-21 22:39:26 +00:00
Jonathan G Rennison
2e20da40ed Cache current value of snow line height 2021-02-21 22:34:22 +00:00
Jonathan G Rennison
f595696e97 Add map bit to suppress water flooding checks
Set if all neighbour tiles are also water
This reduces the overhead of flood checks on large maps
2021-02-21 21:11:35 +00:00
Jonathan G Rennison
0df3e785cb Debug: Add console command to dump tile info 2021-02-21 20:59:25 +00:00
Jonathan G Rennison
1c1d272b57 Merge branch 'master' into jgrpp 2021-02-21 19:51:00 +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
Jonathan G Rennison
c9ab460a03 Re-apply c0616750
Lost in merge: e95216b5
2021-02-21 12:25:43 +00:00
Jonathan G Rennison
2221805ddd Remove IncreaseRealtimeTick
Not needed as modal progress windows no longer use _realtime_tick
2021-02-21 12:22:50 +00:00
Jonathan G Rennison
dfecdf3afb Merge branch 'master' into jgrpp
# Conflicts:
#	src/dock_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/terraform_gui.cpp
#	src/vehicle.cpp
#	src/video/allegro_v.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/dedicated_v.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
2021-02-21 11:54:24 +00: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