示例#1
0
        private bool MoveNextStain()
        {
            if (!_IsCurrentStained)
            {
                return(false);
            }
            if (!_StainEnumerator.MoveNext())
            {
                return(false);
            }

            var variant = new ModelVariantIdentifier {
                ImcVariant = _CurrentVariant,
                StainKey   = null
            };

            if (_StainEnumerator.Current.Key > 0)
            {
                variant.StainKey = _StainEnumerator.Current.Key;
            }

            CurrentComponent  = new Content.ContentModel(_Engine, variant, _CurrentModel);
            CurrentTargetFile = GetTargetFile(_EquipmentIterator.Current, _StainEnumerator.Current);
            CurrentName       = GetName(_EquipmentIterator.Current, _StainEnumerator.Current);

            return(true);
        }
 public ContentMesh(ContentModel model, PrimitiveMesh primitive, ModelVariantIdentifier variant)
     : base(model.Engine)
 {
     this.Model = model;
     this.Primitive = primitive;
     this.Variant = variant;
     this.Transformation = Matrix.Identity;
 }
        public bool MoveNext()
        {
            if (MoveNextStain())
            {
                return(true);
            }

            while (_EquipmentIterator.MoveNext())
            {
                var eq       = _EquipmentIterator.Current;
                var charType = RaceCharacterTypes[eq.RacesEquippableBy.First().Key];
                if (!eq.EquippableByMale)
                {
                    charType += 100;
                }

                _CurrentModel = eq.GetModel(charType, out _CurrentVariant);
                if (_CurrentModel == null)
                {
                    continue;
                }

                RenderFromOppositeSide = eq.ItemUICategory.Key == 1 || eq.ItemUICategory.Key == 10; // PGL/MNK and books
                CurrentBoundingBox     = _CurrentModel.BoundingBoxes.Value2.Scale(1.35f);           // Not sure what the first one is for, but some are very strange.

                if (_StainEnumerator == null)
                {
                    _IsCurrentStained = false;
                }
                else
                {
                    _IsCurrentStained = eq.IsDyeable;
                }

                if (_IsCurrentStained)
                {
                    _StainEnumerator.Reset();
                    MoveNextStain();
                }
                else
                {
                    CurrentComponent  = new Content.ContentModel(_Engine, _CurrentVariant, _CurrentModel);
                    CurrentTargetFile = GetTargetFile(_EquipmentIterator.Current);
                    CurrentName       = GetName(_EquipmentIterator.Current);
                }

                return(true);
            }
            return(false);
        }
        public bool MoveNext()
        {
            if (MoveNextStain())
                return true;

            while (_EquipmentIterator.MoveNext()) {
                var eq = _EquipmentIterator.Current;
                var charType = RaceCharacterTypes[eq.RacesEquippableBy.First().Key];
                if (!eq.EquippableByMale)
                    charType += 100;

                _CurrentModel = eq.GetModel(charType, out _CurrentVariant);
                if (_CurrentModel == null)
                    continue;

                RenderFromOppositeSide = eq.ItemUICategory.Key == 1 || eq.ItemUICategory.Key == 10;     // PGL/MNK and books
                CurrentBoundingBox = _CurrentModel.BoundingBoxes.Value2.Scale(1.35f);    // Not sure what the first one is for, but some are very strange.

                if (_StainEnumerator == null)
                    _IsCurrentStained = false;
                else
                    _IsCurrentStained = eq.IsDyeable;

                if (_IsCurrentStained) {
                    _StainEnumerator.Reset();
                    MoveNextStain();
                } else {
                    CurrentComponent = new Content.ContentModel(_Engine, _CurrentVariant, _CurrentModel);
                    CurrentTargetFile = GetTargetFile(_EquipmentIterator.Current);
                    CurrentName = GetName(_EquipmentIterator.Current);
                }

                return true;
            }
            return false;
        }
        private bool MoveNextStain()
        {
            if (!_IsCurrentStained)
                return false;
            if (!_StainEnumerator.MoveNext())
                return false;

            var variant = new ModelVariantIdentifier {
                ImcVariant = _CurrentVariant,
                StainKey = null
            };
            if(_StainEnumerator.Current.Key > 0)
                variant.StainKey = _StainEnumerator.Current.Key;

            CurrentComponent = new Content.ContentModel(_Engine, variant, _CurrentModel);
            CurrentTargetFile = GetTargetFile(_EquipmentIterator.Current, _StainEnumerator.Current);
            CurrentName = GetName(_EquipmentIterator.Current, _StainEnumerator.Current);

            return true;
        }