minor optimisations

This commit is contained in:
Ian Curtis 2016-11-28 17:32:25 +00:00
parent abc8c24b69
commit a310e8e5cf
2 changed files with 5 additions and 5 deletions

View file

@ -438,7 +438,7 @@ void CNew3D::DescendCullingNode(UINT32 addr)
//================
hDistance = node[9 - m_offset] & 0xFFFF;
fDistance = R3DFloat::GetFloat16(node[9 - m_offset] & 0xFFFF);
fDistance = R3DFloat::GetFloat16(hDistance);
if (hDistance != R3DFloat::Pro16BitMax) {

View file

@ -99,10 +99,10 @@ UINT32 Texture::UploadTexture(const UINT16* src, UINT8* scratch, int format, boo
{
for (xi = x; xi < (x + width); xi++)
{
scratch[i++] = (GLubyte)(((src[yi * 2048 + xi] >> 10) & 0x1F) * 255.f / 0x1F); // R
scratch[i++] = (GLubyte)(((src[yi * 2048 + xi] >> 5) & 0x1F) * 255.f / 0x1F); // G
scratch[i++] = (GLubyte)(((src[yi * 2048 + xi] >> 0) & 0x1F) * 255.f / 0x1F); // B
scratch[i++] = ((src[yi * 2048 + xi] & 0x8000) ? 0 : 255); // T
scratch[i++] = ((src[yi * 2048 + xi] >> 10) & 0x1F) * 255 / 0x1F; // R
scratch[i++] = ((src[yi * 2048 + xi] >> 5 ) & 0x1F) * 255 / 0x1F; // G
scratch[i++] = ((src[yi * 2048 + xi] >> 0 ) & 0x1F) * 255 / 0x1F; // B
scratch[i++] = ((src[yi * 2048 + xi] & 0x8000) ? 0 : 255); // T
}
}
break;