Second version of fix for display of all scanlines in preview render for
authorTon Roosendaal <ton@blender.org>
Sat, 12 Feb 2005 14:15:08 +0000 (14:15 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 12 Feb 2005 14:15:08 +0000 (14:15 +0000)
wacko 3d cards... now it draws 5 scanlines in a time, with first being
drawn double.

source/blender/src/previewrender.c

index 0f682c18f72d0a6739c39848faf147e3304aef30..d2f4f9abcae14b89e13254d3109ceb3589dd5709 100644 (file)
@@ -286,13 +286,16 @@ static void end_previewrect(void)
 static void display_pr_scanline(unsigned int *rect, int recty)
 {
        
-       /* we do steps of 4 scanlines, doing 2 gives errors on some gfx cards (nvidia geforce) */
+       /* we do steps of 4 scanlines. but draw 5, because of errors in some gfx cards (nvidia geforce, ati...) */
        if( (recty & 3)==3) {
                
-               rect+= (recty-3)*PR_RECTX;
-               
-               glaDrawPixelsSafe(prerect.xmin, prerect.ymin + (((float)recty-3.0)*pr_facy), PR_RECTX, 4, rect);
-               
+               if(recty == 3) {
+                       glaDrawPixelsSafe(prerect.xmin, prerect.ymin, PR_RECTX, 4, rect);
+               }
+               else {
+                       rect+= (recty-4)*PR_RECTX;
+                       glaDrawPixelsSafe(prerect.xmin, prerect.ymin + (((float)recty-4.0)*pr_facy), PR_RECTX, 5, rect);
+               }
        }
 }