Sense number of graphics operations (#10898)

* Sense number of graphics operations

* int to long
This commit is contained in:
Cardillan 2025-06-14 17:21:18 +02:00 committed by GitHub
parent 96b0544261
commit 981e954c61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View file

@ -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.displayheight = Height of a display block in pixels.
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.description = Uncategorized instructions.

View file

@ -41,6 +41,7 @@ public enum LAccess{
displayWidth,
displayHeight,
bufferUsage,
operations,
size,
solid,
dead,

View file

@ -78,6 +78,7 @@ public class LogicDisplay extends Block{
public float stroke = 1f;
public LongQueue commands = new LongQueue(256);
public @Nullable Mat transform;
public long operations;
@Override
public void draw(){
@ -111,6 +112,7 @@ public class LogicDisplay extends Block{
return switch(sensor){
case displayWidth, displayHeight -> displaySize;
case bufferUsage -> commands.size;
case operations -> operations;
default -> super.sense(sensor);
};
}
@ -121,6 +123,8 @@ public class LogicDisplay extends Block{
for(int i = 0; i < added; i++){
commands.addLast(graphicsBuffer.items[i]);
}
operations++;
}
public void processCommands(){