2005-07-24 15:12:37 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
2008-05-06 16:11:33 +01:00
|
|
|
/** @file engine_func.h Functions related to engines. */
|
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
|
|
|
typedef int CDECL EngList_SortTypeFunction(const void*, const void*); ///< argument type for EngList_Sort()
|
2008-05-07 19:31:29 +01:00
|
|
|
void EngList_Sort(EngineList *el, EngList_SortTypeFunction compare); ///< qsort of the engine list
|
2006-11-30 16:03:12 +00:00
|
|
|
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 */
|