mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-23 20:59:42 +02:00
ubb-la/gui.c: add section titles and reorder some of the functions
This commit is contained in:
parent
533e9643ac
commit
0925b0f060
22
ubb-la/gui.c
22
ubb-la/gui.c
@ -45,6 +45,9 @@
|
||||
static SDL_Surface *surf;
|
||||
|
||||
|
||||
/* ----- SDL initialization and screen-wide functions ---------------------- */
|
||||
|
||||
|
||||
void gui_init(void)
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||
@ -70,6 +73,16 @@ static void clear(void)
|
||||
}
|
||||
|
||||
|
||||
static void update(void)
|
||||
{
|
||||
SDL_UnlockSurface(surf);
|
||||
SDL_UpdateRect(surf, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
/* ----- Waveform elements ------------------------------------------------- */
|
||||
|
||||
|
||||
static inline int ch_y(int ch, int v)
|
||||
{
|
||||
return CH_YOFF+CH_SKIP*ch+(v ? 0 : CH_HEIGHT);
|
||||
@ -97,6 +110,9 @@ static void level(int x0, int x1, int ch, int v)
|
||||
}
|
||||
|
||||
|
||||
/* ----- Show (part of) a buffer ------------------------------------------- */
|
||||
|
||||
|
||||
static void show_buffer_zoom_in(const uint8_t *buf, int skip, int nibbles,
|
||||
int x0, int x1)
|
||||
{
|
||||
@ -206,11 +222,7 @@ static void show_buffer(const uint8_t *buf, int skip, int nibbles,
|
||||
}
|
||||
|
||||
|
||||
static void update(void)
|
||||
{
|
||||
SDL_UnlockSurface(surf);
|
||||
SDL_UpdateRect(surf, 0, 0, 0, 0);
|
||||
}
|
||||
/* ----- Main event loop --------------------------------------------------- */
|
||||
|
||||
|
||||
static int pos_step(int zoom)
|
||||
|
Loading…
Reference in New Issue
Block a user