summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2014-08-19 20:16:50 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2014-08-19 22:33:46 -0700
commit4bf031c0646e91b35777f1ba4e2b0328063bb666 (patch)
tree9a98fccbb90d608ff1746e4bc8c47bf7819526f3 /Source
parent043ea31f14a330bfdddfb6d5ab14794675efdd74 (diff)
msvc: resolve all warnings in VideoCommon.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp22
-rw-r--r--Source/Core/VideoCommon/HiresTextures.cpp13
-rw-r--r--Source/Core/VideoCommon/PixelShaderManager.cpp12
-rw-r--r--Source/Core/VideoCommon/VertexShaderManager.cpp7
4 files changed, 31 insertions, 23 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 6ba663b75d..5f63280ea8 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -219,7 +219,7 @@ static void BPWritten(const BPCmd& bp)
CopyEFB(destAddr, srcRect,
PE_copy.tp_realFormat(), bpmem.zcontrol.pixel_format,
- PE_copy.intensity_fmt, PE_copy.half_scale);
+ !!PE_copy.intensity_fmt, !!PE_copy.half_scale);
}
else
{
@@ -235,19 +235,19 @@ static void BPWritten(const BPCmd& bp)
else
yScale = (float)bpmem.dispcopyyscale / 256.0f;
- float xfbLines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale);
- if ((u32)xfbLines > MAX_XFB_HEIGHT)
+ float num_xfb_lines = ((bpmem.copyTexSrcWH.y + 1.0f) * yScale);
+
+ u32 height = static_cast<u32>(num_xfb_lines);
+ if (height > MAX_XFB_HEIGHT)
{
- INFO_LOG(VIDEO, "Tried to scale EFB to too many XFB lines (%f)", xfbLines);
- xfbLines = MAX_XFB_HEIGHT;
+ INFO_LOG(VIDEO, "Tried to scale EFB to too many XFB lines: %d (%f)",
+ height, num_xfb_lines);
+ height = MAX_XFB_HEIGHT;
}
u32 width = bpmem.copyMipMapStrideChannels << 4;
- u32 height = xfbLines;
- Renderer::RenderToXFB(destAddr, srcRect,
- width, height,
- s_gammaLUT[PE_copy.gamma]);
+ Renderer::RenderToXFB(destAddr, srcRect, width, height, s_gammaLUT[PE_copy.gamma]);
}
// Clear the rectangular region after copying it.
@@ -565,9 +565,9 @@ static void BPWritten(const BPCmd& bp)
// don't compare with changes!
int num = (bp.address >> 1) & 0x3;
if ((bp.address & 1) == 0)
- PixelShaderManager::SetColorChanged(bpmem.tevregs[num].type_ra, num);
+ PixelShaderManager::SetColorChanged(static_cast<int>(bpmem.tevregs[num].type_ra), num);
else
- PixelShaderManager::SetColorChanged(bpmem.tevregs[num].type_bg, num);
+ PixelShaderManager::SetColorChanged(static_cast<int>(bpmem.tevregs[num].type_bg), num);
}
return;
default:
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp
index f9e7d918c9..605cef4756 100644
--- a/Source/Core/VideoCommon/HiresTextures.cpp
+++ b/Source/Core/VideoCommon/HiresTextures.cpp
@@ -107,13 +107,13 @@ PC_TexFormat GetHiresTex(const std::string& filename, unsigned int* pWidth, unsi
//int offset = 0;
PC_TexFormat returnTex = PC_TEX_FMT_NONE;
- switch (texformat)
- {
// TODO(neobrain): This function currently has no way to enforce RGBA32
// output, which however is required on some configurations to function
// properly. As a lazy workaround, we hence disable the optimized code
// path for now.
#if 0
+ switch (texformat)
+ {
case GX_TF_I4:
case GX_TF_I8:
case GX_TF_IA4:
@@ -131,7 +131,6 @@ PC_TexFormat GetHiresTex(const std::string& filename, unsigned int* pWidth, unsi
}
returnTex = PC_TEX_FMT_IA8;
break;
-#endif
default:
*required_size = width * height * 4;
if (data_size < *required_size)
@@ -141,6 +140,14 @@ PC_TexFormat GetHiresTex(const std::string& filename, unsigned int* pWidth, unsi
returnTex = PC_TEX_FMT_RGBA32;
break;
}
+#else
+ *required_size = width * height * 4;
+ if (data_size < *required_size)
+ goto cleanup;
+
+ memcpy(data, temp, width * height * 4);
+ returnTex = PC_TEX_FMT_RGBA32;
+#endif
INFO_LOG(VIDEO, "Loading custom texture from %s", textureMap[filename].c_str());
cleanup:
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp
index 3ea6713ebd..b20b9815a4 100644
--- a/Source/Core/VideoCommon/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/PixelShaderManager.cpp
@@ -100,8 +100,8 @@ void PixelShaderManager::SetConstants()
if (s_bViewPortChanged)
{
- constants.zbias[1][0] = xfmem.viewport.farZ;
- constants.zbias[1][1] = xfmem.viewport.zRange;
+ constants.zbias[1][0] = static_cast<u32>(xfmem.viewport.farZ);
+ constants.zbias[1][1] = static_cast<u32>(xfmem.viewport.zRange);
dirty = true;
s_bViewPortChanged = false;
}
@@ -110,10 +110,10 @@ void PixelShaderManager::SetConstants()
void PixelShaderManager::SetColorChanged(int type, int num)
{
int4* c = type ? constants.kcolors : constants.colors;
- c[num][0] = bpmem.tevregs[num].red;
- c[num][3] = bpmem.tevregs[num].alpha;
- c[num][2] = bpmem.tevregs[num].blue;
- c[num][1] = bpmem.tevregs[num].green;
+ c[num][0] = static_cast<s32>(bpmem.tevregs[num].red);
+ c[num][3] = static_cast<s32>(bpmem.tevregs[num].alpha);
+ c[num][2] = static_cast<s32>(bpmem.tevregs[num].blue);
+ c[num][1] = static_cast<s32>(bpmem.tevregs[num].green);
dirty = true;
PRIM_LOG("pixel %scolor%d: %d %d %d %d\n", type?"k":"", num, c[num][0], c[num][1], c[num][2], c[num][3]);
diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp
index 6fc187726f..112c2498c9 100644
--- a/Source/Core/VideoCommon/VertexShaderManager.cpp
+++ b/Source/Core/VideoCommon/VertexShaderManager.cpp
@@ -285,9 +285,10 @@ void VertexShaderManager::SetConstants()
double(light.ddir[1]) * double(light.ddir[1]) +
double(light.ddir[2]) * double(light.ddir[2]);
norm = 1.0 / sqrt(norm);
- dstlight.dir[0] = light.ddir[0] * norm;
- dstlight.dir[1] = light.ddir[1] * norm;
- dstlight.dir[2] = light.ddir[2] * norm;
+ float norm_float = static_cast<float>(norm);
+ dstlight.dir[0] = light.ddir[0] * norm_float;
+ dstlight.dir[1] = light.ddir[1] * norm_float;
+ dstlight.dir[2] = light.ddir[2] * norm_float;
}
dirty = true;