[Scummvm-cvs-logs] SF.net SVN: scummvm:[44678] scummvm/trunk/engines/sci/gui

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Oct 5 22:46:20 CEST 2009


Revision: 44678
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44678&view=rev
Author:   m_kiewitz
Date:     2009-10-05 20:46:19 +0000 (Mon, 05 Oct 2009)

Log Message:
-----------
SCI/newgui: color duplicated to upper 4 bits on EGA to remove dithering with black

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui.cpp
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp

Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-05 20:21:59 UTC (rev 44677)
+++ scummvm/trunk/engines/sci/gui/gui.cpp	2009-10-05 20:46:19 UTC (rev 44678)
@@ -53,8 +53,6 @@
 
 void SciGui::init(bool oldGfxFunctions) {
 	_usesOldGfxFunctions = oldGfxFunctions;
-
-	
 }
 
 int16 SciGui::getTimeTicks() {
@@ -109,6 +107,11 @@
 reg_t SciGui::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
 	GuiWindow *wnd = NULL;
 
+	if (!_s->resMan->isVGA()) {
+		colorPen |= (colorPen << 4);
+		colorBack |= (colorBack << 4);
+	}
+
 	if (restoreRect.top != 0 && restoreRect.left != 0 && restoreRect.height() != 0 && restoreRect.width() != 0)
 		wnd = _windowMgr->NewWindow(dims, &restoreRect, title, style, priority, false);
 	else
@@ -194,6 +197,9 @@
 			break;
 		}
 	}
+	if (!_s->resMan->isVGA())
+		bgcolor |= (bgcolor << 4);
+
 	// now drawing the text
 	_gfx->TextSize(rect, text, -1, width);
 	_gfx->Move((orect->left <= 320 ? 0 : 320 - orect->left), (orect->top <= 200 ? 0 : 200 - orect->top)); // move port to (0,0)
@@ -234,6 +240,12 @@
 
 void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) {
 	GuiPort *oldPort = _gfx->SetPort(_gfx->_menuPort);
+
+	if (!_s->resMan->isVGA()) {
+		colorPen |= colorPen << 4;
+		colorBack |= colorBack << 4;
+	}
+
 	_gfx->FillRect(_gfx->_menuRect, 1, colorBack);
 	_gfx->PenColor(colorPen);
 	_gfx->MoveTo(0, 1);
@@ -311,11 +323,15 @@
 }
 
 void SciGui::graphFillBox(Common::Rect rect, uint16 colorMask, int16 color, int16 priority, int16 control) {
+	if (!_s->resMan->isVGA())
+		color |= (color << 4);
 	_gfx->FillRect(rect, colorMask, color, priority, control);
 	_screen->copyToScreen();
 }
 
 void SciGui::graphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control) {
+	if (!_s->resMan->isVGA())
+		color |= (color << 4);
 	_gfx->Draw_Line(startPoint.x, startPoint.y, endPoint.x, endPoint.y, color, priority, control);
 	_screen->copyToScreen();
 }

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-05 20:21:59 UTC (rev 44677)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-05 20:46:19 UTC (rev 44678)
@@ -377,13 +377,16 @@
 	port->left = 0;
 	port->textFace = 0;
 	port->penClr = 0;
-	port->backClr = 0xFF;
+	port->backClr = 255;
 	port->penMode = 0;
 	port->rect = _bounds;
 }
 
 void SciGuiGfx::PenColor(int16 color) {
-	_curPort->penClr = color;
+	if (!_s->resMan->isVGA())
+		_curPort->penClr = color;
+	else
+		_curPort->penClr = color | (color << 4);
 }
 
 void SciGuiGfx::PenMode(int16 mode) {


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