LayeredDirty ignores timing threshold

Issue #256 new
Matthew DuCharme created an issue
# LayeredDirty's draw method
start_time = get_ticks()

# drawing code here

end_time = get_ticks()
if end_time - start_time > self._time_threshold:
    self._use_update = False

# More stuff down here

On my machine (i5, Windows 10) with a low number of sprites, end_time and start_time are the same values. This behavior doesn't make sense, as it's basically saying "if the previous batch's draw was long enough, redraw the whole screen" (which is an even larger performance hit), whereas it should redraw the whole screen if the timing threshold is exceeded.

Comments (3)

  1. René Dudfield


    the code seems correct to me.

    If there is a lot of work done drawing, then updating the whole screen will be faster.

    In your case, there are only a few sprites drawn. Which means using update is better, and the code does this correctly.

  2. Log in to comment