mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-28 15:26:12 +00:00
PRIVATE: Simplify palette code
This commit is contained in:
parent
3e019c1d94
commit
6c0fda035e
@ -1404,14 +1404,8 @@ void PrivateEngine::drawScreen() {
|
|||||||
// No use of _compositeSurface, we write the frame directly to the screen in the expected position
|
// No use of _compositeSurface, we write the frame directly to the screen in the expected position
|
||||||
g_system->copyRectToScreen(frame->getPixels(), frame->pitch, center.x, center.y, frame->w, frame->h);
|
g_system->copyRectToScreen(frame->getPixels(), frame->pitch, center.x, center.y, frame->w, frame->h);
|
||||||
} else {
|
} else {
|
||||||
const byte *cPalette = (const byte *) _compositeSurface->getPalette();
|
byte newPalette[256 * 3];
|
||||||
|
_compositeSurface->grabPalette(newPalette, 0, 256);
|
||||||
byte newPalette[768];
|
|
||||||
for (int c = 0; c < 256; c++) { // This avoids any endianness issues
|
|
||||||
uint32 y = READ_UINT32(&cPalette[c * 4]) & 0x00FFFFFF;
|
|
||||||
WRITE_LE_UINT24(&newPalette[c * 3], y);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_system->getPaletteManager()->setPalette(newPalette, 0, 256);
|
g_system->getPaletteManager()->setPalette(newPalette, 0, 256);
|
||||||
|
|
||||||
if (_mode == 1) {
|
if (_mode == 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user