From bfb5eef88f1db699dc19e28d11172fcb35cdf7ec Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 11 Aug 2009 04:47:39 +0000 Subject: [PATCH] When setting the palette, the passed array is 0 based, even if the first index is not 0. Bruno, can you check if this fixes SoundPlay's colors? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32241 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/game/WindowScreen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kits/game/WindowScreen.cpp b/src/kits/game/WindowScreen.cpp index baf081d831..2d9ab90c29 100644 --- a/src/kits/game/WindowScreen.cpp +++ b/src/kits/game/WindowScreen.cpp @@ -327,7 +327,7 @@ BWindowScreen::SetColorList(rgb_color *list, int32 firstIndex, int32 lastIndex) if (!fActivateState) { // If we aren't active, we just change our local palette for (int32 x = firstIndex; x <= lastIndex; x++) { - fPalette[x] = list[x]; + fPalette[x] = list[x - firstIndex]; } } else { uint8 colors[3 * 256]; @@ -335,12 +335,12 @@ BWindowScreen::SetColorList(rgb_color *list, int32 firstIndex, int32 lastIndex) int32 j = 0; for (int32 x = firstIndex; x <= lastIndex; x++) { - fPalette[x] = list[x]; + fPalette[x] = list[x - firstIndex]; // update our local palette as well - colors[j++] = list[x].red; - colors[j++] = list[x].green; - colors[j++] = list[x].blue; + colors[j++] = fPalette[x].red; + colors[j++] = fPalette[x].green; + colors[j++] = fPalette[x].blue; } if (fAddonImage >= 0) {