Ignore:
Timestamp:
Nov 10, 2003, 10:17:47 PM (19 years ago)
Author:
Sam Hocevar
Message:
  • libee/sprite.c: + Made sprite loading more robust.
  • src/explosions.c: + No longer use ee_putchar etc. to draw our sprites, but use

ee_draw_sprite().

  • data/: + Drew explosion_medium and explosion_small sprites.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/libee/sprite.c

    r135 r139  
    8989        for(y = 0; y < h; y++)
    9090        {
    91             memset(buf, ' ', w);
    92             buf[w] = '\0';
    9391            if(!fgets(buf, BUFSIZ, fd))
    9492                goto failed;
    9593
    96             for(x = 0; x < w; x++)
     94            for(x = 0; x < w && buf[x] && buf[x] != '\r' && buf[x] != '\n'; x++)
    9795                frame->chars[w * y + x] = buf[x];
     96
     97            for(; x < w; x++)
     98                frame->chars[w * y + x] = ' ';
    9899        }
    99100
    100101        for(y = 0; y < h; y++)
    101102        {
    102             memset(buf, ' ', w);
    103             buf[w] = '\0';
    104103            if(!fgets(buf, BUFSIZ, fd))
    105104                goto failed;
    106105
    107             for(x = 0; x < w; x++)
     106            for(x = 0; x < w && buf[x] && buf[x] != '\r' && buf[x] != '\n'; x++)
    108107                frame->color[w * y + x] = buf[x] - 'a';
     108
     109            for(; x < w; x++)
     110                frame->color[w * y + x] = ' ' - 'a';
    109111        }
    110112
Note: See TracChangeset for help on using the changeset viewer.