Add "screenshot mode" compile flag to round % and Hz displays

This commit is contained in:
RichardG867
2025-09-13 17:00:15 -03:00
parent 25ee59d98c
commit d92112fa2d
3 changed files with 15 additions and 1 deletions

View File

@@ -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. */

View File

@@ -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)

View File

@@ -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);