From ba94a77a489f7871048c30444d5c1891edc20ca0 Mon Sep 17 00:00:00 2001 From: Tellow Krinkle Date: Sun, 21 Jun 2020 03:50:37 -0500 Subject: [PATCH] Add Unity 2017 Carets --- .../files-2017.2/SGCaret000000_0_Sprite.dat | Bin 0 -> 476 bytes .../files-2017.2/SGCaret000000_1_Sprite.dat | Bin 0 -> 484 bytes .../files-2017.2/SGCaret000000_2_Sprite.dat | Bin 0 -> 492 bytes .../files-2017.2/SGCaret000100_0_Sprite.dat | Bin 0 -> 440 bytes .../files-2017.2/SGCaret000100_1_Sprite.dat | Bin 0 -> 440 bytes .../files-2017.2/SGCaret000100_2_Sprite.dat | Bin 0 -> 440 bytes scripts/BinaryTemplates/Unity2017.2Sprite.tcl | 128 ++++++++++++++++++ src/main.rs | 3 +- 8 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 assets/files-2017.2/SGCaret000000_0_Sprite.dat create mode 100644 assets/files-2017.2/SGCaret000000_1_Sprite.dat create mode 100644 assets/files-2017.2/SGCaret000000_2_Sprite.dat create mode 100644 assets/files-2017.2/SGCaret000100_0_Sprite.dat create mode 100644 assets/files-2017.2/SGCaret000100_1_Sprite.dat create mode 100644 assets/files-2017.2/SGCaret000100_2_Sprite.dat create mode 100644 scripts/BinaryTemplates/Unity2017.2Sprite.tcl 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 0000000000000000000000000000000000000000..a1ec5135520c3191bb13a542a36107bf6c1ec288 GIT binary patch literal 476 zcmd;QU|6T04NSN%Ygw5!2AOMJ0vXr literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..d745a9b288d5c5a359bd29e2a43860aca2ab92eb GIT binary patch literal 484 zcmd;QU|c1;yH>6!xNO8`} z+r>6piP;qFXUKL|U3wKo7M0cRi|NIL-4 zHP|x&#o57fV0(e$3l2csU;wh$k%0kB1KAHi;y_vfDAoW~)36`nQ3oKO!2x6*kOl%U G{{R371~3)? literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..bc4c450d928475fee334dd2ab570d899cd151f1f GIT binary patch literal 492 zcmd;QU|QgENo-f&)$v4B=st4fa4WFlK~G7GM2$#q5T(>k28( zS$VtIW~(r}!lW>?%VUTzFu)YEA<3~IvC)}4U;#!3CLm;FU}oS1@ohdfdQtN4M~m#iH*+W0ShoPFaaSW12Y3BkPlMN0a3^dp@1Y0 zPyreU0P`IVGB7weqDq1I7-ArGK#UB)>d?es^5|jLu%CgUVZQ@dx&cTz0K*kd+cN^i aS;2B3I}{utc7fOiP&SBW0O$ iv;$CGgFPcqoE0o*05ng)k%0k3!`ud=LE#P7>j(gQj3;IQ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..701a7c41ee0bae116eff3ba42769b7e431f99ba4 GIT binary patch literal 440 zcmd;QU|ti`-s|vF#ObSE0HiifT157a+k{k;X8=c7m7GPvx0zyUxW(H0mAEcfGqL3Lv z0ZAU90yGc+<~tk&`qvRv3dF|{1E~XIWB^u&E`}rQ8ul|VH0*Z(Yi|Hj1weHm+5s5G f4fc#caaORL0MI-IM+OEE4Rafe2B|*)#0ri8kYXn6 literal 0 HcmV?d00001 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);