Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
hibi
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamesuta committed Sep 26, 2016
1 parent d68cab6 commit a4a191e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void draw(final WEvent ev, final Area pgp, final Point p, final float fra
translate(a);
GlStateManager.translate((a.w()-size2.width)/2f, (a.h()-size2.height)/2f, 0f);
GlStateManager.scale(100, 100, 1f);
Client.renderer.renderImage(content, size, 1f);
Client.renderer.renderImage(content, size, -1, 1f);

GlStateManager.popMatrix();
GlStateManager.enableCull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class CustomTileEntitySignRenderer extends TileEntitySignRenderer

public CustomTileEntitySignRenderer() {}

public void renderImage(final Content content, final ImageSize size, final float opacity) {
public void renderImage(final Content content, final ImageSize size, final int destroy, final float opacity) {
GlStateManager.pushMatrix();
GlStateManager.scale(size.width, size.height, 1f);
if (content.state.getType() == ContentStateType.AVAILABLE) {
Expand All @@ -44,6 +44,22 @@ public void renderImage(final Content content, final ImageSize size, final float
this.t.pos(1, 0, 0).endVertex();
RenderHelper.t.draw();
}

if (destroy>= 0) {
GlStateManager.pushMatrix();
RenderHelper.startTexture();
bindTexture(DESTROY_STAGES[destroy]);
GlStateManager.translate(0f, 0f, .01f);
this.t.begin(GL_QUADS, DefaultVertexFormats.POSITION_TEX);
RenderHelper.addRectVertex(0, 0, 1, 1);
RenderHelper.t.draw();
GlStateManager.translate(0f, 0f, -.02f);
this.t.begin(GL_QUADS, DefaultVertexFormats.POSITION_TEX);
RenderHelper.addRectVertex(0, 0, 1, 1);
RenderHelper.t.draw();
GlStateManager.popMatrix();
}

GlStateManager.popMatrix();

if (size.width<1.5f || size.height<1.5) {
Expand Down Expand Up @@ -82,22 +98,7 @@ public void renderSignPicture(final Entry entry, final int destroy, final float
GlStateManager.translate(-size.width/2, size.height + ((size.height>=0)?0:-size.height)-.5f, 0f);
GlStateManager.scale(1f, -1f, 1f);

if (destroy>= 0) {
GlStateManager.pushMatrix();
RenderHelper.startTexture();
bindTexture(DESTROY_STAGES[destroy]);
GlStateManager.translate(0f, 0f, .01f);
this.t.begin(GL_QUADS, DefaultVertexFormats.POSITION_TEX);
RenderHelper.addRectVertex(0, 0, 1, 1);
RenderHelper.t.draw();
GlStateManager.translate(0f, 0f, -.02f);
this.t.begin(GL_QUADS, DefaultVertexFormats.POSITION_TEX);
RenderHelper.addRectVertex(0, 0, 1, 1);
RenderHelper.t.draw();
GlStateManager.popMatrix();
}

renderImage(content, size, opacity);
renderImage(content, size, destroy, opacity);

GlStateManager.popMatrix();
}
Expand All @@ -108,7 +109,7 @@ public void renderSignPictureBase(final TileEntitySign tile, final double x, fin
if (CurrentMode.instance.isState(CurrentMode.State.SEE)) {
RenderHelper.startTexture();
GlStateManager.color(1f, 1f, 1f, opacity * .5f);
super.renderTileEntityAt(tile, x, y, z, partialTicks, (int)opacity);
super.renderTileEntityAt(tile, x, y, z, partialTicks, destroy);
}

// Vanilla Translate
Expand Down

0 comments on commit a4a191e

Please sign in to comment.