Commit Graph

1624 Commits

Author SHA1 Message Date
Jonathan G Rennison
5b78090a61 Merge branch 'master' into jgrpp
# Conflicts:
#	CMakeLists.txt
#	src/saveload/town_sl.cpp
#	src/screenshot.h
#	src/script/api/ai/ai_date.hpp.sq
#	src/script/api/ai/ai_marine.hpp.sq
#	src/script/api/ai/ai_station.hpp.sq
#	src/script/api/game/game_date.hpp.sq
#	src/script/api/game/game_marine.hpp.sq
#	src/script/api/game/game_station.hpp.sq
#	src/script/api/game/game_window.hpp.sq
#	src/script/api/script_window.hpp
#	src/script/api/template/template_window.hpp.sq
#	src/signal.cpp
#	src/statusbar_gui.cpp
#	src/toolbar_gui.cpp
#	src/viewport.cpp
#	src/viewport_func.h
2020-08-27 18:31:09 +01:00
Jonathan G Rennison
810bfd276e Add several NewGRF variables to vehicle image callback whitelist
Add vehicle flags to control cached image invalidation

Various refactorings
2020-08-25 01:26:44 +01:00
TechGeekNZ
a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
Jonathan G Rennison
002e99ac34 Debug: Show tile info on separate lines in vehicle debug window 2020-07-09 17:40:00 +01:00
Jonathan G Rennison
1f5de8b82c Auto separation: Remove circular linked list, use new algorithm 2020-07-09 02:15:16 +01:00
Jonathan G Rennison
894fd6c609 Add separation state to DumpVehicleFlags 2020-07-07 18:22:06 +01:00
Jonathan G Rennison
09a1a7ce1a Auto-separation: Tidy up Vehicle::InitSeparation 2020-07-07 18:14:50 +01:00
Jonathan G Rennison
b520193831 Fix incorrect news parameters for vehicle too heavy advice message 2020-07-07 18:10:38 +01:00
Jonathan G Rennison
3adeff1883 Merge branch 'master' into jgrpp
# Conflicts:
#	CMakeLists.txt
#	cmake/CompileFlags.cmake
#	src/bridge_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/saveload/town_sl.cpp
#	src/screenshot.cpp
#	src/screenshot.h
#	src/toolbar_gui.cpp
#	src/town.h
#	src/town_cmd.cpp
2020-06-30 21:43:04 +01:00
Charles Pigott
218db00c4c Fix #8216: Don't show floating text on autoreplace if cost is 0 2020-06-28 00:00:28 +01:00
Michael Lutz
f2b40f40aa Codechange: Replace SmallPair with std::pair.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
2020-05-21 20:02:34 +02:00
Jonathan G Rennison
f077c3bf6e Merge branch 'master' into jgrpp 2020-04-06 20:58:54 +01:00
glx
b50d77b831 Fix #8064: Incorrect display of refit capacity 2020-04-06 16:21:30 +01:00
Jonathan G Rennison
f3145030b7 Fix false positive in ValidateVehicleTileHash 2020-03-09 09:22:51 +00:00
Jonathan G Rennison
cb6a01cab3 Fix cases where departures board data was not invalidated 2020-03-09 09:22:38 +00:00
Jonathan G Rennison
a4608f6f72 Cache vehicle positions across draw blocks in viewport map mode 2020-03-05 23:06:01 +00:00
Jonathan G Rennison
4108672cf6 Use separate tile hash for each vehicle type 2020-03-03 06:57:50 +00:00
Jonathan G Rennison
4020719227 Exclude effect and disaster vehicles from vehicle tile hash 2020-03-03 06:57:50 +00:00
Jonathan G Rennison
de2c2f7cea Fix 37adf9be: Fix last effect flag not being checked if front has no effect 2020-02-27 01:57:35 +00:00
Jonathan G Rennison
76f68c48f5 Cache whether vehicle is currently drawn: Vehicle::IsDrawn() 2020-02-03 18:58:19 +00:00
Jonathan G Rennison
9917a1daef Scheduled dispatch: Add hints about dispatch order to timetable window
Adjust condition for dispatch order
2020-01-29 00:25:09 +00:00
Jonathan G Rennison
c3fce9c09b Fix ff628813: Inverted test for if train refit state matches template 2020-01-18 21:49:36 +00:00
Jonathan G Rennison
7611e1229c Use 0 for per-cargo percent loaded value when capacity is 0 2020-01-18 20:48:41 +00:00
Jonathan G Rennison
09b13dd484 Add conditional orders for cargo load percentage and waiting cargo amount
See: #90
2020-01-18 20:32:42 +00:00
Jonathan G Rennison
ee6d808578 TBTR: Template replacements now also apply to child groups 2020-01-16 21:47:29 +00:00
Jonathan G Rennison
ff6288139e TBTR: Send train to depot when replacement due but servicing disabled
This is to match autoreplace
2020-01-16 21:10:56 +00:00
Jonathan G Rennison
424813446f TBTR: Avoid unnecessary iterations of template replacement pool 2020-01-16 01:16:08 +00:00
Jonathan G Rennison
7960db35f2 Merge branch 'master' into jgrpp
# Conflicts:
#	config.lib
#	projects/openttd_vs140.vcxproj
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs141.vcxproj
#	projects/openttd_vs141.vcxproj.filters
#	projects/openttd_vs142.vcxproj
#	projects/openttd_vs142.vcxproj.filters
#	src/aircraft_cmd.cpp
#	src/base_station_base.h
#	src/core/pool_type.hpp
#	src/disaster_vehicle.cpp
#	src/economy.cpp
#	src/engine.cpp
#	src/group.h
#	src/group_cmd.cpp
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/network/network_command.cpp
#	src/network/network_server.cpp
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/road_cmd.cpp
#	src/saveload/afterload.cpp
#	src/saveload/cargopacket_sl.cpp
#	src/saveload/linkgraph_sl.cpp
#	src/saveload/order_sl.cpp
#	src/saveload/station_sl.cpp
#	src/saveload/town_sl.cpp
#	src/saveload/vehicle_sl.cpp
#	src/screenshot.cpp
#	src/screenshot.h
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/station.cpp
#	src/station_cmd.cpp
#	src/table/settings.ini
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/train.h
#	src/train_cmd.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehiclelist.cpp
#	src/window_type.h
2020-01-06 18:45:51 +00:00
SamuXarick
9e7c5235e8 Fix #7891: Actually check the vehicle type before casting 2020-01-03 00:04:39 +00:00
glx
d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
glx
1f6b3a37f9 Codechange: Replace FOR_ALL_ENGINES with range-based for loops 2019-12-21 20:13:03 +01:00
glx
ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
Jonathan G Rennison
ec0b5e0ed0 Improve performance of departures window
See: #119
2019-12-17 22:47:16 +00:00
Jonathan G Rennison
aa8aae9a62 Initial implementation of tracerestrict speed restriction feature 2019-12-06 21:15:07 +00:00
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
2019-11-12 18:43:10 +00:00
S. D. Cloudt
13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Jonathan G Rennison
edfd378e93 Merge branch 'master' into jgrpp
# Conflicts:
#	source.list
#	src/blitter/32bpp_anim.cpp
#	src/linkgraph/linkgraphjob.cpp
#	src/order_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_type.h
2019-10-05 21:45:54 +01:00
Jonathan G Rennison
455e694e79 Refactor effect vehicle cache to reduce cost of inserts/removes 2019-10-05 12:28:23 +01:00
JMcKiern
04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Jonathan G Rennison
ba9d1a0390 Merge branch 'jgrpp' into jgrpp-nrt
# Conflicts:
#	.ottdrev-vc
#	README.md
#	jgrpp-changelog.md
2019-08-29 01:01:45 +01:00
Jonathan G Rennison
9a05ea67d5 Add chicken bits setting
2 bits so far
2019-08-28 19:10:34 +01:00
Jonathan G Rennison
7ed86e7488 Merge branch 'jgrpp' into jgrpp-nrt 2019-07-29 22:50:51 +01:00
Jonathan G Rennison
162fcb050e Only set TBTR replacement game event flag when replacement action occurs 2019-07-29 19:36:35 +01:00
Jonathan G Rennison
ba8ed880c1 Merge branch 'master' into jgrpp-nrt
Merge NRT feature

# Conflicts:
#	docs/landscape.html
#	docs/landscape_grid.html
#	src/bridge_map.h
#	src/build_vehicle_gui.cpp
#	src/company_base.h
#	src/company_cmd.cpp
#	src/misc_gui.cpp
#	src/newgrf.cpp
#	src/newgrf_engine.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/npf/npf.cpp
#	src/road_cmd.cpp
#	src/road_func.h
#	src/road_gui.cpp
#	src/road_map.h
#	src/road_type.h
#	src/roadveh_cmd.cpp
#	src/saveload/afterload.cpp
#	src/saveload/company_sl.cpp
#	src/script/api/script_bridge.cpp
#	src/table/newgrf_debug_data.h
#	src/tile_cmd.h
#	src/town_cmd.cpp
#	src/tunnel_map.h
#	src/tunnelbridge_cmd.cpp
2019-07-11 19:45:56 +01:00
Jonathan G Rennison
36eb4165b8 Merge branch 'master' into jgrpp
# Conflicts:
#	src/bridge_map.h
#	src/crashlog.cpp
#	src/industry.h
#	src/linkgraph/linkgraph_type.h
#	src/order_type.h
#	src/saveload/afterload.cpp
#	src/settings.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/spritecache.cpp
#	src/stdafx.h
#	src/table/settings.h.preamble
#	src/train.h
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/viewport_func.h
#	src/widgets/station_widget.h
#	src/zoom_func.h
#	src/zoom_type.h
2019-07-08 16:19:07 +01:00
Jonathan G Rennison
9b87610cd6 Check vehicle tile hash in CheckCaches 2019-05-27 15:58:30 +01:00
Jonathan G Rennison
31ad8bdd07 Do not add virtual vehicles to tile hash 2019-05-27 15:58:17 +01:00
Jonathan G Rennison
5b7d1f7f80 Add game event for TBTR replacement attempt 2019-05-19 18:38:02 +01:00
Jonathan G Rennison
49f6490c7d Fix potential non-determinism in vehicle autorenew/template replace/pay for repair/sell 2019-05-18 10:17:59 +01:00
Jonathan G Rennison
1e51d7af2f Add console command to dump vehicle stats 2019-05-16 18:58:50 +01:00
Jonathan G Rennison
10d0f79e83 Validate vehicle tick caches in CheckCaches 2019-05-02 19:20:47 +01:00
peter1138
c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Charles Pigott
5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Jonathan G Rennison
d47c083e00 Comment out some unused constants 2019-04-28 12:24:40 +01:00
Jonathan G Rennison
2a41d783cd Adjust vehicle position filter in ViewportMapDrawVehicles 2019-04-16 23:54:28 +01:00
Jonathan G Rennison
674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 2019-04-11 18:14:13 +01:00
Henry Wilson
7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Jonathan G Rennison
ba34ec7ade Merge branch 'master' into jgrpp
Replace build and refit, and group collapse implementations
Fix template creation build and refit

