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

Public Member Functions

 PAT0Node ()
 
void RegenerateTextureList ()
 
void RegeneratePaletteList ()
 
override bool OnInitialize ()
 
override void OnPopulate ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
PAT0EntryNode CreateEntry ()
 
PAT0EntryNode CreateEntry (int index)
 
void Resize ()
 Stretches or compresses all frames of the animation to fit a new frame count specified by the user. More...
 
void Resize (int newFrameCount)
 Stretches or compresses all frames of the animation to fit a new frame count. More...
 
void Append ()
 Adds an animation opened by the user to the end of this one More...
 
void Append (PAT0Node external)
 Adds an animation to the end of this one More...
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.BRESEntryNode
override bool OnInitialize ()
 
override void Export (string outPath)
 
override byte[] MD5 ()
 Find the MD5 checksum of this node's data. Before calculating the checksum, the data will be copied to a temporary area in memory and PostProcess will be run just as in Export(). More...
 
- 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 ()
 

Properties

override ResourceType ResourceFileType [get]
 
override Type[] AllowedChildTypes [get]
 
override int[] SupportedVersions [get]
 
override string Tag [get]
 
override int FrameCount [get, set]
 
override bool Loop [get, set]
 
string[] Textures [get]
 
string[] Palettes [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.NW4RAnimationNode
virtual int FrameCount [get, set]
 
virtual bool Loop [get, set]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.BRESEntryNode
virtual int DataAlign [get]
 
BRRESNode BRESNode [get]
 
virtual int[] SupportedVersions [get]
 
virtual string Tag [get]
 
int Version [get, set]
 
string OriginalPath [get, set]
 
UserDataCollection UserEntries [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)
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.NW4RAnimationNode
int _numFrames = 1
 
bool _loop
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.BRESEntryNode
int _version
 
string _originalPath
 
- 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
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.NW4RAnimationNode
virtual void UpdateChildFrameLimits ()
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.BRESEntryNode
virtual void OnVersionChanged (int previousVersion)
 
- 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
 

Constructor & Destructor Documentation

◆ PAT0Node()

BrawlLib.SSBB.ResourceNodes.PAT0Node.PAT0Node ( )
inline
28 {
29 _version = 3;
30 }
int _version
Definition: BRRESNode.cs:1045

Member Function Documentation

◆ Append() [1/2]

void BrawlLib.SSBB.ResourceNodes.PAT0Node.Append ( )
inline

Adds an animation opened by the user to the end of this one

501 {
502 PAT0Node external = null;
503 OpenFileDialog o = new OpenFileDialog
504 {
505 Filter = "PAT0 Animation (*.pat0)|*.pat0",
506 Title = "Please select an animation to append."
507 };
508 if (o.ShowDialog() == DialogResult.OK)
509 {
510 if ((external = (PAT0Node) NodeFactory.FromFile(null, o.FileName)) != null)
511 {
512 Append(external);
513 }
514 }
515 }
PAT0Node()
Definition: PAT0Node.cs:27
void Append()
Adds an animation opened by the user to the end of this one
Definition: PAT0Node.cs:500

◆ Append() [2/2]

void BrawlLib.SSBB.ResourceNodes.PAT0Node.Append ( PAT0Node  external)
inline

Adds an animation to the end of this one

521 {
522 int origIntCount = FrameCount;
523 FrameCount += external.FrameCount;
524
525 foreach (PAT0EntryNode w in external.Children)
526 {
527 foreach (PAT0TextureNode _extEntry in w.Children)
528 {
529 PAT0TextureNode _intEntry = null;
530 if ((_intEntry = (PAT0TextureNode) FindChild(w.Name + "/" + _extEntry.Name, false)) == null)
531 {
532 PAT0EntryNode wi = null;
533 if ((wi = (PAT0EntryNode) FindChild(w.Name, false)) == null)
534 {
535 AddChild(wi = new PAT0EntryNode {Name = FindName(null)});
536 }
537
538 PAT0TextureNode newIntEntry = new PAT0TextureNode(_extEntry._texFlags, _extEntry.TextureIndex);
539
540 wi.AddChild(newIntEntry);
541 foreach (PAT0TextureEntryNode e in _extEntry.Children)
542 {
543 PAT0TextureEntryNode q = new PAT0TextureEntryNode {_frame = e._frame + origIntCount};
544 newIntEntry.AddChild(q);
545
546 q.Texture = e.Texture;
547 q.Palette = e.Palette;
548 }
549 }
550 else
551 {
552 foreach (PAT0TextureEntryNode e in _extEntry.Children)
553 {
554 PAT0TextureEntryNode q = new PAT0TextureEntryNode {_frame = e._frame + origIntCount};
555 _intEntry.AddChild(q);
556
557 q.Texture = e.Texture;
558 q.Palette = e.Palette;
559 }
560 }
561 }
562 }
563 }
override int FrameCount
Definition: PAT0Node.cs:36
unsafe string FindName(string name)
Definition: ResourceNode.cs:1578
virtual string Name
Definition: ResourceNode.cs:223
virtual void AddChild(ResourceNode child)
Definition: ResourceNode.cs:757
ResourceNode FindChild(string path)
Definition: ResourceNode.cs:1342

◆ CreateEntry() [1/2]

PAT0EntryNode BrawlLib.SSBB.ResourceNodes.PAT0Node.CreateEntry ( )
inline
446 {
447 return CreateEntry(-1);
448 }
PAT0EntryNode CreateEntry()
Definition: PAT0Node.cs:445

◆ CreateEntry() [2/2]

PAT0EntryNode BrawlLib.SSBB.ResourceNodes.PAT0Node.CreateEntry ( int  index)
inline
451 {
452 PAT0EntryNode n = new PAT0EntryNode
453 {
454 Name = FindName(null)
455 };
456 InsertChild(n, index);
457 n.CreateEntry();
458 return n;
459 }
virtual void InsertChild(ResourceNode child, int index)
Definition: ResourceNode.cs:774

◆ OnCalculateSize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

265 {
268
269 int size = PAT0v3.Size + 0x18 + Children.Count * 0x10;
270 size += (_textureFiles.Count + _paletteFiles.Count) * 8;
271 foreach (PAT0EntryNode n in Children)
272 {
273 size += n.CalculateSize(true);
274 }
275
276 if (_version == 4)
277 {
278 size += _userEntries.GetSize();
279 }
280
281 return size;
282 }
void RegeneratePaletteList()
Definition: PAT0Node.cs:102
void RegenerateTextureList()
Definition: PAT0Node.cs:51
List< ResourceNode > Children
Definition: ResourceNode.cs:262

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

154 {
155 base.OnInitialize();
156
157 _textureFiles.Clear();
158 _paletteFiles.Clear();
159
160 int texPtr, pltPtr;
161 if (_version == 4)
162 {
163 PAT0v4* header = Header4;
164 _numFrames = header->_numFrames;
165 _loop = header->_loop != 0;
166 texPtr = header->_numTexPtr;
167 pltPtr = header->_numPltPtr;
168 if (_name == null && header->_stringOffset != 0)
169 {
170 _name = header->ResourceString;
171 }
172
173 if (header->_origPathOffset > 0)
174 {
175 _originalPath = header->OrigPath;
176 }
177
178 (_userEntries = new UserDataCollection()).Read(header->UserData, WorkingUncompressed);
179
180 //Get texture strings
181 for (int i = 0; i < texPtr; i++)
182 {
183 _textureFiles.Add(header->GetTexStringEntry(i));
184 }
185
186 //Get palette strings
187 for (int i = 0; i < pltPtr; i++)
188 {
189 _paletteFiles.Add(header->GetPltStringEntry(i));
190 }
191
192 return header->Group->_numEntries > 0;
193 }
194 else
195 {
196 PAT0v3* header = Header3;
197 _numFrames = header->_numFrames;
198 _loop = header->_loop != 0;
199 texPtr = header->_numTexPtr;
200 pltPtr = header->_numPltPtr;
201
202 if (_name == null && header->_stringOffset != 0)
203 {
204 _name = header->ResourceString;
205 }
206
207 if (header->_origPathOffset > 0)
208 {
209 _originalPath = header->OrigPath;
210 }
211
212 //Get texture strings
213 for (int i = 0; i < texPtr; i++)
214 {
215 _textureFiles.Add(header->GetTexStringEntry(i));
216 }
217
218 //Get palette strings
219 for (int i = 0; i < pltPtr; i++)
220 {
221 _paletteFiles.Add(header->GetPltStringEntry(i));
222 }
223
224 return header->Group->_numEntries > 0;
225 }
226 }
string _originalPath
Definition: BRRESNode.cs:1046
int _numFrames
Definition: BRRESNode.cs:994
bool _loop
Definition: BRRESNode.cs:995
string _name
Definition: ResourceNode.cs:139
DataSource WorkingUncompressed
Definition: ResourceNode.cs:183

◆ OnPopulate()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

229 {
230 ResourceGroup* group = Header3->Group;
231 for (int i = 0; i < group->_numEntries; i++)
232 {
233 new PAT0EntryNode().Initialize(this, new DataSource(group->First[i].DataAddress, PAT0Pattern.Size));
234 }
235 }
VoidPtr DataAddress
Definition: Common.cs:524
Definition: Common.cs:380
ResourceEntry * First
Definition: Common.cs:405
bint _numEntries
Definition: Common.cs:384

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

285 {
286 //Set header values
287 if (_version == 4)
288 {
289 PAT0v4* header = (PAT0v4*) address;
290 header->_header._tag = PAT0v4.Tag;
291 header->_header._version = 4;
292 header->_dataOffset = PAT0v4.Size;
293 header->_userDataOffset = header->_origPathOffset = 0;
294 header->_numFrames = (ushort) _numFrames;
295 header->_numEntries = (ushort) Children.Count;
296 header->_numTexPtr = (ushort) _textureFiles.Count;
297 header->_numPltPtr = (ushort) _paletteFiles.Count;
298 header->_loop = _loop ? 1 : 0;
299 }
300 else
301 {
302 PAT0v3* header = (PAT0v3*) address;
303 header->_header._tag = PAT0v3.Tag;
304 header->_header._version = 3;
305 header->_dataOffset = PAT0v3.Size;
306 header->_origPathOffset = 0;
307 header->_numFrames = (ushort) _numFrames;
308 header->_numEntries = (ushort) Children.Count;
309 header->_numTexPtr = (ushort) _textureFiles.Count;
310 header->_numPltPtr = (ushort) _paletteFiles.Count;
311 header->_loop = _loop ? 1 : 0;
312 }
313
314 PAT0v3* commonHeader = (PAT0v3*) address;
315
316 //Now set header values that are in the same spot between versions
317
318 //Set offsets
319 commonHeader->_texTableOffset = length - (_textureFiles.Count + _paletteFiles.Count) * 8;
320 commonHeader->_pltTableOffset = commonHeader->_texTableOffset + _textureFiles.Count * 4;
321
322 //Set pointer offsets
323 int offset = length - _textureFiles.Count * 4 - _paletteFiles.Count * 4;
324 commonHeader->_texPtrTableOffset = offset;
325 commonHeader->_pltPtrTableOffset = offset + _textureFiles.Count * 4;
326
327 //Set pointers
328 bint* ptr = (bint*) (commonHeader->Address + commonHeader->_texPtrTableOffset);
329 for (int i = 0; i < _textureFiles.Count; i++)
330 {
331 *ptr++ = 0;
332 }
333
334 ptr = (bint*) (commonHeader->Address + commonHeader->_pltPtrTableOffset);
335 for (int i = 0; i < _paletteFiles.Count; i++)
336 {
337 *ptr++ = 0;
338 }
339
340 ResourceGroup* group = commonHeader->Group;
341 *group = new ResourceGroup(Children.Count);
342
343 VoidPtr entryAddress = group->EndAddress;
344 VoidPtr dataAddress = entryAddress;
345 ResourceEntry* rEntry = group->First;
346
347 foreach (PAT0EntryNode n in Children)
348 {
349 dataAddress += n._entryLen;
350 }
351
352 foreach (PAT0EntryNode n in Children)
353 {
354 foreach (PAT0TextureNode t in n.Children)
355 {
356 n._dataAddrs[t.Index] = dataAddress;
357 if (n._dataLens[t.Index] != -1)
358 {
359 dataAddress += n._dataLens[t.Index];
360 }
361 }
362 }
363
364 foreach (PAT0EntryNode n in Children)
365 {
366 (rEntry++)->_dataOffset = (int) entryAddress - (int) group;
367
368 n.Rebuild(entryAddress, n._entryLen, true);
369 entryAddress += n._entryLen;
370 }
371
372 if (_userEntries.Count > 0 && _version == 4)
373 {
374 _userEntries.Write(((PAT0v4*) address)->UserData = dataAddress);
375 }
376 }
Definition: VoidPtr.cs:9
Definition: BigEndianTypes.cs:9
Definition: Common.cs:472
VoidPtr EndAddress
Definition: Common.cs:406

◆ RegeneratePaletteList()

void BrawlLib.SSBB.ResourceNodes.PAT0Node.RegeneratePaletteList ( )
inline
103 {
104 int index = -1;
105
106 //Make sure all palette names are assigned before clearing the list
107 Populate();
108
109 //Reset list to recollect
110 _paletteFiles.Clear();
111
112 //First, collect palette names
113 foreach (PAT0EntryNode n in Children)
114 {
115 foreach (PAT0TextureNode t in n.Children)
116 {
117 foreach (PAT0TextureEntryNode e in t.Children)
118 {
119 if (t._hasPlt && !string.IsNullOrEmpty(e._plt))
120 {
121 if ((index = _paletteFiles.IndexOf(e._plt)) < 0)
122 {
123 _paletteFiles.Add(e._plt);
124 }
125 }
126 else
127 {
128 e._pltFileIndex = 0;
129 }
130 }
131 }
132 }
133
134 //Sort them
135 _paletteFiles.Sort();
136
137 //Now assign indices into the sorted list
138 foreach (PAT0EntryNode n in Children)
139 {
140 foreach (PAT0TextureNode t in n.Children)
141 {
142 foreach (PAT0TextureEntryNode e in t.Children)
143 {
144 if (t._hasPlt && !string.IsNullOrEmpty(e._plt))
145 {
146 e._pltFileIndex = (ushort) _paletteFiles.IndexOf(e._plt);
147 }
148 }
149 }
150 }
151 }
void Populate(int levels=-1)
Definition: ResourceNode.cs:613

◆ RegenerateTextureList()

void BrawlLib.SSBB.ResourceNodes.PAT0Node.RegenerateTextureList ( )
inline
52 {
53 int index = -1;
54
55 //Make sure all texture names are assigned before clearing the list
56 Populate();
57
58 //Reset list to recollect
59 _textureFiles.Clear();
60
61 //First, collect texture names
62 foreach (PAT0EntryNode n in Children)
63 {
64 foreach (PAT0TextureNode t in n.Children)
65 {
66 foreach (PAT0TextureEntryNode e in t.Children)
67 {
68 if (t._hasTex && !string.IsNullOrEmpty(e._tex))
69 {
70 if ((index = _textureFiles.IndexOf(e._tex)) < 0)
71 {
72 _textureFiles.Add(e._tex);
73 }
74 }
75 else
76 {
77 e._texFileIndex = 0;
78 }
79 }
80 }
81 }
82
83 //Sort them
84 _textureFiles.Sort();
85
86 //Now assign indices into the sorted list
87 foreach (PAT0EntryNode n in Children)
88 {
89 foreach (PAT0TextureNode t in n.Children)
90 {
91 foreach (PAT0TextureEntryNode e in t.Children)
92 {
93 if (t._hasTex && !string.IsNullOrEmpty(e._tex))
94 {
95 e._texFileIndex = (ushort) _textureFiles.IndexOf(e._tex);
96 }
97 }
98 }
99 }
100 }

◆ Resize() [1/2]

void BrawlLib.SSBB.ResourceNodes.PAT0Node.Resize ( )
inline

Stretches or compresses all frames of the animation to fit a new frame count specified by the user.

467 {
469 if (f.ShowDialog(FrameCount) == DialogResult.OK)
470 {
471 Resize(f.NewValue);
472 }
473 }
Definition: FrameCountChanger.cs:7
DialogResult ShowDialog(int frameCount)
Definition: FrameCountChanger.cs:15
int NewValue
Definition: FrameCountChanger.cs:13
void Resize()
Stretches or compresses all frames of the animation to fit a new frame count specified by the user.
Definition: PAT0Node.cs:466

◆ Resize() [2/2]

void BrawlLib.SSBB.ResourceNodes.PAT0Node.Resize ( int  newFrameCount)
inline

Stretches or compresses all frames of the animation to fit a new frame count.

479 {
480 float ratio = newFrameCount / (float) FrameCount;
481 foreach (PAT0EntryNode e in Children)
482 {
483 foreach (PAT0TextureNode t in e.Children)
484 {
485 foreach (PAT0TextureEntryNode x in t.Children)
486 {
487 x._frame *= ratio;
488 }
489
490 //t.SortChildren();
491 }
492 }
493
494 FrameCount = newFrameCount;
495 }

Property Documentation

◆ AllowedChildTypes

override Type [] BrawlLib.SSBB.ResourceNodes.PAT0Node.AllowedChildTypes
get

◆ FrameCount

override int BrawlLib.SSBB.ResourceNodes.PAT0Node.FrameCount
getset
36 {
37 get => base.FrameCount;
38 set => base.FrameCount = value;
39 }

◆ Loop

override bool BrawlLib.SSBB.ResourceNodes.PAT0Node.Loop
getset
43 {
44 get => base.Loop;
45 set => base.Loop = value;
46 }

◆ Palettes

string [] BrawlLib.SSBB.ResourceNodes.PAT0Node.Palettes
get

◆ ResourceFileType

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

◆ SupportedVersions

override int [] BrawlLib.SSBB.ResourceNodes.PAT0Node.SupportedVersions
get

◆ Tag

override string BrawlLib.SSBB.ResourceNodes.PAT0Node.Tag
get

◆ Textures

string [] BrawlLib.SSBB.ResourceNodes.PAT0Node.Textures
get

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