Commit Graph

853 Commits (0ea57528c9e23e43be252f44b789ecd856e0d5c7)

Author SHA1 Message Date
Jonathan G Rennison 0ea57528c9 Rename DateTicksScaled to StateTicks
Rename various other related/derived types and variables
4 months ago
Jonathan G Rennison 9bea1e3cc3 Scheduled dispatch: Allow tagging departure slots, add to conditional order 5 months ago
Jonathan G Rennison 6c329871f1 Scheduled dispatch: Add per dispatch slot flags field
Add flag for slot re-use
5 months ago
Jonathan G Rennison 7db457ad80 Use _scaled_date_ticks in ODATFB_NEAREST_DEPOT rate-limiting 5 months ago
Jonathan G Rennison 9be3dfa69c Scheduled dispatch: Use an invalid value for no last dispatch, not 0 5 months ago
Jonathan G Rennison 5b7689a0aa Scheduled dispatch: Add flag to re-use all dispatch slots 5 months ago
Jonathan G Rennison 461fe116f2 Tracerestrict: Pass vehicle ptr instead of index to Occupy/Vacate
And related functions, to avoid unnecessary vehicle pool lookup
5 months ago
Jonathan G Rennison 041f36d565 Add try to acquire slot order subtype 5 months ago
Jonathan G Rennison 2fc631b15b Rename OT_RELEASE_SLOT to OT_SLOT, use a subtype field 5 months ago
Jonathan G Rennison 3050620189 Merge branch 'master' into jgrpp
# Conflicts:
#	src/autoreplace_cmd.cpp
#	src/build_vehicle_gui.cpp
#	src/cargotype.cpp
#	src/economy.cpp
#	src/engine_gui.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/linkgraph/refresh.cpp
#	src/linkgraph/refresh.h
#	src/newgrf.cpp
#	src/newgrf_airporttiles.h
#	src/newgrf_roadstop.cpp
#	src/newgrf_station.cpp
#	src/newgrf_station.h
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_func.h
#	src/order_gui.cpp
#	src/pathfinder/pathfinder_type.h
#	src/saveload/afterload.cpp
#	src/subsidy_base.h
#	src/vehicle_cmd.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
5 months ago
Loïc Guilloux 251008663b Fix #11748: Incorrect clamping of negative service interval values (#11749)
(cherry picked from commit f7bd70baec)
5 months ago
Loïc Guilloux f7bd70baec
Fix #11748: Incorrect clamping of negative service interval values (#11749) 5 months ago
Peter Nelson 400ae65ff2 Codechange: Redefine some cargo-related values in terms of CargoID instead of CargoType.
Values used as special filter types are now defined as offsets from NUM_CARGO instead of confusingly reusing CARGO_NO_REFIT/CARGO_AUTO_REFIT types.
5 months ago
Jonathan G Rennison 97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
5 months ago
Jonathan G Rennison 107b73c2b8 Merge branch 'master' into jgrpp 5 months ago
SamuXarick 847f3f660d
Fix #10511: Delay 'go to nearest depot' orders (#11548)
Delay the nearest depot order search for a day if the vehicle can't find its destination, which happens when it has already attempted to do so and failed to find a valid destination.
5 months ago
Jonathan G Rennison ea85bbda97 Fix duplicate order not always preserving colour 5 months ago
Jonathan G Rennison 9ea49d6680 Only compile OrderList::DebugCheckSanity when WITH_ASSERT defined 6 months ago
Jonathan G Rennison 03e0ec8276 Strong typedef: Use strong typedefs for date, date tick, minutes types
Add delta types
Adjust/add type conversion functions
Add various utility methods on types
Remove the various minute macros
Fix some minute conversion inconsistencies
6 months ago
Jonathan G Rennison e9599fd4be Scheduled dispatch: Remove scheduled_dispatch_start_full_date_fract
Use DateTicksScaled
6 months ago
Jonathan G Rennison 88670a230f Merge branch 'master' into jgrpp
# Conflicts:
#	src/articulated_vehicles.cpp
#	src/articulated_vehicles.h
#	src/base_media_base.h
#	src/base_media_func.h
#	src/build_vehicle_gui.cpp
#	src/dock_gui.cpp
#	src/main_gui.cpp
#	src/music_gui.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_content.cpp
#	src/newgrf.cpp
#	src/newgrf_roadstop.cpp
#	src/os/windows/string_uniscribe.h
#	src/os/windows/win32.cpp
#	src/rail_gui.cpp
#	src/road.cpp
#	src/road_gui.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.cpp
#	src/strings.cpp
#	src/terraform_gui.cpp
#	src/tests/test_script_admin.cpp
#	src/tests/test_window_desc.cpp
#	src/timer/timer_game_calendar.h
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/viewport.cpp
#	src/widget_type.h
#	src/window.cpp
#	src/window_gui.h
7 months ago
Jonathan G Rennison fc1c47cbd2 Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/crashlog.cpp
#	src/crashlog.h
#	src/date_type.h
#	src/depot_type.h
#	src/landscape.cpp
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/macosx/crashlog_osx.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/pathfinder/npf/npf.cpp
#	src/road_cmd.cpp
#	src/script/api/script_infrastructure.cpp
#	src/stdafx.h
#	src/table/settings/gui_settings.ini
#	src/table/settings/pathfinding_settings.ini
#	src/tests/CMakeLists.txt
7 months ago
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
Peter Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
7 months ago
Jonathan G Rennison 1e7f31b807 Fix conditional order wait loops not ignoring label orders 9 months ago
Jonathan G Rennison 9ad2f44ab7 Fix conditional order subtype not being reset when changing to time/date 9 months ago
Jonathan G Rennison a18f3274b4 Rename close window functions to match upstream 9 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 9 months ago
Tyler Trahan fca2b37726 Codechange: Move Ticks into their own class 9 months ago
Jonathan G Rennison 02aecca5ae Conditional order: Replace "next station" with manually set station 10 months ago
Jonathan G Rennison 691e2dcc69 Fix cargo waiting amount via station not being cleared when station deleted 10 months ago
Jonathan G Rennison c11be37fd9 Add xdata2 field to OrderExtraInfo 10 months ago
Jonathan G Rennison 19835b51ee Move StationCargoList and FlowStatMap out of GoodsEntry struct
Move them into a new GoodsEntryData struct referenced
using a std::unique_ptr from GoodsEntry.
The unique_ptr may be nullptr if the cargo list and flow stat map
are both empty (this is the case for unused cargoes).

