gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/libpaper textures.py


From: Matti Katila
Subject: [Gzz-commits] gzz/gfx/libpaper textures.py
Date: Thu, 05 Dec 2002 09:34:52 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   02/12/05 09:34:50

Modified files:
        gfx/libpaper   : textures.py 

Log message:
        fixed dual-papers. Now both luminance alpa and rgba works.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/textures.py.diff?tr1=1.41&tr2=1.42&r1=text&r2=text

Patches:
Index: gzz/gfx/libpaper/textures.py
diff -u gzz/gfx/libpaper/textures.py:1.41 gzz/gfx/libpaper/textures.py:1.42
--- gzz/gfx/libpaper/textures.py:1.41   Wed Nov 27 05:01:40 2002
+++ gzz/gfx/libpaper/textures.py        Thu Dec  5 09:34:49 2002
@@ -357,15 +357,12 @@
 
 class Textures:
     textures = None
+    last_paperopt = 0
     paperopt = gzz.gfx.gl.PaperOptions.instance()
     def __init__(self, seed):
         text_comps, text_form = texture_components, texture_format
         if not self.textures:
-            if self.paperopt.use_opengl_1_1:
-                text_comps, text_form = 2, 'LUMINANCE_ALPHA'
-
-            self.textures = init(text_comps, text_form)
-            print "Textures created: components: %d, format: %s" % 
(text_comps, text_form)
+            self.paperInit()
             
        rnd = java.util.Random(seed)
 
@@ -387,8 +384,22 @@
 
             #print self.probs[type]
 
+    def paperInit(self):
+        if self.paperopt.use_opengl_1_1:
+            text_comps, text_form = 2, 'LUMINANCE_ALPHA'
+        else:
+            text_comps, text_form = 4, 'RGBA'
+            
+        self.textures = init(text_comps, text_form)
+        print "Textures created: components: %d, format: %s" % (text_comps, 
text_form)
+
         
     def getPaperTexture(self, type, gen):
+
+        if self.last_paperopt != self.paperopt.use_opengl_1_1:
+            self.paperInit()
+            self.last_paperopt = self.paperopt.use_opengl_1_1
+
         index = 0
 
         t = gen.nextDouble()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]