public void findNullTextures() { //make a list of textures that need to be loaded from wad files TexInfoClass[] texinfo = new TexInfoClass[NumTexLoadFromWad]; //iterate miptexLump and add a TexInfoClass for each null texture we need to load int IndexOfTexinfo = 0; for (int j = 0; j < miptexLump.Length; j++) //!!!!!!!!!! do this in the load miptexLump method instead!!!!!!!!!!!!!!!!!! { if (miptexLump [j].texture == null) { texinfo [IndexOfTexinfo] = new TexInfoClass(miptexLump [j].name, j); IndexOfTexinfo++; } } //next get the string of wads we need string[] wadFileNames; myParser = new EntityParser(entityLump.rawEntities); Dictionary <string, string> mylist = myParser.ReadEntity(); string tempString; if (mylist.ContainsKey("wad")) { tempString = mylist ["wad"]; wadFileNames = tempString.Split(';'); for (int i = 0; i < wadFileNames.Length; i++) { wadFileNames [i] = wadFileNames [i].Substring(wadFileNames [i].LastIndexOf("\\") + 1); //remove unwanted text if (wadFileNames [i].Length > 3) { Debug.Log(wadFileNames [i].ToString()); LoadTextureFromWad(wadFileNames [i], texinfo); } } } else { Debug.Log("no textures to load from wad, or no wad key found in bsp"); } }
public void findNullTextures () { //make a list of textures that need to be loaded from wad files TexInfoClass[] texinfo = new TexInfoClass[NumTexLoadFromWad]; //iterate miptexLump and add a TexInfoClass for each null texture we need to load int IndexOfTexinfo = 0; for (int j=0; j<miptexLump.Length; j++)//!!!!!!!!!! do this in the load miptexLump method instead!!!!!!!!!!!!!!!!!! { if (miptexLump [j].texture == null) { texinfo [IndexOfTexinfo] = new TexInfoClass (miptexLump [j].name, j); IndexOfTexinfo++; } } //next get the string of wads we need string[] wadFileNames; myParser = new EntityParser (entityLump.rawEntities); Dictionary<string, string> mylist = myParser.ReadEntity (); string tempString; if (mylist.ContainsKey ("wad")) { tempString = mylist ["wad"]; wadFileNames = tempString.Split (';'); for (int i =0; i<wadFileNames.Length; i++) { wadFileNames [i] = wadFileNames [i].Substring (wadFileNames [i].LastIndexOf ("\\") + 1);//remove unwanted text if (wadFileNames [i].Length > 3) { Debug.Log (wadFileNames [i].ToString ()); LoadTextureFromWad (wadFileNames [i], texinfo); } } } else { Debug.Log ("no textures to load from wad, or no wad key found in bsp"); } }