diff options
author | KUDr <kudr@openttd.org> | 2006-11-30 16:03:12 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-11-30 16:03:12 +0000 |
commit | 1235172cc7392325a0f14c2e5d9ab08fadf9fb8c (patch) | |
tree | d0b937c0d86acf0c61f997be2286c510c5fbf5d4 /engine.h | |
parent | 3e6f89ca7e76c078af713b41cfdece5470b9983c (diff) | |
download | openttd-1235172cc7392325a0f14c2e5d9ab08fadf9fb8c.tar.xz |
(svn r7299) -CodeChange: Train and Aircraft Build window GUI code simplified a bit:
- using one engine list instead of 3
- removed engine filters (loco, wagons, helicopters, etc.)
- EngineList code isolated from GUI (moved to helpers.cpp - reusing CBlobT code which does exactly what is needed for EngineList)
- removed unnecessary "optimization" (rebuild and sort engine list on each WE_PAINT)
Diffstat (limited to 'engine.h')
-rw-r--r-- | engine.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -293,4 +293,15 @@ int32 AddEngineReplacement(EngineRenewList* erl, EngineID old_engine, EngineID n */ int32 RemoveEngineReplacement(EngineRenewList* erl, EngineID engine, uint32 flags); +/* Engine list manipulators - current implementation is only C wrapper of CBlobT<EngineID> class (helpers.cpp) */ +void EngList_Create(EngineList *el); ///< Creates engine list +void EngList_Destroy(EngineList *el); ///< Deallocate and destroy engine list +uint EngList_Count(const EngineList *el); ///< Returns number of items in the engine list +void EngList_Add(EngineList *el, EngineID eid); ///< Append one item at the end of engine list +EngineID* EngList_Items(EngineList *el); ///< Returns engine list items as C array +void EngList_RemoveAll(EngineList *el); ///< Removes all items from engine list +typedef int CDECL EngList_SortTypeFunction(const void*, const void*); ///< argument type for EngList_Sort() +void EngList_Sort(EngineList *el, EngList_SortTypeFunction compare); ///< qsort of the engine list +void EngList_SortPartial(EngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items); ///< qsort of specified portion of the engine list + #endif /* ENGINE_H */ |