Skip to content

Commit

Permalink
Native resolution setting
Browse files Browse the repository at this point in the history
  • Loading branch information
XITRIX committed Feb 8, 2024
1 parent d9bd91f commit 2cc9440
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/settings_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ SettingsTab::SettingsTab() {
// Inflate the tab from the XML file
this->inflateFromXMLRes("xml/tabs/settings.xml");

std::vector<std::string> resolutions = {"720p", "1080p"};
std::vector<std::string> resolutions = {"720p", "1080p", "Native"};
resolution->setText("settings/resolution"_i18n);
resolution->setData(resolutions);
switch (Settings::instance().resolution()) {
GET_SETTINGS(resolution, 720, 0);
GET_SETTINGS(resolution, 1080, 1);
GET_SETTINGS(resolution, -1, 2);
DEFAULT;
}
resolution->getEvent()->subscribe([](int selected) {
switch (selected) {
SET_SETTING(0, set_resolution(720));
SET_SETTING(1, set_resolution(1080));
SET_SETTING(2, set_resolution(-1));
DEFAULT;
}
});
Expand Down
4 changes: 4 additions & 0 deletions app/src/streaming/MoonlightSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ void MoonlightSession::start(ServerCallback<bool> callback) {

int h = Settings::instance().resolution();
int w = h * 16 / 9;
if (h == -1) {
h = Application::windowHeight;
w = Application::windowWidth;
}
m_config.width = w;
m_config.height = h;
m_config.fps = Settings::instance().fps();
Expand Down

0 comments on commit 2cc9440

Please sign in to comment.