From: Laszlo T. <ave...@us...> - 2006-12-25 18:25:12
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19734 Modified Files: Button.cpp Log Message: fixed buttons with picturelist (paperdoll) to not check for transparency, so autoequip will work Index: Button.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Button.cpp,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Button.cpp 3 Dec 2006 17:16:54 -0000 1.109 --- Button.cpp 25 Dec 2006 18:25:10 -0000 1.110 *************** *** 116,119 **** --- 116,126 ---- } + Video * video = core->GetVideoDriver(); + + #ifdef _DEBUG + Color green = {0,255,0,0}; + Region r = Region( x + XPos, y + YPos, Width, Height ); + video->DrawRect( r, green, false ); + #endif // Button image if (!( Flags & IE_GUI_BUTTON_NO_IMAGE )) { *************** *** 151,155 **** int yOffs = ( Height / 2 ) - ( Image->Height / 2 ); ! core->GetVideoDriver()->BlitSprite( Image, x + XPos + xOffs, y + YPos + yOffs, true ); } } --- 158,162 ---- int yOffs = ( Height / 2 ) - ( Image->Height / 2 ); ! video->BlitSprite( Image, x + XPos + xOffs, y + YPos + yOffs, true ); } } *************** *** 166,170 **** int yOffs = ( Height / 2 ) - ( Picture->Height / 2 ); Region r( x + XPos + xOffs, y + YPos + yOffs, (int)(Picture->Width * Clipping), Picture->Height ); ! core->GetVideoDriver()->BlitSprite( Picture, x + XPos + xOffs, y + YPos + yOffs, true, &r ); } --- 173,177 ---- int yOffs = ( Height / 2 ) - ( Picture->Height / 2 ); Region r( x + XPos + xOffs, y + YPos + yOffs, (int)(Picture->Width * Clipping), Picture->Height ); ! video->BlitSprite( Picture, x + XPos + xOffs, y + YPos + yOffs, true, &r ); } *************** *** 178,183 **** } for (; iter != PictureList.end(); ++iter) { ! core->GetVideoDriver()->BlitSprite( *iter, x + XPos + xOffs, ! y + YPos + yOffs, true ); } } --- 185,189 ---- } for (; iter != PictureList.end(); ++iter) { ! video->BlitSprite( *iter, x + XPos + xOffs, y + YPos + yOffs, true ); } } *************** *** 188,192 **** int yOffs = ( Height / 2 ) - ( AnimPicture->Height / 2 ); Region r( x + XPos + xOffs, y + YPos + yOffs, (int)(AnimPicture->Width * Clipping), AnimPicture->Height ); ! core->GetVideoDriver()->BlitSprite( AnimPicture, x + XPos + xOffs, y + YPos + yOffs, true, &r ); } --- 194,198 ---- int yOffs = ( Height / 2 ) - ( AnimPicture->Height / 2 ); Region r( x + XPos + xOffs, y + YPos + yOffs, (int)(AnimPicture->Width * Clipping), AnimPicture->Height ); ! video->BlitSprite( AnimPicture, x + XPos + xOffs, y + YPos + yOffs, true, &r ); } *************** *** 227,231 **** Region r = Region( x + XPos + fr->dx1, y + YPos + fr->dy1, Width - (fr->dx1 + fr->dx2 + 1), Height - (fr->dy1 + fr->dy2 + 1) ); ! core->GetVideoDriver()->DrawRect( r, fr->color, fr->filled ); } } --- 233,237 ---- Region r = Region( x + XPos + fr->dx1, y + YPos + fr->dy1, Width - (fr->dx1 + fr->dx2 + 1), Height - (fr->dy1 + fr->dy2 + 1) ); ! video->DrawRect( r, fr->color, fr->filled ); } } *************** *** 556,560 **** // some buttons have hollow Image frame filled w/ Picture // some buttons in BG2 are text only (if BAM == 'GUICTRL') ! if (Picture || ! Unpressed) return false; return core->GetVideoDriver()->IsSpritePixelTransparent(Unpressed, x, y); } --- 562,566 ---- // some buttons have hollow Image frame filled w/ Picture // some buttons in BG2 are text only (if BAM == 'GUICTRL') ! if (Picture || PictureList.size() || ! Unpressed) return false; return core->GetVideoDriver()->IsSpritePixelTransparent(Unpressed, x, y); } |