From d3641a12c27c1daabc95ff5115b0d4a1e81a156c Mon Sep 17 00:00:00 2001 From: Ryan Flegel Date: Sat, 15 May 2004 10:29:35 +0000 Subject: [PATCH] - fixed drawgradient() function (res fix) SVN-Revision: 1189 --- src/screen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/screen.cpp b/src/screen.cpp index fa685b157..52071d210 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -82,11 +82,11 @@ void drawgradient(Color top_clr, Color bot_clr) { #endif - for(float y = 0; y < 480; y += 2) - 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); + 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); /* calculates the color for each line, based in the generic equation for functions: y = mx + b */ #ifndef NOOPENGL -- 2.11.0