Alex Henrie : winex11: Make color cubes as big as possible.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 2 09:47:14 CST 2015


Module: wine
Branch: master
Commit: e5d4d91871cbf80ecece669e2ba7b9ded00176aa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e5d4d91871cbf80ecece669e2ba7b9ded00176aa

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Thu Oct 29 21:30:22 2015 -0600

winex11: Make color cubes as big as possible.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/palette.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c
index 953c9ea..f950334 100644
--- a/dlls/winex11.drv/palette.c
+++ b/dlls/winex11.drv/palette.c
@@ -594,10 +594,10 @@ static void X11DRV_PALETTE_FillDefaultColors( const PALETTEENTRY *sys_pal_templa
 
   if (palette_size <= NB_RESERVED_COLORS)
   	return;
-  while (i*i*i < (palette_size - NB_RESERVED_COLORS)) i++;
+  while (i*i*i <= (palette_size - NB_RESERVED_COLORS)) i++;
   no_r = no_g = no_b = --i;
-  if ((no_r * (no_g+1) * no_b) < (palette_size - NB_RESERVED_COLORS)) no_g++;
-  if ((no_r * no_g * (no_b+1)) < (palette_size - NB_RESERVED_COLORS)) no_b++;
+  if ((no_r * (no_g+1) * no_b) <= (palette_size - NB_RESERVED_COLORS)) no_g++;
+  if ((no_r * no_g * (no_b+1)) <= (palette_size - NB_RESERVED_COLORS)) no_b++;
   inc_r = (255 - NB_COLORCUBE_START_INDEX)/no_r;
   inc_g = (255 - NB_COLORCUBE_START_INDEX)/no_g;
   inc_b = (255 - NB_COLORCUBE_START_INDEX)/no_b;




More information about the wine-cvs mailing list