summaryrefslogtreecommitdiff
path: root/src/gfxinit.cpp
diff options
context:
space:
mode:
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;
}