Let's see how this merge tree looks.

This commit is contained in:
Jason Felds
2011-02-27 20:41:49 -05:00
13 changed files with 156 additions and 39 deletions
+7 -3
View File
@@ -15,7 +15,10 @@
#include <float.h>
static ThemeMetric<float> ARROW_SPACING( "ArrowEffects", "ArrowSpacing" );
static ThemeMetric<bool> QUANTIZE_ARROW_Y( "ArrowEffects", "QuantizeArrowYPosition");
static ThemeMetric<bool> HIDDEN_SUDDEN_PAST_RECEPTOR( "ArrowEffects", "DrawHiddenNotesAfterReceptor");
// Allow themes to modify effects. (Is this a good idea? -aj)
static ThemeMetric<float> BLINK_MOD_FREQUENCY( "ArrowEffects", "BlinkModFrequency" );
static ThemeMetric<float> BOOST_MOD_MIN_CLAMP( "ArrowEffects", "BoostModMinClamp" );
static ThemeMetric<float> BOOST_MOD_MAX_CLAMP( "ArrowEffects", "BoostModMaxClamp" );
@@ -50,7 +53,6 @@ static ThemeMetric<float> BEAT_OFFSET_HEIGHT( "ArrowEffects", "BeatOffsetHeight"
static ThemeMetric<float> BEAT_PI_HEIGHT( "ArrowEffects", "BeatPIHeight" );
static ThemeMetric<float> MINI_PERCENT_BASE( "ArrowEffects", "MiniPercentBase" );
static ThemeMetric<float> MINI_PERCENT_GATE( "ArrowEffects", "MiniPercentGate" );
static ThemeMetric<bool> QUANTIZE_ARROW_Y( "ArrowEffects", "QuantizeArrowYPosition");
static float GetNoteFieldHeight( const PlayerState* pPlayerState )
{
@@ -231,6 +233,8 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
fYOffset += fYOffsetTimeSpacing * pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing;
}
// TODO: If we allow noteskins to have metricable row spacing
// (per issue 24), edit this to reflect that. -aj
fYOffset *= ARROW_SPACING;
// don't mess with the arrows after they've crossed 0
@@ -287,8 +291,8 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
seed = ((seed * 1664525u) + 1013904223u) & 0xFFFFFFFF;
float fRandom = seed / 4294967296.0f;
/* Random speed always increases speed: a random speed of 10 indicates [1,11].
* This keeps it consistent with other mods: 0 means no effect. */
/* Random speed always increases speed: a random speed of 10 indicates
* [1,11]. This keeps it consistent with other mods: 0 means no effect. */
fScrollSpeed *=
SCALE( fRandom,
0.0f, 1.0f,
+21 -25
View File
@@ -78,9 +78,9 @@ public:
* the three credits needed to begin the game. */
BroadcastOnChange<int> m_iCoins;
/** @brief The player number used with Styles where one player controls both sides. */
PlayerNumber m_MasterPlayerNumber;
bool m_bMultiplayer;
int m_iNumMultiplayerNoteFields;
PlayerNumber m_MasterPlayerNumber;
bool m_bMultiplayer;
int m_iNumMultiplayerNoteFields;
bool DifficultiesLocked() const;
bool ChangePreferredDifficultyAndStepsType( PlayerNumber pn, Difficulty dc, StepsType st );
bool ChangePreferredDifficulty( PlayerNumber pn, int dir );
@@ -90,24 +90,24 @@ public:
Difficulty GetClosestShownDifficulty( PlayerNumber pn ) const;
Difficulty GetEasiestStepsDifficulty() const;
Difficulty GetHardestStepsDifficulty() const;
RageTimer m_timeGameStarted; // from the moment the first player pressed Start
LuaTable *m_Environment;
RageTimer m_timeGameStarted; // from the moment the first player pressed Start
LuaTable *m_Environment;
// This is set to a random number per-game/round; it can be used for a random seed.
int m_iGameSeed, m_iStageSeed;
RString m_sStageGUID;
int m_iGameSeed, m_iStageSeed;
RString m_sStageGUID;
/**
* @brief Determine if a second player can join in at this time.
* @return true if a player can still enter the game, false otherwise. */
bool PlayersCanJoin() const;
int GetCoinsNeededToJoin() const;
bool EnoughCreditsToJoin() const { return m_iCoins >= GetCoinsNeededToJoin(); }
bool PlayersCanJoin() const;
int GetCoinsNeededToJoin() const;
bool EnoughCreditsToJoin() const { return m_iCoins >= GetCoinsNeededToJoin(); }
int GetNumSidesJoined() const;
const Game* GetCurrentGame();
const Style* GetCurrentStyle() const;
void SetCurrentStyle( const Style *pStyle );
void SetCurrentStyle( const Style *pStyle );
void GetPlayerInfo( PlayerNumber pn, bool& bIsEnabledOut, bool& bIsHumanOut );
bool IsPlayerEnabled( PlayerNumber pn ) const;
@@ -129,17 +129,17 @@ public:
BroadcastOnChange<RString> m_sPreferredSongGroup; // GROUP_ALL denotes no preferred group
BroadcastOnChange<RString> m_sPreferredCourseGroup; // GROUP_ALL denotes no preferred group
bool m_bChangedFailTypeOnScreenSongOptions; // true if FailType was changed in the song options screen
bool m_bChangedFailTypeOnScreenSongOptions; // true if FailType was changed in the song options screen
BroadcastOnChange<StepsType> m_PreferredStepsType;
BroadcastOnChange1D<Difficulty,NUM_PLAYERS> m_PreferredDifficulty;
BroadcastOnChange1D<CourseDifficulty,NUM_PLAYERS> m_PreferredCourseDifficulty;// used in nonstop
BroadcastOnChange<SortOrder> m_SortOrder; // set by MusicWheel
SortOrder m_PreferredSortOrder; // used by MusicWheel
EditMode m_EditMode;
bool IsEditing() const { return m_EditMode != EditMode_Invalid; }
bool m_bDemonstrationOrJukebox; // ScreenGameplay does special stuff when this is true
bool m_bJukeboxUsesModifiers;
int m_iNumStagesOfThisSong;
SortOrder m_PreferredSortOrder; // used by MusicWheel
EditMode m_EditMode;
bool IsEditing() const { return m_EditMode != EditMode_Invalid; }
bool m_bDemonstrationOrJukebox; // ScreenGameplay does special stuff when this is true
bool m_bJukeboxUsesModifiers;
int m_iNumStagesOfThisSong;
/**
* @brief Increase this every stage while not resetting on a continue.
*
@@ -159,8 +159,8 @@ public:
void CancelStage();
void CommitStageStats();
void FinishStage();
int GetNumStagesLeft( PlayerNumber pn ) const;
int GetSmallestNumStagesLeftForAnyHumanPlayer() const;
int GetNumStagesLeft( PlayerNumber pn ) const;
int GetSmallestNumStagesLeftForAnyHumanPlayer() const;
bool IsFinalStageForAnyHumanPlayer() const;
bool IsAnExtraStage() const;
bool IsAnExtraStageAndSelectionLocked() const;
@@ -173,7 +173,6 @@ public:
bool m_bLoadingNextSong;
int GetLoadingCourseSongIndex() const;
// State Info used during gameplay
// NULL on ScreenSelectMusic if the currently selected wheel item isn't a Song.
@@ -212,17 +211,14 @@ public:
BroadcastOnChange<bool> m_bGameplayLeadIn;
// Metricable noteskin things
//void LoadNoteSkinMetrics( PlayerNumber pn );
/*
void LoadNoteSkinMetrics( PlayerNumber pn );
int m_iNoteSkinColSpacing[NUM_PLAYERS];
int m_iNoteSkinArrowSize[NUM_PLAYERS];
*/
// not sure I want to let noteskins change row spacing, as that changes how
// the speed mods work... -aj
//int m_iNoteSkinRowSpacing[NUM_PLAYERS];
// what are these for, exactly? -aj
//bool m_bNoteSkinOverrideDim[NUM_PLAYERS];
//bool m_bNoteSkinOverrideBright[NUM_PLAYERS];
float m_fMusicSecondsVisible;
float m_fSongBeatVisible;
+18
View File
@@ -823,6 +823,24 @@ void PlayerOptions::ResetPrefs( ResetPrefsType type )
#undef CPY
}
// lua start
#include "LuaBinding.h"
/** @brief Allow Lua to have access to PlayerOptions. */
class LunaPlayerOptions: public Luna<PlayerOptions>
{
public:
DEFINE_METHOD( GetNoteSkin, m_sNoteSkin )
LunaPlayerOptions()
{
ADD_METHOD( GetNoteSkin );
}
};
LUA_REGISTER_CLASS( PlayerOptions )
// lua end
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard
* All rights reserved.
+4 -1
View File
@@ -5,6 +5,7 @@ class Course;
class Song;
class Steps;
class Trail;
struct lua_State;
#include "GameConstantsAndTypes.h"
#include "PlayerNumber.h"
@@ -32,6 +33,9 @@ public:
void ChooseRandomModifiers();
bool ContainsTransformOrTurn() const;
// Lua
void PushSelf( lua_State *L );
bool operator==( const PlayerOptions &other ) const;
bool operator!=( const PlayerOptions &other ) const { return !operator==(other); }
@@ -188,7 +192,6 @@ public:
void SetOneScroll( Scroll s );
void ToggleOneTurn( Turn t );
// return true if any mods being used will make the song(s) easier
bool IsEasierForSongAndSteps( Song* pSong, Steps* pSteps, PlayerNumber pn ) const;
bool IsEasierForCourseAndTrail( Course* pCourse, Trail* pTrail ) const;
+1 -1
View File
@@ -187,7 +187,7 @@ Grade PlayerStageStats::GetGrade() const
//LOG->Trace( "GetGrade: Grade: %s, %i", GradeToString(grade).c_str(), GRADE_TIER02_IS_ALL_W2S );
// todo: move all these conditions to Lua. -aj
// TODO: Change these conditions to use Lua instead. -aj
if( GRADE_TIER02_IS_ALL_W2S )
{
if( FullComboOfScore(TNS_W1) )
+10 -2
View File
@@ -210,8 +210,8 @@ public:
static int GetPlayerOptions( T* p, lua_State *L )
{
ModsLevel m = Enum::Check<ModsLevel>( L, 1 );
RString s = p->m_PlayerOptions.Get(m).GetString();
LuaHelpers::Push( L, s );
PlayerOptions po = p->m_PlayerOptions.Get(m);
po.PushSelf(L);
return 1;
}
static int GetPlayerOptionsArray( T* p, lua_State *L )
@@ -222,6 +222,13 @@ public:
LuaHelpers::CreateTableFromArray<RString>( s, L );
return 1;
}
static int GetPlayerOptionsString( T* p, lua_State *L )
{
ModsLevel m = Enum::Check<ModsLevel>( L, 1 );
RString s = p->m_PlayerOptions.Get(m).GetString();
LuaHelpers::Push( L, s );
return 1;
}
DEFINE_METHOD( GetHealthState, m_HealthState );
LunaPlayerState()
@@ -231,6 +238,7 @@ public:
ADD_METHOD( SetPlayerOptions );
ADD_METHOD( GetPlayerOptions );
ADD_METHOD( GetPlayerOptionsArray );
ADD_METHOD( GetPlayerOptionsString );
ADD_METHOD( GetHealthState );
}
};
+5 -1
View File
@@ -31,7 +31,11 @@ public:
* in PlayerState and callers should not use PlayerNumber to index into
* GameState. */
PlayerNumber m_PlayerNumber;
/**
* @brief The MultiPlayer number assigned to this Player, typically 1-32.
*
* This is only used if GAMESTATE->m_bMultiplayer is true.
*/
MultiPlayer m_mp;
/**