File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,11 +135,8 @@ void CButton::draw(Position parentOrigin) const
135135 if (button_picture >= 0 )
136136 {
137137 auto & picTex = getBmpTexture (button_picture);
138- if (picTex.isValid ())
139- {
140- const Position picPos = absPos + size_ / 2 - Position (picTex.getSize ()) / 2 ;
141- picTex.draw (picPos);
142- }
138+ const Position picPos = absPos + size_ / 2 - Position (picTex.getSize ()) / 2 ;
139+ picTex.draw (picPos);
143140 } else if (button_text)
144141 {
145142 // Draw text centered (using native-size texture drawing for each character)
Original file line number Diff line number Diff line change @@ -189,8 +189,6 @@ void CControlContainer::drawChildren(Position origin)
189189 button->draw (origin);
190190 for (const auto & static_picture : static_pictures)
191191 {
192- auto & tex = getBmpTexture (static_picture.pic );
193- if (tex.isValid ())
194- tex.draw (origin + static_picture.pos );
192+ getBmpTexture (static_picture.pic ).draw (origin + static_picture.pos );
195193 }
196194}
Original file line number Diff line number Diff line change @@ -66,8 +66,5 @@ void CPicture::setMouseData(const SDL_MouseButtonEvent& button)
6666
6767void CPicture::draw (Position parentOrigin) const
6868{
69- auto & tex = getBmpTexture (picture_);
70- if (!tex.isValid ())
71- return ;
72- tex.draw (parentOrigin + pos_);
69+ getBmpTexture (picture_).draw (parentOrigin + pos_);
7370}
You can’t perform that action at this time.
0 commit comments