From 864cde28312dc448bdf2f6d69511434cdff069a4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 7 May 1992 15:21:25 +0000 Subject: [PATCH] Warn if stride not a multiple of 4 bytes; use PM_SIZE instead of 5. --- Demo/sgi/video/video.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Demo/sgi/video/video.py b/Demo/sgi/video/video.py index 2b50e396587..4469329444a 100755 --- a/Demo/sgi/video/video.py +++ b/Demo/sgi/video/video.py @@ -40,6 +40,9 @@ def openvideo(name): x = eval(line[:-1]) if len(x) == 3: w, h, pf = x else: w, h = x; pf = 2 + if pf and w/pf % 4 <> 0: + sys.stderr.write( \ + 'warning: stride not a multiple of 4 -- may not work on Indigo XS\n') return f, w, h, pf, colorinfo def loadframe(f,w,h,pf,af,spkr, (ybits,ibits,qbits,chrompack),mf): @@ -66,11 +69,11 @@ def loadframe(f,w,h,pf,af,spkr, (ybits,ibits,qbits,chrompack),mf): ch = (h+chrompack-1)/chrompack chromdata = f.read(2*cw*ch) rectzoom(pf*chrompack*mf,pf*chrompack*mf) - pixmode(5,16) + pixmode(PM_SIZE,16) writemask(0x7ff - ((1< 1: @@ -166,7 +169,7 @@ def main(): color(2048) clear() writemask(2047) - pixmode(5,8) # 8 bit pixels + pixmode(PM_SIZE,8) # 8 bit pixels qdevice(ESCKEY) qdevice(WINSHUT) qdevice(WINQUIT)