[pypy-svn] r55227 - pypy/dist/pypy/lang/gameboy
cami at codespeak.net
cami at codespeak.net
Mon May 26 01:34:04 CEST 2008
Author: cami
Date: Mon May 26 01:34:02 2008
New Revision: 55227
Modified:
pypy/dist/pypy/lang/gameboy/gameboyImplementation.py
Log:
removed string multiplication
Modified: pypy/dist/pypy/lang/gameboy/gameboyImplementation.py
==============================================================================
--- pypy/dist/pypy/lang/gameboy/gameboyImplementation.py (original)
+++ pypy/dist/pypy/lang/gameboy/gameboyImplementation.py Mon May 26 01:34:02 2008
@@ -84,7 +84,8 @@
str = ""
for x in range(self.width):
if y%2 == 0:
- str += self.pixel_map(x, y)*2
+ s = self.pixel_map(x, y)
+ str += s+s
#RSDL_helper.set_pixel(self.screen, x, y, self.get_pixel_color(x, y))
print str;
@@ -96,7 +97,7 @@
g = (px>>8) & 0xFF
r = (px>>16) & 0xFF
brightness = 4 * (r+b+g) / (0xFF*3)
- return [".", "+", "O", "#", ""][brightness]
+ return [" ", ".", "+", "#", ""][brightness]
def get_pixel_color(self, x, y):
return self.pixels[x+self.width*y]
More information about the Pypy-commit
mailing list