Add Pump it Up's X Mode (thanks to StepNXA); this version should work with all gametypes and stepstypes.

This commit is contained in:
AJ Kelly
2010-05-02 10:15:02 -05:00
parent 9c4856e612
commit bff6eb0469
3 changed files with 40 additions and 16 deletions
+35 -10
View File
@@ -310,7 +310,7 @@ float ArrowEffects::GetYPos( const PlayerState* pPlayerState, int iCol, float fY
// In beware's DDR Extreme-focused fork of StepMania 3.9, this value is // In beware's DDR Extreme-focused fork of StepMania 3.9, this value is
// floored, making arrows show on integer Y coordinates. Supposedly it makes // floored, making arrows show on integer Y coordinates. Supposedly it makes
// the arrows look better, but testing needs to be done. // the arrows look better, but testing needs to be done.
// todo: make this a preference -aj // todo: make this a noteskin metric ("QuantizeArrowYPosition") -aj
return f; return f;
//return floor(f); //return floor(f);
} }
@@ -377,14 +377,39 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_BEAT] * fShift; fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_BEAT] * fShift;
} }
/* if( fEffects[PlayerOptions::EFFECT_XMODE] != 0 )
if( fEffects[PlayerOptions::SCROLL_X] != 0 )
{ {
// Compare pPlayerState->m_PlayerNumber. // based off of code by v1toko for StepNXA, except it should work on
// notes will go \ for p1 and / for p2. // any gametype now.
// pCols[iColNum] for each column. switch( pStyle->m_StyleType )
{
case StyleType_OnePlayerTwoSides:
case StyleType_TwoPlayersSharedSides: // fall through?
{
// find the middle, and split based on iColNum
// it's unknown if this will work for routine.
const int iMiddleColumn = floor(pStyle->m_iColsPerPlayer/2.0f);
if( iColNum > iMiddleColumn-1 )
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset);
else
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*fYOffset;
}
break;
case StyleType_OnePlayerOneSide:
case StyleType_TwoPlayersTwoSides: // fall through
{
// the code was the same for both of these cases in StepNXA.
if( pPlayerState->m_PlayerNumber == PLAYER_2 )
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*-(fYOffset);
else
fPixelOffsetFromCenter += fEffects[PlayerOptions::EFFECT_XMODE]*fYOffset;
}
break;
default:
ASSERT("What the hell kind of styletype are you passing me anyways?");
break;
}
} }
*/
fPixelOffsetFromCenter += pCols[iColNum].fXOffset; fPixelOffsetFromCenter += pCols[iColNum].fXOffset;
@@ -554,7 +579,7 @@ float ArrowGetPercentVisible( const PlayerState* pPlayerState, float fYPosWithou
float ArrowEffects::GetAlpha( const PlayerState* pPlayerState, int iCol, float fYOffset, float fPercentFadeToFail, float fYReverseOffsetPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ) float ArrowEffects::GetAlpha( const PlayerState* pPlayerState, int iCol, float fYOffset, float fPercentFadeToFail, float fYReverseOffsetPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar )
{ {
/* Get the YPos without reverse (that is, factor in EFFECT_TIPSY). */ // Get the YPos without reverse (that is, factor in EFFECT_TIPSY).
float fYPosWithoutReverse = ArrowEffects::GetYPos( pPlayerState, iCol, fYOffset, fYReverseOffsetPixels, false ); float fYPosWithoutReverse = ArrowEffects::GetYPos( pPlayerState, iCol, fYOffset, fYReverseOffsetPixels, false );
float fPercentVisible = ArrowGetPercentVisible( pPlayerState, fYPosWithoutReverse ); float fPercentVisible = ArrowGetPercentVisible( pPlayerState, fYPosWithoutReverse );
@@ -576,7 +601,7 @@ float ArrowEffects::GetAlpha( const PlayerState* pPlayerState, int iCol, float f
float ArrowEffects::GetGlow( const PlayerState* pPlayerState, int iCol, float fYOffset, float fPercentFadeToFail, float fYReverseOffsetPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar ) float ArrowEffects::GetGlow( const PlayerState* pPlayerState, int iCol, float fYOffset, float fPercentFadeToFail, float fYReverseOffsetPixels, float fDrawDistanceBeforeTargetsPixels, float fFadeInPercentOfDrawFar )
{ {
/* Get the YPos without reverse (that is, factor in EFFECT_TIPSY). */ // Get the YPos without reverse (that is, factor in EFFECT_TIPSY).
float fYPosWithoutReverse = ArrowEffects::GetYPos( pPlayerState, iCol, fYOffset, fYReverseOffsetPixels, false ); float fYPosWithoutReverse = ArrowEffects::GetYPos( pPlayerState, iCol, fYOffset, fYReverseOffsetPixels, false );
float fPercentVisible = ArrowGetPercentVisible( pPlayerState, fYPosWithoutReverse ); float fPercentVisible = ArrowGetPercentVisible( pPlayerState, fYPosWithoutReverse );
@@ -654,7 +679,7 @@ float ArrowEffects::GetFrameWidthScale( const PlayerState* pPlayerState, float f
float fWidthEffect = pPlayerState->m_EffectHistory.GetSample( fSecond ); float fWidthEffect = pPlayerState->m_EffectHistory.GetSample( fSecond );
if( fWidthEffect != 0 && FRAME_WIDTH_LOCK_EFFECTS_TO_OVERLAPPING ) if( fWidthEffect != 0 && FRAME_WIDTH_LOCK_EFFECTS_TO_OVERLAPPING )
{ {
/* Don't display effect data that happened before this hold overlapped the top. */ // Don't display effect data that happened before this hold overlapped the top.
float fFromEndOfOverlapped = fOverlappedTime - fSecond; float fFromEndOfOverlapped = fOverlappedTime - fSecond;
float fTrailingPixels = FRAME_WIDTH_LOCK_EFFECTS_TWEEN_PIXELS; float fTrailingPixels = FRAME_WIDTH_LOCK_EFFECTS_TWEEN_PIXELS;
float fTrailingSeconds = fTrailingPixels / fPixelsPerSecond; float fTrailingSeconds = fTrailingPixels / fPixelsPerSecond;
+3 -4
View File
@@ -149,6 +149,7 @@ void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
AddPart( AddTo, m_fEffects[EFFECT_TIPSY], "Tipsy" ); AddPart( AddTo, m_fEffects[EFFECT_TIPSY], "Tipsy" );
AddPart( AddTo, m_fEffects[EFFECT_BUMPY], "Bumpy" ); AddPart( AddTo, m_fEffects[EFFECT_BUMPY], "Bumpy" );
AddPart( AddTo, m_fEffects[EFFECT_BEAT], "Beat" ); AddPart( AddTo, m_fEffects[EFFECT_BEAT], "Beat" );
AddPart( AddTo, m_fEffects[EFFECT_XMODE], "XMode" );
AddPart( AddTo, m_fAppearances[APPEARANCE_HIDDEN], "Hidden" ); AddPart( AddTo, m_fAppearances[APPEARANCE_HIDDEN], "Hidden" );
AddPart( AddTo, m_fAppearances[APPEARANCE_HIDDEN_OFFSET], "HiddenOffset" ); AddPart( AddTo, m_fAppearances[APPEARANCE_HIDDEN_OFFSET], "HiddenOffset" );
@@ -163,7 +164,6 @@ void PlayerOptions::GetMods( vector<RString> &AddTo, bool bForceNoteSkin ) const
AddPart( AddTo, m_fScrolls[SCROLL_ALTERNATE], "Alternate" ); AddPart( AddTo, m_fScrolls[SCROLL_ALTERNATE], "Alternate" );
AddPart( AddTo, m_fScrolls[SCROLL_CROSS], "Cross" ); AddPart( AddTo, m_fScrolls[SCROLL_CROSS], "Cross" );
AddPart( AddTo, m_fScrolls[SCROLL_CENTERED], "Centered" ); AddPart( AddTo, m_fScrolls[SCROLL_CENTERED], "Centered" );
//AddPart( AddTo, m_fScrolls[SCROLL_X], "XMode" );
AddPart( AddTo, m_fDark, "Dark" ); AddPart( AddTo, m_fDark, "Dark" );
@@ -305,7 +305,6 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
} }
} }
sBit = asParts.back(); sBit = asParts.back();
#define SET_FLOAT( opt ) { m_ ## opt = level; m_Speed ## opt = speed; } #define SET_FLOAT( opt ) { m_ ## opt = level; m_Speed ## opt = speed; }
@@ -328,7 +327,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
SET_FLOAT( fTimeSpacing ) SET_FLOAT( fTimeSpacing )
m_fTimeSpacing = 1; m_fTimeSpacing = 1;
} }
/* Port M-Mod's from OpenITG, starting from r537 */ /* Port M-Mods from OpenITG, starting from r537 */
// Midiman // Midiman
else if( sscanf( sBit, "m%f", &level ) == 1 ) else if( sscanf( sBit, "m%f", &level ) == 1 )
{ {
@@ -355,6 +354,7 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
else if( sBit == "tipsy" ) SET_FLOAT( fEffects[EFFECT_TIPSY] ) else if( sBit == "tipsy" ) SET_FLOAT( fEffects[EFFECT_TIPSY] )
else if( sBit == "bumpy" ) SET_FLOAT( fEffects[EFFECT_BUMPY] ) else if( sBit == "bumpy" ) SET_FLOAT( fEffects[EFFECT_BUMPY] )
else if( sBit == "beat" ) SET_FLOAT( fEffects[EFFECT_BEAT] ) else if( sBit == "beat" ) SET_FLOAT( fEffects[EFFECT_BEAT] )
else if( sBit == "xmode" ) SET_FLOAT( fEffects[EFFECT_XMODE] )
else if( sBit == "hidden" ) SET_FLOAT( fAppearances[APPEARANCE_HIDDEN] ) else if( sBit == "hidden" ) SET_FLOAT( fAppearances[APPEARANCE_HIDDEN] )
else if( sBit == "hiddenoffset" ) SET_FLOAT( fAppearances[APPEARANCE_HIDDEN_OFFSET] ) else if( sBit == "hiddenoffset" ) SET_FLOAT( fAppearances[APPEARANCE_HIDDEN_OFFSET] )
else if( sBit == "sudden" ) SET_FLOAT( fAppearances[APPEARANCE_SUDDEN] ) else if( sBit == "sudden" ) SET_FLOAT( fAppearances[APPEARANCE_SUDDEN] )
@@ -391,7 +391,6 @@ bool PlayerOptions::FromOneModString( const RString &sOneMod, RString &sErrorOut
else if( sBit == "alternate" ) SET_FLOAT( fScrolls[SCROLL_ALTERNATE] ) else if( sBit == "alternate" ) SET_FLOAT( fScrolls[SCROLL_ALTERNATE] )
else if( sBit == "cross" ) SET_FLOAT( fScrolls[SCROLL_CROSS] ) else if( sBit == "cross" ) SET_FLOAT( fScrolls[SCROLL_CROSS] )
else if( sBit == "centered" ) SET_FLOAT( fScrolls[SCROLL_CENTERED] ) else if( sBit == "centered" ) SET_FLOAT( fScrolls[SCROLL_CENTERED] )
//else if( sBit == "xmode" ) SET_FLOAT( fScrolls[SCROLL_X] )
else if( sBit == "noholds" ) m_bTransforms[TRANSFORM_NOHOLDS] = on; else if( sBit == "noholds" ) m_bTransforms[TRANSFORM_NOHOLDS] = on;
else if( sBit == "norolls" ) m_bTransforms[TRANSFORM_NOROLLS] = on; else if( sBit == "norolls" ) m_bTransforms[TRANSFORM_NOROLLS] = on;
else if( sBit == "nomines" ) m_bTransforms[TRANSFORM_NOMINES] = on; else if( sBit == "nomines" ) m_bTransforms[TRANSFORM_NOMINES] = on;
+1 -1
View File
@@ -58,6 +58,7 @@ public:
EFFECT_TIPSY, EFFECT_TIPSY,
EFFECT_BUMPY, EFFECT_BUMPY,
EFFECT_BEAT, EFFECT_BEAT,
EFFECT_XMODE,
NUM_EFFECTS NUM_EFFECTS
}; };
enum Appearance { enum Appearance {
@@ -110,7 +111,6 @@ public:
SCROLL_ALTERNATE, SCROLL_ALTERNATE,
SCROLL_CROSS, SCROLL_CROSS,
SCROLL_CENTERED, SCROLL_CENTERED,
//SCROLL_X,
NUM_SCROLLS NUM_SCROLLS
}; };
enum ScoreDisplay { enum ScoreDisplay {