From: Charles Date: Mon, 12 Apr 2010 01:09:04 +0000 (+0000) Subject: created a new project MapProcessorLib to for importing map files X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=c5daf1d9adca0c3a826dfa2ac7b6d4f8a64c84a3;p=chaz%2Fcarfire created a new project MapProcessorLib to for importing map files determined that `cfmap' will be the extension we'll use for map files added map reader with a module for general-purpose parsing git-svn-id: https://bd85.net/svn/cs3505_group@62 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- diff --git a/CarFire/CarFire/CarFire.sln b/CarFire/CarFire/CarFire.sln index 6ed4e2b..2583a8e 100644 --- a/CarFire/CarFire/CarFire.sln +++ b/CarFire/CarFire/CarFire.sln @@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarFire", "CarFire\CarFire. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CharacterTestBed", "CharacterTestBed\CharacterTestBed.csproj", "{757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapProcessorLib", "MapProcessorLib\MapProcessorLib.csproj", "{EA5996C5-17A9-4827-AAB8-884B476B62EE}" +EndProject Global GlobalSection(SubversionScc) = preSolution Svn-Managed = True @@ -12,21 +14,53 @@ Global EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 + Debug|Xbox 360 = Debug|Xbox 360 + Debug|Zune = Debug|Zune Release|x86 = Release|x86 + Release|Xbox 360 = Release|Xbox 360 + Release|Zune = Release|Zune EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Debug|x86.ActiveCfg = Debug|x86 {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Debug|x86.Build.0 = Debug|x86 + {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Debug|Zune.ActiveCfg = Debug|x86 {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Release|x86.ActiveCfg = Release|x86 {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Release|x86.Build.0 = Release|x86 - {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Debug|x86.ActiveCfg = Debug|x86 - {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Release|x86.ActiveCfg = Release|x86 + {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Release|Xbox 360.ActiveCfg = Release|x86 + {FDDA5BCD-3616-400D-A40B-CFD57C54D0F2}.Release|Zune.ActiveCfg = Release|x86 {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Debug|x86.ActiveCfg = Debug|x86 {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Debug|x86.Build.0 = Debug|x86 + {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Debug|Zune.ActiveCfg = Debug|x86 {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Release|x86.ActiveCfg = Release|x86 {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Release|x86.Build.0 = Release|x86 + {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Release|Xbox 360.ActiveCfg = Release|x86 + {757B5B2E-27C5-43E3-BF29-5025E9DDDBF1}.Release|Zune.ActiveCfg = Release|x86 + {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Debug|x86.ActiveCfg = Debug|x86 + {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Debug|Zune.ActiveCfg = Debug|x86 + {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Release|x86.ActiveCfg = Release|x86 + {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Release|Xbox 360.ActiveCfg = Release|x86 + {C115BBCA-D6FD-42AF-B2A1-3E895808BC14}.Release|Zune.ActiveCfg = Release|x86 {4F0BE90F-1E46-4959-80A5-E92B578F6A48}.Debug|x86.ActiveCfg = Debug|x86 + {4F0BE90F-1E46-4959-80A5-E92B578F6A48}.Debug|Xbox 360.ActiveCfg = Debug|x86 + {4F0BE90F-1E46-4959-80A5-E92B578F6A48}.Debug|Zune.ActiveCfg = Debug|x86 {4F0BE90F-1E46-4959-80A5-E92B578F6A48}.Release|x86.ActiveCfg = Release|x86 + {4F0BE90F-1E46-4959-80A5-E92B578F6A48}.Release|Xbox 360.ActiveCfg = Release|x86 + {4F0BE90F-1E46-4959-80A5-E92B578F6A48}.Release|Zune.ActiveCfg = Release|x86 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Debug|x86.ActiveCfg = Debug|x86 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Debug|x86.Build.0 = Debug|x86 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Debug|Xbox 360.Build.0 = Debug|Xbox 360 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Debug|Zune.ActiveCfg = Debug|Zune + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Debug|Zune.Build.0 = Debug|Zune + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Release|x86.ActiveCfg = Release|x86 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Release|x86.Build.0 = Release|x86 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Release|Xbox 360.ActiveCfg = Release|Xbox 360 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Release|Xbox 360.Build.0 = Release|Xbox 360 + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Release|Zune.ActiveCfg = Release|Zune + {EA5996C5-17A9-4827-AAB8-884B476B62EE}.Release|Zune.Build.0 = Release|Zune EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CarFire/CarFire/CarFire.suo b/CarFire/CarFire/CarFire.suo index dd09ba1..19bb6f3 100644 Binary files a/CarFire/CarFire/CarFire.suo and b/CarFire/CarFire/CarFire.suo differ diff --git a/CarFire/CarFire/CarFire/CarFire.csproj b/CarFire/CarFire/CarFire/CarFire.csproj index 9d05f39..30d2d0d 100644 --- a/CarFire/CarFire/CarFire/CarFire.csproj +++ b/CarFire/CarFire/CarFire/CarFire.csproj @@ -88,7 +88,10 @@ + + + diff --git a/CarFire/CarFire/CarFire/Content/Content.contentproj b/CarFire/CarFire/CarFire/Content/Content.contentproj index 6128e00..077c9a1 100644 --- a/CarFire/CarFire/CarFire/Content/Content.contentproj +++ b/CarFire/CarFire/CarFire/Content/Content.contentproj @@ -104,6 +104,17 @@ TextureProcessor + + + {EA5996C5-17A9-4827-AAB8-884B476B62EE} + MapProcessorLib + + + + + sandbox + + + \ No newline at end of file diff --git a/CarFire/CarFire/MapProcessorLib/MapSourceCode.cs b/CarFire/CarFire/MapProcessorLib/MapSourceCode.cs new file mode 100644 index 0000000..2ec33af --- /dev/null +++ b/CarFire/CarFire/MapProcessorLib/MapSourceCode.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework.Content.Pipeline; + +namespace MapProcessorLib +{ + /// + /// Container for the map file before it is rewritten as an XNB file. + /// + public class MapSourceCode + { + string[] mLines; + public string[] Lines { get { return mLines; } } + + public MapSourceCode(string[] lines) + { + mLines = lines; + } + } +} diff --git a/CarFire/CarFire/MapProcessorLib/MapWriter.cs b/CarFire/CarFire/MapProcessorLib/MapWriter.cs new file mode 100644 index 0000000..3cdcfad --- /dev/null +++ b/CarFire/CarFire/MapProcessorLib/MapWriter.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Content.Pipeline; +using Microsoft.Xna.Framework.Content.Pipeline.Graphics; +using Microsoft.Xna.Framework.Content.Pipeline.Processors; +using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler; + +using TWrite = MapProcessorLib.MapSourceCode; + +namespace MapProcessorLib +{ + /// + /// This class will be instantiated by the XNA Framework Content Pipeline + /// to write the specified data type into binary .xnb format. + /// + /// This should be part of a Content Pipeline Extension Library project. + /// + [ContentTypeWriter] + public class MapWriter : ContentTypeWriter + { + protected override void Write(ContentWriter output, TWrite value) + { + output.Write(value.Lines.Length); + foreach (string line in value.Lines) + { + output.Write(line); + } + } + + public override string GetRuntimeReader(TargetPlatform targetPlatform) + { + return "CarFire.MapReader, CarFire"; + } + } +} diff --git a/CarFire/CarFire/MapProcessorLib/Properties/AssemblyInfo.cs b/CarFire/CarFire/MapProcessorLib/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..591c56a --- /dev/null +++ b/CarFire/CarFire/MapProcessorLib/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MapProcessorLib")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("MapProcessorLib")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f2f52768-d8d6-47ee-8ee8-ef34e3f2d195")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]