diff options
author | Max Horn | 2012-02-29 11:43:21 +0100 |
---|---|---|
committer | Max Horn | 2012-02-29 11:43:21 +0100 |
commit | 92d219715f1fc8b3535cfce370084bd56596c2ef (patch) | |
tree | a3d4a2eae9fee032aaf0f441f7796c1a64ffa454 /common | |
parent | 657206bc5b840006ea9f98767ade937f9fc0fab0 (diff) | |
download | scummvm-rg350-92d219715f1fc8b3535cfce370084bd56596c2ef.tar.gz scummvm-rg350-92d219715f1fc8b3535cfce370084bd56596c2ef.tar.bz2 scummvm-rg350-92d219715f1fc8b3535cfce370084bd56596c2ef.zip |
COMMON: Replace OptionsDialog::renderType2GUIO by API in rendermode.h
Diffstat (limited to 'common')
-rw-r--r-- | common/rendermode.cpp | 41 | ||||
-rw-r--r-- | common/rendermode.h | 6 |
2 files changed, 47 insertions, 0 deletions
diff --git a/common/rendermode.cpp b/common/rendermode.cpp index 62b67faee5..1ca67c1878 100644 --- a/common/rendermode.cpp +++ b/common/rendermode.cpp @@ -22,6 +22,7 @@ #include "common/rendermode.h" +#include "common/gui_options.h" #include "common/str.h" #include "common/translation.h" @@ -43,6 +44,26 @@ const RenderModeDescription g_renderModes[] = { {0, 0, kRenderDefault} }; +struct RenderGUIOMapping { + RenderMode id; + const char *guio; +}; + +// TODO: Merge s_renderGUIOMapping into g_renderModes? the kRenderDefault +// could be used to indicate "any" mode when passed to renderMode2GUIO (if +// we wanted to merge allRenderModesGUIOs back into) +static const RenderGUIOMapping s_renderGUIOMapping[] = { + { kRenderHercG, GUIO_RENDERHERCGREEN }, + { kRenderHercA, GUIO_RENDERHERCAMBER }, + { kRenderCGA, GUIO_RENDERCGA }, + { kRenderEGA, GUIO_RENDEREGA }, + { kRenderVGA, GUIO_RENDERVGA }, + { kRenderAmiga, GUIO_RENDERAMIGA }, + { kRenderFMTowns, GUIO_RENDERFMTOWNS }, + { kRenderPC9821, GUIO_RENDERPC9821 }, + { kRenderPC9801, GUIO_RENDERPC9801 } +}; + DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Hercules Green", "lowres") DECLARE_TRANSLATION_ADDITIONAL_CONTEXT("Hercules Amber", "lowres") @@ -77,5 +98,25 @@ const char *getRenderModeDescription(RenderMode id) { return 0; } +String renderMode2GUIO(RenderMode id) { + Common::String res; + + for (int i = 0; i < ARRAYSIZE(s_renderGUIOMapping); i++) { + if (id == s_renderGUIOMapping[i].id) + res += s_renderGUIOMapping[i].guio; + } + + return res; +} + +String allRenderModesGUIOs() { + Common::String res; + + for (int i = 0; i < ARRAYSIZE(s_renderGUIOMapping); i++) { + res += s_renderGUIOMapping[i].guio; + } + + return res; +} } // End of namespace Common diff --git a/common/rendermode.h b/common/rendermode.h index c2fece77ee..945c4e7d9d 100644 --- a/common/rendermode.h +++ b/common/rendermode.h @@ -61,6 +61,12 @@ extern RenderMode parseRenderMode(const String &str); extern const char *getRenderModeCode(RenderMode id); extern const char *getRenderModeDescription(RenderMode id); +// TODO: Rename the following to something better; also, document it +extern String renderMode2GUIO(RenderMode id); + +// TODO: Rename the following to something better; also, document it +extern String allRenderModesGUIOs(); + } // End of namespace Common |