From aa95d18a43c9df94866f579ccdad52c896543219 Mon Sep 17 00:00:00 2001 From: way-zer Date: Fri, 20 Sep 2024 00:07:03 +0800 Subject: [PATCH] revert "fix #16"; fix NPE when bulletShow=false; fix "D/V/T/F" need restart --- patches/client/0036-API-C-DebugUtil.patch | 16 +- patches/client/0037-OC-Batch.patch | 211 +----------------- patches/client/0038-H-UI-AuxiliaryTools.patch | 2 +- .../0039-H-UI-NewCoreItemsDisplay.patch | 4 +- ...0056-OC-no-bullet-create-when-hidden.patch | 16 +- patches/client/0063-ARC-merged.patch | 23 +- 6 files changed, 40 insertions(+), 232 deletions(-) diff --git a/patches/client/0036-API-C-DebugUtil.patch b/patches/client/0036-API-C-DebugUtil.patch index 1c8558d84a1a..baedeec321bf 100644 --- a/patches/client/0036-API-C-DebugUtil.patch +++ b/patches/client/0036-API-C-DebugUtil.patch @@ -12,8 +12,8 @@ way-zer on 2024/7/21 core/src/arc/graphics/g2d/MySpriteBatch.java | 26 +++++++++++++++++++ core/src/mindustry/ClientLauncher.java | 2 +- core/src/mindustry/core/Logic.java | 3 +++ - .../mindustry/ui/fragments/HudFragment.java | 9 +++++++ - 4 files changed, 39 insertions(+), 1 deletion(-) + .../mindustry/ui/fragments/HudFragment.java | 7 +++++ + 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 core/src/arc/graphics/g2d/MySpriteBatch.java diff --git a/core/src/arc/graphics/g2d/MySpriteBatch.java b/core/src/arc/graphics/g2d/MySpriteBatch.java @@ -90,7 +90,7 @@ index d1c7c5ca602c6c765cc62c9e2f0b384c3ad0a254..b640803511bcae93b5c8d8c71ffdc23b /** @return whether the wave timer is paused due to enemies */ diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java -index 23d4ad03c71131265f82478a0285110cdf71059d..fe959362b9a79dbeb79eb12f5ce73ef693e0cd33 100644 +index 23d4ad03c71131265f82478a0285110cdf71059d..d13458daa505cb321dfb02b173cfd4ad6b3f4eb5 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -29,6 +29,7 @@ import mindustry.type.*; @@ -101,18 +101,16 @@ index 23d4ad03c71131265f82478a0285110cdf71059d..fe959362b9a79dbeb79eb12f5ce73ef6 import static mindustry.Vars.*; import static mindustry.gen.Tex.*; -@@ -282,6 +283,14 @@ public class HudFragment{ +@@ -282,6 +283,12 @@ public class HudFragment{ info.label(() -> fps.get(Core.graphics.getFramesPerSecond())).left().style(Styles.outlineLabel).name("fps"); info.row(); + info.label(() -> Strings.format("LG/DW/UI(ms) @/@/@", Time.nanosToMillis(DebugUtil.logicTime), Time.nanosToMillis(DebugUtil.rendererTime), Time.nanosToMillis(DebugUtil.uiTime))) + .left().style(Styles.outlineLabel).name("cpuTime"); + info.row(); -+ if(DebugUtil.renderDebug){ -+ info.label(() -> Strings.format("D/V/T/F @/@/@/@", -+ DebugUtil.lastDrawRequests, DebugUtil.lastVertices, DebugUtil.lastSwitchTexture, DebugUtil.lastFlushCount)).left().style(Styles.outlineLabel).name("draw"); -+ info.row(); -+ } ++ info.collapser(t-> t.label(() -> Strings.format("D/V/T/F @/@/@/@", ++ DebugUtil.lastDrawRequests, DebugUtil.lastVertices, DebugUtil.lastSwitchTexture, DebugUtil.lastFlushCount)).left().style(Styles.outlineLabel).name("draw"), ()->DebugUtil.renderDebug); ++ info.row(); if(android){ info.label(() -> memnative.get((int)(Core.app.getJavaHeap() / 1024 / 1024), (int)(Core.app.getNativeHeap() / 1024 / 1024))).left().style(Styles.outlineLabel).name("memory2"); diff --git a/patches/client/0037-OC-Batch.patch b/patches/client/0037-OC-Batch.patch index c9ec096f006e..772e392eca69 100644 --- a/patches/client/0037-OC-Batch.patch +++ b/patches/client/0037-OC-Batch.patch @@ -22,10 +22,9 @@ way-zer on 2024/7/23 顶点合并等优化已合并到arc上游 way-zer on 2024/8/4 --- - core/src/arc/graphics/g2d/MySpriteBatch.java | 224 ++++++++++++++++++ - core/src/mindustry/graphics/MultiPacker.java | 2 +- - .../world/blocks/logic/LogicDisplay.java | 174 +++++++------- - 3 files changed, 309 insertions(+), 91 deletions(-) + core/src/arc/graphics/g2d/MySpriteBatch.java | 224 +++++++++++++++++++ + core/src/mindustry/graphics/MultiPacker.java | 2 +- + 2 files changed, 225 insertions(+), 1 deletion(-) diff --git a/core/src/arc/graphics/g2d/MySpriteBatch.java b/core/src/arc/graphics/g2d/MySpriteBatch.java index e2bdb30e190a210f25130c423c853892798e4c28..f0c580f01f0a0014870d1f37b37cbf4eeb4748d6 100644 @@ -284,207 +283,3 @@ index e5f473a7651495f7f61856e6df711fba12dfb1be..f1a3f1cbbac0fbda6dfabe689f25c210 //TODO stuff like this throws OOM on some devices environment(4096, 2048), -diff --git a/core/src/mindustry/world/blocks/logic/LogicDisplay.java b/core/src/mindustry/world/blocks/logic/LogicDisplay.java -index 1db6409a264c5977e4ccfbf7709d1db430ac31e6..c8794b047f0faccadd106edca05997af1f03c648 100644 ---- a/core/src/mindustry/world/blocks/logic/LogicDisplay.java -+++ b/core/src/mindustry/world/blocks/logic/LogicDisplay.java -@@ -20,25 +20,25 @@ import mindustryX.features.*; - - public class LogicDisplay extends Block{ - public static final byte -- commandClear = 0, -- commandColor = 1, -- //virtual command, unpacked in instruction -- commandColorPack = 2, -- commandStroke = 3, -- commandLine = 4, -- commandRect = 5, -- commandLineRect = 6, -- commandPoly = 7, -- commandLinePoly = 8, -- commandTriangle = 9, -- commandImage = 10, -- //note that this command actually only draws 1 character, unpacked in instruction -- commandPrint = 11, -- -- commandTranslate = 12, -- commandScale = 13, -- commandRotate = 14, -- commandResetTransform = 15 -+ commandClear = 0, -+ commandColor = 1, -+ //virtual command, unpacked in instruction -+ commandColorPack = 2, -+ commandStroke = 3, -+ commandLine = 4, -+ commandRect = 5, -+ commandLineRect = 6, -+ commandPoly = 7, -+ commandLinePoly = 8, -+ commandTriangle = 9, -+ commandImage = 10, -+ //note that this command actually only draws 1 character, unpacked in instruction -+ commandPrint = 11, -+ -+ commandTranslate = 12, -+ commandScale = 13, -+ commandRotate = 14, -+ commandResetTransform = 15 - ; - - public static final float scaleStep = 0.05f; -@@ -78,89 +78,83 @@ public class LogicDisplay extends Block{ - - //don't even bother processing anything when displays are off. - if(!Vars.renderer.drawDisplays) return; -+ Draw.draw(Draw.z(), this::draw0); -+ } - -- Draw.draw(Draw.z(), () -> { -- if(buffer == null){ -- buffer = new FrameBuffer(displaySize, displaySize); -- //clear the buffer - some OSs leave garbage in it -- buffer.begin(Pal.darkerMetal); -- buffer.end(); -- } -- }); -+ private void draw0(){ -+ if(buffer == null){ -+ buffer = new FrameBuffer(displaySize, displaySize); -+ //clear the buffer - some OSs leave garbage in it -+ buffer.begin(Pal.darkerMetal); -+ buffer.end(); -+ } - - //don't bother processing commands if displays are off - if(!commands.isEmpty()){ -- Draw.draw(Draw.z(), () -> { -- Tmp.m1.set(Draw.proj()); -- Tmp.m2.set(Draw.trans()); -- Draw.proj(0, 0, displaySize, displaySize); -- if(transform != null){ -- Draw.trans(transform); -- } -- buffer.begin(); -- Draw.color(color); -- Lines.stroke(stroke); -- -- while(!commands.isEmpty()){ -- long c = commands.removeFirst(); -- int type = DisplayCmd.type(c); -- int x = unpackSign(DisplayCmd.x(c)), y = unpackSign(DisplayCmd.y(c)), -- p1 = unpackSign(DisplayCmd.p1(c)), p2 = unpackSign(DisplayCmd.p2(c)), p3 = unpackSign(DisplayCmd.p3(c)), p4 = unpackSign(DisplayCmd.p4(c)); -- -- switch(type){ -- case commandClear -> { -- //discard any pending batched sprites, so they don't get drawn over the cleared screen later -- Draw.discard(); -- Core.graphics.clear(x / 255f, y / 255f, p1 / 255f, 1f); -- } -- case commandLine -> Lines.line(x, y, p1, p2); -- case commandRect -> Fill.crect(x, y, p1, p2); -- case commandLineRect -> Lines.rect(x, y, p1, p2); -- case commandPoly -> Fill.poly(x, y, Math.min(p1, maxSides), p2, p3); -- case commandLinePoly -> Lines.poly(x, y, Math.min(p1, maxSides), p2, p3); -- case commandTriangle -> Fill.tri(x, y, p1, p2, p3, p4); -- case commandColor -> Draw.color(this.color = Color.toFloatBits(x, y, p1, p2)); -- case commandStroke -> Lines.stroke(this.stroke = x); -- case commandImage -> { -- if(p4 >= 0 && p4 < ContentType.all.length && Vars.content.getByID(ContentType.all[p4], p1) instanceof UnlockableContent u){ -- var icon = u.fullIcon; -- Draw.rect(icon, x, y, p2, p2 / icon.ratio(), p3); -- } -+ Tmp.m1.set(Draw.proj()); -+ Tmp.m2.set(Draw.trans()); -+ Draw.proj(0, 0, displaySize, displaySize); -+ if(transform != null){ -+ Draw.trans(transform); -+ } -+ buffer.begin(); -+ Draw.color(color); -+ Lines.stroke(stroke); -+ -+ while(!commands.isEmpty()){ -+ long c = commands.removeFirst(); -+ int type = DisplayCmd.type(c); -+ int x = unpackSign(DisplayCmd.x(c)), y = unpackSign(DisplayCmd.y(c)), -+ p1 = unpackSign(DisplayCmd.p1(c)), p2 = unpackSign(DisplayCmd.p2(c)), p3 = unpackSign(DisplayCmd.p3(c)), p4 = unpackSign(DisplayCmd.p4(c)); -+ -+ switch(type){ -+ case commandClear -> { -+ //discard any pending batched sprites, so they don't get drawn over the cleared screen later -+ Draw.discard(); -+ Core.graphics.clear(x / 255f, y / 255f, p1 / 255f, 1f); -+ } -+ case commandLine -> Lines.line(x, y, p1, p2); -+ case commandRect -> Fill.crect(x, y, p1, p2); -+ case commandLineRect -> Lines.rect(x, y, p1, p2); -+ case commandPoly -> Fill.poly(x, y, Math.min(p1, maxSides), p2, p3); -+ case commandLinePoly -> Lines.poly(x, y, Math.min(p1, maxSides), p2, p3); -+ case commandTriangle -> Fill.tri(x, y, p1, p2, p3, p4); -+ case commandColor -> Draw.color(this.color = Color.toFloatBits(x, y, p1, p2)); -+ case commandStroke -> Lines.stroke(this.stroke = x); -+ case commandImage -> { -+ if(p4 >= 0 && p4 < ContentType.all.length && Vars.content.getByID(ContentType.all[p4], p1) instanceof UnlockableContent u){ -+ var icon = u.fullIcon; -+ Draw.rect(icon, x, y, p2, p2 / icon.ratio(), p3); - } -- case commandPrint -> { -- var glyph = Fonts.logic.getData().getGlyph((char)p1); -- if(glyph != null){ -- Tmp.tr1.set(Fonts.logic.getRegion().texture); -- Tmp.tr1.set(glyph.u, glyph.v2, glyph.u2, glyph.v); -- -- Draw.rect(Tmp.tr1, x + Tmp.tr1.width/2f + glyph.xoffset, y + Tmp.tr1.height/2f + glyph.yoffset + Fonts.logic.getData().capHeight + Fonts.logic.getData().ascent, Tmp.tr1.width, Tmp.tr1.height); -- } -+ } -+ case commandPrint -> { -+ var glyph = Fonts.logic.getData().getGlyph((char)p1); -+ if(glyph != null){ -+ Tmp.tr1.set(Fonts.logic.getRegion().texture); -+ Tmp.tr1.set(glyph.u, glyph.v2, glyph.u2, glyph.v); -+ -+ Draw.rect(Tmp.tr1, x + Tmp.tr1.width / 2f + glyph.xoffset, y + Tmp.tr1.height / 2f + glyph.yoffset + Fonts.logic.getData().capHeight + Fonts.logic.getData().ascent, Tmp.tr1.width, Tmp.tr1.height); - } -- case commandTranslate -> Draw.trans((transform == null ? (transform = new Mat()) : transform).translate(x, y)); -- case commandScale -> Draw.trans((transform == null ? (transform = new Mat()) : transform).scale(x * scaleStep, y * scaleStep)); -- case commandRotate-> Draw.trans((transform == null ? (transform = new Mat()) : transform).rotate(p1)); -- case commandResetTransform -> Draw.trans((transform == null ? (transform = new Mat()) : transform).idt()); - } -+ case commandTranslate -> Draw.trans((transform == null ? (transform = new Mat()) : transform).translate(x, y)); -+ case commandScale -> Draw.trans((transform == null ? (transform = new Mat()) : transform).scale(x * scaleStep, y * scaleStep)); -+ case commandRotate -> Draw.trans((transform == null ? (transform = new Mat()) : transform).rotate(p1)); -+ case commandResetTransform -> Draw.trans((transform == null ? (transform = new Mat()) : transform).idt()); - } -+ } - -- buffer.end(); -- Draw.proj(Tmp.m1); -- Draw.trans(Tmp.m2); -- Draw.reset(); -- }); -+ buffer.end(); -+ Draw.proj(Tmp.m1); -+ Draw.trans(Tmp.m2); -+ Draw.reset(); - } - - Draw.blend(Blending.disabled); -- Draw.draw(Draw.z(), () -> { -- if(buffer != null){ -- if(RenderExt.logicDisplayNoBorder){ -- Draw.rect(Draw.wrap(buffer.getTexture()), x, y, (buffer.getWidth() + 16) * Draw.scl, -(buffer.getHeight() + 16) * Draw.scl); -- return; -- } -- Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * scaleFactor * Draw.scl, -buffer.getHeight() * scaleFactor * Draw.scl); -- } -- }); -- Draw.blend(); -+ if(RenderExt.logicDisplayNoBorder){ -+ Draw.rect(Draw.wrap(buffer.getTexture()), x, y, (buffer.getWidth() + 16) * Draw.scl, -(buffer.getHeight() + 16) * Draw.scl); -+ return; -+ } -+ Draw.rect(Draw.wrap(buffer.getTexture()), x, y, buffer.getWidth() * scaleFactor * Draw.scl, -buffer.getHeight() * scaleFactor * Draw.scl); - } - - @Override diff --git a/patches/client/0038-H-UI-AuxiliaryTools.patch b/patches/client/0038-H-UI-AuxiliaryTools.patch index 8f96749808e9..30feb2eafa87 100644 --- a/patches/client/0038-H-UI-AuxiliaryTools.patch +++ b/patches/client/0038-H-UI-AuxiliaryTools.patch @@ -8,7 +8,7 @@ Subject: [PATCH] H(UI): AuxiliaryTools 1 file changed, 13 insertions(+) diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java -index fe959362b9a79dbeb79eb12f5ce73ef693e0cd33..2c674865d350123c3eba5f402dc528b0b94ef210 100644 +index d13458daa505cb321dfb02b173cfd4ad6b3f4eb5..0b3d391dbea4bdd88e1a9635ff8510d476477328 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -42,6 +42,7 @@ public class HudFragment{ diff --git a/patches/client/0039-H-UI-NewCoreItemsDisplay.patch b/patches/client/0039-H-UI-NewCoreItemsDisplay.patch index 1aa8dbe16da2..7f764a960f1e 100644 --- a/patches/client/0039-H-UI-NewCoreItemsDisplay.patch +++ b/patches/client/0039-H-UI-NewCoreItemsDisplay.patch @@ -12,7 +12,7 @@ Content-Transfer-Encoding: 8bit 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java -index 2c674865d350123c3eba5f402dc528b0b94ef210..c84b479b57324153c9f5de05d6d656d2d5e48271 100644 +index 0b3d391dbea4bdd88e1a9635ff8510d476477328..d8579557ba0378190e5f9ffb3ca0747c9857492c 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -30,6 +30,7 @@ import mindustry.ui.*; @@ -44,7 +44,7 @@ index 2c674865d350123c3eba5f402dc528b0b94ef210..c84b479b57324153c9f5de05d6d656d2 //paused table parent.fill(t -> { t.name = "paused"; -@@ -333,8 +329,9 @@ public class HudFragment{ +@@ -331,8 +327,9 @@ public class HudFragment{ t.collapser(v -> v.add().height(pauseHeight), () -> state.isPaused() && !netServer.isWaitingForPlayers()).row(); t.table(c -> { diff --git a/patches/client/0056-OC-no-bullet-create-when-hidden.patch b/patches/client/0056-OC-no-bullet-create-when-hidden.patch index 635aa5087905..283178b13ef3 100644 --- a/patches/client/0056-OC-no-bullet-create-when-hidden.patch +++ b/patches/client/0056-OC-no-bullet-create-when-hidden.patch @@ -5,7 +5,8 @@ Subject: [PATCH] OC: no bullet create when hidden --- core/src/mindustry/entities/bullet/BulletType.java | 2 ++ - 1 file changed, 2 insertions(+) + core/src/mindustry/type/Weapon.java | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 160a45d8d245cdf0fe60baaa1c92ca135bf53a5c..aabfd4f3750978651e912a2dac5ad651b67a6a97 100644 @@ -27,3 +28,16 @@ index 160a45d8d245cdf0fe60baaa1c92ca135bf53a5c..aabfd4f3750978651e912a2dac5ad651 if(!Mathf.chance(createChance)) return null; if(ignoreSpawnAngle) angle = 0; if(spawnUnit != null){ +diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java +index f9ec8feac6e944e76b5e2309da9b78e9d1269348..bf50d03c33d9251ce0c7d600beba56ca1a7c578a 100644 +--- a/core/src/mindustry/type/Weapon.java ++++ b/core/src/mindustry/type/Weapon.java +@@ -525,7 +525,7 @@ public class Weapon implements Cloneable{ + + //override to do special things to a bullet after spawning + protected void handleBullet(Unit unit, WeaponMount mount, Bullet bullet){ +- if(continuous){ ++ if(continuous && bullet != null){ + float + weaponRotation = unit.rotation - 90 + (rotate ? mount.rotation : baseRotation), + mountX = unit.x + Angles.trnsx(unit.rotation - 90, x, y), diff --git a/patches/client/0063-ARC-merged.patch b/patches/client/0063-ARC-merged.patch index 72ceb6609771..a9ef32b998ba 100644 --- a/patches/client/0063-ARC-merged.patch +++ b/patches/client/0063-ARC-merged.patch @@ -120,7 +120,7 @@ way-zer on 2024/9/8 .../ui/dialogs/SettingsMenuDialog.java | 28 +- .../mindustry/ui/fragments/ChatFragment.java | 25 +- .../ui/fragments/ConsoleFragment.java | 3 + - .../mindustry/ui/fragments/HudFragment.java | 227 +++++++++++- + .../mindustry/ui/fragments/HudFragment.java | 228 +++++++++++- .../mindustry/ui/fragments/MenuFragment.java | 59 ++- .../ui/fragments/PlacementFragment.java | 166 +++++++-- .../ui/fragments/PlayerListFragment.java | 93 +++-- @@ -134,7 +134,7 @@ way-zer on 2024/9/8 .../world/blocks/production/Drill.java | 23 +- .../blocks/production/GenericCrafter.java | 16 + .../world/blocks/storage/CoreBlock.java | 9 + - 41 files changed, 1998 insertions(+), 242 deletions(-) + 41 files changed, 1999 insertions(+), 242 deletions(-) diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 7f944a3eb06180f9e2b760bbd5aa41709ddf6611..4972f424edd41b8a29d926a09bc55987066d33aa 100644 @@ -1821,7 +1821,7 @@ index e6c38c601c937c3810d3ef44db97ed9547baf176..a29f972b13258b6640464cfa5a387c1c unit.x + ex - Angles.trnsx(rot + rotation, 1f), unit.y + ey - Angles.trnsy(rot + rotation, 1f), diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java -index f9ec8feac6e944e76b5e2309da9b78e9d1269348..54aecfe829705b2f0f39743f476fbc8dcf408d93 100644 +index bf50d03c33d9251ce0c7d600beba56ca1a7c578a..0ef9a31c6a59f1e0112027c787f638b3571a828f 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -24,6 +24,7 @@ import mindustry.graphics.*; @@ -3051,7 +3051,7 @@ index e74e6a12e3da57eb58598eb4e679a7990c109def..013255ce5aa828d538814fa25dc64c6a //special case for 'clear' command if(message.equals("clear")){ diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java -index c84b479b57324153c9f5de05d6d656d2d5e48271..0843d4d9a7d5bd8cbcfcd2c941dc12ede0b10948 100644 +index d8579557ba0378190e5f9ffb3ca0747c9857492c..d323bea5fe786b72efb00827d6aaa86ecc9e6560 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -14,6 +14,7 @@ import arc.scene.ui.ImageButton.*; @@ -3190,18 +3190,19 @@ index c84b479b57324153c9f5de05d6d656d2d5e48271..0843d4d9a7d5bd8cbcfcd2c941dc12ed info.label(() -> fps.get(Core.graphics.getFramesPerSecond())).left().style(Styles.outlineLabel).name("fps"); info.row(); info.label(() -> Strings.format("LG/DW/UI(ms) @/@/@", Time.nanosToMillis(DebugUtil.logicTime), Time.nanosToMillis(DebugUtil.rendererTime), Time.nanosToMillis(DebugUtil.uiTime))) -@@ -300,6 +329,10 @@ public class HudFragment{ - DebugUtil.lastDrawRequests, DebugUtil.lastVertices, DebugUtil.lastSwitchTexture, DebugUtil.lastFlushCount)).left().style(Styles.outlineLabel).name("draw"); - info.row(); - } +@@ -299,6 +328,11 @@ public class HudFragment{ + DebugUtil.lastDrawRequests, DebugUtil.lastVertices, DebugUtil.lastSwitchTexture, DebugUtil.lastFlushCount)).left().style(Styles.outlineLabel).name("draw"), ()->DebugUtil.renderDebug); + info.row(); + + if (!android){ + info.label(() -> "缩放: " + String.format("%.2f", renderer.getScale())).left().style(Styles.outlineLabel); + info.row(); + } - ++ if(android){ info.label(() -> memnative.get((int)(Core.app.getJavaHeap() / 1024 / 1024), (int)(Core.app.getNativeHeap() / 1024 / 1024))).left().style(Styles.outlineLabel).name("memory2"); -@@ -910,6 +943,142 @@ public class HudFragment{ + }else{ +@@ -908,6 +942,142 @@ public class HudFragment{ return table; } @@ -3344,7 +3345,7 @@ index c84b479b57324153c9f5de05d6d656d2d5e48271..0843d4d9a7d5bd8cbcfcd2c941dc12ed private void addInfoTable(Table table){ table.name = "infotable"; table.left(); -@@ -954,7 +1123,45 @@ public class HudFragment{ +@@ -952,7 +1122,45 @@ public class HudFragment{ } private boolean canSkipWave(){