Commit Graph

651 Commits (ece0a431467579679b0a0efe029ad00315f900be)

Author SHA1 Message Date
Jonathan G Rennison ece0a43146 Merge branch 'master' into jgrpp
# Conflicts:
#	src/newgrf_station.cpp
2 years ago
PeterN f279fc5772
Fix: DrawStringMultiLine() could overdraw (#10014)
This function did not take the line height into account when checking text will fit before the bottom bounds.
2 years ago
dP ca23e8abcf Add step console command to advance n ticks
Cherry-picked from https://github.com/citymania-org/cmclient
Commit: 5ce2d21223a96934a83b8da43434c7a81f001ef0
2 years ago
Jonathan G Rennison 8688840e24 Viewport route step markers are now variable size to match font/text
See: #410
2 years ago
Jonathan G Rennison b2d8f3ce43 Add setting to disable water animation depending on zoom level 2 years ago
Jonathan G Rennison 981104e308 Add a functor fill mode to GfxFillPolygon 2 years ago
Jonathan G Rennison 929ee23b34 Fix SetColourRemap when using TC_FORCED | TC_BLACK 2 years ago
Jonathan G Rennison 2f8e63e954 Merge branch 'master' into jgrpp
# Conflicts:
#	src/gfx.cpp
#	src/lang/traditional_chinese.txt
#	src/station_cmd.cpp
2 years ago
Michael Lutz 57b992717b Codechange: Extend DrawSpriteToRgbaBuffer to work with 8bpp blitters. 2 years ago
Michael Lutz f40e82a19d Fix #9743: [OSX] Don't try to render touchbar sprites with invalid zoom level. 2 years ago
Jonathan G Rennison 9e946d4c5d Merge branch 'master' into jgrpp-beta
# Conflicts:
#	src/command.cpp
#	src/console_cmds.cpp
#	src/group_gui.cpp
#	src/lang/catalan.txt
#	src/lang/czech.txt
#	src/lang/danish.txt
#	src/lang/greek.txt
#	src/lang/hungarian.txt
#	src/lang/irish.txt
#	src/lang/japanese.txt
#	src/lang/luxembourgish.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/romanian.txt
#	src/lang/russian.txt
#	src/lang/serbian.txt
#	src/lang/simplified_chinese.txt
#	src/lang/slovak.txt
#	src/lang/spanish_MX.txt
#	src/lang/swedish.txt
#	src/lang/tamil.txt
#	src/lang/traditional_chinese.txt
#	src/lang/turkish.txt
#	src/lang/ukrainian.txt
#	src/lang/vietnamese.txt
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/network/network_func.h
#	src/network/network_internal.h
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/saveload/afterload.cpp
#	src/saveload/newgrf_sl.cpp
#	src/saveload/saveload.h
#	src/script/script_instance.cpp
#	src/toolbar_gui.cpp
#	src/toolbar_gui.h
#	src/vehicle_gui.cpp
#	src/widgets/rail_widget.h
#	src/widgets/vehicle_widget.h
#	src/window.cpp
3 years ago
Jonathan G Rennison da282c3ecc Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/ci-build.yml
#	CMakeLists.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/korean.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/russian.txt
#	src/lang/spanish.txt
#	src/misc_gui.cpp
#	src/newgrf.cpp
3 years ago
Jonathan G Rennison 4042480806 Merge branch 'jgrpp' into jgrpp-beta
# Conflicts:
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/table/company_settings.ini
#	src/table/currency_settings.ini
#	src/table/gameopt_settings.ini
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/table/settings.ini
#	src/table/win32_settings.ini
#	src/table/window_settings.ini
3 years ago
Patric Stout 441ff7e436 Fix: thread safety issue during exiting the game (#9380)
_exit_game is read by the draw-thread to know when to exit, but
most of the time written by the game-thread.

(cherry picked from commit c12a152ec9)
3 years ago
Danny de Bruijne 753b1d7e15 Feature: Add selected toolbar buttons to MacBook Pro Touch Bar 3 years ago
Jonathan G Rennison da1ac73c02 Merge commit 'f1dfa661a1898cde06a38ab4cb230c95912b245b' into jgrpp-beta
# Conflicts:
#	src/lang/estonian.txt
#	src/lang/hungarian.txt
#	src/network/core/game_info.cpp
#	src/network/core/game_info.h
#	src/network/core/packet.h
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/openttd.cpp
#	src/string_func.h
3 years ago
Patric Stout 0013673faf Change: prevent palette updates during copying to the video driver
ThreadSanitizer rightfully notices that the game-thread could
update the palette while the draw-thread is copying it for local
use. The odds of this are very small, but nevertheless, it does
carry a very good point.

It wouldn't hurt the application in any way, but it might cause
visual glitches on the screen.
3 years ago
Patric Stout 74186998a2 Codechange: use _cur_palette the same in all the drivers
It was a bit of a mixed bag. With this change, gfx.cpp is in
control who accesses _cur_palette from the video-drivers.
3 years ago
Patric Stout c12a152ec9
Fix: thread safety issue during exiting the game (#9380)
_exit_game is read by the draw-thread to know when to exit, but
most of the time written by the game-thread.
3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
Michael Lutz 418e0ea85f Codechange: Use dynamic string list for contents of land info window. 3 years ago
Jonathan G Rennison 704eac8220 Fix changing font zoom level not updating font height cache 3 years ago
rubidium42 cb89d22cf2 Codechange: add DrawString(Multiline) that accepts std::string& 3 years ago
Peter Nelson a469b4f395 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed.
(cherry picked from commit 4791ff2862)
3 years ago
Peter Nelson 7bf0eefd36 Codechange: Simplify calling of DrawCharCentered()
(cherry picked from commit 2efa390a7d)
3 years ago
glx22 dfe616bef4 Codechange: Replace window related FOR_ALL with range-based for loops
(cherry picked from commit 14e92bd8e2)
3 years ago
Peter Nelson 4791ff2862 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed. 3 years ago
Peter Nelson 2efa390a7d Codechange: Simplify calling of DrawCharCentered() 3 years ago
Jonathan G Rennison 6490b252f5 Fix changing font zoom not updating font height cache 3 years ago
Jonathan G Rennison e094b7f1d6 Partially fix thread safety issues around _cur_palette
Replaces: 4c59dfb6
See also: https://github.com/OpenTTD/OpenTTD/issues/8712
3 years ago
Jonathan G Rennison 2a13c8623c Revert: 4c59dfb6, move DoPaletteAnimations back into GameLoop
Race fix to follow
3 years ago
Jonathan G Rennison 5e14b54a0c Merge branch 'master' into jgrpp 3 years ago
Patric Stout 4866e43862
Codechange: rework codeflow introduced in 098d5b22 (#8837)
It didn't sit well to me, how I wrote the commit initially. First
casting a variable into another, only to write it back into the
originally feels wrong.

This flow makes a bit more sense to me.
3 years ago
Patric Stout 970fedd78c Add: make modal windows update more smooth
Basically, modal windows had their own thread-locking for what
drawing was possible. This is a bit nonsense now we have a
game-thread. And it makes much more sense to do things like
NewGRFScan and GenerateWorld in the game-thread, and not in a
thread next to the game-thread.

This commit changes that: it removes the threads for NewGRFScan
and GenerateWorld, and just runs the code in the game-thread.
On regular intervals it allows the draw-thread to do a tick,
which gives a much smoother look and feel.

It does slow down NewGRFScan and GenerateWorld ever so slightly
as it spends more time on drawing. But the slowdown is not
measureable on my machines (with 700+ NewGRFs / 4kx4k map and
a Debug build).

Running without a game-thread means NewGRFScan and GenerateWorld
are now blocking.
3 years ago
Patric Stout 098d5b2239
Fix #8711: having gui_zoom lower than zoom_min causes crashes (#8835)
gui_zoom was never clamp'd between zoom_min/zoom_max.

zoom_min controls how zoomed-in we load sprites. For a value of 1,
no quad-sizes sprites are loaded. If gui_zoom would be 0, meaning
it wants quad-sized sprites to display, it was printing random
stuff to the screen, which could or could not result in crashes.
3 years ago
Patric Stout b9eac7c6dc Codechange: remove the unused lock around Blitter 3 years ago
Jonathan G Rennison 3e017ddaa9 Remove unused dirty block size constants 3 years ago
Jonathan G Rennison f4e29071be Merge tag '1.11.0-beta2' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release.yml
#	CMakeLists.txt
#	src/blitter/32bpp_optimized.cpp
#	src/debug.cpp
#	src/gfx.cpp
#	src/gfx_func.h
#	src/lang/czech.txt
#	src/lang/english.txt
#	src/lang/italian.txt
#	src/lang/swedish.txt
#	src/lang/ukrainian.txt
#	src/network/network_server.cpp
#	src/os/windows/crashlog_win.cpp
#	src/os/windows/win32.cpp
#	src/pathfinder/follow_track.hpp
#	src/screenshot.cpp
#	src/settings_type.h
#	src/spritecache.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/video_driver.cpp
#	src/video/video_driver.hpp
#	src/video/win32_v.cpp
3 years ago
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
3 years ago
Patric Stout c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
3 years ago
Jonathan G Rennison 4ef363422a Add 32bpp blitter support for adjusting brightness of drawn sprites 3 years ago
Michael Lutz 3e49aff35c Codechange: Allow video drivers to handle the cursor themselves. 3 years ago
Jonathan G Rennison c9ab460a03 Re-apply c0616750
Lost in merge: e95216b5
3 years ago
Jonathan G Rennison e95216b59d Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/core/geometry_func.cpp
#	src/date.cpp
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/object_gui.cpp
#	src/openttd.cpp
#	src/settings_type.h
#	src/video/allegro_v.cpp
#	src/video/dedicated_v.cpp
#	src/video/null_v.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
3 years ago
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.
3 years ago
Michael Lutz 22f5aeab07 Feature: Automatic UI and font zoom levels when supported by the OS. 3 years ago
Jonathan G Rennison b7ddd486cf Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/aircraft_cmd.cpp
#	src/blitter/32bpp_anim.cpp
#	src/cargopacket.cpp
#	src/cheat_gui.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/core/pool_func.hpp
#	src/date.cpp
#	src/economy.cpp
#	src/error_gui.cpp
#	src/ground_vehicle.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/industry_cmd.cpp
#	src/lang/dutch.txt
#	src/lang/french.txt
#	src/lang/german.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/mcf.cpp
#	src/network/network_content.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_station.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_common.hpp
#	src/saveload/saveload.cpp
#	src/settings_gui.cpp
#	src/station_cmd.cpp
#	src/station_kdtree.h
#	src/string_func.h
#	src/table/settings.ini
#	src/tgp.cpp
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/train_gui.cpp
#	src/tree_gui.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
#	src/viewport.cpp
#	src/viewport_sprite_sorter_sse4.cpp
#	src/window.cpp
3 years ago
Jonathan G Rennison 6c3e5642f8 Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/crashlog.cpp
#	src/fileio.cpp
#	src/fileio_func.h
#	src/fios_gui.cpp
#	src/ini_load.cpp
#	src/ini_type.h
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/network/network_client.cpp
#	src/order_base.h
#	src/order_cmd.cpp
#	src/os/windows/win32.cpp
#	src/road_cmd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/settings.cpp
#	src/station_cmd.cpp
#	src/stdafx.h
#	src/table/settings.ini
#	src/tree_cmd.cpp
#	src/tree_gui.cpp
#	src/vehicle_base.h
#	src/video/cocoa/cocoa_v.mm
#	src/video/cocoa/event.mm
#	src/video/cocoa/wnd_quartz.mm
#	src/viewport.cpp
#	src/widgets/tree_widget.h
3 years ago
Jonathan G Rennison 43980639de Merge branch 'master' into jgrpp
# Conflicts:
#	.gitignore
#	CMakeLists.txt
#	src/3rdparty/optional/optional.hpp
#	src/group_cmd.cpp
#	src/industry_cmd.cpp
#	src/misc_gui.cpp
#	src/video/sdl2_v.cpp
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago