Changeset 291


Ignore:
Timestamp:
Dec 31, 2003, 1:05:44 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • src/caca.c: + Do not try the X11 driver if DISPLAY is set to the empty string.
  • examples/cacaview.c: + Cosmetic fixes.
Location:
libcaca/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/examples/cacaview.c

    r290 r291  
    11/*
    2  *  view          image viewer for libcaca
     2 *  cacaview      image viewer for libcaca
    33 *  Copyright (c) 2003 Sam Hocevar <sam@zoy.org>
    44 *                All Rights Reserved
     
    6161int x, y;
    6262unsigned int w, h, depth, bpp, rmask, gmask, bmask, amask;
     63#if !defined(HAVE_IMLIB2_H)
    6364unsigned int red[256], green[256], blue[256], alpha[256];
     65#endif
    6466
    6567int main(int argc, char **argv)
     
    288290            newbitmap = caca_create_bitmap(bpp, 2 * xn, 2 * yn, depth * w,
    289291                                           rmask, gmask, bmask, amask);
     292#if !defined(HAVE_IMLIB2_H)
    290293            if(bpp == 8)
    291294                caca_set_bitmap_palette(newbitmap, red, green, blue, alpha);
     295#endif
    292296            draw_checkers(0, fullscreen ? 0 : 1,
    293297                          ww - 1, fullscreen ? wh - 1 : wh - 3);
     
    369373static void unload_image(void)
    370374{
    371 #ifdef HAVE_IMLIB2_H
     375#if defined(HAVE_IMLIB2_H)
    372376    if(image)
    373377        imlib_free_image();
     
    386390static void load_image(const char *name)
    387391{
    388 #ifdef HAVE_IMLIB2_H
     392#if defined(HAVE_IMLIB2_H)
    389393    /* Load the new image */
    390394    image = imlib_load_image(name);
  • libcaca/trunk/src/caca.c

    r286 r291  
    408408#if defined(USE_X11)
    409409#if defined(HAVE_GETENV)
    410     if(getenv("DISPLAY"))
     410    if(getenv("DISPLAY") && *(getenv("DISPLAY")))
    411411#endif
    412412    {
Note: See TracChangeset for help on using the changeset viewer.