added flag for fps display
This commit is contained in:
parent
e9372475c9
commit
56a4f252d6
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -12,4 +12,16 @@ thumbs.db
|
||||||
*.shx
|
*.shx
|
||||||
*.geojson
|
*.geojson
|
||||||
|
|
||||||
|
*.cpg
|
||||||
|
*.dbf
|
||||||
|
*.zip*
|
||||||
|
*.prj
|
||||||
|
*.xml
|
||||||
|
*.html
|
||||||
|
*.txt
|
||||||
|
|
||||||
|
airportnames
|
||||||
|
mapnames
|
||||||
|
|
||||||
|
|
||||||
viz1090
|
viz1090
|
||||||
|
|
3
View.cpp
3
View.cpp
|
@ -1548,9 +1548,11 @@ void View::draw() {
|
||||||
//drawMouse();
|
//drawMouse();
|
||||||
drawClick();
|
drawClick();
|
||||||
|
|
||||||
|
if(fps) {
|
||||||
char fps[60] = " ";
|
char fps[60] = " ";
|
||||||
snprintf(fps,40," %d lines @ %.1ffps", lineCount, 1000.0 / elapsed(lastFrameTime));
|
snprintf(fps,40," %d lines @ %.1ffps", lineCount, 1000.0 / elapsed(lastFrameTime));
|
||||||
drawStringBG(fps, 0,0, mapFont, style.subLabelColor, style.backgroundColor);
|
drawStringBG(fps, 0,0, mapFont, style.subLabelColor, style.backgroundColor);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
|
|
||||||
|
@ -1569,6 +1571,7 @@ View::View(AppData *appData){
|
||||||
screen_width = 0;
|
screen_width = 0;
|
||||||
screen_height = 0;
|
screen_height = 0;
|
||||||
screen_depth = 32;
|
screen_depth = 32;
|
||||||
|
fps = 0;
|
||||||
fullscreen = 0;
|
fullscreen = 0;
|
||||||
screen_index = 0;
|
screen_index = 0;
|
||||||
|
|
||||||
|
|
2
View.h
2
View.h
|
@ -215,6 +215,8 @@ class View {
|
||||||
////////////////
|
////////////////
|
||||||
bool metric;
|
bool metric;
|
||||||
|
|
||||||
|
bool fps;
|
||||||
|
|
||||||
float maxDist;
|
float maxDist;
|
||||||
float currentMaxDist;
|
float currentMaxDist;
|
||||||
|
|
||||||
|
|
13
viz1090.cpp
13
viz1090.cpp
|
@ -48,16 +48,17 @@ void showHelp(void) {
|
||||||
"-----------------------------------------------------------------------------\n"
|
"-----------------------------------------------------------------------------\n"
|
||||||
"| viz1090 ADSB Viewer Ver : 0.1 |\n"
|
"| viz1090 ADSB Viewer Ver : 0.1 |\n"
|
||||||
"-----------------------------------------------------------------------------\n"
|
"-----------------------------------------------------------------------------\n"
|
||||||
"--server <IPv4/hosname> TCP Beast output listen IPv4 (default: 127.0.0.1)\n"
|
"--fps Show current framerate\n"
|
||||||
"--port <port> TCP Beast output listen port (default: 30005)\n"
|
"--fullscreen Start fullscreen\n"
|
||||||
|
"--help Show this help\n"
|
||||||
"--lat <latitude> Latitude in degrees\n"
|
"--lat <latitude> Latitude in degrees\n"
|
||||||
"--lon <longitude> Longitude in degrees\n"
|
"--lon <longitude> Longitude in degrees\n"
|
||||||
"--metric Use metric units\n"
|
"--metric Use metric units\n"
|
||||||
"--help Show this help\n"
|
"--port <port> TCP Beast output listen port (default: 30005)\n"
|
||||||
"--uiscale <factor> UI global scaling (default: 1)\n"
|
"--server <IPv4/hosname> TCP Beast output listen IPv4 (default: 127.0.0.1)\n"
|
||||||
"--screensize <width> <height> Set frame buffer resolution (default: screen resolution)\n"
|
"--screensize <width> <height> Set frame buffer resolution (default: screen resolution)\n"
|
||||||
"--screenindex <i> Set the index of the display to use (default: 0)\n"
|
"--screenindex <i> Set the index of the display to use (default: 0)\n"
|
||||||
"--fullscreen Start fullscreen\n"
|
"--uiscale <factor> UI global scaling (default: 1)\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,6 +95,8 @@ int main(int argc, char **argv) {
|
||||||
view.centerLon = appData.modes.fUserLon;
|
view.centerLon = appData.modes.fUserLon;
|
||||||
} else if (!strcmp(argv[j],"--metric")) {
|
} else if (!strcmp(argv[j],"--metric")) {
|
||||||
view.metric = 1;
|
view.metric = 1;
|
||||||
|
} else if (!strcmp(argv[j],"--fps")) {
|
||||||
|
view.fps = 1;
|
||||||
} else if (!strcmp(argv[j],"--fullscreen")) {
|
} else if (!strcmp(argv[j],"--fullscreen")) {
|
||||||
view.fullscreen = 1;
|
view.fullscreen = 1;
|
||||||
} else if (!strcmp(argv[j],"--screenindex")) {
|
} else if (!strcmp(argv[j],"--screenindex")) {
|
||||||
|
|
Loading…
Reference in a new issue