summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-08-30 17:54:11 +0000
committeralberth <alberth@openttd.org>2009-08-30 17:54:11 +0000
commit1ba000be12130d0f955feaba05f0ac65c1519115 (patch)
tree649000ae80cf774b103b2565d40afdf0ca3867a3 /src
parentdb120540a0db62530d61c4e9ebd1e8a6984d13a5 (diff)
downloadopenttd-1ba000be12130d0f955feaba05f0ac65c1519115.tar.xz
(svn r17327) -Codechange: Allow external use of GetEngineCategoryName().
Diffstat (limited to 'src')
-rw-r--r--src/engine.cpp3
-rw-r--r--src/engine_gui.cpp4
-rw-r--r--src/engine_gui.h1
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 */