Changeset 136
- Timestamp:
- Nov 10, 2003, 7:29:04 PM (17 years ago)
- Location:
- ttyvaders/trunk/libee
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/libee/conic.c
r132 r136 27 27 #include "ee.h" 28 28 29 static void ellipsepoints(int, int, int, int, char); 30 29 31 void ee_draw_circle(int x, int y, int r, char c) 30 32 { … … 34 36 for(test = 0, dx = 0, dy = r ; dx <= dy ; dx++) 35 37 { 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); 45 40 46 41 test += test > 0 ? dx - dy-- : dx; 47 42 } 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);56 43 } 57 44 … … 98 85 } 99 86 87 static 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 -
ttyvaders/trunk/libee/sprite.c
r122 r136 131 131 void ee_set_sprite_frame(struct ee_sprite *sprite, int f) 132 132 { 133 if(sprite == NULL) 134 return; 135 133 136 if(f < 0 || f >= sprite->nf) 134 137 return; … … 139 142 int ee_get_sprite_frame(struct ee_sprite *sprite) 140 143 { 144 if(sprite == NULL) 145 return -1; 146 141 147 return sprite->f; 142 148 } … … 145 151 { 146 152 int i, j; 147 struct ee_frame *frame = &sprite->frames[sprite->f]; 153 struct ee_frame *frame; 154 155 if(sprite == NULL) 156 return; 157 158 frame = &sprite->frames[sprite->f]; 148 159 149 160 for(j = 0; j < frame->h; j++) … … 166 177 int i; 167 178 179 if(sprite == NULL) 180 return; 181 168 182 for(i = sprite->nf; i--;) 169 183 {
Note: See TracChangeset
for help on using the changeset viewer.