Commit Graph

549 Commits (0a9c44d1a2b3b5de76595dfc74938fca34b3448a)

Author SHA1 Message Date
Jonathan G Rennison 0a9c44d1a2 Merge branch 'master' into jgrpp
# Conflicts:
#	src/airport_gui.cpp
#	src/blitter/32bpp_anim_sse4.cpp
#	src/console_cmds.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/newgrf_object.h
#	src/road_gui.cpp
#	src/widgets/road_widget.h
#	src/window.cpp
2 years ago
Peter Nelson dc1b84aa1e Cleanup: Text widgets are capable of drawing text without assistance.
Remove custom text drawing of some widgets in favour of standard text
widgets.
2 years ago
Peter Nelson fc944829e1 Change: Don't use zero-sized plane for World Generation window.
Use of zero-sized plane causes the window size calculation to change
depending on which plane is displayed. Instead use an empty plane so
that largest of the planes is taken into account for sizing.
2 years ago
Jonathan G Rennison b69521ea87 Allow specifying a custom number of industries in map generation window 2 years ago
Jonathan G Rennison 0b0d154788 Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/ci-build.yml
#	src/lang/german.txt
#	src/lang/romanian.txt
#	src/lang/slovak.txt
#	src/lang/turkish.txt
#	src/network/core/address.cpp
#	src/network/core/tcp.h
#	src/network/core/udp.cpp
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/network/network_udp.cpp
#	src/openttd.cpp
#	src/saveload/newgrf_sl.cpp
#	src/tree_cmd.cpp
#	src/video/video_driver.hpp
#	src/window.cpp
#	src/window_gui.h
3 years ago
Andreas Schmitt 150e502cf9 Add generation of public roads linking towns 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
Patric Stout b136e65cf9
Change: reworked the debug levels for network facility (#9251)
It now follows very simple rules:
0 - Fatal, user should know about this
1 - Error, but we are recovering
2 - Warning, wrong but okay if you don't know
3 - Info, information you might care about
4 -
5 - Debug #1 - High level debug messages
6 - Debug #2 - Low level debug messages
7 - Trace information
3 years ago
Jonathan G Rennison f39b6f4ba3 Merge branch 'master' into jgrpp
# Conflicts:
#	src/cheat_gui.cpp
#	src/genworld_gui.cpp
#	src/landscape.cpp
#	src/lang/english.txt
#	src/saveload/afterload.cpp
#	src/screenshot.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_type.h
#	src/table/settings.ini
#	src/tile_type.h
#	src/widgets/genworld_widget.h
3 years ago
Jonathan G Rennison 2e6dbfee05 Merge branch 'master' into jgrpp 3 years ago
Jonathan G Rennison 5e14b54a0c Merge branch 'master' into jgrpp 3 years ago
reldred 213b6fe6ef Add PR #231: More river configuration options 3 years ago
Patric Stout f05e2e0d40 Feature: allow setting a custom terrain type to define highest peak
At least, TGP will try to reach it. It heavily depends on the map
if it is reachable at all. But for sure it will do its atmost to
get there!
3 years ago
Patric Stout 45c2c29c35 Add: allow setting the highest mountain for heightmaps
It will add some slack to the map height limit if that was set
to auto.
3 years ago
Patric Stout 422e132845 Feature: auto-detect map height limit based on generated map
This opens up the true power of the TGP terrain generator, as it
is no longer constrainted by an arbitrary low map height limit,
especially for extreme terrain types.

In other words: on a 1kx1k map with "Alpinist" terrain type, the
map is now really hilly with default settings.

People can still manually limit the map height if they so wish,
and after the terrain generation the limit is stored in the
savegame as if the user set it.

Cheats still allow you to change this value.
3 years ago
Patric Stout 1a1049bc0d Change: rename setting "max_heightlevel" to "map_height_limit"
This better reflects what it is, and hopefully removes a bit of
the confusion people are having what this setting actually does.

Additionally, update the text on the setting to better inform
users what it is doing exactly, so they can make an educated
decision on how to change it.

Next commit will introduce an "auto" value, which should be the
new default. The rename has as added benefit that everyone will
start out on the "auto" value.
3 years ago
Patric Stout 23f27db8c3 Change: remove "maximum map height" from the New Game GUI
This setting influence the max heightlevel, and not as the name
suggests: the height of the generated map.

How ever you slice it, it is a very weird place to add this
setting, and it is better off being only in the settings menu.

Commits following this commit also make it more useful, so users
no longer have to care about it.
3 years ago
Patric Stout 70bc55cfd6 Feature: setting to indicate desert coverage for tropic climate
This is an indication value; the game tries to get as close as it
can, but due to the complex tropic rules, that is unlikely to be
exact.

In the end, it picks a height-level to base the desert/tropic
line on. This is strictly seen not needed, as we can convert any
tile to either. But it is the simplest way to get started with
this without redoing all related functions.
3 years ago
Patric Stout cafe4eed6e Feature: setting to indicate snow coverage for arctic climate (replaces snow line height)
Setting the snow coverage (in % of the map) makes a lot more sense
to the human, while still allowing the niche player to set (by
finding the correct %) a snow line height they like. This makes for
easier defaults, as it decoupled terrain height from amount of snow.

Maps can never be 100% snow, as we do not have sprites for coastal
tiles.

Internally, this calculates the best snow line height to approach
this coverage as close as possible.
3 years ago
Patric Stout 751434ea63
Fix: placing random trees in SE crashes the game (#8892)
This used to work by accident: originally the code checked if
GenerateWorld was threaded. If not, it would abort the function.
This worked for placing trees, because it was also returning false
when it was not active.

With the recent changes, that check got removed, and this crash
started to happen. So now check if we have a modal window, which
is a very solid indication we are generating the world.
3 years ago
Jonathan G Rennison abf8505c69 Add rainforest line height setting to map generation windows
See: #227
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 68a0a4d1b9 Merge branch 'master' into jgrpp
# Conflicts:
#	src/newgrf_config.cpp
3 years ago
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".
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
frosch c71d0f5e7f Change: move townname generator selection to mapgen GUI. 3 years ago
frosch d17226910d Codechange: minor rearrangement of settings in random map and heightmap GUI. 3 years ago
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'. 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
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Michael Lutz 65f65ad2ad Codechange: Convert some more FIO functions to take std::string. 3 years ago
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 3 years ago
Jonathan G Rennison af09391bfb Use atomic load for _realtime_tick in _SetGeneratingWorldProgress 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 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Jonathan G Rennison f5747bf753 Merge branch 'master' into jgrpp
# Conflicts:
#	src/genworld_gui.cpp
#	src/group_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings_gui.cpp
#	src/toolbar_gui.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
5 years ago
Jonathan G Rennison 361758b516 Merge branches 'crashlog_improvements', 'save_ext' into jgrpp
# Conflicts:
#	Makefile.src.in
#	projects/openttd_vs140.vcxproj
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj
#	projects/openttd_vs142.vcxproj.filters
#	src/core/smallstack_type.hpp
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/linkgraphjob.h
#	src/misc.cpp
#	src/network/network_udp.cpp
#	src/openttd.cpp
#	src/saveload/saveload.cpp
5 years ago
Michael Lutz 05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
5 years ago
Jonathan G Rennison ba34ec7ade Merge branch 'master' into jgrpp
Replace build and refit, and group collapse implementations
Fix template creation build and refit

# Conflicts:
#	Makefile.bundle.in
#	config.lib
#	src/animated_tile.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/null.hpp
#	src/build_vehicle_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/console_gui.cpp
#	src/core/smallstack_type.hpp
#	src/date.cpp
#	src/debug.cpp
#	src/genworld_gui.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/core/game.h
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_content.cpp
#	src/network/network_type.h
#	src/network/network_udp.cpp
#	src/newgrf_house.h
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/osk_gui.cpp
#	src/pathfinder/opf/opf_ship.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.h
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/gameopt_settings.ini
#	src/table/newgrf_debug_data.h
#	src/table/settings.ini
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehiclelist.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 5 years ago
Jonathan G Rennison 3a640af71d Merge branch 'master' into jgrpp
# Conflicts:
#	src/ground_vehicle.cpp
#	src/viewport.cpp
6 years ago
Miguel Horta e00908f5e9 Fix #6898: Replace atoi() with strtoul()
Normalize type and parsing of generation_seed across all files
Add assert_compile() to ensure correct type
6 years ago
Jonathan G Rennison 4d1bd8e4b4 Merge branch 'master' into jgrpp
# Conflicts:
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/music.cpp
#	src/table/settings.ini
#	src/town_cmd.cpp
#	src/train_cmd.cpp
6 years ago