Exemple #1
0
        private string GetSkinName(string root, IDataStorageRecord displayInfo, int index)
        {
            if (displayInfo == null)
            {
                throw new ArgumentNullException("displayInfo");
            }
            var skinString = displayInfo.GetString(6 + index);

            return(string.IsNullOrEmpty(skinString)
                ? "default_texture"
                : string.Format("{0}\\{1}.blp", root, skinString));
        }
Exemple #2
0
        public WorldLightEntry(IDataStorageRecord lightEntry)
        {
            mLight = lightEntry;

            var px = mLight.GetFloat(2);
            var py = mLight.GetFloat(3);
            var pz = mLight.GetFloat(4);
            var ir = mLight.GetFloat(5);
            var or = mLight.GetFloat(6);

            px /= 36.0f;
            py /= 36.0f;
            pz /= 36.0f;
            ir /= 36.0f;
            or /= 36.0f;

            IsGlobal    = Math.Abs(px) < 1e-3 && Math.Abs(py) < 1e-3 && Math.Abs(pz) < 1e-3;
            InnerRadius = ir;
            OuterRadius = or;

            Position = new Vector3(px, pz, py);

            for (var i = 0; i < 18; ++i)
            {
                mColorTables[i] = new List <Vector3>();
                mTimeTables[i]  = new List <uint>();
            }

            for (var i = 0; i < 2; ++i)
            {
                mFloatTables[i] = new List <float>();
                mFloatTimes[i]  = new List <uint>();
            }

            InitTables();
        }
Exemple #3
0
        private string[] GetDoodads(int effect, IDataStorageRecord textureRow)
        {
            if (GroundEffectCache.ContainsKey(effect))
            {
                return(GroundEffectCache[effect]);
            }


            var ret = new string[4];

            for (var i = 0; i < 4; ++i)
            {
                var doodadRef = textureRow.GetInt32(1 + i);
                if (doodadRef < 0)
                {
                    continue;
                }

                ret[i] = GetDoodadString(doodadRef);
            }

            GroundEffectCache.Add(effect, ret);
            return(ret);
        }