Commit Graph

22 Commits

Author SHA1 Message Date
Peter Nelson cdc356e7bf Change: Unify station/waypoint/roadstop/object build-picker window code.
These windows now share a common code base for choosing and display class and types.

An additional text filter is added to search types by name instead of just classes.
2024-05-11 02:12:41 +01:00
Peter Nelson d5671030b1 Codechange: Add NewGRFSpecsBase class to hold class/index information.
Standardises how the class index is stored in the spec, instead of relying ot the Spec structs having the same members.

This allows retrieving class_index and index without searching or using pointer arithmetic.

'cls_id' is renamed to 'class_index' to make it clearer that it is an index rather than the multichar label of the class.
2024-05-11 02:12:41 +01:00
Peter Nelson 052f421327 Change: Use vector/iterators/algorithms instead of C-array/loops for NewGRF classes. 2024-04-09 21:46:59 +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
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
Peter Nelson 912eb68981 Change: Extend entity override manager and station spec lists to support 16 bit IDs. 2023-05-05 07:08:40 +01:00
Rubidium 7088f5b7c7 Codechange: use string/fmt instead of printf for grfmsg 2023-04-18 23:21:08 +02:00
Peter Nelson 02961fd7af Codechange: Use std::vector for NewGRF class lists. 2023-04-02 22:42:38 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
frosch 00af887048 (svn r24170) -Add: Methods for translating between NewGRFClass spec indices and user interface indices. 2012-04-22 16:28:32 +00:00
frosch 34969178db (svn r24169) -Add: Make NewGRFClass distinguish between defined specs and specs visible for the user. 2012-04-22 16:28:27 +00:00
frosch c841a78f69 (svn r24167) -Codechange: Rename NewGRFClass::GetCount() to NewGRFClass::GetClassCount() 2012-04-22 16:28:19 +00:00
frosch 0f0e7e43cf (svn r24166) -Codechange: Turn NewGRFClass::Get(Tid, uint) and GetCount(Tid) into non-static members GetSpec(uint) and GetSpecCount(). 2012-04-22 16:28:14 +00:00
frosch cb43494488 (svn r24165) -Codechange: Split parts of static NewGRFClass::Assign() into non-static Insert(). 2012-04-22 16:28:09 +00:00
frosch 48c44a8d21 (svn r24164) -Codechange: Split parts of static NewGRFClass::Reset() into non-static ResetClass(). 2012-04-22 16:28:04 +00:00
frosch 6f4d2160c2 (svn r24162) -Codechange: Remove NewGRFClass::GetName() and SetName() in favour of using Get() and direct member access (which is needed anyway for GRF string resolving). 2012-04-22 16:27:55 +00:00
frosch 73d926c8d4 (svn r24161) -Add: Method to get a specific NewGRFClass. 2012-04-22 16:27:49 +00:00
rubidium 4d5dbf5170 (svn r22410) -Document: some more bits ;) 2011-05-02 16:14:23 +00:00
rubidium eb299736c1 (svn r21886) -Codechange: move documentation towards the code to make it more likely to be updated [n]. 2011-01-22 09:53:15 +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 cb4ab6a231 (svn r20405) -Add: generic class for "classes" for NewGRFs, e.g. the Station classes and Airport classes 2010-08-07 22:05:58 +00:00