Skip to content

Commit

Permalink
RenderUtil: put back a comment about string profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Nov 10, 2023
1 parent 1f0d0b9 commit d613d7c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/starling/utils/RenderUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ class RenderUtil
else if (#if (haxe_ver < 4.2) Std.is #else Std.isOfType #end(profile, Int))
profiles = [cast profile];
else if (#if (haxe_ver < 4.2) Std.is #else Std.isOfType #end(profile, String))
{
// ensure that the Haxe compiler knows it's a String instead of Dynamic
// it's not required on all targets, but some may throw exceptions with Dynamic
// for instance, on HashLink, it throws 'Can't cast String to i32'
profiles = [Std.string(profile)];
}
else if (#if (haxe_ver < 4.2) Std.is #else Std.isOfType #end(profile, Array))
{
var dynProfiles:Array<Dynamic> = cast(profile, Array<Dynamic>);
Expand All @@ -249,6 +254,9 @@ class RenderUtil
}
else
{
// ensure that the Haxe compiler knows it's a String instead of Dynamic
// it's not required on all targets, but some may throw exceptions with Dynamic
// for instance, on HashLink, it throws 'Can't cast String to i32'
profiles.push(Std.string(prof));
}
}
Expand Down

0 comments on commit d613d7c

Please sign in to comment.