public List <string> GetBifList() { var list = new List <String>(); foreach (byte[] element in bifList) { list.Add(CGeneric.ConvertByteArrayToString(element)); } return(list); }
public int Get3FIBIndexWithFIBName(string name) { int increm = 0; var b = name.ToUpper().Replace("\0", ""); for (int z = 0; z < ressourcesList.Count(); z++) { var a = CGeneric.ConvertByteArrayToString(ressourcesList[z].ressourceName).ToUpper().Replace("\0", ""); if (a == b) { return(increm); } if (a.EndsWith(".BIF")) { increm++; } } return(-1); }
public CSBF1Scene(byte[] rawData) { this.rawData = rawData; //read sceneNameLength byte[] sceneNameLength = new byte[4]; Array.Copy(rawData, 4, sceneNameLength, 0, sceneNameLength.Length); int sceneLength = CGeneric.ConvertByteArrayToInt(sceneNameLength); //extract sceneName this.sceneName = new byte[sceneLength]; Array.Copy(rawData, 8, sceneName, 0, sceneLength); //decompose scene in 3 parts. byte[] dataWithoutHeader = new Byte[rawData.Length - 8 - sceneLength]; Array.Copy(rawData, 8 + sceneLength, dataWithoutHeader, 0, dataWithoutHeader.Length); this.sceneNameDebug = CGeneric.ConvertByteArrayToString(sceneName); //decompose data of scene ChunkScene(dataWithoutHeader, 8 + sceneLength); //for text, decompose groups of text GroupTextData(); }
//public void AddTexture(int indexScene, string bifName) //{ // //if the texture is already in the sbf, just add the texture to the scene // for(int i = 0; i < bifList.Count; i++) // { // if(bifName == CGeneric.ConvertByteArrayToString(bifList[i]).ToUpper()) // { // scenesList[indexScene].AddNewTextureObject(i); // return; // } // } // //else add before the texture and after add it to the scene // //store the name in lower just because it will be more pretty in the rom :) // bifList.Add(CGeneric.ConvertStringToByteArray(bifName.ToLower())); // scenesList[indexScene].AddNewTextureObject(bifList.Count - 1); //} public string GetBifName(int index) { return(CGeneric.ConvertByteArrayToString(bifList[index])); }