mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-20 23:47:16 -05:00
Merge pull request #1016 from Ziemas/useless_dcc_math
This DCC frame size calculation seems useless
This commit is contained in:
commit
68d2486fbb
@ -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,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user