JMX File Editor/Silkroad/Data/JMXVRES 0109.cs
/// <summary>
/// Calculate and update the values from file pointers
/// </summary>
Calculate and update the values from file pointers
Calculate and update the values from file pointers
public void UpdatePointers()
        {
            PointerBoundingBox = (uint)(Header.Length + (8 * 4) + (5 * 4) + (4) + (4 + Name.Length) + UnkByteArray01.Length);
            PointerMaterial = PointerBoundingBox + (uint)((4 + RootMesh.Length) + (BoundingBox01.Length * 4) + (BoundingBox02.Length * 4) + (4 + ExtraBoundingData.Length));
            PointerMesh = PointerMaterial + 4;
            for (int i = 0; i < Materials.Count; i++)
            {
                PointerMesh += (uint)(4 + (4 + Materials[i].Path.Length));
            }
            PointerAnimation = PointerMesh + 4;
            for (int i = 0; i < Meshes.Count; i++)
            {
                PointerAnimation += (uint)((4 + Meshes[i].Path.Length) + (FlagUInt01 == 1 ? 4 : 0));
            }
            PointerSkeleton = PointerAnimation + 8 + 4;
            for (int i = 0; i < Animations.Count; i++)
            {
                PointerSkeleton += (uint)(4 + Animations[i].Path.Length);
            }
            PointerMeshGroup = PointerSkeleton + 4;
            for (int i = 0; i < Skeletons.Count; i++)
            {
                PointerMeshGroup += (uint)((4 + Skeletons[i].Path.Length) + (4 + Skeletons[i].ExtraBone.Length));
            }
            PointerAnimationGroup = PointerMeshGroup + 4;
            for (int i = 0; i < MeshGroups.Count; i++)
            {
                PointerAnimationGroup += (uint)((4 + MeshGroups[i].Name.Length) + (4 + MeshGroups[i].FileIndexes.Count * 4));
            }
            PointerSystemMods = PointerAnimationGroup + 4;
            for (int i = 0; i < AnimationGroups.Count; i++)
            {
                PointerSystemMods += (uint)((4 + AnimationGroups[i].Name.Length) + 4);
                for (int j = 0; j < AnimationGroups[i].Entries.Count; j++)
                {
                    PointerSystemMods += (uint)(4 + 4 + (4 + AnimationGroups[i].Entries[j].Events.Count * 16) + 4 + (4 + AnimationGroups[i].Entries[j].WalkPoints.Count * 8));
                }
            }
        }
public void UpdatePointers ( ) { PointerBoundingBox = ( uint ) ( Header . Length + ( 8 * 4 ) + ( 5 * 4 ) + ( 4 ) + ( 4 + Name . Length ) + UnkByteArray01 . Length ) ; PointerMaterial = PointerBoundingBox + ( uint ) ( ( 4 + RootMesh . Length ) + ( BoundingBox01 . Length * 4 ) + ( BoundingBox02 . Length * 4 ) + ( 4 + ExtraBoundingData . Length ) ) ; PointerMesh = PointerMaterial + 4 ; for ( int i = 0 ; i < Materials . Count ; i ++ ) { PointerMesh += ( uint ) ( 4 + ( 4 + Materials [ i ] . Path . Length ) ) ; } PointerAnimation = PointerMesh + 4 ; for ( int i = 0 ; i < Meshes . Count ; i ++ ) { PointerAnimation += ( uint ) ( ( 4 + Meshes [ i ] . Path . Length ) + ( FlagUInt01 == 1 ? 4 : 0 ) ) ; } PointerSkeleton = PointerAnimation + 8 + 4 ; for ( int i = 0 ; i < Animations . Count ; i ++ ) { PointerSkeleton += ( uint ) ( 4 + Animations [ i ] . Path . Length ) ; } PointerMeshGroup = PointerSkeleton + 4 ; for ( int i = 0 ; i < Skeletons . Count ; i ++ ) { PointerMeshGroup += ( uint ) ( ( 4 + Skeletons [ i ] . Path . Length ) + ( 4 + Skeletons [ i ] . ExtraBone . Length ) ) ; } PointerAnimationGroup = PointerMeshGroup + 4 ; for ( int i = 0 ; i < MeshGroups . Count ; i ++ ) { PointerAnimationGroup += ( uint ) ( ( 4 + MeshGroups [ i ] . Name . Length ) + ( 4 + MeshGroups [ i ] . FileIndexes . Count * 4 ) ) ; } PointerSystemMods = PointerAnimationGroup + 4 ; for ( int i = 0 ; i < AnimationGroups . Count ; i ++ ) { PointerSystemMods += ( uint ) ( ( 4 + AnimationGroups [ i ] . Name . Length ) + 4 ) ; for ( int j = 0 ; j < AnimationGroups [ i ] . Entries . Count ; j ++ ) { PointerSystemMods += ( uint ) ( 4 + 4 + ( 4 + AnimationGroups [ i ] . Entries [ j ] . Events . Count * 16 ) + 4 + ( 4 + AnimationGroups [ i ] . Entries [ j ] . WalkPoints . Count * 8 ) ) ; } } }
Calculate and update the values from file pointers
Calculate and update the values from file pointers