Exemplo n.º 1
0
        private void ExecObject(int dlDepth, int objId,
		int matrixId, int colorTransformId, int instId,
		int dlBlendMode, bool updateBlendMode = false)
        {
            // Ignore error
            if (objId == -1)
            return;
            Data data = m_lwf.data;
            Format.Object dataObject = data.objects[objId];
            int dataObjectId = dataObject.objectId;
            Object obj = m_displayList[dlDepth];

            if (obj != null && (obj.type != (Type)dataObject.objectType ||
                obj.objectId != dataObjectId || (obj.IsMovie() &&
                ((IObject)obj).instanceId != instId))) {
            if (m_texts != null && obj.IsText())
                EraseText(obj.objectId);
            obj.Destroy();
            obj = null;
            }

            if (obj == null) {
            switch ((Type)dataObject.objectType) {
            case Type.BUTTON:
                obj = new Button(m_lwf,
                    this, dataObjectId, instId, matrixId, colorTransformId);
                break;

            case Type.GRAPHIC:
                obj = new Graphic(m_lwf, this, dataObjectId);
                break;

            case Type.MOVIE:
                obj = new Movie(m_lwf, this,
                    dataObjectId, instId, matrixId, colorTransformId);
                ((Movie)obj).blendMode = dlBlendMode;
                break;

            case Type.BITMAP:
                obj = new Bitmap(m_lwf, this, dataObjectId);
                break;

            case Type.BITMAPEX:
                obj = new BitmapEx(m_lwf, this, dataObjectId);
                break;

            case Type.TEXT:
                obj = new Text(m_lwf, this, dataObjectId, instId);
                break;

            case Type.PARTICLE:
                obj = new Particle(m_lwf, this, dataObjectId);
                break;

            case Type.PROGRAMOBJECT:
                obj = new ProgramObject(m_lwf, this, dataObjectId);
                break;
            }
            }

            if (obj.IsMovie() && updateBlendMode)
            ((Movie)obj).blendMode = dlBlendMode;

            if (obj.IsMovie() || obj.IsButton()) {
            IObject instance = (IObject)obj;
            instance.linkInstance = null;
            if (m_instanceHead == null)
                m_instanceHead = instance;
            else
                m_instanceTail.linkInstance = instance;
            m_instanceTail = instance;
            if (obj.IsButton())
                m_hasButton = true;
            }

            if (m_texts != null && obj.IsText())
            InsertText(obj.objectId);

            m_displayList[dlDepth] = obj;
            obj.execCount = m_movieExecCount;
            obj.Exec(matrixId, colorTransformId);
        }