[Super-tux-commit] supertux/src screen.cpp,1.4,1.5
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-04-11 21:19:47
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27735/src Modified Files: screen.cpp Log Message: Made drawgradient() to use our fillrect(), instead of SDL thingies and thus the code is much clear now. Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- screen.cpp 11 Apr 2004 20:46:31 -0000 1.4 +++ screen.cpp 11 Apr 2004 21:06:05 -0000 1.5 @@ -74,17 +74,10 @@ { #endif - SDL_Rect r; - r.x = 0; - r.w = 640; - r.h = 2; - for(float y = 0; y < 480; y += 2) - { - r.y = (int)y; - - SDL_FillRect(screen, &r, SDL_MapRGB(screen->format, (int)(((float)(top_r-bot_r)/640) * y + top_r), (int)(((float)(top_g-bot_g)/640) * y + top_g), (int)(((float)(top_b-bot_b)/640) * y + top_b))); - } + fillrect(0, (int)y, 640, 2, (int)(((float)(top_r-bot_r)/640) * y + top_r), + (int)(((float)(top_g-bot_g)/640) * y + top_g), + (int)(((float)(top_b-bot_b)/640) * y + top_b), 255); /* calculates the color for each line, based in the generic equation for functions: y = mx + b */ #ifndef NOOPENGL |