More warnings: mark/avert truncating conversions from float.

This commit is contained in:
comex
2013-08-30 00:43:21 -04:00
parent 4f5729dd59
commit 2630169229
6 changed files with 13 additions and 13 deletions

View File

@ -1318,7 +1318,7 @@ void Renderer::SetLineWidth()
// We can't change line width in D3D unless we use ID3DXLine
float fratio = xfregs.viewport.wd != 0 ? Renderer::EFBToScaledXf(1.f) : 1.0f;
float psize = bpmem.lineptwidth.pointsize * fratio / 6.0f;
psize = psize > 0 ? psize : 1.0;
psize = psize > 0 ? psize : 1.0f;
if (psize > m_fMaxPointSize)
{
psize = m_fMaxPointSize;

View File

@ -189,8 +189,8 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
int usage = 0;
GLfloat delta_x = GLfloat(2*char_width)/GLfloat(bbWidth);
GLfloat delta_y = GLfloat(2*char_height)/GLfloat(bbHeight);
GLfloat border_x = 2.0/GLfloat(bbWidth);
GLfloat border_y = 4.0/GLfloat(bbHeight);
GLfloat border_x = 2.0f/GLfloat(bbWidth);
GLfloat border_y = 4.0f/GLfloat(bbHeight);
GLfloat x = GLfloat(start_x);
GLfloat y = GLfloat(start_y);
@ -199,7 +199,7 @@ void RasterFont::printMultilineText(const char *text, double start_x, double sta
u8 c = text[i];
if(c == '\n') {
x = start_x;
x = GLfloat(start_x);
y -= delta_y + border_y;
continue;
}

View File

@ -755,7 +755,7 @@ void Tev::Draw()
// First, calculate the offset from the viewport center (normalized to 0..1)
float offset = (Position[0] - (bpmem.fogRange.Base.Center - 342)) / (float)swxfregs.viewport.wd;
// Based on that, choose the index such that points which are far away from the z-axis use the 10th "k" value and such that central points use the first value.
int index = 9 - std::abs(offset) * 9.f;
int index = (int) (9 - std::abs(offset) * 9.f);
index = (index < 0) ? 0 : (index > 9) ? 9 : index; // TODO: Shouldn't be necessary!
// Look up coefficient... Seems like multiplying by 4 makes Fortune Street work properly (fog is too strong without the factor)
float k = bpmem.fogRange.K[index/2].GetValue(index%2) * 4.f;