Fix some issues rendering animated terrains in dialogs, and avoid a crash if a graphics sheet cannot be found

This commit is contained in:
2023-01-30 00:07:25 -05:00
parent f2b438d5c5
commit 8a2cfbae7e
5 changed files with 41 additions and 2 deletions

View File

@@ -78,6 +78,10 @@ void rect_draw_some_item(const sf::Texture& src_gworld,rectangle src_rect,sf::Re
}
void rect_draw_some_item(const sf::Texture& src_gworld,rectangle src_rect,sf::RenderTarget& targ_gworld,rectangle targ_rect,sf::RenderStates mode) {
rectangle src_gworld_rect(src_gworld), targ_gworld_rect(targ_gworld);
src_rect &= src_gworld_rect;
targ_rect &= targ_gworld_rect;
if(src_rect.empty() || targ_rect.empty()) return;
setActiveRenderTarget(targ_gworld);
sf::Sprite tile(src_gworld, src_rect);
tile.setPosition(targ_rect.left, targ_rect.top);