Merge AJ's and Daisuke's work together.
Hopefully.
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
local Noteskin = ... or {}
|
||||
local Noteskin = {}
|
||||
|
||||
--bBlanks:
|
||||
--bBlanks:
|
||||
Noteskin.bBlanks = {
|
||||
--["element"] = true|false;
|
||||
["Hold Tail Active"] = true;
|
||||
["Roll Tail Active"] = true;
|
||||
["Hold Tail Active"] = true;
|
||||
["Roll Tail Inactive"] = true;
|
||||
["Roll Tail Inactive"] = true;
|
||||
}
|
||||
Noteskin.ElementRedirs = {
|
||||
--["element"] = "redirected_element";
|
||||
["Hold Head Active"] = "Tap Note";
|
||||
["Hold Head Inactive"] = "Tap Note";
|
||||
["Roll Head Active"] = "Tap Note";
|
||||
["Roll Head Inactive"] = "Tap Note";
|
||||
["Roll Head Active"] = "Roll Head Active";
|
||||
["Roll Head Inactive"] = "Roll Head Active";
|
||||
["Tap Fake"] = "Tap Note";
|
||||
--
|
||||
["Hold Topcap Inactive"] = "Hold Topcap Active";
|
||||
@@ -19,17 +21,22 @@ Noteskin.ElementRedirs = {
|
||||
["Hold Bottomcap Inactive"] = "Hold Bottomcap Active";
|
||||
["Hold Tail Inactive"] = "Hold Tail Active";
|
||||
--
|
||||
["Roll Topcap Inactive"] = "Roll Topcap Active";
|
||||
["Roll Body Inactive"] = "Roll Body Active";
|
||||
["Roll Bottomcap Inactive"] = "Roll Bottomcap Active";
|
||||
["Roll Tail Inactive"] = "Roll Tail Active";
|
||||
["Roll Topcap Active"] = "Hold Topcap Active";
|
||||
["Roll Body Active"] = "Hold Body Active";
|
||||
["Roll Bottomcap Active"] = "Hold Bottomcap Active";
|
||||
["Roll Tail Active"] = "Hold Tail Active";
|
||||
--
|
||||
["Roll Topcap Inactive"] = "Hold Topcap Active";
|
||||
["Roll Body Inactive"] = "Hold Body Active";
|
||||
["Roll Bottomcap Inactive"] = "Hold Bottomcap Active";
|
||||
["Roll Tail Inactive"] = "Hold Tail Active";
|
||||
}
|
||||
Noteskin.ButtonRedirs = {
|
||||
Center = "Center";
|
||||
UpLeft = "UpLeft";
|
||||
UpRight = "UpLeft";
|
||||
UpRight = "UpRight";
|
||||
DownLeft = "DownLeft";
|
||||
DownRight = "DownLeft";
|
||||
DownRight = "DownRight";
|
||||
}
|
||||
Noteskin.BaseRotX = {
|
||||
Center = 0;
|
||||
@@ -41,9 +48,9 @@ Noteskin.BaseRotX = {
|
||||
Noteskin.BaseRotY = {
|
||||
Center = 0;
|
||||
UpLeft = 0;
|
||||
UpRight = 180;
|
||||
UpRight = 0;
|
||||
DownLeft = 0;
|
||||
DownRight = 180;
|
||||
DownRight = 0;
|
||||
}
|
||||
|
||||
local function func()
|
||||
@@ -71,6 +78,8 @@ local function func()
|
||||
local path = NOTESKIN:GetPath(Noteskin.ButtonRedirs[sButton],ElementToLoad)
|
||||
--Graficos separados para holds y rolls
|
||||
if string.find(sElement,"Hold") or string.find(sElement,"Roll") then
|
||||
--if ( string.find(sElement,"Hold") or string.find(sElement,"Roll") ) and not ( string.find(sElement,"Head") or string.find(sElement,"Tail") ) then
|
||||
--if ( string.find(sElement,"Hold") or string.find(sElement,"Roll") ) and ( string.find(sElement,"Body") ) then
|
||||
path = NOTESKIN:GetPath(sButton,ElementToLoad)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
return Def.ActorFrame {
|
||||
--note graphic
|
||||
NOTESKIN:LoadActor(Var "Button", "Tap Note") .. {
|
||||
InitCommand=cmd(blend,"BlendMode_Add";playcommand,"Glow");
|
||||
W1Command=cmd(playcommand,"Glow");
|
||||
@@ -6,10 +7,44 @@ return Def.ActorFrame {
|
||||
W3Command=cmd(playcommand,"Glow");
|
||||
W4Command=cmd();
|
||||
W5Command=cmd();
|
||||
HoldingOnCommand=cmd(playcommand,"Glow");
|
||||
--HoldingOnCommand=cmd(playcommand,"Glow");
|
||||
HitMineCommand=cmd(playcommand,"Glow");
|
||||
GlowCommand=cmd(setstate,0;finishtweening;diffusealpha,1.0;zoom,1.0;linear,0.15;diffusealpha,0.9;zoom,1.15;linear,0.15;diffusealpha,0.0;zoom,1.3);
|
||||
HeldCommand=cmd(playcommand,"Glow");
|
||||
};
|
||||
NOTESKIN:LoadActor(Var "Button", "Ready Receptor")..{
|
||||
Name="Tap";
|
||||
Frames = { { Frame = 2 } };
|
||||
InitCommand=cmd(zoom,1;diffusealpha,0);
|
||||
TapCommand=cmd(finishtweening;diffusealpha,1;zoom,1;linear,0.2;diffusealpha,0;zoom,1.2);
|
||||
|
||||
W1Command=cmd(playcommand,"Tap");
|
||||
W2Command=cmd(playcommand,"Tap");
|
||||
W3Command=cmd(playcommand,"Tap");
|
||||
W4Command=cmd(playcommand,"Tap");
|
||||
W5Command=cmd(playcommand,"Tap");
|
||||
|
||||
HitMineCommand=cmd(playcommand,"Tap");
|
||||
HeldCommand=cmd(playcommand,"Tap");
|
||||
|
||||
--NONECommand=cmd(playcommand,"Tap");
|
||||
|
||||
--HeldCommand=NOTESKIN:GetMetricA(Var "Button", "TapHeldCommand");
|
||||
--NOT WORKING!!
|
||||
NoneCommand=cmd(linear,0.1;zoom,2);
|
||||
};
|
||||
--explosion
|
||||
LoadActor("_flash")..{
|
||||
InitCommand=cmd(blend,"BlendMode_Add";playcommand,"Glow");
|
||||
W1Command=cmd(playcommand,"Glow");
|
||||
W2Command=cmd(playcommand,"Glow");
|
||||
W3Command=cmd(playcommand,"Glow");
|
||||
W4Command=cmd();
|
||||
W5Command=cmd();
|
||||
--HoldingOnCommand=cmd(playcommand,"Glow");
|
||||
HitMineCommand=cmd(playcommand,"Glow");
|
||||
HeldCommand=cmd(playcommand,"Glow");
|
||||
GlowCommand=cmd(setstate,0;finishtweening;diffusealpha,1.0;zoom,1.0;linear,0.15;diffusealpha,0.9;zoom,1.1;linear,0.15;diffusealpha,0.0;zoom,1.2);
|
||||
GlowCommand=cmd(setstate,0;finishtweening;diffusealpha,1;zoom,1;linear,0.2;diffusealpha,0;zoom,1.2);
|
||||
};
|
||||
Def.Quad {
|
||||
InitCommand=cmd(diffuse,1,1,1,0;zoomto,SCREEN_WIDTH*100,SCREEN_HEIGHT*100;zoomz,SCREEN_WIDTH*SCREEN_HEIGHT);
|
||||
|
||||
@@ -1,39 +1,49 @@
|
||||
local function Beat(self)
|
||||
local this = self:GetChildren()
|
||||
--Yes, why not?
|
||||
this.Base:pause();
|
||||
this.Glow:pause();
|
||||
this.Tap:pause();
|
||||
this.Base:setstate(0);
|
||||
this.Glow:setstate(1);
|
||||
this.Tap:setstate(2);
|
||||
|
||||
this.Glow:blend('BlendMode_Add');
|
||||
|
||||
this.Glow:diffusealpha(0);
|
||||
local beat = GAMESTATE:GetSongBeat()
|
||||
|
||||
local part = beat%1
|
||||
part = clamp(part,0,0.5)
|
||||
local eff = scale(part,0,0.5,1,0)
|
||||
if beat >= 0 then
|
||||
this.Glow:diffusealpha(eff);
|
||||
if (GAMESTATE:GetSongDelay() or false) and part == 0 then eff = 0 end
|
||||
if beat < 0 then
|
||||
eff = 0
|
||||
end
|
||||
this.Glow:diffusealpha(eff);
|
||||
end
|
||||
|
||||
return Def.ActorFrame {
|
||||
-- COMMANDS --
|
||||
InitCommand=cmd(SetUpdateFunction,Beat);
|
||||
|
||||
-- LAYERS --
|
||||
NOTESKIN:LoadActor("Center", "Outline Receptor")..{
|
||||
Name="Outline";
|
||||
Condition=Var "Button" == "Center";
|
||||
--InitCommand=cmd(x,96);
|
||||
};
|
||||
NOTESKIN:LoadActor(Var "Button", "Ready Receptor")..{
|
||||
Name="Base";
|
||||
InitCommand=cmd();
|
||||
Frames = { { Frame = 0 } };
|
||||
--PressCommand=cmd(finishtweening;glow,1,1,1,1;linear,0.1;glow,1,1,1,0);
|
||||
};
|
||||
NOTESKIN:LoadActor(Var "Button", "Ready Receptor")..{
|
||||
Name="Glow";
|
||||
InitCommand=cmd();
|
||||
Frames = { { Frame = 1 } };
|
||||
InitCommand=cmd(blend,'BlendMode_Add');
|
||||
--PressCommand=cmd(finishtweening;linear,0.05;zoom,0.9;linear,0.1;zoom,1);
|
||||
};
|
||||
--[[
|
||||
NOTESKIN:LoadActor(Var "Button", "Ready Receptor")..{
|
||||
Name="Tap";
|
||||
InitCommand=NOTESKIN:GetMetricA(Var "Button" ,"ReceptorTapInitCommand");
|
||||
PressCommand=NOTESKIN:GetMetricA(Var "Button" ,"ReceptorTapPressCommand");
|
||||
Frames = { { Frame = 2 } };
|
||||
InitCommand=cmd(zoom,1;diffusealpha,0;glow,1,1,1,0);
|
||||
--NOTESKIN:GetMetricA(Var "Button", "TapInitCommand");
|
||||
--
|
||||
PressCommand=cmd(finishtweening;glow,1,1,1,1;zoom,1;linear,0.2;glow,1,1,1,0;zoom,1.2);
|
||||
--NOTESKIN:GetMetricA(Var "Button", "TapHeldCommand");
|
||||
--
|
||||
};
|
||||
--]]
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
[NoteDisplay]
|
||||
TapNoteAnimationLength=1.25
|
||||
TapMineAnimationLength=1.25
|
||||
TapLiftAnimationLength=1.25
|
||||
AnimationIsBeatBased=0
|
||||
|
||||
HoldHeadAnimationLength=1.25
|
||||
HoldTopCapAnimationLength=1.25
|
||||
HoldBottomCapAnimationLength=1.25
|
||||
HoldBodyAnimationLength=1.25
|
||||
HoldTailAnimationLength=1.25
|
||||
TapNoteAnimationLength=0.25
|
||||
TapMineAnimationLength=0.25
|
||||
TapLiftAnimationLength=0.25
|
||||
TapFakeAnimationLength=0.25
|
||||
HoldHeadAnimationLength=0.25
|
||||
HoldTopCapAnimationLength=0.25
|
||||
HoldBottomCapAnimationLength=0.25
|
||||
HoldBodyAnimationLength=0.25
|
||||
HoldTailAnimationLength=0.25
|
||||
|
||||
HoldLetGoGrayPercent=1
|
||||
ReverseDrawOrder=1111
|
||||
@@ -17,23 +19,7 @@ FlipHoldBodyWhenReverse=1
|
||||
TopHoldAnchorWhenReverse=0
|
||||
HoldActiveIsAddLayer=0
|
||||
|
||||
;Explosion commands
|
||||
ButtonTapCommand=setstate,0;finishtweening;diffusealpha,1.0;zoom,1.0;linear,0.15;diffusealpha,0.9;zoom,1.15;linear,0.15;diffusealpha,0.0;zoom,1.3
|
||||
|
||||
;you can go nuts now...
|
||||
FlashTapCommand=finishtweening;diffusealpha,0.5;zoom,1.0;linear,0.15;diffusealpha,0.45;zoom,1.15;linear,0.15;diffusealpha,0.0;zoom,1.3
|
||||
|
||||
;if you want/need diferent commands for each button, write the previous commands
|
||||
;under the correspondant button section in this metrics.ini
|
||||
|
||||
;ReceptorTap commands
|
||||
ReceptorTapInitCommand=zoom,1;diffusealpha,0;glow,1,1,1,0
|
||||
ReceptorTapPressCommand=finishtweening;glow,1,1,1,1;zoom,1;linear,0.2;glow,1,1,1,0;zoom,1.2
|
||||
|
||||
[Center]
|
||||
TapNoteAnimationLength=1
|
||||
HoldHeadAnimationLength=1
|
||||
HoldTailAnimationLength=1
|
||||
|
||||
[DownLeft]
|
||||
|
||||
|
||||
+98
-68
@@ -124,33 +124,48 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song,
|
||||
sFName.MakeLower();
|
||||
|
||||
out.SetDescription(sFName);
|
||||
if( sFName.find("crazy") != string::npos || sFName.find("nightmare") != string::npos ||
|
||||
sFName.find("crazydouble") != string::npos )
|
||||
//Check another before anything else... is this okay? -DaisuMaster
|
||||
if( sFName.find("another") != string::npos )
|
||||
{
|
||||
out.SetDifficulty( Difficulty_Edit );
|
||||
if( !out.GetMeter() ) out.SetMeter( 25 );
|
||||
}
|
||||
else if( sFName.find("wild") != string::npos || sFName.find("wd") != string::npos || sFName.find("crazy+") != string::npos || sFName.find("cz+") != string::npos || sFName.find("hardcore") != string::npos )
|
||||
{
|
||||
out.SetDifficulty( Difficulty_Challenge );
|
||||
if( !out.GetMeter() ) out.SetMeter( 20 );
|
||||
}
|
||||
else if( sFName.find("crazy") != string::npos || sFName.find("cz") != string::npos || sFName.find("nightmare") != string::npos || sFName.find("nm") != string::npos || sFName.find("crazydouble") != string::npos )
|
||||
{
|
||||
out.SetDifficulty( Difficulty_Hard );
|
||||
if( !out.GetMeter() ) out.SetMeter( 14 ); // Set the meters to the Pump scale, not DDR.
|
||||
}
|
||||
else if( sFName.find("hard") != string::npos || sFName.find("freestyle") != string::npos ||
|
||||
sFName.find("double") != string::npos )
|
||||
else if( sFName.find("hard") != string::npos || sFName.find("hd") != string::npos || sFName.find("freestyle") != string::npos || sFName.find("fs") != string::npos || sFName.find("double") != string::npos )
|
||||
{
|
||||
out.SetDifficulty( Difficulty_Medium );
|
||||
if( !out.GetMeter() ) out.SetMeter( 8 );
|
||||
}
|
||||
else if( sFName.find("easy") != string::npos || sFName.find("normal") != string::npos )
|
||||
else if( sFName.find("easy") != string::npos || sFName.find("ez") != string::npos || sFName.find("normal") != string::npos )
|
||||
{
|
||||
//I wonder if I should leave easy fall into the Beginner difficulty... -DaisuMaster
|
||||
out.SetDifficulty( Difficulty_Easy );
|
||||
if( !out.GetMeter() ) out.SetMeter( 4 );
|
||||
}
|
||||
else if( sFName.find("beginner") != string::npos || sFName.find("practice") != string::npos || sFName.find("pr") != string::npos )
|
||||
{
|
||||
out.SetDifficulty( Difficulty_Beginner );
|
||||
if( !out.GetMeter() ) out.SetMeter( 4 );
|
||||
}
|
||||
else
|
||||
{
|
||||
out.SetDifficulty( Difficulty_Medium );
|
||||
if( !out.GetMeter() ) out.SetMeter( 8 );
|
||||
out.SetDifficulty( Difficulty_Hard );
|
||||
if( !out.GetMeter() ) out.SetMeter( 10 );
|
||||
}
|
||||
|
||||
out.m_StepsType = StepsType_pump_single;
|
||||
|
||||
// Check for "halfdouble" before "double".
|
||||
if( sFName.find("halfdouble") != string::npos || sFName.find("h_double") != string::npos )
|
||||
if( sFName.find("halfdouble") != string::npos || sFName.find("half-double") != string::npos || sFName.find("h_double") != string::npos )
|
||||
out.m_StepsType = StepsType_pump_halfdouble;
|
||||
// Handle bDoublesChart from above as well. -aj
|
||||
else if( sFName.find("double") != string::npos || sFName.find("nightmare") != string::npos || sFName.find("freestyle") != string::npos || bDoublesChart )
|
||||
@@ -211,13 +226,15 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song,
|
||||
LOG->UserLog( "Song file", sPath, "has illegal syntax \"%s\" which can't be in KIU complient files.",
|
||||
sRowString.c_str() );
|
||||
return false;
|
||||
//In other words: you can't mix ksf's with DM05 tags and ksf's without any DM05 tags
|
||||
//Either one set or another will be read...
|
||||
}
|
||||
if( BeginsWith(sRowString, "|B") || BeginsWith(sRowString, "|D") || BeginsWith(sRowString, "|E") )
|
||||
{
|
||||
// These don't have to be worried about here: the changes and stops were already added.
|
||||
continue;
|
||||
}
|
||||
if ( BeginsWith(sRowString, "|T") )
|
||||
else if ( BeginsWith(sRowString, "|T") )
|
||||
{
|
||||
RString temp = sRowString.substr(2,sRowString.size()-3);
|
||||
newTick = atoi(temp);
|
||||
@@ -226,9 +243,11 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song,
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG->UserLog( "Song file", sPath, "has a RowString with an improper length \"%s\"; corrupt notes ignored.",
|
||||
sRowString.c_str() );
|
||||
return false;
|
||||
// Is this why improper ksf or some kiucompilant ksf mixed with dm05 ksf are ignored?? -DaisuMaster
|
||||
//LOG->UserLog( "Song file", sPath, "has a RowString with an improper length \"%s\"; corrupt notes ignored.",
|
||||
// sRowString.c_str() );
|
||||
//return false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,6 +290,19 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song,
|
||||
{
|
||||
case '0': tap = TAP_EMPTY; break;
|
||||
case '1': tap = TAP_ORIGINAL_TAP; break;
|
||||
//allow setting more notetypes on ksf files, this may come in handy (it should) -DaisuMaster
|
||||
case 'M':
|
||||
case 'm':
|
||||
tap = TAP_ORIGINAL_MINE;
|
||||
break;
|
||||
case 'F':
|
||||
case 'f':
|
||||
tap = TAP_ORIGINAL_FAKE;
|
||||
break;
|
||||
case 'L':
|
||||
case 'l':
|
||||
tap = TAP_ORIGINAL_LIFT;
|
||||
break;
|
||||
default:
|
||||
LOG->UserLog( "Song file", sPath, "has an invalid row \"%s\"; corrupt notes ignored.",
|
||||
sRowString.c_str() );
|
||||
@@ -347,6 +379,18 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant
|
||||
return false;
|
||||
}
|
||||
|
||||
// changed up there in case of something is found inside the SONGFILE tag in the head ksf -DaisuMaster
|
||||
// search for music with song in the file name
|
||||
vector<RString> arrayPossibleMusic;
|
||||
GetDirListing( out.GetSongDir() + RString("song.mp3"), arrayPossibleMusic );
|
||||
GetDirListing( out.GetSongDir() + RString("song.oga"), arrayPossibleMusic );
|
||||
GetDirListing( out.GetSongDir() + RString("song.ogg"), arrayPossibleMusic );
|
||||
GetDirListing( out.GetSongDir() + RString("song.wav"), arrayPossibleMusic );
|
||||
|
||||
if( !arrayPossibleMusic.empty() ) // we found a match
|
||||
out.m_sMusicFile = arrayPossibleMusic[0];
|
||||
// ^this was below, at the end
|
||||
|
||||
float SMGap1 = 0, SMGap2 = 0, BPM1 = -1, BPMPos2 = -1, BPM2 = -1, BPMPos3 = -1, BPM3 = -1;
|
||||
int iTickCount = -1;
|
||||
bKIUCompliant = false;
|
||||
@@ -412,7 +456,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant
|
||||
// CheckpointsUseTimeSignatures metric. -aj
|
||||
TimeSignatureSegment seg;
|
||||
seg.m_iStartRow = BeatToNoteRow(0.0f);
|
||||
seg.m_iNumerator = iTickCount;
|
||||
seg.m_iNumerator = CLAMP( iTickCount, 0, ROWS_PER_BEAT );
|
||||
seg.m_iDenominator = 4;
|
||||
out.m_Timing.AddTimeSignatureSegment( seg );
|
||||
}
|
||||
@@ -435,6 +479,22 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant
|
||||
{
|
||||
out.m_fMusicSampleStartSeconds = HHMMSSToSeconds( sParams[1] );
|
||||
}
|
||||
else if( 0==stricmp(sValueName,"TITLEFILE") )
|
||||
{
|
||||
out.m_sBackgroundFile = sParams[1];
|
||||
}
|
||||
else if( 0==stricmp(sValueName,"DISCFILE") )
|
||||
{
|
||||
out.m_sBannerFile = sParams[1];
|
||||
}
|
||||
else if( 0==stricmp(sValueName,"SONGFILE") )
|
||||
{
|
||||
out.m_sSongFileName = sParams[1];
|
||||
}
|
||||
//else if( 0==stricmp(sValueName,"INTROFILE") )
|
||||
//{
|
||||
// nothing to add...
|
||||
//}
|
||||
// end new cases
|
||||
else
|
||||
{
|
||||
@@ -443,6 +503,9 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant
|
||||
}
|
||||
}
|
||||
|
||||
//intro length in piu mixes is normally 7 seconds
|
||||
out.m_fMusicSampleLengthSeconds = 7.0f;
|
||||
|
||||
/* BPM Change checks are done here. If bKIUCompliant, it's short and sweet.
|
||||
* Otherwise, the whole file has to be processed. Right now, this is only
|
||||
* called once, for the initial file (often the Crazy steps). Hopefully that
|
||||
@@ -470,13 +533,8 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant
|
||||
}
|
||||
else
|
||||
{
|
||||
int tickToChange = iTickCount;
|
||||
float fCurBeat = 0.0f;
|
||||
float speedToChange = 0.0f, timeToStop = 0.0f;
|
||||
bool bDMRequired = false;
|
||||
bool bBPMChangeNeeded = false;
|
||||
bool bBPMStopNeeded = false;
|
||||
bool bTickChangeNeeded = false;
|
||||
|
||||
for( unsigned i=0; i < vNoteRows.size(); ++i )
|
||||
{
|
||||
@@ -504,68 +562,50 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant
|
||||
float numTemp = StringToFloat(temp);
|
||||
if (BeginsWith(NoteRowString, "|T"))
|
||||
{
|
||||
bTickChangeNeeded = true;
|
||||
tickToChange = (int)numTemp;
|
||||
iTickCount = (int)numTemp;
|
||||
TimeSignatureSegment seg;
|
||||
seg.m_iStartRow = BeatToNoteRow(fCurBeat);
|
||||
seg.m_iNumerator = CLAMP( iTickCount, 0, ROWS_PER_BEAT);
|
||||
seg.m_iDenominator = 4;
|
||||
out.m_Timing.AddTimeSignatureSegment( seg );
|
||||
|
||||
continue;
|
||||
}
|
||||
if (BeginsWith(NoteRowString, "|B"))
|
||||
else if (BeginsWith(NoteRowString, "|B"))
|
||||
{
|
||||
bBPMChangeNeeded = true;
|
||||
speedToChange = numTemp;
|
||||
out.m_Timing.AddBPMSegment( BPMSegment( BeatToNoteRow(fCurBeat), (float)numTemp ) );
|
||||
continue;
|
||||
}
|
||||
if (BeginsWith(NoteRowString, "|E"))
|
||||
else if (BeginsWith(NoteRowString, "|E"))
|
||||
{
|
||||
bBPMStopNeeded = true;
|
||||
timeToStop = 60 / out.m_Timing.GetBPMAtBeat(NoteRowToBeat(i)) * numTemp / (float)tickToChange;
|
||||
//Finally! the |E| tag is working as it should. I can die happy now -DaisuMaster
|
||||
float fCurDelay = 60 / out.m_Timing.GetBPMAtBeat(fCurBeat) * (float)numTemp / iTickCount;
|
||||
out.m_Timing.AddStopSegment( StopSegment( BeatToNoteRow(fCurBeat), fCurDelay, true ) );
|
||||
continue;
|
||||
}
|
||||
if (BeginsWith(NoteRowString, "|D"))
|
||||
else if (BeginsWith(NoteRowString, "|D"))
|
||||
{
|
||||
bBPMStopNeeded = true;
|
||||
//bool bDelay = true;
|
||||
timeToStop = numTemp / 1000.0f; // + out.m_Timing.GetStopAtRow(i-1, bDelay);
|
||||
bool bDelay = true;
|
||||
float fCurDelay = out.m_Timing.GetStopAtRow(i, bDelay);
|
||||
out.m_Timing.AddStopSegment( StopSegment( BeatToNoteRow(fCurBeat), fCurDelay, true ) );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Quit while we're ahead if any bad syntax is spotted.
|
||||
LOG->UserLog( "Song file", sPath, "has an invalid RowString \"%s\".",
|
||||
NoteRowString.c_str() );
|
||||
return false;
|
||||
//LOG->UserLog( "Song file", sPath, "has an invalid RowString \"%s\".",
|
||||
// NoteRowString.c_str() );
|
||||
//return false;
|
||||
//how about no? :D -DaisuMaster
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if( bTickChangeNeeded )
|
||||
{
|
||||
iTickCount = tickToChange;
|
||||
LOG->Trace( "Adding time signature of %i/4 at beat %f", iTickCount, fCurBeat );
|
||||
TimeSignatureSegment seg;
|
||||
seg.m_iStartRow = BeatToNoteRow(fCurBeat);
|
||||
seg.m_iNumerator = iTickCount;
|
||||
seg.m_iDenominator = 4;
|
||||
out.m_Timing.AddTimeSignatureSegment( seg );
|
||||
bTickChangeNeeded = false;
|
||||
}
|
||||
if( bBPMChangeNeeded )
|
||||
{
|
||||
LOG->Trace( "Adding tempo change of %f BPM at beat %f", speedToChange, fCurBeat );
|
||||
out.AddBPMSegment( BPMSegment(BeatToNoteRow(fCurBeat), speedToChange) );
|
||||
bBPMChangeNeeded = false;
|
||||
}
|
||||
if( bBPMStopNeeded )
|
||||
{
|
||||
LOG->Trace( "Adding delay of %f seconds at beat %f", timeToStop, fCurBeat );
|
||||
out.AddStopSegment( StopSegment(BeatToNoteRow(fCurBeat),timeToStop,true) );
|
||||
bBPMStopNeeded = false;
|
||||
}
|
||||
fCurBeat += 1.0f / iTickCount;
|
||||
}
|
||||
}
|
||||
|
||||
out.m_fMusicSampleLengthSeconds = 7.0f;
|
||||
|
||||
// Try to fill in missing bits of information from the pathname.
|
||||
{
|
||||
vector<RString> asBits;
|
||||
@@ -575,16 +615,6 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant
|
||||
LoadTags( asBits[asBits.size()-2], out );
|
||||
}
|
||||
|
||||
// search for music with song in the file name
|
||||
vector<RString> arrayPossibleMusic;
|
||||
GetDirListing( out.GetSongDir() + RString("song.mp3"), arrayPossibleMusic );
|
||||
GetDirListing( out.GetSongDir() + RString("song.oga"), arrayPossibleMusic );
|
||||
GetDirListing( out.GetSongDir() + RString("song.ogg"), arrayPossibleMusic );
|
||||
GetDirListing( out.GetSongDir() + RString("song.wav"), arrayPossibleMusic );
|
||||
|
||||
if( !arrayPossibleMusic.empty() ) // we found a match
|
||||
out.m_sMusicFile = arrayPossibleMusic[0];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user