From 70c0a12b2bfc4d807faeb0b5d5482bf3ce9ab78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 13 Oct 2019 21:23:49 +0200 Subject: [PATCH] Fix name collision on iOS build --- ext/native/base/display.cpp | 6 +++--- ext/native/base/display.h | 6 +++--- ext/native/thin3d/VulkanQueueRunner.cpp | 4 ++-- ext/native/thin3d/thin3d_d3d11.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/native/base/display.cpp b/ext/native/base/display.cpp index 2b4361d4a7..b0b940c42f 100644 --- a/ext/native/base/display.cpp +++ b/ext/native/base/display.cpp @@ -20,7 +20,7 @@ DisplayRotation g_display_rotation; Matrix4x4 g_display_rot_matrix; template -void RotateRectToDisplayImpl(Rect &rect, T curRTWidth, T curRTHeight) { +void RotateRectToDisplayImpl(DisplayRect &rect, T curRTWidth, T curRTHeight) { switch (g_display_rotation) { case DisplayRotation::ROTATE_180: rect.x = curRTWidth - rect.w - rect.x; @@ -57,10 +57,10 @@ void RotateRectToDisplayImpl(Rect &rect, T curRTWidth, T curRTHeight) { } } -void RotateRectToDisplay(Rect &rect, int curRTWidth, int curRTHeight) { +void RotateRectToDisplay(DisplayRect &rect, int curRTWidth, int curRTHeight) { RotateRectToDisplayImpl(rect, curRTWidth, curRTHeight); } -void RotateRectToDisplay(Rect &rect, float curRTWidth, float curRTHeight) { +void RotateRectToDisplay(DisplayRect &rect, float curRTWidth, float curRTHeight) { RotateRectToDisplayImpl(rect, curRTWidth, curRTHeight); } diff --git a/ext/native/base/display.h b/ext/native/base/display.h index 1bcf05283e..a11a697da4 100644 --- a/ext/native/base/display.h +++ b/ext/native/base/display.h @@ -32,9 +32,9 @@ extern DisplayRotation g_display_rotation; extern Matrix4x4 g_display_rot_matrix; template -struct Rect { +struct DisplayRect { T x, y, w, h; }; -void RotateRectToDisplay(Rect &rect, float rtWidth, float rtHeight); -void RotateRectToDisplay(Rect &rect, int rtWidth, int rtHeight); +void RotateRectToDisplay(DisplayRect &rect, float rtWidth, float rtHeight); +void RotateRectToDisplay(DisplayRect &rect, int rtWidth, int rtHeight); diff --git a/ext/native/thin3d/VulkanQueueRunner.cpp b/ext/native/thin3d/VulkanQueueRunner.cpp index a1f84d8881..3785b7d9b9 100644 --- a/ext/native/thin3d/VulkanQueueRunner.cpp +++ b/ext/native/thin3d/VulkanQueueRunner.cpp @@ -1011,7 +1011,7 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c vkCmdSetViewport(cmd, 0, 1, &c.viewport.vp); } else { const VkViewport &vp = c.viewport.vp; - Rect rc{ vp.x, vp.y, vp.width, vp.height }; + DisplayRect rc{ vp.x, vp.y, vp.width, vp.height }; RotateRectToDisplay(rc, (float)vulkan_->GetBackbufferWidth(), (float)vulkan_->GetBackbufferHeight()); VkViewport final_vp; final_vp.x = rc.x; @@ -1031,7 +1031,7 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c } else { // Rendering to backbuffer. Might need to rotate. const VkRect2D &rc = c.scissor.scissor; - Rect rotated_rc{ rc.offset.x, rc.offset.y, (int)rc.extent.width, (int)rc.extent.height }; + DisplayRect rotated_rc{ rc.offset.x, rc.offset.y, (int)rc.extent.width, (int)rc.extent.height }; RotateRectToDisplay(rotated_rc, vulkan_->GetBackbufferWidth(), vulkan_->GetBackbufferHeight()); _dbg_assert_(G3D, rotated_rc.x >= 0); _dbg_assert_(G3D, rotated_rc.y >= 0); diff --git a/ext/native/thin3d/thin3d_d3d11.cpp b/ext/native/thin3d/thin3d_d3d11.cpp index bb7ad95476..787f6b977a 100644 --- a/ext/native/thin3d/thin3d_d3d11.cpp +++ b/ext/native/thin3d/thin3d_d3d11.cpp @@ -360,7 +360,7 @@ void D3D11DrawContext::HandleEvent(Event ev, int width, int height, void *param1 void D3D11DrawContext::SetViewports(int count, Viewport *viewports) { D3D11_VIEWPORT vp[4]; for (int i = 0; i < count; i++) { - Rect rc{ viewports[i].TopLeftX , viewports[i].TopLeftY, viewports[i].Width, viewports[i].Height }; + DisplayRect rc{ viewports[i].TopLeftX , viewports[i].TopLeftY, viewports[i].Width, viewports[i].Height }; if (curRenderTargetView_ == bbRenderTargetView_) // Only the backbuffer is actually rotated wrong! RotateRectToDisplay(rc, curRTWidth_, curRTHeight_); vp[i].TopLeftX = rc.x; @@ -374,7 +374,7 @@ void D3D11DrawContext::SetViewports(int count, Viewport *viewports) { } void D3D11DrawContext::SetScissorRect(int left, int top, int width, int height) { - Rect frc{ (float)left, (float)top, (float)width, (float)height }; + DisplayRect frc{ (float)left, (float)top, (float)width, (float)height }; if (curRenderTargetView_ == bbRenderTargetView_) // Only the backbuffer is actually rotated wrong! RotateRectToDisplay(frc, curRTWidth_, curRTHeight_); D3D11_RECT rc{};