Commit Graph

433 Commits (jgrpp)

Author SHA1 Message Date
Rubidium a409e4b026 Add: documention to large functions that have too little documentation according to CodeQL 1 year ago
Jonathan G Rennison 05ec32f577 Run water flooding at constant speed at day lengths >= 4
See: #482
1 year ago
Jonathan G Rennison a9100e93cb Merge branch 'master' into jgrpp
# Conflicts:
#	src/group_cmd.cpp
#	src/lang/korean.txt
#	src/lang/simplified_chinese.txt
#	src/script/api/script_rail.cpp
#	src/tunnelbridge_cmd.cpp
1 year ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Rubidium 9c1a3b17e3 Codechange: use MapLogY() instead of FindFirstBit(MapSizeY()), MapSize() instead of MapSizeX() * MapSizeY() 1 year ago
SamuXarick 96ec9908a0
Codechange: refactor removal of desert around river tiles 1 year ago
Jonathan G Rennison 5b490b243d Merge branch 'master' into jgrpp
# Conflicts:
#	src/industry_cmd.cpp
#	src/landscape.cpp
#	src/object_cmd.cpp
#	src/rail_cmd.cpp
#	src/script/api/script_tile.cpp
#	src/table/settings/difficulty_settings.ini
#	src/table/settings/world_settings.ini
#	src/terraform_cmd.cpp
#	src/tilearea_type.h
#	src/tree_cmd.cpp
#	src/tree_cmd.h
#	src/tree_gui.cpp
#	src/water_cmd.cpp
1 year ago
Tyler Trahan 07fba75238
Fix: Various Wide River issues (#10348) 1 year ago
Rubidium f667a831a5 Codechange: unify creation of diagonal/orthogonal iterator using smart pointers 1 year ago
Jonathan G Rennison 160dcc345a Add wrapper class for diagonal or orthogonal tile iteration 1 year ago
Jonathan G Rennison 58d841486e Merge branch 'master' into jgrpp
# Conflicts:
#	src/os/windows/font_win32.cpp
#	src/script/api/script_object.hpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/viewport.cpp
#	src/viewport_func.h
1 year ago
Peter Nelson a971eee2e0 Cleanup: Replace foundation drawing magic numbers.
Use TILE_SIZE or TILE_HEIGHT as appropriate instead.
1 year ago
Peter Nelson 138198e971 Change: Separate ground sprite from foundation sprite offsets. 1 year ago
2TallTyler 0116a422ea Cleanup: Refactor Wide Rivers code slightly 1 year ago
2TallTyler d67259334a Fix #10218: Sloped river tiles need water both up and downstream 1 year ago
Jonathan G Rennison ff0b3ca9be Merge branch 'master' into jgrpp
# Conflicts:
#	src/landscape.cpp
2 years ago
Jonathan G Rennison 29a1e49c28 Change various asserts to not be included in release builds 2 years ago
Tyler Trahan 4daad7f348 Change: Don't make wide rivers using original landscape generator 2 years ago
Tyler Trahan 664771d085 Feature: Wide rivers 2 years ago
SamuXarick c7505539af Fix #9869: remove docking tile when doing a clear square
Terraforming through objects placed on water didn't properly remove docking tiles as expected.

By moving some logic regarding removal of docking tiles into DoClearSquare, the issue is solved, while also simplifying code, avoiding repetition elsewhere.
2 years ago
Jonathan G Rennison 3d857333c8 Reduce delays with company bankrupcty/sale processing at high day lengths 2 years ago
Jonathan G Rennison 1714773457 Adjust baseline for arctic snowline dynamic width setting to lower value 2 years ago
Jonathan G Rennison 452d22ce37 Add setting for width of dynamic snowline range for arctic tree placement
Default: 75%
2 years ago
Jonathan G Rennison ed30542acf Cache highest snowline value 2 years ago
Jonathan G Rennison ef379b5214 Fix DC_FORCE_CLEAR_TILE water removal not removing docking tiles
See: https://github.com/OpenTTD/OpenTTD/issues/9869
2 years ago
Jonathan G Rennison 39d39a5c61 Reduce duplication in desert or rainforeset data search arrays 2 years ago
reldred 3bf2e850a5 undo the mess I made of JGR's fixes to my janky code 2 years ago
reldred e3e032518b Merge branch 'desert-tweaks' of https://github.com/reldred/OpenTTD-patches into desert-tweaks 2 years ago
reldred 59022c40f9 adjustments;
added lake tropic width adjustment
added an extra large setting to the coasts (51radius)
set minimum width for rivers and lakes to 2 (setting it to 1 actually CTD'd the game)
made max for rivers and lakes be 51 tiles to match the 51tiles of the coast setting.
2 years ago
Jonathan G Rennison f1b6eb932f Reduce duplication in CreateDesertOrRainForest 2 years ago
reldred 22305e8795 Allows configuring the width of the coast in tropic maps that generates as tropiczone_normal before the desert kicks in, it does this by creating two additional arrays which house the coordinates to create a filled circle of radius of 19 tiles, and 25 tiles. the default creates a radius of 13 tiles.
I'd eventually like to add an Extra Large setting but manually creating the array of coordinates is horrible.

I wedged this setting in beside the setting for tropic width around rivers despite it not fitting into the rivers/lakes category because it still feels the most relevant place for now.
2 years ago
Michael Lutz 2e39637db2 Codechange: Don't use a global for the 'not enough cash' message. 3 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 3 years ago
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
3 years ago
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 3 years ago
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
3 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 3 years ago
reldred 5a53b4d846 Additional tweaks to allow rivers to spawn in deserts (causing aditional tropic biome to spawn around them). This piggybacks off of the 'allow lakes in deserts' setting, renaming it to cover both. The actual setting name itself internally hasn't changed. 3 years ago
Andreas Schmitt 7601720ff7 landscape.cpp fixes 3 years ago
Andreas Schmitt 44fe1ca00b Tweak the bridge generation 3 years ago
Andreas Schmitt 8d584990aa Remove unused hash functions and start the road building from the map center 3 years ago
Andreas Schmitt da4de2c959 Improve lake generation
Prior to this change, lakes could be very small and could also not be deactivated.

This change allows the deactivation of lake creation and the lake size is now the set size +- 25% instead of anything between 0 and lake_size.
3 years ago
Andreas Schmitt 99e32488f2 Add creation of wide rivers 3 years ago
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 3 years ago
Jonathan G Rennison 1ef236525a Mapgen: Generate fuzzy ellipse shaped lakes instead of squares 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
Patric Stout ff6924f122
Fix 70bc55cfd6e: snow line height was set while calculating desert line (#8989)
Seems I liked copy/pasting just a tiny bit too much.
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 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 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
reldred 07397783f8 Allows configuring the height at which rainforests start, which by default was controlled by dividing the map maxheight by 4 in landscape.cpp. Default setting is 8 which matches and should provide default behavior in new map creation. 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 2e20da40ed Cache current value of snow line height 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
SamuXarick aaeb36e95d Fix: for original terrain generator, keep a single gap of water at the borders (#7883)
This means that for NE/NW, it should have one more in case of
freeform-edges, and in case of SE/SW it should have one less.

Reminder: freeform-edges only adds VOID tiles on X=0 and Y=0.
(cherry picked from commit 1d85d71d29)
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
SamuXarick 1d85d71d29
Fix: for original terrain generator, keep a single gap of water at the borders (#7883)
This means that for NE/NW, it should have one more in case of
freeform-edges, and in case of SE/SW it should have one less.

Reminder: freeform-edges only adds VOID tiles on X=0 and Y=0.
4 years ago
Jonathan G Rennison 946442ab6b GRF: Add extra road/tram type flag: towns cannot modify tiles 4 years ago
Jonathan G Rennison 737ced9f50 Merge branch 'master' into jgrpp 4 years ago
TechGeekNZ 716c883737 Fix: Globally apply preprocessor directive coding style
Global; except for the 32-bit SSE blitter, which has some #DEFINEs
in not-very-nice places.
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 edfd378e93 Merge branch 'master' into jgrpp
# Conflicts:
#	source.list
#	src/blitter/32bpp_anim.cpp
#	src/linkgraph/linkgraphjob.cpp
#	src/order_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_type.h
5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
Jonathan G Rennison 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Jonathan G Rennison 7ff252c58d Merge branch 'master' into jgrpp
# Conflicts:
#	Makefile.src.in
#	findversion.sh
#	projects/determineversion.vbs
#	src/aircraft_cmd.cpp
#	src/lang/dutch.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/order_cmd.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.cpp
#	src/town_cmd.cpp
#	src/viewport.cpp
#	src/water_map.h
5 years ago
SamuXarick 4adb91202d Fix: Remove desert around lakes upon generation 5 years ago
Jonathan G Rennison 2fdcc52321 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	Makefile.src.in
#	findversion.sh
#	projects/determineversion.vbs
#	src/lang/dutch.txt
#	src/lang/korean.txt
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/rail.cpp
#	src/rail_cmd.cpp
#	src/saveload/afterload.cpp
#	src/ship_cmd.cpp
#	src/toolbar_gui.cpp
#	src/vehicle.cpp
5 years ago
Gabda 37bb2c9308 Codechange: Make the style of MakeVoid calls uniform (#7192) 5 years ago
Jonathan G Rennison 9d3b77c5a2 Merge branch 'master' into jgrpp
# Conflicts:
#	src/fios_gui.cpp
#	src/lang/english.txt
#	src/lang/german.txt
5 years ago
J0an Josep 19be1f4ace Codechange: [NPF] Add some consts. 5 years ago
Jonathan G Rennison 281d346fe2 Merge branch 'master' into jgrpp
# Conflicts:
#	bin/baseset/no_sound.obs
#	bin/baseset/orig_dos.obg
#	bin/baseset/orig_dos.obs
#	bin/baseset/orig_dos_de.obg
#	bin/baseset/orig_win.obg
#	bin/baseset/orig_win.obm
#	bin/baseset/orig_win.obs
#	src/aircraft_cmd.cpp
#	src/blitter/32bpp_anim.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.cpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.cpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/common.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/saveload/saveload.cpp
#	src/town_cmd.cpp
#	src/viewport.cpp
#	src/viewport_func.h
5 years ago
Johannes E. Krause c33596fe4a Codechange: Unify tile height model in all functions (Patch by adf88, #6583) 5 years ago
Johannes E. Krause f744dea0ff Fix: jumping effect when scrolling viewport over bottom edge of the map (Patch by adf88, #6583) 5 years ago
Johannes E. Krause f0290d5de7 Codechange: Add InverseRemapCoords2 function for remapping viewport coordinates to underlying tile coordinates (Patch by adf88, #6583) 5 years ago
Jonathan G Rennison 035f5622b9 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_cmds.cpp
#	src/landscape.cpp
#	src/linkgraph/linkgraphschedule.cpp
#	src/openttd.cpp
#	src/roadveh_cmd.cpp
#	src/toolbar_gui.cpp
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/window_type.h
6 years ago
Niels Martin Hansen 2a868b9f3b Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
6 years ago
Jonathan G Rennison 6740a9a470 Merge branch 'custom_bridgeheads' into jgrpp
# Conflicts:
#	docs/landscape.html
#	src/bridge_map.h
#	src/pbs.cpp
#	src/saveload/company_sl.cpp
#	src/saveload/extended_ver_sl.cpp
#	src/settings_type.h
#	src/signal.cpp
#	src/train_cmd.cpp
#	src/tunnel_map.h
#	src/tunnelbridge_cmd.cpp
#	src/tunnelbridge_map.h
#	src/vehicle.cpp
#	src/viewport.cpp
6 years ago
Jonathan G Rennison 77362b829a Initial support for rail custom bridge heads 6 years ago
Jonathan G Rennison 3330e4cef8 Merge branch 'cargo_type_order' into jgrpp
# Conflicts:
#	src/pathfinder/yapf/yapf_common.hpp
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/order_sl.cpp
#	src/saveload/station_sl.cpp
#	src/track_func.h
6 years ago
Charles Pigott 5f86e1a390 Codechange: Silence -Wclass-memaccess warnings with GCC8 6 years ago
keldorkatarn 4955996b35 Remove costly recalculation of a date format we already have.
(cherry picked from commit 6aca18d18252f1c2f6d4a215999b7d7afb7df813)

See #36
6 years ago
Jonathan G Rennison 2e7380bc72 Add scope info logging to tile loop 7 years ago
Jonathan G Rennison 4db69283c1 Add setting to disable removing sea/rivers 7 years ago
Jonathan G Rennison 9d5f34fea6 Replace various uses of std::set/map with btree containers. 7 years ago
Jonathan G Rennison 072915f2c7 Merge branch 'custom_bridgeheads' into jgrpp
# Conflicts:
#	docs/landscape_grid.html
#	src/roadveh_cmd.cpp
#	src/saveload/afterload.cpp
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/tunnelbridge_cmd.cpp
#	src/tunnelbridge_map.h
7 years ago
Jonathan G Rennison da177d063f Custom bridge heads: Initial implementation 7 years ago
Jonathan G Rennison 95aad35774 Instead of list use deque in FlowRiver, vector in StationViewWindow. 8 years ago
Jonathan G Rennison 5e67582a64 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	config.lib
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/saveload.cpp
8 years ago
alberth 597380e099 (svn r27650) -Codechange: Replace SaveOrLoadMode by FileOperation and DetailedFileType. 8 years ago
alberth a959c0c965 (svn r27650) -Codechange: Replace SaveOrLoadMode by FileOperation and DetailedFileType. 8 years ago
alberth 9135f7130e (svn r27635) -Codechange: Move FileType and FileToSaveLoad structure definitions. 8 years ago
alberth a35e970ab0 (svn r27635) -Codechange: Move FileType and FileToSaveLoad structure definitions. 8 years ago
Jonathan G Rennison 1891e7dfc8 Bump max map size to 28 bits.
Prevent opening NewGRF debug window on tile indexes > 27 bits,
to avoid overflowing field.
9 years ago