typedef struct sImage
{
unsigned w, h;
- char *data;
+ unsigned char *data;
} Image;
typedef struct sGlyph
{
unsigned x, y;
unsigned char *src;
- char *dst;
+ unsigned char *dst;
image->w = bmp->width;
image->h = bmp->rows;
return 0;
}
- image->data = (char *)malloc(image->w*image->h);
+ image->data = (unsigned char *)malloc(image->w*image->h);
if(!image->data)
{
fprintf(stderr, "Cannot allocate %d bytes of memory for glyph\n", image->w*image->h);
if(!npot)
font->image.h = round_to_pot(font->image.h);
- font->image.data = (char *)alloc_image_data(font->image.w, font->image.h);
+ font->image.data = (unsigned char *)alloc_image_data(font->image.w, font->image.h);
if(!font->image.data)
return -1;
memset(font->image.data, 255, font->image.w*font->image.h);
glyphs. Since glyphs are rectangular and the image is filled starting from
the top, it's enough to track the number of used pixels at the top of each
column. */
- font->image.data = (char *)alloc_image_data(font->image.w, font->image.h);
+ font->image.data = (unsigned char *)alloc_image_data(font->image.w, font->image.h);
if(!font->image.data)
return -1;
memset(font->image.data, 255, font->image.w*font->image.h);