Beispiel #1
0
        public override GenericRCOLResource.ChunkEntry Export(
            IDictionary <ulong, string> nameMap, bool exportAllNames)
        {
            System.IO.Stream s = null;
            TGIBlock         tgi
                = new TGIBlock(0, null, "ITG", ResourceType, 0, 0);
            JazzActorOperationNode jaon
                = new JazzActorOperationNode(0, null, s);

            jaon.ActorDefinitionIndex = this.mActor == null
                ? NullCRef : this.mActor.ChunkReference;
            jaon.ActorOp = this.mOperation;
            jaon.Operand = this.mOperand;
            if (this.TargetCount > 0)
            {
                JazzChunk.ChunkReferenceList dgi     = jaon.DecisionGraphIndexes;
                DecisionGraphNode[]          targets = this.Targets;
                Array.Sort(targets, 0, targets.Length,
                           AChunkObject.InstantiationComparer.Instance);
                for (int i = 0; i < targets.Length; i++)
                {
                    dgi.Add(targets[i] == null
                        ? NullCRef : targets[i].ChunkReference);
                }
            }
            return(new GenericRCOLResource.ChunkEntry(0, null, tgi, jaon));
        }
Beispiel #2
0
        public override GenericRCOLResource.ChunkEntry Export(
            IDictionary <ulong, string> nameMap, bool exportAllNames)
        {
            System.IO.Stream s = null;
            TGIBlock         tgi
                = new TGIBlock(0, null, "ITG", ResourceType, 0, 0);
            JazzDecisionGraph jdg = new JazzDecisionGraph(0, null, s);

            this.mDecisionMakers.Sort(
                AChunkObject.InstantiationComparer.Instance);
            JazzChunk.ChunkReferenceList odgi
                = jdg.OutboundDecisionGraphIndexes;
            foreach (DecisionGraphNode dm in this.mDecisionMakers)
            {
                odgi.Add(dm == null ? NullCRef : dm.ChunkReference);
            }
            this.mEntryPoints.Sort(
                AChunkObject.InstantiationComparer.Instance);
            JazzChunk.ChunkReferenceList idgi
                = jdg.InboundDecisionGraphIndexes;
            foreach (DecisionGraphNode ep in this.mEntryPoints)
            {
                idgi.Add(ep == null ? NullCRef : ep.ChunkReference);
            }
            return(new GenericRCOLResource.ChunkEntry(0, null, tgi, jdg));
        }
Beispiel #3
0
        public override GenericRCOLResource.ChunkEntry Export(
            IDictionary <ulong, string> nameMap, bool exportAllNames)
        {
            System.IO.Stream s = null;
            TGIBlock         tgi
                = new TGIBlock(0, null, "ITG", ResourceType, 0, 0);
            JazzStopAnimationNode jsan
                = new JazzStopAnimationNode(0, null, s);

            jsan.AnimationFlags     = this.Flags;
            jsan.AnimationPriority1 = this.Priority;
            jsan.BlendInTime        = this.BlendInTime;
            jsan.BlendOutTime       = this.BlendOutTime;
            jsan.Speed = this.Speed;
            ActorDefinition actor = this.Actor;

            jsan.ActorDefinitionIndex = actor == null
                ? NullCRef : actor.ChunkReference;
            jsan.TimingPriority = this.TimingPriority;
            if (this.TargetCount > 0)
            {
                JazzChunk.ChunkReferenceList dgi     = jsan.DecisionGraphIndexes;
                DecisionGraphNode[]          targets = this.Targets;
                Array.Sort(targets, 0, targets.Length,
                           AChunkObject.InstantiationComparer.Instance);
                for (int i = 0; i < targets.Length; i++)
                {
                    dgi.Add(targets[i] == null
                        ? NullCRef : targets[i].ChunkReference);
                }
            }
            return(new GenericRCOLResource.ChunkEntry(0, null, tgi, jsan));
        }
