mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-08-20 07:25:59 +00:00
vis wips wips wips
This commit is contained in:
parent
df427c8ecb
commit
a750cc1620
|
@ -16,6 +16,7 @@ class PolygonSpectogram extends MeshRender
|
|||
public var visType:VISTYPE = UPDATED;
|
||||
public var daHeight:Float = FlxG.height;
|
||||
public var realtimeVisLenght:Float = 0.2;
|
||||
public var realtimeStartOffset:Float = 0;
|
||||
|
||||
var numSamples:Int = 0;
|
||||
var setBuffer:Bool = false;
|
||||
|
@ -86,7 +87,7 @@ class PolygonSpectogram extends MeshRender
|
|||
|
||||
var prevPoint:FlxPoint = new FlxPoint();
|
||||
|
||||
var funnyPixels:Int = Std.int(daHeight); // sorta redundant but just need it for different var...
|
||||
var funnyPixels:Int = Std.int(daHeight * detail); // sorta redundant but just need it for different var...
|
||||
|
||||
if (prevAudioData == audioData.subarray(startSample, startSample + samplesToGen)) return; // optimize / finish funciton here, no need to re-render
|
||||
|
||||
|
@ -130,7 +131,7 @@ class PolygonSpectogram extends MeshRender
|
|||
|
||||
curTime = vis.snd.time;
|
||||
|
||||
if (vis.snd.time < vis.snd.length - realtimeVisLenght) generateSection(vis.snd.time, realtimeVisLenght);
|
||||
if (vis.snd.time < vis.snd.length - realtimeVisLenght) generateSection(vis.snd.time + realtimeStartOffset, realtimeVisLenght);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,9 @@ import flixel.sound.FlxSound;
|
|||
|
||||
class PolygonVisGroup extends FlxTypedGroup<PolygonSpectogram>
|
||||
{
|
||||
var playerVis:PolygonSpectogram;
|
||||
var opponentVis:PolygonSpectogram;
|
||||
public var playerVis:PolygonSpectogram;
|
||||
public var opponentVis:PolygonSpectogram;
|
||||
|
||||
var instVis:PolygonSpectogram;
|
||||
|
||||
public function new()
|
||||
|
|
|
@ -330,6 +330,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
{
|
||||
gridTiledSprite.y = -scrollPositionInPixels + (MENU_BAR_HEIGHT + GRID_TOP_PAD);
|
||||
gridPlayheadScrollArea.y = gridTiledSprite.y;
|
||||
|
||||
if (audioVisGroup != null && audioVisGroup.playerVis != null)
|
||||
{
|
||||
audioVisGroup.playerVis.y = Math.max(gridTiledSprite.y, MENU_BAR_HEIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,12 +433,16 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
|||
|
||||
function get_playheadPositionInMs():Float
|
||||
{
|
||||
if (audioVisGroup != null && audioVisGroup.playerVis != null)
|
||||
audioVisGroup.playerVis.realtimeStartOffset = -Conductor.getStepTimeInMs(playheadPositionInSteps);
|
||||
return Conductor.getStepTimeInMs(playheadPositionInSteps);
|
||||
}
|
||||
|
||||
function set_playheadPositionInMs(value:Float):Float
|
||||
{
|
||||
playheadPositionInSteps = Conductor.getTimeInSteps(value);
|
||||
|
||||
if (audioVisGroup != null && audioVisGroup.playerVis != null) audioVisGroup.playerVis.realtimeStartOffset = -value;
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
@ -178,9 +178,15 @@ class ChartEditorAudioHandler
|
|||
case BF:
|
||||
state.audioVocalTrackGroup.addPlayerVoice(vocalTrack);
|
||||
state.audioVisGroup.addPlayerVis(vocalTrack);
|
||||
state.audioVisGroup.playerVis.x = 885;
|
||||
state.audioVisGroup.playerVis.realtimeVisLenght = Conductor.getStepTimeInMs(16) * 0.00195;
|
||||
state.audioVisGroup.playerVis.daHeight = (ChartEditorState.GRID_SIZE) * 16;
|
||||
state.audioVisGroup.playerVis.detail = 1;
|
||||
return true;
|
||||
case DAD:
|
||||
state.audioVocalTrackGroup.addOpponentVoice(vocalTrack);
|
||||
state.audioVisGroup.addOpponentVis(vocalTrack);
|
||||
state.audioVisGroup.opponentVis.x = 435;
|
||||
return true;
|
||||
case OTHER:
|
||||
state.audioVocalTrackGroup.add(vocalTrack);
|
||||
|
|
Loading…
Reference in a new issue