Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

speedup when rebuilding image

  • Loading branch information...
commit f08b1d4a0cb3f2b288b3b0dda08842c64a7e4b79 1 parent 83c7dd3
@phooky authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 tools/rom-explorer.py
View
11 tools/rom-explorer.py
@@ -36,13 +36,14 @@ def rebuildImage(self):
line = self.img.scanLine(y)
line.setsize(self.stride)
try:
- for x in range(self.stride):
- line[x] = self.data[byteidx]
- byteidx = byteidx + 1
- except IndexError:
+ line[0:self.stride] = self.data[byteidx:byteidx+self.stride]
+ byteidx = byteidx + self.stride
+ except ValueError:
# zero out the rest of the scan line
+ remainder = len(self.data)-byteidx
+ line[0:remainder] = self.data[byteidx:]
buf = "\x00"
- for x in range(x,self.stride):
+ for x in range(remainder,self.stride):
line[x] = buf[0]
self.width = width
self.height = height
Please sign in to comment.
Something went wrong with that request. Please try again.