本文整理汇总了Python中EbModule.read4BPPArea方法的典型用法代码示例。如果您正苦于以下问题:Python EbModule.read4BPPArea方法的具体用法?Python EbModule.read4BPPArea怎么用?Python EbModule.read4BPPArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EbModule
的用法示例。
在下文中一共展示了EbModule.read4BPPArea方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: readFromBlock
# 需要导入模块: import EbModule [as 别名]
# 或者: from EbModule import read4BPPArea [as 别名]
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
示例2: readFromBlock
# 需要导入模块: import EbModule [as 别名]
# 或者: from EbModule import read4BPPArea [as 别名]
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)
示例3: readFromBlock
# 需要导入模块: import EbModule [as 别名]
# 或者: from EbModule import read4BPPArea [as 别名]
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