Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/guides/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ When software rendering is on, you can check this to skip some steps in the rend

Displays some information on the game screen such as framecount, inputs, notifications and ram watches. The placement of these texts can be modified, and can be displayed in the encode video.

### Lua on video encode

Display text from Lua script in video encode.

## Runtime

### Time tracking
Expand Down
2 changes: 1 addition & 1 deletion src/library/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void frameBoundary(std::function<void()> draw, RenderHUD& hud)
* We encode at the end so that we can encode with or without the OSD easily
*/
if (Global::shared_config.av_dumping) {
if (Global::shared_config.osd_encode) {
if (Global::shared_config.osd_encode || Global::shared_config.osd_lua) {
/* We need to recapture the whole screen with OSD, so we redo the
* whole steps without the final `draw()` call */
if (!Global::skipping_draw && draw) {
Expand Down
6 changes: 6 additions & 0 deletions src/library/renderhud/RenderHUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ void RenderHUD::drawAll(uint64_t framecount, uint64_t nondraw_framecount, const
ImGui::EndMainMenuBar();
}
ImGui::PopStyleColor(2);
} else if (Global::shared_config.av_dumping && Global::shared_config.osd_lua) {
show_lua = true;
show_framecount = false;
show_inputs = false;
show_messages = false;
show_watches = false;
}

if (supportsGameWindow() && !show_game_window && old_show_game_window) {
Expand Down
2 changes: 2 additions & 0 deletions src/program/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void Config::save(const std::string& gamepath) {
settings.setValue("screen_height", sc.screen_height);
settings.setValue("osd", sc.osd);
settings.setValue("osd_encode", sc.osd_encode);
settings.setValue("osd_lua", sc.osd_lua);
settings.setValue("prevent_savefiles", sc.prevent_savefiles);
settings.setValue("audio_bitdepth", sc.audio_bitdepth);
settings.setValue("audio_channels", sc.audio_channels);
Expand Down Expand Up @@ -367,6 +368,7 @@ void Config::load(const std::string& gamepath) {
sc.screen_height = settings.value("screen_height", sc.screen_height).toInt();
sc.osd = settings.value("osd", sc.osd).toBool();
sc.osd_encode = settings.value("osd_encode", sc.osd_encode).toBool();
sc.osd_lua = settings.value("osd_lua", sc.osd_lua).toBool();
sc.prevent_savefiles = settings.value("prevent_savefiles", sc.prevent_savefiles).toBool();
sc.audio_bitdepth = settings.value("audio_bitdepth", sc.audio_bitdepth).toInt();
sc.audio_channels = settings.value("audio_channels", sc.audio_channels).toInt();
Expand Down
5 changes: 5 additions & 0 deletions src/program/ui/settings/VideoPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ void VideoPane::initLayout()

osdMenuBox = new QCheckBox(tr("Main Menu"));
osdEncodeBox = new QCheckBox(tr("OSD on video encode"));
osdLuaBox = new QCheckBox(tr("Lua on video encode"));

osdLayout->addWidget(osdMenuBox);
osdLayout->addWidget(osdEncodeBox);
osdLayout->addWidget(osdLuaBox);

renderingBox = new QGroupBox(tr("Rendering"));
QVBoxLayout* renderingLayout = new QVBoxLayout;
Expand Down Expand Up @@ -134,6 +136,7 @@ void VideoPane::initSignals()
});
connect(osdMenuBox, &QAbstractButton::clicked, this, &VideoPane::saveConfig);
connect(osdEncodeBox, &QAbstractButton::clicked, this, &VideoPane::saveConfig);
connect(osdLuaBox, &QAbstractButton::clicked, this, &VideoPane::saveConfig);

connect(rendSoftBox, &QAbstractButton::clicked, this, &VideoPane::saveConfig);
connect(rendPerfBox, &QAbstractButton::clicked, this, &VideoPane::saveConfig);
Expand Down Expand Up @@ -187,6 +190,7 @@ void VideoPane::loadConfig()

osdMenuBox->setChecked(context->config.sc.osd);
osdEncodeBox->setChecked(context->config.sc.osd_encode);
osdLuaBox->setChecked(context->config.sc.osd_lua);

rendSoftBox->setChecked(context->config.sc.opengl_soft);
rendPerfBox->setChecked(context->config.sc.opengl_performance);
Expand All @@ -210,6 +214,7 @@ void VideoPane::saveConfig()

context->config.sc.osd = osdMenuBox->isChecked();
context->config.sc.osd_encode = osdEncodeBox->isChecked();
context->config.sc.osd_lua = osdLuaBox->isChecked();

context->config.sc.opengl_soft = rendSoftBox->isChecked();
context->config.sc.opengl_performance = rendPerfBox->isChecked();
Expand Down
1 change: 1 addition & 0 deletions src/program/ui/settings/VideoPane.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class VideoPane : public QWidget {
QSpinBox* widthField;
QSpinBox* heightField;

QCheckBox* osdLuaBox;
QCheckBox* osdMenuBox;
QCheckBox* osdEncodeBox;

Expand Down
3 changes: 3 additions & 0 deletions src/shared/SharedConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ struct __attribute__((packed, aligned(8))) SharedConfig {
/* Display OSD in the video encode */
bool osd_encode = false;

/* Display lua text in the video encode */
bool osd_lua = false;

/* Use a backup of savefiles in memory, which leaves the original
* savefiles unmodified and save the content in savestates */
bool prevent_savefiles = true;
Expand Down