+ Replace CACA_WIDTH and CACA_HEIGHT with CACA_GEOMETRY. * src/caca.c: + Documented the CACA_GEOMETRY environment variable.tags/v0.99.beta14
@@ -5,8 +5,7 @@ Changes between 0.3 and 0.4: | |||||
* preliminary X11 graphics driver | * preliminary X11 graphics driver | ||||
* support for simultaneously compiled-in drivers | * support for simultaneously compiled-in drivers | ||||
* honour the CACA_DRIVER, CACA_WIDTH, CACA_HEIGHT and CACA_FONT environment | |||||
variables | |||||
* honour the CACA_DRIVER, CACA_GEOMETRY and CACA_FONT environment variables | |||||
* more documentation | * more documentation | ||||
Changes between 0.2 and 0.3: | Changes between 0.2 and 0.3: | ||||
@@ -62,6 +62,10 @@ | |||||
* - \c slang uses the S-Lang library. | * - \c slang uses the S-Lang library. | ||||
* - \c x11 uses the native X11 driver. | * - \c x11 uses the native X11 driver. | ||||
* | * | ||||
* \li \b CACA_GEOMETRY: set the video display size. The format of this | |||||
* variable must be XxY, with X and Y being integer values. This option | |||||
* currently only works with the X11 driver. | |||||
* | |||||
* \li \b CACA_BACKGROUND: set the background type. | * \li \b CACA_BACKGROUND: set the background type. | ||||
* - \c solid uses solid coloured backgrounds for all characters. This | * - \c solid uses solid coloured backgrounds for all characters. This | ||||
* feature does not work with all terminal emulators. This is the | * feature does not work with all terminal emulators. This is the | ||||
@@ -520,13 +520,12 @@ int _caca_init_graphics(void) | |||||
const char *font_name = "8x13bold"; | const char *font_name = "8x13bold"; | ||||
int i; | int i; | ||||
if(getenv("CACA_WIDTH")) | |||||
_caca_width = atoi(getenv("CACA_WIDTH")); | |||||
if(getenv("CACA_GEOMETRY")) | |||||
sscanf(getenv("CACA_GEOMETRY"), | |||||
"%ux%u", &_caca_width, &_caca_height); | |||||
if(!_caca_width) | if(!_caca_width) | ||||
_caca_width = 80; | _caca_width = 80; | ||||
if(getenv("CACA_HEIGHT")) | |||||
_caca_height = atoi(getenv("CACA_HEIGHT")); | |||||
if(!_caca_height) | if(!_caca_height) | ||||
_caca_height = 32; | _caca_height = 32; | ||||