[Scummvm-cvs-logs] SF.net SVN: scummvm:[50599] scummvm/trunk/engines/sci/graphics
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Fri Jul 2 17:58:09 CEST 2010
Revision: 50599
http://scummvm.svn.sourceforge.net/scummvm/?rev=50599&view=rev
Author: m_kiewitz
Date: 2010-07-02 15:58:09 +0000 (Fri, 02 Jul 2010)
Log Message:
-----------
SCI: change drawing of fonts, so that we never do triple pixel line duplications. sierra didn't do this, but it looks much better - "fixes" gk1, kq6 font rendering when running in hires
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/font.cpp
scummvm/trunk/engines/sci/graphics/screen.cpp
scummvm/trunk/engines/sci/graphics/screen.h
Modified: scummvm/trunk/engines/sci/graphics/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/font.cpp 2010-07-02 14:39:13 UTC (rev 50598)
+++ scummvm/trunk/engines/sci/graphics/font.cpp 2010-07-02 15:58:09 UTC (rev 50599)
@@ -82,7 +82,7 @@
int charWidth = MIN<int>(getCharWidth(chr), _screen->getWidth() - left);
int charHeight = MIN<int>(getCharHeight(chr), _screen->getHeight() - top);
byte b = 0, mask = 0xFF;
- int y = top;
+ int y = 0;
byte *pIn = getCharData(chr);
for (int i = 0; i < charHeight; i++, y++) {
@@ -92,7 +92,7 @@
if ((done & 7) == 0) // fetching next data byte
b = *(pIn++) & mask;
if (b & 0x80) // if MSB is set - paint it
- _screen->putPixel(left + done, y, 1, color, 0, 0);
+ _screen->putFontPixel(top, left + done, y, color);
b = b << 1;
}
}
Modified: scummvm/trunk/engines/sci/graphics/screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.cpp 2010-07-02 14:39:13 UTC (rev 50598)
+++ scummvm/trunk/engines/sci/graphics/screen.cpp 2010-07-02 15:58:09 UTC (rev 50599)
@@ -224,6 +224,27 @@
}
/**
+ * This is used to put font pixels onto the screen - we adjust differently, so that we won't
+ * do triple pixel lines in any case on upscaled hires. That way the font will not get distorted
+ * Sierra SCI didn't do this
+ */
+void GfxScreen::putFontPixel(int startingY, int x, int y, byte color) {
+ int offset = (startingY + y) * _width + x;
+
+ _visualScreen[offset] = color;
+ if (!_upscaledHires) {
+ _displayScreen[offset] = color;
+ } else {
+ int displayOffset = (_upscaledMapping[startingY] + y * 2) * _displayWidth + x * 2;
+ _displayScreen[displayOffset] = color;
+ _displayScreen[displayOffset + 1] = color;
+ displayOffset += _displayWidth;
+ _displayScreen[displayOffset] = color;
+ _displayScreen[displayOffset + 1] = color;
+ }
+}
+
+/**
* This will just change a pixel directly on displayscreen. It is supposed to be
* only used on upscaled-Hires games where hires content needs to get drawn ONTO
* the upscaled display screen (like japanese fonts, hires portraits, etc.).
Modified: scummvm/trunk/engines/sci/graphics/screen.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.h 2010-07-02 14:39:13 UTC (rev 50598)
+++ scummvm/trunk/engines/sci/graphics/screen.h 2010-07-02 15:58:09 UTC (rev 50599)
@@ -83,6 +83,7 @@
byte getDrawingMask(byte color, byte prio, byte control);
void putPixel(int x, int y, byte drawMask, byte color, byte prio, byte control);
+ void putFontPixel(int startingY, int x, int y, byte color);
void putPixelOnDisplay(int x, int y, byte color);
void drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte prio, byte control);
void drawLine(int16 left, int16 top, int16 right, int16 bottom, byte color, byte prio, byte control) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list