Merge pull request #1 from lioncash/glyph

Rename charDesc_s to Glyph
This commit is contained in:
bunnei 2014-11-27 20:07:56 -05:00
commit bc693011b3
3 changed files with 277 additions and 262 deletions

View File

@ -1,19 +1,34 @@
#pragma once #pragma once
struct charDesc_s { struct Glyph {
// Glyph representation
char c; char c;
int x, y, w, h, xo, yo, xa;
// x and y origin of the character.
int x, y;
// width and height in pixels.
int w, h;
// x and y offset
int xo, yo;
// Pixels after this character to begin
// drawing the next one.
int xa;
// Glyph data.
u8* data; u8* data;
}; };
struct font_s { struct font_s {
u8* data; u8* data;
charDesc_s* desc; Glyph* desc;
u8 height; u8 height;
u8 color[3]; u8 color[3];
}; };
extern u8 font1Data[]; extern u8 font1Data[];
extern charDesc_s font1Desc[]; extern Glyph font1Desc[];
extern font_s fontDefault; extern font_s fontDefault;

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
//this code is not meant to be readable //this code is not meant to be readable
int drawCharacter(u8* fb, font_s* font, char c, s16 x, s16 y, u16 w, u16 h) int drawCharacter(u8* fb, font_s* font, char c, s16 x, s16 y, u16 w, u16 h)
{ {
charDesc_s* cd = &font->desc[(int)c]; Glyph* cd = &font->desc[(int)c];
if (!cd->data) if (!cd->data)
return 0; return 0;