slight improvements to select and simplerender
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m9s
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m9s
This commit is contained in:
parent
8dead855f2
commit
3d959cdf42
2 changed files with 16 additions and 11 deletions
|
@ -93,9 +93,9 @@ public class Select extends Feature {
|
|||
int c = Features.getFeature(Client.class).theme.getGreenColor() | 0xff000000;
|
||||
SimpleRender simpleRender = new SimpleRender(event.getPartialTicks());
|
||||
if(wireframe)
|
||||
simpleRender.color(c).lines().aabb(selection.toAABB()).back();
|
||||
simpleRender.color(c).lines().aabb(selection.toAABB()).end();
|
||||
if(fill)
|
||||
simpleRender.color(Pixels.mulTransparency(c, opacity)).quadsFill().aabb(selection.toAABB()).back();
|
||||
simpleRender.color(Pixels.mulTransparency(c, opacity)).quadsFill().aabb(selection.toAABB()).end();
|
||||
simpleRender.finish();
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public class SimpleRender {
|
|||
}
|
||||
SimpleRenderBackend aabb(AxisAlignedBB box);
|
||||
SimplePolyMesh<?> mesh();
|
||||
SimpleRender back();
|
||||
SimpleRender end();
|
||||
}
|
||||
|
||||
public class SimplePolyMesh<T extends SimpleRenderBackend> {
|
||||
|
@ -103,8 +103,8 @@ public class SimpleRender {
|
|||
}
|
||||
}
|
||||
|
||||
public class SimpleLinePolyMesh<T extends SimpleRenderBackend> extends SimplePolyMesh<T> {
|
||||
private SimpleLinePolyMesh(T parent) {
|
||||
public class SimpleLineMesh<T extends SimpleRenderBackend> extends SimplePolyMesh<T> {
|
||||
private SimpleLineMesh(T parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class SimpleRender {
|
|||
double lx, ly, lz;
|
||||
boolean b;
|
||||
@Override
|
||||
public SimpleLinePolyMesh<T> point(double x, double y, double z) {
|
||||
public SimpleLineMesh<T> point(double x, double y, double z) {
|
||||
if(b) {
|
||||
put(lx, ly, lz);
|
||||
put(lx = x, ly = y, lz = z);
|
||||
|
@ -125,6 +125,11 @@ public class SimpleRender {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SimpleLineMesh<T> breakPolygon() {
|
||||
b = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T end() {
|
||||
if(b) {
|
||||
|
@ -135,7 +140,7 @@ public class SimpleRender {
|
|||
}
|
||||
|
||||
@Override
|
||||
public SimpleLinePolyMesh<T> next() {
|
||||
public SimpleLineMesh<T> next() {
|
||||
if(b) {
|
||||
put(lx, ly, lz);
|
||||
put(fx, fy, fz);
|
||||
|
@ -158,7 +163,7 @@ public class SimpleRender {
|
|||
}
|
||||
|
||||
@Override
|
||||
public SimpleRender back() {
|
||||
public SimpleRender end() {
|
||||
glEnd();
|
||||
return SimpleRender.this;
|
||||
}
|
||||
|
@ -198,12 +203,12 @@ public class SimpleRender {
|
|||
}
|
||||
|
||||
@Override
|
||||
public SimpleLinePolyMesh<SimpleLineBackend> mesh() {
|
||||
return new SimpleLinePolyMesh<>(this);
|
||||
public SimpleLineMesh<SimpleLineBackend> mesh() {
|
||||
return new SimpleLineMesh<>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleRender back() {
|
||||
public SimpleRender end() {
|
||||
glEnd();
|
||||
return SimpleRender.this;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue