Commit Graph

58729 Commits

Author SHA1 Message Date
Jonathan G Rennison
4326cde313 Viewport: Fix use after free caused by AddChildSpriteToFoundation
Use indices instead of pointers for last child sprite ID store

See: https://github.com/OpenTTD/OpenTTD/issues/12914
2024-08-23 18:37:42 +01:00
Jonathan G Rennison
3994f329e3 Use hash table index for NewGRFClass::GetByGrf 2024-08-23 18:37:42 +01:00
Jonathan G Rennison
5f94f1e27e Avoid unnecessary tile slope check in GetTileTrackStatus_Water 2024-08-23 16:04:54 +01:00
Jonathan G Rennison
fead409888 Ring buffer: Make construct_from internal method private 2024-08-23 15:10:56 +01:00
Jonathan G Rennison
b3689e2cc0 Fix station catchment increase with new picker window 2024-08-22 22:36:54 +01:00
Patric Stout
4f58a0f3c5 Fix #12818: during Hostile Takeover, profit was calculated wrongly (#12819)
(cherry picked from commit 21813fbe8b)
2024-08-22 21:09:40 +01:00
Jonathan G Rennison
436178cbd4 Scheduled dispatch: Highlight vehicle dispatch slot in slots panel
Add info line in tooltip
2024-08-22 19:05:42 +01:00
Jonathan G Rennison
c40ba9782c Add more information to getfulldate console command 2024-08-22 17:37:52 +01:00
Jonathan G Rennison
397a30bffc Change INITIAL_STATE_TICKS_VALUE to be an integer multiple of useful values 2024-08-22 16:37:07 +01:00
Jonathan G Rennison
fd66e9d8cc Codefix: Move saveload of road stop tile data (#12883)
So that road stop tile data is also saved/loaded for road waypoints

(cherry picked from commit 39465d7f5c)

# Conflicts:
#	src/saveload/saveload.h
2024-08-22 16:15:27 +01:00
Jonathan G Rennison
12c38fff52 Add support for SLV_COMPANY_INAUGURATED_PERIOD (no changes) 2024-08-22 16:13:20 +01:00
Jonathan G Rennison
45f86a2ac3 Add support for upstream road waypoints savegame version 2024-08-22 15:57:43 +01:00
Joan Josep
6bb52b86eb Fix: typo in picker mode tooltip. (#12834)
(cherry picked from commit e7982e8082)
2024-08-22 15:41:01 +01:00
Peter Nelson
a6a72c68d1 Fix: Crash if interface scale or font size changes with chat box present. (#12705)
Caused by the chat box being undrawn with the new dimensions, leading to out-of-bounding memory access.

(cherry picked from commit 7e12b5ff0f)
2024-08-22 15:38:43 +01:00
Peter Nelson
06b84f7c00 Fix: Unable to choose a font containing hyphen. (#12684)
FcNameParse may require some characters be escaped. Instead, pass name as FC_FAMILY.

(cherry picked from commit ca52da6c95)
2024-08-22 15:38:15 +01:00
Jonathan G Rennison
c5f49ba0e8 Increase width of picker window class column 2024-08-22 15:27:13 +01:00
Jonathan G Rennison
1133ce2432 Fix: Picker window 'used' filter for rail waypoints
The first two field of struct PickerItem were not populated.
These are required for set operations.

StationUsesDefaultType always returned false for rail waypoints.
2024-08-22 15:17:45 +01:00
Jonathan G Rennison
f72d8d0b48 Extend station bridge above flags for more than 8 station gfx values 2024-08-22 14:55:02 +01:00
Peter Nelson
84c6a917d8 Add: [NewGRF] Extended custom waypoint classes. (#12653)
This allows waypoints to be split into categories just like stations, instead of all being lumped together.

Station class labels with the first byte set to 0xFF will be treated in the same way as the 'WAYP' class.

(cherry picked from commit 2c70ccb137)
2024-08-22 14:21:21 +01:00
Peter Nelson
fe14fe6d3c Codechange: Store custom station layouts in a map instead of nested vectors. (#12898)
The map key is the platforms and length combined. This simplifies allocation and searching for layouts.

(cherry picked from commit ff972ec4ff)

# Conflicts:
#	src/newgrf.cpp
#	src/newgrf_station.h
2024-08-22 14:21:21 +01:00
Peter Nelson
839ec6f1e8 Add: [NewGRF] Station property 1E, extended station tile flags.
Properties 11, 14 and 15 to set pylons/nowires/blocked intrinsically only support 8 station tiles.

Add new property to define all three flags for each station tile layout.

(cherry picked from commit a03ddb3ccb)

# Conflicts:
#	src/newgrf.cpp
#	src/newgrf_station.h
#	src/station_cmd.cpp
2024-08-22 14:21:21 +01:00
Peter Nelson
c709976703 Feature: [NewGRF] Allow fixed layout up to 256 tiles per NewGRF rail station.
Allow using up to 256 tile layouts in property 0E or callback 24, which defines the layout to be saved into the map.

This was originally limited to 8, because station graphics above 8 referred to other station types but that was changed in 2007.

1) More efficient than using callback 14, as that needs to be checked every time a station tile is rendered.
2) The layout does not get changed when the station is changed (this may or may not be desirable!)

Using more than 256 layouts still requires callback 14.

(cherry picked from commit 6e553410d3)
2024-08-22 14:10:47 +01:00
Peter Nelson
c001ee507e Codechange: Rename CBID_STATION_SPRITE_LAYOUT and CBID_STATION_TILE_LAYOUT.
These callbacks both select rail station tile layouts, the difference is one happens when drawing, the other happens when building. Change the names to make this clearer.

(cherry picked from commit 70a2ed062d)

# Conflicts:
#	src/newgrf_station.cpp
#	src/station_cmd.cpp
2024-08-22 14:10:47 +01:00
Peter Nelson
6b5e4108a9 Codefix: Find GRF override entries properly. (#12743)
My naive code from 16 years ago tested for GRF overrides in a way that will create empty 0 entries for each source GRF tested.

(cherry picked from commit 579ce8eae0)
2024-08-22 14:10:47 +01:00
Peter Nelson
1e55fd4667 Change: [NewGRF] Treat house max year 0xFFFF as MAX_YEAR. (#12740)
(cherry picked from commit 96fc367bcf)
2024-08-22 14:10:47 +01:00
Jonathan G Rennison
1154fff48a Fix a2b63635: Scheduled dispatch info panel was one line too short 2024-08-22 12:54:31 +01:00
Jonathan G Rennison
e6afaed4fc Scheduled dispatch: Show slots for different clock hours on separate lines
See: #722
2024-08-22 12:48:20 +01:00
Jonathan G Rennison
f75f9f11de Merge branch 'master' into jgrpp
# Conflicts:
#	src/CMakeLists.txt
#	src/network/network_server.cpp
#	src/newgrf.cpp
#	src/newgrf_class.h
#	src/newgrf_class_func.h
#	src/newgrf_object.h
#	src/object_gui.cpp
#	src/openttd.cpp
#	src/pathfinder/aystar.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/saveload/station_sl.cpp
#	src/script/api/script_rail.cpp
#	src/settings.cpp
#	src/table/object_land.h
#	src/widgets/CMakeLists.txt
2024-08-22 11:48:13 +01:00
Jonathan G Rennison
5ad010b06f Timer: Add equivalent timer interface for upstream TimerGameCalendar 2024-08-22 01:00:58 +01:00
Jonathan G Rennison
c7904e23f0 Timer: Add upstream TimerWindow 2024-08-22 01:00:58 +01:00
Jonathan G Rennison
a56efeb609 Timer: Add utility to ensure safe iteration of timers 2024-08-21 22:57:54 +01:00
Jonathan G Rennison
5eae56fd23 Lang: Reformat lang files, remove unused string 2024-08-21 22:57:54 +01:00
Jonathan G Rennison
c21d6607dd Hotkeys: Use std::vector, remove HOTKEY_LIST_END sentinel 2024-08-21 22:35:54 +01:00
Jonathan G Rennison
44dffb0e81 cpp-btree: Add contains method to match STL 2024-08-21 22:21:47 +01:00
Jonathan G Rennison
e060e9b83d Fix: DepotWindow::GetVehicleFromDepotWndPt not refreshing vehicle list 2024-08-21 16:57:30 +01:00
Jeremy Gao
4fb677bdfe
Update: Simplified Chinese translations (#721) 2024-08-21 12:00:06 +01:00
Jonathan G Rennison
5fe5519a66 Lang: Remove unused extra string 2024-08-20 23:46:45 +01:00
Jonathan G Rennison
f76204475b Merge PR #729 into jgrpp 2024-08-20 23:46:20 +01:00
Qwest8K
5aca3bd4ab Update russian.txt 2024-08-20 04:13:32 +03:00
Jonathan G Rennison
6b8a37d0e9 Remove unused headers from road.cpp 2024-08-19 21:52:29 +01:00
Jonathan G Rennison
e760a4eff6 Tracerestrict: Use spans for drop down list sets in GUI 2024-08-17 22:49:11 +01:00
Jonathan G Rennison
591fe96a71 Saveload: Support upstream wider station type field size version 2024-08-17 22:01:29 +01:00
Jonathan G Rennison
782840a62b Remove leftover debug prints 2024-08-17 18:03:10 +01:00
Jonathan G Rennison
16dfb84978 Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.h
#	src/console_gui.cpp
#	src/music.cpp
#	src/pathfinder/npf/npf.cpp
#	src/roadveh_cmd.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/script/api/script_types.hpp
#	src/settings_gui.cpp
#	src/settings_table.cpp
#	src/settings_type.h
#	src/ship_cmd.cpp
#	src/strings.cpp
#	src/table/settings/pathfinding_settings.ini
#	src/train_cmd.cpp
#	src/vehicle_type.h
#	src/waypoint_gui.cpp
2024-08-17 17:49:19 +01:00
Jonathan G Rennison
e2510b4627 Merge branch 'master' into jgrpp
Company password removal/pubkey access: mostly skipped

# Conflicts:
#	src/company_cmd.h
#	src/network/core/tcp_game.h
#	src/network/network_server.cpp
#	src/saveload/saveload.h
2024-08-17 15:31:57 +01:00
Jonathan G Rennison
7dd8729a33 Merge branch 'master' into jgrpp
# Conflicts:
#	src/cachecheck.cpp
#	src/network/network.cpp
#	src/openttd.cpp
#	src/pathfinder/follow_track.hpp
#	src/saveload/saveload.cpp
#	src/textfile_gui.cpp
2024-08-17 15:31:57 +01:00
Jonathan G Rennison
1406b36fde Set default hotkey for picker tool to / (SLASH) 2024-08-14 00:59:03 +01:00
Jonathan G Rennison
5b36c1db11 Merge branch 'master' into jgrpp
# Conflicts:
#	src/bridge_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/core/geometry_func.hpp
#	src/disaster_vehicle.cpp
#	src/dropdown.cpp
#	src/dropdown_func.h
#	src/engine_gui.h
#	src/genworld_gui.cpp
#	src/industry_cmd.cpp
#	src/industrytype.h
#	src/network/network_content.cpp
#	src/newgrf.cpp
#	src/newgrf_airport.h
#	src/newgrf_engine.cpp
#	src/order_gui.cpp
#	src/pathfinder/water_regions.cpp
#	src/saveload/town_sl.cpp
#	src/slider_func.h
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/table/airport_defaults.h
#	src/tilematrix_type.hpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/video/sdl_v.cpp
2024-08-13 20:34:12 +01:00
Jonathan G Rennison
fbfb752b1c Simplify texts and GUI behaviour for cargo scaling mode settings 2024-08-13 01:43:35 +01:00
Jonathan G Rennison
4c3072e719 Departures: Fix manual memory management, avoid leaks 2024-08-13 01:39:26 +01:00