Merge pull request #1621 from MidflightDigital/progress-alternate

Add NoteColorType ProgressAlternate
This commit is contained in:
ListenerJubatus
2018-01-17 10:35:09 -06:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -41,6 +41,7 @@ LuaXType( NotePart );
static const char *NoteColorTypeNames[] = { static const char *NoteColorTypeNames[] = {
"Denominator", "Denominator",
"Progress", "Progress",
"ProgressAlternate"
}; };
XToString( NoteColorType ); XToString( NoteColorType );
StringToX( NoteColorType ); StringToX( NoteColorType );
@@ -1325,6 +1326,8 @@ void NoteDisplay::DrawActor(const TapNote& tn, Actor* pActor, NotePart part,
{ {
DISPLAY->TexturePushMatrix(); DISPLAY->TexturePushMatrix();
float color = 0.0f; float color = 0.0f;
//this is only used for ProgressAlternate but must be declared here
float fScaledBeat = 0.0f;
switch( cache->m_NoteColorType[part] ) switch( cache->m_NoteColorType[part] )
{ {
case NoteColorType_Denominator: case NoteColorType_Denominator:
@@ -1334,6 +1337,13 @@ void NoteDisplay::DrawActor(const TapNote& tn, Actor* pActor, NotePart part,
case NoteColorType_Progress: case NoteColorType_Progress:
color = fmodf( ceilf( fBeat * cache->m_iNoteColorCount[part] ), (float)cache->m_iNoteColorCount[part] ); color = fmodf( ceilf( fBeat * cache->m_iNoteColorCount[part] ), (float)cache->m_iNoteColorCount[part] );
break; break;
case NoteColorType_ProgressAlternate:
fScaledBeat = fBeat * cache->m_iNoteColorCount[part];
//knock it back into the last frame if it's on a boundary
if (fScaledBeat - int64_t(fScaledBeat) == 0.0f)
fScaledBeat -= 1.0f;
color = fmodf( ceilf( fScaledBeat ), (float)cache->m_iNoteColorCount[part] );
break;
default: default:
FAIL_M(ssprintf("Invalid NoteColorType: %i", cache->m_NoteColorType[part])); FAIL_M(ssprintf("Invalid NoteColorType: %i", cache->m_NoteColorType[part]));
} }
+1
View File
@@ -36,6 +36,7 @@ enum NoteColorType
{ {
NoteColorType_Denominator, /**< Color by note type. */ NoteColorType_Denominator, /**< Color by note type. */
NoteColorType_Progress, /**< Color by progress. */ NoteColorType_Progress, /**< Color by progress. */
NoteColorType_ProgressAlternate, /**< Color by progress, except the frame boundaries are slightly later. */
NUM_NoteColorType, NUM_NoteColorType,
NoteColorType_Invalid NoteColorType_Invalid
}; };