/[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.3 by benja, Thu Apr 24 20:52:23 2003 UTC revision 1.4 by tjl, Fri Apr 25 12:44:43 2003 UTC
# Line 12  import org.nongnu.libvob.gl.*; Line 12  import org.nongnu.libvob.gl.*;
12   * this other view is rendered on top of the paper.   * this other view is rendered on top of the paper.
13   */   */
14  public class PaperView2D extends View2D {  public class PaperView2D extends View2D {
15        public static boolean dbg = true;
16    public static final String rcsid = "$Id$";
17        private static void pa(String s) { System.out.println("AlphContent: "+s); }
18    
19      public PaperMill paperMill;      public PaperMill paperMill;
20      public float dicefactor = 1;      public float dicefactor = 1;
21      public int flags = 0;      public int flags = 0;
22    
23        public float paperScaling = 1/200f;
24    
25      protected View2D child;      protected View2D child;
26            
27      public PaperView2D(GraphicsAPI.RenderingSurface optWin) {      public PaperView2D(GraphicsAPI.RenderingSurface optWin) {
28          this.optWin = optWin;          this(optWin, null);
         this.child = null;  
29      }      }
30      public PaperView2D(GraphicsAPI.RenderingSurface optWin,      public PaperView2D(GraphicsAPI.RenderingSurface optWin,
31                         View2D child) {                         View2D child) {
# Line 31  public class PaperView2D extends View2D Line 36  public class PaperView2D extends View2D
36      public GraphicsAPI.RenderingSurface optWin;      public GraphicsAPI.RenderingSurface optWin;
37    
38      private float[] tmp = new float[2];      private float[] tmp = new float[2];
39        private float[] tmp2 = new float[2];
40      public void render(VobScene vs,      public void render(VobScene vs,
41                  Object plane,                  Object plane,
42                  int matchingParent,                  int matchingParent,
# Line 46  public class PaperView2D extends View2D Line 52  public class PaperView2D extends View2D
52          org.nongnu.libvob.Vob v = GLRen.createEasyPaperQuad(          org.nongnu.libvob.Vob v = GLRen.createEasyPaperQuad(
53                      p, dicefactor, flags);                      p, dicefactor, flags);
54                    
55          vs.coords.getSqSize(box2paper, tmp);          int magnified = box2paper;
56          int magnified = vs.coords.orthoBox(box2paper, 0, 0, 0,          if(paperScaling != 1) {
57                                             1/200f, 1/200f,              int magnify = vs.coords.scale(0, paperScaling, paperScaling);
58                                             tmp[0], tmp[1]);              magnified = vs.coords.concat(magnify, magnified);
59                if(dbg) {
60                    vs.coords.getSqSize(box2paper, tmp);
61                    vs.coords.getSqSize(magnified, tmp2);
62                    pa("SQSIZES: "+tmp[0]+" "+tmp[1]+" "+tmp2[0]+" "+tmp2[1]);
63                }
64    
65            }
66          vs.put(v, box2screen, magnified);          vs.put(v, box2screen, magnified);
67    
68          if(child != null)          if(child != null)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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