aboutsummaryrefslogtreecommitdiff
path: root/gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'gui.c')
-rw-r--r--gui.c17
1 files 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)