diff --git a/vis2.py b/vis2.py index 2a82e6a..7481686 100644 --- a/vis2.py +++ b/vis2.py @@ -2,16 +2,31 @@ import pygame # pygame setup pygame.init() -screen = pygame.display.set_mode((1920, 1080), flags=pygame.FULLSCREEN) +display = pygame.display.Info() +screen = pygame.display.set_mode((display.current_w, display.current_h), flags=pygame.FULLSCREEN) clock = pygame.time.Clock() running = True screen.fill("black") -X=128 -Y=8 -maps = [(x%X)+1920*(x//X) for x in range(X*Y)] -maps += [x+1*X for x in maps] -it = iter(maps) +import sys +if len(sys.argv[1:3]) == 2: + XSTRIPE, YSTRIPE = [int(i) for i in sys.argv[1:3]] +else: + XSTRIPE = 128 + YSTRIPE = 8 +def mapsf(width=display.current_w, height=display.current_w): + for i in range(width*height): + sno = i // (XSTRIPE * YSTRIPE) + ord = i % (XSTRIPE * YSTRIPE) + base_x = sno % (width // XSTRIPE) * XSTRIPE + base_y = sno // (width // XSTRIPE) * YSTRIPE + sx = ord % XSTRIPE + base_x + sy = ord // XSTRIPE + base_y + yield sy * width + sx + +maps = [(x%XSTRIPE)+1920*(x//XSTRIPE) for x in range(XSTRIPE*YSTRIPE)] +maps += [x+1*XSTRIPE for x in maps] +it = iter(mapsf()) #for _ in range(8*8*16*16*(15*8)+18000*5): # next(it) #for _ in range(8*8*16*16*(15*8)):