Adjusted screen coordinates so menu doesn't overlap (#66)
* Optimized final blit to the screen render target. When bumping the table, instead of offseting the table pixels by CPU, just memcpy all the pixels to vScreenTex once, and then render two separate quads from that texture: one for the board and the other for the sidebar. Then change the coordinates of the board quad when bumping. * Main menu bar doesn't cover game area * Forgot to also take into account changing UI scale.
This commit is contained in:
1 parent
38cf08e298
commit
5789492021
4 files changed
+14
-1
No files matched your search
@@ -37,6 +37,7 @@ bool winmain::LaunchBallEnabled = true;
|
||||
bool winmain::HighScoresEnabled = true;
|
||||
bool winmain::DemoActive = false;
|
||||
char* winmain::BasePath;
|
||||
int winmain::MainMenuHeight = 0;
|
||||
std::string winmain::FpsDetails;
|
||||
double winmain::UpdateToFrameRatio;
|
||||
winmain::DurationMs winmain::TargetFrameTime;
|
||||
@@ -341,6 +342,14 @@ void winmain::RenderUi()
|
||||
|
||||
if (ImGui::BeginMainMenuBar())
|
||||
{
|
||||
int currentMenuHeight = static_cast<int>(ImGui::GetWindowSize().y);
|
||||
if (MainMenuHeight != currentMenuHeight)
|
||||
{
|
||||
// Get the height of the main menu bar and update screen coordinates
|
||||
MainMenuHeight = currentMenuHeight;
|
||||
fullscrn::window_size_changed();
|
||||
}
|
||||
|
||||
if (ImGui::BeginMenu("Game"))
|
||||
{
|
||||
if (ImGui::MenuItem("New Game", "F2"))
|
||||
|
||||
Reference in new issue
Block a user