Skip to content
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

Fix UI scaling #592

Merged
merged 9 commits into from
Sep 13, 2021
Merged

Fix UI scaling #592

merged 9 commits into from
Sep 13, 2021

Conversation

SheridanR
Copy link
Collaborator

UI is now rendered to its own framebuffer (render-to-texture) then drawn on a fullscreen quad to fix seams between ui elements at non-720p resolutions.

Also unlocks Frame::process() from the original tickrate which was 50.

Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
fix a bunch of ui rendering bugs caused by new scaling code
fix main menu timing code

Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
@@ -399,10 +417,13 @@ int initApp(char const * const title, int fullscreen)
}

// create player classes
// TODO/FIXME: why isn't this in initGame? why is it in init.cpp?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was to not crash on frames checking for the mouse in the loading screen (caught this in debug)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this PR changes the UI code so it reads mousex/mousey etc variables directly when EDITOR is defined (so it doesn't crash). ergo this can probably go in initGame() now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was crashing the main game, not editor

@@ -715,7 +715,7 @@ void createInventoryTooltipFrame(const int player)
auto tooltipTextField = tooltipFrame->addField("inventory mouse tooltip header", 1024);
tooltipTextField->setText("Nothing");
tooltipTextField->setSize(SDL_Rect{ 0, 0, 0, 0 });
tooltipTextField->setFont("fonts/pixelmix.ttf#14");
tooltipTextField->setFont("fonts/pixelmix.ttf#16");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert these font size changes for my HUD stuff - I'll need to redo the spacing/layout and want the old sizes for reference.

fix credits scroll rate
Text.cpp: SDL_BlitScaled not used if resolution == 1

Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
/res command changes window size

Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
Signed-off-by: SheridanR <sheridan.rathbun@gmail.com>
@WALLOFJUSTICE WALLOFJUSTICE merged commit 13941f4 into develop Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants