|
@@ -10,6 +10,7 @@ class TileLayerContent extends h3d.prim.Primitive {
|
|
|
public var yMin : Float;
|
|
|
public var xMax : Float;
|
|
|
public var yMax : Float;
|
|
|
+ public var useAllocator = false;
|
|
|
|
|
|
var state : BatchDrawState;
|
|
|
|
|
@@ -20,7 +21,10 @@ class TileLayerContent extends h3d.prim.Primitive {
|
|
|
|
|
|
public function clear() {
|
|
|
tmp = new hxd.FloatBuffer();
|
|
|
- if( buffer != null ) hxd.impl.Allocator.get().disposeBuffer(buffer);
|
|
|
+ if( buffer != null ) {
|
|
|
+ if(useAllocator) hxd.impl.Allocator.get().disposeBuffer(buffer);
|
|
|
+ else buffer.dispose();
|
|
|
+ }
|
|
|
buffer = null;
|
|
|
xMin = hxd.Math.POSITIVE_INFINITY;
|
|
|
yMin = hxd.Math.POSITIVE_INFINITY;
|
|
@@ -402,13 +406,16 @@ class TileLayerContent extends h3d.prim.Primitive {
|
|
|
override public function alloc(engine:h3d.Engine) {
|
|
|
if( tmp == null ) clear();
|
|
|
if( tmp.length > 0 ) {
|
|
|
- buffer = hxd.impl.Allocator.get().ofFloats(tmp, 8, RawQuads);
|
|
|
+ buffer = useAllocator
|
|
|
+ ? hxd.impl.Allocator.get().ofFloats(tmp, 8, RawQuads)
|
|
|
+ : h3d.Buffer.ofFloats(tmp, 8, [Quads, RawFormat]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
override function dispose() {
|
|
|
if( buffer != null ) {
|
|
|
- hxd.impl.Allocator.get().disposeBuffer(buffer);
|
|
|
+ if(useAllocator) hxd.impl.Allocator.get().disposeBuffer(buffer);
|
|
|
+ else buffer.dispose();
|
|
|
buffer = null;
|
|
|
}
|
|
|
super.dispose();
|