forked from sam-itt/sofis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathladder-gauge.h
More file actions
50 lines (36 loc) · 1.01 KB
/
ladder-gauge.h
File metadata and controls
50 lines (36 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* SPDX-FileCopyrightText: 2021 Samuel Cuella <samuel.cuella@gmail.com>
*
* This file is part of SoFIS - an open source EFIS
*
* SPDX-License-Identifier: GPL-2.0-only
*/
#ifndef LADDER_GAUGE_H
#define LADDER_GAUGE_H
#include <stdbool.h>
#include "sfv-gauge.h"
#include "ladder-page.h"
#include "misc.h"
#define N_PAGES 4
typedef struct{
GenericLayer *layer;
SDL_Rect src;
SDL_Rect dst;
}LadderPagePatch;
typedef struct{
LadderPagePatch patches[3]; /*Up to 3: top, middle, bottom*/
uintf8_t npatches;
int pskip;
}LadderGaugeState;
typedef struct{
SfvGauge super;
int rubis;
LadderPage *pages[N_PAGES];
uintf8_t base;
LadderPageDescriptor *descriptor;
LadderGaugeState state;
}LadderGauge;
LadderGauge *ladder_gauge_new(LadderPageDescriptor *descriptor, int rubis);
LadderGauge *ladder_gauge_init(LadderGauge *self, LadderPageDescriptor *descriptor, int rubis);
bool ladder_gauge_set_value(LadderGauge *self, float value, bool animated);
#endif /* LADDER_GAUGE_H */