place the placeholders
This commit is contained in:
parent
f252776afd
commit
971ce1d541
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 4.4 KiB |
|
@ -1,6 +1,7 @@
|
|||
# gint bopti_image_t
|
||||
background.png:
|
||||
type: bopti-image
|
||||
profile: p4
|
||||
name: bimg_background
|
||||
bar3.png:
|
||||
type: bopti-image
|
||||
|
@ -8,4 +9,5 @@ bar3.png:
|
|||
name: bimg_bar3
|
||||
icons.png:
|
||||
type: bopti-image
|
||||
profile: p4
|
||||
name: bimg_icons
|
||||
|
|
BIN
assets/icons.png
BIN
assets/icons.png
Binary file not shown.
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 467 B |
|
@ -8,9 +8,9 @@ extern bopti_image_t bimg_icons;
|
|||
#define BAR_Y 48
|
||||
#define BAR_HEIGHT (DHEIGHT - BAR_Y - 16)
|
||||
#define BAR_BASE_FILL 0.5
|
||||
#define BAR_ICON_HEIGHT 16
|
||||
#define BAR_ICON_WIDTH 16
|
||||
#define BAR_ICON_Y (BAR_Y - BAR_ICON_HEIGHT - 16)
|
||||
#define BAR_ICON_HEIGHT 24
|
||||
#define BAR_ICON_WIDTH 24
|
||||
#define BAR_ICON_Y (BAR_Y - BAR_ICON_HEIGHT - 12)
|
||||
|
||||
struct Bar {
|
||||
int id;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#define CHOICE_OK "OK"
|
||||
|
||||
#define BUTTON_WIDTH 52
|
||||
#define BUTTON_HEIGHT 32
|
||||
#define BUTTON_Y (DHEIGHT - BUTTON_HEIGHT * 1.7)
|
||||
#define BUTTON_HEIGHT 24
|
||||
#define BUTTON_Y (DHEIGHT - BUTTON_HEIGHT - 12)
|
||||
|
||||
struct Choice {
|
||||
int cursor;
|
||||
|
|
|
@ -25,6 +25,7 @@ bar_draw(struct Bar bar)
|
|||
dsubimage(bar.x, i, vimg_bar3, 0, bar.limit_height,
|
||||
vimg_bar3->width, 1, DIMAGE_NOCLIP);
|
||||
/* draw icons */
|
||||
dsubimage(bar.x, BAR_ICON_Y, &bimg_icons, BAR_ICON_WIDTH * bar.id, 0,
|
||||
BAR_ICON_WIDTH, BAR_ICON_HEIGHT, DIMAGE_NOCLIP);
|
||||
dsubimage(bar.x + (BAR_WIDTH - BAR_ICON_WIDTH) / 2, BAR_ICON_Y,
|
||||
&bimg_icons, BAR_ICON_WIDTH * bar.id, 0, BAR_ICON_WIDTH,
|
||||
BAR_ICON_HEIGHT, DIMAGE_NOCLIP);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ main(void)
|
|||
{
|
||||
int i;
|
||||
key_event_t key_ev;
|
||||
usb_interface_t const *interfaces[] = { &usb_ff_bulk, NULL };
|
||||
usb_interface_t const *interfaces[] = {&usb_ff_bulk, NULL};
|
||||
|
||||
/* init */
|
||||
usb_open(interfaces, GINT_CALL_NULL);
|
||||
|
@ -43,18 +43,15 @@ main(void)
|
|||
static void
|
||||
main_draw(void)
|
||||
{
|
||||
static color_t colors[4] = { C_RED, C_GREEN, C_BLUE, C_WHITE };
|
||||
extern bopti_image_t bimg_background;
|
||||
int i;
|
||||
|
||||
/* draw background */
|
||||
dimage(0, 0, &bimg_background);
|
||||
dimage(-2, 0, &bimg_background);
|
||||
|
||||
/* draw bars */
|
||||
for (i = 0; i < BAR_TOTAL; i += 1) {
|
||||
*vcol_bar3 = colors[i];
|
||||
for (i = 0; i < BAR_TOTAL; i += 1)
|
||||
bar_draw(bars[i]);
|
||||
}
|
||||
|
||||
/* draw choice */
|
||||
choice_draw(choice);
|
||||
|
|
Loading…
Reference in New Issue