BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.SSBB.ResourceNodes.REFFAnimationNode Class Reference
Inheritance diagram for BrawlLib.SSBB.ResourceNodes.REFFAnimationNode:
BrawlLib.SSBB.ResourceNodes.ResourceNode

Public Types

enum  AnimType
 

Public Member Functions

override bool OnInitialize ()
 
override void OnPopulate ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void OnRenamed ()
 
List< ResourceNodeGetChildrenRecursive ()
 Used primarily to get bone lists. Kept for all resource nodes for utility. More...
 
virtual void SignalPropertyChange ()
 
virtual void Dispose ()
 
void SelectChildAtIndex (int index)
 
void UpdateProperties ()
 
void UpdateCurrentControl ()
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual void OnMoved ()
 
virtual void DoMoveDown ()
 
virtual void DoMoveDown (bool select)
 
virtual void DoMoveUp ()
 
virtual void DoMoveUp (bool select)
 
virtual bool AddUp ()
 
virtual bool AddDown ()
 
virtual bool ToParent ()
 
void Populate (int levels=-1)
 
virtual void OnPopulate ()
 
void Initialize (ResourceNode parent, FileMap source)
 
void Initialize (ResourceNode parent, VoidPtr address, int length)
 
void Initialize (ResourceNode parent, DataSource origSource)
 
virtual void Initialize (ResourceNode parent, DataSource origSource, DataSource uncompSource)
 
virtual bool OnInitialize ()
 
virtual void Restore ()
 
virtual void Remove ()
 
virtual void RemoveChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child, bool change)
 
virtual void InsertChild (ResourceNode child, int index)
 
virtual void InsertChild (ResourceNode child, bool change, int index)
 
void SetSizeInternal (int size)
 
virtual void Replace (string fileName)
 
virtual void Replace (ResourceNode node)
 
virtual void Replace (string fileName, FileMapProtect prot, FileOptions options)
 
virtual void ReplaceRaw (VoidPtr address, int length)
 
virtual void ReplaceRaw (FileMap map)
 
virtual void Export (string outPath)
 
void Export (FileStream outStream)
 
virtual void ExportUncompressed (string outPath)
 
void ExportUncompressed (FileStream outStream)
 
virtual void Rebuild ()
 
virtual void Rebuild (bool force)
 
virtual void Rebuild (VoidPtr address, int length, bool force)
 
virtual void OnRebuild (VoidPtr address, int length, bool force)
 
virtual int CalculateSize (bool force)
 
virtual int OnCalculateSize (bool force)
 
void Merge ()
 
void Merge (bool forceBuild)
 
ResourceNode FindChildByType (string path, bool searchChildren, params ResourceType[] types)
 
ResourceNode FindChildByType (string path, bool searchChildren, StringComparison compare, params ResourceType[] types)
 
ResourceNode FindChild (string path)
 
ResourceNode FindChild (string path, bool searchChildren)
 
ResourceNode FindChild (string path, StringComparison compare)
 
ResourceNode FindChild (string path, bool searchChildren, StringComparison compare)
 
ResourceNode[] FindChildrenByClassType (string path, Type type)
 
ResourceNode[] FindChildrenByType (string path, ResourceType type)
 
ResourceNode[] FindChildrenByTypeInGroup (string path, ResourceType type, byte group)
 
ResourceNode[] FindChildrenByName (string name)
 
unsafe string FindName (string name)
 
ResourceNode FindEmbeddedIndex (int index)
 
virtual unsafe byte[] MD5 ()
 Find the MD5 checksum of this node's data. If this node doesn't have any data (BRESGroupNode, for example), this method will return null. More...
 
string MD5Str ()
 Get the result of the MD5() function as a string of hexadecimal digits. If MD5() returns null, this method will return an empty string. More...
 
ResourceNode PrevSibling ()
 
ResourceNode NextSibling ()
 
override string ToString ()
 
virtual void SortChildren ()
 

Public Attributes

bool _isPtcl
 
List< string > _names = new List<string>()
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
Form _mainForm
 
string _name
 
string _origPath
 
ResourceNode _parent
 
List< ResourceNode_children = new List<ResourceNode>()
 
int _calcSize
 
EventHandler UpdateControl
 
MoveEventHandler MovedDown
 
ResourceEventHandler Renamed
 
ResourceEventHandler PropertyChanged
 
ResourceEventHandler Replaced
 
ResourceEventHandler Restored
 
ResourceChildEventHandler ChildRemoved
 
bool _isPopulating
 
bool _replaced
 

Properties

override ResourceType ResourceFileType [get]
 
AnimType Type [get, set]
 
string KindType [get, set]
 
AnimCurveType CurveFlag [get]
 
byte KindEnable [get]
 
AnimCurveHeaderProcessFlagType ProcessFlag [get]
 
byte LoopCount [get]
 
ushort RandomSeed [get, set]
 
ushort FrameCount [get, set]
 
uint KeyTableSize [get]
 
uint RangeTableSize [get]
 
uint RandomTableSize [get]
 
uint NameTableSize [get]
 
uint InfoTableSize [get]
 
string[] Names [get, set]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
string FilePath [get]
 
string FileName [get]
 
string DirectoryName [get]
 
ResourceNode RootNode [get]
 
DataSource OriginalSource [get]
 
DataSource UncompressedSource [get]
 
DataSource WorkingSource [get]
 
DataSource WorkingUncompressed [get]
 
virtual bool HasChildren [get]
 
virtual ResourceType ResourceFileType [get]
 
string NodeType [get]
 
virtual string TreePathAbsolute [get]
 
virtual string TreePath [get]
 
virtual int Level [get]
 
virtual int MaxNameLength [get]
 
virtual bool AllowDuplicateNames [get]
 
virtual bool AllowNullNames [get]
 
virtual string Name [get, set]
 
ResourceNode Parent [get, set]
 
List< ResourceNodeChildren [get]
 
int Index [get]
 
int HexIndex [get]
 
bool IsCompressed [get]
 
bool HasChanged [get, set]
 
bool IsBranch [get]
 
bool HasMerged [get]
 
virtual bool AllowSaving [get, set]
 
virtual bool IsDirty [get, set]
 
virtual uint UncompressedSize [get]
 
virtual Type[] AllowedChildTypes [get]
 
virtual string Compression [get, set]
 
virtual bool RetainChildrenOnReplace [get]
 
virtual bool supportsCompression [get]
 
