[Scummvm-cvs-logs] CVS: scummvm/common util.cpp,1.47,1.48 util.h,1.46,1.47
Eugene Sandulenko
sev at users.sourceforge.net
Sat Feb 19 16:18:55 CET 2005
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6099/common
Modified Files:
util.cpp util.h
Log Message:
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
Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- util.cpp 1 Jan 2005 16:08:50 -0000 1.47
+++ util.cpp 20 Feb 2005 00:17:21 -0000 1.48
@@ -219,5 +219,47 @@
}
+#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
Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- util.h 1 Jan 2005 16:08:50 -0000 1.46
+++ util.h 20 Feb 2005 00:17:21 -0000 1.47
@@ -147,12 +147,42 @@
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
More information about the Scummvm-git-logs
mailing list