summaryrefslogtreecommitdiff
path: root/src/gfxinit.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-05-17 18:21:21 +0000
committerfrosch <frosch@openttd.org>2009-05-17 18:21:21 +0000
commit5507a5b23341e3f79c4764431f3797e1d326c0ef (patch)
tree449359c5c724b4905781248fb4c2e31c2437b79c /src/gfxinit.cpp
parente56cc911f13153f174ed2636d80c33e236ed4492 (diff)
downloadopenttd-5507a5b23341e3f79c4764431f3797e1d326c0ef.tar.xz
(svn r16342) -Feature(tte): Display base graphics description in game options window.
Diffstat (limited to 'src/gfxinit.cpp')
-rw-r--r--src/gfxinit.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index d63d2429f..9619b4e87 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -600,14 +600,38 @@ int GetIndexOfCurrentGraphicsSet()
}
/**
- * Get the name of the graphics set at the specified index
+ * Get the graphics set at the specified index
*/
-const char *GetGraphicsSetName(int index)
+static const GraphicsSet *GetGraphicsSetAtIndex(int index)
{
for (const GraphicsSet *g = _available_graphics_sets; g != NULL; g = g->next) {
if (g != _used_graphics_set && g->found_grfs <= 1) continue;
- if (index == 0) return g->name;
+ if (index == 0) return g;
index--;
}
- error("GetGraphicsSetName: index %d out of range", index);
+ error("GetGraphicsSetAtIndex: index %d out of range", index);
+}
+
+/**
+ * Get the name of the graphics set at the specified index
+ */
+const char *GetGraphicsSetName(int index)
+{
+ return GetGraphicsSetAtIndex(index)->name;
+}
+
+/**
+ * Get the description of the graphics set at the specified index
+ */
+const char *GetGraphicsSetDescription(int index)
+{
+ return GetGraphicsSetAtIndex(index)->description;
+}
+
+/**
+ * Get the number of missing/corrupted files of the graphics set at the specified index
+ */
+int GetGraphicsSetNumMissingFiles(int index)
+{
+ return MAX_GFT - GetGraphicsSetAtIndex(index)->found_grfs;
}