/[fenfire]/fenfire/org/fenfire/view/PaperView2D.java
ViewVC logotype

Diff of /fenfire/org/fenfire/view/PaperView2D.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by tjl, Wed Nov 5 10:25:53 2003 UTC revision 1.23 by tjl, Sat Nov 8 19:45:09 2003 UTC
# Line 27  PaperView2D.java Line 27  PaperView2D.java
27  package org.fenfire.view;  package org.fenfire.view;
28  import org.nongnu.libvob.*;  import org.nongnu.libvob.*;
29  import org.nongnu.libvob.gl.*;  import org.nongnu.libvob.gl.*;
30    import org.fenfire.functional.Function;
31    
32  /** A paper background for View2D.  /** A paper background for View2D.
33   * For the render call, make sure the plane object   * For the render call, make sure the plane object
# Line 39  public class PaperView2D extends View2D Line 40  public class PaperView2D extends View2D
40      public static boolean dbg = false;      public static boolean dbg = false;
41      private static void pa(String s) { System.out.println("PaperView2D::"+s); }      private static void pa(String s) { System.out.println("PaperView2D::"+s); }
42    
     public PaperMill paperMill;  
43      public float dicefactor = 1;      public float dicefactor = 1;
44      public int flags = 0;      public int flags = 0;
45    
46      public float paperScaling = .5f;      public float paperScaling = .5f;
47    
48        private Function paperMill;
49    
50      // implement      // implement
51      public void chgFast(VobScene vs,      public void chgFast(VobScene vs,
52                          Object plane,                          Object plane,
# Line 60  public class PaperView2D extends View2D Line 62  public class PaperView2D extends View2D
62      }      }
63      protected View2D child;      protected View2D child;
64            
65      public PaperView2D() {      /** Create a new PaperView2D.
66          this(null);       * @param paperMill A function; input: the plane object, output:
67         *                  a org.nongnu.libvob.gl.Paper object.
68         */
69        public PaperView2D(Function paperMill) {
70            this(paperMill, null);
71      }      }
72      public PaperView2D(View2D child) {      /** Create a new PaperView2D.
73         * @param paperMill A function; input: the plane object, output:
74         *                  a org.nongnu.libvob.gl.Paper object.
75         * @param child The view to render inside this.
76         *                  XXX View2DList should take care of this already.
77         */
78        public PaperView2D(Function paperMill, View2D child) {
79            this.paperMill = paperMill;
80          this.child = child;          this.child = child;
81      }      }
82    
# Line 82  public class PaperView2D extends View2D Line 95  public class PaperView2D extends View2D
95                          )                          )
96      {      {
97          if (dbg) pa("begin render");          if (dbg) pa("begin render");
         if(paperMill == null)  
             paperMill = PaperMill.getInstance();  
98                            
99          int seed = plane.hashCode();          Paper p = (Paper)paperMill.f(plane) ;
   
         Paper p = paperMill.getOptimizedPaper(seed) ;  
100                            
101          org.nongnu.libvob.Vob v = GLRen.createEasyPaperQuad(p, dicefactor, flags);          org.nongnu.libvob.Vob v = GLRen.createEasyPaperQuad(p, dicefactor, flags);
102          int magnified = box2paper;          int magnified = box2paper;

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26