mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
M4: Updated for OSystem Palette RGBA->RGB Change.
This commit is contained in:
parent
292f197142
commit
10e2cec6b9
@ -43,8 +43,8 @@ static void strToLower(char *s) {
|
||||
}
|
||||
|
||||
const RGB8 DIALOG_PALETTE[8] = {
|
||||
{0x80, 0x80, 0x80, 0xff}, {0x90, 0x90, 0x90, 0xff}, {0x70, 0x70, 0x70, 0xff}, {0x9c, 0x9c, 0x9c, 0xff},
|
||||
{0x80, 0x80, 0x80, 0xff}, {0x90, 0x90, 0x90, 0xff}, {0xDC, 0xDC, 0xDC, 0xff}, {0x00, 0x00, 0x00, 0xff}
|
||||
{0x80, 0x80, 0x80}, {0x90, 0x90, 0x90}, {0x70, 0x70, 0x70}, {0x9c, 0x9c, 0x9c},
|
||||
{0x80, 0x80, 0x80}, {0x90, 0x90, 0x90}, {0xDC, 0xDC, 0xDC}, {0x00, 0x00, 0x00}
|
||||
};
|
||||
|
||||
#define ROR16(v,amt) (((uint16)(v) >> amt) | ((uint16)(v) << (16 - amt)))
|
||||
|
@ -795,7 +795,11 @@ void M4Surface::m4LoadBackground(Common::SeekableReadStream *source) {
|
||||
palette[i].b = source->readByte() << 2;
|
||||
palette[i].g = source->readByte() << 2;
|
||||
palette[i].r = source->readByte() << 2;
|
||||
palette[i].u = source->readByte() << 2;
|
||||
// FIXME - Removed u field from RGB8 as the OSystem palette is now RGB.
|
||||
// If this is needed, then the system setPalette() call will need changing to skip this.
|
||||
uint8 u = source->readByte() << 2;
|
||||
if (u != 0)
|
||||
debugC(1, kDebugGraphics, "Unused u field in Palette data non-zero: %d", u);
|
||||
|
||||
if ((blackIndex == 0) && !palette[i].r && !palette[i].g && !palette[i].b)
|
||||
blackIndex = i;
|
||||
@ -1049,7 +1053,6 @@ void Palette::setEntry(uint index, uint8 r, uint8 g, uint8 b) {
|
||||
c.r = r;
|
||||
c.g = g;
|
||||
c.b = b;
|
||||
c.u = 255;
|
||||
g_system->getPaletteManager()->setPalette((const byte *)&c, index, 1);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ struct BGR8 {
|
||||
};
|
||||
|
||||
struct RGB8 {
|
||||
uint8 r, g, b, u;
|
||||
uint8 r, g, b;
|
||||
};
|
||||
|
||||
//later use ScummVM's Rect?
|
||||
@ -214,8 +214,8 @@ private:
|
||||
MadsM4Engine *_vm;
|
||||
bool _colorsChanged;
|
||||
bool _fading_in_progress;
|
||||
byte _originalPalette[256 * 4];
|
||||
byte _fadedPalette[256 * 4];
|
||||
byte _originalPalette[256 * 3];
|
||||
byte _fadedPalette[256 * 3];
|
||||
int _usageCount[256];
|
||||
|
||||
void reset();
|
||||
|
@ -111,8 +111,8 @@ void MadsScene::loadSceneTemporary() {
|
||||
/* Existing code that eventually needs to be replaced with the proper MADS code */
|
||||
// Set system palette entries
|
||||
_vm->_palette->blockRange(0, 18);
|
||||
RGB8 sysColors[3] = { {0x1f<<2, 0x2d<<2, 0x31<<2, 0}, {0x24<<2, 0x37<<2, 0x3a<<2, 0},
|
||||
{0x00<<2, 0x10<<2, 0x16<<2, 0}};
|
||||
RGB8 sysColors[3] = { {0x1f<<2, 0x2d<<2, 0x31<<2}, {0x24<<2, 0x37<<2, 0x3a<<2},
|
||||
{0x00<<2, 0x10<<2, 0x16<<2}};
|
||||
_vm->_palette->setPalette(&sysColors[0], 4, 3);
|
||||
|
||||
_interfaceSurface->initialise();
|
||||
|
@ -149,11 +149,11 @@ void Scene::showCodes() {
|
||||
for (int i = 0; i < _walkSurface->width() * _walkSurface->height(); i++)
|
||||
destP[i] = (srcP[i] & 0x10) ? 0xFF : 0;
|
||||
|
||||
byte colors[256 * 4];
|
||||
byte colors[256 * 3];
|
||||
memset(colors, 0, sizeof(colors));
|
||||
colors[255 * 4 + 0] = 255;
|
||||
colors[255 * 4 + 1] = 255;
|
||||
colors[255 * 4 + 2] = 255;
|
||||
colors[255 * 3 + 0] = 255;
|
||||
colors[255 * 3 + 1] = 255;
|
||||
colors[255 * 3 + 2] = 255;
|
||||
_vm->_palette->setPalette(colors, 0, 256);
|
||||
} else {
|
||||
// MADS handling
|
||||
|
@ -321,12 +321,12 @@ void WoodScript::update() {
|
||||
|
||||
{
|
||||
// FIXME: This should be done when a new palette is set
|
||||
byte palette[1024];
|
||||
byte palette[768];
|
||||
g_system->getPaletteManager()->grabPalette(palette, 0, 256);
|
||||
for (int i = 0; i < 256; i++) {
|
||||
_mainPalette[i].r = palette[i * 4 + 0];
|
||||
_mainPalette[i].g = palette[i * 4 + 1];
|
||||
_mainPalette[i].b = palette[i * 4 + 2];
|
||||
_mainPalette[i].r = palette[i * 3 + 0];
|
||||
_mainPalette[i].g = palette[i * 3 + 1];
|
||||
_mainPalette[i].b = palette[i * 3 + 2];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user