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) { |
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, |
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) |