Ignore:
Timestamp:
Nov 15, 2003, 10:58:20 AM (16 years ago)
Author:
Sam Hocevar
Message:
  • libee/graphics.c: + Correct clipping in ee_putstr() for long strings.
  • libee/ee.c: + New ee_get_rendertime() call to provide framerate information.
  • libee/ee.h: + Added const keywords where it was meaningful, despite Slang's blatant

omission of such keywords in its prototypes.

File:
1 edited

Legend:

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

    r167 r179  
    8080}
    8181
    82 void ee_putstr(int x, int y, char *s)
     82void ee_putstr(int x, int y, const char *s)
    8383{
    8484    int len;
    8585
    86     if(y < 0 || y >= ee_get_height())
     86    if(y < 0 || y >= ee_get_height() || x >= ee_get_width())
    8787        return;
    8888
     
    9696        s += -x;
    9797        x = 0;
     98    }
     99
     100    if(x + len >= ee_get_width())
     101    {
     102        memcpy(_ee_scratch_line, s, ee_get_width() - x);
     103        _ee_scratch_line[ee_get_width() - x] = '\0';
     104        s = _ee_scratch_line;
    98105    }
    99106
Note: See TracChangeset for help on using the changeset viewer.