|
@@ -125,18 +125,17 @@ class Renderer {
|
|
ctx.engine.clear(color, depth, stencil);
|
|
ctx.engine.clear(color, depth, stencil);
|
|
}
|
|
}
|
|
|
|
|
|
- inline function pushTarget( tex ) {
|
|
|
|
- ctx.engine.pushTarget(tex);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- inline function setTarget( tex ) {
|
|
|
|
|
|
+ function setTarget( tex ) {
|
|
if( hasSetTarget ) ctx.engine.popTarget();
|
|
if( hasSetTarget ) ctx.engine.popTarget();
|
|
ctx.engine.pushTarget(tex);
|
|
ctx.engine.pushTarget(tex);
|
|
hasSetTarget = true;
|
|
hasSetTarget = true;
|
|
}
|
|
}
|
|
|
|
|
|
- inline function popTarget() {
|
|
|
|
- ctx.engine.popTarget();
|
|
|
|
|
|
+ function resetTarget() {
|
|
|
|
+ if( hasSetTarget ) {
|
|
|
|
+ ctx.engine.popTarget();
|
|
|
|
+ hasSetTarget = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function get( name : String ) {
|
|
function get( name : String ) {
|
|
@@ -180,10 +179,7 @@ class Renderer {
|
|
passGroups.set(p.name, p);
|
|
passGroups.set(p.name, p);
|
|
}
|
|
}
|
|
render();
|
|
render();
|
|
- if( hasSetTarget ) {
|
|
|
|
- ctx.engine.popTarget();
|
|
|
|
- hasSetTarget = false;
|
|
|
|
- }
|
|
|
|
|
|
+ resetTarget();
|
|
for( p in passes )
|
|
for( p in passes )
|
|
passGroups.set(p.name, null);
|
|
passGroups.set(p.name, null);
|
|
}
|
|
}
|