From 7c64631792f5bb3bd804ff5880808d275be89a4d Mon Sep 17 00:00:00 2001 From: Dan Everton Date: Thu, 16 Feb 2006 18:55:36 +0000 Subject: Actually fix the palette issue. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8705 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/lcd-sdl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c index 4a0962dbec..3327dd8350 100644 --- a/uisimulator/sdl/lcd-sdl.c +++ b/uisimulator/sdl/lcd-sdl.c @@ -73,9 +73,9 @@ void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, in SDL_Color palette[steps]; for (i = 0; i < steps; i++) { - palette[i].r = start->r + (end->r - start->r) * i / steps; - palette[i].g = start->g + (end->g - start->g) * i / steps; - palette[i].b = start->b + (end->b - start->b) * i / steps; + palette[i].r = start->r + (end->r - start->r) * i / (steps - 1); + palette[i].g = start->g + (end->g - start->g) * i / (steps - 1); + palette[i].b = start->b + (end->b - start->b) * i / (steps - 1); } SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, 0, steps); -- cgit v1.2.3