diasurgical / devilutionX

Diablo build for modern operating systems
Other
8.01k stars 786 forks source link

Fix Magic Rock related bugs #7365

Closed kphoenix137 closed 2 weeks ago

kphoenix137 commented 1 month ago

Fixes: https://github.com/diasurgical/devilutionX/issues/7304

Bug 1: Magic Rock isn't animated while on the stand Bug 2: Magic Rock drops to the ground with full inventory upon attempted pickup, rendering behind the stand

Note: We can't cycle back to frame 10 from frame 20 during the elevated frames animation, because processAnimation will reset the currentFrame to 0 if the currentFrame is greater than or equal to the total number of frames (20). This would make the rock appear to be bouncing up and down.

https://github.com/user-attachments/assets/0b66f4b0-bd85-4b3d-9d7b-3e305c1baeb3

FitzRoyX commented 1 month ago

There is something odd about the animation quality, imo. It just seems a bit crude and unrefined. It looks like the rock is changing shape in places and the pixels are pulsing in unison instead of sparkling in alternation. I think there's a chance this was some vestigal idea that was abandoned.

kphoenix137 commented 2 weeks ago

There is something odd about the animation quality, imo. It just seems a bit crude and unrefined. It looks like the rock is changing shape in places and the pixels are pulsing in unison instead of sparkling in alternation. I think there's a chance this was some vestigal idea that was abandoned.

The rock gets animated, just not while on the stand. If it was intentional to disable the animation, why didn't they disable it while on the ground?

AJenbo commented 2 weeks ago

the _selFlag type is shared between monsters objects and items and is derived from cursor. It should be seen as 3 bits that represents the rough tile shape of the entity.

I don't think the enum here works well for the additional options with the 3rd bit and it would be odd to treat it specially for items.

I think it would be best to pull that commit out of this PR, I can try and look at it, been putting it off for a long time, but this helped me dig in to it a bit deeper.

AJenbo commented 2 weeks ago

There rolled back the last commit, please address the comment by ephphatha and then I think it should be ready to merge.

FitzRoyX commented 2 weeks ago

The rock gets animated, just not while on the stand. If it was intentional to disable the animation, why didn't they disable it while on the ground?

Ah, makes sense.

kphoenix137 commented 1 week ago

The rock gets animated, just not while on the stand. If it was intentional to disable the animation, why didn't they disable it while on the ground?

Ah, makes sense.

With the highlight, it does look strange. It's likely entirely possible to cut out the extra pixels that get drawn on the edges during some frames. At a later time though.