Changeset 1233
- Timestamp:
- Oct 26, 2006, 10:16:43 AM (16 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/driver_gl.c
r1218 r1233 87 87 char *argv[2] = { "", NULL }; 88 88 char const * const * fonts; 89 unsigned int width = 0, height = 0;89 unsigned int width = dp->cv->width, height = dp->cv->height; 90 90 int argc = 1; 91 91 … … 100 100 #endif 101 101 102 if(width && height) 103 _cucul_set_canvas_size(dp->cv, width, height); 104 102 _cucul_set_canvas_size(dp->cv, width ? width : 80, height ? height : 32); 105 103 106 104 /* Load a libcucul internal font */ -
libcaca/trunk/caca/driver_raw.c
r1054 r1233 22 22 23 23 #include <stdio.h> 24 #include <stdlib.h> 24 25 25 26 #include "caca.h" … … 30 31 static int raw_init_graphics(caca_display_t *dp) 31 32 { 33 unsigned int width = dp->cv->width, height = dp->cv->height; 34 char const *geometry; 35 36 #if defined(HAVE_GETENV) 37 geometry = getenv("CACA_GEOMETRY"); 38 if(geometry && *geometry) 39 sscanf(geometry, "%ux%u", &width, &height); 40 #endif 41 42 _cucul_set_canvas_size(dp->cv, width ? width : 80, height ? height : 24); 43 32 44 return 0; 33 45 } -
libcaca/trunk/caca/driver_win32.c
r1218 r1233 113 113 114 114 /* Set the new console size */ 115 size.X = dp->cv->width ;116 size.Y = dp->cv->height ;115 size.X = dp->cv->width ? dp->cv->width : 80; 116 size.Y = dp->cv->height ? dp->cv->height : 25; 117 117 SetConsoleScreenBufferSize(dp->drv.p->screen, size); 118 118 -
libcaca/trunk/caca/driver_x11.c
r1218 r1233 68 68 char const *fonts[] = { NULL, "8x13bold", "fixed" }, **parser; 69 69 char const *geometry; 70 unsigned int width = 0, height = 0;70 unsigned int width = dp->cv->width, height = dp->cv->height; 71 71 int i; 72 72 … … 79 79 #endif 80 80 81 if(width && height) 82 _cucul_set_canvas_size(dp->cv, width, height); 81 _cucul_set_canvas_size(dp->cv, width ? width : 80, height ? height : 32); 83 82 84 83 dp->drv.p->dpy = XOpenDisplay(NULL); -
libcaca/trunk/cucul/cucul.c
r1231 r1233 44 44 * should be called at the end of the program to free all allocated resources. 45 45 * 46 * If one of the desired canvas coordinates is zero, a default canvas size47 * of 80x32 is used instead.48 *49 46 * If an error occurs, NULL is returned and \b errno is set accordingly: 50 47 * - \c ENOMEM Not enough memory for the requested canvas size. … … 57 54 { 58 55 cucul_canvas_t *cv = malloc(sizeof(cucul_canvas_t)); 59 int ret;60 56 61 57 if(!cv) … … 89 85 cv->allattr[0] = NULL; 90 86 91 /* Initialise to a default size. 80x32 is arbitrary but matches AAlib's 92 * default X11 window. When a graphic driver attaches to us, it can set 93 * a different size. */ 94 if(width && height) 95 ret = _cucul_set_canvas_size(cv, width, height); 96 else 97 ret = _cucul_set_canvas_size(cv, 80, 32); 98 99 if(ret < 0) 87 if(_cucul_set_canvas_size(cv, width, height) < 0) 100 88 { 101 89 #if defined(HAVE_ERRNO_H)
Note: See TracChangeset
for help on using the changeset viewer.