From 5a8ed196e6e9416134a85fbc7da14fed3af307e4 Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 19 May 2014 17:57:35 -0700 Subject: common_types: Changed BasicRect back to Rect, in the common namespace Only Rect is in the namespace for now; the rest of common should be added in the future --- src/common/common_types.h | 10 ++++++---- src/video_core/renderer_opengl/renderer_opengl.cpp | 4 ++-- src/video_core/renderer_opengl/renderer_opengl.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/common/common_types.h b/src/common/common_types.h index 25dc912a9..402410507 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -100,16 +100,17 @@ union t128 { __m128 a; ///< 128-bit floating point (__m128 maps to the XMM[0-7] registers) }; +namespace common { /// Rectangle data structure -class BasicRect { +class Rect { public: - BasicRect(int x0=0, int y0=0, int x1=0, int y1=0) { + Rect(int x0=0, int y0=0, int x1=0, int y1=0) { x0_ = x0; y0_ = y0; x1_ = x1; y1_ = y1; } - ~BasicRect() { } + ~Rect() { } int x0_; ///< Rect top left X-coordinate int y0_; ///< Rect top left Y-coordinate @@ -119,7 +120,8 @@ public: inline u32 width() const { return abs(x1_ - x0_); } inline u32 height() const { return abs(y1_ - y0_); } - inline bool operator == (const BasicRect& val) const { + inline bool operator == (const Rect& val) const { return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_); } }; +} diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index f2e809b1d..bb5eb34aa 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -37,7 +37,7 @@ void RendererOpenGL::SwapBuffers() { // EFB->XFB copy // TODO(bunnei): This is a hack and does not belong here. The copy should be triggered by some // register write We're also treating both framebuffers as a single one in OpenGL. - BasicRect framebuffer_size(0, 0, m_resolution_width, m_resolution_height); + common::Rect framebuffer_size(0, 0, m_resolution_width, m_resolution_height); RenderXFB(framebuffer_size, framebuffer_size); // XFB->Window copy @@ -75,7 +75,7 @@ void RendererOpenGL::FlipFramebuffer(const u8* in, u8* out) { * @param src_rect Source rectangle in XFB to copy * @param dst_rect Destination rectangle in output framebuffer to copy to */ -void RendererOpenGL::RenderXFB(const BasicRect& src_rect, const BasicRect& dst_rect) { +void RendererOpenGL::RenderXFB(const common::Rect& src_rect, const common::Rect& dst_rect) { FlipFramebuffer(LCD::GetFramebufferPointer(LCD::g_regs.framebuffer_top_left_1), m_xfb_top_flipped); FlipFramebuffer(LCD::GetFramebufferPointer(LCD::g_regs.framebuffer_sub_left_1), m_xfb_bottom_flipped); diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 06e602b46..dd811cad6 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -28,7 +28,7 @@ public: * @param src_rect Source rectangle in XFB to copy * @param dst_rect Destination rectangle in output framebuffer to copy to */ - void RenderXFB(const BasicRect& src_rect, const BasicRect& dst_rect); + void RenderXFB(const common::Rect& src_rect, const common::Rect& dst_rect); /** * Set the emulator window to use for renderer -- cgit v1.2.3