diff --git a/source/flx3d/Flx3DUtil.hx b/source/flx3d/Flx3DUtil.hx index 9a5e0b53..029a06f3 100644 --- a/source/flx3d/Flx3DUtil.hx +++ b/source/flx3d/Flx3DUtil.hx @@ -13,6 +13,7 @@ import flixel.FlxG; * Help from Ne_Eo * @see https://twitter.com/Ne_Eo_Twitch */ +@:access(away3d.core.managers.Stage3DManager) class Flx3DUtil { #if THREE_D_SUPPORT @@ -25,18 +26,25 @@ class Flx3DUtil return FlxG.stage.stage3Ds.length; } + /** + * Returns the total amount of 3D stages that are in use + * @return Int + */ + public static inline function getUsed3D():Int + { + return Stage3DManager._numStageProxies; + } + /** * Returns if a Stage3D is available * @return Bool */ public static inline function is3DAvailable():Bool { - @:privateAccess { - if (Stage3DManager._stageProxies == null) - return true; + if (Stage3DManager._stageProxies == null) + return true; - return Stage3DManager._numStageProxies < Stage3DManager._stageProxies.length; - } + return Stage3DManager._numStageProxies < Stage3DManager._stageProxies.length; } /** diff --git a/source/flx3d/Flx3DView.hx b/source/flx3d/Flx3DView.hx index b034190d..24763bac 100644 --- a/source/flx3d/Flx3DView.hx +++ b/source/flx3d/Flx3DView.hx @@ -36,7 +36,7 @@ class Flx3DView extends FlxView3D { var meshes:Array = []; public function new(x:Float = 0, y:Float = 0, width:Int = -1, height:Int = -1) { if (!Flx3DUtil.is3DAvailable()) - throw "[Flx3DView] 3D is not available on this platform. Stages in use: " + Flx3DUtil.getTotal3D() + ", Max stages allowed: " + FlxG.stage.stage3Ds.length + "."; + throw "[Flx3DView] 3D is not available on this platform. Stages in use: " + Flx3DUtil.getUsed3D() + ", Max stages allowed: " + Flx3DUtil.getTotal3D() + "."; super(x, y, width, height); __cur3DStageID = __3DIDS++; }