private ResourceManager() { zsc_body_male = (ZSC)loadResource("3DDATA/AVATAR/LIST_MBODY.ZSC"); zsc_arms_male = (ZSC)loadResource("3DData/Avatar/LIST_MARMS.zsc"); zsc_foot_male = (ZSC)loadResource("3DData/Avatar/LIST_MFOOT.zsc"); zsc_face_male = (ZSC)loadResource("3DData/Avatar/LIST_MFACE.zsc"); zsc_hair_male = (ZSC)loadResource("3DData/Avatar/LIST_MHAIR.zsc"); zsc_cap_male = (ZSC)loadResource("3DData/Avatar/LIST_MCAP.zsc"); zsc_body_female = (ZSC)loadResource("3DData/Avatar/LIST_WBODY.zsc"); zsc_arms_female = (ZSC)loadResource("3DData/Avatar/LIST_WARMS.zsc"); zsc_foot_female = (ZSC)loadResource("3DData/Avatar/LIST_WFOOT.zsc"); zsc_face_female = (ZSC)loadResource("3DData/Avatar/LIST_WFACE.zsc"); zsc_hair_female = (ZSC)loadResource("3DData/Avatar/LIST_WHAIR.zsc"); zsc_cap_female = (ZSC)loadResource("3DData/Avatar/LIST_WCAP.zsc"); zsc_back = (ZSC)loadResource("3DData/Avatar/LIST_BACK.zsc"); zsc_faceItem = (ZSC)loadResource("3DData/Avatar/LIST_FACEIEM.zsc"); zsc_weapon = (ZSC)loadResource("3DDATA/WEAPON/LIST_WEAPON.zsc"); zsc_subweapon = (ZSC)loadResource("3DDATA/WEAPON/LIST_SUBWPN.zsc"); stb_animation_list = (STB)loadResource("3Ddata/STB/FILE_MOTION.STB"); stb_animation_type = (STB)loadResource("3DDATA/STB/TYPE_MOTION.STB"); stb_weapon_list = (STB)loadResource("3DDATA/STB/LIST_WEAPON.STB"); stb_cap_list = (STB)loadResource("3DDATA/STB/LIST_CAP.STB"); stb_hair_list = (STB)loadResource("3DDATA/STB/LIST_HAIR.STB"); cache = new Cache(this, CACHE_SIZE); }
private void Button_Click(object sender, RoutedEventArgs e) { STB user_Sec = new STB { stb1 = it.Text.ToString(), }; db.GetTable <STB>().InsertOnSubmit(user_Sec); db.SubmitChanges(); }
private void LoadMapsName() { STB sTB = ContentManager.Instance().GetSTB("3DDATA\\STB\\LIST_ZONE.STB"); STL sTL = ContentManager.Instance().GetSTL("3DDATA\\STB\\LIST_ZONE_S.STL"); this.UpdateStatus("Loading Maps Name", -1); this.SetProgressCount(sTL.entryCount); for (int i = 0; i < sTL.entryCount; i++) { MainForm.MapInfo item = new MainForm.MapInfo(sTL.entry[i].text[1], (int)sTL.entry[i].ID); this.listBoxMap.Items.Add(item); this.PerformStepProgress(); } this.ResetProgress(); }
public void HideButtons() { foreach (GameObject Tower_Slot in TowerSlots) { foreach (GameObject btn in Tower_Slot.transform.GetChild(0).transform.GetChild(0).GetComponent <TowerController>().Buttons_) { btn.SetActive(false); } foreach (GameObject STB in GameObject.FindGameObjectsWithTag("SpawnTowerButton")) { STB.GetComponent <TowerController>().TowerParent.transform.GetChild(1).GetComponent <RangeIndicatorController>().switchRangeIndicatorOff(); } } }
public STB GetSTB(string name) { STB result; if (!this.STBs.Contains(name)) { STB sTB = new STB(); sTB.Load(ContentManager.rootPath + name, ClientType.IROSE); this.STBs.Add(name, sTB); result = sTB; } else { result = (STB)this.STBs[name]; } return(result); }
public void Load(int mapIndex) { ContentManager.Instance().ClearMapData(); STB sTB = ContentManager.Instance().GetSTB("3DDATA\\STB\\LIST_ZONE.STB"); string cellValue = sTB.GetCellValue <string>(mapIndex, 2); string cellValue2 = sTB.GetCellValue <string>(mapIndex, 13); string cellValue3 = sTB.GetCellValue <string>(mapIndex, 12); this.mapFolder = Directory.GetParent(ContentManager.GetRootPath() + cellValue).FullName + "\\"; this.minSizeX = sTB.GetCellValue <int>(mapIndex, 10); this.minSizeY = sTB.GetCellValue <int>(mapIndex, 11); this.maxSizeY = this.minSizeY; this.maxSizeX = this.minSizeX; while (File.Exists(string.Concat(new object[] { this.mapFolder, this.maxSizeX, "_", this.minSizeY, ".HIM" }))) { this.maxSizeX++; } this.maxSizeX--; while (File.Exists(string.Concat(new object[] { this.mapFolder, this.minSizeX, "_", this.maxSizeY, ".HIM" }))) { this.maxSizeY++; } this.maxSizeY--; this.terrain = new Terrain(this.graphics); this.terrain.Load(cellValue, cellValue2, cellValue3, this.mapFolder, this.minSizeX, this.minSizeY, this.maxSizeX, this.maxSizeY); }
void CreateTextureImage() { byte[] texData = File.ReadAllBytes(image); int width; int height; int comp; var pixels = STB.Load(texData, out width, out height, out comp, 4); long imageSize = width * height * 4; VkBuffer stagingBuffer; VkDeviceMemory stagingBufferMemory; CreateBuffer(imageSize, VkBufferUsageFlags.TransferSrcBit, VkMemoryPropertyFlags.HostVisibleBit | VkMemoryPropertyFlags.HostCoherentBit, out stagingBuffer, out stagingBufferMemory); var data = stagingBufferMemory.Map(0, imageSize); Interop.Copy(pixels, data, (int)imageSize); stagingBufferMemory.Unmap(); CreateImage(width, height, VkFormat.R8G8B8A8_Unorm, VkImageTiling.Optimal, VkImageUsageFlags.TransferDstBit | VkImageUsageFlags.SampledBit, VkMemoryPropertyFlags.DeviceLocalBit, out textureImage, out textureImageMemory); TransitionImageLayout(textureImage, VkFormat.R8G8B8A8_Unorm, VkImageLayout.Undefined, VkImageLayout.TransferDstOptimal); CopyBufferToImage(stagingBuffer, textureImage, width, height); TransitionImageLayout(textureImage, VkFormat.R8G8B8A8_Unorm, VkImageLayout.TransferDstOptimal, VkImageLayout.ShaderReadOnlyOptimal); stagingBuffer.Dispose(); stagingBufferMemory.Dispose(); }
/// <summary>Constructor /// </summary> /// <param name="connector">serial connector</param> /// <param name="exec_func">functions flag to be executed /// (e.g. p2def.EX_FACE | p2def.EX_AGE )</param> /// <param name="use_stabilizer">use_stb (bool): use STB library</param> /// <returns> void public HVCP2Api(Connector connector, int exec_func, bool use_stabilizer)</returns> public HVCP2Api(Connector connector, int exec_func, bool use_stabilizer) { bool _use_stb; this._hvc_p2_wrapper = new HVCP2Wrapper(connector); // Disable to use STB if using Hand detection only. if ((use_stabilizer == p2def.USE_STB_ON) && (exec_func == p2def.EX_HAND)) { _use_stb = p2def.USE_STB_OFF; } else { _use_stb = use_stabilizer; } this.use_stb = _use_stb; // Adds face flag if using facial estimation function if ((exec_func & (p2def.EX_DIRECTION | p2def.EX_AGE | p2def.EX_GENDER | p2def.EX_GAZE | p2def.EX_BLINK | p2def.EX_RECOGNITION | p2def.EX_EXPRESSION)) != 0x00) { exec_func |= p2def.EX_FACE + p2def.EX_DIRECTION; } this._exec_func = exec_func; var stb_lib_name = "libSTB.dll"; if (this.use_stb == true) { this._stb = new STB(stb_lib_name, exec_func); } }
protected int getSymbolValue( ST symbol, ref string symbolKind, ref SectionType st, ref bool local) { string s = "none"; st = SectionType.None; STB binding = (STB)((symbol.info >> 4) & 0x0f); if (binding == STB.WEAK) { Debug.WriteLine(String.Format( "weak binding for symbol ({0}) unsupported", symbol.name)); symbolKind = s; return(0); } local = (binding != STB.GLOBAL); SHN sectNum = (SHN)symbol.shndx; if (sectNum == SHN.UNDEF) { s = "external"; } else if ((uint)sectNum < (uint)SHN.LOPROC) { byte[] htentry = sectionHeaderTable[(uint)sectNum]; uint sectNameIx = getInt32(htentry, 0); s = getString(sectNameIx); } else if (sectNum == SHN.ABS) { s = "absolute"; // for symbols with absolute addresses } else if (sectNum == SHN.COMMON) { s = "common"; // for COMM symbols } else { Debug.WriteLine(String.Format( "Unhandled symbol type (shndx=0x{0:X})", (uint)sectNum)); symbolKind = s; return(0); } if (trace > 0) { Debug.WriteLine(String.Format( " symbol {0}: kind = {1} value=0x{2:X} size=0x{3:X}", symbol.name, s, symbol.value, symbol.size)); } switch (s) { case ".text": case ".text.hot": case ".text.unlikely": st = SectionType.Text; break; case ".data": st = SectionType.Data; break; case ".rodata": st = SectionType.Data; break; case ".rodata.str1.4": st = SectionType.Data; break; case ".bss": case "common": st = SectionType.Bss; break; case "absolute": st = SectionType.Abs; break; case "external": af.DefineExternal(symbol.name); break; case "none": case ".debug_abbrev": case ".debug_line": break; default: Debug.WriteLine(String.Format( "Unsupported section type {0}", s)); break; } symbolKind = s; int offset = (int)symbol.value; if (s == ".rodata.str1.4") { offset += roDataSize; } if (s == ".data") { offset += roDataSize + roStrlDataSize; } return(offset); }
public STB GetSTB(string name) { STB result; if (!this.STBs.Contains(name)) { STB sTB = new STB(); sTB.Load(ContentManager.rootPath + name, ClientType.IROSE); this.STBs.Add(name, sTB); result = sTB; } else { result = (STB)this.STBs[name]; } return result; }