(svn r16342) -Feature(tte): Display base graphics description in game options window.

This commit is contained in:
frosch
2009-05-17 18:21:21 +00:00
parent e56cc911f1
commit 5507a5b233
4 changed files with 67 additions and 16 deletions

View File

@@ -599,15 +599,39 @@ int GetIndexOfCurrentGraphicsSet()
return -1;
}
/**
* Get the graphics set at the specified 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;
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)
{
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;
index--;
}
error("GetGraphicsSetName: index %d out of range", 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;
}