(svn r15389) -Feature: Add ability to select which base graphics set is used from the Game Options window. The change takes effect when the window is closed. This option can only be used from the intro menu, as reloading graphics during a game may cause issues.

This commit is contained in:
peter1138
2009-02-07 01:01:02 +00:00
parent 1a14688926
commit 43a8400647
4 changed files with 88 additions and 2 deletions

View File

@@ -569,3 +569,43 @@ bool HasGraphicsSet(const ContentInfo *ci, bool md5sum)
}
#endif /* ENABLE_NETWORK */
/**
* Count the number of available graphics sets.
*/
int GetNumGraphicsSets()
{
int n = 0;
for (const GraphicsSet *g = _available_graphics_sets; g != NULL; g = g->next) {
if (g->found_grfs <= 1) continue;
n++;
}
return n;
}
/**
* Get the index of the currently active graphics set
*/
int GetIndexOfCurrentGraphicsSet()
{
int n = 0;
for (const GraphicsSet *g = _available_graphics_sets; g != NULL; g = g->next) {
if (g->found_grfs <= 1) continue;
if (g == _used_graphics_set) return n;
n++;
}
return -1;
}
/**
* 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->found_grfs <= 1) continue;
if (index == 0) return g->name;
index--;
}
error("GetGraphicsSetName: index %d out of range", index);
}