1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-12 02:30:43 +00:00

Set proper sizes for DCC frames (#663)

This commit is contained in:
Ziemas 2020-08-01 03:22:56 +02:00 committed by GitHub
parent 3fea5a096d
commit 39ab8d19f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,