2017-10-06 05:25:30 +02:00
|
|
|
#ifndef STRUCTS
|
|
|
|
#define STRUCTS
|
|
|
|
|
2017-09-14 05:21:36 +02:00
|
|
|
#include "defs.h"
|
|
|
|
|
2020-03-08 02:22:20 +01:00
|
|
|
#include "AircraftData.h"
|
2020-03-07 22:19:49 +01:00
|
|
|
|
|
|
|
|
2019-09-09 06:23:38 +02:00
|
|
|
typedef struct AppData
|
2017-09-14 05:21:36 +02:00
|
|
|
{
|
2019-09-08 01:11:20 +02:00
|
|
|
SDL_Window *window;
|
|
|
|
SDL_Renderer *renderer;
|
2020-02-18 07:19:45 +01:00
|
|
|
SDL_Texture *mapTexture;
|
2017-10-06 05:25:30 +02:00
|
|
|
|
2019-09-08 01:11:20 +02:00
|
|
|
TTF_Font *mapFont;
|
|
|
|
TTF_Font *mapBoldFont;
|
|
|
|
TTF_Font *listFont;
|
2017-10-06 18:34:36 +02:00
|
|
|
|
2019-09-08 01:11:20 +02:00
|
|
|
TTF_Font *messageFont;
|
|
|
|
TTF_Font *labelFont;
|
2017-10-06 18:34:36 +02:00
|
|
|
|
2017-10-10 22:56:05 +02:00
|
|
|
int mapFontWidth;
|
|
|
|
int mapFontHeight;
|
2017-10-06 18:34:36 +02:00
|
|
|
int labelFontWidth;
|
|
|
|
int labelFontHeight;
|
|
|
|
int messageFontWidth;
|
|
|
|
int messageFontHeight;
|
2017-09-16 04:25:26 +02:00
|
|
|
|
2019-09-09 06:23:38 +02:00
|
|
|
// map options
|
|
|
|
float maxDist;
|
|
|
|
|
|
|
|
//display options
|
|
|
|
int screen_upscale;
|
|
|
|
int screen_uiscale;
|
|
|
|
int screen_width;
|
|
|
|
int screen_height;
|
|
|
|
int screen_depth;
|
|
|
|
int fullscreen;
|
2020-03-12 20:46:26 +01:00
|
|
|
int screen_index;
|
2019-09-09 06:23:38 +02:00
|
|
|
|
2020-02-27 07:44:30 +01:00
|
|
|
float centerLon;
|
|
|
|
float centerLat;
|
2019-09-09 06:23:38 +02:00
|
|
|
|
2020-02-17 06:54:46 +01:00
|
|
|
uint64_t touchDownTime;
|
|
|
|
int touchx;
|
|
|
|
int touchy;
|
2020-03-07 00:44:45 +01:00
|
|
|
int tapCount;
|
2020-03-07 05:51:47 +01:00
|
|
|
int isDragging;
|
2020-02-17 06:54:46 +01:00
|
|
|
|
2020-03-06 00:02:40 +01:00
|
|
|
uint64_t mouseMovedTime;
|
|
|
|
int mousex;
|
|
|
|
int mousey;
|
|
|
|
|
2020-03-07 00:44:45 +01:00
|
|
|
float mapTargetMaxDist;
|
|
|
|
float mapTargetLat;
|
|
|
|
float mapTargetLon;
|
|
|
|
|
2020-02-18 07:19:45 +01:00
|
|
|
int mapMoved;
|
|
|
|
|
2020-03-07 22:19:49 +01:00
|
|
|
QuadTree root;
|
2019-09-09 06:23:38 +02:00
|
|
|
|
2020-03-08 02:22:20 +01:00
|
|
|
//PlaneObj *planes;
|
|
|
|
//PlaneObj *selectedPlane;
|
2019-09-09 06:23:38 +02:00
|
|
|
|
2020-03-07 22:19:49 +01:00
|
|
|
uint64_t lastFrameTime;
|
|
|
|
} AppData;
|
2020-02-18 03:11:05 +01:00
|
|
|
|
|
|
|
|
2019-09-09 06:23:38 +02:00
|
|
|
struct {
|
|
|
|
double msgRate;
|
|
|
|
double avgSig;
|
|
|
|
int numPlanes;
|
|
|
|
int numVisiblePlanes;
|
|
|
|
double maxDist;
|
|
|
|
struct aircraft *closeCall;
|
|
|
|
} Status;
|
2020-03-07 05:51:47 +01:00
|
|
|
typedef struct Style {
|
|
|
|
SDL_Color backgroundColor;
|
|
|
|
|
|
|
|
SDL_Color selectedColor;
|
|
|
|
SDL_Color planeColor;
|
|
|
|
SDL_Color planeGoneColor;
|
|
|
|
|
|
|
|
SDL_Color mapInnerColor;
|
|
|
|
SDL_Color mapOuterColor;
|
|
|
|
SDL_Color scaleBarColor;
|
|
|
|
|
|
|
|
SDL_Color buttonColor;
|
|
|
|
} Style;
|
|
|
|
|
2020-03-07 22:19:49 +01:00
|
|
|
// globals
|
|
|
|
extern AppData appData;
|
|
|
|
extern Style style;
|
2017-09-17 17:38:22 +02:00
|
|
|
|
2017-09-16 04:25:26 +02:00
|
|
|
// functions
|
2020-03-07 22:19:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2017-09-16 04:25:26 +02:00
|
|
|
|
|
|
|
//font.c
|
|
|
|
TTF_Font *loadFont(char *, int);
|
|
|
|
void closeFont(TTF_Font *);
|
|
|
|
void drawString(char *, int, int, TTF_Font *, SDL_Color);
|
2017-10-06 18:34:36 +02:00
|
|
|
void drawString90(char *, int, int, TTF_Font *, SDL_Color);
|
2017-09-17 17:38:22 +02:00
|
|
|
void drawStringBG(char *, int, int, TTF_Font *, SDL_Color, SDL_Color);
|
2017-09-16 04:25:26 +02:00
|
|
|
|
|
|
|
//init.c
|
|
|
|
void init(char *);
|
|
|
|
void cleanup(void);
|
|
|
|
|
2017-09-17 16:46:48 +02:00
|
|
|
//mapdata.c
|
2017-09-17 17:38:22 +02:00
|
|
|
void initMaps();
|
|
|
|
|
|
|
|
//list.c
|
2019-09-08 21:29:21 +02:00
|
|
|
void drawList(int top);
|
2017-10-05 16:58:23 +02:00
|
|
|
|
2017-10-06 05:25:30 +02:00
|
|
|
|
|
|
|
//status.c
|
|
|
|
void updateStatus();
|
|
|
|
void drawStatus();
|
|
|
|
|
2020-03-07 22:19:49 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2019-09-09 06:23:38 +02:00
|
|
|
|
2017-10-06 05:25:30 +02:00
|
|
|
#endif
|