java类net.minecraft.client.renderer.texture.DynamicTexture的实例源码

MapDownloader.java 文件源码 项目:ForgeHax 阅读 23 收藏 0 点赞 0 评论 0
public void downloadMap(@Nullable String fileName, @Nullable Integer scaledRes) {
    if (MC.player == null || !(MC.player.getHeldItemMainhand().getItem() instanceof ItemMap)) return;

    ItemMap map = (ItemMap) MC.player.getHeldItemMainhand().getItem();
    MapData heldMapData = map.getMapData(MC.player.getHeldItemMainhand(), MC.world);

    if (fileName == null) fileName = heldMapData.mapName;

    ResourceLocation location = findResourceLocation(heldMapData.mapName);
    if (location == null) {
        Helper.printMessage("Failed to find ResourceLocation");
        return;
    }

    DynamicTexture texture = (DynamicTexture)MC.getTextureManager().getTexture(location);
    BufferedImage image = dynamicToImage(texture);
    if (scaledRes != null) image = createResizedCopy(image, scaledRes, scaledRes, true);

    saveImage(fileName, image);
}
WaifuESP.java 文件源码 项目:ForgeHax 阅读 15 收藏 0 点赞 0 评论 0
@Override
public void onLoad() {
    MC.addScheduledTask(() -> {
        try {
            BufferedImage image = getImageFromUrl(waifuUrl);
            if (image == null) { LOGGER.warn("Failed to download waifu image"); return; }

            DynamicTexture dynamicTexture = new DynamicTexture(image);
            dynamicTexture.loadTexture(MC.getResourceManager());
            waifu = MC.getTextureManager().getDynamicTextureLocation("WAIFU", dynamicTexture);
        } catch (Exception e) {
            e.printStackTrace();
        }

    });
}
EntityRenderer.java 文件源码 项目:DecompiledMinecraft 阅读 17 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = shaderCount;
    this.useShader = false;
    this.frameCount = 0;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
ShadersTex.java 文件源码 项目:BaseClient 阅读 18 收藏 0 点赞 0 评论 0
public static void initDynamicTexture(int texID, int width, int height, DynamicTexture tex)
{
    MultiTexID multitexid = tex.getMultiTexID();
    int[] aint = tex.getTextureData();
    int i = width * height;
    Arrays.fill(aint, i, i * 2, -8421377);
    Arrays.fill((int[])aint, i * 2, i * 3, (int)0);
    TextureUtil.allocateTexture(multitexid.base, width, height);
    TextureUtil.setTextureBlurMipmap(false, false);
    TextureUtil.setTextureClamped(false);
    TextureUtil.allocateTexture(multitexid.norm, width, height);
    TextureUtil.setTextureBlurMipmap(false, false);
    TextureUtil.setTextureClamped(false);
    TextureUtil.allocateTexture(multitexid.spec, width, height);
    TextureUtil.setTextureBlurMipmap(false, false);
    TextureUtil.setTextureClamped(false);
    GlStateManager.bindTexture(multitexid.base);
}
EntityRenderer.java 文件源码 项目:BaseClient 阅读 21 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = shaderCount;
    this.useShader = false;
    this.frameCount = 0;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
