Ignore:
Timestamp:
May 20, 2009, 4:44:47 PM (11 years ago)
Author:
Pascal Terjan
Message:

Revert r3478

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/codec/export.c

    r3478 r3491  
    163163{
    164164    char *data, *cur;
    165     int f, i, n;
    166 
    167     /* at least 72 bytes for the header:
     165    int f, n;
     166
     167    /* 52 bytes for the header:
    168168     *  - 4 bytes for "\xCA\xCA" + "CV"
    169      *  - 20 bytes for the canvas header
    170      *  - 16 bytes for each dirty rectangle info
    171      *  - 32 bytes for each frame info
     169     *  - 16 bytes for the canvas header
     170     *  - 32 bytes for the frame info
    172171     * 8 bytes for each character cell */
    173     *bytes = 24 + 16 * cv->ndirty + (32 + 8 * cv->width * cv->height) * cv->framecount;
     172    *bytes = 20 + (32 + 8 * cv->width * cv->height) * cv->framecount;
    174173    cur = data = malloc(*bytes);
    175174
     
    178177
    179178    /* canvas_header */
    180     cur += sprintu32(cur, 20 + 16 * cv->ndirty + 32 * cv->framecount);
     179    cur += sprintu32(cur, 16 + 32 * cv->framecount);
    181180    cur += sprintu32(cur, cv->width * cv->height * 8 * cv->framecount);
    182     cur += sprintu16(cur, 0x0002);
    183     cur += sprintu32(cur, cv->ndirty);
     181    cur += sprintu16(cur, 0x0001);
    184182    cur += sprintu32(cur, cv->framecount);
    185183    cur += sprintu16(cur, 0x0000);
    186 
    187     /* dirty rectangles info */
    188     for(i = 0; i < cv->ndirty; i++)
    189     {
    190         cur += sprintu32(cur, cv->dirty_xmin);
    191         cur += sprintu32(cur, cv->dirty_ymin);
    192         cur += sprintu32(cur, cv->dirty_xmax);
    193         cur += sprintu32(cur, cv->dirty_ymax);
    194     }
    195184
    196185    /* frame_info */
Note: See TracChangeset for help on using the changeset viewer.