/***************/
 /* Constructor */
 /***************/
 public RWTextureDictionaryWrapper(string text, RWTextureDictionary textureDictionary) 
     : base(text, textureDictionary, SupportedFileType.RWTextureDictionary, true)
 {
     m_canMove = false;
     m_canRename = false;
     m_canDelete = false;
     m_canAdd = true;
     InitializeContextMenuStrip();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Read the <see cref="RMDScene"/> from a <see cref="Stream"/> using a <see cref="BinaryReader"/>.
        /// </summary>
        /// <param name="reader">The <see cref="BinaryReader"/> attached to a <see cref="Stream"/> containing <see cref="RMDScene"/> data.</param>
        private void InternalReadScene(BinaryReader reader)
        {
            List<RWNode> unfilteredNodes = new List<RWNode>();

            // Initial pass, read all nodes into a list and filter the animation set count, texture dictionary, scenes and attach frame list out.
            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                RWNode node = RWNodeFactory.GetNode(this, reader);

                switch (node.Type)
                {
                    case RWNodeType.RMDAnimationSetCount:
                        // skip this node as its entirely redundant
                        break;

                    case RWNodeType.TextureDictionary:
                        _textureDictionary = (RWTextureDictionary)node;
                        break;

                    case RWNodeType.Scene:
                        _scenes.Add((RWScene)node);
                        break;

                    case RWNodeType.RMDFrameLinkList:
                        // Retrieve the list of frame links from the node and skip the node itself
                        _nodeLinks = (node as RMDFrameLinkList).FrameLinks;
                        break;

                    default:
                        unfilteredNodes.Add(node);
                        break;
                }
            }

            // Second pass, sort the remaining nodes into misc nodes and animation sets
            for (int i = 0; i < unfilteredNodes.Count; i++)
            {
                switch (unfilteredNodes[i].Type)
                {
                    case RWNodeType.Animation:
                    case RWNodeType.UVAnimationDictionary:
                    case RWNodeType.RMDAnimationSetPlaceholder:
                    case RWNodeType.RMDAnimationSetRedirect:
                    case RWNodeType.RMDAnimationSetTerminator:
                    case RWNodeType.RMDTransformOverride:
                    case RWNodeType.RMDVisibilityAnim:
                    case RWNodeType.RMDParticleAnimation:
                        // Read an animation set, this function will increment the loop iterator variable
                        _animationSets.Add(CreateAnimationSet(unfilteredNodes, ref i));
                        break;

                    default:
                        _miscNodes.Add(unfilteredNodes[i]);
                        break;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes the texture dictionary and lists of the <see cref="RMDScene"/>.
 /// </summary>
 private void InitializeMembers()
 {
     _textureDictionary = null;
     _scenes = new List<RWScene>();
     _nodeLinks = new List<RMDNodeLink>();
     _animationSets = new List<RMDAnimationSet>();
     _miscNodes = new List<RWNode>();
 }
        internal override void RebuildWrappedObject()
        {
            var txd = new RWTextureDictionary();
            foreach (RWTextureNativeWrapper node in Nodes)
            {
                if (node.IsDirty)
                    node.RebuildWrappedObject();
                txd.Textures.Add(node.WrappedObject);
            }

            m_wrappedObject = txd;
            m_isDirty = false;
        }
Ejemplo n.º 5
0
 internal RWTextureDictionaryStruct(RWTextureDictionary texDictionary)
     : base(RWNodeType.Struct, texDictionary)
 {
     TextureCount = (ushort)texDictionary.TextureCount;
     DeviceID = texDictionary.DeviceID;
 }