# Conflicts:
#	Makefile.bundle.in
#	config.lib
#	src/animated_tile.cpp
#	src/blitter/32bpp_anim.hpp
#	src/blitter/32bpp_base.hpp
#	src/blitter/8bpp_base.hpp
#	src/blitter/null.hpp
#	src/build_vehicle_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/console_gui.cpp
#	src/core/smallstack_type.hpp
#	src/date.cpp
#	src/debug.cpp
#	src/genworld_gui.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/lang/korean.txt
#	src/linkgraph/linkgraph_gui.h
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/core/game.h
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
#	src/network/core/udp.h
#	src/network/network_content.cpp
#	src/network/network_type.h
#	src/network/network_udp.cpp
#	src/newgrf_house.h
#	src/openttd.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/osk_gui.cpp
#	src/pathfinder/opf/opf_ship.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.h
#	src/station_base.h
#	src/station_cmd.cpp
#	src/table/gameopt_settings.ini
#	src/table/newgrf_debug_data.h
#	src/table/settings.ini
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehiclelist.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
2019-03-27 18:12:04 +00:00
Jonathan G Rennison
99b79c26c6 Remove disaster vehicles from tick cache immediately on deletion 2019-03-27 00:36:06 +00:00
Henry Wilson
cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson
ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson
297fd3dda3 Codechange: Replaced SmallVector::Include() with include() 2019-03-26 20:15:57 +00:00
Henry Wilson
a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson
f3938fdb83 Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit() 2019-03-26 20:15:57 +00:00
Henry Wilson
bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 2019-03-26 20:15:57 +00:00
stormcone
8acca3a72b Change: Do not display a newspaper about old vehicles for which replacement is activated. 2019-03-25 23:41:06 +01:00
Jonathan G Rennison
1c84d80333 Fix dumping of subtype for non ground vehicles in DumpVehicleFlags 2019-03-08 18:45:16 +00:00
Jonathan G Rennison
dd94c4d22d Skip Vehicle::UpdateViewport in network dedicated mode 2019-02-17 16:51:36 +00:00
Jonathan G Rennison
3b55f5d765 Cache whether ground vehicles currently have 0 slope resistance 2019-02-16 21:27:08 +00:00
Jonathan G Rennison
ac5b4b9454 De-virtualise call to EffectVehicle::Tick in CallVehicleTicks 2019-02-16 12:58:19 +00:00
Jonathan G Rennison
e28e2f638e Fix handling of effect vehicles in CallVehicleTicks
Move effect vehicles into separate cache vector
Call effect vehicle ticks before other vehicle types

