Fixed some rendering issues.
This commit is contained in:
parent
d7d0f241ff
commit
d541e492c4
1 changed files with 13 additions and 0 deletions
|
@ -106,6 +106,7 @@ public class ForgeHooksClient {
|
||||||
Tessellator.instance=t;
|
Tessellator.instance=t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static IRenderContextHandler unbindContext=null;
|
||||||
protected static void bindTexture(String name, int sub) {
|
protected static void bindTexture(String name, int sub) {
|
||||||
Integer n;
|
Integer n;
|
||||||
n=textures.get(name);
|
n=textures.get(name);
|
||||||
|
@ -115,12 +116,20 @@ public class ForgeHooksClient {
|
||||||
textures.put(name,n);
|
textures.put(name,n);
|
||||||
}
|
}
|
||||||
if(!inWorld) {
|
if(!inWorld) {
|
||||||
|
if(unbindContext!=null) {
|
||||||
|
unbindContext.afterRenderContext();
|
||||||
|
unbindContext=null;
|
||||||
|
}
|
||||||
if(Tessellator.instance.isDrawing) {
|
if(Tessellator.instance.isDrawing) {
|
||||||
int mode=Tessellator.instance.drawMode;
|
int mode=Tessellator.instance.drawMode;
|
||||||
Tessellator.instance.draw();
|
Tessellator.instance.draw();
|
||||||
Tessellator.instance.startDrawing(mode);
|
Tessellator.instance.startDrawing(mode);
|
||||||
}
|
}
|
||||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */,n);
|
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */,n);
|
||||||
|
unbindContext=renderHandlers.get(new TesKey(n,sub));
|
||||||
|
if(unbindContext!=null) {
|
||||||
|
unbindContext.beforeRenderContext();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bindTessellator(n,sub);
|
bindTessellator(n,sub);
|
||||||
|
@ -133,6 +142,10 @@ public class ForgeHooksClient {
|
||||||
if(Tessellator.instance.isDrawing) {
|
if(Tessellator.instance.isDrawing) {
|
||||||
int mode=Tessellator.instance.drawMode;
|
int mode=Tessellator.instance.drawMode;
|
||||||
Tessellator.instance.draw();
|
Tessellator.instance.draw();
|
||||||
|
if(unbindContext!=null) {
|
||||||
|
unbindContext.afterRenderContext();
|
||||||
|
unbindContext=null;
|
||||||
|
}
|
||||||
Tessellator.instance.startDrawing(mode);
|
Tessellator.instance.startDrawing(mode);
|
||||||
}
|
}
|
||||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||||
|
|
Loading…
Reference in a new issue