PDA

View Full Version : [zplayer] Some hearts become white from left to right



Asuna Yuuki Nagato
03-19-2024, 07:38 PM
Steps to recreate:


In the editor, File->New
Place a 'Fire' enemy on the screen
Test the quest
Walk into the fire repeatedly
Observe the fullmost heart correctly becomes white from right to left, but the other two become white from left to right.

Asuna Yuuki Nagato
04-12-2024, 11:54 PM
The hurting happens in gamedata::set_life

Asuna Yuuki Nagato
04-13-2024, 12:01 AM
Commenting out the body of lifemeter in subscr.cpp doesn't have any affect on this bug.

Asuna Yuuki Nagato
04-13-2024, 06:13 PM
The hearts are drawn by SW_GaugePiece::draw

Asuna Yuuki Nagato
04-13-2024, 06:46 PM
Here is what overtile8 draws when called with various values of the tile parameter:



80181 upper right corner of widget box
103036 blackness
103376 full heart
103368 half-heart (empty on left side)
103380 empty heart
103388 half-heart (empty on right side)

Asuna Yuuki Nagato
04-13-2024, 07:05 PM
A bit ugly, but making the if(fulltile) at the bottom of SW_GaugePiece::draw_piece look like this fixes it:



if(fulltile)
overtile16(dest,tile+offs,dx,dy,cset,0);
else
{
if( mtile + offs == 103368 ) // draw half-hearts that are empty on their right side, not left
overtile8(dest, 103388, dx, dy, cset, 0);
else
overtile8(dest, mtile + offs, dx, dy, cset, 0);
}