Examples of TextureMap


Examples of edu.cmu.cs.stage3.alice.core.TextureMap

        edu.cmu.cs.stage3.alice.scenegraph.Appearance sgAppearance = sgVisual.getFrontFacingAppearance();
        edu.cmu.cs.stage3.alice.scenegraph.Geometry sgGeometry = sgVisual.getGeometry();
        if( sgAppearance != null ) {
          edu.cmu.cs.stage3.alice.scenegraph.TextureMap sgTextureMap = sgAppearance.getDiffuseColorMap();
          if( sgTextureMap != null ) {
            TextureMap diffuseColorMap = new TextureMap();
            diffuseColorMap.setParent( model );
            diffuseColorMap.image.set( sgTextureMap.getImage() );
            diffuseColorMap.format.set( new Integer( sgTextureMap.getFormat() ) );
            model.diffuseColorMap.set( diffuseColorMap );
            model.textureMaps.add( diffuseColorMap );
          }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

                setupSprite(i);
        }
       
        public void registerIcons(IIconRegister register)
        {
            TextureMap textureMap = (TextureMap)register;
           
            if(TextureUtils.refreshTexture(textureMap, resource.getResourcePath()))
            {
                reloadTexture();
                for(int i = 0; i < sprites.length; i++)
                    if(sprites[i] != null)
                        textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
            }
            else
            {
                for(int i : newSprites)
                    textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
            }
            newSprites.clear();
        }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

    public static void bindAtlas(int atlasIndex) {
        engine().bindTexture(atlasIndex == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
    }

    public static IIcon getBlankIcon(int size, IIconRegister iconRegister) {
        TextureMap textureMap = (TextureMap) iconRegister;
        String s = "blank_" + size;
        if (textureMap.getTextureExtry(s) == null) {
            TextureSpecial icon = new TextureSpecial(s).blank(size);
            textureMap.setTextureEntry(s, icon);
        }
        return iconRegister.registerIcon(s);
    }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

        }
        return iconRegister.registerIcon(s);
    }

    public static TextureSpecial getTextureSpecial(IIconRegister iconRegister, String name) {
        TextureMap textureMap = (TextureMap) iconRegister;
        IIcon entry = textureMap.getTextureExtry(name);
        if (entry != null)
            throw new IllegalStateException("Texture: " + name + " is already registered");

        TextureSpecial icon = new TextureSpecial(name);
        textureMap.setTextureEntry(name, icon);
        return icon;
    }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

    engine().bindTexture(atlasIndex == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
  }

  public static IIcon getBlankIcon(int size, IIconRegister iconRegister) {

    TextureMap textureMap = (TextureMap) iconRegister;
    String s = "blank_" + size;
    if (textureMap.getTextureExtry(s) == null) {
      TextureSpecial icon = new TextureSpecial(s).blank(size);
      textureMap.setTextureEntry(s, icon);
    }
    return iconRegister.registerIcon(s);
  }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

    return iconRegister.registerIcon(s);
  }

  public static TextureSpecial getTextureSpecial(IIconRegister iconRegister, String name) {

    TextureMap textureMap = (TextureMap) iconRegister;
    IIcon entry = textureMap.getTextureExtry(name);
    if (entry != null) {
      throw new IllegalStateException("Texture: " + name + " is already registered");
    }

    TextureSpecial icon = new TextureSpecial(name);
    textureMap.setTextureEntry(name, icon);
    return icon;
  }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

    }

    @Override
    public void registerIcons(IIconRegister register) {

      TextureMap textureMap = (TextureMap) register;

      if (TextureUtils.refreshTexture(textureMap, resource.getResourcePath())) {
        reloadTexture();
        for (int i = 0; i < sprites.length; i++) {
          if (sprites[i] != null) {
            textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
          }
        }
      } else {
        for (int i : newSprites) {
          textureMap.setTextureEntry(sprites[i].getIconName(), sprites[i]);
        }
      }
      newSprites.clear();
    }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

    @SideOnly(Side.CLIENT)
    @Override
    public void registerBlockIcons(IIconRegister register) {
        if (register instanceof TextureMap) { // should always be true (...but
            // you never know)
            TextureMap map = (TextureMap) register;
            for (int i = 0; i < 16; i++) {
                if (isValid(i)) {

                    // Registering custom icon classes

                    // name of custom icon ( must equal getIconName() )
                    String name = TextureOre.getDerivedName(entry[i].texture);
                    // see if there's already an icon of that name
                    TextureAtlasSprite texture = map.getTextureExtry(name);
                    if (texture == null) {
                        // if not create one and put it in the register
                        texture = new TextureOre(entry[i]);
                        map.setTextureEntry(name, texture);
                    }

                    icons[i] = map.getTextureExtry(name);
                }
            }
        }
    }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

    public static IIcon[] unstitchIcons(IIconRegister iconRegister, String name, int numIcons) {
        return unstitchIcons(iconRegister, name, numIcons, 1);
    }

    public static IIcon[] unstitchIcons(IIconRegister iconRegister, String name, int columns, int rows) {
        TextureMap textureMap = (TextureMap) iconRegister;
        int numIcons = rows * columns;
        IIcon[] icons = new IIcon[numIcons];
        for (int i = 0; i < numIcons; i++) {
            String texName = name + "." + i;
            TextureAtlasSheet texture = new TextureAtlasSheet(texName, i, rows, columns);
            textureMap.setTextureEntry(texName, texture);
            icons[i] = texture;
        }
        return icons;
    }
View Full Code Here

Examples of net.minecraft.client.renderer.texture.TextureMap

  @SubscribeEvent
  @SideOnly(Side.CLIENT)
  public void loadTextures(TextureStitchEvent.Pre evt) {
    if (evt.map.getTextureType() == 0) {
      TextureMap terrainTextures = evt.map;
      FactoryProxyClient.pumpTexture = terrainTextures.registerIcon("buildcraft:pump_tube");
      FactoryProxyClient.drillTexture = terrainTextures.registerIcon("buildcraft:blockDrillTexture");
      FactoryProxyClient.drillHeadTexture = terrainTextures.registerIcon("buildcraft:blockDrillHeadTexture");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.