35 lines
804 B
C
35 lines
804 B
C
#pragma once
|
|
#include <gint/display.h>
|
|
|
|
extern bopti_image_t bimg_bar3;
|
|
extern bopti_image_t bimg_icons;
|
|
|
|
#define BAR_WIDTH 16
|
|
#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)
|
|
|
|
struct Bar {
|
|
int id;
|
|
int x;
|
|
int y;
|
|
int height;
|
|
int limit_height;
|
|
float fill;
|
|
};
|
|
|
|
#define BAR_TOTAL 4
|
|
enum BarID { BAR_CASH, BAR_HUMAN, BAR_SMILE, BAR_SUN };
|
|
|
|
struct Bar bar_init(enum BarID bar_id);
|
|
void bar_update(struct Bar *bar);
|
|
void bar_draw(struct Bar bar);
|
|
/* 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);
|