Commit Graph

346 Commits (c79dd3656f68d5b653f2f16d35a8819c0fa12bff)

Author SHA1 Message Date
Jonathan G Rennison 0538ead472 Don't spread temperate trees uphill if above lower snow line in arctic 11 months ago
Jonathan G Rennison e74e08bf47 Fix manual tree planting in artic climate in perfect tree placement mode 1 year ago
Jonathan G Rennison 9521e7ef2b Merge branch 'master' into jgrpp
# Conflicts:
#	src/elrail.cpp
#	src/ground_vehicle.hpp
#	src/landscape.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/tile_cmd.h
#	src/town_cmd.cpp
#	src/tunnelbridge_cmd.cpp
1 year ago
Rubidium e8af8daa68 Codechange: pass "ground vehicle" to GetTileSlopeZ since for tunnel/bridges there are two states
Previously it checked the position in non-driving direction to "guess" whether
a ground vehicle was using the function, so on tunnels/bridges it could either
return the Z of the (virtual) ground compared to the Z of the path the vehicle
would take.
1 year ago
dP b0542c8c49
Codechange: Don't store tree counter in the map array (#10018) 1 year ago
Jonathan G Rennison 3e7a625e0e Fix function locals shadowing parameters 1 year ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Jonathan G Rennison 1bfd96c7f2 Merge branch 'master' into jgrpp
# Conflicts:
#	src/3rdparty/fmt/core.h
#	src/command_type.h
#	src/console_cmds.cpp
#	src/core/overflowsafe_type.hpp
#	src/landscape.cpp
#	src/network/network.cpp
#	src/newgrf_object.h
#	src/object_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/vehicle_sl.cpp
#	src/script/api/script_industrytype.cpp
#	src/script/api/script_object.hpp
#	src/script/api/script_town.cpp
#	src/table/object_land.h
#	src/timetable_cmd.cpp
#	src/tree_cmd.cpp
#	src/vehicle_gui.cpp
#	src/window.cpp
1 year ago
Rubidium 3373128233 Codechange: pass the randomizer directly to the town name generation 1 year ago
Tyler Trahan 5c64cdcb79
Feature: Press Ctrl to build a diagonal area of trees (#10342) 1 year ago
Jonathan G Rennison b1a1760bcc Allow planting trees on diagonal areas 2 years ago
Jonathan G Rennison 6154406d8a Prevent spread/regrowth of temperate trees already on snowy ground 2 years ago
Jonathan G Rennison 29a1e49c28 Change various asserts to not be included in release builds 2 years ago
Jonathan G Rennison 0818ce4ae7 Merge branch 'master' into jgrpp (SLV_U64_TICK_COUNTER)
# Conflicts:
#	src/date.cpp
#	src/date_func.h
#	src/newgrf.cpp
#	src/newgrf_animation_base.h
#	src/saveload/gamelog_sl.cpp
#	src/saveload/misc_sl.cpp
#	src/saveload/saveload.h
#	src/stdafx.h
2 years ago
dP 30bc490292 Codechange: Don't store tree counter in the map array
(cherry picked from commit 6c3f351d5a4b0d19a1a265f04f44c70c24c19cd2)

See: https://github.com/OpenTTD/OpenTTD/pull/10018
2 years ago
Jonathan G Rennison 5c2fb5c160 Make tree tile grass ground density update speed independent of growth speed
See #386
2 years ago
Jonathan G Rennison 91f740424b Fix #386: Tree tile grass ground density update when tree growth/spread disabled 2 years ago
Jonathan G Rennison 452d22ce37 Add setting for width of dynamic snowline range for arctic tree placement
Default: 75%
2 years ago
Andreas Schmitt c55051a135 Make arctic treeline feature use the dynamic snowline if present 2 years ago
Jonathan G Rennison dfc6e309d0 Fix ground/tree tile vegetation changes not updating map mode viewports
(In vegetation mode)
2 years ago
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 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 b0990fcff7 Codechange: Make TileIndex a "strong" typedef to give it a distinct type.
This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
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
Jonathan G Rennison 3ef1a0943b Merge branch 'master' into jgrpp-beta
# Conflicts:
#	src/lang/chuvash.txt
#	src/lang/czech.txt
#	src/lang/english_AU.txt
#	src/lang/english_US.txt
#	src/lang/german.txt
#	src/lang/japanese.txt
#	src/lang/korean.txt
#	src/lang/latvian.txt
#	src/lang/russian.txt
#	src/tree_gui.cpp
#	src/vehicle.cpp
3 years ago
Jonathan G Rennison 61cc60099a Merge branch 'jgrpp' into jgrpp-beta
# Conflicts:
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
3 years ago
Jonathan G Rennison 4a1e347f8e Fix desync when using "perfect" tree placement mode in arctic climate 3 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
Vít Šefl 710b758b81
Fix #9241: Grove and forest tree brushes also create rainforests (#9542) 3 years ago
Jonathan G Rennison c922f361b8 Fix truncation of arctic tree probability distribution 3 years ago
Jonathan G Rennison 6c7fccff5d Reduce duplication of GetTileZ calls in tree placement 3 years ago
Jonathan G Rennison 82fa6ed711 Whitespace adjustments 3 years ago
Andreas Schmitt d719b09cf0 Tweak the dispersed spreading a bit more 3 years ago
Andreas Schmitt f944c9e7ba Reduce building of cacti 3 years ago
Andreas Schmitt fe3c5d0330 Add another sparse tree growth area above the snow line and prevent that area from overgrowing 3 years ago
Andreas Schmitt 6c2152045a Fix banding issue in artic tree range
Using tile index for randomization is a very very very bad idea
3 years ago
Andreas Schmitt 3b4cbd3323 Improve tree placement
Prior to this change, trees tended to either cover the entire map like an ancient forest, or alternatively you turn off their growth which breaks industry. Furthermore there are these ugly random tree clumps at the beginning of the game which look like squares on the map someone placed there.

This change adds a new tree placing setting which removes the ugly random clumps and only slightly modifies the initial placement. The actual growth causes trees to bunch up in higher levels as usual but on the lower 4 levels their growth works differently. The number of trees per tile is limited and the trees spread out over a wider area instead of only to the neighboring tile. That spreads them out more and makes for a nicer look.

This also allows cacti to spread, since they can now use that same algorithm and avoid bunching up, but spread as they should.
3 years ago
Vít Šefl 30f5938eed Fix b791ffc6: use the correct name in CmdPlantTree 3 years ago
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 3 years ago
rubidium42 b791ffc6de Fix: do not hide parameter by local variable with the same name 3 years ago
Jonathan G Rennison 30409192f0 Fix f5183807: Tree planting scaling on extra large maps 3 years ago
PeterN f5183807fe Fix #9242: Tree tick handler did not scale by map size. (#9246)
This means that random tree generation density is higher on small maps and lower on large maps. This difference is enough to make the Lumber Mill impractical to use on large maps.

This change skips ticks on maps smaller than 256x256 and increases iterations or shortens the interval on maps larger than 256x256.

(cherry picked from commit b972ed8604)
3 years ago
glx22 38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 3 years ago
PeterN b972ed8604
Fix #9242: Tree tick handler did not scale by map size. (#9246)
This means that random tree generation density is higher on small maps and lower on large maps. This difference is enough to make the Lumber Mill impractical to use on large maps.

This change skips ticks on maps smaller than 256x256 and increases iterations or shortens the interval on maps larger than 256x256.
3 years ago
Jonathan G Rennison 1a29a1ee74 Fix building objects, trees and buoys on water/shore not clearing neighbour flooding states 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