Merge pull request #1134 from FunkinCrew/perf/sustain-trail-leak
This commit is contained in:
@@ -118,7 +118,7 @@
|
||||
"name": "hxcpp",
|
||||
"type": "git",
|
||||
"dir": null,
|
||||
"ref": "43e368e3af08ea38bdc4ea9d4a7a9d4365941b9a",
|
||||
"ref": "d5d9bd200e509f2e6022c8999c91543a0fda30c6",
|
||||
"url": "https://github.com/FunkinCrew/hxcpp"
|
||||
},
|
||||
{
|
||||
|
||||
+7
-1
@@ -21,15 +21,21 @@ class NewgroundsCredentials
|
||||
|
||||
static function main():Void
|
||||
{
|
||||
trace('[PREBUILD] Building...');
|
||||
var start:Float = Sys.time();
|
||||
trace('[PREBUILD] Performing pre-build tasks...');
|
||||
|
||||
saveBuildTime();
|
||||
|
||||
buildCredsFile();
|
||||
|
||||
var end:Float = Sys.time();
|
||||
var duration:Float = end - start;
|
||||
trace('[PREBUILD] Finished pre-build tasks in $duration seconds.');
|
||||
}
|
||||
|
||||
static function saveBuildTime():Void
|
||||
{
|
||||
// PostBuild.hx reads this file and computes the total build duration.
|
||||
var fo:sys.io.FileOutput = File.write(BUILD_TIME_FILE);
|
||||
var now:Float = Sys.time();
|
||||
fo.writeDouble(now);
|
||||
|
||||
@@ -73,8 +73,6 @@ class SustainTrail extends FlxSprite
|
||||
*/
|
||||
public var uvtData:DrawData<Float> = new DrawData<Float>();
|
||||
|
||||
private var processedGraphic:FlxGraphic;
|
||||
|
||||
private var zoom:Float = 1;
|
||||
|
||||
/**
|
||||
@@ -214,7 +212,6 @@ class SustainTrail extends FlxSprite
|
||||
|
||||
// alpha = 0.6;
|
||||
alpha = 1.0;
|
||||
// calls updateColorTransform(), which initializes processedGraphic!
|
||||
updateColorTransform();
|
||||
|
||||
updateClipping();
|
||||
@@ -398,7 +395,7 @@ class SustainTrail extends FlxSprite
|
||||
// if (!isOnScreen(camera)) continue; // TODO: Update this code to make it work properly.
|
||||
|
||||
getScreenPosition(_point, camera).subtractPoint(offset);
|
||||
camera.drawTriangles(processedGraphic, vertices, indices, uvtData, null, _point, blend, true, antialiasing);
|
||||
camera.drawTriangles(graphic, vertices, indices, uvtData, null, _point, blend, true, antialiasing);
|
||||
}
|
||||
|
||||
#if FLX_DEBUG
|
||||
@@ -440,16 +437,7 @@ class SustainTrail extends FlxSprite
|
||||
vertices = null;
|
||||
indices = null;
|
||||
uvtData = null;
|
||||
processedGraphic.destroy();
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
override function updateColorTransform():Void
|
||||
{
|
||||
super.updateColorTransform();
|
||||
if (processedGraphic != null) processedGraphic.destroy();
|
||||
processedGraphic = FlxGraphic.fromGraphic(graphic, true);
|
||||
processedGraphic.bitmap.colorTransform(processedGraphic.bitmap.rect, colorTransform);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user