Example #1
0
        public static void glNitroBindTextures(HBDF b, int offset)
        {
            if (b.TEXSBlocks.Length == 0)
            {
                return;
            }
            int num = 0;

            foreach (HBDF.MDLFBlock.TextureBlock texture in b.MDLFBlocks[0].Textures)
            {
                string str    = b.MDLFBlocks[0].Names.Strings[(int)b.MDLFBlocks[0].NrMaterials + num * 2 + 1];
                int    index1 = 0;
                for (int index2 = 0; index2 < b.TEXSBlocks[0].TEXOBlocks.Length; ++index2)
                {
                    if (b.TEXSBlocks[0].TEXOBlocks[index2].TexName.Name == str)
                    {
                        index1 = index2;
                        break;
                    }
                }
                if (b.TEXSBlocks[0].TEXOBlocks[index1].PalName != null)
                {
                    GlNitro2.glNitroTexImage2D(b.TEXSBlocks[0].GetIMGOByName(b.TEXSBlocks[0].TEXOBlocks[index1].TexName.Name).ToBitmap(b.TEXSBlocks[0].GetPLTOByName(b.TEXSBlocks[0].TEXOBlocks[index1].PalName.Name)), texture, num + offset);
                }
                else
                {
                    GlNitro2.glNitroTexImage2D(b.TEXSBlocks[0].GetIMGOByName(b.TEXSBlocks[0].TEXOBlocks[index1].TexName.Name).ToBitmap((HBDF.TEXSBlock.PLTOBlock)null), texture, num + offset);
                }
                ++num;
            }
        }
Example #2
0
        public static void glNitroBindTextures(BMD b, int offset)
        {
            int num = 1;

            foreach (BMD.BMDMaterial material in b.Materials)
            {
                if (material.TexID == -1)
                {
                    ++num;
                }
                else if (material.PalID != -1)
                {
                    GlNitro2.glNitroTexImage2D(b.Textures[material.TexID].ToBitmap(b.Palettes[material.PalID]), material, num++);
                }
                else
                {
                    GlNitro2.glNitroTexImage2D(b.Textures[material.TexID].ToBitmap((BMD.BMDPalette)null), material, num++);
                }
            }
        }