diff --git a/assets/files-2017.2/SGCaret000000_0_Sprite.dat b/assets/files-2017.2/SGCaret000000_0_Sprite.dat new file mode 100644 index 0000000..a1ec513 Binary files /dev/null and b/assets/files-2017.2/SGCaret000000_0_Sprite.dat differ diff --git a/assets/files-2017.2/SGCaret000000_1_Sprite.dat b/assets/files-2017.2/SGCaret000000_1_Sprite.dat new file mode 100644 index 0000000..d745a9b Binary files /dev/null and b/assets/files-2017.2/SGCaret000000_1_Sprite.dat differ diff --git a/assets/files-2017.2/SGCaret000000_2_Sprite.dat b/assets/files-2017.2/SGCaret000000_2_Sprite.dat new file mode 100644 index 0000000..bc4c450 Binary files /dev/null and b/assets/files-2017.2/SGCaret000000_2_Sprite.dat differ diff --git a/assets/files-2017.2/SGCaret000100_0_Sprite.dat b/assets/files-2017.2/SGCaret000100_0_Sprite.dat new file mode 100644 index 0000000..3273edb Binary files /dev/null and b/assets/files-2017.2/SGCaret000100_0_Sprite.dat differ diff --git a/assets/files-2017.2/SGCaret000100_1_Sprite.dat b/assets/files-2017.2/SGCaret000100_1_Sprite.dat new file mode 100644 index 0000000..da2da4c Binary files /dev/null and b/assets/files-2017.2/SGCaret000100_1_Sprite.dat differ diff --git a/assets/files-2017.2/SGCaret000100_2_Sprite.dat b/assets/files-2017.2/SGCaret000100_2_Sprite.dat new file mode 100644 index 0000000..701a7c4 Binary files /dev/null and b/assets/files-2017.2/SGCaret000100_2_Sprite.dat differ diff --git a/scripts/BinaryTemplates/Unity2017.2Sprite.tcl b/scripts/BinaryTemplates/Unity2017.2Sprite.tcl new file mode 100644 index 0000000..8ab6e64 --- /dev/null +++ b/scripts/BinaryTemplates/Unity2017.2Sprite.tcl @@ -0,0 +1,128 @@ +little_endian +proc align {size alignment} { + set extra [expr $size % $alignment] + set newExtra [expr $extra > 0 ? $alignment : 0] + return [expr $size - $extra + $newExtra] +} + +proc alignPos {alignment} { + goto [align [pos] $alignment] +} + +proc pptr {name} { + section $name { + int32 "m_FileID" + int64 "m_PathID" + } +} + +proc rectf {name} { + section $name { + float "x" + float "y" + float "width" + float "height" + } +} + +proc vector2f {name} { + section $name { + float "x" + float "y" + } +} + +proc vector3f {name} { + section $name { + float "x" + float "y" + float "z" + } +} + +proc vector4f {name} { + section $name { + float "x" + float "y" + float "z" + float "w" + } +} + +set nameLen [uint32 "Name Length"] +str [align $nameLen 4] "utf8" "Name" +rectf "m_Rect" +vector2f "m_Offset" +vector4f "m_Border" +float "m_PixelsToUnits" +vector2f "m_Pivot" +uint32 "m_Extrude" +uint8 "m_IsPolygon" +alignPos 4 +section "m_RenderDataKey" { + uuid "first" + int64 "second" +} +uint32 "m_AtlasTags.size" +pptr "m_SpriteAtlas" +section "m_RD" { + pptr "texture" + pptr "alphaTexture" + section "m_SubMeshes" { + set alen [int32 "size"] + for {set i 0} {$i < $alen} {incr i} { + section "Submesh" { + uint32 "firstByte" + uint32 "indexCount" + int32 "topology" + uint32 "firstVertex" + uint32 "vertexCount" + section "localAABB" { + vector3f "m_Center" + vector3f "m_Extent" + } + } + } + } + section "m_IndexBuffer" { + set alen [int32 "size"] + for {set i 0} {$i < $alen} {incr i} { + uint8 "data" + } + } + section "m_VertexData" { + int32 "m_CurrentChannels" + uint32 "m_VertexCount" + section "m_Channels" { + set alen [int32 "size"] + for {set i 0} {$i < $alen} {incr i} { + section "ChannelInfo" { + uint8 "stream" + uint8 "offset" + uint8 "format" + uint8 "dimension" + } + } + } + set dlen [uint32 "dataSize"] + bytes $dlen "data" + } + rectf "textureRect" + vector2f "textureRectOffset" + vector2f "atlasRectOffset" + uint32 "settingsRaw" + vector4f "uvTransform" + float "downscaleMultiplier" +} + +section "m_PhysicsShape" { + set alen [int32 "size"] + for {set i 0} {$i < $alen} {incr i} { + section "Entry" { + set blen [int32 "size"] + for {set j 0} {$j < $blen} {incr j} { + vector2f "data" + } + } + } +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 88bde75..22a3ee8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,7 +93,8 @@ fn main() { 1..=2 => "assets/files-5.2", 3..=4 => "assets/files-5.3", 5..=6 => "assets/files-5.5", - 7..=8 => "assets/files-5.6", + 7 => "assets/files-5.6", + 8 => "assets/files-2017.2", _ => panic!("Couldn't folder for text carets with arc {}", arc_number) }; copy_files(&caretdir, &directory_assets);