The death of hashlink

This commit is contained in:
MAJigsaw77
2026-08-02 21:14:21 +08:00
committed by Hundrec
parent 77d829e888
commit bf6b8eecb8
9 changed files with 17 additions and 87 deletions
+8 -2
View File
@@ -80,12 +80,13 @@
{ "name": "html5", "enabled": true, "label": "HTML5" },
{ "name": "android", "enabled": true, "label": "Android" },
{ "name": "ios", "enabled": true, "label": "iOS" },
{ "name": "hl", "enabled": true, "label": "HashLink" },
// Disabled targets
{ "name": "air", "enabled": false },
{ "name": "electron", "enabled": false },
{ "name": "flash", "enabled": false },
{ "name": "neko", "enabled": false }
{ "name": "neko", "enabled": false },
{ "name": "hl", "enabled": false }
],
"lime.defaultTargetConfiguration": "Windows / Debug",
"lime.targetConfigurations": [
@@ -143,6 +144,11 @@
"target": "windows",
"args": ["-debug", "-DLATENCY", "-DFEATURE_DEBUG_FUNCTIONS"]
},
{
"label": "Windows / Debug (No Asset Redirect)",
"target": "windows",
"args": ["-debug", "-DNO_REDIRECT_ASSETS_FOLDER"]
},
{
"label": "Windows / Debug (Waveform Test)",
"target": "windows",
+2 -2
View File
@@ -188,7 +188,7 @@
{
"name": "lime",
"type": "git",
"ref": "ef9f3d6e447bdf216de6ccbeca53d7e2606ab408",
"ref": "22c12c76c97e0e7e83862f437b501e859a4e2222",
"url": "https://github.com/FunkinCrew/lime"
},
{
@@ -201,7 +201,7 @@
{
"name": "openfl",
"type": "git",
"ref": "963bcf35dbe80be7b3c7966a7efb1572058706bb",
"ref": "640efd4b4939f07c9a47c421ead7d766cb91ba8c",
"url": "https://github.com/FunkinCrew/openfl"
},
{
+4 -51
View File
@@ -789,31 +789,11 @@ class Project extends HXProject
error('Unknown platform type (got ${platformType})');
}
// Print whether we are using HXCPP, HashLink, or something else.
// Print whether we are using HXCPP, JavaScript, or something else.
if (isWeb())
{
info('Target Language: JavaScript (HTML5)');
}
else if (isHashLink())
{
info('Target Language: HashLink');
}
else if (isNeko())
{
info('Target Language: Neko');
}
else if (isJava())
{
info('Target Language: Java');
}
else if (isNodeJS())
{
info('Target Language: JavaScript (NodeJS)');
}
else if (isCSharp())
{
info('Target Language: C#');
}
else if (isCPP())
{
info('Target Language: C++');
@@ -913,7 +893,7 @@ class Project extends HXProject
FEATURE_POLYMOD_MODS.apply(this, true);
// Video playback should be enabled on desktop, web, and mobile.
FEATURE_VIDEO_PLAYBACK.apply(this, !isHashLink());
FEATURE_VIDEO_PLAYBACK.apply(this, true);
// Video subtitles only work via using hxvlc.
FEATURE_VIDEO_SUBTITLES.apply(this, FEATURE_VIDEO_PLAYBACK.isEnabled(this) && !isWeb());
@@ -924,7 +904,7 @@ class Project extends HXProject
// Should be true on desktop, non-tester builds.
// We don't want testers to accidentally leak songs to their Discord friends!
FEATURE_DISCORD_RPC.apply(this, isDesktop() && !FEATURE_DEBUG_FUNCTIONS.isEnabled(this) && !isHashLink());
FEATURE_DISCORD_RPC.apply(this, isDesktop() && !FEATURE_DEBUG_FUNCTIONS.isEnabled(this));
FEATURE_LOST_FOCUS_VOLUME.apply(this, isDesktop());
@@ -1359,8 +1339,6 @@ class Project extends HXProject
if ((isDesktop() || isMobile()) && FEATURE_VIDEO_PLAYBACK.isEnabled(this))
{
// hxvlc doesn't function on HashLink or non-desktop platforms
// It's also unnecessary if video playback is disabled
addHaxelib('hxvlc'); // Video playback
}
@@ -1544,7 +1522,7 @@ class Project extends HXProject
var exportPath:Null<String> = app.path ?? "";
// mac target uses `macos` for the export folder instead of `mac`
var platform:String = isHashLink() ? 'hl' : (!isMac() ? Std.string(this.target) : 'macos');
var platform:String = !isMac() ? Std.string(this.target) : 'macos';
var basePath:String = Path.join([exportPath, platform, "bin"]);
var assetsPath:String = "";
@@ -1775,31 +1753,6 @@ class Project extends HXProject
return this.target == Platform.IOS && this.targetFlags.exists("simulator");
}
public function isHashLink():Bool
{
return this.targetFlags.exists("hl");
}
public function isNeko():Bool
{
return this.targetFlags.exists("neko");
}
public function isJava():Bool
{
return this.targetFlags.exists("java");
}
public function isNodeJS():Bool
{
return this.targetFlags.exists("nodejs");
}
public function isCSharp():Bool
{
return this.targetFlags.exists("cs");
}
public function isCPP():Bool
{
return this.defines.exists("cpp");
-10
View File
@@ -161,16 +161,6 @@ class Preferences
#if NO_FEATURE_DEBUG_DISPLAY
return DebugDisplayMode.Off;
#else
#if hl
// Account for when debugDisplay used to be a boolean
var options:Null<SaveDataOptions> = Save.instance?.options;
if (options != null && Std.isOfType(options.debugDisplay, Bool))
{
var convertedDebugDisplay = cast(options.debugDisplay, Bool) ? DebugDisplayMode.Simple : DebugDisplayMode.Off;
options.debugDisplay = convertedDebugDisplay;
Save.system.flush();
}
#end
return Save?.instance?.options?.debugDisplay ?? 'Off';
#end
}
@@ -5,7 +5,6 @@ import openfl.display.BlendMode;
class RuntimeCustomBlendShader extends RuntimePostEffectShader
{
// only different name purely for hashlink fix
public var sourceSwag(default, set):BitmapData;
function set_sourceSwag(value:BitmapData):BitmapData
@@ -108,7 +108,7 @@ class RuntimeRainShader extends RuntimePostEffectShader
return lightMap = value;
}
public var numLightsSwag(default, set):Int = 0; // swag heads, we have never been more back (needs different name purely for hashlink casting fix)
public var numLightsSwag(default, set):Int = 0;
function set_numLightsSwag(value:Int):Int
{
+1 -7
View File
@@ -16,15 +16,9 @@ class SongItemGroup extends FlxTypedGroup<SongMenuItem>
var favIconBlurredShader:GaussianBlurShader = new GaussianBlurShader(1.2);
var weekTextFilter:GlowFilter = new GlowFilter(0xFF1A1C24, 1, 5, 5, 3.13, 1, true, true);
#if hl
// What the hell is the compiler about on here?
override function recycle(?cls:Class<Dynamic>, ?factory:Void->Dynamic, force:Bool = false, revive:Bool = true):SongMenuItem
#else
override function recycle(?cls:Class<SongMenuItem>, ?factory:Void->SongMenuItem, force:Bool = false, revive:Bool = true):SongMenuItem
#end
{
var capsule:SongMenuItem = super.recycle(#if hl cast #end cls, factory, force, revive);
var capsule:SongMenuItem = super.recycle(cls, factory, force, revive);
// Apply the same shader instance to some elements so that we can use one draw call to render multiple of them.
capsule.fakeBlurredRanking.shader = rankBlurredShader;
@@ -269,7 +269,7 @@ class FunkinPreloader extends FlxBasePreloader
override function update(percent:Float):Void
{
var elapsed:Float = (#if hl Sys.time() * Constants.MS_PER_SEC #else Date.now().getTime() #end - this._startTime) / Constants.MS_PER_SEC;
var elapsed:Float = (Date.now().getTime() - this._startTime) / Constants.MS_PER_SEC;
vfdShader.update(elapsed * 100);
-12
View File
@@ -45,11 +45,6 @@ class MemoryUtil
#elseif js
var result:String = 'JS-MNS:';
result += '\n- Memory Used: ${getGCMemory()} bytes';
#elseif hl
var result:String = 'HL-MNNS:';
result += '\n- Memory Used: ${hl.Gc.stats().currentMemory} bytes';
result += '\n- Memory Allocated: ${hl.Gc.stats().totalAllocated} bytes';
result += '\n- Memory Allocation Count: ${hl.Gc.stats().allocationCount}';
#else
var result:String = 'Unknown GC';
#end
@@ -143,8 +138,6 @@ class MemoryUtil
{
#if cpp
cpp.vm.Gc.enable(true);
#elseif hl
hl.Gc.enable(true);
#else
throw 'Not implemented!';
#end
@@ -157,8 +150,6 @@ class MemoryUtil
{
#if cpp
cpp.vm.Gc.enable(false);
#elseif hl
hl.Gc.enable(false);
#else
throw 'Not implemented!';
#end
@@ -173,9 +164,6 @@ class MemoryUtil
{
#if cpp
cpp.vm.Gc.run(major);
#elseif hl
// Doesn't seem to have just a collect function?
hl.Gc.major();
#else
throw 'Not implemented!';
#end