Skip to content

Commit

Permalink
GSdx-hw: get rid of some VS warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
iMineLink authored and lightningterror committed Jun 15, 2020
1 parent 60e8d40 commit d05b31e
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions plugins/GSdx/Renderers/HW/GSRendererHW.cpp
Expand Up @@ -750,10 +750,10 @@ void GSRendererHW::SwSpriteRender()
&& m_vt.m_eq.z == 0x1
&& (!PRIM->TME || PRIM->FST || m_vt.m_eq.q == 0x1))); // Check Q equality only if texturing enabled and STQ coords used

bool texture_mapping_enabled = PRIM->TME;
const bool texture_mapping_enabled = PRIM->TME;

// Setup registers for SW rendering
GIFRegBITBLTBUF bitbltbuf;
GIFRegBITBLTBUF bitbltbuf = {};

if (texture_mapping_enabled)
{
Expand All @@ -771,14 +771,14 @@ void GSRendererHW::SwSpriteRender()
ASSERT(!PRIM->TME || (abs(m_vt.m_max.t.x - m_r.z) <= SSR_UV_TOLERANCE && abs(m_vt.m_max.t.y - m_r.w) <= SSR_UV_TOLERANCE)); // No input texture min/mag, if any
ASSERT(!PRIM->TME || (m_vt.m_max.t.x <= (1 << m_context->TEX0.TW) && m_vt.m_max.t.y <= (1 << m_context->TEX0.TH))); // No texture UV wrap, if any

GIFRegTRXPOS trxpos;
GIFRegTRXPOS trxpos = {};

trxpos.DSAX = 0;
trxpos.DSAY = 0;
trxpos.SSAX = 0;
trxpos.SSAY = 0;

GIFRegTRXREG trxreg;
GIFRegTRXREG trxreg = {};

trxreg.RRW = m_r.z;
trxreg.RRH = m_r.w;
Expand All @@ -789,8 +789,8 @@ void GSRendererHW::SwSpriteRender()
int sy = trxpos.SSAY;
int dx = trxpos.DSAX;
int dy = trxpos.DSAY;
int w = trxreg.RRW;
int h = trxreg.RRH;
const int w = trxreg.RRW;
const int h = trxreg.RRH;

GL_INS("SwSpriteRender: Dest 0x%x W:%d F:%s, size(%d %d)", bitbltbuf.DBP, bitbltbuf.DBW, psm_str(bitbltbuf.DPSM), w, h);

Expand All @@ -801,29 +801,29 @@ void GSRendererHW::SwSpriteRender()
GSOffset* RESTRICT spo = texture_mapping_enabled ? m_mem.GetOffset(bitbltbuf.SBP, bitbltbuf.SBW, bitbltbuf.SPSM) : nullptr;
GSOffset* RESTRICT dpo = m_mem.GetOffset(bitbltbuf.DBP, bitbltbuf.DBW, bitbltbuf.DPSM);

int* RESTRICT scol = texture_mapping_enabled ? &spo->pixel.col[0][sx] : nullptr;
const int* RESTRICT scol = texture_mapping_enabled ? &spo->pixel.col[0][sx] : nullptr;
int* RESTRICT dcol = &dpo->pixel.col[0][dx];

bool alpha_blending_enabled = PRIM->ABE;
const bool alpha_blending_enabled = PRIM->ABE;

const GSVertex& v = m_vertex.buff[m_index.buff[m_index.tail - 1]]; // Last vertex.
const GSVector4i vc = GSVector4i(v.RGBAQ.R, v.RGBAQ.G, v.RGBAQ.B, v.RGBAQ.A) // 0x000000AA000000BB000000GG000000RR
.ps32(); // 0x00AA00BB00GG00RR00AA00BB00GG00RR

GSVector4i a_mask = GSVector4i::xff000000().u8to16(); // 0x00FF00000000000000FF000000000000
const GSVector4i a_mask = GSVector4i::xff000000().u8to16(); // 0x00FF00000000000000FF000000000000

bool fb_mask_enabled = m_context->FRAME.FBMSK != 0x0;
GSVector4i fb_mask = GSVector4i(m_context->FRAME.FBMSK).u8to16(); // 0x00AA00BB00GG00RR00AA00BB00GG00RR
const bool fb_mask_enabled = m_context->FRAME.FBMSK != 0x0;
const GSVector4i fb_mask = GSVector4i(m_context->FRAME.FBMSK).u8to16(); // 0x00AA00BB00GG00RR00AA00BB00GG00RR

uint8 tex0_tfx = m_context->TEX0.TFX;
uint8 tex0_tcc = m_context->TEX0.TCC;
uint8 alpha_b = m_context->ALPHA.B;
uint8 alpha_c = m_context->ALPHA.C;
uint8 alpha_fix = m_context->ALPHA.FIX;
const uint8 tex0_tfx = m_context->TEX0.TFX;
const uint8 tex0_tcc = m_context->TEX0.TCC;
const uint8 alpha_b = m_context->ALPHA.B;
const uint8 alpha_c = m_context->ALPHA.C;
const uint8 alpha_fix = m_context->ALPHA.FIX;

for (int y = 0; y < h; y++, ++sy, ++dy)
{
uint32* RESTRICT s = texture_mapping_enabled ? &m_mem.m_vm32[spo->pixel.row[sy]] : nullptr;
const uint32* RESTRICT s = texture_mapping_enabled ? &m_mem.m_vm32[spo->pixel.row[sy]] : nullptr;
uint32* RESTRICT d = &m_mem.m_vm32[dpo->pixel.row[dy]];

ASSERT(w % 2 == 0);
Expand Down Expand Up @@ -920,10 +920,10 @@ void GSRendererHW::SwSpriteRender()

bool GSRendererHW::CanUseSwSpriteRender(bool allow_64x64_sprite)
{
bool r_0_0_64_64 = allow_64x64_sprite ? (m_r == GSVector4i(0, 0, 64, 64)).alltrue() : false;
const bool r_0_0_64_64 = allow_64x64_sprite ? (m_r == GSVector4i(0, 0, 64, 64)).alltrue() : false;
if (r_0_0_64_64 && !allow_64x64_sprite) // Rendering region 64x64 support is enabled via parameter
return false;
bool r_0_0_16_16 = (m_r == GSVector4i(0, 0, 16, 16)).alltrue();
const bool r_0_0_16_16 = (m_r == GSVector4i(0, 0, 16, 16)).alltrue();
if (!r_0_0_16_16 && !r_0_0_64_64) // Rendering region is 16x16 or 64x64, without offset
return false;
if (PRIM->PRIM != GS_SPRITE
Expand Down Expand Up @@ -956,8 +956,8 @@ bool GSRendererHW::CanUseSwSpriteRender(bool allow_64x64_sprite)
return false;
if (abs(m_vt.m_max.t.x - m_r.z) > SSR_UV_TOLERANCE || abs(m_vt.m_max.t.y - m_r.w) > SSR_UV_TOLERANCE) // No texture width or height mag/min
return false;
int tw = 1 << m_context->TEX0.TW;
int th = 1 << m_context->TEX0.TH;
const int tw = 1 << m_context->TEX0.TW;
const int th = 1 << m_context->TEX0.TH;
if (m_vt.m_max.t.x > tw || m_vt.m_max.t.y > th) // No UV wrapping
return false;
}
Expand Down

0 comments on commit d05b31e

Please sign in to comment.