Ignore:
Timestamp:
Nov 10, 2003, 7:29:04 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • libee/sprite.c: + Added sanity checks in ee_sprite_* functions.
  • libee/conic.c: + Use ellipsepoints() in ee_draw_circle().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/libee/conic.c

    r132 r136  
    2727#include "ee.h"
    2828
     29static void ellipsepoints(int, int, int, int, char);
     30
    2931void ee_draw_circle(int x, int y, int r, char c)
    3032{
     
    3436    for(test = 0, dx = 0, dy = r ; dx <= dy ; dx++)
    3537    {
    36         ee_putcharTO(x + dx, y + dy / 2, c);
    37         ee_putcharTO(x - dx, y + dy / 2, c);
    38         ee_putcharTO(x + dx, y - dy / 2, c);
    39         ee_putcharTO(x - dx, y - dy / 2, c);
    40 
    41         ee_putcharTO(x + dy, y + dx / 2, c);
    42         ee_putcharTO(x - dy, y + dx / 2, c);
    43         ee_putcharTO(x + dy, y - dx / 2, c);
    44         ee_putcharTO(x - dy, y - dx / 2, c);
     38        ellipsepoints(x, y, dx, dy, c);
     39        ellipsepoints(x, y, dy, dx, c);
    4540
    4641        test += test > 0 ? dx - dy-- : dx;
    4742    }
    48 }
    49 
    50 static void ellipsepoints(int xo, int yo, int x, int y, char c)
    51 {
    52     ee_putcharTO(xo + x, yo + y, c);
    53     ee_putcharTO(xo - x, yo + y, c);
    54     ee_putcharTO(xo + x, yo - y, c);
    55     ee_putcharTO(xo - x, yo - y, c);
    5643}
    5744
     
    9885}
    9986
     87static void ellipsepoints(int xo, int yo, int x, int y, char c)
     88{
     89    ee_putcharTO(xo + x, yo + y, c);
     90    ee_putcharTO(xo - x, yo + y, c);
     91    ee_putcharTO(xo + x, yo - y, c);
     92    ee_putcharTO(xo - x, yo - y, c);
     93}
     94
Note: See TracChangeset for help on using the changeset viewer.