Changeset 185 for libcaca/trunk/libcaca/box.c
 Timestamp:
 Nov 16, 2003, 1:33:35 AM (19 years ago)
 Location:
 libcaca/trunk/libcaca
 Files:

 1 edited
 1 moved
Legend:
 Unmodified
 Added
 Removed

libcaca/trunk/libcaca/box.c
r159 r185 1 1 /* 2 * lib eeASCIIArt library2 * libcaca ASCIIArt library 3 3 * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> 4 4 * All Rights Reserved … … 25 25 #include <stdlib.h> 26 26 27 #include " ee.h"28 #include " ee_internals.h"27 #include "caca.h" 28 #include "caca_internals.h" 29 29 30 void ee_draw_box(int x1, int y1, int x2, int y2, char c)30 void caca_draw_box(int x1, int y1, int x2, int y2, char c) 31 31 { 32 ee_draw_line(x1, y1, x1, y2, c);33 ee_draw_line(x1, y2, x2, y2, c);34 ee_draw_line(x2, y2, x2, y1, c);35 ee_draw_line(x2, y1, x1, y1, c);32 caca_draw_line(x1, y1, x1, y2, c); 33 caca_draw_line(x1, y2, x2, y2, c); 34 caca_draw_line(x2, y2, x2, y1, c); 35 caca_draw_line(x2, y1, x1, y1, c); 36 36 } 37 37 38 void ee_draw_thin_box(int x1, int y1, int x2, int y2)38 void caca_draw_thin_box(int x1, int y1, int x2, int y2) 39 39 { 40 40 int x, y, xmax, ymax; … … 52 52 } 53 53 54 xmax = ee_get_width()  1;55 ymax = ee_get_height()  1;54 xmax = caca_get_width()  1; 55 ymax = caca_get_height()  1; 56 56 57 57 if(x2 < 0  y2 < 0  x1 > xmax  y1 > ymax) … … 61 61 if(y1 >= 0) 62 62 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 63 ee_putchar(x, y1, '');63 caca_putchar(x, y1, ''); 64 64 65 65 if(y2 <= ymax) 66 66 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 67 ee_putchar(x, y2, '');67 caca_putchar(x, y2, ''); 68 68 69 69 if(x1 >= 0) 70 70 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 71 ee_putchar(x1, y, '');71 caca_putchar(x1, y, ''); 72 72 73 73 if(x2 <= xmax) 74 74 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 75 ee_putchar(x2, y, '');75 caca_putchar(x2, y, ''); 76 76 77 77 /* Draw corners */ 78 78 if(x1 >= 0 && y1 >= 0) 79 ee_putchar(x1, y1, ',');79 caca_putchar(x1, y1, ','); 80 80 81 81 if(x1 >= 0 && y2 <= ymax) 82 ee_putchar(x1, y2, '`');82 caca_putchar(x1, y2, '`'); 83 83 84 84 if(x2 <= xmax && y1 >= 0) 85 ee_putchar(x2, y1, '.');85 caca_putchar(x2, y1, '.'); 86 86 87 87 if(x2 <= xmax && y2 <= ymax) 88 ee_putchar(x2, y2, '\'');88 caca_putchar(x2, y2, '\''); 89 89 } 90 90 91 void ee_fill_box(int x1, int y1, int x2, int y2, char c)91 void caca_fill_box(int x1, int y1, int x2, int y2, char c) 92 92 { 93 93 int x, y, xmax, ymax; … … 105 105 } 106 106 107 xmax = ee_get_width()  1;108 ymax = ee_get_height()  1;107 xmax = caca_get_width()  1; 108 ymax = caca_get_height()  1; 109 109 110 110 if(x2 < 0  y2 < 0  x1 > xmax  y1 > ymax) … … 118 118 for(y = y1; y <= y2; y++) 119 119 for(x = x1; x <= x2; x++) 120 ee_putchar(x, y, c);120 caca_putchar(x, y, c); 121 121 } 122 122
Note: See TracChangeset
for help on using the changeset viewer.