Commit Graph

225 Commits (38571cf0daea6f9e4ec56f489df0c9a282ef94f4)

Author SHA1 Message Date
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 d81cbc25b8 Add setting to allow hiding viewport labels of inidivudal waypoints 2 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
Jonathan G Rennison 2e022d5194 Move game events to new event_logs header/cpp files 3 years ago
Jonathan G Rennison 2bd535e834 Merge branch 'master' into jgrpp-beta
# Conflicts:
#	src/engine_base.h
#	src/gfxinit.cpp
#	src/graph_gui.cpp
#	src/lang/brazilian_portuguese.txt
#	src/lang/dutch.txt
#	src/lang/french.txt
#	src/lang/korean.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/portuguese.txt
#	src/lang/russian.txt
#	src/lang/spanish.txt
#	src/lang/spanish_MX.txt
#	src/network/core/address.cpp
#	src/network/core/game_info.h
#	src/network/core/os_abstraction.h
#	src/network/core/udp.cpp
#	src/network/network_client.cpp
#	src/network/network_client.h
#	src/network/network_internal.h
#	src/newgrf_engine.cpp
#	src/settings_gui.cpp
#	src/station_cmd.cpp
#	src/string_func.h
#	src/town_gui.cpp
#	src/video/video_driver.cpp
#	src/widget_type.h
3 years ago
rubidium42 05394d5216 Fix #6598: Prevent invalid memory accesses when abandoning a join from within a network game
One could join a network game from within an already running network game. This would call a NetworkDisconnect, but keeps the UI alive. If, during that process the join is aborted, e.g. by cancelling on a password dialog, you would still be in your network game but also get shown the server list.
Solve all the underlying problems by falling back to the main UI when (re)connecting to a(nother) server.
3 years ago
Jonathan G Rennison 253d54ce05 Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/french.txt
#	src/network/network_udp.cpp
3 years ago
rubidium42 c4bccd4f70
Fix #8874: show a warning when a NewGRF scan is requested multiple times from the console (#9022) 3 years ago
Jonathan G Rennison 5e14b54a0c Merge branch 'master' into jgrpp 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
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
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.
3 years ago
Jonathan G Rennison 483ed2f468 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/commit-checker.yml
#	src/openttd.cpp
3 years ago
Jonathan G Rennison 5fe5884613 Debug: Add experimental command to switch baseset 3 years ago
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.
3 years ago
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.
4 years ago
Jonathan G Rennison 63d3f33fd2 Add display setting for income/cost text effects 4 years ago
Jonathan G Rennison d85a529f87 Merge branch 'master' into jgrpp 4 years ago
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.
4 years ago
Jonathan G Rennison 52e0d44c8a Revert "Fix recursive faults in Window crash logger due to message box event loop."
This reverts commit 2b1b7f8b135968cb88d8e65fcb89cdff8d203838.

Replaced by b5ca2161d9.
4 years ago
Jonathan G Rennison cbdd9f84d8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_gui.cpp
#	src/lang/korean.txt
#	src/video/sdl2_v.cpp
#	src/video/sdl2_v.h
#	src/window.cpp
#	src/window_gui.h
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jonathan G Rennison 89a6cc3e03 Add game event flag for virtual train creation 5 years ago
Jonathan G Rennison 942dd35380 Add game events for industry create/destroy 5 years ago
Jonathan G Rennison 36eb4165b8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/bridge_map.h
#	src/crashlog.cpp
#	src/industry.h
#	src/linkgraph/linkgraph_type.h
#	src/order_type.h
#	src/saveload/afterload.cpp
#	src/settings.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/spritecache.cpp
#	src/stdafx.h
#	src/table/settings.h.preamble
#	src/train.h
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/viewport_func.h
#	src/widgets/station_widget.h
#	src/zoom_func.h
#	src/zoom_type.h
5 years ago
Jonathan G Rennison 1d5ba98932 Show time and in game date of game load in desync/crash logs 5 years ago
Jonathan G Rennison c7a9950269 Add game event for train crash 5 years ago
Jonathan G Rennison e2251999ce Add game event flag for disaster vehicles 5 years ago
Jonathan G Rennison 5b7d1f7f80 Add game event for TBTR replacement attempt 5 years ago
Jonathan G Rennison ec1e848a7f Add log of game events since last load and overall
Add console command
Add to crashlog
5 years ago
Charles Pigott 327ff89808 Codechange: Remove PauseModeByte 5 years ago
Jonathan G Rennison 064a36b319 Merge branch 'crashlog_improvements' into jgrpp 7 years ago
Jonathan G Rennison 102405e082 Fix recursive faults in Window crash logger due to message box event loop. 7 years ago
Jonathan G Rennison c6854afcef Pause the game instead of blocking when link graph jobs lag.
Check if the job is still running one date fract tick before it
is due to join and if so pause the game until its done.
This avoids the main thread being blocked on a thread join.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
9 years ago
rubidium 17951f57a5 (svn r25506) -Document: a function, and name it slightly better 11 years ago
rubidium 5b2a5ac790 (svn r25506) -Document: a function, and name it slightly better 11 years ago
truebrain 3a799f1145 (svn r23618) -Add: ScriptGame::Pause, ScriptGame::Unpause, and ScriptGame::GetLandscape (GameScript only) 13 years ago
truebrain 55de5d336c (svn r23618) -Add: ScriptGame::Pause, ScriptGame::Unpause, and ScriptGame::GetLandscape (GameScript only) 13 years ago
rubidium daba7e588a (svn r23470) -Codechange: move declaration of SwitchToMode to a header instead of declaring it in 6 other files 13 years ago
rubidium b231e80125 (svn r23470) -Codechange: move declaration of SwitchToMode to a header instead of declaring it in 6 other files 13 years ago
rubidium 4509f814b3 (svn r23244) -Feature: if the installation is ananas, try to get the b without b installed 13 years ago
rubidium 02b884d923 (svn r23244) -Feature: if the installation is ananas, try to get the b without b installed 13 years ago
planetmaker 3e5d60ea2e (svn r22708) -Feature [FS#4701]: Display option to hide competitors' signs and station names (Zuu) 13 years ago
planetmaker 3fb66890ee (svn r22708) -Feature [FS#4701]: Display option to hide competitors' signs and station names (Zuu) 13 years ago
alberth cae2d84af3 (svn r22512) -Add: Save heightmap. 13 years ago
alberth f1cae9960f (svn r22512) -Add: Save heightmap. 13 years ago
alberth b833c08459 (svn r22507) -Doc: Document SwitchMode. 13 years ago
alberth c8cbc8ef97 (svn r22507) -Doc: Document SwitchMode. 13 years ago
alberth 3ae756f85f (svn r22460) -Doc: Semantic documentation fixes, and doxygen additions (partly by planetmaker). 13 years ago