ShadersTex.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:BaseClient 作者:
public static void loadLayeredTexture(LayeredTexture tex, IResourceManager manager, List list)
{
    int i = 0;
    int j = 0;
    int k = 0;
    int[] aint = null;

    for (Object s : list)
    {
        if (s != null)
        {
            try
            {
                ResourceLocation resourcelocation = new ResourceLocation((String) s);
                InputStream inputstream = manager.getResource(resourcelocation).getInputStream();
                BufferedImage bufferedimage = ImageIO.read(inputstream);

                if (k == 0)
                {
                    i = bufferedimage.getWidth();
                    j = bufferedimage.getHeight();
                    k = i * j;
                    aint = createAIntImage(k, 0);
                }

                int[] aint1 = getIntArray(k * 3);
                bufferedimage.getRGB(0, 0, i, j, aint1, 0, i);
                loadNSMap(manager, resourcelocation, i, j, aint1);

                for (int l = 0; l < k; ++l)
                {
                    int i1 = aint1[l] >>> 24 & 255;
                    aint[k * 0 + l] = blendColor(aint1[k * 0 + l], aint[k * 0 + l], i1);
                    aint[k * 1 + l] = blendColor(aint1[k * 1 + l], aint[k * 1 + l], i1);
                    aint[k * 2 + l] = blendColor(aint1[k * 2 + l], aint[k * 2 + l], i1);
                }
            }
            catch (IOException ioexception)
            {
                ioexception.printStackTrace();
            }
        }
    }

    setupTexture(tex.getMultiTexID(), aint, i, j, false, false);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号