Commit Graph

358 Commits (jgrpp)

Author SHA1 Message Date
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
Jonathan G Rennison 93f2d5e056 Add GUI setting for shading trees on slopes in viewports
Deafult on, only for non-map mode
(Slope shading is always on in map mode)
3 years ago
Jonathan G Rennison 4f74a83496 Add fast paths for clear/tree snow line checks in tile loop 3 years ago
Jonathan G Rennison dfecdf3afb Merge branch 'master' into jgrpp
# Conflicts:
#	src/dock_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/terraform_gui.cpp
#	src/vehicle.cpp
#	src/video/allegro_v.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/dedicated_v.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
3 years ago
frosch d9b4413bc9
Codechange: rename sound ids to make more sense. (#8701) 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
SamuXarick a4035af337
Codechange: Apply coding style (#8640)
* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
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 39df1c49a1 Merge branch 'master' into jgrpp
# Conflicts:
#	src/fileio.cpp
#	src/group_gui.cpp
#	src/industry.h
#	src/lang/korean.txt
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/linkgraphjob.h
#	src/linkgraph/linkgraphschedule.cpp
#	src/linkgraph/linkgraphschedule.h
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/town_cmd.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Niels Martin Hansen 2d9fa81bd0 Feature: Plant clumps of trees in editor by dragging on the landscape 3 years ago
Pavel Stupnikov 22b9dec960
Feature: Add an option to disable tree growth completely (#8415) 3 years ago
Pavel Stupnikov 04e572933d
Fix: Don't lower tree density if spreading is not enabled (#8413) 3 years ago
Jonathan G Rennison 352b361e1b Viewport: Replace viewport mark dirty if zoom level below with flags param
Fix missing flags for tracerestrict and effect vehicles
4 years ago
Yourself 087cae82fc Add: zero tree growth setting 4 years ago
Jonathan G Rennison f8d6e781ba Merge branch 'master' into jgrpp
# Conflicts:
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj.filters
#	src/base_consist.h
#	src/company_base.h
#	src/newgrf_config.cpp
#	src/newgrf_config.h
#	src/openttd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/saveload/station_sl.cpp
#	src/settings.cpp
#	src/signs_base.h
#	src/string.cpp
#	src/string_func.h
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/town_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_cmd.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/null_v.cpp
4 years ago
dP 82572754dd Fix: Trees disappear completely after a few years when they're not allowed to spread 4 years ago
Jonathan G Rennison 7949de2c05 Add a minimum visible height and no ground tile parameter to DrawTileProc.
Filter out tile parts which are entirely outside the drawing area.
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
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Jonathan G Rennison 9e1e074c2b Update existing assertions to log tile information where suitable 6 years ago
Jonathan G Rennison f34833f111 Merge branch 'improved_breakdowns' into jgrpp
# Conflicts:
#	src/vehiclelist.cpp
7 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch a47fb85cd8 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
Jonathan G Rennison 09291a3b74 Merge branch 'master' into jgrpp
# Conflicts:
#	src/blitter/32bpp_anim.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/train_cmd.cpp
#	src/vehicle_base.h
8 years ago
Jonathan G Rennison 224e927e0c Fix "remove all trees in scenario editor" being available in game. 8 years ago
patch-import 2e04f211df Import remove all trees in scenario editor patch.
http://www.tt-forums.net/viewtopic.php?f=33&t=49326

Update to current current version.
Use CMD_LANDSCAPE_CLEAR instead of CMD_CLEAR_AREA.
Whitespace, misc fixes.
8 years ago
patch-import c5f9d8b6de Import reduced tree patch
http://www.tt-forums.net/viewtopic.php?p=890778#p890778

Update to recent trunk, use extended savegame framework.
Add setting help text, tweak setting name.
Pre-calculate tree growth probabilities.
8 years ago
Jonathan G Rennison 3d40ca2db9 Merge branch 'master' into jgrpp 9 years ago
frosch bfa3528069 (svn r27406) -Doc: Use same start/end tile convention in CmdPlantTree as in other TileArea commands. (HackaLittleBit) 9 years ago
frosch 0d4b84f06b (svn r27406) -Doc: Use same start/end tile convention in CmdPlantTree as in other TileArea commands. (HackaLittleBit) 9 years ago
Jonathan G Rennison 2a4f196d34 Merge branch 'everest_treeline-sx' into jgrpp 9 years ago
patch-import 1796957258 Everest patch: Fix plant random trees planting cacti above the snowline.
Fix from HackaLittleBit
http://www.tt-forums.net/viewtopic.php?p=1156793#p1156793
9 years ago
Jonathan G Rennison c5de99c6b3 Fix off by one error in documentation comment for GetRandomTreeType. 9 years ago
Jonathan G Rennison 58780fb109 Merge branch 'everest_treeline-sx' into jgrpp 9 years ago
Jonathan G Rennison 381d11096f Bin no_trees_on_this_level, use exp. decay away from snow line.
Probability of placing an arctic tree is now an exponential decay
function of height distance from the snow line, instead of the previous
50% blocks.
This results in a more gradual thinning out of arctic trees in
each direction.
The algorithm is: p = exp(-3 * distance / range_setting),
using a rather crude approximation of the exponential function.

The no_trees_on_this_level setting is not really useful, and its
dual behaviour to disallow discrete height levels and turn on the
snow line behaviour is unintuitive.
Replace it with a simple on/off setting.
9 years ago
Jonathan G Rennison efe85200f0 Import Everest treeline patch 9 years ago
patch-import 536a95dfd0 Import combined Enhanced viewport: zoom out, overlays & tooltips (r53_27127) patch
https://www.tt-forums.net/viewtopic.php?f=33&t=53394
9 years ago
rubidium 2be4215f43 (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
frosch 336a93a9d8 (svn r24846) -Add: Advanced settings to disable certain sound effects. 12 years ago
frosch 3ce8d2ce70 (svn r24846) -Add: Advanced settings to disable certain sound effects. 12 years ago
michi_cc 07f32df363 (svn r24134) -Add: Configurable limits for tree planting. 12 years ago
michi_cc f3e295b4ec (svn r24134) -Add: Configurable limits for tree planting. 12 years ago
rubidium d5eeab43b7 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
yexo f884be58e5 (svn r23724) -Codechange: split of the check to see if ambient sounds are enabled to a header file allowing compilers to inline that check 13 years ago
yexo 5f79b4c5d1 (svn r23724) -Codechange: split of the check to see if ambient sounds are enabled to a header file allowing compilers to inline that check 13 years ago
yexo 0566a6cfda (svn r23168) -Feature [FS#1824]: always draw fences around field tiles 13 years ago
yexo 5c838ff1c3 (svn r23168) -Feature [FS#1824]: always draw fences around field tiles 13 years ago
yexo 36e61e08b3 (svn r23160) -Fix: wrong comments in a lot of TileTypeProcs definitions 13 years ago
yexo 6a272233b3 (svn r23160) -Fix: wrong comments in a lot of TileTypeProcs definitions 13 years ago
michi_cc 109d15410e (svn r23116) -Fix (r23114): Ambient sound effect callback was called for unsupported tile types. 13 years ago
michi_cc 3e016e4254 (svn r23116) -Fix (r23114): Ambient sound effect callback was called for unsupported tile types. 13 years ago
michi_cc 84a103e112 (svn r23114) -Feature: [NewGRF] Ambient sound effect callback. 13 years ago
michi_cc 707b0f48e6 (svn r23114) -Feature: [NewGRF] Ambient sound effect callback. 13 years ago
rubidium 0e2d2b2317 (svn r23108) -Codechange: more uint -> int / byte -> int conversions for Z related variables 13 years ago
rubidium 2a2c102b0b (svn r23108) -Codechange: more uint -> int / byte -> int conversions for Z related variables 13 years ago
rubidium fb9fb416a1 (svn r23107) -Codechange: let GetSlopePixelZ and TerraformTile tile type functions use int z as well 13 years ago
rubidium 459c9523e8 (svn r23107) -Codechange: let GetSlopePixelZ and TerraformTile tile type functions use int z as well 13 years ago
rubidium 70faeeaba9 (svn r23106) -Codechange: pass int* to GetTileSlope and friends 13 years ago
rubidium 19eabdba2c (svn r23106) -Codechange: pass int* to GetTileSlope and friends 13 years ago
rubidium a70fdbcf2f (svn r23096) -Codechange: remove useless divisions and multiplications by TILE_HEIGHT for the snow line code 13 years ago
rubidium 69162621d8 (svn r23096) -Codechange: remove useless divisions and multiplications by TILE_HEIGHT for the snow line code 13 years ago
rubidium bcb93b3b75 (svn r23093) -Codechange: add a default NULL for the Z of GetTileSlope and use it 13 years ago
rubidium 2ed0f93bfb (svn r23093) -Codechange: add a default NULL for the Z of GetTileSlope and use it 13 years ago
rubidium de980ef0f9 (svn r23091) -Codechange: rename some Get*Z functions to Get*PixelZ functions if they return the Z in pixels (like TilePixelHeight) 13 years ago
rubidium 7757a2ed40 (svn r23091) -Codechange: rename some Get*Z functions to Get*PixelZ functions if they return the Z in pixels (like TilePixelHeight) 13 years ago
rubidium 3cb12ed89c (svn r22019) -Codechange: s/functions.h/clear_func.h/ 14 years ago
rubidium 0395aab420 (svn r22019) -Codechange: s/functions.h/clear_func.h/ 14 years ago
terkhen b956a3e847 (svn r20829) -Fix [FS#4094]: Place less trees at once when planting random trees at the scenario editor. 14 years ago
terkhen 9a7dd40006 (svn r20829) -Fix [FS#4094]: Place less trees at once when planting random trees at the scenario editor. 14 years ago
terkhen d97c7f9ce4 (svn r20828) -Add: Take into account tree group placement at the world generation progress bar. 14 years ago
terkhen ee8272bacc (svn r20828) -Add: Take into account tree group placement at the world generation progress bar. 14 years ago
terkhen 26b144e663 (svn r20827) -Codechange: Simplify code for placement of tree groups. 14 years ago
terkhen 95e5e59f37 (svn r20827) -Codechange: Simplify code for placement of tree groups. 14 years ago
terkhen dc9053b900 (svn r20826) -Codechange: Simplify code for generating more trees above the snowline. 14 years ago
terkhen 9ecf69684e (svn r20826) -Codechange: Simplify code for generating more trees above the snowline. 14 years ago
terkhen 4f8ebe9582 (svn r20825) -Codechange: Replace a few magic numbers by constants. 14 years ago
terkhen 3607c33b4f (svn r20825) -Codechange: Replace a few magic numbers by constants. 14 years ago
terkhen 04134c1e51 (svn r20289) -Codechange: Unify fall through coding style. 14 years ago
terkhen 80c43f52e8 (svn r20289) -Codechange: Unify fall through coding style. 14 years ago
frosch 5b86c79fce (svn r20283) -Codechange: Unify start of doygen comments. 14 years ago
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 14 years ago
rubidium 8c85b4ce3d (svn r20281) -Codechange: unify case scope closure + break coding style 14 years ago
rubidium e356cb9405 (svn r20281) -Codechange: unify case scope closure + break coding style 14 years ago