
Former-commit-id: 03042b53b1c453e267695262a6b801ee9569ada5 Former-commit-id: 96eb24339b9ec6e7b8740a562c5869fe3b0b7de7
36 lines
670 B
C
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);
|
|
} |