From 6fed567f387b49676d3a61d8b19289a98eb52646 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Wed, 4 Dec 2019 15:29:41 -0800 Subject: [PATCH] Animation box will update when initially loading COF Animation box will update when initially loading COF Debug drawing animation will display origin Created issue #71 --- core/src/com/riiablo/codec/Animation.java | 31 +++++++++----------- mpqviewer/src/com/riiablo/mpq/MPQViewer.java | 1 + 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/core/src/com/riiablo/codec/Animation.java b/core/src/com/riiablo/codec/Animation.java index a40bf790..00a946d7 100644 --- a/core/src/com/riiablo/codec/Animation.java +++ b/core/src/com/riiablo/codec/Animation.java @@ -382,12 +382,12 @@ public class Animation extends BaseDrawable implements Pool.Poolable { shapes.set(ShapeRenderer.ShapeType.Line); } - //shapes.setColor(Color.RED); - //shapes.line(x, y, x + 50, y); - //shapes.setColor(Color.GREEN); - //shapes.line(x, y, x, y + 50); - //shapes.setColor(Color.BLUE); - //shapes.line(x, y, x + 15, y - 20); + shapes.setColor(Color.RED); + shapes.line(x, y, x + 50, y); + shapes.setColor(Color.GREEN); + shapes.line(x, y, x, y + 50); + shapes.setColor(Color.BLUE); + shapes.line(x, y, x + 15, y - 20); shapes.setColor(Color.GREEN); shapes.rect(x + box.xMin, y - box.yMax, box.width, box.height); if (reset) shapes.end(); @@ -648,20 +648,17 @@ public class Animation extends BaseDrawable implements Pool.Poolable { shapeRenderer.set(ShapeRenderer.ShapeType.Line); } - //shapeRenderer.setColor(Color.RED); - //shapeRenderer.line(x, y, x + 40, y); - //shapeRenderer.setColor(Color.GREEN); - //shapeRenderer.line(x, y, x, y + 20); - //shapeRenderer.setColor(Color.BLUE); - //shapeRenderer.line(x, y, x + 20, y - 10); + shapeRenderer.setColor(Color.RED); + shapeRenderer.line(x, y, x + 40, y); + shapeRenderer.setColor(Color.GREEN); + shapeRenderer.line(x, y, x, y + 20); + shapeRenderer.setColor(Color.BLUE); + shapeRenderer.line(x, y, x + 20, y - 10); - BBox box = dc.getDirection(d).box; + BBox box = dc.getBox(d, f); shapeRenderer.setColor(DEBUG_COLOR); shapeRenderer.rect(x + box.xMin, y - box.yMax, box.width, box.height); - - if (reset) { - shapeRenderer.end(); - } + if (reset) shapeRenderer.end(); } } diff --git a/mpqviewer/src/com/riiablo/mpq/MPQViewer.java b/mpqviewer/src/com/riiablo/mpq/MPQViewer.java index 8d032755..0ff179c6 100644 --- a/mpqviewer/src/com/riiablo/mpq/MPQViewer.java +++ b/mpqviewer/src/com/riiablo/mpq/MPQViewer.java @@ -1741,6 +1741,7 @@ public class MPQViewer { anim.setLayer(layer, dc, false); } + anim.updateBox(); setDelegate(anim); }