示例#1
0
        static void SetupFiles()
        {
            try
            {
                _index = ClientVersion.InstallationIsUopFormat ?
                         UltimaFileManager.CreateFileIndex("soundLegacyMUL.uop", 0xFFF, false, ".dat") :
                         UltimaFileManager.CreateFileIndex("soundidx.mul", "sound.mul", 0x1000, -1); // new BinaryReader(new FileStream(FileManager.GetFilePath("soundidx.mul"), FileMode.Open));
                _filesPrepared = true;
            }
            catch
            {
                _filesPrepared = false;
                return;
            }
            var reg = new Regex(@"(\d{1,3}) \x7B(\d{1,3})\x7D (\d{1,3})", RegexOptions.Compiled);

            _translations = new Dictionary <int, int>();
            string line;

            using (var r = new StreamReader(UltimaFileManager.GetFilePath("Sound.def")))
                while ((line = r.ReadLine()) != null)
                {
                    if (((line = line.Trim()).Length != 0) && !line.StartsWith("#"))
                    {
                        var match = reg.Match(line);
                        if (match.Success)
                        {
                            _translations.Add(int.Parse(match.Groups[1].Value), int.Parse(match.Groups[2].Value));
                        }
                    }
                }
        }
示例#2
0
 public ArtMulResource(object graphics)
 {
     _fileIndex = ClientVersion.InstallationIsUopFormat ?
                  UltimaFileManager.CreateFileIndex("artLegacyMUL.uop", 0x10000, false, ".tga") :
                  UltimaFileManager.CreateFileIndex("artidx.mul", "art.mul", 0x10000, -1); // !!! must find patch file reference for artdata.
     _staticPicking          = new PixelPicking();
     _landTileTextureCache   = new Texture2DInfo[0x10000];
     _staticTileTextureCache = new Texture2DInfo[0x10000];
 }