Ignore:
Timestamp:
Mar 27, 2006, 11:33:29 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Implemented a proof-of-concept cacaplay program that can redisplay a single frame that was saved by the raw driver.
File:
1 edited

Legend:

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

    r699 r702  
    5858    uint8_t *attr = kk->qq->attr;
    5959    uint32_t *chars = kk->qq->chars;
    60     int n;
     60    uint32_t w, h;
     61    unsigned int n;
    6162
    62     fprintf(stdout, "CACA %i %i\n", kk->qq->width, kk->qq->height);
     63    w = kk->qq->width;
     64    h = kk->qq->height;
     65
     66    fprintf(stdout, "CACA%c%c%c%c%c%c%c%c",
     67                    (w >> 24), (w >> 16) & 0xff, (w >> 8) & 0xff, w & 0xff,
     68                    (h >> 24), (h >> 16) & 0xff, (h >> 8) & 0xff, h & 0xff);
     69
    6370    for(n = kk->qq->height * kk->qq->width; n--; )
    6471    {
     
    6673        uint8_t a = *attr++;
    6774
    68         fprintf(stdout, "%c%c%c%c %c", (c >> 24), (c >> 16) & 0xff,
    69                                        (c >> 8) & 0xff, c & 0xff, a);
     75        fprintf(stdout, "%c%c%c%c%c", (c >> 24), (c >> 16) & 0xff,
     76                                      (c >> 8) & 0xff, c & 0xff, a);
    7077    }
    71     fprintf(stdout, "ACAC\n");
     78
     79    fprintf(stdout, "ACAC");
    7280    fflush(stdout);
    7381}
Note: See TracChangeset for help on using the changeset viewer.