[Scummvm-git-logs] scummvm master -> 1a604c7bd329b756612e979018ea48e516938b12
neuromancer
noreply at scummvm.org
Sat Jan 1 17:52:49 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1a604c7bd3 PRIVATE: more portable code to avoid endianness issues
Commit: 1a604c7bd329b756612e979018ea48e516938b12
https://github.com/scummvm/scummvm/commit/1a604c7bd329b756612e979018ea48e516938b12
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-01-01T18:51:49+01:00
Commit Message:
PRIVATE: more portable code to avoid endianness issues
Changed paths:
engines/private/private.cpp
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 6e1a5b02c3f..a8afc9ec48a 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -1386,9 +1386,8 @@ void PrivateEngine::drawScreen() {
byte newPalette[768];
for (int c = 0; c < 256; c++) { // This avoids any endianness issues
- newPalette[c * 3 + 0] = cPalette[c * 4 + 0];
- newPalette[c * 3 + 1] = cPalette[c * 4 + 1];
- newPalette[c * 3 + 2] = cPalette[c * 4 + 2];
+ uint32 y = READ_UINT32(&cPalette[c * 4]) & 0x00FFFFFF;
+ WRITE_LE_UINT24(&newPalette[c * 3], y);
}
g_system->getPaletteManager()->setPalette(newPalette, 0, 256);
More information about the Scummvm-git-logs
mailing list