mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-25 05:51:47 -08:00
Sense number of graphics operations (#10898)
* Sense number of graphics operations * int to long
This commit is contained in:
parent
96b0544261
commit
981e954c61
3 changed files with 6 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ public enum LAccess{
|
|||
displayWidth,
|
||||
displayHeight,
|
||||
bufferUsage,
|
||||
operations,
|
||||
size,
|
||||
solid,
|
||||
dead,
|
||||
|
|
|
|||
|
|
@ -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(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue