aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/palette.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/palette.cpp')
-rw-r--r--engines/mads/palette.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp
index d7301bb369..ba63dd3145 100644
--- a/engines/mads/palette.cpp
+++ b/engines/mads/palette.cpp
@@ -237,7 +237,8 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) {
int PaletteUsage::rgbMerge(RGB6 &palEntry) {
- return palEntry.r * 38 + palEntry.g * 76 + palEntry.b * 14;
+ return ((palEntry.r + 1) / 4 - 1) * 38 + ((palEntry.g + 1) / 4 - 1) * 76 +
+ ((palEntry.b + 1) / 4 - 1) * 14;
}
void PaletteUsage::prioritizeFromList(int lst[3]) {