mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 22:19:31 +07:00
glow filter reader
This commit is contained in:
BIN
Assets/FlashTools/Examples/Animations/Cooking/GiftBox.fla
Normal file
BIN
Assets/FlashTools/Examples/Animations/Cooking/GiftBox.fla
Normal file
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f662336a47e244df9b854bd56662f84b
|
||||
timeCreated: 1470932299
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -145,7 +145,7 @@ Camera:
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 2
|
||||
orthographic size: 6
|
||||
m_Depth: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
@@ -166,7 +166,7 @@ Transform:
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 1173114888}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 4.1, y: -1.96, z: -1000}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -1000}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_Children: []
|
||||
|
||||
@@ -139,8 +139,14 @@ namespace FlashTools.Internal.SwfTools {
|
||||
return Encoding.UTF8.GetString(bytes.ToArray());
|
||||
}
|
||||
|
||||
public float ReadFixedPoint8() {
|
||||
return ReadInt16() / 256.0f;
|
||||
public float ReadFixedPoint_8_8() {
|
||||
var value = ReadInt16();
|
||||
return value / 256.0f;
|
||||
}
|
||||
|
||||
public float ReadFixedPoint_16_16() {
|
||||
var value = ReadInt32();
|
||||
return value / 65536.0f;
|
||||
}
|
||||
|
||||
public float ReadFixedPoint16(uint bits) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
var header = new SwfLongHeader();
|
||||
header.ShortHeader = SwfShortHeader.Read(reader);
|
||||
header.FrameSize = SwfRect.Read(reader);
|
||||
header.FrameRate = reader.ReadFixedPoint8();
|
||||
header.FrameRate = reader.ReadFixedPoint_8_8();
|
||||
header.FrameCount = reader.ReadUInt16();
|
||||
return header;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace FlashTools.Internal.SwfTools.SwfTypes {
|
||||
reader.ReadByte(); // Ratio
|
||||
SwfColor.Read(reader, with_alpha);
|
||||
}
|
||||
reader.ReadFixedPoint8(); // FocalPoint
|
||||
reader.ReadFixedPoint_8_8(); // FocalPoint
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -189,7 +189,7 @@ namespace FlashTools.Internal.SwfTools.SwfTypes {
|
||||
reader.ReadBit(); // NoClose
|
||||
reader.ReadUnsignedBits(2); // EndCapStyle
|
||||
if ( join_style == 2 ) {
|
||||
reader.ReadFixedPoint8(); // MiterLimitFactor
|
||||
reader.ReadFixedPoint_8_8(); // MiterLimitFactor
|
||||
}
|
||||
if ( has_fill_flag ) {
|
||||
ReadFillStyle(reader, true); // FillStyle
|
||||
|
||||
@@ -34,6 +34,14 @@ namespace FlashTools.Internal.SwfTools.SwfTypes {
|
||||
public override FilterType Type {
|
||||
get { return FilterType.Glow; }
|
||||
}
|
||||
public SwfColor GlowColor;
|
||||
public float BlurX;
|
||||
public float BlurY;
|
||||
public float Strength;
|
||||
public bool InnerGlow;
|
||||
public bool Knockout;
|
||||
public bool CompositeSource;
|
||||
public uint Passes;
|
||||
}
|
||||
|
||||
public class BevelFilter : Filter {
|
||||
@@ -131,9 +139,15 @@ namespace FlashTools.Internal.SwfTools.SwfTypes {
|
||||
}
|
||||
|
||||
static Filter ReadConcreteFilter(GlowFilter filter, SwfStreamReader reader) {
|
||||
//TODO: IMPLME
|
||||
throw new UnityException(string.Format(
|
||||
"Unsupported surface filter type: {0}", filter.Type));
|
||||
filter.GlowColor = SwfColor.Read(reader, true);
|
||||
filter.BlurX = reader.ReadFixedPoint_16_16();
|
||||
filter.BlurY = reader.ReadFixedPoint_16_16();
|
||||
filter.Strength = reader.ReadFixedPoint_8_8();
|
||||
filter.InnerGlow = reader.ReadBit();
|
||||
filter.Knockout = reader.ReadBit();
|
||||
filter.CompositeSource = reader.ReadBit();
|
||||
filter.Passes = reader.ReadUnsignedBits(5);
|
||||
return filter;
|
||||
}
|
||||
|
||||
static Filter ReadConcreteFilter(BevelFilter filter, SwfStreamReader reader) {
|
||||
|
||||
Reference in New Issue
Block a user