TexCache: rename OverlapsMemoryRange

This commit is contained in:
degasus 2014-05-16 21:57:14 +02:00
parent dddcea5a9a
commit 774596dbed
2 changed files with 7 additions and 9 deletions

View File

@ -181,8 +181,7 @@ void TextureCache::InvalidateRange(u32 start_address, u32 size)
tcend = textures.end(); tcend = textures.end();
while (iter != tcend) while (iter != tcend)
{ {
const int rangePosition = iter->second->IntersectsMemoryRange(start_address, size); if (iter->second->OverlapsMemoryRange(start_address, size))
if (0 == rangePosition)
{ {
delete iter->second; delete iter->second;
textures.erase(iter++); textures.erase(iter++);
@ -205,8 +204,7 @@ void TextureCache::MakeRangeDynamic(u32 start_address, u32 size)
for (; iter != tcend; ++iter) for (; iter != tcend; ++iter)
{ {
const int rangePosition = iter->second->IntersectsMemoryRange(start_address, size); if (iter->second->OverlapsMemoryRange(start_address, size))
if (0 == rangePosition)
{ {
iter->second->SetHashes(TEXHASH_INVALID); iter->second->SetHashes(TEXHASH_INVALID);
} }
@ -223,15 +221,15 @@ bool TextureCache::Find(u32 start_address, u64 hash)
return false; 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) if (addr + size_in_bytes < range_address)
return -1; return false;
if (addr >= range_address + range_size) if (addr >= range_address + range_size)
return 1; return false;
return 0; return true;
} }
void TextureCache::ClearRenderTargets() void TextureCache::ClearRenderTargets()

View File

@ -81,7 +81,7 @@ public:
bool isIntensity, bool scaleByHalf, unsigned int cbufid, bool isIntensity, bool scaleByHalf, unsigned int cbufid,
const float *colmat) = 0; 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); } bool IsEfbCopy() { return (type == TCET_EC_VRAM || type == TCET_EC_DYNAMIC); }
}; };