Skip to content

Commit

Permalink
Merge branch 'develop' of git://github.com/mono/MonoGame into dxtmipmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Helikin committed Jun 17, 2013
2 parents 8c80601 + d19614e commit eb03390
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions MonoGame.Framework/Graphics/PackedVector/HalfTypeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ private struct uif
public float f;
[FieldOffset(0)]
public int i;
[FieldOffset(0)]
public uint u;
}

internal static UInt16 Convert(float f)
Expand Down Expand Up @@ -79,7 +81,7 @@ internal static UInt16 Convert(int i)
}
}

internal static unsafe float Convert(ushort value)
internal static float Convert(ushort value)
{
uint rst;
uint mantissa = (uint)(value & 1023);
Expand Down Expand Up @@ -107,7 +109,9 @@ internal static unsafe float Convert(ushort value)
rst = (uint)(((((uint)value & 0x8000) << 16) | ((((((uint)value >> 10) & 0x1f) - 15) + 127) << 23)) | (mantissa << 13));
}

return *(((float*)&rst));
var uif = new uif();
uif.u = rst;
return uif.f;
}
}
}
7 changes: 6 additions & 1 deletion MonoGame.Framework/MonoGame.Framework.WindowsPhone.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -92,6 +92,11 @@
<ItemGroup>
<Compile Include="Content\ContentReaders\Texture3DReader.cs" />
<Compile Include="Graphics\IRenderTarget.cs" />
<Compile Include="Graphics\PackedVector\HalfSingle.cs" />
<Compile Include="Graphics\PackedVector\HalfTypeHelper.cs" />
<Compile Include="Graphics\PackedVector\HalfVector2.cs" />
<Compile Include="Graphics\PackedVector\HalfVector4.cs" />
<Compile Include="Graphics\PackedVector\Short4.cs" />
<Compile Include="Graphics\RenderTargetCube.cs" />
<Compile Include="Graphics\RenderTarget3D.cs" />
<Compile Include="Graphics\ResourceCreatedEventArgs.cs" />
Expand Down

0 comments on commit eb03390

Please sign in to comment.