diff options
author | Gregory Montoir | 2003-10-07 14:05:56 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-10-07 14:05:56 +0000 |
commit | 537ee7166fc50701845fd2ad73c5124e0f9be0db (patch) | |
tree | 15fe50b2054b4a5aabba88633321cad72d568162 /queen | |
parent | f49a741cfb244574bf05ddece0849cc78c4d56e2 (diff) | |
download | scummvm-rg350-537ee7166fc50701845fd2ad73c5124e0f9be0db.tar.gz scummvm-rg350-537ee7166fc50701845fd2ad73c5124e0f9be0db.tar.bz2 scummvm-rg350-537ee7166fc50701845fd2ad73c5124e0f9be0db.zip |
some text functions
svn-id: r10670
Diffstat (limited to 'queen')
-rw-r--r-- | queen/defs.h | 19 | ||||
-rw-r--r-- | queen/graphics.cpp | 420 | ||||
-rw-r--r-- | queen/graphics.h | 65 |
3 files changed, 478 insertions, 26 deletions
diff --git a/queen/defs.h b/queen/defs.h index 991dcd8c42..e05b39bc5a 100644 --- a/queen/defs.h +++ b/queen/defs.h @@ -49,12 +49,19 @@ enum { enum { - INK_BG_PANEL = 0xE2, - INK_SELECT = 17, - INK_JOURNAL = 16, - INK_NORMAL = 1, - INK_TALK_NORMAL = 1, - INK_JOE = 17 + INK_BG_PANEL = 0xE2, + INK_SELECT = 17, + INK_JOURNAL = 16, + INK_NORMAL = 1, + INK_TALK_NORMAL = 1, + INK_JOE = 17, + INK_OUTLINED_TEXT = 16 +}; + + +enum { + ZONE_ROOM = 0, + ZONE_PANEL = 1 }; diff --git a/queen/graphics.cpp b/queen/graphics.cpp index aa1eb3dc2d..463863f7a7 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -25,6 +25,245 @@ namespace Queen { +const uint8 Graphics::FONT[] = { + 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, + 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, + 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB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8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, + 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, + 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, + 0xC0, 0x00, 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, + 0xF8, 0xB0, 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0xF8, 0xB0, + 0xB0, 0x80, 0xB0, 0xB0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0xC0, + 0xC0, 0x00, 0xD8, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x30, 0x7C, + 0xC0, 0x78, 0x0C, 0xF8, 0x30, 0x00, 0x00, 0xC6, 0xCC, 0x18, + 0x30, 0x66, 0xC6, 0x00, 0x38, 0x6C, 0x68, 0x36, 0xDC, 0xCC, + 0x76, 0x00, 0x60, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x60, 0xC0, 0xC0, 0xC0, 0x60, 0x30, 0x00, 0xC0, 0x60, + 0x30, 0x30, 0x30, 0x60, 0xC0, 0x00, 0x00, 0x6C, 0x38, 0xFE, + 0x38, 0x6C, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0xC0, + 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x03, 0x06, 0x0C, 0x18, + 0x30, 0x60, 0xC0, 0x00, 0x78, 0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 0x0C, 0x78, 0x00, 0x30, 0x30, + 0xFC, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0xCC, 0xCC, + 0xCC, 0xCC, 0x7C, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, + 0x30, 0x00, 0x00, 0x00, 0xC6, 0xD6, 0xD6, 0x6C, 0x6C, 0x00, + 0x00, 0x00, 0xCC, 0x78, 0x30, 0x78, 0xCC, 0x00, 0x00, 0x00, + 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0xE0, 0x00, 0x00, 0xFC, 0x18, + 0x30, 0x60, 0xFC, 0x00, 0x38, 0x60, 0x60, 0xC0, 0x60, 0x60, + 0x38, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, 0x00, + 0xE0, 0x30, 0x30, 0x18, 0x30, 0x30, 0xE0, 0x00, 0x38, 0x44, + 0xBA, 0xAA, 0xBA, 0x44, 0x38, 0x00, 0x00, 0x98, 0x30, 0x60, + 0xC8, 0x98, 0x30, 0x00, 0x1E, 0x30, 0x60, 0x60, 0x30, 0x1E, + 0x0C, 0x18, 0x00, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, + 0x0C, 0x18, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x18, 0x66, + 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x3C, 0x06, 0x3E, 0x66, + 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1E, 0x30, 0x60, 0x60, 0x30, 0x1E, 0x0C, 0x18, 0x18, 0x66, + 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x66, 0x00, 0x3C, 0x66, + 0x7E, 0x60, 0x3C, 0x00, 0x30, 0x18, 0x3C, 0x66, 0x7E, 0x60, + 0x3C, 0x00, 0x00, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, + 0x18, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x30, 0x18, + 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x30, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x66, 0x00, 0x3C, + 0x66, 0x66, 0x3C, 0x00, 0x00, 0x66, 0x00, 0x3C, 0x66, 0x66, + 0x3C, 0x00, 0x30, 0x18, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, + 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x7C, 0x00, 0x0C, 0x18, + 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x30, 0x00, 0x78, + 0xCC, 0xCC, 0x78, 0x00, 0x18, 0x30, 0x00, 0xCC, 0xCC, 0xCC, + 0x7C, 0x00, 0x71, 0x8E, 0x00, 0x7C, 0x66, 0x66, 0x66, 0x00, + 0x71, 0xCE, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0x00, 0x18, 0x18, + 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0x3C, 0x60, 0x3C, 0x66, + 0x3C, 0x06, 0x3C, 0x00, 0x18, 0x00, 0x18, 0x0C, 0x06, 0x66, + 0x3C, 0x00, 0x3F, 0x40, 0x4E, 0x58, 0x4E, 0x40, 0x3F, 0x00, + 0x1C, 0xA4, 0xC4, 0xBC, 0x80, 0xFE, 0x00, 0x00, 0x00, 0x33, + 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x3E, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0xC0, + 0xC0, 0x00, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0x7E, 0x00, + 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xCC, + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xFC, 0x30, + 0x30, 0x00, 0xFC, 0x00, 0xF0, 0x18, 0x30, 0x60, 0xF8, 0x00, + 0x00, 0x00, 0xF0, 0x18, 0x30, 0x18, 0xF0, 0x00, 0x00, 0x00, + 0x30, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xCC, 0xCC, 0xCC, 0xCC, 0xFE, 0xC0, 0x3E, 0x7A, 0x7A, 0x3A, + 0x0A, 0x0A, 0x0A, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, + 0x60, 0xE0, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x38, 0x44, + 0x44, 0x38, 0x00, 0x7C, 0x00, 0x00, 0x00, 0xCC, 0x66, 0x33, + 0x66, 0xCC, 0x00, 0x00, 0x40, 0xC6, 0x4C, 0x58, 0x32, 0x66, + 0xCF, 0x02, 0x40, 0xC6, 0x4C, 0x58, 0x3E, 0x62, 0xC4, 0x0E, + 0xC0, 0x23, 0x66, 0x2C, 0xD9, 0x33, 0x67, 0x01, 0x18, 0x00, + 0x18, 0x30, 0x60, 0x66, 0x3C, 0x00, 0x60, 0x30, 0x7C, 0xC6, + 0xFE, 0xC6, 0xC6, 0x00, 0x0C, 0x18, 0x7C, 0xC6, 0xFE, 0xC6, + 0xC6, 0x00, 0x38, 0xC6, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, + 0x71, 0x8E, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x6C, 0x00, + 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, 0x38, 0x44, 0x7C, 0xC6, + 0xFE, 0xC6, 0xC6, 0x00, 0x1F, 0x3C, 0x3C, 0x6F, 0x7C, 0xCC, + 0xCF, 0x00, 0x1E, 0x30, 0x60, 0x60, 0x30, 0x1E, 0x0C, 0x18, + 0x60, 0x30, 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, 0x18, 0x30, + 0xFC, 0xC0, 0xF0, 0xC0, 0xFC, 0x00, 0x30, 0xCC, 0xFC, 0xC0, + 0xF0, 0xC0, 0xFC, 0x00, 0xCC, 0x00, 0xFC, 0xC0, 0xF0, 0xC0, + 0xFC, 0x00, 0x60, 0x30, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, + 0x18, 0x30, 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, 0x30, 0xCC, + 0x78, 0x30, 0x30, 0x30, 0x78, 0x00, 0xCC, 0x00, 0x78, 0x30, + 0x30, 0x30, 0x78, 0x00, 0x78, 0x6C, 0x66, 0xF6, 0x66, 0x6C, + 0x78, 0x00, 0x71, 0xCE, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0x00, + 0x30, 0x18, 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x0C, 0x18, + 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x18, 0x66, 0x3C, 0x66, + 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, 0x3C, 0x66, 0x66, 0x66, + 0x3C, 0x00, 0xC3, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, + 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x3F, 0x66, + 0x6E, 0x7E, 0x76, 0x66, 0xFC, 0x00, 0x30, 0x18, 0x66, 0x66, + 0x66, 0x66, 0x3E, 0x00, 0x0C, 0x18, 0x66, 0x66, 0x66, 0x66, + 0x3E, 0x00, 0x18, 0x24, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, + 0x66, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x06, 0x08, + 0xC3, 0x66, 0x3C, 0x18, 0x18, 0x00, 0x60, 0x60, 0x7E, 0x63, + 0x7E, 0x60, 0x60, 0x00, 0x3C, 0x66, 0x66, 0x6C, 0x66, 0x66, + 0x6C, 0x60, 0x30, 0x18, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, + 0x0C, 0x18, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x18, 0x66, + 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, 0x71, 0x8E, 0x3C, 0x06, + 0x3E, 0x66, 0x3E, 0x00, 0x66, 0x00, 0x3C, 0x06, 0x3E, 0x66, + 0x3E, 0x00, 0x18, 0x24, 0x3C, 0x06, 0x3E, 0x66, 0x3E, 0x00, + 0x00, 0x00, 0x7E, 0x1B, 0x7F, 0xD8, 0x77, 0x00, 0x00, 0x00, + 0x3C, 0x60, 0x60, 0x60, 0x3C, 0x18, 0x30, 0x18, 0x3C, 0x66, + 0x7E, 0x60, 0x3C, 0x00, 0x0C, 0x18, 0x3C, 0x66, 0x7E, 0x60, + 0x3C, 0x00, 0x18, 0x66, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, + 0x66, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C, 0x00, 0x30, 0x18, + 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x0C, 0x18, 0x00, 0x18, + 0x18, 0x18, 0x18, 0x00, 0x18, 0x66, 0x00, 0x18, 0x18, 0x18, + 0x18, 0x00, 0x00, 0x66, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, + 0x60, 0xFC, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x71, 0x8E, + 0x00, 0x7C, 0x66, 0x66, 0x66, 0x00, 0x30, 0x18, 0x00, 0x3C, + 0x66, 0x66, 0x3C, 0x00, 0x0C, 0x18, 0x00, 0x3C, 0x66, 0x66, + 0x3C, 0x00, 0x18, 0x66, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, + 0x71, 0x8E, 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x66, + 0x00, 0x3C, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x18, 0x00, 0x7E, + 0x00, 0x18, 0x00, 0x00, 0x00, 0x02, 0x7C, 0xCE, 0xD6, 0xE6, + 0x7C, 0x80, 0x30, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, + 0x0C, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x18, 0x66, + 0x00, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x00, 0x66, 0x00, 0x66, + 0x66, 0x66, 0x3E, 0x00, 0x0C, 0x18, 0x00, 0x66, 0x66, 0x3C, + 0x18, 0x30, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60, + 0x00, 0x66, 0x00, 0x66, 0x66, 0x3C, 0x18, 0x30, 0xFF +}; + + +const uint8 Graphics::FONT_SIZES[] = { + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x04, 0x03, 0x06, 0x08, 0x07, 0x08, 0x08, 0x04, + 0x05, 0x05, 0x08, 0x07, 0x04, 0x07, 0x03, 0x09, 0x07, 0x05, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x04, + 0x06, 0x07, 0x06, 0x07, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x05, 0x07, 0x08, 0x07, 0x08, 0x08, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x07, + 0x07, 0x05, 0x09, 0x05, 0x08, 0x02, 0x04, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x07, 0x07, 0x03, 0x08, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, + 0x07, 0x07, 0x07, 0x06, 0x03, 0x06, 0x08, 0x06, 0x08, 0x08, + 0x08, 0x08, 0x02, 0x08, 0x02, 0x08, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x06, 0x02, 0x02, 0x07, 0x02, 0x02, 0x08, 0x08, 0x08, + 0x02, 0x08, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x07, 0x07, 0x07, 0x07, 0x09, 0x09, 0x06, 0x08, 0x08, 0x09, + 0x08, 0x09, 0x08, 0x03, 0x09, 0x07, 0x07, 0x07, 0x06, 0x06, + 0x05, 0x08, 0x08, 0x06, 0x05, 0x04, 0x07, 0x09, 0x09, 0x08, + 0x09, 0x08, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x09, 0x08, + 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x07, 0x07, 0x08, 0x09, + 0x08, 0x08, 0x08, 0x09, 0x09, 0x08, 0x09, 0x08, 0x08, 0x08, + 0x08, 0x09, 0x09, 0x08, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, + 0x09, 0x07, 0x08, 0x08, 0x08, 0x08, 0x06, 0x07, 0x08, 0x08, + 0x08, 0x09, 0x08, 0x08, 0x08, 0x09, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +}; + + Graphics::Graphics(Resource *resource) : _cameraBob(0), _resource(resource) { @@ -32,6 +271,8 @@ Graphics::Graphics(Resource *resource) memset(_banks, 0, sizeof(_banks)); memset(_bobs, 0, sizeof(_bobs)); memset(_sortedBobs, 0, sizeof(_sortedBobs)); + _sortedBobsCount = 0; + memset(_texts, 0, sizeof(_texts)); _shrinkBuffer.data = new uint8[ BOB_SHRINK_BUF_SIZE ]; _backdrop = new uint8[ BACKDROP_W * BACKDROP_H ]; _panel = new uint8[ PANEL_W * PANEL_H ]; @@ -292,8 +533,8 @@ void Graphics::bobDraw(uint32 bobnum, uint16 x, uint16 y, uint16 scale, bool xfl bobShrink(pbf, scale); pbf = &_shrinkBuffer; } - w = pbf->width; - h = pbf->height; + w = pbf->width; + h = pbf->height; if(w != 0 && h != 0 && box.intersects(x, y, w, h)) { @@ -326,15 +567,16 @@ void Graphics::bobDraw(uint32 bobnum, uint16 x, uint16 y, uint16 scale, bool xfl // _display->ulines(w_new / 16, h_new, 2); + // FIXME: original code blits to 'hidden' buffer src += w * y_skip; if (!xflip) { src += x_skip; -// Display::blit(_backdrop, x, y, BACKDROP_W, src, w_new, h_new, w, xflip, true); + displayBlit(_backdrop, x, y, BACKDROP_W, src, w_new, h_new, w, xflip, true); } else { src += w - w_new - x_skip; x += w_new - 1; -// Display::blit(_display->_screen, x, y, 320, src, w_new, h_new, w, xflip, true); + displayBlit(_backdrop, x, y, BACKDROP_W, src, w_new, h_new, w, xflip, true); } } @@ -347,16 +589,16 @@ void Graphics::bobDrawInventoryItem(uint32 bobnum, uint16 x, uint16 y) { memset(_panel + y * 32 + x, INK_BG_PANEL, 32 * 32); } else { -// BobFrame *pbf = &_frames[bobnum]; -// Display::blit(_panel, x, y, 320, pbf->data, pbf->width, pbf->height, false, false); + BobFrame *pbf = &_frames[bobnum]; + displayBlit(_panel, x, y, 320, pbf->data, pbf->width, pbf->height, pbf->width, false, false); } } void Graphics::bobPaste(uint32 bobnum, uint16 x, uint16 y) { -// BobFrame *pbf = &_frames[bobnum]; -// Display::blit(_backdrop, x, y, 640, pbf->data, pbf->width, pbf->height, pbf->width, false, true); + BobFrame *pbf = &_frames[bobnum]; + displayBlit(_backdrop, x, y, 640, pbf->data, pbf->width, pbf->height, pbf->width, false, true); frameErase(bobnum); } @@ -513,6 +755,62 @@ BobSlot *Graphics::bob(int index) { } +void Graphics::textCurrentColor(uint8 color) { + _curTextColor = color; +} + + +void Graphics::textSet(uint16 x, uint16 y, const char *text, bool outlined) { + if (y < GAME_SCREEN_HEIGHT) { + if (x == 0) x = 1; + if (y == 0) y = 1; + TextSlot *pts = &_texts[y]; + + pts->x = x; + pts->color = _curTextColor; + pts->outlined = outlined; + if (pts->text != NULL) { + free(pts->text); + } + pts->text = strdup(text); + } +} + + +void Graphics::textDrawAll() { + int y; + for (y = GAME_SCREEN_HEIGHT - 1; y > 0; --y) { + const TextSlot *pts = &_texts[y]; + if (pts->text != NULL) { + displayText(pts, y); + } + } +} + + +void Graphics::textClear(uint16 y1, uint16 y2) { + + while (y1 <= y2) { + if (_texts[y1].text != NULL) { + free(_texts[y1].text); + _texts[y1].text = NULL; + } + ++y1; + } +} + + +uint16 Graphics::textLength(const char* text) { + + uint16 len = 0; + while (*text) { + len += FONT_SIZES[ *text ]; + ++text; + } + return len; +} + + void Graphics::frameErase(uint32 fslot) { BobFrame *pbf = &_frames[fslot]; @@ -536,7 +834,7 @@ void Graphics::frameEraseAll(bool joe) { } -void Graphics::loadBackdrop(const char* name, uint16 room) { +void Graphics::backdropLoad(const char* name, uint16 room) { // _display->ulines(2); @@ -553,6 +851,7 @@ void Graphics::loadBackdrop(const char* name, uint16 room) { // uint32 size = _resource->fileSize(name); // _display->setPal(pcxbuf + size - 768, 0, (room <= 144) ? 144 : 256); + _backdropWidth = READ_LE_UINT16(pcxbuf + 12); _backdropHeight = READ_LE_UINT16(pcxbuf + 14); @@ -569,7 +868,7 @@ void Graphics::loadBackdrop(const char* name, uint16 room) { } -void Graphics::loadPanel() { +void Graphics::panelLoad() { uint8 *pcxbuf = _resource->loadFile("panel.pcx"); if (pcxbuf == NULL) { @@ -607,7 +906,7 @@ void Graphics::useJournal() { // GameSettings* pgs int i; bobClearAll(); - loadBackdrop("journal.pcx", 160); + backdropLoad("journal.pcx", 160); // _display->fadeout(0,255); // load and unpack journal frames @@ -661,5 +960,104 @@ void Graphics::journalBobPreDraw() { // GameSettings* pgs +void Graphics::update() { + // FIXME: incomplete ! + bobSortAll(); +// panelDraw(); +// backdropDraw(); + bobDrawAll(); + textDrawAll(); +} + + +void Graphics::displayText(const TextSlot *pts, uint16 y) { + + // FIXME: original source uses hidden buffer (instead of _backdrop) + uint16 x = pts->x; + uint8 *str = (uint8*)pts->text; + while (*str && x < GAME_SCREEN_WIDTH) { + const uint8 *pchr = FONT + (*str) * 8; +// if (_resource->_gameVersion->versionString[1] == 'F' && *str == 150) { +// chr = 251; +// } +// _display->ulines(2); + if (pts->outlined) { + displayChar(_backdrop, BACKDROP_W, x - 1, y - 1, INK_OUTLINED_TEXT, pchr); + displayChar(_backdrop, BACKDROP_W, x , y - 1, INK_OUTLINED_TEXT, pchr); + displayChar(_backdrop, BACKDROP_W, x + 1, y - 1, INK_OUTLINED_TEXT, pchr); + displayChar(_backdrop, BACKDROP_W, x + 1, y , INK_OUTLINED_TEXT, pchr); + displayChar(_backdrop, BACKDROP_W, x + 1, y + 1, INK_OUTLINED_TEXT, pchr); + displayChar(_backdrop, BACKDROP_W, x , y + 1, INK_OUTLINED_TEXT, pchr); + displayChar(_backdrop, BACKDROP_W, x - 1, y + 1, INK_OUTLINED_TEXT, pchr); + displayChar(_backdrop, BACKDROP_W, x - 1, y , INK_OUTLINED_TEXT, pchr); + } + displayChar(_backdrop, BACKDROP_W, x, y, pts->color, pchr); + + x += FONT_SIZES[ *str ]; + ++str; + } +} + + +void Graphics::displayChar(uint8 *dst, uint16 dstPitch, uint16 x, uint16 y, uint8 color, const uint8 *chr) { + + int i, j; + dst += y * dstPitch + x; + for (j = 0; j < 8; ++j) { + uint8* p = dst; + uint8 c = *chr++; + if (c != 0) { + for (i = 0; i < 8; ++i) { + if(c & 0x80) { + *p = color; + } + ++p; + c <<= 1; + } + } + dst += dstPitch; + } +} + + +void Graphics::displayBlit(uint8 *dst_buf, uint16 dst_x, uint16 dst_y, uint16 dst_pitch, const uint8 *src_buf, uint16 src_w, uint16 src_h, uint16 src_pitch, bool xflip, bool masked) { + + dst_buf += dst_y * dst_pitch + dst_x; + if (!masked) { // Unmasked always unflipped + while (src_h--) { + memcpy(dst_buf, src_buf, src_w); + src_buf += src_pitch; + dst_buf += dst_pitch; + } + } + else if (!xflip) { // Masked bitmap unflipped + while (src_h--) { + int i; + for(i = 0; i < src_w; ++i) { + uint8 b = *(src_buf + i); + if(b != 0) { + *(dst_buf + i) = b; + } + } + src_buf += src_pitch; + dst_buf += dst_pitch; + } + } + else { // Masked bitmap flipped + while (src_h--) { + int i; + for(i = 0; i < src_w; ++i) { + uint8 b = *(src_buf + i); + if(b != 0) { + *(dst_buf - i) = b; + } + } + src_buf += src_pitch; + dst_buf += dst_pitch; + } + } +} + + } // End of namespace Queen diff --git a/queen/graphics.h b/queen/graphics.h index 91064da47c..4033bf8a33 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -93,6 +93,14 @@ struct BobSlot { }; +struct TextSlot { + uint16 x; + uint8 color; + char *text; + bool outlined; +}; + + //class Display; class Graphics { @@ -119,16 +127,31 @@ public: void bobClearAll(); // clearallbobs() BobSlot *bob(int index); + void textCurrentColor(uint8 color); // ink() + void textSet(uint16 x, uint16 y, const char *text, bool outlined = true); // text() + void textDrawAll(); // drawtext() + void textClear(uint16 y1, uint16 y2); // blanktexts() + uint16 textLength(const char* text); // textlen() + void frameErase(uint32 fslot); void frameEraseAll(bool joe); // freeframes, freeallframes - void loadBackdrop(const char* name, uint16 room); // loadbackdrop - void loadPanel(); // loadpanel + void backdropLoad(const char* name, uint16 room); // loadbackdrop +// void backdropDraw(); + + void panelLoad(); // loadpanel +// void panelDraw(); void useJournal(); void journalBobSetup(uint32 bobnum, uint16 x, uint16 y, uint16 frame); void journalBobPreDraw(); + void update(); + + void displayText(const TextSlot *pts, uint16 y); // FIXME: move to Display class + void displayChar(uint8 *dst, uint16 dstPitch, uint16 x, uint16 y, uint8 color, const uint8 *chr); // FIXME: move to Display class + static void displayBlit(uint8 *dst_buf, uint16 dst_x, uint16 dst_y, uint16 dst_pitch, const uint8 *src_buf, uint16 src_w, uint16 src_h, uint16 src_pitch, bool xflip, bool masked); // FIXME: move to Display class + private: @@ -145,21 +168,45 @@ private: uint8 *data; }; - BobFrame _frames[MAX_FRAMES_NUMBER]; //! unbanked bob frames - PackedBank _banks[MAX_BANKS_NUMBER]; //! banked bob frames + //! unbanked bob frames + BobFrame _frames[MAX_FRAMES_NUMBER]; + + //! banked bob frames + PackedBank _banks[MAX_BANKS_NUMBER]; + BobSlot _bobs[MAX_BOBS_NUMBER]; - BobSlot *_sortedBobs[MAX_BOBS_NUMBER]; //! bobs displayed - BobFrame _shrinkBuffer; //! used to scale a BobFrame + + //! bobs to display + BobSlot *_sortedBobs[MAX_BOBS_NUMBER]; + uint16 _sortedBobsCount; + //! used to scale a BobFrame + BobFrame _shrinkBuffer; + + TextSlot _texts[GAME_SCREEN_HEIGHT]; + uint8 _curTextColor; + uint16 _cameraBob; // cambob - uint16 _backdropWidth, _backdropHeight; //! current room dimensions - uint8 *_backdrop; //! current room bitmap - uint8 *_panel; //! panel storage area + + //! current room dimensions + uint16 _backdropWidth, _backdropHeight; // BDxres, BDyres + + //! current room bitmap + uint8 *_backdrop; + + //! panel storage area + uint8 *_panel; Resource *_resource; // Display *_display; + //! font used to render the text + static const uint8 FONT[]; // FIXME: move to Display class + + //! font justification values + static const uint8 FONT_SIZES[]; // FIXME: move to Display class + void readPCX(const uint8 *src, uint8 *dst, uint16 dstPitch, uint16 w, uint16 h); }; |