mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-20 23:47:16 -05:00
Set proper sizes for DCC frames (#663)
This commit is contained in:
parent
3fea5a096d
commit
39ab8d19f5
@ -96,10 +96,10 @@ func (a *DCCAnimation) decodeDirection(directionIndex int) error {
|
||||
maxY = d2common.MaxInt(maxY, dccFrame.Box.Bottom())
|
||||
}
|
||||
|
||||
for _, dccFrame := range direction.Frames {
|
||||
frameWidth := maxX - minX
|
||||
frameHeight := maxY - minY
|
||||
frameWidth := maxX - minX
|
||||
frameHeight := maxY - minY
|
||||
|
||||
for _, dccFrame := range direction.Frames {
|
||||
pixels := ImgIndexToRGBA(dccFrame.PixelData, a.palette)
|
||||
|
||||
sfc, err := a.renderer.NewSurface(frameWidth, frameHeight, d2enum.FilterNearest)
|
||||
@ -113,8 +113,8 @@ func (a *DCCAnimation) decodeDirection(directionIndex int) error {
|
||||
|
||||
a.directions[directionIndex].decoded = true
|
||||
a.directions[directionIndex].frames = append(a.directions[directionIndex].frames, &animationFrame{
|
||||
width: dccFrame.Width,
|
||||
height: dccFrame.Height,
|
||||
width: frameWidth,
|
||||
height: frameHeight,
|
||||
offsetX: minX,
|
||||
offsetY: minY,
|
||||
image: sfc,
|
||||
|
Loading…
x
Reference in New Issue
Block a user