Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2939a4c

Browse files
committed
Fixed another place where set_rgbmode() should be called.
Separated out colormap installation (for override by Glx widget).
1 parent f6d8032 commit 2939a4c

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

Demo/sgi/video/VFile.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ def initcolormap(self):
449449
# This only works on an Entry-level Indigo from IRIX 4.0.5
450450
if self.format == 'rgb8' and is_entry_indigo() and \
451451
gl.gversion() == 'GL4DLG-4.0.': # Note trailing '.'!
452-
gl.RGBmode()
453-
gl.gconfig()
452+
self.set_rgbmode()
454453
gl.RGBcolor(200, 200, 200) # XXX rather light grey
455454
gl.clear()
456455
gl.pixmode(GL.PM_SIZE, 8)
@@ -514,6 +513,7 @@ def clearto(self, r, g, b):
514513
# by clear() and clearto()
515514

516515
def _initcmap(self):
516+
map = []
517517
if self.format in ('mono', 'grey4') and self.mustunpack:
518518
convcolor = conv_grey
519519
else:
@@ -564,12 +564,22 @@ def _initcmap(self):
564564
r, g, b = int(rv*255.0), \
565565
int(gv*255.0), \
566566
int(bv*255.0)
567-
gl.mapcolor(index, r, g, b)
567+
map.append(index, r, g, b)
568568
if self.color0 == None:
569569
self.color0 = \
570570
index, r, g, b
571+
self.install_colormap(map)
571572
# Permanently make the first color index current
572573
gl.color(self.color0[0])
574+
575+
# Install the colormap in the window (may be overridden for Glx window)
576+
577+
def install_colormap(self, map):
578+
if not self.quiet:
579+
sys.stderr.write(' Installing ' + `len(map)` + \
580+
' entries...')
581+
for irgb in map:
582+
gl.mapcolor(irgb)
573583
gl.gflush() # send the colormap changes to the X server
574584

575585

0 commit comments

Comments
 (0)