예제 #1
0
 def run_codes(self, r):
     #r.clamp_ip(self.bounds)
     for y in xrange(r.top / TH, r.bottom / TH):
         if y < 0 or y >= self.size[1]: continue
         for x in xrange(r.left / TW, r.right / TW):
             if x < 0 or x >= self.size[0]: continue
             if (x, y) not in self.codes:
                 n = self.data[2][y][x]
                 if n == 0: continue
                 s = codes.c_run(self, (x, y), n)
                 if s == None: continue
                 s._code = (x, y)
                 self.codes[(x, y)] = s
예제 #2
0
 def run_codes(self,r):
     #r.clamp_ip(self.bounds)
     for y in xrange(r.top/TH,r.bottom/TH):
         if y < 0 or y >= self.size[1]: continue
         for x in xrange(r.left/TW,r.right/TW):
             if x < 0 or x >= self.size[0]: continue 
             if (x,y) not in self.codes:
                 n = self.data[2][y][x]
                 if n == 0: continue
                 s = codes.c_run(self,(x,y),n)
                 if s == None: continue
                 s._code = (x,y)
                 self.codes[(x,y)] = s
예제 #3
0
 def run_codes(self, r):
     #r.clamp_ip(self.bounds)
     for y in xrange(r.top / TH, r.bottom / TH):
         if y < 0 or y >= self.size[1]: continue
         for x in xrange(r.left / TW, r.right / TW):
             if x < 0 or x >= self.size[0]: continue
             if (x, y) not in self.codes:
                 n = self.data[2][y][x]  # MYNOTE g value of level file
                 if n == 0: continue
                 #if n not in [0x60, 0x61, 0x62, 0x78, 0x30, 0x31, 0x32, 0x33]: continue # only door hack
                 s = codes.c_run(self, (x, y), n)
                 if s == None: continue
                 s._code = (x, y)
                 self.codes[(x, y)] = s
예제 #4
0
 def run_codes(self, r):
     rw = xrange(max(r.left / TW, 0), min(r.right / TW, self.size[0]))
     rh = xrange(max(r.top / TH, 0), min(r.bottom / TH, self.size[1]))
     for y in rh:
         row = self.codes_data[y]
         for x in rw:
             coords = (x, y)
             if coords not in self.codes:
                 n = row[x]
                 if n != 0:
                     s = codes.c_run(self, coords, n)
                     if s is not None:
                         s._code = coords
                         self.codes[coords] = s