57 lines
880 B
C
57 lines
880 B
C
#include "bar.h"
|
|
#include "choice.h"
|
|
#include <gint/display.h>
|
|
#include <gint/keyboard.h>
|
|
|
|
static struct Bar bars[BAR_TOTAL];
|
|
static struct Choice choice;
|
|
|
|
static void main_draw(void);
|
|
|
|
extern color_t *vcol_bar3;
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
int i;
|
|
|
|
/* init */
|
|
for (i = 0; i < BAR_TOTAL; i += 1)
|
|
bars[i] = bar_init(i);
|
|
choice = choice_init();
|
|
|
|
bar_change(&bars[BAR_CASH], 0.2);
|
|
bar_change(&bars[BAR_SMILE], -0.6);
|
|
bar_change(&bars[BAR_SUN], 69.42);
|
|
|
|
main_draw();
|
|
getkey();
|
|
|
|
/* deinit */
|
|
bar_deinit();
|
|
|
|
return 1;
|
|
}
|
|
|
|
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);
|
|
|
|
/* draw bars */
|
|
for (i = 0; i < BAR_TOTAL; i += 1) {
|
|
*vcol_bar3 = colors[i];
|
|
bar_draw(bars[i]);
|
|
}
|
|
|
|
/* draw choice */
|
|
choice_draw(choice);
|
|
|
|
dupdate();
|
|
}
|