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())
|
maxY = d2common.MaxInt(maxY, dccFrame.Box.Bottom())
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, dccFrame := range direction.Frames {
|
frameWidth := maxX - minX
|
||||||
frameWidth := maxX - minX
|
frameHeight := maxY - minY
|
||||||
frameHeight := maxY - minY
|
|
||||||
|
|
||||||
|
for _, dccFrame := range direction.Frames {
|
||||||
pixels := ImgIndexToRGBA(dccFrame.PixelData, a.palette)
|
pixels := ImgIndexToRGBA(dccFrame.PixelData, a.palette)
|
||||||
|
|
||||||
sfc, err := a.renderer.NewSurface(frameWidth, frameHeight, d2enum.FilterNearest)
|
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].decoded = true
|
||||||
a.directions[directionIndex].frames = append(a.directions[directionIndex].frames, &animationFrame{
|
a.directions[directionIndex].frames = append(a.directions[directionIndex].frames, &animationFrame{
|
||||||
width: dccFrame.Width,
|
width: frameWidth,
|
||||||
height: dccFrame.Height,
|
height: frameHeight,
|
||||||
offsetX: minX,
|
offsetX: minX,
|
||||||
offsetY: minY,
|
offsetY: minY,
|
||||||
image: sfc,
|
image: sfc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user