Change .f to .0f etc.

This commit is contained in:
raven02 2013-02-17 21:26:23 +08:00
parent 2bf958b06f
commit 45e4919fe9

View File

@ -197,7 +197,7 @@ void VertexDecoder::Step_Color5551() const
c[0] = Convert5To8(cdata & 0x1f);
c[1] = Convert5To8((cdata>>5) & 0x1f);
c[2] = Convert5To8((cdata>>10) & 0x1f);
c[3] = (cdata>>15) ? 255 : 0;
c[3] = (cdata>>15) ? 255.0f : 0.0f;
}
void VertexDecoder::Step_Color4444() const
@ -222,15 +222,15 @@ void VertexDecoder::Step_Color565Morph() const
{
float w = gstate_c.morphWeights[n];
u16 cdata = *(u16*)(ptr_ + onesize_*n + coloff);
col[0] += w * (cdata & 0x1f) / 31.f;
col[1] += w * ((cdata>>5) & 0x3f) / 63.f;
col[2] += w * ((cdata>>11) & 0x1f) / 31.f;
col[0] += w * (cdata & 0x1f) / 31.0f;
col[1] += w * ((cdata>>5) & 0x3f) / 63.0f;
col[2] += w * ((cdata>>11) & 0x1f) / 31.0f;
}
u8 *c = decoded_ + decFmt.c0off;
for (int i = 0; i < 3; i++) {
c[i] = (u8)(col[i] * 255.0f);
}
c[3] = 255;
c[3] = 255.0f;
}
void VertexDecoder::Step_Color5551Morph() const
@ -240,9 +240,9 @@ void VertexDecoder::Step_Color5551Morph() const
{
float w = gstate_c.morphWeights[n];
u16 cdata = *(u16*)(ptr_ + onesize_*n + coloff);
col[0] += w * (cdata & 0x1f) / 31.f;
col[1] += w * ((cdata>>5) & 0x1f) / 31.f;
col[2] += w * ((cdata>>10) & 0x1f) / 31.f;
col[0] += w * (cdata & 0x1f) / 31.0f;
col[1] += w * ((cdata>>5) & 0x1f) / 31.0f;
col[2] += w * ((cdata>>10) & 0x1f) / 31.0f;
col[3] += w * ((cdata>>15) ? 1.0f : 0.0f);
}
u8 *c = decoded_ + decFmt.c0off;
@ -259,7 +259,7 @@ void VertexDecoder::Step_Color4444Morph() const
float w = gstate_c.morphWeights[n];
u16 cdata = *(u16*)(ptr_ + onesize_*n + coloff);
for (int j = 0; j < 4; j++)
col[j] += w * ((cdata >> (j * 4)) & 0xF) / 15.f;
col[j] += w * ((cdata >> (j * 4)) & 0xF) / 15.0f;
}
u8 *c = decoded_ + decFmt.c0off;
for (int i = 0; i < 4; i++) {
@ -346,7 +346,7 @@ void VertexDecoder::Step_NormalS16Morph() const
multiplier = -multiplier;
}
const s16 *sv = (const s16 *)(ptr_ + onesize_*n + nrmoff);
multiplier *= (1.0f/32767.f);
multiplier *= (1.0f/32767.0f);
for (int j = 0; j < 3; j++)
normal[j] += sv[j] * multiplier;
}