From d3452b01c8aad35e6d55523323247eeb114dc7d1 Mon Sep 17 00:00:00 2001 From: Cate Date: Tue, 12 Jul 2011 11:28:33 -0400 Subject: OMG FIXES. Lots of fixes for triangle brush to make sure it works, from Cracker. Edited CLST to prevent "popcorning" when its float hits weird numbers. Also fixed it so it freezes nicely when cooled. Fingers are back! :DDD diff --git a/src/elements/clst.c b/src/elements/clst.c index db0eb7c..15b5624 100644 --- a/src/elements/clst.c +++ b/src/elements/clst.c @@ -16,7 +16,16 @@ int update_CLST(UPDATE_FUNC_ARGS) { } if ((r&0xFF)==PT_CLST) { - parts[i].vx += 0.01*rx; parts[i].vy += 0.01*ry; + if(parts[i].temp <195) + cxy = 0.05; + if(parts[i].temp >= 195 && parts[i].temp <295) + cxy = 0.015; + if(parts[i].temp >= 295 && parts[i].temp <350) + cxy = 0.01; + if(parts[i].temp > 350) + cxy = 0.005; + parts[i].vx += cxy*rx; + parts[i].vy += cxy*ry;//These two can be set not to calculate over 350 later. They do virtually nothing over 0.005. } } return 0; diff --git a/src/graphics.c b/src/graphics.c index 2013de6..40f57c1 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -4247,13 +4247,14 @@ void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry) } } else if (CURRENT_BRUSH==TRI_BRUSH) - { + { for (j=-ry; j<=ry; j++) - for (i=-rx; i<=rx; i++) - if ((j <= ry ) && ( j >= (((-2.0*ry)/rx)*i) -ry) && ( j >= (((-2.0*ry)/(-rx))*i)-ry ) && (j+1>ry || (j-1 < (((-2.0*ry)/rx)*i) -ry) || ( j-1 < (((-2.0*ry)/(-rx))*i)-ry )) ) - { - xor_pixel(x+i, y+j, vid); - } + for (i=-rx; i<=0; i++) + if ((j <= ry ) && ( j >= (((-2.0*ry)/(rx))*i)-ry ) && (j+1>ry || ( j-1 < (((-2.0*ry)/(rx))*i)-ry )) ) + { + xor_pixel(x+i, y+j, vid); + if (i) xor_pixel(x-i, y+j, vid); + } } } diff --git a/src/main.c b/src/main.c index 9d68465..075cab0 100644 --- a/src/main.c +++ b/src/main.c @@ -3055,7 +3055,7 @@ int main(int argc, char *argv[]) { for (j=-bsy; j<=bsy; j++) for (i=-bsx; i<=bsx; i++) - if (lx+i>=0 && ly+j>=0 && lx+i0 && y+j>0 && x+i0 && y+j>0 && x+i0 && y+j>0 && x+i= (((-2.0*ry)/rx)*i) -ry) && ( j >= (((-2.0*ry)/(-rx))*i)-ry ) ; break; + default: + return 0; + break; } } void create_line(int x1, int y1, int x2, int y2, int rx, int ry, int c) -- cgit v0.9.2-21-gd62e