diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-07 02:34:44 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-07 02:34:44 +0200 |
commit | ca0e381e2a248170f71c236a5070ce349f0206ea (patch) | |
tree | 14ef6b3b824ce40e488badfd5cd9c05dc334b118 /src | |
parent | 4d1c3791cb68e0b17e586b516ea943a31711b223 (diff) |
Manga: set fps to 20, consume events on next/previous chapter
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index bbc6f91..283379a 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -535,7 +535,7 @@ namespace QuickMedia { case Page::IMAGES: { body->draw_thumbnails = false; window.setKeyRepeatEnabled(false); - window.setFramerateLimit(4); + window.setFramerateLimit(20); image_page(); body->filter_search_fuzzy(""); if(vsync_set) @@ -2181,7 +2181,6 @@ namespace QuickMedia { bool error = !error_message.getString().isEmpty(); bool redraw = true; - sf::Event event; sf::Text chapter_text(content_title + " | " + chapter_title + " | Page " + std::to_string(image_index + 1) + "/" + std::to_string(num_images), *font, 14); if(image_index == num_images) @@ -2200,6 +2199,10 @@ namespace QuickMedia { sf::Clock check_downloaded_timer; const sf::Int32 check_downloaded_timeout_ms = 500; + sf::Event event; + // Consume events sent during above call to get_number_of_images which sends a request to server which may take a while. We dont want pages to be skipped when pressing arrow up/down + while(window.pollEvent(event)) {} + // TODO: Show to user if a certain page is missing (by checking page name (number) and checking if some are skipped) while (current_page == Page::IMAGES) { while(window.pollEvent(event)) { |