From 07cddf6f7fe7399be9c3ba279726afcb2b052d63 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 18 Jun 2017 23:28:28 -0400 Subject: [PATCH 1/2] AbstractTexture: Add missing includes (and remove unnecessary ones) --- Source/Core/VideoBackends/D3D/DXTexture.h | 1 - Source/Core/VideoBackends/Null/NullTexture.h | 1 - Source/Core/VideoBackends/OGL/OGLTexture.h | 1 - Source/Core/VideoBackends/Software/SWTexture.h | 1 - Source/Core/VideoBackends/Vulkan/VKTexture.h | 1 - Source/Core/VideoCommon/AbstractTexture.h | 4 +++- 6 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/DXTexture.h b/Source/Core/VideoBackends/D3D/DXTexture.h index 73055343f8..a57c104fa0 100644 --- a/Source/Core/VideoBackends/D3D/DXTexture.h +++ b/Source/Core/VideoBackends/D3D/DXTexture.h @@ -7,7 +7,6 @@ #include "Common/CommonTypes.h" #include "VideoCommon/AbstractTexture.h" -#include "VideoCommon/VideoCommon.h" class D3DTexture2D; diff --git a/Source/Core/VideoBackends/Null/NullTexture.h b/Source/Core/VideoBackends/Null/NullTexture.h index c8f8e77004..65f4252050 100644 --- a/Source/Core/VideoBackends/Null/NullTexture.h +++ b/Source/Core/VideoBackends/Null/NullTexture.h @@ -7,7 +7,6 @@ #include "Common/CommonTypes.h" #include "VideoCommon/AbstractTexture.h" -#include "VideoCommon/VideoCommon.h" namespace Null { diff --git a/Source/Core/VideoBackends/OGL/OGLTexture.h b/Source/Core/VideoBackends/OGL/OGLTexture.h index 34322bf120..029afe272f 100644 --- a/Source/Core/VideoBackends/OGL/OGLTexture.h +++ b/Source/Core/VideoBackends/OGL/OGLTexture.h @@ -7,7 +7,6 @@ #include "Common/GL/GLUtil.h" #include "VideoCommon/AbstractTexture.h" -#include "VideoCommon/VideoCommon.h" namespace OGL { diff --git a/Source/Core/VideoBackends/Software/SWTexture.h b/Source/Core/VideoBackends/Software/SWTexture.h index 8737792cc0..4d6189bb4f 100644 --- a/Source/Core/VideoBackends/Software/SWTexture.h +++ b/Source/Core/VideoBackends/Software/SWTexture.h @@ -7,7 +7,6 @@ #include "Common/CommonTypes.h" #include "VideoCommon/AbstractTexture.h" -#include "VideoCommon/VideoCommon.h" namespace SW { diff --git a/Source/Core/VideoBackends/Vulkan/VKTexture.h b/Source/Core/VideoBackends/Vulkan/VKTexture.h index 0983703db5..056f50c6e8 100644 --- a/Source/Core/VideoBackends/Vulkan/VKTexture.h +++ b/Source/Core/VideoBackends/Vulkan/VKTexture.h @@ -8,7 +8,6 @@ #include #include "VideoCommon/AbstractTexture.h" -#include "VideoCommon/VideoCommon.h" namespace Vulkan { diff --git a/Source/Core/VideoCommon/AbstractTexture.h b/Source/Core/VideoCommon/AbstractTexture.h index 2b06d9c401..433aae60ac 100644 --- a/Source/Core/VideoCommon/AbstractTexture.h +++ b/Source/Core/VideoCommon/AbstractTexture.h @@ -4,10 +4,12 @@ #pragma once +#include +#include + #include "Common/CommonTypes.h" #include "Common/MathUtil.h" #include "VideoCommon/TextureConfig.h" -#include "VideoCommon/VideoCommon.h" class AbstractTexture { From 59a947d41db3d5c603deeb5ffc40afec0ecc61f1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 18 Jun 2017 23:33:15 -0400 Subject: [PATCH 2/2] AbstractTexture: Return config by const reference Returning by const value isn't really necessary (and usually an indicator const reference was intended). --- Source/Core/VideoCommon/AbstractTexture.cpp | 2 +- Source/Core/VideoCommon/AbstractTexture.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/AbstractTexture.cpp b/Source/Core/VideoCommon/AbstractTexture.cpp index 1b6fac8bff..b756651640 100644 --- a/Source/Core/VideoCommon/AbstractTexture.cpp +++ b/Source/Core/VideoCommon/AbstractTexture.cpp @@ -38,7 +38,7 @@ size_t AbstractTexture::CalculateHostTextureLevelPitch(AbstractTextureFormat for } } -const TextureConfig AbstractTexture::GetConfig() const +const TextureConfig& AbstractTexture::GetConfig() const { return m_config; } diff --git a/Source/Core/VideoCommon/AbstractTexture.h b/Source/Core/VideoCommon/AbstractTexture.h index 433aae60ac..94c082af70 100644 --- a/Source/Core/VideoCommon/AbstractTexture.h +++ b/Source/Core/VideoCommon/AbstractTexture.h @@ -28,7 +28,7 @@ public: static bool IsCompressedHostTextureFormat(AbstractTextureFormat format); static size_t CalculateHostTextureLevelPitch(AbstractTextureFormat format, u32 row_length); - const TextureConfig GetConfig() const; + const TextureConfig& GetConfig() const; protected: const TextureConfig m_config;