Update #32 - Fixed some bugs in the client

This commit is contained in:
lax1dude
2024-05-30 21:42:11 -07:00
parent 6ea4ffe62d
commit aeb63fcd41
23 changed files with 214 additions and 52 deletions

View File

@ -488,6 +488,17 @@ public class EaglercraftGPU {
return mapTexturesGL.get(tex);
}
public static final void regenerateTexture(int tex) {
ITextureGL webglTex = mapTexturesGL.get(tex);
if(webglTex != null) {
GlStateManager.unbindTextureIfCached(tex);
_wglDeleteTextures(webglTex);
mapTexturesGL.set(tex, _wglGenTextures());
}else {
logger.error("Tried to regenerate a missing texture!");
}
}
public static final void drawHighPoly(HighPolyMesh mesh) {
if(mesh.vertexCount == 0 || mesh.indexCount == 0 || mesh.vertexArray == null) {
return;

View File

@ -589,18 +589,25 @@ public class GlStateManager {
}
public static final void deleteTexture(int texture) {
unbindTextureIfCached(texture);
_wglDeleteTextures(EaglercraftGPU.mapTexturesGL.free(texture));
boolean f = false;
}
static final void unbindTextureIfCached(int texture) {
boolean f1, f2 = false;
for(int i = 0; i < boundTexture.length; ++i) {
if(boundTexture[i] == texture) {
_wglActiveTexture(GL_TEXTURE0 + i);
f1 = i != activeTexture;
if(f2 || f1) {
_wglActiveTexture(GL_TEXTURE0 + i);
f2 = f1;
}
_wglBindTexture(GL_TEXTURE_2D, null);
_wglBindTexture(GL_TEXTURE_3D, null);
boundTexture[i] = -1;
f = true;
}
}
if(f) {
if(f2) {
_wglActiveTexture(GL_TEXTURE0 + activeTexture);
}
}

View File

@ -2058,7 +2058,7 @@ public class EaglerDeferredPipeline {
GlStateManager.disableBlend();
if(reprojectionEngineEnable || config.realisticWater) {
if(reprojectionEngineEnable || config.is_rendering_realisticWater) {
// =========== SAVE REPROJECTION DATA FOR NEXT FRAME ============= //