Commit Graph

162 Commits (ab535c0a8665e6380c5037d7b6f0a507fc91d36a)

Author SHA1 Message Date
Peter Nelson ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
7 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
11 months ago
Patric Stout 31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 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
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 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
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 2 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 2 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.
2 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.
2 years ago
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2 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.
2 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2 years ago
Vít Šefl 710b758b81
Fix #9241: Grove and forest tree brushes also create rainforests (#9542) 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
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
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
frosch d9b4413bc9
Codechange: rename sound ids to make more sense. (#8701) 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
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
dP 82572754dd Fix: Trees disappear completely after a few years when they're not allowed to spread 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 7 years ago
frosch bfa3528069 (svn r27406) -Doc: Use same start/end tile convention in CmdPlantTree as in other TileArea commands. (HackaLittleBit) 9 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 3ce8d2ce70 (svn r24846) -Add: Advanced settings to disable certain sound effects. 12 years ago
michi_cc f3e295b4ec (svn r24134) -Add: Configurable limits for tree planting. 12 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 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 5c838ff1c3 (svn r23168) -Feature [FS#1824]: always draw fences around field tiles 13 years ago
yexo 6a272233b3 (svn r23160) -Fix: wrong comments in a lot of TileTypeProcs definitions 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 707b0f48e6 (svn r23114) -Feature: [NewGRF] Ambient sound effect callback. 13 years ago
rubidium 2a2c102b0b (svn r23108) -Codechange: more uint -> int / byte -> int conversions for Z related variables 13 years ago
rubidium 459c9523e8 (svn r23107) -Codechange: let GetSlopePixelZ and TerraformTile tile type functions use int z as well 13 years ago
rubidium 19eabdba2c (svn r23106) -Codechange: pass int* to GetTileSlope and friends 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 2ed0f93bfb (svn r23093) -Codechange: add a default NULL for the Z of GetTileSlope and use it 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 0395aab420 (svn r22019) -Codechange: s/functions.h/clear_func.h/ 14 years ago