aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-04-23 02:14:45 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-04-23 02:14:45 +0000
commit81c2db583542fdcb121d99aabd27ecc8af3c4a2c (patch)
treeee9eeceb4ad0a57f12ac4b9fe32bae42751f3461
parent958f6b5bd834121362183f33cabd1d75290429ab (diff)
misc
-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)