Skip to content

Commit 6527844

Browse files
4B796C65@gmail.com4B796C65@gmail.com
authored andcommitted
1 parent 27738c4 commit 6527844

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* added a method to iterate over all coordinates in a Console, getMap
1+
* added a method to iterate over all coordinates of a Console
22
* drawStr can be configured to scroll or raise an error
33
* You can now configure or disable key repeating with tdl.event.setKeyRepeat
44

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
The library is used for displaying tilesets (ANSI, Unicode, or graphical) in true color.
1717
1818
It also provides functionality to compute path-finding and field of view.
19+
20+
python-tdl on GoogleCode: http://code.google.com/p/python-tdl/
21+
Online Documentation: http://pythonhosted.org/tdl/
22+
Issue Tracker: http://code.google.com/p/python-tdl/issues/list
23+
24+
libtcod: http://doryen.eptalys.net/libtcod/
1925
""",
2026
url='http://code.google.com/p/python-tdl/',
2127
download_url='http://code.google.com/p/python-tdl/downloads/list',
@@ -40,7 +46,7 @@
4046
'Topic :: Multimedia :: Graphics',
4147
'Topic :: Software Development :: Libraries :: Python Modules',
4248
],
43-
keywords = 'portable rogue-like rogue-likes text ctypes ASCII ANSI Unicode libtcod',
49+
keywords = 'portable rogue-like rogue-likes text ctypes ASCII ANSI Unicode libtcod fov pathfinsing',
4450
platforms = ['Windows', 'Mac OS X', 'Linux'],
4551
license = 'New BSD License'
4652
)

tdl/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def _normalizeRect(self, x, y, width, height):
235235
def _normalizeCursor(self, x, y):
236236
"""return the normalized the cursor position."""
237237
width, height = self.getSize()
238+
assert width != 0 and height != 0, 'can not print on a console with a width or height of zero'
238239
while x >= width:
239240
x -= width
240241
y += 1
@@ -256,7 +257,7 @@ def _lockColors(self, forceUpdate=False):
256257
_lib.TCOD_console_set_default_foreground(self.console, self.fgcolor)
257258
#
258259

259-
def setScrollMode(self, mode):
260+
def setMode(self, mode):
260261
"""Configure how this console will react to the cursor writing past the
261262
end if the console.
262263
@@ -632,8 +633,11 @@ def getSize(self):
632633
"""
633634
return self.width, self.height
634635

635-
def getMap(self):
636-
"""Return an iterator with every possible (x, y) value for this console."""
636+
def map(self):
637+
"""Return an iterator with every possible (x, y) value for this console.
638+
639+
It goes without saying that working on the console this way is a
640+
slow process, especially for Python, and should be minimized."""
637641
return itertools.product(range(self.width), range(self.height))
638642

639643
def move(self, x, y):

0 commit comments

Comments
 (0)