pcadmin/src/main.c

57 lines
880 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);
extern color_t *vcol_bar3;
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.6);
bar_change(&bars[BAR_SUN], 69.42);
2021-05-24 12:11:04 +02:00
2021-05-24 11:19:21 +02:00
main_draw();
getkey();
/* deinit */
bar_deinit();
2021-05-24 11:19:21 +02:00
return 1;
}
static void
main_draw(void)
{
static color_t colors[4] = { C_RED, C_GREEN, C_BLUE, C_WHITE };
2021-05-24 11:19:21 +02:00
extern bopti_image_t bimg_background;
int i;
/* draw background */
dimage(0, 0, &bimg_background);
/* draw bars */
for (i = 0; i < BAR_TOTAL; i += 1) {
*vcol_bar3 = colors[i];
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
}