From b1f265bc5a03187dd2295ab7f759b0a6a3ecdf79 Mon Sep 17 00:00:00 2001 From: Dirk-Dinkum <134403819+Dirk-Dinkum@users.noreply.github.com> Date: Thu, 28 Dec 2023 14:38:00 +0100 Subject: [PATCH 1/3] Removed NONE and NTWO From f91ee82b732752a04f27390602683c74a43227f6 Mon Sep 17 00:00:00 2001 From: Mihai Alexandru <77043862+MAJigsaw77@users.noreply.github.com> Date: Mon, 1 Jan 2024 20:44:51 +0200 Subject: [PATCH 2/3] Use haxelib release of hxvlc. (#231) * Update libs.xml * Update VideoCutscene.hx * Fixed bug with videos --------- Co-authored-by: NeeEoo --- libs.xml | 2 +- source/funkin/game/cutscenes/VideoCutscene.hx | 36 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/libs.xml b/libs.xml index 70e72592..262fe27a 100644 --- a/libs.xml +++ b/libs.xml @@ -12,7 +12,7 @@ - + diff --git a/source/funkin/game/cutscenes/VideoCutscene.hx b/source/funkin/game/cutscenes/VideoCutscene.hx index 68a86b92..8e290631 100644 --- a/source/funkin/game/cutscenes/VideoCutscene.hx +++ b/source/funkin/game/cutscenes/VideoCutscene.hx @@ -7,7 +7,10 @@ import flixel.addons.display.FlxBackdrop; import sys.io.File; #end import funkin.backend.FunkinText; +import haxe.io.FPHelper; import haxe.xml.Access; +import haxe.Int64; +import flixel.util.FlxTimer; #if VIDEO_CUTSCENES import hxvlc.flixel.FlxVideo; #end @@ -56,6 +59,11 @@ class VideoCutscene extends Cutscene { video.onEndReached.add(video.dispose); video.onEndReached.add(close); + //cover = new FlxSprite(0, FlxG.height * 0.85).makeSolid(FlxG.width + 50, FlxG.height + 50, 0xFF000000); + //cover.scrollFactor.set(0, 0); + //cover.screenCenter(); + //add(cover); + bg = new FlxSprite(0, FlxG.height * 0.85).makeGraphic(1, 1, 0xFF000000); bg.alpha = 0.5; bg.visible = false; @@ -85,7 +93,12 @@ class VideoCutscene extends Cutscene { videoReady = true; }); } else { - video.play(localPath); + if (video.load(localPath)) + new FlxTimer().start(0.001, function(tmr:FlxTimer) { + video.play(); + }); + else + close(); } add(bg); add(subtitle); @@ -160,13 +173,28 @@ class VideoCutscene extends Cutscene { #if VIDEO_CUTSCENES if (videoReady) { videoReady = false; - video.play(localPath); + + if (video.load(localPath)) + new FlxTimer().start(0.001, function(tmr:FlxTimer) { + video.play(); + }); + else + { + close(); + + if (loadingBackdrop != null) + loadingBackdrop.visible = false; + + return; + } + if (loadingBackdrop != null) loadingBackdrop.visible = false; } @:privateAccess - var time = video.time; - while (subtitles.length > 0 && subtitles[0].time < time) + var time:Int64 = video.time; + + while (subtitles.length > 0 && subtitles[0].time < Math.round(FPHelper.i64ToDouble(time.low, time.high))) setSubtitle(subtitles.shift()); if (loadingBackdrop != null) { From eecb1ef83cc1db1da7b93857f4a161ac017d8039 Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Mon, 1 Jan 2024 22:54:51 +0100 Subject: [PATCH 3/3] Fixed Linux workflow Co-Authored-By: Sonamaker1 <87080176+sonamaker1@users.noreply.github.com> --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index f7e7ef90..a8452f77 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -6,7 +6,7 @@ jobs: build: name: Linux Build permissions: write-all - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Pulling the source uses: actions/checkout@v2