video cutscenes define

This commit is contained in:
Yoshman29
2022-12-14 14:20:59 +01:00
parent 90cfadb792
commit ca03550463
3 changed files with 8 additions and 5 deletions
+3
View File
@@ -190,4 +190,7 @@
<!-- Comment this out to use the default OpenFL assets system for the assets/ folder. !-->
<haxedef name="USE_ADAPTED_ASSETS" />
<!-- Comment this out to disable video cutscene support, in case of compilation errors. !-->
<haxedef name="VIDEO_CUTSCENES" unless="web" />
</project>
+1 -1
View File
@@ -1,6 +1,6 @@
package funkin.cutscenes;
#if sys
#if VIDEO_CUTSCENES
import vlc.bitmap.VlcBitmap;
import flixel.util.FlxTimer;
import funkin.options.PlayerSettings;
+4 -4
View File
@@ -9,7 +9,7 @@ class VideoCutscene extends Cutscene {
var path:String;
var localPath:String;
#if sys
#if VIDEO_CUTSCENES
var video:MP4Handler;
var videoSprite:FlxSprite;
#end
@@ -27,7 +27,7 @@ class VideoCutscene extends Cutscene {
cutsceneCamera.bgColor = 0;
FlxG.cameras.add(cutsceneCamera, false);
#if sys
#if VIDEO_CUTSCENES
video = new MP4Handler();
video.finishCallback = close;
video.canvasWidth = cutsceneCamera.width;
@@ -46,12 +46,12 @@ class VideoCutscene extends Cutscene {
public override function update(elapsed:Float) {
super.update(elapsed);
#if !sys
#if !VIDEO_CUTSCENES
close();
#end
}
public override function destroy() {
FlxG.cameras.remove(camera, true);
FlxG.cameras.remove(cutsceneCamera, true);
super.destroy();
}
}