Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class BakedQuadVertexBuilder implements VertexConsumer, ISpriteAwareVerte
private final List<BakedQuad> quadList = new ArrayList<>();
private final VertexFormat.Mode mode;

private boolean shade = false;
private boolean ambientOcclusion = true;

private final Quad current = new Quad();
private int vertex = -1;

Expand All @@ -38,9 +41,15 @@ public BakedQuadVertexBuilder(VertexFormat.Mode mode) {

public void reset() {
quadList.clear();
shade = false;
ambientOcclusion = true;
vertex = -1;
}

public void setShade(boolean shade) {
this.shade = shade;
}

@Override
public void sprite(TextureAtlasSprite sprite) {
current.sprite = sprite;
Expand All @@ -61,7 +70,7 @@ public VertexConsumer setColor(int color) {

@Override
public VertexConsumer setColor(int red, int green, int blue, int alpha) {
setColor(ARGB.color(red, green, blue, alpha));
setColor(ARGB.color(alpha, red, green, blue));
return this;
}

Expand Down Expand Up @@ -106,6 +115,8 @@ private void endPrevVertex() {
throw new IllegalStateException("Sprite not set.");
}
current.calculateOrientation(false);
current.shade = shade;
current.ambientOcclusion = ambientOcclusion;
quadList.add(current.bake());
vertex = 0;
}
Expand Down
Loading