Author: rloach Date: 2007-01-16 04:50:50 -0500 (Tue, 16 Jan 2007) New Revision: 71114
Removed: trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/GlutGameWindow.cs Modified: trunk/Mono.Xna/examples/Pong/Properties/AssemblyInfo.cs trunk/Mono.Xna/examples/SimpleExample/Properties/AssemblyInfo.cs trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Properties/AssemblyInfo.cs trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentLoadException.cs trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentManager.cs trunk/Mono.Xna/src/Microsoft.Xna.Framework/Properties/AssemblyInfo.cs trunk/Mono.Xna/tests/Properties/AssemblyInfo.cs Log: Remove GlutGameWindow (duff), update AssemblyInfo copyright. Modified: trunk/Mono.Xna/examples/Pong/Properties/AssemblyInfo.cs =================================================================== --- trunk/Mono.Xna/examples/Pong/Properties/AssemblyInfo.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/examples/Pong/Properties/AssemblyInfo.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -1,64 +1,64 @@ -#region License -/* -MIT License -Copyright � 2007 The Mono.Xna Team -http://www.taoframework.com -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ -#endregion License - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Pong")] -[assembly: AssemblyProduct("Pong")] -[assembly: AssemblyDescription("A simple recreation of Pong using XNA Technology.")] -#if DEBUG -[assembly: AssemblyConfiguration("Debug")] -#else -[assembly: AssemblyConfiguration("Release")] -#endif -[assembly: AssemblyCompany("The Mono.Xna Team")] -[assembly: AssemblyCopyright("Copyright � 2007 The Mono.Xna Team")] -[assembly: AssemblyTrademark("http://www.taoframework.com")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c5822ce5-c20d-4447-8717-be97e7da576b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] +#region License +/* +MIT License +Copyright � 2007 The Mono.Xna Team +http://www.taoframework.com +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ +#endregion License + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Pong")] +[assembly: AssemblyProduct("Pong")] +[assembly: AssemblyDescription("A simple recreation of Pong using XNA Technology.")] +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +#else +[assembly: AssemblyConfiguration("Release")] +#endif +[assembly: AssemblyCompany("The Mono.Xna Team")] +[assembly: AssemblyCopyright("Copyright � 2006 - 2007 The Mono.Xna Team")] +[assembly: AssemblyTrademark("http://www.taoframework.com")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c5822ce5-c20d-4447-8717-be97e7da576b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.*")] +[assembly: AssemblyFileVersion("1.0.0.*")] Modified: trunk/Mono.Xna/examples/SimpleExample/Properties/AssemblyInfo.cs =================================================================== --- trunk/Mono.Xna/examples/SimpleExample/Properties/AssemblyInfo.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/examples/SimpleExample/Properties/AssemblyInfo.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -55,5 +55,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.0.*")] +[assembly: AssemblyFileVersion("1.0.0.*")] Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentLoadException.cs =================================================================== --- trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentLoadException.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentLoadException.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -26,26 +26,36 @@ #endregion License using System; +using System.IO; +using System.Runtime.Serialization; namespace Microsoft.Xna.Framework.Content { + /// <summary> + /// Exception used to report errors from the ContentManager.Load method. + /// </summary> [Serializable] public class ContentLoadException : Exception { - public ContentLoadException() { - throw new NotImplementedException(); } - public ContentLoadException(string message) + public ContentLoadException(string message) : base(message) { - throw new NotImplementedException(); } - public ContentLoadException(string message, Exception innerException) + public ContentLoadException(string message, Exception innerException) : base(message, innerException) { - throw new NotImplementedException(); } + + /// <summary> + /// Creates a new instance of ContentLoadException. + /// </summary> + /// <param name="info">Describes the value types that were being loaded when the exception occured.</param> + /// <param name="context">Describes the stream where the exception occured.</param> + protected ContentLoadException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } } } Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentManager.cs =================================================================== --- trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentManager.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/src/Microsoft.Xna.Framework/Content/ContentManager.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -27,23 +27,27 @@ using System; using System.IO; +using System.Collections.Generic; namespace Microsoft.Xna.Framework.Content { - + public class ContentManager : IDisposable { - IServiceProvider serviceProvider; + private IServiceProvider serviceProvider; + private string rootDirectory = string.Empty; + private bool disposed = false; + private Dictionary<string, object> assets = new Dictionary<string,object>(); - public ContentManager(IServiceProvider serviceProvider) + public ContentManager(IServiceProvider serviceProvider) : this(serviceProvider, string.Empty) { - this.serviceProvider = serviceProvider; - + // Empty } public ContentManager(IServiceProvider serviceProvider, string rootDirectory) { - throw new NotImplementedException(); + this.rootDirectory = rootDirectory; + this.serviceProvider = serviceProvider; } public IServiceProvider ServiceProvider @@ -56,12 +60,21 @@ public void Dispose() { - throw new NotImplementedException(); + this.Dispose(true); + GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { - throw new NotImplementedException(); + if (!disposed) + { + if (disposing) + { + // Dispose any managed resources + Unload(); + } + // Dispose any unmanaged resources + } } public virtual T Load<T>(string assetName) @@ -71,12 +84,38 @@ protected virtual Stream OpenStream(string assetName) { - throw new NotImplementedException(); + Stream stream; + try + { + string path = Path.Combine(rootDirectory, assetName + ".xnb"); + stream = File.OpenRead(path); + } + catch (FileNotFoundException fileNotFound) + { + throw new ContentLoadException("The content file was not found.", fileNotFound); + } + catch (DirectoryNotFoundException directoryNotFound) + { + throw new ContentLoadException("The directory was not found.", directoryNotFound); + } + catch (Exception exception) + { + throw new ContentLoadException("Opening stream error.", exception); + } + return stream; } public virtual void Unload() { - throw new NotImplementedException(); + Dictionary<string, object>.Enumerator enumerator = assets.GetEnumerator(); + while (enumerator.MoveNext()) + { + IDisposable disposableObject = enumerator.Current.Value as IDisposable; + if (disposableObject != null) + disposableObject.Dispose(); + } + enumerator.Dispose(); + assets.Clear(); } } } Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework/Properties/AssemblyInfo.cs =================================================================== --- trunk/Mono.Xna/src/Microsoft.Xna.Framework/Properties/AssemblyInfo.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/src/Microsoft.Xna.Framework/Properties/AssemblyInfo.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -1,7 +1,7 @@ #region License /* MIT License -Copyright � 2006 The Mono.Xna Team +Copyright � 2006-2007 The Mono.Xna Team http://www.taoframework.com All rights reserved. @@ -40,9 +40,14 @@ [assembly: AssemblyTitle("Microsoft.Xna.Framework")] [assembly: AssemblyProduct("Microsoft.Xna.Framework")] [assembly: AssemblyDescription("")] +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +#else +[assembly: AssemblyConfiguration("Release")] +#endif [assembly: AssemblyCompany("The Mono.Xna Team")] -[assembly: AssemblyCopyright("Copyright The Mono.Xna Team 2006")] -[assembly: AssemblyTrademark("")] +[assembly: AssemblyCopyright("Copyright � 2006 - 2007 The Mono.Xna Team")] +[assembly: AssemblyTrademark("http://www.taoframework.com")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible @@ -61,8 +66,8 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] +[assembly: AssemblyVersion("0.1.0.*")] +[assembly: AssemblyFileVersion("0.1.0.*")] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Deleted: trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/GlutGameWindow.cs =================================================================== --- trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/GlutGameWindow.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/GlutGameWindow.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -1,135 +0,0 @@ -#region License -/* -MIT License -Copyright � 2006 The Mono.Xna Team -http://www.taoframework.com -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ -#endregion License - -using System; -using System.Collections.Generic; -using System.Text; -using Tao.OpenGl; -using Tao.FreeGlut; - -namespace Microsoft.Xna.Framework -{ - public class GlutGameWindow : GameWindow - { - public GlutGameWindow() - { - Glut.glutInitWindowSize(GameWindow.DefaultClientWidth, GameWindow.DefaultClientHeight); - Glut.glutCreateWindow(Title); - - Glut.glutReshapeFunc(new Glut.ReshapeCallback(OnGlutReshape)); - Glut.glutDisplayFunc(new Glut.DisplayCallback(OnGlutPaint)); - Glut.glutCloseFunc(new Glut.CloseCallback(OnGlutClose)); - } - - private void OnGlutClose() - { - base.OnDeactivated(); - } - private void OnGlutPaint() - { - base.OnPaint(); - } - private void OnGlutReshape(int width, int height) - { - m_ClientWidth = width; - m_ClientHeight = height; - base.OnClientSizeChanged(); - } - - internal override bool AllowUserResizing - { - get - { - return m_AllowUserResizing; - } - set - { - m_AllowUserResizing = value; - if (value) - { - Glut.glutSetOption(Glut.GLUT_VIDEO_RESIZE_POSSIBLE, value ? Gl.GL_TRUE : Gl.GL_FALSE); - } - } - } - private bool m_AllowUserResizing = true; - - public override void BeginScreenDeviceChange(bool willBeFullScreen) - { - throw new Exception("The method or operation is not implemented."); - } - - public override int ClientHeight - { - get - { - return m_ClientHeight; - } - } - private int m_ClientHeight; - private int m_ClientWidth; - public override int ClientWidth - { - get { return m_ClientWidth; } - } - protected override void SetTitle(string title) - { - Glut.glutSetWindowTitle(title); - } - internal override bool IsMouseVisible - { - get - { - return m_IsMouseVisible; - } - set - { - m_IsMouseVisible = value; - if (m_IsMouseVisible) - Glut.glutSetCursor(Glut.GLUT_CURSOR_NONE); - else - Glut.glutSetCursor(Glut.GLUT_CURSOR_LEFT_ARROW); - } - } - private bool m_IsMouseVisible = false; - - public override void EndScreenDeviceChange(string screenDeviceName, int clientWidth, int clientHeight) - { - throw new Exception("The method or operation is not implemented."); - } - public override IntPtr Handle - { - get - { - throw new NotImplementedException(); - } - } - public override string ScreenDeviceName - { - get { throw new NotImplementedException("The method or operation is not implemented."); } - } - } -} Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Properties/AssemblyInfo.cs =================================================================== --- trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Properties/AssemblyInfo.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Properties/AssemblyInfo.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -40,9 +40,14 @@ [assembly: AssemblyTitle("Microsoft.Xna.Framework.Game")] [assembly: AssemblyProduct("Microsoft.Xna.Framework.Game")] [assembly: AssemblyDescription("")] +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +#else +[assembly: AssemblyConfiguration("Release")] +#endif [assembly: AssemblyCompany("The Mono.Xna Team")] -[assembly: AssemblyCopyright("Copyright The Mono.Xna Team 2006")] -[assembly: AssemblyTrademark("")] +[assembly: AssemblyCopyright("Copyright � 2006 - 2007 The Mono.Xna Team")] +[assembly: AssemblyTrademark("http://www.taoframework.com")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible @@ -61,5 +66,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.1.0.0")] -[assembly: AssemblyFileVersion("0.1.0.0")] +[assembly: AssemblyVersion("0.1.0.*")] +[assembly: AssemblyFileVersion("0.1.0.*")] Modified: trunk/Mono.Xna/tests/Properties/AssemblyInfo.cs =================================================================== --- trunk/Mono.Xna/tests/Properties/AssemblyInfo.cs 2007-01-16 09:17:42 UTC (rev 71113) +++ trunk/Mono.Xna/tests/Properties/AssemblyInfo.cs 2007-01-16 09:50:50 UTC (rev 71114) @@ -29,14 +29,18 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. // -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +[assembly: AssemblyTitle("XnaTests")] +[assembly: AssemblyProduct("XnaTests")] +[assembly: AssemblyDescription("A collection of tests created for the Mono.Xna project.")] +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +#else +[assembly: AssemblyConfiguration("Release")] +#endif +[assembly: AssemblyCompany("The Mono.Xna Team")] +[assembly: AssemblyCopyright("Copyright � 2006 - 2007 The Mono.Xna Team")] +[assembly: AssemblyTrademark("http://www.taoframework.com")] +[assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: NeutralResourcesLanguageAttribute("en-US")]
_______________________________________________ Mono-patches maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-patches
