public void ReadRawTris(byte[] memory) { UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) { l.data[i] = memory[readerpos + i]; } RawTriangles = new List <RawTriangle>(); for (int i = 0; i < l.count; i++) { RawTriangle r = new RawTriangle(); r.v0 = BitConverter.ToInt16(memory, readerpos); r.v1 = BitConverter.ToInt16(memory, readerpos + 2); r.v2 = BitConverter.ToInt16(memory, readerpos + 4); r.mat = BitConverter.ToInt16(memory, readerpos + 6); RawTriangles.Add(r); string s = ""; for (int j = 0; j < l.size; j++) { s += memory[readerpos].ToString("X2") + " "; readerpos++; } } RawTris rt = new RawTris(); rt.RawTriangles = RawTriangles; Mesh.RawTris = rt; }
/// <summary> /// /// </summary> public static bool CheckList(TagReadDataEventArgs e) { //Check dt if EPC already exist. if (BookListing.getBookList().Any(p => p.EPC == e.TagReadData.EpcString)) { return(false); } if (UnknownList.Any(p => p.EPC == e.TagReadData.EpcString)) { var list = UnknownList.First(f => f.EPC == e.TagReadData.EpcString); var index = UnknownList.IndexOf(list); UnknownList[index].timeStamp = e.TagReadData.Time.ToString(); UnknownList[index].RSSI = e.TagReadData.Rssi.ToString(); // double distance = Math.Pow((-30 - Double.Parse(UnknownList[index].RSSI)) / (10 * 2), 10); // UnknownList[index].RSSI = distance.ToString(); Console.WriteLine("[Update Unknown Tag] " + e.TagReadData.EpcString + e.TagReadData.Time.ToString() + " - " + e.TagReadData.Rssi); return(true); } else { addUnknownRFIDItem(e.TagReadData.EpcString, e.TagReadData.Time.ToString(), e.TagReadData.Rssi.ToString()); return(false); } }
public void ReadVerts(byte[] memory) { UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) { l.data[i] = memory[readerpos + i]; } Vertices = new List <Vector3>(); for (int i = 0; i < l.count; i++) { float f1 = BitConverter.ToSingle(memory, readerpos); float f2 = BitConverter.ToSingle(memory, readerpos + 4); float f3 = BitConverter.ToSingle(memory, readerpos + 8); Vertices.Add(new Vector3(f1, f2, f3)); readerpos += l.size; } Verts v = new Verts(); v.Points = Vertices; Mesh.Vertices = v; }
public void ReadkDOPTree(byte[] memory) { UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) { l.data[i] = memory[readerpos + i]; } kdNodes = new List <kDOPNode>(); for (int i = 0; i < l.count; i++) { kDOPNode nd = new kDOPNode(); nd.min = new Vector3(memory[readerpos] / 256f, memory[readerpos + 1] / 256f, memory[readerpos + 2] / 256f); nd.max = new Vector3(memory[readerpos + 3] / 256f, memory[readerpos + 4] / 256f, memory[readerpos + 5] / 256f); kdNodes.Add(nd); for (int j = 0; j < l.size; j++) { readerpos++; } } Mesh.kDOPTree = l; }
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) { _altChar = '?'; if (!UnknownList.Any(one => one.Index == index)) { var str = charUnknownHigh.ToString() + charUnknownLow.ToString(); UnknownList.Add(new UnknownString(str, index, string.Format("High: 0x{0:X4} Low: 0x{1:X4}", (int)charUnknownHigh, (int)charUnknownLow))); } _remaining = 1; return(true); }
/// <summary> /// Fallback /// </summary> /// <param name="charUnknown">不明な文字</param> /// <param name="index">インデックス</param> /// <returns></returns> public override bool Fallback(char charUnknown, int index) { var code = (int)charUnknown; bool converted = false; foreach (var keyValue in UTF8toLocalCodeConverter.CustomConvertTable) { if (keyValue.Key.StartsWith("0x")) { if (Convert.ToInt32(keyValue.Key, 16) == code) { if (keyValue.Value.StartsWith("0x")) { _altChar = (char)(Convert.ToInt32(keyValue.Value, 16)); } else { _altChar = keyValue.Value[0]; } converted = true; break; } } else if (keyValue.Key.Length == 1) { if (keyValue.Key[0] == charUnknown) { if (keyValue.Value.StartsWith("0x")) { _altChar = (char)(Convert.ToInt32(keyValue.Value, 16)); } else { _altChar = keyValue.Value[0]; } converted = true; break; } } } if (!converted) { _altChar = '?'; if (!UnknownList.Any(one => one.Index == index)) { UnknownList.Add(new UnknownString(charUnknown.ToString(), index, string.Format("0x{0:X4}", (int)charUnknown))); } } _remaining = 1; return(true); }
private void PopulateInstance() { const char dash = '-'; var propertyName = string.Empty; foreach (var arg in _args) { var ignoreSetValue = string.IsNullOrWhiteSpace(propertyName); if (ignoreSetValue) { if (string.IsNullOrWhiteSpace(arg) || arg[0] != dash) { continue; } propertyName = arg.Substring(1); if (!string.IsNullOrWhiteSpace(propertyName) && propertyName[0] == dash) { propertyName = propertyName.Substring(1); } } var targetProperty = TryGetProperty(propertyName); if (targetProperty == null) { // Skip if the property is not found UnknownList.Add(propertyName); continue; } if (!ignoreSetValue && SetPropertyValue(targetProperty, arg, _instance)) { _updatedList.Add(targetProperty); propertyName = string.Empty; } else if (targetProperty.PropertyType == typeof(bool)) { // If the arg is a boolean property set it to true. targetProperty.SetValue(_instance, true); _updatedList.Add(targetProperty); propertyName = string.Empty; } } if (!string.IsNullOrEmpty(propertyName)) { UnknownList.Add(propertyName); } }
protected override void Parse(Stream s) { base.Parse(s); BinaryReader r = new BinaryReader(s); this.unknown1 = r.ReadByte(); this.unknown2 = r.ReadByte(); if (r.BaseStream.Position != r.BaseStream.Length) { this.listFlag = true; } if (this.listFlag) { this.unknownList1 = new UnknownList(OnResourceChanged, s); } }
protected override Stream UnParse() { var s = base.UnParse(); BinaryWriter w = new BinaryWriter(s); w.Write(this.unknown1); w.Write(this.unknown2); if (this.listFlag) { if (this.unknownList1 == null) { this.unknownList1 = new UnknownList(OnResourceChanged); } this.unknownList1.UnParse(s); } return(s); }
public void ReadEdges(byte[] memory) { UnknownList edges = new UnknownList(); Edges e = new Edges(); edges.size = BitConverter.ToInt32(memory, readerpos); edges.count = BitConverter.ToInt32(memory, readerpos + 4); e.size = edges.size; e.count = edges.count; readerpos += 8; int len = edges.size * edges.count; edges.data = new byte[len]; int datacounter = 0; e.UVSet = new List <UVSet>(); for (int i = 0; i < edges.count; i++) { UVSet uv = new UVSet(); uv.UVs = new List <Vector2>(); uv.x1 = memory[readerpos]; uv.y1 = memory[readerpos + 1]; uv.z1 = memory[readerpos + 2]; uv.w1 = memory[readerpos + 3]; uv.x2 = memory[readerpos + 4]; uv.y2 = memory[readerpos + 5]; uv.z2 = memory[readerpos + 6]; uv.w2 = memory[readerpos + 7]; readerpos += 8; for (int row = 0; row < (edges.size - 8) / 4; row++) { float u = DXHelper.HalfToFloat(BitConverter.ToUInt16(memory, readerpos)); float v = DXHelper.HalfToFloat(BitConverter.ToUInt16(memory, readerpos + 2)); uv.UVs.Add(new Vector2(u, v)); edges.data[datacounter] = memory[readerpos]; readerpos += 4; datacounter += 1; } e.UVSet.Add(uv); } Mesh.Edges = e; }
public bool IsValid() => (_settings.IgnoreUnknownArguments || !UnknownList.Any()) && !RequiredList.Any();
public void ReadVerts(byte[] memory) { UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) l.data[i] = memory[readerpos + i]; Vertices = new List<Vector3>(); for (int i = 0; i < l.count; i++) { float f1 = BitConverter.ToSingle(memory, readerpos); float f2 = BitConverter.ToSingle(memory, readerpos + 4); float f3 = BitConverter.ToSingle(memory, readerpos + 8); Vertices.Add(new Vector3(f1, f2, f3)); readerpos += l.size; } Verts v = new Verts(); v.Points = Vertices; Mesh.Vertices = v; }
public void ReadVerts(byte[] memory) { TreeNode res = new TreeNode("Vertices pos: 0x" + readerpos.ToString("X4")); UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) l.data[i] = memory[readerpos + i]; res.Nodes.Add(new TreeNode("Size : " + l.size.ToString())); res.Nodes.Add(new TreeNode("Count : " + l.count.ToString())); TreeNode t = new TreeNode("Data"); Vertices = new List<Vector3>(); for (int i = 0; i < l.count; i++) { float f1 = BitConverter.ToSingle(memory, readerpos); float f2 = BitConverter.ToSingle(memory, readerpos + 4); float f3 = BitConverter.ToSingle(memory, readerpos + 8); Vertices.Add(new Vector3(f1, f2, f3)); string s = f1 + " " + f2 + " " + f3; readerpos += l.size; t.Nodes.Add(new TreeNode("#" + i.ToString("D4") + " : " + s)); } res.Nodes.Add(t); Verts v = new Verts(); v.Points = Vertices; v.t = res; Mesh.Vertices = v; }
public void ReadEdges(byte[] memory) { TreeNode res = new TreeNode("Edges list, start: 0x" + readerpos.ToString("X4")); UnknownList edges = new UnknownList(); //here using struct unknown list, later we're just filling up data array byte by byte Edges e = new Edges(); edges.size = BitConverter.ToInt32(memory, readerpos); edges.count = BitConverter.ToInt32(memory, readerpos + 4); e.size = edges.size; e.count = edges.count; //quick'n'dirty fix above, need work! <-------------- readerpos += 8; int len = edges.size * edges.count; edges.data = new byte[len]; res.Nodes.Add(new TreeNode("Size : " + edges.size.ToString())); res.Nodes.Add(new TreeNode("Count : " + edges.count.ToString())); TreeNode data = new TreeNode("Data"); int datacounter = 0; e.UVSet = new List<UVSet>(); for (int i = 0; i < edges.count; i++) { UVSet uv = new UVSet(); uv.UVs = new List<Vector2>(); //here adding packed normals uv.x1 = memory[readerpos]; uv.y1 = memory[readerpos + 1]; uv.z1 = memory[readerpos + 2]; uv.w1 = memory[readerpos + 3]; uv.x2 = memory[readerpos + 4]; uv.y2 = memory[readerpos + 5]; uv.z2 = memory[readerpos + 6]; uv.w2 = memory[readerpos + 7]; //string rawdata = ""; //string n1 = packedNorm(readerpos); //string n2 = packedNorm(readerpos + 4); //rawdata = n1 + " " + n2 + " UV Sets: "; // // memory[readerpos].ToString("X2") + " " + // memory[readerpos + 1].ToString("X2") + " " + // memory[readerpos + 2].ToString("X2") + " " + // memory[readerpos + 3].ToString("X2") + " " + // memory[readerpos + 4].ToString("X2") + " " + // memory[readerpos + 5].ToString("X2") + " " + // memory[readerpos + 6].ToString("X2") + " " + // memory[readerpos + 7].ToString("X2") + " " + readerpos += 8; for (int row = 0; row < (edges.size - 8) / 4; row++) { float u = HalfToFloat(BitConverter.ToUInt16(memory, readerpos)); float v = HalfToFloat(BitConverter.ToUInt16(memory, readerpos + 2)); uv.UVs.Add(new Vector2(u, v)); //rawdata += "uv(" + u + " ; " + v + ") "; edges.data[datacounter] = memory[readerpos]; readerpos += 4; datacounter += 1; } e.UVSet.Add(uv); data.Nodes.Add(new TreeNode(i.ToString("d4") + ": " )); } res.Nodes.Add(data); e.t = res; Mesh.Edges = e; }
public void ReadkDOPTree(byte[] memory) { TreeNode res = new TreeNode("kDOP-tree pos: 0x" + readerpos.ToString("X4")); UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) l.data[i] = memory[readerpos + i]; res.Nodes.Add(new TreeNode("Size : " + l.size.ToString())); res.Nodes.Add(new TreeNode("Count : " + l.count.ToString())); TreeNode t = new TreeNode("Data"); kdNodes = new List<kDOPNode>(); for (int i = 0; i < l.count; i++) { kDOPNode nd = new kDOPNode(); nd.min = new Vector3(memory[readerpos] / 256f, memory[readerpos + 1] / 256f, memory[readerpos + 2] / 256f); nd.max = new Vector3(memory[readerpos + 3] / 256f, memory[readerpos + 4] / 256f, memory[readerpos + 5] / 256f); kdNodes.Add(nd); string s = ""; for (int j = 0; j < l.size; j++) { s += (memory[readerpos] / 256f).ToString() + " "; readerpos++; } t.Nodes.Add(new TreeNode("#" + i.ToString("D4") + " : " + s)); } ReadkdNodes(Meshplorer.Preview3D.Cubes[0], memory); res.Nodes.Add(t); l.t = res; Mesh.kDOPTree = l; }
public void ReadRawTris(byte[] memory) { TreeNode res = new TreeNode("Raw triangles pos: 0x" + readerpos.ToString("X4")); UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) l.data[i] = memory[readerpos + i]; res.Nodes.Add(new TreeNode("Size : " + l.size.ToString())); res.Nodes.Add(new TreeNode("Count : " + l.count.ToString())); TreeNode t = new TreeNode("Data"); RawTriangles = new List<RawTriangle>(); for (int i = 0; i < l.count; i++) { RawTriangle r = new RawTriangle(); r.v0 = BitConverter.ToInt16(memory, readerpos); r.v1 = BitConverter.ToInt16(memory, readerpos + 2); r.v2 = BitConverter.ToInt16(memory, readerpos + 4); r.mat = BitConverter.ToInt16(memory, readerpos + 6); RawTriangles.Add(r); string s = ""; for (int j = 0; j < l.size; j++) { s += memory[readerpos].ToString("X2") + " "; readerpos++; } t.Nodes.Add(new TreeNode("#" + i.ToString("D4") + " : " + s)); } res.Nodes.Add(t); RawTris rt = new RawTris(); rt.RawTriangles = RawTriangles; rt.t = res; Mesh.RawTris = rt; }
/// <summary> /// /// </summary> public static void addUnknownRFIDItem(String EPC, String timeStamp, String RSSI) { UnknownList.Add(new UnknownRFID(EPC = EPC, timeStamp = timeStamp.ToString(), RSSI = RSSI)); Console.WriteLine(EPC + " " + timeStamp); }
internal MCPTable(MCP mcp, int index) { MCP = mcp; Index = index; Unknowns = new UnknownList(); }
/// <summary> /// Fallback /// </summary> /// <param name="charUnknown">不明な文字</param> /// <param name="index">インデックス</param> /// <returns></returns> public override bool Fallback(char charUnknown, int index) { var code = (int)charUnknown; switch (code) { // 全角チルダ case 0x301C: _altChar = ((char)0xFF5E); break; // 全角マイナス case 0x2212: _altChar = ((char)0xFF0D); break; // セント case 0x00A2: _altChar = ((char)0xFFE0); break; // ポンド case 0x00A3: _altChar = ((char)0xFFE1); break; // ノット case 0x00AC: _altChar = ((char)0xFFE2); break; case 0x2011: // ハイフン case 0x2013: // – ENダッシュ case 0x2014: // — EMダッシュ _altChar = '-'; break; // 二重線 case 0x2016: _altChar = ((char)0x2225); break; // ゼロ幅スペース case 0x200b: case 0x2007: case 0x2423: _altChar = ' '; break; // 縦線 ¦ case 0x00A6: _altChar = '|'; break; // 二重ハイフン ゠ case 0x30A0: _altChar = '='; break; // ブラケット左 « case 0x00AB: _altChar = '〈'; break; // ブラケット右 » case 0x00BB: _altChar = '〉'; break; // 旧字体・印刷字体 case '俠': _altChar = '侠'; break; case '俱': _altChar = '倶'; break; case '剝': _altChar = '剥'; break; case '吞': _altChar = '呑'; break; case '啞': _altChar = '唖'; break; case '噓': _altChar = '嘘'; break; case '嚙': _altChar = '噛'; break; case '囊': _altChar = '嚢'; break; case '塡': _altChar = '填'; break; case '姸': _altChar = '妍'; break; case '屛': _altChar = '屏'; break; case '屢': _altChar = '屡'; break; case '幷': _altChar = '并'; break; case '搔': _altChar = '掻'; break; case '摑': _altChar = '掴'; break; case '攢': _altChar = '攅'; break; case '杮': _altChar = '柿'; break; case '沪': _altChar = '濾'; break; case '潑': _altChar = '溌'; break; case '瀆': _altChar = '涜'; break; case '焰': _altChar = '焔'; break; case '瞱': _altChar = '曄'; break; case '簞': _altChar = '箪'; break; case '繡': _altChar = '繍'; break; case '繫': _altChar = '繋'; break; case '萊': _altChar = '莱'; break; case '蔣': _altChar = '蒋'; break; case '蟬': _altChar = '蝉'; break; case '蠟': _altChar = '蝋'; break; case '軀': _altChar = '躯'; break; case '醬': _altChar = '醤'; break; case '醱': _altChar = '醗'; break; case '頰': _altChar = '頬'; break; case '顚': _altChar = '顛'; break; case '驒': _altChar = '騨'; break; case '鷗': _altChar = '鴎'; break; case '鹼': _altChar = '鹸'; break; case '麴': _altChar = '麹'; break; case '䇳': _altChar = '箋'; break; case '倂': _altChar = '併'; break; case '卽': _altChar = '即'; break; case '巢': _altChar = '巣'; break; case '徵': _altChar = '徴'; break; case '戾': _altChar = '戻'; break; case '揭': _altChar = '掲'; break; case '擊': _altChar = '撃'; break; case '晚': _altChar = '晩'; break; case '曆': _altChar = '暦'; break; case '槪': _altChar = '概'; break; case '步': _altChar = '歩'; break; case '歷': _altChar = '歴'; break; case '每': _altChar = '毎'; break; case '涉': _altChar = '渉'; break; case '淚': _altChar = '涙'; break; case '渴': _altChar = '渇'; break; case '溫': _altChar = '温'; break; case '狀': _altChar = '状'; break; case '瘦': _altChar = '痩'; break; case '硏': _altChar = '研'; break; case '禱': _altChar = '祷'; break; case '緣': _altChar = '縁'; break; case '虛': _altChar = '虚'; break; case '錄': _altChar = '録'; break; case '鍊': _altChar = '錬'; break; case '鬭': _altChar = '闘'; break; case '麵': _altChar = '麺'; break; case '黃': _altChar = '黄'; break; case '欄': _altChar = '欄'; break; case '廊': _altChar = '廊'; break; case '虜': _altChar = '虜'; break; case '殺': _altChar = '殺'; break; case '類': _altChar = '類'; break; case '侮': _altChar = '侮'; break; case '僧': _altChar = '僧'; break; case '免': _altChar = '免'; break; case '勉': _altChar = '勉'; break; case '勤': _altChar = '勤'; break; case '卑': _altChar = '卑'; break; case '喝': _altChar = '喝'; break; case '嘆': _altChar = '嘆'; break; case '器': _altChar = '器'; break; case '塀': _altChar = '塀'; break; case '墨': _altChar = '墨'; break; case '層': _altChar = '層'; break; case '悔': _altChar = '悔'; break; case '慨': _altChar = '慨'; break; case '憎': _altChar = '憎'; break; case '懲': _altChar = '懲'; break; case '敏': _altChar = '敏'; break; case '既': _altChar = '既'; break; case '暑': _altChar = '暑'; break; case '梅': _altChar = '梅'; break; case '海': _altChar = '海'; break; case '渚': _altChar = '渚'; break; case '漢': _altChar = '漢'; break; case '煮': _altChar = '煮'; break; case '琢': _altChar = '琢'; break; case '碑': _altChar = '碑'; break; case '社': _altChar = '社'; break; case '祉': _altChar = '祉'; break; case '祈': _altChar = '祈'; break; case '祐': _altChar = '祐'; break; case '祖': _altChar = '祖'; break; case '祝': _altChar = '祝'; break; case '禍': _altChar = '禍'; break; case '禎': _altChar = '禎'; break; case '穀': _altChar = '穀'; break; case '突': _altChar = '突'; break; case '節': _altChar = '節'; break; case '練': _altChar = '練'; break; case '繁': _altChar = '繁'; break; case '署': _altChar = '署'; break; case '者': _altChar = '者'; break; case '臭': _altChar = '臭'; break; case '著': _altChar = '著'; break; case '褐': _altChar = '褐'; break; case '視': _altChar = '視'; break; case '謁': _altChar = '謁'; break; case '謹': _altChar = '謹'; break; case '賓': _altChar = '賓'; break; case '贈': _altChar = '贈'; break; case '逸': _altChar = '逸'; break; case '難': _altChar = '難'; break; case '響': _altChar = '響'; break; case '頻': _altChar = '頻'; break; default: _altChar = '?'; if (!UnknownList.Any(one => one.Index == index)) { UnknownList.Add(new UnknownString(charUnknown.ToString(), index, string.Format("0x{0:X4}", (int)charUnknown))); } break; } _remaining = 1; return(true); }
/// <summary> /// /// </summary> public static void RemoveUnknownRFIDItem(UnknownRFID selectedItem) { UnknownList.Remove(UnknownList.Where(i => i.EPC == selectedItem.EPC).Single()); }
public void ReadEdges(byte[] memory) { UnknownList edges = new UnknownList(); Edges e = new Edges(); edges.size = BitConverter.ToInt32(memory, readerpos); edges.count = BitConverter.ToInt32(memory, readerpos + 4); e.size = edges.size; e.count = edges.count; readerpos += 8; int len = edges.size * edges.count; edges.data = new byte[len]; int datacounter = 0; e.UVSet = new List<UVSet>(); for (int i = 0; i < edges.count; i++) { UVSet uv = new UVSet(); uv.UVs = new List<Vector2>(); uv.x1 = memory[readerpos]; uv.y1 = memory[readerpos + 1]; uv.z1 = memory[readerpos + 2]; uv.w1 = memory[readerpos + 3]; uv.x2 = memory[readerpos + 4]; uv.y2 = memory[readerpos + 5]; uv.z2 = memory[readerpos + 6]; uv.w2 = memory[readerpos + 7]; readerpos += 8; for (int row = 0; row < (edges.size - 8) / 4; row++) { float u = DXHelper.HalfToFloat(BitConverter.ToUInt16(memory, readerpos)); float v = DXHelper.HalfToFloat(BitConverter.ToUInt16(memory, readerpos + 2)); uv.UVs.Add(new Vector2(u, v)); edges.data[datacounter] = memory[readerpos]; readerpos += 4; datacounter += 1; } e.UVSet.Add(uv); } Mesh.Edges = e; }
public void ReadRawTris(byte[] memory) { UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) l.data[i] = memory[readerpos + i]; RawTriangles = new List<RawTriangle>(); for (int i = 0; i < l.count; i++) { RawTriangle r = new RawTriangle(); r.v0 = BitConverter.ToInt16(memory, readerpos); r.v1 = BitConverter.ToInt16(memory, readerpos + 2); r.v2 = BitConverter.ToInt16(memory, readerpos + 4); r.mat = BitConverter.ToInt16(memory, readerpos + 6); RawTriangles.Add(r); string s = ""; for (int j = 0; j < l.size; j++) { s += memory[readerpos].ToString("X2") + " "; readerpos++; } } RawTris rt = new RawTris(); rt.RawTriangles = RawTriangles; Mesh.RawTris = rt; }
internal MCGTable(MCG mcg, int index) { MCG = mcg; Index = index; Unknowns = new UnknownList(); }
public override void ReadDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("Data", false, out subEle)) { if (Data == null) { Data = new DialogResponseData(); } Data.ReadXML(subEle, master); } if (ele.TryPathTo("Quest", false, out subEle)) { if (Quest == null) { Quest = new RecordReference(); } Quest.ReadXML(subEle, master); } if (ele.TryPathTo("Topic", false, out subEle)) { if (Topic == null) { Topic = new RecordReference(); } Topic.ReadXML(subEle, master); } if (ele.TryPathTo("PreviousDialogResponse", false, out subEle)) { if (PreviousDialogResponse == null) { PreviousDialogResponse = new RecordReference(); } PreviousDialogResponse.ReadXML(subEle, master); } if (ele.TryPathTo("LearnedTopics", false, out subEle)) { if (LearnedTopics == null) { LearnedTopics = new List <RecordReference>(); } foreach (XElement e in subEle.Elements()) { RecordReference tempNAME = new RecordReference(); tempNAME.ReadXML(e, master); LearnedTopics.Add(tempNAME); } } if (ele.TryPathTo("Responses", false, out subEle)) { if (Responses == null) { Responses = new List <Response>(); } foreach (XElement e in subEle.Elements()) { Response tempTRDT = new Response(); tempTRDT.ReadXML(e, master); Responses.Add(tempTRDT); } } if (ele.TryPathTo("Conditions", false, out subEle)) { if (Conditions == null) { Conditions = new List <Condition>(); } foreach (XElement e in subEle.Elements()) { Condition tempCTDA = new Condition(); tempCTDA.ReadXML(e, master); Conditions.Add(tempCTDA); } } if (ele.TryPathTo("Choices", false, out subEle)) { if (Choices == null) { Choices = new List <RecordReference>(); } foreach (XElement e in subEle.Elements()) { RecordReference tempTCLT = new RecordReference(); tempTCLT.ReadXML(e, master); Choices.Add(tempTCLT); } } if (ele.TryPathTo("LinkedFromList", false, out subEle)) { if (LinkedFromList == null) { LinkedFromList = new List <RecordReference>(); } foreach (XElement e in subEle.Elements()) { RecordReference tempTCLF = new RecordReference(); tempTCLF.ReadXML(e, master); LinkedFromList.Add(tempTCLF); } } if (ele.TryPathTo("UnknownList", false, out subEle)) { if (UnknownList == null) { UnknownList = new List <RecordReference>(); } foreach (XElement e in subEle.Elements()) { RecordReference tempTCFU = new RecordReference(); tempTCFU.ReadXML(e, master); UnknownList.Add(tempTCFU); } } if (ele.TryPathTo("BeginScript", false, out subEle)) { if (BeginScript == null) { BeginScript = new EmbeddedScript(); } BeginScript.ReadXML(subEle, master); } if (ele.TryPathTo("EndScript", false, out subEle)) { if (EndScript == null) { EndScript = new DialogEndScript(); } EndScript.ReadXML(subEle, master); } if (ele.TryPathTo("UnusedSound", false, out subEle)) { if (UnusedSound == null) { UnusedSound = new RecordReference(); } UnusedSound.ReadXML(subEle, master); } if (ele.TryPathTo("Prompt", false, out subEle)) { if (Prompt == null) { Prompt = new SimpleSubrecord <String>(); } Prompt.ReadXML(subEle, master); } if (ele.TryPathTo("Speaker", false, out subEle)) { if (Speaker == null) { Speaker = new RecordReference(); } Speaker.ReadXML(subEle, master); } if (ele.TryPathTo("RelatedSkillOrPerk", false, out subEle)) { if (RelatedSkillOrPerk == null) { RelatedSkillOrPerk = new RecordReference(); } RelatedSkillOrPerk.ReadXML(subEle, master); } if (ele.TryPathTo("SpeechChallenge", false, out subEle)) { if (SpeechChallenge == null) { SpeechChallenge = new SimpleSubrecord <SpeechChallengeType>(); } SpeechChallenge.ReadXML(subEle, master); } }
/// <summary> /// /// </summary> public static void RemoveALL() { UnknownList.Clear(); }
public void ReadkDOPTree(byte[] memory) { UnknownList l = new UnknownList(); l.size = BitConverter.ToInt32(memory, readerpos); l.count = BitConverter.ToInt32(memory, readerpos + 4); readerpos += 8; int len = l.size * l.count; l.data = new byte[len]; for (int i = 0; i < len; i++) l.data[i] = memory[readerpos + i]; kdNodes = new List<kDOPNode>(); for (int i = 0; i < l.count; i++) { kDOPNode nd = new kDOPNode(); nd.min = new Vector3(memory[readerpos] / 256f, memory[readerpos + 1] / 256f, memory[readerpos + 2] / 256f); nd.max = new Vector3(memory[readerpos + 3] / 256f, memory[readerpos + 4] / 256f, memory[readerpos + 5] / 256f); kdNodes.Add(nd); for (int j = 0; j < l.size; j++) { readerpos++; } } Mesh.kDOPTree = l; }
public override void ReadData(ESPReader reader, long dataEnd) { while (reader.BaseStream.Position < dataEnd) { string subTag = reader.PeekTag(); switch (subTag) { case "DATA": if (Data == null) { Data = new DialogResponseData(); } Data.ReadBinary(reader); break; case "QSTI": if (Quest == null) { Quest = new RecordReference(); } Quest.ReadBinary(reader); break; case "TPIC": if (Topic == null) { Topic = new RecordReference(); } Topic.ReadBinary(reader); break; case "PNAM": if (PreviousDialogResponse == null) { PreviousDialogResponse = new RecordReference(); } PreviousDialogResponse.ReadBinary(reader); break; case "NAME": if (LearnedTopics == null) { LearnedTopics = new List <RecordReference>(); } RecordReference tempNAME = new RecordReference(); tempNAME.ReadBinary(reader); LearnedTopics.Add(tempNAME); break; case "TRDT": if (Responses == null) { Responses = new List <Response>(); } Response tempTRDT = new Response(); tempTRDT.ReadBinary(reader); Responses.Add(tempTRDT); break; case "CTDA": if (Conditions == null) { Conditions = new List <Condition>(); } Condition tempCTDA = new Condition(); tempCTDA.ReadBinary(reader); Conditions.Add(tempCTDA); break; case "TCLT": if (Choices == null) { Choices = new List <RecordReference>(); } RecordReference tempTCLT = new RecordReference(); tempTCLT.ReadBinary(reader); Choices.Add(tempTCLT); break; case "TCLF": if (LinkedFromList == null) { LinkedFromList = new List <RecordReference>(); } RecordReference tempTCLF = new RecordReference(); tempTCLF.ReadBinary(reader); LinkedFromList.Add(tempTCLF); break; case "TCFU": if (UnknownList == null) { UnknownList = new List <RecordReference>(); } RecordReference tempTCFU = new RecordReference(); tempTCFU.ReadBinary(reader); UnknownList.Add(tempTCFU); break; case "SCHR": if (BeginScript == null) { BeginScript = new EmbeddedScript(); } BeginScript.ReadBinary(reader); break; case "NEXT": if (EndScript == null) { EndScript = new DialogEndScript(); } EndScript.ReadBinary(reader); break; case "SNDD": if (UnusedSound == null) { UnusedSound = new RecordReference(); } UnusedSound.ReadBinary(reader); break; case "RNAM": if (Prompt == null) { Prompt = new SimpleSubrecord <String>(); } Prompt.ReadBinary(reader); break; case "ANAM": if (Speaker == null) { Speaker = new RecordReference(); } Speaker.ReadBinary(reader); break; case "KNAM": if (RelatedSkillOrPerk == null) { RelatedSkillOrPerk = new RecordReference(); } RelatedSkillOrPerk.ReadBinary(reader); break; case "DNAM": if (SpeechChallenge == null) { SpeechChallenge = new SimpleSubrecord <SpeechChallengeType>(); } SpeechChallenge.ReadBinary(reader); break; default: throw new Exception(); } } }