[Super-tux-commit] supertux/src screen.cpp,1.6,1.7
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-04-13 15:34:20
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22506/src Modified Files: screen.cpp Log Message: Fixed SDL code of drawgradient(). I forgot that the axis in SDL are positve in the Up-Down direction. Now you shouldn't notice any difference between SDL and OpenGL gradients ;) Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- screen.cpp 13 Apr 2004 11:34:54 -0000 1.6 +++ screen.cpp 13 Apr 2004 15:20:20 -0000 1.7 @@ -75,9 +75,10 @@ #endif for(float y = 0; y < 480; y += 2) - fillrect(0, (int)y, 640, 2, (int)(((float)(top_clr.red-bot_clr.red)/640) * y + top_clr.red), - (int)(((float)(top_clr.green-bot_clr.green)/640) * y + top_clr.green), - (int)(((float)(top_clr.blue-bot_clr.blue)/640) * y + top_clr.blue), 255); + fillrect(0, (int)y, 640, 2, + (int)(((float)(top_clr.red-bot_clr.red)/(0-480)) * y + top_clr.red), + (int)(((float)(top_clr.green-bot_clr.green)/(0-480)) * y + top_clr.green), + (int)(((float)(top_clr.blue-bot_clr.blue)/(0-480)) * y + top_clr.blue), 255); /* calculates the color for each line, based in the generic equation for functions: y = mx + b */ #ifndef NOOPENGL |