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 | |
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')
-rw-r--r-- | common/util.cpp | 42 | ||||
-rw-r--r-- | common/util.h | 32 |
2 files changed, 73 insertions, 1 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 diff --git a/common/util.h b/common/util.h index 8813fc9d8b..173f2bf835 100644 --- a/common/util.h +++ b/common/util.h @@ -147,12 +147,42 @@ struct PlatformDescription { extern const PlatformDescription g_platforms[]; - /** Convert a string containing a platform name into a Platform enum value. */ extern Platform parsePlatform(const String &str); extern const char *getPlatformCode(Platform id); extern const char *getPlatformDescription(Platform id); +/** + * List of render modes. It specifies which original graphics mode + * to use. Some targets used postprocessing dithering routines for + * reducing color depth of final image which let it to be rendered on + * such low-level adapters as CGA or Hercules. + */ +enum RenderMode { + kRenderDefault = -1, + kRenderEGA = 1, + kRenderCGA = 2, + kRenderHerc = 3 +}; + +enum HerculesDimesnions { + kHercW = 720, + kHercH = 350 +}; + +struct RenderModeDescription { + const char *code; + const char *description; + Common::RenderMode id; +}; + +extern const RenderModeDescription g_renderModes[]; + +/** Convert a string containing a render mode name into a RenderingMode enum value. */ +extern RenderMode parseRenderMode(const String &str); +extern const char *getRenderModeCode(RenderMode id); +extern const char *getRenderModeDescription(RenderMode id); + } // End of namespace Common |