Skip to content

Commit

Permalink
before recycling
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealJake12 committed Jun 2, 2024
1 parent a4d462d commit bbd137c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 63 deletions.
5 changes: 2 additions & 3 deletions source/Caching.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Caching extends MusicBeatState
text.font = Paths.font("vcr.ttf");
text.screenCenter(X);

kadeLogo = new FlxSprite(0,0).loadGraphic(Paths.image('KEClogoP'));
kadeLogo = new FlxSprite(0, 0).loadGraphic(Paths.image('KEClogoP'));
kadeLogo.setGraphicSize(Std.int(kadeLogo.width * 0.3));
kadeLogo.updateHitbox();
kadeLogo.alpha = 0;
Expand Down Expand Up @@ -112,7 +112,7 @@ class Caching extends MusicBeatState
function actuallyCache(gpuRender:Bool)
{
FlxG.autoPause = false;
var stamp = Timer.stamp();
// var stamp = Timer.stamp();
switch (gpuRender)
{
case true:
Expand All @@ -132,7 +132,6 @@ class Caching extends MusicBeatState
loaded = true;
MusicBeatState.switchState(new OptionsDirect());
Debug.logTrace("Done");
Debug.logTrace(Timer.stamp() - stamp);
}, 600);
case false:
new lime.app.Future<Void>(function()
Expand Down
2 changes: 1 addition & 1 deletion source/Load.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import lime.app.Future;

class Load extends MusicBeatState
{
var load:FlxSprite = new FlxSprite(0,0);
var load:FlxSprite = new FlxSprite(0, 0);

override public function create()
{
Expand Down
19 changes: 0 additions & 19 deletions source/ModchartState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -586,25 +586,6 @@ class ModchartState
hideTheHUD(hidden);
});

Lua_helper.add_callback(lua, "playVideo", function(videoFile:String)
{
#if VIDEOS
if (sys.FileSystem.exists(Paths.video(videoFile)))
{
PlayState.instance.playVideo(videoFile);
return true;
}
else
{
Debug.logTrace('playVideo: Video file not found: ' + videoFile);
}
return false;
#else
PlayState.instance.startAndEnd();
return true;
#end
});

// sprites

Lua_helper.add_callback(lua, "createWiggle", function(freq:Float, amplitude:Float, speed:Float)
Expand Down
49 changes: 11 additions & 38 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5830,37 +5830,6 @@ class PlayState extends MusicBeatState
Stage = null;
}

public function playVideo(name:String)
{
#if VIDEOS
inCutscene = true;
inCinematic = true;

var filepath:String = Paths.video(name);
if (!OpenFlAssets.exists(filepath))
{
FlxG.log.warn('Couldnt find video file: ' + name);
startAndEnd();
return;
}

var video:VideoHandler = new VideoHandler();
video.load(filepath);
// Recent versions
video.play();
video.onEndReached.add(function()
{
video.dispose();
startAndEnd();
return;
}, true);
#else
FlxG.log.warn('Platform not supported!');
startAndEnd();
return;
#end
}

public function startAndEnd()
{
if (endingSong)
Expand All @@ -5875,8 +5844,17 @@ class PlayState extends MusicBeatState
inCutscene = true;
inCinematic = true;
var diff:String = CoolUtil.getSuffixFromDiff(CoolUtil.difficultyArray[storyDifficulty]);
cutscene = new VideoHandler();
cutscene.load(Paths.video(name));
OpenFlAssets.loadBytes(Paths.video(name)).onComplete(function(bytes:openfl.utils.ByteArray):Void
{
if (cutscene.load(bytes))
{
new FlxTimer().start(0.001, function(tmr:FlxTimer):Void
{
cutscene.play();
});
Debug.logTrace("Fard");
}
});
inst.stop();
cutscene.onEndReached.add(function()
{
Expand All @@ -5901,11 +5879,6 @@ class PlayState extends MusicBeatState

cutscene.dispose();
});

new FlxTimer().start(0.001, function(tmr:FlxTimer):Void
{
cutscene.play();
});
#else
FlxG.log.warn("Platform Not Supported.");
#end
Expand Down
4 changes: 2 additions & 2 deletions source/debug/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ class ChartingState extends MusicBeatState
else
section.sectionNotes.push([noteStrum, noteData, noteSus, TimingStruct.getBeatFromTime(noteStrum), noteShit]);

Debug.logTrace("Note Data : " + noteData + " StrumTime : " + noteStrum + " Section Length : " + section.sectionNotes.length);
Debug.logTrace("Note Data : " + noteData + " StrumTime : " + noteStrum + " Section Length : " + section.sectionNotes.length);

var seg = TimingStruct.getTimingAtTimestamp(noteStrum);

Expand Down Expand Up @@ -1455,7 +1455,7 @@ class ChartingState extends MusicBeatState
if (note.sustainLength > 0)
curRenderedSustains.remove(note.noteCharterObject, true);

destroyBoxes();
destroyBoxes();

for (i in 0...selectedBoxes.members.length)
{
Expand Down

0 comments on commit bbd137c

Please sign in to comment.