Commit Graph

1639 Commits (2f8e63e9548f8624d5dd333759bac82f66343010)

Author SHA1 Message Date
Matt Kimber 5728f9c7d0 Codechange: consider vehicle co-ordinates when identifying viewport candidate as using only the hash generates false positives 3 years ago
Matt Kimber 9b28b15e67 Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods 3 years ago
Matt Kimber eeb88e87d8 Codechange: improve performance for complex vehicle chains by resolving sprites less often 3 years ago
Jonathan G Rennison 204f8e173f Fix sprite bound issues for vehicles which vary bounds with curvature
If a vehicle uses curvature vars 0x45 or 0x62, cache the directions
of its 4 nearest neighbours, and check them in UpdateViewport along
with the vehicle's own direction.
4 years ago
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 4 years ago
Jonathan G Rennison 78b06ddc40 TBTR: Fix palette recolouring of templates
Fix group overrides affecting template image when cloning vehicle
Update template when changing company colours

Update template images on demand instead of at load
4 years ago
Jonathan G Rennison 99b2698658 Update vehicle image on demand when image is continuously updated by GRF
This is for trains/RVs only (to avoid issues with variable sprite bounds)

This largely fixes the performance issues of continuously updating
vehicle images
4 years ago
Jonathan G Rennison 75eeac8ff9 Fix crash when skipping suppressed unreached implicit orders on load 4 years ago
Jonathan G Rennison cce6d731a1 TBTR: Delete orphaned virtual trains on client disconnection 4 years ago
Jonathan G Rennison e684135e4a Add fast path to ViewportMapDrawVehicles horizontal hash bit check 4 years ago
Jonathan G Rennison bd2649c19e Avoid unnecessary redrawing of vehicle list windows
Redraw info section every tick if values have changed
4 years ago
Jonathan G Rennison a474e71243 Viewport: Cache landscape pixels in map mode
Avoid invalidating landscape pixels for non-landscape updates
(vehicles, overlays, etc.)
4 years ago
Jonathan G Rennison 352b361e1b Viewport: Replace viewport mark dirty if zoom level below with flags param
Fix missing flags for tracerestrict and effect vehicles
4 years ago
Galigator 933d02dce2 Change: Service depot also reset breakdown chance. 4 years ago
Jonathan G Rennison ff12051ee1 Only show ship is lost messages if lost for a significant time 4 years ago
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
4 years ago
Jonathan G Rennison 810bfd276e Add several NewGRF variables to vehicle image callback whitelist
Add vehicle flags to control cached image invalidation

