agate-svn-commit Mailing List for AgateLib (Page 9)
Status: Alpha
Brought to you by:
kanato
You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
(86) |
May
(77) |
Jun
|
Jul
(1) |
Aug
(31) |
Sep
(12) |
Oct
(31) |
Nov
(53) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(53) |
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(7) |
Dec
(13) |
2011 |
Jan
(17) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(21) |
Dec
|
2012 |
Jan
(6) |
Feb
(14) |
Mar
(5) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(8) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(5) |
Nov
(9) |
Dec
(5) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
|
Jun
(5) |
Jul
(33) |
Aug
(69) |
Sep
(35) |
Oct
(4) |
Nov
(1) |
Dec
|
From: <ka...@us...> - 2012-03-06 05:28:11
|
Revision: 1337 http://agate.svn.sourceforge.net/agate/?rev=1337&view=rev Author: kanato Date: 2012-03-06 05:28:04 +0000 (Tue, 06 Mar 2012) Log Message: ----------- Added option to encode arrays as comma separated lists in the xml file. Reorganized XleSerializationInfo file. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs trunk/Tools/FontCreator/FontCreator.csproj Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2012-02-27 20:12:52 UTC (rev 1336) +++ trunk/AgateLib/AgateLib.csproj 2012-03-06 05:28:04 UTC (rev 1337) @@ -180,6 +180,7 @@ <Compile Include="PlatformType.cs" /> <Compile Include="Resources\ImageResource.cs" /> <Compile Include="Serialization\Xle\CompressionType.cs" /> + <Compile Include="Serialization\Xle\NumericEncoding.cs" /> <Compile Include="Settings\SettingsGroup.cs" /> <Compile Include="Timing.cs"> <SubType>Code</SubType> Modified: trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs =================================================================== --- trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2012-02-27 20:12:52 UTC (rev 1336) +++ trunk/AgateLib/Serialization/Xle/XleSerializationInfo.cs 2012-03-06 05:28:04 UTC (rev 1337) @@ -36,11 +36,6 @@ XmlDocument doc; Stack<XmlElement> nodes = new Stack<XmlElement>(); - /// <summary> - /// The ITypeBinder object used. - /// </summary> - public ITypeBinder Binder { get; internal set; } - internal XleSerializationInfo() { doc = new XmlDocument(); @@ -93,6 +88,8 @@ #region --- Writing methods --- + #region --- Writing single values to the XML --- + /// <summary> /// Writes a field to the XML data as an element. /// </summary> @@ -302,29 +299,115 @@ } /// <summary> + /// Writes an object implementing IXleSerializable to the XML data as an element. + /// </summary> + /// <param name="name">The name of the XML element used.</param> + /// <param name="value">The object data to write.</param> + public void Write(string name, IXleSerializable value) + { + XmlElement element = CreateElement(name); + + if (value == null) + AddAttribute(element, "type", "null"); + else + { + AddAttribute(element, "type", value.GetType().ToString()); + + nodes.Push(element); + + Serialize(value); + + nodes.Pop(); + } + } + private XmlElement WriteAsElement<T>(string name, T value) where T : IConvertible + { + XmlElement element = doc.CreateElement(name); + + element.InnerText = value.ToString(); + + CurrentNode.AppendChild(element); + + return element; + } + private void WriteAsAttribute<T>(string name, T value) where T : IConvertible + { + AddAttribute(CurrentNode, name, Convert.ToString(value)); + } + + private XmlElement CreateElement(string name) + { + XmlElement element = doc.CreateElement(name); + + for (int i = 0; i < CurrentNode.ChildNodes.Count; i++) + { + if (CurrentNode.ChildNodes[i].Name == name) + throw new XleSerializationException("The name " + name + " already exists."); + } + + CurrentNode.AppendChild(element); + + return element; + } + #endregion + #region --- Writing arrays --- + + /// <summary> /// Writes an int[] array to the XML data as an element. /// </summary> /// <param name="name">The name of the XML element used.</param> /// <param name="value">The array data to write.</param> public void Write(string name, int[] value) { - byte[] array = new byte[value.Length * 4]; + WriteImpl(name, value, NumericEncoding.Base64); + } + /// <summary> + /// Writes an int[] array to the XML data as an element with the specified encoding. + /// </summary> + /// <param name="name"></param> + /// <param name="value"></param> + /// <param name="encoding"></param> + public void Write(string name, int[] value, NumericEncoding encoding) + { + WriteImpl(name, value, encoding); + } - if (array.Length > 0) + private void WriteImpl(string name, int[] value, NumericEncoding encoding) + { + switch (encoding) { - unsafe - { - fixed (int* val = value) + case NumericEncoding.Base64: + byte[] array = new byte[value.Length * 4]; + + if (array.Length > 0) { - Marshal.Copy((IntPtr)val, array, 0, array.Length); + unsafe + { + fixed (int* val = value) + { + Marshal.Copy((IntPtr)val, array, 0, array.Length); + } + } } - } + + WriteBase64Encoded(name, array); + break; + + case NumericEncoding.Csv: + string newValue = string.Join(",", value); + + XmlElement el = WriteAsElement(name, newValue); + + AddAttribute(el, "array", "true"); + AddAttribute(el, "encoding", "Csv"); + + break; + + default: + throw new ArgumentException("Value of encoding is not understood."); } - Write(name, array); - } - /// <summary> /// Writes a bool[] array to the XML data as an element. /// </summary> @@ -336,8 +419,8 @@ for (int i = 0; i < value.Length; i++) array[i] = (byte)(value[i] ? 1 : 0); - - Write(name, array); + + WriteBase64Encoded(name, array); } /// <summary> @@ -356,49 +439,10 @@ Marshal.Copy((IntPtr)val, array, 0, array.Length); } } - Write(name, array); + WriteBase64Encoded(name, array); } - /// <summary> - /// Writes a binary stream to the XML data as an element. - /// Compresses the stream using GZip compression. - /// </summary> - /// <param name="name">The name of the XML element used.</param> - /// <param name="value">The stream of data to write.</param> - public void Write(string name, Stream value) - { - Write(name, value, CompressionType.GZip); - } - /// <summary> - /// Writes a binary stream to the XML data as an element. - /// </summary> - /// <param name="name">The name of the XML element used.</param> - /// <param name="value">The stream of data to write.</param> - /// <param name="compression">The compression algorithm to use.</param> - public void Write(string name, Stream value, CompressionType compression) - { - WriteImpl(name, value, compression); - } - private void WriteImpl(string name, Stream value, CompressionType compression) - { - MemoryStream ms = new MemoryStream(); - Stream compressed = TranslateStream(ms, compression, CompressionMode.Compress); - - byte[] uncompressedData = ReadFromStream(value); - compressed.Write(uncompressedData, 0, uncompressedData.Length); - - byte[] buffer = ms.GetBuffer(); - - string newValue = Convert.ToBase64String( - buffer/*, Base64FormattingOptions.InsertLineBreaks*/); - - XmlElement el = WriteAsElement(name, newValue); - AddAttribute(el, "stream", "true"); - AddAttribute(el, "compression", compression.ToString()); - AddAttribute(el, "encoding", "Base64"); - } - /// <summary> /// Writes a byte[] array to the XML data as an element. /// </summary> @@ -406,35 +450,20 @@ /// <param name="value">The array data to write.</param> public void Write(string name, byte[] value) { + WriteBase64Encoded(name, value); + } + + private void WriteBase64Encoded(string name, byte[] value) + { string newValue = Convert.ToBase64String(value, Base64FormattingOptions.InsertLineBreaks); XmlElement el = WriteAsElement(name, newValue); + AddAttribute(el, "array", "true"); AddAttribute(el, "encoding", "Base64"); } - /// <summary> - /// Writes an object implementing IXleSerializable to the XML data as an element. - /// </summary> - /// <param name="name">The name of the XML element used.</param> - /// <param name="value">The object data to write.</param> - public void Write(string name, IXleSerializable value) - { - XmlElement element = CreateElement(name); - if (value == null) - AddAttribute(element, "type", "null"); - else - { - AddAttribute(element, "type", value.GetType().ToString()); - nodes.Push(element); - - Serialize(value); - - nodes.Pop(); - } - } - /// <summary> /// Writes an array of objects implementing IXleSerializable to the XML data as an element. /// </summary> @@ -496,11 +525,11 @@ /// </summary> /// <param name="name">The name of the XML element used.</param> /// <param name="value">The list data to write.</param> - public void Write(string name, List<string> value) + public void Write(string name, List<string> value) { XmlElement element = CreateElement(name); AddAttribute(element, "array", "true"); - + nodes.Push(element); for (int i = 0; i < value.Count; i++) @@ -619,36 +648,50 @@ nodes.Pop(); } - private XmlElement WriteAsElement<T>(string name, T value) where T : IConvertible + #endregion + #region --- Writing Streams --- + + /// <summary> + /// Writes a binary stream to the XML data as an element. + /// Compresses the stream using GZip compression. + /// </summary> + /// <param name="name">The name of the XML element used.</param> + /// <param name="value">The stream of data to write.</param> + public void Write(string name, Stream value) { - XmlElement element = doc.CreateElement(name); - - element.InnerText = value.ToString(); - - CurrentNode.AppendChild(element); - - return element; + Write(name, value, CompressionType.GZip); } - private void WriteAsAttribute<T>(string name, T value) where T : IConvertible + /// <summary> + /// Writes a binary stream to the XML data as an element. + /// </summary> + /// <param name="name">The name of the XML element used.</param> + /// <param name="value">The stream of data to write.</param> + /// <param name="compression">The compression algorithm to use.</param> + public void Write(string name, Stream value, CompressionType compression) { - AddAttribute(CurrentNode, name, Convert.ToString(value)); + WriteImpl(name, value, compression); } - private XmlElement CreateElement(string name) + private void WriteImpl(string name, Stream value, CompressionType compression) { - XmlElement element = doc.CreateElement(name); + MemoryStream ms = new MemoryStream(); + Stream compressed = TranslateStream(ms, compression, CompressionMode.Compress); - for (int i = 0; i < CurrentNode.ChildNodes.Count; i++) - { - if (CurrentNode.ChildNodes[i].Name == name) - throw new XleSerializationException("The name " + name + " already exists."); - } + byte[] uncompressedData = ReadFromStream(value); + compressed.Write(uncompressedData, 0, uncompressedData.Length); - CurrentNode.AppendChild(element); + byte[] buffer = ms.GetBuffer(); - return element; + string newValue = Convert.ToBase64String( + buffer/*, Base64FormattingOptions.InsertLineBreaks*/); + + XmlElement el = WriteAsElement(name, newValue); + AddAttribute(el, "stream", "true"); + AddAttribute(el, "compression", compression.ToString()); + AddAttribute(el, "encoding", "Base64"); } + #endregion #endregion #region --- Reading methods --- @@ -673,130 +716,9 @@ return true; } - private Type GetType(string name) - { - return Binder.GetType(name); - } + #region --- Reading single values --- /// <summary> - /// Reads a dictionary type from the XML data. - /// The key type must implement IConvertible and the value type must implement - /// IXleSerializable. - /// </summary> - /// <typeparam name="TKey"></typeparam> - /// <typeparam name="TValue"></typeparam> - /// <param name="name"></param> - /// <returns></returns> - [CLSCompliant(false)] - public Dictionary<TKey, TValue> ReadDictionary<TKey, TValue>(string name) - where TKey : IConvertible - where TValue : IXleSerializable - { - XmlElement element = (XmlElement)CurrentNode[name]; - - if (element == null) - throw new XleSerializationException("Node " + name + " was not found."); - - nodes.Push(element); - - Dictionary<TKey, TValue> retval = new Dictionary<TKey, TValue>(); - - for (int i = 0; i < element.ChildNodes.Count; i++) - { - XmlElement current = (XmlElement)CurrentNode.ChildNodes[i]; - string keyString = current.GetAttribute("key"); - TKey key = (TKey)Convert.ChangeType(keyString, typeof(TKey)); - - nodes.Push(current); - TValue val = (TValue)DeserializeObject(typeof(TValue)); - nodes.Pop(); - - retval.Add(key, val); - } - - nodes.Pop(); - - return retval; - } - /// <summary> - /// Reads a dictionary type of strings from the XML data. - /// The key type must implement IConvertible and the value type must implement - /// IXleSerializable. - /// </summary> - /// <typeparam name="Tkey">The key type of the dictionary.</typeparam> - /// <param name="name">The name of the element in the XML stream to decode.</param> - /// <returns></returns> - [CLSCompliant(false)] - [Obsolete("Use ReadDictionaryString instead.")] - public Dictionary<Tkey, string> ReadDictionary<Tkey>(string name) - where Tkey : IConvertible - { - return ReadDictionaryString<Tkey>(name); - } - /// <summary> - /// Reads a dictionary type of strings from the XML data. - /// The key type must implement IConvertible and the value type must implement - /// IXleSerializable. - /// </summary> - /// <typeparam name="Tkey">The key type of the dictionary.</typeparam> - /// <param name="name">The name of the element in the XML stream to decode.</param> - /// <returns></returns> - [CLSCompliant(false)] - public Dictionary<Tkey, string> ReadDictionaryString<Tkey>(string name) - where Tkey : IConvertible - { - XmlElement element = (XmlElement)CurrentNode[name]; - - nodes.Push(element); - - Dictionary<Tkey, string> retval = new Dictionary<Tkey, string>(); - - for (int i = 0; i < element.ChildNodes.Count; i++) - { - XmlElement current = (XmlElement)CurrentNode.ChildNodes[i]; - string keyString = current.GetAttribute("key"); - Tkey key = (Tkey)Convert.ChangeType(keyString, typeof(Tkey)); - - string valueString = current.GetAttribute("value"); - - retval.Add(key, valueString); - } - - nodes.Pop(); - - return retval; - } - - /// <summary> - /// Reads a dictionary of the form Dictionary<Tkey, int>. - /// </summary> - /// <typeparam name="Tkey"></typeparam> - /// <param name="name"></param> - /// <returns></returns> - public Dictionary<Tkey, int> ReadDictionaryInt32<Tkey>(string name) - { - XmlElement element = (XmlElement)CurrentNode[name]; - - nodes.Push(element); - - Dictionary<Tkey, int> retval = new Dictionary<Tkey, int>(); - - for (int i = 0; i < element.ChildNodes.Count; i++) - { - XmlElement current = (XmlElement)CurrentNode.ChildNodes[i]; - string keyString = current.GetAttribute("key"); - Tkey key = (Tkey)Convert.ChangeType(keyString, typeof(Tkey)); - - string valueString = current.GetAttribute("value"); - - retval.Add(key, int.Parse(valueString)); - } - - nodes.Pop(); - - return retval; - } - /// <summary> /// Reads an object from the XML data. /// </summary> /// <param name="name"></param> @@ -851,48 +773,7 @@ { return ReadStringImpl(name, false, string.Empty); } - /// <summary> - /// Reads binary data stored as a stream. - /// </summary> - /// <param name="name"></param> - /// <returns></returns> - public Stream ReadStream(string name) - { - XmlElement element = (XmlElement)CurrentNode[name]; - if (element == null) - throw new XleSerializationException("Field " + name + " was not found."); - - if (element.Attributes["stream"] == null || element.Attributes["stream"].Value != "true") - throw new XleSerializationException("Field " + name + " is not a stream."); - if (element.Attributes["encoding"] == null) - throw new XleSerializationException("Field " + name + " does not have encoding information."); - - string encoding = element.Attributes["encoding"].Value; - byte[] bytes; - - if (encoding == "Base64") - { - bytes = Convert.FromBase64String(element.InnerText); - } - else - throw new XleSerializationException("Unrecognized encoding " + encoding); - - CompressionType compression = CompressionType.None; - - if (element.Attributes["compression"] != null) - { - compression = (CompressionType) - Enum.Parse(typeof(CompressionType), element.Attributes["compression"].Value, true); - } - - MemoryStream ms = new MemoryStream(bytes); - ms.Position = 0; - Stream uncompressed = TranslateStream(ms, compression, CompressionMode.Decompress); - - return uncompressed; - } - private string ReadStringImpl(string name, bool haveDefault, string defaultValue) { string attribute = CurrentNode.GetAttribute(name); @@ -1068,7 +949,49 @@ return float.Parse(element.InnerText); } + + #endregion + #region --- Reading array values --- + + private string GetEncoding(string name) + { + XmlElement element = (XmlElement)CurrentNode[name]; + + if (element == null) + throw new XleSerializationException("Node " + name + " not found."); + if (element.Attributes["encoding"] == null) + throw new XleSerializationException("Element " + name + " does not have encoding information."); + + return element.Attributes["encoding"].Value; + } + /// <summary> + /// Reads a byte array from the XML data. If the name is not present + /// an XleSerializationException is thrown. + /// </summary> + /// <param name="name">Name of the field.</param> + /// <returns></returns> + public byte[] ReadByteArray(string name) + { + XmlElement element = (XmlElement)CurrentNode[name]; + + string encoding = GetEncoding(name); + + if (element.Attributes["array"] == null || element.Attributes["array"].Value != "true") + throw new XleSerializationException("Element " + name + " is not an array."); + + if (encoding == "Base64") + { + byte[] array = Convert.FromBase64String(element.InnerText); + return array; + } + else + { + throw new XleSerializationException("Unrecognized encoding " + element.Attributes["encoding"]); + } + } + + /// <summary> /// Reads a integer array from the XML data. If the name is not present /// an XleSerializationException is thrown. /// </summary> @@ -1076,25 +999,46 @@ /// <returns></returns> public int[] ReadInt32Array(string name) { - byte[] array = ReadByteArray(name); - int[] result = new int[array.Length / 4]; + XmlElement element = (XmlElement)CurrentNode[name]; + string encoding = GetEncoding(name); + int[] result; - if (array.Length % 4 != 0) - throw new XleSerializationException("Encoded array is wrong size!"); + switch ((NumericEncoding)Enum.Parse(typeof(NumericEncoding), encoding)) + { + case NumericEncoding.Base64: + byte[] array = ReadByteArray(name); + result = new int[array.Length / 4]; - if (array.Length > 0) - { - unsafe - { - fixed (byte* ar = array) + if (array.Length % 4 != 0) + throw new XleSerializationException("Encoded array is wrong size!"); + + if (array.Length > 0) { - Marshal.Copy((IntPtr)ar, result, 0, result.Length); + unsafe + { + fixed (byte* ar = array) + { + Marshal.Copy((IntPtr)ar, result, 0, result.Length); + } + } } - } + + return result; + + case NumericEncoding.Csv: + string value = element.InnerText; + string[] vals = value.Split(new char[] { ',' }, + StringSplitOptions.RemoveEmptyEntries); + + result = vals.Select(x => int.Parse(x)).ToArray(); + + return result; + + default: + throw new XleSerializationException("Encoding information could not be parsed."); } + } - return result; - } /// <summary> /// Reads a boolean array from the XML data. If the name is not present /// an XleSerializationException is thrown. @@ -1203,7 +1147,7 @@ { list.Add(item.InnerText); } - else + else { nodes.Push(item); @@ -1236,50 +1180,190 @@ else ar = ReadArrayImpl(name, typeof(T)); - List<T> retval = new List<T>(); - retval.AddRange((T[])ar); + return ((T[])ar).ToList(); + } + /// <summary> + /// Reads a dictionary type from the XML data. + /// The key type must implement IConvertible and the value type must implement + /// IXleSerializable. + /// </summary> + /// <typeparam name="TKey"></typeparam> + /// <typeparam name="TValue"></typeparam> + /// <param name="name"></param> + /// <returns></returns> + [CLSCompliant(false)] + public Dictionary<TKey, TValue> ReadDictionary<TKey, TValue>(string name) + where TKey : IConvertible + where TValue : IXleSerializable + { + XmlElement element = (XmlElement)CurrentNode[name]; + + if (element == null) + throw new XleSerializationException("Node " + name + " was not found."); + + nodes.Push(element); + + Dictionary<TKey, TValue> retval = new Dictionary<TKey, TValue>(); + + for (int i = 0; i < element.ChildNodes.Count; i++) + { + XmlElement current = (XmlElement)CurrentNode.ChildNodes[i]; + string keyString = current.GetAttribute("key"); + TKey key = (TKey)Convert.ChangeType(keyString, typeof(TKey)); + + nodes.Push(current); + TValue val = (TValue)DeserializeObject(typeof(TValue)); + nodes.Pop(); + + retval.Add(key, val); + } + + nodes.Pop(); + return retval; } + /// <summary> + /// Reads a dictionary type of strings from the XML data. + /// The key type must implement IConvertible and the value type must implement + /// IXleSerializable. + /// </summary> + /// <typeparam name="Tkey">The key type of the dictionary.</typeparam> + /// <param name="name">The name of the element in the XML stream to decode.</param> + /// <returns></returns> + [CLSCompliant(false)] + [Obsolete("Use ReadDictionaryString instead.")] + public Dictionary<Tkey, string> ReadDictionary<Tkey>(string name) + where Tkey : IConvertible + { + return ReadDictionaryString<Tkey>(name); + } + /// <summary> + /// Reads a dictionary type of strings from the XML data. + /// The key type must implement IConvertible and the value type must implement + /// IXleSerializable. + /// </summary> + /// <typeparam name="Tkey">The key type of the dictionary.</typeparam> + /// <param name="name">The name of the element in the XML stream to decode.</param> + /// <returns></returns> + [CLSCompliant(false)] + public Dictionary<Tkey, string> ReadDictionaryString<Tkey>(string name) + where Tkey : IConvertible + { + XmlElement element = (XmlElement)CurrentNode[name]; + nodes.Push(element); + Dictionary<Tkey, string> retval = new Dictionary<Tkey, string>(); + + for (int i = 0; i < element.ChildNodes.Count; i++) + { + XmlElement current = (XmlElement)CurrentNode.ChildNodes[i]; + string keyString = current.GetAttribute("key"); + Tkey key = (Tkey)Convert.ChangeType(keyString, typeof(Tkey)); + + string valueString = current.GetAttribute("value"); + + retval.Add(key, valueString); + } + + nodes.Pop(); + + return retval; + } + /// <summary> - /// Reads a byte array from the XML data. If the name is not present - /// an XleSerializationException is thrown. + /// Reads a dictionary of the form Dictionary<Tkey, int>. /// </summary> - /// <param name="name">Name of the field.</param> + /// <typeparam name="Tkey"></typeparam> + /// <param name="name"></param> /// <returns></returns> - public byte[] ReadByteArray(string name) + public Dictionary<Tkey, int> ReadDictionaryInt32<Tkey>(string name) { XmlElement element = (XmlElement)CurrentNode[name]; + nodes.Push(element); + + Dictionary<Tkey, int> retval = new Dictionary<Tkey, int>(); + + for (int i = 0; i < element.ChildNodes.Count; i++) + { + XmlElement current = (XmlElement)CurrentNode.ChildNodes[i]; + string keyString = current.GetAttribute("key"); + Tkey key = (Tkey)Convert.ChangeType(keyString, typeof(Tkey)); + + string valueString = current.GetAttribute("value"); + + retval.Add(key, int.Parse(valueString)); + } + + nodes.Pop(); + + return retval; + } + + #endregion + #region --- Reading streams --- + /// <summary> + /// Reads binary data stored as a stream. + /// </summary> + /// <param name="name"></param> + /// <returns></returns> + public Stream ReadStream(string name) + { + XmlElement element = (XmlElement)CurrentNode[name]; + if (element == null) - throw new XleSerializationException("Node " + name + " not found."); + throw new XleSerializationException("Field " + name + " was not found."); - if (element.Attributes["array"] == null || element.Attributes["array"].Value != "true") - throw new XleSerializationException("Element " + name + " is not an array."); + if (element.Attributes["stream"] == null || element.Attributes["stream"].Value != "true") + throw new XleSerializationException("Field " + name + " is not a stream."); if (element.Attributes["encoding"] == null) - throw new XleSerializationException("Element " + name + " does not have encoding information."); + throw new XleSerializationException("Field " + name + " does not have encoding information."); - if (element.Attributes["encoding"].Value == "Base64") + string encoding = element.Attributes["encoding"].Value; + byte[] bytes; + + if (encoding == "Base64") { - byte[] array = Convert.FromBase64String(element.InnerText); - return array; + bytes = Convert.FromBase64String(element.InnerText); } else + throw new XleSerializationException("Unrecognized encoding " + encoding); + + CompressionType compression = CompressionType.None; + + if (element.Attributes["compression"] != null) { - throw new XleSerializationException("Unrecognized encoding " + element.Attributes["encoding"]); + compression = (CompressionType) + Enum.Parse(typeof(CompressionType), element.Attributes["compression"].Value, true); } + MemoryStream ms = new MemoryStream(bytes); + ms.Position = 0; + Stream uncompressed = TranslateStream(ms, compression, CompressionMode.Decompress); + + return uncompressed; } + #endregion + #endregion + #region --- Type Binding --- + private Type GetType(string name) + { + return Binder.GetType(name); + } + + /// <summary> + /// The ITypeBinder object used. + /// </summary> + public ITypeBinder Binder { get; internal set; } + #endregion - #region --- Dealing with streams --- - /// <summary> /// Reads data from a stream until the end is reached. The /// data is returned as a byte array. An IOException is @@ -1303,7 +1387,6 @@ } } - private Stream TranslateStream(Stream value, CompressionType compression, CompressionMode mode) { switch (compression) Modified: trunk/Tools/FontCreator/FontCreator.csproj =================================================================== --- trunk/Tools/FontCreator/FontCreator.csproj 2012-02-27 20:12:52 UTC (rev 1336) +++ trunk/Tools/FontCreator/FontCreator.csproj 2012-03-06 05:28:04 UTC (rev 1337) @@ -124,6 +124,10 @@ <Name>AgateLib</Name> <Project>{9490B719-829E-43A7-A5FE-8001F8A81759}</Project> </ProjectReference> + <ProjectReference Include="..\..\Drivers\AgateDrawing\AgateDrawing.csproj"> + <Project>{164A785D-924E-40FB-A517-D7E677F3B53A}</Project> + <Name>AgateDrawing</Name> + </ProjectReference> <ProjectReference Include="..\..\Drivers\AgateLib.WinForms\AgateLib.WinForms.csproj"> <Name>AgateLib.WinForms</Name> <Project>{BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}</Project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-27 20:12:57
|
Revision: 1336 http://agate.svn.sourceforge.net/agate/?rev=1336&view=rev Author: kanato Date: 2012-02-27 20:12:52 +0000 (Mon, 27 Feb 2012) Log Message: ----------- Add Vector2.FromPolar methods. Modified Paths: -------------- trunk/AgateLib/Geometry/Vector2.cs Modified: trunk/AgateLib/Geometry/Vector2.cs =================================================================== --- trunk/AgateLib/Geometry/Vector2.cs 2012-02-27 20:12:30 UTC (rev 1335) +++ trunk/AgateLib/Geometry/Vector2.cs 2012-02-27 20:12:52 UTC (rev 1336) @@ -246,5 +246,27 @@ "{{X={0},Y={1}}}", X, Y); } + /// <summary> + /// Produces a Vector2 object from polar coordinates. + /// </summary> + /// <remarks>Angles in the first + /// quadrant (between 0 and pi/2) will have positive x and y coordinates, + /// which will be downright in the usual screen coordinates. + /// </remarks> + /// <param name="radius"></param> + /// <param name="angle">The angle in radians</param> + /// <returns></returns> + public static Vector2 FromPolar(double radius, double angle) + { + Vector2 retval = new Vector2( + radius * Math.Cos(angle), + radius * Math.Sin(angle)); + + return retval; + } + public static Vector2 FromPolarDegrees(double radius, double angle) + { + return FromPolar(radius, angle * Math.PI / 180.0); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-27 20:12:39
|
Revision: 1335 http://agate.svn.sourceforge.net/agate/?rev=1335&view=rev Author: kanato Date: 2012-02-27 20:12:30 +0000 (Mon, 27 Feb 2012) Log Message: ----------- Add Surface.Draw(Rectangle, PointF) overload. Modified Paths: -------------- trunk/AgateLib/DisplayLib/Surface.cs trunk/AgateLib/Sprites/SpriteFrame.cs Modified: trunk/AgateLib/DisplayLib/Surface.cs =================================================================== --- trunk/AgateLib/DisplayLib/Surface.cs 2012-02-24 18:32:44 UTC (rev 1334) +++ trunk/AgateLib/DisplayLib/Surface.cs 2012-02-27 20:12:30 UTC (rev 1335) @@ -502,7 +502,7 @@ /// to the top-left of the surface.</param> public void Draw(PointF destPt, PointF rotationCenter) { - Draw(destPt, Rectangle.Empty, rotationCenter); + Draw(Rectangle.Empty, destPt, rotationCenter); } /// <summary> /// Draws this surface to the screen at the specified point, @@ -516,7 +516,7 @@ Draw(new PointF(destX, destY), new PointF(rotationCenterX, rotationCenterY)); } - internal void Draw(PointF destPt, Rectangle srcRect, PointF rotationCenter) + internal void Draw(Rectangle srcRect, PointF destPt, PointF rotationCenter) { OriginAlignment oldrotation = State.RotationCenter; PointF oldcenter = State.RotationCenterLocation; @@ -534,6 +534,31 @@ } /// <summary> + /// Draws the specified source rect at the given destination point. + /// </summary> + /// <param name="srcRect"></param> + /// <param name="destPt"></param> + public void Draw(Rectangle srcRect, PointF destPt) + { + State.DrawInstances.SetCount(1); + State.DrawInstances[0] = new SurfaceDrawInstance(destPt, srcRect); + + mImpl.Draw(State); + } + /// <summary> + /// Draws the specified source rect at the given destination point. + /// </summary> + /// <param name="srcRect"></param> + /// <param name="destPt"></param> + public void Draw(Rectangle srcRect, Point destPt) + { + State.DrawInstances.SetCount(1); + State.DrawInstances[0] = new SurfaceDrawInstance((PointF)destPt, srcRect); + + mImpl.Draw(State); + } + + /// <summary> /// Draws the surface using the parameters in the specified state object. /// </summary> /// <param name="state">The surface state information to use when drawing.</param> Modified: trunk/AgateLib/Sprites/SpriteFrame.cs =================================================================== --- trunk/AgateLib/Sprites/SpriteFrame.cs 2012-02-24 18:32:44 UTC (rev 1334) +++ trunk/AgateLib/Sprites/SpriteFrame.cs 2012-02-27 20:12:30 UTC (rev 1335) @@ -137,10 +137,8 @@ mSurface.SetScale(scaleX, scaleY); - mSurface.Draw(new PointF(dest_x + (mOffset.X * scaleX), - dest_y + (mOffset.Y * scaleY)), - mSrcRect, - new PointF(rotationCenterX - (mOffset.X * scaleX), + mSurface.Draw(mSrcRect, new PointF(dest_x + (mOffset.X * scaleX), + dest_y + (mOffset.Y * scaleY)), new PointF(rotationCenterX - (mOffset.X * scaleX), rotationCenterY - (mOffset.Y * scaleY))); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-24 18:32:52
|
Revision: 1334 http://agate.svn.sourceforge.net/agate/?rev=1334&view=rev Author: kanato Date: 2012-02-24 18:32:44 +0000 (Fri, 24 Feb 2012) Log Message: ----------- Add properties to retrieve which drivers were initialized. Modified Paths: -------------- trunk/AgateLib/Drivers/Registrar.cs Modified: trunk/AgateLib/Drivers/Registrar.cs =================================================================== --- trunk/AgateLib/Drivers/Registrar.cs 2012-02-24 18:20:22 UTC (rev 1333) +++ trunk/AgateLib/Drivers/Registrar.cs 2012-02-24 18:32:44 UTC (rev 1334) @@ -1,525 +1,552 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2006-2011. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Reflection; -using System.Text; -using AgateLib.AudioLib.ImplementationBase; -using AgateLib.DisplayLib.ImplementationBase; -using AgateLib.InputLib.ImplementationBase; -using AgateLib.Utility; - -namespace AgateLib.Drivers -{ - /// <summary> - /// Static class with which drivers register themselves so that the library can - /// instantiate them. - /// </summary> - public static class Registrar - { - private static List<AgateDriverInfo> - displayDrivers = new List<AgateDriverInfo>(), - audioDrivers = new List<AgateDriverInfo>(), - inputDrivers = new List<AgateDriverInfo>(), - desktopDrivers = new List<AgateDriverInfo>(); - - private static bool mIsInitialized = false; - - private static IDesktopDriver mDesktop; - - private static readonly string[] KnownNativeLibraries = new string[] - { - "SDL.dll", - "SDL_mixer.dll", - "libogg-0.dll", - "libvorbis-0.dll", - "libvorbisfile-3.dll", - }; - - - static bool Contains(this IEnumerable<AgateDriverInfo> list, DisplayTypeID type) - { - return list.Any( - x => Comparator(x, DriverType.Display, (int)type)); - } - static bool Contains(this IEnumerable<AgateDriverInfo> list, AudioTypeID type) - { - return list.Any( - x => Comparator(x, DriverType.Audio, (int)type)); - } - static bool Contains(this IEnumerable<AgateDriverInfo> list, InputTypeID type) - { - return list.Any( - x => Comparator(x, DriverType.Input, (int)type)); - } - static bool Comparator(AgateDriverInfo info, DriverType driverType, int type) - { - return info.DriverType == driverType && info.DriverTypeID == type; - } - - static Registrar() - { - } - /// <summary> - /// Searches through FileManager.AssemblyPath for all *.dll files. These files - /// are loaded and searched for classes which derive from DisplayImpl, AudioImpl, etc. - /// </summary> - internal static void Initialize() - { - if (mIsInitialized) - return; - - RegisterNullDrivers(); - - AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); - AppDomain sandbox = AppDomain.CreateDomain("AgateSandBox"); - - AgateSandBoxLoader loader = (AgateSandBoxLoader) - sandbox.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, - typeof(AgateSandBoxLoader).FullName); - - IEnumerable<string> files = AgateFileProvider.Assemblies.GetAllFiles("*.dll"); - - foreach (string file in files) - { - if (ShouldSkipLibrary(file)) - continue; - - foreach (AgateDriverInfo info in loader.ReportDrivers(file)) - { - switch (info.DriverType) - { - case DriverType.Display: - displayDrivers.Add(info); - break; - - case DriverType.Audio: - audioDrivers.Add(info); - break; - - case DriverType.Input: - inputDrivers.Add(info); - break; - - case DriverType.Desktop: - desktopDrivers.Add(info); - break; - - default: - Core.ErrorReporting.Report(ErrorLevel.Warning, string.Format( - "Could not interpret DriverType returned by type {0} in assembly {1}.", - info.DriverTypeName, info.AssemblyFile), null); - - break; - } - } - } - - AppDomain.Unload(sandbox); - - SortDriverInfo(displayDrivers); - SortDriverInfo(audioDrivers); - SortDriverInfo(inputDrivers); - SortDriverInfo(desktopDrivers); - - mIsInitialized = true; - } - private static void SortDriverInfo(List<AgateDriverInfo> driverList) - { - // sorts the driver list in reverse order. - driverList.Sort(delegate(AgateDriverInfo a, AgateDriverInfo b) - { - return -a.Priority.CompareTo(b.Priority); - }); - } - - private static void RegisterNullDrivers() - { - Assembly thisAssembly = Assembly.GetExecutingAssembly(); - - AgateDriverInfo nullAudioInfo = new AgateDriverInfo(AudioTypeID.Silent, - typeof(NullSoundImpl), "No audio", -100); - - nullAudioInfo.AssemblyFile = thisAssembly.CodeBase; - nullAudioInfo.AssemblyName = thisAssembly.FullName; - - audioDrivers.Add(nullAudioInfo); - - AgateDriverInfo nullInputInfo = new AgateDriverInfo(InputTypeID.Silent, - typeof(NullInputImpl), "No input", -100); - - nullInputInfo.AssemblyFile = thisAssembly.CodeBase; - nullInputInfo.AssemblyName = thisAssembly.FullName; - - inputDrivers.Add(nullInputInfo); - } - - private static bool ShouldSkipLibrary(string file) - { - // Native libraries in the same directory will give an error when loaded, - // so skip any ones that we know about that will probably be in the same - // directory as the drivers. - if (IsKnownNativeLibrary(file)) - return true; - - // hack, because mono crashes if AgateMDX.dll is present. - // annoying, because it should report a failure to load the types in the - // assembly, and then the try catch should continue after that. - // TODO: this hack seems unnecessary in recent versions of Mono. Should it be removed? - if ((Environment.OSVersion.Platform == PlatformID.Unix || - Environment.OSVersion.Platform == (PlatformID)128) && - (System.IO.Path.GetFileName(file).ToLower().Contains("agatemdx.dll") || - System.IO.Path.GetFileName(file).ToLower().Contains("agatesdx.dll"))) - { - Core.ErrorReporting.Report(ErrorLevel.Comment, - string.Format("DirectX not supported on non-Windows platforms. {0}Remove {1} to eliminate this message.", - Environment.NewLine, System.IO.Path.GetFileName(file)), null); - - return true; - } - - // Skip the agatelib dll. - if (System.IO.Path.GetFileName(file).ToLower().Contains("agatelib.dll")) - return true; - - return false; - } - private static bool IsKnownNativeLibrary(string path) - { - string filename = System.IO.Path.GetFileName(path).ToLowerInvariant(); - - for (int i = 0; i < KnownNativeLibraries.Length; i++) - { - if (KnownNativeLibraries[i].ToLowerInvariant() == filename) - return true; - } - return false; - } - - - /// <summary> - /// Asks the user to select which drivers to use. - /// </summary> - /// <param name="chooseDisplay"></param> - /// <param name="chooseAudio"></param> - /// <param name="chooseInput"></param> - /// <param name="selectedDisplay"></param> - /// <param name="selectedAudio"></param> - /// <param name="selectedInput"></param> - /// <returns></returns> - internal static bool UserSelectDrivers(bool chooseDisplay, bool chooseAudio, bool chooseInput, - DisplayTypeID preferredDisplay, AudioTypeID preferredAudio, InputTypeID preferredInput, - out DisplayTypeID selectedDisplay, out AudioTypeID selectedAudio, out InputTypeID selectedInput) - { - if (mDesktop == null) - { - CreateDesktopDriver(); - - if (mDesktop == null) - { - SelectBestDrivers(chooseDisplay, chooseAudio, chooseInput, - preferredDisplay, preferredAudio, preferredInput, - out selectedDisplay, out selectedAudio, out selectedInput); - - return true; - } - } - - IUserSetSystems frm = mDesktop.CreateUserSetSystems(); - - // set default values. - selectedDisplay = DisplayTypeID.AutoSelect; - selectedAudio = AudioTypeID.AutoSelect; - selectedInput = InputTypeID.AutoSelect; - - foreach (AgateDriverInfo info in displayDrivers) - { - frm.AddDisplayType(info); - } - foreach (AgateDriverInfo info in audioDrivers) - { - frm.AddAudioType(info); - } - foreach (AgateDriverInfo info in inputDrivers) - { - frm.AddInputType(info); - } - - frm.SetChoices(chooseDisplay, chooseAudio, chooseInput, - preferredDisplay, preferredAudio, preferredInput); - - // run the dialog asking user which drivers to use. - if (frm.RunDialog() == SetSystemsDialogResult.Cancel) - { - return false; - } - - selectedDisplay = frm.DisplayType; - selectedAudio = frm.AudioType; - selectedInput = frm.InputType; - - return true; - - } - - private static void SelectBestDrivers(bool chooseDisplay, bool chooseAudio, bool chooseInput, - DisplayTypeID preferredDisplay, AudioTypeID preferredAudio, InputTypeID preferredInput, - out DisplayTypeID selectedDisplay, out AudioTypeID selectedAudio, out InputTypeID selectedInput) - { - // initial return values if a driver isn't selected. - selectedDisplay = DisplayTypeID.AutoSelect; - selectedAudio = AudioTypeID.AutoSelect; - selectedInput = InputTypeID.AutoSelect; - - if (preferredDisplay != DisplayTypeID.AutoSelect && displayDrivers.Contains(preferredDisplay)) - selectedDisplay = preferredDisplay; - else if (displayDrivers.Count > 0) - selectedDisplay = (DisplayTypeID)displayDrivers[0].DriverTypeID; - - if (preferredAudio != AudioTypeID.AutoSelect && audioDrivers.Contains(preferredAudio)) - selectedAudio = preferredAudio; - else if (audioDrivers.Count > 0) - selectedAudio = (AudioTypeID)audioDrivers[0].DriverTypeID; - - if (preferredInput != InputTypeID.AutoSelect && inputDrivers.Contains(preferredInput)) - selectedInput = preferredInput; - else if (inputDrivers.Count > 0) - selectedInput = (InputTypeID)inputDrivers[0].DriverTypeID; - } - - private static void CreateDesktopDriver() - { - if (desktopDrivers.Count == 0) - return; - - mDesktop = (IDesktopDriver)CreateDriverInstance(desktopDrivers[0]); - } - - internal static IDesktopDriver WinForms - { - get { return mDesktop; } - } - - internal static DisplayImpl CreateDisplayDriver(DisplayTypeID displayType) - { - if (displayDrivers.Count == 0) - throw new AgateException("No display drivers registered."); - - AgateDriverInfo info = null; - string text; - - bool settingsSelect = displayType == DisplayTypeID.AutoSelect; - settingsSelect &= Core.Settings["AgateLib"].TryGetValue("DisplayDriver", out text); - - if (settingsSelect) - { - info = FindDriverInfo(displayDrivers, text); - - if (info == null) - settingsSelect = false; - } - - if (settingsSelect == false) - info = FindDriverInfo(displayDrivers, (int)displayType); - - if (info == null) +// The contents of this file are subject to the Mozilla Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is AgateLib. +// +// The Initial Developer of the Original Code is Erik Ylvisaker. +// Portions created by Erik Ylvisaker are Copyright (C) 2006-2011. +// All Rights Reserved. +// +// Contributor(s): Erik Ylvisaker +// +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using System.Text; +using AgateLib.AudioLib.ImplementationBase; +using AgateLib.DisplayLib.ImplementationBase; +using AgateLib.InputLib.ImplementationBase; +using AgateLib.Utility; + +namespace AgateLib.Drivers +{ + /// <summary> + /// Static class with which drivers register themselves so that the library can + /// instantiate them. + /// </summary> + public static class Registrar + { + private static List<AgateDriverInfo> + displayDrivers = new List<AgateDriverInfo>(), + audioDrivers = new List<AgateDriverInfo>(), + inputDrivers = new List<AgateDriverInfo>(), + desktopDrivers = new List<AgateDriverInfo>(); + + private static AgateDriverInfo mDisplayUsed; + private static AgateDriverInfo mAudioUsed; + private static AgateDriverInfo mInputUsed; + + private static bool mIsInitialized = false; + + private static IDesktopDriver mDesktop; + + private static readonly string[] KnownNativeLibraries = new string[] + { + "SDL.dll", + "SDL_mixer.dll", + "libogg-0.dll", + "libvorbis-0.dll", + "libvorbisfile-3.dll", + }; + + + static bool Contains(this IEnumerable<AgateDriverInfo> list, DisplayTypeID type) + { + return list.Any( + x => Comparator(x, DriverType.Display, (int)type)); + } + static bool Contains(this IEnumerable<AgateDriverInfo> list, AudioTypeID type) + { + return list.Any( + x => Comparator(x, DriverType.Audio, (int)type)); + } + static bool Contains(this IEnumerable<AgateDriverInfo> list, InputTypeID type) + { + return list.Any( + x => Comparator(x, DriverType.Input, (int)type)); + } + static bool Comparator(AgateDriverInfo info, DriverType driverType, int type) + { + return info.DriverType == driverType && info.DriverTypeID == type; + } + + static Registrar() + { + } + /// <summary> + /// Searches through FileManager.AssemblyPath for all *.dll files. These files + /// are loaded and searched for classes which derive from DisplayImpl, AudioImpl, etc. + /// </summary> + internal static void Initialize() + { + if (mIsInitialized) + return; + + RegisterNullDrivers(); + + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); + AppDomain sandbox = AppDomain.CreateDomain("AgateSandBox"); + + AgateSandBoxLoader loader = (AgateSandBoxLoader) + sandbox.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, + typeof(AgateSandBoxLoader).FullName); + + IEnumerable<string> files = AgateFileProvider.Assemblies.GetAllFiles("*.dll"); + + foreach (string file in files) + { + if (ShouldSkipLibrary(file)) + continue; + + foreach (AgateDriverInfo info in loader.ReportDrivers(file)) + { + switch (info.DriverType) + { + case DriverType.Display: + displayDrivers.Add(info); + break; + + case DriverType.Audio: + audioDrivers.Add(info); + break; + + case DriverType.Input: + inputDrivers.Add(info); + break; + + case DriverType.Desktop: + desktopDrivers.Add(info); + break; + + default: + Core.ErrorReporting.Report(ErrorLevel.Warning, string.Format( + "Could not interpret DriverType returned by type {0} in assembly {1}.", + info.DriverTypeName, info.AssemblyFile), null); + + break; + } + } + } + + AppDomain.Unload(sandbox); + + SortDriverInfo(displayDrivers); + SortDriverInfo(audioDrivers); + SortDriverInfo(inputDrivers); + SortDriverInfo(desktopDrivers); + + mIsInitialized = true; + } + private static void SortDriverInfo(List<AgateDriverInfo> driverList) + { + // sorts the driver list in reverse order. + driverList.Sort(delegate(AgateDriverInfo a, AgateDriverInfo b) + { + return -a.Priority.CompareTo(b.Priority); + }); + } + + private static void RegisterNullDrivers() + { + Assembly thisAssembly = Assembly.GetExecutingAssembly(); + + AgateDriverInfo nullAudioInfo = new AgateDriverInfo(AudioTypeID.Silent, + typeof(NullSoundImpl), "No audio", -100); + + nullAudioInfo.AssemblyFile = thisAssembly.CodeBase; + nullAudioInfo.AssemblyName = thisAssembly.FullName; + + audioDrivers.Add(nullAudioInfo); + + AgateDriverInfo nullInputInfo = new AgateDriverInfo(InputTypeID.Silent, + typeof(NullInputImpl), "No input", -100); + + nullInputInfo.AssemblyFile = thisAssembly.CodeBase; + nullInputInfo.AssemblyName = thisAssembly.FullName; + + inputDrivers.Add(nullInputInfo); + } + + private static bool ShouldSkipLibrary(string file) + { + // Native libraries in the same directory will give an error when loaded, + // so skip any ones that we know about that will probably be in the same + // directory as the drivers. + if (IsKnownNativeLibrary(file)) + return true; + + // hack, because mono crashes if AgateMDX.dll is present. + // annoying, because it should report a failure to load the types in the + // assembly, and then the try catch should continue after that. + // TODO: this hack seems unnecessary in recent versions of Mono. Should it be removed? + if ((Environment.OSVersion.Platform == PlatformID.Unix || + Environment.OSVersion.Platform == (PlatformID)128) && + (System.IO.Path.GetFileName(file).ToLower().Contains("agatemdx.dll") || + System.IO.Path.GetFileName(file).ToLower().Contains("agatesdx.dll"))) + { + Core.ErrorReporting.Report(ErrorLevel.Comment, + string.Format("DirectX not supported on non-Windows platforms. {0}Remove {1} to eliminate this message.", + Environment.NewLine, System.IO.Path.GetFileName(file)), null); + + return true; + } + + // Skip the agatelib dll. + if (System.IO.Path.GetFileName(file).ToLower().Contains("agatelib.dll")) + return true; + + return false; + } + private static bool IsKnownNativeLibrary(string path) + { + string filename = System.IO.Path.GetFileName(path).ToLowerInvariant(); + + for (int i = 0; i < KnownNativeLibraries.Length; i++) + { + if (KnownNativeLibraries[i].ToLowerInvariant() == filename) + return true; + } + return false; + } + + + /// <summary> + /// Asks the user to select which drivers to use. + /// </summary> + /// <param name="chooseDisplay"></param> + /// <param name="chooseAudio"></param> + /// <param name="chooseInput"></param> + /// <param name="selectedDisplay"></param> + /// <param name="selectedAudio"></param> + /// <param name="selectedInput"></param> + /// <returns></returns> + internal static bool UserSelectDrivers(bool chooseDisplay, bool chooseAudio, bool chooseInput, + DisplayTypeID preferredDisplay, AudioTypeID preferredAudio, InputTypeID preferredInput, + out DisplayTypeID selectedDisplay, out AudioTypeID selectedAudio, out InputTypeID selectedInput) + { + if (mDesktop == null) + { + CreateDesktopDriver(); + + if (mDesktop == null) + { + SelectBestDrivers(chooseDisplay, chooseAudio, chooseInput, + preferredDisplay, preferredAudio, preferredInput, + out selectedDisplay, out selectedAudio, out selectedInput); + + return true; + } + } + + IUserSetSystems frm = mDesktop.CreateUserSetSystems(); + + // set default values. + selectedDisplay = DisplayTypeID.AutoSelect; + selectedAudio = AudioTypeID.AutoSelect; + selectedInput = InputTypeID.AutoSelect; + + foreach (AgateDriverInfo info in displayDrivers) + { + frm.AddDisplayType(info); + } + foreach (AgateDriverInfo info in audioDrivers) + { + frm.AddAudioType(info); + } + foreach (AgateDriverInfo info in inputDrivers) + { + frm.AddInputType(info); + } + + frm.SetChoices(chooseDisplay, chooseAudio, chooseInput, + preferredDisplay, preferredAudio, preferredInput); + + // run the dialog asking user which drivers to use. + if (frm.RunDialog() == SetSystemsDialogResult.Cancel) + { + return false; + } + + selectedDisplay = frm.DisplayType; + selectedAudio = frm.AudioType; + selectedInput = frm.InputType; + + return true; + + } + + private static void SelectBestDrivers(bool chooseDisplay, bool chooseAudio, bool chooseInput, + DisplayTypeID preferredDisplay, AudioTypeID preferredAudio, InputTypeID preferredInput, + out DisplayTypeID selectedDisplay, out AudioTypeID selectedAudio, out InputTypeID selectedInput) + { + // initial return values if a driver isn't selected. + selectedDisplay = DisplayTypeID.AutoSelect; + selectedAudio = AudioTypeID.AutoSelect; + selectedInput = InputTypeID.AutoSelect; + + if (preferredDisplay != DisplayTypeID.AutoSelect && displayDrivers.Contains(preferredDisplay)) + selectedDisplay = preferredDisplay; + else if (displayDrivers.Count > 0) + selectedDisplay = (DisplayTypeID)displayDrivers[0].DriverTypeID; + + if (preferredAudio != AudioTypeID.AutoSelect && audioDrivers.Contains(preferredAudio)) + selectedAudio = preferredAudio; + else if (audioDrivers.Count > 0) + selectedAudio = (AudioTypeID)audioDrivers[0].DriverTypeID; + + if (preferredInput != InputTypeID.AutoSelect && inputDrivers.Contains(preferredInput)) + selectedInput = preferredInput; + else if (inputDrivers.Count > 0) + selectedInput = (InputTypeID)inputDrivers[0].DriverTypeID; + } + + private static void CreateDesktopDriver() + { + if (desktopDrivers.Count == 0) + return; + + mDesktop = (IDesktopDriver)CreateDriverInstance(desktopDrivers[0]); + } + + internal static IDesktopDriver WinForms + { + get { return mDesktop; } + } + + internal static DisplayImpl CreateDisplayDriver(DisplayTypeID displayType) + { + if (displayDrivers.Count == 0) + throw new AgateException("No display drivers registered."); + + AgateDriverInfo info = null; + string text; + + bool settingsSelect = displayType == DisplayTypeID.AutoSelect; + settingsSelect &= Core.Settings["AgateLib"].TryGetValue("DisplayDriver", out text); + + if (settingsSelect) + { + info = FindDriverInfo(displayDrivers, text); + + if (info == null) + settingsSelect = false; + } + + if (settingsSelect == false) + info = FindDriverInfo(displayDrivers, (int)displayType); + + if (info == null) throw new AgateException(string.Format("Could not find the driver {0}.", displayType)); - Core.Settings["AgateLib"]["DisplayDriver"] = info.FriendlyName; - - return (DisplayImpl)CreateDriverInstance(info); - } - internal static AudioImpl CreateAudioDriver(AudioTypeID audioType) - { - if (audioDrivers.Count == 0) - throw new AgateException("No audio drivers registered."); - - AgateDriverInfo info = null; - string text; - - bool settingsSelect = audioType == AudioTypeID.AutoSelect; - settingsSelect &= Core.Settings["AgateLib"].TryGetValue("AudioDriver", out text); - - if (settingsSelect) - { - info = FindDriverInfo(audioDrivers, text); - - if (info == null) - settingsSelect = false; - } - - if (settingsSelect == false) - info = FindDriverInfo(audioDrivers, (int)audioType); - - if (info == null) + Core.Settings["AgateLib"]["DisplayDriver"] = info.FriendlyName; + mDisplayUsed = info; + + return (DisplayImpl)CreateDriverInstance(info); + } + internal static AudioImpl CreateAudioDriver(AudioTypeID audioType) + { + if (audioDrivers.Count == 0) + throw new AgateException("No audio drivers registered."); + + AgateDriverInfo info = null; + string text; + + bool settingsSelect = audioType == AudioTypeID.AutoSelect; + settingsSelect &= Core.Settings["AgateLib"].TryGetValue("AudioDriver", out text); + + if (settingsSelect) + { + info = FindDriverInfo(audioDrivers, text); + + if (info == null) + settingsSelect = false; + } + + if (settingsSelect == false) + info = FindDriverInfo(audioDrivers, (int)audioType); + + if (info == null) throw new AgateException(string.Format("Could not find the driver {0}.", audioType)); - Core.Settings["AgateLib"]["AudioDriver"] = info.FriendlyName; - - return (AudioImpl)CreateDriverInstance(info); - } - internal static InputImpl CreateInputDriver(InputTypeID inputType) - { - if (inputDrivers.Count == 0) - throw new AgateException("No audio drivers registered."); - - AgateDriverInfo info = null; - string text; - - bool settingsSelect = inputType == InputTypeID.AutoSelect; - settingsSelect &= Core.Settings["AgateLib"].TryGetValue("InputDriver", out text); - - if (settingsSelect) - { - info = FindDriverInfo(inputDrivers, text); - - if (info == null) - settingsSelect = false; - } - - if (settingsSelect == false) - info = FindDriverInfo(inputDrivers, (int)inputType); - - if (info == null) + Core.Settings["AgateLib"]["AudioDriver"] = info.FriendlyName; + mAudioUsed = info; + + return (AudioImpl)CreateDriverInstance(info); + } + internal static InputImpl CreateInputDriver(InputTypeID inputType) + { + if (inputDrivers.Count == 0) + throw new AgateException("No audio drivers registered."); + + AgateDriverInfo info = null; + string text; + + bool settingsSelect = inputType == InputTypeID.AutoSelect; + settingsSelect &= Core.Settings["AgateLib"].TryGetValue("InputDriver", out text); + + if (settingsSelect) + { + info = FindDriverInfo(inputDrivers, text); + + if (info == null) + settingsSelect = false; + } + + if (settingsSelect == false) + info = FindDriverInfo(inputDrivers, (int)inputType); + + if (info == null) throw new AgateException(string.Format("Could not find the driver {0}.", inputType)); - Core.Settings["AgateLib"]["InputDriver"] = info.FriendlyName; - - return (InputImpl)CreateDriverInstance(info); - } - - private static AgateDriverInfo FindDriverInfo(List<AgateDriverInfo> driverList, string matchText) - { - AgateDriverInfo retval = null; - - if (driverList.Count == 0) - return null; - - foreach(AgateDriverInfo info in driverList) - { - if (info.FriendlyName.Contains(matchText)) - retval = info; - } - - return retval; - } - private static AgateDriverInfo FindDriverInfo(List<AgateDriverInfo> driverList, int typeID) - { - AgateDriverInfo theInfo = null; - - if (driverList.Count == 0) - return null; - - // autoselect ID's are all zero - if (typeID == 0) - return driverList[0]; - - foreach (AgateDriverInfo info in driverList) - { - if (info.DriverTypeID != typeID) - continue; - - theInfo = info; - } - return theInfo; - } - private static AgateDriverInfo FindDriverInfo(IEnumerable<AgateDriverInfo> driverList, string assemblyFullName) - { - AgateDriverInfo theInfo = null; - - foreach (AgateDriverInfo info in driverList) - { - if (info.AssemblyName != assemblyFullName) - continue; - - theInfo = info; - } - return theInfo; - } - - private static object CreateDriverInstance(AgateDriverInfo info) - { - Assembly ass = Assembly.Load(info.AssemblyName); - - Type driverType = ass.GetType(info.DriverTypeName, false); - - if (driverType == null) - throw new AgateException(string.Format( - "Could not find the type {0} in the library {1}.", - info.DriverTypeName, - ass.FullName)); - - return Activator.CreateInstance(driverType); - } - - private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) - { - AgateDriverInfo info = null; - - info = info ?? FindDriverInfo(displayDrivers, args.Name); - info = info ?? FindDriverInfo(audioDrivers, args.Name); - info = info ?? FindDriverInfo(inputDrivers, args.Name); - info = info ?? FindDriverInfo(desktopDrivers, args.Name); - - if (info == null) - return null; - - return LoadAssemblyLoadFrom(info); - } - - private static Assembly LoadAssemblyLoadFrom(AgateDriverInfo info) - { - Core.ErrorReporting.Report(ErrorLevel.Warning, - string.Format("Assembly {0} was loaded in the LoadFrom context. Move it to the application directory to load in the Load context.", info.AssemblyName), null); - return Assembly.LoadFrom(info.AssemblyFile); - } - - /// <summary> - /// Returns a collection with all the DriverInfo<DisplayTypeID> structures for - /// registered display drivers. - /// </summary> - /// <returns></returns> - public static List<AgateDriverInfo> DisplayDrivers - { - get { return displayDrivers; } - } - /// <summary> - /// Returns a collection with all the DriverInfo<AudioTypeID> structures for - /// registered display drivers. - /// </summary> - /// <returns></returns> - public static List<AgateDriverInfo> AudioDrivers - { - get { return audioDrivers; } - } - /// <summary> - /// Returns a collection with all the DriverInfo<InputTypeID> structures for - /// registered display drivers. - /// </summary> - /// <returns></returns> - public static List<AgateDriverInfo> InputDrivers - { - get { return inputDrivers; } - } - - - } -} + Core.Settings["AgateLib"]["InputDriver"] = info.FriendlyName; + mInputUsed = info; + + return (InputImpl)CreateDriverInstance(info); + } + + private static AgateDriverInfo FindDriverInfo(List<AgateDriverInfo> driverList, string matchText) + { + AgateDriverInfo retval = null; + + if (driverList.Count == 0) + return null; + + foreach(AgateDriverInfo info in driverList) + { + if (info.FriendlyName.Contains(matchText)) + retval = info; + } + + return retval; + } + private static AgateDriverInfo FindDriverInfo(List<AgateDriverInfo> driverList, int typeID) + { + AgateDriverInfo theInfo = null; + + if (driverList.Count == 0) + return null; + + // autoselect ID's are all zero + if (typeID == 0) + return driverList[0]; + + foreach (AgateDriverInfo info in driverList) + { + if (info.DriverTypeID != typeID) + continue; + + theInfo = info; + } + return theInfo; + } + private static AgateDriverInfo FindDriverInfo(IEnumerable<AgateDriverInfo> driverList, string assemblyFullName) + { + AgateDriverInfo theInfo = null; + + foreach (AgateDriverInfo info in driverList) + { + if (info.AssemblyName != assemblyFullName) + continue; + + theInfo = info; + } + return theInfo; + } + + private static object CreateDriverInstance(AgateDriverInfo info) + { + Assembly ass = Assembly.Load(info.AssemblyName); + + Type driverType = ass.GetType(info.DriverTypeName, false); + + if (driverType == null) + throw new AgateException(string.Format( + "Could not find the type {0} in the library {1}.", + info.DriverTypeName, + ass.FullName)); + + return Activator.CreateInstance(driverType); + } + + private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) + { + AgateDriverInfo info = null; + + info = info ?? FindDriverInfo(displayDrivers, args.Name); + info = info ?? FindDriverInfo(audioDrivers, args.Name); + info = info ?? FindDriverInfo(inputDrivers, args.Name); + info = info ?? FindDriverInfo(desktopDrivers, args.Name); + + if (info == null) + return null; + + return LoadAssemblyLoadFrom(info); + } + + private static Assembly LoadAssemblyLoadFrom(AgateDriverInfo info) + { + Core.ErrorReporting.Report(ErrorLevel.Warning, + string.Format("Assembly {0} was loaded in the LoadFrom context. Move it to the application directory to load in the Load context.", info.AssemblyName), null); + return Assembly.LoadFrom(info.AssemblyFile); + } + + /// <summary> + /// Returns a collection with all the AgateDriverInfo structures for + /// registered display drivers. + /// </summary> + /// <returns></returns> + public static List<AgateDriverInfo> DisplayDrivers + { + get { return displayDrivers; } + } + /// <summary> + /// Returns a collection with all the AgateDriverInfo structures for + /// registered display drivers. + /// </summary> + /// <returns></returns> + public static List<AgateDriverInfo> AudioDrivers + { + get { return audioDrivers; } + } + /// <summary> + /// Returns a collection with all the AgateDriverInfo structures for + /// registered display drivers. + /// </summary> + /// <returns></returns> + public static List<AgateDriverInfo> InputDrivers + { + get { return inputDrivers; } + } + + /// <summary> + /// Returns the AgateDriverInfo for the initialized display driver. + /// </summary> + public static AgateDriverInfo DisplayUsed + { + get { return mDisplayUsed; } + } + /// <summary> + /// Returns the AgateDriverInfo for the initialized audio driver. + /// </summary> + public static AgateDriverInfo AudioUsed + { + get { return mAudioUsed; } + } + /// <summary> + /// Returns the AgateDriverInfo for the initialized input driver. + /// </summary> + public static AgateDriverInfo InputUsed + { + get { return mInputUsed; } + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-24 18:20:32
|
Revision: 1333 http://agate.svn.sourceforge.net/agate/?rev=1333&view=rev Author: kanato Date: 2012-02-24 18:20:22 +0000 (Fri, 24 Feb 2012) Log Message: ----------- Implement window events in AgateSDX. Modified Paths: -------------- trunk/Drivers/AgateSDX/SDX_Display.cs trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs trunk/Tests/DisplayTests/Capabilities/frmCapabilities.cs trunk/Tests/InputTests/Input/frmInputTester.cs trunk/Tests/Tests.csproj Modified: trunk/Drivers/AgateSDX/SDX_Display.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Display.cs 2012-02-23 23:04:27 UTC (rev 1332) +++ trunk/Drivers/AgateSDX/SDX_Display.cs 2012-02-24 18:20:22 UTC (rev 1333) @@ -959,10 +959,11 @@ case RenderStateBool.ZBufferTest: return mDevice.Device.GetRenderState<bool>(RenderState.ZEnable); case RenderStateBool.StencilBufferTest: return mDevice.Device.GetRenderState<bool>(RenderState.StencilEnable); case RenderStateBool.AlphaBlend: return mDevice.AlphaBlend; + case RenderStateBool.ZBufferWrite: return mDevice.Device.GetRenderState<bool>(RenderState.ZWriteEnable); default: throw new NotSupportedException(string.Format( - "The specified render state, {0}, is not supported by this driver.")); + "The specified render state, {0}, is not supported by this driver.", renderStateBool)); } } @@ -987,6 +988,10 @@ mDevice.AlphaBlend = value; break; + case RenderStateBool.ZBufferWrite: + mDevice.Device.SetRenderState(RenderState.ZWriteEnable, value); + break; + default: throw new NotSupportedException(string.Format( "The specified render state, {0}, is not supported by this driver.")); Modified: trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs 2012-02-23 23:04:27 UTC (rev 1332) +++ trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs 2012-02-24 18:20:22 UTC (rev 1333) @@ -188,10 +188,15 @@ void form_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) { mIsClosed = true; + OnClosed(); + } void form_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) { + bool cancel = e.Cancel; + OnClosing(ref cancel); + e.Cancel = cancel; } void form_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) Modified: trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs =================================================================== --- trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs 2012-02-23 23:04:27 UTC (rev 1332) +++ trunk/Drivers/AgateSDX/Shaders/FixedFunction/SDX_FF_Basic2DShader.cs 2012-02-24 18:20:22 UTC (rev 1333) @@ -76,7 +76,16 @@ // TODO: figure out why this method sometimes gets called when mDevice is null? if (mDevice != null) - mDevice.SetTransform(TransformState.Projection, orthoProj); + { + try + { + mDevice.SetTransform(TransformState.Projection, orthoProj); + } + catch (NullReferenceException e) + { + System.Diagnostics.Debug.Print("NullReferenceException when setting transformation."); + } + } } public override void Begin() Modified: trunk/Tests/DisplayTests/Capabilities/frmCapabilities.cs =================================================================== --- trunk/Tests/DisplayTests/Capabilities/frmCapabilities.cs 2012-02-23 23:04:27 UTC (rev 1332) +++ trunk/Tests/DisplayTests/Capabilities/frmCapabilities.cs 2012-02-24 18:20:22 UTC (rev 1333) @@ -13,8 +13,10 @@ { public frmCapabilities() { - InitializeComponent(); - + InitializeComponent(); + + AgateLib.DisplayLib.DisplayWindow wind = AgateLib.DisplayLib.DisplayWindow.CreateFromControl(this); + Text += " "; Text += AgateLib.Drivers.Registrar.DisplayDrivers[0].FriendlyName; Modified: trunk/Tests/InputTests/Input/frmInputTester.cs =================================================================== --- trunk/Tests/InputTests/Input/frmInputTester.cs 2012-02-23 23:04:27 UTC (rev 1332) +++ trunk/Tests/InputTests/Input/frmInputTester.cs 2012-02-24 18:20:22 UTC (rev 1333) @@ -51,8 +51,11 @@ { FillJoystickInfo(i, joystickLabels[i]); } - + + timer1.Enabled = false; Core.KeepAlive(); + + timer1.Enabled = true; } private void FillJoystickInfo(int index, Label label) Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2012-02-23 23:04:27 UTC (rev 1332) +++ trunk/Tests/Tests.csproj 2012-02-24 18:20:22 UTC (rev 1333) @@ -490,6 +490,7 @@ </None> <None Include="Data\TestResourceFile.xml"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> + <SubType>Designer</SubType> </None> <None Include="Data\wallpaper.png"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-23 23:04:34
|
Revision: 1332 http://agate.svn.sourceforge.net/agate/?rev=1332&view=rev Author: kanato Date: 2012-02-23 23:04:27 +0000 (Thu, 23 Feb 2012) Log Message: ----------- Made registrar store audio and input drivers in settings. Modified Paths: -------------- trunk/AgateLib/Drivers/Registrar.cs Modified: trunk/AgateLib/Drivers/Registrar.cs =================================================================== --- trunk/AgateLib/Drivers/Registrar.cs 2012-02-23 22:05:25 UTC (rev 1331) +++ trunk/AgateLib/Drivers/Registrar.cs 2012-02-23 23:04:27 UTC (rev 1332) @@ -370,7 +370,9 @@ info = FindDriverInfo(audioDrivers, (int)audioType); if (info == null) - throw new AgateException(string.Format("Could not find the driver {0}.", audioType)); + throw new AgateException(string.Format("Could not find the driver {0}.", audioType)); + + Core.Settings["AgateLib"]["AudioDriver"] = info.FriendlyName; return (AudioImpl)CreateDriverInstance(info); } @@ -397,7 +399,9 @@ info = FindDriverInfo(inputDrivers, (int)inputType); if (info == null) - throw new AgateException(string.Format("Could not find the driver {0}.", inputType)); + throw new AgateException(string.Format("Could not find the driver {0}.", inputType)); + + Core.Settings["AgateLib"]["InputDriver"] = info.FriendlyName; return (InputImpl)CreateDriverInstance(info); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-23 22:05:32
|
Revision: 1331 http://agate.svn.sourceforge.net/agate/?rev=1331&view=rev Author: kanato Date: 2012-02-23 22:05:25 +0000 (Thu, 23 Feb 2012) Log Message: ----------- Add correction for CurrentWindow property of Display when the render target is changed. Fixed stack overflow issue with PersistantSettings loading. Registrar saves driver selection in settings now. SlimDX for .NET 4.0 (Jan 2012) is referenced in AgateSDX. Modified Paths: -------------- trunk/AgateLib/DisplayLib/Display.cs trunk/AgateLib/DisplayLib/DisplayWindow.cs trunk/AgateLib/DisplayLib/FrameBuffer.cs trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs trunk/AgateLib/Drivers/Registrar.cs trunk/AgateLib/Settings/PersistantSettings.cs trunk/AgateLib/Settings/SettingsGroup.cs trunk/Drivers/AgateDrawing/Drawing_Display.cs trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs trunk/Drivers/AgateOTK/ContextFB.cs trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs trunk/Drivers/AgateOTK/GL_Display.cs trunk/Drivers/AgateOTK/GL_DisplayControl.cs trunk/Drivers/AgateOTK/GL_GameWindow.cs trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs trunk/Drivers/AgateSDX/AgateSDX.csproj trunk/Drivers/AgateSDX/FrameBufferSurface.cs trunk/Drivers/AgateSDX/FrameBufferWindow.cs trunk/Drivers/AgateSDX/SDX_Display.cs trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs trunk/Tests/frmLauncher.cs Modified: trunk/AgateLib/DisplayLib/Display.cs =================================================================== --- trunk/AgateLib/DisplayLib/Display.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/DisplayLib/Display.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -196,9 +196,8 @@ sImpl.RenderTarget = value; - // TODO: replace this with an ActiveWindow property. - //if (value is DisplayWindow) - // mCurrentWindow = (DisplayWindow)value; + if (value.AttachedWindow != null) + sCurrentWindow = value.AttachedWindow; } } Modified: trunk/AgateLib/DisplayLib/DisplayWindow.cs =================================================================== --- trunk/AgateLib/DisplayLib/DisplayWindow.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/DisplayLib/DisplayWindow.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -58,14 +58,14 @@ CreateWindowParams par = CreateWindowParams.FullScreen( disp.Title, disp.Size.Width, disp.Size.Height, disp.Bpp); - mImpl = Display.Impl.CreateDisplayWindow(par); + mImpl = Display.Impl.CreateDisplayWindow(this, par); } else { CreateWindowParams par = CreateWindowParams.Windowed( disp.Title, disp.Size.Width, disp.Size.Height, disp.AllowResize, null); - mImpl = Display.Impl.CreateDisplayWindow(par); + mImpl = Display.Impl.CreateDisplayWindow(this, par); } Display.RenderTarget = FrameBuffer; @@ -83,7 +83,7 @@ "Display has not been initialized." + Environment.NewLine + "Did you forget to call AgateSetup.Initialize or Display.Initialize?"); - mImpl = Display.Impl.CreateDisplayWindow(windowParams); + mImpl = Display.Impl.CreateDisplayWindow(this, windowParams); Display.RenderTarget = FrameBuffer; Display.DisposeDisplay += new Display.DisposeDisplayHandler(Dispose); Modified: trunk/AgateLib/DisplayLib/FrameBuffer.cs =================================================================== --- trunk/AgateLib/DisplayLib/FrameBuffer.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/DisplayLib/FrameBuffer.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -117,6 +117,15 @@ } /// <summary> + /// Gets the window that this frame buffer is attached to. Returns null + /// if this FrameBuffer is not attached to any window. + /// </summary> + public DisplayWindow AttachedWindow + { + get { return Impl.AttachedWindow; } + } + + /// <summary> /// Returns true if the RenderTarget property is readable, and this surface that is /// rendered to can be used to draw from. /// </summary> Modified: trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs =================================================================== --- trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/DisplayLib/ImplementationBase/DisplayImpl.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -124,7 +124,7 @@ /// </summary> /// <param name="windowParams"></param> /// <returns></returns> - public abstract DisplayWindowImpl CreateDisplayWindow(CreateWindowParams windowParams); + public abstract DisplayWindowImpl CreateDisplayWindow(DisplayWindow owner, CreateWindowParams windowParams); /// <summary> /// Creates a SurfaceImpl derived object. Modified: trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs =================================================================== --- trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/DisplayLib/ImplementationBase/FrameBufferImpl.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -81,5 +81,11 @@ { get { throw new AgateException("Cannot access the back buffer in this frame buffer."); } } + + /// <summary> + /// Gets the window that this frame buffer is attached to. Returns null + /// if this FrameBuffer is not attached to any window. + /// </summary> + public abstract DisplayWindow AttachedWindow { get; } } } Modified: trunk/AgateLib/Drivers/Registrar.cs =================================================================== --- trunk/AgateLib/Drivers/Registrar.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/Drivers/Registrar.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -341,7 +341,9 @@ info = FindDriverInfo(displayDrivers, (int)displayType); if (info == null) - throw new AgateException(string.Format("Could not find the driver {0}.", displayType)); + throw new AgateException(string.Format("Could not find the driver {0}.", displayType)); + + Core.Settings["AgateLib"]["DisplayDriver"] = info.FriendlyName; return (DisplayImpl)CreateDriverInstance(info); } Modified: trunk/AgateLib/Settings/PersistantSettings.cs =================================================================== --- trunk/AgateLib/Settings/PersistantSettings.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/Settings/PersistantSettings.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -1,191 +1,196 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2006-2011. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using System.Xml; - -namespace AgateLib.Settings -{ - /// <summary> - /// Class which stores a simple list of persistant settings. The settings exist - /// in named groups, and within each group an individual setting is a key/value pair. - /// These settings are stored on a per-user basis. - /// </summary> - /// <remarks>On Windows Vista and up the file is stored in - /// %HOME%\AppData\Company Name\Application Name\settings.xml. - /// On Unix the file is stored at - /// $HOME/.config/Company Name/Application Name/settings.xml. - /// </remarks> - public class PersistantSettings - { - Dictionary<string, SettingsGroup> mSettings = new Dictionary<string, SettingsGroup>(); - - internal PersistantSettings() - { - LoadSettings(); - } +// The contents of this file are subject to the Mozilla Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is AgateLib. +// +// The Initial Developer of the Original Code is Erik Ylvisaker. +// Portions created by Erik Ylvisaker are Copyright (C) 2006-2011. +// All Rights Reserved. +// +// Contributor(s): Erik Ylvisaker +// +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; + +namespace AgateLib.Settings +{ + /// <summary> + /// Class which stores a simple list of persistant settings. The settings exist + /// in named groups, and within each group an individual setting is a key/value pair. + /// These settings are stored on a per-user basis. + /// </summary> + /// <remarks>On Windows Vista and up the file is stored in + /// %HOME%\AppData\Company Name\Application Name\settings.xml. + /// On Unix the file is stored at + /// $HOME/.config/Company Name/Application Name/settings.xml. + /// </remarks> + public class PersistantSettings + { + Dictionary<string, SettingsGroup> mSettings = new Dictionary<string, SettingsGroup>(); - public ISettingsTracer SettingsTracer { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this <see cref="AgateLib.Settings.PersistantSettings"/> is in - /// debugging mode. If true, every access to a setting value will be echoed to System.Diagnostics.Trace. - /// </summary> - /// <value> - /// <c>true</c> if debug; otherwise, <c>false</c>. - /// </value> - public bool Debug { get; set; } - - internal void TraceSettingsRead(string groupName, string key, string value) - { - if (Debug) - { - Trace.WriteLine(string.Format("Settings[\"{0}\"][\"{1}\"] read.", groupName, key)); - } - - if (SettingsTracer == null) return; - + #region --- Static Members --- + + public static ISettingsTracer SettingsTracer { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether PersistantSettings objects are in + /// debugging mode. If true, every access to a setting value will be echoed to System.Diagnostics.Trace. + /// </summary> + /// <value> + /// <c>true</c> if debug; otherwise, <c>false</c>. + /// </value> + public static bool Debug { get; set; } + + internal static void TraceSettingsRead(string groupName, string key, string value) + { + if (Debug) + { + Trace.WriteLine(string.Format("Settings[\"{0}\"][\"{1}\"] read.", groupName, key)); + } + + if (SettingsTracer == null) return; + SettingsTracer.OnReadSetting(groupName, key, value); } - internal void TraceSettingsWrite(string groupName, string key, string value) - { - if (Debug) - { - Trace.WriteLine(string.Format("Settings[\"{0}\"][\"{1}\"] written.", groupName, key)); - } - + internal static void TraceSettingsWrite(string groupName, string key, string value) + { + if (Debug) + { + Trace.WriteLine(string.Format("Settings[\"{0}\"][\"{1}\"] written.", groupName, key)); + } + if (SettingsTracer == null) return; - + SettingsTracer.OnWriteSetting(groupName, key, value); } - - private SettingsGroup GetOrCreateSettingsGroup(string name) - { - if (name.Contains(" ")) - throw new AgateException("Settings group name cannot contain a space."); - - if (mSettings.ContainsKey(name) == false) - { - mSettings[name] = new SettingsGroup(); - mSettings[name].Name = name; - } - - return mSettings[name]; - } - - /// <summary> - /// Gets a settings group, or creates it if it does not exist. - /// </summary> - /// <param name="name">The name of the group is case-sensitive, and must not contain any spaces - /// or special characters.</param> - /// <returns></returns> - public SettingsGroup this[string name] - { - get { return GetOrCreateSettingsGroup(name); } - } - /// <summary> - /// Gets the full path to the location where the settings file is stored. - /// </summary> - public string SettingsFilename - { - get - { - return System.IO.Path.Combine(Core.Platform.AppDataDirectory, "settings.xml"); - } - } - - /// <summary> - /// Saves the settings to the persistant storage on disk. - /// </summary> - public void SaveSettings() - { - XmlDocument doc = new XmlDocument(); - XmlElement root = doc.CreateElement("Settings"); - - foreach (string group in mSettings.Keys) - { - XmlElement groupNode = doc.CreateElement(group); - - foreach (var kvp in mSettings[group]) - { - XmlElement set = doc.CreateElement(kvp.Key); - set.InnerText = kvp.Value; - - groupNode.AppendChild(set); - } - - root.AppendChild(groupNode); - } - - doc.AppendChild(root); - - System.Diagnostics.Trace.WriteLine("Saving settings to " + SettingsFilename); - - Core.Platform.EnsureAppDataDirectoryExists(); - - doc.Save(SettingsFilename); - } - - private void LoadSettings() - { - XmlDocument doc = new XmlDocument(); - try - { - doc.Load(SettingsFilename); - } - catch (FileNotFoundException) - { - return; - } - catch (DirectoryNotFoundException) - { - return; - } - catch (XmlException e) - { - System.Diagnostics.Trace.WriteLine("Error reading settings file:" + Environment.NewLine + - e.Message); - - return; - } - XmlElement root = doc.ChildNodes[0] as XmlElement; - - if (root.Name != "Settings") - throw new AgateException("Could not understand settings file\n" + SettingsFilename + - "\nYou may need to delete it."); - - foreach (XmlElement node in root.ChildNodes) - { - SettingsGroup g = new SettingsGroup(); - - foreach (XmlElement pair in node.ChildNodes) - { - g.Add(pair.Name, pair.InnerXml); - } - - g.Name = node.Name; - mSettings.Add(node.Name, g); - } - } - } -} + + #endregion + + internal PersistantSettings() + { + LoadSettings(); + } + + + private SettingsGroup GetOrCreateSettingsGroup(string name) + { + if (name.Contains(" ")) + throw new AgateException("Settings group name cannot contain a space."); + + if (mSettings.ContainsKey(name) == false) + { + mSettings[name] = new SettingsGroup(); + mSettings[name].Name = name; + } + + return mSettings[name]; + } + + /// <summary> + /// Gets a settings group, or creates it if it does not exist. + /// </summary> + /// <param name="name">The name of the group is case-sensitive, and must not contain any spaces + /// or special characters.</param> + /// <returns></returns> + public SettingsGroup this[string name] + { + get { return GetOrCreateSettingsGroup(name); } + } + /// <summary> + /// Gets the full path to the location where the settings file is stored. + /// </summary> + public string SettingsFilename + { + get + { + return System.IO.Path.Combine(Core.Platform.AppDataDirectory, "settings.xml"); + } + } + + /// <summary> + /// Saves the settings to the persistant storage on disk. + /// </summary> + public void SaveSettings() + { + XmlDocument doc = new XmlDocument(); + XmlElement root = doc.CreateElement("Settings"); + + foreach (string group in mSettings.Keys) + { + XmlElement groupNode = doc.CreateElement(group); + + foreach (var kvp in mSettings[group]) + { + XmlElement set = doc.CreateElement(kvp.Key); + set.InnerText = kvp.Value; + + groupNode.AppendChild(set); + } + + root.AppendChild(groupNode); + } + + doc.AppendChild(root); + + System.Diagnostics.Trace.WriteLine("Saving settings to " + SettingsFilename); + + Core.Platform.EnsureAppDataDirectoryExists(); + + doc.Save(SettingsFilename); + } + + private void LoadSettings() + { + XmlDocument doc = new XmlDocument(); + try + { + doc.Load(SettingsFilename); + } + catch (FileNotFoundException) + { + return; + } + catch (DirectoryNotFoundException) + { + return; + } + catch (XmlException e) + { + System.Diagnostics.Trace.WriteLine("Error reading settings file:" + Environment.NewLine + + e.Message); + + return; + } + XmlElement root = doc.ChildNodes[0] as XmlElement; + + if (root.Name != "Settings") + throw new AgateException("Could not understand settings file\n" + SettingsFilename + + "\nYou may need to delete it."); + + foreach (XmlElement node in root.ChildNodes) + { + SettingsGroup g = new SettingsGroup(); + + foreach (XmlElement pair in node.ChildNodes) + { + g.Add(pair.Name, pair.InnerXml); + } + + g.Name = node.Name; + mSettings.Add(node.Name, g); + } + } + } +} Modified: trunk/AgateLib/Settings/SettingsGroup.cs =================================================================== --- trunk/AgateLib/Settings/SettingsGroup.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/AgateLib/Settings/SettingsGroup.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -1,198 +1,198 @@ -// The contents of this file are subject to the Mozilla Public License -// Version 1.1 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://www.mozilla.org/MPL/ -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is AgateLib. -// -// The Initial Developer of the Original Code is Erik Ylvisaker. -// Portions created by Erik Ylvisaker are Copyright (C) 2006-2011. -// All Rights Reserved. -// -// Contributor(s): Erik Ylvisaker -// -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; - -namespace AgateLib.Settings -{ - /// <summary> - /// A group of settings. This is essentially just a Dictionary object - /// where both key and value types are strings. - /// </summary> - public class SettingsGroup : IDictionary<string, string> - { - Dictionary<string, string> mStore = new Dictionary<string, string>(); - - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value> - /// The name. - /// </value> - public string Name { get; internal set; } - - - /// <summary> - /// Returns true if this settings group has no members. - /// </summary> - public bool IsEmpty - { - get { return Count == 0; } - } - - #region --- IDictionary<string,string> Members --- - - /// <summary> - /// Adds a setting to the group. - /// </summary> - /// <param name="key"></param> - /// <param name="value"></param> - public void Add(string key, string value) - { - Core.Settings.TraceSettingsWrite(Name, key, value); - - mStore.Add(key, value); - } - - /// <summary> - /// Returns whether or not the specified key is present. - /// </summary> - /// <param name="key"></param> - /// <returns></returns> - public bool ContainsKey(string key) +// The contents of this file are subject to the Mozilla Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is AgateLib. +// +// The Initial Developer of the Original Code is Erik Ylvisaker. +// Portions created by Erik Ylvisaker are Copyright (C) 2006-2011. +// All Rights Reserved. +// +// Contributor(s): Erik Ylvisaker +// +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; + +namespace AgateLib.Settings +{ + /// <summary> + /// A group of settings. This is essentially just a Dictionary object + /// where both key and value types are strings. + /// </summary> + public class SettingsGroup : IDictionary<string, string> + { + Dictionary<string, string> mStore = new Dictionary<string, string>(); + + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value> + /// The name. + /// </value> + public string Name { get; internal set; } + + + /// <summary> + /// Returns true if this settings group has no members. + /// </summary> + public bool IsEmpty { - Core.Settings.TraceSettingsRead(Name, key, (mStore.ContainsKey(key) ? mStore[key] : null)); - - return mStore.ContainsKey(key); - } - - /// <summary> - /// Gets the collection of keys. - /// </summary> - public ICollection<string> Keys - { - get { return mStore.Keys; } - } - - /// <summary> - /// Removes a key/value pair. - /// </summary> - /// <param name="key"></param> - /// <returns></returns> - public bool Remove(string key) - { - return mStore.Remove(key); - } - /// <summary> - /// Trys to get a value from the SettingsGroup. - /// </summary> - /// <param name="key"></param> - /// <param name="value"></param> - /// <returns></returns> - public bool TryGetValue(string key, out string value) - { - Core.Settings.TraceSettingsRead(Name, key, (mStore.ContainsKey(key) ? mStore[key] : null)); - - return mStore.TryGetValue(key, out value); - } - - /// <summary> - /// Gets a collection of the values. - /// </summary> - public ICollection<string> Values - { - get { return mStore.Values; } - } - - /// <summary> - /// Gets or sets a value in the SettingsGroup. - /// </summary> - /// <param name="key"></param> - /// <returns></returns> - public string this[string key] - { - get + get { return Count == 0; } + } + + #region --- IDictionary<string,string> Members --- + + /// <summary> + /// Adds a setting to the group. + /// </summary> + /// <param name="key"></param> + /// <param name="value"></param> + public void Add(string key, string value) + { + PersistantSettings.TraceSettingsWrite(Name, key, value); + + mStore.Add(key, value); + } + + /// <summary> + /// Returns whether or not the specified key is present. + /// </summary> + /// <param name="key"></param> + /// <returns></returns> + public bool ContainsKey(string key) + { + PersistantSettings.TraceSettingsRead(Name, key, (mStore.ContainsKey(key) ? mStore[key] : null)); + + return mStore.ContainsKey(key); + } + + /// <summary> + /// Gets the collection of keys. + /// </summary> + public ICollection<string> Keys + { + get { return mStore.Keys; } + } + + /// <summary> + /// Removes a key/value pair. + /// </summary> + /// <param name="key"></param> + /// <returns></returns> + public bool Remove(string key) + { + return mStore.Remove(key); + } + /// <summary> + /// Trys to get a value from the SettingsGroup. + /// </summary> + /// <param name="key"></param> + /// <param name="value"></param> + /// <returns></returns> + public bool TryGetValue(string key, out string value) + { + PersistantSettings.TraceSettingsRead(Name, key, (mStore.ContainsKey(key) ? mStore[key] : null)); + + return mStore.TryGetValue(key, out value); + } + + /// <summary> + /// Gets a collection of the values. + /// </summary> + public ICollection<string> Values + { + get { return mStore.Values; } + } + + /// <summary> + /// Gets or sets a value in the SettingsGroup. + /// </summary> + /// <param name="key"></param> + /// <returns></returns> + public string this[string key] + { + get { - Core.Settings.TraceSettingsRead(Name, key, (mStore.ContainsKey(key) ? mStore[key] : null)); - - return mStore[key]; - } - set + PersistantSettings.TraceSettingsRead(Name, key, (mStore.ContainsKey(key) ? mStore[key] : null)); + + return mStore[key]; + } + set { - Core.Settings.TraceSettingsWrite(Name, key, value); - - mStore[key] = value; - } - } - - #endregion - #region --- ICollection<KeyValuePair<string,string>> Members --- - - /// <summary> - /// Returns the number of settings in the group. - /// </summary> - public int Count - { - get { return mStore.Count; } - } - /// <summary> - /// Clears the settings from the group. - /// </summary> - public void Clear() - { - mStore.Clear(); - } - - void ICollection<KeyValuePair<string, string>>.Add(KeyValuePair<string, string> item) - { - Add(item.Key, item.Value); - } - void ICollection<KeyValuePair<string, string>>.CopyTo(KeyValuePair<string, string>[] array, int arrayIndex) - { - ((ICollection<KeyValuePair<string, string>>)mStore).CopyTo(array, arrayIndex); - } - bool ICollection<KeyValuePair<string, string>>.Contains(KeyValuePair<string, string> item) - { - return ((ICollection<KeyValuePair<string, string>>)mStore).Contains(item); - } - bool ICollection<KeyValuePair<string, string>>.IsReadOnly - { - get { return false; } - } - bool ICollection<KeyValuePair<string, string>>.Remove(KeyValuePair<string, string> item) - { - return Remove(item.Key); - } - - #endregion - #region --- IEnumerable<KeyValuePair<string,string>> Members --- - - /// <summary> - /// Enumerates the KeyValuePair objects. - /// </summary> - /// <returns></returns> - public IEnumerator<KeyValuePair<string, string>> GetEnumerator() - { - return mStore.GetEnumerator(); - } - - #endregion - #region --- IEnumerable Members --- - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - #endregion - } -} + PersistantSettings.TraceSettingsWrite(Name, key, value); + + mStore[key] = value; + } + } + + #endregion + #region --- ICollection<KeyValuePair<string,string>> Members --- + + /// <summary> + /// Returns the number of settings in the group. + /// </summary> + public int Count + { + get { return mStore.Count; } + } + /// <summary> + /// Clears the settings from the group. + /// </summary> + public void Clear() + { + mStore.Clear(); + } + + void ICollection<KeyValuePair<string, string>>.Add(KeyValuePair<string, string> item) + { + Add(item.Key, item.Value); + } + void ICollection<KeyValuePair<string, string>>.CopyTo(KeyValuePair<string, string>[] array, int arrayIndex) + { + ((ICollection<KeyValuePair<string, string>>)mStore).CopyTo(array, arrayIndex); + } + bool ICollection<KeyValuePair<string, string>>.Contains(KeyValuePair<string, string> item) + { + return ((ICollection<KeyValuePair<string, string>>)mStore).Contains(item); + } + bool ICollection<KeyValuePair<string, string>>.IsReadOnly + { + get { return false; } + } + bool ICollection<KeyValuePair<string, string>>.Remove(KeyValuePair<string, string> item) + { + return Remove(item.Key); + } + + #endregion + #region --- IEnumerable<KeyValuePair<string,string>> Members --- + + /// <summary> + /// Enumerates the KeyValuePair objects. + /// </summary> + /// <returns></returns> + public IEnumerator<KeyValuePair<string, string>> GetEnumerator() + { + return mStore.GetEnumerator(); + } + + #endregion + #region --- IEnumerable Members --- + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + #endregion + } +} Modified: trunk/Drivers/AgateDrawing/Drawing_Display.cs =================================================================== --- trunk/Drivers/AgateDrawing/Drawing_Display.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateDrawing/Drawing_Display.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -106,9 +106,9 @@ { return new Drawing_Surface(surfaceSize); } - public override DisplayWindowImpl CreateDisplayWindow(CreateWindowParams windowParams) + public override DisplayWindowImpl CreateDisplayWindow(DisplayWindow owner, CreateWindowParams windowParams) { - return new Drawing_DisplayWindow(windowParams); + return new Drawing_DisplayWindow(owner, windowParams); } public override FontSurfaceImpl CreateFont(string fontFamily, float sizeInPoints, FontStyle style) { Modified: trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs =================================================================== --- trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -40,9 +40,12 @@ Icon mIcon; Bitmap mBackBuffer; + DisplayWindow mOwner; - public Drawing_DisplayWindow(CreateWindowParams windowParams) + public Drawing_DisplayWindow(DisplayWindow owner, CreateWindowParams windowParams) { + mOwner = owner; + if (windowParams.RenderToControl == true) { if (typeof(Control).IsAssignableFrom(windowParams.RenderTarget.GetType()) == false) @@ -78,6 +81,8 @@ mFrameBuffer = new Drawing_FrameBuffer(mBackBuffer); mFrameBuffer.EndRenderEvent += new EventHandler(mFrameBuffer_EndRenderEvent); + mFrameBuffer.mAttachedWindow = mOwner; + } void mFrameBuffer_EndRenderEvent(object sender, EventArgs e) Modified: trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs =================================================================== --- trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -30,6 +30,7 @@ class Drawing_FrameBuffer: FrameBufferImpl { Bitmap backBuffer; + internal AgateLib.DisplayLib.DisplayWindow mAttachedWindow; public Drawing_FrameBuffer(Size size) { @@ -83,8 +84,12 @@ { get { return new Drawing_Surface(backBuffer, new System.Drawing.Rectangle(System.Drawing.Point.Empty, backBuffer.Size)); } } + + public override AgateLib.DisplayLib.DisplayWindow AttachedWindow + { + get { return mAttachedWindow; } + } - public event EventHandler EndRenderEvent; } } Modified: trunk/Drivers/AgateOTK/ContextFB.cs =================================================================== --- trunk/Drivers/AgateOTK/ContextFB.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateOTK/ContextFB.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -32,6 +32,7 @@ IGraphicsContext mContext; IWindowInfo mWindowInfo; Size mSize; + internal AgateLib.DisplayLib.DisplayWindow mAttachedWindow; public ContextFB(IGraphicsContext context, IWindowInfo window, Size size, bool depthBuffer, bool stencilBuffer) @@ -58,7 +59,10 @@ mSize = size; } - + public override AgateLib.DisplayLib.DisplayWindow AttachedWindow + { + get { return mAttachedWindow; } + } public override void MakeCurrent() { if (mContext.IsCurrent == false) Modified: trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs =================================================================== --- trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -121,5 +121,29 @@ { GL.BindFramebuffer(FramebufferTarget.Framebuffer, mFramebufferID); } + + public override AgateLib.DisplayLib.DisplayWindow AttachedWindow + { + get { return null; } + } + public override bool CanAccessRenderTarget + { + get { return true; } + } + + public override bool HasDepthBuffer + { + get + { + return mHasDepth; + } + } + public override bool HasStencilBuffer + { + get + { + return mHasStencil; + } + } } } Modified: trunk/Drivers/AgateOTK/GL_Display.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Display.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateOTK/GL_Display.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -98,12 +98,12 @@ { return ShaderFactory.CreateBuiltInShader(builtInShaderType); } - public override DisplayWindowImpl CreateDisplayWindow(CreateWindowParams windowParams) + public override DisplayWindowImpl CreateDisplayWindow(DisplayWindow owner, CreateWindowParams windowParams) { if (windowParams.IsFullScreen && windowParams.RenderToControl == false) - return new GL_GameWindow(windowParams); + return new GL_GameWindow(owner, windowParams); else - return new GL_DisplayControl(windowParams); + return new GL_DisplayControl(owner, windowParams); //if (windowParams.RenderToControl) //{ Modified: trunk/Drivers/AgateOTK/GL_DisplayControl.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_DisplayControl.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateOTK/GL_DisplayControl.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -44,6 +44,7 @@ /// </summary> public sealed class GL_DisplayControl : DisplayWindowImpl { + DisplayWindow mOwner; Form frm; Control mRenderTarget; IGraphicsContext mContext; @@ -70,8 +71,9 @@ { get { return mFrameBuffer; } } - public GL_DisplayControl(CreateWindowParams windowParams) + public GL_DisplayControl(DisplayWindow owner, CreateWindowParams windowParams) { + mOwner = owner; mChoosePosition = windowParams.WindowPosition; if (windowParams.RenderToControl) @@ -226,6 +228,7 @@ (mContext as IGraphicsContextInternal).LoadAll(); mFrameBuffer = new ContextFB(mContext, mWindowInfo, this.Size, true, false); + mFrameBuffer.mAttachedWindow = mOwner; } private IWindowInfo CreateWindowInfo(GraphicsMode mode) Modified: trunk/Drivers/AgateOTK/GL_GameWindow.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_GameWindow.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateOTK/GL_GameWindow.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -178,9 +178,11 @@ WindowPosition mCreatePosition; GLDrawBuffer mDrawBuffer; ContextFB mFrameBuffer; + DisplayWindow mOwner; - public GL_GameWindow(CreateWindowParams windowParams) + public GL_GameWindow(DisplayWindow owner, CreateWindowParams windowParams) { + mOwner = owner; mCreatePosition = windowParams.WindowPosition; if (string.IsNullOrEmpty(windowParams.IconFile) == false) @@ -201,6 +203,7 @@ mFrameBuffer = new ContextFB(mWindow.Context, mWindow.WindowInfo, new Size(mWindow.ClientSize.Width, mWindow.ClientSize.Height), true, false); + mFrameBuffer.mAttachedWindow = mOwner; mDisplay = Display.Impl as GL_Display; Modified: trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -29,7 +29,7 @@ namespace AgateOTK.Legacy { - class FrameBufferExt : GL_FrameBuffer + class FrameBufferExt : GL_FrameBuffer { Size mSize; int mFramebufferID; @@ -119,7 +119,7 @@ GL.Ext.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.DepthComponent24, mSize.Width, mSize.Height); - + // attach the depth buffer GL.Ext.FramebufferRenderbuffer(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, RenderbufferTarget.Renderbuffer, @@ -203,5 +203,18 @@ { GL.Ext.BindFramebuffer(FramebufferTarget.FramebufferExt, mFramebufferID); } + + public override AgateLib.DisplayLib.DisplayWindow AttachedWindow + { + get { return null; } + } + public override bool HasDepthBuffer + { + get { return mHasDepth; } + } + public override bool HasStencilBuffer + { + get { return mHasStencil; } + } } } Modified: trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -101,5 +101,10 @@ return surface; } } + + public override DisplayWindow AttachedWindow + { + get { return null; } + } } } Modified: trunk/Drivers/AgateSDX/AgateSDX.csproj =================================================================== --- trunk/Drivers/AgateSDX/AgateSDX.csproj 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateSDX/AgateSDX.csproj 2012-02-23 22:05:25 UTC (rev 1331) @@ -106,7 +106,7 @@ <PlatformTarget>x64</PlatformTarget> </PropertyGroup> <ItemGroup> - <Reference Include="SlimDX, Version=2.0.12.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86" /> + <Reference Include="SlimDX, Version=4.0.13.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86" /> <Reference Include="System"> <Name>System</Name> </Reference> Modified: trunk/Drivers/AgateSDX/FrameBufferSurface.cs =================================================================== --- trunk/Drivers/AgateSDX/FrameBufferSurface.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateSDX/FrameBufferSurface.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -102,5 +102,13 @@ return mAgateSurface; } } + + public override DisplayWindow AttachedWindow + { + get + { + return null; + } + } } } Modified: trunk/Drivers/AgateSDX/FrameBufferWindow.cs =================================================================== --- trunk/Drivers/AgateSDX/FrameBufferWindow.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateSDX/FrameBufferWindow.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -30,15 +30,17 @@ { class FrameBufferWindow : SDX_FrameBuffer { + AgateLib.DisplayLib.DisplayWindow mAttachedWindow; SDX_Display mDisplay; SwapChain mSwap; Direct3D.Surface mBackBuffer; Direct3D.Surface mBackDepthStencil; Size mSize; - public FrameBufferWindow(Size size, SwapChain swap, Direct3D.Surface backBuffer, Direct3D.Surface backDepthStencil) + public FrameBufferWindow(Size size, SwapChain swap, AgateLib.DisplayLib.DisplayWindow attachedWindow, Direct3D.Surface backBuffer, Direct3D.Surface backDepthStencil) { mDisplay = (SDX_Display)AgateLib.DisplayLib.Display.Impl; + mAttachedWindow = attachedWindow; mSize = size; mSwap = swap; @@ -81,5 +83,10 @@ mSwap.Present(Present.None); } + + public override AgateLib.DisplayLib.DisplayWindow AttachedWindow + { + get { return mAttachedWindow; } + } } } Modified: trunk/Drivers/AgateSDX/SDX_Display.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Display.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateSDX/SDX_Display.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -265,9 +265,9 @@ { return Shaders.ShaderFactory.CreateBuiltInShader(builtInShaderType); } - public override DisplayWindowImpl CreateDisplayWindow(CreateWindowParams windowParams) + public override DisplayWindowImpl CreateDisplayWindow(DisplayWindow owner, CreateWindowParams windowParams) { - return new SDX_DisplayWindow(windowParams); + return new SDX_DisplayWindow(owner, windowParams); } public override SurfaceImpl CreateSurface(string fileName) { Modified: trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Drivers/AgateSDX/SDX_DisplayWindow.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -36,6 +36,7 @@ { public class SDX_DisplayWindow : DisplayWindowImpl { + DisplayWindow mOwner; Form frm; Control mRenderTarget; bool mIsClosed = false; @@ -57,9 +58,10 @@ #region --- Creation / Destruction --- - public SDX_DisplayWindow(CreateWindowParams windowParams) + public SDX_DisplayWindow(DisplayWindow owner, CreateWindowParams windowParams) { mChoosePosition = windowParams.WindowPosition; + mOwner = owner; if (windowParams.RenderToControl) { @@ -365,7 +367,7 @@ mDisplay.DepthStencilFormat, MultisampleType.None, 0, true); - mFrameBuffer = new FrameBufferWindow(Size, swap, backBuffer, backDepthStencil); + mFrameBuffer = new FrameBufferWindow(Size, swap, mOwner, backBuffer, backDepthStencil); mRenderTarget.Resize += new EventHandler(mRenderTarget_Resize); } Modified: trunk/Tests/frmLauncher.cs =================================================================== --- trunk/Tests/frmLauncher.cs 2012-02-20 02:05:27 UTC (rev 1330) +++ trunk/Tests/frmLauncher.cs 2012-02-23 22:05:25 UTC (rev 1331) @@ -35,8 +35,8 @@ ReadSettingsNames(); - AgateLib.Core.Settings.SettingsTracer = this; - AgateLib.Core.Settings.Debug = true; + AgateLib.Settings.PersistantSettings.SettingsTracer = this; + AgateLib.Settings.PersistantSettings.Debug = true; FillDrivers(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-20 02:05:36
|
Revision: 1330 http://agate.svn.sourceforge.net/agate/?rev=1330&view=rev Author: kanato Date: 2012-02-20 02:05:27 +0000 (Mon, 20 Feb 2012) Log Message: ----------- Add option to enforce monospace numbers in font generation. Correct calculation of text width. Modified Paths: -------------- trunk/AgateLib/BitmapFont/BitmapFontImpl.cs trunk/AgateLib/BitmapFont/BitmapFontOptions.cs trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs trunk/Tests/Data/TestResourceFile.xml trunk/Tests/Tests.csproj trunk/Tools/FontCreator/CreateFont.Designer.cs trunk/Tools/FontCreator/CreateFont.cs trunk/Tools/FontCreator/CreateFont.resx Added Paths: ----------- trunk/Tests/Data/fonts/MedievalSharp14.png trunk/Tests/Data/fonts/MedievalSharp18.png trunk/Tests/Data/fonts/MedievalSharpBold14.png trunk/Tests/Data/fonts/MedievalSharpBold18.png trunk/Tests/Data/fonts/MedievalSharpBold22.png trunk/Tests/Fonts/FontAlignment.cs Modified: trunk/AgateLib/BitmapFont/BitmapFontImpl.cs =================================================================== --- trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2012-02-17 02:25:24 UTC (rev 1329) +++ trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2012-02-20 02:05:27 UTC (rev 1330) @@ -210,7 +210,7 @@ if (mFontMetrics.ContainsKey(line[j]) == false) continue; - lineWidth += mFontMetrics[line[j]].Width; + lineWidth += mFontMetrics[line[j]].LayoutWidth; } if (lineWidth > highestLineWidth) Modified: trunk/AgateLib/BitmapFont/BitmapFontOptions.cs =================================================================== --- trunk/AgateLib/BitmapFont/BitmapFontOptions.cs 2012-02-17 02:25:24 UTC (rev 1329) +++ trunk/AgateLib/BitmapFont/BitmapFontOptions.cs 2012-02-20 02:05:27 UTC (rev 1330) @@ -96,6 +96,7 @@ private FontStyle mStyle; private bool mUseTextRenderer = true; private bool mCreateBorder; + private bool mMonospaceNumbers = true; private Color mBorderColor = Color.FromArgb(128, Color.Black); private BitmapFontEdgeOptions mEdgeOptions; private List<CharacterRange> mRanges = new List<CharacterRange>(); @@ -288,6 +289,21 @@ /// Indicates how much to increase the bottom margin of letters. Can be negative. /// </summary> public int BottomMarginAdjust { get; set; } + + /// <summary> + /// Set to true to force the digits 0-9 to be generated at the same width. + /// </summary> + public bool MonospaceNumbers + { + get { return mMonospaceNumbers; } + set { mMonospaceNumbers = value; } + } + + /// <summary> + /// Gets or sets the number of pixels the width of numbers is to be increased or decreased. + /// This value is only used if MonospaceNumbers is enabled. + /// </summary> + public int NumberWidthAdjust { get; set; } } } Modified: trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs 2012-02-17 02:25:24 UTC (rev 1329) +++ trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs 2012-02-20 02:05:27 UTC (rev 1330) @@ -99,6 +99,7 @@ int x = rend.Padding, y = 2; int height = 0; char lastChar = ' '; + int digitWidth = 0; // first measure the required height of the image. foreach (BitmapFontOptions.CharacterRange range in options.CharacterRanges) @@ -134,6 +135,9 @@ glyphs[i] = new GlyphMetrics(new Rectangle(0, 0, sourceSize.Width, sourceSize.Height)); + if ('0' <= i && i <= '9') + digitWidth = Math.Max(digitWidth, sourceSize.Width); + lastChar = i; } } @@ -189,11 +193,11 @@ if (font.SizeInPoints >= 14.0) { - glyphs[i].LeftOverhang = 1; - glyphs[i].RightOverhang = 1; + glyphs[i].LeftOverhang += 1; + glyphs[i].RightOverhang += 1; } else - glyphs[i].RightOverhang = 1; + glyphs[i].RightOverhang += 1; } else @@ -215,6 +219,22 @@ rend.ModifyMetrics(glyphs, g); + if (options.MonospaceNumbers) + { + digitWidth += options.NumberWidthAdjust; + + for (char i = '0'; i <= '9'; i++) + { + int delta = digitWidth - glyphs[i].Width; + + int leftShift = -delta / 2; + int rightShift = -delta - leftShift; + + glyphs[i].LeftOverhang = leftShift; + glyphs[i].RightOverhang = rightShift; + } + } + g.Dispose(); // do post processing of chars. Modified: trunk/Tests/Data/TestResourceFile.xml =================================================================== --- trunk/Tests/Data/TestResourceFile.xml 2012-02-17 02:25:24 UTC (rev 1329) +++ trunk/Tests/Data/TestResourceFile.xml 2012-02-20 02:05:27 UTC (rev 1330) @@ -120,4 +120,974 @@ <Glyph char="126" source="{X=127,Y=110,Width=11,Height=24}" leftOverhang="1" rightOverhang="1" /> </Metrics> </BitmapFont> + <BitmapFont name="MedievalSharp18" image="fonts/MedievalSharp18.png"> + <Metrics> + <Glyph char="32" source="{X=0,Y=2,Width=8,Height=34}" rightOverhang="1" /> + <Glyph char="33" source="{X=10,Y=2,Width=8,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="34" source="{X=20,Y=2,Width=11,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="35" source="{X=33,Y=2,Width=18,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="36" source="{X=53,Y=2,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="37" source="{X=70,Y=2,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="38" source="{X=91,Y=2,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="39" source="{X=110,Y=2,Width=7,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="40" source="{X=119,Y=2,Width=11,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="41" source="{X=132,Y=2,Width=11,Height=34}" rightOverhang="1" /> + <Glyph char="42" source="{X=145,Y=2,Width=16,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="43" source="{X=163,Y=2,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="44" source="{X=181,Y=2,Width=8,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="45" source="{X=191,Y=2,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="46" source="{X=209,Y=2,Width=7,Height=34}" rightOverhang="1" /> + <Glyph char="47" source="{X=218,Y=2,Width=14,Height=34}" rightOverhang="1" /> + <Glyph char="48" source="{X=234,Y=2,Width=17,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="49" source="{X=0,Y=39,Width=10,Height=34}" leftOverhang="-2" rightOverhang="-2" /> + <Glyph char="50" source="{X=12,Y=39,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="51" source="{X=29,Y=39,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="52" source="{X=46,Y=39,Width=16,Height=34}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="53" source="{X=64,Y=39,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="54" source="{X=81,Y=39,Width=16,Height=34}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="55" source="{X=99,Y=39,Width=13,Height=34}" rightOverhang="-1" /> + <Glyph char="56" source="{X=114,Y=39,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="57" source="{X=131,Y=39,Width=16,Height=34}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="58" source="{X=149,Y=39,Width=7,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="59" source="{X=158,Y=39,Width=8,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="60" source="{X=168,Y=39,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="61" source="{X=187,Y=39,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="62" source="{X=205,Y=39,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="63" source="{X=224,Y=39,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="64" source="{X=241,Y=39,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="65" source="{X=0,Y=76,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="66" source="{X=18,Y=76,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="67" source="{X=37,Y=76,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="68" source="{X=55,Y=76,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="69" source="{X=75,Y=76,Width=14,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="70" source="{X=91,Y=76,Width=13,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="71" source="{X=106,Y=76,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="72" source="{X=125,Y=76,Width=17,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="73" source="{X=144,Y=76,Width=8,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="74" source="{X=154,Y=76,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="75" source="{X=171,Y=76,Width=16,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="76" source="{X=189,Y=76,Width=15,Height=34}" leftOverhang="-2" rightOverhang="5" /> + <Glyph char="77" source="{X=206,Y=76,Width=21,Height=34}" rightOverhang="1" /> + <Glyph char="78" source="{X=229,Y=76,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="79" source="{X=0,Y=113,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="80" source="{X=19,Y=113,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="81" source="{X=38,Y=113,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="82" source="{X=57,Y=113,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="83" source="{X=76,Y=113,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="84" source="{X=93,Y=113,Width=14,Height=34}" rightOverhang="1" /> + <Glyph char="85" source="{X=109,Y=113,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="86" source="{X=129,Y=113,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="87" source="{X=147,Y=113,Width=22,Height=34}" rightOverhang="1" /> + <Glyph char="88" source="{X=171,Y=113,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="89" source="{X=188,Y=113,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="90" source="{X=205,Y=113,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="91" source="{X=222,Y=113,Width=11,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="92" source="{X=235,Y=113,Width=14,Height=34}" rightOverhang="1" /> + <Glyph char="93" source="{X=0,Y=150,Width=11,Height=34}" rightOverhang="1" /> + <Glyph char="94" source="{X=13,Y=150,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="95" source="{X=32,Y=150,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="96" source="{X=50,Y=150,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="97" source="{X=61,Y=150,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="98" source="{X=77,Y=150,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="99" source="{X=94,Y=150,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="100" source="{X=109,Y=150,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="101" source="{X=125,Y=150,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="102" source="{X=140,Y=150,Width=13,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="103" source="{X=155,Y=150,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="104" source="{X=172,Y=150,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="105" source="{X=189,Y=150,Width=7,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="106" source="{X=198,Y=150,Width=9,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="107" source="{X=209,Y=150,Width=15,Height=34}" leftOverhang="-1" rightOverhang="4" /> + <Glyph char="108" source="{X=226,Y=150,Width=7,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="109" source="{X=0,Y=187,Width=22,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="110" source="{X=24,Y=187,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="111" source="{X=41,Y=187,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="112" source="{X=57,Y=187,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="113" source="{X=73,Y=187,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="114" source="{X=90,Y=187,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="115" source="{X=105,Y=187,Width=12,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="116" source="{X=119,Y=187,Width=10,Height=34}" rightOverhang="1" /> + <Glyph char="117" source="{X=131,Y=187,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="118" source="{X=148,Y=187,Width=13,Height=34}" rightOverhang="1" /> + <Glyph char="119" source="{X=163,Y=187,Width=22,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="120" source="{X=187,Y=187,Width=14,Height=34}" rightOverhang="3" /> + <Glyph char="121" source="{X=203,Y=187,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="122" source="{X=220,Y=187,Width=12,Height=34}" rightOverhang="1" /> + <Glyph char="123" source="{X=234,Y=187,Width=13,Height=34}" rightOverhang="1" /> + <Glyph char="124" source="{X=0,Y=224,Width=8,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="125" source="{X=10,Y=224,Width=13,Height=34}" rightOverhang="1" /> + <Glyph char="126" source="{X=25,Y=224,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="161" source="{X=42,Y=224,Width=8,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="162" source="{X=52,Y=224,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="163" source="{X=67,Y=224,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="164" source="{X=84,Y=224,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="165" source="{X=105,Y=224,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="166" source="{X=123,Y=224,Width=9,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="167" source="{X=134,Y=224,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="168" source="{X=150,Y=224,Width=11,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="169" source="{X=163,Y=224,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="170" source="{X=182,Y=224,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="171" source="{X=197,Y=224,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="172" source="{X=218,Y=224,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="173" source="{X=236,Y=224,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="174" source="{X=0,Y=261,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="175" source="{X=19,Y=261,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="176" source="{X=37,Y=261,Width=11,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="177" source="{X=50,Y=261,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="178" source="{X=68,Y=261,Width=11,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="179" source="{X=81,Y=261,Width=11,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="180" source="{X=94,Y=261,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="181" source="{X=105,Y=261,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="182" source="{X=122,Y=261,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="183" source="{X=137,Y=261,Width=7,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="184" source="{X=146,Y=261,Width=8,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="185" source="{X=156,Y=261,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="186" source="{X=167,Y=261,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="187" source="{X=182,Y=261,Width=19,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="188" source="{X=203,Y=261,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="189" source="{X=223,Y=261,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="190" source="{X=0,Y=298,Width=20,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="191" source="{X=22,Y=298,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="192" source="{X=39,Y=298,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="193" source="{X=57,Y=298,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="194" source="{X=75,Y=298,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="195" source="{X=93,Y=298,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="196" source="{X=111,Y=298,Width=18,Height=34}" rightOverhang="3" /> + <Glyph char="197" source="{X=131,Y=298,Width=18,Height=34}" rightOverhang="3" /> + <Glyph char="198" source="{X=151,Y=298,Width=22,Height=34}" rightOverhang="1" /> + <Glyph char="199" source="{X=175,Y=298,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="200" source="{X=193,Y=298,Width=14,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="201" source="{X=209,Y=298,Width=14,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="202" source="{X=225,Y=298,Width=14,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="203" source="{X=241,Y=298,Width=14,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="204" source="{X=0,Y=335,Width=8,Height=34}" rightOverhang="1" /> + <Glyph char="205" source="{X=10,Y=335,Width=8,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="206" source="{X=20,Y=335,Width=8,Height=34}" rightOverhang="1" /> + <Glyph char="207" source="{X=30,Y=335,Width=8,Height=34}" rightOverhang="1" /> + <Glyph char="208" source="{X=40,Y=335,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="209" source="{X=60,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="210" source="{X=79,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="211" source="{X=98,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="212" source="{X=117,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="213" source="{X=136,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="214" source="{X=155,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="215" source="{X=174,Y=335,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="216" source="{X=190,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="217" source="{X=209,Y=335,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="218" source="{X=229,Y=335,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="219" source="{X=0,Y=372,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="220" source="{X=20,Y=372,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="221" source="{X=40,Y=372,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="222" source="{X=57,Y=372,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="223" source="{X=74,Y=372,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="224" source="{X=91,Y=372,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="225" source="{X=107,Y=372,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="226" source="{X=123,Y=372,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="227" source="{X=139,Y=372,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="228" source="{X=155,Y=372,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="229" source="{X=171,Y=372,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="230" source="{X=187,Y=372,Width=21,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="231" source="{X=210,Y=372,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="232" source="{X=225,Y=372,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="233" source="{X=240,Y=372,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="234" source="{X=0,Y=409,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="235" source="{X=15,Y=409,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="236" source="{X=30,Y=409,Width=9,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="237" source="{X=41,Y=409,Width=9,Height=34}" leftOverhang="-1" rightOverhang="4" /> + <Glyph char="238" source="{X=52,Y=409,Width=7,Height=34}" rightOverhang="1" /> + <Glyph char="239" source="{X=61,Y=409,Width=7,Height=34}" rightOverhang="1" /> + <Glyph char="240" source="{X=70,Y=409,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="241" source="{X=87,Y=409,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="242" source="{X=104,Y=409,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="243" source="{X=120,Y=409,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="244" source="{X=136,Y=409,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="245" source="{X=152,Y=409,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="246" source="{X=168,Y=409,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="247" source="{X=184,Y=409,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="248" source="{X=202,Y=409,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="249" source="{X=218,Y=409,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="250" source="{X=235,Y=409,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="251" source="{X=0,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="252" source="{X=17,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="253" source="{X=34,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="254" source="{X=51,Y=446,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="255" source="{X=67,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + </Metrics> + </BitmapFont> + <BitmapFont name="MedievalSharp14" image="fonts/MedievalSharp14.png"> + <Metrics> + <Glyph char="32" source="{X=0,Y=2,Width=7,Height=27}" rightOverhang="1" /> + <Glyph char="33" source="{X=9,Y=2,Width=7,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="34" source="{X=18,Y=2,Width=9,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="35" source="{X=29,Y=2,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="36" source="{X=45,Y=2,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="37" source="{X=59,Y=2,Width=15,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="38" source="{X=76,Y=2,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="39" source="{X=92,Y=2,Width=6,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="40" source="{X=100,Y=2,Width=9,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="41" source="{X=111,Y=2,Width=9,Height=27}" rightOverhang="1" /> + <Glyph char="42" source="{X=122,Y=2,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="43" source="{X=136,Y=2,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="44" source="{X=151,Y=2,Width=7,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="45" source="{X=160,Y=2,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="46" source="{X=175,Y=2,Width=6,Height=27}" rightOverhang="1" /> + <Glyph char="47" source="{X=183,Y=2,Width=11,Height=27}" rightOverhang="1" /> + <Glyph char="48" source="{X=196,Y=2,Width=14,Height=27}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="49" source="{X=212,Y=2,Width=8,Height=27}" leftOverhang="-1" rightOverhang="-2" /> + <Glyph char="50" source="{X=222,Y=2,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="51" source="{X=236,Y=2,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="52" source="{X=0,Y=32,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="53" source="{X=14,Y=32,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="54" source="{X=28,Y=32,Width=13,Height=27}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="55" source="{X=43,Y=32,Width=10,Height=27}" rightOverhang="-1" /> + <Glyph char="56" source="{X=55,Y=32,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="57" source="{X=69,Y=32,Width=13,Height=27}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="58" source="{X=84,Y=32,Width=6,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="59" source="{X=92,Y=32,Width=7,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="60" source="{X=101,Y=32,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="61" source="{X=117,Y=32,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="62" source="{X=132,Y=32,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="63" source="{X=148,Y=32,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="64" source="{X=162,Y=32,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="65" source="{X=176,Y=32,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="66" source="{X=191,Y=32,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="67" source="{X=207,Y=32,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="68" source="{X=222,Y=32,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="69" source="{X=238,Y=32,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="70" source="{X=0,Y=62,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="71" source="{X=13,Y=62,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="72" source="{X=29,Y=62,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="73" source="{X=45,Y=62,Width=7,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="74" source="{X=54,Y=62,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="75" source="{X=68,Y=62,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="76" source="{X=83,Y=62,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="77" source="{X=96,Y=62,Width=17,Height=27}" rightOverhang="1" /> + <Glyph char="78" source="{X=115,Y=62,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="79" source="{X=131,Y=62,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="80" source="{X=147,Y=62,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="81" source="{X=162,Y=62,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="82" source="{X=178,Y=62,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="83" source="{X=194,Y=62,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="84" source="{X=208,Y=62,Width=15,Height=27}" leftOverhang="1" rightOverhang="4" /> + <Glyph char="85" source="{X=225,Y=62,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="86" source="{X=241,Y=62,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="87" source="{X=0,Y=92,Width=18,Height=27}" rightOverhang="1" /> + <Glyph char="88" source="{X=20,Y=92,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="89" source="{X=34,Y=92,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="90" source="{X=48,Y=92,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="91" source="{X=62,Y=92,Width=9,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="92" source="{X=73,Y=92,Width=11,Height=27}" rightOverhang="1" /> + <Glyph char="93" source="{X=86,Y=92,Width=9,Height=27}" rightOverhang="1" /> + <Glyph char="94" source="{X=97,Y=92,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="95" source="{X=113,Y=92,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="96" source="{X=128,Y=92,Width=8,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="97" source="{X=138,Y=92,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="98" source="{X=151,Y=92,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="99" source="{X=165,Y=92,Width=10,Height=27}" rightOverhang="1" /> + <Glyph char="100" source="{X=177,Y=92,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="101" source="{X=191,Y=92,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="102" source="{X=204,Y=92,Width=11,Height=27}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="103" source="{X=217,Y=92,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="104" source="{X=231,Y=92,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="105" source="{X=245,Y=92,Width=6,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="106" source="{X=0,Y=122,Width=6,Height=27}" rightOverhang="1" /> + <Glyph char="107" source="{X=8,Y=122,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="108" source="{X=21,Y=122,Width=6,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="109" source="{X=29,Y=122,Width=18,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="110" source="{X=49,Y=122,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="111" source="{X=63,Y=122,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="112" source="{X=76,Y=122,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="113" source="{X=90,Y=122,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="114" source="{X=104,Y=122,Width=10,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="115" source="{X=116,Y=122,Width=10,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="116" source="{X=128,Y=122,Width=8,Height=27}" rightOverhang="1" /> + <Glyph char="117" source="{X=138,Y=122,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="118" source="{X=152,Y=122,Width=11,Height=27}" rightOverhang="1" /> + <Glyph char="119" source="{X=165,Y=122,Width=18,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="120" source="{X=185,Y=122,Width=10,Height=27}" rightOverhang="1" /> + <Glyph char="121" source="{X=197,Y=122,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="122" source="{X=211,Y=122,Width=10,Height=27}" rightOverhang="1" /> + <Glyph char="123" source="{X=223,Y=122,Width=10,Height=27}" rightOverhang="1" /> + <Glyph char="124" source="{X=235,Y=122,Width=7,Height=27}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="125" source="{X=244,Y=122,Width=10,Height=27}" rightOverhang="1" /> + <Glyph char="126" source="{X=0,Y=152,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="161" source="{X=14,Y=152,Width=7,Height=27}" rightOverhang="1" /> + <Glyph char="162" source="{X=23,Y=152,Width=10,Height=27}" rightOverhang="1" /> + <Glyph char="163" source="{X=35,Y=152,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="164" source="{X=49,Y=152,Width=15,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="165" source="{X=66,Y=152,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="166" source="{X=81,Y=152,Width=7,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="167" source="{X=90,Y=152,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="168" source="{X=103,Y=152,Width=9,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="169" source="{X=114,Y=152,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="170" source="{X=130,Y=152,Width=10,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="171" source="{X=142,Y=152,Width=15,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="172" source="{X=159,Y=152,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="173" source="{X=174,Y=152,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="174" source="{X=189,Y=152,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="175" source="{X=205,Y=152,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="176" source="{X=220,Y=152,Width=9,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="177" source="{X=231,Y=152,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="178" source="{X=246,Y=152,Width=9,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="179" source="{X=0,Y=182,Width=9,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="180" source="{X=11,Y=182,Width=8,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="181" source="{X=21,Y=182,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="182" source="{X=35,Y=182,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="183" source="{X=48,Y=182,Width=6,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="184" source="{X=56,Y=182,Width=7,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="185" source="{X=65,Y=182,Width=7,Height=27}" rightOverhang="1" /> + <Glyph char="186" source="{X=74,Y=182,Width=10,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="187" source="{X=86,Y=182,Width=15,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="188" source="{X=103,Y=182,Width=14,Height=27}" rightOverhang="1" /> + <Glyph char="189" source="{X=119,Y=182,Width=15,Height=27}" rightOverhang="1" /> + <Glyph char="190" source="{X=136,Y=182,Width=16,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="191" source="{X=154,Y=182,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="192" source="{X=168,Y=182,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="193" source="{X=183,Y=182,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="194" source="{X=198,Y=182,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="195" source="{X=213,Y=182,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="196" source="{X=228,Y=182,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="197" source="{X=243,Y=182,Width=13,Height=27}" rightOverhang="1" /> + <Glyph char="198" source="{X=0,Y=212,Width=18,Height=27}" rightOverhang="1" /> + <Glyph char="199" source="{X=20,Y=212,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="200" source="{X=35,Y=212,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="201" source="{X=48,Y=212,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="202" source="{X=61,Y=212,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="203" source="{X=74,Y=212,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="204" source="{X=87,Y=212,Width=7,Height=27}" rightOverhang="1" /> + <Glyph char="205" source="{X=96,Y=212,Width=7,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="206" source="{X=105,Y=212,Width=7,Height=27}" rightOverhang="1" /> + <Glyph char="207" source="{X=114,Y=212,Width=7,Height=27}" rightOverhang="1" /> + <Glyph char="208" source="{X=123,Y=212,Width=14,Height=27}" rightOverhang="1" /> + <Glyph char="209" source="{X=139,Y=212,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="210" source="{X=155,Y=212,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="211" source="{X=171,Y=212,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="212" source="{X=187,Y=212,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="213" source="{X=203,Y=212,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="214" source="{X=219,Y=212,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="215" source="{X=235,Y=212,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="216" source="{X=0,Y=242,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="217" source="{X=16,Y=242,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="218" source="{X=32,Y=242,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="219" source="{X=48,Y=242,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="220" source="{X=64,Y=242,Width=14,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="221" source="{X=80,Y=242,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="222" source="{X=94,Y=242,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="223" source="{X=108,Y=242,Width=12,Height=27}" rightOverhang="1" /> + <Glyph char="224" source="{X=122,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="225" source="{X=135,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="226" source="{X=148,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="227" source="{X=161,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="228" source="{X=174,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="229" source="{X=187,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="230" source="{X=200,Y=242,Width=17,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="231" source="{X=219,Y=242,Width=10,Height=27}" rightOverhang="1" /> + <Glyph char="232" source="{X=231,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="233" source="{X=244,Y=242,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="234" source="{X=0,Y=272,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="235" source="{X=13,Y=272,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="236" source="{X=26,Y=272,Width=6,Height=27}" rightOverhang="1" /> + <Glyph char="237" source="{X=34,Y=272,Width=6,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="238" source="{X=42,Y=272,Width=6,Height=27}" rightOverhang="1" /> + <Glyph char="239" source="{X=50,Y=272,Width=6,Height=27}" rightOverhang="1" /> + <Glyph char="240" source="{X=58,Y=272,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="241" source="{X=72,Y=272,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="242" source="{X=86,Y=272,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="243" source="{X=99,Y=272,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="244" source="{X=112,Y=272,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="245" source="{X=125,Y=272,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="246" source="{X=138,Y=272,Width=11,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="247" source="{X=151,Y=272,Width=13,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="248" source="{X=166,Y=272,Width=11,Height=27}" rightOverhang="1" /> + <Glyph char="249" source="{X=179,Y=272,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="250" source="{X=193,Y=272,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="251" source="{X=207,Y=272,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="252" source="{X=221,Y=272,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="253" source="{X=235,Y=272,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="254" source="{X=0,Y=302,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="255" source="{X=14,Y=302,Width=12,Height=27}" leftOverhang="-1" rightOverhang="2" /> + </Metrics> + </BitmapFont> + <BitmapFont name="MedievalSharpBold18" image="fonts/MedievalSharpBold18.png"> + <Metrics> + <Glyph char="32" source="{X=0,Y=2,Width=8,Height=34}" rightOverhang="1" /> + <Glyph char="33" source="{X=10,Y=2,Width=10,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="34" source="{X=22,Y=2,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="35" source="{X=38,Y=2,Width=21,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="36" source="{X=61,Y=2,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="37" source="{X=80,Y=2,Width=24,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="38" source="{X=106,Y=2,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="39" source="{X=127,Y=2,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="40" source="{X=138,Y=2,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="41" source="{X=153,Y=2,Width=13,Height=34}" rightOverhang="1" /> + <Glyph char="42" source="{X=168,Y=2,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="43" source="{X=188,Y=2,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="44" source="{X=208,Y=2,Width=10,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="45" source="{X=220,Y=2,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="46" source="{X=240,Y=2,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="47" source="{X=0,Y=39,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="48" source="{X=18,Y=39,Width=19,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="49" source="{X=39,Y=39,Width=13,Height=34}" leftOverhang="-1" rightOverhang="-2" /> + <Glyph char="50" source="{X=54,Y=39,Width=17,Height=34}" rightOverhang="1" /> + <Glyph char="51" source="{X=73,Y=39,Width=18,Height=34}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="52" source="{X=93,Y=39,Width=16,Height=34}" /> + <Glyph char="53" source="{X=111,Y=39,Width=17,Height=34}" rightOverhang="1" /> + <Glyph char="54" source="{X=130,Y=39,Width=18,Height=34}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="55" source="{X=150,Y=39,Width=16,Height=34}" /> + <Glyph char="56" source="{X=168,Y=39,Width=17,Height=34}" rightOverhang="1" /> + <Glyph char="57" source="{X=187,Y=39,Width=18,Height=34}" leftOverhang="1" rightOverhang="1" /> + <Glyph char="58" source="{X=207,Y=39,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="59" source="{X=218,Y=39,Width=10,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="60" source="{X=230,Y=39,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="61" source="{X=0,Y=76,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="62" source="{X=20,Y=76,Width=18,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="63" source="{X=40,Y=76,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="64" source="{X=59,Y=76,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="65" source="{X=78,Y=76,Width=20,Height=34}" rightOverhang="3" /> + <Glyph char="66" source="{X=100,Y=76,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="67" source="{X=121,Y=76,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="68" source="{X=141,Y=76,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="69" source="{X=162,Y=76,Width=16,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="70" source="{X=180,Y=76,Width=15,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="71" source="{X=197,Y=76,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="72" source="{X=218,Y=76,Width=19,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="73" source="{X=239,Y=76,Width=10,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="74" source="{X=0,Y=113,Width=17,Height=34}" rightOverhang="1" /> + <Glyph char="75" source="{X=19,Y=113,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="76" source="{X=39,Y=113,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="77" source="{X=56,Y=113,Width=23,Height=34}" rightOverhang="1" /> + <Glyph char="78" source="{X=81,Y=113,Width=20,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="79" source="{X=103,Y=113,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="80" source="{X=124,Y=113,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="81" source="{X=144,Y=113,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="82" source="{X=165,Y=113,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="83" source="{X=186,Y=113,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="84" source="{X=205,Y=113,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="85" source="{X=223,Y=113,Width=19,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="86" source="{X=0,Y=150,Width=20,Height=34}" rightOverhang="3" /> + <Glyph char="87" source="{X=22,Y=150,Width=25,Height=34}" rightOverhang="1" /> + <Glyph char="88" source="{X=49,Y=150,Width=18,Height=34}" rightOverhang="1" /> + <Glyph char="89" source="{X=69,Y=150,Width=17,Height=34}" rightOverhang="1" /> + <Glyph char="90" source="{X=88,Y=150,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="91" source="{X=107,Y=150,Width=13,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="92" source="{X=122,Y=150,Width=16,Height=34}" rightOverhang="1" /> + <Glyph char="93" source="{X=140,Y=150,Width=13,Height=34}" rightOverhang="1" /> + <Glyph char="94" source="{X=155,Y=150,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="95" source="{X=175,Y=150,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="96" source="{X=195,Y=150,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="97" source="{X=210,Y=150,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="98" source="{X=228,Y=150,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="99" source="{X=0,Y=187,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="100" source="{X=17,Y=187,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="101" source="{X=36,Y=187,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="102" source="{X=53,Y=187,Width=15,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="103" source="{X=70,Y=187,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="104" source="{X=88,Y=187,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="105" source="{X=107,Y=187,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="106" source="{X=118,Y=187,Width=11,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="107" source="{X=131,Y=187,Width=17,Height=34}" leftOverhang="-1" rightOverhang="4" /> + <Glyph char="108" source="{X=150,Y=187,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="109" source="{X=161,Y=187,Width=25,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="110" source="{X=188,Y=187,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="111" source="{X=207,Y=187,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="112" source="{X=224,Y=187,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="113" source="{X=0,Y=224,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="114" source="{X=18,Y=224,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="115" source="{X=35,Y=224,Width=14,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="116" source="{X=51,Y=224,Width=12,Height=34}" rightOverhang="1" /> + <Glyph char="117" source="{X=65,Y=224,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="118" source="{X=84,Y=224,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="119" source="{X=101,Y=224,Width=25,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="120" source="{X=128,Y=224,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="121" source="{X=145,Y=224,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="122" source="{X=164,Y=224,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="123" source="{X=181,Y=224,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="124" source="{X=198,Y=224,Width=10,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="125" source="{X=210,Y=224,Width=15,Height=34}" rightOverhang="1" /> + <Glyph char="126" source="{X=227,Y=224,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="161" source="{X=246,Y=224,Width=10,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="162" source="{X=0,Y=261,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="163" source="{X=17,Y=261,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="164" source="{X=36,Y=261,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="165" source="{X=57,Y=261,Width=18,Height=34}" rightOverhang="1" /> + <Glyph char="166" source="{X=77,Y=261,Width=10,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="167" source="{X=89,Y=261,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="168" source="{X=106,Y=261,Width=12,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="169" source="{X=120,Y=261,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="170" source="{X=139,Y=261,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="171" source="{X=156,Y=261,Width=22,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="172" source="{X=180,Y=261,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="173" source="{X=200,Y=261,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="174" source="{X=220,Y=261,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="175" source="{X=0,Y=298,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="176" source="{X=20,Y=298,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="177" source="{X=35,Y=298,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="178" source="{X=55,Y=298,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="179" source="{X=70,Y=298,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="180" source="{X=85,Y=298,Width=13,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="181" source="{X=100,Y=298,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="182" source="{X=120,Y=298,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="183" source="{X=138,Y=298,Width=9,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="184" source="{X=149,Y=298,Width=10,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="185" source="{X=161,Y=298,Width=11,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="186" source="{X=174,Y=298,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="187" source="{X=191,Y=298,Width=22,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="188" source="{X=215,Y=298,Width=21,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="189" source="{X=0,Y=335,Width=21,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="190" source="{X=23,Y=335,Width=23,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="191" source="{X=48,Y=335,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="192" source="{X=67,Y=335,Width=20,Height=34}" rightOverhang="3" /> + <Glyph char="193" source="{X=89,Y=335,Width=20,Height=34}" rightOverhang="3" /> + <Glyph char="194" source="{X=111,Y=335,Width=20,Height=34}" rightOverhang="3" /> + <Glyph char="195" source="{X=133,Y=335,Width=20,Height=34}" rightOverhang="3" /> + <Glyph char="196" source="{X=155,Y=335,Width=20,Height=34}" rightOverhang="3" /> + <Glyph char="197" source="{X=177,Y=335,Width=18,Height=34}" rightOverhang="1" /> + <Glyph char="198" source="{X=197,Y=335,Width=23,Height=34}" rightOverhang="1" /> + <Glyph char="199" source="{X=222,Y=335,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="200" source="{X=0,Y=372,Width=16,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="201" source="{X=18,Y=372,Width=16,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="202" source="{X=36,Y=372,Width=16,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="203" source="{X=54,Y=372,Width=16,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="204" source="{X=72,Y=372,Width=10,Height=34}" rightOverhang="1" /> + <Glyph char="205" source="{X=84,Y=372,Width=10,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="206" source="{X=96,Y=372,Width=10,Height=34}" rightOverhang="1" /> + <Glyph char="207" source="{X=108,Y=372,Width=12,Height=34}" rightOverhang="3" /> + <Glyph char="208" source="{X=122,Y=372,Width=19,Height=34}" rightOverhang="1" /> + <Glyph char="209" source="{X=143,Y=372,Width=20,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="210" source="{X=165,Y=372,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="211" source="{X=186,Y=372,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="212" source="{X=207,Y=372,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="213" source="{X=228,Y=372,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="214" source="{X=0,Y=409,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="215" source="{X=21,Y=409,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="216" source="{X=39,Y=409,Width=19,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="217" source="{X=60,Y=409,Width=19,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="218" source="{X=81,Y=409,Width=19,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="219" source="{X=102,Y=409,Width=19,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="220" source="{X=123,Y=409,Width=19,Height=34}" leftOverhang="-2" rightOverhang="3" /> + <Glyph char="221" source="{X=144,Y=409,Width=17,Height=34}" rightOverhang="1" /> + <Glyph char="222" source="{X=163,Y=409,Width=17,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="223" source="{X=182,Y=409,Width=18,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="224" source="{X=202,Y=409,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="225" source="{X=220,Y=409,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="226" source="{X=238,Y=409,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="227" source="{X=0,Y=446,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="228" source="{X=18,Y=446,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="229" source="{X=36,Y=446,Width=16,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="230" source="{X=54,Y=446,Width=23,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="231" source="{X=79,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="232" source="{X=96,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="233" source="{X=113,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="234" source="{X=130,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="235" source="{X=147,Y=446,Width=15,Height=34}" leftOverhang="-1" rightOverhang="2" /> + <Glyph char="236" source="{X=164,Y=446,Width=11,Height=34}" leftOverhang="1" rightOverhang="2" /> + <Glyph char="237" source="{X=177,Y=446,Width=11,Height=34}" rightOverhang="3" /> + <Glyph char="238" source="{X=190,Y=446,Width=13,Height=34}" leftOverhang="1" rightOverhang="4" /> + <Glyph char="239" source="{X=205,Y=446,Width=11,Height=34}" rightOverhang="... [truncated message content] |
From: <ka...@us...> - 2012-02-17 02:25:31
|
Revision: 1329 http://agate.svn.sourceforge.net/agate/?rev=1329&view=rev Author: kanato Date: 2012-02-17 02:25:24 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Fix looping setting for music in AgateSDL. Modified Paths: -------------- trunk/Drivers/AgateSDL/Audio/SDL_Music.cs Modified: trunk/Drivers/AgateSDL/Audio/SDL_Music.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_Music.cs 2012-02-17 02:22:01 UTC (rev 1328) +++ trunk/Drivers/AgateSDL/Audio/SDL_Music.cs 2012-02-17 02:25:24 UTC (rev 1329) @@ -92,7 +92,7 @@ protected override void OnSetLoop(bool value) { - SdlMixer.Mix_PlayMusic(music, -1); + SdlMixer.Mix_PlayMusic(music, IsLooping ? -1 : 1); } public override double Pan @@ -109,7 +109,7 @@ public override void Play() { - SdlMixer.Mix_PlayMusic(music, -1); + SdlMixer.Mix_PlayMusic(music, IsLooping ? -1 : 1); } public override void Stop() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-17 02:22:07
|
Revision: 1328 http://agate.svn.sourceforge.net/agate/?rev=1328&view=rev Author: kanato Date: 2012-02-17 02:22:01 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Fix text layout if using DrawText with formatting overload but no format parameters. Modified Paths: -------------- trunk/AgateLib/DisplayLib/FontSurface.cs Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2012-02-09 04:21:25 UTC (rev 1327) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2012-02-17 02:22:01 UTC (rev 1328) @@ -475,16 +475,17 @@ if (matches.Count == 0) { - return new TextLayout - { - new LayoutText - { - Font = this, - State = this.State.Clone(), - LineIndex = 0, - Text = formatString - } + var singleLayout = new LayoutText + { + Font = this, + State = this.State.Clone(), + LineIndex = 0, + Text = formatString }; + + singleLayout.State.Location = PointF.Empty; + + return new TextLayout { singleLayout }; } for (int i = 0; i < args.Length; i++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-09 04:21:31
|
Revision: 1327 http://agate.svn.sourceforge.net/agate/?rev=1327&view=rev Author: kanato Date: 2012-02-09 04:21:25 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Fixed the Display.Clear(Color, Rectangle) overload when a GL3 framebuffer is the render target. Modified Paths: -------------- trunk/Drivers/AgateOTK/GL_Display.cs Modified: trunk/Drivers/AgateOTK/GL_Display.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Display.cs 2012-02-08 01:35:21 UTC (rev 1326) +++ trunk/Drivers/AgateOTK/GL_Display.cs 2012-02-09 04:21:25 UTC (rev 1327) @@ -257,9 +257,20 @@ } public override void Clear(Color color, Rectangle destRect) { - DrawBuffer.Flush(); + // hack because FBO's need to be flipped. So we shift the rectangle. + if (mRenderTarget is GL3.FrameBuffer) + { + destRect.Y = mRenderTarget.Height - destRect.Y - destRect.Height; + } - DrawRect(destRect, Color.FromArgb(255, color)); + // OpenGL apparently doesn't have direct capability to clear within a + // destination region, but we can use the glScissor function to restrict + // the clear to a specified area. + GL.Scissor(destRect.Left, destRect.Top, destRect.Width, destRect.Height); + GL.Enable(EnableCap.ScissorTest); + + Clear(color); + GL.Disable(EnableCap.ScissorTest); } #region --- Drawing Primitives --- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-08 01:35:27
|
Revision: 1326 http://agate.svn.sourceforge.net/agate/?rev=1326&view=rev Author: kanato Date: 2012-02-08 01:35:21 +0000 (Wed, 08 Feb 2012) Log Message: ----------- Add missing inputlib files. Added Paths: ----------- trunk/AgateLib/InputLib/Delegates.cs trunk/AgateLib/InputLib/JoystickEventArgs.cs Added: trunk/AgateLib/InputLib/Delegates.cs =================================================================== --- trunk/AgateLib/InputLib/Delegates.cs (rev 0) +++ trunk/AgateLib/InputLib/Delegates.cs 2012-02-08 01:35:21 UTC (rev 1326) @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.InputLib +{ + /// <summary> + /// Input Event handler event type. + /// </summary> + /// <param name="e"></param> + public delegate void InputEventHandler(InputEventArgs e); + + public delegate void JoystickEventHandler(object sender, JoystickEventArgs e); +} Added: trunk/AgateLib/InputLib/JoystickEventArgs.cs =================================================================== --- trunk/AgateLib/InputLib/JoystickEventArgs.cs (rev 0) +++ trunk/AgateLib/InputLib/JoystickEventArgs.cs 2012-02-08 01:35:21 UTC (rev 1326) @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.InputLib +{ + public enum JoystickEventType + { + Button, + Hat, + } + + public class JoystickEventArgs : EventArgs + { + private JoystickEventType mEventType; + private int mIndex; + + public JoystickEventArgs(JoystickEventType joystickEventType, int index) + { + // TODO: Complete member initialization + this.mEventType = joystickEventType; + this.mIndex = index; + } + + public JoystickEventType JoystickEventType + { + get { return mEventType; } + } + + public int Index + { + get { return mIndex; } + } + + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-06 18:56:00
|
Revision: 1325 http://agate.svn.sourceforge.net/agate/?rev=1325&view=rev Author: kanato Date: 2012-02-06 18:55:54 +0000 (Mon, 06 Feb 2012) Log Message: ----------- Fixed a bug where OpenGL FrameBuffers would be rendered upside-down. Modified Paths: -------------- trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs trunk/Drivers/AgateOTK/GL_Surface.cs trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs trunk/Tests/Tests.csproj Added Paths: ----------- trunk/Tests/DisplayTests/RenderTargetContinuous.cs Modified: trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs =================================================================== --- trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2012-02-05 01:58:45 UTC (rev 1324) +++ trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2012-02-06 18:55:54 UTC (rev 1325) @@ -46,7 +46,8 @@ // AgateLib.DisplayLib.PixelFormat.RGBA8888, mSize); mTexture = new GL_Surface(mSize); - + mTexture.FlipVertical = true; + // generate the frame buffer GL.GenFramebuffers(1, out mFramebufferID); GL.BindFramebuffer(FramebufferTarget.Framebuffer, mFramebufferID); Modified: trunk/Drivers/AgateOTK/GL_Surface.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Surface.cs 2012-02-05 01:58:45 UTC (rev 1324) +++ trunk/Drivers/AgateOTK/GL_Surface.cs 2012-02-06 18:55:54 UTC (rev 1325) @@ -486,6 +486,13 @@ (srcRect.Right) / (float)mTextureSize.Width, (srcRect.Bottom) / (float)mTextureSize.Height); + if (FlipVertical) + { + var t = coords.Top; + coords.Top = coords.Bottom; + coords.Bottom = t; + } + return coords; } private TextureCoordinates GetTextureCoords(RectangleF srcRect) @@ -496,8 +503,19 @@ (srcRect.Right) / (float)mTextureSize.Width, (srcRect.Bottom) / (float)mTextureSize.Height); + if (FlipVertical) + { + var t = coords.Top; + coords.Top = coords.Bottom; + coords.Bottom = t; + } + return coords; } + /// <summary> + /// Used for framebuffer surfaces which need to be flipped vertically for some reason. + /// </summary> + public bool FlipVertical { get; set; } } } Modified: trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs 2012-02-05 01:58:45 UTC (rev 1324) +++ trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs 2012-02-06 18:55:54 UTC (rev 1325) @@ -48,6 +48,9 @@ void InitializeFramebuffer() { + mTexture = new GL_Surface(mSize); + mTexture.FlipVertical = true; + // try to initialize with both depth and stencil buffers. if (sDepthSupported && sStencilSupported) { @@ -104,8 +107,6 @@ void InitializeFramebuffer(bool depth, bool stencil) { - mTexture = new GL_Surface(mSize); - // generate the frame buffer GL.Ext.GenFramebuffers(1, out mFramebufferID); GL.Ext.BindFramebuffer(FramebufferTarget.Framebuffer, mFramebufferID); Added: trunk/Tests/DisplayTests/RenderTargetContinuous.cs =================================================================== --- trunk/Tests/DisplayTests/RenderTargetContinuous.cs (rev 0) +++ trunk/Tests/DisplayTests/RenderTargetContinuous.cs 2012-02-06 18:55:54 UTC (rev 1325) @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib; +using AgateLib.DisplayLib; +using AgateLib.Geometry; + +namespace Tests.DisplayTests +{ + class RenderTargetContinuous : IAgateTest + { + public string Name + { + get { return "Render Target Continuous"; } + } + + public string Category + { + get { return "Display"; } + } + + public void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup()) + { + setup.Initialize(true, false, false); + if (setup.WasCanceled) return; + + DisplayWindow wind = DisplayWindow.CreateWindowed(Name, 300, 300); + FrameBuffer buffer = new FrameBuffer(300, 300); + + FontSurface font = FontSurface.AgateSans24; + font.Color = Color.White; + + while (wind.IsClosed == false) + { + Display.RenderTarget = buffer; + Display.BeginFrame(); + Display.Clear(Color.Gray); + + font.DrawText(string.Format("Time: {0}", Timing.TotalSeconds.ToString("0.0"))); + + Display.EndFrame(); + + Display.RenderTarget = wind.FrameBuffer; + Display.BeginFrame(); + Display.Clear(Color.Gray); + + buffer.RenderTarget.Draw(); + + Display.EndFrame(); + Core.KeepAlive(); + } + } + } + } +} Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2012-02-05 01:58:45 UTC (rev 1324) +++ trunk/Tests/Tests.csproj 2012-02-06 18:55:54 UTC (rev 1325) @@ -145,6 +145,7 @@ <Compile Include="DisplayTests\PixelBufferMask.cs" /> <Compile Include="DisplayTests\ClipRect.cs" /> <Compile Include="DisplayTests\Prerendered.cs" /> + <Compile Include="DisplayTests\RenderTargetContinuous.cs" /> <Compile Include="Fonts\Builtin.cs" /> <Compile Include="Fonts\Kerning.cs" /> <Compile Include="frmLauncher.cs"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-05 01:58:51
|
Revision: 1324 http://agate.svn.sourceforge.net/agate/?rev=1324&view=rev Author: kanato Date: 2012-02-05 01:58:45 +0000 (Sun, 05 Feb 2012) Log Message: ----------- Added events for joystick buttons and hats. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/AgateLib/InputLib/InputEventArgs.cs trunk/AgateLib/InputLib/Joystick.cs trunk/AgateLib/InputLib/Keyboard.cs Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2012-02-05 01:58:20 UTC (rev 1323) +++ trunk/AgateLib/AgateLib.csproj 2012-02-05 01:58:45 UTC (rev 1324) @@ -173,7 +173,9 @@ <SubType>Code</SubType> </Compile> <Compile Include="DisplayLib\ImplementationBase\FrameBufferImpl.cs" /> + <Compile Include="InputLib\Delegates.cs" /> <Compile Include="InputLib\HatState.cs" /> + <Compile Include="InputLib\JoystickEventArgs.cs" /> <Compile Include="Platform.cs" /> <Compile Include="PlatformType.cs" /> <Compile Include="Resources\ImageResource.cs" /> Modified: trunk/AgateLib/InputLib/InputEventArgs.cs =================================================================== --- trunk/AgateLib/InputLib/InputEventArgs.cs 2012-02-05 01:58:20 UTC (rev 1323) +++ trunk/AgateLib/InputLib/InputEventArgs.cs 2012-02-05 01:58:45 UTC (rev 1324) @@ -122,5 +122,4 @@ get { return mWheelDelta; } } } - } Modified: trunk/AgateLib/InputLib/Joystick.cs =================================================================== --- trunk/AgateLib/InputLib/Joystick.cs 2012-02-05 01:58:20 UTC (rev 1323) +++ trunk/AgateLib/InputLib/Joystick.cs 2012-02-05 01:58:45 UTC (rev 1324) @@ -30,12 +30,18 @@ public class Joystick { JoystickImpl impl; + bool[] mButtonState; + HatState[] mHatState; internal Joystick(JoystickImpl i) { impl = i; AxisThreshold = 0.02; + + mButtonState = new bool[ButtonCount]; + mHatState = new HatState[HatCount]; + } /// <summary> @@ -61,11 +67,24 @@ /// </summary> /// <param name="hatIndex"></param> /// <returns></returns> + [Obsolete("Use HatState property instead.")] public HatState GetHatState(int hatIndex) { + return GetHatStateImpl(hatIndex); + } + private HatState GetHatStateImpl(int hatIndex) + { return impl.GetHatState(hatIndex); } + /// <summary> + /// Gets an array indicating the state of the joystick hats. + /// </summary> + public HatState[] HatState + { + get { return mHatState; } + } + /// <summary> /// Gets the current value for the given axis. /// Axis 0 is always the x-axis, axis 1 is always the y-axis on /// controlers which have this capability. @@ -81,12 +100,25 @@ /// </summary> /// <param name="buttonIndex"></param> /// <returns></returns> + [Obsolete("Use ButtonState property instead.")] public bool GetButtonState(int buttonIndex) { + return GetButtonStateImpl(buttonIndex); + } + private bool GetButtonStateImpl(int buttonIndex) + { return impl.GetButtonState(buttonIndex); } /// <summary> + /// Gets an array indicating the state of the buttons. + /// </summary> + public bool[] ButtonState + { + get { return mButtonState; } + } + + /// <summary> /// Recalibrates this joystick. /// /// Behavior is driver-dependent, however this usually means taking @@ -158,6 +190,56 @@ public void Poll() { impl.Poll(); + + for (int i = 0; i < mButtonState.Length; i++) + { + bool newValue = GetButtonStateImpl(i); + + if (newValue != mButtonState[i]) + { + mButtonState[i] = newValue; + + if (newValue) + OnButtonPressed(i); + else + OnButtonReleased(i); + } + } + for (int i = 0; i < mHatState.Length; i++) + { + HatState newValue = GetHatStateImpl(i); + + if (newValue != mHatState[i]) + { + mHatState[i] = newValue; + + OnHatStateChanged(i); + } + } } + + + public event JoystickEventHandler ButtonPressed; + public event JoystickEventHandler ButtonReleased; + public event JoystickEventHandler HatStateChanged; + + private void OnButtonPressed(int index) + { + if (ButtonPressed != null) + ButtonPressed(this, + new JoystickEventArgs(JoystickEventType.Button, index)); + } + private void OnButtonReleased(int index) + { + if (ButtonReleased != null) + ButtonReleased(this, + new JoystickEventArgs(JoystickEventType.Button, index)); + } + private void OnHatStateChanged(int index) + { + if (HatStateChanged != null) + HatStateChanged(this, + new JoystickEventArgs(JoystickEventType.Hat, index)); + } } } Modified: trunk/AgateLib/InputLib/Keyboard.cs =================================================================== --- trunk/AgateLib/InputLib/Keyboard.cs 2012-02-05 01:58:20 UTC (rev 1323) +++ trunk/AgateLib/InputLib/Keyboard.cs 2012-02-05 01:58:45 UTC (rev 1324) @@ -24,14 +24,7 @@ namespace AgateLib.InputLib { - /// <summary> - /// Event handler event type. - /// </summary> - /// <param name="e"></param> - public delegate void InputEventHandler(InputEventArgs e); - - /// <summary> /// Static class which represents Keyboard input. /// </summary> [CLSCompliant(true)] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-02-05 01:58:26
|
Revision: 1323 http://agate.svn.sourceforge.net/agate/?rev=1323&view=rev Author: kanato Date: 2012-02-05 01:58:20 +0000 (Sun, 05 Feb 2012) Log Message: ----------- Fixed a bug when passing a SurfaceState object to correct drawing from a source rectangle. Modified Paths: -------------- trunk/Drivers/AgateOTK/GL_Surface.cs Modified: trunk/Drivers/AgateOTK/GL_Surface.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Surface.cs 2012-01-19 07:28:25 UTC (rev 1322) +++ trunk/Drivers/AgateOTK/GL_Surface.cs 2012-02-05 01:58:20 UTC (rev 1323) @@ -183,7 +183,7 @@ float destX = inst.DestLocation.X; float destY = inst.DestLocation.Y; Rectangle srcRect = inst.GetSourceRect(SurfaceSize); - SizeF displaySize = state.GetDisplaySize(SurfaceSize); + SizeF displaySize = state.GetDisplaySize(srcRect.Size); PointF rotationCenter = state.GetRotationCenter(displaySize); float mRotationCos = (float)Math.Cos(state.RotationAngle); float mRotationSin = (float)Math.Sin(state.RotationAngle); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-01-19 07:28:32
|
Revision: 1322 http://agate.svn.sourceforge.net/agate/?rev=1322&view=rev Author: kanato Date: 2012-01-19 07:28:25 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Include missing app.config for DatabaseEditor project. Modified Paths: -------------- trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs trunk/Tools/DatabaseEditor/Properties/Settings.Designer.cs trunk/Tools/FontCreator/FontCreator.csproj Added Paths: ----------- trunk/Tools/DatabaseEditor/app.config Modified: trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2012-01-18 20:44:03 UTC (rev 1321) +++ trunk/Tools/DatabaseEditor/Properties/Resources.Designer.cs 2012-01-19 07:28:25 UTC (rev 1322) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.239 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Modified: trunk/Tools/DatabaseEditor/Properties/Settings.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/Properties/Settings.Designer.cs 2012-01-18 20:44:03 UTC (rev 1321) +++ trunk/Tools/DatabaseEditor/Properties/Settings.Designer.cs 2012-01-19 07:28:25 UTC (rev 1322) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.239 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Added: trunk/Tools/DatabaseEditor/app.config =================================================================== --- trunk/Tools/DatabaseEditor/app.config (rev 0) +++ trunk/Tools/DatabaseEditor/app.config 2012-01-19 07:28:25 UTC (rev 1322) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Modified: trunk/Tools/FontCreator/FontCreator.csproj =================================================================== --- trunk/Tools/FontCreator/FontCreator.csproj 2012-01-18 20:44:03 UTC (rev 1321) +++ trunk/Tools/FontCreator/FontCreator.csproj 2012-01-19 07:28:25 UTC (rev 1322) @@ -134,7 +134,9 @@ </ProjectReference> </ItemGroup> <ItemGroup> - <None Include="app.config" /> + <None Include="app.config"> + <SubType>Designer</SubType> + </None> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-01-18 20:44:09
|
Revision: 1321 http://agate.svn.sourceforge.net/agate/?rev=1321&view=rev Author: kanato Date: 2012-01-18 20:44:03 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Fix bugs where null string passed to DrawText would cause crash. Modified Paths: -------------- trunk/AgateLib/DisplayLib/FontSurface.cs Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2012-01-17 08:24:00 UTC (rev 1320) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2012-01-18 20:44:03 UTC (rev 1321) @@ -149,7 +149,7 @@ /// <summary> /// Gets the name of the font. /// </summary> - public string FontName + public string FontName { get { return mImpl.FontName; } } @@ -341,9 +341,9 @@ /// </summary> /// <param name="text"></param> /// <returns></returns> - public Size MeasureString(string text) - { - return mImpl.MeasureString(mState, text); + public Size MeasureString(string text) + { + return mImpl.MeasureString(mState, text); } /// <summary> /// Measures the display size of the specified string. @@ -376,6 +376,9 @@ /// <param name="text"></param> public void DrawText(double destX, double destY, string text) { + if (string.IsNullOrEmpty(text)) + return; + mState.Location = new PointF((float)destX, (float)destY); mState.Text = mTransformer.Transform(text); @@ -388,6 +391,9 @@ /// <param name="text"></param> public void DrawText(Point destPt, string text) { + if (string.IsNullOrEmpty(text)) + return; + mState.Location = new PointF(destPt.X, destPt.Y); mState.Text = mTransformer.Transform(text); @@ -400,6 +406,9 @@ /// <param name="text"></param> public void DrawText(PointF destPt, string text) { + if (string.IsNullOrEmpty(text)) + return; + mState.Location = destPt; mState.Text = mTransformer.Transform(text); @@ -440,6 +449,9 @@ /// are laid out according to the TextImageLayout member.</param> public void DrawText(int destX, int destY, string formatString, params object[] args) { + if (string.IsNullOrEmpty(formatString)) + return; + TextLayout layout = CreateLayout(formatString, args); layout.Translate(new Point(destX, destY)); @@ -585,7 +597,7 @@ ref PointF dest, ref int lineHeight, ref int spaceAboveLine, ISurface surface) { - if (layout == null) + if (layout == null) throw new ArgumentNullException("layout"); int newSpaceAbove; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-01-17 08:24:12
|
Revision: 1320 http://agate.svn.sourceforge.net/agate/?rev=1320&view=rev Author: kanato Date: 2012-01-17 08:24:00 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Added Closed and Closing events for DisplayWindow. SlimDX does not work; need to wait for updated version for .NET 4.0. Fixed bug where drawing text with a FontSurface object would crash if null text was passed. Modified Paths: -------------- trunk/AgateLib/DisplayLib/DisplayWindow.cs trunk/AgateLib/DisplayLib/FontState.cs trunk/AgateLib/DisplayLib/FontSurface.cs trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs trunk/Drivers/AgateOTK/GL_DisplayControl.cs trunk/Drivers/AgateOTK/GL_GameWindow.cs trunk/Drivers/AgateSDX/AgateSDX.csproj trunk/Tests/Tests.csproj Added Paths: ----------- trunk/Tests/DisplayTests/DisplayWindowEvents.cs Modified: trunk/AgateLib/DisplayLib/DisplayWindow.cs =================================================================== --- trunk/AgateLib/DisplayLib/DisplayWindow.cs 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/AgateLib/DisplayLib/DisplayWindow.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -84,7 +84,7 @@ "Did you forget to call AgateSetup.Initialize or Display.Initialize?"); mImpl = Display.Impl.CreateDisplayWindow(windowParams); - + Display.RenderTarget = FrameBuffer; Display.DisposeDisplay += new Display.DisposeDisplayHandler(Dispose); @@ -177,7 +177,7 @@ /// </summary> public FrameBuffer FrameBuffer { - get + get { if (mFrameBuffer == null || mFrameBuffer.Impl != Impl.FrameBuffer) { @@ -345,13 +345,32 @@ /// <summary> /// Event raised when the window is resized by the user. /// </summary> - public event EventHandler Resize; + public event EventHandler Resize + { + add { mImpl.Resize += value; } + remove { mImpl.Resize -= value; } + } - internal void OnResize() + /// <summary> + /// Event raised when the window is closed by the user. + /// </summary> + public event EventHandler Closed { - if (Resize != null) - Resize(this, EventArgs.Empty); + add { mImpl.Closed += value; } + remove { mImpl.Closed -= value; } } + /// <summary> + /// Event raised when the user clicks the close box but before the window is closed. + /// </summary> + public event CancelEventHandler Closing + { + add { mImpl.Closing += value; } + remove { mImpl.Closing -= value; } + } + } + + public delegate void CancelEventHandler(object sender, ref bool cancel); + } \ No newline at end of file Modified: trunk/AgateLib/DisplayLib/FontState.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontState.cs 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/AgateLib/DisplayLib/FontState.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -35,7 +35,7 @@ private double mScaleWidth = 1.0; private double mScaleHeight = 1.0; private PointF mLocation; - private string mText; + private string mText = string.Empty; private FontStateCache mCache; private string mTransformedText; Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -313,7 +313,7 @@ [Obsolete("Use MeasureString instead.", true)] public int StringDisplayWidth(string text) { - return StringDisplaySize(text).Width; + return MeasureString(text).Width; } /// <summary> /// Measures the display height of the specified string. @@ -323,7 +323,7 @@ [Obsolete("Use MeasureString instead.", true)] public int StringDisplayHeight(string text) { - return StringDisplaySize(text).Height; + return MeasureString(text).Height; } /// <summary> /// Measures the display size of the specified string. @@ -411,6 +411,9 @@ /// <param name="text"></param> public void DrawText(string text) { + if (string.IsNullOrEmpty(text)) + return; + mState.Location = PointF.Empty; mState.Text = mTransformer.Transform(text); Modified: trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs =================================================================== --- trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/AgateLib/DisplayLib/ImplementationBase/DisplayWindowImpl.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -109,5 +109,53 @@ /// </summary> public abstract Point MousePosition { get; set; } + + /// <summary> + /// Event raised when the window is resized by the user. + /// Be sure to call the base class method so that client events are raised. + /// </summary> + protected virtual void OnResize() + { + if (Resize != null) + Resize(this, EventArgs.Empty); + } + + /// <summary> + /// Event raised when the window is closed by the user. + /// Be sure to call the base class method so that client events are raised. + /// </summary> + protected virtual void OnClosed() + { + if (Closed != null) + Closed(this, EventArgs.Empty); + } + + /// <summary> + /// Event raised when the user clicks the close box but before the window is closed. + /// Be sure to call the base class method so that client events are raised. + /// </summary> + protected virtual void OnClosing(ref bool cancel) + { + if (Closing != null) + { + Closing(this, ref cancel); + } + } + + /// <summary> + /// Event raised when the window is resized by the user. + /// </summary> + public event EventHandler Resize; + + /// <summary> + /// Event raised when the window is closed by the user. + /// </summary> + public event EventHandler Closed; + + /// <summary> + /// Event raised when the user clicks the close box but before the window is closed. + /// </summary> + public event CancelEventHandler Closing; + } } \ No newline at end of file Modified: trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs =================================================================== --- trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/Drivers/AgateDrawing/Drawing_DisplayWindow.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -53,7 +53,7 @@ AttachEvents(); - OnResize(); + RecreateBackBuffer(); } else { @@ -73,7 +73,7 @@ AttachEvents(); // and create the back buffer - OnResize(); + RecreateBackBuffer(); } mFrameBuffer = new Drawing_FrameBuffer(mBackBuffer); @@ -117,44 +117,10 @@ form.KeyDown += new System.Windows.Forms.KeyEventHandler(form_KeyDown); form.KeyUp += new System.Windows.Forms.KeyEventHandler(form_KeyUp); - // TODO: This can probably be removed as of 11/2011. - // fuck, it seems that FormClosing had a different name in .NET 1.1, which is - // the version of windows that Mono implements. - // So here's an ugly System.Reflection hack around it. - { - EventInfo formClosing = GetFormEvent("FormClosing", "Closing"); - MethodInfo method = this.GetType().GetMethod("form_FormClosing"); - - Delegate d = Delegate.CreateDelegate(formClosing.EventHandlerType, this, method); - - formClosing.AddEventHandler(form, d); - } - { - EventInfo formClosed = GetFormEvent("FormClosed", "Closed"); - MethodInfo method = this.GetType().GetMethod("form_FormClosed"); - - Delegate d = Delegate.CreateDelegate(formClosed.EventHandlerType, this, method); - - formClosed.AddEventHandler(form, d); - } + form.FormClosed += new FormClosedEventHandler(form_FormClosed); + form.FormClosing += new FormClosingEventHandler(form_FormClosing); } - private EventInfo GetFormEvent(params string[] eventNames) - { - Type formType = typeof(System.Windows.Forms.Form); - - foreach (string name in eventNames) - { - EventInfo evt = formType.GetEvent(name); - - if (evt != null) - return evt; - } - - return null; - } - - Mouse.MouseButtons GetButtons(MouseButtons buttons) { Mouse.MouseButtons retval = Mouse.MouseButtons.None; @@ -173,14 +139,23 @@ return retval; } - public void form_FormClosed(object sender, EventArgs e) + + void form_FormClosed(object sender, FormClosedEventArgs e) { mIsClosed = true; + + OnClosed(); } - public void form_FormClosing(object sender, EventArgs e) + + void form_FormClosing(object sender, FormClosingEventArgs e) { + bool cancel = false; + OnClosing(ref cancel); + + e.Cancel = cancel; } + void form_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { Keyboard.Keys[FormUtil.TransformWinFormsKey(e.KeyCode)] = false; @@ -237,17 +212,23 @@ { OnResize(); } + protected override void OnResize() + { + RecreateBackBuffer(); - private void OnResize() + base.OnResize(); + } + + private void RecreateBackBuffer() { if (mRenderTarget.ClientSize.Width == 0 || mRenderTarget.ClientSize.Height == 0) return; - + if (mBackBuffer != null) mBackBuffer.Dispose(); mBackBuffer = new Bitmap(mRenderTarget.ClientSize.Width, mRenderTarget.ClientSize.Height); - + if (mFrameBuffer != null) mFrameBuffer.BackBufferBitmap = mBackBuffer; } Modified: trunk/Drivers/AgateOTK/GL_DisplayControl.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_DisplayControl.cs 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/Drivers/AgateOTK/GL_DisplayControl.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -380,12 +380,15 @@ mRenderTarget.MouseDown += new System.Windows.Forms.MouseEventHandler(pct_MouseDown); mRenderTarget.MouseUp += new System.Windows.Forms.MouseEventHandler(pct_MouseUp); mRenderTarget.DoubleClick += new EventHandler(mRenderTarget_DoubleClick); + System.Windows.Forms.Form form = (mRenderTarget.TopLevelControl as System.Windows.Forms.Form); + form.KeyPreview = true; - form.KeyPreview = true; form.KeyDown += new System.Windows.Forms.KeyEventHandler(form_KeyDown); form.KeyUp += new System.Windows.Forms.KeyEventHandler(form_KeyUp); - + form.FormClosing += new FormClosingEventHandler(form_FormClosing); + form.FormClosed += new FormClosedEventHandler(form_FormClosed); + } private void DetachEvents() { @@ -400,13 +403,30 @@ mRenderTarget.MouseDown -= new System.Windows.Forms.MouseEventHandler(pct_MouseDown); mRenderTarget.MouseUp -= new System.Windows.Forms.MouseEventHandler(pct_MouseUp); mRenderTarget.DoubleClick -= new EventHandler(mRenderTarget_DoubleClick); + System.Windows.Forms.Form form = (mRenderTarget.TopLevelControl as System.Windows.Forms.Form); form.KeyDown -= new System.Windows.Forms.KeyEventHandler(form_KeyDown); form.KeyUp -= new System.Windows.Forms.KeyEventHandler(form_KeyUp); + form.FormClosing -= new FormClosingEventHandler(form_FormClosing); + form.FormClosed -= new FormClosedEventHandler(form_FormClosed); + + } + void form_FormClosed(object sender, FormClosedEventArgs e) + { + OnClosed(); } + void form_FormClosing(object sender, FormClosingEventArgs e) + { + bool cancel = false; + + OnClosing(ref cancel); + + e.Cancel = cancel; + } + Mouse.MouseButtons GetButtons(System.Windows.Forms.MouseButtons buttons) { Mouse.MouseButtons retval = Mouse.MouseButtons.None; @@ -433,9 +453,10 @@ { mContext.Update(mWindowInfo); mFrameBuffer.SetSize(new Size(mRenderTarget.Width, mRenderTarget.Height)); + + OnResize(); } - void mRenderTarget_DoubleClick(object sender, EventArgs e) { Mouse.OnMouseDoubleClick(Mouse.MouseButtons.Primary); @@ -465,11 +486,6 @@ mIsClosed = true; } - - void form_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) - { - mIsClosed = true; - } void form_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { Keyboard.Keys[FormUtil.TransformWinFormsKey(e.KeyCode)] = false; @@ -478,6 +494,7 @@ { Keyboard.Keys[FormUtil.TransformWinFormsKey(e.KeyCode)] = true; } + public override bool IsClosed { get { return mIsClosed; } Modified: trunk/Drivers/AgateOTK/GL_GameWindow.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_GameWindow.cs 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/Drivers/AgateOTK/GL_GameWindow.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -209,6 +209,8 @@ mDisplay.InitializeCurrentContext(); mDrawBuffer = mDisplay.CreateDrawBuffer(); + + } public override FrameBufferImpl FrameBuffer @@ -222,11 +224,8 @@ } bool done = false; - void mWindow_CloseWindow(object sender, EventArgs e) - { - done = true; - } + void Keyboard_KeyDown(object sender, OpenTK.Input.KeyboardKeyEventArgs e) { KeyCode code = TransformKey(e.Key); @@ -289,7 +288,8 @@ private void AttachEvents() { - mWindow.Closing += mWindow_CloseWindow; + mWindow.Closed += new EventHandler<EventArgs>(mWindow_Closed); + mWindow.Closing += new EventHandler<System.ComponentModel.CancelEventArgs>(mWindow_Closing); mWindow.Resize += new EventHandler<EventArgs>(mWindow_Resize); mWindow.Keyboard.KeyRepeat = true; @@ -301,24 +301,28 @@ mWindow.Mouse.Move += new EventHandler<OpenTK.Input.MouseMoveEventArgs>(Mouse_Move); } - private void DetachEvents() + void mWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { - mWindow.Closing -= mWindow_CloseWindow; - mWindow.Resize -= mWindow_Resize; + bool cancel = false; - mWindow.Keyboard.KeyDown -= Keyboard_KeyDown; - mWindow.Keyboard.KeyUp -= Keyboard_KeyUp; + OnClosing(ref cancel); - mWindow.Mouse.ButtonDown -= Mouse_ButtonDown; - mWindow.Mouse.ButtonUp -= Mouse_ButtonUp; - mWindow.Mouse.Move -= Mouse_Move; + e.Cancel = cancel; } + void mWindow_Closed(object sender, EventArgs e) + { + done = true; + OnClosed(); + } + void mWindow_Resize(object sender, EventArgs e) { Debug.Print("Reseting viewport to {0}x{1}", mWindow.Width, mWindow.Height); GL.Viewport(0, 0, mWindow.Width, mWindow.Height); + + OnResize(); } private void CreateWindowedDisplay() Modified: trunk/Drivers/AgateSDX/AgateSDX.csproj =================================================================== --- trunk/Drivers/AgateSDX/AgateSDX.csproj 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/Drivers/AgateSDX/AgateSDX.csproj 2012-01-17 08:24:00 UTC (rev 1320) @@ -106,7 +106,7 @@ <PlatformTarget>x64</PlatformTarget> </PropertyGroup> <ItemGroup> - <Reference Include="SlimDX, Version=4.0.12.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86" /> + <Reference Include="SlimDX, Version=2.0.12.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86" /> <Reference Include="System"> <Name>System</Name> </Reference> Added: trunk/Tests/DisplayTests/DisplayWindowEvents.cs =================================================================== --- trunk/Tests/DisplayTests/DisplayWindowEvents.cs (rev 0) +++ trunk/Tests/DisplayTests/DisplayWindowEvents.cs 2012-01-17 08:24:00 UTC (rev 1320) @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib; +using AgateLib.DisplayLib; + +namespace Tests.DisplayTests +{ + class DisplayWindowEvents : IAgateTest + { + public string Name + { + get { return "Display Window Events"; } + } + + public string Category + { + get { return "Display"; } + } + + string text; + bool closedEvent; + bool closingEvent; + + public void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup(args)) + { + setup.InitializeAll(); + if (setup.WasCanceled) + return; + + DisplayWindow wind = DisplayWindow.CreateWindowed("Display Window Events", 640, 480, true); + + wind.Resize += new EventHandler(wind_Resize); + wind.Closed += new EventHandler(wind_Closed); + wind.Closing += new CancelEventHandler(wind_Closing); + + while (wind.IsClosed == false) + { + Display.BeginFrame(); + Display.Clear(); + + FontSurface.AgateSans24.DrawText(text); + + Display.EndFrame(); + Core.KeepAlive(); + } + } + + if (closedEvent == false) + { + System.Windows.Forms.MessageBox.Show( + "Closed event did not fire!"); + } + } + + void wind_Closing(object sender, ref bool cancel) + { + if (closingEvent == false) + { + text = "Closing event fired!" + Environment.NewLine + "Press close again to exit test."; + + closingEvent = true; + cancel = true; + } + } + + void wind_Closed(object sender, EventArgs e) + { + closedEvent = true; + } + + void wind_Resize(object sender, EventArgs e) + { + text = "Resize event fired!"; + } + + } +} Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2012-01-14 17:18:04 UTC (rev 1319) +++ trunk/Tests/Tests.csproj 2012-01-17 08:24:00 UTC (rev 1320) @@ -141,6 +141,7 @@ <DependentUpon>frmCapabilities.cs</DependentUpon> </Compile> <Compile Include="DisplayTests\ColorTest.cs" /> + <Compile Include="DisplayTests\DisplayWindowEvents.cs" /> <Compile Include="DisplayTests\PixelBufferMask.cs" /> <Compile Include="DisplayTests\ClipRect.cs" /> <Compile Include="DisplayTests\Prerendered.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-01-14 17:18:11
|
Revision: 1319 http://agate.svn.sourceforge.net/agate/?rev=1319&view=rev Author: kanato Date: 2012-01-14 17:18:04 +0000 (Sat, 14 Jan 2012) Log Message: ----------- Add code to export tables to CSV format. Modified Paths: -------------- trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs trunk/Tools/DatabaseEditor/DatabaseEditor.cs Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.Designer.cs 2012-01-14 17:18:04 UTC (rev 1319) @@ -43,13 +43,15 @@ this.smallIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.listToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tableContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.editColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.renameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.duplicateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.editColumnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveExportDialog = new System.Windows.Forms.SaveFileDialog(); this.tabContextMenu.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -72,9 +74,9 @@ this.lstTables.View = System.Windows.Forms.View.SmallIcon; this.lstTables.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.lstTables_AfterLabelEdit); this.lstTables.DoubleClick += new System.EventHandler(this.lstTables_DoubleClick); + this.lstTables.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lstTables_KeyDown); + this.lstTables.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstTables_MouseDown); this.lstTables.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lstTables_MouseUp); - this.lstTables.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstTables_MouseDown); - this.lstTables.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lstTables_KeyDown); // // largeImages // @@ -153,7 +155,7 @@ // largeIconsToolStripMenuItem // this.largeIconsToolStripMenuItem.Name = "largeIconsToolStripMenuItem"; - this.largeIconsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.largeIconsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.largeIconsToolStripMenuItem.Text = "Large Icons"; this.largeIconsToolStripMenuItem.Click += new System.EventHandler(this.largeIconsToolStripMenuItem_Click); // @@ -162,14 +164,14 @@ this.smallIconsToolStripMenuItem.Checked = true; this.smallIconsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.smallIconsToolStripMenuItem.Name = "smallIconsToolStripMenuItem"; - this.smallIconsToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.smallIconsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.smallIconsToolStripMenuItem.Text = "Small Icons"; this.smallIconsToolStripMenuItem.Click += new System.EventHandler(this.smallIconsToolStripMenuItem_Click); // // listToolStripMenuItem // this.listToolStripMenuItem.Name = "listToolStripMenuItem"; - this.listToolStripMenuItem.Size = new System.Drawing.Size(134, 22); + this.listToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.listToolStripMenuItem.Text = "List"; this.listToolStripMenuItem.Click += new System.EventHandler(this.listToolStripMenuItem_Click); // @@ -177,6 +179,7 @@ // this.tableContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.openToolStripMenuItem, + this.exportToolStripMenuItem, this.editColumnsToolStripMenuItem, this.toolStripSeparator1, this.renameToolStripMenuItem, @@ -184,8 +187,28 @@ this.toolStripSeparator2, this.deleteToolStripMenuItem}); this.tableContextMenu.Name = "tableContextMenu"; - this.tableContextMenu.Size = new System.Drawing.Size(155, 148); + this.tableContextMenu.Size = new System.Drawing.Size(155, 170); // + // openToolStripMenuItem + // + this.openToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.openToolStripMenuItem.Name = "openToolStripMenuItem"; + this.openToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.openToolStripMenuItem.Text = "Open"; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // editColumnsToolStripMenuItem + // + this.editColumnsToolStripMenuItem.Name = "editColumnsToolStripMenuItem"; + this.editColumnsToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.editColumnsToolStripMenuItem.Text = "Edit Columns..."; + this.editColumnsToolStripMenuItem.Click += new System.EventHandler(this.editColumnsToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(151, 6); + // // renameToolStripMenuItem // this.renameToolStripMenuItem.Name = "renameToolStripMenuItem"; @@ -196,42 +219,34 @@ // duplicateToolStripMenuItem // this.duplicateToolStripMenuItem.Name = "duplicateToolStripMenuItem"; - this.duplicateToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.duplicateToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.duplicateToolStripMenuItem.Text = "Duplicate"; this.duplicateToolStripMenuItem.Click += new System.EventHandler(this.duplicateToolStripMenuItem_Click); // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(151, 6); + // // deleteToolStripMenuItem // this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; - this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.deleteToolStripMenuItem.Size = new System.Drawing.Size(154, 22); this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // - // openToolStripMenuItem + // exportToolStripMenuItem // - this.openToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.openToolStripMenuItem.Text = "Open"; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; + this.exportToolStripMenuItem.Size = new System.Drawing.Size(154, 22); + this.exportToolStripMenuItem.Text = "Export..."; + this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // - // toolStripSeparator1 + // saveExportDialog // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + this.saveExportDialog.DefaultExt = "txt"; + this.saveExportDialog.Filter = "Text Files (*.csv;*.txt)|*.csv;*.txt|All Files (*.*)|*.*"; // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6); - // - // editColumnsToolStripMenuItem - // - this.editColumnsToolStripMenuItem.Name = "editColumnsToolStripMenuItem"; - this.editColumnsToolStripMenuItem.Size = new System.Drawing.Size(154, 22); - this.editColumnsToolStripMenuItem.Text = "Edit Columns..."; - this.editColumnsToolStripMenuItem.Click += new System.EventHandler(this.editColumnsToolStripMenuItem_Click); - // // DatabaseEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -271,5 +286,7 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripMenuItem editColumnsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem; + private System.Windows.Forms.SaveFileDialog saveExportDialog; } } Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.cs =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2012-01-13 21:53:11 UTC (rev 1318) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.cs 2012-01-14 17:18:04 UTC (rev 1319) @@ -504,6 +504,45 @@ CurrentTable.SortDescending(); DirtyState = true; } + + private void exportToolStripMenuItem_Click(object sender, EventArgs e) + { + if (lstTables.SelectedItems.Count == 0) return; + + object obj = lstTables.SelectedItems[0].Tag; + + if (obj == null || obj is AgateTable != true) + return; + + AgateTable table = obj as AgateTable; + + saveExportDialog.FileName = table.Name + ".txt"; + + if (saveExportDialog.ShowDialog() == DialogResult.Cancel) + return; + + using (System.IO.StreamWriter w = new System.IO.StreamWriter(saveExportDialog.FileName)) + { + for (int i = 0; i < table.Columns.Count; i++) + { + if (i != 0) w.Write("\t"); + + w.Write(table.Columns[i].Name); + } + + for (int i = 0; i < table.Rows.Count; i++) + { + w.WriteLine(); + + for (int j = 0; j < table.Columns.Count; j++) + { + if (j != 0) w.Write("\t"); + + w.Write(table.Rows[i][table.Columns[j]]); + } + } + } + } } delegate void InvokeDelegate(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-01-13 21:53:19
|
Revision: 1318 http://agate.svn.sourceforge.net/agate/?rev=1318&view=rev Author: kanato Date: 2012-01-13 21:53:11 +0000 (Fri, 13 Jan 2012) Log Message: ----------- Converted all projects to target .NET 4.0 framework. Removed ERY prefix on NotebookLib namespaces. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/Drivers/AgateDrawing/AgateDrawing.csproj trunk/Drivers/AgateFMOD/AgateFMOD.csproj trunk/Drivers/AgateOTK/GL_Display.cs trunk/Drivers/AgateOTK/Legacy/LegacyDrawBuffer.cs trunk/Drivers/AgateSDX/AgateSDX.csproj trunk/Examples/BallBuster.Net/BallBuster.Net.csproj trunk/Examples/BallBuster.Net/main.cs trunk/Examples/Pong/Pong.csproj trunk/Examples/ShootTheTraps/ShootTheTraps.csproj trunk/Tests/Tests.csproj trunk/Tools/DatabaseEditor/DatabaseEditor.csproj trunk/Tools/DatabaseEditor/Import/frmImportTable.Designer.cs trunk/Tools/FontCreator/EditGlyphs.Designer.cs trunk/Tools/FontCreator/FontCreator.csproj trunk/Tools/FontCreator/app.config trunk/Tools/NotebookLib/NotebookLib/CloseTabEventArgs.cs trunk/Tools/NotebookLib/NotebookLib/DesignerClass/EditPagesList.cs trunk/Tools/NotebookLib/NotebookLib/DesignerClass/MySplitterDesigner.cs trunk/Tools/NotebookLib/NotebookLib/DesignerClass/NotebookDesigner.cs trunk/Tools/NotebookLib/NotebookLib/DesignerClass/PageDesigner.cs trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabNavigator.cs trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabProperties.cs trunk/Tools/NotebookLib/NotebookLib/HSeparator.Designer.cs trunk/Tools/NotebookLib/NotebookLib/HSeparator.cs trunk/Tools/NotebookLib/NotebookLib/INavigator.cs trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookNavigator.cs trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookProperties.cs trunk/Tools/NotebookLib/NotebookLib/NavigatorFactory.cs trunk/Tools/NotebookLib/NotebookLib/NavigatorLocation.cs trunk/Tools/NotebookLib/NotebookLib/NavigatorProperties.cs trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigator.cs trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigatorProperties.cs trunk/Tools/NotebookLib/NotebookLib/Notebook.Designer.cs trunk/Tools/NotebookLib/NotebookLib/Notebook.cs trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj trunk/Tools/NotebookLib/NotebookLib/NotebookPage.Designer.cs trunk/Tools/NotebookLib/NotebookLib/NotebookPage.cs trunk/Tools/NotebookLib/NotebookLib/Properties/Resources.Designer.cs trunk/Tools/NotebookLib/NotebookLib/Properties/Settings.Designer.cs trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj trunk/Tools/ResourceEditor/ResourceEditor.csproj trunk/Tools/ResourceEditor/StringTable/StringEntry.Designer.cs trunk/Tools/ResourceEditor/frmResourceEditor.Designer.cs Added Paths: ----------- trunk/Drivers/AgateSDX/Shaders/Hlsl/ trunk/Examples/BallBuster.Net/app.config trunk/Examples/Pong/app.config trunk/Examples/ShootTheTraps/app.config trunk/Tests/app.config trunk/Tools/PackedSpriteCreator/app.config trunk/Tools/ResourceEditor/app.config Property Changed: ---------------- trunk/Examples/BallBuster.Net/ trunk/Examples/Pong/ trunk/Examples/ShootTheTraps/ trunk/Tests/ Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/AgateLib/AgateLib.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> Modified: trunk/Drivers/AgateDrawing/AgateDrawing.csproj =================================================================== --- trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <BaseAddress>285212672</BaseAddress> Modified: trunk/Drivers/AgateFMOD/AgateFMOD.csproj =================================================================== --- trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -16,7 +16,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -27,6 +27,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <AllowUnsafeBlocks>False</AllowUnsafeBlocks> Modified: trunk/Drivers/AgateOTK/GL_Display.cs =================================================================== --- trunk/Drivers/AgateOTK/GL_Display.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Drivers/AgateOTK/GL_Display.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -385,7 +385,15 @@ mNonPowerOf2Textures = true; mSupportsShaders = true; } + if (mGLVersion < 1.2m) + { + System.Windows.Forms.MessageBox.Show( + "Error: OpenGL 1.2 or higher is required, but your system only supports OpenGL " + mGLVersion.ToString(), + "OpenGL 1.2 not aviable", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Stop); + throw new AgateLib.AgateException("OpenGL 1.2 or higher is required, but this system only supports OpenGL " + mGLVersion.ToString() + "."); + } + if (mGL3) mPrimitives = new GL3.GLPrimitiveRenderer(); else Modified: trunk/Drivers/AgateOTK/Legacy/LegacyDrawBuffer.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/LegacyDrawBuffer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Drivers/AgateOTK/Legacy/LegacyDrawBuffer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -32,8 +32,7 @@ namespace AgateOTK.Legacy { /// <summary> - /// Not GL3 compatible. Need replacements for - /// EnableClientState,TexCoordPointer, etc. + /// Uses /// </summary> public class LegacyDrawBuffer: GLDrawBuffer { @@ -87,6 +86,7 @@ int mIndex; int mCurrentTexture; + bool mValid = true; InterpolationMode lastInterpolation = (InterpolationMode)(-1); PointF[] cachePts = new PointF[4]; @@ -95,10 +95,22 @@ public LegacyDrawBuffer() { - GL.GenBuffers(1, out mBufferID); - Debug.Print("LegacyDrawBuffer: Draw buffer ID: {0}", mBufferID); + try + { + GL.GenBuffers(1, out mBufferID); + Debug.Print("LegacyDrawBuffer: Draw buffer ID: {0}", mBufferID); - SetBufferSize(1000); + SetBufferSize(1000); + } + catch (EntryPointNotFoundException e) + { + mValid = false; + + Trace.WriteLine("ERROR: Failed to create draw buffer."); + Trace.WriteLine("\tEntry point for glGenBuffers was not found."); + Trace.WriteLine("\tIt is likely that only a very old OpenGL is available."); + + } } private void SetBufferSize(int size) Modified: trunk/Drivers/AgateSDX/AgateSDX.csproj =================================================================== --- trunk/Drivers/AgateSDX/AgateSDX.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Drivers/AgateSDX/AgateSDX.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -16,7 +16,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -27,6 +27,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <AllowUnsafeBlocks>True</AllowUnsafeBlocks> @@ -105,7 +106,7 @@ <PlatformTarget>x64</PlatformTarget> </PropertyGroup> <ItemGroup> - <Reference Include="SlimDX, Version=2.0.8.42, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86" /> + <Reference Include="SlimDX, Version=4.0.12.43, Culture=neutral, PublicKeyToken=b1b0c32fd1ffe4f9, processorArchitecture=x86" /> <Reference Include="System"> <Name>System</Name> </Reference> Property changes on: trunk/Examples/BallBuster.Net ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Modified: trunk/Examples/BallBuster.Net/BallBuster.Net.csproj =================================================================== --- trunk/Examples/BallBuster.Net/BallBuster.Net.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Examples/BallBuster.Net/BallBuster.Net.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -30,7 +30,8 @@ <IsWebBootstrapper>false</IsWebBootstrapper> <UseApplicationTrust>false</UseApplicationTrust> <BootstrapperEnabled>true</BootstrapperEnabled> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -115,6 +116,7 @@ <DependentUpon>Resources.resx</DependentUpon> <DesignTime>True</DesignTime> </Compile> + <None Include="app.config" /> <None Include="OpenTK.dll.config"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> Added: trunk/Examples/BallBuster.Net/app.config =================================================================== --- trunk/Examples/BallBuster.Net/app.config (rev 0) +++ trunk/Examples/BallBuster.Net/app.config 2012-01-13 21:53:11 UTC (rev 1318) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Modified: trunk/Examples/BallBuster.Net/main.cs =================================================================== --- trunk/Examples/BallBuster.Net/main.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Examples/BallBuster.Net/main.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -983,7 +983,7 @@ } powerupLeft = 755; - powerupTop = 10 + img.font.StringDisplayHeight("A"); + powerupTop = 10 + img.font.FontHeight; for (int i = 0; i < lastPowerups.Count; i++) { @@ -1128,7 +1128,8 @@ if (start > -1) { - int fw = img.font.StringDisplayWidth(time); + Size size = img.font.MeasureString(time); + int fw = size.Width; int pos = powerupLeft + (40 - fw) / 2; img.font.Color = Color.Black; @@ -3495,8 +3496,9 @@ img.font.SetScale(scale, scale); - int width = img.font.StringDisplayWidth (str); - int height = img.font.StringDisplayHeight(str); + Size size = img.font.MeasureString(str); + int width = size.Width; + int height = size.Height; myx -= width / 2; myy -= height / 2; @@ -4115,7 +4117,7 @@ { editorState.Menu.Clear(); - int height = img.font.StringDisplayHeight("M"); + int height = img.font.FontHeight; editorState.Menu.Add(new Point(13, 500), "[TITLE SCREEN]"); editorState.Menu.Add(new Point(13, 516), "[NEW LEVEL]"); Property changes on: trunk/Examples/Pong ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Modified: trunk/Examples/Pong/Pong.csproj =================================================================== --- trunk/Examples/Pong/Pong.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Examples/Pong/Pong.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -15,7 +15,8 @@ <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation> </UpgradeBackupLocation> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -93,6 +94,7 @@ <DependentUpon>Resources.resx</DependentUpon> <DesignTime>True</DesignTime> </Compile> + <None Include="app.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> Added: trunk/Examples/Pong/app.config =================================================================== --- trunk/Examples/Pong/app.config (rev 0) +++ trunk/Examples/Pong/app.config 2012-01-13 21:53:11 UTC (rev 1318) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Property changes on: trunk/Examples/ShootTheTraps ___________________________________________________________________ Added: svn:ignore + [Bb]in obj [Dd]ebug [Rr]elease *.user *.aps *.eto Modified: trunk/Examples/ShootTheTraps/ShootTheTraps.csproj =================================================================== --- trunk/Examples/ShootTheTraps/ShootTheTraps.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Examples/ShootTheTraps/ShootTheTraps.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -15,7 +15,8 @@ <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation> </UpgradeBackupLocation> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -104,6 +105,9 @@ <Name>AgateOTK</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Added: trunk/Examples/ShootTheTraps/app.config =================================================================== --- trunk/Examples/ShootTheTraps/app.config (rev 0) +++ trunk/Examples/ShootTheTraps/app.config 2012-01-13 21:53:11 UTC (rev 1318) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Property changes on: trunk/Tests ___________________________________________________________________ Modified: svn:ignore - *.suo obj + *.suo obj [Bb]in [Dd]ebug [Rr]elease *.user *.aps *.eto Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tests/Tests.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>WinExe</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -24,6 +24,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <BaseAddress>285212672</BaseAddress> @@ -441,6 +442,7 @@ <SubType>Designer</SubType> <DependentUpon>LightingTestForm.cs</DependentUpon> </EmbeddedResource> + <None Include="app.config" /> <None Include="Data\9ball.png"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> Added: trunk/Tests/app.config =================================================================== --- trunk/Tests/app.config (rev 0) +++ trunk/Tests/app.config 2012-01-13 21:53:11 UTC (rev 1318) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.csproj =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -181,6 +181,10 @@ <Project>{9490B719-829E-43A7-A5FE-8001F8A81759}</Project> <Name>AgateLib</Name> </ProjectReference> + <ProjectReference Include="..\AgateDataLib\AgateDataLib.csproj"> + <Project>{2F7A686B-2272-4803-9EF9-0B34BA7802DC}</Project> + <Name>AgateDataLib</Name> + </ProjectReference> <ProjectReference Include="..\NotebookLib\NotebookLib\NotebookLib.csproj"> <Project>{91F57346-B574-4D52-9EB0-AA191B552C94}</Project> <Name>NotebookLib</Name> Modified: trunk/Tools/DatabaseEditor/Import/frmImportTable.Designer.cs =================================================================== --- trunk/Tools/DatabaseEditor/Import/frmImportTable.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/DatabaseEditor/Import/frmImportTable.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -31,7 +31,7 @@ this.txtFileContents = new System.Windows.Forms.TextBox(); this.btnOK = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); - this.hSeparator1 = new ERY.NotebookLib.HSeparator(); + this.hSeparator1 = new NotebookLib.HSeparator(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.chkMergeDelimiters = new System.Windows.Forms.CheckBox(); this.txtOther = new System.Windows.Forms.TextBox(); @@ -387,7 +387,7 @@ private System.Windows.Forms.TextBox txtFileContents; private System.Windows.Forms.Button btnOK; private System.Windows.Forms.Button btnCancel; - private ERY.NotebookLib.HSeparator hSeparator1; + private NotebookLib.HSeparator hSeparator1; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.TextBox txtOther; private System.Windows.Forms.CheckBox chkOther; Modified: trunk/Tools/FontCreator/EditGlyphs.Designer.cs =================================================================== --- trunk/Tools/FontCreator/EditGlyphs.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/FontCreator/EditGlyphs.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -32,7 +32,7 @@ this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.pctImage = new System.Windows.Forms.PictureBox(); this.pctZoom = new System.Windows.Forms.PictureBox(); - this.hSeparator1 = new ERY.NotebookLib.HSeparator(); + this.hSeparator1 = new NotebookLib.HSeparator(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.lstItems = new System.Windows.Forms.ListBox(); this.properties = new System.Windows.Forms.PropertyGrid(); @@ -242,7 +242,7 @@ private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.PropertyGrid properties; private System.Windows.Forms.ListBox lstItems; - private ERY.NotebookLib.HSeparator hSeparator1; + private NotebookLib.HSeparator hSeparator1; private System.Windows.Forms.PictureBox pctZoom; private System.Windows.Forms.SplitContainer splitContainer3; private System.Windows.Forms.ToolStrip toolStrip1; Modified: trunk/Tools/FontCreator/FontCreator.csproj =================================================================== --- trunk/Tools/FontCreator/FontCreator.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/FontCreator/FontCreator.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>WinExe</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <BaseAddress>285212672</BaseAddress> @@ -133,6 +134,7 @@ </ProjectReference> </ItemGroup> <ItemGroup> + <None Include="app.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> Modified: trunk/Tools/FontCreator/app.config =================================================================== --- trunk/Tools/FontCreator/app.config 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/FontCreator/app.config 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,8 +1,8 @@ -<?xml version="1.0" encoding="utf-8" ?> +<?xml version="1.0"?> <configuration> <configSections> - <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > - <section name="FontCreator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> + <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <section name="FontCreator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> </sectionGroup> </configSections> <userSettings> @@ -12,4 +12,4 @@ </setting> </FontCreator.Properties.Settings> </userSettings> -</configuration> \ No newline at end of file +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Modified: trunk/Tools/NotebookLib/NotebookLib/CloseTabEventArgs.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/CloseTabEventArgs.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/CloseTabEventArgs.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -3,7 +3,7 @@ using System.ComponentModel; using System.Text; -namespace ERY.NotebookLib +namespace NotebookLib { public class ClosePageQueryEventArgs : CancelEventArgs { Modified: trunk/Tools/NotebookLib/NotebookLib/DesignerClass/EditPagesList.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/DesignerClass/EditPagesList.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/DesignerClass/EditPagesList.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -4,7 +4,7 @@ using System.ComponentModel.Design; using System.ComponentModel; -namespace ERY.NotebookLib.DesignerClass +namespace NotebookLib.DesignerClass { class EditPagesList : DesignerActionList { Modified: trunk/Tools/NotebookLib/NotebookLib/DesignerClass/MySplitterDesigner.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/DesignerClass/MySplitterDesigner.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/DesignerClass/MySplitterDesigner.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -7,7 +7,7 @@ using System.Windows.Forms.Design; using System.Text; -namespace ERY.NotebookLib.DesignerClass +namespace NotebookLib.DesignerClass { class MySplitterDesigner : ControlDesigner { Modified: trunk/Tools/NotebookLib/NotebookLib/DesignerClass/NotebookDesigner.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/DesignerClass/NotebookDesigner.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/DesignerClass/NotebookDesigner.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -9,7 +9,7 @@ using System.Windows.Forms.Design; using System.Windows.Forms.Design.Behavior; -namespace ERY.NotebookLib.DesignerClass +namespace NotebookLib.DesignerClass { class NotebookDesigner : ParentControlDesigner { Modified: trunk/Tools/NotebookLib/NotebookLib/DesignerClass/PageDesigner.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/DesignerClass/PageDesigner.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/DesignerClass/PageDesigner.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -7,7 +7,7 @@ using System.Windows.Forms.Design; using System.Text; -namespace ERY.NotebookLib.DesignerClass +namespace NotebookLib.DesignerClass { class PageDesigner : ParentControlDesigner { Modified: trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabNavigator.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabNavigator.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabNavigator.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib.FlatTabs +namespace NotebookLib.FlatTabs { [ToolboxItem(false)] class FlatTabNavigator : Control, INavigator Modified: trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabProperties.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabProperties.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/FlatTabs/FlatTabProperties.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -5,7 +5,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib.FlatTabs +namespace NotebookLib.FlatTabs { class FlatTabProperties : NavigatorProperties { Modified: trunk/Tools/NotebookLib/NotebookLib/HSeparator.Designer.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/HSeparator.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/HSeparator.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -namespace ERY.NotebookLib +namespace NotebookLib { partial class HSeparator { Modified: trunk/Tools/NotebookLib/NotebookLib/HSeparator.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/HSeparator.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/HSeparator.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib +namespace NotebookLib { public partial class HSeparator : UserControl { Modified: trunk/Tools/NotebookLib/NotebookLib/INavigator.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/INavigator.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/INavigator.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -4,7 +4,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib +namespace NotebookLib { public interface INavigator { Modified: trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookNavigator.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookNavigator.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookNavigator.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib.ListBookNavigator +namespace NotebookLib.ListBookNavigator { [ToolboxItem(false)] public partial class ListBookNavigator : ListBox, INavigator Modified: trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookProperties.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookProperties.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/ListBookNavigator/ListBookProperties.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -3,7 +3,7 @@ using System.ComponentModel; using System.Text; -namespace ERY.NotebookLib.ListBookNavigator +namespace NotebookLib.ListBookNavigator { [Editor(typeof(System.Drawing.Design.UITypeEditor), typeof(System.Drawing.Design.UITypeEditor))] class ListBookProperties : NavigatorProperties Modified: trunk/Tools/NotebookLib/NotebookLib/NavigatorFactory.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NavigatorFactory.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NavigatorFactory.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace ERY.NotebookLib +namespace NotebookLib { public enum NavigatorType { Modified: trunk/Tools/NotebookLib/NotebookLib/NavigatorLocation.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NavigatorLocation.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NavigatorLocation.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -namespace ERY.NotebookLib +namespace NotebookLib { public enum NavigatorLocation { Modified: trunk/Tools/NotebookLib/NotebookLib/NavigatorProperties.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NavigatorProperties.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NavigatorProperties.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -5,7 +5,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib +namespace NotebookLib { [TypeConverter(typeof(ExpandableObjectConverter))] [Editor(typeof(System.Drawing.Design.UITypeEditor), typeof(System.Drawing.Design.UITypeEditor))] Modified: trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigator.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigator.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigator.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -3,7 +3,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib.NoNavigator +namespace NotebookLib.NoNavigator { class NoNavigator : Control, INavigator { Modified: trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigatorProperties.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigatorProperties.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NoNavigator/NoNavigatorProperties.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace ERY.NotebookLib.NoNavigator +namespace NotebookLib.NoNavigator { class NoNavigatorProperties : NavigatorProperties { Modified: trunk/Tools/NotebookLib/NotebookLib/Notebook.Designer.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/Notebook.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/Notebook.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -namespace ERY.NotebookLib +namespace NotebookLib { partial class Notebook { Modified: trunk/Tools/NotebookLib/NotebookLib/Notebook.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/Notebook.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/Notebook.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib +namespace NotebookLib { [Designer(typeof(DesignerClass.NotebookDesigner))] [ToolboxBitmap(typeof(Notebook), "book_reportHS")] Modified: trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <BaseAddress>285212672</BaseAddress> Modified: trunk/Tools/NotebookLib/NotebookLib/NotebookPage.Designer.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NotebookPage.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NotebookPage.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -namespace ERY.NotebookLib +namespace NotebookLib { partial class NotebookPage { Modified: trunk/Tools/NotebookLib/NotebookLib/NotebookPage.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NotebookPage.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/NotebookPage.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace ERY.NotebookLib +namespace NotebookLib { [ToolboxItem(false)] [Designer(typeof(DesignerClass.PageDesigner))] Modified: trunk/Tools/NotebookLib/NotebookLib/Properties/Resources.Designer.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/Properties/Resources.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/Properties/Resources.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -8,7 +8,7 @@ // </auto-generated> //------------------------------------------------------------------------------ -namespace ERY.NotebookLib.Properties { +namespace NotebookLib.Properties { using System; Modified: trunk/Tools/NotebookLib/NotebookLib/Properties/Settings.Designer.cs =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/Properties/Settings.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/NotebookLib/NotebookLib/Properties/Settings.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -8,7 +8,7 @@ // </auto-generated> //------------------------------------------------------------------------------ -namespace ERY.NotebookLib.Properties { +namespace NotebookLib.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] Modified: trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj =================================================================== --- trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>WinExe</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <BaseAddress>285212672</BaseAddress> @@ -203,6 +204,9 @@ <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> Added: trunk/Tools/PackedSpriteCreator/app.config =================================================================== --- trunk/Tools/PackedSpriteCreator/app.config (rev 0) +++ trunk/Tools/PackedSpriteCreator/app.config 2012-01-13 21:53:11 UTC (rev 1318) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Modified: trunk/Tools/ResourceEditor/ResourceEditor.csproj =================================================================== --- trunk/Tools/ResourceEditor/ResourceEditor.csproj 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/ResourceEditor/ResourceEditor.csproj 2012-01-13 21:53:11 UTC (rev 1318) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>WinExe</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <BaseAddress>285212672</BaseAddress> @@ -201,6 +202,7 @@ <SubType>Designer</SubType> <DependentUpon>StringTableEditor.cs</DependentUpon> </EmbeddedResource> + <None Include="app.config" /> <None Include="Resources\Broom.png"> </None> <None Include="Resources\Control_Form.png"> Modified: trunk/Tools/ResourceEditor/StringTable/StringEntry.Designer.cs =================================================================== --- trunk/Tools/ResourceEditor/StringTable/StringEntry.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/ResourceEditor/StringTable/StringEntry.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -30,7 +30,7 @@ { this.languageLabel = new System.Windows.Forms.Label(); this.box = new System.Windows.Forms.TextBox(); - this.hSeparator1 = new ERY.NotebookLib.HSeparator(); + this.hSeparator1 = new NotebookLib.HSeparator(); this.SuspendLayout(); // // languageLabel @@ -86,6 +86,6 @@ private System.Windows.Forms.Label languageLabel; private System.Windows.Forms.TextBox box; - private ERY.NotebookLib.HSeparator hSeparator1; + private NotebookLib.HSeparator hSeparator1; } } Added: trunk/Tools/ResourceEditor/app.config =================================================================== --- trunk/Tools/ResourceEditor/app.config (rev 0) +++ trunk/Tools/ResourceEditor/app.config 2012-01-13 21:53:11 UTC (rev 1318) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Modified: trunk/Tools/ResourceEditor/frmResourceEditor.Designer.cs =================================================================== --- trunk/Tools/ResourceEditor/frmResourceEditor.Designer.cs 2012-01-13 21:02:50 UTC (rev 1317) +++ trunk/Tools/ResourceEditor/frmResourceEditor.Designer.cs 2012-01-13 21:53:11 UTC (rev 1318) @@ -32,18 +32,18 @@ this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.mainbook = new ERY.NotebookLib.Notebook(); - this.notebookPage5 = new ERY.NotebookLib.NotebookPage(); - this.notebookPage3 = new ERY.NotebookLib.NotebookPage(); - this.notebookPage4 = new ERY.NotebookLib.NotebookPage(); - this.fontPage = new ERY.NotebookLib.NotebookPage(); - this.pageStrings = new ERY.NotebookLib.NotebookPage(); + this.mainbook = new NotebookLib.Notebook(); + this.notebookPage5 = new NotebookLib.NotebookPage(); + this.notebookPage3 = new NotebookLib.NotebookPage(); + this.notebookPage4 = new NotebookLib.NotebookPage(); + this.fontPage = new NotebookLib.NotebookPage(); + this.pageStrings = new NotebookLib.NotebookPage(); this.stringTableEditor1 = new ResourceEditor.StringTable.StringTableEditor(); - this.pageWindow = new ERY.NotebookLib.NotebookPage(); + this.pageWindow = new NotebookLib.NotebookPage(); this.displayWindowEditor1 = new ResourceEditor.DisplayWinds.DisplayWindowEditor(); - this.pageNumbers = new ERY.NotebookLib.NotebookPage(); - this.notebookPage1 = new ERY.NotebookLib.NotebookPage(); - this.notebookPage2 = new ERY.NotebookLib.NotebookPage(); + this.pageNumbers = new NotebookLib.NotebookPage(); + this.notebookPage1 = new NotebookLib.NotebookPage(); + this.notebookPage2 = new NotebookLib.NotebookPage(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newResourceFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -141,7 +141,7 @@ this.mainbook.Name = "mainbook"; this.mainbook.Navigator.Margin = new System.Windows.Forms.Padding(3); this.mainbook.Navigator.PageBackColor = System.Drawing.SystemColors.Control; - this.mainbook.NavigatorType = ERY.NotebookLib.NavigatorType.ListBook; + this.mainbook.NavigatorType = NotebookLib.NavigatorType.ListBook; this.mainbook.SelectedIndex = 5; this.mainbook.Size = new System.Drawing.Size(608, 398); this.mainbook.SplitterLocation = 206; @@ -576,21 +576,21 @@ private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private ERY.NotebookLib.Notebook mainbook; - private ERY.NotebookLib.NotebookPage pageNumbers; - private ERY.NotebookLib.NotebookPage pageStrings; - private ERY.NotebookLib.NotebookPage notebookPage2; - private ERY.NotebookLib.NotebookPage notebookPage1; - private ERY.NotebookLib.NotebookPage pageWindow; - private ERY.NotebookLib.NotebookPage notebookPage3; - private ERY.NotebookLib.NotebookPage notebookPage4; - private ERY.NotebookLib.NotebookPage notebookPage5; + private NotebookLib.Notebook mainbook; + private NotebookLib.NotebookPage pageNumbers; + private NotebookLib.NotebookPage pageStrings; + private NotebookLib.NotebookPage notebookPage2; + private NotebookLib.NotebookPage notebookPage1; + private NotebookLib.NotebookPage pageWindow; + private NotebookLib.NotebookPage notebookPage3; + private NotebookLib.NotebookPage notebookPage4; + private NotebookLib.NotebookPage notebookPage5; private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem validateResourcesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem createDistributionToolStripMenuItem; private ResourceEditor.StringTable.StringTableEditor stringTableEditor1; private ResourceEditor.DisplayWinds.DisplayWindowEditor displayWindowEditor1; - private ERY.NotebookLib.NotebookPage fontPage; + private NotebookLib.NotebookPage fontPage; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2012-01-13 21:02:56
|
Revision: 1317 http://agate.svn.sourceforge.net/agate/?rev=1317&view=rev Author: kanato Date: 2012-01-13 21:02:50 +0000 (Fri, 13 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj trunk/Drivers/AgateOTK/AgateOTK.csproj trunk/Drivers/AgateSDL/AgateSDL.csproj trunk/Tools/AgateDataLib/AgateDataLib.csproj trunk/Tools/DatabaseEditor/DatabaseEditor.csproj Modified: trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj =================================================================== --- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2011-11-30 06:13:29 UTC (rev 1316) +++ trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2012-01-13 21:02:50 UTC (rev 1317) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <BaseAddress>285212672</BaseAddress> Modified: trunk/Drivers/AgateOTK/AgateOTK.csproj =================================================================== --- trunk/Drivers/AgateOTK/AgateOTK.csproj 2011-11-30 06:13:29 UTC (rev 1316) +++ trunk/Drivers/AgateOTK/AgateOTK.csproj 2012-01-13 21:02:50 UTC (rev 1317) @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> Modified: trunk/Drivers/AgateSDL/AgateSDL.csproj =================================================================== --- trunk/Drivers/AgateSDL/AgateSDL.csproj 2011-11-30 06:13:29 UTC (rev 1316) +++ trunk/Drivers/AgateSDL/AgateSDL.csproj 2012-01-13 21:02:50 UTC (rev 1317) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -14,7 +14,7 @@ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> <DelaySign>false</DelaySign> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <OutputType>Library</OutputType> <AppDesignerFolder> </AppDesignerFolder> @@ -23,6 +23,7 @@ </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> Modified: trunk/Tools/AgateDataLib/AgateDataLib.csproj =================================================================== --- trunk/Tools/AgateDataLib/AgateDataLib.csproj 2011-11-30 06:13:29 UTC (rev 1316) +++ trunk/Tools/AgateDataLib/AgateDataLib.csproj 2012-01-13 21:02:50 UTC (rev 1317) @@ -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> @@ -10,12 +10,13 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>DataLib</RootNamespace> <AssemblyName>DataLib</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <FileUpgradeFlags> </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> Modified: trunk/Tools/DatabaseEditor/DatabaseEditor.csproj =================================================================== --- trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2011-11-30 06:13:29 UTC (rev 1316) +++ trunk/Tools/DatabaseEditor/DatabaseEditor.csproj 2012-01-13 21:02:50 UTC (rev 1317) @@ -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> @@ -10,12 +10,13 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>AgateDatabaseEditor</RootNamespace> <AssemblyName>DatabaseEditor</AssemblyName> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <FileUpgradeFlags> </FileUpgradeFlags> <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation /> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -153,6 +154,7 @@ <DependentUpon>TableEditor.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <None Include="app.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> @@ -179,10 +181,6 @@ <Project>{9490B719-829E-43A7-A5FE-8001F8A81759}</Project> <Name>AgateLib</Name> </ProjectReference> - <ProjectReference Include="..\AgateDataLib\AgateDataLib.csproj"> - <Project>{2F7A686B-2272-4803-9EF9-0B34BA7802DC}</Project> - <Name>AgateDataLib</Name> - </ProjectReference> <ProjectReference Include="..\NotebookLib\NotebookLib\NotebookLib.csproj"> <Project>{91F57346-B574-4D52-9EB0-AA191B552C94}</Project> <Name>NotebookLib</Name> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-11-30 06:13:35
|
Revision: 1316 http://agate.svn.sourceforge.net/agate/?rev=1316&view=rev Author: kanato Date: 2011-11-30 06:13:29 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Fix playing of sounds in SDL. Modified Paths: -------------- trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs trunk/Tests/Launcher.cs trunk/Tests/Tests.csproj Added Paths: ----------- trunk/Tests/AudioTests/SoundbufferStopTester.cs trunk/Tests/Data/snda.wav trunk/Tests/Data/sndb.wav Modified: trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2011-11-29 07:10:53 UTC (rev 1315) +++ trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2011-11-30 06:13:29 UTC (rev 1316) @@ -29,6 +29,8 @@ public class SDL_Audio : AudioImpl { List<string> tempfiles = new List<string>(); + Dictionary<int, SDL_SoundBufferSession> mChannels = new Dictionary<int, SDL_SoundBufferSession>(); + SdlMixer.ChannelFinishedDelegate mChannelFinishedDelegate; ~SDL_Audio() { @@ -102,13 +104,27 @@ throw new AgateLib.AgateException("Failed to initialize SDL_mixer."); } + mChannelFinishedDelegate = ChannelFinished; + + SdlMixer.Mix_ChannelFinished(mChannelFinishedDelegate); + Report("SDL driver instantiated for audio."); } + void ChannelFinished(int channel) + { + mChannels[channel].mIsPlaying = false; + + mChannels.Remove(channel); + } + internal void RegisterTempFile(string filename) { tempfiles.Add(filename); } - + internal void RegisterChannel(int channel, SDL_SoundBufferSession session) + { + mChannels[channel] = session; + } } } Modified: trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs 2011-11-29 07:10:53 UTC (rev 1315) +++ trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs 2011-11-30 06:13:29 UTC (rev 1316) @@ -36,19 +36,26 @@ bool loop; Stopwatch watch = new Stopwatch(); SDL_SoundBuffer buffer; + SDL_Audio audio; + public bool mIsPlaying; + public SDL_SoundBufferSession(SDL_SoundBuffer buffer) { this.buffer = buffer; loop = buffer.Loop; sound = buffer.SoundChunk; - channel = SdlMixer.Mix_PlayChannel(-1, sound, LoopCount); volume = buffer.Volume; + channel = SdlMixer.Mix_PlayChannel(-1, sound, LoopCount); + audio = (SDL_Audio)AgateLib.AudioLib.Audio.Impl; + SetPanning(); + watch.Reset(); watch.Start(); + audio.RegisterChannel(channel, this); } public override void Dispose() { @@ -62,7 +69,7 @@ public override bool IsPlaying { - get { return SdlMixer.Mix_Playing(channel) != 0; } + get { return mIsPlaying; } } public override double Pan @@ -96,11 +103,23 @@ public override void Play() { - SdlMixer.Mix_PlayChannel(channel, sound, LoopCount); + if (IsPlaying == false) + { + channel = SdlMixer.Mix_PlayChannel(-1, sound, LoopCount); + } + else + { + SdlMixer.Mix_PlayChannel(channel, sound, LoopCount); + } + SetPanning(); watch.Reset(); watch.Start(); + + audio.RegisterChannel(channel, this); + + mIsPlaying = true; } int LoopCount Added: trunk/Tests/AudioTests/SoundbufferStopTester.cs =================================================================== --- trunk/Tests/AudioTests/SoundbufferStopTester.cs (rev 0) +++ trunk/Tests/AudioTests/SoundbufferStopTester.cs 2011-11-30 06:13:29 UTC (rev 1316) @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib; +using AgateLib.AudioLib; +using AgateLib.DisplayLib; +using AgateLib.Geometry; +using AgateLib.InputLib; + +namespace Tests.AudioTests +{ + class SoundbufferStopTester : IAgateTest + { + #region IAgateTest Members + + public string Name + { + get { return "SoundBuffer Stop"; } + } + + public string Category + { + get { return "Audio"; } + } + + SoundBuffer snda, sndb; + + public void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup()) + { + setup.Initialize(true, true, false); + if (setup.WasCanceled) + return; + + DisplayWindow wind = new DisplayWindow(CreateWindowParams.Windowed( + "Sound Buffer Tester", 640, 480, false, null)); + + snda = new SoundBuffer("snda.wav"); + sndb = new SoundBuffer("sndb.wav"); + + FontSurface font = FontSurface.AgateSans14; + + Keyboard.KeyDown += new InputEventHandler(Keyboard_KeyDown); + + while (wind.IsClosed == false) + { + Display.BeginFrame(); + Display.Clear(); + + font.Color = Color.White; + font.DrawText("Press a for first sound, b for second sound."); + + if (snda.IsPlaying) + font.DrawText(0, 30, "first sound is playing"); + if (sndb.IsPlaying) + font.DrawText(0, 60, "second sound is playing"); + + Display.EndFrame(); + Core.KeepAlive(); + } + } + } + + void Keyboard_KeyDown(InputEventArgs e) + { + if (e.KeyCode == KeyCode.A) + snda.Play(); + + if (e.KeyCode == KeyCode.B) + sndb.Play(); + } + + #endregion + } +} Added: trunk/Tests/Data/snda.wav =================================================================== (Binary files differ) Property changes on: trunk/Tests/Data/snda.wav ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/Tests/Data/sndb.wav =================================================================== (Binary files differ) Property changes on: trunk/Tests/Data/sndb.wav ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/Tests/Launcher.cs =================================================================== --- trunk/Tests/Launcher.cs 2011-11-29 07:10:53 UTC (rev 1315) +++ trunk/Tests/Launcher.cs 2011-11-30 06:13:29 UTC (rev 1316) @@ -13,6 +13,7 @@ public static void Main(string[] args) { AgateFileProvider.Images.AddPath("Data"); + AgateFileProvider.Sounds.AddPath("Data"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2011-11-29 07:10:53 UTC (rev 1315) +++ trunk/Tests/Tests.csproj 2011-11-30 06:13:29 UTC (rev 1316) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <ProjectType>Local</ProjectType> @@ -122,6 +122,7 @@ <Compile Include="AgateTestAttribute.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="AudioTests\SoundbufferStopTester.cs" /> <Compile Include="AudioTests\StreamAudio.cs" /> <Compile Include="CoreTests\PersistantSettingsTest.cs" /> <Compile Include="CoreTests\PlatformDetection\PlatformDetection.cs"> @@ -534,6 +535,12 @@ <Content Include="Data\mask_circle.png"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> + <Content Include="Data\snda.wav"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Data\sndb.wav"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-11-29 07:10:59
|
Revision: 1315 http://agate.svn.sourceforge.net/agate/?rev=1315&view=rev Author: kanato Date: 2011-11-29 07:10:53 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Test framebuffer resizing. Modified Paths: -------------- trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs trunk/Tests/settings_list.txt Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2011-11-29 07:10:37 UTC (rev 1314) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2011-11-29 07:10:53 UTC (rev 1315) @@ -1,49 +1,50 @@ -// The contents of this file are public domain. -// You may use them as you wish. -// -using System; -using System.Collections.Generic; -using AgateLib; -using AgateLib.DisplayLib; -using AgateLib.Geometry; - -namespace Tests.MultipleWindows -{ - class MultipleWindowTest : IAgateTest - { - Surface surf; - Random rand = new Random(); - FrameBuffer buffer; - - public string Name - { - get { return "Multiple Render Targets"; } - } - - public string Category - { - get { return "Display"; } - } - - public void Main(string[] args) - { - using (AgateSetup setup = new AgateSetup(args)) - { - setup.Initialize(true, false, false); - if (setup.WasCanceled) return; - - MultipleRenderTargetExample myForm = new MultipleRenderTargetExample(); - myForm.Show(); - - // create three display windows - DisplayWindow wnd_1 = DisplayWindow.CreateFromControl(myForm.pictureBox1); - DisplayWindow wnd_2 = DisplayWindow.CreateFromControl(myForm.pictureBox2); - DisplayWindow wnd_3 = DisplayWindow.CreateFromControl(myForm.pictureBox3); - - buffer = new FrameBuffer(200, 150); - - // this is the code that will be called when the button is pressed - myForm.btnDraw.Click += new EventHandler(btnDraw_Click); +// The contents of this file are public domain. +// You may use them as you wish. +// +using System; +using System.Collections.Generic; +using AgateLib; +using AgateLib.DisplayLib; +using AgateLib.Geometry; + +namespace Tests.MultipleWindows +{ + class MultipleWindowTest : IAgateTest + { + Surface surf; + Random rand = new Random(); + FrameBuffer buffer; + + public string Name + { + get { return "Multiple Render Targets"; } + } + + public string Category + { + get { return "Display"; } + } + + public void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup(args)) + { + setup.Initialize(true, false, false); + if (setup.WasCanceled) return; + + MultipleRenderTargetExample myForm = new MultipleRenderTargetExample(); + myForm.Show(); + + // create three display windows + DisplayWindow wnd_1 = DisplayWindow.CreateFromControl(myForm.pictureBox1); + DisplayWindow wnd_2 = DisplayWindow.CreateFromControl(myForm.pictureBox2); + DisplayWindow wnd_3 = DisplayWindow.CreateFromControl(myForm.pictureBox3); + + buffer = new FrameBuffer(wnd_3.Width, wnd_3.Height); + myForm.pictureBox3.Resize += new EventHandler(wnd_3_Resize); + + // this is the code that will be called when the button is pressed + myForm.btnDraw.Click += new EventHandler(btnDraw_Click); myForm.btnClearSurface.Click += new EventHandler(btnClear_Click); Surface image1 = new Surface("jellybean.png"); @@ -53,87 +54,110 @@ image2.DisplayWidth = 40; image2.DisplayHeight = (int)(image2.DisplayWidth * image2.SurfaceHeight / (double)image2.SurfaceWidth); - double time = 0; - - while (myForm.Visible) - { - // Render targets must be set before the call to BeginFrame, - // and may not be changed between BeginFrame and EndFrame. - // Use the FrameBuffer property of each DisplayWindow object - // to set the Display.RenderTarget value. - Display.RenderTarget = wnd_1.FrameBuffer; - - Display.BeginFrame(); - Display.Clear(Color.Red); + double time = 0; + + while (myForm.Visible) + { + // Render targets must be set before the call to BeginFrame, + // and may not be changed between BeginFrame and EndFrame. + // Use the FrameBuffer property of each DisplayWindow object + // to set the Display.RenderTarget value. + Display.RenderTarget = wnd_1.FrameBuffer; + + Display.BeginFrame(); + Display.Clear(Color.Red); Display.FillRect(new Rectangle(20, 20, 40, 30), Color.Blue); - image1.Draw(120 + (int)(30 * Math.Sin(time)), 20); - - Display.EndFrame(); - - // now do the second window. - Display.RenderTarget = wnd_2.FrameBuffer; - - Display.BeginFrame(); - Display.Clear(Color.Green); + image1.Draw(120 + (int)(30 * Math.Sin(time)), 20); + + Display.EndFrame(); + + // now do the second window. + Display.RenderTarget = wnd_2.FrameBuffer; + + Display.BeginFrame(); + Display.Clear(Color.Green); Display.FillRect(new Rectangle(20, 20, 40, 30), Color.Yellow); image2.Draw(120 + (int)(30 * Math.Cos(time)), 20); - Display.EndFrame(); - - // draw the third window from the surface - Display.RenderTarget = wnd_3.FrameBuffer; - - surf = buffer.RenderTarget; - - Display.BeginFrame(); - Display.Clear(Color.Black); - surf.Draw(0, 0); Display.EndFrame(); + // draw the third window from the surface + Display.RenderTarget = wnd_3.FrameBuffer; + + surf = buffer.RenderTarget; + + Display.BeginFrame(); + Display.Clear(Color.Black); + surf.Draw(0, 0); + Display.EndFrame(); + Core.KeepAlive(); time = Timing.TotalSeconds; - //System.Threading.Thread.Sleep(250); - - } - - } - - - } - - void btnClear_Click(object sender, EventArgs e) - { - Display.RenderTarget = buffer; - - Display.BeginFrame(); - Display.Clear(0, 0, 0, 0); - Display.EndFrame(); - } - - void btnDraw_Click(object sender, EventArgs e) - { - Display.RenderTarget = buffer; - - Display.BeginFrame(); - - Rectangle rect = new Rectangle( - rand.Next(-10, 190), - rand.Next(-10, 140), - rand.Next(20, 100), - rand.Next(20, 100)); - Color clr = Color.FromArgb(255 /*rand.Next(200, 256)*/, rand.Next(0, 256), - rand.Next(0, 256), rand.Next(0, 256)); - - Display.FillRect(rect, clr); - - Display.EndFrame(); - - surf.SaveTo("test.png", ImageFileFormat.Png); - - System.Diagnostics.Debug.Print("Wrote rectangle to {0} with color {1}.", rect, clr); - System.Diagnostics.Debug.Flush(); - } - - - } + //System.Threading.Thread.Sleep(250); + + } + + } + + + } + + void wnd_3_Resize(object sender, EventArgs e) + { + var ctrl = (System.Windows.Forms.Control )sender; + + FrameBuffer newBuffer = new FrameBuffer(ctrl.Width, ctrl.Height); + + Display.RenderTarget = newBuffer; + + Display.BeginFrame(); + Display.Clear(); + + buffer.RenderTarget.Draw(new Rectangle(0, 0, buffer.Width, buffer.Height)); + + Display.EndFrame(); + + buffer.Dispose(); + buffer = newBuffer; + } + + void btnClear_Click(object sender, EventArgs e) + { + Display.RenderTarget = buffer; + + Display.BeginFrame(); + Display.Clear(0, 0, 0, 0); + Display.EndFrame(); + } + + void btnDraw_Click(object sender, EventArgs e) + { + Display.RenderTarget = buffer; + + Display.BeginFrame(); + + int width = rand.Next(20, 100); + int height = rand.Next(20, 100); + + Rectangle rect = new Rectangle( + rand.Next(0, buffer.Width - width), + rand.Next(0, buffer.Height - height), + width, + height); + + Color clr = Color.FromArgb(255 /*rand.Next(200, 256)*/, rand.Next(0, 256), + rand.Next(0, 256), rand.Next(0, 256)); + + Display.FillRect(rect, clr); + + Display.EndFrame(); + + surf.SaveTo("test.png", ImageFileFormat.Png); + + System.Diagnostics.Debug.Print("Wrote rectangle to {0} with color {1}.", rect, clr); + System.Diagnostics.Debug.Flush(); + } + + + } } \ No newline at end of file Modified: trunk/Tests/settings_list.txt =================================================================== --- trunk/Tests/settings_list.txt 2011-11-29 07:10:37 UTC (rev 1314) +++ trunk/Tests/settings_list.txt 2011-11-29 07:10:53 UTC (rev 1315) @@ -2,5 +2,5 @@ AgateLib.DisplayDriver AgateLib.InputDriver AgateLib.OpenGL.DisableFramebufferArb -AgateLib.OpenGL.EnableGL3 true +AgateLib.OpenGL.EnableGL3 false AgateLib.OpenGL.DisableFramebufferExt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-11-29 07:10:43
|
Revision: 1314 http://agate.svn.sourceforge.net/agate/?rev=1314&view=rev Author: kanato Date: 2011-11-29 07:10:37 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Implement GL3/FrameBuffer.Dispose method. Modified Paths: -------------- trunk/AgateLib/DisplayLib/DisplayWindow.cs trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs Modified: trunk/AgateLib/DisplayLib/DisplayWindow.cs =================================================================== --- trunk/AgateLib/DisplayLib/DisplayWindow.cs 2011-11-29 02:48:54 UTC (rev 1313) +++ trunk/AgateLib/DisplayLib/DisplayWindow.cs 2011-11-29 07:10:37 UTC (rev 1314) @@ -84,7 +84,7 @@ "Did you forget to call AgateSetup.Initialize or Display.Initialize?"); mImpl = Display.Impl.CreateDisplayWindow(windowParams); - + Display.RenderTarget = FrameBuffer; Display.DisposeDisplay += new Display.DisposeDisplayHandler(Dispose); Modified: trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs =================================================================== --- trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2011-11-29 02:48:54 UTC (rev 1313) +++ trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2011-11-29 07:10:37 UTC (rev 1314) @@ -83,16 +83,19 @@ mHasDepth = true; mHasStencil = true; } + public override void Dispose() + { + GL.DeleteFramebuffers(1, ref mFramebufferID); + GL.DeleteRenderbuffers(1, ref mDepthBuffer); + // TODO: Should we delete the surface also? + } + public override SurfaceImpl RenderTarget { get { return mTexture; } } - public override void Dispose() - { - throw new NotImplementedException(); - } - + public override AgateLib.Geometry.Size Size { get { return mSize; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2011-11-29 02:49:00
|
Revision: 1313 http://agate.svn.sourceforge.net/agate/?rev=1313&view=rev Author: kanato Date: 2011-11-29 02:48:54 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Add images and resizing to multiple render target test. Modified Paths: -------------- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs trunk/Tests/settings_list.txt Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs 2011-11-29 02:46:09 UTC (rev 1312) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleRenderTargetExample.Designer.cs 2011-11-29 02:48:54 UTC (rev 1313) @@ -41,9 +41,17 @@ this.btnDraw = new System.Windows.Forms.Button(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnClearSurface = new System.Windows.Forms.Button(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); this.SuspendLayout(); // // pictureBox1 @@ -51,18 +59,21 @@ this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox1.Location = new System.Drawing.Point(12, 38); + this.pictureBox1.Location = new System.Drawing.Point(12, 32); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(136, 32); + this.pictureBox1.Size = new System.Drawing.Size(203, 91); this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.Tag = "Red Window"; // // pictureBox2 // - this.pictureBox2.Location = new System.Drawing.Point(12, 156); + this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox2.Location = new System.Drawing.Point(12, 29); this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(136, 70); + this.pictureBox2.Size = new System.Drawing.Size(203, 97); this.pictureBox2.TabIndex = 1; this.pictureBox2.TabStop = false; this.pictureBox2.Tag = "Green Window"; @@ -70,7 +81,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Location = new System.Drawing.Point(12, 3); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(133, 26); this.label1.TabIndex = 2; @@ -79,7 +90,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(12, 127); + this.label2.Location = new System.Drawing.Point(12, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(148, 26); this.label2.TabIndex = 3; @@ -88,7 +99,7 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(179, 9); + this.label3.Location = new System.Drawing.Point(3, 16); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(142, 13); this.label3.TabIndex = 5; @@ -96,16 +107,20 @@ // // pictureBox3 // - this.pictureBox3.Location = new System.Drawing.Point(182, 35); + this.pictureBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBox3.Location = new System.Drawing.Point(6, 32); this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(200, 150); + this.pictureBox3.Size = new System.Drawing.Size(279, 170); this.pictureBox3.TabIndex = 4; this.pictureBox3.TabStop = false; this.pictureBox3.Tag = "Red Window"; // // btnDraw // - this.btnDraw.Location = new System.Drawing.Point(307, 198); + this.btnDraw.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnDraw.Location = new System.Drawing.Point(208, 208); this.btnDraw.Name = "btnDraw"; this.btnDraw.Size = new System.Drawing.Size(75, 39); this.btnDraw.TabIndex = 6; @@ -115,34 +130,76 @@ // // btnClearSurface // - this.btnClearSurface.Location = new System.Drawing.Point(226, 198); + this.btnClearSurface.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnClearSurface.Location = new System.Drawing.Point(127, 208); this.btnClearSurface.Name = "btnClearSurface"; this.btnClearSurface.Size = new System.Drawing.Size(75, 39); this.btnClearSurface.TabIndex = 8; this.btnClearSurface.Text = "Clear Surface"; this.btnClearSurface.UseVisualStyleBackColor = true; // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.label3); + this.splitContainer1.Panel2.Controls.Add(this.btnClearSurface); + this.splitContainer1.Panel2.Controls.Add(this.pictureBox3); + this.splitContainer1.Panel2.Controls.Add(this.btnDraw); + this.splitContainer1.Size = new System.Drawing.Size(517, 259); + this.splitContainer1.SplitterDistance = 218; + this.splitContainer1.TabIndex = 9; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.label1); + this.splitContainer2.Panel1.Controls.Add(this.pictureBox1); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.label2); + this.splitContainer2.Panel2.Controls.Add(this.pictureBox2); + this.splitContainer2.Size = new System.Drawing.Size(218, 259); + this.splitContainer2.SplitterDistance = 126; + this.splitContainer2.TabIndex = 0; + // // MultipleRenderTargetExample // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(401, 249); - this.Controls.Add(this.btnClearSurface); - this.Controls.Add(this.btnDraw); - this.Controls.Add(this.label3); - this.Controls.Add(this.pictureBox3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.pictureBox1); + this.ClientSize = new System.Drawing.Size(517, 259); + this.Controls.Add(this.splitContainer1); this.Name = "MultipleRenderTargetExample"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; this.Text = "Multiple Render Targets Example"; ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.Panel2.PerformLayout(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel1.PerformLayout(); + this.splitContainer2.Panel2.ResumeLayout(false); + this.splitContainer2.Panel2.PerformLayout(); + this.splitContainer2.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); } @@ -157,6 +214,8 @@ private System.Windows.Forms.ToolTip toolTip1; public System.Windows.Forms.Button btnDraw; public System.Windows.Forms.Button btnClearSurface; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.SplitContainer splitContainer2; } } Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2011-11-29 02:46:09 UTC (rev 1312) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2011-11-29 02:48:54 UTC (rev 1313) @@ -44,17 +44,30 @@ // this is the code that will be called when the button is pressed myForm.btnDraw.Click += new EventHandler(btnDraw_Click); - myForm.btnClearSurface.Click += new EventHandler(btnClear_Click); + myForm.btnClearSurface.Click += new EventHandler(btnClear_Click); + + Surface image1 = new Surface("jellybean.png"); + Surface image2 = new Surface("9ball.png"); + image1.DisplayWidth = 40; + image1.DisplayHeight = (int)(image1.DisplayWidth * image1.SurfaceHeight / (double)image1.SurfaceWidth); + image2.DisplayWidth = 40; + image2.DisplayHeight = (int)(image2.DisplayWidth * image2.SurfaceHeight / (double)image2.SurfaceWidth); + + double time = 0; while (myForm.Visible) { // Render targets must be set before the call to BeginFrame, // and may not be changed between BeginFrame and EndFrame. + // Use the FrameBuffer property of each DisplayWindow object + // to set the Display.RenderTarget value. Display.RenderTarget = wnd_1.FrameBuffer; Display.BeginFrame(); Display.Clear(Color.Red); - Display.FillRect(new Rectangle(20, 20, 40, 30), Color.Blue); + Display.FillRect(new Rectangle(20, 20, 40, 30), Color.Blue); + image1.Draw(120 + (int)(30 * Math.Sin(time)), 20); + Display.EndFrame(); // now do the second window. @@ -62,7 +75,9 @@ Display.BeginFrame(); Display.Clear(Color.Green); - Display.FillRect(new Rectangle(20, 20, 40, 30), Color.Yellow); + Display.FillRect(new Rectangle(20, 20, 40, 30), Color.Yellow); + image2.Draw(120 + (int)(30 * Math.Cos(time)), 20); + Display.EndFrame(); // draw the third window from the surface @@ -73,9 +88,10 @@ Display.BeginFrame(); Display.Clear(Color.Black); surf.Draw(0, 0); - Display.EndFrame(); - - Core.KeepAlive(); + Display.EndFrame(); + + Core.KeepAlive(); + time = Timing.TotalSeconds; //System.Threading.Thread.Sleep(250); } Modified: trunk/Tests/settings_list.txt =================================================================== --- trunk/Tests/settings_list.txt 2011-11-29 02:46:09 UTC (rev 1312) +++ trunk/Tests/settings_list.txt 2011-11-29 02:48:54 UTC (rev 1313) @@ -3,3 +3,4 @@ AgateLib.InputDriver AgateLib.OpenGL.DisableFramebufferArb AgateLib.OpenGL.EnableGL3 true +AgateLib.OpenGL.DisableFramebufferExt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |