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

Public Member Functions

override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
override bool OnInitialize ()
 
bool GetEntry (int index)
 
void SetEntry (int index, bool value)
 
void MakeConstant (bool value)
 
void MakeAnimated ()
 
- 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 ()
 
void SetEntry (int index, bool value)
 
bool GetEntry (int index)
 
void MakeAnimated ()
 
void MakeConstant (bool value)
 

Public Attributes

byte[] _data = new byte[0]
 
int _entryCount
 
VIS0Flags _flags
 
- 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

int EntryCount [get, set]
 
bool Enabled [get, set]
 
bool Constant [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]
 
- Properties inherited from BrawlLib.SSBB.IBoolArraySource
bool Constant [get, set]
 
bool Enabled [get, set]
 
int EntryCount [get, set]
 

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 Function Documentation

◆ GetEntry()

bool BrawlLib.SSBB.ResourceNodes.VIS0EntryNode.GetEntry ( int  index)
inline

Implements BrawlLib.SSBB.IBoolArraySource.

556 {
557 int i = index >> 3;
558 if (i >= _data.Length)
559 {
560 return false;
561 }
562
563 int bit = 1 << (7 - (index & 7));
564 return (_data[i] & bit) != 0;
565 }
byte[] _data
Definition: VIS0Node.cs:434

◆ MakeAnimated()

void BrawlLib.SSBB.ResourceNodes.VIS0EntryNode.MakeAnimated ( )
inline

Implements BrawlLib.SSBB.IBoolArraySource.

589 {
590 _flags = VIS0Flags.None;
591 _entryCount = -1;
592 EntryCount = ((VIS0Node) _parent).FrameCount;
593
594 //bool e = Enabled;
595 //for (int i = 0; i < _entryCount; i++)
596 // SetEntry(i, e);
597
599 }
ResourceNode _parent
Definition: ResourceNode.cs:142
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313
int _entryCount
Definition: VIS0Node.cs:435
int EntryCount
Definition: VIS0Node.cs:440
VIS0Flags _flags
Definition: VIS0Node.cs:436
VIS0Flags
Definition: VIS0.cs:9

◆ MakeConstant()

void BrawlLib.SSBB.ResourceNodes.VIS0EntryNode.MakeConstant ( bool  value)
inline

Implements BrawlLib.SSBB.IBoolArraySource.

582 {
583 _flags = VIS0Flags.Constant | (value ? VIS0Flags.Enabled : 0);
584 _entryCount = 0;
586 }

◆ OnCalculateSize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

506 {
507 if (_entryCount == 0)
508 {
509 return 8;
510 }
511
512 return _entryCount.Align(32) / 8 + 8;
513 }

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

527 {
528 if (_name == null && Header->_stringOffset != 0)
529 {
530 _name = Header->ResourceString;
531 }
532
533 _flags = Header->Flags;
534
535 if ((_flags & VIS0Flags.Constant) == 0)
536 {
537 _entryCount = ((VIS0Node) _parent).FrameCount;
538 int numBytes = _entryCount.Align(32) / 8;
539
540 SetSizeInternal(numBytes + 8);
541
542 _data = new byte[numBytes];
543 Marshal.Copy(Header->Data, _data, 0, numBytes);
544 }
545 else
546 {
547 _entryCount = 0;
548 _data = new byte[0];
550 }
551
552 return false;
553 }
void SetSizeInternal(int size)
Definition: ResourceNode.cs:799
string _name
Definition: ResourceNode.cs:139

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

516 {
517 VIS0Entry* header = (VIS0Entry*) address;
518 *header = new VIS0Entry(_flags);
519
520 if (_entryCount != 0)
521 {
522 Marshal.Copy(_data, 0, header->Data, length - 8);
523 }
524 }

◆ SetEntry()

void BrawlLib.SSBB.ResourceNodes.VIS0EntryNode.SetEntry ( int  index,
bool  value 
)
inline

Implements BrawlLib.SSBB.IBoolArraySource.

568 {
569 int i = index >> 3;
570 if (i >= _data.Length)
571 {
572 return;
573 }
574
575 int bit = 1 << (7 - (index & 7));
576 int mask = ~bit;
577 _data[i] = (byte) ((_data[i] & mask) | (value ? bit : 0));
579 }

Member Data Documentation

◆ _data

byte [] BrawlLib.SSBB.ResourceNodes.VIS0EntryNode._data = new byte[0]

◆ _entryCount

int BrawlLib.SSBB.ResourceNodes.VIS0EntryNode._entryCount

◆ _flags

VIS0Flags BrawlLib.SSBB.ResourceNodes.VIS0EntryNode._flags

Property Documentation

◆ Constant

bool BrawlLib.SSBB.ResourceNodes.VIS0EntryNode.Constant
getset

Implements BrawlLib.SSBB.IBoolArraySource.

487 {
488 get => _flags.HasFlag(VIS0Flags.Constant);
489 set
490 {
491 if (value)
492 {
494 }
495 else
496 {
497 MakeAnimated();
498 }
499
502 }
503 }
void UpdateCurrentControl()
Definition: ResourceNode.cs:482
bool Enabled
Definition: VIS0Node.cs:468
void MakeAnimated()
Definition: VIS0Node.cs:588
void MakeConstant(bool value)
Definition: VIS0Node.cs:581

◆ Enabled

bool BrawlLib.SSBB.ResourceNodes.VIS0EntryNode.Enabled
getset

Implements BrawlLib.SSBB.IBoolArraySource.

468 {
469 get => _flags.HasFlag(VIS0Flags.Enabled);
470 set
471 {
472 if (value)
473 {
474 _flags |= VIS0Flags.Enabled;
475 }
476 else
477 {
478 _flags &= ~VIS0Flags.Enabled;
479 }
480
482 }
483 }

◆ EntryCount

int BrawlLib.SSBB.ResourceNodes.VIS0EntryNode.EntryCount
getset

Implements BrawlLib.SSBB.IBoolArraySource.

440 {
441 get => _entryCount;
442 set
443 {
444 if (_entryCount == 0)
445 {
446 return;
447 }
448
449 _entryCount = value;
450 int len = value.Align(32) / 8;
451
452 if (_data.Length < len)
453 {
454 byte[] newArr = new byte[len];
455 Array.Copy(_data, newArr, _data.Length);
456 _data = newArr;
457 }
458
460 }
461 }

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