if not self.quiet:
sys.stderr.write('Initializing color map...')
self.initcmap()
+ self.clear()
if not self.quiet:
sys.stderr.write(' Done.\n')
+
+ def clear(self):
if self.offset == 0:
gl.color(0x800)
gl.clear()
self.mask = 0x7ff
else:
self.mask = 0xfff
- gl.clear()
-
+ gl.clear()
def initcmap(self):
maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE)
getattr(self, io + '_info2').label = `pos`
getattr(self, io + '_info3').label = `right`
-main()
+
+try:
+ main()
+except KeyboardInterrupt:
+ print '[Interrupt]'
# Interpret options
try:
for opt, arg in opts:
- if opt == '-M': magnify = string.atoi(arg)
+ if opt == '-M': magnify = float(eval(arg))
if opt == '-d': debug = debug + 1
if opt == '-l': looping = 1
if opt == '-m': mindelta = string.atoi(arg)
gl.foreground()
- width, height = vin.width * magnify, vin.height * magnify
+ width, height = int(vin.width * magnify), int(vin.height * magnify)
if xoff <> None and yoff <> None:
scrheight = gl.getgdesc(GL.GD_YPMAX)
gl.prefposition(xoff, xoff+width-1, \