Ignore:
Timestamp:
Dec 11, 2003, 5:31:49 PM (19 years ago)
Author:
Sam Hocevar
Message:
  • src/graphics.c: + Internally cache screen width and height.
  • src/bitmap.c: + Added alpha support to caca_draw_bitmap(). For now, we only treat 0%

alpha as fully transparent, and any other value as fully opaque.

+ Slightly tuned colour weights in the renderer.
+ caca_set_bitmap_palette() takes unsigned ints.

  • examples/demo.c: + Added a crap render demo.
  • examples/aafire.c: + Set a 20ms delay. + Added alpha values to the palette.
  • examples/view.c: + Draw a gray checkered grid below the image so that transparent images

look a lot nicer.

+ 'f' toggles "fullscreen" mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/caca.c

    r238 r246  
    3939#   include <dos.h>
    4040#   include <conio.h>
    41 #   if defined(SCREENUPDATE_IN_PC_H)
    42 #       include <pc.h>
    43 #   endif
    4441#else
    4542#   error "no graphics library detected"
     
    6360
    6461#if defined(USE_CONIO)
    65 static struct text_info ti;
    6662char *_caca_screen;
    6763#endif
     
    133129unsigned int caca_get_width(void)
    134130{
    135 #if defined(USE_SLANG)
    136     return SLtt_Screen_Cols;
    137 #elif defined(USE_NCURSES)
    138     return COLS;
    139 #elif defined(USE_CONIO)
    140     return ti.screenwidth;
    141 #endif
     131    return _caca_width;
    142132}
    143133
    144134unsigned int caca_get_height(void)
    145135{
    146 #if defined(USE_SLANG)
    147     return SLtt_Screen_Rows;
    148 #elif defined(USE_NCURSES)
    149     return LINES;
    150 #else
    151     return ti.screenheight;
    152 #endif
     136    return _caca_height;
    153137}
    154138
     
    213197    textcolor((enum COLORS)WHITE);
    214198    textbackground((enum COLORS)BLACK);
    215     gotoxy(caca_get_width(), caca_get_height());
     199    gotoxy(_caca_width, _caca_height);
    216200    cputs("\r\n");
    217201    _setcursortype(_NORMALCURSOR);
Note: See TracChangeset for help on using the changeset viewer.