summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2010-12-03 05:13:00 (GMT)
committer Cracker64 <cracker642@gmail.com>2010-12-03 05:13:00 (GMT)
commit01a2dcaf419b207702d959a5016107674c636325 (patch)
tree0d02d0dc687ca7442b5e6ed8c4e9ed91972e5743 /src/graphics.c
parent25ac5e7a660485ab4417c6b343f96fb03a930fb1 (diff)
downloadpowder-01a2dcaf419b207702d959a5016107674c636325.zip
powder-01a2dcaf419b207702d959a5016107674c636325.tar.gz
lots and lots of small changes/fixes. fixed typo for water movement, made parts_avg kinda better? electronics still work.
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 5561f04..ed1a4b3 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -2882,24 +2882,15 @@ corrupt:
return 1;
}
-void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry)
+void render_cursor(pixel *vid, int x, int y, int t, int rx, int ry)
{
int i,j,c;
- float temprx, tempry;
if(t<PT_NUM||t==SPC_AIR||t==SPC_HEAT||t==SPC_COOL||t==SPC_VACUUM)
{
- tempry = ry;
- temprx = rx;
if(rx<=0)
- {
xor_pixel(x, y, vid);
- temprx = 1;
- }
else if(ry<=0)
- {
xor_pixel(x, y, vid);
- tempry = 1;
- }
if(rx+ry<=0)
xor_pixel(x, y, vid);
else if(CURRENT_BRUSH==SQUARE_BRUSH)
@@ -2917,7 +2908,7 @@ void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry)
else if(CURRENT_BRUSH==CIRCLE_BRUSH)
for(j=0; j<=ry; j++)
for(i=0; i<=rx; i++)
- if((i*i)/(temprx*temprx)+(j*j)/(tempry*tempry)<=1 && (((i+1)*(i+1))/(temprx*temprx)+(j*j)/(tempry*tempry)>1 || ((i*i)/(temprx*temprx)+((j+1)*(j+1))/(tempry*tempry)>1)))
+ if((pow(i,2))/(pow(rx,2))+(pow(j,2))/(pow(ry,2))<=1 && ((pow(i+1,2))/(pow(rx,2))+(pow(j,2))/(pow(ry,2))>1 || (pow(i,2))/(pow(rx,2))+(pow(j+1,2))/(pow(ry,2))>1))
{
xor_pixel(x+i, y+j, vid);
if(j) xor_pixel(x+i, y-j, vid);
@@ -2928,7 +2919,7 @@ void render_cursor(pixel *vid, int x, int y, int t, float rx, float ry)
else
{
int tc;
- c = ((int)rx/CELL) * CELL;
+ c = (rx/CELL) * CELL;
x = (x/CELL) * CELL;
y = (y/CELL) * CELL;