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