From 81c2db583542fdcb121d99aabd27ecc8af3c4a2c Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 23 Apr 2012 02:14:45 +0000 Subject: misc --- gui.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gui.c b/gui.c index cd3384b..1eff06b 100644 --- a/gui.c +++ b/gui.c @@ -152,30 +152,33 @@ keyboard(unsigned short *m) return 0; } -#if 0 void loadfont(unsigned short *m, char *font) { - int w, h, x, y, ch; + int w, h, x, y, ch, i, p; SDL_Surface *img; SDL_Rect frame; img = IMG_Load(font); - w = img->w / 4; - h = img->h / 8; + w = img->w / gl.w; + h = img->h / gl.h; for (x = 0; x < img->h; x += 8) { for (y = 0; y < img->w; y += 4) { - ch = y / 4 + x / 8 * w; - //printf("%d\n", ch); + ch = 2 * (y / gl.w + x / gl.h * w); + for (i = 0; i < gl.h; i++) { + p = !!getpixel(img, x + i, y + 0); + p = !!getpixel(img, x + i, y + 1); + p = !!getpixel(img, x + i, y + 2); + p = !!getpixel(img, x + i, y + 3); + } } } SDL_FreeSurface(img); } -#endif void setfont(unsigned short *m) -- cgit v1.2.3