Commit Graph

2010 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 7d086ae686 Tracerestrict: Only apply wait at PBS for intermediary signals in forward direction 4 months ago
Jonathan G Rennison 5e29901d02 Tracerestrict: Allow nesting temporary slot states
Use a temporary state stack instead of passing the state directly
in TraceRestrictProgramInput

No longer exit early from ExtendTrainReservation to handle slots, this
fixes reservation failures when starting from a signal with a slot acquire

More thorough fix for 9e8a4314
4 months ago
Jonathan G Rennison 31d87f6101 Fix 9e8a4314: Start signal state erroneously changed if it has slot acquire 4 months ago
Jonathan G Rennison efab96b82b Set default service interval and timetable flags for virtual trains
See: #636
4 months ago
Jonathan G Rennison 5404be172c Merge branch 'master' into jgrpp
# Conflicts:
#	src/core/bitmath_func.cpp
#	src/core/bitmath_func.hpp
#	src/core/geometry_type.hpp
#	src/game/game_text.hpp
#	src/graph_gui.cpp
#	src/pathfinder/npf/npf.cpp
#	src/script/api/script_text.cpp
#	src/spritecache.cpp
#	src/track_func.h
4 months ago
Jonathan G Rennison 49eb40bc4f Change various _network_dedicated tests to use IsHeadless 4 months ago
Jonathan G Rennison 7d1e350b94 Tracerestrict: Handle slot acquire on tunnel/bridge entrance reserve
When using realistic braking
Using the same context as PBS end acquire/release
4 months ago
Jonathan G Rennison 9e8a43144a Tracerestrict: Handle slot acquire and wait at PBS on intermediary reservation signals
Wait at PBS is applied as if on the starting signal
4 months ago
Jonathan G Rennison 293b5c9435 Tracerestrict: Remove slot acquire on reservation flags 4 months ago
Jonathan G Rennison 5a731c04f3 Tracerestrict: Do not acquire slots a second time when front passes signal
If slot acquire was already handled during reservation
4 months ago
Jonathan G Rennison 5e2a8861f9 Tracerestrict: Avoid prematurely acquiring slots on tunnel/bridge exits
Due to checking the long reserve and wait at PBS/slots in a single pass
4 months ago
Rubidium 6b21368bc2 Codechange: replace FIND_FIRST_BIT/FindFirstBit2x64 with FindFirstBit 4 months ago
Jonathan G Rennison 091fb0da44 Fix crash which could occur when trying to extend invalidated reservation
When using realistic braking
5 months ago
Jonathan G Rennison 0df59defc4 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/release-linux.yml
#	.github/workflows/release.yml
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/script/api/script_rail.cpp
#	src/settings_gui.cpp
#	src/signal_type.h
#	src/video/sdl2_v.cpp
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
Jonathan G Rennison 97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
5 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 4fac6b295c Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/release-linux.yml
#	src/base_consist.h
#	src/blitter/32bpp_optimized.cpp
#	src/blitter/32bpp_optimized.hpp
#	src/blitter/32bpp_sse2.hpp
#	src/blitter/8bpp_optimized.hpp
#	src/gfx_func.h
#	src/industry_cmd.cpp
#	src/industrytype.h
#	src/linkgraph/linkgraphjob.cpp
#	src/mixer.cpp
#	src/newgrf_callbacks.h
#	src/openttd.cpp
#	src/os/macosx/macos.mm
#	src/os/windows/win32.cpp
#	src/pathfinder/npf/npf.cpp
#	src/road_cmd.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/sound.cpp
#	src/spritecache.cpp
#	src/spriteloader/spriteloader.hpp
#	src/station_map.h
#	src/timetable_cmd.cpp
#	src/timetable_cmd.h
#	src/timetable_gui.cpp
#	src/town_cmd.cpp
#	src/vehicle_cmd.cpp
#	src/vehicle_gui_base.h
#	src/video/opengl.cpp
#	src/video/opengl.h
#	src/viewport.cpp
6 months ago
Jonathan G Rennison e9612338ff Fix condition for extending train reverse distance due to overspeed 6 months ago
Peter Nelson ddd609ce9b
Feature: Randomize direction of rail vehicle on build based on probability callback. (#11489)
This allows NewGRF authors to indicate that the game should randomly flip rail vehicles on build, without needing to use random bits nor duplicate sprites to handle it themselves.

To use this functionality, test for callback 162 (CBID_VEHICLE_BUILD_PROBABILITY)  and var10 = 0 (values other than 0 are reserved for future use), and return a value between 0 and 100 inclusive.

The return value is a percentage chance of reversing the vehicle. A value of 0 will always build a forward facing vehicle, and 100 will always build a reverse facing vehicle.
6 months ago
Peter Nelson e6d132d24b
Fix #10926: New free wagons no longer split by type. (#11507)
NormalizeTrainVehInDepot() should only be called if an engine was built, not for wagons.
6 months ago
Peter Nelson 96d4538055 Fix #11437: Flipped shorter rail vehicles disappear in windows. (#11446)
Mixed signed/unsigned strikes again, causing an incorrect sprite offset for shortened vehicles.

(cherry picked from commit 43aa91a7f5)
6 months ago
Jonathan G Rennison 2a31095118 Merge branch 'master' into jgrpp
# Conflicts:
#	regression/regression/result.txt
#	src/aircraft_cmd.cpp
#	src/airport_gui.cpp
#	src/articulated_vehicles.cpp
#	src/console_cmds.cpp
#	src/date_gui.cpp
#	src/engine.cpp
#	src/genworld_gui.cpp
#	src/gfx_layout_fallback.cpp
#	src/group_gui.cpp
#	src/hotkeys.cpp
#	src/network/core/tcp_connect.cpp
#	src/network/core/tcp_listen.h
#	src/newgrf.cpp
#	src/newgrf.h
#	src/newgrf_engine.cpp
#	src/newgrf_gui.cpp
#	src/newgrf_station.cpp
#	src/openttd.cpp
#	src/order_gui.cpp
#	src/os/macosx/osx_main.cpp
#	src/pathfinder/yapf/yapf_node_rail.hpp
#	src/rail_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/cargopacket_sl.cpp
#	src/saveload/linkgraph_sl.cpp
#	src/saveload/station_sl.cpp
#	src/script/api/script_industrytype.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_table.cpp
#	src/settingsgen/settingsgen.cpp
#	src/station.cpp
#	src/station_cmd.cpp
#	src/strings.cpp
#	src/timer/timer_game_calendar.cpp
#	src/timer/timer_game_calendar.h
#	src/timer/timer_manager.h
#	src/timer/timer_window.cpp
#	src/timetable_cmd.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/train_gui.cpp
#	src/vehicle_cmd.h
#	src/vehicle_gui.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_func.h
#	src/window_gui.h
6 months ago
Jonathan G Rennison 38df621e62 Improve train speed adaptation with realistic braking
Take into account recorded speeds at signals along the reservation
As noted in the lookahead

See: #613
6 months ago
Jonathan G Rennison c9a205c707 Train speed adaptation: Move IsOutOfDate to be a method 6 months ago
Jonathan G Rennison c929f7075e Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/SourceList.cmake
#	src/build_vehicle_gui.cpp
#	src/company_gui.cpp
#	src/console_cmds.cpp
#	src/depot_base.h
#	src/elrail.cpp
#	src/network/core/udp.cpp
#	src/network/network_admin.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/newgrf.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_railtype.cpp
#	src/newgrf_railtype.h
#	src/newgrf_storage.h
#	src/os/unix/crashlog_unix.cpp
#	src/rail.h
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/road_cmd.cpp
#	src/road_map.h
#	src/saveload/labelmaps_sl.cpp
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/sl/oldloader_sl.cpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/table/settings/world_settings.ini
#	src/tests/test_script_admin.cpp
#	src/textfile_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_cmd.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/window.cpp
#	src/window_gui.h
#	src/window_type.h
7 months ago
Peter Nelson 43aa91a7f5
Fix #11437: Flipped shorter rail vehicles disappear in windows. (#11446)
Mixed signed/unsigned strikes again, causing an incorrect sprite offset for shortened vehicles.
7 months ago
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 7 months ago
Jonathan G Rennison 0620026d56 Tracerestrict: Add long reserve (unless stopping) mode
Requires realistic braking
8 months ago
Jonathan G Rennison 90192f9537 TBTR: Implement cost estimation for template replacement
Simplified operation, CMD_NO_TEST is still in use
8 months ago
Jonathan G Rennison ad3980e596 Add setting for whether non-leading train engines keep custom names 8 months ago
Jonathan G Rennison 3afb732c37 Fix #11307: Incorrect GroupStatistics after selling leading wagon
When this results in a countable consist
9 months ago
Jonathan G Rennison cd2a368d77 Fix #11307: Incorrect GroupStatistics after selling leading wagon
When this results in a countable consist
9 months ago
Jonathan G Rennison a18f3274b4 Rename close window functions to match upstream 9 months ago
PeterN acd7d3c913
Codechange: Rename *Railtype* to *RailType* for consistency. (#11287) 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 b0331c84b3 TBTR: Refactor handling of vehicle start/stop state 10 months ago
Jonathan G Rennison d7d9c05cbd TBTR: Fix various refit issues in refit as incoming vehicle mode
Allow refits to fail in refit as incoming vehicle mode
Remove virtual train mode from CmdRefitVehicle
Fix refit as incoming for non-head parts being free
10 months ago
Jonathan G Rennison 64df35067a TBTR: Handle setting unit direction separately from refits 10 months ago
Jonathan G Rennison 2cf95eea36 TBTR: Refactor train/template match function to return difference flags 10 months ago
Tyler Trahan b012d1100c Fix #10334: Store separate newgrf-safe version of date_of_last_service. (#11124)
This value is not changed when the date cheat is used, which caused issues with changing properties based on service date.

Co-authored-by: Peter Nelson <peter1138@openttd.org>
(cherry picked from commit 9a602ff304)
10 months ago
Tyler Trahan 9a602ff304
Fix #10334: Store separate newgrf-safe version of date_of_last_service. (#11124)
This value is not changed when the date cheat is used, which caused issues with changing properties based on service date.

Co-authored-by: Peter Nelson <peter1138@openttd.org>
10 months ago
Jonathan G Rennison 4f875012b6 Do not unnecessarily extend train reservations when passing signal
When the signal is a next-only or non-aspect-incrementing type, and
its maximum lookahead is not beyond the current end of the reservation
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
merni-ns e1cb4d2397 Fix #10975: Clear a non-head engine's name (#10976)
(cherry picked from commit 1be668c2e4)
12 months ago
merni-ns 1be668c2e4
Fix #10975: Clear a non-head engine's name (#10976) 12 months ago
Jonathan G Rennison 02549c5224 Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/cargomonitor.cpp
#	src/core/CMakeLists.txt
#	src/economy.cpp
#	src/landscape.cpp
#	src/linkgraph/flowmapper.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/linkgraphschedule.cpp
#	src/misc_gui.cpp
#	src/newgrf_generic.cpp
#	src/newgrf_storage.cpp
#	src/rail_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/station_sl.cpp
#	src/script/script_gui.cpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/string_func.h
#	src/terraform_cmd.cpp
12 months ago