This reduces GoodsEntry from 128 to 24 bytes,
and Station from 8680 to 2024 bytes,
(on Linux x86_64).
10 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 10 months ago
Patric Stout b7acf9e50e
Codechange: use TimerGameCalendar::Year and friends when working with years (#11188) 10 months ago
Tyler Trahan c7b51a8c3a
Codechange: Use proper date types in various places (#11177) 10 months ago
Tyler Trahan 6190f48df0
Codechange: Add a DateToYear function instead of dividing each time (#11173) 10 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
Jonathan G Rennison ead18b2af2 Merge branch 'master' into jgrpp
# Conflicts:
#	CMakeLists.txt
#	src/3rdparty/md5/md5.h
#	src/3rdparty/squirrel/squirrel/squtils.h
#	src/animated_tile.cpp
#	src/console_func.h
#	src/core/CMakeLists.txt
#	src/core/container_func.hpp
#	src/core/smallstack_type.hpp
#	src/crashlog.cpp
#	src/crashlog.h
#	src/debug.h
#	src/economy.cpp
#	src/gamelog.cpp
#	src/industry_gui.cpp
#	src/lang/catalan.txt
#	src/misc_gui.cpp
#	src/network/network_content.h
#	src/newgrf.cpp
#	src/newgrf.h
#	src/newgrf_config.cpp
#	src/newgrf_config.h
#	src/newgrf_gui.cpp
#	src/os/unix/font_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/rail_cmd.cpp
#	src/saveload/animated_tile_sl.cpp
#	src/script/api/script_tilelist.cpp
#	src/settings.cpp
#	src/settingsgen/settingsgen.cpp
#	src/sl/oldloader_sl.cpp
#	src/station.cpp
#	src/station_cmd.cpp
#	src/stdafx.h
#	src/strgen/strgen.cpp
#	src/strgen/strgen_base.cpp
#	src/table/settings/gui_settings.ini
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_cmd.cpp
#	src/vehicle_gui_base.h
#	src/viewport_sprite_sorter.h
12 months ago
Jonathan G Rennison 28a764f319 Fix order backup not copying dispatch schedules when not enabled
See: #559
12 months ago
Jonathan G Rennison 3cbd1a5a76 Add conditional order test for whether slot is empty/not empty 1 year ago
Jonathan G Rennison 6d483cc5cc Add toggle to show vehicle route overlay even when window is not focused 1 year ago
Jonathan G Rennison b089b561a5 Add departure board via order subtype to remove via for prior terminus 1 year ago
Jonathan G Rennison 359fe89d2f Don't use occupancy of unload and leave empty orders for occupancy average 1 year ago
Jonathan G Rennison 06e0f39aff Add text label and departure board via orders 1 year ago
Jonathan G Rennison 3b6f7c09ad Allow changing colour of orders in order list and timetable windows 1 year ago
Jonathan G Rennison 0370f2e3f1 Check that order is station type when comparing with last_station_visited 1 year ago
Jonathan G Rennison e3e743ba1e Skip over dummy/invalid orders in destination prediction and auto-separation 1 year ago
Jonathan G Rennison c9e62ca29b Only handle each conditional branch once in OrderList::GetNextStoppingStation 1 year ago
Jonathan G Rennison cbd71b3d58 Merge branch 'master' into jgrpp
# Conflicts:
#	src/order_cmd.cpp
1 year ago