diff --git a/src/starling/rendering/BatchProcessor.hx b/src/starling/rendering/BatchProcessor.hx index 1c36c24..3510a08 100644 --- a/src/starling/rendering/BatchProcessor.hx +++ b/src/starling/rendering/BatchProcessor.hx @@ -14,7 +14,7 @@ import starling.display.Mesh; import starling.display.MeshBatch; import starling.utils.MeshSubset; import starling.utils.ArrayUtil; -import haxe.ds.Map; +import haxe.ds.ObjectMap; /** This class manages a list of mesh batches of different types; * it acts as a "meta" MeshBatch that initiates all rendering. @@ -183,10 +183,10 @@ class BatchProcessor { } class BatchPool { - private var _batchLists:Map, Array>; + private var _batchLists:ObjectMap>; public function new() { - _batchLists = new Map, Array>(); + _batchLists = new ObjectMap(); } public function purge():Void { @@ -207,10 +207,10 @@ class BatchPool { } public function get(styleType:Class):MeshBatch { - var batchList:Array = _batchLists[styleType]; + var batchList:Array = _batchLists.get(styleType); if (batchList == null) { batchList = new Array(); - _batchLists[styleType] = batchList; + _batchLists.set(styleType, batchList); } if (batchList.length > 0) @@ -221,7 +221,7 @@ class BatchPool { public function put(meshBatch:MeshBatch):Void { var styleType:Class = meshBatch.style.type; - var batchList:Array = _batchLists[styleType]; + var batchList:Array = _batchLists.get(styleType); if (batchList == null) { batchList = new Array(); _batchLists.set(styleType, batchList);