Various refactorings
4 years ago
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
4 years ago
Jonathan G Rennison 002e99ac34 Debug: Show tile info on separate lines in vehicle debug window 4 years ago
Jonathan G Rennison 1f5de8b82c Auto separation: Remove circular linked list, use new algorithm 4 years ago
Jonathan G Rennison 894fd6c609 Add separation state to DumpVehicleFlags 4 years ago
Jonathan G Rennison 09a1a7ce1a Auto-separation: Tidy up Vehicle::InitSeparation 4 years ago
Jonathan G Rennison b520193831 Fix incorrect news parameters for vehicle too heavy advice message 4 years ago
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
4 years ago
Charles Pigott 218db00c4c Fix #8216: Don't show floating text on autoreplace if cost is 0 4 years ago
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.
4 years ago
Jonathan G Rennison f077c3bf6e Merge branch 'master' into jgrpp 4 years ago
glx b50d77b831 Fix #8064: Incorrect display of refit capacity 4 years ago
Jonathan G Rennison f3145030b7 Fix false positive in ValidateVehicleTileHash 4 years ago
Jonathan G Rennison cb6a01cab3 Fix cases where departures board data was not invalidated 4 years ago
Jonathan G Rennison a4608f6f72 Cache vehicle positions across draw blocks in viewport map mode 4 years ago
Jonathan G Rennison 4108672cf6 Use separate tile hash for each vehicle type 4 years ago
Jonathan G Rennison 4020719227 Exclude effect and disaster vehicles from vehicle tile hash 4 years ago
Jonathan G Rennison de2c2f7cea Fix 37adf9be: Fix last effect flag not being checked if front has no effect 4 years ago
Jonathan G Rennison 76f68c48f5 Cache whether vehicle is currently drawn: Vehicle::IsDrawn() 4 years ago
Jonathan G Rennison 9917a1daef Scheduled dispatch: Add hints about dispatch order to timetable window
Adjust condition for dispatch order
4 years ago
Jonathan G Rennison c3fce9c09b Fix ff628813: Inverted test for if train refit state matches template 4 years ago
Jonathan G Rennison 7611e1229c Use 0 for per-cargo percent loaded value when capacity is 0 4 years ago
Jonathan G Rennison 09b13dd484 Add conditional orders for cargo load percentage and waiting cargo amount
See: #90
4 years ago
Jonathan G Rennison ee6d808578 TBTR: Template replacements now also apply to child groups 4 years ago
Jonathan G Rennison ff6288139e TBTR: Send train to depot when replacement due but servicing disabled
This is to match autoreplace
4 years ago
Jonathan G Rennison 424813446f TBTR: Avoid unnecessary iterations of template replacement pool 4 years ago
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
5 years ago
SamuXarick 9e7c5235e8 Fix #7891: Actually check the vehicle type before casting 5 years ago
glx d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 5 years ago
glx 1f6b3a37f9 Codechange: Replace FOR_ALL_ENGINES with range-based for loops 5 years ago
glx ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 5 years ago
Jonathan G Rennison ec0b5e0ed0 Improve performance of departures window
See: #119
5 years ago
Jonathan G Rennison aa8aae9a62 Initial implementation of tracerestrict speed restriction feature 5 years ago
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
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
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
5 years ago
Jonathan G Rennison 455e694e79 Refactor effect vehicle cache to reduce cost of inserts/removes 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
Jonathan G Rennison ba9d1a0390 Merge branch 'jgrpp' into jgrpp-nrt
# Conflicts:
#	.ottdrev-vc
#	README.md
#	jgrpp-changelog.md
5 years ago
Jonathan G Rennison 9a05ea67d5 Add chicken bits setting
2 bits so far
5 years ago
Jonathan G Rennison 7ed86e7488 Merge branch 'jgrpp' into jgrpp-nrt 5 years ago
Jonathan G Rennison 162fcb050e Only set TBTR replacement game event flag when replacement action occurs 5 years ago
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
5 years ago
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
5 years ago
Jonathan G Rennison 9b87610cd6 Check vehicle tile hash in CheckCaches 5 years ago
Jonathan G Rennison 31ad8bdd07 Do not add virtual vehicles to tile hash 5 years ago
Jonathan G Rennison 5b7d1f7f80 Add game event for TBTR replacement attempt 5 years ago
Jonathan G Rennison 49f6490c7d Fix potential non-determinism in vehicle autorenew/template replace/pay for repair/sell 5 years ago
Jonathan G Rennison 1e51d7af2f Add console command to dump vehicle stats 5 years ago
Jonathan G Rennison 10d0f79e83 Validate vehicle tick caches in CheckCaches 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 5 years ago
Jonathan G Rennison d47c083e00 Comment out some unused constants 5 years ago
Jonathan G Rennison 2a41d783cd Adjust vehicle position filter in ViewportMapDrawVehicles 5 years ago
Jonathan G Rennison 674732cd68 Merge: Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
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
5 years ago
Jonathan G Rennison 99b79c26c6 Remove disaster vehicles from tick cache immediately on deletion 5 years ago
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson 297fd3dda3 Codechange: Replaced SmallVector::Include() with include() 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson f3938fdb83 Codechange: Replaced SmallVector::Reset() with std::vector::clear() + shrink_to_fit() 5 years ago
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 5 years ago
stormcone 8acca3a72b Change: Do not display a newspaper about old vehicles for which replacement is activated. 5 years ago
Jonathan G Rennison 1c84d80333 Fix dumping of subtype for non ground vehicles in DumpVehicleFlags 5 years ago
Jonathan G Rennison dd94c4d22d Skip Vehicle::UpdateViewport in network dedicated mode 5 years ago
Jonathan G Rennison 3b55f5d765 Cache whether ground vehicles currently have 0 slope resistance 5 years ago
Jonathan G Rennison ac5b4b9454 De-virtualise call to EffectVehicle::Tick in CallVehicleTicks 5 years ago
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
5 years ago
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
5 years ago
PeterN 22f33fdd08
Fix 148e5b41d6: Uninitialized variable usage. (#7216) 5 years ago
Eddi-z 148e5b41d6 Change: Skip reliability decay if servicing is disabled 5 years ago
PeterN d242875d27
Fix #7197: Invalidate depot buttons when necessary. (#7212) 5 years ago
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.
5 years ago
Peter Nelson e3b440c9c5 Add #5006: Flag to hide rail type from construction. 5 years ago
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
5 years ago
Peter Nelson e8f1c446a6 Fix: DMU/EMU livery should apply to passenger carriages with DMU/EMU engines. 5 years ago
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
5 years ago
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.
5 years ago
Jonathan G Rennison 98aa58a6b4 Log position tile where it differs from vehicle tile in DumpVehicleFlags 5 years ago
Jonathan G Rennison 8105b5582e Add track to train DumpVehicleFlags 5 years ago
Jonathan G Rennison 37adf9be4a Cache the last vehicle in a consist to have a visual effect 5 years ago
Jonathan G Rennison e5b61e0b6c Refactor CallVehicleTicks vehicle loop 5 years ago