Skip to content

Commit

Permalink
Merge branch 'JordanSantiagoYT:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SyncGit12 authored Dec 12, 2024
2 parents 7a65af5 + 57cd7fa commit 50b583b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
7 changes: 7 additions & 0 deletions hmm.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
"dir": null,
"ref": "cbf91e2180fd2e374924fe74844086aab7891666",
"url": "https://gitlab.com/haxe-grig/grig.audio.git"
},
{
"name": "away3d",
"type": "git",
"dir": null,
"ref": "master",
"url": "https://github.com/moxie-coder/away3d"
}
]
}
45 changes: 44 additions & 1 deletion source/editors/BenchmarkState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package editors;
import flixel.FlxG;
import flixel.FlxState;
import model.objects.flixel.Flixel;
import flixel.text.FlxText;
import flixel.util.FlxDestroyUtil;

class BenchmarkState extends FlxState
{
Expand All @@ -17,13 +19,54 @@ class BenchmarkState extends FlxState
{
super.create();

// TODO: add debug info and such
final text:FlxText = new FlxText();
text.text = 'Press ESCAPE to leave.';
text.screenCenter(X);
text.y = FlxG.height * 0.89;
text.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, OUTLINE, FlxColor.BLACK);
text.borderSize = 2;
add(text);

daFlixelLogo = new Flixel();
add(daFlixelLogo);
}

override function destroy()
{
if (daFlixelLogo != null) daFlixelLogo.destroy();
if (daFlixelLogo != null) {
@:privateAccess {
for (mesh in daFlixelLogo.meshs) {
if (mesh != null) {
// Dispose material first, as it may rely on geometry
if (mesh.material != null) {
mesh.material.dispose();
mesh.material = null;
}

// Dispose geometry next
if (mesh.geometry != null) {
mesh.geometry.dispose();
mesh.geometry = null;
}

// Finally, dispose of the mesh itself
mesh.dispose();
mesh = null;
}
}

// Dispose the 3D view (if it exists)
if (daFlixelLogo.view != null) {
daFlixelLogo.view.dispose();
daFlixelLogo.view = null;
}
}

// Destroy the Flixel object
daFlixelLogo = FlxDestroyUtil.destroy(daFlixelLogo);
}

super.destroy();
}
override function update(elapsed:Float)
Expand Down

0 comments on commit 50b583b

Please sign in to comment.