[Scummvm-cvs-logs] scummvm master -> 920bea0fd9a161eba08c4057871177010c79ac1f

m-kiewitz m_kiewitz at users.sourceforge.net
Tue Feb 2 23:27:35 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
920bea0fd9 AGI: add drawCharacterOnDisplay()


Commit: 920bea0fd9a161eba08c4057871177010c79ac1f
    https://github.com/scummvm/scummvm/commit/920bea0fd9a161eba08c4057871177010c79ac1f
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-02-02T23:27:13+01:00

Commit Message:
AGI: add drawCharacterOnDisplay()

Changed paths:
    engines/agi/graphics.cpp
    engines/agi/graphics.h



diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index a9b1a1c..af1b9b1 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -589,7 +589,13 @@ void GfxMgr::drawDisplayRectCGA(int16 x, int16 y, int16 width, int16 height, byt
 
 // row + column are text-coordinates
 void GfxMgr::drawCharacter(int16 row, int16 column, byte character, byte foreground, byte background, bool disabledLook) {
-	int16       startX, startY;
+	int16 x = column * FONT_DISPLAY_WIDTH;
+	int16 y = row * FONT_DISPLAY_HEIGHT;
+
+	drawCharacterOnDisplay(x, y, character, foreground, background, disabledLook);
+}
+
+void GfxMgr::drawCharacterOnDisplay(int16 x, int16 y, byte character, byte foreground, byte background, bool disabledLook) {
 	int16       curX, curY;
 	const byte *fontData;
 	byte        curByte = 0;
@@ -597,9 +603,6 @@ void GfxMgr::drawCharacter(int16 row, int16 column, byte character, byte foregro
 	byte        curTransformXOR = 0;
 	byte        curTransformOR = 0;
 
-	startX = column * FONT_DISPLAY_HEIGHT;
-	startY = row * FONT_DISPLAY_WIDTH;
-
 	// get font data of specified character
 	fontData = _vm->getFontData() + character * FONT_BYTES_PER_CHARACTER;
 
@@ -627,15 +630,15 @@ void GfxMgr::drawCharacter(int16 row, int16 column, byte character, byte foregro
 				curBit  = 0x80;
 			}
 			if (curByte & curBit) {
-				putPixelOnDisplay(startX + curX, startY + curY, foreground);
+				putPixelOnDisplay(x + curX, y + curY, foreground);
 			} else {
-				putPixelOnDisplay(startX + curX, startY + curY, background);
+				putPixelOnDisplay(x + curX, y + curY, background);
 			}
 			curBit = curBit >> 1;
 		}
 	}
 
-	copyDisplayRectToScreen(startX, startY, FONT_DISPLAY_WIDTH, FONT_DISPLAY_HEIGHT);
+	copyDisplayRectToScreen(x, y, FONT_DISPLAY_WIDTH, FONT_DISPLAY_HEIGHT);
 }
 
 #define SHAKE_VERTICAL_PIXELS 4
diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h
index 8d52605..3a8bb60 100644
--- a/engines/agi/graphics.h
+++ b/engines/agi/graphics.h
@@ -137,6 +137,7 @@ private:
 
 public:
 	void drawCharacter(int16 row, int16 column, byte character, byte foreground, byte background, bool disabledLook);
+	void drawCharacterOnDisplay(int16 x, int16 y, byte character, byte foreground, byte background, bool disabledLook);
 
 	void shakeScreen(int16 repeatCount);
 	void updateScreen();






More information about the Scummvm-git-logs mailing list