Skip to content

Commit

Permalink
Fix some bugs and mistakes found by Nemoumbra through static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Nov 26, 2023
1 parent aec0606 commit dae758e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Common/VR/VRFramebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ static bool ovrFramebuffer_CreateGLES(XrSession session, ovrFramebuffer* frameBu
swapChainCreateInfo.arraySize = multiview ? 2 : 1;

#ifdef ANDROID
XrSwapchainCreateInfoFoveationFB swapChainFoveationCreateInfo;
if (VR_GetPlatformFlag(VR_PLATFORM_EXTENSION_FOVEATION)) {
XrSwapchainCreateInfoFoveationFB swapChainFoveationCreateInfo;
memset(&swapChainFoveationCreateInfo, 0, sizeof(swapChainFoveationCreateInfo));
swapChainFoveationCreateInfo.type = XR_TYPE_SWAPCHAIN_CREATE_INFO_FOVEATION_FB;
swapChainCreateInfo.next = &swapChainFoveationCreateInfo;
Expand Down Expand Up @@ -203,8 +203,8 @@ static bool ovrFramebuffer_CreateVK(XrSession session, ovrFramebuffer* frameBuff
swapChainCreateInfo.arraySize = multiview ? 2 : 1;

#ifdef ANDROID
XrSwapchainCreateInfoFoveationFB swapChainFoveationCreateInfo;
if (VR_GetPlatformFlag(VR_PLATFORM_EXTENSION_FOVEATION)) {
XrSwapchainCreateInfoFoveationFB swapChainFoveationCreateInfo;
memset(&swapChainFoveationCreateInfo, 0, sizeof(swapChainFoveationCreateInfo));
swapChainFoveationCreateInfo.type = XR_TYPE_SWAPCHAIN_CREATE_INFO_FOVEATION_FB;
swapChainCreateInfo.next = &swapChainFoveationCreateInfo;
Expand Down
6 changes: 2 additions & 4 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1593,10 +1593,8 @@ void FramebufferManagerCommon::CopyDisplayToOutput(bool reallyDirty) {
if (!vfb) {
if (Memory::IsValidAddress(fbaddr)) {
// The game is displaying something directly from RAM. In GTA, it's decoded video.
if (!vfb) {
DrawFramebufferToOutput(Memory::GetPointerUnchecked(fbaddr), displayStride_, displayFormat_);
return;
}
DrawFramebufferToOutput(Memory::GetPointerUnchecked(fbaddr), displayStride_, displayFormat_);
return;
} else {
DEBUG_LOG(FRAMEBUF, "Found no FBO to display! displayFBPtr = %08x", fbaddr);
// No framebuffer to display! Clear to black.
Expand Down
2 changes: 1 addition & 1 deletion Windows/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ namespace MainWindow
double now = time_now_d();
if ((now - lastMouseDown) < 0.001 * GetDoubleClickTime()) {
float dx = lastMouseDownX - x;
float dy = lastMouseDownX - x;
float dy = lastMouseDownY - y;
float distSq = dx * dx + dy * dy;
if (distSq < 3.0f*3.0f && !g_Config.bShowTouchControls && !g_Config.bMouseControl && GetUIState() == UISTATE_INGAME && g_Config.bFullscreenOnDoubleclick) {
SendToggleFullscreen(!g_Config.UseFullScreen());
Expand Down

0 comments on commit dae758e

Please sign in to comment.