Commit Graph

51 Commits

Author SHA1 Message Date
Peter Nelson cf96d49ced
Codechange: Use vector for airport tile layouts. (#12607)
Simplify AirportSpec data by storing layout information together in a vector, instead of separate arrays.

This removes manual memory management and separate count members.

The default layouts will be copied instead of always referring to the originals.
2024-05-02 11:37:54 +00:00
Rubidium 8986fb0385 Codechange: replace C-style array-pointer methods with the appropriate C++ methods 2024-04-20 11:30:46 +02:00
Peter Nelson 774f811217
Codechange: Use std::optional for town parent scope resolver. (#12530)
When resolving NewGRF, the parent town_scope is lazily initialised as it does not always need to be used.

Replace the manually managed pointer with std::optional to simplify. Using std::optional avoids extra memory allocation.
2024-04-18 22:14:16 +01:00
Peter Nelson 668186ca5b
Codechange: Remove macros involved with NewGRFClass. (#12363)
Use direct class instantiation instead.
2024-03-23 21:55:50 +00:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
Peter Nelson 49dae08a3b Codechange: Add missing override specifiers. 2023-09-25 21:27:45 +01:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Michael Lutz 1c620b349f Feature: [NewGRF] Related Act2 objects for airports and airport tiles.
Airports are similar two stations and industries, both of which have the town as related object.
Airport tiles are similar to industry tiles, which have the industry as related object.
This seems a sensible structure, so let's make it Airport Tile -> Airport -> Town.
2023-09-10 19:38:18 +02:00
Michael Lutz a6f2f3c042 Add: [NewGRF] Inspection window for airports.
As as the station window combines all station types, accessing the
debug view is via the parent of the airport tile only.
2023-09-10 19:38:18 +02:00
Tyler Trahan 701a61c9af Codechange: Delete date_type.h 2023-09-10 08:40:25 -04:00
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
2023-07-19 19:30:14 +02:00
Tyler Trahan 930f0a16d8 Codechange: Define Date/Year/Month/Day within TimerGameCalendar class 2023-04-26 07:14:03 -04:00
Rubidium b35c791d05 Codechange: use smart pointers when cloning iterators 2023-01-13 21:09:40 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
PeterN e1069eee05
Codechange: Check airport layout would fit within map bounds before iterating tiles. (#7429) 2019-03-30 22:20:26 +00:00
adf88 6dec889306 (svn r27908) -Codechange: Mark airport tile tables and FTAs "const" to be sure that they are really constant 2017-08-31 06:55:38 +00:00
rubidium 13855f0a09 (svn r25705) -Fix: a number of typos (inspired by 90c920601c84975acb694f3673e2beb08b013753) 2013-08-09 18:43:44 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
rubidium e40eb8177a (svn r23735) -Codechange: remove ~50 includes from headers that weren't needed 2012-01-03 20:26:05 +00:00
alberth 4af8c2d5e1 (svn r23704) -Doc: Doxygen comment fixes and additions. 2012-01-01 17:22:32 +00:00
rubidium 9b192efc58 (svn r23654) -Fix [FS#4904]: missing this-> (adf88) 2011-12-21 17:15:56 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
yexo 16eb11e988 (svn r23462) -Codechange: use AirportTileTableIterator in a few more places to make the code easier to read 2011-12-09 19:53:42 +00:00
yexo c9be5d50da (svn r23461) -Fix: handle a missing airport newgrf as graceful as possible by not crashing when loading such savegame or when an airport is removed 2011-12-09 19:30:30 +00:00
michi_cc d3b7b89493 (svn r23415) -Feature: Infrastructure maintenance costs. 2011-12-03 23:40:46 +00:00
alberth bc6d4069fe (svn r22741) -Add: Add exit direction of hangars to airport specifications. 2011-08-13 12:43:05 +00:00
rubidium 4d5dbf5170 (svn r22410) -Document: some more bits ;) 2011-05-02 16:14:23 +00:00
rubidium 30f2afac9b (svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to some headers 2010-08-26 22:01:16 +00:00
rubidium ef50a89ca5 (svn r20407) -Codechange: make AirportClass use the new generic class 2010-08-07 22:08:20 +00:00
rubidium 2d3ee123af (svn r20402) -Codechange: rename the airport/station class id to something slightly more generic 2010-08-07 21:10:57 +00:00
rubidium af9d8824bd (svn r20398) -Codechange: move some variables of GRFFileProps into (the new) GRFFilePropsBase 2010-08-07 20:51:07 +00:00
yexo 5bacbba9f2 (svn r20371) -Codechange: add general function to call text callbacks for airports 2010-08-05 12:04:33 +00:00
yexo 3e6f8165d4 (svn r20369) -Feature: preview sprites for airports 2010-08-05 12:03:34 +00:00
yexo d2f9b87ccd (svn r20366) -Codechange: store the rotation of the airport layout in the station struct and use it to rotate hangar tiles 2010-08-05 12:00:09 +00:00
yexo 689d4bef04 (svn r20331) -Doc: some more airport-related code 2010-08-02 23:09:38 +00:00
smatz 53aaabe6e9 (svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET 2010-03-23 22:25:43 +00:00
yexo 1579e9ded2 (svn r19465) -Codechange: support for multi-tile hangars 2010-03-19 11:17:52 +00:00
yexo 38f4cb6469 (svn r19457) -Codechange: introduce AirportOverrideManager to keep track of airports if a newgrf can't be found 2010-03-18 23:12:38 +00:00
yexo f7691a95d7 (svn r19354) -Codechange: store the number of layouts in AirportSpec 2010-03-06 16:02:07 +00:00
yexo 20e05f878c (svn r19353) -Codechange: use static objects for the airport statemachines instead of new/delete at the start/end of the game
-Codechange: store the fta in AirportSpec
2010-03-06 15:38:13 +00:00
yexo 46d5ef925b (svn r19330) -Cleanup: remove the now unused 'oilrig' from AirportSpec 2010-03-06 00:38:21 +00:00
yexo b8d7680e66 (svn r19328) -Feature: a more extendable gui for building airports 2010-03-05 23:21:56 +00:00
yexo 585b036c90 (svn r19327) -Codechange: make the oilrig a part of the original airports array so some special cases can be removed 2010-03-05 23:21:51 +00:00
yexo c42e2a9bfc (svn r19326) -Codechange: store the airport name as property in AirportSpec 2010-03-05 23:21:41 +00:00
yexo a71462bb94 (svn r19325) -Codechange: introduce airport classes and split the default airports in 4 classes 2010-03-05 23:21:35 +00:00
yexo d03d990f33 (svn r19324) -Codechange: introduce AirportSpec::GetWithoutOverride to get a non-const pointer to a given airportspec 2010-03-05 23:21:30 +00:00
yexo 664934e6f6 (svn r19323) -Codechange: copy the AirportSpec original array to an internal array in AirportSpec 2010-03-05 23:21:23 +00:00
frosch 4559dfe7e7 (svn r19303) -Codechange: Silence a gcc warning. 2010-03-02 20:31:05 +00:00
yexo 3cda09170c (svn r19299) -Codechange: store the most compatible ttd airport type in AirportSpec
-Fix: [NewGRF] return the ttd airport type in station var 0xF1
2010-03-01 20:17:21 +00:00