Skip to content

Commit

Permalink
Updated SB3U library
Browse files Browse the repository at this point in the history
  • Loading branch information
bbepis committed Jun 23, 2016
1 parent 28d0b14 commit 7af8ef8
Show file tree
Hide file tree
Showing 26 changed files with 612 additions and 1,334 deletions.
2 changes: 1 addition & 1 deletion AA2Data/LST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace AA2Data
{
public abstract partial class BaseLST
public class BaseLST
{
public byte[] raw { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion AA2Snowflake/AA2Snowflake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
1 change: 1 addition & 0 deletions AA2Snowflake/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
v2.2
+ Changed TGA handler to something more stable
+ Increased the limits of pose numbers again
+ Updated SB3U libary

v2.1
+ Fixed setting pose for male personalities
Expand Down
2 changes: 1 addition & 1 deletion AA2Snowflake/LST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static PersonalityLST LoadLST(this IWriteFile iw, LSTMode mode)

public static IWriteFile ToSubfile(this BaseLST lst, string name)
{
return new MemSubfile(new MemoryStream(lst.raw), name);
return new MemSubfile(lst.raw, name);
}
}
}
6 changes: 3 additions & 3 deletions AA2Snowflake/Personality.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public static Dictionary<int, IPersonality> GetAllPersonalities()
foreach (string path in Directory.EnumerateFiles(Paths.AA2Play))
if (regex.IsMatch(path))
{
CustomPersonality cp = LoadPersonality(new ppParser(path, new ppFormat_AA2()));
CustomPersonality cp = LoadPersonality(new ppParser(path));
if (!ReferenceEquals(cp, null)) //is there a better way to check null?
pers[cp.Slot] = cp;
}
Expand All @@ -158,7 +158,7 @@ public static ppParser GetLstPP(this IPersonality personality)
string path = Paths.AA2Play + "\\" + personality.LSTLocation.RemoveFilename('/');
if (!File.Exists(path))
path = Paths.AA2Edit + "\\" + personality.LSTLocation.RemoveFilename('/');
return new ppParser(path, new ppFormat_AA2());
return new ppParser(path);
}

public static IWriteFile GetLst(this IPersonality personality)
Expand All @@ -172,7 +172,7 @@ public static ppParser GetIcfPP(this IPersonality personality)
string path = Paths.AA2Play + "\\" + personality.ICFLocation;
if (!File.Exists(path))
path = Paths.AA2Edit + "\\" + personality.ICFLocation;
return new ppParser(path, new ppFormat_AA2());
return new ppParser(path);
}
}

Expand Down
23 changes: 14 additions & 9 deletions AA2Snowflake/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public static MemoryStream GetStreamFromFile(string file)

public static void RefreshPPs()
{
PP.jg2e00_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e00_00_00.pp", new ppFormat_AA2());
PP.jg2e01_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e01_00_00.pp", new ppFormat_AA2());
PP.jg2e06_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e06_00_00.pp", new ppFormat_AA2());
PP.jg2p01_00_00 = new ppParser(Paths.AA2Play + @"\jg2p01_00_00.pp", new ppFormat_AA2());
PP.jg2e00_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e00_00_00.pp");
PP.jg2e01_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e01_00_00.pp");
PP.jg2e06_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e06_00_00.pp");
PP.jg2p01_00_00 = new ppParser(Paths.AA2Play + @"\jg2p01_00_00.pp");
}

public static void BackupFile(string file)
Expand All @@ -55,7 +55,12 @@ public static void DeleteBackup(string file)
public static Bitmap LoadTGA(Stream stream)
{
Bitmap bit;
using (var image = new ImageMagick.MagickImage(stream.ToByteArray()))
var sett = new ImageMagick.MagickReadSettings()
{
Format = ImageMagick.MagickFormat.Tga
};

using (var image = new ImageMagick.MagickImage(stream.ToByteArray(), sett))
bit = image.ToBitmap();

return bit;
Expand Down Expand Up @@ -95,9 +100,9 @@ public static IEnumerable<int> PatternAt(byte[] source, byte[] pattern)

public static class PP
{
public static ppParser jg2e00_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e00_00_00.pp", new ppFormat_AA2());
public static ppParser jg2e01_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e01_00_00.pp", new ppFormat_AA2());
public static ppParser jg2e06_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e06_00_00.pp", new ppFormat_AA2());
public static ppParser jg2p01_00_00 = new ppParser(Paths.AA2Play + @"\jg2p01_00_00.pp", new ppFormat_AA2());
public static ppParser jg2e00_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e00_00_00.pp");
public static ppParser jg2e01_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e01_00_00.pp");
public static ppParser jg2e06_00_00 = new ppParser(Paths.AA2Edit + @"\jg2e06_00_00.pp");
public static ppParser jg2p01_00_00 = new ppParser(Paths.AA2Play + @"\jg2p01_00_00.pp");
}
}
2 changes: 1 addition & 1 deletion AA2Snowflake/formCrash.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label1.Text" xml:space="preserve">
<value>AA2Install has crashed. If you were in the middle of an operation, your game may have become corrupt.
<value>AA2Snowflake has crashed. If you were in the middle of an operation, your game may have become corrupt.

Please notify the dev (via a github issue or directly on /aa2g/ or hongfire ) of this, what you were doing and attach the following files:</value>
</data>
Expand Down
Loading

0 comments on commit 7af8ef8

Please sign in to comment.