X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=eradicate;a=blobdiff_plain;f=src%2Fmenuscr.c;fp=src%2Fmenuscr.c;h=04b36f39a58af60d5b179ac97aa4f54b57d6be6b;hp=51f8ae96370adf14960adf3821b147cdc7fd5616;hb=5a00ac1b6ff18814600e84e74d4d1e34847e9103;hpb=7b3c578d22e5eebc4d048655da7bc711662e2179 diff --git a/src/menuscr.c b/src/menuscr.c index 51f8ae9..04b36f3 100644 --- a/src/menuscr.c +++ b/src/menuscr.c @@ -1,4 +1,5 @@ #include +#include #include "screens.h" #include "imago2.h" #include "gfx.h" @@ -8,9 +9,9 @@ static const struct menuent { int x, y, len, height; } menuent[] = { - {240, 300, 170, 32}, - {230, 360, 184, 32}, - {260, 424, 130, 32} + {240, 300, 170, 40}, + {230, 360, 184, 40}, + {260, 424, 130, 40} }; static int cur; @@ -52,27 +53,36 @@ void menu_draw(void) const struct menuent *ent = menuent + cur; y = ent->y - ent->height / 2; - offs = y * ent->len + ent->x; + offs = y * fb_width + ent->x; blit(blurbuf[0], ent->len, bgpix + offs, ent->len, ent->height, bgwidth); - //blur_grey_horiz(blurbuf[1], blurbuf[0], ent->len, ent->height, 5, 0x100); - for(i=0; iheight; i++) { - for(j=0; jlen; j++) { - blurbuf[1][i * ent->len + j] = 0xff;//~blurbuf[0][i * ent->len + j]; - } - } + blur_grey_horiz(blurbuf[1], blurbuf[0], ent->len, ent->height, 7, 0x100); wait_vsync(); - blit_frame(bgpix, 0); + memcpy(fb_pixels, bgpix, fb_size); blit(fb_pixels + offs, fb_width, blurbuf[1], ent->len, ent->height, ent->len); + + blit_frame(fb_pixels, 0); } void menu_keyb(int key, int pressed) { + if(!pressed) return; + switch(key) { case 27: game_quit(); break; + + case KB_UP: + if(cur > 0) cur--; + break; + + case KB_DOWN: + if(cur < sizeof menuent / sizeof *menuent - 1) { + cur++; + } + break; } }