From 826b1224f6f6d0a1744b1f080949bb43cc5e736b Mon Sep 17 00:00:00 2001 From: Ziemas Date: Sat, 2 Jan 2021 01:56:09 +0100 Subject: [PATCH] This DCC frame size calculation seems useless TBH there some to be some other overcomplicated things going on in DCCAnimation but too tired to use brain right now. --- d2core/d2asset/dcc_animation.go | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/d2core/d2asset/dcc_animation.go b/d2core/d2asset/dcc_animation.go index 9961b5ea..326f8124 100644 --- a/d2core/d2asset/dcc_animation.go +++ b/d2core/d2asset/dcc_animation.go @@ -2,9 +2,6 @@ package d2asset import ( "errors" - "math" - - "github.com/OpenDiablo2/OpenDiablo2/d2common/d2math" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2util" @@ -132,24 +129,11 @@ func (a *DCCAnimation) decodeDirection(directionIndex int) error { func (a *DCCAnimation) decodeFrame(directionIndex int) animationFrame { dccDirection := a.dcc.Directions[directionIndex] - minX, minY := math.MaxInt32, math.MaxInt32 - maxX, maxY := math.MinInt32, math.MinInt32 - - for _, dccFrame := range dccDirection.Frames { - minX = d2math.MinInt(minX, dccFrame.Box.Left) - minY = d2math.MinInt(minY, dccFrame.Box.Top) - maxX = d2math.MaxInt(maxX, dccFrame.Box.Right()) - maxY = d2math.MaxInt(maxY, dccFrame.Box.Bottom()) - } - - frameWidth := maxX - minX - frameHeight := maxY - minY - frame := animationFrame{ - width: frameWidth, - height: frameHeight, - offsetX: minX, - offsetY: minY, + width: dccDirection.Box.Width, + height: dccDirection.Box.Height, + offsetX: dccDirection.Box.Left, + offsetY: dccDirection.Box.Top, decoded: true, }