[pypy-svn] r62542 - pypy/trunk/pypy/lang/gameboy
cfbolz at codespeak.net
cfbolz at codespeak.net
Wed Mar 4 18:50:05 CET 2009
Author: cfbolz
Date: Wed Mar 4 18:50:05 2009
New Revision: 62542
Modified:
pypy/trunk/pypy/lang/gameboy/gameboy_implementation.py
Log:
make string drawing not completely brain-dead
Modified: pypy/trunk/pypy/lang/gameboy/gameboy_implementation.py
==============================================================================
--- pypy/trunk/pypy/lang/gameboy/gameboy_implementation.py (original)
+++ pypy/trunk/pypy/lang/gameboy/gameboy_implementation.py Wed Mar 4 18:50:05 2009
@@ -127,19 +127,18 @@
RSDL_helper.set_pixel(self.screen, x, y, color)
def draw_ascii_pixels(self):
- str = ""
+ str = []
for y in range(self.height):
- str += "\n"
+ str.append("\n")
for x in range(self.width):
if y%2 == 0 or True:
- str += self.get_pixel_color(x, y, string=True)
- pass
- print str;
+ str.append(self.get_pixel_color(x, y, string=True))
+ print "".join(str)
@specialize.arg(3)
def get_pixel_color(self, x, y, string=False):
if string:
- return ["#", "%", "+", " ", " "][self.get_pixel_color(x, y)]
+ return ["#", "%", "+", ".", " "][self.get_pixel_color(x, y)]
else:
return self.pixels[x+self.width*y]
More information about the Pypy-commit
mailing list