Skip to content

Commit

Permalink
Merge pull request #1610 from rohit-n/sign-compare
Browse files Browse the repository at this point in the history
VideoCommon: Fix -Wsign-compare warnings.
  • Loading branch information
Sonicadvance1 committed Nov 30, 2014
2 parents 7c38d04 + 239eaf1 commit d3c278c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/FramebufferManagerBase.h
Expand Up @@ -55,7 +55,7 @@ class FramebufferManagerBase
static int ScaleToVirtualXfbWidth(int x, unsigned int backbuffer_width);
static int ScaleToVirtualXfbHeight(int y, unsigned int backbuffer_height);

static int GetEFBLayers() { return m_EFBLayers; }
static unsigned int GetEFBLayers() { return m_EFBLayers; }

protected:
struct VirtualXFB
Expand Down
7 changes: 4 additions & 3 deletions Source/Core/VideoCommon/TextureCacheBase.cpp
Expand Up @@ -893,16 +893,17 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
unsigned int scaled_tex_w = g_ActiveConfig.bCopyEFBScaled ? Renderer::EFBToScaledX(tex_w) : tex_w;
unsigned int scaled_tex_h = g_ActiveConfig.bCopyEFBScaled ? Renderer::EFBToScaledY(tex_h) : tex_h;

const unsigned int efb_layers = FramebufferManagerBase::GetEFBLayers();

TCacheEntryBase *entry = textures[dstAddr];
if (entry)
{
if (entry->type == TCET_EC_DYNAMIC && entry->native_width == tex_w && entry->native_height == tex_h && entry->num_layers == FramebufferManagerBase::GetEFBLayers())
if (entry->type == TCET_EC_DYNAMIC && entry->native_width == tex_w && entry->native_height == tex_h && entry->num_layers == efb_layers)
{
scaled_tex_w = tex_w;
scaled_tex_h = tex_h;
}
else if (!(entry->type == TCET_EC_VRAM && entry->virtual_width == scaled_tex_w && entry->virtual_height == scaled_tex_h && entry->num_layers == FramebufferManagerBase::GetEFBLayers()))
else if (!(entry->type == TCET_EC_VRAM && entry->virtual_width == scaled_tex_w && entry->virtual_height == scaled_tex_h && entry->num_layers == efb_layers))
{
if (entry->type == TCET_EC_VRAM)
{
Expand All @@ -925,7 +926,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
textures[dstAddr] = entry = AllocateRenderTarget(scaled_tex_w, scaled_tex_h);

// TODO: Using the wrong dstFormat, dumb...
entry->SetGeneralParameters(dstAddr, 0, dstFormat, 1, FramebufferManagerBase::GetEFBLayers());
entry->SetGeneralParameters(dstAddr, 0, dstFormat, 1, efb_layers);
entry->SetDimensions(tex_w, tex_h, scaled_tex_w, scaled_tex_h);
entry->SetHashes(TEXHASH_INVALID);
entry->type = TCET_EC_VRAM;
Expand Down

0 comments on commit d3c278c

Please sign in to comment.