viz1090/draw.c
nathan 1efbc59320 directory cleanup of old hw stuff (retained in subdir
Former-commit-id: 43a73a7b2dbb7be398f79f40602e3527d42f0e1a
Former-commit-id: d49dd4b7d39d708518a7244f16be37db47027ac7
2019-09-08 15:06:42 -05:00

36 lines
670 B
C

#include "dump1090.h"
#include "structs.h"
#include "SDL2/SDL2_rotozoom.h"
static uint64_t mstime(void) {
struct timeval tv;
uint64_t mst;
gettimeofday(&tv, NULL);
mst = ((uint64_t)tv.tv_sec)*1000;
mst += tv.tv_usec/1000;
return mst;
}
void draw() {
if ((mstime() - Modes.interactive_last_update) < MODES_INTERACTIVE_REFRESH_TIME) {
return;
}
Modes.interactive_last_update = mstime();
updateStatus();
SDL_SetRenderDrawColor( game.renderer, 0, 0, 0, 0);
SDL_RenderClear(game.renderer);
drawMap();
drawStatus();
if(!Modes.map) {
drawList(0);
}
SDL_RenderPresent(game.renderer);
}