agate-svn-commit Mailing List for AgateLib (Page 16)
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...> - 2009-12-25 05:22:29
|
Revision: 1162 http://agate.svn.sourceforge.net/agate/?rev=1162&view=rev Author: kanato Date: 2009-12-25 05:22:19 +0000 (Fri, 25 Dec 2009) Log Message: ----------- Update paths for output in release configurations. Add SoundFormat enum. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/AgateLib/AudioLib/SoundBuffer.cs trunk/AgateLib/AudioLib/SoundBufferSession.cs trunk/AgateLib/Drivers/NullSoundImpl.cs trunk/AgateLib/ImplementationBase/AudioImpl.cs trunk/Drivers/AgateDrawing/AgateDrawing.csproj trunk/Drivers/AgateFMOD/FMOD_SoundBufferSession.cs trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj trunk/Drivers/AgateOTK/AgateOTK.csproj trunk/Drivers/AgateSDL/AgateSDL.csproj trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs trunk/Drivers/AgateSDX/AgateSDX.csproj trunk/Drivers/AgateSDX/FrameBufferWindow.cs trunk/Drivers/AgateSDX/SDX_Audio.cs trunk/Tests/AudioTests/GenerateAudio.cs trunk/Tests/Tests.csproj Added Paths: ----------- trunk/AgateLib/AudioLib/SoundFormat.cs Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/AgateLib/AgateLib.csproj 2009-12-25 05:22:19 UTC (rev 1162) @@ -56,7 +56,7 @@ <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> - <OutputPath>..\Binaries\Release\AgateLib\</OutputPath> + <OutputPath>..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -132,6 +132,7 @@ <Compile Include="AppInitParameters.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="AudioLib\SoundFormat.cs" /> <Compile Include="Core.cs"> <SubType>Code</SubType> </Compile> Modified: trunk/AgateLib/AudioLib/SoundBuffer.cs =================================================================== --- trunk/AgateLib/AudioLib/SoundBuffer.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/AgateLib/AudioLib/SoundBuffer.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -92,19 +92,14 @@ } /// <summary> - /// Creates an empty SoundBuffer object. + /// Constructs a SoundBuffer object, loading audio data from the passed stream. /// </summary> - /// <param name="size">The number of samples in this sound buffer.</param> - /// <param name="stereo"></param> - public SoundBuffer(int size) + /// <param name="source"></param> + public SoundBuffer(Stream source, SoundFormat format) { - impl = Audio.Impl.CreateSoundBuffer(size); + impl = Audio.Impl.CreateSoundBuffer(source, format); } - public SoundBuffer(short[] data) - { - impl = Audio.Impl.CreateSoundBuffer(data); - } /// <summary> /// Disposes of the SoundBuffer object, and all SoundBufferSession objects /// created by this SoundBuffer. @@ -275,11 +270,6 @@ mSessions.Remove(session); } - - public void Write(short[] source, int srcIndex, int destIndex, int length) - { - impl.Write(source, srcIndex, destIndex, length); - } } } Modified: trunk/AgateLib/AudioLib/SoundBufferSession.cs =================================================================== --- trunk/AgateLib/AudioLib/SoundBufferSession.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/AgateLib/AudioLib/SoundBufferSession.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -57,6 +57,8 @@ { Volume = mSource.Volume; Pan = mSource.Pan; + + impl.Initialize(); } /// <summary> @@ -125,6 +127,12 @@ get { return impl.Pan; } set { impl.Pan = value; } } + + public int CurrentLocation + { + get { return impl.CurrentLocation; } + } + /// <summary> /// Returns true if this Session is playing. /// </summary> Added: trunk/AgateLib/AudioLib/SoundFormat.cs =================================================================== --- trunk/AgateLib/AudioLib/SoundFormat.cs (rev 0) +++ trunk/AgateLib/AudioLib/SoundFormat.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.AudioLib +{ + public enum SoundFormat + { + Raw16, + Wave, + } +} Modified: trunk/AgateLib/Drivers/NullSoundImpl.cs =================================================================== --- trunk/AgateLib/Drivers/NullSoundImpl.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/AgateLib/Drivers/NullSoundImpl.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -83,6 +83,15 @@ { get { return false; } } + + public override int CurrentLocation + { + get { return 0; } + } + + protected internal override void Initialize() + { + } } public class NullMusicImpl : MusicImpl { Modified: trunk/AgateLib/ImplementationBase/AudioImpl.cs =================================================================== --- trunk/AgateLib/ImplementationBase/AudioImpl.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/AgateLib/ImplementationBase/AudioImpl.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -73,6 +73,16 @@ public abstract SoundBufferImpl CreateSoundBuffer(Stream inStream); /// <summary> + /// Creates a SoundBufferImpl object. + /// </summary> + /// <param name="inStream"></param> + /// <returns></returns> + public virtual SoundBufferImpl CreateSoundBuffer(Stream inStream, AudioLib.SoundFormat format) + { + throw new NotImplementedException(); + } + + /// <summary> /// This function is called once a frame to allow the Audio driver to update /// information. There is no need to call base.Update() if overriding this /// function. @@ -81,15 +91,6 @@ { } - public virtual SoundBufferImpl CreateSoundBuffer(int size) - { - throw new NotImplementedException(); - } - - public virtual SoundBufferImpl CreateSoundBuffer(short[] data) - { - throw new NotImplementedException(); - } } /// <summary> @@ -112,12 +113,6 @@ public virtual bool Loop { get { return false; } set { } } - public virtual void Write(short[] source, int srcIndex, int destIndex, int length) - { - throw new NotImplementedException(); - } - - } /// <summary> /// Represents a playback instance. @@ -139,13 +134,8 @@ /// </summary> public abstract void Stop(); + public abstract int CurrentLocation { get; } - public virtual int BufferPointer - { - get { return -1; } - set { } - } - /// <summary> /// Gets or sets the volume this audio file is playing at. /// 0.0 is completely quiet. @@ -164,6 +154,11 @@ /// Gets whether or not this playback instance is actually playing. /// </summary> public abstract bool IsPlaying { get; } + + /// <summary> + /// Initializes the SoundBufferSession to begin playing. + /// </summary> + protected internal abstract void Initialize(); } /// <summary> Modified: trunk/Drivers/AgateDrawing/AgateDrawing.csproj =================================================================== --- trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2009-12-25 05:22:19 UTC (rev 1162) @@ -57,7 +57,7 @@ <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> - <OutputPath>..\..\Binaries\Release\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> Modified: trunk/Drivers/AgateFMOD/FMOD_SoundBufferSession.cs =================================================================== --- trunk/Drivers/AgateFMOD/FMOD_SoundBufferSession.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateFMOD/FMOD_SoundBufferSession.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -44,12 +44,13 @@ mSystem = mAudio.FMODSystem; mSound = mBuffer.FMODSound; - //CheckCreateChannel(); - CreateChannel(); - Volume = mBuffer.Volume; } + protected override void Initialize() + { + CreateChannel(); + } private void CheckFMODResult(FMOD.RESULT result) { if (result == FMOD.RESULT.ERR_INVALID_HANDLE) @@ -141,5 +142,17 @@ return mAudio.IsChannelPlaying(mChannel); } } + + public override int CurrentLocation + { + get + { + uint pos = 0; + + mChannel.getPosition(ref pos, FMOD.TIMEUNIT.PCMBYTES); + + return (int)pos / 2; + } + } } } Modified: trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj =================================================================== --- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-25 05:22:19 UTC (rev 1162) @@ -56,7 +56,7 @@ <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> - <OutputPath>..\..\Binaries\Release\AgateLib\</OutputPath> + <OutputPath>..\..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> Modified: trunk/Drivers/AgateOTK/AgateOTK.csproj =================================================================== --- trunk/Drivers/AgateOTK/AgateOTK.csproj 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateOTK/AgateOTK.csproj 2009-12-25 05:22:19 UTC (rev 1162) @@ -57,7 +57,7 @@ <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> - <OutputPath>..\..\Binaries\Release\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> Modified: trunk/Drivers/AgateSDL/AgateSDL.csproj =================================================================== --- trunk/Drivers/AgateSDL/AgateSDL.csproj 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateSDL/AgateSDL.csproj 2009-12-25 05:22:19 UTC (rev 1162) @@ -57,7 +57,7 @@ <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> - <OutputPath>..\..\Binaries\Release\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> Modified: trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -76,14 +76,6 @@ { return new SDL_SoundBuffer(inStream); } - public override SoundBufferImpl CreateSoundBuffer(int size) - { - return new SDL_SoundBuffer(size); - } - public override SoundBufferImpl CreateSoundBuffer(short[] data) - { - return new SDL_SoundBuffer(data); - } public override SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer) { return new SDL_SoundBufferSession((SDL_SoundBuffer)buffer); Modified: trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -36,6 +36,7 @@ double mVolume = 1.0; bool ownRam = false; IntPtr soundPtr; + int samplesPerSec = 22050; public SDL_SoundBuffer(Stream stream) { @@ -50,42 +51,16 @@ { LoadFromFile(filename); } - public SDL_SoundBuffer(int size) - { - int bytes = size * 2; - soundPtr = Marshal.AllocHGlobal(bytes); - ownRam = true; - sound = SdlMixer.Mix_QuickLoad_RAW(soundPtr, bytes); - } - public SDL_SoundBuffer(short[] data) - { - int bytes = data.Length * 2; - soundPtr = Marshal.AllocHGlobal(bytes); - ownRam = true; - Marshal.Copy(data, 0, soundPtr, data.Length); - - sound = SdlMixer.Mix_QuickLoad_RAW(soundPtr, bytes); - } - - public override void Write(short[] source, int srcIndex, int destIndex, int length) + ~SDL_SoundBuffer() { - if (soundPtr == IntPtr.Zero) - throw new AgateException("Cannot write to audio buffer loaded from a file."); - - SdlMixer.Mix_Chunk c = - (SdlMixer.Mix_Chunk)Marshal.PtrToStructure(sound, typeof(SdlMixer.Mix_Chunk)); - - unsafe - { - Marshal.Copy(source, srcIndex, (IntPtr)(((short*)c.abuf + destIndex)), length); - } + Dispose(false); } - ~SDL_SoundBuffer() + public int SamplePerSec { - Dispose(false); + get { return samplesPerSec; } } public override void Dispose() Modified: trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -18,6 +18,7 @@ // using System; using System.Collections.Generic; +using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; @@ -35,21 +36,32 @@ double volume; double pan; bool loop; + Stopwatch watch = new Stopwatch(); + SDL_SoundBuffer buffer; 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; + watch.Reset(); + watch.Start(); + } public override void Dispose() { Stop(); } + protected override void Initialize() + { + + } + public override bool IsPlaying { get { return SdlMixer.Mix_Playing(channel) != 0; } @@ -68,6 +80,14 @@ } } + public override int CurrentLocation + { + get + { + return (int)(watch.ElapsedMilliseconds / 1000.0 * buffer.SamplePerSec); + } + } + private void SetPanning() { byte leftVol = (byte)(pan <= 0 ? 255 : (int)((1.0 - pan) * 255)); @@ -80,6 +100,9 @@ { SdlMixer.Mix_PlayChannel(channel, sound, LoopCount); SetPanning(); + + watch.Reset(); + watch.Start(); } int LoopCount @@ -97,6 +120,8 @@ public override void Stop() { SdlMixer.Mix_Pause(channel); + + watch.Stop(); } public override double Volume Modified: trunk/Drivers/AgateSDX/AgateSDX.csproj =================================================================== --- trunk/Drivers/AgateSDX/AgateSDX.csproj 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateSDX/AgateSDX.csproj 2009-12-25 05:22:19 UTC (rev 1162) @@ -37,7 +37,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\..\Binaries\Debug\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -57,7 +57,7 @@ <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> - <OutputPath>..\..\Binaries\Release\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> Modified: trunk/Drivers/AgateSDX/FrameBufferWindow.cs =================================================================== --- trunk/Drivers/AgateSDX/FrameBufferWindow.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateSDX/FrameBufferWindow.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -31,8 +31,8 @@ public override void Dispose() { mSwap.Dispose(); - mBackBuffer.Dispose(); - mBackDepthStencil.Dispose(); + //mBackBuffer.Dispose(); + //mBackDepthStencil.Dispose(); } public override Size Size Modified: trunk/Drivers/AgateSDX/SDX_Audio.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Audio.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Drivers/AgateSDX/SDX_Audio.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -59,6 +59,11 @@ { return new SDX_SoundBuffer(this, inStream); } + public override SoundBufferImpl CreateSoundBuffer(Stream inStream, SoundFormat format) + { + return new SDX_SoundBuffer(this, inStream, format); + } + public override MusicImpl CreateMusic(System.IO.Stream musicStream) { CheckCoop(); @@ -105,6 +110,8 @@ AudioBuffer mBuffer; double mVolume; WaveFormat mFormat; + MemoryStream mem; + byte[] buffer; public SDX_SoundBuffer(SDX_Audio audio, Stream inStream) { @@ -118,13 +125,51 @@ mBuffer.Flags = BufferFlags.EndOfStream; mFormat = stream.Format; + } + public SDX_SoundBuffer(SDX_Audio audio, Stream inStream, SoundFormat format) + { + mAudio = audio; + + switch (format) + { + case SoundFormat.Wave: + WaveStream stream = new WaveStream(inStream); + + mBuffer = new AudioBuffer(); + mBuffer.AudioData = stream; + mBuffer.AudioBytes = (int)inStream.Length; + mBuffer.Flags = BufferFlags.EndOfStream; + + mFormat = stream.Format; + break; + + case SoundFormat.Raw16: + mBuffer = new AudioBuffer(); + mBuffer.AudioData = inStream; + mBuffer.AudioBytes = (int)inStream.Length; + mBuffer.Flags = BufferFlags.EndOfStream; + + mFormat = new WaveFormat(); + mFormat.BitsPerSample = 16; + mFormat.BlockAlignment = 2; + mFormat.Channels = 1; + mFormat.FormatTag = SlimDX.WaveFormatTag.Pcm; + mFormat.SamplesPerSecond = 44100; + mFormat.AverageBytesPerSecond = + mFormat.SamplesPerSecond * mFormat.BitsPerSample / 8; + + break; + } } public SDX_SoundBuffer(SDX_Audio audio, string filename) : this(audio, File.OpenRead(filename)) { } + + public override bool Loop { get; set; } + public override void Dispose() { mBuffer.Dispose(); @@ -147,6 +192,7 @@ } public class SDX_SoundBufferSession : SoundBufferSessionImpl { + SDX_SoundBuffer mSource; SDX_Audio mAudio; AudioBuffer mBuffer; SourceVoice mVoice; @@ -156,19 +202,36 @@ public SDX_SoundBufferSession(SDX_Audio audio, SDX_SoundBuffer source) { mAudio = audio; + mSource = source; mBuffer = source.Buffer; + mVolume = source.Volume; - mVoice = new SourceVoice(mAudio.Device, source.Format); - mVoice.SubmitSourceBuffer(mBuffer); - mVoice.Start(); - - mVolume = source.Volume; + Initialize(); } public override void Dispose() { mVoice.Dispose(); } + protected override void Initialize() + { + if (mVoice != null) + { + mVoice.Stop(); + mVoice.Dispose(); + } + + mVoice = new SourceVoice(mAudio.Device, mSource.Format); + mVoice.SubmitSourceBuffer(mBuffer); + } + + public override int CurrentLocation + { + get + { + return mVoice.State.SamplesPlayed; + } + } public override void Play() { mVoice.Start(); Modified: trunk/Tests/AudioTests/GenerateAudio.cs =================================================================== --- trunk/Tests/AudioTests/GenerateAudio.cs 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Tests/AudioTests/GenerateAudio.cs 2009-12-25 05:22:19 UTC (rev 1162) @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using System.Linq; using System.Text; using AgateLib; @@ -37,9 +38,13 @@ int frequency = 100; FillSoundBuffer(s, frequency); + + byte[] buffer = new byte[s.Length * 2]; + Buffer.BlockCopy(s, 0, buffer, 0, buffer.Length); + + MemoryStream ms = new MemoryStream(buffer); + SoundBuffer buf = new SoundBuffer(ms, SoundFormat.Raw16); - SoundBuffer buf = new SoundBuffer(s); - buf.Loop = true; SoundBufferSession ses = buf.Play(); @@ -62,8 +67,10 @@ { frequency += 50; FillSoundBuffer(s, frequency); - buf.Write(s, 0, 0, s.Length); + Buffer.BlockCopy(s, 0, buffer, 0, buffer.Length); + ms.Seek(0, SeekOrigin.Begin); + buf.Play(); w.Reset(); w.Start(); } Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2009-12-25 01:25:18 UTC (rev 1161) +++ trunk/Tests/Tests.csproj 2009-12-25 05:22:19 UTC (rev 1162) @@ -56,7 +56,7 @@ <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> - <OutputPath>..\Binaries\Release\Tests\</OutputPath> + <OutputPath>..\Binaries\Release\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-25 01:25:26
|
Revision: 1161 http://agate.svn.sourceforge.net/agate/?rev=1161&view=rev Author: kanato Date: 2009-12-25 01:25:18 +0000 (Fri, 25 Dec 2009) Log Message: ----------- Fix test launcher to not use Drivers directory. Modified Paths: -------------- trunk/Tests/Launcher.cs Modified: trunk/Tests/Launcher.cs =================================================================== --- trunk/Tests/Launcher.cs 2009-12-25 01:24:03 UTC (rev 1160) +++ trunk/Tests/Launcher.cs 2009-12-25 01:25:18 UTC (rev 1161) @@ -12,7 +12,6 @@ [STAThread] public static void Main(string[] args) { - AgateFileProvider.Assemblies.AddPath("../Drivers"); AgateFileProvider.Images.AddPath("Data"); Application.EnableVisualStyles(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-25 01:24:11
|
Revision: 1160 http://agate.svn.sourceforge.net/agate/?rev=1160&view=rev Author: kanato Date: 2009-12-25 01:24:03 +0000 (Fri, 25 Dec 2009) Log Message: ----------- Fix target directory for CPU-specific configurations. Change output target to Binaries\Debug for debug configurations. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/Drivers/AgateDrawing/AgateDrawing.csproj trunk/Drivers/AgateFMOD/AgateFMOD.csproj trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj trunk/Drivers/AgateOTK/AgateOTK.csproj trunk/Drivers/AgateSDL/AgateSDL.csproj trunk/Tests/Tests.csproj Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2009-12-25 01:16:27 UTC (rev 1159) +++ trunk/AgateLib/AgateLib.csproj 2009-12-25 01:24:03 UTC (rev 1160) @@ -37,7 +37,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\Binaries\Debug\AgateLib\</OutputPath> + <OutputPath>..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -66,7 +66,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> + <OutputPath>..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> @@ -85,7 +85,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> + <OutputPath>..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> Modified: trunk/Drivers/AgateDrawing/AgateDrawing.csproj =================================================================== --- trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2009-12-25 01:16:27 UTC (rev 1159) +++ trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2009-12-25 01:24:03 UTC (rev 1160) @@ -37,7 +37,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\..\Binaries\Debug\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -67,7 +67,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> @@ -83,7 +83,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> Modified: trunk/Drivers/AgateFMOD/AgateFMOD.csproj =================================================================== --- trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2009-12-25 01:16:27 UTC (rev 1159) +++ trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2009-12-25 01:24:03 UTC (rev 1160) @@ -37,7 +37,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\..\Binaries\Debug\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -67,7 +67,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> @@ -83,7 +83,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> Modified: trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj =================================================================== --- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-25 01:16:27 UTC (rev 1159) +++ trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-25 01:24:03 UTC (rev 1160) @@ -37,7 +37,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\..\Binaries\Debug\AgateLib\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -66,7 +66,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> @@ -83,7 +83,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> Modified: trunk/Drivers/AgateOTK/AgateOTK.csproj =================================================================== --- trunk/Drivers/AgateOTK/AgateOTK.csproj 2009-12-25 01:16:27 UTC (rev 1159) +++ trunk/Drivers/AgateOTK/AgateOTK.csproj 2009-12-25 01:24:03 UTC (rev 1160) @@ -37,7 +37,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\..\Binaries\Debug\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -67,7 +67,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> @@ -85,7 +85,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> Modified: trunk/Drivers/AgateSDL/AgateSDL.csproj =================================================================== --- trunk/Drivers/AgateSDL/AgateSDL.csproj 2009-12-25 01:16:27 UTC (rev 1159) +++ trunk/Drivers/AgateSDL/AgateSDL.csproj 2009-12-25 01:24:03 UTC (rev 1160) @@ -37,7 +37,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\..\Binaries\Debug\Drivers\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -67,7 +67,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> @@ -85,7 +85,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> + <OutputPath>..\..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2009-12-25 01:16:27 UTC (rev 1159) +++ trunk/Tests/Tests.csproj 2009-12-25 01:24:03 UTC (rev 1160) @@ -36,7 +36,7 @@ <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> - <OutputPath>..\Binaries\Debug\Tests\</OutputPath> + <OutputPath>..\Binaries\Debug\</OutputPath> <RegisterForComInterop>False</RegisterForComInterop> <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> @@ -66,7 +66,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x64\Debug\</OutputPath> + <OutputPath>..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> @@ -82,7 +82,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> - <OutputPath>bin\x86\Debug\</OutputPath> + <OutputPath>..\Binaries\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;</DefineConstants> <BaseAddress>285212672</BaseAddress> <FileAlignment>4096</FileAlignment> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-25 01:16:34
|
Revision: 1159 http://agate.svn.sourceforge.net/agate/?rev=1159&view=rev Author: kanato Date: 2009-12-25 01:16:27 +0000 (Fri, 25 Dec 2009) Log Message: ----------- Add configurations for different CPUs. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/AgateLib.sln trunk/Drivers/AgateDrawing/AgateDrawing.csproj trunk/Drivers/AgateFMOD/AgateFMOD.csproj trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj trunk/Drivers/AgateOTK/AgateOTK.csproj trunk/Drivers/AgateSDL/AgateSDL.csproj trunk/Tests/Tests.csproj Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/AgateLib/AgateLib.csproj 2009-12-25 01:16:27 UTC (rev 1159) @@ -64,6 +64,44 @@ <NoWarn> </NoWarn> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x64\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <OutputPath>bin\x64\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <DocumentationFile>AgateLib.xml</DocumentationFile> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <DocumentationFile>AgateLib.xml</DocumentationFile> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="System"> <Name>System</Name> Modified: trunk/AgateLib.sln =================================================================== --- trunk/AgateLib.sln 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/AgateLib.sln 2009-12-25 01:16:27 UTC (rev 1159) @@ -24,37 +24,91 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x64.ActiveCfg = Debug|x64 + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x64.Build.0 = Debug|x64 + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x86.ActiveCfg = Debug|x86 + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|x86.Build.0 = Debug|x86 + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.Build.0 = Release|Any CPU + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x64.ActiveCfg = Release|x64 + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x64.Build.0 = Release|x64 + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x86.ActiveCfg = Release|x86 + {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|x86.Build.0 = Release|x86 {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|x64.ActiveCfg = Debug|x64 + {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|x64.Build.0 = Debug|x64 + {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|x86.ActiveCfg = Debug|x86 + {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Debug|x86.Build.0 = Debug|x86 {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|Any CPU.ActiveCfg = Release|Any CPU {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|Any CPU.Build.0 = Release|Any CPU + {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|x64.ActiveCfg = Release|Any CPU + {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|x86.ActiveCfg = Release|x86 + {00C7FA95-98F4-43D9-9B63-34122B1DB003}.Release|x86.Build.0 = Release|x86 {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|x64.ActiveCfg = Debug|x64 + {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|x64.Build.0 = Debug|x64 + {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|x86.ActiveCfg = Debug|x86 + {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Debug|x86.Build.0 = Debug|x86 {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Release|Any CPU.Build.0 = Release|Any CPU + {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Release|x64.ActiveCfg = Release|Any CPU + {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Release|x86.ActiveCfg = Release|x86 + {9E095F03-BA3F-4EAD-A905-2A2647CE4405}.Release|x86.Build.0 = Release|x86 {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x64.ActiveCfg = Debug|x64 + {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x64.Build.0 = Debug|x64 + {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x86.ActiveCfg = Debug|x86 + {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|x86.Build.0 = Debug|x86 {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.ActiveCfg = Release|Any CPU {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.Build.0 = Release|Any CPU + {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x64.ActiveCfg = Release|Any CPU + {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x86.ActiveCfg = Release|x86 + {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|x86.Build.0 = Release|x86 {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|x64.ActiveCfg = Debug|x64 + {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|x64.Build.0 = Debug|x64 + {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|x86.ActiveCfg = Debug|x86 + {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|x86.Build.0 = Debug|x86 {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|Any CPU.ActiveCfg = Release|Any CPU {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|Any CPU.Build.0 = Release|Any CPU + {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|x64.ActiveCfg = Release|Any CPU + {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|x86.ActiveCfg = Release|x86 + {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|x86.Build.0 = Release|x86 {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|x64.ActiveCfg = Debug|x64 + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|x64.Build.0 = Debug|x64 + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|x86.ActiveCfg = Debug|x86 + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|x86.Build.0 = Debug|x86 {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|Any CPU.ActiveCfg = Release|Any CPU {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|Any CPU.Build.0 = Release|Any CPU - {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC687DB2-90A8-484D-AB99-B3D29FDD8D44}.Release|Any CPU.Build.0 = Release|Any CPU + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|x64.ActiveCfg = Release|Any CPU + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|x86.ActiveCfg = Release|x86 + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|x86.Build.0 = Release|x86 {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|x64.ActiveCfg = Debug|x64 + {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|x64.Build.0 = Debug|x64 + {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|x86.ActiveCfg = Debug|x86 + {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Debug|x86.Build.0 = Debug|x86 {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Release|Any CPU.ActiveCfg = Release|Any CPU {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Release|Any CPU.Build.0 = Release|Any CPU + {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Release|x64.ActiveCfg = Release|Any CPU + {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Release|x86.ActiveCfg = Release|x86 + {424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/Drivers/AgateDrawing/AgateDrawing.csproj =================================================================== --- trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/Drivers/AgateDrawing/AgateDrawing.csproj 2009-12-25 01:16:27 UTC (rev 1159) @@ -65,6 +65,38 @@ <NoWarn> </NoWarn> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x64\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <OutputPath>bin\x64\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="System"> <Name>System</Name> Modified: trunk/Drivers/AgateFMOD/AgateFMOD.csproj =================================================================== --- trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/Drivers/AgateFMOD/AgateFMOD.csproj 2009-12-25 01:16:27 UTC (rev 1159) @@ -1,12 +1,13 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{424C08A9-6CC6-4FFF-B782-CBD58BC42FCA}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon></ApplicationIcon> + <ApplicationIcon> + </ApplicationIcon> <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>AgateFMOD</AssemblyName> @@ -16,9 +17,11 @@ <DelaySign>false</DelaySign> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <OutputType>Library</OutputType> - <AppDesignerFolder></AppDesignerFolder> + <AppDesignerFolder> + </AppDesignerFolder> <RootNamespace>AgateFMOD</RootNamespace> - <StartupObject></StartupObject> + <StartupObject> + </StartupObject> <FileUpgradeFlags> </FileUpgradeFlags> </PropertyGroup> @@ -29,7 +32,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> @@ -38,7 +42,8 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AllowUnsafeBlocks>False</AllowUnsafeBlocks> @@ -47,7 +52,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> @@ -56,20 +62,53 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x64\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <OutputPath>bin\x64\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="System"> - <Name>System</Name> + <Name>System</Name> </Reference> <Reference Include="System.Core"> - <Name>System.Core</Name> + <Name>System.Core</Name> </Reference> <Reference Include="System.Data"> - <Name>System.Data</Name> + <Name>System.Data</Name> </Reference> <Reference Include="System.Xml"> - <Name>System.Xml</Name> + <Name>System.Xml</Name> </Reference> </ItemGroup> <ItemGroup> @@ -115,4 +154,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Modified: trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj =================================================================== --- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-25 01:16:27 UTC (rev 1159) @@ -64,6 +64,40 @@ <NoWarn> </NoWarn> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x64\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <OutputPath>bin\x64\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <DocumentationFile>AgateLib.WinForms.xml</DocumentationFile> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <DocumentationFile>AgateLib.WinForms.xml</DocumentationFile> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="System"> <Name>System</Name> Modified: trunk/Drivers/AgateOTK/AgateOTK.csproj =================================================================== --- trunk/Drivers/AgateOTK/AgateOTK.csproj 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/Drivers/AgateOTK/AgateOTK.csproj 2009-12-25 01:16:27 UTC (rev 1159) @@ -65,6 +65,42 @@ <NoWarn> </NoWarn> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x64\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <OutputPath>bin\x64\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="OpenTK"> <Name>OpenTK</Name> Modified: trunk/Drivers/AgateSDL/AgateSDL.csproj =================================================================== --- trunk/Drivers/AgateSDL/AgateSDL.csproj 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/Drivers/AgateSDL/AgateSDL.csproj 2009-12-25 01:16:27 UTC (rev 1159) @@ -1,12 +1,13 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{00C7FA95-98F4-43D9-9B63-34122B1DB003}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon></ApplicationIcon> + <ApplicationIcon> + </ApplicationIcon> <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>AgateSDL</AssemblyName> @@ -16,9 +17,11 @@ <DelaySign>false</DelaySign> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <OutputType>Library</OutputType> - <AppDesignerFolder></AppDesignerFolder> + <AppDesignerFolder> + </AppDesignerFolder> <RootNamespace>AgateSDL</RootNamespace> - <StartupObject></StartupObject> + <StartupObject> + </StartupObject> <FileUpgradeFlags> </FileUpgradeFlags> </PropertyGroup> @@ -29,7 +32,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> @@ -38,7 +42,8 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AllowUnsafeBlocks>True</AllowUnsafeBlocks> @@ -47,7 +52,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> @@ -56,21 +62,58 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x64\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <OutputPath>bin\x64\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="Tao.Sdl"> - <Name>Tao.Sdl</Name> + <Name>Tao.Sdl</Name> <HintPath>.\Tao.Sdl.dll</HintPath> </Reference> <Reference Include="System"> - <Name>System</Name> + <Name>System</Name> </Reference> <Reference Include="System.Core"> - <Name>System.Core</Name> + <Name>System.Core</Name> </Reference> <Reference Include="System.Xml"> - <Name>System.Xml</Name> + <Name>System.Xml</Name> </Reference> </ItemGroup> <ItemGroup> @@ -139,4 +182,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2009-12-22 18:31:51 UTC (rev 1158) +++ trunk/Tests/Tests.csproj 2009-12-25 01:16:27 UTC (rev 1159) @@ -64,6 +64,38 @@ <NoWarn> </NoWarn> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x64\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <OutputPath>bin\x64\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE;</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <Optimize>true</Optimize> + <FileAlignment>4096</FileAlignment> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="System"> <Name>System</Name> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-22 18:31:59
|
Revision: 1158 http://agate.svn.sourceforge.net/agate/?rev=1158&view=rev Author: kanato Date: 2009-12-22 18:31:51 +0000 (Tue, 22 Dec 2009) Log Message: ----------- Use built in font in test. Modified Paths: -------------- trunk/Tests/Shaders/Lighting3DTest.cs Modified: trunk/Tests/Shaders/Lighting3DTest.cs =================================================================== --- trunk/Tests/Shaders/Lighting3DTest.cs 2009-12-18 18:03:30 UTC (rev 1157) +++ trunk/Tests/Shaders/Lighting3DTest.cs 2009-12-22 18:31:51 UTC (rev 1158) @@ -12,7 +12,6 @@ { class Lighting3DTest : IAgateTest { - #region IAgateTest Members public string Name { @@ -44,7 +43,7 @@ Surface texture = new Surface("bg-bricks.png"); DisplayWindow wind = DisplayWindow.CreateWindowed("Lighting 3D", 640, 480); - FontSurface font = new FontSurface("Times", 14); + FontSurface font = FontSurface.AgateSerif14; AgateLib.Geometry.Builders.CubeBuilder cb = new AgateLib.Geometry.Builders.CubeBuilder(); cb.Location = new Vector3(0, 0, 0); @@ -147,6 +146,5 @@ } } - #endregion } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-18 18:03:38
|
Revision: 1157 http://agate.svn.sourceforge.net/agate/?rev=1157&view=rev Author: kanato Date: 2009-12-18 18:03:30 +0000 (Fri, 18 Dec 2009) Log Message: ----------- Add GenerateAudio.cs test. Added Paths: ----------- trunk/Tests/AudioTests/GenerateAudio.cs Added: trunk/Tests/AudioTests/GenerateAudio.cs =================================================================== --- trunk/Tests/AudioTests/GenerateAudio.cs (rev 0) +++ trunk/Tests/AudioTests/GenerateAudio.cs 2009-12-18 18:03:30 UTC (rev 1157) @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using AgateLib; +using AgateLib.AudioLib; +using AgateLib.DisplayLib; + +namespace Tests.AudioTests +{ + class GenerateAudio : IAgateTest + { + + public string Name + { + get { return "Generate Audio"; } + } + + public string Category + { + get { return "Audio"; } + } + + public void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup()) + { + setup.AskUser = true; + setup.Initialize(true, true, false); + if (setup.WasCanceled) + return; + + DisplayWindow wind = DisplayWindow.CreateWindowed("Generate Audio", 640, 480); + + short[] s = new short[22050]; + + int frequency = 100; + FillSoundBuffer(s, frequency); + + SoundBuffer buf = new SoundBuffer(s); + + buf.Loop = true; + + SoundBufferSession ses = buf.Play(); + + Stopwatch w = new Stopwatch(); + w.Start(); + + while (wind.IsClosed == false) + { + Display.BeginFrame(); + Display.Clear(); + + FontSurface.AgateSans14.Color = AgateLib.Geometry.Color.White; + FontSurface.AgateSans14.DrawText(0, 0, string.Format("Frequency: {0}", frequency)); + + Display.EndFrame(); + Core.KeepAlive(); + + if (w.ElapsedMilliseconds > 800) + { + frequency += 50; + FillSoundBuffer(s, frequency); + buf.Write(s, 0, 0, s.Length); + + w.Reset(); + w.Start(); + } + } + } + } + + private void FillSoundBuffer(short[] s, double frequency) + { + for (int i = 0; i < s.Length; i++) + { + double index = i / (double)s.Length; + index *= 2 * Math.PI * frequency; + + s[i] = (short)(Math.Sin(index) * short.MaxValue); + } + } + + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-18 06:40:53
|
Revision: 1156 http://agate.svn.sourceforge.net/agate/?rev=1156&view=rev Author: kanato Date: 2009-12-18 06:40:41 +0000 (Fri, 18 Dec 2009) Log Message: ----------- Implement ability to write to sound buffer. Correct disposal of Audio when AgateSetup is destroyed. Modified Paths: -------------- trunk/AgateLib/AgateSetup.cs trunk/AgateLib/AudioLib/SoundBuffer.cs trunk/AgateLib/AudioLib/SoundBufferSession.cs trunk/AgateLib/ImplementationBase/AudioImpl.cs trunk/AgateLib/InputLib/JoystickInput.cs trunk/AgateLib/Settings/PersistantSettings.cs trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs trunk/Tests/Tests.csproj Modified: trunk/AgateLib/AgateSetup.cs =================================================================== --- trunk/AgateLib/AgateSetup.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/AgateLib/AgateSetup.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -246,6 +246,8 @@ public void Dispose() { Display.Dispose(); + Audio.Dispose(); + InputLib.JoystickInput.Dispose(); } /// <summary> Modified: trunk/AgateLib/AudioLib/SoundBuffer.cs =================================================================== --- trunk/AgateLib/AudioLib/SoundBuffer.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/AgateLib/AudioLib/SoundBuffer.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -92,6 +92,20 @@ } /// <summary> + /// Creates an empty SoundBuffer object. + /// </summary> + /// <param name="size">The number of samples in this sound buffer.</param> + /// <param name="stereo"></param> + public SoundBuffer(int size) + { + impl = Audio.Impl.CreateSoundBuffer(size); + } + + public SoundBuffer(short[] data) + { + impl = Audio.Impl.CreateSoundBuffer(data); + } + /// <summary> /// Disposes of the SoundBuffer object, and all SoundBufferSession objects /// created by this SoundBuffer. /// </summary> @@ -143,6 +157,12 @@ return sb; } + public bool Loop + { + get { return impl.Loop; } + set { impl.Loop = value; } + } + /// <summary> /// Creates a new SoundBufferSession object, or finds one which /// can be recycled. @@ -255,6 +275,11 @@ mSessions.Remove(session); } + + public void Write(short[] source, int srcIndex, int destIndex, int length) + { + impl.Write(source, srcIndex, destIndex, length); + } } } Modified: trunk/AgateLib/AudioLib/SoundBufferSession.cs =================================================================== --- trunk/AgateLib/AudioLib/SoundBufferSession.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/AgateLib/AudioLib/SoundBufferSession.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -68,7 +68,6 @@ mSource.RemoveSession(this); } - /// <summary> /// Returns the implemented object. /// </summary> Modified: trunk/AgateLib/ImplementationBase/AudioImpl.cs =================================================================== --- trunk/AgateLib/ImplementationBase/AudioImpl.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/AgateLib/ImplementationBase/AudioImpl.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -80,6 +80,16 @@ public virtual void Update() { } + + public virtual SoundBufferImpl CreateSoundBuffer(int size) + { + throw new NotImplementedException(); + } + + public virtual SoundBufferImpl CreateSoundBuffer(short[] data) + { + throw new NotImplementedException(); + } } /// <summary> @@ -100,6 +110,14 @@ /// </summary> public abstract double Volume { get; set; } + public virtual bool Loop { get { return false; } set { } } + + public virtual void Write(short[] source, int srcIndex, int destIndex, int length) + { + throw new NotImplementedException(); + } + + } /// <summary> /// Represents a playback instance. @@ -121,6 +139,13 @@ /// </summary> public abstract void Stop(); + + public virtual int BufferPointer + { + get { return -1; } + set { } + } + /// <summary> /// Gets or sets the volume this audio file is playing at. /// 0.0 is completely quiet. Modified: trunk/AgateLib/InputLib/JoystickInput.cs =================================================================== --- trunk/AgateLib/InputLib/JoystickInput.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/AgateLib/InputLib/JoystickInput.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -66,5 +66,11 @@ for (int i = 0; i < mRawJoysticks.Count; i++) mRawJoysticks[i].Poll(); } + + internal static void Dispose() + { + if (impl != null) + impl.Dispose(); + } } } Modified: trunk/AgateLib/Settings/PersistantSettings.cs =================================================================== --- trunk/AgateLib/Settings/PersistantSettings.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/AgateLib/Settings/PersistantSettings.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -105,7 +105,13 @@ { 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") Modified: trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/Drivers/AgateSDL/Audio/SDL_Audio.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -71,11 +71,19 @@ { return new SDL_Music(musicStream); } + public override SoundBufferImpl CreateSoundBuffer(System.IO.Stream inStream) { return new SDL_SoundBuffer(inStream); } - + public override SoundBufferImpl CreateSoundBuffer(int size) + { + return new SDL_SoundBuffer(size); + } + public override SoundBufferImpl CreateSoundBuffer(short[] data) + { + return new SDL_SoundBuffer(data); + } public override SoundBufferSessionImpl CreateSoundBufferSession(SoundBufferImpl buffer) { return new SDL_SoundBufferSession((SDL_SoundBuffer)buffer); Modified: trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/Drivers/AgateSDL/Audio/SDL_SoundBuffer.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Runtime.InteropServices; using System.Text; using Tao.Sdl; @@ -33,6 +34,8 @@ IntPtr sound; string tempfile; double mVolume = 1.0; + bool ownRam = false; + IntPtr soundPtr; public SDL_SoundBuffer(Stream stream) { @@ -47,7 +50,39 @@ { LoadFromFile(filename); } + public SDL_SoundBuffer(int size) + { + int bytes = size * 2; + soundPtr = Marshal.AllocHGlobal(bytes); + ownRam = true; + sound = SdlMixer.Mix_QuickLoad_RAW(soundPtr, bytes); + } + public SDL_SoundBuffer(short[] data) + { + int bytes = data.Length * 2; + soundPtr = Marshal.AllocHGlobal(bytes); + ownRam = true; + + Marshal.Copy(data, 0, soundPtr, data.Length); + + sound = SdlMixer.Mix_QuickLoad_RAW(soundPtr, bytes); + } + + public override void Write(short[] source, int srcIndex, int destIndex, int length) + { + if (soundPtr == IntPtr.Zero) + throw new AgateException("Cannot write to audio buffer loaded from a file."); + + SdlMixer.Mix_Chunk c = + (SdlMixer.Mix_Chunk)Marshal.PtrToStructure(sound, typeof(SdlMixer.Mix_Chunk)); + + unsafe + { + Marshal.Copy(source, srcIndex, (IntPtr)(((short*)c.abuf + destIndex)), length); + } + } + ~SDL_SoundBuffer() { Dispose(false); @@ -61,8 +96,12 @@ private void Dispose(bool disposing) { + if (ownRam ) + { + Marshal.FreeHGlobal(soundPtr); + } + SdlMixer.Mix_FreeChunk(sound); - //if (string.IsNullOrEmpty(tempfile) == false) //{ // File.Delete(tempfile); @@ -91,6 +130,11 @@ } } + public override bool Loop + { + get; + set; + } internal IntPtr SoundChunk { get { return sound; } Modified: trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs =================================================================== --- trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/Drivers/AgateSDL/Audio/SDL_SoundBufferSession.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -18,6 +18,7 @@ // using System; using System.Collections.Generic; +using System.Runtime.InteropServices; using System.Text; using Tao.Sdl; @@ -33,11 +34,14 @@ int channel; double volume; double pan; + bool loop; public SDL_SoundBufferSession(SDL_SoundBuffer buffer) { + loop = buffer.Loop; + sound = buffer.SoundChunk; - channel = SdlMixer.Mix_PlayChannel(-1, sound, 0); + channel = SdlMixer.Mix_PlayChannel(-1, sound, LoopCount); volume = buffer.Volume; } @@ -74,10 +78,22 @@ public override void Play() { - SdlMixer.Mix_PlayChannel(channel, sound, 0); + SdlMixer.Mix_PlayChannel(channel, sound, LoopCount); SetPanning(); } + int LoopCount + { + get + { + int loops = 0; + if (loop) + loops = -1; + + return loops; + } + } + public override void Stop() { SdlMixer.Mix_Pause(channel); Modified: trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs =================================================================== --- trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-12-18 06:40:41 UTC (rev 1156) @@ -1,142 +1,142 @@ - -using System; - -using Tests; - -using AgateLib; -using AgateLib.DisplayLib; -using AgateLib.Geometry; -using AgateLib.Particles; -using AgateLib.Sprites; - -namespace Tests.ParticleTest -{ - public class PixelParticleTest : AgateGame, IAgateTest - { - #region IAgateTest Members - - public string Name { get { return "Particles"; } } - - public string Category { get { return "Display"; } } - - public void Main(string[] args) - { - Run(args); - } - + +using System; + +using Tests; + +using AgateLib; +using AgateLib.DisplayLib; +using AgateLib.Geometry; +using AgateLib.Particles; +using AgateLib.Sprites; + +namespace Tests.ParticleTest +{ + public class PixelParticleTest : AgateGame, IAgateTest + { + #region IAgateTest Members + + public string Name { get { return "Particles"; } } + + public string Category { get { return "Display"; } } + + public void Main(string[] args) + { + Run(args); + } + #endregion protected override void AdjustAppInitParameters(ref AppInitParameters initParams) { initParams.InitializeAudio = false; initParams.InitializeJoysticks = false; - initParams.ShowSplashScreen = false; - } - - Random ran = new Random(); - - // PixelParticle - PixelEmitter pe; - GravityManipulator gm; - GravityManipulator gm2; - - //SurfaceParticle - SurfaceEmitter sm; - - //SpriteParticle - SpriteEmitter se; - - FontSurface fontSurface; - - FadeOutManipulator fom; - FadeOutManipulator fom2; - - GravityPointManipulator gpm; - - protected override void Initialize() - { - //PixelParticle - pe = new PixelEmitter(new Vector2(400f, 550f) ,Color.Blue, 2000); - pe.EmitLife = 15f; - pe.EmitFrequency = 0.01f; - pe.PixelSize = new Size(3, 3); - - //SurfaceParticle - sm = new SurfaceEmitter(new Vector2(150f, 550f), 4.2f, 50, 0); - Surface surf = new Surface(@"smoke2.png"); - sm.AddSurface(surf); - sm.EmitFrequency = 0.1f; - sm.EmitAlpha = 1d; - sm.EmitAcceleration = new Vector2(0, -20); - sm.EmitVelocity = new Vector2(0, -10); - - //SpriteParticle - Surface surf2 = new Surface(@"smoke.png"); - Sprite sprite = new Sprite(100, 100); - sprite.AddFrame(surf); - sprite.AddFrame(surf2); - sprite.TimePerFrame = 3d; - sprite.AnimationType = SpriteAnimType.Looping; - se = new SpriteEmitter(new Vector2(600f, 550f), 4.2f, 100, 0); - se.AddSprite(sprite); - se.EmitFrequency = 0.05f; - se.EmitAlpha = 1d; - se.EmitAcceleration = new Vector2(0, -20); - se.EmitVelocity = new Vector2(0, -10); - - //Manipulators - gm = new GravityManipulator(new Vector2(0f, -20f)); - gm.SubscribeToEmitter(sm); - gm.SubscribeToEmitter(se); - - gm2 = new GravityManipulator(Vector2.Empty); - //gm2.SubscribeToEmitter(pe); - gm2.SubscribeToEmitter(sm); - gm2.SubscribeToEmitter(se); - - fom = new FadeOutManipulator(2.5f, 0.6f); - fom.SubscribeToEmitter(pe); - - fom2 = new FadeOutManipulator(4f, 0.3f); - fom2.SubscribeToEmitter(sm); - fom2.SubscribeToEmitter(se); - - gpm = new GravityPointManipulator(new Vector2(400f, 350f), -1f); - gpm.SubscribeToEmitter(pe); - - fontSurface = new FontSurface("Arial", 10f, FontStyle.Bold); - } - - protected override void Update(double time_ms) - { - gm2.Gravity = new Vector2((float)ran.Next(-300, 300), 0f); - - fom.AlphaAmount = (float)ran.NextDouble() * 1.3f; - fom.LifeBarrier = (float)ran.NextDouble() * 5f; - - pe.Update(time_ms); - pe.EmitVelocity = new Vector2((float)ran.Next(-10, 10), 0f); - - sm.Update(time_ms); - - se.Update(time_ms); - se.GetSpriteByKey(0).TimePerFrame = ran.NextDouble() * 3 + 1.5d; - } - - protected override void Render() - { - Display.Clear(Color.Black); - - fontSurface.DrawText("FPS: " + Display.FramesPerSecond); - - pe.Draw(); - fontSurface.DrawText(pe.Position.X, pe.Position.Y, "Particles: " + pe.Particles.Count + "/" + pe.Particles.Capacity); - - sm.Draw(); - fontSurface.DrawText(sm.Position.X, sm.Position.Y, "Particles: " + sm.Particles.Count + "/" + sm.Particles.Capacity); - - se.Draw(); - fontSurface.DrawText(se.Position.X, se.Position.Y, "Particles: " + se.Particles.Count + "/" + se.Particles.Capacity); - } - } -} + initParams.ShowSplashScreen = false; + } + + Random ran = new Random(); + + // PixelParticle + PixelEmitter pe; + GravityManipulator gm; + GravityManipulator gm2; + + //SurfaceParticle + SurfaceEmitter sm; + + //SpriteParticle + SpriteEmitter se; + + FontSurface fontSurface; + + FadeOutManipulator fom; + FadeOutManipulator fom2; + + GravityPointManipulator gpm; + + protected override void Initialize() + { + //PixelParticle + pe = new PixelEmitter(new Vector2(400f, 550f) ,Color.Blue, 2000); + pe.EmitLife = 15f; + pe.EmitFrequency = 0.01f; + pe.PixelSize = new Size(3, 3); + + //SurfaceParticle + sm = new SurfaceEmitter(new Vector2(150f, 550f), 4.2f, 50, 0); + Surface surf = new Surface(@"smoke2.png"); + sm.AddSurface(surf); + sm.EmitFrequency = 0.1f; + sm.EmitAlpha = 1d; + sm.EmitAcceleration = new Vector2(0, -20); + sm.EmitVelocity = new Vector2(0, -10); + + //SpriteParticle + Surface surf2 = new Surface(@"smoke.png"); + Sprite sprite = new Sprite(100, 100); + sprite.AddFrame(surf); + sprite.AddFrame(surf2); + sprite.TimePerFrame = 3d; + sprite.AnimationType = SpriteAnimType.Looping; + se = new SpriteEmitter(new Vector2(600f, 550f), 4.2f, 100, 0); + se.AddSprite(sprite); + se.EmitFrequency = 0.05f; + se.EmitAlpha = 1d; + se.EmitAcceleration = new Vector2(0, -20); + se.EmitVelocity = new Vector2(0, -10); + + //Manipulators + gm = new GravityManipulator(new Vector2(0f, -20f)); + gm.SubscribeToEmitter(sm); + gm.SubscribeToEmitter(se); + + gm2 = new GravityManipulator(Vector2.Empty); + //gm2.SubscribeToEmitter(pe); + gm2.SubscribeToEmitter(sm); + gm2.SubscribeToEmitter(se); + + fom = new FadeOutManipulator(2.5f, 0.6f); + fom.SubscribeToEmitter(pe); + + fom2 = new FadeOutManipulator(4f, 0.3f); + fom2.SubscribeToEmitter(sm); + fom2.SubscribeToEmitter(se); + + gpm = new GravityPointManipulator(new Vector2(400f, 350f), -1f); + gpm.SubscribeToEmitter(pe); + + fontSurface = new FontSurface("Arial", 10f, FontStyle.Bold); + } + + protected override void Update(double time_ms) + { + gm2.Gravity = new Vector2((float)ran.Next(-300, 300), 0f); + + fom.AlphaAmount = (float)ran.NextDouble() * 1.3f; + fom.LifeBarrier = (float)ran.NextDouble() * 5f; + + pe.Update(time_ms); + pe.EmitVelocity = new Vector2((float)ran.Next(-10, 10), 0f); + + sm.Update(time_ms); + + se.Update(time_ms); + se.GetSpriteByKey(0).TimePerFrame = ran.NextDouble() * 3 + 1.5d; + } + + protected override void Render() + { + Display.Clear(Color.Black); + + fontSurface.DrawText("FPS: " + Display.FramesPerSecond); + + pe.Draw(); + fontSurface.DrawText(pe.Position.X, pe.Position.Y, "Particles: " + pe.Particles.Count + "/" + pe.Particles.Capacity); + + sm.Draw(); + fontSurface.DrawText(sm.Position.X, sm.Position.Y, "Particles: " + sm.Particles.Count + "/" + sm.Particles.Capacity); + + se.Draw(); + fontSurface.DrawText(se.Position.X, se.Position.Y, "Particles: " + se.Particles.Count + "/" + se.Particles.Capacity); + } + } +} Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2009-12-17 06:39:57 UTC (rev 1155) +++ trunk/Tests/Tests.csproj 2009-12-18 06:40:41 UTC (rev 1156) @@ -88,6 +88,7 @@ <Compile Include="AgateTestAttribute.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="AudioTests\GenerateAudio.cs" /> <Compile Include="CoreTests\PersistantSettingsTest.cs" /> <Compile Include="CoreTests\PlatformDetection\PlatformDetection.cs"> <SubType>Form</SubType> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-17 06:40:04
|
Revision: 1155 http://agate.svn.sourceforge.net/agate/?rev=1155&view=rev Author: kanato Date: 2009-12-17 06:39:57 +0000 (Thu, 17 Dec 2009) Log Message: ----------- Add Clear method to PixelBuffer Minor optimizations to PixelBuffer for code that uses it intensely. Modified Paths: -------------- trunk/AgateLib/DisplayLib/PixelBuffer.cs Modified: trunk/AgateLib/DisplayLib/PixelBuffer.cs =================================================================== --- trunk/AgateLib/DisplayLib/PixelBuffer.cs 2009-12-06 06:47:58 UTC (rev 1154) +++ trunk/AgateLib/DisplayLib/PixelBuffer.cs 2009-12-17 06:39:57 UTC (rev 1155) @@ -37,6 +37,8 @@ PixelFormat mFormat; byte[] mData; Size mSize; + int mRowStride; + int mPixelStride; #endregion @@ -101,9 +103,12 @@ mFormat = format; mSize = size; + SetStrides(); + SetData(data, dataFormat); } + /// <summary> /// Constructs a PixelBuffer object. /// This overload allows you to specify whether or not the @@ -126,6 +131,9 @@ mFormat = format; mSize = size; + SetStrides(); + + if (copyData == false) Data = data; else @@ -159,6 +167,9 @@ mFormat = format; mSize = size; + + SetStrides(); + mData = new byte[size.Width * size.Height * PixelStride]; SetData(data, sourceFormat, srcRowStride); @@ -183,6 +194,12 @@ return new PixelBuffer(this, new Rectangle(0, 0, Width, Height)); } + private void SetStrides() + { + mPixelStride = GetPixelStride(mFormat); + mRowStride = mSize.Width * mPixelStride; + } + /// <summary> /// Loads image data from a file and returns a PixelBuffer. /// </summary> @@ -239,7 +256,7 @@ /// </summary> public int PixelStride { - get { return GetPixelStride(mFormat); } + get { return mPixelStride; } } /// <summary> @@ -270,7 +287,7 @@ /// </summary> public int RowStride { - get { return Width * PixelStride; } + get { return mRowStride; } } /// <summary> @@ -479,6 +496,15 @@ if (srcRect.X < 0 || srcRect.Y < 0 || srcRect.Right > buffer.Width || srcRect.Bottom > buffer.Height) throw new ArgumentOutOfRangeException("srcRect", "Source rectangle outside size of buffer!"); + if (buffer.RowStride == RowStride && buffer.PixelFormat == PixelFormat && destPt.X == 0) + { + int destIndex = GetPixelIndex(destPt.X, destPt.Y); + int srcIndex = buffer.GetPixelIndex(srcRect.X, srcRect.Y); + + int size = buffer.RowStride * srcRect.Height; + + Array.Copy(buffer.Data, srcIndex, Data, destIndex, size); + } for (int y = 0; y < srcRect.Height; y++) { if (buffer.PixelFormat == PixelFormat) @@ -576,37 +602,45 @@ public void SetPixel(int x, int y, Color clr) { int index = GetPixelIndex(x, y); - double A = clr.A / 255.0; - double R = clr.R / 255.0; - double G = clr.G / 255.0; - double B = clr.B / 255.0; - switch (PixelFormat) + if (this.PixelStride == 4) { - case PixelFormat.ARGB8888: - SetARGB8(A, R, G, B, Data, - index, index + 1, index + 2, index + 3); - break; + int A = clr.A; + int R = clr.R; + int G = clr.G; + int B = clr.B; - case PixelFormat.ABGR8888: - SetARGB8(A, R, G, B, Data, - index, index + 3, index + 2, index + 1); - break; + switch (PixelFormat) + { + case PixelFormat.ARGB8888: + SetARGB8(A, R, G, B, Data, + index, index + 1, index + 2, index + 3); + break; - case PixelFormat.BGRA8888: - SetARGB8(A, R, G, B, Data, - index + 3, index + 2, index + 1, index); - break; + case PixelFormat.ABGR8888: + SetARGB8(A, R, G, B, Data, + index, index + 3, index + 2, index + 1); + break; - case PixelFormat.RGBA8888: - SetARGB8(A, R, G, B, Data, - index + 3, index, index + 1, index + 2); - break; + case PixelFormat.BGRA8888: + SetARGB8(A, R, G, B, Data, + index + 3, index + 2, index + 1, index); + break; - default: - throw new NotSupportedException(string.Format("Pixel format {0} not supported by SetPixel.", PixelFormat)); + case PixelFormat.RGBA8888: + SetARGB8(A, R, G, B, Data, + index + 3, index, index + 1, index + 2); + break; + default: + throw new NotSupportedException(string.Format("Pixel format {0} not supported by SetPixel.", PixelFormat)); + + } } + else + throw new NotSupportedException(string.Format("Pixel format {0} not supported by SetPixel.", PixelFormat)); + + } /// <summary> @@ -973,6 +1007,14 @@ } + private static void SetARGB8(int A, int R, int G, int B, + byte[] dest, int Aindex, int Rindex, int Gindex, int Bindex) + { + dest[Aindex] = (byte)A; + dest[Rindex] = (byte)R; + dest[Gindex] = (byte)G; + dest[Bindex] = (byte)B; + } private static void SetARGB8(double A, double R, double G, double B, byte[] dest, int Aindex, int Rindex, int Gindex, int Bindex) @@ -1094,5 +1136,20 @@ } #endregion + + /// <summary> + /// Sets every pixel in the PixelBuffer to the specified color. + /// </summary> + /// <param name="color"></param> + public void Clear(Color color) + { + for (int j = 0; j < Height; j++) + { + for (int i = 0; i < Width; i++) + { + SetPixel(i, j, color); + } + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 06:48:05
|
Revision: 1154 http://agate.svn.sourceforge.net/agate/?rev=1154&view=rev Author: kanato Date: 2009-12-06 06:47:58 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Update release notes. Modified Paths: -------------- trunk/ReleaseNotes.txt Modified: trunk/ReleaseNotes.txt =================================================================== --- trunk/ReleaseNotes.txt 2009-12-06 06:46:37 UTC (rev 1153) +++ trunk/ReleaseNotes.txt 2009-12-06 06:47:58 UTC (rev 1154) @@ -31,6 +31,9 @@ A particles system has been developed by Marcel Hauf and is included in the AgateLib.Particles namespace. +A simple mechanism for saving/loading user perferences has been implemented +in the AgateLib.Settings namespace, and is accessed through Core.Settings. + Several functions have been deprecated around the library. A compatibility release versioned 0.3.9 is included which retains these deprecated functions to help migrate code to AgateLib 0.4.0. Not everything could be kept however. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 06:46:49
|
Revision: 1153 http://agate.svn.sourceforge.net/agate/?rev=1153&view=rev Author: kanato Date: 2009-12-06 06:46:37 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Mark old Glsl shader compilers as obsolete. Modified Paths: -------------- trunk/Drivers/AgateOTK/Legacy/ArbShaderCompiler.cs trunk/Drivers/AgateOTK/Shaders/GlslShaderCompiler.cs Modified: trunk/Drivers/AgateOTK/Legacy/ArbShaderCompiler.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/ArbShaderCompiler.cs 2009-12-06 06:46:08 UTC (rev 1152) +++ trunk/Drivers/AgateOTK/Legacy/ArbShaderCompiler.cs 2009-12-06 06:46:37 UTC (rev 1153) @@ -8,6 +8,7 @@ namespace AgateOTK { + [Obsolete] class ArbShaderCompiler : ShaderCompilerImpl { public ArbShaderCompiler() Modified: trunk/Drivers/AgateOTK/Shaders/GlslShaderCompiler.cs =================================================================== --- trunk/Drivers/AgateOTK/Shaders/GlslShaderCompiler.cs 2009-12-06 06:46:08 UTC (rev 1152) +++ trunk/Drivers/AgateOTK/Shaders/GlslShaderCompiler.cs 2009-12-06 06:46:37 UTC (rev 1153) @@ -8,6 +8,7 @@ namespace AgateOTK { + [Obsolete] class GlslShaderCompiler : ShaderCompilerImpl { public GlslShaderCompiler() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 06:46:16
|
Revision: 1152 http://agate.svn.sourceforge.net/agate/?rev=1152&view=rev Author: kanato Date: 2009-12-06 06:46:08 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Add some documentation to persistant settings. Modified Paths: -------------- trunk/AgateLib/Settings/PersistantSettings.cs trunk/AgateLib/Settings/SettingsGroup.cs trunk/Tests/Tests.csproj Added Paths: ----------- trunk/Tests/CoreTests/PersistantSettingsTest.cs Modified: trunk/AgateLib/Settings/PersistantSettings.cs =================================================================== --- trunk/AgateLib/Settings/PersistantSettings.cs 2009-12-06 06:37:47 UTC (rev 1151) +++ trunk/AgateLib/Settings/PersistantSettings.cs 2009-12-06 06:46:08 UTC (rev 1152) @@ -7,6 +7,16 @@ 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 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>(); @@ -16,7 +26,7 @@ LoadSettings(); } - public SettingsGroup GetOrCreateSettingsGroup(string name) + private SettingsGroup GetOrCreateSettingsGroup(string name) { if (name.Contains(" ")) throw new AgateException("Settings group name cannot contain a string."); @@ -37,6 +47,9 @@ { get { return GetOrCreateSettingsGroup(name); } } + /// <summary> + /// Gets the full path to the location where the settings file is stored. + /// </summary> public string SettingsFilename { get @@ -45,6 +58,9 @@ } } + /// <summary> + /// Saves the settings to the persistant storage on disk. + /// </summary> public void SaveSettings() { XmlDocument doc = new XmlDocument(); @@ -85,6 +101,10 @@ { return; } + catch (DirectoryNotFoundException) + { + return; + } XmlElement root = doc.ChildNodes[0] as XmlElement; Modified: trunk/AgateLib/Settings/SettingsGroup.cs =================================================================== --- trunk/AgateLib/Settings/SettingsGroup.cs 2009-12-06 06:37:47 UTC (rev 1151) +++ trunk/AgateLib/Settings/SettingsGroup.cs 2009-12-06 06:46:08 UTC (rev 1152) @@ -5,6 +5,10 @@ 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>(); Added: trunk/Tests/CoreTests/PersistantSettingsTest.cs =================================================================== --- trunk/Tests/CoreTests/PersistantSettingsTest.cs (rev 0) +++ trunk/Tests/CoreTests/PersistantSettingsTest.cs 2009-12-06 06:46:08 UTC (rev 1152) @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib; + +namespace Tests.CoreTests +{ + class PersistantSettingsTest : IAgateTest + { + + public string Name + { + get { return "Persistant Settings"; } + } + + public string Category + { + get { return "Core"; } + } + + public void Main(string[] args) + { + using (AgateSetup setup = new AgateSetup()) + { + setup.CompanyName = "Tester Inc."; + setup.ApplicationName = "Testing"; + setup.InitializeAll(); + if (setup.WasCanceled) + return; + + if (Core.Settings["Testy"].IsEmpty) + { + InitializeSettings(); + } + + int runcount = int.Parse(Core.Settings["Testy"]["RunCount"]); + runcount++; + Core.Settings["Testy"]["RunCount"] = runcount.ToString(); + + Core.Settings.SaveSettings(); + } + } + + private void InitializeSettings() + { + Core.Settings["Testy"]["MyTest"] = "true"; + Core.Settings["Testy"]["RunCount"] = "0"; + + } + + } +} Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2009-12-06 06:37:47 UTC (rev 1151) +++ trunk/Tests/Tests.csproj 2009-12-06 06:46:08 UTC (rev 1152) @@ -88,6 +88,7 @@ <Compile Include="AgateTestAttribute.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="CoreTests\PersistantSettingsTest.cs" /> <Compile Include="CoreTests\PlatformDetection\PlatformDetection.cs"> <SubType>Form</SubType> </Compile> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 06:37:56
|
Revision: 1151 http://agate.svn.sourceforge.net/agate/?rev=1151&view=rev Author: kanato Date: 2009-12-06 06:37:47 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Add persistant settings. Modified Paths: -------------- trunk/AgateLib/AgateLib.csproj trunk/AgateLib/AgateSetup.cs trunk/AgateLib/Core.cs trunk/AgateLib/Platform.cs Added Paths: ----------- trunk/AgateLib/Settings/ trunk/AgateLib/Settings/PersistantSettings.cs trunk/AgateLib/Settings/SettingsGroup.cs Modified: trunk/AgateLib/AgateLib.csproj =================================================================== --- trunk/AgateLib/AgateLib.csproj 2009-12-06 05:12:13 UTC (rev 1150) +++ trunk/AgateLib/AgateLib.csproj 2009-12-06 06:37:47 UTC (rev 1151) @@ -153,6 +153,7 @@ <Compile Include="ImplementationBase\FrameBufferImpl.cs" /> <Compile Include="Platform.cs" /> <Compile Include="PlatformType.cs" /> + <Compile Include="Settings\SettingsGroup.cs" /> <Compile Include="Timing.cs"> <SubType>Code</SubType> </Compile> @@ -544,6 +545,7 @@ <Compile Include="Utility\FileSystemProvider.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="Settings\PersistantSettings.cs" /> <Compile Include="Utility\Ref.cs"> <SubType>Code</SubType> </Compile> Modified: trunk/AgateLib/AgateSetup.cs =================================================================== --- trunk/AgateLib/AgateSetup.cs 2009-12-06 05:12:13 UTC (rev 1150) +++ trunk/AgateLib/AgateSetup.cs 2009-12-06 06:37:47 UTC (rev 1151) @@ -74,6 +74,9 @@ private AudioTypeID mSelectAudio = AudioTypeID.AutoSelect; private InputTypeID mSelectInput = InputTypeID.AutoSelect; + private string mCompanyName; + private string mAppName; + public DisplayTypeID PreferredDisplay { get { return mPreferredDisplay; } @@ -163,8 +166,16 @@ if (mUseInput) InitializeInput(); + + if (string.IsNullOrEmpty(mAppName) == false) + { + Core.Platform.SetFolderPaths(mCompanyName, mAppName); + } } + public string CompanyName { get { return mCompanyName; } set { mCompanyName = value; } } + public string ApplicationName { get { return mAppName; } set { mAppName = value; } } + /// <summary> /// Initializes the Display. /// Automatically selects the driver to use, or asks the user which Modified: trunk/AgateLib/Core.cs =================================================================== --- trunk/AgateLib/Core.cs 2009-12-06 05:12:13 UTC (rev 1150) +++ trunk/AgateLib/Core.cs 2009-12-06 06:37:47 UTC (rev 1151) @@ -24,6 +24,7 @@ using AgateLib.AudioLib; using AgateLib.DisplayLib; +using AgateLib.Settings; namespace AgateLib { @@ -90,7 +91,9 @@ private static bool mIsActive = true; private static bool mInititalized = false; private static Platform mPlatform; + private static PersistantSettings mSettings; + #region --- Error Reporting --- private static CrossPlatformDebugLevel mCrossPlatform = CrossPlatformDebugLevel.Comment; @@ -320,6 +323,21 @@ } /// <summary> + /// Gets an object which contains the persistant settings for the application. + /// </summary> + public static PersistantSettings Settings + { + get + { + if (mSettings == null) + { + mSettings = new PersistantSettings(); + } + + return mSettings; + } + } + /// <summary> /// Gets or sets a bool value which indicates whether or not your /// app is the focused window. This will be automatically set if /// you created DisplayWindows by specifying a title and size, but not Modified: trunk/AgateLib/Platform.cs =================================================================== --- trunk/AgateLib/Platform.cs 2009-12-06 05:12:13 UTC (rev 1150) +++ trunk/AgateLib/Platform.cs 2009-12-06 06:37:47 UTC (rev 1151) @@ -79,9 +79,10 @@ } } - // TODO: Maybe there is a better way to inspect permissions? private bool HasWriteAccessToAppDirectory() { + // TODO: Maybe there is a better way to inspect permissions? + // here we just stry to write and see if we fail. string filename = Path.GetTempFileName(); try @@ -102,6 +103,19 @@ } } + internal void EnsureAppDataDirectoryExists() + { + if (Directory.Exists(AppDataDirectory)) + return; + + Directory.CreateDirectory(AppDataDirectory); + } + + public string AppDataDirectory + { + get { return mAppData; } + } + static T GetCustomAttribute<T>(Assembly ass) where T : Attribute { try @@ -309,5 +323,7 @@ return retval; } + + } } Added: trunk/AgateLib/Settings/PersistantSettings.cs =================================================================== --- trunk/AgateLib/Settings/PersistantSettings.cs (rev 0) +++ trunk/AgateLib/Settings/PersistantSettings.cs 2009-12-06 06:37:47 UTC (rev 1151) @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; + +namespace AgateLib.Settings +{ + public class PersistantSettings + { + Dictionary<string, SettingsGroup> mSettings = new Dictionary<string, SettingsGroup>(); + + internal PersistantSettings() + { + LoadSettings(); + } + + public SettingsGroup GetOrCreateSettingsGroup(string name) + { + if (name.Contains(" ")) + throw new AgateException("Settings group name cannot contain a string."); + + if (mSettings.ContainsKey(name) == false) + mSettings[name] = new SettingsGroup(); + + 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); } + } + public string SettingsFilename + { + get + { + return System.IO.Path.Combine(Core.Platform.AppDataDirectory, "settings.xml"); + } + } + + 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; + } + + 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); + } + + mSettings.Add(node.Name, g); + } + } + } +} Added: trunk/AgateLib/Settings/SettingsGroup.cs =================================================================== --- trunk/AgateLib/Settings/SettingsGroup.cs (rev 0) +++ trunk/AgateLib/Settings/SettingsGroup.cs 2009-12-06 06:37:47 UTC (rev 1151) @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace AgateLib.Settings +{ + public class SettingsGroup : IDictionary<string, string> + { + Dictionary<string, string> mStore = new Dictionary<string, string>(); + + /// <summary> + /// Returns true if this settings group has no members. + /// </summary> + public bool IsEmpty + { + get { return Count == 0; } + } + + #region IDictionary<string,string> Members + + public void Add(string key, string value) + { + mStore.Add(key, value); + } + + public bool ContainsKey(string key) + { + return mStore.ContainsKey(key); + } + + public ICollection<string> Keys + { + get { return mStore.Keys; } + } + + public bool Remove(string key) + { + return mStore.Remove(key); + } + + public bool TryGetValue(string key, out string value) + { + return mStore.TryGetValue(key, out value); + } + + public ICollection<string> Values + { + get { return mStore.Values; } + } + + public string this[string key] + { + get + { + return mStore[key]; + } + set + { + mStore[key] = value; + } + } + + #endregion + + #region ICollection<KeyValuePair<string,string>> Members + + void ICollection<KeyValuePair<string,string>>.Add(KeyValuePair<string, string> item) + { + Add(item.Key, item.Value); + } + + public void Clear() + { + mStore.Clear(); + } + + bool ICollection<KeyValuePair<string, string>>.Contains(KeyValuePair<string, string> item) + { + return ((ICollection<KeyValuePair<string, string>>)mStore).Contains(item); + } + + void ICollection<KeyValuePair<string, string>>.CopyTo(KeyValuePair<string, string>[] array, int arrayIndex) + { + ((ICollection<KeyValuePair<string, string>>)mStore).CopyTo(array, arrayIndex); + } + + public int Count + { + get { return mStore.Count; } + } + + 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 + + public IEnumerator<KeyValuePair<string, string>> GetEnumerator() + { + return mStore.GetEnumerator(); + } + + #endregion + + #region IEnumerable Members + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + #endregion + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 05:12:21
|
Revision: 1150 http://agate.svn.sourceforge.net/agate/?rev=1150&view=rev Author: kanato Date: 2009-12-06 05:12:13 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Add index buffer documentation. Modified Paths: -------------- trunk/AgateLib/DisplayLib/IndexBuffer.cs trunk/AgateLib/DisplayLib/VertexBuffer.cs Modified: trunk/AgateLib/DisplayLib/IndexBuffer.cs =================================================================== --- trunk/AgateLib/DisplayLib/IndexBuffer.cs 2009-12-06 05:08:40 UTC (rev 1149) +++ trunk/AgateLib/DisplayLib/IndexBuffer.cs 2009-12-06 05:12:13 UTC (rev 1150) @@ -24,15 +24,29 @@ namespace AgateLib.DisplayLib { + /// <summary> + /// Class which represents an index buffer in video memory. An index buffer is + /// used to reduce the amount of vertex data that needs to be stored/sent to the + /// graphics adapter. + /// </summary> public class IndexBuffer { IndexBufferImpl impl; + /// <summary> + /// Constructs an index buffer. + /// </summary> + /// <param name="type">The type of index buffer to create, 16 or 32 bit indices.</param> + /// <param name="size">The number of indices that are contained in the index buffer.</param> public IndexBuffer(IndexBufferType type, int size) { impl = Display.Impl.CreateIndexBuffer(type, size); } + /// <summary> + /// Writes indices to the index buffer. + /// </summary> + /// <param name="indices">The indices to write.</param> public void WriteIndices(short[] indices) { if (impl.IndexType == IndexBufferType.Int32) @@ -43,6 +57,11 @@ impl.WriteIndices(indices); } + /// <summary> + /// Writes indices to the index buffer. + /// </summary> + /// <param name="indices">The indices to write. If this is a 16 bit index buffer, you must not + /// have an index greater than 32767.</param> public void WriteIndices(int[] indices) { if (impl.IndexType == IndexBufferType.Int16) @@ -92,20 +111,35 @@ return retval; } + /// <summary> + /// Gets the number of indices in the buffer. + /// </summary> public int Count { get { return impl.Count; } } + /// <summary> + /// Gets the index buffer implementation. + /// </summary> public IndexBufferImpl Impl { get { return impl; } } } + /// <summary> + /// Enum indicating the type of index buffer. + /// </summary> public enum IndexBufferType { + /// <summary> + /// A 16-bit index buffer. + /// </summary> Int16, + /// <summary> + /// A 32-bit index buffer. + /// </summary> Int32, } } Modified: trunk/AgateLib/DisplayLib/VertexBuffer.cs =================================================================== --- trunk/AgateLib/DisplayLib/VertexBuffer.cs 2009-12-06 05:08:40 UTC (rev 1149) +++ trunk/AgateLib/DisplayLib/VertexBuffer.cs 2009-12-06 05:12:13 UTC (rev 1150) @@ -26,6 +26,9 @@ namespace AgateLib.DisplayLib { + /// <summary> + /// Class which represents a vertex buffer in memory. + /// </summary> public sealed class VertexBuffer { VertexBufferImpl impl; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 05:08:48
|
Revision: 1149 http://agate.svn.sourceforge.net/agate/?rev=1149&view=rev Author: kanato Date: 2009-12-06 05:08:40 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Add comments to Display.cs. Modified Paths: -------------- trunk/AgateLib/DisplayLib/Display.cs trunk/Drivers/AgateDrawing/Drawing_Display.cs Modified: trunk/AgateLib/DisplayLib/Display.cs =================================================================== --- trunk/AgateLib/DisplayLib/Display.cs 2009-12-06 05:07:03 UTC (rev 1148) +++ trunk/AgateLib/DisplayLib/Display.cs 2009-12-06 05:08:40 UTC (rev 1149) @@ -100,7 +100,10 @@ Shaders.AgateBuiltInShaders.InitializeShaders(); } - + /// <summary> + /// Gets the RenderStateAdapter object which is used to set and retrieve render + /// states for the display device. + /// </summary> public static RenderStateAdapter RenderState { get { return mRenderState; } @@ -145,6 +148,9 @@ } } + /// <summary> + /// Gets the shader that is currently in use. + /// </summary> public static Shaders.AgateShader Shader { get { return impl.Shader; } @@ -682,7 +688,6 @@ { impl.HideCursor(); } - internal static void ShowCursor() { impl.ShowCursor(); Modified: trunk/Drivers/AgateDrawing/Drawing_Display.cs =================================================================== --- trunk/Drivers/AgateDrawing/Drawing_Display.cs 2009-12-06 05:07:03 UTC (rev 1148) +++ trunk/Drivers/AgateDrawing/Drawing_Display.cs 2009-12-06 05:08:40 UTC (rev 1149) @@ -267,10 +267,6 @@ return null; } } - public override void SetOrthoProjection(AgateLib.Geometry.Rectangle region) - { - throw new AgateException("SetOrthoProjection is not implemented in AgateDrawing.dll."); - } protected override void SavePixelBuffer(PixelBuffer pixelBuffer, string filename, ImageFileFormat format) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 05:07:10
|
Revision: 1148 http://agate.svn.sourceforge.net/agate/?rev=1148&view=rev Author: kanato Date: 2009-12-06 05:07:03 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Update ReleaseNotes.txt Add comments to FontSurface.cs. Modified Paths: -------------- trunk/AgateLib/DisplayLib/FontSurface.cs trunk/ChangeLog.txt trunk/ReleaseNotes.txt trunk/TODO.txt Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-06 04:46:00 UTC (rev 1147) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-06 05:07:03 UTC (rev 1148) @@ -71,20 +71,32 @@ FontState mState = new FontState(); /// <summary> - /// Creates a FontSurface object from the given fontFamily. + /// Creates a FontSurface object from the given fontFamily. Appearance + /// of the font will likely be platform-dependent. /// </summary> - /// <param name="fontFamily"></param> - /// <param name="sizeInPoints"></param> + /// <param name="fontFamily">Name of the font familty to use.</param> + /// <param name="sizeInPoints">Size of the font in points.</param> + /// <remarks>It is not recommended that you use this method + /// if any cross-platform support is concerned. For cross-platform + /// support, either create a bitmap font, or use one of the built-in + /// ones, like FontSurface.AgateSans14. + /// </remarks> public FontSurface(string fontFamily, float sizeInPoints) : this(fontFamily, sizeInPoints, FontStyle.None) { } /// <summary> - /// Creates a FontSurface object from the given fontFamily. + /// Creates a FontSurface object from the given fontFamily. Appearance + /// of the font will likely be platform-dependent. /// </summary> - /// <param name="fontFamily"></param> - /// <param name="sizeInPoints"></param> - /// <param name="style"></param> + /// <param name="fontFamily">Name of the font familty to use.</param> + /// <param name="sizeInPoints">Size of the font in points.</param> + /// <param name="style">Style of the font, such as bold or italic.</param> + /// <remarks>It is not recommended that you use this method + /// if any cross-platform support is concerned. For cross-platform + /// support, either create a bitmap font, or use one of the built-in + /// ones, like FontSurface.AgateSans14. + /// </remarks> public FontSurface(string fontFamily, float sizeInPoints, FontStyle style) { if (sizeInPoints < 1) @@ -134,6 +146,9 @@ System.Diagnostics.Debug.Assert(impl != null); } + /// <summary> + /// Gets the name of the font. + /// </summary> public string FontName { get { return impl.FontName; } @@ -349,6 +364,9 @@ get { return impl.FontHeight; } } + /// <summary> + /// Indicates how images are laid out inline with text. + /// </summary> public TextImageLayout TextImageLayout { get; set; } /// <summary> @@ -399,7 +417,10 @@ DrawText(mState); } - + /// <summary> + /// Draws text using the specified FontState object. + /// </summary> + /// <param name="state">The FontState to use.</param> public void DrawText(FontState state) { if (string.IsNullOrEmpty(state.TransformedText)) @@ -407,10 +428,14 @@ impl.DrawText(state); } - - Regex substituteMatch = new Regex(@"\{.*?\}|\{\{\}|\{\}\}|\r\n|\n"); - Regex indexMatch = new Regex(@"[0-9]+:?"); - + /// <summary> + /// Draws formatted text. + /// </summary> + /// <param name="destX">X position of destination.</param> + /// <param name="destY">Y position of destination.</param> + /// <param name="formatString">The formatting string.</param> + /// <param name="args">Arguments that are used to fill {x} members of the formatString. Surface objects + /// are laid out according to the TextImageLayout member.</param> public void DrawText(int destX, int destY, string formatString, params object[] args) { TextLayout layout = CreateLayout(formatString, args); @@ -419,7 +444,18 @@ layout.DrawAll(); } - public TextLayout CreateLayout(string formatString, object[] args) + static Regex substituteMatch = new Regex(@"\{.*?\}|\{\{\}|\{\}\}|\r\n|\n"); + static Regex indexMatch = new Regex(@"[0-9]+:?"); + + /// <summary> + /// Creates a text layout from a format string and list of arguments. + /// </summary> + /// <param name="formatString">The formatting string.</param> + /// <param name="args">Arguments that are used to fill {x} members of the formatString. Surface objects + /// are laid out according to the TextImageLayout member.</param> + /// <returns>Returns a TextLayout object which contains all the layout information needed to draw + /// the text/images on screen.</returns> + public TextLayout CreateLayout(string formatString, params object[] args) { var matches = substituteMatch.Matches(formatString); @@ -686,10 +722,22 @@ } + /// <summary> + /// Enum indicating how images are laid out when drawing inline with text. + /// </summary> public enum TextImageLayout { + /// <summary> + /// The top of the image is aligned with the top of the text. + /// </summary> InlineTop, + /// <summary> + /// The center of the image is aligned with the center of the text. + /// </summary> InlineCenter, + /// <summary> + /// The bottom of the image is aligned with the bottom of the text. + /// </summary> InlineBottom, } } Modified: trunk/ChangeLog.txt =================================================================== --- trunk/ChangeLog.txt 2009-12-06 04:46:00 UTC (rev 1147) +++ trunk/ChangeLog.txt 2009-12-06 05:07:03 UTC (rev 1148) @@ -1,3 +1,4 @@ + Version 0.3.2 =================== Moved ISprite and ISpriteFrame to Sprites namespace. Modified: trunk/ReleaseNotes.txt =================================================================== --- trunk/ReleaseNotes.txt 2009-12-06 04:46:00 UTC (rev 1147) +++ trunk/ReleaseNotes.txt 2009-12-06 05:07:03 UTC (rev 1148) @@ -1,7 +1,47 @@ +Version 0.4.0 +=================== +Major changes in this version. + +AgateLib now has built-in fonts, which can be accessed via static members like +FontSurface.AgateSans14 for a 14-point sans serif font. This are bitmap fonts +embedded in AgateLib.dll, and they are guaranteed to look exactly the same across +all supported platforms. + +A basic set of GUI controls has been included for an in-game GUI. This is located +in the AgateLib.Gui namespace. This GUI has a somewhat flexible skinning engine +called Mercury. + +Basic support for 3D rendering is now available. This is accessed by using +the shaders in AgateLib.DisplayLib.Shaders.AgateBuiltInShaders class. You can +create vertex buffers and index buffers. + +The old IRenderTarget interface that was implemented by DisplayWindows and Surfaces +is gone, and instead we have the FrameBuffer class. This requires some rather +minor changes to consumer code, and resolves ambiguities around having surfaces +as render targets, and is much more forward compatible. + +No longer are you required to create a DisplayWindow before creating any Surfaces. +Now objects can be instantiated in any order, as long as AgateSetup.Initialize has +been called. + +AgateMDX has been dumped and a SlimDX based replacement, AgateSDX is included now. +SlimDX has much better community support, and AgateSDX will eventually be +developed to include Direct3D 10/11 support. + +A particles system has been developed by Marcel Hauf and is included in the +AgateLib.Particles namespace. + +Several functions have been deprecated around the library. A compatibility +release versioned 0.3.9 is included which retains these deprecated functions +to help migrate code to AgateLib 0.4.0. Not everything could be kept however. + AgateLib 0.3.1 Release Notes ====================================== -This is mainly a minor update to 0.3.0. All features deprecated in 0.3.0 have been removed. There are a few minor bug fixes, and a few properties added. Of note is the addition of the ZipFileProvider, which is an IFileProvider object that allows resources to be loaded from zip files. +This is mainly a minor update to 0.3.0. All features deprecated in 0.3.0 have +been removed. There are a few minor bug fixes, and a few properties added. +Of note is the addition of the ZipFileProvider, which is an IFileProvider object +that allows resources to be loaded from zip files. AgateLib 0.3.0 Release Notes ====================================== Modified: trunk/TODO.txt =================================================================== --- trunk/TODO.txt 2009-12-06 04:46:00 UTC (rev 1147) +++ trunk/TODO.txt 2009-12-06 05:07:03 UTC (rev 1148) @@ -1,6 +1,8 @@ AgateLib Todo ============= +AgateLib 0.4.0 + General: Remove all OpenGL immediate mode code from AgateOTK. Check GetPixelFormat method in AgateSDX This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 04:46:10
|
Revision: 1147 http://agate.svn.sourceforge.net/agate/?rev=1147&view=rev Author: kanato Date: 2009-12-06 04:46:00 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Make shoot the traps use built in fonts. Modified Paths: -------------- trunk/Examples/ShootTheTraps/App.cs Modified: trunk/Examples/ShootTheTraps/App.cs =================================================================== --- trunk/Examples/ShootTheTraps/App.cs 2009-12-06 04:40:22 UTC (rev 1146) +++ trunk/Examples/ShootTheTraps/App.cs 2009-12-06 04:46:00 UTC (rev 1147) @@ -31,10 +31,12 @@ // graphics declaration FontSurface mFont; + FontSurface mLargeFont; protected override void Initialize() { - mFont = new FontSurface("Tahoma", 16); + mFont = FontSurface.AgateSans14; + mLargeFont = FontSurface.AgateSans24; Mouse.MouseDown += new InputEventHandler(Mouse_MouseDown); @@ -130,11 +132,11 @@ mFont.Color = Color.White; mFont.SetScale(1, 1); - int fontHeight = mFont.StringDisplayHeight("M"); + int fontHeight = mFont.FontHeight; Point textStart = new Point(10, Display.RenderTarget.Height - 52); - Display.FillRect(new Rectangle(0, textStart.Y + 2, Display.RenderTarget.Width, 50), Color.Black); + Display.FillRect(new Rectangle(0, textStart.Y, Display.RenderTarget.Width, 50), Color.Black); mFont.DrawText(textStart.X, textStart.Y, "Score: " + mDisplayedScore); mFont.DrawText(textStart.X, textStart.Y + fontHeight, "Need: " + @@ -198,12 +200,10 @@ mLevelTime = Timing.TotalMilliseconds; } - mFont.SetScale(2, 2); - int width = Display.RenderTarget.Width; int x = (int)(width * (1 - (Timing.TotalMilliseconds - mLevelTime) / 2300.0)); - DrawBorderedText(mFont, x, 160, "Level " + mGame.Level, Color.White, Color.Black); + DrawBorderedText(mLargeFont, x, 160, "Level " + mGame.Level, Color.White, Color.Black); if (Timing.TotalMilliseconds - mLevelTime > 3000) mLevelTime = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 04:40:36
|
Revision: 1146 http://agate.svn.sourceforge.net/agate/?rev=1146&view=rev Author: kanato Date: 2009-12-06 04:40:22 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Add in large sans font. Modified Paths: -------------- trunk/AgateLib/DisplayLib/FontSurface.cs trunk/AgateLib/InternalResources/Data.cs trunk/AgateLib/InternalResources/Fonts.zip trunk/Examples/BallBuster.Net/CImage.cs trunk/Examples/BallBuster.Net/main.cs Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-06 02:18:07 UTC (rev 1145) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-06 04:40:22 UTC (rev 1146) @@ -637,6 +637,17 @@ } /// <summary> + /// The default AgateLib sans serif font at 24 points. + /// </summary> + /// <remarks> + /// AgateSans was rasterized from Bitstream Vera Sans. + /// </remarks> + public static FontSurface AgateSans24 + { + get { return InternalResources.Data.AgateSans24; } + } + + /// <summary> /// The default AgateLib serif font at 10 points. /// </summary> /// <remarks> Modified: trunk/AgateLib/InternalResources/Data.cs =================================================================== --- trunk/AgateLib/InternalResources/Data.cs 2009-12-06 02:18:07 UTC (rev 1145) +++ trunk/AgateLib/InternalResources/Data.cs 2009-12-06 04:40:22 UTC (rev 1146) @@ -89,6 +89,10 @@ { get { return GetFont(mSans, 14, "AgateSans-14"); } } + internal static FontSurface AgateSans24 + { + get { return GetFont(mSans, 24, "AgateSans-24"); } + } internal static FontSurface AgateSerif10 { Modified: trunk/AgateLib/InternalResources/Fonts.zip =================================================================== (Binary files differ) Modified: trunk/Examples/BallBuster.Net/CImage.cs =================================================================== --- trunk/Examples/BallBuster.Net/CImage.cs 2009-12-06 02:18:07 UTC (rev 1145) +++ trunk/Examples/BallBuster.Net/CImage.cs 2009-12-06 04:40:22 UTC (rev 1146) @@ -58,8 +58,10 @@ public void preload() { - this.font = new FontSurface("Arial", 11.0f); - this.largeFont = new FontSurface("Arial", 22.0f); + this.font = FontSurface.AgateSans10; + this.largeFont = FontSurface.AgateSans24; + this.largeFont.SetScale(0.8, 0.8); + this.palogo = new Sprite(spritesSrc, "palogo"); } Modified: trunk/Examples/BallBuster.Net/main.cs =================================================================== --- trunk/Examples/BallBuster.Net/main.cs 2009-12-06 02:18:07 UTC (rev 1145) +++ trunk/Examples/BallBuster.Net/main.cs 2009-12-06 04:40:22 UTC (rev 1146) @@ -1645,6 +1645,7 @@ { Display.BeginFrame(); + img.largeFont.SetScale(0.8, 0.8); median = (int)Timing.TotalMilliseconds - start; Display.Clear(Color.White); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 02:18:14
|
Revision: 1145 http://agate.svn.sourceforge.net/agate/?rev=1145&view=rev Author: kanato Date: 2009-12-06 02:18:07 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Fix calls to obsolete functions. Modified Paths: -------------- trunk/Examples/BallBuster.Net/main.cs trunk/Examples/Pong/Pong.cs trunk/Examples/ShootTheTraps/App.cs Modified: trunk/Examples/BallBuster.Net/main.cs =================================================================== --- trunk/Examples/BallBuster.Net/main.cs 2009-12-06 02:11:06 UTC (rev 1144) +++ trunk/Examples/BallBuster.Net/main.cs 2009-12-06 02:18:07 UTC (rev 1145) @@ -452,7 +452,7 @@ foreach (KeyValuePair<Point, string> kvp in editorState.Menu) { - Rectangle rect = new Rectangle(kvp.Key, img.font.StringDisplaySize(kvp.Value)); + Rectangle rect = new Rectangle(kvp.Key, img.font.MeasureString(kvp.Value)); if (rect.Height > 16) rect.Height = 16; @@ -4024,7 +4024,7 @@ // draw menu foreach (KeyValuePair<Point, string> kvp in editorState.Menu) { - Rectangle rect = new Rectangle(kvp.Key, img.font.StringDisplaySize(kvp.Value)); + Rectangle rect = new Rectangle(kvp.Key, img.font.MeasureString(kvp.Value)); if (rect.Height > 16) rect.Height = 16; Modified: trunk/Examples/Pong/Pong.cs =================================================================== --- trunk/Examples/Pong/Pong.cs 2009-12-06 02:11:06 UTC (rev 1144) +++ trunk/Examples/Pong/Pong.cs 2009-12-06 02:18:07 UTC (rev 1145) @@ -49,7 +49,7 @@ DisplayWindow wind = DisplayWindow.CreateWindowed ("Pong Example", displayWidth, displayHeight); - font = new FontSurface("Sans Serif", 14); + font = FontSurface.AgateSans14; paddle[0] = new Vector2(50, displayHeight / 2); paddle[1] = new Vector2(playAreaWidth - 50 - paddleWidth, displayHeight / 2); @@ -83,17 +83,17 @@ private void DrawScore() { - int x = playAreaWidth + borderSize * 3 / 2; + int x = playAreaWidth + borderSize ; int y = borderSize * 2; font.DrawText(x, y, "Score"); for (int i = 0; i < 2; i++) { - y += font.StringDisplayHeight("M") * 2; + y += font.FontHeight * 2; font.DrawText(x, y, names[i]); - y += font.StringDisplayHeight("M"); + y += font.FontHeight; font.DrawText(x, y, score[i].ToString()); } } Modified: trunk/Examples/ShootTheTraps/App.cs =================================================================== --- trunk/Examples/ShootTheTraps/App.cs 2009-12-06 02:11:06 UTC (rev 1144) +++ trunk/Examples/ShootTheTraps/App.cs 2009-12-06 02:18:07 UTC (rev 1145) @@ -212,7 +212,7 @@ private void CenterText(FontSurface font, int y, string text, Color color) { - Size size = font.StringDisplaySize(text); + Size size = font.MeasureString(text); int x = (Display.RenderTarget.Width - size.Width) / 2; @@ -221,7 +221,7 @@ } private void CenterText(FontSurface font, int y, string text, Color color, Color borderColor) { - Size size = font.StringDisplaySize(text); + Size size = font.MeasureString(text); int x = (Display.RenderTarget.Width - size.Width) / 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-06 02:11:15
|
Revision: 1144 http://agate.svn.sourceforge.net/agate/?rev=1144&view=rev Author: kanato Date: 2009-12-06 02:11:06 +0000 (Sun, 06 Dec 2009) Log Message: ----------- Implement Windows-specific font rasterization for kerning support. Replace Andika and Gentium with Bitstream Vera-derived fonts. Modified Paths: -------------- trunk/AgateLib/AgateGame.cs trunk/AgateLib/BitmapFont/BitmapFontImpl.cs trunk/AgateLib/BitmapFont/FontMetrics.cs trunk/AgateLib/BitmapFont/GlyphMetrics.cs trunk/AgateLib/DisplayLib/FontSurface.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs trunk/AgateLib/InternalResources/Data.cs trunk/AgateLib/InternalResources/Fonts.zip trunk/AgateLib/Resources/AgateResourceLoader.cs trunk/AgateLib/Resources/BitmapFontResource.cs trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs trunk/Tests/Fonts/Builtin.cs trunk/Tests/GuiTests/RenderGui.cs trunk/Tests/Tests.csproj trunk/Tools/FontCreator/CreateFont.cs trunk/Tools/FontCreator/EditGlyphs.Designer.cs trunk/Tools/FontCreator/EditGlyphs.cs trunk/Tools/FontCreator/EditGlyphs.resx trunk/Tools/FontCreator/FontCreator.csproj trunk/Tools/FontCreator/Properties/Resources.Designer.cs trunk/Tools/FontCreator/Properties/Resources.resx trunk/Tools/FontCreator/SaveFont.Designer.cs trunk/Tools/FontCreator/SaveFont.cs trunk/Tools/FontCreator/SaveFont.resx trunk/Tools/FontCreator/frmFontCreator.cs Added Paths: ----------- trunk/Drivers/AgateLib.WinForms/BitmapFontUtilRenderers.cs trunk/Tests/Fonts/Kerning.cs trunk/Tools/FontCreator/Resources/zoom_in.png trunk/Tools/FontCreator/Resources/zoom_out.png Removed Paths: ------------- trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs Modified: trunk/AgateLib/AgateGame.cs =================================================================== --- trunk/AgateLib/AgateGame.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/AgateGame.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -83,7 +83,7 @@ CreateDisplayWindow(); - font = FontSurface.Gentium12; + font = FontSurface.AgateSans14; if (InitParams.ShowSplashScreen) { Modified: trunk/AgateLib/BitmapFont/BitmapFontImpl.cs =================================================================== --- trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -286,6 +286,15 @@ destX += destRects[rectCount].Width - glyph.RightOverhang * ScaleWidth; + // check for kerning + if (i < text.Length - 1) + { + if (glyph.KerningPairs.ContainsKey(text[i + 1])) + { + destX += glyph.KerningPairs[text[i + 1]] * ScaleWidth; + } + } + rectCount++; break; } @@ -328,34 +337,33 @@ private void RefreshCache(FontState state, BitmapFontCache cache) { + if (cache.NeedsRefresh == false) + return; - if (cache.NeedsRefresh) - { - // this variable counts the number of rectangles actually used to display text. - // It may be less then text.Length because carriage return characters - // don't need any rects. - GetRects(cache.SrcRects, cache.DestRects, out cache.DisplayTextLength, - state.TransformedText, state.ScaleHeight, state.ScaleWidth); + // this variable counts the number of rectangles actually used to display text. + // It may be less then text.Length because carriage return characters + // don't need any rects. + GetRects(cache.SrcRects, cache.DestRects, out cache.DisplayTextLength, + state.TransformedText, state.ScaleHeight, state.ScaleWidth); - PointF dest = state.Location; + PointF dest = state.Location; - if (state.DisplayAlignment != OriginAlignment.TopLeft) - { - Point value = Origin.Calc(state.DisplayAlignment, - MeasureString(state, state.Text)); + if (state.DisplayAlignment != OriginAlignment.TopLeft) + { + Point value = Origin.Calc(state.DisplayAlignment, + MeasureString(state, state.Text)); - dest.X -= value.X; - dest.Y -= value.Y; - } + dest.X -= value.X; + dest.Y -= value.Y; + } - for (int i = 0; i < cache.DisplayTextLength; i++) - { - cache.DestRects[i].X += dest.X; - cache.DestRects[i].Y += dest.Y; - } + for (int i = 0; i < cache.DisplayTextLength; i++) + { + cache.DestRects[i].X += dest.X; + cache.DestRects[i].Y += dest.Y; + } - cache.NeedsRefresh = false; - } + cache.NeedsRefresh = false; } } Modified: trunk/AgateLib/BitmapFont/FontMetrics.cs =================================================================== --- trunk/AgateLib/BitmapFont/FontMetrics.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/BitmapFont/FontMetrics.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -190,50 +190,6 @@ } #endregion - - private void ReadGlyphs030(XmlNode rootNode) - { - foreach (XmlNode node in rootNode.ChildNodes) - { - GlyphMetrics glyph = new GlyphMetrics(); - - char key = (char)int.Parse(node.Attributes["Char"].Value); - glyph.SourceRect = Rectangle.Parse(node.Attributes["Source"].Value); - - glyph.LeftOverhang = GetAttributeInt32(node, "LeftOverhang"); - glyph.RightOverhang = GetAttributeInt32(node, "RightOverhang"); - - mGlyphs.Add(key, glyph); - } - } - - private int GetAttributeInt32(XmlNode node, string p) - { - if (node[p] == null) - return 0; - - return int.Parse(node[p].Value); - } - - private static void AddAttribute(XmlDocument doc, XmlNode current, string name, int value) - { - XmlAttribute att = doc.CreateAttribute(name); - att.Value = value.ToString(); - current.Attributes.Append(att); - } - private static void AddAttribute(XmlDocument doc, XmlNode current, string name, Rectangle value) - { - XmlAttribute att = doc.CreateAttribute(name); - att.Value = value.ToString(); - current.Attributes.Append(att); - } - private static void AddAttribute(XmlDocument doc, XmlNode current, string name, char value) - { - XmlAttribute att = doc.CreateAttribute(name); - att.Value = ((int)value).ToString(); - current.Attributes.Append(att); - } - #region ICloneable Members object ICloneable.Clone() Modified: trunk/AgateLib/BitmapFont/GlyphMetrics.cs =================================================================== --- trunk/AgateLib/BitmapFont/GlyphMetrics.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/BitmapFont/GlyphMetrics.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -104,6 +104,14 @@ } /// <summary> + /// Gets the number of pixels the drawing position is advanced when this glyph is drawn. + /// </summary> + public int LayoutWidth + { + get { return mSourceRect.Width - LeftOverhang - RightOverhang; } + } + + /// <summary> /// A dictionary of characters which need kerning when paired with this glyph. /// </summary> public Dictionary<char, int> KerningPairs Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -151,6 +151,16 @@ } /// <summary> + /// Initializes a FontSurface object with a given implementation object. + /// </summary> + /// <param name="implToUse"></param> + /// <returns></returns> + public static FontSurface FromImpl(FontSurfaceImpl implToUse) + { + return new FontSurface(implToUse); + } + + /// <summary> /// Returns the implementation object. /// </summary> public FontSurfaceImpl Impl @@ -605,91 +615,61 @@ #region --- Built-in Fonts --- /// <summary> - /// This sans serif bitmap font was generated from Andika at 9 points. + /// The default AgateLib sans serif font at 10 points. /// </summary> /// <remarks> - /// Andika is Copyright (c) 2004-2008, SIL International and - /// distributed under the Open Font License. - /// http://scripts.sil.org/OFL + /// AgateSans was rasterized from Bitstream Vera Sans. /// </remarks> - public static FontSurface Andika09 + public static FontSurface AgateSans10 { - get { return InternalResources.Data.Andika09; } + get { return InternalResources.Data.AgateSans10; } } + /// <summary> - /// This sans serif bitmap font was generated from Andika at 10 points. + /// The default AgateLib sans serif font at 14 points. /// </summary> /// <remarks> - /// Andika is Copyright (c) 2004-2008, SIL International and - /// distributed under the Open Font License. - /// http://scripts.sil.org/OFL + /// AgateSans was rasterized from Bitstream Vera Sans. /// </remarks> - public static FontSurface Andika10 + public static FontSurface AgateSans14 { - get { return InternalResources.Data.Andika10; } + get { return InternalResources.Data.AgateSans14; } } + /// <summary> - /// This sans serif bitmap font was generated from Andika at 12 points. + /// The default AgateLib serif font at 10 points. /// </summary> /// <remarks> - /// Andika is Copyright (c) 2004-2008, SIL International and - /// distributed under the Open Font License. - /// http://scripts.sil.org/OFL + /// AgateSans was rasterized from Bitstream Vera Serif. /// </remarks> - public static FontSurface Andika12 + public static FontSurface AgateSerif10 { - get { return InternalResources.Data.Andika12; } + get { return InternalResources.Data.AgateSerif10; } } + /// <summary> - /// This sans serif bitmap font was generated from Andika at 14 points. + /// The default AgateLib serif font at 14 points. /// </summary> /// <remarks> - /// Andika is Copyright (c) 2004-2008, SIL International and - /// distributed under the Open Font License. - /// http://scripts.sil.org/OFL + /// AgateSans was rasterized from Bitstream Vera Serif. /// </remarks> - public static FontSurface Andika14 + public static FontSurface AgateSerif14 { - get { return InternalResources.Data.Andika14; } + get { return InternalResources.Data.AgateSerif14; } } /// <summary> - /// This serif bitmap font was generated from Gentium at 10 points. + /// The default AgateLib monospace font at 10 points. /// </summary> /// <remarks> - /// Gentium is Copyright (c) 2004-2008, SIL International and - /// distributed under the Open Font License. - /// http://scripts.sil.org/OFL + /// AgateSans was rasterized from Bitstream Vera Sans Mono. /// </remarks> - public static FontSurface Gentium10 + public static FontSurface AgateMono10 { - get { return InternalResources.Data.Gentium10; } + get { return InternalResources.Data.AgateMono10; } } - /// <summary> - /// This serif bitmap font was generated from Gentium at 12 points. - /// </summary> - /// <remarks> - /// Gentium is Copyright (c) 2004-2008, SIL International and - /// distributed under the Open Font License. - /// http://scripts.sil.org/OFL - /// </remarks> - public static FontSurface Gentium12 - { - get { return InternalResources.Data.Gentium12; } - } - /// <summary> - /// This serif bitmap font was generated from Gentium at 14 points. - /// </summary> - /// <remarks> - /// Gentium is Copyright (c) 2004-2008, SIL International and - /// distributed under the Open Font License. - /// http://scripts.sil.org/OFL - /// </remarks> - public static FontSurface Gentium14 - { - get { return InternalResources.Data.Gentium14; } - } + #endregion Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/Mercury.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -32,7 +32,7 @@ public Mercury() : this(MercuryScheme.CreateDefaultScheme()) { - DebugOutlines = true; + } public Mercury(MercuryScheme scheme) { Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryScheme.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -121,8 +121,8 @@ void SetDefaults(IFileProvider files) { - WidgetFont = FontSurface.Andika09; - TitleFont = FontSurface.Andika10; + WidgetFont = FontSurface.AgateSans10; + TitleFont = FontSurface.AgateSans14; FontColor = Color.White; FontColorDisabled = Color.Gray; Modified: trunk/AgateLib/InternalResources/Data.cs =================================================================== --- trunk/AgateLib/InternalResources/Data.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/InternalResources/Data.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -15,8 +15,9 @@ static AgateResourceCollection mFontResources; static Surface mPoweredBy; - static Dictionary<int, FontSurface> mGentium = new Dictionary<int, FontSurface>(); - static Dictionary<int, FontSurface> mAndika = new Dictionary<int, FontSurface>(); + static Dictionary<int, FontSurface> mSans = new Dictionary<int, FontSurface>(); + static Dictionary<int, FontSurface> mSerif = new Dictionary<int, FontSurface>(); + static Dictionary<int, FontSurface> mMono = new Dictionary<int, FontSurface>(); static Data() { @@ -31,14 +32,19 @@ mPoweredBy = null; } - foreach (var font in mAndika) + foreach (var font in mSans) font.Value.Dispose(); - foreach (var font in mGentium) + foreach (var font in mSerif) font.Value.Dispose(); - mAndika.Clear(); - mGentium.Clear(); + foreach (var font in mMono) + font.Value.Dispose(); + + mSans.Clear(); + mSerif.Clear(); + mMono.Clear(); + } private static void LoadFonts() @@ -75,35 +81,29 @@ return dictionary[size]; } - internal static FontSurface Gentium10 + internal static FontSurface AgateSans10 { - get { return GetFont(mGentium, 10, "Gentium-10"); } + get { return GetFont(mSans, 10, "AgateSans-10"); } } - - internal static FontSurface Gentium12 + internal static FontSurface AgateSans14 { - get { return GetFont(mGentium, 12, "Gentium-12"); } + get { return GetFont(mSans, 14, "AgateSans-14"); } } - internal static FontSurface Gentium14 - { - get { return GetFont(mGentium, 14, "Gentium-14"); } - } - internal static FontSurface Andika09 + internal static FontSurface AgateSerif10 { - get { return GetFont(mAndika, 9, "Andika-09"); } + get { return GetFont(mSerif, 10, "AgateSerif-10"); } } - internal static FontSurface Andika10 + internal static FontSurface AgateSerif14 { - get { return GetFont(mAndika, 10, "Andika-10"); } + get { return GetFont(mSerif, 14, "AgateSerif-14"); } } - internal static FontSurface Andika12 + + internal static FontSurface AgateMono10 { - get { return GetFont(mAndika, 12, "Andika-12"); } + get { return GetFont(mMono, 10, "AgateMono-10"); } } - internal static FontSurface Andika14 - { - get { return GetFont(mAndika, 14, "Andika-14"); } - } + + } } \ No newline at end of file Modified: trunk/AgateLib/InternalResources/Fonts.zip =================================================================== (Binary files differ) Modified: trunk/AgateLib/Resources/AgateResourceLoader.cs =================================================================== --- trunk/AgateLib/Resources/AgateResourceLoader.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/Resources/AgateResourceLoader.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -38,7 +38,7 @@ { XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement("AgateResources"); - XmlHelper.AppendAttribute(root, doc, "Version", "0.3.0"); + XmlHelper.AppendAttribute(root, doc, "Version", "0.4.0"); doc.AppendChild(root); @@ -99,9 +99,10 @@ switch (version) { + case "0.4.0": case "0.3.1": case "0.3.0": - ReadVersion031(resources, root, version); + ReadVersion040(resources, root, version); break; default: @@ -110,7 +111,7 @@ } - private static void ReadVersion031(AgateResourceCollection resources, XmlNode root, string version) + private static void ReadVersion040(AgateResourceCollection resources, XmlNode root, string version) { for (int i = 0; i < root.ChildNodes.Count; i++) { Modified: trunk/AgateLib/Resources/BitmapFontResource.cs =================================================================== --- trunk/AgateLib/Resources/BitmapFontResource.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/AgateLib/Resources/BitmapFontResource.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -27,6 +27,14 @@ { switch (version) { + case "0.4.0": + Name = node.Attributes["name"].Value; + mImage = XmlHelper.ReadAttributeString(node, "image", string.Empty); + + ReadMetrics040(node); + + break; + case "0.3.1": case "0.3.0": Name = node.Attributes["name"].Value; @@ -42,6 +50,54 @@ } } + private void ReadMetrics040(XmlNode parent) + { + XmlNode root = null; + + // find metrics node + foreach (XmlNode n in parent.ChildNodes) + { + if (n.Name == "Metrics") + { + root = n; + break; + } + } + + if (root == null) + throw new AgateResourceException(string.Format( + "Could not find Metrics node in bitmap font resource {0}.", Name)); + + foreach (XmlNode node in root.ChildNodes) + { + if (node.Name == "Glyph") + { + GlyphMetrics glyph = new GlyphMetrics(); + + char key = (char)int.Parse(node.Attributes["char"].Value); + glyph.SourceRect = Rectangle.Parse(node.Attributes["source"].Value); + + glyph.LeftOverhang = XmlHelper.ReadAttributeInt(node, "leftOverhang", 0); + glyph.RightOverhang = XmlHelper.ReadAttributeInt(node, "rightOverhang", 0); + + mMetrics.Add(key, glyph); + } + else if (node.Name == "Kerning") + { + char left = (char)XmlHelper.ReadAttributeInt(node, "first"); + char right = (char)XmlHelper.ReadAttributeInt(node, "second"); + int value = XmlHelper.ReadAttributeInt(node, "value"); + + mMetrics[left].KerningPairs.Add(right, value); + } + else + { + throw new AgateResourceException(string.Format( + "Expected to find glyph node, but found {0} instead.", node.Name)); + } + } + } + private void ReadMetrics030(XmlNode parent) { XmlNode root = null; @@ -102,7 +158,20 @@ metrics.AppendChild(current); } + foreach (char glyph in mMetrics.Keys) + { + foreach (var kern in mMetrics[glyph].KerningPairs) + { + XmlNode current = doc.CreateElement("Kerning"); + XmlHelper.AppendAttribute(current, doc, "first", glyph); + XmlHelper.AppendAttribute(current, doc, "second", kern.Key); + XmlHelper.AppendAttribute(current, doc, "value", kern.Value); + + metrics.AppendChild(current); + } + } + root.AppendChild(metrics); parent.AppendChild(root); } Modified: trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj =================================================================== --- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-06 02:11:06 UTC (rev 1144) @@ -102,6 +102,7 @@ <Compile Include="BitmapFontUtil.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="BitmapFontUtilRenderers.cs" /> <Compile Include="DisplayWindowForm.cs"> <SubType>Form</SubType> </Compile> @@ -115,7 +116,6 @@ <Compile Include="FormUtil.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="GdiFontExtensions.cs" /> <Compile Include="Icons.Designer.cs"> <DependentUpon>Icons.resx</DependentUpon> <SubType>Code</SubType> Modified: trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -31,113 +31,9 @@ /// <summary> /// Utility class for constructing a bitmap font image. /// </summary> - public static class BitmapFontUtil + public static partial class BitmapFontUtil { - interface ICharacterRenderer - { - Drawing.Font Font { get; set; } - - int Padding { get; } - Size MeasureText(Drawing.Graphics g, string text); - void DrawText(Drawing.Graphics g, string text, Point location, Drawing.Color clr); - } - - class TextRend : ICharacterRenderer - { - Drawing.Font font; - - public TextRend(Drawing.Font font) - { - Font = font; - } - public System.Drawing.Font Font - { - get { return font; } - set { font = value; } - } - public int Padding - { - get { return 1; } - } - TextFormatFlags flags = TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix; - - public Size MeasureText(System.Drawing.Graphics g, string text) - { - Drawing.Size size = TextRenderer.MeasureText(g, text, - font, new System.Drawing.Size(256, 256), flags); - - return new Size(size.Width, size.Height); - } - - public void DrawText(System.Drawing.Graphics g, string text, Point location, Drawing.Color clr) - { - TextRenderer.DrawText(g, text, font, - new System.Drawing.Rectangle(location.X, location.Y, 256, 256), - clr, flags); - } - - } - class GraphicsRend : ICharacterRenderer - { - Drawing.Font font; - float padding; - - public GraphicsRend(Drawing.Font font) - { - Font = font; - } - public System.Drawing.Font Font - { - get { return font; } - set { font = value; } - } - - public int Padding - { - get { return (int)Math.Ceiling(padding); } - } - void CalculatePadding(Drawing.Graphics g) - { - // apparently .NET (or GDI+) does this stupid thing on Windows - // where is reports extra padded space around the characters drawn. - // Fortunately, this padding is equal the reported size of the - // space character, which is not drawn when by itself. - if (Environment.OSVersion.Platform == PlatformID.Win32NT) - { - SizeF padSize = Interop.Convert(g.MeasureString(" ", font)); - - padding = padSize.Width - 1; - } - } - public Size MeasureText(Drawing.Graphics g, string text) - { - if (padding == 0) - CalculatePadding(g); - - Drawing.SizeF size = g.MeasureString(text, font); - size.Width -= padding; - - // for space character on windows. - if (text == " " && padding > 0) - size.Width = padding; - - return new Size((int)(size.Width), (int)(size.Height)); - } - - public void DrawText(Drawing.Graphics g, string text, Point location, Drawing.Color clr) - { - g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; - - // we need to adjust the position by half the padding - location.X -= (int)Math.Ceiling(padding / 2); - - using (Drawing.Brush brush = new Drawing.SolidBrush(clr)) - { - g.DrawString(text, font, brush, new Drawing.Point(location.X, location.Y)); - } - } - } - + /// <summary> /// Creates a bitmap font by loading an OS font, and drawing it to /// a bitmap to use as a Surface object. You should only use this method @@ -162,6 +58,11 @@ (ICharacterRenderer)new TextRend(font) : (ICharacterRenderer)new GraphicsRend(font); + if (Core.Platform.PlatformType == PlatformType.Windows && options.UseTextRenderer) + { + rend = new GdiWindows(font); + } + MakeBitmap(options, rend, out bmp, out glyphs); //bmp.Save("testfont.png", Drawing.Imaging.ImageFormat.Png); @@ -204,7 +105,7 @@ { for (char i = range.StartChar; i <= range.EndChar; i++) { - Size sourceSize = rend.MeasureText(g, i.ToString()); + Size sourceSize = rend.MeasureChar(g, i); // skip glyphs which are not in the font. if (sourceSize.Width == 0) @@ -279,12 +180,12 @@ if (options.CreateBorder) { - rend.DrawText(borderG, i.ToString(), new Point(drawX , drawY + 1), borderColor); - rend.DrawText(borderG, i.ToString(), new Point(drawX + 2, drawY + 1), borderColor); - rend.DrawText(borderG, i.ToString(), new Point(drawX + 1, drawY), borderColor); - rend.DrawText(borderG, i.ToString(), new Point(drawX + 1, drawY + 2), borderColor); + rend.DrawChar(borderG, i, new Point(drawX , drawY + 1), borderColor); + rend.DrawChar(borderG, i, new Point(drawX + 2, drawY + 1), borderColor); + rend.DrawChar(borderG, i, new Point(drawX + 1, drawY), borderColor); + rend.DrawChar(borderG, i, new Point(drawX + 1, drawY + 2), borderColor); - rend.DrawText(g, i.ToString(), new Point(drawX + 1, drawY + 1), System.Drawing.Color.White); + rend.DrawChar(g, i, new Point(drawX + 1, drawY + 1), System.Drawing.Color.White); if (font.SizeInPoints >= 14.0) glyphs[i].LeftOverhang = 1; @@ -293,7 +194,7 @@ } else { - rend.DrawText(g, i.ToString(), new Point(drawX, drawY), System.Drawing.Color.White); + rend.DrawChar(g, i, new Point(drawX, drawY), System.Drawing.Color.White); } glyphs[i].SourceRect = new Rectangle( @@ -307,13 +208,8 @@ } } - - if (Core.Platform.PlatformType == PlatformType.Windows) - { - GdiFontExtensions gdi = new GdiFontExtensions(); - gdi.LoadKerningPairs(glyphs, font, bmp, g); - } + rend.ModifyMetrics(glyphs, g); g.Dispose(); Added: trunk/Drivers/AgateLib.WinForms/BitmapFontUtilRenderers.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/BitmapFontUtilRenderers.cs (rev 0) +++ trunk/Drivers/AgateLib.WinForms/BitmapFontUtilRenderers.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -0,0 +1,454 @@ +// 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-2009. +// All Rights Reserved. +// +// Contributor(s): Erik Ylvisaker +// +using System; +using Drawing = System.Drawing; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; +using AgateLib.DisplayLib; +using AgateLib.Geometry; +using AgateLib.BitmapFont; +using AgateLib.Resources; + +namespace AgateLib.WinForms +{ + static partial class BitmapFontUtil + { + interface ICharacterRenderer + { + Drawing.Font Font { get; set; } + + int Padding { get; } + Size MeasureChar(Drawing.Graphics g, char c); + void DrawChar(Drawing.Graphics g, char c, Point location, Drawing.Color clr); + + void ModifyMetrics(FontMetrics glyphs, Drawing.Graphics g); + } + + class TextRend : ICharacterRenderer + { + Drawing.Font font; + + public TextRend(Drawing.Font font) + { + Font = font; + } + public System.Drawing.Font Font + { + get { return font; } + set { font = value; } + } + public int Padding + { + get { return 1; } + } + TextFormatFlags flags = TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix; + + public void ModifyMetrics(FontMetrics glyphs, Drawing.Graphics g) + { } + public Size MeasureChar(System.Drawing.Graphics g, char c) + { + string text = c.ToString(); + + Drawing.Size size = TextRenderer.MeasureText(g, text, + font, new System.Drawing.Size(256, 256), flags); + + return new Size(size.Width, size.Height); + } + + public void DrawChar(System.Drawing.Graphics g, char c, Point location, Drawing.Color clr) + { + string text = c.ToString(); + + TextRenderer.DrawText(g, text, font, + new System.Drawing.Rectangle(location.X, location.Y, 256, 256), + clr, flags); + } + + + } + class GraphicsRend : ICharacterRenderer + { + Drawing.Font font; + float padding; + + public GraphicsRend(Drawing.Font font) + { + Font = font; + } + public System.Drawing.Font Font + { + get { return font; } + set { font = value; } + } + + public void ModifyMetrics(FontMetrics glyphs, Drawing.Graphics g) + { } + + public int Padding + { + get { return (int)Math.Ceiling(padding); } + } + void CalculatePadding(Drawing.Graphics g) + { + // apparently .NET (or GDI+) does this stupid thing on Windows + // where is reports extra padded space around the characters drawn. + // Fortunately, this padding is equal the reported size of the + // space character, which is not drawn when by itself. + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + SizeF padSize = Interop.Convert(g.MeasureString(" ", font)); + + padding = padSize.Width - 1; + } + } + public Size MeasureChar(Drawing.Graphics g, char c) + { + string text = c.ToString(); + + if (padding == 0) + CalculatePadding(g); + + Drawing.SizeF size = g.MeasureString(text, font); + size.Width -= padding; + + // for space character on windows. + if (text == " " && padding > 0) + size.Width = padding; + + return new Size((int)(size.Width), (int)(size.Height)); + } + + public void DrawChar(Drawing.Graphics g, char c, Point location, Drawing.Color clr) + { + string text = c.ToString(); + + g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; + + // we need to adjust the position by half the padding + location.X -= (int)Math.Ceiling(padding / 2); + + using (Drawing.Brush brush = new Drawing.SolidBrush(clr)) + { + g.DrawString(text, font, brush, new Drawing.Point(location.X, location.Y)); + } + } + } + class GdiWindows : ICharacterRenderer + { + Drawing.Font font; + IntPtr fontHandle; + + bool hasMetric = false; + TEXTMETRIC metric; + + #region --- Imports --- + + [DllImport("gdi32.dll")] + static extern bool GetCharWidth32(IntPtr hdc, uint iFirstChar, uint iLastChar, + [Out] int[] lpBuffer); + + [DllImport("gdi32.dll")] + static extern uint GetKerningPairs(IntPtr hdc, uint nNumPairs, [Out] KERNINGPAIR[] lpkrnpair); + + [DllImport("gdi32.dll", ExactSpelling = true, PreserveSig = true, SetLastError = true)] + static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj); + + [DllImport("gdi32.dll", CharSet = CharSet.Auto)] + static extern bool GetTextMetrics(IntPtr hdc, out TEXTMETRIC lptm); + + [DllImport("user32.dll")] + static extern int DrawText(IntPtr hDC, string lpString, int nCount, ref RECT lpRect, uint uFormat); + + [DllImport("user32.dll")] + static extern int DrawTextEx(IntPtr hdc, StringBuilder lpchText, int cchText, + ref RECT lprc, uint dwDTFormat, ref DRAWTEXTPARAMS lpDTParams); + + [DllImport("gdi32.dll")] + static extern uint SetTextColor(IntPtr hdc, int crColor); + + [DllImport("gdi32.dll")] + static extern uint SetBkColor(IntPtr hdc, int crColor); + + [DllImport("gdi32.dll")] + static extern int SetBkMode(IntPtr hdc, int iBkMode); + + [DllImport("gdi32.dll")] + static extern int SetMapMode(IntPtr hdc, int fnMapMode); + + [DllImport("gdi32.dll", SetLastError = true, CharSet = CharSet.Auto)] + static extern bool GetCharABCWidths(IntPtr hdc, uint uFirstChar, + uint uLastChar, out ABC lpabc); + + #endregion + #region --- Structures --- + + const int TRANSPARENT = 1; + const int OPAQUE = 2; + + //Mapping Modes + const int MM_TEXT = 1; + const int MM_LOMETRIC = 2; + const int MM_HIMETRIC = 3; + const int MM_LOENGLISH = 4; + const int MM_HIENGLISH = 5; + const int MM_TWIPS = 6; + const int MM_ISOTROPIC = 7; + const int MM_ANISOTROPIC = 8; + + //Minimum and Maximum Mapping Mode values + const int MM_MIN = MM_TEXT; + const int MM_MAX = MM_ANISOTROPIC; + const int MM_MAX_FIXEDSCALE = MM_TWIPS; + + [StructLayout(LayoutKind.Sequential)] + public struct ABC + { + public int abcA; + public uint abcB; + public int abcC; + + public int AgateWidth + { + get { return Math.Abs(abcA) + Math.Abs((int)abcB) + Math.Abs(abcC); } + } + public int AdvanceWidth + { + get { return abcA + (int)abcB + abcC; } + } + public override string ToString() + { + return string.Format("A={0}, B={1}, C={2}", abcA, abcB, abcC); + } + } + + [StructLayout(LayoutKind.Sequential)] + struct KERNINGPAIR + { + public ushort wFirst; // might be better off defined as char + public ushort wSecond; // might be better off defined as char + public int iKernAmount; + + public KERNINGPAIR(ushort wFirst, ushort wSecond, int iKernAmount) + { + this.wFirst = wFirst; + this.wSecond = wSecond; + this.iKernAmount = iKernAmount; + } + + public char First { get { return (char)wFirst; } } + public char Second { get { return (char)wSecond; } } + public int Amount { get { return iKernAmount; } } + + public override string ToString() + { + return (String.Format("{{First={0}, Second={1}, Amount={2}}}", wFirst, wSecond, iKernAmount)); + } + } + + [Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + public struct TEXTMETRIC + { + public int tmHeight; + public int tmAscent; + public int tmDescent; + public int tmInternalLeading; + public int tmExternalLeading; + public int tmAveCharWidth; + public int tmMaxCharWidth; + public int tmWeight; + public int tmOverhang; + public int tmDigitizedAspectX; + public int tmDigitizedAspectY; + public char tmFirstChar; + public char tmLastChar; + public char tmDefaultChar; + public char tmBreakChar; + public byte tmItalic; + public byte tmUnderlined; + public byte tmStruckOut; + public byte tmPitchAndFamily; + public byte tmCharSet; + } + + private struct RECT + { + public int Left, Top, Right, Bottom; + public RECT(Rectangle r) + { + this.Left = r.Left; + this.Top = r.Top; + this.Bottom = r.Bottom; + this.Right = r.Right; + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct DRAWTEXTPARAMS + { + public uint cbSize; + public int iTabLength; + public int iLeftMargin; + public int iRightMargin; + public uint uiLengthDrawn; + } + + #endregion + + + public GdiWindows(Drawing.Font font) + { + Font = font; + } + public System.Drawing.Font Font + { + get { return font; } + set + { + font = value; + fontHandle = font.ToHfont(); + + } + } + public int Padding + { + get { return 0; } + } + + Dictionary<char, ABC> mABCs = new Dictionary<char, ABC>(); + + int ColorToWin32Color(Drawing.Color clr) + { + return clr.R + clr.G << 8 + clr.B << 16; + } + public Size MeasureChar(System.Drawing.Graphics g, char c) + { + IntPtr hdc = g.GetHdc(); + + if (SetMapMode(hdc, MM_TEXT) == 0) + throw new Exception("Failed to set map mode."); + + SelectObject(hdc, fontHandle); + + if (hasMetric == false) + { + GetTextMetrics(hdc, out metric); + hasMetric = true; + } + + ABC abc; + + GetCharABCWidths(hdc, (uint)c, (uint)c, out abc); + + // hack because the lower case f doesn't come out with the right + // source rect on some small fonts. + if (c == 'f') + { + abc.abcA -= 1; + } + + mABCs.Add(c, abc); + + int width = abc.AgateWidth; + + g.ReleaseHdc(); + return new Size(width+1, metric.tmHeight + metric.tmInternalLeading + metric.tmExternalLeading); + } + + public void DrawChar(System.Drawing.Graphics g, char c, Point location, System.Drawing.Color clr) + { + + location.X -= mABCs[c].abcA; + + TextRenderer.DrawText(g, c.ToString(), font, Interop.Convert(location), clr, + TextFormatFlags.NoPadding | TextFormatFlags.NoPrefix); + //StringBuilder b = new StringBuilder(); + //b.Append(c.ToString()); + + //IntPtr hdc = g.GetHdc(); + //RECT r = new RECT { Left = location.X, Top = location.Y, Right = 10000, Bottom = 10000 }; + + //SelectObject(hdc, fontHandle); + //SetBkMode(hdc, TRANSPARENT); + ////SetBkColor(hdc, 0); + //SetTextColor(hdc, ColorToWin32Color(clr)); + + //DRAWTEXTPARAMS dtpa = new DRAWTEXTPARAMS(); + + + //DrawText(hdc, b, -1, ref r, 0, ref dtpa); + + //g.ReleaseHdc(); + } + + public void ModifyMetrics(FontMetrics glyphs, Drawing.Graphics g) + { + IntPtr hdc = g.GetHdc(); + SelectObject(hdc, font.ToHfont()); + if (SetMapMode(hdc, MM_TEXT) == 0) + throw new Exception("Failed to set map mode."); + + foreach (char c in glyphs.Keys) + { + ABC abc = mABCs[c]; + + int left = -abc.abcA; + int right = -(abc.AdvanceWidth - abc.AgateWidth - 1 + left); + + glyphs[c].LeftOverhang = left; + glyphs[c].RightOverhang = right; + } + + uint numPairs = GetKerningPairs(hdc, 0, null); + + if (numPairs == 0) + return; + + KERNINGPAIR[] kerningArray = new KERNINGPAIR[numPairs]; + + uint err = GetKerningPairs(hdc, numPairs, kerningArray); + + if (err == 0) throw new Exception(); + + foreach (var kern in kerningArray) + { + int amount = kern.iKernAmount; + + // Kerning is too strong, particularly for the letter T for some reason. + // This hack fixes it. + amount /= 2; + + if (amount == 0) + continue; + + if (glyphs.ContainsKey(kern.First) == false) + continue; + if (glyphs.ContainsKey(kern.Second) == false) + continue; + + glyphs[kern.First].KerningPairs[kern.Second] = amount; + } + + g.ReleaseHdc(); + } + + } + } +} Deleted: trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using AgateLib.BitmapFont; - -namespace AgateLib.WinForms -{ - class GdiFontExtensions - { - [DllImport("gdi32.dll")] - static extern uint GetKerningPairs(IntPtr hdc, uint nNumPairs,[Out] KERNINGPAIR[] lpkrnpair); - - [DllImport("gdi32.dll", ExactSpelling = true, PreserveSig = true, SetLastError = true)] - static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj); - - [StructLayout(LayoutKind.Sequential)] - struct KERNINGPAIR - { - public ushort wFirst; // might be better off defined as char - public ushort wSecond; // might be better off defined as char - public int iKernAmount; - - public KERNINGPAIR(ushort wFirst, ushort wSecond, int iKernAmount) - { - this.wFirst = wFirst; - this.wSecond = wSecond; - this.iKernAmount = iKernAmount; - } - - public override string ToString() - { - return (String.Format("{{First={0}, Second={1}, Amount={2}}}", wFirst, wSecond, iKernAmount)); - } - } - - internal void LoadKerningPairs(FontMetrics glyphs, Font font, Bitmap bmp, Graphics g) - { - IntPtr hdc = g.GetHdc(); - SelectObject(hdc, font.ToHfont()); - - uint numPairs = GetKerningPairs(hdc, 0, null); - - if (numPairs == 0) - return; - - KERNINGPAIR[] kerningArray = new KERNINGPAIR[numPairs]; - - uint err = GetKerningPairs(hdc, numPairs, kerningArray); - - if (err == 0) throw new Exception(); - - foreach (var kern in kerningArray) - { - if (kern.iKernAmount == 0) - continue; - - if (glyphs.ContainsKey((char)kern.wFirst) == false) - continue; - if (glyphs.ContainsKey((char)kern.wSecond) == false) - continue; - - glyphs[(char)kern.wFirst].KerningPairs.Add((char)kern.wSecond, kern.iKernAmount); - } - - } - } -} Modified: trunk/Tests/Fonts/Builtin.cs =================================================================== --- trunk/Tests/Fonts/Builtin.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Tests/Fonts/Builtin.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -42,15 +42,12 @@ { base.Initialize(); - fonts.Add(FontSurface.Andika09); - fonts.Add(FontSurface.Andika10); - fonts.Add(FontSurface.Andika12); - fonts.Add(FontSurface.Andika14); + fonts.Add(FontSurface.AgateSans10); + fonts.Add(FontSurface.AgateSans14); + fonts.Add(FontSurface.AgateSerif10); + fonts.Add(FontSurface.AgateSerif14); + fonts.Add(FontSurface.AgateMono10); - fonts.Add(FontSurface.Gentium10); - fonts.Add(FontSurface.Gentium12); - fonts.Add(FontSurface.Gentium14); - for (char i = (char)128; i < 255; i++) { nonenglish += i; @@ -66,8 +63,12 @@ font.Color = Color.White; font.DrawText(0, y, font.FontName); - int x = font.MeasureString(font.FontName).Width + 40; + int x = 20; + y += font.FontHeight; + font.DrawText(x,y,"01234567890!@#$%^&*()[]{}\\|/?'\";:.>,<`~-_=+"); + y +=font.FontHeight; + font.DrawText(x, y, "The quick brown fox jumped over the lazy dogs."); y += font.FontHeight; Added: trunk/Tests/Fonts/Kerning.cs =================================================================== --- trunk/Tests/Fonts/Kerning.cs (rev 0) +++ trunk/Tests/Fonts/Kerning.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib; +using AgateLib.BitmapFont; +using AgateLib.Geometry; +using AgateLib.DisplayLib; +using AgateLib.InputLib; + +namespace Tests.Fonts +{ + class Kerning : IAgateTest + { + public string Name + { + get { return "Kerning"; } + } + + public string Category + { + get { return "Fonts"; } + } + + bool useKerning = true; + + public void Main(string[] args) + { + using (var setup = new AgateSetup()) + { + setup.AskUser = true; + setup.Initialize(true, false, false); + if (setup.WasCanceled) + return; + + Keyboard.KeyDown += new InputEventHandler(Keyboard_KeyDown); + DisplayWindow wind = DisplayWindow.CreateWindowed("Kerning test", 800, 600); + + FontSurface font = FontSurface.AgateSans14; + FontSurface unkerned = ConstructUnkernedFont(font); + + string text = ConstructKerningText(wind, font); + + while (wind.IsClosed == false) + { + Display.BeginFrame(); + Display.Clear(); + + FontSurface thisFont = useKerning ? font : unkerned; + + if (useKerning) + thisFont.DrawText("Using kerning. (space to toggle)"); + else + thisFont.DrawText("No kerning used. (space to toggle)"); + + thisFont.Color = Color.White; + thisFont.DrawText(0, thisFont.FontHeight, text); + + Display.EndFrame(); + Core.KeepAlive(); + } + } + } + + void Keyboard_KeyDown(InputEventArgs e) + { + if (e.KeyCode == KeyCode.Space) + useKerning = !useKerning; + } + + + private FontSurface ConstructUnkernedFont(FontSurface font) + { + var bmp = font.Impl as AgateLib.BitmapFont.BitmapFontImpl; + + FontMetrics metrics = bmp.FontMetrics.Clone(); + + foreach (var glyph in metrics.Keys) + { + metrics[glyph].KerningPairs.Clear(); + } + + return FontSurface.FromImpl(new BitmapFontImpl(bmp.Surface, metrics, "Unkerned " + bmp.FontName)); + } + + private static string ConstructKerningText(DisplayWindow wind, FontSurface font) + { + + var bmp = font.Impl as AgateLib.BitmapFont.BitmapFontImpl; + + FontMetrics metrics = bmp.FontMetrics.Clone(); + + StringBuilder text = new StringBuilder(); + + int count = 0; + int maxLine = wind.Width / font.FontHeight; + + foreach (char first in metrics.Keys) + { + foreach (var kern in metrics[first].KerningPairs) + { + text.Append(first); + text.Append(kern.Key); + text.Append(" "); + + count += 2; + + if (count > maxLine) + { + text.AppendLine(); + count = 0; + } + } + } + + string displayText = text.ToString(); + return displayText; + } + + } +} Modified: trunk/Tests/GuiTests/RenderGui.cs =================================================================== --- trunk/Tests/GuiTests/RenderGui.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Tests/GuiTests/RenderGui.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -100,7 +100,7 @@ wind.Children.Add(topPanel); wind.Children.Add(bottomPanel); wind.AllowDrag = true; - wind.Size = new Size(400, 300); + wind.Size = new Size(500, 400); bottomPanel.LayoutExpand = LayoutExpand.ExpandToMax; wind.AcceptButton = (Button)leftPanel.Children[0]; Modified: trunk/Tests/Tests.csproj =================================================================== --- trunk/Tests/Tests.csproj 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Tests/Tests.csproj 2009-12-06 02:11:06 UTC (rev 1144) @@ -104,6 +104,7 @@ </Compile> <Compile Include="DisplayTests\ClipRect.cs" /> <Compile Include="Fonts\Builtin.cs" /> + <Compile Include="Fonts\Kerning.cs" /> <Compile Include="frmLauncher.cs"> <SubType>Form</SubType> </Compile> Modified: trunk/Tools/FontCreator/CreateFont.cs =================================================================== --- trunk/Tools/FontCreator/CreateFont.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Tools/FontCreator/CreateFont.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -62,7 +62,7 @@ foreach (string family in fonts) { - if (family == "Arial" || family.Contains("Sans Serif") && index == 0) + if (family == "Bitstream Vera Sans" || family == "Arial") index = cboFamily.Items.Count; cboFamily.Items.Add(family); Modified: trunk/Tools/FontCreator/EditGlyphs.Designer.cs =================================================================== --- trunk/Tools/FontCreator/EditGlyphs.Designer.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Tools/FontCreator/EditGlyphs.Designer.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -28,48 +28,107 @@ /// </summary> private void InitializeComponent() { + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.pctImage = new System.Windows.Forms.PictureBox(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.pctZoom = new System.Windows.Forms.PictureBox(); + this.hSeparator1 = new ERY.NotebookLib.HSeparator(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.lstItems = new System.Windows.Forms.ListBox(); this.properties = new System.Windows.Forms.PropertyGrid(); - ((System.ComponentModel.ISupportInitialize)(this.pctImage)).BeginInit(); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.btnZoomIn = new System.Windows.Forms.ToolStripButton(); + this.btnZoomOut = new System.Windows.Forms.ToolStripButton(); + this.mouseLabel = new System.Windows.Forms.ToolStripLabel(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pctImage)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pctZoom)).BeginInit(); this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); + this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // + // 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.splitContainer3); + this.splitContainer1.Panel1.Controls.Add(this.hSeparator1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); + this.splitContainer1.Size = new System.Drawing.Size(574, 389); + this.splitContainer1.SplitterDistance = 217; + this.splitContainer1.TabIndex = 2; + // + // splitContainer3 + // + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer3.Panel1 + // + this.splitContainer3.Panel1.Controls.Add(this.pctImage); + // + // splitContainer3.Panel2 + // + this.splitContainer3.Panel2.Controls.Add(this.pctZoom); + this.splitContainer3.Size = new System.Drawing.Size(217, 385); + this.splitContainer3.SplitterDistance = 118; + this.splitContainer3.TabIndex = 2; + // // pctImage // this.pctImage.BackColor = System.Drawing.Color.White; this.pctImage.Dock = System.Windows.Forms.DockStyle.Fill; this.pctImage.Location = new System.Drawing.Point(0, 0); this.pctImage.Name = "pctImage"; - this.pctImage.Size = new System.Drawing.Size(218, 271); + this.pctImage.Size = new System.Drawing.Size(217, 118); this.pctImage.TabIndex = 0; this.pctImage.TabStop = false; this.pctImage.Paint += new System.Windows.Forms.PaintEventHandler(this.pctImage_Paint); // - // splitContainer1 + // pctZoom // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; + this.pctZoom.Dock = System.Windows.Forms.DockStyle.Fill; + this.pctZoom.Location = new System.Drawing.Point(0, 0); + this.pctZoom.Name = "pctZoom"; + this.pctZoom.Size = new System.Drawing.Size(217, 263); + this.pctZoom.TabIndex = 2; + this.pctZoom.TabStop = false; + this.pctZoom.MouseLeave += new System.EventHandler(this.pctZoom_MouseLeave); + this.pctZoom.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pctZoom_MouseMove); + this.pctZoom.Resize += new System.EventHandler(this.pctZoom_Resize); + this.pctZoom.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pctZoom_MouseDown); + this.pctZoom.Paint += new System.Windows.Forms.PaintEventHandler(this.pctZoom_Paint); + this.pctZoom.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pctZoom_MouseUp); // - // splitContainer1.Panel1 + // hSeparator1 // - this.splitContainer1.Panel1.Controls.Add(this.pctImage); + this.hSeparator1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.hSeparator1.Location = new System.Drawing.Point(0, 385); + this.hSeparator1.Margin = new System.Windows.Forms.Padding(3, 1, 3, 1); + this.hSeparator1.MaximumSize = new System.Drawing.Size(10000, 4); + this.hSeparator1.MinimumSize = new System.Drawing.Size(0, 4); + this.hSeparator1.Name = "hSeparator1"; + this.hSeparator1.Size = new System.Drawing.Size(217, 4); + this.hSeparator1.TabIndex = 1; + this.hSeparator1.TabStop = true; // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); - this.splitContainer1.Size = new System.Drawing.Size(576, 271); - this.splitContainer1.SplitterDistance = 218; - this.splitContainer1.TabIndex = 2; - // // splitContainer2 // this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; @@ -84,8 +143,8 @@ // splitContainer2.Panel2 // this.splitContainer2.Panel2.Controls.Add(this.properties); - this.splitContainer2.Size = new System.Drawing.Size(354, 271); - this.splitContainer2.SplitterDistance = 71; + this.splitContainer2.Size = new System.Drawing.Size(353, 389); + this.splitContainer2.SplitterDistance = 101; this.splitContainer2.TabIndex = 0; // // lstItems @@ -97,33 +156,82 @@ this.lstItems.Location = new System.Drawing.Point(0, 0); this.lstItems.MultiColumn = true; this.lstItems.Name = "lstItems"; - this.lstItems.Size = new System.Drawing.Size(354, 69); + this.lstItems.Size = new System.Drawing.Size(353, 95); this.lstItems.TabIndex = 0; this.lstItems.SelectedIndexChanged += new System.EventHandler(this.lstItems_SelectedIndexChanged); + this.lstItems.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lstItems_KeyDown); // // properties // this.properties.Dock = System.Windows.Forms.DockStyle.Fill; this.properties.Location = new System.Drawing.Point(0, 0); this.properties.Name = "properties"; - this.properties.Size = new System.Drawing.Size(354, 196); + this.properties.Size = new System.Drawing.Size(353, 284); this.properties.TabIndex = 1; + this.properties.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.properties_PropertyValueChanged); // + // toolStrip1 + // + this.toolStrip1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.btnZoomIn, + this.btnZoomOut, + this.mouseLabel}); + this.toolStrip1.Location = new System.Drawing.Point(0, 389); + this.toolStrip1.Name = "toolStrip1"; + this.toolStrip1.Size = new System.Drawing.Size(574, 25); + this.toolStrip1.TabIndex = 4; + this.toolStrip1.Text = "toolStrip1"; + // + // btnZoomIn + // + this.btnZoomIn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnZoomIn.Image = global::FontCreator.Properties.Resources.zoom_in; + this.btnZoomIn.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnZoomIn.Name = "btnZoomIn"; + this.btnZoomIn.Size = new System.Drawing.Size(23, 22); + this.btnZoomIn.Text = "toolStripButton1"; + this.btnZoomIn.Click += new System.EventHandler(this.btnZoomIn_Click); + // + // btnZoomOut + // + this.btnZoomOut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.btnZoomOut.Image = global::FontCreator.Properties.Resources.zoom_out; + this.btnZoomOut.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnZoomOut.Name = "btnZoomOut"; + this.btnZoomOut.Size = new System.Drawing.Size(23, 22); + this.btnZoomOut.Text = "toolStripButton2"; + this.btnZoomOut.Click += new System.EventHandler(this.btnZoomOut_Click); + // + // mouseLabel + // + this.mouseLabel.Name = "mouseLabel"; + this.mouseLabel.Size = new System.Drawing.Size(71, 22); + this.mouseLabel.Text = "mouseLabel"; + // // EditGlyphs // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.splitContainer1); + this.Controls.Add(this.toolStrip1); this.Name = "EditGlyphs"; - this.Size = new System.Drawing.Size(576, 271); - ((System.ComponentModel.ISupportInitialize)(this.pctImage)).EndInit(); + this.Size = new System.Drawing.Size(574, 414); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel2.ResumeLayout(false); + this.splitContainer3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pctImage)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pctZoom)).EndInit(); this.splitContainer2.Panel1.ResumeLayout(false); this.splitContainer2.Panel2.ResumeLayout(false); this.splitContainer2.ResumeLayout(false); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -134,5 +242,12 @@ private System.Windows.Forms.SplitContainer splitContainer2; private System.Windows.Forms.PropertyGrid properties; private System.Windows.Forms.ListBox lstItems; + private ERY.NotebookLib.HSeparator hSeparator1; + private System.Windows.Forms.PictureBox pctZoom; + private System.Windows.Forms.SplitContainer splitContainer3; + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.ToolStripLabel mouseLabel; + private System.Windows.Forms.ToolStripButton btnZoomIn; + private System.Windows.Forms.ToolStripButton btnZoomOut; } } \ No newline at end of file Modified: trunk/Tools/FontCreator/EditGlyphs.cs =================================================================== --- trunk/Tools/FontCreator/EditGlyphs.cs 2009-12-05 21:21:08 UTC (rev 1143) +++ trunk/Tools/FontCreator/EditGlyphs.cs 2009-12-06 02:11:06 UTC (rev 1144) @@ -12,64 +12,294 @@ namespace FontCreator { - public partial class EditGlyphs : UserControl - { - public EditGlyphs() - { - InitializeComponent(); - } + public partial class EditGlyphs : UserControl + { + public EditGlyphs() + { + InitializeComponent(); - Image image; - FontMetrics font; + mouseLabel.Text = ""; + } + Image image; + FontMetrics font; + int zoomTop, zoomLeft; + float scale = 4f; + bool dragSource; + bool dragOverhang; + int overHangRelative; - internal void SetFont(string tempImage, FontMetrics fontMetrics) - { - image = new Bitmap(tempImage); + internal void SetFont(string tempImage, FontMetrics fontMetrics) + { + image = new Bitmap(tempImage); - font = fontMetrics; + font = fontMetrics; - foreach (char key in font.Keys) - { - lstItems.Items.Add(key); - } - } + lstItems.Items.Clear(); - private void pctImage_Paint(object sender, PaintEventArgs e) - { - if (image == null) - return; + foreach (char key in font.Keys) + { + lstItems.Items.Add(key); + } + } - e.Graphics.FillRectangle(Brushes.DarkRed, new Rectangle(0,0,image.Width, image.Height)); - e.Graphics.DrawImage(image, new Rectangle(0, 0, image.Width, image.Height)); + private void pctImage_Paint(object sender, PaintEventArgs e) + { + if (image == null) + return; - if (lstItems.SelectedIndex != -1) - { - char glyph = (char)lstItems.SelectedItem; - GlyphMetrics metric = font[glyph]; - Color clr = Color.FromArgb(128, Color.Blue); + PaintFontImage(e.Graphics); + } + private void pctZoom_Paint(object sender, PaintEventArgs e) + { + if (lstItems.SelectedItem == null) + { + e.Graphics.Clear(Color.White); + return; + } - using (Pen p = new Pen(clr)) - { - e.Graphics.DrawRectangle(p, Interop.Convert(metric.SourceRect)); - } - } - } + e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; + e.Graphics.Transform = new System.Drawing.Drawing2D.Matrix(scale, 0, 0, scale, -zoomLeft * scale, -zoomTop * scale); - private void lstItems_SelectedIndexChanged(object sender, EventArgs e) - { - if (lstItems.SelectedItem == null) - { - properties.SelectedObject = null; - } - else - { - properties.SelectedObject = font[(char)lstItems.SelectedItem]; - } + PaintFontImage(e.Graphics); + } + private void PaintFontImage(Graphics g) + { + g.FillRectangle(Brushes.DarkRed, new Rectangle(0, 0, image.Width, image.Height)); - pctImage.Invalidate(); - } + if (lstItems.SelectedIndex != -1) + { + GlyphMetrics metric = SelectedMetric; + Rectangle r = Interop.Convert(metric.SourceRect); + + Rectangle ... [truncated message content] |
From: <ka...@us...> - 2009-12-05 21:21:16
|
Revision: 1143 http://agate.svn.sourceforge.net/agate/?rev=1143&view=rev Author: kanato Date: 2009-12-05 21:21:08 +0000 (Sat, 05 Dec 2009) Log Message: ----------- Change version in assembly attribute. Modified Paths: -------------- trunk/AgateLib/Properties/AssemblyInfo.cs Modified: trunk/AgateLib/Properties/AssemblyInfo.cs =================================================================== --- trunk/AgateLib/Properties/AssemblyInfo.cs 2009-12-05 21:02:19 UTC (rev 1142) +++ trunk/AgateLib/Properties/AssemblyInfo.cs 2009-12-05 21:21:08 UTC (rev 1143) @@ -51,6 +51,6 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.3.2.0")] -[assembly: AssemblyFileVersion("0.3.2.0")] +[assembly: AssemblyVersion("0.3.9.0")] +[assembly: AssemblyFileVersion("0.3.9.0")] [assembly: NeutralResourcesLanguageAttribute("en")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-05 21:02:31
|
Revision: 1142 http://agate.svn.sourceforge.net/agate/?rev=1142&view=rev Author: kanato Date: 2009-12-05 21:02:19 +0000 (Sat, 05 Dec 2009) Log Message: ----------- Add function to get font kerning on Windows. Modified Paths: -------------- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs Added Paths: ----------- trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs Modified: trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj =================================================================== --- trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-05 09:28:38 UTC (rev 1141) +++ trunk/Drivers/AgateLib.WinForms/AgateLib.WinForms.csproj 2009-12-05 21:02:19 UTC (rev 1142) @@ -115,6 +115,7 @@ <Compile Include="FormUtil.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="GdiFontExtensions.cs" /> <Compile Include="Icons.Designer.cs"> <DependentUpon>Icons.resx</DependentUpon> <SubType>Code</SubType> Modified: trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs 2009-12-05 09:28:38 UTC (rev 1141) +++ trunk/Drivers/AgateLib.WinForms/BitmapFontUtil.cs 2009-12-05 21:02:19 UTC (rev 1142) @@ -307,12 +307,20 @@ } } + + if (Core.Platform.PlatformType == PlatformType.Windows) + { + GdiFontExtensions gdi = new GdiFontExtensions(); + gdi.LoadKerningPairs(glyphs, font, bmp, g); + } + g.Dispose(); // do post processing of chars. PostProcessFont(options, bmp); + // place the chars on the border image borderG.DrawImage(bmp, new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height)); Added: trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs =================================================================== --- trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs (rev 0) +++ trunk/Drivers/AgateLib.WinForms/GdiFontExtensions.cs 2009-12-05 21:02:19 UTC (rev 1142) @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using AgateLib.BitmapFont; + +namespace AgateLib.WinForms +{ + class GdiFontExtensions + { + [DllImport("gdi32.dll")] + static extern uint GetKerningPairs(IntPtr hdc, uint nNumPairs,[Out] KERNINGPAIR[] lpkrnpair); + + [DllImport("gdi32.dll", ExactSpelling = true, PreserveSig = true, SetLastError = true)] + static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj); + + [StructLayout(LayoutKind.Sequential)] + struct KERNINGPAIR + { + public ushort wFirst; // might be better off defined as char + public ushort wSecond; // might be better off defined as char + public int iKernAmount; + + public KERNINGPAIR(ushort wFirst, ushort wSecond, int iKernAmount) + { + this.wFirst = wFirst; + this.wSecond = wSecond; + this.iKernAmount = iKernAmount; + } + + public override string ToString() + { + return (String.Format("{{First={0}, Second={1}, Amount={2}}}", wFirst, wSecond, iKernAmount)); + } + } + + internal void LoadKerningPairs(FontMetrics glyphs, Font font, Bitmap bmp, Graphics g) + { + IntPtr hdc = g.GetHdc(); + SelectObject(hdc, font.ToHfont()); + + uint numPairs = GetKerningPairs(hdc, 0, null); + + if (numPairs == 0) + return; + + KERNINGPAIR[] kerningArray = new KERNINGPAIR[numPairs]; + + uint err = GetKerningPairs(hdc, numPairs, kerningArray); + + if (err == 0) throw new Exception(); + + foreach (var kern in kerningArray) + { + if (kern.iKernAmount == 0) + continue; + + if (glyphs.ContainsKey((char)kern.wFirst) == false) + continue; + if (glyphs.ContainsKey((char)kern.wSecond) == false) + continue; + + glyphs[(char)kern.wFirst].KerningPairs.Add((char)kern.wSecond, kern.iKernAmount); + } + + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-05 09:28:50
|
Revision: 1141 http://agate.svn.sourceforge.net/agate/?rev=1141&view=rev Author: kanato Date: 2009-12-05 09:28:38 +0000 (Sat, 05 Dec 2009) Log Message: ----------- Workaround for mono bug crashing on settings access. Modified Paths: -------------- trunk/AgateTools.sln trunk/Tools/FontCreator/FontCreator.csproj trunk/Tools/FontCreator/FontCreatorProgram.cs trunk/Tools/FontCreator/frmWarningSplash.cs trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj trunk/Tools/PackedSpriteCreator/SpriteRenderer.cs trunk/Tools/ResourceEditor/ResourceEditor.csproj Modified: trunk/AgateTools.sln =================================================================== --- trunk/AgateTools.sln 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/AgateTools.sln 2009-12-05 09:28:38 UTC (rev 1141) @@ -1,18 +1,18 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceEditor", "Tools\ResourceEditor\ResourceEditor.csproj", "{5E31315E-8A37-4A55-A8D8-A0136C0C2F4C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceEditor", "Tools\ResourceEditor\ResourceEditor.csproj", "{FAB0D7E5-E6AF-4B29-BFE1-6545D6C22621}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.WinForms", "Drivers\AgateLib.WinForms\AgateLib.WinForms.csproj", "{2E6579F9-1F70-4DF9-98A9-22687425A830}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib.WinForms", "Drivers\AgateLib.WinForms\AgateLib.WinForms.csproj", "{BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackedSpriteCreator", "Tools\PackedSpriteCreator\PackedSpriteCreator.csproj", "{674650F4-8E72-4DD2-8E5C-1FF858C7B5E4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackedSpriteCreator", "Tools\PackedSpriteCreator\PackedSpriteCreator.csproj", "{C653C244-F604-4BA4-8822-D04FA9ACEFA5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateDrawing", "Drivers\AgateDrawing\AgateDrawing.csproj", "{AAC01466-7370-4464-B1AD-1593A3A3BEC1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateDrawing", "Drivers\AgateDrawing\AgateDrawing.csproj", "{164A785D-924E-40FB-A517-D7E677F3B53A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontCreator", "Tools\FontCreator\FontCreator.csproj", "{49F8D445-EF44-46AA-93C0-E9C563B2074C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FontCreator", "Tools\FontCreator\FontCreator.csproj", "{A18DEAA1-EB7F-4B4A-B93A-83A2CAD5954A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib", "AgateLib\AgateLib.csproj", "{BED5DD5D-13C6-4BA4-80DC-A47478E74F84}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgateLib", "AgateLib\AgateLib.csproj", "{9490B719-829E-43A7-A5FE-8001F8A81759}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotebookLib", "Tools\NotebookLib\NotebookLib\NotebookLib.csproj", "{826129F3-81A8-4D87-99E0-60DA009C9E3C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotebookLib", "Tools\NotebookLib\NotebookLib\NotebookLib.csproj", "{91F57346-B574-4D52-9EB0-AA191B552C94}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{4B147B99-8BC3-4B78-938A-1035B16A8D1B}" ProjectSection(SolutionItems) = preProject @@ -27,34 +27,34 @@ Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5E31315E-8A37-4A55-A8D8-A0136C0C2F4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5E31315E-8A37-4A55-A8D8-A0136C0C2F4C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5E31315E-8A37-4A55-A8D8-A0136C0C2F4C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5E31315E-8A37-4A55-A8D8-A0136C0C2F4C}.Release|Any CPU.Build.0 = Release|Any CPU - {2E6579F9-1F70-4DF9-98A9-22687425A830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E6579F9-1F70-4DF9-98A9-22687425A830}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E6579F9-1F70-4DF9-98A9-22687425A830}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E6579F9-1F70-4DF9-98A9-22687425A830}.Release|Any CPU.Build.0 = Release|Any CPU - {674650F4-8E72-4DD2-8E5C-1FF858C7B5E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {674650F4-8E72-4DD2-8E5C-1FF858C7B5E4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {674650F4-8E72-4DD2-8E5C-1FF858C7B5E4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {674650F4-8E72-4DD2-8E5C-1FF858C7B5E4}.Release|Any CPU.Build.0 = Release|Any CPU - {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AAC01466-7370-4464-B1AD-1593A3A3BEC1}.Release|Any CPU.Build.0 = Release|Any CPU - {49F8D445-EF44-46AA-93C0-E9C563B2074C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {49F8D445-EF44-46AA-93C0-E9C563B2074C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49F8D445-EF44-46AA-93C0-E9C563B2074C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {49F8D445-EF44-46AA-93C0-E9C563B2074C}.Release|Any CPU.Build.0 = Release|Any CPU - {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BED5DD5D-13C6-4BA4-80DC-A47478E74F84}.Release|Any CPU.Build.0 = Release|Any CPU - {826129F3-81A8-4D87-99E0-60DA009C9E3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {826129F3-81A8-4D87-99E0-60DA009C9E3C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {826129F3-81A8-4D87-99E0-60DA009C9E3C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {826129F3-81A8-4D87-99E0-60DA009C9E3C}.Release|Any CPU.Build.0 = Release|Any CPU + {FAB0D7E5-E6AF-4B29-BFE1-6545D6C22621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FAB0D7E5-E6AF-4B29-BFE1-6545D6C22621}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FAB0D7E5-E6AF-4B29-BFE1-6545D6C22621}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FAB0D7E5-E6AF-4B29-BFE1-6545D6C22621}.Release|Any CPU.Build.0 = Release|Any CPU + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BEF6D67B-4C84-4D3E-8047-6DB2C8754D77}.Release|Any CPU.Build.0 = Release|Any CPU + {C653C244-F604-4BA4-8822-D04FA9ACEFA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C653C244-F604-4BA4-8822-D04FA9ACEFA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C653C244-F604-4BA4-8822-D04FA9ACEFA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C653C244-F604-4BA4-8822-D04FA9ACEFA5}.Release|Any CPU.Build.0 = Release|Any CPU + {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {164A785D-924E-40FB-A517-D7E677F3B53A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {164A785D-924E-40FB-A517-D7E677F3B53A}.Release|Any CPU.Build.0 = Release|Any CPU + {A18DEAA1-EB7F-4B4A-B93A-83A2CAD5954A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A18DEAA1-EB7F-4B4A-B93A-83A2CAD5954A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A18DEAA1-EB7F-4B4A-B93A-83A2CAD5954A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A18DEAA1-EB7F-4B4A-B93A-83A2CAD5954A}.Release|Any CPU.Build.0 = Release|Any CPU + {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9490B719-829E-43A7-A5FE-8001F8A81759}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9490B719-829E-43A7-A5FE-8001F8A81759}.Release|Any CPU.Build.0 = Release|Any CPU + {91F57346-B574-4D52-9EB0-AA191B552C94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91F57346-B574-4D52-9EB0-AA191B552C94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91F57346-B574-4D52-9EB0-AA191B552C94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91F57346-B574-4D52-9EB0-AA191B552C94}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/Tools/FontCreator/FontCreator.csproj =================================================================== --- trunk/Tools/FontCreator/FontCreator.csproj 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/Tools/FontCreator/FontCreator.csproj 2009-12-05 09:28:38 UTC (rev 1141) @@ -1,12 +1,13 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{A18DEAA1-EB7F-4B4A-B93A-83A2CAD5954A}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon></ApplicationIcon> + <ApplicationIcon> + </ApplicationIcon> <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>FontCreator</AssemblyName> @@ -16,9 +17,11 @@ <DelaySign>false</DelaySign> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <OutputType>WinExe</OutputType> - <AppDesignerFolder></AppDesignerFolder> + <AppDesignerFolder> + </AppDesignerFolder> <RootNamespace>FontCreator</RootNamespace> - <StartupObject></StartupObject> + <StartupObject> + </StartupObject> <FileUpgradeFlags> </FileUpgradeFlags> </PropertyGroup> @@ -29,7 +32,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> @@ -38,7 +42,8 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AllowUnsafeBlocks>False</AllowUnsafeBlocks> @@ -47,7 +52,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> @@ -56,26 +62,27 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <ItemGroup> <Reference Include="System"> - <Name>System</Name> + <Name>System</Name> </Reference> <Reference Include="System.Core"> - <Name>System.Core</Name> + <Name>System.Core</Name> </Reference> <Reference Include="System.Data"> - <Name>System.Data</Name> + <Name>System.Data</Name> </Reference> <Reference Include="System.Drawing"> - <Name>System.Drawing</Name> + <Name>System.Drawing</Name> </Reference> <Reference Include="System.Windows.Forms"> - <Name>System.Windows.Forms</Name> + <Name>System.Windows.Forms</Name> </Reference> <Reference Include="System.Xml"> - <Name>System.Xml</Name> + <Name>System.Xml</Name> </Reference> </ItemGroup> <ItemGroup> @@ -96,14 +103,14 @@ <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> <Compile Include="CreateFont.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="CreateFont.Designer.cs"> <DependentUpon>CreateFont.cs</DependentUpon> <SubType>Code</SubType> </Compile> <Compile Include="EditGlyphs.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="EditGlyphs.Designer.cs"> <DependentUpon>EditGlyphs.cs</DependentUpon> @@ -116,21 +123,21 @@ <SubType>Code</SubType> </Compile> <Compile Include="frmFontCreator.cs"> - <SubType>Code</SubType> + <SubType>Form</SubType> </Compile> <Compile Include="frmFontCreator.Designer.cs"> <DependentUpon>frmFontCreator.cs</DependentUpon> <SubType>Code</SubType> </Compile> <Compile Include="frmWarningSplash.cs"> - <SubType>Code</SubType> + <SubType>Form</SubType> </Compile> <Compile Include="frmWarningSplash.Designer.cs"> <DependentUpon>frmWarningSplash.cs</DependentUpon> <SubType>Code</SubType> </Compile> <Compile Include="SaveFont.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="SaveFont.Designer.cs"> <DependentUpon>SaveFont.cs</DependentUpon> @@ -186,4 +193,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Modified: trunk/Tools/FontCreator/FontCreatorProgram.cs =================================================================== --- trunk/Tools/FontCreator/FontCreatorProgram.cs 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/Tools/FontCreator/FontCreatorProgram.cs 2009-12-05 09:28:38 UTC (rev 1141) @@ -35,12 +35,29 @@ frm.Show(); Properties.Settings.Default.Reload(); - if (Properties.Settings.Default.SkipWarning == false) + + // workaround for bug in mono + bool skipWarning = false; + + try + { + skipWarning = Properties.Settings.Default.SkipWarning; + } + catch + {} + + if (skipWarning == false) { new frmWarningSplash().ShowDialog(frm); } - Properties.Settings.Default.Save(); + try + { + Properties.Settings.Default.Save(); + } + catch + { } + Application.Run(frm); } Modified: trunk/Tools/FontCreator/frmWarningSplash.cs =================================================================== --- trunk/Tools/FontCreator/frmWarningSplash.cs 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/Tools/FontCreator/frmWarningSplash.cs 2009-12-05 09:28:38 UTC (rev 1141) @@ -19,7 +19,12 @@ private void btnOK_Click(object sender, EventArgs e) { - Properties.Settings.Default.SkipWarning = chkSkipWarning.Checked; + try + { + Properties.Settings.Default.SkipWarning = chkSkipWarning.Checked; + } + catch + { } } } } Modified: trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj =================================================================== --- trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/Tools/NotebookLib/NotebookLib/NotebookLib.csproj 2009-12-05 09:28:38 UTC (rev 1141) @@ -1,12 +1,13 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{91F57346-B574-4D52-9EB0-AA191B552C94}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon></ApplicationIcon> + <ApplicationIcon> + </ApplicationIcon> <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>NotebookLib</AssemblyName> @@ -16,9 +17,11 @@ <DelaySign>false</DelaySign> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <OutputType>Library</OutputType> - <AppDesignerFolder></AppDesignerFolder> + <AppDesignerFolder> + </AppDesignerFolder> <RootNamespace>NotebookLib</RootNamespace> - <StartupObject></StartupObject> + <StartupObject> + </StartupObject> <FileUpgradeFlags> </FileUpgradeFlags> </PropertyGroup> @@ -29,7 +32,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> @@ -38,7 +42,8 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AllowUnsafeBlocks>False</AllowUnsafeBlocks> @@ -47,7 +52,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> @@ -56,32 +62,33 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <ItemGroup> <Reference Include="System"> - <Name>System</Name> + <Name>System</Name> </Reference> <Reference Include="System.Core"> - <Name>System.Core</Name> + <Name>System.Core</Name> </Reference> <Reference Include="System.Data"> - <Name>System.Data</Name> + <Name>System.Data</Name> </Reference> <Reference Include="System.Deployment"> - <Name>System.Deployment</Name> + <Name>System.Deployment</Name> </Reference> <Reference Include="System.Design"> - <Name>System.Design</Name> + <Name>System.Design</Name> </Reference> <Reference Include="System.Drawing"> - <Name>System.Drawing</Name> + <Name>System.Drawing</Name> </Reference> <Reference Include="System.Windows.Forms"> - <Name>System.Windows.Forms</Name> + <Name>System.Windows.Forms</Name> </Reference> <Reference Include="System.Xml"> - <Name>System.Xml</Name> + <Name>System.Xml</Name> </Reference> </ItemGroup> <ItemGroup> @@ -91,7 +98,7 @@ <SubType>Code</SubType> </Compile> <Compile Include="HSeparator.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="HSeparator.Designer.cs"> <DependentUpon>HSeparator.cs</DependentUpon> @@ -110,14 +117,14 @@ <SubType>Code</SubType> </Compile> <Compile Include="Notebook.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="Notebook.Designer.cs"> <DependentUpon>Notebook.cs</DependentUpon> <SubType>Code</SubType> </Compile> <Compile Include="NotebookPage.cs"> - <SubType>Code</SubType> + <SubType>Component</SubType> </Compile> <Compile Include="NotebookPage.Designer.cs"> <DependentUpon>NotebookPage.cs</DependentUpon> @@ -136,19 +143,19 @@ <SubType>Code</SubType> </Compile> <Compile Include="FlatTabs\FlatTabNavigator.cs"> - <SubType>Code</SubType> + <SubType>Component</SubType> </Compile> <Compile Include="FlatTabs\FlatTabProperties.cs"> <SubType>Code</SubType> </Compile> <Compile Include="ListBookNavigator\ListBookNavigator.cs"> - <SubType>Code</SubType> + <SubType>Component</SubType> </Compile> <Compile Include="ListBookNavigator\ListBookProperties.cs"> <SubType>Code</SubType> </Compile> <Compile Include="NoNavigator\NoNavigator.cs"> - <SubType>Code</SubType> + <SubType>Component</SubType> </Compile> <Compile Include="NoNavigator\NoNavigatorProperties.cs"> <SubType>Code</SubType> @@ -193,4 +200,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Modified: trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj =================================================================== --- trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/Tools/PackedSpriteCreator/PackedSpriteCreator.csproj 2009-12-05 09:28:38 UTC (rev 1141) @@ -1,12 +1,13 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{C653C244-F604-4BA4-8822-D04FA9ACEFA5}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon></ApplicationIcon> + <ApplicationIcon> + </ApplicationIcon> <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>PackedSpriteCreator</AssemblyName> @@ -16,9 +17,11 @@ <DelaySign>false</DelaySign> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <OutputType>WinExe</OutputType> - <AppDesignerFolder></AppDesignerFolder> + <AppDesignerFolder> + </AppDesignerFolder> <RootNamespace>PackedSpriteCreator</RootNamespace> - <StartupObject></StartupObject> + <StartupObject> + </StartupObject> <FileUpgradeFlags> </FileUpgradeFlags> </PropertyGroup> @@ -29,7 +32,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> @@ -38,7 +42,8 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AllowUnsafeBlocks>False</AllowUnsafeBlocks> @@ -47,7 +52,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> @@ -56,23 +62,24 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <ItemGroup> <Reference Include="System"> - <Name>System</Name> + <Name>System</Name> </Reference> <Reference Include="System.Core"> - <Name>System.Core</Name> + <Name>System.Core</Name> </Reference> <Reference Include="System.Data"> - <Name>System.Data</Name> + <Name>System.Data</Name> </Reference> <Reference Include="System.Drawing"> - <Name>System.Drawing</Name> + <Name>System.Drawing</Name> </Reference> <Reference Include="System.Windows.Forms"> - <Name>System.Windows.Forms</Name> + <Name>System.Windows.Forms</Name> </Reference> </ItemGroup> <ItemGroup> @@ -94,21 +101,21 @@ </ItemGroup> <ItemGroup> <Compile Include="frmAddSpriteFrames.cs"> - <SubType>Code</SubType> + <SubType>Form</SubType> </Compile> <Compile Include="frmAddSpriteFrames.Designer.cs"> <DependentUpon>frmAddSpriteFrames.cs</DependentUpon> <SubType>Code</SubType> </Compile> <Compile Include="frmNewSprite.cs"> - <SubType>Code</SubType> + <SubType>Form</SubType> </Compile> <Compile Include="frmNewSprite.Designer.cs"> <DependentUpon>frmNewSprite.cs</DependentUpon> <SubType>Code</SubType> </Compile> <Compile Include="frmSpriteCreator.cs"> - <SubType>Code</SubType> + <SubType>Form</SubType> </Compile> <Compile Include="frmSpriteCreator.Designer.cs"> <DependentUpon>frmSpriteCreator.cs</DependentUpon> @@ -121,7 +128,7 @@ <SubType>Code</SubType> </Compile> <Compile Include="SpriteEditor.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="SpriteEditor.Designer.cs"> <DependentUpon>SpriteEditor.cs</DependentUpon> @@ -172,4 +179,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Modified: trunk/Tools/PackedSpriteCreator/SpriteRenderer.cs =================================================================== --- trunk/Tools/PackedSpriteCreator/SpriteRenderer.cs 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/Tools/PackedSpriteCreator/SpriteRenderer.cs 2009-12-05 09:28:38 UTC (rev 1141) @@ -17,7 +17,7 @@ } public Color BackgroundColor { get; set; } - public void DrawSprite(IRenderTarget renderTarget, Sprite sprite) + public void DrawSprite(FrameBuffer renderTarget, Sprite sprite) { if (renderTarget == null) return; Modified: trunk/Tools/ResourceEditor/ResourceEditor.csproj =================================================================== --- trunk/Tools/ResourceEditor/ResourceEditor.csproj 2009-12-02 21:04:43 UTC (rev 1140) +++ trunk/Tools/ResourceEditor/ResourceEditor.csproj 2009-12-05 09:28:38 UTC (rev 1141) @@ -1,12 +1,13 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{FAB0D7E5-E6AF-4B29-BFE1-6545D6C22621}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon></ApplicationIcon> + <ApplicationIcon> + </ApplicationIcon> <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>ResourceEditor</AssemblyName> @@ -16,9 +17,11 @@ <DelaySign>false</DelaySign> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <OutputType>WinExe</OutputType> - <AppDesignerFolder></AppDesignerFolder> + <AppDesignerFolder> + </AppDesignerFolder> <RootNamespace>ResourceEditor</RootNamespace> - <StartupObject></StartupObject> + <StartupObject> + </StartupObject> <FileUpgradeFlags> </FileUpgradeFlags> </PropertyGroup> @@ -29,7 +32,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>True</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>False</Optimize> @@ -38,7 +42,8 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <AllowUnsafeBlocks>False</AllowUnsafeBlocks> @@ -47,7 +52,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE;</DefineConstants> - <DocumentationFile></DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>False</DebugSymbols> <FileAlignment>4096</FileAlignment> <Optimize>True</Optimize> @@ -56,26 +62,27 @@ <RemoveIntegerChecks>False</RemoveIntegerChecks> <TreatWarningsAsErrors>False</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <NoWarn></NoWarn> + <NoWarn> + </NoWarn> </PropertyGroup> <ItemGroup> <Reference Include="System"> - <Name>System</Name> + <Name>System</Name> </Reference> <Reference Include="System.Core"> - <Name>System.Core</Name> + <Name>System.Core</Name> </Reference> <Reference Include="System.Data"> - <Name>System.Data</Name> + <Name>System.Data</Name> </Reference> <Reference Include="System.Drawing"> - <Name>System.Drawing</Name> + <Name>System.Drawing</Name> </Reference> <Reference Include="System.Windows.Forms"> - <Name>System.Windows.Forms</Name> + <Name>System.Windows.Forms</Name> </Reference> <Reference Include="System.Xml"> - <Name>System.Xml</Name> + <Name>System.Xml</Name> </Reference> </ItemGroup> <ItemGroup> @@ -102,7 +109,7 @@ </ItemGroup> <ItemGroup> <Compile Include="frmResourceEditor.cs"> - <SubType>Code</SubType> + <SubType>Form</SubType> </Compile> <Compile Include="frmResourceEditor.Designer.cs"> <DependentUpon>frmResourceEditor.cs</DependentUpon> @@ -112,7 +119,7 @@ <SubType>Code</SubType> </Compile> <Compile Include="DisplayWinds\DisplayWindowEditor.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="DisplayWinds\DisplayWindowEditor.Designer.cs"> <DependentUpon>DisplayWindowEditor.cs</DependentUpon> @@ -130,14 +137,14 @@ <SubType>Code</SubType> </Compile> <Compile Include="StringTable\StringEntry.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="StringTable\StringEntry.Designer.cs"> <DependentUpon>StringEntry.cs</DependentUpon> <SubType>Code</SubType> </Compile> <Compile Include="StringTable\StringTableEditor.cs"> - <SubType>Code</SubType> + <SubType>UserControl</SubType> </Compile> <Compile Include="StringTable\StringTableEditor.Designer.cs"> <DependentUpon>StringTableEditor.cs</DependentUpon> @@ -226,4 +233,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-02 21:04:59
|
Revision: 1140 http://agate.svn.sourceforge.net/agate/?rev=1140&view=rev Author: kanato Date: 2009-12-02 21:04:43 +0000 (Wed, 02 Dec 2009) Log Message: ----------- Remove old clanlib source. Modified Paths: -------------- trunk/Examples/BallBuster.Net/CImage.cs Modified: trunk/Examples/BallBuster.Net/CImage.cs =================================================================== --- trunk/Examples/BallBuster.Net/CImage.cs 2009-12-02 17:27:37 UTC (rev 1139) +++ trunk/Examples/BallBuster.Net/CImage.cs 2009-12-02 21:04:43 UTC (rev 1140) @@ -135,10 +135,6 @@ this.bblogo = new Sprite(spritesSrc, "bblogo"); this.xlogo = new Sprite(spritesSrc, "xlogo"); - //CL_ResourceManager resources("imgs/font.xml"); - - //this.fontStyler = new CL_TextStyler("Font2", &resources); - Display.PackAllSurfaces(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-02 17:27:49
|
Revision: 1139 http://agate.svn.sourceforge.net/agate/?rev=1139&view=rev Author: kanato Date: 2009-12-02 17:27:37 +0000 (Wed, 02 Dec 2009) Log Message: ----------- Add missing ScrollBars.cs file. Added Paths: ----------- trunk/Tests/GuiTests/ScrollBars.cs Added: trunk/Tests/GuiTests/ScrollBars.cs =================================================================== --- trunk/Tests/GuiTests/ScrollBars.cs (rev 0) +++ trunk/Tests/GuiTests/ScrollBars.cs 2009-12-02 17:27:37 UTC (rev 1139) @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AgateLib; +using AgateLib.DisplayLib; +using AgateLib.Geometry; +using AgateLib.Gui; + +namespace Tests.GuiTests +{ + public class ScrollBars : AgateGame, IAgateTest + { + public string Name + { + get { return "Scroll Bars"; } + } + + public string Category + { + get { return "Gui"; } + } + + public void Main(string[] args) + { + Run(args); + } + + protected override void AdjustAppInitParameters(ref AppInitParameters initParams) + { + initParams.ShowSplashScreen = false; + initParams.InitializeAudio = false; + initParams.InitializeJoysticks = false; + + } + + protected override void Initialize() + { + base.GuiRoot = new GuiRoot(); + + Window wind = new Window("Scroll Bars test"); + wind.Size = new Size(400, 300); + + wind.Layout = new AgateLib.Gui.Layout.HorizontalBox(); + + Panel rightPanel = new Panel(); + Label leftVbarValueLabel = new Label(); + leftVbarValueLabel.Text = "Left Vertical value: "; + rightPanel.Children.Add(leftVbarValueLabel); + + Label rightVbarValueLabel = new Label(); + rightVbarValueLabel.Text = "Right Vertical value: "; + rightPanel.Children.Add(rightVbarValueLabel); + + VerticalScrollBar leftVbar = new VerticalScrollBar(); + leftVbar.ValueChanged += (sender, e) => { leftVbarValueLabel.Text = "Left Vertical value: " + leftVbar.Value.ToString(); }; + + VerticalScrollBar rightVbar = new VerticalScrollBar(); + rightVbar.ValueChanged += (sender, e) => { rightVbarValueLabel.Text = "Right Vertical value: " + rightVbar.Value.ToString(); }; + rightVbar.MaxValue = 10; + rightVbar.LargeChange = 5; + + wind.Children.Add(leftVbar); + wind.Children.Add(rightVbar); + wind.Children.Add(rightPanel); + + base.GuiRoot.Children.Add(wind); + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2009-12-02 16:43:01
|
Revision: 1138 http://agate.svn.sourceforge.net/agate/?rev=1138&view=rev Author: kanato Date: 2009-12-02 16:42:48 +0000 (Wed, 02 Dec 2009) Log Message: ----------- Add documentation. Modified Paths: -------------- trunk/AgateLib/AgateGame.cs trunk/AgateLib/AgateSetup.cs trunk/AgateLib/AppInitParameters.cs trunk/AgateLib/BitmapFont/BitmapFontImpl.cs trunk/AgateLib/DisplayLib/Display.cs trunk/AgateLib/DisplayLib/DisplayWindow.cs trunk/AgateLib/DisplayLib/FontSurface.cs trunk/AgateLib/DisplayLib/FrameBuffer.cs trunk/AgateLib/DisplayLib/RenderStateAdapter.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs trunk/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs trunk/AgateLib/Geometry/Builders/Cube.cs trunk/AgateLib/Geometry/Builders/Terrain.cs trunk/AgateLib/Geometry/VertexTypes/PositionColor.cs trunk/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs trunk/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs trunk/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs trunk/AgateLib/Geometry/VertexTypes/VertexLayout.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs trunk/AgateLib/ImplementationBase/DisplayImpl.cs trunk/AgateLib/ImplementationBase/FrameBufferImpl.cs trunk/AgateLib/ImplementationBase/IndexBufferImpl.cs trunk/AgateLib/ImplementationBase/ShaderCompilerImpl.cs trunk/AgateLib/ImplementationBase/VertexBufferImpl.cs trunk/AgateLib/Particles/Particles/SpriteParticle.cs trunk/AgateLib/Utility/ZipFileProvider.cs trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs trunk/Drivers/AgateSDX/D3DDevice.cs trunk/Drivers/AgateSDX/DrawBuffer.cs trunk/Drivers/AgateSDX/FrameBufferSurface.cs trunk/Drivers/AgateSDX/HlslCompiler.cs trunk/Drivers/AgateSDX/HlslEffect.cs trunk/Drivers/AgateSDX/SDX_Display.cs trunk/Drivers/AgateSDX/SDX_Input.cs trunk/Drivers/AgateSDX/SDX_Surface.cs trunk/Drivers/AgateSDX/SDX_VertexBuffer.cs trunk/Tests/AudioTests/AudioPlayer/frmAudioPlayer.cs trunk/Tests/CoreTests/App.cs trunk/Tests/CoreTests/Performance/Performance.cs trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs trunk/Tests/DisplayTests/ScreenCapture.cs trunk/Tests/DisplayTests/SpriteTester/frmSpriteTester.cs trunk/Tests/Fonts/Builtin.cs trunk/Tests/Fonts/FontLineTester.cs trunk/Tests/Fonts/Fonts.cs Modified: trunk/AgateLib/AgateGame.cs =================================================================== --- trunk/AgateLib/AgateGame.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/AgateGame.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -99,7 +99,7 @@ if (GuiRoot != null) GuiRoot.DoUpdate(); - Display.RenderTarget = mWindow; + Display.RenderTarget = mWindow.FrameBuffer; Display.BeginFrame(); Render(); @@ -121,7 +121,7 @@ { if (mInitParams == null) { - mInitParams = GetAppInitParameters(); + mInitParams = new AppInitParameters(); AdjustAppInitParameters(ref mInitParams); } return mInitParams; @@ -288,7 +288,7 @@ /// Gets the initialization parameters. /// </summary> /// <returns></returns> - [Obsolete("Override AdjustAppInitParameters")] + [Obsolete("Override AdjustAppInitParameters", true)] protected virtual AppInitParameters GetAppInitParameters() { return new AppInitParameters(); Modified: trunk/AgateLib/AgateSetup.cs =================================================================== --- trunk/AgateLib/AgateSetup.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/AgateSetup.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -170,8 +170,7 @@ /// Automatically selects the driver to use, or asks the user which /// driver to use if appropriate. /// </summary> - [Obsolete("Use Initialize(bool, bool, bool) overload instead.")] - public void InitializeDisplay() + private void InitializeDisplay() { DoAskUser(); InitializeDisplay(mSelectDisplay); @@ -192,8 +191,7 @@ /// Initializes the Audio subsystem. /// Automatically picks which driver to use. /// </summary> - [Obsolete("Use Initialize(bool, bool, bool) overload instead.")] - public void InitializeAudio() + private void InitializeAudio() { DoAskUser(); InitializeAudio(mSelectAudio); @@ -214,8 +212,7 @@ /// Initializes the Input subsystem. /// Automatically picks which driver to use. /// </summary> - [Obsolete("Use Initialize(bool, bool, bool) overload instead.")] - public void InitializeInput() + private void InitializeInput() { DoAskUser(); InitializeInput(mSelectInput); Modified: trunk/AgateLib/AppInitParameters.cs =================================================================== --- trunk/AgateLib/AppInitParameters.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/AppInitParameters.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,8 +6,14 @@ namespace AgateLib { + /// <summary> + /// Class which contains the parameters for initializing the application. + /// </summary> public class AppInitParameters { + /// <summary> + /// Constructs an AppInitParameters object. + /// </summary> public AppInitParameters() { InitializeAudio = true; @@ -16,16 +22,43 @@ ShowSplashScreen = true; } + /// <summary> + /// Gets or sets a value indicating whether to show the splash screen on startup. + /// </summary> public bool ShowSplashScreen { get; set; } + /// <summary> + /// Gets or sets a value indicating whether the main window should be user resizable. + /// </summary> public bool AllowResize { get; set; } + /// <summary> + /// Gets or sets a file name which points to an icon file to use for the main window. + /// </summary> public string IconFile { get; set; } + /// <summary> + /// Gets or sets a boolean value indicating whether to initialize the display or not. + /// </summary> public bool InitializeDisplay { get; set; } + /// <summary> + /// Gets or sets a boolean value indicating whether to initialize the audio system or not. + /// </summary> public bool InitializeAudio { get; set; } + /// <summary> + /// Gets or sets a boolean value indicating whether to initialize the joystick system or not. + /// </summary> public bool InitializeJoysticks { get; set; } + /// <summary> + /// Gets or sets the preferred display driver. + /// </summary> public Drivers.DisplayTypeID PreferredDisplay { get; set; } + /// <summary> + /// Gets or sets the preferred audio driver. + /// </summary> public Drivers.AudioTypeID PreferredAudio { get; set; } + /// <summary> + /// Gets or sets the preferred input driver. + /// </summary> public Drivers.InputTypeID PreferredInput { get; set; } } Modified: trunk/AgateLib/BitmapFont/BitmapFontImpl.cs =================================================================== --- trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/BitmapFont/BitmapFontImpl.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -82,8 +82,8 @@ /// Constructs a BitmapFontImpl, assuming the characters in the given file /// are all the same size, and are in their ASCII order. /// </summary> - /// <param name="filename"></param> - /// <param name="characterSize"></param> + /// <param name="filename">Path to the file which contains the image data for the font glyphs.</param> + /// <param name="characterSize">Size of each character in the image.</param> public BitmapFontImpl(string filename, Size characterSize) { FontName = System.IO.Path.GetFileNameWithoutExtension(filename); @@ -102,6 +102,7 @@ /// <param name="surface">Surface which contains the image data for the font glyphs.</param> /// <param name="fontMetrics">FontMetrics structure which describes how characters /// are laid out.</param> + /// <param name="name">The name of the font.</param> public BitmapFontImpl(Surface surface, FontMetrics fontMetrics, string name) { FontName = name; Modified: trunk/AgateLib/DisplayLib/Display.cs =================================================================== --- trunk/AgateLib/DisplayLib/Display.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/Display.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -106,6 +106,7 @@ get { return mRenderState; } } + [Obsolete] private static ShaderCompilerImpl CreateShaderCompiler() { return impl.CreateShaderCompiler(); Modified: trunk/AgateLib/DisplayLib/DisplayWindow.cs =================================================================== --- trunk/AgateLib/DisplayLib/DisplayWindow.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/DisplayWindow.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -69,7 +69,7 @@ impl = Display.Impl.CreateDisplayWindow(par); } - Display.RenderTarget = this; + Display.RenderTarget = FrameBuffer; Display.DisposeDisplay += new Display.DisposeDisplayHandler(Dispose); } /// <summary> Modified: trunk/AgateLib/DisplayLib/FontSurface.cs =================================================================== --- trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/FontSurface.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -305,7 +305,7 @@ /// </summary> /// <param name="text"></param> /// <returns></returns> - [Obsolete] + [Obsolete("Use MeasureString instead.", true)] public Size StringDisplaySize(string text) { return impl.MeasureString(mState, text); Modified: trunk/AgateLib/DisplayLib/FrameBuffer.cs =================================================================== --- trunk/AgateLib/DisplayLib/FrameBuffer.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/FrameBuffer.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -7,72 +7,111 @@ namespace AgateLib.DisplayLib { + /// <summary> + /// Class which represents a render target. This can either be a render target for + /// an area on screen with an associated DisplayWindow object, + /// or a render target in memory which can be used as a Surface object + /// after rendering to it. For the most part, FrameBuffers which are associated with + /// a DisplayWindow cannot be used as Surfaces. + /// </summary> public class FrameBuffer : IDisposable { FrameBufferImpl impl; + Surface mRenderTarget; + /// <summary> + /// Constructs a frame buffer to be used as a render target. FrameBuffers constructed + /// with this constructor can be used as surfaces after drawing to them is complete. + /// </summary> + /// <param name="size"></param> public FrameBuffer(Size size) { impl = Display.Impl.CreateFrameBuffer(size); } + /// <summary> + /// Constructs a frame buffer to be used as a render target. FrameBuffers constructed + /// with this constructor can be used as surfaces after drawing to them is complete. + /// </summary> + /// <param name="width"></param> + /// <param name="height"></param> public FrameBuffer(int width, int height) : this(new Size(width, height)) { } - public FrameBuffer(FrameBufferImpl impl) + /// <summary> + /// Constructs a FrameBuffer from a FrameBufferImpl object. Application code + /// should not need to use this constructor ever. + /// </summary> + /// <param name="impl"></param> + internal FrameBuffer(FrameBufferImpl impl) { this.impl = impl; } - + /// <summary> + /// Disposes of unmanaged resources. + /// </summary> public void Dispose() { impl.Dispose(); } + /// <summary> + /// Gets the implementation object of the FrameBuffer. + /// </summary> public FrameBufferImpl Impl { get { return impl; } } + /// <summary> + /// Size in pixels of the render target. + /// </summary> public Size Size { get { return Impl.Size; } } - public int Height - { - get { return Impl.Height; } - } + /// <summary> + /// Width in pixels of the render target. + /// </summary> public int Width { get { return Impl.Width; } } - - public void BeginRender() + /// <summary> + /// Height in pixels of the render target. + /// </summary> + public int Height { + get { return Impl.Height; } } - public void EndRender() - { } - public bool CanAccessBackBuffer + /// <summary> + /// Returns true if the RenderTarget property is readable, and this surface that is + /// rendered to can be used to draw from. + /// </summary> + public bool CanAccessRenderTarget { - get { return Impl.CanAccessBackBuffer; } + get { return Impl.CanAccessRenderTarget; } } - Surface mBackBuffer; - - public Surface BackBuffer + /// <summary> + /// Gets the Surface object that was rendered to, if it is available. + /// If the CanAccessRenderTarget property is false, then this will throw + /// an exception. + /// </summary> + public Surface RenderTarget { get { - if (mBackBuffer != null && mBackBuffer.Impl != Impl.BackBuffer) + if (mRenderTarget != null && mRenderTarget.Impl != Impl.RenderTarget) { - mBackBuffer.Dispose(); - mBackBuffer = null; + mRenderTarget.Dispose(); + mRenderTarget = null; } - if (mBackBuffer == null) - mBackBuffer = new Surface(Impl.BackBuffer); + if (mRenderTarget == null) + mRenderTarget = new Surface(Impl.RenderTarget); - return mBackBuffer; + return mRenderTarget; } } } Modified: trunk/AgateLib/DisplayLib/RenderStateAdapter.cs =================================================================== --- trunk/AgateLib/DisplayLib/RenderStateAdapter.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/RenderStateAdapter.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -5,6 +5,9 @@ namespace AgateLib.DisplayLib { + /// <summary> + /// Class which gets or sets render states for the Display. + /// </summary> public sealed class RenderStateAdapter { void CheckDisplayInitialized() @@ -13,6 +16,9 @@ throw new AgateException("Display has not been initialized."); } + /// <summary> + /// Gets or sets whether the vertical blank should be waited for on each frame. + /// </summary> public bool WaitForVerticalBlank { get @@ -26,7 +32,9 @@ Display.Impl.SetRenderState(RenderStateBool.WaitForVerticalBlank, value); } } - + /// <summary> + /// Gets or sets whether alpha blending is enabled. + /// </summary> public bool AlphaBlend { get @@ -40,7 +48,9 @@ Display.Impl.SetRenderState(RenderStateBool.AlphaBlend, value); } } - + /// <summary> + /// Gets or sets whether to test the z-buffer when writing pixels, if it is available. + /// </summary> public bool ZBufferTest { get @@ -54,6 +64,9 @@ Display.Impl.SetRenderState(RenderStateBool.ZBufferTest, value); } } + /// <summary> + /// Gets or sets whether to write to the z-buffer when writing pixels, if it is available. + /// </summary> public bool ZBufferWrite { get @@ -67,6 +80,9 @@ Display.Impl.SetRenderState(RenderStateBool.ZBufferWrite, value); } } + /// <summary> + /// Gets or sets whether to test the stencil buffer when writing pixels. + /// </summary> public bool StencilBufferTest { get @@ -82,15 +98,30 @@ } } + /// <summary> + /// Enum describing boolean render state values. + /// </summary> public enum RenderStateBool { + /// <summary> + /// VSync + /// </summary> WaitForVerticalBlank, - + /// <summary> + /// Alpha blending + /// </summary> AlphaBlend, - + /// <summary> + /// Z Buffer Testing + /// </summary> ZBufferTest, + /// <summary> + /// Z buffer writing + /// </summary> ZBufferWrite, - + /// <summary> + /// Stencil buffer testing + /// </summary> StencilBufferTest, } } Modified: trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderCompiler.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -24,6 +24,7 @@ namespace AgateLib.DisplayLib.Shaders { + [Obsolete] public static class ShaderCompiler { static ShaderCompilerImpl impl; Modified: trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/Shaders/Implementation/ShaderLanguage.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -23,11 +23,23 @@ namespace AgateLib.DisplayLib.Shaders { + /// <summary> + /// Enum indicating an industry standard shading language. + /// </summary> public enum ShaderLanguage { + /// <summary> + /// No shading language is used. + /// </summary> None, + /// <summary> + /// OpenGL's GLSL language. + /// </summary> Glsl, + /// <summary> + /// Direct3D's HLSL language. + /// </summary> Hlsl, // Cg, Modified: trunk/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs =================================================================== --- trunk/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/DisplayLib/Shaders/Implementation/Technique.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -23,6 +23,10 @@ namespace AgateLib.DisplayLib.Shaders { + /// <summary> + /// + /// </summary> + [Obsolete] public class Technique { } Modified: trunk/AgateLib/Geometry/Builders/Cube.cs =================================================================== --- trunk/AgateLib/Geometry/Builders/Cube.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/Builders/Cube.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,27 +6,46 @@ namespace AgateLib.Geometry.Builders { + /// <summary> + /// Constructs a cube. + /// </summary> public class CubeBuilder { VertexBuffer mVertices = null; IndexBuffer mIndices = null; + /// <summary> + /// Constructs a cube builder. + /// </summary> public CubeBuilder() { Length = 1; VertexType = VertexTypes.PositionTextureNTB.VertexLayout; } + /// <summary> + /// Gets the created vertex buffer. + /// </summary> public VertexBuffer VertexBuffer { get { return mVertices; } } + /// <summary> + /// Gets the created index buffer. + /// </summary> public IndexBuffer IndexBuffer { get { return mIndices; } } + /// <summary> + /// Length of the cube. + /// </summary> public float Length { get; set; } + + /// <summary> + /// Position of the center of the cube. + /// </summary> public Vector3 Location { get; set; } bool GenerateTextureCoords @@ -46,8 +65,13 @@ get { return VertexType.ContainsElement(VertexElement.Bitangent); } } + /// <summary> + /// Vertex type to use when generating the cube. + /// </summary> public VertexLayout VertexType { get; set; } - + /// <summary> + /// Creates the vertex buffer and index buffer using the settings of the CubeBuilder. + /// </summary> public void CreateVertexBuffer() { PositionTextureNTB[] vertices = new PositionTextureNTB[24]; Modified: trunk/AgateLib/Geometry/Builders/Terrain.cs =================================================================== --- trunk/AgateLib/Geometry/Builders/Terrain.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/Builders/Terrain.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -7,10 +7,17 @@ namespace AgateLib.Geometry.Builders { + /// <summary> + /// Constructs a terrain from a pixel buffer. + /// </summary> public class HeightMapTerrain { PixelBuffer pixels; + /// <summary> + /// Construts a height map from a pixel buffer. + /// </summary> + /// <param name="pixels"></param> public HeightMapTerrain(PixelBuffer pixels) { this.pixels = pixels.Clone(); @@ -47,8 +54,15 @@ /// </summary> public float MaxPeak { get; set; } + /// <summary> + /// Type of vertex used. + /// </summary> public VertexLayout VertexType { get; set; } + /// <summary> + /// Create the vertex buffer. + /// </summary> + /// <returns></returns> public VertexBuffer CreateVertexBuffer() { Vector3[] vertices = new Vector3[pixels.Width * pixels.Height]; Modified: trunk/AgateLib/Geometry/VertexTypes/PositionColor.cs =================================================================== --- trunk/AgateLib/Geometry/VertexTypes/PositionColor.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/VertexTypes/PositionColor.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,22 +6,47 @@ namespace AgateLib.Geometry.VertexTypes { + /// <summary> + /// Vertex layout which only contains position and color information. + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct PositionColor { + /// <summary> + /// Vertex position + /// </summary> public Vector3 Position; + /// <summary> + /// Vertex color + /// </summary> public int Color; + /// <summary> + /// Constructs vertex. + /// </summary> + /// <param name="x"></param> + /// <param name="y"></param> + /// <param name="z"></param> + /// <param name="color"></param> public PositionColor(float x, float y, float z, Color color) : this(x, y, z, color.ToArgb()) { } + /// <summary> + /// Constructs vertex. + /// </summary> + /// <param name="x"></param> + /// <param name="y"></param> + /// <param name="z"></param> + /// <param name="color"></param> public PositionColor(float x, float y, float z, int color) { Position = new Vector3(x, y, z); this.Color = color; } - + /// <summary> + /// Layout for the PositionColor vertex type. + /// </summary> public static VertexLayout VertexLayout { get Modified: trunk/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs =================================================================== --- trunk/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/VertexTypes/PositionTextureColor.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,16 +6,46 @@ namespace AgateLib.Geometry.VertexTypes { + /// <summary> + /// Vertex structure with position, texture and color values + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct PositionTextureColor { + /// <summary> + /// Position of vertex. + /// </summary> public Vector3 Position; + /// <summary> + /// Texture coordinates of vertex. + /// </summary> public Vector2 TexCoord; + /// <summary> + /// Color value of vertex. + /// </summary> public int Color; + /// <summary> + /// + /// </summary> + /// <param name="x"></param> + /// <param name="y"></param> + /// <param name="z"></param> + /// <param name="color"></param> + /// <param name="tu"></param> + /// <param name="tv"></param> public PositionTextureColor(float x, float y, float z, Color color, float tu, float tv) : this(x, y, z, color.ToArgb(), tu, tv) { } + /// <summary> + /// + /// </summary> + /// <param name="x"></param> + /// <param name="y"></param> + /// <param name="z"></param> + /// <param name="color"></param> + /// <param name="tu"></param> + /// <param name="tv"></param> public PositionTextureColor(float x, float y, float z, int color, float tu, float tv) { Position = new Vector3(x, y, z); @@ -23,16 +53,32 @@ this.Color = color; } + /// <summary> + /// X Position + /// </summary> public float X { get { return Position.X; } set { Position.X = value; } } + /// <summary> + /// Y Position + /// </summary> public float Y { get { return Position.Y; } set { Position.Y = value; } } + /// <summary> + /// Z Position + /// </summary> public float Z { get { return Position.Z; } set { Position.Z = value; } } + /// <summary> + /// ToString debugging information. + /// </summary> + /// <returns></returns> public override string ToString() { return string.Format("X: {0} Y: {1} Z: {2} Color: {3} Tu: {4}, Tv: {5}", Position.X, Position.Y, Position.Z, Color, TexCoord.X, TexCoord.Y); } + /// <summary> + /// Gets the vertex layout for PositionTextureColor. + /// </summary> public static VertexLayout VertexLayout { get Modified: trunk/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs =================================================================== --- trunk/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/VertexTypes/PositionTextureColorNormal.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -5,39 +5,91 @@ using System.Text; namespace AgateLib.Geometry.VertexTypes -{ +{ + /// <summary> + /// Vertex structure with position, texture and normal values. + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct PositionTextureColorNormal { + /// <summary> + /// Position + /// </summary> public Vector3 Position; - public Vector2 TexCoord; + /// <summary> + /// Texture coordinates + /// </summary> + public Vector2 Texture; + /// <summary> + /// Color value. + /// </summary> public int Color; + /// <summary> + /// Normal value + /// </summary> public Vector3 Normal; + /// <summary> + /// Constructor + /// </summary> + /// <param name="x"></param> + /// <param name="y"></param> + /// <param name="z"></param> + /// <param name="color"></param> + /// <param name="tu"></param> + /// <param name="tv"></param> + /// <param name="nx"></param> + /// <param name="ny"></param> + /// <param name="nz"></param> public PositionTextureColorNormal(float x, float y, float z, Color color, float tu, float tv, float nx, float ny, float nz) : this(x, y, z, color.ToArgb(), tu, tv, nx, ny, nz) { } + /// <summary> + /// Constructor + /// </summary> public PositionTextureColorNormal(float x, float y, float z, int color, float tu, float tv, float nx, float ny, float nz) { Position = new Vector3(x, y, z); - TexCoord = new Vector2(tu, tv); + Texture = new Vector2(tu, tv); this.Color = color; Normal = new Vector3(nx, ny, nz); } + /// <summary> + /// X position + /// </summary> public float X { get { return Position.X; } set { Position.X = value; } } + /// <summary> + /// Y position + /// </summary> public float Y { get { return Position.Y; } set { Position.Y = value; } } + /// <summary> + /// Z position + /// </summary> public float Z { get { return Position.Z; } set { Position.Z = value; } } - public float U { get { return TexCoord.X; } set { TexCoord.X = value; } } - public float V { get { return TexCoord.Y; } set { TexCoord.Y = value; } } + /// <summary> + /// Texture coordinate u + /// </summary> + public float U { get { return Texture.X; } set { Texture.X = value; } } + /// <summary> + /// Texture coordinate v + /// </summary> + public float V { get { return Texture.Y; } set { Texture.Y = value; } } + /// <summary> + /// ToString debugging information. + /// </summary> + /// <returns></returns> public override string ToString() { return string.Format("X: {0} Y: {1} Z: {2} Color: {3} Tu: {4}, Tv: {5} Nx: {6} Ny: {7} Nz: {8}", - Position.X, Position.Y, Position.Z, Color, TexCoord.X, TexCoord.Y, Normal.X, Normal.Y, Normal.Z); + Position.X, Position.Y, Position.Z, Color, Texture.X, Texture.Y, Normal.X, Normal.Y, Normal.Z); } + /// <summary> + /// Vertex Layout for PositionTextureColorNormal. + /// </summary> public static VertexLayout VertexLayout { get Modified: trunk/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs =================================================================== --- trunk/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/VertexTypes/PositionTextureNTB.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,15 +6,36 @@ namespace AgateLib.Geometry.VertexTypes { + /// <summary> + /// Vertex structure with position, texture coordinates, normal, tangent, bitangent. + /// </summary> [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct PositionTextureNTB { + /// <summary> + /// + /// </summary> public Vector3 Position; + /// <summary> + /// + /// </summary> public Vector2 Texture; + /// <summary> + /// + /// </summary> public Vector3 Normal; + /// <summary> + /// + /// </summary> public Vector3 Tangent; + /// <summary> + /// + /// </summary> public Vector3 Bitangent; + /// <summary> + /// + /// </summary> public static VertexLayout VertexLayout { get Modified: trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs =================================================================== --- trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormal.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,13 +6,28 @@ namespace AgateLib.Geometry.VertexTypes { + /// <summary> + /// Vertex structure with position, texture and normal values. + /// </summary> [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct PositionTextureNormal { + /// <summary> + /// Position + /// </summary> public Vector3 Position; + /// <summary> + /// Texture coordinates + /// </summary> public Vector2 Texture; + /// <summary> + /// Normal value + /// </summary> public Vector3 Normal; + /// <summary> + /// Vertex layout for PositionTextureNormal structure. + /// </summary> public static VertexLayout VertexLayout { get Modified: trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs =================================================================== --- trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/VertexTypes/PositionTextureNormalTangent.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,14 +6,32 @@ namespace AgateLib.Geometry.VertexTypes { + /// <summary> + /// Vertex structure with position, texture coordinates, normal and tangent. + /// </summary> [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct PositionTextureNormalTangent { + /// <summary> + /// + /// </summary> public Vector3 Position; + /// <summary> + /// + /// </summary> public Vector2 Texture; + /// <summary> + /// + /// </summary> public Vector3 Normal; + /// <summary> + /// + /// </summary> public Vector3 Tangent; + /// <summary> + /// + /// </summary> public static VertexLayout VertexLayout { get @@ -28,6 +46,10 @@ } } + /// <summary> + /// + /// </summary> + /// <returns></returns> public override string ToString() { return string.Format( Modified: trunk/AgateLib/Geometry/VertexTypes/VertexLayout.cs =================================================================== --- trunk/AgateLib/Geometry/VertexTypes/VertexLayout.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Geometry/VertexTypes/VertexLayout.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -5,10 +5,16 @@ namespace AgateLib.Geometry.VertexTypes { + /// <summary> + /// Class which describes how vertex information is layed out in memory. + /// </summary> public class VertexLayout : IList<VertexElementDesc> { List<VertexElementDesc> items = new List<VertexElementDesc>(); + /// <summary> + /// Gets the size of a vertex structure in bytes. + /// </summary> public int VertexSize { get @@ -16,7 +22,11 @@ return this.Sum(x => x.ItemSize); } } - + /// <summary> + /// Gets the element description for the specified vertex element. + /// </summary> + /// <param name="element"></param> + /// <returns></returns> public VertexElementDesc GetElement(VertexElement element) { for (int i = 0; i < Count; i++) @@ -27,11 +37,20 @@ throw new AgateException("Element {0} not found.", element); } - + /// <summary> + /// Gets whether the described vertex structure contains the specified element. + /// </summary> + /// <param name="element"></param> + /// <returns></returns> public bool ContainsElement(VertexElement element) { return items.Any(x => x.ElementType == element); } + /// <summary> + /// Gets the byte offset into the vertex structure the specified element is at. + /// </summary> + /// <param name="element"></param> + /// <returns></returns> public int ElementByteIndex(VertexElement element) { int size = 0; @@ -46,7 +65,11 @@ throw new AgateException("Could not find the element {0} in the vertex layout.", element); } - + /// <summary> + /// Gets the size of a particular vertex element data type. + /// </summary> + /// <param name="vertexElementType"></param> + /// <returns></returns> public static int SizeOf(VertexElementDataType vertexElementType) { switch (vertexElementType) @@ -161,21 +184,38 @@ #endregion } + /// <summary> + /// A class which describes a particular element of a vertex structure. + /// </summary> public class VertexElementDesc { VertexElement mDef; + /// <summary> + /// Constructs a VertexElementDesc structure. + /// </summary> + /// <param name="type">The data type of the vertex element.</param> + /// <param name="def">The semantic type of the vertex element.</param> public VertexElementDesc(VertexElementDataType type, VertexElement def) { DataType = type; ElementType = def; } - + /// <summary> + /// Gets debugging string. + /// </summary> + /// <returns></returns> public override string ToString() { - return ElementType.ToString(); + return ElementType.ToString(); } + /// <summary> + /// Gets the data type of the vertex element. + /// </summary> public VertexElementDataType DataType { get; private set; } + /// <summary> + /// Gets the semantic type of the vertex element. + /// </summary> public VertexElement ElementType { get { return mDef; } @@ -184,31 +224,81 @@ mDef = value; } } - + /// <summary> + /// Returns the size in bytes of the vertex element. + /// </summary> public int ItemSize { get { return VertexLayout.SizeOf(DataType); } } } + /// <summary> + /// Enumeration for describing the data types of vertex elements. + /// </summary> public enum VertexElementDataType { + /// <summary> + /// A single 4-byte float. + /// </summary> Float1, + /// <summary> + /// Two 4-byte floats. + /// </summary> Float2, + /// <summary> + /// Three 4-byte floats. + /// </summary> Float3, + /// <summary> + /// Four 4-byte floats. + /// </summary> Float4, + /// <summary> + /// A single 4-byte integer. + /// </summary> Int, } + /// <summary> + /// The various vertex element types. + /// </summary> public enum VertexElement { + /// <summary> + /// Vertex position. + /// </summary> Position, + /// <summary> + /// Vertex normal. + /// </summary> Normal, + /// <summary> + /// Vertex tangent. + /// </summary> Tangent, + /// <summary> + /// Vertex bitangent (often called binormal). + /// </summary> Bitangent, + /// <summary> + /// The diffuse color of the vertex. + /// </summary> DiffuseColor, + /// <summary> + /// Texture coordinates for the vertex. + /// </summary> Texture, + /// <summary> + /// Secondary texture coordinates for the vertex. + /// </summary> Texture1, + /// <summary> + /// Tertiary texture coordinates for the vertex. + /// </summary> Texture2, + /// <summary> + /// Tertiary texture coordinates for the vertex. + /// </summary> Texture3, } } Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/Cache/TextBoxCache.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -35,7 +35,7 @@ if (TextBoxFrameBuffer == null) return null; else - return TextBoxFrameBuffer.BackBuffer; + return TextBoxFrameBuffer.RenderTarget; } } Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryGuiRoot.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -23,6 +23,9 @@ namespace AgateLib.Gui.ThemeEngines.Mercury { + /// <summary> + /// Mercury class for "drawing" the gui root object. + /// </summary> public class MercuryGuiRoot : MercuryWidget { public MercuryGuiRoot(MercuryScheme scheme) Modified: trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs =================================================================== --- trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Gui/ThemeEngines/Mercury/MercuryTextBox.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -264,7 +264,7 @@ } } - Size sz = WidgetFont.StringDisplaySize( + Size sz = WidgetFont.MeasureString( textBox.Text.Substring(lineStart, textBox.InsertionPoint - lineStart)); Point loc = new Point( Modified: trunk/AgateLib/ImplementationBase/DisplayImpl.cs =================================================================== --- trunk/AgateLib/ImplementationBase/DisplayImpl.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/ImplementationBase/DisplayImpl.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -224,9 +224,7 @@ mFrames++; mInFrame = false; - CalcDeltaTime(); - } private void CalcDeltaTime() @@ -622,6 +620,7 @@ /// Only call the base class method if shaders aren't supported, as it throws a NotSupportedException. /// </summary> /// <returns></returns> + [Obsolete] protected internal virtual ShaderCompilerImpl CreateShaderCompiler() { throw new NotSupportedException("The current driver does not support shaders."); @@ -648,6 +647,7 @@ } } + [Obsolete] protected void InitializeShaders() { if (Display.Caps.SupportsCustomShaders) Modified: trunk/AgateLib/ImplementationBase/FrameBufferImpl.cs =================================================================== --- trunk/AgateLib/ImplementationBase/FrameBufferImpl.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/ImplementationBase/FrameBufferImpl.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,25 +6,53 @@ namespace AgateLib.ImplementationBase { + /// <summary> + /// Base class for implementing a render target. + /// </summary> public abstract class FrameBufferImpl : IDisposable { + /// <summary> + /// Disposes of the unmanaged resources. + /// </summary> public abstract void Dispose(); + /// <summary> + /// Size in pixels of the render target. + /// </summary> public abstract Size Size { get; } + /// <summary> + /// Width in pixels of the render target. + /// </summary> public int Width { get { return Size.Width; } } + /// <summary> + /// Height in pixels of the render target. + /// </summary> public int Height { get { return Size.Height; } } + /// <summary> + /// Begins rendering to the render target. + /// </summary> public abstract void BeginRender(); + /// <summary> + /// Ends rendering to the render target. + /// </summary> public abstract void EndRender(); - public virtual bool CanAccessBackBuffer + /// <summary> + /// Return true to indicate that the back buffer can be read and used as a texture. + /// </summary> + public virtual bool CanAccessRenderTarget { get { return false; } } - public virtual SurfaceImpl BackBuffer + /// <summary> + /// Gets the SurfaceImpl which points to the render target, to be used as a texture. + /// Throw an AgateException if CanAccessBackBuffer is false. + /// </summary> + public virtual SurfaceImpl RenderTarget { - get { throw new NotImplementedException(); } + get { throw new AgateException("Cannot access the back buffer in this frame buffer."); } } } } Modified: trunk/AgateLib/ImplementationBase/IndexBufferImpl.cs =================================================================== --- trunk/AgateLib/ImplementationBase/IndexBufferImpl.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/ImplementationBase/IndexBufferImpl.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,13 +6,30 @@ namespace AgateLib.ImplementationBase { + /// <summary> + /// Base class for implementing a hardware stored index buffer. + /// </summary> public abstract class IndexBufferImpl { + /// <summary> + /// Writes indices to the index buffer. + /// </summary> + /// <param name="indices"></param> public abstract void WriteIndices(short[] indices); + /// <summary> + /// Writes indices to the index buffer. + /// </summary> + /// <param name="indices"></param> public abstract void WriteIndices(int[] indices); + /// <summary> + /// Gets the number of indices in the index buffer. + /// </summary> public abstract int Count { get; } + /// <summary> + /// Gets the type of indices in the index buffer. + /// </summary> public abstract IndexBufferType IndexType { get; } } } Modified: trunk/AgateLib/ImplementationBase/ShaderCompilerImpl.cs =================================================================== --- trunk/AgateLib/ImplementationBase/ShaderCompilerImpl.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/ImplementationBase/ShaderCompilerImpl.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -6,8 +6,18 @@ namespace AgateLib.ImplementationBase { + /// <summary> + /// + /// </summary> + [Obsolete] public abstract class ShaderCompilerImpl { + /// <summary> + /// + /// </summary> + /// <param name="language"></param> + /// <param name="effectSource"></param> + /// <returns></returns> public abstract Effect CompileEffect(ShaderLanguage language, string effectSource); } } Modified: trunk/AgateLib/ImplementationBase/VertexBufferImpl.cs =================================================================== --- trunk/AgateLib/ImplementationBase/VertexBufferImpl.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/ImplementationBase/VertexBufferImpl.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -7,23 +7,60 @@ namespace AgateLib.ImplementationBase { + /// <summary> + /// Class for implementing a vertex buffer stored in hardware memory. + /// </summary> public abstract class VertexBufferImpl { + /// <summary> + /// Constructs a vertex buffer implementation. + /// </summary> public VertexBufferImpl() { Textures = new TextureList(); } + /// <summary> + /// Writes vertices to the vertex buffer. + /// </summary> + /// <typeparam name="T">The type of vertices in the buffer. This type must be a struct, and may not + /// contain any reference types.</typeparam> + /// <param name="vertices">The vertex data.</param> public abstract void Write<T>(T[] vertices) where T:struct; + /// <summary> + /// Gets the number of vertices in the buffer. + /// </summary> public abstract int VertexCount { get; } + /// <summary> + /// Gets or sets an enum value indicating the type of primitives drawn from this + /// vertex buffer. + /// </summary> public virtual PrimitiveType PrimitiveType { get; set; } + /// <summary> + /// Gets the textures that should be used in drawing primitives from this vertex + /// buffer. + /// </summary> public TextureList Textures { get; set; } + /// <summary> + /// Draws primitives from this vertex buffer. + /// </summary> + /// <param name="start">Index of the first vertex to use when drawing.</param> + /// <param name="count">Number of primitives to draw.</param> public abstract void Draw(int start, int count); + /// <summary> + /// Draws primitives from this vertex buffer, using the specified index buffer. + /// </summary> + /// <param name="indexbuffer">The index buffer from which to draw indices from.</param> + /// <param name="start">Index of the first value in the index buffer to use.</param> + /// <param name="count">Number of primitives to draw.</param> public abstract void DrawIndexed(IndexBuffer indexbuffer, int start, int count); + /// <summary> + /// Gets the vertex layout which is used to interpret the data in the vertex buffer. + /// </summary> public abstract VertexLayout VertexLayout { get; } } } Modified: trunk/AgateLib/Particles/Particles/SpriteParticle.cs =================================================================== --- trunk/AgateLib/Particles/Particles/SpriteParticle.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Particles/Particles/SpriteParticle.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -21,7 +21,7 @@ namespace AgateLib.Particles { /// <summary> - /// A particle implementation for <see cref="Sprite"/>s. + /// A particle implementation for <see cref="AgateLib.Sprites.Sprite"/>s. /// </summary> public class SpriteParticle : Particle { Modified: trunk/AgateLib/Utility/ZipFileProvider.cs =================================================================== --- trunk/AgateLib/Utility/ZipFileProvider.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/AgateLib/Utility/ZipFileProvider.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -169,7 +169,6 @@ private void ReadHeaders() { FileHeader header; - bool valid; do { @@ -187,7 +186,7 @@ //ReadCentralDirectoryHeader(reader); } else - valid = false; + throw new AgateException("Failed to understand zip file."); files.Add(header); Modified: trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs =================================================================== --- trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateDrawing/Drawing_FrameBuffer.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -45,14 +45,14 @@ if (EndRenderEvent != null) EndRenderEvent(this, EventArgs.Empty); } - public override bool CanAccessBackBuffer + public override bool CanAccessRenderTarget { get { return true; } } - public override SurfaceImpl BackBuffer + public override SurfaceImpl RenderTarget { get { return new Drawing_Surface(backBuffer, new System.Drawing.Rectangle(System.Drawing.Point.Empty, backBuffer.Size)); } } Modified: trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs =================================================================== --- trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateOTK/GL3/FrameBuffer.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -62,7 +62,7 @@ } - public override AgateLib.ImplementationBase.SurfaceImpl BackBuffer + public override AgateLib.ImplementationBase.SurfaceImpl RenderTarget { get {return mTexture;} } Modified: trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateOTK/Legacy/FrameBufferExt.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -136,7 +136,7 @@ } - public override AgateLib.ImplementationBase.SurfaceImpl BackBuffer + public override AgateLib.ImplementationBase.SurfaceImpl RenderTarget { get { return mTexture; } } Modified: trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs =================================================================== --- trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateOTK/Legacy/FrameBufferReadPixels.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -70,7 +70,7 @@ TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); } - public override bool CanAccessBackBuffer + public override bool CanAccessRenderTarget { get { @@ -78,7 +78,7 @@ } } - public override AgateLib.ImplementationBase.SurfaceImpl BackBuffer + public override AgateLib.ImplementationBase.SurfaceImpl RenderTarget { get { Modified: trunk/Drivers/AgateSDX/D3DDevice.cs =================================================================== --- trunk/Drivers/AgateSDX/D3DDevice.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/D3DDevice.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -37,7 +37,6 @@ private SDX_FrameBuffer mRenderTarget; private DrawBuffer mDrawBuffer; - private VertexFormat mVertexFormat; private bool mAlphaBlend; private TextureArgument mAlphaArgument1; private TextureArgument mAlphaArgument2; @@ -45,8 +44,6 @@ private Matrix mWorld2D; - private int mMaxLightsUsed = 0; - private VertexDeclaration mSurfaceDecl; //VertexBuffer mSurfaceVB; @@ -82,7 +79,6 @@ // set weird values which will indicate that the device's // render states need to be set. mAlphaBlend = false; - mVertexFormat = VertexFormat.None; mAlphaArgument1 = TextureArgument.Temp; mAlphaArgument2 = TextureArgument.Temp; mAlphaOperation = TextureOperation.Add; @@ -198,12 +194,6 @@ } } - public void SetFontRenderState() - { - mLastTexture = null; - mVertexFormat = VertexFormat.PointSize; - } - public void SetDeviceStateTexture(Texture texture) { SetDeviceStateTexture(texture, 0); Modified: trunk/Drivers/AgateSDX/DrawBuffer.cs =================================================================== --- trunk/Drivers/AgateSDX/DrawBuffer.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/DrawBuffer.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -104,17 +104,8 @@ SDX_Display display = (SDX_Display)Display.Impl; - if (display.Effect != null) - { - HlslEffect fx = (HlslEffect)display.Effect; + DoDraw(null); - fx.SetTexture(AgateLib.DisplayLib.Shaders.EffectTexture.Texture0, mTexture); - - fx.InternalRender<object>(DoDraw, null); - } - else - DoDraw(null); - mVertPointer = 0; mIndexPointer = 0; Modified: trunk/Drivers/AgateSDX/FrameBufferSurface.cs =================================================================== --- trunk/Drivers/AgateSDX/FrameBufferSurface.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/FrameBufferSurface.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -67,14 +67,14 @@ mDevice.Device.EndScene(); } - public override bool CanAccessBackBuffer + public override bool CanAccessRenderTarget { get { return true; } } - public override SurfaceImpl BackBuffer + public override SurfaceImpl RenderTarget { get { Modified: trunk/Drivers/AgateSDX/HlslCompiler.cs =================================================================== --- trunk/Drivers/AgateSDX/HlslCompiler.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/HlslCompiler.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -9,6 +9,7 @@ namespace AgateSDX { + [Obsolete] class HlslCompiler : ShaderCompilerImpl { SDX_Display mDisplay; Modified: trunk/Drivers/AgateSDX/HlslEffect.cs =================================================================== --- trunk/Drivers/AgateSDX/HlslEffect.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/HlslEffect.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -9,6 +9,7 @@ namespace AgateSDX { + [Obsolete] class HlslEffect : Effect { SDX_Display mDisplay; Modified: trunk/Drivers/AgateSDX/SDX_Display.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Display.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/SDX_Display.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -158,7 +158,7 @@ mDevice = new D3DDevice(device); - InitializeShaders(); + //InitializeShaders(); mPosColorDecl = SDX_VertexBuffer.CreateVertexDeclaration(device, PositionColor.VertexLayout); } @@ -287,6 +287,7 @@ { return BitmapFontUtil.ConstructFromOSFont(bitmapOptions); } + [Obsolete] protected override ShaderCompilerImpl CreateShaderCompiler() { return new HlslCompiler(this); @@ -357,8 +358,6 @@ mDevice.Device.Viewport = view; mCurrentClipRect = newClipRect; - - SetOrthoProjection(newClipRect); } private Stack<Rectangle> mClipRects = new Stack<Rectangle>(); @@ -932,7 +931,6 @@ #endregion - [Obsolete("The necessity of this needs to be verified.")] internal event EventHandler VSyncChanged; private void OnVSyncChanged() { Modified: trunk/Drivers/AgateSDX/SDX_Input.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Input.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/SDX_Input.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -96,7 +96,7 @@ private bool[] mButtons; private int[] shift = new int[8]; - private double maxX, maxY, maxZ; + private double max; private double mThreshold; @@ -109,7 +109,7 @@ // joystick values in di seem to be from 0 (left) to 65536 (right). // seems to be the right value on my joystick. - maxX = maxY = maxZ = 32768; + max = 32768; mButtons = new bool[ButtonCount]; shift = new int[AxisCount]; @@ -145,7 +145,7 @@ public override double GetAxisValue(int axisIndex) { - return CorrectAxisValue(mDevice.GetCurrentState().GetSliders()[axisIndex], shift[axisIndex], maxX); + return CorrectAxisValue(mDevice.GetCurrentState().GetSliders()[axisIndex], shift[axisIndex], max); //if (axisIndex == 0) // return CorrectAxisValue(mDevice.GetCurrentState().X, shift[0], maxX); Modified: trunk/Drivers/AgateSDX/SDX_Surface.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_Surface.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/SDX_Surface.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -54,8 +54,6 @@ Rectangle mSrcRect; Size mTextureSize; PointF mCenterPoint; - float mRotationCos = 1.0f; - float mRotationSin = 0.0f; PositionTextureColor[] mVerts = new PositionTextureColor[4]; short[] mIndices = new short[] { 0, 2, 1, 1, 2, 3 }; @@ -249,7 +247,7 @@ mTexture = Texture.FromStream(mDevice, stream, Usage.None, Pool.Managed); * */ //mTexture = new Texture(mDevice, bitmap, Usage.None, Pool.Managed); - Format format; + //Format format; throw new NotImplementedException(); @@ -467,15 +465,15 @@ disposeSurfWhenDone = true; } - Direct3D.ImageFileFormat d3dformat = SlimDX.Direct3D9.ImageFileFormat.Png; + //Direct3D.ImageFileFormat d3dformat = SlimDX.Direct3D9.ImageFileFormat.Png; - switch (format) - { - case ImageFileFormat.Bmp: d3dformat = Direct3D.ImageFileFormat.Bmp; break; - case ImageFileFormat.Png: d3dformat = Direct3D.ImageFileFormat.Png; break; - case ImageFileFormat.Jpg: d3dformat = Direct3D.ImageFileFormat.Jpg; break; - case ImageFileFormat.Tga: d3dformat = Direct3D.ImageFileFormat.Tga; break; - } + //switch (format) + //{ + // case ImageFileFormat.Bmp: d3dformat = Direct3D.ImageFileFormat.Bmp; break; + // case ImageFileFormat.Png: d3dformat = Direct3D.ImageFileFormat.Png; break; + // case ImageFileFormat.Jpg: d3dformat = Direct3D.ImageFileFormat.Jpg; break; + // case ImageFileFormat.Tga: d3dformat = Direct3D.ImageFileFormat.Tga; break; + //} DataRectangle rect = surf.LockRectangle(LockFlags.ReadOnly); Modified: trunk/Drivers/AgateSDX/SDX_VertexBuffer.cs =================================================================== --- trunk/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Drivers/AgateSDX/SDX_VertexBuffer.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -16,7 +16,6 @@ Direct3D.VertexBuffer mBuffer; Direct3D.VertexDeclaration mDeclaration; int mCount; - object data; VertexLayout mLayout; public SDX_VertexBuffer(SDX_Display display, VertexLayout layout, int vertexCount) Modified: trunk/Tests/AudioTests/AudioPlayer/frmAudioPlayer.cs =================================================================== --- trunk/Tests/AudioTests/AudioPlayer/frmAudioPlayer.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Tests/AudioTests/AudioPlayer/frmAudioPlayer.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -163,7 +163,7 @@ FillMusicListBox(); } - catch (Exception ex) + catch (Exception) { } } Modified: trunk/Tests/CoreTests/App.cs =================================================================== --- trunk/Tests/CoreTests/App.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Tests/CoreTests/App.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -12,11 +12,9 @@ Run(args); } - protected override AppInitParameters GetAppInitParameters() + protected override void AdjustAppInitParameters(ref AppInitParameters initParams) { - var retval = base.GetAppInitParameters(); - retval.AllowResize = true; - return retval; + initParams.AllowResize = true; } #region IAgateTest Members Modified: trunk/Tests/CoreTests/Performance/Performance.cs =================================================================== --- trunk/Tests/CoreTests/Performance/Performance.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Tests/CoreTests/Performance/Performance.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -62,7 +62,6 @@ { Trace.WriteLine(string.Format("Starting driver {0}...", info.FriendlyName)); Trace.Indent(); - double fps; Display.Initialize((DisplayTypeID)info.DriverTypeID); Display.RenderState.WaitForVerticalBlank = false; Modified: trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs =================================================================== --- trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Tests/DisplayTests/MultipleWindows/MultipleWindowTest.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -69,7 +69,7 @@ // draw the third window from the surface Display.RenderTarget = wnd_3.FrameBuffer; - surf = buffer.BackBuffer; + surf = buffer.RenderTarget; Display.BeginFrame(); Display.Clear(Color.Black); Modified: trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs =================================================================== --- trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Tests/DisplayTests/ParticleTests/ParticleTests.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -24,16 +24,13 @@ Run(args); } - #endregion - - protected override AppInitParameters GetAppInitParameters () - { - AppInitParameters para = new AppInitParameters(); - para.InitializeAudio = false; - para.InitializeJoysticks = false; - para.ShowSplashScreen = false; - - return para; + #endregion + + protected override void AdjustAppInitParameters(ref AppInitParameters initParams) + { + initParams.InitializeAudio = false; + initParams.InitializeJoysticks = false; + initParams.ShowSplashScreen = false; } Random ran = new Random(); Modified: trunk/Tests/DisplayTests/ScreenCapture.cs =================================================================== --- trunk/Tests/DisplayTests/ScreenCapture.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Tests/DisplayTests/ScreenCapture.cs 2009-12-02 16:42:48 UTC (rev 1138) @@ -57,7 +57,7 @@ if (capturing) { - capture.BackBuffer.SaveTo("CapturedImage.png", ImageFileFormat.Png); + capture.RenderTarget.SaveTo("CapturedImage.png", ImageFileFormat.Png); Display.RenderTarget = wind.FrameBuffer; someSurface.SetScale(1, 1); capturing = false; Modified: trunk/Tests/DisplayTests/SpriteTester/frmSpriteTester.cs =================================================================== --- trunk/Tests/DisplayTests/SpriteTester/frmSpriteTester.cs 2009-12-01 18:01:28 UTC (rev 1137) +++ trunk/Tests/DisplayTests/SpriteTes... [truncated message content] |