Skip to content

Commit

Permalink
Minor FlxDrawTrianglesItem optimization (#3121)
Browse files Browse the repository at this point in the history
* Update FlxDrawTrianglesItem.hx

* remove checks for lower openfl versions
  • Loading branch information
MaybeMaru authored Apr 21, 2024
1 parent 873d5a6 commit b39947f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions flixel/graphics/tile/FlxDrawTrianglesItem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import openfl.display.ShaderParameter;
import openfl.display.TriangleCulling;
import openfl.geom.ColorTransform;

typedef DrawData<T> = #if (flash || openfl >= "4.0.0") openfl.Vector<T> #else Array<T> #end;
typedef DrawData<T> = openfl.Vector<T>;

/**
* @author Zaphod
Expand Down Expand Up @@ -101,10 +101,10 @@ class FlxDrawTrianglesItem extends FlxDrawBaseItem<FlxDrawTrianglesItem>
override public function reset():Void
{
super.reset();
vertices.splice(0, vertices.length);
indices.splice(0, indices.length);
uvtData.splice(0, uvtData.length);
colors.splice(0, colors.length);
vertices.length = 0;
indices.length = 0;
uvtData.length = 0;
colors.length = 0;

verticesPosition = 0;
indicesPosition = 0;
Expand Down

1 comment on commit b39947f

@SomeGuyWhoLovesCoding
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait you can set length in vector?

Please sign in to comment.