mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 03:00:29 +03:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1415,10 +1415,10 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
|
||||
|
||||
private static void prepareTexture(ObjectiveMarker marker, Object texture){
|
||||
if(texture instanceof LogicDisplayBuild d && d.isAdded()){
|
||||
if(d.buffer == null || d.buffer.isDisposed()){
|
||||
if(d.rootDisplay.buffer == null || d.rootDisplay.buffer.isDisposed()){
|
||||
marker.setTexture("error");
|
||||
}else{
|
||||
d.processCommands();
|
||||
d.rootDisplay.processCommands();
|
||||
}
|
||||
}else if(texture instanceof CanvasBuild c && c.isAdded()){
|
||||
if(c.texture == null || c.texture.isDisposed()){
|
||||
|
||||
@@ -148,8 +148,9 @@ public class LogicDisplay extends Block{
|
||||
}
|
||||
|
||||
public void getBufferRegion(TextureRegion region){
|
||||
if(buffer != null){
|
||||
region.set(buffer.getTexture(), 0, buffer.getTexture().height, buffer.getTexture().width, -buffer.getTexture().height);
|
||||
if(rootDisplay.buffer != null){
|
||||
region.set(rootDisplay.buffer.getTexture(), 0, rootDisplay.buffer.getTexture().height,
|
||||
rootDisplay.buffer.getTexture().width, -rootDisplay.buffer.getTexture().height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +196,7 @@ public class LogicDisplay extends Block{
|
||||
int id = packed >> 5;
|
||||
if(ctype == displayDrawType){
|
||||
if(id != index && id < displays.size && id >= 0 && displays.get(id).buffer != null){
|
||||
displays.get(id).getBufferRegion(Tmp.tr1);
|
||||
displays.get(id).rootDisplay.getBufferRegion(Tmp.tr1);
|
||||
Draw.rect(Tmp.tr1, x, y, p2, p2 / Tmp.tr1.ratio(), p3);
|
||||
}
|
||||
}else if(ctype < ContentType.all.length && Vars.content.getByID(ContentType.all[ctype], id) instanceof UnlockableContent u){
|
||||
|
||||
@@ -269,11 +269,11 @@ public class TileableLogicDisplay extends LogicDisplay{
|
||||
|
||||
@Override
|
||||
public void ensureBuffer() {
|
||||
if(buffer == null){
|
||||
buffer = new FrameBuffer(32 * tilesWidth - 2 * frameSize, 32 * tilesHeight - 2 * frameSize);
|
||||
if(rootDisplay.buffer == null){
|
||||
rootDisplay.buffer = new FrameBuffer(32 * tilesWidth - 2 * frameSize, 32 * tilesHeight - 2 * frameSize);
|
||||
//clear the buffer - some OSs leave garbage in it
|
||||
buffer.begin(backgroundColor);
|
||||
buffer.end();
|
||||
rootDisplay.buffer.begin(backgroundColor);
|
||||
rootDisplay.buffer.end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user