Beispiel #4
0
        public override GenericRCOLResource.ChunkEntry Export(
            IDictionary <ulong, string> nameMap, bool exportAllNames)
        {
            System.IO.Stream s = null;
            TGIBlock         tgi
                = new TGIBlock(0, null, "ITG", ResourceType, 0, 0);
            JazzState js = new JazzState(0, null, s);

            js.NameHash           = this.mNameHash;
            js.Properties         = this.mFlags;
            js.DecisionGraphIndex = this.mDecisionGraph == null
                ? NullCRef : this.mDecisionGraph.ChunkReference;

            State[] transitions = this.mTransitions.ToArray();
            Array.Sort(transitions, 0, transitions.Length,
                       NameComparer.Instance);
            JazzChunk.ChunkReferenceList osi = js.OutboundStateIndexes;
            foreach (State state in transitions)
            {
                osi.Add(state == null ? NullCRef : state.ChunkReference);
            }
            js.AwarenessOverlayLevel = this.mAwarenessOverlayLevel;

            if (!this.bNameIsHash &&
                nameMap != null && !nameMap.ContainsKey(this.mNameHash) &&
                (exportAllNames || !KeyNameReg.HasName(this.mNameHash)))
            {
                nameMap[this.mNameHash] = this.mName;
            }
            return(new GenericRCOLResource.ChunkEntry(0, null, tgi, js));
        }
        public override GenericRCOLResource.ChunkEntry Export(
            IDictionary <ulong, string> nameMap, bool exportAllNames)
        {
            System.IO.Stream s = null;
            int      i;
            TGIBlock tgi
                = new TGIBlock(0, null, "ITG", ResourceType, 0, 0);
            JazzPlayAnimationNode jpan
                = new JazzPlayAnimationNode(0, null, s);

            jpan.ClipResource = string.IsNullOrEmpty(this.mClipPattern)
                ? this.mClipKey : DummyKey;
            jpan.TkmkResource = this.mTrackMaskKey;
            if (this.mSlotSetup.ActorSlotCount > 0)
            {
                JazzPlayAnimationNode.ActorSlot     jslot;
                JazzPlayAnimationNode.ActorSlotList jslots
                    = jpan.ActorSlots;
                SlotSetupBuilder.ActorSlot   slot;
                SlotSetupBuilder.ActorSlot[] slots
                    = this.mSlotSetup.ActorSlotArray;
                for (i = 0; i < slots.Length; i++)
                {
                    slot  = slots[i];
                    jslot = new JazzPlayAnimationNode.ActorSlot(0, null,
                                                                slot.ChainId, slot.SlotId,
                                                                slot.ActorNameHash, slot.SlotNameHash);
                    jslots.Add(jslot);
                }
            }
            if (this.mSlotSetup.ActorSuffixCount > 0)
            {
                JazzPlayAnimationNode.ActorSuffix     jsuffix;
                JazzPlayAnimationNode.ActorSuffixList jsuffixes
                    = jpan.ActorSuffixes;
                SlotSetupBuilder.ActorSuffix   suffix;
                SlotSetupBuilder.ActorSuffix[] suffixes
                    = this.mSlotSetup.ActorSuffixArray;
                for (i = 0; i < suffixes.Length; i++)
                {
                    suffix  = suffixes[i];
                    jsuffix = new JazzPlayAnimationNode.ActorSuffix(0, null);
                    jsuffix.ActorNameHash = suffix.Actor == null
                        ? 0 : suffix.Actor.NameHash;
                    jsuffix.SuffixHash = suffix.Param == null
                        ? 0 : suffix.Param.NameHash;
                    jsuffixes.Add(jsuffix);
                }
            }
            jpan.AdditiveClipResource
                = string.IsNullOrEmpty(this.mAdditiveClipPattern)
                ? this.mAdditiveClipKey : DummyKey;
            jpan.Animation         = this.mClipPattern ?? "";
            jpan.AdditiveAnimation = this.mAdditiveClipPattern ?? "";

            jpan.AnimationNodeFlags = this.Flags;
            jpan.AnimationPriority1 = this.Priority;
            jpan.BlendInTime        = this.BlendInTime;
            jpan.BlendOutTime       = this.BlendOutTime;
            jpan.Speed = this.Speed;
            ActorDefinition actor = this.Actor;

            jpan.ActorDefinitionIndex = actor == null
                ? NullCRef : actor.ChunkReference;
            jpan.TimingPriority = this.TimingPriority;
            if (this.TargetCount > 0)
            {
                JazzChunk.ChunkReferenceList dgi     = jpan.DecisionGraphIndexes;
                DecisionGraphNode[]          targets = this.Targets;
                Array.Sort(targets, 0, targets.Length,
                           AChunkObject.InstantiationComparer.Instance);
                for (i = 0; i < targets.Length; i++)
                {
                    dgi.Add(targets[i] == null
                        ? NullCRef : targets[i].ChunkReference);
                }
            }
            return(new GenericRCOLResource.ChunkEntry(0, null, tgi, jpan));
        }