-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows LUS to set the screen dimensions programmatically. #785
base: main
Are you sure you want to change the base?
Changes from all commits
ec68583
2e09647
6c96eac
b2fc462
64f9c51
af82cca
ee112d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,13 +62,13 @@ void Fast3dWindow::Init() { | |
uint32_t width, height; | ||
int32_t posX, posY; | ||
|
||
isFullscreen = Ship::Context::GetInstance()->GetConfig()->GetBool("Window.Fullscreen.Enabled", false) || gameMode; | ||
isFullscreen = Ship::Context::GetInstance()->GetConfig()->GetBool("Window.Fullscreen.Enabled", 0) || gameMode; | ||
posX = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.PositionX", 100); | ||
posY = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.PositionY", 100); | ||
|
||
if (isFullscreen) { | ||
width = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Fullscreen.Width", gameMode ? 1280 : 1920); | ||
height = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Fullscreen.Height", gameMode ? 800 : 1080); | ||
width = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Fullscreen.Width", 1920); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to test this in gamescope. i still don't like that we have resolution tied to gamescope, just because someone is using gamescope doesn't mean they're on a steam deck, but seeing what breaks and if we have ways around it with the other changes in this PR will be good edit: looks like we're looking for |
||
height = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Fullscreen.Height", 1080); | ||
} else { | ||
width = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Width", 640); | ||
height = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Height", 480); | ||
|
@@ -172,6 +172,40 @@ uint32_t Fast3dWindow::GetHeight() { | |
return height; | ||
} | ||
|
||
void Fast3dWindow::SetCurrentDimensions(uint32_t width, uint32_t height, int32_t posX, int32_t posY) { | ||
mWindowManagerApi->set_dimensions(width, height, posX, posY); | ||
SaveWindowToConfig(); | ||
} | ||
|
||
void Fast3dWindow::SetCurrentDimensions(uint32_t width, uint32_t height) { | ||
SetCurrentDimensions(width, height, GetPosX(), GetPosY()); | ||
} | ||
|
||
void Fast3dWindow::SetCurrentDimensions(bool isFullscreen, uint32_t width, uint32_t height, int32_t posX, | ||
int32_t posY) { | ||
auto conf = Ship::Context::GetInstance()->GetConfig(); | ||
if (!isFullscreen) { | ||
conf->SetInt("Window.Width", (int32_t)width); | ||
conf->SetInt("Window.Height", (int32_t)height); | ||
conf->SetInt("Window.PositionX", posX); | ||
conf->SetInt("Window.PositionY", posY); | ||
} else { | ||
conf->SetInt("Window.Fullscreen.Width", (int32_t)width); | ||
conf->SetInt("Window.Fullscreen.Height", (int32_t)height); | ||
} | ||
mWindowManagerApi->set_fullscreen(isFullscreen); | ||
mWindowManagerApi->set_dimensions(width, height, posX, posY); | ||
SaveWindowToConfig(); | ||
} | ||
|
||
void Fast3dWindow::SetCurrentDimensions(bool isFullscreen, uint32_t width, uint32_t height) { | ||
SetCurrentDimensions(isFullscreen, width, height, GetPosX(), GetPosY()); | ||
} | ||
|
||
Ship::WindowRect Fast3dWindow::GetPrimaryMonitorRect() { | ||
return mWindowManagerApi->get_primary_monitor_rect(); | ||
} | ||
|
||
int32_t Fast3dWindow::GetPosX() { | ||
uint32_t width, height; | ||
int32_t posX, posY; | ||
|
@@ -248,8 +282,8 @@ void Fast3dWindow::SetMsaaLevel(uint32_t value) { | |
} | ||
|
||
void Fast3dWindow::SetFullscreen(bool isFullscreen) { | ||
SaveWindowToConfig(); | ||
mWindowManagerApi->set_fullscreen(isFullscreen); | ||
SaveWindowToConfig(); | ||
} | ||
|
||
bool Fast3dWindow::IsFullscreen() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the plan to standardize on
0
instead offalse
forGetBool
?