(svn r17327) -Codechange: Allow external use of GetEngineCategoryName().

This commit is contained in:
alberth 2009-08-30 17:54:11 +00:00
parent db120540a0
commit 1ba000be12
3 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@
#include "vehicle_func.h"
#include "settings_type.h"
#include "core/pool_func.hpp"
#include "engine_gui.h"
#include "table/strings.h"
#include "table/engines.h"
@ -614,8 +615,6 @@ CommandCost CmdWantEnginePreview(TileIndex tile, DoCommandFlag flags, uint32 p1,
return CommandCost();
}
StringID GetEngineCategoryName(EngineID engine);
static void NewVehicleAvailable(Engine *e)
{
Vehicle *v;

View File

@ -27,6 +27,10 @@
#include "table/strings.h"
#include "table/sprites.h"
/** Return the category of an engine.
* @param engine Engine to examine.
* @return String describing the category ("road veh", "train". "airplane", or "ship") of the engine.
*/
StringID GetEngineCategoryName(EngineID engine)
{
switch (Engine::Get(engine)->type) {

View File

@ -20,6 +20,7 @@ typedef int CDECL EngList_SortTypeFunction(const void*, const void*); ///< argum
void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare); ///< qsort of the engine list
void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items); ///< qsort of specified portion of the engine list
StringID GetEngineCategoryName(EngineID engine);
void DrawVehicleEngine(int x, int y, EngineID engine, SpriteID pal);
#endif /* ENGINE_GUI_H */