From df799dd12466a319c5616027980db0dbcadaa7de Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 21 Nov 2015 10:20:34 +0100 Subject: [PATCH] VideoCommon: Create default implementation for state setters It's fine to pull those within the backends, so there is no need to enforce them to implement this interface. --- Source/Core/VideoBackends/OGL/Render.h | 4 ---- Source/Core/VideoCommon/RenderBase.h | 31 +++++++++++++------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/Render.h b/Source/Core/VideoBackends/OGL/Render.h index a6544a6049..b939911cee 100644 --- a/Source/Core/VideoBackends/OGL/Render.h +++ b/Source/Core/VideoBackends/OGL/Render.h @@ -83,10 +83,6 @@ public: void SetInterlacingMode() override; void SetViewport() override; - // TODO: Implement and use these - void ApplyState(bool bUseDstAlpha) override {} - void RestoreState() override {} - void RenderText(const std::string& text, int left, int top, u32 color) override; void FlipImageData(u8 *data, int w, int h, int pixel_width = 3); diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index c717483d1e..ad53f2f20c 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -58,19 +58,22 @@ public: PP_EFB_COPY_CLOCKS }; - virtual void SetColorMask() = 0; - virtual void SetBlendMode(bool forceUpdate) = 0; - virtual void SetScissorRect(const EFBRectangle& rc) = 0; - virtual void SetGenerationMode() = 0; - virtual void SetDepthMode() = 0; - virtual void SetLogicOpMode() = 0; - virtual void SetDitherMode() = 0; - virtual void SetSamplerState(int stage, int texindex, bool custom_tex) = 0; - virtual void SetInterlacingMode() = 0; - virtual void SetViewport() = 0; + virtual void SetColorMask() {} + virtual void SetBlendMode(bool forceUpdate) {} + virtual void SetScissorRect(const EFBRectangle& rc) {} + virtual void SetGenerationMode() {} + virtual void SetDepthMode() {} + virtual void SetLogicOpMode() {} + virtual void SetDitherMode() {} + virtual void SetSamplerState(int stage, int texindex, bool custom_tex) {} + virtual void SetInterlacingMode() {} + virtual void SetViewport() {} - virtual void ApplyState(bool bUseDstAlpha) = 0; - virtual void RestoreState() = 0; + virtual void ApplyState(bool bUseDstAlpha) {} + virtual void RestoreState() {} + + virtual void ResetAPIState() {} + virtual void RestoreAPIState() {} // Ideal internal resolution - determined by display resolution (automatic scaling) and/or a multiple of the native EFB resolution static int GetTargetWidth() { return s_target_width; } @@ -117,10 +120,6 @@ public: virtual u16 BBoxRead(int index) = 0; virtual void BBoxWrite(int index, u16 value) = 0; - // What's the real difference between these? Too similar names. - virtual void ResetAPIState() = 0; - virtual void RestoreAPIState() = 0; - // Finish up the current frame, print some stats static void Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc,float Gamma = 1.0f); virtual void SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const EFBRectangle& rc, float Gamma = 1.0f) = 0;