mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix the last few warnings in Dolphin on my system.
This commit is contained in:
@ -302,8 +302,7 @@ void PixelShaderManager::SetConstants()
|
|||||||
float GC_ALIGNED16(material[4]);
|
float GC_ALIGNED16(material[4]);
|
||||||
float NormalizationCoef = 1 / 255.0f;
|
float NormalizationCoef = 1 / 255.0f;
|
||||||
|
|
||||||
// TODO: This code is wrong. i goes out of range for xfregs.ambColor.
|
for (int i = 0; i < 2; ++i)
|
||||||
for (int i = 0; i < 4; ++i)
|
|
||||||
{
|
{
|
||||||
if (nMaterialsChanged & (1 << i))
|
if (nMaterialsChanged & (1 << i))
|
||||||
{
|
{
|
||||||
@ -318,6 +317,21 @@ void PixelShaderManager::SetConstants()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; ++i)
|
||||||
|
{
|
||||||
|
if (nMaterialsChanged & (1 << (i + 2)))
|
||||||
|
{
|
||||||
|
u32 data = *(xfregs.matColor + i);
|
||||||
|
|
||||||
|
material[0] = ((data >> 24) & 0xFF) * NormalizationCoef;
|
||||||
|
material[1] = ((data >> 16) & 0xFF) * NormalizationCoef;
|
||||||
|
material[2] = ((data >> 8) & 0xFF) * NormalizationCoef;
|
||||||
|
material[3] = ( data & 0xFF) * NormalizationCoef;
|
||||||
|
|
||||||
|
SetPSConstant4fv(C_PMATERIALS + i + 2, material);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nMaterialsChanged = 0;
|
nMaterialsChanged = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,8 +251,7 @@ void VertexShaderManager::SetConstants()
|
|||||||
float GC_ALIGNED16(material[4]);
|
float GC_ALIGNED16(material[4]);
|
||||||
float NormalizationCoef = 1 / 255.0f;
|
float NormalizationCoef = 1 / 255.0f;
|
||||||
|
|
||||||
// TODO: This code is wrong. i goes out of range for xfregs.ambColor.
|
for (int i = 0; i < 2; ++i)
|
||||||
for (int i = 0; i < 4; ++i)
|
|
||||||
{
|
{
|
||||||
if (nMaterialsChanged & (1 << i))
|
if (nMaterialsChanged & (1 << i))
|
||||||
{
|
{
|
||||||
@ -267,6 +266,21 @@ void VertexShaderManager::SetConstants()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; ++i)
|
||||||
|
{
|
||||||
|
if (nMaterialsChanged & (1 << (i + 2)))
|
||||||
|
{
|
||||||
|
u32 data = *(xfregs.matColor + i);
|
||||||
|
|
||||||
|
material[0] = ((data >> 24) & 0xFF) * NormalizationCoef;
|
||||||
|
material[1] = ((data >> 16) & 0xFF) * NormalizationCoef;
|
||||||
|
material[2] = ((data >> 8) & 0xFF) * NormalizationCoef;
|
||||||
|
material[3] = ( data & 0xFF) * NormalizationCoef;
|
||||||
|
|
||||||
|
SetVSConstant4fv(C_MATERIALS + i + 2, material);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nMaterialsChanged = 0;
|
nMaterialsChanged = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,9 +147,6 @@ void SWRenderer::DrawTexture(u8 *texture, int width, int height)
|
|||||||
glTexParameteri(TEX2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(TEX2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(TEX2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(TEX2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
|
||||||
GLfloat u_max = (GLfloat)width;
|
|
||||||
GLfloat v_max = (GLfloat)height;
|
|
||||||
|
|
||||||
static const GLfloat verts[4][2] = {
|
static const GLfloat verts[4][2] = {
|
||||||
{ -1, -1}, // Left top
|
{ -1, -1}, // Left top
|
||||||
{ -1, 1}, // left bottom
|
{ -1, 1}, // left bottom
|
||||||
@ -158,6 +155,9 @@ void SWRenderer::DrawTexture(u8 *texture, int width, int height)
|
|||||||
};
|
};
|
||||||
//Texture rectangle uses pixel coordinates
|
//Texture rectangle uses pixel coordinates
|
||||||
#ifndef USE_GLES
|
#ifndef USE_GLES
|
||||||
|
GLfloat u_max = (GLfloat)width;
|
||||||
|
GLfloat v_max = (GLfloat)height;
|
||||||
|
|
||||||
static const GLfloat texverts[4][2] = {
|
static const GLfloat texverts[4][2] = {
|
||||||
{0, v_max},
|
{0, v_max},
|
||||||
{0, 0},
|
{0, 0},
|
||||||
|
Reference in New Issue
Block a user