mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #49 - Fix unclosable pause menu glitch
This commit is contained in:
@ -10,7 +10,7 @@ public class EaglercraftVersion {
|
||||
/// Customize these to fit your fork:
|
||||
|
||||
public static final String projectForkName = "EaglercraftX";
|
||||
public static final String projectForkVersion = "u48";
|
||||
public static final String projectForkVersion = "u49";
|
||||
public static final String projectForkVendor = "lax1dude";
|
||||
|
||||
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
|
||||
@ -20,20 +20,20 @@ public class EaglercraftVersion {
|
||||
public static final String projectOriginName = "EaglercraftX";
|
||||
public static final String projectOriginAuthor = "lax1dude";
|
||||
public static final String projectOriginRevision = "1.8";
|
||||
public static final String projectOriginVersion = "u48";
|
||||
public static final String projectOriginVersion = "u49";
|
||||
|
||||
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; // rest in peace
|
||||
|
||||
// EPK Version Identifier
|
||||
|
||||
public static final String EPKVersionIdentifier = "u48"; // Set to null to disable EPK version check
|
||||
public static final String EPKVersionIdentifier = "u49"; // Set to null to disable EPK version check
|
||||
|
||||
// Updating configuration
|
||||
|
||||
public static final boolean enableUpdateService = true;
|
||||
|
||||
public static final String updateBundlePackageName = "net.lax1dude.eaglercraft.v1_8.client";
|
||||
public static final int updateBundlePackageVersionInt = 48;
|
||||
public static final int updateBundlePackageVersionInt = 49;
|
||||
|
||||
public static final String updateLatestLocalStorageKey = "latestUpdate_" + updateBundlePackageName;
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.internal.vfs2;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.EaglerOutputStream;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023-2024 lax1dude. All Rights Reserved.
|
||||
* Copyright (c) 2023-2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
@ -21,29 +21,58 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
class VFileOutputStream extends EaglerOutputStream {
|
||||
class VFileOutputStream extends OutputStream {
|
||||
|
||||
private final VFile2 vfsFile;
|
||||
private boolean closed = false;
|
||||
private ByteBuffer buffer;
|
||||
|
||||
VFileOutputStream(VFile2 vfsFile) {
|
||||
super(256);
|
||||
this.buffer = PlatformRuntime.allocateByteBuffer(256);
|
||||
this.vfsFile = vfsFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
if(buffer == null) throw new IOException("File is closed!");
|
||||
if(buffer.remaining() < 1) {
|
||||
buffer.flip();
|
||||
ByteBuffer buf = PlatformRuntime.allocateByteBuffer(buffer.limit() << 1);
|
||||
buf.put(buffer);
|
||||
PlatformRuntime.freeByteBuffer(buffer);
|
||||
buffer = buf;
|
||||
}
|
||||
buffer.put((byte)(b & 0xFF));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
if(buffer == null) throw new IOException("File is closed!");
|
||||
if(buffer.remaining() < len) {
|
||||
buffer.flip();
|
||||
int oldLen = buffer.limit();
|
||||
int newLen = oldLen;
|
||||
do {
|
||||
newLen <<= 1;
|
||||
}while(newLen < oldLen + len);
|
||||
ByteBuffer buf = PlatformRuntime.allocateByteBuffer(newLen);
|
||||
buf.put(buffer);
|
||||
PlatformRuntime.freeByteBuffer(buffer);
|
||||
buffer = buf;
|
||||
}
|
||||
buffer.put(b, off, len);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
if(!closed) {
|
||||
closed = true;
|
||||
ByteBuffer copyBuffer = PlatformRuntime.allocateByteBuffer(count);
|
||||
if(buffer != null) {
|
||||
buffer.flip();
|
||||
try {
|
||||
copyBuffer.put(buf, 0, count);
|
||||
copyBuffer.flip();
|
||||
vfsFile.getFS().eaglerWrite(vfsFile.path, copyBuffer);
|
||||
vfsFile.getFS().eaglerWrite(vfsFile.path, buffer);
|
||||
}catch(Throwable t) {
|
||||
throw new IOException("Could not write stream contents to file!", t);
|
||||
}finally {
|
||||
PlatformRuntime.freeByteBuffer(copyBuffer);
|
||||
PlatformRuntime.freeByteBuffer(buffer);
|
||||
buffer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import net.lax1dude.eaglercraft.v1_8.EagRuntime;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldVertexBufferUploader;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -25,7 +24,6 @@ public class ChunkUpdateManager {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
private final WorldVertexBufferUploader worldVertexUploader;
|
||||
private final RegionRenderCacheBuilder renderCache;
|
||||
|
||||
private int chunkUpdatesTotal = 0;
|
||||
@ -39,7 +37,6 @@ public class ChunkUpdateManager {
|
||||
private final List<ChunkCompileTaskGenerator> queue = new LinkedList<>();
|
||||
|
||||
public ChunkUpdateManager() {
|
||||
worldVertexUploader = new WorldVertexBufferUploader();
|
||||
renderCache = new RegionRenderCacheBuilder();
|
||||
}
|
||||
|
||||
@ -202,9 +199,7 @@ public class ChunkUpdateManager {
|
||||
|
||||
private void uploadDisplayList(WorldRenderer chunkRenderer, int parInt1, RenderChunk parRenderChunk) {
|
||||
EaglercraftGPU.glNewList(parInt1, GL_COMPILE);
|
||||
GlStateManager.pushMatrix();
|
||||
this.worldVertexUploader.func_181679_a(chunkRenderer);
|
||||
GlStateManager.popMatrix();
|
||||
WorldVertexBufferUploader.func_181679_a(chunkRenderer);
|
||||
EaglercraftGPU.glEndList();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,344 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.minecraft;
|
||||
|
||||
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
|
||||
|
||||
import java.util.BitSet;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
|
||||
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.BetterFrustum;
|
||||
import net.lax1dude.eaglercraft.v1_8.vector.Matrix4f;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
public class EaglerCloudRenderer {
|
||||
|
||||
private static final ResourceLocation locationCloudsPNG = new ResourceLocation("textures/environment/clouds.png");
|
||||
|
||||
private final Minecraft mc;
|
||||
|
||||
private int renderList = -1;
|
||||
|
||||
private static final int RENDER_STATE_FAST = 0;
|
||||
private static final int RENDER_STATE_FANCY_BELOW = 1;
|
||||
private static final int RENDER_STATE_FANCY_INSIDE = 2;
|
||||
private static final int RENDER_STATE_FANCY_ABOVE = 3;
|
||||
|
||||
private int currentRenderState = -1;
|
||||
|
||||
private int[] renderListFancy = new int[] { -1, -1, -1, -1, -1, -1, -1, -1, -1 };
|
||||
|
||||
// 1.8 seems to use a different projection matrix for clouds
|
||||
private final Matrix4f fancyCloudProjView = new Matrix4f();
|
||||
private final BetterFrustum frustum = new BetterFrustum();
|
||||
|
||||
private final BitSet visibleCloudParts = new BitSet();
|
||||
|
||||
public EaglerCloudRenderer(Minecraft mc) {
|
||||
this.mc = mc;
|
||||
}
|
||||
|
||||
public void renderClouds(float partialTicks, int pass) {
|
||||
if (!this.mc.theWorld.provider.isSurfaceWorld()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int c = mc.gameSettings.func_181147_e();
|
||||
if(c == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int newState;
|
||||
Entity rve = this.mc.getRenderViewEntity();
|
||||
float f = (float) (rve.lastTickPosY + (rve.posY - rve.lastTickPosY) * (double) partialTicks);
|
||||
float f3 = this.mc.theWorld.provider.getCloudHeight() - f + 0.33F;
|
||||
if(c == 2) {
|
||||
if (f3 > -5.0F) {
|
||||
if (f3 <= 5.0F) {
|
||||
newState = RENDER_STATE_FANCY_INSIDE;
|
||||
}else {
|
||||
newState = RENDER_STATE_FANCY_ABOVE;
|
||||
}
|
||||
}else {
|
||||
newState = RENDER_STATE_FANCY_BELOW;
|
||||
}
|
||||
}else {
|
||||
newState = RENDER_STATE_FAST;
|
||||
}
|
||||
|
||||
if(newState != currentRenderState) {
|
||||
rebuild(newState);
|
||||
currentRenderState = newState;
|
||||
}
|
||||
|
||||
mc.getTextureManager().bindTexture(locationCloudsPNG);
|
||||
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
||||
Vec3 vec3 = mc.theWorld.getCloudColour(partialTicks);
|
||||
float _f1 = (float) vec3.xCoord;
|
||||
float _f2 = (float) vec3.yCoord;
|
||||
float _f3 = (float) vec3.zCoord;
|
||||
if (pass != 2) {
|
||||
float _f4 = (_f1 * 30.0F + _f2 * 59.0F + _f3 * 11.0F) / 100.0F;
|
||||
float _f5 = (_f1 * 30.0F + _f2 * 70.0F) / 100.0F;
|
||||
float _f6 = (_f1 * 30.0F + _f3 * 70.0F) / 100.0F;
|
||||
_f1 = _f4;
|
||||
_f2 = _f5;
|
||||
_f3 = _f6;
|
||||
}
|
||||
|
||||
if(newState != RENDER_STATE_FAST) {
|
||||
GlStateManager.disableCull();
|
||||
double d0 = this.mc.renderGlobal.getCloudCounter(partialTicks);
|
||||
double d1 = (rve.prevPosX + (rve.posX - rve.prevPosX) * (double) partialTicks + d0 * 0.029999999329447746D) / 12.0D;
|
||||
double d2 = (rve.prevPosZ + (rve.posZ - rve.prevPosZ) * (double) partialTicks) / 12.0D + 0.33000001311302185D;
|
||||
int i = MathHelper.floor_double(d1 / 2048.0D);
|
||||
int j = MathHelper.floor_double(d2 / 2048.0D);
|
||||
d1 = d1 - (double) (i * 2048);
|
||||
d2 = d2 - (double) (j * 2048);
|
||||
float f17 = (float) MathHelper.floor_double(d1) * 0.00390625F;
|
||||
float f18 = (float) MathHelper.floor_double(d2) * 0.00390625F;
|
||||
float f19 = (float) (d1 - (double) MathHelper.floor_double(d1));
|
||||
float f20 = (float) (d2 - (double) MathHelper.floor_double(d2));
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(12.0F, 1.0F, 12.0F);
|
||||
|
||||
Matrix4f.mul(GlStateManager.getProjectionReference(), GlStateManager.getModelViewReference(), fancyCloudProjView);
|
||||
frustum.set(fancyCloudProjView);
|
||||
|
||||
visibleCloudParts.clear();
|
||||
|
||||
for (int k = 0; k < 2; ++k) {
|
||||
if (k == 0) {
|
||||
GlStateManager.colorMask(false, false, false, false);
|
||||
} else {
|
||||
switch (pass) {
|
||||
case 0:
|
||||
GlStateManager.colorMask(false, true, true, true);
|
||||
break;
|
||||
case 1:
|
||||
GlStateManager.colorMask(true, false, false, true);
|
||||
break;
|
||||
case 2:
|
||||
GlStateManager.colorMask(true, true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
int j1;
|
||||
for (int l = -3; l <= 3; ++l) {
|
||||
for (int i1 = -3; i1 <= 3; ++i1) {
|
||||
float f22 = (float) (l * 8);
|
||||
float f23 = (float) (i1 * 8);
|
||||
float f24 = f22 - f19;
|
||||
float f25 = f23 - f20;
|
||||
|
||||
j1 = (l + 3) * 7 + i1 + 3;
|
||||
if(k == 0) {
|
||||
if(frustum.testAab(f24, f3, f25, (f24 + 8.0f), f3 + 4.0f, (f25 + 8.0f))) {
|
||||
visibleCloudParts.set(j1);
|
||||
}else {
|
||||
continue;
|
||||
}
|
||||
}else {
|
||||
if(!visibleCloudParts.get(j1)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(f24, f3, f25);
|
||||
if(k != 0) {
|
||||
GlStateManager.color(_f1, _f2, _f3, 0.8f);
|
||||
}
|
||||
GlStateManager.matrixMode(GL_TEXTURE);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(f22 * 0.00390625F + f17, f23 * 0.00390625F + f18, 0.0f);
|
||||
|
||||
int xx = 0;
|
||||
int yy = 0;
|
||||
if (l <= -1) {
|
||||
xx = -1;
|
||||
}else if (l >= 1) {
|
||||
xx = 1;
|
||||
}
|
||||
|
||||
if (i1 <= -1) {
|
||||
yy = -1;
|
||||
}else if (i1 >= 1) {
|
||||
yy = 1;
|
||||
}
|
||||
|
||||
EaglercraftGPU.glCallList(renderListFancy[(yy + 1) * 3 + xx + 1]);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.matrixMode(GL_MODELVIEW);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}else {
|
||||
GlStateManager.disableCull();
|
||||
double d2 = this.mc.renderGlobal.getCloudCounter(partialTicks);
|
||||
double d0 = rve.prevPosX + (rve.posX - rve.prevPosX) * (double) partialTicks + d2 * 0.029999999329447746D;
|
||||
double d1 = rve.prevPosZ + (rve.posZ - rve.prevPosZ) * (double) partialTicks;
|
||||
int i = MathHelper.floor_double(d0 / 2048.0D);
|
||||
int j = MathHelper.floor_double(d1 / 2048.0D);
|
||||
d0 = d0 - (double) (i * 2048);
|
||||
d1 = d1 - (double) (j * 2048);
|
||||
float f8 = (float) (d0 * 4.8828125E-4D);
|
||||
float f9 = (float) (d1 * 4.8828125E-4D);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(0.0f, f3, 0.0f);
|
||||
GlStateManager.color(_f1, _f2, _f3, 0.8f);
|
||||
GlStateManager.matrixMode(GL_TEXTURE);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(f8, f9, 0.0f);
|
||||
EaglercraftGPU.glCallList(renderList);
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.matrixMode(GL_MODELVIEW);
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableCull();
|
||||
}
|
||||
|
||||
private void rebuild(int newState) {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
if(newState != RENDER_STATE_FAST) {
|
||||
if(renderList != -1) {
|
||||
EaglercraftGPU.glDeleteLists(renderList);
|
||||
renderList = -1;
|
||||
}
|
||||
for(int i = 0; i < renderListFancy.length; ++i) {
|
||||
if(renderListFancy[i] == -1) {
|
||||
renderListFancy[i] = EaglercraftGPU.glGenLists();
|
||||
}
|
||||
EaglercraftGPU.glNewList(renderListFancy[i], GL_COMPILE);
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
generateFancyClouds(worldrenderer, i, newState != RENDER_STATE_FANCY_BELOW, newState != RENDER_STATE_FANCY_ABOVE);
|
||||
tessellator.draw();
|
||||
EaglercraftGPU.glEndList();
|
||||
}
|
||||
}else {
|
||||
if(renderList == -1) {
|
||||
renderList = EaglercraftGPU.glGenLists();
|
||||
}
|
||||
for(int i = 0; i < renderListFancy.length; ++i) {
|
||||
if(renderListFancy[i] != -1) {
|
||||
EaglercraftGPU.glDeleteLists(renderListFancy[i]);
|
||||
renderListFancy[i] = -1;
|
||||
}
|
||||
}
|
||||
EaglercraftGPU.glNewList(renderList, GL_COMPILE);
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
final double d = 4.8828125E-4;
|
||||
worldrenderer.pos(-256.0f, 0.0f, 256.0f).tex(-256.0f * d, 256.0f * d).endVertex();
|
||||
worldrenderer.pos(256.0f, 0.0f, 256.0f).tex(256.0f * d, 256.0f * d).endVertex();
|
||||
worldrenderer.pos(256.0f, 0.0f, -256.0f).tex(256.0f * d, -256.0f * d).endVertex();
|
||||
worldrenderer.pos(-256.0f, 0.0f, -256.0f).tex(-256.0f * d, -256.0f * d).endVertex();
|
||||
tessellator.draw();
|
||||
EaglercraftGPU.glEndList();
|
||||
}
|
||||
}
|
||||
|
||||
private static void generateFancyClouds(WorldRenderer worldrenderer, int mesh, boolean renderAbove, boolean renderBelow) {
|
||||
if (renderAbove) {
|
||||
worldrenderer.pos(0.0f, 0.0f, 8.0f).tex(0.0f, 8.0f * 0.00390625F).color(0.7f, 0.7f, 0.7f, 1.0f).endVertex();
|
||||
worldrenderer.pos(8.0f, 0.0f, 8.0f).tex(8.0f * 0.00390625f, 8.0f * 0.00390625f).color(0.7f, 0.7f, 0.7f, 1.0f).endVertex();
|
||||
worldrenderer.pos(8.0f, 0.0f, 0.0f).tex(8.0f * 0.00390625f, 0.0f).color(0.7f, 0.7f, 0.7f, 1.0f).endVertex();
|
||||
worldrenderer.pos(0.0f, 0.0f, 0.0f).tex(0.0f, 0.0f).color(0.7f, 0.7f, 0.7f, 1.0f).endVertex();
|
||||
}
|
||||
|
||||
if (renderBelow) {
|
||||
worldrenderer.pos(0.0f, 4.0f - 9.765625E-4f, 8.0f).tex(0.0f, 8.0f * 0.00390625f).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex();
|
||||
worldrenderer.pos(8.0f, 4.0f - 9.765625E-4f, 8.0f).tex(8.0f * 0.00390625F, 8.0f * 0.00390625f).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex();
|
||||
worldrenderer.pos(8.0f, 4.0f - 9.765625E-4f, 0.0f).tex(8.0f * 0.00390625f, 0.0f).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex();
|
||||
worldrenderer.pos(0.0f, 4.0f - 9.765625E-4f, 0.0f).tex(0.0f, 0.0f).color(1.0f, 1.0f, 1.0f, 1.0f).endVertex();
|
||||
}
|
||||
|
||||
int xx = (mesh % 3) - 1;
|
||||
int yy = (mesh / 3) - 1;
|
||||
|
||||
if (xx != -1) {
|
||||
for (int j1 = 0; j1 < 8; ++j1) {
|
||||
worldrenderer.pos(j1, 0.0f, 8.0f).tex((j1 + 0.5f) * 0.00390625f, 8.0f * 0.00390625f)
|
||||
.color(0.9f, 0.9f, 0.9f, 1.0f).endVertex();
|
||||
worldrenderer.pos(j1, 4.0f, 8.0f).tex((j1 + 0.5f) * 0.00390625f, 8.0f * 0.00390625f)
|
||||
.color(0.9f, 0.9f, 0.9f, 1.0f).endVertex();
|
||||
worldrenderer.pos(j1, 4.0f, 0.0f).tex((j1 + 0.5f) * 0.00390625f, 0.0f).color(0.9f, 0.9f, 0.9f, 1.0f)
|
||||
.endVertex();
|
||||
worldrenderer.pos(j1, 0.0f, 0.0f).tex((j1 + 0.5f) * 0.00390625f, 0.0f).color(0.9f, 0.9f, 0.9f, 1.0f)
|
||||
.endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
if (xx != 1) {
|
||||
for (int k1 = 0; k1 < 8; ++k1) {
|
||||
worldrenderer.pos(k1 + 1.0f - 9.765625E-4f, 0.0f, 8.0f)
|
||||
.tex((k1 + 0.5f) * 0.00390625f, 8.0f * 0.00390625f).color(0.9f, 0.9f, 0.9f, 1.0f).endVertex();
|
||||
worldrenderer.pos(k1 + 1.0f - 9.765625E-4f, 4.0f, 8.0f)
|
||||
.tex((k1 + 0.5f) * 0.00390625f, 8.0f * 0.00390625f).color(0.9f, 0.9f, 0.9f, 1.0f).endVertex();
|
||||
worldrenderer.pos(k1 + 1.0f - 9.765625E-4f, 4.0f, 0.0f).tex((k1 + 0.5f) * 0.00390625f, 0.0f)
|
||||
.color(0.9f, 0.9f, 0.9f, 1.0f).endVertex();
|
||||
worldrenderer.pos(k1 + 1.0f - 9.765625E-4f, 0.0f, 0.0f).tex((k1 + 0.5f) * 0.00390625f, 0.0f)
|
||||
.color(0.9f, 0.9f, 0.9f, 1.0f).endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
if (yy != -1) {
|
||||
for (int l1 = 0; l1 < 8; ++l1) {
|
||||
worldrenderer.pos(0.0f, 4.0f, l1).tex(0.0f, (l1 + 0.5f) * 0.00390625f).color(0.8f, 0.8f, 0.8f, 1.0f)
|
||||
.endVertex();
|
||||
worldrenderer.pos(8.0f, 4.0f, l1).tex(8.0f * 0.00390625f, (l1 + 0.5f) * 0.00390625f)
|
||||
.color(0.8f, 0.8f, 0.8f, 1.0f).endVertex();
|
||||
worldrenderer.pos(8.0f, 0.0f, l1).tex(8.0f * 0.00390625f, (l1 + 0.5f) * 0.00390625f)
|
||||
.color(0.8f, 0.8f, 0.8f, 1.0f).endVertex();
|
||||
worldrenderer.pos(0.0f, 0.0f, l1).tex(0.0f, (l1 + 0.5f) * 0.00390625f).color(0.8f, 0.8f, 0.8f, 1.0f)
|
||||
.endVertex();
|
||||
}
|
||||
}
|
||||
|
||||
if (yy != 1) {
|
||||
for (int i2 = 0; i2 < 8; ++i2) {
|
||||
worldrenderer.pos(0.0f, 4.0f, i2 + 1.0f - 9.765625E-4f).tex(0.0f, (i2 + 0.5f) * 0.00390625f)
|
||||
.color(0.8f, 0.8f, 0.8f, 1.0f).endVertex();
|
||||
worldrenderer.pos(8.0f, 4.0f, i2 + 1.0f - 9.765625E-4f)
|
||||
.tex(8.0f * 0.00390625f, (i2 + 0.5f) * 0.00390625f).color(0.8f, 0.8f, 0.8f, 1.0f).endVertex();
|
||||
worldrenderer.pos(8.0f, 0.0f, i2 + 1.0f - 9.765625E-4f)
|
||||
.tex(8.0f * 0.00390625f, (i2 + 0.5f) * 0.00390625f).color(0.8f, 0.8f, 0.8f, 1.0f).endVertex();
|
||||
worldrenderer.pos(0.0f, 0.0f, i2 + 1.0f - 9.765625E-4f).tex(0.0f, (i2 + 0.5f) * 0.00390625f)
|
||||
.color(0.8f, 0.8f, 0.8f, 1.0f).endVertex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -268,16 +268,19 @@ public class GlStateManager {
|
||||
private static final Vector4f paramVector4 = new Vector4f();
|
||||
public static final void enableMCLight(int light, float diffuse, double dirX,
|
||||
double dirY, double dirZ, double dirW) {
|
||||
if(dirW != 0.0) throw new IllegalArgumentException("dirW must be 0.0!");
|
||||
paramVector4.x = (float)dirX;
|
||||
paramVector4.y = (float)dirY;
|
||||
paramVector4.z = (float)dirZ;
|
||||
paramVector4.w = (float)dirW;
|
||||
paramVector4.w = (float)0.0f;
|
||||
Matrix4f.transform(modelMatrixStack[modelMatrixStackPointer], paramVector4, paramVector4);
|
||||
paramVector4.normalise();
|
||||
Vector4f dest = stateLightsStack[stateLightsStackPointer][light];
|
||||
dest.x = paramVector4.x;
|
||||
dest.y = paramVector4.y;
|
||||
dest.z = paramVector4.z;
|
||||
float len = MathHelper.sqrt_float(paramVector4.x * paramVector4.x
|
||||
+ paramVector4.y * paramVector4.y
|
||||
+ paramVector4.z * paramVector4.z);
|
||||
dest.x = paramVector4.x / len;
|
||||
dest.y = paramVector4.y / len;
|
||||
dest.z = paramVector4.z / len;
|
||||
dest.w = diffuse;
|
||||
stateLightsEnabled[stateLightsStackPointer][light] = true;
|
||||
++stateLightingSerial[stateLightsStackPointer];
|
||||
@ -1267,6 +1270,10 @@ public class GlStateManager {
|
||||
return modelMatrixStack[modelMatrixStackPointer];
|
||||
}
|
||||
|
||||
public static final Matrix4f getProjectionReference() {
|
||||
return projectionMatrixStack[projectionMatrixStackPointer];
|
||||
}
|
||||
|
||||
public static void recompileShaders() {
|
||||
FixedFunctionPipeline.flushCache();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
|
||||
*
|
||||
*/
|
||||
public class WorldVertexBufferUploader {
|
||||
public void func_181679_a(WorldRenderer parWorldRenderer) {
|
||||
public static void func_181679_a(WorldRenderer parWorldRenderer) {
|
||||
int cunt = parWorldRenderer.getVertexCount();
|
||||
if (cunt > 0) {
|
||||
VertexFormat fmt = parWorldRenderer.getVertexFormat();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.texture;
|
||||
|
||||
import net.lax1dude.eaglercraft.v1_8.internal.IFramebufferGL;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
@ -47,7 +47,7 @@ public class SkinPackets {
|
||||
k = i * 3 + 2;
|
||||
packet[k] = v3data[j + 1];
|
||||
packet[k + 1] = v3data[j + 2];
|
||||
packet[k + 2] = (byte)((v3data[j + 3] >>> 1) | (v3data[j] & 0x80));
|
||||
packet[k + 2] = (byte)(((v3data[j + 3] & 0xFF) >>> 1) | (v3data[j] & 0x80));
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class GameProtocolMessageController {
|
||||
pkt = sendQueueV4.remove(0);
|
||||
sendFunction.sendPluginMessage(GamePluginMessageConstants.V4_CHANNEL, pkt);
|
||||
}else {
|
||||
int i, j, sendCount, totalLen;
|
||||
int i, j, sendCount, totalLen, lastLen;
|
||||
PacketBuffer sendBuffer;
|
||||
while(sendQueueV4.size() > 0) {
|
||||
sendCount = 0;
|
||||
@ -153,11 +153,13 @@ public class GameProtocolMessageController {
|
||||
Iterator<PacketBuffer> itr = sendQueueV4.iterator();
|
||||
do {
|
||||
i = itr.next().readableBytes();
|
||||
totalLen += GamePacketOutputBuffer.getVarIntSize(i) + i;
|
||||
lastLen = GamePacketOutputBuffer.getVarIntSize(i) + i;
|
||||
totalLen += lastLen;
|
||||
++sendCount;
|
||||
}while(totalLen < 32760 && itr.hasNext());
|
||||
if(totalLen >= 32760) {
|
||||
--sendCount;
|
||||
totalLen -= lastLen;
|
||||
}
|
||||
if(sendCount <= 1) {
|
||||
pkt = sendQueueV4.remove(0);
|
||||
|
Reference in New Issue
Block a user