Beispiel #1
0
 def readFromBlock(self, block, width, height, loc=0):
     self._w = width
     self._h = height
     self._data = map(lambda x: array('B', [0] * self._h),
             range(self._w))
     for i in range(self._h / 8):
         for j in range(self._w / 8):
             EbModule.read4BPPArea(self._data, block, loc, j*8, i*8)
             loc += 32
Beispiel #2
0
 def readFromBlock(self, block, width, height, loc=0):
     self._width = width
     self._height = height
     self._sprite = map(lambda x: array('B', [0] * height),
             range(0, width))
     offset = loc
     for q in range(0, height/32):
         for r in range(0, width/32):
             for a in range(0, 4):
                 for j in range(0, 4):
                     EbModule.read4BPPArea(self._sprite, block, offset,
                             (j + r * 4) * 8, (a + q * 4) * 8)
                     offset += 32
     self._spriteHash = EbModule.hashArea(self._sprite)
 def readFromBlock(self, block, loc=0):
     off = loc
     self._tiles = []
     for i in xrange(self._numTiles):
         try:
             tile = [array('B', [0]*self._tileSize)
                     for i in xrange(self._tileSize)]
             if self._bpp == 2:
                 off += EbModule.read2BPPArea(
                     tile, block._data, off, 0, 0)
             elif self._bpp == 4:
                 off += EbModule.read4BPPArea(
                     tile, block._data, off, 0, 0)
         except IndexError:
             pass # Load an empty tile if it's out of range of the data
         self._tiles.append(tile)
     self._usedTiles = self._numTiles