pcadmin/src/main.c

48 lines
689 B
C
Raw Normal View History

2021-04-16 11:08:47 +02:00
#include "bar.h"
2021-05-24 23:04:03 +02:00
#include "choice.h"
2021-04-16 11:08:47 +02:00
#include <gint/display.h>
#include <gint/keyboard.h>
2021-05-24 12:11:04 +02:00
static struct Bar bars[BAR_TOTAL];
2021-05-24 23:04:03 +02:00
static struct Choice choice;
2021-05-24 11:19:21 +02:00
static void main_draw(void);
2021-04-16 11:08:47 +02:00
int
main(void)
{
2021-05-24 11:07:56 +02:00
int i;
2021-05-24 11:19:21 +02:00
/* init */
2021-05-24 12:11:04 +02:00
for (i = 0; i < BAR_TOTAL; i += 1)
2021-05-24 11:07:56 +02:00
bars[i] = bar_init(i);
2021-05-24 23:04:03 +02:00
choice = choice_init();
2021-04-16 11:08:47 +02:00
2021-05-24 12:11:04 +02:00
bar_change(&bars[BAR_CASH], 0.2);
bar_change(&bars[BAR_SMILE], 0.4);
2021-05-24 11:19:21 +02:00
main_draw();
getkey();
return 1;
}
static void
main_draw(void)
{
extern bopti_image_t bimg_background;
int i;
/* draw background */
dimage(0, 0, &bimg_background);
/* draw bars */
2021-05-24 12:11:04 +02:00
for (i = 0; i < BAR_TOTAL; i += 1)
2021-05-24 11:07:56 +02:00
bar_draw(bars[i]);
2021-04-16 11:08:47 +02:00
2021-05-24 23:04:03 +02:00
/* draw choice */
choice_draw(choice);
2021-05-24 11:19:21 +02:00
dupdate();
2021-04-16 11:08:47 +02:00
}