Don't initialize pygame if --no-show-output

This commit is contained in:
kris 2021-11-24 15:24:58 +00:00
parent e77e7abd43
commit 5fefd0b0bb
1 changed files with 8 additions and 7 deletions

View File

@ -352,13 +352,14 @@ def main():
inner_iterations = 10
outer_iterations = 20
pygame.init()
# TODO: for some reason I need to execute this twice - the first time
# the window is created and immediately destroyed
_ = pygame.display.set_mode((640, 400))
canvas = pygame.display.set_mode((640, 400))
canvas.fill((0, 0, 0))
pygame.display.flip()
if args.show_output:
pygame.init()
# TODO: for some reason I need to execute this twice - the first time
# the window is created and immediately destroyed
_ = pygame.display.set_mode((640, 400))
canvas = pygame.display.set_mode((640, 400))
canvas.fill((0, 0, 0))
pygame.display.flip()
total_image_error = None
# TODO: reserved_colours should be a flag