diff options
author | Martin Kiewitz | 2016-02-02 23:27:13 +0100 |
---|---|---|
committer | Martin Kiewitz | 2016-02-02 23:27:13 +0100 |
commit | 920bea0fd9a161eba08c4057871177010c79ac1f (patch) | |
tree | 0f54e117511e30dfc4d9b206b7546a2e1ea0fb67 | |
parent | 5f41a09701d25619fc51e077781e4204080b7d62 (diff) | |
download | scummvm-rg350-920bea0fd9a161eba08c4057871177010c79ac1f.tar.gz scummvm-rg350-920bea0fd9a161eba08c4057871177010c79ac1f.tar.bz2 scummvm-rg350-920bea0fd9a161eba08c4057871177010c79ac1f.zip |
AGI: add drawCharacterOnDisplay()
-rw-r--r-- | engines/agi/graphics.cpp | 17 | ||||
-rw-r--r-- | engines/agi/graphics.h | 1 |
2 files changed, 11 insertions, 7 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index a9b1a1c730..af1b9b1755 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 8d5260570c..3a8bb6043c 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(); |