From 774596dbed35c2d69d8b70d58c4190cb1b42d1ac Mon Sep 17 00:00:00 2001 From: degasus Date: Fri, 16 May 2014 21:57:14 +0200 Subject: [PATCH] TexCache: rename OverlapsMemoryRange --- Source/Core/VideoCommon/TextureCacheBase.cpp | 14 ++++++-------- Source/Core/VideoCommon/TextureCacheBase.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 70e8f0433f..94ac0d2848 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -181,8 +181,7 @@ void TextureCache::InvalidateRange(u32 start_address, u32 size) tcend = textures.end(); while (iter != tcend) { - const int rangePosition = iter->second->IntersectsMemoryRange(start_address, size); - if (0 == rangePosition) + if (iter->second->OverlapsMemoryRange(start_address, size)) { delete iter->second; textures.erase(iter++); @@ -205,8 +204,7 @@ void TextureCache::MakeRangeDynamic(u32 start_address, u32 size) for (; iter != tcend; ++iter) { - const int rangePosition = iter->second->IntersectsMemoryRange(start_address, size); - if (0 == rangePosition) + if (iter->second->OverlapsMemoryRange(start_address, size)) { iter->second->SetHashes(TEXHASH_INVALID); } @@ -223,15 +221,15 @@ bool TextureCache::Find(u32 start_address, u64 hash) return false; } -int TextureCache::TCacheEntryBase::IntersectsMemoryRange(u32 range_address, u32 range_size) const +bool TextureCache::TCacheEntryBase::OverlapsMemoryRange(u32 range_address, u32 range_size) const { if (addr + size_in_bytes < range_address) - return -1; + return false; if (addr >= range_address + range_size) - return 1; + return false; - return 0; + return true; } void TextureCache::ClearRenderTargets() diff --git a/Source/Core/VideoCommon/TextureCacheBase.h b/Source/Core/VideoCommon/TextureCacheBase.h index cea35816fe..93345b9617 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.h +++ b/Source/Core/VideoCommon/TextureCacheBase.h @@ -81,7 +81,7 @@ public: bool isIntensity, bool scaleByHalf, unsigned int cbufid, const float *colmat) = 0; - int IntersectsMemoryRange(u32 range_address, u32 range_size) const; + bool OverlapsMemoryRange(u32 range_address, u32 range_size) const; bool IsEfbCopy() { return (type == TCET_EC_VRAM || type == TCET_EC_DYNAMIC); } };