no thank you, no very nasty union tricks here
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2237 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7c57db5560
commit
89db47fde8
2 changed files with 4 additions and 14 deletions
|
@ -799,9 +799,7 @@ void test_print(unsigned char c, BDF* font, short* enc_map)
|
|||
{
|
||||
unsigned short bmp = 0;
|
||||
unsigned short sh;
|
||||
DOUBLE_BYTE db;
|
||||
db.db[0] = g->bitmap[i*2];
|
||||
db.db[1] = g->bitmap[i*2+1];
|
||||
int db= (g->bitmap[i*2] | (g->bitmap[i*2+1] <<8));
|
||||
|
||||
sh = 1 << 7; /*g->dwidth_x;*/
|
||||
|
||||
|
@ -814,7 +812,7 @@ void test_print(unsigned char c, BDF* font, short* enc_map)
|
|||
sh = 1 << (sizeof(unsigned short)*8-1);
|
||||
bit = sh>>(j - 8);
|
||||
}
|
||||
b = bit & db.sval;
|
||||
b = bit & db;
|
||||
printf( b ? "*" : " " );
|
||||
}
|
||||
|
||||
|
@ -884,9 +882,7 @@ void getBitmap(BDF_GLYPH* g, unsigned char* src)
|
|||
{
|
||||
unsigned short bmp = 0;
|
||||
unsigned short sh, srcmap;
|
||||
DOUBLE_BYTE db;
|
||||
db.db[0] = g->bitmap[i*2];
|
||||
db.db[1] = g->bitmap[i*2+1];
|
||||
int db= (g->bitmap[i*2] | (g->bitmap[i*2+1] <<8));
|
||||
|
||||
sh = 1 << 7; /*g->dwidth_x;*/
|
||||
|
||||
|
@ -906,7 +902,7 @@ void getBitmap(BDF_GLYPH* g, unsigned char* src)
|
|||
sh = 1 << (sizeof(unsigned short)*8-1);
|
||||
bit = sh>>(j - 8);
|
||||
}
|
||||
b = bit&db.sval;
|
||||
b = bit&db;
|
||||
|
||||
if (b)
|
||||
src[j*rows+d] |= srcmap;
|
||||
|
|
|
@ -60,12 +60,6 @@ typedef struct
|
|||
BDF_GLYPH* enc_table[256];
|
||||
} BDF;
|
||||
|
||||
typedef union
|
||||
{
|
||||
unsigned char db[2];
|
||||
unsigned short sval;
|
||||
} DOUBLE_BYTE;
|
||||
|
||||
BDF* readFont(const char *name);
|
||||
BDF_GLYPH* getGlyph(unsigned char c, BDF* bdf, short* enc_map);
|
||||
void getBitmap(BDF_GLYPH* g, unsigned char* src);
|
||||
|
|
Loading…
Reference in a new issue