Add the ability to embed songs audio files.

This commit is contained in:
MAJigsaw77
2025-12-10 11:26:33 -08:00
committed by Kade
parent 770bad3a6d
commit ee2a77d570
+19
View File
@@ -177,6 +177,17 @@ class Project extends HXProject
"darnellCutscene-censored.mp4"
];
//
// ASSET EMBEDDING
//
/**
* The songs whose audio files should be embedded inside the executable.
*/
static final EMBED_SONGS_AUDIO:Array<String> = [
"spaghetti"
];
//
// BUILD FLAGS
// Inverse build flags are automatically populated.
@@ -1438,8 +1449,16 @@ class Project extends HXProject
// Shared asset libraries
addAssetLibrary("songs", shouldEmbed, shouldPreload);
addAssetPath("assets/songs", "assets/songs", "songs", ["*"], exclude, shouldEmbed, "assets");
for (song in EMBED_SONGS_AUDIO)
{
removeAssetPath('assets/songs/$song');
addAssetPath('assets/songs/$song', 'assets/songs/$song', "songs", ["*"], exclude, true, "assets");
}
addAssetLibrary("shared", shouldEmbed, shouldPreload);
addAssetPath("assets/shared", "assets/shared", "shared", ["*"], exclude, shouldEmbed, "assets");
if (FEATURE_VIDEO_PLAYBACK.isEnabled(this))
{
var shouldEmbedVideos = false;