public static void Load(string mapName, Vector2 coords) { string dataPath = @"world\maptextures\" + mapName + @"\" + mapName + "_" + coords.x + "_" + coords.y + ".blp"; MapTextureBlock mapTextureBlock = new MapTextureBlock(); Texture2Ddata texture2Ddata = new Texture2Ddata(); string extractedTexturePath = Casc.GetFile(dataPath); using (Stream stream = File.Open(extractedTexturePath, FileMode.Open)) { BLP blp = new BLP(); byte[] data = blp.GetUncompressed(stream, true); BLPinfo info = blp.Info(); texture2Ddata.hasMipmaps = info.hasMipmaps; texture2Ddata.height = info.height; texture2Ddata.width = info.width; texture2Ddata.textureFormat = info.textureFormat; texture2Ddata.TextureData = data; mapTextureBlock.dataPath = dataPath; mapTextureBlock.mapName = mapName; mapTextureBlock.coords = coords; mapTextureBlock.data = texture2Ddata; if (ADT.working) { MapTextureDataQueue.Enqueue(mapTextureBlock); } MapTextureThreadRunning = false; } }
public static void Load(Vector2 coords, CASCHandler Handler) { MapTextureBlock mapTextureBlock = new MapTextureBlock(); Texture2Ddata texture2Ddata = new Texture2Ddata(); using (Stream stream = Handler.OpenFile(WDT.WDTEntries[((int)coords.x, (int)coords.y)].MapTexture))