Exemplo n.º 1
0
 def dumpLocalPalettes(self, base):
     """Returns a list of floats representing the local palette starting at the base."""
     out = [0.0 for i in range(16*4)]
     for i in range(16):
         if (i % 4) == 0:
             continue
         paletteIndex = ord(self.cpu.mem.ppuRead(base + i))
         out[4*i:(4*i)+3] = [float(x)/255.0 for x in palette.palette(paletteIndex)] # rgb
         out[(4*i)+3] = 1.0 # alpha
     return out
Exemplo n.º 2
0
	def create_palette(s, scope, atts, parser):
		log = logging.getLogger('menu').debug
		s.palette_results = []
		log("scope:%s"%len(scope))
		for x in scope:
			log("%s:"%x)
			a = palette.palette(x, scope, s.current_text, parser)
			s.palette_results += a
			for i in a:
				log(i.value.tostr())

		s.palette_results = flatten(s.palette_results)
		log("palette_results:%s"% len(s.palette_results))

		s.update_items()
Exemplo n.º 3
0
        
        if self.width < self.minWidth:
            self.width = self.minWidth

        if self.height < self.minHeight:
            self.height = self.minHeight

        self.screen = pygame.display.set_mode((self.width, self.height), HWSURFACE|DOUBLEBUF|RESIZABLE)

window = window()

from palette import palette
from panels import panels
from workspace import workspace, camera

palette = palette(window)
panels = panels(window)
workspace = workspace(window)

class fps:
    clock = pygame.time.Clock()
    
    maxfps = 140
    
    def get(self):
        self.clock.tick(self.maxfps)
        
        return round(self.clock.get_fps(), 2)

fps = fps()