diff --git a/plugins/GSdx/GPUState.h b/plugins/GSdx/GPUState.h index c2aeb287e7..e47a88413b 100644 --- a/plugins/GSdx/GPUState.h +++ b/plugins/GSdx/GPUState.h @@ -87,12 +87,14 @@ class GPUState : public GSAlignedClass<32> protected: int s_n; + bool dump_enable = false; void Dump(const string& s, uint32 TP, const GSVector4i& r, int inc = true) { //if(m_perfmon.GetFrame() < 1000) //if((m_env.TWIN.u32 & 0xfffff) == 0) //if(!m_env.STATUS.ME && !m_env.STATUS.MD) + if(!dump_enable) return; if(inc) s_n++; diff --git a/plugins/GSdx/GSClut.cpp b/plugins/GSdx/GSClut.cpp index a7eab9a4b2..261604e4fd 100644 --- a/plugins/GSdx/GSClut.cpp +++ b/plugins/GSdx/GSClut.cpp @@ -331,7 +331,7 @@ void GSClut::Read32(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) } } -void GSClut::GetAlphaMinMax32(int& amin, int& amax) +void GSClut::GetAlphaMinMax32(int& amin_out, int& amax_out) { // call only after Read32 @@ -394,8 +394,8 @@ void GSClut::GetAlphaMinMax32(int& amin, int& amax) } } - amin = m_read.amin; - amax = m_read.amax; + amin_out = m_read.amin; + amax_out = m_read.amax; } // diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index 1c4a2d8cec..a09ff0a351 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -622,7 +622,7 @@ void GSDevice11::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r) return; } - D3D11_BOX box = {r.left, r.top, 0, r.right, r.bottom, 1}; + D3D11_BOX box = {(UINT)r.left, (UINT)r.top, 0U, (UINT)r.right, (UINT)r.bottom, 1U}; m_ctx->CopySubresourceRegion(*(GSTexture11*)dTex, 0, 0, 0, 0, *(GSTexture11*)sTex, 0, &box); } @@ -793,8 +793,8 @@ void GSDevice11::DoExternalFX(GSTexture* sTex, GSTexture* dTex) InitExternalFX(); - cb.xyFrame = GSVector2(s.x, s.y); - cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f); + cb.xyFrame = GSVector2((float)s.x, (float)s.y); + cb.rcpFrame = GSVector4(1.0f / (float)s.x, 1.0f / (float)s.y, 0.0f, 0.0f); cb.rcpFrameOpt = GSVector4::zero(); m_ctx->UpdateSubresource(m_shaderfx.cb, 0, NULL, &cb, 0, 0); diff --git a/plugins/GSdx/GSDevice9.cpp b/plugins/GSdx/GSDevice9.cpp index 1414d07fd7..4d0a6ad446 100644 --- a/plugins/GSdx/GSDevice9.cpp +++ b/plugins/GSdx/GSDevice9.cpp @@ -977,7 +977,7 @@ void GSDevice9::DoExternalFX(GSTexture* sTex, GSTexture* dTex) InitExternalFX(); - cb.xyFrame = GSVector2(s.x, s.y); + cb.xyFrame = GSVector2((float)s.x, (float)s.y); cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f); cb.rcpFrameOpt = GSVector4::zero(); diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index a685ff9146..22bbc578e3 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -72,7 +72,7 @@ GSDeviceOGL::GSDeviceOGL() m_debug_gl_file = fopen("GSdx_opengl_debug.txt","w"); #endif - m_debug_gl_call = theApp.GetConfig("debug_opengl", 0); + m_debug_gl_call = !!theApp.GetConfig("debug_opengl", 0); } GSDeviceOGL::~GSDeviceOGL() @@ -1039,7 +1039,7 @@ void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture else OMSetRenderTargets(dTex, NULL); - OMSetBlendState(bs); + OMSetBlendState((uint8)bs); OMSetColorMaskState(); // ************************************ @@ -1219,7 +1219,7 @@ void GSDeviceOGL::DoExternalFX(GSTexture* sTex, GSTexture* dTex) ExternalFXConstantBuffer cb; - cb.xyFrame = GSVector2(s.x, s.y); + cb.xyFrame = GSVector2((float)s.x, (float)s.y); cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f); cb.rcpFrameOpt = GSVector4::zero(); diff --git a/plugins/GSdx/GSLocalMemory.cpp b/plugins/GSdx/GSLocalMemory.cpp index 537a3f088f..95371af473 100644 --- a/plugins/GSdx/GSLocalMemory.cpp +++ b/plugins/GSdx/GSLocalMemory.cpp @@ -41,7 +41,7 @@ for(int x = _r.left; x < _r.right; x += w >> 3) \ { \ const uint8* src = BlockPtr(_base + off->block.col[x]); \ - uint8* dst = &_dst[x * bpp]; \ + uint8* read_dst = &_dst[x * bpp]; \ #define FOREACH_BLOCK_END }} @@ -1612,7 +1612,7 @@ void GSLocalMemory::ReadTexture32(const GSOffset* RESTRICT off, const GSVector4i { FOREACH_BLOCK_START(r, 8, 8, 32) { - GSBlock::ReadBlock32(src, dst, dstpitch); + GSBlock::ReadBlock32(src, read_dst, dstpitch); } FOREACH_BLOCK_END } @@ -1623,7 +1623,7 @@ void GSLocalMemory::ReadTexture24(const GSOffset* RESTRICT off, const GSVector4i { FOREACH_BLOCK_START(r, 8, 8, 32) { - GSBlock::ReadAndExpandBlock24(src, dst, dstpitch, TEXA); + GSBlock::ReadAndExpandBlock24(src, read_dst, dstpitch, TEXA); } FOREACH_BLOCK_END } @@ -1631,7 +1631,7 @@ void GSLocalMemory::ReadTexture24(const GSOffset* RESTRICT off, const GSVector4i { FOREACH_BLOCK_START(r, 8, 8, 32) { - GSBlock::ReadAndExpandBlock24(src, dst, dstpitch, TEXA); + GSBlock::ReadAndExpandBlock24(src, read_dst, dstpitch, TEXA); } FOREACH_BLOCK_END } @@ -1643,7 +1643,7 @@ void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT off, const GSVector4i { FOREACH_BLOCK_START(r, 16, 8, 32) { - GSBlock::ReadAndExpandBlock16(src, dst, dstpitch, TEXA); + GSBlock::ReadAndExpandBlock16(src, read_dst, dstpitch, TEXA); } FOREACH_BLOCK_END } @@ -1651,7 +1651,7 @@ void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT off, const GSVector4i { FOREACH_BLOCK_START(r, 16, 8, 32) { - GSBlock::ReadAndExpandBlock16(src, dst, dstpitch, TEXA); + GSBlock::ReadAndExpandBlock16(src, read_dst, dstpitch, TEXA); } FOREACH_BLOCK_END } @@ -1663,7 +1663,7 @@ void GSLocalMemory::ReadTexture8(const GSOffset* RESTRICT off, const GSVector4i& FOREACH_BLOCK_START(r, 16, 16, 32) { - GSBlock::ReadAndExpandBlock8_32(src, dst, dstpitch, pal); + GSBlock::ReadAndExpandBlock8_32(src, read_dst, dstpitch, pal); } FOREACH_BLOCK_END } @@ -1674,7 +1674,7 @@ void GSLocalMemory::ReadTexture4(const GSOffset* RESTRICT off, const GSVector4i& FOREACH_BLOCK_START(r, 32, 16, 32) { - GSBlock::ReadAndExpandBlock4_32(src, dst, dstpitch, pal); + GSBlock::ReadAndExpandBlock4_32(src, read_dst, dstpitch, pal); } FOREACH_BLOCK_END } @@ -1685,7 +1685,7 @@ void GSLocalMemory::ReadTexture8H(const GSOffset* RESTRICT off, const GSVector4i FOREACH_BLOCK_START(r, 8, 8, 32) { - GSBlock::ReadAndExpandBlock8H_32(src, dst, dstpitch, pal); + GSBlock::ReadAndExpandBlock8H_32(src, read_dst, dstpitch, pal); } FOREACH_BLOCK_END } @@ -1696,7 +1696,7 @@ void GSLocalMemory::ReadTexture4HL(const GSOffset* RESTRICT off, const GSVector4 FOREACH_BLOCK_START(r, 8, 8, 32) { - GSBlock::ReadAndExpandBlock4HL_32(src, dst, dstpitch, pal); + GSBlock::ReadAndExpandBlock4HL_32(src, read_dst, dstpitch, pal); } FOREACH_BLOCK_END } @@ -1707,7 +1707,7 @@ void GSLocalMemory::ReadTexture4HH(const GSOffset* RESTRICT off, const GSVector4 FOREACH_BLOCK_START(r, 8, 8, 32) { - GSBlock::ReadAndExpandBlock4HH_32(src, dst, dstpitch, pal); + GSBlock::ReadAndExpandBlock4HH_32(src, read_dst, dstpitch, pal); } FOREACH_BLOCK_END } @@ -1870,7 +1870,7 @@ void GSLocalMemory::ReadTexture8P(const GSOffset* RESTRICT off, const GSVector4i { FOREACH_BLOCK_START(r, 16, 16, 8) { - GSBlock::ReadBlock8(src, dst, dstpitch); + GSBlock::ReadBlock8(src, read_dst, dstpitch); } FOREACH_BLOCK_END } @@ -1879,7 +1879,7 @@ void GSLocalMemory::ReadTexture4P(const GSOffset* RESTRICT off, const GSVector4i { FOREACH_BLOCK_START(r, 32, 16, 8) { - GSBlock::ReadBlock4P(src, dst, dstpitch); + GSBlock::ReadBlock4P(src, read_dst, dstpitch); } FOREACH_BLOCK_END } @@ -1888,7 +1888,7 @@ void GSLocalMemory::ReadTexture8HP(const GSOffset* RESTRICT off, const GSVector4 { FOREACH_BLOCK_START(r, 8, 8, 8) { - GSBlock::ReadBlock8HP(src, dst, dstpitch); + GSBlock::ReadBlock8HP(src, read_dst, dstpitch); } FOREACH_BLOCK_END } @@ -1897,7 +1897,7 @@ void GSLocalMemory::ReadTexture4HLP(const GSOffset* RESTRICT off, const GSVector { FOREACH_BLOCK_START(r, 8, 8, 8) { - GSBlock::ReadBlock4HLP(src, dst, dstpitch); + GSBlock::ReadBlock4HLP(src, read_dst, dstpitch); } FOREACH_BLOCK_END } @@ -1906,7 +1906,7 @@ void GSLocalMemory::ReadTexture4HHP(const GSOffset* RESTRICT off, const GSVector { FOREACH_BLOCK_START(r, 8, 8, 8) { - GSBlock::ReadBlock4HHP(src, dst, dstpitch); + GSBlock::ReadBlock4HHP(src, read_dst, dstpitch); } FOREACH_BLOCK_END } diff --git a/plugins/GSdx/GSRendererDX.cpp b/plugins/GSdx/GSRendererDX.cpp index 531d3e4ecd..35d7e44812 100644 --- a/plugins/GSdx/GSRendererDX.cpp +++ b/plugins/GSdx/GSRendererDX.cpp @@ -263,10 +263,10 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc GSVector4i tmp(v[i].XYZ.Y, v[i].V, v[i + 1].XYZ.Y, v[i + 1].V); tmp = GSVector4i(tmp - offset).srl32(1) + offset; - v[i].XYZ.Y = tmp.x; - v[i].V = tmp.y; - v[i + 1].XYZ.Y = tmp.z; - v[i + 1].V = tmp.w; + v[i].XYZ.Y = (uint16)tmp.x; + v[i].V = (uint16)tmp.y; + v[i + 1].XYZ.Y = (uint16)tmp.z; + v[i + 1].V = (uint16)tmp.w; } // Please bang my head against the wall! diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 37c4033b19..6a00419472 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -201,22 +201,22 @@ void GSRendererHW::InvalidateLocalMem(const GIFRegBITBLTBUF& BITBLTBUF, const GS m_tc->InvalidateLocalMem(m_mem.GetOffset(BITBLTBUF.SBP, BITBLTBUF.SBW, BITBLTBUF.SPSM), r); } -int GSRendererHW::Interpolate_UV(float alpha, int t0, int t1) +uint16 GSRendererHW::Interpolate_UV(float alpha, int t0, int t1) { float t = (1.0f - alpha) * t0 + alpha * t1; - return (int)t & ~0xF; // cheap rounding + return (uint16)t & ~0xF; // cheap rounding } float GSRendererHW::alpha0(int L, int X0, int X1) { - float x = (X0 + 15) & ~0xF; // Round up - return (x - X0) / (float)L; + int x = (X0 + 15) & ~0xF; // Round up + return float(x - X0) / (float)L; } float GSRendererHW::alpha1(int L, int X0, int X1) { - float x = (X1 - 1) & ~0xF; // Round down. Note -1 because right pixel isn't included in primitive so 0x100 must return 0. - return (x - X0) / (float)L; + int x = (X1 - 1) & ~0xF; // Round down. Note -1 because right pixel isn't included in primitive so 0x100 must return 0. + return float(x - X0) / (float)L; } template @@ -234,14 +234,14 @@ void GSRendererHW::RoundSpriteOffset() // Performance note: if it had any impact on perf, someone would port it to SSE (AKA GSVector) // Compute the coordinate of first and last texels (in native with a linear filtering) - int ox = m_context->XYOFFSET.OFX; - int X0 = v[i].XYZ.X - ox; - int X1 = v[i+1].XYZ.X - ox; - int Lx = (v[i+1].XYZ.X - v[i].XYZ.X); - float ax0 = alpha0(Lx, X0, X1); - float ax1 = alpha1(Lx, X0, X1); - int tx0 = Interpolate_UV(ax0, v[i].U, v[i+1].U); - int tx1 = Interpolate_UV(ax1, v[i].U, v[i+1].U); + int ox = m_context->XYOFFSET.OFX; + int X0 = v[i].XYZ.X - ox; + int X1 = v[i+1].XYZ.X - ox; + int Lx = (v[i+1].XYZ.X - v[i].XYZ.X); + float ax0 = alpha0(Lx, X0, X1); + float ax1 = alpha1(Lx, X0, X1); + uint16 tx0 = Interpolate_UV(ax0, v[i].U, v[i+1].U); + uint16 tx1 = Interpolate_UV(ax1, v[i].U, v[i+1].U); #ifdef DEBUG_U if (debug) { fprintf(stderr, "u0:%d and u1:%d\n", v[i].U, v[i+1].U); @@ -250,14 +250,14 @@ void GSRendererHW::RoundSpriteOffset() } #endif - int oy = m_context->XYOFFSET.OFY; - int Y0 = v[i].XYZ.Y - oy; - int Y1 = v[i+1].XYZ.Y - oy; - int Ly = (v[i+1].XYZ.Y - v[i].XYZ.Y); - float ay0 = alpha0(Ly, Y0, Y1); - float ay1 = alpha1(Ly, Y0, Y1); - int ty0 = Interpolate_UV(ay0, v[i].V, v[i+1].V); - int ty1 = Interpolate_UV(ay1, v[i].V, v[i+1].V); + int oy = m_context->XYOFFSET.OFY; + int Y0 = v[i].XYZ.Y - oy; + int Y1 = v[i+1].XYZ.Y - oy; + int Ly = (v[i+1].XYZ.Y - v[i].XYZ.Y); + float ay0 = alpha0(Ly, Y0, Y1); + float ay1 = alpha1(Ly, Y0, Y1); + uint16 ty0 = Interpolate_UV(ay0, v[i].V, v[i+1].V); + uint16 ty1 = Interpolate_UV(ay1, v[i].V, v[i+1].V); #ifdef DEBUG_V if (debug) { fprintf(stderr, "v0:%d and v1:%d\n", v[i].V, v[i+1].V); @@ -958,9 +958,9 @@ bool GSRendererHW::OI_GodOfWar2(GSTexture* rt, GSTexture* ds, GSTextureCache::So TEX0.TBW = FBW; TEX0.PSM = FPSM; - if(GSTextureCache::Target* ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, true)) + if(GSTextureCache::Target* tmp_ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, true)) { - m_dev->ClearDepth(ds->m_texture, 0); + m_dev->ClearDepth(tmp_ds->m_texture, 0); } return false; @@ -1007,9 +1007,9 @@ bool GSRendererHW::OI_RozenMaidenGebetGarden(GSTexture* rt, GSTexture* ds, GSTex TEX0.TBW = m_context->FRAME.FBW; TEX0.PSM = m_context->FRAME.PSM; - if(GSTextureCache::Target* rt = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::RenderTarget, true)) + if(GSTextureCache::Target* tmp_rt = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::RenderTarget, true)) { - m_dev->ClearRenderTarget(rt->m_texture, 0); + m_dev->ClearRenderTarget(tmp_rt->m_texture, 0); } return false; @@ -1024,9 +1024,9 @@ bool GSRendererHW::OI_RozenMaidenGebetGarden(GSTexture* rt, GSTexture* ds, GSTex TEX0.TBW = m_context->FRAME.FBW; TEX0.PSM = m_context->ZBUF.PSM; - if(GSTextureCache::Target* ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, true)) + if(GSTextureCache::Target* tmp_ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, true)) { - m_dev->ClearDepth(ds->m_texture, 0); + m_dev->ClearDepth(tmp_ds->m_texture, 0); } return false; @@ -1235,9 +1235,9 @@ bool GSRendererHW::OI_SMTNocturne(GSTexture* rt, GSTexture* ds, GSTextureCache:: TEX0.TBP0 = FBP; TEX0.TBW = FBW; TEX0.PSM = FPSM; - if (GSTextureCache::Target* ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, true)) + if (GSTextureCache::Target* tmp_ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, true)) { - m_dev->ClearDepth(ds->m_texture, 0); + m_dev->ClearDepth(tmp_ds->m_texture, 0); } return false; } diff --git a/plugins/GSdx/GSRendererHW.h b/plugins/GSdx/GSRendererHW.h index 83272e7899..58c638901a 100644 --- a/plugins/GSdx/GSRendererHW.h +++ b/plugins/GSdx/GSRendererHW.h @@ -138,7 +138,7 @@ private: #pragma endregion - int Interpolate_UV(float alpha, int t0, int t1); + uint16 Interpolate_UV(float alpha, int t0, int t1); float alpha0(int L, int X0, int X1); float alpha1(int L, int X0, int X1); diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 1bbf3a0a9d..6863007e6e 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -27,7 +27,7 @@ GSRendererOGL::GSRendererOGL() : GSRendererHW(new GSTextureCacheOGL(this)) { - m_accurate_date = theApp.GetConfig("accurate_date", 0); + m_accurate_date = !!theApp.GetConfig("accurate_date", 0); m_sw_blending = theApp.GetConfig("accurate_blending_unit", 1); @@ -37,7 +37,7 @@ GSRendererOGL::GSRendererOGL() UserHacks_TCOffset = theApp.GetConfig("UserHacks_TCOffset", 0); UserHacks_TCO_x = (UserHacks_TCOffset & 0xFFFF) / -1000.0f; UserHacks_TCO_y = ((UserHacks_TCOffset >> 16) & 0xFFFF) / -1000.0f; - UserHacks_safe_fbmask = theApp.GetConfig("UserHacks_safe_fbmask", false); + UserHacks_safe_fbmask = !!theApp.GetConfig("UserHacks_safe_fbmask", 0); m_prim_overlap = PRIM_OVERLAP_UNKNOW; m_unsafe_fbmask = false; @@ -175,7 +175,7 @@ bool GSRendererOGL::EmulateTextureShuffleAndFbmask(GSDeviceOGL::PSSelector& ps_s bool write_ba = (pos > 112 && pos < 136); // Read texture is 8 to 16 pixels (same as above) float tw = (float)(1u << m_context->TEX0.TW); - int tex_pos = (PRIM->FST) ? v[0].U : tw * v[0].ST.S; + int tex_pos = (PRIM->FST) ? v[0].U : (int)(tw * v[0].ST.S); tex_pos &= 0xFF; ps_sel.read_ba = (tex_pos > 112 && tex_pos < 144); @@ -201,10 +201,10 @@ bool GSRendererOGL::EmulateTextureShuffleAndFbmask(GSDeviceOGL::PSSelector& ps_s GSVector4i tmp(v[i].XYZ.Y, v[i].V, v[i+1].XYZ.Y, v[i+1].V); tmp = GSVector4i(tmp - offset).srl32(1) + offset; - v[i].XYZ.Y = tmp.x; - v[i].V = tmp.y; - v[i+1].XYZ.Y = tmp.z; - v[i+1].V = tmp.w; + v[i].XYZ.Y = (uint16)tmp.x; + v[i].V = (uint16)tmp.y; + v[i+1].XYZ.Y = (uint16)tmp.z; + v[i+1].V = (uint16)tmp.w; } } else { const float offset_8pix = 8.0f / tw; @@ -228,9 +228,9 @@ bool GSRendererOGL::EmulateTextureShuffleAndFbmask(GSDeviceOGL::PSSelector& ps_s tmp = GSVector4i(tmp - offset).srl32(1) + offset; //fprintf(stderr, "Before %d, After %d\n", v[i+1].XYZ.Y, tmp.y); - v[i].XYZ.Y = tmp.x; + v[i].XYZ.Y = (uint16)tmp.x; v[i].ST.T /= 2.0f; - v[i+1].XYZ.Y = tmp.y; + v[i+1].XYZ.Y = (uint16)tmp.y; v[i+1].ST.T /= 2.0f; } } @@ -365,7 +365,7 @@ bool GSRendererOGL::EmulateBlending(GSDeviceOGL::PSSelector& ps_sel, bool DATE_G } // Compute the blending equation to detect special case - uint8 blend_index = ((ALPHA.A * 3 + ALPHA.B) * 3 + ALPHA.C) * 3 + ALPHA.D; + uint8 blend_index = uint8(((ALPHA.A * 3 + ALPHA.B) * 3 + ALPHA.C) * 3 + ALPHA.D); int blend_flag = GSDeviceOGL::m_blendMapOGL[blend_index].bogus; // SW Blend is (nearly) free. Let's use it. @@ -373,7 +373,7 @@ bool GSRendererOGL::EmulateBlending(GSDeviceOGL::PSSelector& ps_sel, bool DATE_G || (m_prim_overlap == PRIM_OVERLAP_NO); // Do the multiplication in shader for blending accumulation: Cs*As + Cd or Cs*Af + Cd - bool accumulation_blend = (blend_flag & BLEND_ACCU); + bool accumulation_blend = !!(blend_flag & BLEND_ACCU); // Warning no break on purpose switch (m_sw_blending) { @@ -462,7 +462,7 @@ bool GSRendererOGL::EmulateBlending(GSDeviceOGL::PSSelector& ps_sel, bool DATE_G ps_sel.clr1 = !!(blend_flag & BLEND_C_CLR); if (ps_sel.dfmt == 1 && ALPHA.C == 1) { // 24 bits doesn't have an alpha channel so use 1.0f fix factor as equivalent - int hacked_blend_index = blend_index + 3; // +3 <=> +1 on C + uint8 hacked_blend_index = blend_index + 3; // +3 <=> +1 on C dev->OMSetBlendState(hacked_blend_index, 128, true); } else { dev->OMSetBlendState(blend_index, ALPHA.FIX, (ALPHA.C == 2)); diff --git a/plugins/GSdx/GSSettingsDlg.cpp b/plugins/GSdx/GSSettingsDlg.cpp index 4e0ac39229..fc4d2e97b3 100644 --- a/plugins/GSdx/GSSettingsDlg.cpp +++ b/plugins/GSdx/GSSettingsDlg.cpp @@ -232,7 +232,7 @@ bool GSSettingsDlg::OnCommand(HWND hWnd, UINT id, UINT code) if(ComboBoxGetSelData(IDC_OPENCL_DEVICE, data)) { - if ((int)data < m_ocl_devs.size()) { + if ((UINT)data < m_ocl_devs.size()) { theApp.SetConfig("ocldev", m_ocl_devs[(int)data].name.c_str()); } } diff --git a/plugins/GSdx/GSTexture11.cpp b/plugins/GSdx/GSTexture11.cpp index 2e4cbf557b..409a565b1c 100644 --- a/plugins/GSdx/GSTexture11.cpp +++ b/plugins/GSdx/GSTexture11.cpp @@ -50,7 +50,7 @@ bool GSTexture11::Update(const GSVector4i& r, const void* data, int pitch) { if(m_dev && m_texture) { - D3D11_BOX box = {r.left, r.top, 0, r.right, r.bottom, 1}; + D3D11_BOX box = { (UINT)r.left, (UINT)r.top, 0U, (UINT)r.right, (UINT)r.bottom, 1U }; m_ctx->UpdateSubresource(m_texture, 0, &box, data, pitch, 0); diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index f79e7848f0..103badd26f 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -32,9 +32,9 @@ GSTextureCache::GSTextureCache(GSRenderer* r) if (theApp.GetConfig("UserHacks", 0)) { m_spritehack = theApp.GetConfig("UserHacks_SpriteHack", 0); - UserHacks_HalfPixelOffset = theApp.GetConfig("UserHacks_HalfPixelOffset", 0); - m_preload_frame = theApp.GetConfig("preload_frame_with_gs_data", 0); - m_disable_partial_invalidation = theApp.GetConfig("UserHacks_DisablePartialInvalidation", 0); + UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0); + m_preload_frame = !!theApp.GetConfig("preload_frame_with_gs_data", 0); + m_disable_partial_invalidation = !!theApp.GetConfig("UserHacks_DisablePartialInvalidation", 0); m_can_convert_depth = !theApp.GetConfig("UserHacks_DisableDepthSupport", 0); } else { m_spritehack = 0; @@ -299,7 +299,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int } else if (CanConvertDepth()) { int rev_type = (type == DepthStencil) ? RenderTarget : DepthStencil; - GSVector4 sRect(0, 0, 1.0, 1.0); + GSVector4 sRect(0, 0, 1, 1); GSVector4 dRect(0, 0, w, h); // Depth stencil/RT can be an older RT/DS but only check recent RT/DS to avoid to pick @@ -1123,7 +1123,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con // which is arbitrary set to 1280 (biggest RT used by GS). h/w are based on the input texture // so the only reliable way to find the real size of the target is to use the TBW value. float real_width = dst->m_TEX0.TBW * 64u * dst->m_texture->GetScale().x; - m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i(real_width/2.0f, 0, real_width, h)); + m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i((int)(real_width/2.0f), 0, (int)real_width, h)); } else { m_renderer->m_dev->CopyRect(sTex, dTex, GSVector4i(0, 0, w, h)); // <= likely wrong dstsize.x could be bigger than w }