Ignore:
Timestamp:
Apr 18, 2006, 5:11:25 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Renamed caca_t into caca_display_t.
  • Renamed canvas handle variables from "c" to "cv". Eh ouais mon gros.
File:
1 edited

Legend:

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

    r810 r811  
    5050};
    5151
    52 static int vga_init_graphics(caca_t *kk)
     52static int vga_init_graphics(caca_display_t *dp)
    5353{
    5454    int i;
     
    7575
    7676    /* We don't have much choice */
    77     _cucul_set_size(kk->c, 80, 25);
     77    _cucul_set_size(dp->cv, 80, 25);
    7878
    7979    return 0;
    8080}
    8181
    82 static int vga_end_graphics(caca_t *kk)
     82static int vga_end_graphics(caca_display_t *dp)
    8383{
    8484    uint8_t tmp;
     
    9494}
    9595
    96 static int vga_set_window_title(caca_t *kk, char const *title)
     96static int vga_set_window_title(caca_display_t *dp, char const *title)
    9797{
    9898    /* Unsupported, of course. */
     
    100100}
    101101
    102 static unsigned int vga_get_window_width(caca_t *kk)
     102static unsigned int vga_get_window_width(caca_display_t *dp)
    103103{
    104104    /* Fallback to a 320x200 screen */
     
    106106}
    107107
    108 static unsigned int vga_get_window_height(caca_t *kk)
     108static unsigned int vga_get_window_height(caca_display_t *dp)
    109109{
    110110    /* Fallback to a 320x200 screen */
     
    112112}
    113113
    114 static void vga_display(caca_t *kk)
     114static void vga_display(caca_display_t *dp)
    115115{
    116116    char *screen = (char *)(intptr_t)0x000b8000;
    117     uint32_t *attr = kk->c->attr;
    118     uint32_t *chars = kk->c->chars;
     117    uint32_t *attr = dp->cv->attr;
     118    uint32_t *chars = dp->cv->chars;
    119119    int n;
    120120
    121     for(n = kk->c->height * kk->c->width; n--; )
     121    for(n = dp->cv->height * dp->cv->width; n--; )
    122122    {
    123123        *screen++ = _cucul_utf32_to_cp437(*chars++);
     
    126126}
    127127
    128 static void vga_handle_resize(caca_t *kk)
     128static void vga_handle_resize(caca_display_t *dp)
    129129{
    130130    /* We know nothing about our window */
    131     kk->resize.w = kk->c->width;
    132     kk->resize.h = kk->c->height;
     131    dp->resize.w = dp->cv->width;
     132    dp->resize.h = dp->cv->height;
    133133}
    134134
    135 static int vga_get_event(caca_t *kk, caca_event-t *ev)
     135static int vga_get_event(caca_display_t *dp, caca_event-t *ev)
    136136{
    137137    /* FIXME */
     
    144144 */
    145145
    146 int vga_install(caca_t *kk)
     146int vga_install(caca_display_t *dp)
    147147{
    148     kk->drv.driver = CACA_DRIVER_VGA;
     148    dp->drv.driver = CACA_DRIVER_VGA;
    149149
    150     kk->drv.init_graphics = vga_init_graphics;
    151     kk->drv.end_graphics = vga_end_graphics;
    152     kk->drv.set_window_title = vga_set_window_title;
    153     kk->drv.get_window_width = vga_get_window_width;
    154     kk->drv.get_window_height = vga_get_window_height;
    155     kk->drv.display = vga_display;
    156     kk->drv.handle_resize = vga_handle_resize;
    157     kk->drv.get_event = vga_get_event;
    158     kk->drv.set_mouse = NULL;
     150    dp->drv.init_graphics = vga_init_graphics;
     151    dp->drv.end_graphics = vga_end_graphics;
     152    dp->drv.set_window_title = vga_set_window_title;
     153    dp->drv.get_window_width = vga_get_window_width;
     154    dp->drv.get_window_height = vga_get_window_height;
     155    dp->drv.display = vga_display;
     156    dp->drv.handle_resize = vga_handle_resize;
     157    dp->drv.get_event = vga_get_event;
     158    dp->drv.set_mouse = NULL;
    159159
    160160    return 0;
Note: See TracChangeset for help on using the changeset viewer.