diff options
| author | comex <comexk@gmail.com> | 2014-10-02 02:20:46 -0400 |
|---|---|---|
| committer | comex <comexk@gmail.com> | 2014-10-02 03:00:33 -0400 |
| commit | 7f6284c2fcea9d543b0eec44ea0f3ad36bd0c0aa (patch) | |
| tree | d73cbd161db505d2f2a03751a012790e4a832feb /Source/Core/VideoCommon | |
| parent | c98a3f62be12a7c6abaa0e1465382fdcb2efbab6 (diff) | |
Change a bunch of reference function arguments to pointers.
Per the coding style and sanity.
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferManagerBase.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferManagerBase.h | 6 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 14 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.h | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.cpp | 12 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/TextureCacheBase.h | 2 |
6 files changed, 26 insertions, 25 deletions
diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.cpp b/Source/Core/VideoCommon/FramebufferManagerBase.cpp index 16e96e3892..ea865cd275 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.cpp +++ b/Source/Core/VideoCommon/FramebufferManagerBase.cpp @@ -31,20 +31,20 @@ FramebufferManagerBase::~FramebufferManagerBase() delete m_realXFBSource; } -const XFBSourceBase* const* FramebufferManagerBase::GetXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount) +const XFBSourceBase* const* FramebufferManagerBase::GetXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCountP) { if (!g_ActiveConfig.bUseXFB) return nullptr; if (g_ActiveConfig.bUseRealXFB) - return GetRealXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount); + return GetRealXFBSource(xfbAddr, fbWidth, fbHeight, xfbCountP); else - return GetVirtualXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount); + return GetVirtualXFBSource(xfbAddr, fbWidth, fbHeight, xfbCountP); } -const XFBSourceBase* const* FramebufferManagerBase::GetRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount) +const XFBSourceBase* const* FramebufferManagerBase::GetRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCountP) { - xfbCount = 1; + *xfbCountP = 1; // recreate if needed if (m_realXFBSource && (m_realXFBSource->texWidth != fbWidth || m_realXFBSource->texHeight != fbHeight)) @@ -79,9 +79,9 @@ const XFBSourceBase* const* FramebufferManagerBase::GetRealXFBSource(u32 xfbAddr return &m_overlappingXFBArray[0]; } -const XFBSourceBase* const* FramebufferManagerBase::GetVirtualXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount) +const XFBSourceBase* const* FramebufferManagerBase::GetVirtualXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCountP) { - xfbCount = 0; + u32 xfbCount = 0; if (m_virtualXFBList.empty()) // no Virtual XFBs available return nullptr; @@ -106,6 +106,7 @@ const XFBSourceBase* const* FramebufferManagerBase::GetVirtualXFBSource(u32 xfbA } } + *xfbCountP = xfbCount; return &m_overlappingXFBArray[0]; } diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.h b/Source/Core/VideoCommon/FramebufferManagerBase.h index d8bf0afdd5..bd9eef5037 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.h +++ b/Source/Core/VideoCommon/FramebufferManagerBase.h @@ -45,7 +45,7 @@ public: virtual ~FramebufferManagerBase(); static void CopyToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma); - static const XFBSourceBase* const* GetXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount); + static const XFBSourceBase* const* GetXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCount); static void SetLastXfbWidth(unsigned int width) { s_last_xfb_width = width; } static void SetLastXfbHeight(unsigned int height) { s_last_xfb_height = height; } @@ -83,8 +83,8 @@ private: virtual void CopyToRealXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma = 1.0f) = 0; static void CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma = 1.0f); - static const XFBSourceBase* const* GetRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount); - static const XFBSourceBase* const* GetVirtualXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32 &xfbCount); + static const XFBSourceBase* const* GetRealXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCount); + static const XFBSourceBase* const* GetVirtualXFBSource(u32 xfbAddr, u32 fbWidth, u32 fbHeight, u32* xfbCount); static XFBSourceBase *m_realXFBSource; // Only used in Real XFB mode static VirtualXFBListType m_virtualXFBList; // Only used in Virtual XFB mode diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index ee31d50ff0..921073f17a 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -151,17 +151,17 @@ int Renderer::EFBToScaledY(int y) }; } -void Renderer::CalculateTargetScale(int x, int y, int &scaledX, int &scaledY) +void Renderer::CalculateTargetScale(int x, int y, int* scaledX, int* scaledY) { if (g_ActiveConfig.iEFBScale == SCALE_AUTO || g_ActiveConfig.iEFBScale == SCALE_AUTO_INTEGRAL) { - scaledX = x; - scaledY = y; + *scaledX = x; + *scaledY = y; } else { - scaledX = x * (int)efb_scale_numeratorX / (int)efb_scale_denominatorX; - scaledY = y * (int)efb_scale_numeratorY / (int)efb_scale_denominatorY; + *scaledX = x * (int)efb_scale_numeratorX / (int)efb_scale_denominatorX; + *scaledY = y * (int)efb_scale_numeratorY / (int)efb_scale_denominatorY; } } @@ -228,7 +228,7 @@ bool Renderer::CalculateTargetSize(unsigned int framebuffer_width, unsigned int break; } if (s_LastEFBScale > SCALE_AUTO_INTEGRAL) - CalculateTargetScale(EFB_WIDTH, EFB_HEIGHT, newEFBWidth, newEFBHeight); + CalculateTargetScale(EFB_WIDTH, EFB_HEIGHT, &newEFBWidth, &newEFBHeight); if (newEFBWidth != s_target_width || newEFBHeight != s_target_height) { @@ -477,7 +477,7 @@ void Renderer::SetWindowSize(int width, int height) height = 1; // Scale the window size by the EFB scale. - CalculateTargetScale(width, height, width, height); + CalculateTargetScale(width, height, &width, &height); Host_RequestRenderWindowSize(width, height); } diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h index 3646507bb6..2350117369 100644 --- a/Source/Core/VideoCommon/RenderBase.h +++ b/Source/Core/VideoCommon/RenderBase.h @@ -123,7 +123,7 @@ public: protected: - static void CalculateTargetScale(int x, int y, int &scaledX, int &scaledY); + static void CalculateTargetScale(int x, int y, int* scaledX, int* scaledY); bool CalculateTargetSize(unsigned int framebuffer_width, unsigned int framebuffer_height); static void CheckFifoRecording(); diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index c0b46d92b6..df28184615 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -267,7 +267,7 @@ bool TextureCache::CheckForCustomTextureLODs(u64 tex_hash, int texformat, unsign return true; } -PC_TexFormat TextureCache::LoadCustomTexture(u64 tex_hash, int texformat, unsigned int level, unsigned int& width, unsigned int& height) +PC_TexFormat TextureCache::LoadCustomTexture(u64 tex_hash, int texformat, unsigned int level, unsigned int* widthp, unsigned int* heightp) { std::string texPathTemp; unsigned int newWidth = 0; @@ -293,6 +293,7 @@ PC_TexFormat TextureCache::LoadCustomTexture(u64 tex_hash, int texformat, unsign if (ret != PC_TEX_FMT_NONE) { + unsigned int width = *widthp, height = *heightp; if (level > 0 && (newWidth != width || newHeight != height)) ERROR_LOG(VIDEO, "Invalid custom texture size %dx%d for texture %s. This mipmap layer _must_ be %dx%d.", newWidth, newHeight, texPathTemp.c_str(), width, height); if (newWidth * height != newHeight * width) @@ -300,8 +301,8 @@ PC_TexFormat TextureCache::LoadCustomTexture(u64 tex_hash, int texformat, unsign if (newWidth % width || newHeight % height) WARN_LOG(VIDEO, "Invalid custom texture size %dx%d for texture %s. Please use an integer upscaling factor based on the native size %dx%d.", newWidth, newHeight, texPathTemp.c_str(), width, height); - width = newWidth; - height = newHeight; + *widthp = newWidth; + *heightp = newHeight; } return ret; } @@ -466,8 +467,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage, if (g_ActiveConfig.bHiresTextures) { - // This function may modify width/height. - pcfmt = LoadCustomTexture(tex_hash, texformat, 0, width, height); + pcfmt = LoadCustomTexture(tex_hash, texformat, 0, &width, &height); if (pcfmt != PC_TEX_FMT_NONE) { if (expandedWidth != width || expandedHeight != height) @@ -584,7 +584,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage, unsigned int mip_width = CalculateLevelSize(width, level); unsigned int mip_height = CalculateLevelSize(height, level); - LoadCustomTexture(tex_hash, texformat, level, mip_width, mip_height); + LoadCustomTexture(tex_hash, texformat, level, &mip_width, &mip_height); entry->Load(mip_width, mip_height, mip_width, level); } } diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index eb13096624..fbe13915fa 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -116,7 +116,7 @@ protected: private: static bool CheckForCustomTextureLODs(u64 tex_hash, int texformat, unsigned int levels); - static PC_TexFormat LoadCustomTexture(u64 tex_hash, int texformat, unsigned int level, unsigned int& width, unsigned int& height); + static PC_TexFormat LoadCustomTexture(u64 tex_hash, int texformat, unsigned int level, unsigned int* width, unsigned int* height); static void DumpTexture(TCacheEntryBase* entry, unsigned int level); static TCacheEntryBase* AllocateRenderTarget(unsigned int width, unsigned int height); |
