|
@@ -49,6 +49,7 @@ class Stage3dDriver extends Driver {
|
|
var antiAlias : Int;
|
|
var antiAlias : Int;
|
|
var width : Int;
|
|
var width : Int;
|
|
var height : Int;
|
|
var height : Int;
|
|
|
|
+ var enableDraw : Bool;
|
|
|
|
|
|
@:allow(h3d.impl.VertexWrapper)
|
|
@:allow(h3d.impl.VertexWrapper)
|
|
var empty : flash.utils.ByteArray;
|
|
var empty : flash.utils.ByteArray;
|
|
@@ -65,6 +66,7 @@ class Stage3dDriver extends Driver {
|
|
}
|
|
}
|
|
|
|
|
|
override function reset() {
|
|
override function reset() {
|
|
|
|
+ enableDraw = true;
|
|
curMatBits = -1;
|
|
curMatBits = -1;
|
|
curShader = null;
|
|
curShader = null;
|
|
curBuffer = null;
|
|
curBuffer = null;
|
|
@@ -361,13 +363,14 @@ class Stage3dDriver extends Driver {
|
|
}
|
|
}
|
|
|
|
|
|
override function draw( ibuf : IndexBuffer, startIndex : Int, ntriangles : Int ) {
|
|
override function draw( ibuf : IndexBuffer, startIndex : Int, ntriangles : Int ) {
|
|
- ctx.drawTriangles(ibuf, startIndex, ntriangles);
|
|
|
|
|
|
+ if( enableDraw ) ctx.drawTriangles(ibuf, startIndex, ntriangles);
|
|
}
|
|
}
|
|
|
|
|
|
override function setRenderZone( x : Int, y : Int, width : Int, height : Int ) {
|
|
override function setRenderZone( x : Int, y : Int, width : Int, height : Int ) {
|
|
- if( x == 0 && y == 0 && width < 0 && height < 0 )
|
|
|
|
|
|
+ if( x == 0 && y == 0 && width < 0 && height < 0 ) {
|
|
|
|
+ enableDraw = true;
|
|
ctx.setScissorRectangle(null);
|
|
ctx.setScissorRectangle(null);
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
if( x < 0 ) {
|
|
if( x < 0 ) {
|
|
width += x;
|
|
width += x;
|
|
x = 0;
|
|
x = 0;
|
|
@@ -380,10 +383,9 @@ class Stage3dDriver extends Driver {
|
|
var th = inTarget == null ? this.height : 9999;
|
|
var th = inTarget == null ? this.height : 9999;
|
|
if( x + width > tw ) width = tw - x;
|
|
if( x + width > tw ) width = tw - x;
|
|
if( y + height > th ) height = th - y;
|
|
if( y + height > th ) height = th - y;
|
|
- // for flash, width=0 means no scissor...
|
|
|
|
- if( width <= 0 ) { x = tw; width = 1; };
|
|
|
|
- if( height <= 0 ) { y = th; height = 1; };
|
|
|
|
- ctx.setScissorRectangle(new flash.geom.Rectangle(x, y, width, height));
|
|
|
|
|
|
+ enableDraw = width > 0 && height > 0;
|
|
|
|
+ if( enableDraw )
|
|
|
|
+ ctx.setScissorRectangle(new flash.geom.Rectangle(x, y, width, height));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|