EntityRenderer.java 文件源码 项目:BaseClient 阅读 22 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) {
    this.shaderIndex = shaderCount;
    this.useShader = false;
    this.frameCount = 0;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i) {
        for (int j = 0; j < 32; ++j) {
            float f = (float) (j - 16);
            float f1 = (float) (i - 16);
            float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
ImageManager.java 文件源码 项目:Lithium-Forge 阅读 25 收藏 0 点赞 0 评论 0
@SideOnly(Side.CLIENT)
public static void handleImage(LImage img) {
    if (isImageHandled(img)) {
        return;
    }
    try {
        LithiumMod.log("Loading image for control with UUID[" + img.getUUID() + "].");
        handledControls.add(img.getUUID());
        bufferedImages.put(img.getUUID(), new DynamicTexture(ImageIO.read(new URL(img.getImageURL()))));
        LithiumMod.log("Finished loading image for control with UUID[" + img.getUUID() + "].");

    } catch (IOException e) {
        LithiumMod.log("An error occured while trying to load image for control with UUID[" + img.getUUID() + "].");
        e.printStackTrace();
    }
}
ImageRenderer.java 文件源码 项目:Lithium-Forge 阅读 20 收藏 0 点赞 0 评论 0
@SideOnly(Side.CLIENT)
@Override
public void renderLithiumControl(LImage control, GuiScreen gui) {
    Point loc = NewLithiumGUI.centerControl(control);

    //Ask ImageManager to give us a dynamic texture
    DynamicTexture imageTexture = ImageManager.getDynamicTexture(control);
    if (imageTexture != null) {
        //Get Minecraft's texture manager
        TextureManager textureManager = ModCoderPackUtils.getTextureManager();

        //Bind the texture. (In other words, tell Minecraft to use this texture)
        textureManager.bindTexture(textureManager.getDynamicTextureLocation(control.getUUID().toString(), imageTexture));
        //Correct colors
        GlStateManager.color(1, 1, 1, 1);
        //Draw the image to the screen
        Gui.drawModalRectWithCustomSizedTexture(loc.getX(), loc.getY(), 0.0F, 0.0F, control.getSize().getWidth(), control.getSize().getHeight(), control.getSize().getWidth(), control.getSize().getHeight());
    }
}
ShadersTex.java 文件源码 项目:Backmemed 阅读 20 收藏 0 点赞 0 评论 0
public static void initDynamicTexture(int texID, int width, int height, DynamicTexture tex)
{
    MultiTexID multitexid = tex.getMultiTexID();
    int[] aint = tex.getTextureData();
    int i = width * height;
    Arrays.fill(aint, i, i * 2, -8421377);
    Arrays.fill((int[])aint, i * 2, i * 3, (int)0);
    TextureUtil.allocateTexture(multitexid.base, width, height);
    TextureUtil.setTextureBlurMipmap(false, false);
    TextureUtil.setTextureClamped(false);
    TextureUtil.allocateTexture(multitexid.norm, width, height);
    TextureUtil.setTextureBlurMipmap(false, false);
    TextureUtil.setTextureClamped(false);
    TextureUtil.allocateTexture(multitexid.spec, width, height);
    TextureUtil.setTextureBlurMipmap(false, false);
    TextureUtil.setTextureClamped(false);
    GlStateManager.bindTexture(multitexid.base);
}
EntityRenderer.java 文件源码 项目:Backmemed 阅读 20 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = SHADER_COUNT;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
EntityRenderer.java 文件源码 项目:CustomWorldGen 阅读 17 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = SHADER_COUNT;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
SwingWrapper.java 文件源码 项目:Device-Mod-Apps 阅读 17 收藏 0 点赞 0 评论 0
public void render(int x, int y, int mouseX, int mouseY) {
    rc = txt.getDynamicTextureLocation(c.toString(), new DynamicTexture(img));
    if (!frame.isVisible()) frame.setVisible(true);

    if (rc != null) {
        mc.getRenderManager().renderEngine.bindTexture(rc);
        drawRectWithFullTexture(x, y, width, height);
        txt.deleteTexture(rc);
    }
    if (mouseX >= x && mouseY >= y && mouseX < x + this.width && mouseY < y + this.height) {
        if (mouseX != lastMouseX && mouseY != lastMouseY) {
            if (c instanceof BrowserView) {
                Point p = new Point(Math.round(SwingUtils.map(mouseX - x, 0, width, 0, c.getWidth())), Math.round(SwingUtils.map(mouseY - y, 0, height, 0, c.getHeight())));

                Point globalP = p.getLocation();
                SwingUtilities.convertPointToScreen(globalP, c);

                BrowserView view = (BrowserView) c;

                SwingUtils.forwardMouseMoveEvent(view.getBrowser(), p.x, p.y, globalP.x, globalP.y);
            }
        }
    }
    lastMouseX = mouseX;
    lastMouseY = mouseY;
}
MapUtil.java 文件源码 项目:4Space-5 阅读 19 收藏 0 点赞 0 评论 0
@SideOnly(Side.CLIENT)
   public static void resetClientBody()
   {
    ClientProxyCore.overworldTextureRequestSent = false;
    ClientProxyCore.overworldTexturesValid = false;
    clientRequests.clear();
       File baseFolder = new File(FMLClientHandler.instance().getClient().mcDataDir, "assets/temp");
       if (baseFolder.exists() && baseFolder.isDirectory())
       {
        for (File f : baseFolder.listFiles())
             if (f.isFile()) f.delete();            
       }
    GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(PacketSimple.EnumSimplePacket.S_REQUEST_OVERWORLD_IMAGE, new Object[] {}));
    DrawGameScreen.reusableMap = new DynamicTexture(MapUtil.SIZE_STD2, MapUtil.SIZE_STD2);
    MapUtil.biomeColours.clear();
    setupColours();
}
EntityRenderer.java 文件源码 项目:4Space-5 阅读 18 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_)
{
    this.shaderIndex = shaderCount;
    this.cameraZoom = 1.0D;
    this.prevFrameTime = Minecraft.getSystemTime();
    this.random = new Random();
    this.fogColorBuffer = GLAllocation.createDirectFloatBuffer(16);
    this.mc = p_i45076_1_;
    this.resourceManager = p_i45076_2_;
    this.theMapItemRenderer = new MapItemRenderer(p_i45076_1_.getTextureManager());
    this.itemRenderer = new ItemRenderer(p_i45076_1_);
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = p_i45076_1_.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;
}
QrCodeManager.java 文件源码 项目:RemotecraftMod 阅读 17 收藏 0 点赞 0 评论 0
public void generateQrCode() {
    if (mResourceLocation != null) {
        return;
    }

    BufferedImage bufferedImage = null;
    File imageFile = QRCode.from(mIpAddress).to(ImageType.PNG).withSize(256, 256).file();

    try {
        bufferedImage = ImageIO.read(imageFile);
    } catch (IOException e) {
        e.printStackTrace();
    }

    mResourceLocation = Minecraft.getMinecraft().renderEngine.getDynamicTextureLocation(imageFile.getName(), new DynamicTexture(bufferedImage));
}
RenderChameleonCreeper.java 文件源码 项目:ChameleonCreepersMod 阅读 26 收藏 0 点赞 0 评论 0
public static void convertTextureToGrayScale() throws IOException
{
    IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager();
    try
    {
        BufferedImage vanillaCreeperTextureData = TextureUtil.readBufferedImage(resourceManager.getResource(vanillaCreeperTexture).getInputStream());

        // Do the conversion to grayscale
        BufferedImage creeperTextureData = new BufferedImage(vanillaCreeperTextureData.getWidth(), vanillaCreeperTextureData.getHeight(), BufferedImage.TYPE_USHORT_GRAY);
        Graphics g = creeperTextureData.getGraphics();
        g.drawImage(vanillaCreeperTextureData, 0, 0, null);
        g.dispose();

        DynamicTexture dynamicGrayscaleCreeperTexture = new DynamicTexture(creeperTextureData);

        grayscaleCreeperTexture = new ResourceLocation(ChameleonCreepersMod.MODID, "textures/entity/creeper/chameleoncreeper.png");
        Minecraft.getMinecraft().getTextureManager().loadTexture(grayscaleCreeperTexture, dynamicGrayscaleCreeperTexture);
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
}
OMLModInfo.java 文件源码 项目:OpenModLoader 阅读 14 收藏 0 点赞 0 评论 0
@Override
@Strippable(side = Side.CLIENT)
public ResourceLocation getLogoTexture() {
    if (this.logo == null) {
        try {
            URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation();
            InputStream stream = new URL(url.toString() + "/logo.png").openStream();
            BufferedImage image = ImageIO.read(stream);
            DynamicTexture texture = new DynamicTexture(image);
            this.logo = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("mods/" + getModID(), texture);
            stream.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    return logo;
}
ManifestModInfo.java 文件源码 项目:OpenModLoader 阅读 20 收藏 0 点赞 0 评论 0
@Override
public ResourceLocation getLogoTexture() {
    if (logoTexture == null) {
        if (logoBytes != null || logo != null) {
            try {
                InputStream in;
                if (logoBytes == null) {
                    in = new URL(getModFile().toURI().toURL().toString() + '/' + logo).openStream();
                } else {
                    in = new ByteArrayInputStream(logoBytes);
                }
                BufferedImage image = TextureUtil.readBufferedImage(in);
                DynamicTexture texture = new DynamicTexture(image);
                this.logoTexture = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("mods/" + getModID(), texture);
                in.close();
                logoBytes = null;
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        } else {
            logoTexture = new ResourceLocation("textures/misc/unknown_server.png");
        }
    }
    return logoTexture;
}
SubCommandModelClearCache.java 文件源码 项目:blockbuster 阅读 23 收藏 0 点赞 0 评论 0
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
    TextureManager manager = Minecraft.getMinecraft().renderEngine;
    Map<ResourceLocation, ITextureObject> map = getTextures(manager);

    if (map != null)
    {
        Iterator<Map.Entry<ResourceLocation, ITextureObject>> it = map.entrySet().iterator();

        while (it.hasNext())
        {
            Map.Entry<ResourceLocation, ITextureObject> entry = it.next();

            if (entry.getKey().getResourceDomain().equals("blockbuster.actors") && entry.getValue() instanceof DynamicTexture)
            {
                TextureUtil.deleteTexture(entry.getValue().getGlTextureId());

                it.remove();
            }
        }
    }
}
ConcurrentUtil.java 文件源码 项目:DiscordCE 阅读 16 收藏 0 点赞 0 评论 0
/**
 * Pushes a fetch image request to the queue so that when the image is done being fetched it
 * will be returned to the calling thread
 *
 * @param future The task being waited on
 * @param url The url of the image
 */
public static void pushImageTaskToQueue(Future<BufferedImage> future, String url)
{
    MinecraftEventHandler.queue.add(new AbstractMap.SimpleEntry<>(future, (image) ->
    {
        if (image == null)
        {
            VolatileSettings.icons.remove(url);
            return;
        }

        DynamicTexture t = new DynamicTexture((BufferedImage) image);
        Minecraft mc = Minecraft.getMinecraft();
        VolatileSettings.icons.put(url, mc.getTextureManager().getDynamicTextureLocation(url, t));
    }));
}
EntityRenderer.java 文件源码 项目:Resilience-Client-Source 阅读 23 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_)
{
    this.shaderIndex = shaderCount;
    this.cameraZoom = 1.0D;
    this.prevFrameTime = Minecraft.getSystemTime();
    this.random = new Random();
    this.fogColorBuffer = GLAllocation.createDirectFloatBuffer(16);
    this.mc = p_i45076_1_;
    this.resourceManager = p_i45076_2_;
    this.theMapItemRenderer = new MapItemRenderer(p_i45076_1_.getTextureManager());
    this.itemRenderer = new ItemRenderer(p_i45076_1_);
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = p_i45076_1_.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;
}
DynaTextureProvider.java 文件源码 项目:EnderIOAddons 阅读 13 收藏 0 点赞 0 评论 0
public DynaTextureProvider(TilePMon owner) {
  this.owner = owner;
  this.textureManager = Minecraft.getMinecraft().getTextureManager();
  this.resourceManager = Minecraft.getMinecraft().getResourceManager();

  this.id = EnderIOAddons.DOMAIN + "pmon/x" + owner.xCoord + "y" + owner.yCoord + "z" + owner.zCoord;

  this.dynamicTexture = new DynamicTexture(TEXSIZE, TEXSIZE);
  this.imageData = this.dynamicTexture.getTextureData();
  this.resourceLocation = textureManager.getDynamicTextureLocation(id, this.dynamicTexture);

  for (int i = 0; i < this.imageData.length; ++i) {
    this.imageData[i] = 0;
  }
  loadTextures();
  updateTexture();
  instances.add(this);
}
EntityRenderer.java 文件源码 项目:4Space-1.7 阅读 19 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_)
{
    this.shaderIndex = shaderCount;
    this.cameraZoom = 1.0D;
    this.prevFrameTime = Minecraft.getSystemTime();
    this.random = new Random();
    this.fogColorBuffer = GLAllocation.createDirectFloatBuffer(16);
    this.mc = p_i45076_1_;
    this.resourceManager = p_i45076_2_;
    this.theMapItemRenderer = new MapItemRenderer(p_i45076_1_.getTextureManager());
    this.itemRenderer = new ItemRenderer(p_i45076_1_);
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = p_i45076_1_.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;
}
EntityRenderer.java 文件源码 项目:ExpandedRailsMod 阅读 19 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn)
{
    this.shaderIndex = SHADER_COUNT;
    this.mc = mcIn;
    this.resourceManager = resourceManagerIn;
    this.itemRenderer = mcIn.getItemRenderer();
    this.theMapItemRenderer = new MapItemRenderer(mcIn.getTextureManager());
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = mcIn.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;

    for (int i = 0; i < 32; ++i)
    {
        for (int j = 0; j < 32; ++j)
        {
            float f = (float)(j - 16);
            float f1 = (float)(i - 16);
            float f2 = MathHelper.sqrt_float(f * f + f1 * f1);
            this.rainXCoords[i << 5 | j] = -f1 / f2;
            this.rainYCoords[i << 5 | j] = f / f2;
        }
    }
}
EntityRenderer.java 文件源码 项目:Cauldron 阅读 24 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_)
{
    this.shaderIndex = shaderCount;
    this.cameraZoom = 1.0D;
    this.prevFrameTime = Minecraft.getSystemTime();
    this.random = new Random();
    this.fogColorBuffer = GLAllocation.createDirectFloatBuffer(16);
    this.mc = p_i45076_1_;
    this.resourceManager = p_i45076_2_;
    this.theMapItemRenderer = new MapItemRenderer(p_i45076_1_.getTextureManager());
    this.itemRenderer = new ItemRenderer(p_i45076_1_);
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = p_i45076_1_.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;
}
EntityRenderer.java 文件源码 项目:Cauldron 阅读 22 收藏 0 点赞 0 评论 0
public EntityRenderer(Minecraft p_i45076_1_, IResourceManager p_i45076_2_)
{
    this.shaderIndex = shaderCount;
    this.cameraZoom = 1.0D;
    this.prevFrameTime = Minecraft.getSystemTime();
    this.random = new Random();
    this.fogColorBuffer = GLAllocation.createDirectFloatBuffer(16);
    this.mc = p_i45076_1_;
    this.resourceManager = p_i45076_2_;
    this.theMapItemRenderer = new MapItemRenderer(p_i45076_1_.getTextureManager());
    this.itemRenderer = new ItemRenderer(p_i45076_1_);
    this.lightmapTexture = new DynamicTexture(16, 16);
    this.locationLightMap = p_i45076_1_.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture);
    this.lightmapColors = this.lightmapTexture.getTextureData();
    this.theShaderGroup = null;
}
PenTool.java 文件源码 项目:Battlegear2 阅读 16 收藏 0 点赞 0 评论 0
@Override
public void drawOverlay(int x, int y, int[] pixelsCurrent, DynamicTexture overlay, int rgb, boolean shift) {
    int[] pixelsOverlay = overlay.getTextureData();

    System.arraycopy(pixelsCurrent, 0, pixelsOverlay, 0, pixelsOverlay.length);

    if(shift){
        drawLine(x, last_x, y, last_y, pixelsOverlay, rgb);
    }else{
        if (x > -1 && x < ImageData.IMAGE_RES && y > -1 && y < ImageData.IMAGE_RES){
            pixelsOverlay[x+ImageData.IMAGE_RES*y] = rgb;
        }
    }

    overlay.updateDynamicTexture();
}
RectangleTool.java 文件源码 项目:Battlegear2 阅读 16 收藏 0 点赞 0 评论 0
@Override
public void drawOverlay(int x, int y, int[] pixelsCurrent, DynamicTexture overlay, int rgb, boolean shift) {

    int[] pixelsOverlay = overlay.getTextureData();
    System.arraycopy(pixelsCurrent, 0, pixelsOverlay, 0, pixelsOverlay.length);

    if(Mouse.isButtonDown(0) && last_x > -1000 && last_y > -1000){
        if(shift){
            if(last_y > y)
                y = last_y - Math.abs(last_x - x);
            else
                y = last_y + Math.abs(last_x - x);
        }

        drawShape(Math.min(last_x, x),
                Math.min(last_y, y),
                Math.max(last_x, x),
                Math.max(last_y, y),
                pixelsOverlay,
                rgb);
    }
}
LocatedTexture.java 文件源码 项目:IGW-mod 阅读 19 收藏 0 点赞 0 评论 0
public LocatedTexture(ResourceLocation texture, int x, int y, int width, int height){
    this.texture = texture;
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;

    if(texture.getResourcePath().startsWith("server")) {
        try {
            BufferedImage image = ImageIO.read(new FileInputStream(new File(IGWMod.proxy.getSaveLocation() + File.separator + "igwmod" + File.separator + texture.getResourcePath().substring(7))));
            DynamicTexture t = new DynamicTexture(image);
            textureId = t.getGlTextureId();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
}
PenTool.java 文件源码 项目:CustomFlags 阅读 17 收藏 0 点赞 0 评论 0
@Override
public void drawOverlay(int x, int y, int[] pixelsCurrent, DynamicTexture overlay, int rgb, boolean shift) {
    int[] pixelsOverlay = overlay.func_110565_c();

    for(int i = 0; i < pixelsOverlay.length; i++){
        pixelsOverlay[i] = pixelsCurrent[i];
    }

    if(shift){
        drawLine(x, last_x, y, last_y, pixelsOverlay, rgb);
    }else{
        if (x > -1 &&  x < ImageData.IMAGE_RES && y > -1 && y < ImageData.IMAGE_RES){
            pixelsOverlay[x+ImageData.IMAGE_RES*y] = rgb;
        }
    }

    overlay.func_110564_a();
}


问题


面经


文章

微信
公众号

扫码关注公众号