static MD5CryptoServiceProvider MD5Provider [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
static ResourceNode[] FindAllSubNodes (ResourceNode root)
 
static ResourceNode FindNode (ResourceNode root, string path, bool searchChildren, StringComparison compare)
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void ForceReplacedEvent ()
 
virtual void MergeInternal ()
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Member Enumeration Documentation

◆ AnimType

131 {
132 Particle,
133 Emitter
134 }

Member Function Documentation

◆ OnCalculateSize()

override int BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

486 {
487 return base.OnCalculateSize(force);
488 }

◆ OnInitialize()

override bool BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.OnInitialize ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

364 {
365 _hdr = *Header;
366 _name = KindType;
367 _random = new Random(RandomSeed);
368
369 Bin8 enabled = Header->kindEnable;
370 List<int> enabledIndices = new List<int>();
371 for (int i = 0; i < 8; i++)
372 {
373 if (enabled[i])
374 {
375 enabledIndices.Add(i);
376 }
377 }
378
379 int size = 0;
380 switch (CurveFlag)
381 {
382 case AnimCurveType.ParticleByte:
383 size = 1;
384 break;
385 case AnimCurveType.ParticleFloat:
386 size = 4;
387 break;
388 case AnimCurveType.ParticleRotate:
389 size = 1;
390 break;
391 case AnimCurveType.ParticleTexture:
392 break;
393 case AnimCurveType.Child:
394 break;
395 case AnimCurveType.EmitterFloat:
396 break;
397 case AnimCurveType.Field:
398 break;
399 case AnimCurveType.PostField:
400 break;
401 }
402
403 VoidPtr offset = (VoidPtr) Header + 0x20;
404 if (KeyTableSize > 4)
405 {
407 AnimCurveKeyHeader* key = hdr->First;
408 for (int i = 0; i < hdr->_count; i++, key = key->Next(enabledIndices.Count, size))
409 {
410 key->GetFrameIndex(enabledIndices.Count, size);
411 }
412 }
413
414 offset += KeyTableSize;
415 if (RangeTableSize > 4)
416 {
418 }
419
420 offset += RangeTableSize;
421 if (RandomTableSize > 4)
422 {
424 }
425
426 offset += RandomTableSize;
427 if (NameTableSize > 4)
428 {
429 if (offset + NameTableSize <= size)
430 {
432
433 _names = new List<string>();
434 bushort* addr = (bushort*) ((VoidPtr) hdr + 4 + hdr->_count * 4);
435 for (int i = 0; i < hdr->_count; i++, addr = (bushort*) ((VoidPtr) addr + 2 + *addr))
436 {
437 _names.Add(new string((sbyte*) addr + 2));
438 }
439
440 offset += NameTableSize;
441 }
442 }
443 else
444 {
445 offset += NameTableSize;
446 }
447
448 if (InfoTableSize > 4)
449 {
451 //switch ((v9AnimCurveTargetField)_hdr.kindType)
452 //{
453
454 //}
455 }
456
457#if DEBUG
458 if (CurveFlag == AnimCurveType.EmitterFloat || CurveFlag == AnimCurveType.PostField)
459 {
460 System.Windows.Forms.MessageBox.Show(TreePath);
461 }
462#endif
463
464 switch (CurveFlag)
465 {
466 case AnimCurveType.ParticleByte:
467 break;
468 case AnimCurveType.ParticleFloat:
469 break;
470 case AnimCurveType.ParticleRotate:
471 break;
472 case AnimCurveType.ParticleTexture:
473 break;
474 case AnimCurveType.Child:
475 break;
476 }
477
478 return false;
479 }
uint InfoTableSize
Definition: REFFAnimationNode.cs:346
string KindType
Definition: REFFAnimationNode.cs:152
uint NameTableSize
Definition: REFFAnimationNode.cs:345
AnimCurveType CurveFlag
Definition: REFFAnimationNode.cs:308
List< string > _names
Definition: REFFAnimationNode.cs:361
uint RangeTableSize
Definition: REFFAnimationNode.cs:343
uint KeyTableSize
Definition: REFFAnimationNode.cs:342
uint RandomTableSize
Definition: REFFAnimationNode.cs:344
ushort RandomSeed
Definition: REFFAnimationNode.cs:320
string _name
Definition: ResourceNode.cs:139
virtual string TreePath
Definition: ResourceNode.cs:202
AnimCurveType
Definition: REFF.cs:1070
Definition: BinaryHandlers.cs:343
Definition: VoidPtr.cs:9
Definition: BigEndianTypes.cs:192
Bin8 kindEnable
Definition: REFF.cs:1100
uint GetFrameIndex(int typeCount, int typeSize)
Definition: REFF.cs:1146
AnimCurveKeyHeader * Next(int typeCount, int typeSize)
Definition: REFF.cs:1141
AnimCurveKeyHeader * First
Definition: REFF.cs:1119
bushort _count
Definition: REFF.cs:1116

◆ OnPopulate()

override void BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.OnPopulate ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

482 {
483 }

◆ OnRebuild()

override void BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.OnRebuild ( VoidPtr  address,
int  length,
bool  force 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

491 {
492 base.OnRebuild(address, length, force);
493 }

Member Data Documentation

◆ _isPtcl

bool BrawlLib.SSBB.ResourceNodes.REFFAnimationNode._isPtcl

◆ _names

List<string> BrawlLib.SSBB.ResourceNodes.REFFAnimationNode._names = new List<string>()

Property Documentation

◆ CurveFlag

AnimCurveType BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.CurveFlag
get

◆ FrameCount

ushort BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.FrameCount
getset
331 {
332 get => _hdr.frameLength;
333 set
334 {
335 _hdr.frameLength = value;
337 }
338 }
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313
bushort frameLength
Definition: REFF.cs:1104

◆ InfoTableSize

uint BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.InfoTableSize
get

◆ KeyTableSize

uint BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.KeyTableSize
get

◆ KindEnable

byte BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.KindEnable
get

◆ KindType

string BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.KindType
getset
152 {
153 get
154 {
155 if (((REFFNode) Parent.Parent.Parent).VersionMinor == 9)
156 {
157 switch (CurveFlag)
158 {
159 case AnimCurveType.ParticleByte:
160 case AnimCurveType.ParticleFloat:
161 return ((v9AnimCurveTargetByteFloat) _hdr.kindType).ToString();
162 case AnimCurveType.ParticleRotate:
163 return ((v9AnimCurveTargetRotateFloat) _hdr.kindType).ToString();
164 case AnimCurveType.ParticleTexture:
165 return ((v9AnimCurveTargetPtclTex) _hdr.kindType).ToString();
166 case AnimCurveType.Child:
167 return ((v9AnimCurveTargetChild) _hdr.kindType).ToString();
168 case AnimCurveType.Field:
169 return ((v9AnimCurveTargetField) _hdr.kindType).ToString();
170 case AnimCurveType.PostField:
171 return ((v9AnimCurveTargetPostField) _hdr.kindType).ToString();
172 case AnimCurveType.EmitterFloat:
173 return ((v9AnimCurveTargetEmitterFloat) _hdr.kindType).ToString();
174 }
175 }
176 else
177 {
178 return ((AnimCurveTarget7) _hdr.kindType).ToString();
179 }
180
181 //switch (CurveFlag)
182 //{
183 // case AnimCurveType.ParticleByte:
184 // case AnimCurveType.ParticleFloat:
185 // return ((v7AnimCurveTargetByteFloat)_hdr.kindType).ToString();
186 // case AnimCurveType.ParticleRotate:
187 // return ((v7AnimCurveTargetRotateFloat)_hdr.kindType).ToString();
188 // case AnimCurveType.ParticleTexture:
189 // return ((v7AnimCurveTargetPtclTex)_hdr.kindType).ToString();
190 // case AnimCurveType.Child:
191 // return ((v7AnimCurveTargetChild)_hdr.kindType).ToString();
192 // case AnimCurveType.Field:
193 // return ((v7AnimCurveTargetField)_hdr.kindType).ToString();
194 // case AnimCurveType.PostField:
195 // return ((v7AnimCurveTargetPostField)_hdr.kindType).ToString();
196 // case AnimCurveType.EmitterFloat:
197 // return ((v7AnimCurveTargetEmitterFloat)_hdr.kindType).ToString();
198 //}
199 return null;
200 }
201 set
202 {
203 int i = 0;
204 if (((REFFNode) Parent.Parent.Parent).VersionMinor == 9)
205 {
206 switch (CurveFlag)
207 {
208 case AnimCurveType.ParticleByte:
209 case AnimCurveType.ParticleFloat:
211 if (Enum.TryParse(value, true, out a))
212 {
213 _hdr.kindType = (byte) a;
214 }
215 else if (int.TryParse(value, out i))
216 {
217 _hdr.kindType = (byte) i;
218 }
219
220 break;
221 case AnimCurveType.ParticleRotate:
223 if (Enum.TryParse(value, true, out b))
224 {
225 _hdr.kindType = (byte) b;
226 }
227 else if (int.TryParse(value, out i))
228 {
229 _hdr.kindType = (byte) i;
230 }
231
232 break;
233 case AnimCurveType.ParticleTexture:
235 if (Enum.TryParse(value, true, out c))
236 {
237 _hdr.kindType = (byte) c;
238 }
239 else if (int.TryParse(value, out i))
240 {
241 _hdr.kindType = (byte) i;
242 }
243
244 break;
245 case AnimCurveType.Child:
247 if (Enum.TryParse(value, true, out d))
248 {
249 _hdr.kindType = (byte) d;
250 }
251 else if (int.TryParse(value, out i))
252 {
253 _hdr.kindType = (byte) i;
254 }
255
256 break;
257 case AnimCurveType.Field:
259 if (Enum.TryParse(value, true, out e))
260 {
261 _hdr.kindType = (byte) e;
262 }
263 else if (int.TryParse(value, out i))
264 {
265 _hdr.kindType = (byte) i;
266 }
267
268 break;
269 case AnimCurveType.PostField:
271 if (Enum.TryParse(value, true, out f))
272 {
273 _hdr.kindType = (byte) f;
274 }
275 else if (int.TryParse(value, out i))
276 {
277 _hdr.kindType = (byte) i;
278 }
279
280 break;
281 case AnimCurveType.EmitterFloat:
283 if (Enum.TryParse(value, true, out g))
284 {
285 _hdr.kindType = (byte) g;
286 }
287 else if (int.TryParse(value, out i))
288 {
289 _hdr.kindType = (byte) i;
290 }
291
292 break;
293 }
294 }
295 else
296 {
297 if (int.TryParse(value, out i))
298 {
299 _hdr.kindType = (byte) i;
300 }
301 }
302
304 }
305 }
ResourceNode Parent
Definition: ResourceNode.cs:245
AnimCurveTarget7
Definition: REFF.cs:1000
v9AnimCurveTargetPostField
Definition: REFF.cs:907
v9AnimCurveTargetRotateFloat
Definition: REFF.cs:868
v9AnimCurveTargetPtclTex
Definition: REFF.cs:874
v9AnimCurveTargetByteFloat
Definition: REFF.cs:801
v9AnimCurveTargetField
Definition: REFF.cs:894
v9AnimCurveTargetChild
Definition: REFF.cs:882
v9AnimCurveTargetEmitterFloat
Definition: REFF.cs:915
byte kindType
Definition: REFF.cs:1098

◆ LoopCount

byte BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.LoopCount
get

◆ Names

string [] BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.Names
getset
352 {
353 get => _names.ToArray();
354 set
355 {
356 _names = value.ToList();
358 }
359 }

◆ NameTableSize

uint BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.NameTableSize
get

◆ ProcessFlag

AnimCurveHeaderProcessFlagType BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.ProcessFlag
get

◆ RandomSeed

ushort BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.RandomSeed
getset
320 {
321 get => _hdr.randomSeed;
322 set
323 {
324 _random = new Random(_hdr.randomSeed = value);
326 }
327 }
bushort randomSeed
Definition: REFF.cs:1103

◆ RandomTableSize

uint BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.RandomTableSize
get

◆ RangeTableSize

uint BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.RangeTableSize
get

◆ ResourceFileType

override ResourceType BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.ResourceFileType
get

◆ Type

AnimType BrawlLib.SSBB.ResourceNodes.REFFAnimationNode.Type
getset
138 {
139 get => _isPtcl ? AnimType.Particle : AnimType.Emitter;
140 set
141 {
142 _isPtcl = value == AnimType.Particle;
144 }
145 }
bool _isPtcl
Definition: REFFAnimationNode.cs:128
AnimType
Definition: REFFAnimationNode.cs:131

The documentation for this class was generated from the following file: