private static void setupFiles() { try { _index = ClientVersion.InstallationIsUopFormat ? FileManager.CreateFileIndex("soundLegacyMUL.uop", 0xFFF, false, ".dat") : FileManager.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 reader = new StreamReader(FileManager.GetFilePath("Sound.def"))) while ((line = reader.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)); } } } }
public ArtMulResource(GraphicsDevice graphics) { m_Graphics = graphics; m_FileIndex = ClientVersion.InstallationIsUopFormat ? FileManager.CreateFileIndex("artLegacyMUL.uop", 0x10000, false, ".tga") : FileManager.CreateFileIndex("artidx.mul", "art.mul", 0x10000, -1); m_StaticPicking = new PixelPicking(); m_LandTileTextureCache = new Texture2D[0x10000]; m_StaticTileTextureCache = new Texture2D[0x10000]; }
public ArtMulResource(GraphicsDevice graphics) { m_Graphics = graphics; m_FileIndex = ClientVersion.InstallationIsUopFormat ? FileManager.CreateFileIndex("artLegacyMUL.uop", 0x10000, false, ".tga") : FileManager.CreateFileIndex("artidx.mul", "art.mul", 0x10000, -1); // !!! must find patch file reference for artdata. m_LandTileTextureCache = new Texture2D[0x10000]; m_StaticTileTextureCache = new Texture2D[0x10000]; m_StaticDimensions = new Pair <int> [0x10000]; }
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]; }
private void GetIndexes(int body, int action, int direction, out int index, out AFileIndex fileIndex) { if (body < 0 || body >= COUNT_ANIMS) body = 0; int animIndex = BodyConverter.Convert(ref body); switch (animIndex) { default: case 1: { fileIndex = m_FileIndex; if (body < 200) index = body * 110; else if (body < 400) index = 22000 + ((body - 200) * 65); else index = 35000 + ((body - 400) * 175); break; } case 2: { fileIndex = m_FileIndex2; if (body < 200) index = body * 110; else index = 22000 + ((body - 200) * 65); break; } case 3: { fileIndex = m_FileIndex3; if (body < 300) index = body * 65; else if (body < 400) index = 33000 + ((body - 300) * 110); else index = 35000 + ((body - 400) * 175); break; } case 4: { fileIndex = m_FileIndex4; if (body < 200) index = body * 110; else if (body < 400) index = 22000 + ((body - 200) * 65); else index = 35000 + ((body - 400) * 175); break; } case 5: { fileIndex = m_FileIndex5; if ((body < 200) && (body != 34)) // looks strange, though it works. index = body * 110; else if (body < 400) index = 22000 + ((body - 200) * 65); else index = 35000 + ((body - 400) * 175); break; } } index += action * 5; if (direction <= 4) { index += direction; } else { index += direction - (direction - 4) * 2; } }
private void GetIndexes(ref int body, ref int hue, int action, int direction, out int index, out AFileIndex fileIndex) { Translate(ref body, ref hue); int fileType = BodyConverter.Convert(ref body); switch (fileType) { default: case 1: { fileIndex = m_FileIndex; if (body < 200) { index = body * 110; } else if (body < 400) { index = 22000 + ((body - 200) * 65); } else { index = 35000 + ((body - 400) * 175); } break; } case 2: { fileIndex = m_FileIndex2; if (body < 200) { index = body * 110; } else { index = 22000 + ((body - 200) * 65); } break; } case 3: { fileIndex = m_FileIndex3; if (body < 300) { index = body * 65; } else if (body < 400) { index = 33000 + ((body - 300) * 110); } else { index = 35000 + ((body - 400) * 175); } break; } case 4: { fileIndex = m_FileIndex4; if (body < 200) { index = body * 110; } else if (body < 400) { index = 22000 + ((body - 200) * 65); } else { index = 35000 + ((body - 400) * 175); } break; } // Issue 60 - Missing (or wrong) object animations - http://code.google.com/p/ultimaxna/issues/detail?id=60 - Smjert case 5: { fileIndex = m_FileIndex5; if ((body < 200) && (body != 34)) // looks strange, though it works. { index = body * 110; } else if (body < 400) { index = 22000 + ((body - 200) * 65); } else { index = 35000 + ((body - 400) * 175); } break; } // Issue 60 - End } index += action * 5; if (direction <= 4) { index += direction; } else { index += direction - (direction - 4) * 2; } }