From 1ba000be12130d0f955feaba05f0ac65c1519115 Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 30 Aug 2009 17:54:11 +0000 Subject: (svn r17327) -Codechange: Allow external use of GetEngineCategoryName(). --- src/engine.cpp | 3 +-- src/engine_gui.cpp | 4 ++++ src/engine_gui.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine.cpp b/src/engine.cpp index a77d1c313..392f3a587 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -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; diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 0ecd94d15..9c41e38ad 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -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) { diff --git a/src/engine_gui.h b/src/engine_gui.h index 937215183..fb0b6e878 100644 --- a/src/engine_gui.h +++ b/src/engine_gui.h @@ -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 */ -- cgit v1.2.3-54-g00ecf