- Removed three TODOs from ContentReader.

- Worked on a TODO in AudioEngine
- Worked on TODOs in ContentManager
- fixed another bunch of TODOs which doesn't need work or are very simple and solved directly
This commit is contained in:
Glatzemann 2011-12-15 12:59:20 +00:00
parent 091b91ee05
commit 571ae26707
10 changed files with 36 additions and 17 deletions

View File

@ -56,7 +56,7 @@ namespace ANX.Framework.Audio
{
public class AudioEngine : IDisposable
{
public const int ContentVersion=0;//ToDo find the original value
public const int ContentVersion = 0x27;
public AudioEngine(string settingsFile)

View File

@ -193,7 +193,8 @@ namespace ANX.Framework.Content
throw new ArgumentNullException("assetName");
}
// TODO: make clean asset name
assetName = TitleContainer.GetCleanPath(assetName);
object result;
if (this.loadedAssets.TryGetValue(assetName, out result))
{
@ -243,10 +244,15 @@ namespace ANX.Framework.Content
/// <returns></returns>
protected virtual Stream OpenStream(string assetName)
{
// TODO: catch exception and throw a ContentLoadException
string path = Path.Combine(rootDirectoryAbsolute, assetName + Extension);
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
try
{
string path = Path.Combine(rootDirectoryAbsolute, assetName + Extension);
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
}
catch (Exception ex)
{
throw new ContentLoadException("failed to open stream for '" + assetName + "'", ex);
}
}
protected void ThrowExceptionIfDisposed()

View File

@ -175,7 +175,11 @@ namespace ANX.Framework.Content
bool isCompressed = (flags & 0x80) != 0;
int sizeOnDisk = reader.ReadInt32();
// TODO: check stream length
if (input.CanSeek && ((sizeOnDisk - 10) > (input.Length - input.Position)))
{
throw new ContentLoadException("Bad XNB file size.");
}
if (isCompressed)
{
@ -399,13 +403,17 @@ namespace ANX.Framework.Content
public override float ReadSingle()
{
// TODO: this is handeled with unsafe code in the original implementation, dont know for what reason
// This is handeled with unsafe code in the original implementation.
// The original implementation reads as UInt32 and does some pointer magic to copy the UInt bits into the float.
// The same "pointer magic" is done by the ReadSingle method of the binary reader already.
return base.ReadSingle();
}
public override double ReadDouble()
{
// TODO: this is handeled with unsafe code in the original implementation, dont know for what reason
// This is handeled with unsafe code in the original implementation.
// The original implementation reads as UInt64 and does some pointer magic to copy the UInt bits into the float.
// The same "pointer magic" is done by the ReadDouble method of the binary reader already.
return base.ReadDouble();
}

View File

@ -59,5 +59,12 @@ namespace ANX.Framework
{
throw new NotImplementedException();
}
internal static string GetCleanPath(string path)
{
//TODO: implement
return path;
}
}
}

View File

@ -168,7 +168,7 @@ namespace ANX.InputSystem.Recording
byte writeOffset = 0;
if ((recordInfo & MouseRecordInfo.AllButtons) != 0) //Any of the Buttons is recorded
{
buffer[writeOffset] |= state.LeftButton == ButtonState.Pressed ? (byte)MouseButtons.Left : (byte)0; //TODO: Is there a byte literal? (like 118L or 91.8f)
buffer[writeOffset] |= state.LeftButton == ButtonState.Pressed ? (byte)MouseButtons.Left : (byte)0;
buffer[writeOffset] |= state.RightButton == ButtonState.Pressed ? (byte)MouseButtons.Right : (byte)0;
buffer[writeOffset] |= state.MiddleButton == ButtonState.Pressed ? (byte)MouseButtons.Middle : (byte)0;
buffer[writeOffset] |= state.XButton1 == ButtonState.Pressed ? (byte)MouseButtons.X1 : (byte)0;

View File

@ -111,7 +111,6 @@ namespace ANX.Framework.Windows.DX10
public void Apply(GraphicsDevice graphicsDevice)
{
//TODO: dummy
((GraphicsDeviceWindowsDX10)graphicsDevice.NativeDevice).currentEffect = this;
}

View File

@ -210,7 +210,7 @@ namespace ANX.Framework.Windows.DX10
this.depthStencilView = new DepthStencilView(device, this.depthStencilBuffer);
Clear(ClearOptions.DepthBuffer | ClearOptions.Stencil, Vector4.Zero, 1.0f, 0); //TODO: this workaround is working but maybe not the best solution to issue #472
Clear(ClearOptions.DepthBuffer | ClearOptions.Stencil, Vector4.Zero, 1.0f, 0); // this workaround is working but maybe not the best solution to issue #472
}
#region Clear

View File

@ -94,6 +94,8 @@ namespace ANX.Framework.Windows.GL3
// StaticDraw: set once, use often
// DynamicDraw: set frequently, use repeatadly
// StreamDraw: set every tick, use once
// comment from glatzemann: I think static draw should be right HERE. DynamicDraw should be used for DynamicIndexbuffer. StreamDraw shouldn't be used I think.
usageHint = BufferUsageHint.DynamicDraw;
GL.GenBuffers(1, out bufferHandle);

View File

@ -111,7 +111,6 @@ namespace ANX.RenderSystem.Windows.DX11
public void Apply(GraphicsDevice graphicsDevice)
{
//TODO: dummy
((GraphicsDeviceWindowsDX11)graphicsDevice.NativeDevice).currentEffect = this;
}

View File

@ -33,14 +33,12 @@ namespace Kinect
{
spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: Verwenden Sie this.Content, um Ihren Spiel-Inhalt hier zu laden
}
protected override void Update(GameTime gameTime)
{
//TODO: reactivate
//if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
// this.Exit();
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
kinectState = MotionSensingDevice.GetState();