Permalink
Browse files

* MacOS/GameWindow.cs:

* Audio/SoundEffect.cs:
* Graphics/Viewport.cs:
* Graphics/Texture2D.cs:
* MonoGame.Framework.iOS.csproj:
* MonoGame.Framework.MacOS.csproj:
* Content/ContentSerializerAttribute.cs:
* Content/ContentSerializerIgnoreAttribute.cs: 

Slight code clean up and compatibility changes

git-svn-id: https://xnatouch.svn.codeplex.com/svn@58652 ffd33b8c-2492-42e0-bdc5-587b920b7d6d
  • Loading branch information...
1 parent 054b70f commit f23e09e0c067034340fab1e13ac014d7ab7cee89 SND\CartBlanche_cp committed Mar 1, 2011
View
16 MonoGame.Framework/Audio/SoundEffect.cs
@@ -47,7 +47,7 @@ 1. Definitions
namespace Microsoft.Xna.Framework.Audio
{
- public sealed class SoundEffect
+ public sealed class SoundEffect : IDisposable
{
private Sound _sound;
private string _name = "";
@@ -100,6 +100,20 @@ public SoundEffectInstance CreateInstance ()
Sound = _sound,
};
}
+
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ }
+
+ #endregion
+
+ public static float MasterVolume
+ {
+ get;
+ set;
+ }
}
}
View
50 MonoGame.Framework/Content/ContentSerializerAttribute.cs
@@ -0,0 +1,50 @@
+// #region License
+// /*
+// Microsoft Public License (Ms-PL)
+// MonoGame - Copyright © 2009 The MonoGame Team
+//
+// All rights reserved.
+//
+// This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
+// accept the license, do not use the software.
+//
+// 1. Definitions
+// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
+// U.S. copyright law.
+//
+// A "contribution" is the original software, or any additions or changes to the software.
+// A "contributor" is any person that distributes its contribution under this license.
+// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
+//
+// 2. Grant of Rights
+// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
+// each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
+// each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+//
+// 3. Conditions and Limitations
+// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
+// your patent license from such contributor to the software ends automatically.
+// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
+// notices that are present in the software.
+// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
+// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
+// code form, you may only do so under a license that complies with this license.
+// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
+// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
+// permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
+// purpose and non-infringement.
+// */
+// #endregion License
+//
+using System;
+
+namespace Microsoft.Xna.Framework.Content
+{
+ public sealed class ContentSerializerAttribute : Attribute
+ {
+ public bool Optional { get; set; }
+ }
+}
+
View
49 MonoGame.Framework/Content/ContentSerializerIgnoreAttribute.cs
@@ -0,0 +1,49 @@
+// #region License
+// /*
+// Microsoft Public License (Ms-PL)
+// MonoGame - Copyright © 2009 The MonoGame Team
+//
+// All rights reserved.
+//
+// This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
+// accept the license, do not use the software.
+//
+// 1. Definitions
+// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under
+// U.S. copyright law.
+//
+// A "contribution" is the original software, or any additions or changes to the software.
+// A "contributor" is any person that distributes its contribution under this license.
+// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
+//
+// 2. Grant of Rights
+// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
+// each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3,
+// each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+//
+// 3. Conditions and Limitations
+// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
+// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software,
+// your patent license from such contributor to the software ends automatically.
+// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
+// notices that are present in the software.
+// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
+// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object
+// code form, you may only do so under a license that complies with this license.
+// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
+// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
+// permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
+// purpose and non-infringement.
+// */
+// #endregion License
+//
+using System;
+
+namespace Microsoft.Xna.Framework.Content
+{
+ public sealed class ContentSerializerIgnoreAttribute : Attribute
+ {
+ }
+}
+
View
17 MonoGame.Framework/Graphics/Texture2D.cs
@@ -85,6 +85,12 @@ public Rectangle SourceRect
}
}
+ public bool IsDisposed
+ {
+ get;
+ set;
+ }
+
internal Texture2D(ESImage theImage)
{
texture = theImage;
@@ -297,13 +303,6 @@ public void GetData<T>(ref T[] data)
throw new ArgumentException("data cannot be null");
}
- /*int mult = (this.Format == SurfaceFormat.Alpha8) ? 1 : 4;
-
- if (data.Length < Width * Height * mult)
- {
- throw new ArgumentException("data is the wrong length for Pixel Format");
- }*/
-
int sz = 0;
byte[] pixel = new byte[4];
@@ -323,8 +322,8 @@ public void GetData<T>(ref T[] data)
case SurfaceFormat.Rgba32 /*kTexture2DPixelFormat_RGBA8888*/:
case SurfaceFormat.Dxt3 :
sz = 4;
- pos = ( (y * Width) + x ) * sz;
- pixelOffset = new IntPtr(texture.PixelData.ToInt32() + pos);
+ pos = ( (y * Width) + x ) * sz;
+ pixelOffset = new IntPtr(texture.PixelData.ToInt64() + pos);
Marshal.Copy(pixelOffset, pixel, 0, 4);
result.R = pixel[0];
result.G = pixel[1];
View
17 MonoGame.Framework/Graphics/Viewport.cs
@@ -43,6 +43,7 @@ 1. Definitions
namespace Microsoft.Xna.Framework.Graphics
{
+ [SerializableAttribute]
public struct Viewport
{
@@ -60,6 +61,22 @@ public float AspectRatio
}
}
+ public Rectangle Bounds
+ {
+ get
+ {
+ return new Rectangle(X, Y, Width, Height);
+ }
+
+ set
+ {
+ X = value.X;
+ Y = value.Y;
+ Width = value.Width;
+ Height = value.Height;
+ }
+ }
+
public Rectangle TitleSafeArea {get;set;}
public Vector3 Project(Vector3 source, Matrix projection, Matrix view, Matrix world)
View
2 MonoGame.Framework/MacOS/GameWindow.cs
@@ -55,7 +55,7 @@ 1. Definitions
namespace Microsoft.Xna.Framework
{
- public class GameWindow : NSOpenGLView
+ public class GameWindow : MonoMacGameView
{
private readonly Rectangle clientBounds;
internal Game game;
View
1 MonoGame.Framework/MonoGame.Framework.MacOS.csproj
@@ -208,6 +208,5 @@
<Folder Include="MacOS\Content\" />
<Folder Include="MacOS\Graphics\" />
<Folder Include="MacOS\Media\" />
- <Folder Include="Graphics\New Folder\" />
</ItemGroup>
</Project>
View
2 MonoGame.Framework/MonoGame.Framework.iOS.csproj
@@ -279,6 +279,8 @@
<Compile Include="Media\PlaylistCollection.cs" />
<Compile Include="Media\SongCollection.cs" />
<Compile Include="Graphics\Texture.cs" />
+ <Compile Include="Content\ContentSerializerIgnoreAttribute.cs" />
+ <Compile Include="Content\ContentSerializerAttribute.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>

0 comments on commit f23e09e

Please sign in to comment.