[Super-tux-commit] supertux/src screen.cpp,1.14,1.15
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-05-15 14:19:11
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26735/src Modified Files: screen.cpp Log Message: I allways noticed that in the SDL mode, the gradient was sometimes different than the OpenGL. But when I did the function, everything was okay and in most of the gradients it worked fine. Finally, gone to the code and corrected that. It was just a typo (screen->w was being used in green and blue calculation, instead of screen->h). Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- screen.cpp 15 May 2004 10:29:35 -0000 1.14 +++ screen.cpp 15 May 2004 14:19:01 -0000 1.15 @@ -82,11 +82,14 @@ { #endif +//void fillrect(float x, float y, float w, float h, int r, int g, int b, int a) + for(float y = 0; y < screen->h; y += 2) fillrect(0, (int)y, screen->w, 2, - (int)(((float)(top_clr.red-bot_clr.red)/(0-screen->h)) * y + top_clr.red), - (int)(((float)(top_clr.green-bot_clr.green)/(0-screen->w)) * y + top_clr.green), - (int)(((float)(top_clr.blue-bot_clr.blue)/(0-screen->w)) * y + top_clr.blue), 255); + (int)(((float)(top_clr.red-bot_clr.red)/(0-screen->h)) * y + top_clr.red), + (int)(((float)(top_clr.green-bot_clr.green)/(0-screen->h)) * y + top_clr.green), + (int)(((float)(top_clr.blue-bot_clr.blue)/(0-screen->h)) * y + top_clr.blue), + 255); /* calculates the color for each line, based in the generic equation for functions: y = mx + b */ #ifndef NOOPENGL |