9 static const struct menuent {
10 int x, y, len, height;
19 static uint16_t *bgpix;
20 static int bgwidth, bgheight;
24 if(!(bgpix = img_load_pixels("data/menbg640.png", &bgwidth, &bgheight, IMG_FMT_RGB565))) {
25 fprintf(stderr, "failed to load menu bg image\n");
31 void menu_cleanup(void)
33 img_free_pixels(bgpix);
39 key_event = menu_keyb;
50 static uint16_t blurbuf[2][16384];
53 const struct menuent *ent = menuent + cur;
55 y = ent->y - ent->height / 2;
56 offs = y * fb_width + ent->x;
57 blit(blurbuf[0], ent->len, bgpix + offs, ent->len, ent->height, bgwidth);
59 blur_grey_horiz(blurbuf[1], blurbuf[0], ent->len, ent->height, 7, 0x100);
63 memcpy(fb_pixels, bgpix, fb_size);
64 blit(fb_pixels + offs, fb_width, blurbuf[1], ent->len, ent->height, ent->len);
66 blit_frame(fb_pixels, 0);
69 void menu_keyb(int key, int pressed)
83 if(cur < sizeof menuent / sizeof *menuent - 1) {