remove swf version check. add projects to common solution

This commit is contained in:
2016-10-03 03:31:57 +07:00
parent 24d42a663c
commit bab8c63bb5
6 changed files with 212 additions and 32 deletions

View File

@@ -109,6 +109,9 @@
<Reference Include="UnityEditor.OSXStandalone.Extensions">
<HintPath>/Applications/Unity/PlaybackEngines/MacStandaloneSupport/UnityEditor.OSXStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="SwfTools_Debug">
<HintPath>/Users/matov/Programming/Projects/unityflash/Assets/FlashTools/Plugins/Editor/SwfTools_Debug.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>/Applications/Unity/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference>

View File

@@ -3,6 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwfTools", "SwfTools\SwfTools.csproj", "{4EB8756F-398B-4356-90FB-0ED056B3E6E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "..\Assembly-CSharp.csproj", "{ED48043C-7BE9-40F3-EC3C-3D4369E54740}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "..\Assembly-CSharp-Editor.csproj", "{7FF03E09-4B14-EFF9-4F08-36E102F327D3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
@@ -13,5 +17,185 @@ Global
{4EB8756F-398B-4356-90FB-0ED056B3E6E9}.Debug|x86.Build.0 = Debug|x86
{4EB8756F-398B-4356-90FB-0ED056B3E6E9}.Release|x86.ActiveCfg = Release|x86
{4EB8756F-398B-4356-90FB-0ED056B3E6E9}.Release|x86.Build.0 = Release|x86
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Debug|x86.ActiveCfg = Debug|Any CPU
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Debug|x86.Build.0 = Debug|Any CPU
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Release|x86.ActiveCfg = Release|Any CPU
{7FF03E09-4B14-EFF9-4F08-36E102F327D3}.Release|x86.Build.0 = Release|Any CPU
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Debug|x86.ActiveCfg = Debug|Any CPU
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Debug|x86.Build.0 = Debug|Any CPU
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Release|x86.ActiveCfg = Release|Any CPU
{ED48043C-7BE9-40F3-EC3C-3D4369E54740}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = None
$1.ResourceNamePolicy = FileFormatDefault
$0.TextStylePolicy = $2
$2.inheritsSet = null
$2.scope = text/x-csharp
$0.CSharpFormattingPolicy = $3
$3.NamespaceBraceStyle = EndOfLine
$3.ClassBraceStyle = EndOfLine
$3.InterfaceBraceStyle = EndOfLine
$3.StructBraceStyle = EndOfLine
$3.EnumBraceStyle = EndOfLine
$3.MethodBraceStyle = EndOfLine
$3.ConstructorBraceStyle = EndOfLine
$3.DestructorBraceStyle = EndOfLine
$3.BeforeMethodDeclarationParentheses = False
$3.BeforeMethodCallParentheses = False
$3.BeforeConstructorDeclarationParentheses = False
$3.BeforeIndexerDeclarationBracket = False
$3.BeforeDelegateDeclarationParentheses = False
$3.AfterDelegateDeclarationParameterComma = True
$3.NewParentheses = False
$3.WithinIfParentheses = True
$3.WithinWhileParentheses = True
$3.WithinForParentheses = True
$3.WithinForEachParentheses = True
$3.WithinCatchParentheses = True
$3.WithinSwitchParentheses = True
$3.WithinLockParentheses = True
$3.WithinUsingParentheses = True
$3.SpacesBeforeBrackets = False
$3.inheritsSet = Mono
$3.inheritsScope = text/x-csharp
$3.scope = text/x-csharp
$0.TextStylePolicy = $4
$4.FileWidth = 120
$4.TabsToSpaces = False
$4.inheritsSet = VisualStudio
$4.inheritsScope = text/plain
$4.scope = text/plain
$0.StandardHeader = $5
$5.Text =
$5.IncludeInNewFiles = True
$0.NameConventionPolicy = $6
$6.Rules = $7
$7.NamingRule = $8
$8.Name = Namespaces
$8.AffectedEntity = Namespace
$8.VisibilityMask = VisibilityMask
$8.NamingStyle = PascalCase
$8.IncludeInstanceMembers = True
$8.IncludeStaticEntities = True
$7.NamingRule = $9
$9.Name = Types
$9.AffectedEntity = Class, Struct, Enum, Delegate
$9.VisibilityMask = Public
$9.NamingStyle = PascalCase
$9.IncludeInstanceMembers = True
$9.IncludeStaticEntities = True
$7.NamingRule = $10
$10.Name = Interfaces
$10.RequiredPrefixes = $11
$11.String = I
$10.AffectedEntity = Interface
$10.VisibilityMask = Public
$10.NamingStyle = PascalCase
$10.IncludeInstanceMembers = True
$10.IncludeStaticEntities = True
$7.NamingRule = $12
$12.Name = Attributes
$12.RequiredSuffixes = $13
$13.String = Attribute
$12.AffectedEntity = CustomAttributes
$12.VisibilityMask = Public
$12.NamingStyle = PascalCase
$12.IncludeInstanceMembers = True
$12.IncludeStaticEntities = True
$7.NamingRule = $14
$14.Name = Event Arguments
$14.RequiredSuffixes = $15
$15.String = EventArgs
$14.AffectedEntity = CustomEventArgs
$14.VisibilityMask = Public
$14.NamingStyle = PascalCase
$14.IncludeInstanceMembers = True
$14.IncludeStaticEntities = True
$7.NamingRule = $16
$16.Name = Exceptions
$16.RequiredSuffixes = $17
$17.String = Exception
$16.AffectedEntity = CustomExceptions
$16.VisibilityMask = VisibilityMask
$16.NamingStyle = PascalCase
$16.IncludeInstanceMembers = True
$16.IncludeStaticEntities = True
$7.NamingRule = $18
$18.Name = Methods
$18.AffectedEntity = Methods
$18.VisibilityMask = Protected, Public
$18.NamingStyle = PascalCase
$18.IncludeInstanceMembers = True
$18.IncludeStaticEntities = True
$7.NamingRule = $19
$19.Name = Static Readonly Fields
$19.AffectedEntity = ReadonlyField
$19.VisibilityMask = Protected, Public
$19.NamingStyle = PascalCase
$19.IncludeInstanceMembers = False
$19.IncludeStaticEntities = True
$7.NamingRule = $20
$20.Name = Fields
$20.AffectedEntity = Field
$20.VisibilityMask = Protected, Public
$20.NamingStyle = PascalCase
$20.IncludeInstanceMembers = True
$20.IncludeStaticEntities = True
$7.NamingRule = $21
$21.Name = ReadOnly Fields
$21.AffectedEntity = ReadonlyField
$21.VisibilityMask = Protected, Public
$21.NamingStyle = PascalCase
$21.IncludeInstanceMembers = True
$21.IncludeStaticEntities = False
$7.NamingRule = $22
$22.Name = Constant Fields
$22.AffectedEntity = ConstantField
$22.VisibilityMask = Protected, Public
$22.NamingStyle = PascalCase
$22.IncludeInstanceMembers = True
$22.IncludeStaticEntities = True
$7.NamingRule = $23
$23.Name = Properties
$23.AffectedEntity = Property
$23.VisibilityMask = Protected, Public
$23.NamingStyle = PascalCase
$23.IncludeInstanceMembers = True
$23.IncludeStaticEntities = True
$7.NamingRule = $24
$24.Name = Events
$24.AffectedEntity = Event
$24.VisibilityMask = Protected, Public
$24.NamingStyle = PascalCase
$24.IncludeInstanceMembers = True
$24.IncludeStaticEntities = True
$7.NamingRule = $25
$25.Name = Enum Members
$25.AffectedEntity = EnumMember
$25.VisibilityMask = VisibilityMask
$25.NamingStyle = PascalCase
$25.IncludeInstanceMembers = True
$25.IncludeStaticEntities = True
$7.NamingRule = $26
$26.Name = Parameters
$26.AffectedEntity = Parameter
$26.VisibilityMask = VisibilityMask
$26.NamingStyle = CamelCase
$26.IncludeInstanceMembers = True
$26.IncludeStaticEntities = True
$7.NamingRule = $27
$27.Name = Type Parameters
$27.RequiredPrefixes = $28
$28.String = T
$27.AffectedEntity = TypeParameter
$27.VisibilityMask = VisibilityMask
$27.NamingStyle = PascalCase
$27.IncludeInstanceMembers = True
$27.IncludeStaticEntities = True
version = 0.5
outputpath = ..\Assets\FlashTools\Plugins
EndGlobalSection
EndGlobal

View File

@@ -1,5 +1,5 @@
<Properties StartupItem="SwfTools/SwfTools.csproj">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release|x86" />
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
<MonoDevelop.Ide.Workbench />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />

View File

@@ -7,14 +7,13 @@ namespace SwfTools.SwfTypes {
public uint FileLength;
public static SwfShortHeader Read(SwfStreamReader reader) {
return CheckHeader(new SwfShortHeader{
return new SwfShortHeader{
Format = new string(reader.ReadChars(3)),
Version = reader.ReadByte(),
FileLength = reader.ReadUInt32()});
FileLength = reader.ReadUInt32()};
}
public static void Write(SwfShortHeader header, Stream stream) {
CheckHeader(header);
stream.WriteByte((byte)header.Format[0]);
stream.WriteByte((byte)header.Format[1]);
stream.WriteByte((byte)header.Format[2]);
@@ -31,18 +30,5 @@ namespace SwfTools.SwfTypes {
"Format: {0}, Version: {1}, FileLength: {2}",
Format, Version, FileLength);
}
static SwfShortHeader CheckHeader(SwfShortHeader header) {
if ( string.IsNullOrEmpty(header.Format) || (header.Format != "FWS" && header.Format != "CWS") ) {
throw new System.Exception(string.Format(
"Incorrect swf header format: {0}",
header.Format));
} else if ( header.Version != 28 ) {
throw new System.Exception(string.Format(
"Incorrect swf header version: {0}",
header.Version));
}
return header;
}
}
}

View File

@@ -6,36 +6,33 @@
<ProjectGuid>{4EB8756F-398B-4356-90FB-0ED056B3E6E9}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>FlashTools</RootNamespace>
<AssemblyName>SwfTools</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ReleaseVersion>0.5</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Assets\FlashTools\Plugins\Editor\Debug</OutputPath>
<OutputPath>..\..\Assets\FlashTools\Plugins\Editor</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<NoStdLib>true</NoStdLib>
<AssemblyName>SwfTools_Debug</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<Optimize>true</Optimize>
<OutputPath>..\..\Assets\FlashTools\Plugins\Editor\Release</OutputPath>
<OutputPath>..\..\Assets\FlashTools\Plugins\Editor</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<NoStdLib>true</NoStdLib>
<AssemblyName>SwfTools_Release</AssemblyName>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Reference Include="System" />
<Reference Include="Ionic.Zip.Unity">
<HintPath>..\..\Assets\FlashTools\Plugins\Editor\Ionic.Zip.Unity.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Sources\" />
</ItemGroup>
@@ -89,4 +86,18 @@
<Compile Include="Sources\SwfTypes\SwfShortHeader.cs" />
<Compile Include="Sources\SwfTypes\SwfSurfaceFilters.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib">
<HintPath>..\..\..\..\..\..\..\Applications\Unity\Unity.app\Contents\Frameworks\Mono\lib\mono\unity\mscorlib.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Ionic.Zip.Unity">
<HintPath>..\..\Assets\FlashTools\Plugins\Editor\Ionic.Zip.Unity.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
<HintPath>..\..\..\..\..\..\..\Applications\Unity\Unity.app\Contents\Frameworks\Mono\lib\mono\unity\System.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
</Project>

View File

@@ -2,11 +2,7 @@
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/FlashTools/Scripts/Internal/Editor/Postprocessors/SwfPostprocessor.cs">
<Files>
<File FileName="FTSources/SwfTools/Sources/SwfContext.cs" Line="2" Column="25" />
<File FileName="FTSources/SwfTools/Sources/SwfContextExecuter.cs" Line="5" Column="25" />
<File FileName="FTSources/SwfTools/Sources/SwfDecoder.cs" Line="16" Column="56" />
<File FileName="FTSources/SwfTools/Sources/SwfStreamReader.cs" Line="19" Column="3" />
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/Postprocessors/SwfPostprocessor.cs" Line="22" Column="40" />
<File FileName="Assets/FlashTools/Scripts/Internal/Editor/Postprocessors/SwfPostprocessor.cs" Line="30" Column="24" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>