2005-07-24 15:12:37 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-04-19 14:05:05 +01:00
|
|
|
/** @file engine_func.h */
|
2007-02-23 18:55:07 +00:00
|
|
|
|
2004-08-09 18:04:08 +01:00
|
|
|
#ifndef ENGINE_H
|
|
|
|
#define ENGINE_H
|
|
|
|
|
2008-03-28 18:00:38 +00:00
|
|
|
#include "engine_type.h"
|
2006-01-12 15:52:18 +00:00
|
|
|
|
2008-01-08 18:25:51 +00:00
|
|
|
void SetupEngines();
|
2007-03-07 11:47:46 +00:00
|
|
|
void StartupEngines();
|
2004-08-09 18:04:08 +01:00
|
|
|
|
2008-04-29 22:31:29 +01:00
|
|
|
Engine *GetTempDataEngine(EngineID index);
|
|
|
|
void CopyTempEngineData();
|
|
|
|
|
|
|
|
/* Original engine data counts and offsets */
|
|
|
|
extern const uint8 _engine_counts[4];
|
|
|
|
extern const uint8 _engine_offsets[4];
|
2004-08-09 18:04:08 +01:00
|
|
|
|
2007-01-14 19:57:49 +00:00
|
|
|
void DrawTrainEngine(int x, int y, EngineID engine, SpriteID pal);
|
|
|
|
void DrawRoadVehEngine(int x, int y, EngineID engine, SpriteID pal);
|
|
|
|
void DrawShipEngine(int x, int y, EngineID engine, SpriteID pal);
|
|
|
|
void DrawAircraftEngine(int x, int y, EngineID engine, SpriteID pal);
|
2004-08-09 18:04:08 +01:00
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
void LoadCustomEngineNames();
|
|
|
|
void DeleteCustomEngineNames();
|
2004-08-09 18:04:08 +01:00
|
|
|
|
2008-02-04 11:28:12 +00:00
|
|
|
bool IsEngineBuildable(EngineID engine, VehicleType type, PlayerID player);
|
2007-04-20 17:56:55 +01:00
|
|
|
CargoID GetEngineCargoType(EngineID engine);
|
2004-08-09 18:04:08 +01:00
|
|
|
|
2006-11-30 16:03:12 +00:00
|
|
|
/* 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
|
|
|
|
|
2005-09-18 21:56:44 +01:00
|
|
|
#endif /* ENGINE_H */
|