mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 16:54:22 +00:00
texture packs. They probably still need a beefy system but should work. Hopefully I can figure out why the subImage GL side copy isn't working properly for an even more significant speed boost. But this gets things started.
31 lines
851 B
Java
31 lines
851 B
Java
package cpw.mods.fml.client;
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
import net.minecraft.client.renderer.texture.Texture;
|
|
import net.minecraft.client.renderer.texture.TextureStitched;
|
|
|
|
public class CopySubimageTextureHelper extends TextureHelper {
|
|
@Override
|
|
public void doTextureCopy(Texture atlas, Texture source, int atlasX, int atlasY)
|
|
{
|
|
if (atlas.func_94282_c() == -1)
|
|
{
|
|
return;
|
|
}
|
|
atlas.func_94277_a(0);
|
|
ByteBuffer buffer = source.func_94273_h();
|
|
buffer.position(0);
|
|
GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, atlasX, atlasY, source.func_94275_d(), source.func_94276_e(), GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
|
|
}
|
|
|
|
@Override
|
|
public void doTextureUpload(TextureStitched source)
|
|
{
|
|
// NO OP for copysubimage
|
|
}
|
|
|
|
}
|