Skip to content

Commit c81d341

Browse files
committed
figured out cffi 8-bit int issue, just use uint8 instead of int8
1 parent 836e6ad commit c81d341

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tdl/map.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ def __init__(self, width, height):
9090
self.width = width
9191
self.height = height
9292
self._map_cdata = _lib.TCOD_map_new(width, height)
93-
# cast array into cdata format: int16[y][x]
93+
# cast array into cdata format: uint8[y][x]
9494
# for quick Python access
95-
self._array_cdata = _ffi.new('int16[%i][%i]' % (width, height))
95+
self._array_cdata = _ffi.new('uint8[%i][%i]' % (width, height))
9696
# flat array to pass to TDL's C helpers
97-
self._array_cdata_flat = _ffi.cast('int16 *', self._array_cdata)
97+
self._array_cdata_flat = _ffi.cast('uint8 *', self._array_cdata)
9898
self.transparent = self._MapAttribute(self, 0)
9999
self.walkable = self._MapAttribute(self, 1)
100100
self.fov = self._MapAttribute(self, 2)

0 commit comments

Comments
 (0)