pcadmin/include/bar.h

30 lines
645 B
C
Raw Normal View History

2021-04-16 11:08:47 +02:00
#pragma once
#include <gint/display.h>
extern bopti_image_t bimg_bar3;
2021-05-24 11:07:56 +02:00
#define BAR_WIDTH 16
#define BAR_Y 48
#define BAR_HEIGHT (DHEIGHT - BAR_Y - 16)
2021-04-16 11:08:47 +02:00
#define BAR_BASE_FILL 0.5
struct Bar {
int x;
int y;
int height;
int limit_height;
2021-04-16 11:08:47 +02:00
float fill;
};
2021-05-24 12:11:04 +02:00
#define BAR_TOTAL 4
2021-05-24 11:07:56 +02:00
enum BarID { BAR_CASH, BAR_HUMAN, BAR_SMILE, BAR_SUN };
struct Bar bar_init(enum BarID bar_id);
2021-04-16 11:08:47 +02:00
void bar_update(struct Bar *bar);
void bar_draw(struct Bar bar);
2021-05-24 12:11:04 +02:00
/* Increase/decrease bar fill level.
* Return 1 when bar is fully filled.
* Return -1 when bar is fully emptied.
* Return 0 otherwise. */
int bar_change(struct Bar *bar, float modifier);