diff options
author | Eugene Sandulenko | 2005-02-20 00:17:22 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-02-20 00:17:22 +0000 |
commit | 27469a1896f08c6d32df1778dc7e9cce28c2bec4 (patch) | |
tree | 173e32cafae393fd7bcf2d7eb4e81932c5cd2b95 /common/util.cpp | |
parent | 3184c2de34c89a1b380fffa9f9ac83f53dc062d7 (diff) | |
download | scummvm-rg350-27469a1896f08c6d32df1778dc7e9cce28c2bec4.tar.gz scummvm-rg350-27469a1896f08c6d32df1778dc7e9cce28c2bec4.tar.bz2 scummvm-rg350-27469a1896f08c6d32df1778dc7e9cce28c2bec4.zip |
Patch #1121337 (CGA rendering in early LEC titles).
Differences against patch:
o Updated documentation
o Fixed text colors
o Implemented Hercules dithering
Ditherers are based on loom ega and monkey ega, so for zak and mm they're
wrong, i.e. these games look better than with original ditherers.
TODO:
Proper ditherers for zak & MM
EGA ditherers for VGA SCUMM v5 games
svn-id: r16816
Diffstat (limited to 'common/util.cpp')
-rw-r--r-- | common/util.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/common/util.cpp b/common/util.cpp index eb63e16a68..f4d5c91779 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -219,5 +219,47 @@ const char *getPlatformDescription(Platform id) { } +#pragma mark - + + +const RenderModeDescription g_renderModes[] = { + {"hercules", "Hercules", kRenderHerc}, + {"cga", "CGA", kRenderCGA}, + {"ega", "EGA", kRenderEGA}, + {0, 0, kRenderDefault} +}; + +RenderMode parseRenderMode(const String &str) { + if (str.isEmpty()) + return kRenderDefault; + + const char *s = str.c_str(); + const RenderModeDescription *l = g_renderModes; + for (; l->code; ++l) { + if (!scumm_stricmp(l->code, s)) + return l->id; + } + + return kRenderDefault; +} + +const char *getRenderModeCode(RenderMode id) { + const RenderModeDescription *l = g_renderModes; + for (; l->code; ++l) { + if (l->id == id) + return l->code; + } + return 0; +} + +const char *getRenderModeDescription(RenderMode id) { + const RenderModeDescription *l = g_renderModes; + for (; l->code; ++l) { + if (l->id == id) + return l->description; + } + return 0; +} + } // End of namespace Common |