diff options
| -rw-r--r-- | engines/supernova/graphics.cpp | 5 | ||||
| -rw-r--r-- | engines/supernova/msn_def.h | 354 | ||||
| -rw-r--r-- | engines/supernova/supernova.cpp | 133 | ||||
| -rw-r--r-- | engines/supernova/supernova.h | 7 | 
4 files changed, 282 insertions, 217 deletions
| diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp index 7073de92db..d0d26eb809 100644 --- a/engines/supernova/graphics.cpp +++ b/engines/supernova/graphics.cpp @@ -45,7 +45,10 @@ bool MSNImageDecoder::loadStream(Common::SeekableReadStream &stream) {  			_palette[717 - i] = stream.readByte();  		}  	} -	g_system->getPaletteManager()->setPalette(_palette, 16, 240); +	// 18bit VGA to 24bit CLUT8 +	for (size_t i = 0; i < 717; ++i) { +		_palette[i] <<= 2; +	}  	byte numSections = stream.readByte();  	for (size_t i = 0; i < kMaxSections; ++i) { diff --git a/engines/supernova/msn_def.h b/engines/supernova/msn_def.h index e7ae963ff9..b2aef9d30c 100644 --- a/engines/supernova/msn_def.h +++ b/engines/supernova/msn_def.h @@ -361,8 +361,6 @@ enum {X,        TICKETS}; -} -  enum MessagePosition {  	kMessageNormal,  	kMessageLeft, @@ -404,164 +402,214 @@ enum MessagePosition {  const byte mouseNormal[64] = { -  0xff,0x3f,0xff,0x1f,0xff,0x0f,0xff,0x07, -  0xff,0x03,0xff,0x01,0xff,0x00,0x7f,0x00, -  0x3f,0x00,0x1f,0x00,0x0f,0x00,0x0f,0x00, -  0xff,0x00,0x7f,0x18,0x7f,0x38,0x7f,0xfc, - -  0x00,0x00,0x00,0x40,0x00,0x60,0x00,0x70, -  0x00,0x78,0x00,0x7c,0x00,0x7e,0x00,0x7f, -  0x80,0x7f,0xc0,0x7f,0xe0,0x7f,0x00,0x7e, -  0x00,0x66,0x00,0x43,0x00,0x03,0x00,0x00 +	0xff,0x3f,0xff,0x1f,0xff,0x0f,0xff,0x07, +	0xff,0x03,0xff,0x01,0xff,0x00,0x7f,0x00, +	0x3f,0x00,0x1f,0x00,0x0f,0x00,0x0f,0x00, +	0xff,0x00,0x7f,0x18,0x7f,0x38,0x7f,0xfc, +	 +	0x00,0x00,0x00,0x40,0x00,0x60,0x00,0x70, +	0x00,0x78,0x00,0x7c,0x00,0x7e,0x00,0x7f, +	0x80,0x7f,0xc0,0x7f,0xe0,0x7f,0x00,0x7e, +	0x00,0x66,0x00,0x43,0x00,0x03,0x00,0x00  };  const byte mouseWait[64] = { -  0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80, -  0x01,0x80,0x01,0x80,0x11,0x88,0x31,0x8c, -  0x31,0x8c,0x11,0x88,0x01,0x80,0x01,0x80, -  0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00, - -  0x00,0x00,0xfe,0x7f,0xf4,0x2f,0xf4,0x2f, -  0x14,0x28,0x24,0x24,0x44,0x22,0x84,0x21, -  0x84,0x21,0xc4,0x23,0xe4,0x27,0x74,0x2e, -  0x34,0x2c,0x14,0x28,0xfe,0x7f,0x00,0x00 +	0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80, +	0x01,0x80,0x01,0x80,0x11,0x88,0x31,0x8c, +	0x31,0x8c,0x11,0x88,0x01,0x80,0x01,0x80, +	0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00, +	 +	0x00,0x00,0xfe,0x7f,0xf4,0x2f,0xf4,0x2f, +	0x14,0x28,0x24,0x24,0x44,0x22,0x84,0x21, +	0x84,0x21,0xc4,0x23,0xe4,0x27,0x74,0x2e, +	0x34,0x2c,0x14,0x28,0xfe,0x7f,0x00,0x00  };  const byte font[][5] =  { -  {0x00,0x00,0x00,0xff,0x00}, -  {0x5f,0xff,0x00,0x00,0x00}, -  {0x03,0x00,0x03,0xff,0x00}, -  {0x14,0x7f,0x14,0x7f,0x14}, -  {0x24,0x2a,0x7f,0x2a,0x12}, -  {0x61,0x10,0x08,0x04,0x43}, -  {0x38,0x4e,0x59,0x26,0x50}, -  {0x03,0xff,0x00,0x00,0x00}, -  {0x3e,0x41,0xff,0x00,0x00}, -  {0x41,0x3e,0xff,0x00,0x00}, -  {0x10,0x54,0x38,0x54,0x10}, -  {0x10,0x10,0x7c,0x10,0x10}, -  {0x80,0x40,0xff,0x00,0x00}, -  {0x10,0x10,0x10,0x10,0x10}, -  {0x40,0xff,0x00,0x00,0x00}, -  {0x60,0x10,0x08,0x04,0x03}, - -  {0x3e,0x41,0x41,0x41,0x3e}, /* digits */ -  {0x04,0x02,0x7f,0xff,0x00}, -  {0x42,0x61,0x51,0x49,0x46}, -  {0x22,0x41,0x49,0x49,0x36}, -  {0x18,0x14,0x12,0x7f,0x10}, -  {0x27,0x45,0x45,0x45,0x39}, -  {0x3e,0x49,0x49,0x49,0x32}, -  {0x01,0x61,0x19,0x07,0x01}, -  {0x36,0x49,0x49,0x49,0x36}, -  {0x26,0x49,0x49,0x49,0x3e}, - -  {0x44,0xff,0x00,0x00,0x00}, -  {0x80,0x44,0xff,0x00,0x00}, -  {0x10,0x28,0x44,0xff,0x00}, -  {0x28,0x28,0x28,0x28,0x28}, -  {0x44,0x28,0x10,0xff,0x00}, -  {0x02,0x01,0x51,0x09,0x06}, -  {0x3e,0x41,0x5d,0x5d,0x1e}, - -  {0x7c,0x12,0x11,0x12,0x7c}, /* uppercase letters*/ -  {0x7f,0x49,0x49,0x49,0x36}, -  {0x3e,0x41,0x41,0x41,0x22}, -  {0x7f,0x41,0x41,0x22,0x1c}, -  {0x7f,0x49,0x49,0x49,0xff}, -  {0x7f,0x09,0x09,0x09,0xff}, -  {0x3e,0x41,0x41,0x49,0x3a}, -  {0x7f,0x08,0x08,0x08,0x7f}, -  {0x41,0x7f,0x41,0xff,0x00}, -  {0x20,0x40,0x40,0x3f,0xff}, -  {0x7f,0x08,0x14,0x22,0x41}, -  {0x7f,0x40,0x40,0x40,0xff}, -  {0x7f,0x02,0x04,0x02,0x7f}, -  {0x7f,0x02,0x0c,0x10,0x7f}, -  {0x3e,0x41,0x41,0x41,0x3e}, -  {0x7f,0x09,0x09,0x09,0x06}, -  {0x3e,0x41,0x51,0x21,0x5e}, -  {0x7f,0x09,0x19,0x29,0x46}, -  {0x26,0x49,0x49,0x49,0x32}, -  {0x01,0x01,0x7f,0x01,0x01}, -  {0x3f,0x40,0x40,0x40,0x3f}, -  {0x07,0x18,0x60,0x18,0x07}, -  {0x1f,0x60,0x18,0x60,0x1f}, -  {0x63,0x14,0x08,0x14,0x63}, -  {0x03,0x04,0x78,0x04,0x03}, -  {0x61,0x51,0x49,0x45,0x43}, - -  {0x7f,0x41,0x41,0xff,0x00}, -  {0x03,0x04,0x08,0x10,0x60}, -  {0x41,0x41,0x7f,0xff,0x00}, -  {0x02,0x01,0x02,0xff,0x00}, -  {0x80,0x80,0x80,0x80,0x80}, -  {0x01,0x02,0xff,0x00,0x00}, - -  {0x38,0x44,0x44,0x44,0x7c}, /* lowercase letters */ -  {0x7f,0x44,0x44,0x44,0x38}, -  {0x38,0x44,0x44,0x44,0x44}, -  {0x38,0x44,0x44,0x44,0x7f}, -  {0x38,0x54,0x54,0x54,0x58}, -  {0x04,0x7e,0x05,0x01,0xff}, -  {0x98,0xa4,0xa4,0xa4,0x7c}, -  {0x7f,0x04,0x04,0x04,0x78}, -  {0x7d,0xff,0x00,0x00,0x00}, -  {0x80,0x80,0x7d,0xff,0x00}, -  {0x7f,0x10,0x28,0x44,0xff}, -  {0x7f,0xff,0x00,0x00,0x00}, -  {0x7c,0x04,0x7c,0x04,0x78}, -  {0x7c,0x04,0x04,0x04,0x78}, -  {0x38,0x44,0x44,0x44,0x38}, -  {0xfc,0x24,0x24,0x24,0x18}, -  {0x18,0x24,0x24,0x24,0xfc}, -  {0x7c,0x08,0x04,0x04,0xff}, -  {0x48,0x54,0x54,0x54,0x24}, -  {0x04,0x3e,0x44,0x40,0xff}, -  {0x7c,0x40,0x40,0x40,0x3c}, -  {0x0c,0x30,0x40,0x30,0x0c}, -  {0x3c,0x40,0x3c,0x40,0x3c}, -  {0x44,0x28,0x10,0x28,0x44}, -  {0x9c,0xa0,0xa0,0xa0,0x7c}, -  {0x44,0x64,0x54,0x4c,0x44}, - -  {0x08,0x36,0x41,0xff,0x00}, -  {0x77,0xff,0x00,0x00,0x00}, -  {0x41,0x36,0x08,0xff,0x00}, -  {0x02,0x01,0x02,0x01,0xff}, -  {0xff,0x00,0x00,0x00,0x00}, - -  {0xfe,0x49,0x49,0x4e,0x30}, /* sharp S */ - -  {0x7c,0x41,0x40,0x41,0x3c}, /* umlauts */ - -  {0x04,0x06,0x7f,0x06,0x04}, /* arrows */ -  {0x20,0x60,0xfe,0x60,0x20}, - -  {0x38,0x45,0x44,0x45,0x7c}, /* umlauts */ -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0x79,0x14,0x12,0x14,0x79}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0x38,0x45,0x44,0x45,0x38}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0xff,0x00,0x00,0x00,0x00}, -  {0x3d,0x42,0x42,0x42,0x3d}, -  {0x3d,0x40,0x40,0x40,0x3d}, +	{0x00,0x00,0x00,0xff,0x00}, +	{0x5f,0xff,0x00,0x00,0x00}, +	{0x03,0x00,0x03,0xff,0x00}, +	{0x14,0x7f,0x14,0x7f,0x14}, +	{0x24,0x2a,0x7f,0x2a,0x12}, +	{0x61,0x10,0x08,0x04,0x43}, +	{0x38,0x4e,0x59,0x26,0x50}, +	{0x03,0xff,0x00,0x00,0x00}, +	{0x3e,0x41,0xff,0x00,0x00}, +	{0x41,0x3e,0xff,0x00,0x00}, +	{0x10,0x54,0x38,0x54,0x10}, +	{0x10,0x10,0x7c,0x10,0x10}, +	{0x80,0x40,0xff,0x00,0x00}, +	{0x10,0x10,0x10,0x10,0x10}, +	{0x40,0xff,0x00,0x00,0x00}, +	{0x60,0x10,0x08,0x04,0x03}, +	 +	{0x3e,0x41,0x41,0x41,0x3e}, /* digits */ +	{0x04,0x02,0x7f,0xff,0x00}, +	{0x42,0x61,0x51,0x49,0x46}, +	{0x22,0x41,0x49,0x49,0x36}, +	{0x18,0x14,0x12,0x7f,0x10}, +	{0x27,0x45,0x45,0x45,0x39}, +	{0x3e,0x49,0x49,0x49,0x32}, +	{0x01,0x61,0x19,0x07,0x01}, +	{0x36,0x49,0x49,0x49,0x36}, +	{0x26,0x49,0x49,0x49,0x3e}, +	 +	{0x44,0xff,0x00,0x00,0x00}, +	{0x80,0x44,0xff,0x00,0x00}, +	{0x10,0x28,0x44,0xff,0x00}, +	{0x28,0x28,0x28,0x28,0x28}, +	{0x44,0x28,0x10,0xff,0x00}, +	{0x02,0x01,0x51,0x09,0x06}, +	{0x3e,0x41,0x5d,0x5d,0x1e}, +	 +	{0x7c,0x12,0x11,0x12,0x7c}, /* uppercase letters*/ +	{0x7f,0x49,0x49,0x49,0x36}, +	{0x3e,0x41,0x41,0x41,0x22}, +	{0x7f,0x41,0x41,0x22,0x1c}, +	{0x7f,0x49,0x49,0x49,0xff}, +	{0x7f,0x09,0x09,0x09,0xff}, +	{0x3e,0x41,0x41,0x49,0x3a}, +	{0x7f,0x08,0x08,0x08,0x7f}, +	{0x41,0x7f,0x41,0xff,0x00}, +	{0x20,0x40,0x40,0x3f,0xff}, +	{0x7f,0x08,0x14,0x22,0x41}, +	{0x7f,0x40,0x40,0x40,0xff}, +	{0x7f,0x02,0x04,0x02,0x7f}, +	{0x7f,0x02,0x0c,0x10,0x7f}, +	{0x3e,0x41,0x41,0x41,0x3e}, +	{0x7f,0x09,0x09,0x09,0x06}, +	{0x3e,0x41,0x51,0x21,0x5e}, +	{0x7f,0x09,0x19,0x29,0x46}, +	{0x26,0x49,0x49,0x49,0x32}, +	{0x01,0x01,0x7f,0x01,0x01}, +	{0x3f,0x40,0x40,0x40,0x3f}, +	{0x07,0x18,0x60,0x18,0x07}, +	{0x1f,0x60,0x18,0x60,0x1f}, +	{0x63,0x14,0x08,0x14,0x63}, +	{0x03,0x04,0x78,0x04,0x03}, +	{0x61,0x51,0x49,0x45,0x43}, +	 +	{0x7f,0x41,0x41,0xff,0x00}, +	{0x03,0x04,0x08,0x10,0x60}, +	{0x41,0x41,0x7f,0xff,0x00}, +	{0x02,0x01,0x02,0xff,0x00}, +	{0x80,0x80,0x80,0x80,0x80}, +	{0x01,0x02,0xff,0x00,0x00}, +	 +	{0x38,0x44,0x44,0x44,0x7c}, /* lowercase letters */ +	{0x7f,0x44,0x44,0x44,0x38}, +	{0x38,0x44,0x44,0x44,0x44}, +	{0x38,0x44,0x44,0x44,0x7f}, +	{0x38,0x54,0x54,0x54,0x58}, +	{0x04,0x7e,0x05,0x01,0xff}, +	{0x98,0xa4,0xa4,0xa4,0x7c}, +	{0x7f,0x04,0x04,0x04,0x78}, +	{0x7d,0xff,0x00,0x00,0x00}, +	{0x80,0x80,0x7d,0xff,0x00}, +	{0x7f,0x10,0x28,0x44,0xff}, +	{0x7f,0xff,0x00,0x00,0x00}, +	{0x7c,0x04,0x7c,0x04,0x78}, +	{0x7c,0x04,0x04,0x04,0x78}, +	{0x38,0x44,0x44,0x44,0x38}, +	{0xfc,0x24,0x24,0x24,0x18}, +	{0x18,0x24,0x24,0x24,0xfc}, +	{0x7c,0x08,0x04,0x04,0xff}, +	{0x48,0x54,0x54,0x54,0x24}, +	{0x04,0x3e,0x44,0x40,0xff}, +	{0x7c,0x40,0x40,0x40,0x3c}, +	{0x0c,0x30,0x40,0x30,0x0c}, +	{0x3c,0x40,0x3c,0x40,0x3c}, +	{0x44,0x28,0x10,0x28,0x44}, +	{0x9c,0xa0,0xa0,0xa0,0x7c}, +	{0x44,0x64,0x54,0x4c,0x44}, +	 +	{0x08,0x36,0x41,0xff,0x00}, +	{0x77,0xff,0x00,0x00,0x00}, +	{0x41,0x36,0x08,0xff,0x00}, +	{0x02,0x01,0x02,0x01,0xff}, +	{0xff,0x00,0x00,0x00,0x00}, +	 +	{0xfe,0x49,0x49,0x4e,0x30}, /* sharp S */ +	 +	{0x7c,0x41,0x40,0x41,0x3c}, /* umlauts */ +	 +	{0x04,0x06,0x7f,0x06,0x04}, /* arrows */ +	{0x20,0x60,0xfe,0x60,0x20}, +	 +	{0x38,0x45,0x44,0x45,0x7c}, /* umlauts */ +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0x79,0x14,0x12,0x14,0x79}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0x38,0x45,0x44,0x45,0x38}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0xff,0x00,0x00,0x00,0x00}, +	{0x3d,0x42,0x42,0x42,0x3d}, +	{0x3d,0x40,0x40,0x40,0x3d},  }; +	// Default palette +	const byte initVGAPalette[768] = { +	    0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x58, 0x58, 0x58, 0x70, 0x70, 0x70, 0xfc, 0xfc, 0xfc, 0x00, 0xd0, 0x00, +	    0x00, 0xfc, 0x00, 0xd8, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0xb0, 0xa0, 0xa0, 0xa0, +	    0x50, 0xc8, 0xfc, 0x28, 0xfc, 0x28, 0xf0, 0xf0, 0x00, 0xfc, 0x28, 0x28, 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, +	    0x20, 0x20, 0x20, 0x2c, 0x2c, 0x2c, 0x38, 0x38, 0x38, 0x44, 0x44, 0x44, 0x50, 0x50, 0x50, 0x60, 0x60, 0x60, +	    0x70, 0x70, 0x70, 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb4, 0xb4, 0xb4, 0xc8, 0xc8, 0xc8, +	    0xe0, 0xe0, 0xe0, 0xfc, 0xfc, 0xfc, 0x00, 0x00, 0xfc, 0x40, 0x00, 0xfc, 0x7c, 0x00, 0xfc, 0xbc, 0x00, 0xfc, +	    0xfc, 0x00, 0xfc, 0xfc, 0x00, 0xbc, 0xfc, 0x00, 0x7c, 0xfc, 0x00, 0x40, 0xfc, 0x00, 0x00, 0xfc, 0x40, 0x00, +	    0xfc, 0x7c, 0x00, 0xfc, 0xbc, 0x00, 0xfc, 0xfc, 0x00, 0xbc, 0xfc, 0x00, 0x7c, 0xfc, 0x00, 0x40, 0xfc, 0x00, +	    0x00, 0xfc, 0x00, 0x00, 0xfc, 0x40, 0x00, 0xfc, 0x7c, 0x00, 0xfc, 0xbc, 0x00, 0xfc, 0xfc, 0x00, 0xbc, 0xfc, +	    0x00, 0x7c, 0xfc, 0x00, 0x40, 0xfc, 0x7c, 0x7c, 0xfc, 0x9c, 0x7c, 0xfc, 0xbc, 0x7c, 0xfc, 0xdc, 0x7c, 0xfc, +	    0xfc, 0x7c, 0xfc, 0xfc, 0x7c, 0xdc, 0xfc, 0x7c, 0xbc, 0xfc, 0x7c, 0x9c, 0xfc, 0x7c, 0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70, 0x54, 0x00, 0x70, 0x70, 0x00, 0x54, 0x70, +	    0x00, 0x38, 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, 0x00, 0x10, 0x40, 0x00, 0x00, 0x40, 0x10, 0x00, +	    0x40, 0x20, 0x00, 0x40, 0x30, 0x00, 0x40, 0x40, 0x00, 0x30, 0x40, 0x00, 0x20, 0x40, 0x00, 0x10, 0x40, 0x00, +	    0x00, 0x40, 0x00, 0x00, 0x40, 0x10, 0x00, 0x40, 0x20, 0x00, 0x40, 0x30, 0x00, 0x40, 0x40, 0x00, 0x30, 0x40, +	    0x00, 0x20, 0x40, 0x00, 0x10, 0x40, 0x20, 0x20, 0x40, 0x28, 0x20, 0x40, 0x30, 0x20, 0x40, 0x38, 0x20, 0x40, +	    0x40, 0x20, 0x40, 0x40, 0x20, 0x38, 0x40, 0x20, 0x30, 0x40, 0x20, 0x28, 0x40, 0x20, 0x20, 0x40, 0x28, 0x20, +	    0x40, 0x30, 0x20, 0x40, 0x38, 0x20, 0x40, 0x40, 0x20, 0x38, 0x40, 0x20, 0x30, 0x40, 0x20, 0x28, 0x40, 0x20, +	    0x20, 0x40, 0x20, 0x20, 0x40, 0x28, 0x20, 0x40, 0x30, 0x20, 0x40, 0x38, 0x20, 0x40, 0x40, 0x20, 0x38, 0x40, +	    0x20, 0x30, 0x40, 0x20, 0x28, 0x40, 0x2c, 0x2c, 0x40, 0x30, 0x2c, 0x40, 0x34, 0x2c, 0x40, 0x3c, 0x2c, 0x40, +	    0x40, 0x2c, 0x40, 0x40, 0x2c, 0x3c, 0x40, 0x2c, 0x34, 0x40, 0x2c, 0x30, 0x40, 0x2c, 0x2c, 0x40, 0x30, 0x2c, +	    0x40, 0x34, 0x2c, 0x40, 0x3c, 0x2c, 0x40, 0x40, 0x2c, 0x3c, 0x40, 0x2c, 0x34, 0x40, 0x2c, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +	    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +	}; +	 +	 +} +  #endif // MSN_DEF_H diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp index 84b8550dc8..69fcea588c 100644 --- a/engines/supernova/supernova.cpp +++ b/engines/supernova/supernova.cpp @@ -46,7 +46,9 @@ namespace Supernova {  SupernovaEngine::SupernovaEngine(OSystem *syst)  	: Engine(syst)  	, _console(NULL) -    , _colorIndex(0) +    , _brightness(255) +    , _menuBrightness(255) +    , _incIndex(10)  {  //	const Common::FSNode gameDataDir(ConfMan.get("path"));  //	SearchMan.addSubDirectoryMatching(gameDataDir, "sound"); @@ -69,14 +71,13 @@ Common::Error SupernovaEngine::run() {  	debug(_system->getScreenFormat().toString().c_str());  	_console = new Console(this); -	initPalette();  	initData(); +	initPalette(); +	paletteFadeIn();  	_gameRunning = true;  	while (_gameRunning) {  		updateEvents(); -		renderImage(31, 0); -		renderText("Das Schicksal", 44, 132, 4);  		_system->updateScreen();  		_system->delayMillis(10); @@ -100,13 +101,22 @@ void SupernovaEngine::updateEvents() {  		case Common::EVENT_KEYDOWN:  			if (event.kbd.keycode == Common::KEYCODE_d && event.kbd.hasFlags(Common::KBD_CTRL)) { -				_console->attach(); +				paletteFadeOut(); +			} +			if (event.kbd.keycode == Common::KEYCODE_d && !event.kbd.hasFlags(Common::KBD_CTRL)) { +				paletteFadeIn();  			}  			if (event.kbd.keycode == Common::KEYCODE_q) {  				playSound(48, 13530);  			}  			if (event.kbd.keycode == Common::KEYCODE_w) { -				++_colorIndex; +				renderImage(_incIndex, 0); +				if (_incIndex == 31) { +					renderText("Das Schicksal", 44, 132, 4); +					renderText("des Horst Hummel", 35, 142, 4); +					renderText("Teil 1:", 64, 120, 12); +				} +				++_incIndex;  			}  			break;  		default: @@ -119,62 +129,7 @@ void SupernovaEngine::initData() {  }  void SupernovaEngine::initPalette() { -	// Default VGA palette -	byte pal[768] = { -	    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, -	    0x70, 0x70, 0x70, 0x80, 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0, 0xa0, 0xa0, 0xb4, 0xb4, 0xb4, 0xc8, 0xc8, 0xc8, -	    0xe0, 0xe0, 0xe0, 0xfc, 0xfc, 0xfc, 0x00, 0x00, 0xfc, 0x40, 0x00, 0xfc, 0x7c, 0x00, 0xfc, 0xbc, 0x00, 0xfc, -	    0xfc, 0x00, 0xfc, 0xfc, 0x00, 0xbc, 0xfc, 0x00, 0x7c, 0xfc, 0x00, 0x40, 0xfc, 0x00, 0x00, 0xfc, 0x40, 0x00, -	    0xfc, 0x7c, 0x00, 0xfc, 0xbc, 0x00, 0xfc, 0xfc, 0x00, 0xbc, 0xfc, 0x00, 0x7c, 0xfc, 0x00, 0x40, 0xfc, 0x00, -	    0x00, 0xfc, 0x00, 0x00, 0xfc, 0x40, 0x00, 0xfc, 0x7c, 0x00, 0xfc, 0xbc, 0x00, 0xfc, 0xfc, 0x00, 0xbc, 0xfc, -	    0x00, 0x7c, 0xfc, 0x00, 0x40, 0xfc, 0x7c, 0x7c, 0xfc, 0x9c, 0x7c, 0xfc, 0xbc, 0x7c, 0xfc, 0xdc, 0x7c, 0xfc, -	    0xfc, 0x7c, 0xfc, 0xfc, 0x7c, 0xdc, 0xfc, 0x7c, 0xbc, 0xfc,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1c, 0x00, 0x70, 0x38, 0x00, 0x70, 0x54, 0x00, 0x70, 0x70, 0x00, 0x54, 0x70, -	    0x00, 0x38, 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, 0x00, 0x10, 0x40, 0x00, 0x00, 0x40, 0x10, 0x00, -	    0x40, 0x20, 0x00, 0x40, 0x30, 0x00, 0x40, 0x40, 0x00, 0x30, 0x40, 0x00, 0x20, 0x40, 0x00, 0x10, 0x40, 0x00, -	    0x00, 0x40, 0x00, 0x00, 0x40, 0x10, 0x00, 0x40, 0x20, 0x00, 0x40, 0x30, 0x00, 0x40, 0x40, 0x00, 0x30, 0x40, -	    0x00, 0x20, 0x40, 0x00, 0x10, 0x40, 0x20, 0x20, 0x40, 0x28, 0x20, 0x40, 0x30, 0x20, 0x40, 0x38, 0x20, 0x40, -	    0x40, 0x20, 0x40, 0x40, 0x20, 0x38, 0x40, 0x20, 0x30, 0x40, 0x20, 0x28, 0x40, 0x20, 0x20, 0x40, 0x28, 0x20, -	    0x40, 0x30, 0x20, 0x40, 0x38, 0x20, 0x40, 0x40, 0x20, 0x38, 0x40, 0x20, 0x30, 0x40, 0x20, 0x28, 0x40, 0x20, -	    0x20, 0x40, 0x20, 0x20, 0x40, 0x28, 0x20, 0x40, 0x30, 0x20, 0x40, 0x38, 0x20, 0x40, 0x40, 0x20, 0x38, 0x40, -	    0x20, 0x30, 0x40, 0x20, 0x28, 0x40, 0x2c, 0x2c, 0x40, 0x30, 0x2c, 0x40, 0x34, 0x2c, 0x40, 0x3c, 0x2c, 0x40, -	    0x40, 0x2c, 0x40, 0x40, 0x2c, 0x3c, 0x40, 0x2c, 0x34, 0x40, 0x2c, 0x30, 0x40, 0x2c, 0x2c, 0x40, 0x30, 0x2c, -	    0x40, 0x34, 0x2c, 0x40, 0x3c, 0x2c, 0x40, 0x40, 0x2c, 0x3c, 0x40, 0x2c, 0x34, 0x40, 0x2c, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -	    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -	}; -	 -	byte init_pal[] = { -	     0, 0, 0, 16,16,16, 22,22,22, 28,28,28, -	    63,63,63,  0,52, 0,  0,63, 0, 54, 0, 0, -	    63, 0, 0,  0, 0,30,  0, 0,45, 40,40,40, -	    20,50,63, 10,63,10, 60,60, 0, 63,10,10 -	}; -	 -	_system->getPaletteManager()->setPalette(pal, 0, 256); -	_system->getPaletteManager()->setPalette(init_pal, 0, 16); +	_system->getPaletteManager()->setPalette(initVGAPalette, 0, 256);  }  void SupernovaEngine::playSound(int filenumber, int offset) { @@ -216,6 +171,8 @@ void SupernovaEngine::renderImage(int filenumber, int section) {  	_image.loadStream(file);  	_image.loadSection(section); +	_system->getPaletteManager()->setPalette(_image.getPalette(), 16, 240); +	paletteBrightness();  	_system->copyRectToScreen(_image.getSurface()->getPixels(), 320, 0, 0, 320, 200);  } @@ -346,5 +303,57 @@ void SupernovaEngine::renderBox(int x, int y, int width, int height, byte color)  	_system->unlockScreen();  } +void SupernovaEngine::paletteBrightness() { +	byte palette[768]; +	 +	_system->getPaletteManager()->grabPalette(palette, 0, 256); +	for (size_t i = 0; i < 48; ++i) { +		palette[i] = (initVGAPalette[i] * _menuBrightness) >> 8; +	} +	for (size_t i = 48; i < 768; ++i) { +		const byte *imagePalette; +		if (_image.getPalette()) { +			imagePalette = _image.getPalette(); +		} else { +			imagePalette = palette; +		} +		palette[i] = (imagePalette[i - 48] * _brightness) >> 8; +	} +	_system->getPaletteManager()->setPalette(palette, 0, 256);  } +void SupernovaEngine::paletteFadeOut() { +	// TODO: scene 0 (newspaper article in intro, mode 0x11) +	//       needs to be handled differently +	 +	while (_brightness > 20) { +		_menuBrightness = _brightness; +		paletteBrightness(); +		_brightness -= 20; +		_system->updateScreen(); +		_system->delayMillis(10); +	} +	_menuBrightness = 0; +	_brightness = 0; +	paletteBrightness(); +	_system->updateScreen(); +} + +void SupernovaEngine::paletteFadeIn() { +	// TODO: scene 0 (newspaper article in intro, mode 0x11) +	//       needs to be handled differently +	 +	while (_brightness < 235) { +		_menuBrightness = _brightness; +		paletteBrightness(); +		_brightness += 20; +		_system->updateScreen(); +		_system->delayMillis(10); +	} +	_menuBrightness = 255; +	_brightness = 255; +	paletteBrightness(); +	_system->updateScreen(); +} + +} diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h index cac80e14f7..13c3dab2eb 100644 --- a/engines/supernova/supernova.h +++ b/engines/supernova/supernova.h @@ -54,10 +54,15 @@ private:  	Audio::SoundHandle _soundHandle;  	bool _gameRunning;  	MSNImageDecoder _image; -	byte _colorIndex; +	byte _incIndex; +	byte _menuBrightness; +	byte _brightness;  	void initData();  	void initPalette(); +	void paletteFadeIn(); +	void paletteFadeOut(); +	void paletteBrightness();  	void updateEvents();  	void playSound(int filenumber, int offset = 0);  	void playSoundMod(int filenumber); | 
