Texture animations and vignette
This commit is contained in:
parent
a4abf352e3
commit
265adb18e2
File diff suppressed because one or more lines are too long
|
@ -36,8 +36,12 @@ import net.minecraft.src.Session;
|
|||
import net.minecraft.src.Teleporter;
|
||||
import net.minecraft.src.Tessellator;
|
||||
import net.minecraft.src.TextureCompassFX;
|
||||
import net.minecraft.src.TextureFlamesFX;
|
||||
import net.minecraft.src.TextureLavaFX;
|
||||
import net.minecraft.src.TextureLavaFlowFX;
|
||||
import net.minecraft.src.TexturePortalFX;
|
||||
import net.minecraft.src.TextureWaterFX;
|
||||
import net.minecraft.src.TexureWaterFlowFX;
|
||||
import net.minecraft.src.ThreadSleepForever;
|
||||
import net.minecraft.src.Timer;
|
||||
import net.minecraft.src.Vec3D;
|
||||
|
@ -126,13 +130,13 @@ public class Minecraft implements Runnable {
|
|||
this.checkGLError("Startup");
|
||||
this.renderEngine.registerTextureFX(this.field_9231_Y);
|
||||
this.renderEngine.registerTextureFX(this.field_9232_X);
|
||||
//this.renderEngine.registerTextureFX(new TexturePortalFX());
|
||||
this.renderEngine.registerTextureFX(new TexturePortalFX());
|
||||
this.renderEngine.registerTextureFX(new TextureCompassFX(this));
|
||||
// this.renderEngine.registerTextureFX(new TextureWatchFX(this));
|
||||
// this.renderEngine.registerTextureFX(new TexureWaterFlowFX());
|
||||
// this.renderEngine.registerTextureFX(new TextureLavaFlowFX());
|
||||
// this.renderEngine.registerTextureFX(new TextureFlamesFX(0));
|
||||
// this.renderEngine.registerTextureFX(new TextureFlamesFX(1));
|
||||
this.renderEngine.registerTextureFX(new TexureWaterFlowFX());
|
||||
this.renderEngine.registerTextureFX(new TextureLavaFlowFX());
|
||||
this.renderEngine.registerTextureFX(new TextureFlamesFX(0));
|
||||
this.renderEngine.registerTextureFX(new TextureFlamesFX(1));
|
||||
this.field_6323_f = new RenderGlobal(this, this.renderEngine);
|
||||
GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
|
||||
this.field_6321_h = new EffectRenderer(this.theWorld, this.renderEngine);
|
||||
|
@ -578,9 +582,9 @@ public class Minecraft implements Runnable {
|
|||
}
|
||||
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture("/terrain.png"));
|
||||
// if(!this.field_6316_m) {
|
||||
// this.renderEngine.func_1067_a();
|
||||
// }
|
||||
if(!this.field_6316_m) {
|
||||
this.renderEngine.func_1067_a();
|
||||
}
|
||||
|
||||
if(this.currentScreen == null && this.thePlayer != null && this.thePlayer.health <= 0) {
|
||||
this.displayGuiScreen((GuiScreen)null);
|
||||
|
|
|
@ -31,9 +31,9 @@ public class GuiIngame extends Gui {
|
|||
FontRenderer var8 = this.mc.fontRenderer;
|
||||
this.mc.field_9243_r.func_905_b();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
//if(this.mc.gameSettings.fancyGraphics) {
|
||||
//this.func_4064_a(this.mc.thePlayer.getEntityBrightness(var1), var6, var7);
|
||||
//}
|
||||
if(this.mc.gameSettings.fancyGraphics) {
|
||||
this.func_4064_a(this.mc.thePlayer.getEntityBrightness(var1), var6, var7);
|
||||
}
|
||||
|
||||
ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3);
|
||||
if(!this.mc.gameSettings.thirdPersonView && var9 != null && var9.itemID == Block.pumpkin.blockID) {
|
||||
|
@ -255,34 +255,34 @@ public class GuiIngame extends Gui {
|
|||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
// private void func_4064_a(float var1, int var2, int var3) {
|
||||
// var1 = 1.0F - var1;
|
||||
// if(var1 < 0.0F) {
|
||||
// var1 = 0.0F;
|
||||
// }
|
||||
//
|
||||
// if(var1 > 1.0F) {
|
||||
// var1 = 1.0F;
|
||||
// }
|
||||
//
|
||||
// this.field_931_c = (float)((double)this.field_931_c + (double)(var1 - this.field_931_c) * 0.01D);
|
||||
// GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
// GL11.glDepthMask(false);
|
||||
// GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
|
||||
// GL11.glColor4f(this.field_931_c, this.field_931_c, this.field_931_c, 1.0F);
|
||||
// GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("%blur%/misc/vignette.png"));
|
||||
// Tessellator var4 = Tessellator.instance;
|
||||
// var4.startDrawingQuads();
|
||||
// var4.addVertexWithUV(0.0D, (double)var3, -90.0D, 0.0D, 1.0D);
|
||||
// var4.addVertexWithUV((double)var2, (double)var3, -90.0D, 1.0D, 1.0D);
|
||||
// var4.addVertexWithUV((double)var2, 0.0D, -90.0D, 1.0D, 0.0D);
|
||||
// var4.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
|
||||
// var4.draw();
|
||||
// GL11.glDepthMask(true);
|
||||
// GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
// }
|
||||
private void func_4064_a(float var1, int var2, int var3) {
|
||||
var1 = 1.0F - var1;
|
||||
if(var1 < 0.0F) {
|
||||
var1 = 0.0F;
|
||||
}
|
||||
|
||||
if(var1 > 1.0F) {
|
||||
var1 = 1.0F;
|
||||
}
|
||||
|
||||
this.field_931_c = (float)((double)this.field_931_c + (double)(var1 - this.field_931_c) * 0.01D);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR);
|
||||
GL11.glColor4f(this.field_931_c, this.field_931_c, this.field_931_c, 1.0F);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("%blur%/misc/vignette.png"));
|
||||
Tessellator var4 = Tessellator.instance;
|
||||
var4.startDrawingQuads();
|
||||
var4.addVertexWithUV(0.0D, (double)var3, -90.0D, 0.0D, 1.0D);
|
||||
var4.addVertexWithUV((double)var2, (double)var3, -90.0D, 1.0D, 1.0D);
|
||||
var4.addVertexWithUV((double)var2, 0.0D, -90.0D, 1.0D, 0.0D);
|
||||
var4.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
|
||||
var4.draw();
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
private void func_4065_b(float var1, int var2, int var3) {
|
||||
var1 *= var1;
|
||||
|
|
|
@ -39,6 +39,11 @@ public class RenderEngine {
|
|||
String[] s1 = s.split("%%");
|
||||
setupTexture(readTextureImage(GL11.loadResourceBytes(s1[1])), i);
|
||||
clampTexture = false;
|
||||
} else if(s.startsWith("%blur%")) {
|
||||
blurTexture = true;
|
||||
String[] s1 = s.split("%blur%");
|
||||
setupTexture(readTextureImage(GL11.loadResourceBytes(s1[1])), i);
|
||||
blurTexture = false;
|
||||
} else {
|
||||
if(s.contains("terrain")) {
|
||||
useMipmaps = true;
|
||||
|
@ -188,6 +193,20 @@ public class RenderEngine {
|
|||
public int getTextureForDownloadableImage(String s, String s1) {
|
||||
return getTexture(s1);
|
||||
}
|
||||
|
||||
public void func_1067_a() {
|
||||
for (int i = 0; i < textureList.size(); i++) {
|
||||
TextureFX texturefx = (TextureFX) textureList.get(i);
|
||||
texturefx.field_1131_c = options.anaglyph;
|
||||
texturefx.func_783_a();
|
||||
texturefx.func_782_a(this);
|
||||
int tileSize = 16 * 16 * 4;
|
||||
imageDataB1.clear();
|
||||
imageDataB1.put(texturefx.field_1127_a);
|
||||
imageDataB1.position(0).limit(tileSize);
|
||||
GL11.glTexSubImage2D(3553 /* GL_TEXTURE_2D */, 0, (texturefx.field_1126_b % 16) * 16, (texturefx.field_1126_b / 16) * 16, 16, 16, 6408 /* GL_RGBA */, 5121 /* GL_UNSIGNED_BYTE */, imageDataB1);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean useMipmaps = false;
|
||||
private static HashMap<String, Integer> textureMap;
|
||||
|
|
|
@ -16,7 +16,11 @@ public class TextureFX {
|
|||
|
||||
public void func_783_a() {
|
||||
}
|
||||
|
||||
|
||||
public static void bindTerrainTexture(RenderEngine var1) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.getTexture("/terrain.png"));
|
||||
}
|
||||
|
||||
public void func_782_a(RenderEngine var1) {
|
||||
if(this.field_1128_f == 0) {
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, var1.getTexture("/terrain.png"));
|
||||
|
|
Loading…
Reference in New Issue
Block a user