summaryrefslogtreecommitdiff
path: root/src/overlay.h
blob: c690c64886f2179f8d8741e2664502ad366d1028 (plain)
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
#pragma once
#include "udp.h"
#include "config.h"

struct OVERLAY_DATA {
  TELEMETRY      telem;
  CONFIG         cfg;
  F64            disp_rpm, peak_rpm;
  F64            disp_boost_bar, peak_boost_bar;
  F64            abs_until, tcs_until;
  F64            last_power;
  F64            last_acc;
  F64            last_rpm;
  F64            t_prev;
  F32            last_pos_x, last_pos_y, last_pos_z;
  F32            tele_pos_x, tele_pos_y, tele_pos_z;
  F32            vel_x, vel_y, vel_z;
  U32            teleported;
  U8             was_race_on;
  I32            last_brake, last_hb;
  I32            frame;

  F32            valid_redline;
  I32            valid_shift;
  I32            shift_rpm;
  I32            last_gear;
  I32            last_valid_gear;

  U8           was_live;
  F64            live_since;
  F64            boost_since;
  I32            car_ordinal;
  F32            car_rpm_max;
  I32            prev_race_on;
  U8           lc_armed;

  F64            prev_disp_rpm, rpm_vel;
  F64            prev_disp_bar, bar_vel;

};

OVERLAY_DATA* overlay_inst();
U8            overlay_live( OVERLAY_DATA* d, F64 now );
void          overlay_update( OVERLAY_DATA *d, F64 now, F64 dt );
U8            overlay_visible( OVERLAY_DATA *d, F64 now );
void          overlay_build_cluster( OVERLAY_DATA* d, class GAUGE_RENDERER* gauge, F32 w, F32 h, F64 now );