Example #1
0
        private void ReadTextures()
        {
            // This calculates the number of textures in the lump, and creates a new texture
            // object inside of the texturelump's list for each of them.
            // Note that these aren't actually the texture graphics themselves, they're definitions
            // for getting the texture from an external source.
            BSP.BaseStream.Seek(header.Directory[1].Offset, SeekOrigin.Begin);
            // A texture is 72 bytes, so we use 72 to calculate the number of textures in the lump
            int textureCount = header.Directory[1].Length / 72;

            textureLump = new TextureLump(textureCount);
            for (int i = 0; i < textureCount; i++)
            {
                textureLump.Textures[i] = new Texture(new string(BSP.ReadChars(64)), BSP.ReadInt32(), BSP.ReadInt32());
            }
        }
Example #2
0
 private void ReadTextures()
 {
     // This calculates the number of textures in the lump, and creates a new texture
     // object inside of the texturelump's list for each of them.
     // Note that these aren't actually the texture graphics themselves, they're definitions
     // for getting the texture from an external source.
     BSP.BaseStream.Seek(header.Directory [1].Offset, SeekOrigin.Begin);
     // A texture is 72 bytes, so we use 72 to calculate the number of textures in the lump
     int textureCount = header.Directory [1].Length / 72;
     textureLump = new TextureLump(textureCount);
     for (int i = 0; i < textureCount; i++)
     {
         textureLump.Textures [i] = new Texture(new string(BSP.ReadChars(64)), BSP.ReadInt32(), BSP.ReadInt32());
     }
 }