Ignore:
Timestamp:
Nov 9, 2003, 6:21:43 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • src/weapons.c: + Removed draw_circle, use ee_draw_circle instead.
  • libee/circle.c: + New ee_draw_circle function.
  • libee/line.c: + Changed an internal function's name.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/src/weapons.c

    r90 r98  
    2828static void draw_nuke(int x, int y, int frame);
    2929static void draw_beam(int x, int y, int frame);
    30 static void draw_circle(int x, int y, int r, char c);
    3130static void draw_fragbomb(int x, int y, int frame);
    3231
     
    704703    /* Lots of duplicate pixels, but we don't care */
    705704    ee_color(EE_BLUE);
    706     draw_circle(x, y, r++, ':');
     705    ee_draw_circle(x, y, r++, ':');
    707706    ee_color(EE_CYAN);
    708     draw_circle(x, y, r++, '%');
     707    ee_draw_circle(x, y, r++, '%');
    709708    ee_color(EE_WHITE);
    710     draw_circle(x, y, r++, '#');
    711     draw_circle(x, y, r++, '#');
     709    ee_draw_circle(x, y, r++, '#');
     710    ee_draw_circle(x, y, r++, '#');
    712711}
    713712
    714 static void draw_circle(int x, int y, int r, char c)
    715 {
    716     int test, dx, dy;
    717 
    718     /* Optimized Bresenham. Kick ass. */
    719     for(test = 0, dx = 0, dy = r ; dx <= dy ; dx++)
    720     {
    721         ee_putcharTO(x + dx, y + dy / 2, c);
    722         ee_putcharTO(x - dx, y + dy / 2, c);
    723         ee_putcharTO(x + dx, y - dy / 2, c);
    724         ee_putcharTO(x - dx, y - dy / 2, c);
    725 
    726         ee_putcharTO(x + dy, y + dx / 2, c);
    727         ee_putcharTO(x - dy, y + dx / 2, c);
    728         ee_putcharTO(x + dy, y - dx / 2, c);
    729         ee_putcharTO(x - dy, y - dx / 2, c);
    730 
    731         test += test > 0 ? dx - dy-- : dx;
    732     }
    733 }
    734 
Note: See TracChangeset for help on using the changeset viewer.