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:
@@ -110,6 +110,8 @@ void fullscrn::window_size_changed()
|
||||
{
|
||||
int width, height;
|
||||
SDL_GetRendererOutputSize(winmain::Renderer, &width, &height);
|
||||
int menuHeight = options::Options.ShowMenu ? winmain::MainMenuHeight : 0;
|
||||
height -= menuHeight;
|
||||
auto res = &resolution_array[resolution];
|
||||
ScaleX = static_cast<float>(width) / res->TableWidth;
|
||||
ScaleY = static_cast<float>(height) / res->TableHeight;
|
||||
@@ -124,7 +126,7 @@ void fullscrn::window_size_changed()
|
||||
|
||||
render::DestinationRect = SDL_Rect
|
||||
{
|
||||
OffsetX, OffsetY,
|
||||
OffsetX, OffsetY + menuHeight,
|
||||
width - OffsetX * 2, height - OffsetY * 2
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user