Sense number of graphics operations (#10898)
* Sense number of graphics operations * int to long
This commit is contained in:
@@ -2566,6 +2566,7 @@ laccess.id = ID of a unit/block/item/liquid.\nThis is the inverse of the lookup
|
|||||||
laccess.displaywidth = Width of a display block in pixels.
|
laccess.displaywidth = Width of a display block in pixels.
|
||||||
laccess.displayheight = Height of a display block in pixels.
|
laccess.displayheight = Height of a display block in pixels.
|
||||||
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
|
laccess.bufferusage = Number of unprocessed commands in the graphics buffer of a display.
|
||||||
|
laccess.operations = Number of operations performed on the block.\nFor displays, returns the number of drawflush operations.
|
||||||
|
|
||||||
lcategory.unknown = Unknown
|
lcategory.unknown = Unknown
|
||||||
lcategory.unknown.description = Uncategorized instructions.
|
lcategory.unknown.description = Uncategorized instructions.
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public enum LAccess{
|
|||||||
displayWidth,
|
displayWidth,
|
||||||
displayHeight,
|
displayHeight,
|
||||||
bufferUsage,
|
bufferUsage,
|
||||||
|
operations,
|
||||||
size,
|
size,
|
||||||
solid,
|
solid,
|
||||||
dead,
|
dead,
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public class LogicDisplay extends Block{
|
|||||||
public float stroke = 1f;
|
public float stroke = 1f;
|
||||||
public LongQueue commands = new LongQueue(256);
|
public LongQueue commands = new LongQueue(256);
|
||||||
public @Nullable Mat transform;
|
public @Nullable Mat transform;
|
||||||
|
public long operations;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
@@ -111,6 +112,7 @@ public class LogicDisplay extends Block{
|
|||||||
return switch(sensor){
|
return switch(sensor){
|
||||||
case displayWidth, displayHeight -> displaySize;
|
case displayWidth, displayHeight -> displaySize;
|
||||||
case bufferUsage -> commands.size;
|
case bufferUsage -> commands.size;
|
||||||
|
case operations -> operations;
|
||||||
default -> super.sense(sensor);
|
default -> super.sense(sensor);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -121,6 +123,8 @@ public class LogicDisplay extends Block{
|
|||||||
for(int i = 0; i < added; i++){
|
for(int i = 0; i < added; i++){
|
||||||
commands.addLast(graphicsBuffer.items[i]);
|
commands.addLast(graphicsBuffer.items[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operations++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processCommands(){
|
public void processCommands(){
|
||||||
|
|||||||
Reference in New Issue
Block a user