Fix splash screen glitches when launching by double-clicking (or drag-dropping) a file

This commit is contained in:
2015-06-13 23:14:18 -04:00
parent 0798f98523
commit b16c2a40cd
2 changed files with 16 additions and 9 deletions

View File

@@ -316,17 +316,21 @@ void Set_up_win () {
}
void run_startup_g() {
sf::Event event;
rectangle pict_rect = {0,0,480,640}, dest_rect;
sf::Texture pict_to_draw;
dest_rect = pict_rect;
dest_rect.offset(-25,-25);
pict_to_draw.loadFromImage(*ResMgr::get<ImageRsrc>("edsplash"));
rect_draw_some_item(pict_to_draw, pict_rect, mainPtr, dest_rect, sf::BlendAlpha);
mainPtr.display();
for(int i = 0; i < 10; i++) {
mainPtr.clear(sf::Color::Black);
rect_draw_some_item(pict_to_draw, pict_rect, mainPtr, dest_rect, sf::BlendAlpha);
mainPtr.display();
mainPtr.pollEvent(event);
}
play_sound(-95);
sf::Clock timer;
sf::Event event;
while(timer.getElapsedTime() < time_in_ticks(120)) {
mainPtr.pollEvent(event);
if(event.type == sf::Event::KeyPressed || event.type == sf::Event::MouseButtonPressed)