URL:
  <http://gna.org/bugs/?25408>

                 Summary: Large game slow down when new window UI elements
showing/moved
                 Project: Battle for Wesnoth
            Submitted by: coffee
            Submitted on: Mon 02 Jan 2017 19:28:27 ACDT
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: User Interface
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.13.6+dev
        Operating System: Linux

    _______________________________________________________

Details:

The game appears to slow to a crawl when moving around or resizing the title
screen main window or loading a network game across 2 instances of Wesnoth or
simply with many window elements on the screen.

I believe these are all the same bug, as I will demonstrate below with a
work-around. This is possibly related to bugs 24604 and 24604.

I am running a combination of Linux (64bit newest kernel and stable SDL2
packages, etc.) and nVidia graphics on a very fast machine (12 cores, etc.).

I ran a gdb and found that when I experience the above problems it is always
running "events::pump()" in "gui2::window::show(bool, unsigned int) ()" and
taking all the CPU power from one thread and basically locking up the game.

The SDL_Delay(10) in "src/gui/widgets/window.cpp" seems to be related to
this.

If taken out of the loop looking for windows "!CLOSED" the problem disappears.
Either by removing from this loop or just eliminating it completely seems to
work and not affect the CPU usage of the game (perhaps a delay is elsewhere
done when the important thread is created). Maybe the delay time should be set
to 1 or deleted? Passing this on as it is not my area of expertise.

A work-around that works for me is below:

-------------------------- src/gui/widgets/window.cpp
--------------------------
index 7eac195..fe52fb2 100644
@@ -633,6 +633,7 @@ int window::show(const bool restore, const unsigned
auto_close_timeout)
        {
                // Start our loop drawing will happen here as well.
                bool mouse_button_state_initialised = false;
+               bool add_delay = false;
                for(status_ = SHOWING; status_ != CLOSED;) {
                        // process installed callback if valid, to allow e.g. 
network
                        // polling
@@ -658,6 +659,10 @@ int window::show(const bool restore, const unsigned
auto_close_timeout)
                        }
 
                        // Add a delay so we don't keep spinning if there's no 
event.
+                       add_delay=true;
+                       
+               }
+               if (add_delay) {
                        SDL_Delay(10);
                }
        }





    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?25408>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to