This commit is contained in:
JerryXiao 2023-04-26 15:38:52 +08:00
parent fca089fcda
commit 51f0a2e421
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5

27
vis2.py
View file

@ -2,16 +2,31 @@
import pygame import pygame
# pygame setup # pygame setup
pygame.init() 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() clock = pygame.time.Clock()
running = True running = True
screen.fill("black") screen.fill("black")
X=128 import sys
Y=8 if len(sys.argv[1:3]) == 2:
maps = [(x%X)+1920*(x//X) for x in range(X*Y)] XSTRIPE, YSTRIPE = [int(i) for i in sys.argv[1:3]]
maps += [x+1*X for x in maps] else:
it = iter(maps) 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): #for _ in range(8*8*16*16*(15*8)+18000*5):
# next(it) # next(it)
#for _ in range(8*8*16*16*(15*8)): #for _ in range(8*8*16*16*(15*8)):