Texture animation lag fix from b1.3
|
@ -23,10 +23,14 @@ in vec4 a_color;
|
|||
#ifdef CC_a_normal
|
||||
in vec4 a_normal;
|
||||
#endif
|
||||
|
||||
#ifdef CC_fog
|
||||
out vec4 v_position;
|
||||
#ifdef CC_a_texture1
|
||||
in vec2 a_texture1;
|
||||
#endif
|
||||
|
||||
#ifdef CC_TEX_GEN_STRQ
|
||||
out vec4 v_object_pos;
|
||||
#endif
|
||||
out vec4 v_position;
|
||||
#ifdef CC_a_color
|
||||
out vec4 v_color;
|
||||
#endif
|
||||
|
@ -36,11 +40,20 @@ out vec4 v_normal;
|
|||
#ifdef CC_a_texture0
|
||||
out vec2 v_texture0;
|
||||
#endif
|
||||
#ifdef CC_a_texture1
|
||||
out vec2 v_texture1;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CC_VERT
|
||||
|
||||
void main(){
|
||||
vec4 pos = matrix_m * vec4(a_position, 1.0);
|
||||
#ifdef CC_fog
|
||||
v_position = pos;
|
||||
#ifdef CC_TEX_GEN_STRQ
|
||||
v_object_pos = vec4(a_position, 1.0);
|
||||
#endif
|
||||
#ifdef CC_a_color
|
||||
v_color = a_color;
|
||||
|
@ -50,6 +63,9 @@ void main(){
|
|||
#endif
|
||||
#ifdef CC_a_texture0
|
||||
v_texture0 = a_texture0;
|
||||
#endif
|
||||
#ifdef CC_a_texture1
|
||||
v_texture1 = a_texture1;
|
||||
#endif
|
||||
gl_Position = matrix_p * pos;
|
||||
}
|
||||
|
@ -58,12 +74,10 @@ void main(){
|
|||
|
||||
#ifdef CC_FRAG
|
||||
|
||||
#ifdef CC_unit0
|
||||
uniform sampler2D tex0;
|
||||
#ifndef CC_a_texture0
|
||||
uniform sampler2D tex1;
|
||||
uniform vec2 texCoordV0;
|
||||
#endif
|
||||
#endif
|
||||
uniform vec2 texCoordV1;
|
||||
#ifdef CC_lighting
|
||||
uniform vec3 light0Pos;
|
||||
uniform vec3 light1Pos;
|
||||
|
@ -71,20 +85,35 @@ uniform vec3 normalUniform;
|
|||
#endif
|
||||
#ifdef CC_fog
|
||||
uniform vec4 fogColor;
|
||||
uniform int fogMode;
|
||||
uniform float fogStart;
|
||||
uniform float fogEnd;
|
||||
uniform float fogDensity;
|
||||
uniform float fogPremultiply;
|
||||
//X = uniform float fogMode;
|
||||
//Y = uniform float fogStart;
|
||||
//Z = uniform float fogEnd - fogStart;
|
||||
//W = uniform float fogDensity;
|
||||
uniform vec4 fogParam;
|
||||
#endif
|
||||
uniform vec4 colorUniform;
|
||||
#ifdef CC_alphatest
|
||||
uniform float alphaTestF;
|
||||
#endif
|
||||
|
||||
#ifdef CC_fog
|
||||
in vec4 v_position;
|
||||
#ifdef CC_TEX_GEN_STRQ
|
||||
//uniform int textureGenS_M;
|
||||
//uniform int textureGenT_M;
|
||||
//uniform int textureGenR_M;
|
||||
//uniform int textureGenQ_M;
|
||||
uniform ivec4 textureGen_M;
|
||||
uniform vec4 textureGenS_V;
|
||||
uniform vec4 textureGenT_V;
|
||||
uniform vec4 textureGenR_V;
|
||||
uniform vec4 textureGenQ_V;
|
||||
#endif
|
||||
#ifdef CC_patch_anisotropic
|
||||
uniform vec2 anisotropic_fix;
|
||||
#endif
|
||||
|
||||
#ifdef CC_TEX_GEN_STRQ
|
||||
in vec4 v_object_pos;
|
||||
#endif
|
||||
in vec4 v_position;
|
||||
#ifdef CC_a_color
|
||||
in vec4 v_color;
|
||||
#endif
|
||||
|
@ -94,10 +123,14 @@ in vec4 v_normal;
|
|||
#ifdef CC_a_texture0
|
||||
in vec2 v_texture0;
|
||||
#endif
|
||||
#ifdef CC_a_texture1
|
||||
in vec2 v_texture1;
|
||||
#endif
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
#define TEX_MAT3x2(mat4In) mat3x2(mat4In[0].xy,mat4In[1].xy,mat4In[3].xy)
|
||||
#define TEX_MAT4x3(mat4In) mat4x3(mat4In[0].xyw,mat4In[1].xyw,mat4In[2].xyw,mat4In[3].xyw)
|
||||
|
||||
void main(){
|
||||
#ifdef CC_a_color
|
||||
|
@ -106,12 +139,48 @@ void main(){
|
|||
vec4 color = colorUniform;
|
||||
#endif
|
||||
|
||||
#ifdef CC_TEX_GEN_STRQ
|
||||
vec4 texSrc[2];
|
||||
texSrc[0] = v_object_pos;
|
||||
texSrc[1] = v_position;
|
||||
|
||||
vec4 texPos;
|
||||
texPos.x = dot(texSrc[textureGen_M.x], textureGenS_V);
|
||||
texPos.y = dot(texSrc[textureGen_M.y], textureGenT_V);
|
||||
texPos.z = dot(texSrc[textureGen_M.z], textureGenR_V);
|
||||
texPos.w = dot(texSrc[textureGen_M.w], textureGenQ_V);
|
||||
texPos.xyz = TEX_MAT4x3(matrix_t) * texPos;
|
||||
color *= texture(tex0, texPos.xy / texPos.z).bgra;
|
||||
#ifdef CC_alphatest
|
||||
if(color.a < alphaTestF){
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#ifdef CC_unit0
|
||||
#ifdef CC_a_texture0
|
||||
color *= texture(tex0, (TEX_MAT3x2(matrix_t) * vec3(v_texture0, 1.0)).xy).rgba;
|
||||
|
||||
#ifdef CC_patch_anisotropic
|
||||
vec2 uv = TEX_MAT3x2(matrix_t) * vec3(v_texture0, 1.0);
|
||||
|
||||
/* https://bugs.chromium.org/p/angleproject/issues/detail?id=4994 */
|
||||
uv = ((uv * anisotropic_fix) - fract(uv * anisotropic_fix) + 0.5) / anisotropic_fix;
|
||||
|
||||
vec4 texColor = texture(tex0, uv);
|
||||
#else
|
||||
color *= texture(tex0, (TEX_MAT3x2(matrix_t) * vec3(texCoordV0, 1.0)).xy).rgba;
|
||||
vec4 texColor = texture(tex0, TEX_MAT3x2(matrix_t) * vec3(v_texture0, 1.0));
|
||||
#endif
|
||||
|
||||
#else
|
||||
vec4 texColor = texture(tex0, TEX_MAT3x2(matrix_t) * vec3(texCoordV0, 1.0));
|
||||
#endif
|
||||
|
||||
#ifdef CC_swap_rb
|
||||
color *= texColor.rgba;
|
||||
#else
|
||||
color *= texColor.bgra;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CC_alphatest
|
||||
|
@ -120,6 +189,15 @@ void main(){
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CC_unit1
|
||||
#ifdef CC_a_texture1
|
||||
color.rgb *= texture(tex1, (v_texture1 + 8.0) * 0.00390625).bgr;
|
||||
#else
|
||||
color.rgb *= texture(tex1, (texCoordV1 + 8.0) * 0.00390625).bgr;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CC_lighting
|
||||
#ifdef CC_a_normal
|
||||
vec3 normal = ((v_normal.xyz - 0.5) * 2.0);
|
||||
|
@ -133,11 +211,12 @@ void main(){
|
|||
|
||||
#ifdef CC_fog
|
||||
float dist = sqrt(dot(v_position, v_position));
|
||||
float i = (fogMode == 1) ? clamp((dist - fogStart) / (fogEnd - fogStart), 0.0, 1.0) : clamp(1.0 - exp(-(fogDensity * dist)), 0.0, 1.0);
|
||||
color.rgb = mix(color.rgb, fogColor.xyz, i * fogColor.a);
|
||||
float i = fogParam.x == 1.0 ? (dist - fogParam.y) / fogParam.z : 1.0 - exp(-fogParam.w * dist);
|
||||
color.rgb = mix(color.rgb, fogColor.xyz, clamp(i, 0.0, 1.0) * fogColor.a);
|
||||
#endif
|
||||
|
||||
fragColor = color;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
BIN
resources/sprite_sheet/clock.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
resources/sprite_sheet/compass.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
resources/sprite_sheet/fire_0.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
resources/sprite_sheet/fire_1.png
Normal file
After Width: | Height: | Size: 14 KiB |
1
resources/sprite_sheet/fire_1.txt
Normal file
|
@ -0,0 +1 @@
|
|||
8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7
|
BIN
resources/sprite_sheet/lava.png
Normal file
After Width: | Height: | Size: 11 KiB |
1
resources/sprite_sheet/lava.txt
Normal file
|
@ -0,0 +1 @@
|
|||
0*2,1*2,2*2,3*2,4*2,5*2,6*2,7*2,8*2,9*2,10*2,11*2,12*2,13*2,14*2,15*2,16*2,17*2,18*2,19*2,18*2,17*2,16*2,15*2,14*2,13*2,12*2,11*2,10*2,9*2,8*2,7*2,6*2,5*2,4*2,3*2,2*2,1*2
|
BIN
resources/sprite_sheet/lava_flow.png
Normal file
After Width: | Height: | Size: 10 KiB |
1
resources/sprite_sheet/lava_flow.txt
Normal file
|
@ -0,0 +1 @@
|
|||
0*3,1*3,2*3,3*3,4*3,5*3,6*3,7*3,8*3,9*3,10*3,11*3,12*3,13*3,14*3,15*3
|
BIN
resources/sprite_sheet/portal.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
resources/sprite_sheet/water.png
Normal file
After Width: | Height: | Size: 14 KiB |
1
resources/sprite_sheet/water.txt
Normal file
|
@ -0,0 +1 @@
|
|||
0*2,1*2,2*2,3*2,4*2,5*2,6*2,7*2,8*2,9*2,10*2,11*2,12*2,13*2,14*2,15*2,16*2,17*2,18*2,19*2,20*2,21*2,22*2,23*2,24*2,25*2,26*2,27*2,28*2,29*2,30*2,31*2
|
BIN
resources/sprite_sheet/water_flow.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
156
src/net/lax1dude/eaglercraft/SpriteSheetTexture.java
Normal file
|
@ -0,0 +1,156 @@
|
|||
package net.lax1dude.eaglercraft;
|
||||
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.PeytonPlayz585.awt.image.BufferedImage;
|
||||
import net.minecraft.src.GLAllocation;
|
||||
|
||||
public class SpriteSheetTexture {
|
||||
|
||||
public final String name;
|
||||
public final int iconIndex;
|
||||
public final int iconTileSize;
|
||||
private IntBuffer buffer = null;
|
||||
private int dataFrameCount = 0;
|
||||
private int[] frameSet = null;
|
||||
public int ticks = 0;
|
||||
|
||||
private int[] mipmapOffsets = new int[5];
|
||||
|
||||
public SpriteSheetTexture(String name, int iconIndex, int iconTileSize) {
|
||||
this.name = name;
|
||||
this.iconIndex = iconIndex;
|
||||
this.iconTileSize = iconTileSize;
|
||||
reloadData();
|
||||
}
|
||||
|
||||
public void update() {
|
||||
ticks = (ticks + 1) % frameSet.length;
|
||||
}
|
||||
|
||||
public IntBuffer grabFrame(int lvl) {
|
||||
int offWidth = 16 >> lvl;
|
||||
int step = offWidth * offWidth * iconTileSize * iconTileSize;
|
||||
int startIndex = mipmapOffsets[lvl] + step * frameSet[ticks];
|
||||
buffer.limit(startIndex + step);
|
||||
buffer.position(startIndex);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public void reloadData() {
|
||||
ticks = 0;
|
||||
buffer = null;
|
||||
frameSet = null;
|
||||
|
||||
byte[] imgBytes = GL11.EaglerAdapterImpl2.loadResourceBytes("/sprite_sheet/" + name + ".png");
|
||||
if(imgBytes == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int dim = iconTileSize * iconTileSize * 256;
|
||||
BufferedImage img = GL11.EaglerAdapterImpl2.loadPNG(imgBytes);
|
||||
dataFrameCount = img.getData().length / dim;
|
||||
|
||||
ArrayList<Integer> loadedFrameSet = new ArrayList();
|
||||
byte[] metaBytes = GL11.EaglerAdapterImpl2.loadResourceBytes("/sprite_sheet/" + name + ".txt");
|
||||
|
||||
if(metaBytes == null) {
|
||||
for(int i = 0; i < dataFrameCount; ++i) {
|
||||
loadedFrameSet.add(i);
|
||||
}
|
||||
}else {
|
||||
String str = new String(metaBytes, StandardCharsets.UTF_8);
|
||||
String[] splitted = str.split("\\s*,\\s*");
|
||||
for(int i = 0; i < splitted.length; ++i) {
|
||||
String idxStr = splitted[i];
|
||||
int z = idxStr.indexOf('*');
|
||||
if(z != -1) {
|
||||
int idx = Integer.parseInt(idxStr.substring(0, z));
|
||||
int c = Integer.parseInt(idxStr.substring(z + 1));
|
||||
for(int j = 0; j < c; ++j) {
|
||||
loadedFrameSet.add(idx);
|
||||
}
|
||||
}else {
|
||||
loadedFrameSet.add(Integer.parseInt(idxStr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
frameSet = new int[loadedFrameSet.size()];
|
||||
for(int i = 0; i < frameSet.length; ++i) {
|
||||
frameSet[i] = loadedFrameSet.get(i).intValue();
|
||||
}
|
||||
|
||||
buffer = GLAllocation.createDirectIntBuffer(
|
||||
16 * 16 * dataFrameCount * iconTileSize * iconTileSize +
|
||||
8 * 8 * dataFrameCount * iconTileSize * iconTileSize +
|
||||
4 * 4 * dataFrameCount * iconTileSize * iconTileSize +
|
||||
2 * 2 * dataFrameCount * iconTileSize * iconTileSize +
|
||||
dataFrameCount * iconTileSize * iconTileSize
|
||||
);
|
||||
|
||||
int[] texData = swapRB(img.getData());
|
||||
mipmapOffsets[0] = 0;
|
||||
buffer.put(texData);
|
||||
mipmapOffsets[1] = buffer.position();
|
||||
texData = downscale(texData, 16 * iconTileSize, 16 * iconTileSize * dataFrameCount);
|
||||
buffer.put(texData);
|
||||
mipmapOffsets[2] = buffer.position();
|
||||
texData = downscale(texData, 8 * iconTileSize, 8 * iconTileSize * dataFrameCount);
|
||||
buffer.put(texData);
|
||||
mipmapOffsets[3] = buffer.position();
|
||||
texData = downscale(texData, 4 * iconTileSize, 4 * iconTileSize * dataFrameCount);
|
||||
buffer.put(texData);
|
||||
mipmapOffsets[4] = buffer.position();
|
||||
texData = downscale(texData, 2 * iconTileSize, 2 * iconTileSize * dataFrameCount);
|
||||
buffer.put(texData);
|
||||
|
||||
}
|
||||
|
||||
private static int[] downscale(int[] in, int sw, int sh) {
|
||||
int dw = sw / 2;
|
||||
int dh = sh / 2;
|
||||
int[] ret = new int[dw * dh];
|
||||
for(int y = 0; y < dh; ++y) {
|
||||
for(int x = 0; x < dw; ++x) {
|
||||
int a = in[((x * 2) + (y * 2) * sw)];
|
||||
int b = in[((x * 2 + 1) + (y * 2) * sw)];
|
||||
int c = in[((x * 2 + 1) + (y * 2 + 1) * sw)];
|
||||
int d = in[((x * 2) + (y * 2 + 1) * sw)];
|
||||
int b1= (((a >> 26) & 0x3F)) +
|
||||
(((b >> 26) & 0x3F)) +
|
||||
(((c >> 26) & 0x3F)) +
|
||||
(((d >> 26) & 0x3F));
|
||||
int b2= (((a >> 18) & 0x3F)) +
|
||||
(((b >> 18) & 0x3F)) +
|
||||
(((c >> 18) & 0x3F)) +
|
||||
(((d >> 18) & 0x3F));
|
||||
int b3= (((a >> 10) & 0x3F)) +
|
||||
(((b >> 10) & 0x3F)) +
|
||||
(((c >> 10) & 0x3F)) +
|
||||
(((d >> 10) & 0x3F));
|
||||
int b4= (((a >> 2) & 0x3F)) +
|
||||
(((b >> 2) & 0x3F)) +
|
||||
(((c >> 2) & 0x3F)) +
|
||||
(((d >> 2) & 0x3F));
|
||||
ret[y * dw + x] = (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static int[] swapRB(int[] in) {
|
||||
int[] out = new int[in.length];
|
||||
for(int i = 0; i < in.length; ++i) {
|
||||
int r = (in[i] >> 16) & 0xFF;
|
||||
int b = in[i] & 0xFF;
|
||||
out[i] = (in[i] & 0xFF00FF00) | (b << 16) | r;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
72
src/net/lax1dude/eaglercraft/TextureNewClockFX.java
Normal file
|
@ -0,0 +1,72 @@
|
|||
package net.lax1dude.eaglercraft;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.TextureFX;
|
||||
|
||||
public class TextureNewClockFX extends TextureFX {
|
||||
|
||||
private final int[] clockSpriteSheet;
|
||||
private final int clockSpriteSheetLength;
|
||||
private float field_94239_h;
|
||||
private float field_94240_i;
|
||||
|
||||
public TextureNewClockFX() {
|
||||
super(Item.pocketSundial.getIconFromDamage(0));
|
||||
tileImage = 1;
|
||||
this.clockSpriteSheet = GL11.EaglerAdapterImpl2.loadPNG(GL11.EaglerAdapterImpl2.loadResourceBytes("/sprite_sheet/clock.png")).getData();
|
||||
this.clockSpriteSheetLength = clockSpriteSheet.length / 256;
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
Minecraft var1 = Minecraft.getMinecraft();
|
||||
double var2 = 0.0D;
|
||||
|
||||
if (var1.theWorld != null && var1.thePlayer != null) {
|
||||
float var4 = var1.theWorld.getCelestialAngle(1.0F);
|
||||
var2 = (double) var4;
|
||||
|
||||
if (var1.theWorld.worldProvider.isNether) {
|
||||
var2 = Math.random();
|
||||
}
|
||||
}
|
||||
|
||||
double var7;
|
||||
|
||||
for (var7 = var2 - this.field_94239_h; var7 < -0.5D; ++var7) {
|
||||
;
|
||||
}
|
||||
|
||||
while (var7 >= 0.5D) {
|
||||
--var7;
|
||||
}
|
||||
|
||||
if (var7 < -1.0D) {
|
||||
var7 = -1.0D;
|
||||
}
|
||||
|
||||
if (var7 > 1.0D) {
|
||||
var7 = 1.0D;
|
||||
}
|
||||
|
||||
this.field_94240_i += var7 * 0.1D;
|
||||
this.field_94240_i *= 0.8D;
|
||||
this.field_94239_h += this.field_94240_i;
|
||||
int var6;
|
||||
|
||||
for (var6 = (int) ((this.field_94239_h + 1.0D) * (double) clockSpriteSheetLength) % clockSpriteSheetLength; var6 < 0; var6 = (var6 + clockSpriteSheetLength) % clockSpriteSheetLength) {
|
||||
;
|
||||
}
|
||||
|
||||
int offset = var6 * 256;
|
||||
for(int i = 0; i < 256; ++i) {
|
||||
this.imageData[i * 4] = (byte)((clockSpriteSheet[offset + i] >> 16) & 0xFF);
|
||||
this.imageData[i * 4 + 1] = (byte)((clockSpriteSheet[offset + i] >> 8) & 0xFF);
|
||||
this.imageData[i * 4 + 2] = (byte)(clockSpriteSheet[offset + i] & 0xFF);
|
||||
this.imageData[i * 4 + 3] = (byte)((clockSpriteSheet[offset + i] >> 24) & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
96
src/net/lax1dude/eaglercraft/TextureNewCompassFX.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package net.lax1dude.eaglercraft;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.ChunkCoordinates;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.TextureFX;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
public class TextureNewCompassFX extends TextureFX {
|
||||
|
||||
private final int[] compassSpriteSheet;
|
||||
private final int compassSpriteSheetLength;
|
||||
private float angleDelta = 0.0f;
|
||||
private float currentAngle = 0.0f;
|
||||
|
||||
public TextureNewCompassFX() {
|
||||
super(Item.compass.getIconFromDamage(0));
|
||||
tileImage = 1;
|
||||
this.compassSpriteSheet = GL11.EaglerAdapterImpl2.loadPNG(GL11.EaglerAdapterImpl2.loadResourceBytes("/sprite_sheet/compass.png")).getData();
|
||||
this.compassSpriteSheetLength = compassSpriteSheet.length / 256;
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
Minecraft var1 = Minecraft.getMinecraft();
|
||||
|
||||
if (var1.theWorld != null && var1.thePlayer != null) {
|
||||
this.updateCompass(var1.theWorld, var1.thePlayer.posX, var1.thePlayer.posZ, (double) var1.thePlayer.rotationYaw, false, false);
|
||||
} else {
|
||||
this.updateCompass((World) null, 0.0D, 0.0D, 0.0D, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateCompass(World par1World, double par2, double par4, double par6, boolean par8, boolean par9) {
|
||||
double var10 = 0.0D;
|
||||
|
||||
if (par1World != null && !par8) {
|
||||
ChunkCoordinates var12 = par1World.getSpawnPoint();
|
||||
double var13 = (double) var12.x - par2;
|
||||
double var15 = (double) var12.z - par4;
|
||||
par6 %= 360.0D;
|
||||
var10 = -((par6 - 90.0D) * Math.PI / 180.0D - Math.atan2(var15, var13));
|
||||
|
||||
if (par1World.worldProvider.isNether) {
|
||||
var10 = Math.random() * Math.PI * 2.0D;
|
||||
}
|
||||
}
|
||||
|
||||
if (par9) {
|
||||
this.currentAngle = (float) var10;
|
||||
} else {
|
||||
double var17;
|
||||
|
||||
for (var17 = var10 - this.currentAngle; var17 < -Math.PI; var17 += (Math.PI * 2D)) {
|
||||
;
|
||||
}
|
||||
|
||||
while (var17 >= Math.PI) {
|
||||
var17 -= (Math.PI * 2D);
|
||||
}
|
||||
|
||||
if (var17 < -1.0D) {
|
||||
var17 = -1.0D;
|
||||
}
|
||||
|
||||
if (var17 > 1.0D) {
|
||||
var17 = 1.0D;
|
||||
}
|
||||
|
||||
this.angleDelta += var17 * 0.1D;
|
||||
this.angleDelta *= 0.8D;
|
||||
this.currentAngle += this.angleDelta;
|
||||
}
|
||||
|
||||
int var18;
|
||||
|
||||
for (var18 = (int) ((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double) compassSpriteSheetLength) % compassSpriteSheetLength; var18 < 0; var18 = (var18 + compassSpriteSheetLength) % compassSpriteSheetLength) {
|
||||
;
|
||||
}
|
||||
|
||||
int offset = var18 * 256;
|
||||
for(int i = 0; i < 256; ++i) {
|
||||
this.imageData[i * 4] = (byte)((compassSpriteSheet[offset + i] >> 16) & 0xFF);
|
||||
this.imageData[i * 4 + 1] = (byte)((compassSpriteSheet[offset + i] >> 8) & 0xFF);
|
||||
this.imageData[i * 4 + 2] = (byte)((compassSpriteSheet[offset + i]) & 0xFF);
|
||||
this.imageData[i * 4 + 3] = (byte)((compassSpriteSheet[offset + i] >> 24) & 0xFF);
|
||||
}
|
||||
|
||||
//if (var18 != this.frameCounter) {
|
||||
// this.frameCounter = var18;
|
||||
// this.textureSheet.func_104062_b(this.originX, this.originY, (Texture) this.textureList.get(this.frameCounter));
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
|
@ -5,6 +5,8 @@ import org.lwjgl.input.Mouse;
|
|||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureNewClockFX;
|
||||
import net.lax1dude.eaglercraft.TextureNewCompassFX;
|
||||
import net.minecraft.src.AchievementList;
|
||||
import net.minecraft.src.AxisAlignedBB;
|
||||
import net.minecraft.src.Block;
|
||||
|
@ -66,14 +68,6 @@ import net.minecraft.src.StatList;
|
|||
import net.minecraft.src.StatStringFormatKeyInv;
|
||||
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.TextureWatchFX;
|
||||
import net.minecraft.src.TextureWaterFX;
|
||||
import net.minecraft.src.TextureWaterFlowFX;
|
||||
import net.minecraft.src.Timer;
|
||||
import net.minecraft.src.UnexpectedThrowable;
|
||||
import net.minecraft.src.Vec3D;
|
||||
|
@ -121,8 +115,6 @@ public class Minecraft implements Runnable {
|
|||
public StatFileWriter statFileWriter;
|
||||
private String serverName;
|
||||
private int serverPort;
|
||||
private TextureWaterFX textureWaterFX = new TextureWaterFX();
|
||||
private TextureLavaFX textureLavaFX = new TextureLavaFX();
|
||||
private static String minecraftDir = "minecraft";
|
||||
public volatile boolean running = true;
|
||||
public String debug = "";
|
||||
|
@ -183,15 +175,15 @@ public class Minecraft implements Runnable {
|
|||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
this.checkGLError("Startup");
|
||||
this.sndManager.loadSoundSettings(this.gameSettings);
|
||||
this.renderEngine.registerTextureFX(this.textureLavaFX);
|
||||
this.renderEngine.registerTextureFX(this.textureWaterFX);
|
||||
this.renderEngine.registerTextureFX(new TexturePortalFX());
|
||||
this.renderEngine.registerTextureFX(new TextureCompassFX(this));
|
||||
this.renderEngine.registerTextureFX(new TextureWatchFX(this));
|
||||
this.renderEngine.registerTextureFX(new TextureWaterFlowFX());
|
||||
this.renderEngine.registerTextureFX(new TextureLavaFlowFX());
|
||||
this.renderEngine.registerTextureFX(new TextureFlamesFX(0));
|
||||
this.renderEngine.registerTextureFX(new TextureFlamesFX(1));
|
||||
renderEngine.registerTextureFX(new TextureNewCompassFX());
|
||||
renderEngine.registerTextureFX(new TextureNewClockFX());
|
||||
renderEngine.registerSpriteSheet("portal", Block.portal.blockIndexInTexture, 1);
|
||||
renderEngine.registerSpriteSheet("water", Block.waterStill.blockIndexInTexture, 1);
|
||||
renderEngine.registerSpriteSheet("water_flow", Block.waterMoving.blockIndexInTexture + 1, 2);
|
||||
renderEngine.registerSpriteSheet("lava", Block.lavaStill.blockIndexInTexture, 1);
|
||||
renderEngine.registerSpriteSheet("lava_flow", Block.lavaMoving.blockIndexInTexture + 1, 2);
|
||||
renderEngine.registerSpriteSheet("fire_0", Block.fire.blockIndexInTexture, 1);
|
||||
renderEngine.registerSpriteSheet("fire_1", Block.fire.blockIndexInTexture + 16, 1);
|
||||
this.renderGlobal = new RenderGlobal(this, this.renderEngine);
|
||||
GL11.glViewport(0, 0, this.displayWidth, this.displayHeight);
|
||||
this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine);
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.util.Map;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.PeytonPlayz585.awt.image.BufferedImage;
|
||||
import net.lax1dude.eaglercraft.SpriteSheetTexture;
|
||||
|
||||
public class RenderEngine {
|
||||
public static boolean useMipmaps = false;
|
||||
|
@ -25,6 +26,7 @@ public class RenderEngine {
|
|||
private GameSettings options;
|
||||
private boolean clampTexture = false;
|
||||
private boolean blurTexture = false;
|
||||
private List<SpriteSheetTexture> textureSpriteList = new ArrayList();
|
||||
|
||||
private BufferedImage missingTextureImage;
|
||||
|
||||
|
@ -284,18 +286,51 @@ public class RenderEngine {
|
|||
var1.onTick();
|
||||
}
|
||||
|
||||
// public void updateDynamicTextures() {
|
||||
// for (int i = 0; i < textureList.size(); i++) {
|
||||
// TextureFX texturefx = (TextureFX) textureList.get(i);
|
||||
// texturefx.anaglyphEnabled = this.options.anaglyph;
|
||||
// texturefx.onTick();
|
||||
// texturefx.bindImage(this);
|
||||
// int tileSize = 16 * 16 * 4;
|
||||
// imageData.clear();
|
||||
// imageData.put(texturefx.imageData);
|
||||
// imageData.position(0).limit(tileSize);
|
||||
// GL11.glTexSubImage2D(3553, 0, (texturefx.iconIndex % 16) * 16, (texturefx.iconIndex / 16) * 16, 16, 16, 6408, 5121, imageData);
|
||||
// }
|
||||
// }
|
||||
|
||||
public void updateDynamicTextures() {
|
||||
|
||||
for (int i = 0; i < textureList.size(); i++) {
|
||||
TextureFX texturefx = (TextureFX) textureList.get(i);
|
||||
texturefx.anaglyphEnabled = this.options.anaglyph;
|
||||
texturefx.anaglyphEnabled = options.anaglyph;
|
||||
texturefx.onTick();
|
||||
texturefx.bindImage(this);
|
||||
int tileSize = 16 * 16 * 4;
|
||||
imageData.clear();
|
||||
imageData.put(texturefx.imageData);
|
||||
imageData.position(0).limit(tileSize);
|
||||
GL11.glTexSubImage2D(3553, 0, (texturefx.iconIndex % 16) * 16, (texturefx.iconIndex / 16) * 16, 16, 16, 6408, 5121, imageData);
|
||||
texturefx.bindImage(this);
|
||||
GL11.glTexSubImage2D(3553 /* GL_TEXTURE_2D */, 0, (texturefx.iconIndex % 16) * 16, (texturefx.iconIndex / 16) * 16, 16, 16,
|
||||
6408 /* GL_RGBA */, 5121 /* GL_UNSIGNED_BYTE */, imageData);
|
||||
}
|
||||
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, getTexture("/terrain.png"));
|
||||
for(int i = 0, l = textureSpriteList.size(); i < l; ++i) {
|
||||
SpriteSheetTexture sp = textureSpriteList.get(i);
|
||||
sp.update();
|
||||
int w = 16;
|
||||
for(int j = 0; j < 5; ++j) {
|
||||
GL11.glTexSubImage2D(3553 /* GL_TEXTURE_2D */, j, (sp.iconIndex % 16) * w, (sp.iconIndex / 16) * w, w * sp.iconTileSize, w * sp.iconTileSize,
|
||||
6408 /* GL_RGBA */, 5121 /* GL_UNSIGNED_BYTE */, sp.grabFrame(j));
|
||||
w /= 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void registerSpriteSheet(String name, int iconIndex, int iconTileSize) {
|
||||
textureSpriteList.add(new SpriteSheetTexture(name, iconIndex, iconTileSize));
|
||||
}
|
||||
|
||||
private int averageColor(int var1, int var2) {
|
||||
|
@ -385,6 +420,10 @@ public class RenderEngine {
|
|||
var6.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
for(int j = 0, l = textureSpriteList.size(); j < l; ++j) {
|
||||
textureSpriteList.get(j).reloadData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,145 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.PeytonPlayz585.awt.image.BufferedImage;
|
||||
import net.PeytonPlayz585.awt.image.ImageIO;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class TextureCompassFX extends TextureFX {
|
||||
private Minecraft mc;
|
||||
private int[] compassIconImageData = new int[256];
|
||||
private double field_4229_i;
|
||||
private double field_4228_j;
|
||||
|
||||
public TextureCompassFX(Minecraft var1) {
|
||||
super(Item.compass.getIconFromDamage(0));
|
||||
this.mc = var1;
|
||||
this.tileImage = 1;
|
||||
|
||||
try {
|
||||
BufferedImage var2 = ImageIO.read(GL11.getResource("/gui/items.png"));
|
||||
int var3 = this.iconIndex % 16 * 16;
|
||||
int var4 = this.iconIndex / 16 * 16;
|
||||
var2.getRGB(var3, var4, 16, 16, this.compassIconImageData, 0, 16);
|
||||
} catch (Exception var5) {
|
||||
var5.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
for(int var1 = 0; var1 < 256; ++var1) {
|
||||
int var2 = this.compassIconImageData[var1] >> 24 & 255;
|
||||
int var3 = this.compassIconImageData[var1] >> 16 & 255;
|
||||
int var4 = this.compassIconImageData[var1] >> 8 & 255;
|
||||
int var5 = this.compassIconImageData[var1] >> 0 & 255;
|
||||
if(this.anaglyphEnabled) {
|
||||
int var6 = (var3 * 30 + var4 * 59 + var5 * 11) / 100;
|
||||
int var7 = (var3 * 30 + var4 * 70) / 100;
|
||||
int var8 = (var3 * 30 + var5 * 70) / 100;
|
||||
var3 = var6;
|
||||
var4 = var7;
|
||||
var5 = var8;
|
||||
}
|
||||
|
||||
this.imageData[var1 * 4 + 0] = (byte)var3;
|
||||
this.imageData[var1 * 4 + 1] = (byte)var4;
|
||||
this.imageData[var1 * 4 + 2] = (byte)var5;
|
||||
this.imageData[var1 * 4 + 3] = (byte)var2;
|
||||
}
|
||||
|
||||
double var20 = 0.0D;
|
||||
if(this.mc.theWorld != null && this.mc.thePlayer != null) {
|
||||
ChunkCoordinates var21 = this.mc.theWorld.getSpawnPoint();
|
||||
double var23 = (double)var21.x - this.mc.thePlayer.posX;
|
||||
double var25 = (double)var21.z - this.mc.thePlayer.posZ;
|
||||
var20 = (double)(this.mc.thePlayer.rotationYaw - 90.0F) * Math.PI / 180.0D - Math.atan2(var25, var23);
|
||||
if(this.mc.theWorld.worldProvider.isNether) {
|
||||
var20 = Math.random() * (double)((float)Math.PI) * 2.0D;
|
||||
}
|
||||
}
|
||||
|
||||
double var22;
|
||||
for(var22 = var20 - this.field_4229_i; var22 < -Math.PI; var22 += Math.PI * 2.0D) {
|
||||
}
|
||||
|
||||
while(var22 >= Math.PI) {
|
||||
var22 -= Math.PI * 2.0D;
|
||||
}
|
||||
|
||||
if(var22 < -1.0D) {
|
||||
var22 = -1.0D;
|
||||
}
|
||||
|
||||
if(var22 > 1.0D) {
|
||||
var22 = 1.0D;
|
||||
}
|
||||
|
||||
this.field_4228_j += var22 * 0.1D;
|
||||
this.field_4228_j *= 0.8D;
|
||||
this.field_4229_i += this.field_4228_j;
|
||||
double var24 = Math.sin(this.field_4229_i);
|
||||
double var26 = Math.cos(this.field_4229_i);
|
||||
|
||||
int var9;
|
||||
int var10;
|
||||
int var11;
|
||||
int var12;
|
||||
int var13;
|
||||
int var14;
|
||||
int var15;
|
||||
short var16;
|
||||
int var17;
|
||||
int var18;
|
||||
int var19;
|
||||
for(var9 = -4; var9 <= 4; ++var9) {
|
||||
var10 = (int)(8.5D + var26 * (double)var9 * 0.3D);
|
||||
var11 = (int)(7.5D - var24 * (double)var9 * 0.3D * 0.5D);
|
||||
var12 = var11 * 16 + var10;
|
||||
var13 = 100;
|
||||
var14 = 100;
|
||||
var15 = 100;
|
||||
var16 = 255;
|
||||
if(this.anaglyphEnabled) {
|
||||
var17 = (var13 * 30 + var14 * 59 + var15 * 11) / 100;
|
||||
var18 = (var13 * 30 + var14 * 70) / 100;
|
||||
var19 = (var13 * 30 + var15 * 70) / 100;
|
||||
var13 = var17;
|
||||
var14 = var18;
|
||||
var15 = var19;
|
||||
}
|
||||
|
||||
this.imageData[var12 * 4 + 0] = (byte)var13;
|
||||
this.imageData[var12 * 4 + 1] = (byte)var14;
|
||||
this.imageData[var12 * 4 + 2] = (byte)var15;
|
||||
this.imageData[var12 * 4 + 3] = (byte)var16;
|
||||
}
|
||||
|
||||
for(var9 = -8; var9 <= 16; ++var9) {
|
||||
var10 = (int)(8.5D + var24 * (double)var9 * 0.3D);
|
||||
var11 = (int)(7.5D + var26 * (double)var9 * 0.3D * 0.5D);
|
||||
var12 = var11 * 16 + var10;
|
||||
var13 = var9 >= 0 ? 255 : 100;
|
||||
var14 = var9 >= 0 ? 20 : 100;
|
||||
var15 = var9 >= 0 ? 20 : 100;
|
||||
var16 = 255;
|
||||
if(this.anaglyphEnabled) {
|
||||
var17 = (var13 * 30 + var14 * 59 + var15 * 11) / 100;
|
||||
var18 = (var13 * 30 + var14 * 70) / 100;
|
||||
var19 = (var13 * 30 + var15 * 70) / 100;
|
||||
var13 = var17;
|
||||
var14 = var18;
|
||||
var15 = var19;
|
||||
}
|
||||
|
||||
this.imageData[var12 * 4 + 0] = (byte)var13;
|
||||
this.imageData[var12 * 4 + 1] = (byte)var14;
|
||||
this.imageData[var12 * 4 + 2] = (byte)var15;
|
||||
this.imageData[var12 * 4 + 3] = (byte)var16;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public class TextureFlamesFX extends TextureFX {
|
||||
protected float[] field_1133_g = new float[320];
|
||||
protected float[] field_1132_h = new float[320];
|
||||
|
||||
public TextureFlamesFX(int var1) {
|
||||
super(Block.fire.blockIndexInTexture + var1 * 16);
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
int var2;
|
||||
float var4;
|
||||
int var5;
|
||||
int var6;
|
||||
for(int var1 = 0; var1 < 16; ++var1) {
|
||||
for(var2 = 0; var2 < 20; ++var2) {
|
||||
int var3 = 18;
|
||||
var4 = this.field_1133_g[var1 + (var2 + 1) % 20 * 16] * (float)var3;
|
||||
|
||||
for(var5 = var1 - 1; var5 <= var1 + 1; ++var5) {
|
||||
for(var6 = var2; var6 <= var2 + 1; ++var6) {
|
||||
if(var5 >= 0 && var6 >= 0 && var5 < 16 && var6 < 20) {
|
||||
var4 += this.field_1133_g[var5 + var6 * 16];
|
||||
}
|
||||
|
||||
++var3;
|
||||
}
|
||||
}
|
||||
|
||||
this.field_1132_h[var1 + var2 * 16] = var4 / ((float)var3 * 1.06F);
|
||||
if(var2 >= 19) {
|
||||
this.field_1132_h[var1 + var2 * 16] = (float)(Math.random() * Math.random() * Math.random() * 4.0D + Math.random() * (double)0.1F + (double)0.2F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float[] var12 = this.field_1132_h;
|
||||
this.field_1132_h = this.field_1133_g;
|
||||
this.field_1133_g = var12;
|
||||
|
||||
for(var2 = 0; var2 < 256; ++var2) {
|
||||
float var13 = this.field_1133_g[var2] * 1.8F;
|
||||
if(var13 > 1.0F) {
|
||||
var13 = 1.0F;
|
||||
}
|
||||
|
||||
if(var13 < 0.0F) {
|
||||
var13 = 0.0F;
|
||||
}
|
||||
|
||||
var5 = (int)(var13 * 155.0F + 100.0F);
|
||||
var6 = (int)(var13 * var13 * 255.0F);
|
||||
int var7 = (int)(var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * var13 * 255.0F);
|
||||
short var8 = 255;
|
||||
if(var13 < 0.5F) {
|
||||
var8 = 0;
|
||||
}
|
||||
|
||||
var4 = (var13 - 0.5F) * 2.0F;
|
||||
if(this.anaglyphEnabled) {
|
||||
int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
|
||||
int var10 = (var5 * 30 + var6 * 70) / 100;
|
||||
int var11 = (var5 * 30 + var7 * 70) / 100;
|
||||
var5 = var9;
|
||||
var6 = var10;
|
||||
var7 = var11;
|
||||
}
|
||||
|
||||
this.imageData[var2 * 4 + 0] = (byte)var5;
|
||||
this.imageData[var2 * 4 + 1] = (byte)var6;
|
||||
this.imageData[var2 * 4 + 2] = (byte)var7;
|
||||
this.imageData[var2 * 4 + 3] = (byte)var8;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public class TextureLavaFX extends TextureFX {
|
||||
protected float[] field_1147_g = new float[256];
|
||||
protected float[] field_1146_h = new float[256];
|
||||
protected float[] field_1145_i = new float[256];
|
||||
protected float[] field_1144_j = new float[256];
|
||||
|
||||
public TextureLavaFX() {
|
||||
super(Block.lavaMoving.blockIndexInTexture);
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
int var2;
|
||||
float var3;
|
||||
int var5;
|
||||
int var6;
|
||||
int var7;
|
||||
int var8;
|
||||
int var9;
|
||||
for(int var1 = 0; var1 < 16; ++var1) {
|
||||
for(var2 = 0; var2 < 16; ++var2) {
|
||||
var3 = 0.0F;
|
||||
int var4 = (int)(MathHelper.sin((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
|
||||
var5 = (int)(MathHelper.sin((float)var1 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
|
||||
|
||||
for(var6 = var1 - 1; var6 <= var1 + 1; ++var6) {
|
||||
for(var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
|
||||
var8 = var6 + var4 & 15;
|
||||
var9 = var7 + var5 & 15;
|
||||
var3 += this.field_1147_g[var8 + var9 * 16];
|
||||
}
|
||||
}
|
||||
|
||||
this.field_1146_h[var1 + var2 * 16] = var3 / 10.0F + (this.field_1145_i[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.field_1145_i[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.field_1145_i[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
|
||||
this.field_1145_i[var1 + var2 * 16] += this.field_1144_j[var1 + var2 * 16] * 0.01F;
|
||||
if(this.field_1145_i[var1 + var2 * 16] < 0.0F) {
|
||||
this.field_1145_i[var1 + var2 * 16] = 0.0F;
|
||||
}
|
||||
|
||||
this.field_1144_j[var1 + var2 * 16] -= 0.06F;
|
||||
if(Math.random() < 0.005D) {
|
||||
this.field_1144_j[var1 + var2 * 16] = 1.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float[] var11 = this.field_1146_h;
|
||||
this.field_1146_h = this.field_1147_g;
|
||||
this.field_1147_g = var11;
|
||||
|
||||
for(var2 = 0; var2 < 256; ++var2) {
|
||||
var3 = this.field_1147_g[var2] * 2.0F;
|
||||
if(var3 > 1.0F) {
|
||||
var3 = 1.0F;
|
||||
}
|
||||
|
||||
if(var3 < 0.0F) {
|
||||
var3 = 0.0F;
|
||||
}
|
||||
|
||||
var5 = (int)(var3 * 100.0F + 155.0F);
|
||||
var6 = (int)(var3 * var3 * 255.0F);
|
||||
var7 = (int)(var3 * var3 * var3 * var3 * 128.0F);
|
||||
if(this.anaglyphEnabled) {
|
||||
var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
|
||||
var9 = (var5 * 30 + var6 * 70) / 100;
|
||||
int var10 = (var5 * 30 + var7 * 70) / 100;
|
||||
var5 = var8;
|
||||
var6 = var9;
|
||||
var7 = var10;
|
||||
}
|
||||
|
||||
this.imageData[var2 * 4 + 0] = (byte)var5;
|
||||
this.imageData[var2 * 4 + 1] = (byte)var6;
|
||||
this.imageData[var2 * 4 + 2] = (byte)var7;
|
||||
this.imageData[var2 * 4 + 3] = -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public class TextureLavaFlowFX extends TextureFX {
|
||||
protected float[] field_1143_g = new float[256];
|
||||
protected float[] field_1142_h = new float[256];
|
||||
protected float[] field_1141_i = new float[256];
|
||||
protected float[] field_1140_j = new float[256];
|
||||
int field_1139_k = 0;
|
||||
|
||||
public TextureLavaFlowFX() {
|
||||
super(Block.lavaMoving.blockIndexInTexture + 1);
|
||||
this.tileSize = 2;
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
++this.field_1139_k;
|
||||
|
||||
int var2;
|
||||
float var3;
|
||||
int var5;
|
||||
int var6;
|
||||
int var7;
|
||||
int var8;
|
||||
int var9;
|
||||
for(int var1 = 0; var1 < 16; ++var1) {
|
||||
for(var2 = 0; var2 < 16; ++var2) {
|
||||
var3 = 0.0F;
|
||||
int var4 = (int)(MathHelper.sin((float)var2 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
|
||||
var5 = (int)(MathHelper.sin((float)var1 * (float)Math.PI * 2.0F / 16.0F) * 1.2F);
|
||||
|
||||
for(var6 = var1 - 1; var6 <= var1 + 1; ++var6) {
|
||||
for(var7 = var2 - 1; var7 <= var2 + 1; ++var7) {
|
||||
var8 = var6 + var4 & 15;
|
||||
var9 = var7 + var5 & 15;
|
||||
var3 += this.field_1143_g[var8 + var9 * 16];
|
||||
}
|
||||
}
|
||||
|
||||
this.field_1142_h[var1 + var2 * 16] = var3 / 10.0F + (this.field_1141_i[(var1 + 0 & 15) + (var2 + 0 & 15) * 16] + this.field_1141_i[(var1 + 1 & 15) + (var2 + 0 & 15) * 16] + this.field_1141_i[(var1 + 1 & 15) + (var2 + 1 & 15) * 16] + this.field_1141_i[(var1 + 0 & 15) + (var2 + 1 & 15) * 16]) / 4.0F * 0.8F;
|
||||
this.field_1141_i[var1 + var2 * 16] += this.field_1140_j[var1 + var2 * 16] * 0.01F;
|
||||
if(this.field_1141_i[var1 + var2 * 16] < 0.0F) {
|
||||
this.field_1141_i[var1 + var2 * 16] = 0.0F;
|
||||
}
|
||||
|
||||
this.field_1140_j[var1 + var2 * 16] -= 0.06F;
|
||||
if(Math.random() < 0.005D) {
|
||||
this.field_1140_j[var1 + var2 * 16] = 1.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float[] var11 = this.field_1142_h;
|
||||
this.field_1142_h = this.field_1143_g;
|
||||
this.field_1143_g = var11;
|
||||
|
||||
for(var2 = 0; var2 < 256; ++var2) {
|
||||
var3 = this.field_1143_g[var2 - this.field_1139_k / 3 * 16 & 255] * 2.0F;
|
||||
if(var3 > 1.0F) {
|
||||
var3 = 1.0F;
|
||||
}
|
||||
|
||||
if(var3 < 0.0F) {
|
||||
var3 = 0.0F;
|
||||
}
|
||||
|
||||
var5 = (int)(var3 * 100.0F + 155.0F);
|
||||
var6 = (int)(var3 * var3 * 255.0F);
|
||||
var7 = (int)(var3 * var3 * var3 * var3 * 128.0F);
|
||||
if(this.anaglyphEnabled) {
|
||||
var8 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
|
||||
var9 = (var5 * 30 + var6 * 70) / 100;
|
||||
int var10 = (var5 * 30 + var7 * 70) / 100;
|
||||
var5 = var8;
|
||||
var6 = var9;
|
||||
var7 = var10;
|
||||
}
|
||||
|
||||
this.imageData[var2 * 4 + 0] = (byte)var5;
|
||||
this.imageData[var2 * 4 + 1] = (byte)var6;
|
||||
this.imageData[var2 * 4 + 2] = (byte)var7;
|
||||
this.imageData[var2 * 4 + 3] = -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public class TexturePortalFX extends TextureFX {
|
||||
private int portalTickCounter = 0;
|
||||
private byte[][] portalTextureData = new byte[32][1024];
|
||||
|
||||
public TexturePortalFX() {
|
||||
super(Block.portal.blockIndexInTexture);
|
||||
Random var1 = new Random(100L);
|
||||
|
||||
for(int var2 = 0; var2 < 32; ++var2) {
|
||||
for(int var3 = 0; var3 < 16; ++var3) {
|
||||
for(int var4 = 0; var4 < 16; ++var4) {
|
||||
float var5 = 0.0F;
|
||||
|
||||
int var6;
|
||||
for(var6 = 0; var6 < 2; ++var6) {
|
||||
float var7 = (float)(var6 * 8);
|
||||
float var8 = (float)(var6 * 8);
|
||||
float var9 = ((float)var3 - var7) / 16.0F * 2.0F;
|
||||
float var10 = ((float)var4 - var8) / 16.0F * 2.0F;
|
||||
if(var9 < -1.0F) {
|
||||
var9 += 2.0F;
|
||||
}
|
||||
|
||||
if(var9 >= 1.0F) {
|
||||
var9 -= 2.0F;
|
||||
}
|
||||
|
||||
if(var10 < -1.0F) {
|
||||
var10 += 2.0F;
|
||||
}
|
||||
|
||||
if(var10 >= 1.0F) {
|
||||
var10 -= 2.0F;
|
||||
}
|
||||
|
||||
float var11 = var9 * var9 + var10 * var10;
|
||||
float var12 = (float)Math.atan2((double)var10, (double)var9) + ((float)var2 / 32.0F * (float)Math.PI * 2.0F - var11 * 10.0F + (float)(var6 * 2)) * (float)(var6 * 2 - 1);
|
||||
var12 = (MathHelper.sin(var12) + 1.0F) / 2.0F;
|
||||
var12 /= var11 + 1.0F;
|
||||
var5 += var12 * 0.5F;
|
||||
}
|
||||
|
||||
var5 += var1.nextFloat() * 0.1F;
|
||||
var6 = (int)(var5 * 100.0F + 155.0F);
|
||||
int var13 = (int)(var5 * var5 * 200.0F + 55.0F);
|
||||
int var14 = (int)(var5 * var5 * var5 * var5 * 255.0F);
|
||||
int var15 = (int)(var5 * 100.0F + 155.0F);
|
||||
int var16 = var4 * 16 + var3;
|
||||
this.portalTextureData[var2][var16 * 4 + 0] = (byte)var13;
|
||||
this.portalTextureData[var2][var16 * 4 + 1] = (byte)var14;
|
||||
this.portalTextureData[var2][var16 * 4 + 2] = (byte)var6;
|
||||
this.portalTextureData[var2][var16 * 4 + 3] = (byte)var15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
++this.portalTickCounter;
|
||||
byte[] var1 = this.portalTextureData[this.portalTickCounter & 31];
|
||||
|
||||
for(int var2 = 0; var2 < 256; ++var2) {
|
||||
int var3 = var1[var2 * 4 + 0] & 255;
|
||||
int var4 = var1[var2 * 4 + 1] & 255;
|
||||
int var5 = var1[var2 * 4 + 2] & 255;
|
||||
int var6 = var1[var2 * 4 + 3] & 255;
|
||||
if(this.anaglyphEnabled) {
|
||||
int var7 = (var3 * 30 + var4 * 59 + var5 * 11) / 100;
|
||||
int var8 = (var3 * 30 + var4 * 70) / 100;
|
||||
int var9 = (var3 * 30 + var5 * 70) / 100;
|
||||
var3 = var7;
|
||||
var4 = var8;
|
||||
var5 = var9;
|
||||
}
|
||||
|
||||
this.imageData[var2 * 4 + 0] = (byte)var3;
|
||||
this.imageData[var2 * 4 + 1] = (byte)var4;
|
||||
this.imageData[var2 * 4 + 2] = (byte)var5;
|
||||
this.imageData[var2 * 4 + 3] = (byte)var6;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.lax1dude.eaglercraft.BufferedImage;
|
||||
import net.lax1dude.eaglercraft.ImageIO;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class TextureWatchFX extends TextureFX {
|
||||
private Minecraft mc;
|
||||
private int[] watchIconImageData = new int[256];
|
||||
private int[] dialImageData = new int[256];
|
||||
private double field_4222_j;
|
||||
private double field_4221_k;
|
||||
|
||||
public TextureWatchFX(Minecraft var1) {
|
||||
super(Item.pocketSundial.getIconFromDamage(0));
|
||||
this.mc = var1;
|
||||
this.tileImage = 1;
|
||||
|
||||
try {
|
||||
BufferedImage var2 = ImageIO.read(GL11.getResource("/gui/items.png"));
|
||||
int var3 = this.iconIndex % 16 * 16;
|
||||
int var4 = this.iconIndex / 16 * 16;
|
||||
var2.getRGB(var3, var4, 16, 16, this.watchIconImageData, 0, 16);
|
||||
var2 = ImageIO.read(GL11.getResource("/misc/dial.png"));
|
||||
var2.getRGB(0, 0, 16, 16, this.dialImageData, 0, 16);
|
||||
} catch (Exception var5) {
|
||||
var5.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
double var1 = 0.0D;
|
||||
if(this.mc.theWorld != null && this.mc.thePlayer != null) {
|
||||
float var3 = this.mc.theWorld.getCelestialAngle(1.0F);
|
||||
var1 = (double)(-var3 * (float)Math.PI * 2.0F);
|
||||
if(this.mc.theWorld.worldProvider.isNether) {
|
||||
var1 = Math.random() * (double)((float)Math.PI) * 2.0D;
|
||||
}
|
||||
}
|
||||
|
||||
double var22;
|
||||
for(var22 = var1 - this.field_4222_j; var22 < -Math.PI; var22 += Math.PI * 2.0D) {
|
||||
}
|
||||
|
||||
while(var22 >= Math.PI) {
|
||||
var22 -= Math.PI * 2.0D;
|
||||
}
|
||||
|
||||
if(var22 < -1.0D) {
|
||||
var22 = -1.0D;
|
||||
}
|
||||
|
||||
if(var22 > 1.0D) {
|
||||
var22 = 1.0D;
|
||||
}
|
||||
|
||||
this.field_4221_k += var22 * 0.1D;
|
||||
this.field_4221_k *= 0.8D;
|
||||
this.field_4222_j += this.field_4221_k;
|
||||
double var5 = Math.sin(this.field_4222_j);
|
||||
double var7 = Math.cos(this.field_4222_j);
|
||||
|
||||
for(int var9 = 0; var9 < 256; ++var9) {
|
||||
int var10 = this.watchIconImageData[var9] >> 24 & 255;
|
||||
int var11 = this.watchIconImageData[var9] >> 16 & 255;
|
||||
int var12 = this.watchIconImageData[var9] >> 8 & 255;
|
||||
int var13 = this.watchIconImageData[var9] >> 0 & 255;
|
||||
if(var11 == var13 && var12 == 0 && var13 > 0) {
|
||||
double var14 = -((double)(var9 % 16) / 15.0D - 0.5D);
|
||||
double var16 = (double)(var9 / 16) / 15.0D - 0.5D;
|
||||
int var18 = var11;
|
||||
int var19 = (int)((var14 * var7 + var16 * var5 + 0.5D) * 16.0D);
|
||||
int var20 = (int)((var16 * var7 - var14 * var5 + 0.5D) * 16.0D);
|
||||
int var21 = (var19 & 15) + (var20 & 15) * 16;
|
||||
var10 = this.dialImageData[var21] >> 24 & 255;
|
||||
var11 = (this.dialImageData[var21] >> 16 & 255) * var11 / 255;
|
||||
var12 = (this.dialImageData[var21] >> 8 & 255) * var18 / 255;
|
||||
var13 = (this.dialImageData[var21] >> 0 & 255) * var18 / 255;
|
||||
}
|
||||
|
||||
if(this.anaglyphEnabled) {
|
||||
int var23 = (var11 * 30 + var12 * 59 + var13 * 11) / 100;
|
||||
int var15 = (var11 * 30 + var12 * 70) / 100;
|
||||
int var24 = (var11 * 30 + var13 * 70) / 100;
|
||||
var11 = var23;
|
||||
var12 = var15;
|
||||
var13 = var24;
|
||||
}
|
||||
|
||||
this.imageData[var9 * 4 + 0] = (byte)var11;
|
||||
this.imageData[var9 * 4 + 1] = (byte)var12;
|
||||
this.imageData[var9 * 4 + 2] = (byte)var13;
|
||||
this.imageData[var9 * 4 + 3] = (byte)var10;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public class TextureWaterFX extends TextureFX {
|
||||
protected float[] field_1158_g = new float[256];
|
||||
protected float[] field_1157_h = new float[256];
|
||||
protected float[] field_1156_i = new float[256];
|
||||
protected float[] field_1155_j = new float[256];
|
||||
private int tickCounter = 0;
|
||||
|
||||
public TextureWaterFX() {
|
||||
super(Block.waterMoving.blockIndexInTexture);
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
++this.tickCounter;
|
||||
|
||||
int var1;
|
||||
int var2;
|
||||
float var3;
|
||||
int var5;
|
||||
int var6;
|
||||
for(var1 = 0; var1 < 16; ++var1) {
|
||||
for(var2 = 0; var2 < 16; ++var2) {
|
||||
var3 = 0.0F;
|
||||
|
||||
for(int var4 = var1 - 1; var4 <= var1 + 1; ++var4) {
|
||||
var5 = var4 & 15;
|
||||
var6 = var2 & 15;
|
||||
var3 += this.field_1158_g[var5 + var6 * 16];
|
||||
}
|
||||
|
||||
this.field_1157_h[var1 + var2 * 16] = var3 / 3.3F + this.field_1156_i[var1 + var2 * 16] * 0.8F;
|
||||
}
|
||||
}
|
||||
|
||||
for(var1 = 0; var1 < 16; ++var1) {
|
||||
for(var2 = 0; var2 < 16; ++var2) {
|
||||
this.field_1156_i[var1 + var2 * 16] += this.field_1155_j[var1 + var2 * 16] * 0.05F;
|
||||
if(this.field_1156_i[var1 + var2 * 16] < 0.0F) {
|
||||
this.field_1156_i[var1 + var2 * 16] = 0.0F;
|
||||
}
|
||||
|
||||
this.field_1155_j[var1 + var2 * 16] -= 0.1F;
|
||||
if(Math.random() < 0.05D) {
|
||||
this.field_1155_j[var1 + var2 * 16] = 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float[] var12 = this.field_1157_h;
|
||||
this.field_1157_h = this.field_1158_g;
|
||||
this.field_1158_g = var12;
|
||||
|
||||
for(var2 = 0; var2 < 256; ++var2) {
|
||||
var3 = this.field_1158_g[var2];
|
||||
if(var3 > 1.0F) {
|
||||
var3 = 1.0F;
|
||||
}
|
||||
|
||||
if(var3 < 0.0F) {
|
||||
var3 = 0.0F;
|
||||
}
|
||||
|
||||
float var13 = var3 * var3;
|
||||
var5 = (int)(32.0F + var13 * 32.0F);
|
||||
var6 = (int)(50.0F + var13 * 64.0F);
|
||||
int var7 = 255;
|
||||
int var8 = (int)(146.0F + var13 * 50.0F);
|
||||
if(this.anaglyphEnabled) {
|
||||
int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
|
||||
int var10 = (var5 * 30 + var6 * 70) / 100;
|
||||
int var11 = (var5 * 30 + var7 * 70) / 100;
|
||||
var5 = var9;
|
||||
var6 = var10;
|
||||
var7 = var11;
|
||||
}
|
||||
|
||||
this.imageData[var2 * 4 + 0] = (byte)var5;
|
||||
this.imageData[var2 * 4 + 1] = (byte)var6;
|
||||
this.imageData[var2 * 4 + 2] = (byte)var7;
|
||||
this.imageData[var2 * 4 + 3] = (byte)var8;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
public class TextureWaterFlowFX extends TextureFX {
|
||||
protected float[] field_1138_g = new float[256];
|
||||
protected float[] field_1137_h = new float[256];
|
||||
protected float[] field_1136_i = new float[256];
|
||||
protected float[] field_1135_j = new float[256];
|
||||
private int field_1134_k = 0;
|
||||
|
||||
public TextureWaterFlowFX() {
|
||||
super(Block.waterMoving.blockIndexInTexture + 1);
|
||||
this.tileSize = 2;
|
||||
}
|
||||
|
||||
public void onTick() {
|
||||
++this.field_1134_k;
|
||||
|
||||
int var1;
|
||||
int var2;
|
||||
float var3;
|
||||
int var5;
|
||||
int var6;
|
||||
for(var1 = 0; var1 < 16; ++var1) {
|
||||
for(var2 = 0; var2 < 16; ++var2) {
|
||||
var3 = 0.0F;
|
||||
|
||||
for(int var4 = var2 - 2; var4 <= var2; ++var4) {
|
||||
var5 = var1 & 15;
|
||||
var6 = var4 & 15;
|
||||
var3 += this.field_1138_g[var5 + var6 * 16];
|
||||
}
|
||||
|
||||
this.field_1137_h[var1 + var2 * 16] = var3 / 3.2F + this.field_1136_i[var1 + var2 * 16] * 0.8F;
|
||||
}
|
||||
}
|
||||
|
||||
for(var1 = 0; var1 < 16; ++var1) {
|
||||
for(var2 = 0; var2 < 16; ++var2) {
|
||||
this.field_1136_i[var1 + var2 * 16] += this.field_1135_j[var1 + var2 * 16] * 0.05F;
|
||||
if(this.field_1136_i[var1 + var2 * 16] < 0.0F) {
|
||||
this.field_1136_i[var1 + var2 * 16] = 0.0F;
|
||||
}
|
||||
|
||||
this.field_1135_j[var1 + var2 * 16] -= 0.3F;
|
||||
if(Math.random() < 0.2D) {
|
||||
this.field_1135_j[var1 + var2 * 16] = 0.5F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float[] var12 = this.field_1137_h;
|
||||
this.field_1137_h = this.field_1138_g;
|
||||
this.field_1138_g = var12;
|
||||
|
||||
for(var2 = 0; var2 < 256; ++var2) {
|
||||
var3 = this.field_1138_g[var2 - this.field_1134_k * 16 & 255];
|
||||
if(var3 > 1.0F) {
|
||||
var3 = 1.0F;
|
||||
}
|
||||
|
||||
if(var3 < 0.0F) {
|
||||
var3 = 0.0F;
|
||||
}
|
||||
|
||||
float var13 = var3 * var3;
|
||||
var5 = (int)(32.0F + var13 * 32.0F);
|
||||
var6 = (int)(50.0F + var13 * 64.0F);
|
||||
int var7 = 255;
|
||||
int var8 = (int)(146.0F + var13 * 50.0F);
|
||||
if(this.anaglyphEnabled) {
|
||||
int var9 = (var5 * 30 + var6 * 59 + var7 * 11) / 100;
|
||||
int var10 = (var5 * 30 + var6 * 70) / 100;
|
||||
int var11 = (var5 * 30 + var7 * 70) / 100;
|
||||
var5 = var9;
|
||||
var6 = var10;
|
||||
var7 = var11;
|
||||
}
|
||||
|
||||
this.imageData[var2 * 4 + 0] = (byte)var5;
|
||||
this.imageData[var2 * 4 + 1] = (byte)var6;
|
||||
this.imageData[var2 * 4 + 2] = (byte)var7;
|
||||
this.imageData[var2 * 4 + 3] = (byte)var8;
|
||||
}
|
||||
|
||||
}
|
||||
}
|