aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKari Salminen2007-06-20 22:16:18 +0000
committerKari Salminen2007-06-20 22:16:18 +0000
commit8b4b8a95a04e002d260d333959a84561ae33359a (patch)
treec50553eab70a05130a9b6cb3d22f441e67966570
parent129955ab5511a8dbcd78560ee6f46d6a67e43e92 (diff)
downloadscummvm-rg350-8b4b8a95a04e002d260d333959a84561ae33359a.tar.gz
scummvm-rg350-8b4b8a95a04e002d260d333959a84561ae33359a.tar.bz2
scummvm-rg350-8b4b8a95a04e002d260d333959a84561ae33359a.zip
svn-id: r27561
-rw-r--r--engines/agi/graphics.cpp289
1 files changed, 281 insertions, 8 deletions
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index 8f62ccc08d..5185031569 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -89,6 +89,269 @@ uint8 newPalette[16 * 3] = {
0x3F, 0x3F, 0x3F
};
+/**
+ * 256 color palette used with AGI256 and AGI256-2 games.
+ * Uses full 8 bits per color component.
+ */
+uint8 vgaPalette[256 * 3] = {
+ 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xA8,
+ 0x00, 0xA8, 0x00,
+ 0x00, 0xA8, 0xA8,
+ 0xA8, 0x00, 0x00,
+ 0xA8, 0x00, 0xA8,
+ 0xA8, 0x54, 0x00,
+ 0xA8, 0xA8, 0xA8,
+ 0x54, 0x54, 0x54,
+ 0x54, 0x54, 0xFC,
+ 0x54, 0xFC, 0x54,
+ 0x54, 0xFC, 0xFC,
+ 0xFC, 0x54, 0x54,
+ 0xFC, 0x54, 0xFC,
+ 0xFC, 0xFC, 0x54,
+ 0xFC, 0xFC, 0xFC,
+ 0x00, 0x00, 0x00,
+ 0x14, 0x14, 0x14,
+ 0x20, 0x20, 0x20,
+ 0x2C, 0x2C, 0x2C,
+ 0x38, 0x38, 0x38,
+ 0x44, 0x44, 0x44,
+ 0x50, 0x50, 0x50,
+ 0x60, 0x60, 0x60,
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x38, 0x70,
+ 0x00, 0x1C, 0x70,
+ 0x38, 0x38, 0x70,
+ 0x44, 0x38, 0x70,
+ 0x54, 0x38, 0x70,
+ 0x60, 0x38, 0x70,
+ 0x70, 0x38, 0x70,
+ 0x70, 0x38, 0x60,
+ 0x70, 0x38, 0x54,
+ 0x70, 0x38, 0x44,
+ 0x70, 0x38, 0x38,
+ 0x70, 0x44, 0x38,
+ 0x70, 0x54, 0x38,
+ 0x70, 0x60, 0x38,
+ 0x70, 0x70, 0x38,
+ 0x60, 0x70, 0x38,
+ 0x54, 0x70, 0x38,
+ 0x44, 0x70, 0x38,
+ 0x38, 0x70, 0x38,
+ 0x38, 0x70, 0x44,
+ 0x38, 0x70, 0x54,
+ 0x38, 0x70, 0x60,
+ 0x38, 0x70, 0x70,
+ 0x38, 0x60, 0x70,
+ 0x38, 0x54, 0x70,
+ 0x38, 0x44, 0x70,
+ 0x50, 0x50, 0x70,
+ 0x58, 0x50, 0x70,
+ 0x60, 0x50, 0x70,
+ 0x68, 0x50, 0x70,
+ 0x70, 0x50, 0x70,
+ 0x70, 0x50, 0x68,
+ 0x70, 0x50, 0x60,
+ 0x70, 0x50, 0x58,
+ 0x70, 0x50, 0x50,
+ 0x70, 0x58, 0x50,
+ 0x70, 0x60, 0x50,
+ 0x70, 0x68, 0x50,
+ 0x70, 0x70, 0x50,
+ 0x68, 0x70, 0x50,
+ 0x60, 0x70, 0x50,
+ 0x58, 0x70, 0x50,
+ 0x50, 0x70, 0x50,
+ 0x50, 0x70, 0x58,
+ 0x50, 0x70, 0x60,
+ 0x50, 0x70, 0x68,
+ 0x50, 0x70, 0x70,
+ 0x50, 0x68, 0x70,
+ 0x50, 0x60, 0x70,
+ 0x50, 0x58, 0x70,
+ 0x00, 0x00, 0x40,
+ 0x10, 0x00, 0x40,
+ 0x20, 0x00, 0x40,
+ 0x30, 0x00, 0x40,
+ 0x40, 0x00, 0x40,
+ 0x40, 0x00, 0x30,
+ 0x40, 0x00, 0x20,
+ 0x40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 0x30, 0x40, 0x2C,
+ 0x2C, 0x40, 0x2C,
+ 0x2C, 0x40, 0x30,
+ 0x2C, 0x40, 0x34,
+ 0x2C, 0x40, 0x3C,
+ 0x2C, 0x40, 0x40,
+ 0x2C, 0x3C, 0x40,
+ 0x2C, 0x34, 0x40,
+ 0x2C, 0x30, 0x40,
+ 0x40, 0x40, 0x40,
+ 0x38, 0x38, 0x38,
+ 0x30, 0x30, 0x30,
+ 0x28, 0x28, 0x28,
+ 0x24, 0x24, 0x24,
+ 0x1C, 0x1C, 0x1C,
+ 0x14, 0x14, 0x14,
+ 0x0C, 0x0C, 0x0C
+};
+
static uint16 cgaMap[16] = {
0x0000, /* 0 - black */
0x0d00, /* 1 - blue */
@@ -373,15 +636,25 @@ void GfxMgr::initPalette(uint8 *p) {
void GfxMgr::gfxSetPalette() {
int i;
- byte pal[32 * 4];
-
- for (i = 0; i < 32; i++) {
- pal[i * 4 + 0] = _palette[i * 3 + 0] << 2;
- pal[i * 4 + 1] = _palette[i * 3 + 1] << 2;
- pal[i * 4 + 2] = _palette[i * 3 + 2] << 2;
- pal[i * 4 + 3] = 0;
+ byte pal[256 * 4];
+
+ if (!(_vm->getFeatures() & (GF_AGI256 | GF_AGI256_2))) {
+ for (i = 0; i < 32; i++) {
+ pal[i * 4 + 0] = _palette[i * 3 + 0] << 2;
+ pal[i * 4 + 1] = _palette[i * 3 + 1] << 2;
+ pal[i * 4 + 2] = _palette[i * 3 + 2] << 2;
+ pal[i * 4 + 3] = 0;
+ }
+ g_system->setPalette(pal, 0, 32);
+ } else {
+ for (i = 0; i < 256; i++) {
+ pal[i * 4 + 0] = vgaPalette[i * 3 + 0];
+ pal[i * 4 + 1] = vgaPalette[i * 3 + 1];
+ pal[i * 4 + 2] = vgaPalette[i * 3 + 2];
+ pal[i * 4 + 3] = 0;
+ }
+ g_system->setPalette(pal, 0, 256);
}
- g_system->setPalette(pal, 0, 32);
}
//Gets AGIPAL Data