Add "screenshot mode" compile flag to round % and Hz displays
This commit is contained in:
@@ -1866,6 +1866,12 @@ pc_run(void)
|
||||
|
||||
if (title_update) {
|
||||
mouse_msg_idx = ((mouse_type == MOUSE_TYPE_NONE) || (mouse_input_mode >= 1)) ? 2 : !!mouse_capture;
|
||||
#ifdef SCREENSHOT_MODE
|
||||
if (force_10ms)
|
||||
fps = ((fps + 2) / 5) * 5;
|
||||
else
|
||||
fps = ((fps + 20) / 50) * 50;
|
||||
#endif
|
||||
swprintf(temp, sizeof_w(temp), mouse_msg[mouse_msg_idx], fps / (force_10ms ? 1 : 10), force_10ms ? 0 : (fps % 10));
|
||||
#ifdef __APPLE__
|
||||
/* Needed due to modifying the UI on the non-main thread is a big no-no. */
|
||||
|
||||
@@ -84,6 +84,10 @@ if(DEBUGREGS486)
|
||||
add_compile_definitions(USE_DEBUG_REGS_486)
|
||||
endif()
|
||||
|
||||
if(SCREENSHOT_MODE)
|
||||
add_compile_definitions(SCREENSHOT_MODE)
|
||||
endif()
|
||||
|
||||
if(VNC)
|
||||
find_package(LibVNCServer)
|
||||
if(LibVNCServer_FOUND)
|
||||
|
||||
@@ -200,7 +200,11 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
frameRateTimer->setInterval(1000);
|
||||
frameRateTimer->setSingleShot(false);
|
||||
connect(frameRateTimer, &QTimer::timeout, [hertz_label] {
|
||||
hertz_label->setText(tr("%1 Hz").arg(QString::number(monitors[0].mon_actualrenderedframes.load()) + (monitors[0].mon_interlace ? "i" : "")));
|
||||
auto hz = monitors[0].mon_actualrenderedframes.load();
|
||||
#ifdef SCREENSHOT_MODE
|
||||
hz = ((hz + 2) / 5) * 5;
|
||||
#endif
|
||||
hertz_label->setText(tr("%1 Hz").arg(QString::number(hz) + (monitors[0].mon_interlace ? "i" : "")));
|
||||
});
|
||||
statusBar()->addPermanentWidget(hertz_label);
|
||||
frameRateTimer->start(1000);
|
||||
|
||||
Reference in New Issue
Block a user