- fixed keyboard sample (missing PlatformSystem)

- added a ArgumentNullException to EffectParameter in DirectX 10 RenderSystem (was a unhandled exception)
- fixed a issue in SpriteBatch when no draw call was made between begin and end calls (unhandled exception)
This commit is contained in:
Glatzemann 2012-08-09 20:45:28 +00:00
parent d05594fce8
commit c12c59b648
3 changed files with 32 additions and 20 deletions

View File

@ -252,30 +252,33 @@ namespace ANX.Framework.Graphics
if (this.currentSortMode != SpriteSortMode.Immediate)
{
if (this.currentSortMode == SpriteSortMode.Texture)
if (currentBatchPosition > 0)
{
Array.Sort<SpriteInfo>(spriteInfos, 0, currentBatchPosition, textureComparer);
}
else if (this.currentSortMode == SpriteSortMode.BackToFront)
{
Array.Sort<SpriteInfo>(spriteInfos, 0, currentBatchPosition, backToFrontComparer);
}
else if (this.currentSortMode == SpriteSortMode.FrontToBack)
{
Array.Sort<SpriteInfo>(spriteInfos, 0, currentBatchPosition, frontToBackComparer);
}
int startOffset = 0;
Texture2D lastTexture = spriteInfos[0].texture;
for (int i = 0; i <= currentBatchPosition; i++)
{
if (lastTexture != spriteInfos[i].texture || i == currentBatchPosition)
if (this.currentSortMode == SpriteSortMode.Texture)
{
BatchRender(startOffset, i - startOffset);
startOffset = i;
Array.Sort<SpriteInfo>(spriteInfos, 0, currentBatchPosition, textureComparer);
}
else if (this.currentSortMode == SpriteSortMode.BackToFront)
{
Array.Sort<SpriteInfo>(spriteInfos, 0, currentBatchPosition, backToFrontComparer);
}
else if (this.currentSortMode == SpriteSortMode.FrontToBack)
{
Array.Sort<SpriteInfo>(spriteInfos, 0, currentBatchPosition, frontToBackComparer);
}
lastTexture = spriteInfos[i].texture;
int startOffset = 0;
Texture2D lastTexture = spriteInfos[0].texture;
for (int i = 0; i <= currentBatchPosition; i++)
{
if (lastTexture != spriteInfos[i].texture || i == currentBatchPosition)
{
BatchRender(startOffset, i - startOffset);
startOffset = i;
}
lastTexture = spriteInfos[i].texture;
}
}
}

View File

@ -149,6 +149,11 @@ namespace ANX.RenderSystem.Windows.DX10
public void SetValue(Texture value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
Texture2D_DX10 tex = value.NativeTexture as Texture2D_DX10;
GraphicsDeviceWindowsDX10 graphicsDX10 = tex.GraphicsDevice.NativeDevice as GraphicsDeviceWindowsDX10;
SharpDX.Direct3D10.Device device = graphicsDX10.NativeDevice;

View File

@ -115,6 +115,10 @@
<Project>{97185A92-077D-4498-8B6A-8BFF04079044}</Project>
<Name>ANX.MediaSystem.Windows.OpenAL</Name>
</ProjectReference>
<ProjectReference Include="..\..\PlatformSystems\ANX.PlatformSystem.Windows\ANX.PlatformSystem.Windows.csproj">
<Project>{068EB2E9-963C-4E1B-8831-E25011F11FFE}</Project>
<Name>ANX.PlatformSystem.Windows</Name>
</ProjectReference>
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.RenderSystem.Windows.DX10.csproj">
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
<Name>ANX.Framework.Windows.DX10</Name>