Browse Source

* Minor coding style changes.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/ttyvaders/trunk@166 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 21 years ago
parent
commit
12dccf2f4d
3 changed files with 7 additions and 7 deletions
  1. +3
    -3
      libee/conic.c
  2. +3
    -3
      libee/line.c
  3. +1
    -1
      src/box.c

+ 3
- 3
libee/conic.c View File

@@ -56,7 +56,7 @@ void ee_fill_ellipse(int xo, int yo, int a, int b, char c)
int y = b; int y = b;
int d1 = b*b - (a*a*b) + (a*a/4); int d1 = b*b - (a*a*b) + (a*a/4);


while( a*a*y - a*a/2 > b*b*(x+1))
while(a*a*y - a*a/2 > b*b*(x+1))
{ {
if(d1 < 0) if(d1 < 0)
{ {
@@ -103,7 +103,7 @@ void ee_draw_ellipse(int xo, int yo, int a, int b, char c)


ellipsepoints(xo, yo, x, y, c); ellipsepoints(xo, yo, x, y, c);


while( a*a*y - a*a/2 > b*b*(x+1))
while(a*a*y - a*a/2 > b*b*(x+1))
{ {
if(d1 < 0) if(d1 < 0)
{ {
@@ -146,7 +146,7 @@ void ee_draw_thin_ellipse(int xo, int yo, int a, int b)


ellipsepoints(xo, yo, x, y, '-'); ellipsepoints(xo, yo, x, y, '-');


while( a*a*y - a*a/2 > b*b*(x+1))
while(a*a*y - a*a/2 > b*b*(x+1))
{ {
if(d1 < 0) if(d1 < 0)
{ {


+ 3
- 3
libee/line.c View File

@@ -161,18 +161,18 @@ static void clip_line(struct line* s)
s->y1 = s->y2 - (s->x2 - 0) * (s->y2 - s->y1) / (s->x2 - s->x1); s->y1 = s->y2 - (s->x2 - 0) * (s->y2 - s->y1) / (s->x2 - s->x1);
s->x1 = 0; s->x1 = 0;
} }
else if( bits1 & (1<<1) )
else if(bits1 & (1<<1))
{ {
int xmax = ee_get_width() - 1; int xmax = ee_get_width() - 1;
s->y1 = s->y2 - (s->x2 - xmax) * (s->y2 - s->y1) / (s->x2 - s->x1); s->y1 = s->y2 - (s->x2 - xmax) * (s->y2 - s->y1) / (s->x2 - s->x1);
s->x1 = xmax; s->x1 = xmax;
} }
else if( bits1 & (1<<2) )
else if(bits1 & (1<<2))
{ {
s->x1 = s->x2 - (s->y2 - 0) * (s->x2 - s->x1) / (s->y2 - s->y1); s->x1 = s->x2 - (s->y2 - 0) * (s->x2 - s->x1) / (s->y2 - s->y1);
s->y1 = 0; s->y1 = 0;
} }
else if( bits1 & (1<<3) )
else if(bits1 & (1<<3))
{ {
int ymax = ee_get_height() - 1; int ymax = ee_get_height() - 1;
s->x1 = s->x2 - (s->y2 - ymax) * (s->x2 - s->x1) / (s->y2 - s->y1); s->x1 = s->x2 - (s->y2 - ymax) * (s->x2 - s->x1) / (s->y2 - s->y1);


+ 1
- 1
src/box.c View File

@@ -28,7 +28,7 @@


box * create_box(game *g, int x, int y, int w, int h) box * create_box(game *g, int x, int y, int w, int h)
{ {
box *b = malloc(sizeof( box ));
box *b = malloc(sizeof(box));


b->x = x; b->x = x;
b->y = y; b->y = y;


Loading…
Cancel
Save