Commit Graph

62 Commits

Author SHA1 Message Date
Peter Nelson 9008d793ab
Change: Use per-company group numbers. (#12297)
This is used by the default group name, replacing the use of group index.
2024-05-07 19:01:28 +00:00
Peter Nelson 8797cc7ef2
Codechange: Replace GroupStatistics' num_engines with std::map. (#11849)
This removes manual memory management with calloc/free calls, and prevents potentially large arrays being allocated for each group.
2024-01-21 14:09:44 +00:00
Rubidium 3a676a5af0 Codechange: replace static inline with static for non-class functions 2024-01-06 13:37:33 +01:00
Peter Nelson bfb4254226 Fix: Changing default livery did not propagate to group liveries.
#11614 attempted to address this but did not handle 2CC properly, and changes to the default livery were not handled.
2023-12-28 23:16:19 +00:00
Peter Nelson 7d4a91ef9e
Cleanup: Remove some unused functions. (#11429)
These were picked up with cppcheck.
2023-11-03 21:21:00 +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
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
SamuXarick b2a5ebcfc4
Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
* Change: Store "all time" and "since minimum age" last year profits on groups

* Fix: Update last year profit for groups when copying vehicle statistics on autoreplace

* Codechange: Refactor profit last year

* Change: Rename some group related items for clarity

* Change: Reorder the fields in GroupStatistics

That way less memory gets wasted.
2023-01-22 08:14:02 -05:00
Michael Lutz 57b82e2e99 Codechange: Don't use globals for story/goal/sign/group command proc return values. 2021-12-16 22:28:32 +01:00
peter1138 a05bc04b63 Feature: Per-group wagon removal flag. 2021-04-22 22:57:00 +02:00
peter1138 c56fce70b4 Codechange: Replace CMD_SET_GROUP_REPLACE_PROTECTION with generic CMD_SET_GROUP_FLAG. 2021-04-22 22:57:00 +02:00
peter1138 27a956ba62 Codechange: Replace Group::replace_protection with Group::flags 2021-04-22 22:57:00 +02:00
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 2020-05-21 20:02:34 +02:00
glx 4ae829cb27 Codechange: Replace FOR_ALL_GROUPS with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Charles Pigott 69a6c494bf Codechange: Set VehicleType's base type to byte instead of using VehicleTypeByte 2019-04-29 17:40:22 +01:00
Charles Pigott 49f7332b75 Feature #6053: Collapsible vehicle groups (3298) 2019-03-27 06:58:48 +00:00
Charles Pigott 8890436af1 Add #6189: Groups now count the total number of vehicles in subgroups (3298) 2019-03-27 06:58:48 +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
peter1138 567d0ff3a7 (svn r26450) -Feature: Hierarchical vehicle subgroups. 2014-04-08 21:09:06 +00:00
yexo b490d5ceab (svn r24541) -Cleanup [FS#5260]: remove unused function GetGroupArraySize (juanjo) 2012-09-21 20:31:42 +00:00
frosch d071eefc54 (svn r22985) -Feature: Display autoreplace status in group GUI. 2011-10-03 17:26:37 +00:00
frosch 23a2f23eb3 (svn r22984) -Feature: Display profit icons for groups in the group GUI. 2011-10-03 17:25:44 +00:00
frosch dd74536bef (svn r22981) -Add: GroupStatistics for the ALL_GROUP. 2011-10-03 17:23:41 +00:00
frosch fafa06e821 (svn r22979) -Codechange: Add GroupStatistics::CountEngine(). 2011-10-03 17:22:09 +00:00
frosch 68f969282e (svn r22978) -Codechange: Replace IncreaseGroupNumVehicle() and DecreaseGroupNumVehicle() with GroupStatistics::CountVehicle(). 2011-10-03 17:21:41 +00:00
frosch b78a459613 (svn r22977) -Codechange: Rename SetCachedEngineCounts() to GroupStatistics::UpdateAfterLoad(). 2011-10-03 17:20:56 +00:00
frosch b6766c2ed5 (svn r22976) -Codechange: Split group statistics into separate struct. 2011-10-03 17:20:26 +00:00
alberth 990ec6f0a9 (svn r22460) -Doc: Semantic documentation fixes, and doxygen additions (partly by planetmaker). 2011-05-14 18:38:54 +00:00
smatz 756cc6cf65 (svn r22116) -Codechange: use PoolBase::Clean() at more places 2011-02-19 23:05:47 +00:00
rubidium 7efd7e19ed (svn r21845) -Codechange: move documentation towards the code to make it more likely to be updates [d-m]. 2011-01-18 22:31:06 +00:00
rubidium e8ddf001c8 (svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos 2009-09-19 09:51:14 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
smatz adc5363202 (svn r16717) -Codechange: make IsFrontEngine() member of Train 2009-07-01 22:22:01 +00:00
smatz 56a7b70591 (svn r16380) -Codechange: rename pool.hpp to pool_type.hpp 2009-05-22 15:39:22 +00:00
smatz 62a7948af0 (svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved 2009-05-22 15:13:50 +00:00
smatz 04723b240e (svn r16377) -Codechange: unify FOR_ALL_* macros, use separate index variable instead of var->index 2009-05-22 14:23:36 +00:00
smatz 6afce484bb (svn r16373) -Codechange: use () instead of (void) for functions without parameters 2009-05-21 22:43:25 +00:00
smatz 8808f3beea (svn r16352) -Codechange: use PoolItem::GetIfValid() instead of PoolItem::IsValidID() and PoolItem::Get() 2009-05-18 16:21:28 +00:00
smatz 871107f529 (svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index) 2009-05-17 01:00:56 +00:00
smatz ed1e54bd84 (svn r16326) -Codechange: replace GetPoolItemPoolSize() by PoolItem::GetPoolSize() 2009-05-16 23:44:36 +00:00
smatz 6221d74644 (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) 2009-05-16 23:34:14 +00:00
truebrain a3dd7506d3 (svn r15027) -Merge: tomatos and bananas left to be, here is NoAI for all to see.
NoAI is an API (a framework) to build your own AIs in. See:
   http://wiki.openttd.org/wiki/index.php/AI:Main_Page
 With many thanks to:
  - glx and Rubidium for their syncing, feedback and hard work
  - Yexo for his feedback, patches, and AIs which tested the system very deep
  - Morloth for his feedback and patches
  - TJIP for hosting a challenge which kept NoAI on track
  - All AI authors for testing our AI API, and all other people who helped in one way or another
-Remove: all old AIs and their cheats/hacks
2009-01-12 17:11:45 +00:00
rubidium b650a86e58 (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames. 2008-09-30 20:51:04 +00:00
rubidium 3b798599b6 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with. 2008-09-30 20:39:50 +00:00
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 2008-05-06 15:11:33 +00:00
peter1138 a00371c8db (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist. 2008-04-29 21:31:29 +00:00
rubidium ef2be7d0fc (svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h. 2008-03-31 00:17:39 +00:00
rubidium 878489e38d (svn r12469) -Codechange: split type related stuff from group.h (and openttd.h) to group_type.h. 2008-03-28 16:34:50 +00:00