Skip to content

Commit

Permalink
fix CI errors from FlxPool changes (#2940)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli authored Oct 17, 2023
1 parent 75c0379 commit a33b47d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion flixel/math/FlxRect.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class FlxRect implements IFlxPooled
{
public static var pool(get, never):IFlxPool<FlxRect>;

static var _pool = new FlxPool(FlxRect.new.bind(0, 0, 0, 0));
static var _pool:FlxPool<FlxRect> = new FlxPool(FlxRect.new.bind(0, 0, 0, 0));
// With the version below, this caused weird CI issues when FLX_NO_POINT_POOL is defined
// static var _pool = new FlxPool<FlxRect>(FlxRect);

Expand Down
21 changes: 21 additions & 0 deletions flixel/system/macros/FlxDefines.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ private enum UserDefines
FLX_NO_FOCUS_LOST_SCREEN;
FLX_NO_DEBUG;
FLX_RECORD;
/* Defined in HaxeFlixel CI tests, do not use */
FLX_UNIT_TEST;
/* Defined in HaxeFlixel CI tests, do not use */
FLX_COVERAGE_TEST;
/* Defined in HaxeFlixel CI tests, do not use */
FLX_SWF_VERSION_TEST;
/* additional rendering define */
FLX_RENDER_TRIANGLE;
/* Uses flixel 4.0 legacy collision */
Expand Down Expand Up @@ -57,7 +62,16 @@ private enum HelperDefines
FLX_DRAW_QUADS;
FLX_POINT_POOL;
FLX_PITCH;
/* Used in HaxeFlixel CI, should have no effect on personal projects */
FLX_NO_UNIT_TEST;
/* Used in HaxeFlixel CI, should have no effect on personal projects */
FLX_NO_COVERAGE_TEST;
/* Used in HaxeFlixel CI, should have no effect on personal projects */
FLX_NO_SWF_VERSION_TEST;
/* Used in HaxeFlixel CI, should have no effect on personal projects */
FLX_CI;
/* Used in HaxeFlixel CI, should have no effect on personal projects */
FLX_NO_CI;
FLX_SAVE;
}

Expand Down Expand Up @@ -135,10 +149,17 @@ class FlxDefines
defineInversion(FLX_NO_DEBUG, FLX_DEBUG);
defineInversion(FLX_NO_POINT_POOL, FLX_POINT_POOL);
defineInversion(FLX_UNIT_TEST, FLX_NO_UNIT_TEST);
defineInversion(FLX_COVERAGE_TEST, FLX_NO_COVERAGE_TEST);
defineInversion(FLX_SWF_VERSION_TEST, FLX_NO_SWF_VERSION_TEST);
}

static function defineHelperDefines()
{
if (defined(FLX_UNIT_TEST) || defined(FLX_COVERAGE_TEST) || defined(FLX_SWF_VERSION_TEST))
define(FLX_CI);
else
define(FLX_NO_CI);

if (!defined(FLX_NO_MOUSE) && !defined(FLX_NO_MOUSE_ADVANCED) && (!defined("flash") || defined("flash11_2")))
define(FLX_MOUSE_ADVANCED);

Expand Down
1 change: 1 addition & 0 deletions tests/coverage/Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<haxeflag name="--macro" value="include('flixel', true, ['flixel.system.macros'])" />

<haxedef name="FLX_COVERAGE_TEST" />
<section if="coverage1">
<haxedef name="FLX_NO_MOUSE_ADVANCED" />
<haxedef name="FLX_NO_GAMEPAD" />
Expand Down

0 comments on commit a33b47d

Please sign in to comment.