See #76
2019-02-15 21:06:14 +00:00
Jonathan G Rennison
2fdcc52321 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	Makefile.src.in
#	findversion.sh
#	projects/determineversion.vbs
#	src/lang/dutch.txt
#	src/lang/korean.txt
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/rail.cpp
#	src/rail_cmd.cpp
#	src/saveload/afterload.cpp
#	src/ship_cmd.cpp
#	src/toolbar_gui.cpp
#	src/vehicle.cpp
2019-02-13 19:09:06 +00:00
PeterN
22f33fdd08
Fix 148e5b41d6: Uninitialized variable usage. (#7216) 2019-02-10 21:06:09 +00:00
Eddi-z
148e5b41d6 Change: Skip reliability decay if servicing is disabled 2019-02-10 18:45:48 +01:00
PeterN
d242875d27
Fix #7197: Invalidate depot buttons when necessary. (#7212) 2019-02-10 08:43:54 +00:00
Henry Wilson
d03cb80346 Fix: trains cancelling their pending reversal when ordered to go to a depot behind them
Previously, if a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is behind it, the train would continue forwards.
Also when a train had been ordered to reverse, and while it was slowing down, was
ordered to travel to a depot that is in front of it, the train would not cancel the
reversal.
In both cases the train would travel away from the target depot.

Trains in this situation now behave correctly and will travel towards the depot.
2019-02-08 23:23:41 +00:00
Peter Nelson
e3b440c9c5 Add #5006: Flag to hide rail type from construction. 2019-02-06 07:40:55 +00:00
Jonathan G Rennison
2142452305 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	Makefile.src.in
#	findversion.sh
#	projects/determineversion.vbs
#	src/gamelog.cpp
#	src/gamelog_internal.h
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/network/core/config.h
#	src/network/network.cpp
#	src/network/network_udp.cpp
#	src/rev.h
#	src/saveload/afterload.cpp
#	src/saveload/company_sl.cpp
#	src/saveload/depot_sl.cpp
#	src/saveload/gamelog_sl.cpp
#	src/saveload/misc_sl.cpp
#	src/saveload/order_sl.cpp
#	src/saveload/saveload.cpp
#	src/saveload/station_sl.cpp
#	src/saveload/town_sl.cpp
#	src/saveload/vehicle_sl.cpp
#	src/table/settings.ini
#	src/viewport.cpp
2019-02-04 18:32:44 +00:00
Peter Nelson
e8f1c446a6 Fix: DMU/EMU livery should apply to passenger carriages with DMU/EMU engines. 2019-02-02 16:57:47 +00:00
Jonathan G Rennison
ddf31702a2 Merge branch 'master' into jgrpp
# Conflicts:
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/saveload/saveload.cpp
#	src/widgets/group_widget.h
2019-01-31 18:19:45 +00:00
PeterN
23960d0f2c Feature: Group liveries, and livery window usability enhancements. (#7108)
* Change: Replace checkbox in livery selection window with Default option in drop down selection.

This reduces clutter in the UI and allows for primary/secondary colours to independently follow the default scheme if desired.

* Feature: Add vehicle group liveries.
2019-01-31 14:57:44 +01:00
Jonathan G Rennison
98aa58a6b4 Log position tile where it differs from vehicle tile in DumpVehicleFlags 2019-01-31 01:44:08 +00:00
Jonathan G Rennison
8105b5582e Add track to train DumpVehicleFlags 2019-01-30 22:46:34 +00:00
Jonathan G Rennison
37adf9be4a Cache the last vehicle in a consist to have a visual effect 2019-01-26 11:36:04 +00:00
Jonathan G Rennison
e5b61e0b6c Refactor CallVehicleTicks vehicle loop 2019-01-25 20:17:15 +00:00
Jonathan G Rennison
191afd93c1 Merge branch 'save_ext' into jgrpp
# Conflicts:
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/settings.cpp
#	src/station_cmd.cpp
#	src/table/settings.ini
#	src/vehicle_base.h
#	src/widgets/dropdown.cpp
2019-01-21 19:28:29 +00:00
Peter Nelson
81330b8d6e Change: Add path cache for ships. 2019-01-19 23:11:17 +00:00
Jonathan G Rennison
f4180e8714 Check vehicle sound setting before motion/tick counts in CallVehicleTicks 2019-01-19 19:07:15 +00:00
Jonathan G Rennison
d87ac8ec7e Improve performance of train breakdown detection 2019-01-19 04:39:16 +00:00
Jonathan G Rennison
841ea7639f De-virtualise most common calls to Vehicle::Tick 2019-01-19 04:29:52 +00:00
nikolas
d8ccad91f9 Fix: Some code and comment typos
Found with codespell
2019-01-17 22:01:07 +00:00
Jonathan G Rennison
d78db1c004 Dump tile data in Vehicle::DumpVehicleFlags 2018-12-21 03:28:17 +00:00
Jonathan G Rennison
65b9a103ad Initial implementation of two rail types per tile 2018-12-21 03:27:58 +00:00
Jonathan G Rennison
e735c1a51a Merge branch 'master' into jgrpp
# Conflicts:
#	src/aircraft_cmd.cpp
#	src/autoreplace_cmd.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.cpp
#	src/script/api/ai/ai_station.hpp.sq
#	src/script/api/game/game_station.hpp.sq
#	src/script/api/script_station.hpp
#	src/track_func.h
#	src/vehicle_base.h
2018-11-05 12:53:36 +00:00
Charles Pigott
f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
Jonathan G Rennison
a96428ed13 Fix timetabling of through-load orders 2018-10-30 02:39:11 +00:00
Jonathan G Rennison
0e3986c39c Extend timetable wait/travel times from 16 to 32 bits wide 2018-10-22 19:12:38 +01:00
Jonathan G Rennison
f59535c0b7 Merge branch 'tracerestrict-sx' into jgrpp
# Conflicts:
#	src/train_cmd.cpp
2018-08-16 05:45:30 +01:00
Jonathan G Rennison
60cc1a48ac Refresh trace restrict slots window as with the train list window 2018-08-15 19:38:56 +01:00
Jonathan G Rennison
1c41cff322 Add GV flags and reversing distance to DumpVehicleFlags 2018-08-15 03:43:57 +01:00