Commit Graph

398 Commits (73d70527323dcc848f39a9eba0b8964548761b6c)

Author SHA1 Message Date
Rubidium 73d7052732 Add: unit test functionality using catch2
(cherry picked from commit 43a7e54067)
10 months ago
Jonathan G Rennison 7502fbd44b Use ring buffers for tile/landscape candidate queues 10 months ago
Jonathan G Rennison 9cf39b7a25 Prefetch next tile in tile loop iteration 10 months ago
Jonathan G Rennison cc57ac0eff Add pre-check to auxiliary tile loop flooding test 10 months ago
Jonathan G Rennison 410d5bdc55 Spread tile loop iterations over all ticks when using day length > 1
See: #545
1 year ago
Jonathan G Rennison ac2f9a21e8 Move upstream saveload to src/saveload/, move jgrpp saveload to src/sl/
Leave afterload in src/saveload/
1 year ago
Jonathan G Rennison fd4d4d341d Merge branch 'master' into jgrpp
# Conflicts:
#	src/animated_tile.cpp
#	src/cargopacket.h
#	src/cheat_gui.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/date.cpp
#	src/disaster_vehicle.cpp
#	src/dock_gui.cpp
#	src/economy.cpp
#	src/engine.cpp
#	src/error_gui.cpp
#	src/fontcache/spritefontcache.cpp
#	src/game/game_gui.cpp
#	src/game/game_text.cpp
#	src/gfx.cpp
#	src/graph_gui.cpp
#	src/highscore_gui.cpp
#	src/industry_cmd.cpp
#	src/lang/dutch.txt
#	src/lang/english_AU.txt
#	src/lang/english_US.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/italian.txt
#	src/lang/portuguese.txt
#	src/lang/russian.txt
#	src/lang/turkish.txt
#	src/lang/vietnamese.txt
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/newgrf.cpp
#	src/newgrf.h
#	src/newgrf_generic.cpp
#	src/news_gui.cpp
#	src/openttd.cpp
#	src/os/unix/unix.cpp
#	src/os/windows/font_win32.cpp
#	src/os/windows/win32.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/misc_sl.cpp
#	src/saveload/oldloader_sl.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/script/script_gui.cpp
#	src/settings_table.cpp
#	src/signs_gui.cpp
#	src/smallmap_gui.cpp
#	src/smallmap_gui.h
#	src/spritecache.cpp
#	src/spritecache.h
#	src/spriteloader/grf.cpp
#	src/station_cmd.cpp
#	src/statusbar_gui.cpp
#	src/stdafx.h
#	src/strgen/strgen_base.cpp
#	src/subsidy.cpp
#	src/table/settings/difficulty_settings.ini
#	src/texteff.cpp
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/townname.cpp
#	src/vehicle.cpp
#	src/waypoint_cmd.cpp
#	src/widgets/dropdown.cpp
#	src/window.cpp
1 year ago
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
1 year ago
Rubidium 43a7e54067 Add: unit test functionality using catch2 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 c6ff7dad68 Add: compile time "unit tests" for GetPartialZ consistent 1 year ago
Rubidium 9d2a0f3d0b Change: make GetPartialZ consistent, meaning Z of adjacent slopes continue
Previously, on a straight line of a one corner up slope with the adjacent
steep sloop the Z would increase one step every two sub pixels, except for one
case where one sub pixel is skipped. Similarly, a steep slope with two
adjacent one corner up slopes, would have a bump in the height line along the
diagonal whenever it enters/leaves the steep slope tile.
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
Jonathan G Rennison 2ea1766677 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/commit-checker.yml
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/league_sl.cpp
#	src/saveload/saveload.h
#	src/script/api/script_object.hpp
#	src/script/squirrel_helper.hpp
#	src/settings_table.cpp
#	src/station_cmd.cpp
#	src/table/settings.h.preamble
#	src/tree_cmd.cpp
#	src/tree_map.h
#	src/vehicle.cpp
#	src/waypoint_cmd.cpp
1 year ago
Jonathan G Rennison ff189e44e4 Public roads: Handle non-trivial existing foundations 1 year ago
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 2 years ago
2TallTyler d67259334a Fix #10218: Sloped river tiles need water both up and downstream 2 years 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