[GameCommand] Don't allow battle/rave with Routine (StyleType_TwoPlayersSharedSides). also cleanup

[RageTypes] remove glowmode stub stuff
[RageDisplayOGL] update comments slightly
This commit is contained in:
AJ Kelly
2010-06-02 15:43:56 -05:00
parent 62600c38a8
commit 6b3da26a4c
4 changed files with 41 additions and 59 deletions
+20 -21
View File
@@ -391,7 +391,7 @@ void GameCommand::LoadOne( const Command& cmd )
m_bApplyDefaultOptions = true;
}
/* sm-ssc additions begin: */
// sm-ssc additions begin:
else if( sName == "urlnoexit" )
{
m_sUrl = sValue;
@@ -420,7 +420,7 @@ void GameCommand::LoadOne( const Command& cmd )
else if( sName == "fademusic" )
{
// todo: parse for shit.
// todo: parse things correctly. -aj
if( cmd.m_vsArgs.size() == 3 )
{
m_bFadeMusic = true;
@@ -478,13 +478,14 @@ static bool AreStyleAndPlayModeCompatible( const Style *style, PlayMode pm )
case PLAY_MODE_RAVE:
// Can't play rave if there isn't enough room for two players.
// This is correct for dance (ie, no rave for solo and doubles),
// and should be okay for pump .. not sure about other game types.
// and should be okay for pump.. not sure about other game types.
// Techno Motion scales down versus arrows, though, so allow this.
if( style->m_iColsPerPlayer >= 6 && RString(GAMESTATE->m_pCurGame->m_szName) != "techno" )
return false;
/* Don't allow battle modes if the style takes both sides. */
if( style->m_StyleType==StyleType_OnePlayerTwoSides )
// Don't allow battle modes if the style takes both sides.
if( style->m_StyleType==StyleType_OnePlayerTwoSides ||
style->m_StyleType==StyleType_TwoPlayersSharedSides )
return false;
}
@@ -510,13 +511,13 @@ bool GameCommand::IsPlayable( RString *why ) const
{
case CoinMode_Home:
case CoinMode_Free:
iCredits = NUM_PLAYERS; /* not iNumCreditsPaid */
iCredits = NUM_PLAYERS; // not iNumCreditsPaid
}
/* With PREFSMAN->m_bDelayedCreditsReconcile disabled, enough credits must be
* paid. (This means that enough sides must be joined.) Enabled, simply having
* enough credits lying in the machine is sufficient; we'll deduct the extra in
* Apply(). */
/* With PREFSMAN->m_bDelayedCreditsReconcile disabled, enough credits must
* be paid. (This means that enough sides must be joined.) Enabled, simply
* having enough credits lying in the machine is sufficient; we'll deduct the
* extra in Apply(). */
int iNumCreditsAvailable = iNumCreditsPaid;
if( PREFSMAN->m_bDelayedCreditsReconcile )
iNumCreditsAvailable += iCredits;
@@ -545,8 +546,8 @@ bool GameCommand::IsPlayable( RString *why ) const
}
*/
/* If both sides are joined, disallow singles modes, since easy to select them
* accidentally, instead of versus mode. */
/* If both sides are joined, disallow singles modes, since easy to select
* them accidentally, instead of versus mode. */
if( m_pStyle->m_StyleType == StyleType_OnePlayerOneSide &&
GAMESTATE->GetNumSidesJoined() > 1 )
{
@@ -671,10 +672,9 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
{
GAMESTATE->SetCurrentStyle( m_pStyle );
// It's possible to choose a style that didn't have enough
// players joined. If enough players aren't joined, then
// we need to subtract credits for the sides that will be
// joined as a result of applying this option.
// It's possible to choose a style that didn't have enough players joined.
// If enough players aren't joined, then we need to subtract credits
// for the sides that will be joined as a result of applying this option.
if( GAMESTATE->GetCoinMode() == CoinMode_Pay )
{
int iNumCreditsRequired = GetCreditsRequiredToPlayStyle(m_pStyle);
@@ -685,9 +685,8 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
iNumCreditsOwed * PREFSMAN->m_iCoinsPerCredit, GAMESTATE->m_iCoins.Get() );
}
// If only one side is joined and we picked a style
// that requires both sides, join the other side.
// If only one side is joined and we picked a style that requires both
// sides, join the other side.
switch( m_pStyle->m_StyleType )
{
case StyleType_OnePlayerOneSide:
@@ -791,8 +790,8 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
ScreenPrompt::Prompt( SM_None, COULD_NOT_LAUNCH_BROWSER );
}
/* If we're going to stop music, do so before preparing new screens, so we don't
* stop music between preparing screens and loading screens. */
/* If we're going to stop music, do so before preparing new screens, so we
* don't stop music between preparing screens and loading screens. */
if( m_bStopMusic )
SOUND->StopMusic();
if( m_bFadeMusic )
+6 -6
View File
@@ -1593,22 +1593,22 @@ void RageDisplay_OGL::SetTextureMode( TextureUnit tu, TextureMode tm )
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD );
break;
case TextureMode_Glow:
// the below function is brighten:
// the below function is glowmode,brighten:
if( !GLExt.m_bARB_texture_env_combine && !GLExt.m_bEXT_texture_env_combine )
{
/* This is changing blend state, instead of texture state, which isn't
* great, but it's better than doing nothing. */
/* This is changing blend state, instead of texture state, which
* isn't great, but it's better than doing nothing. */
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
return;
}
// and this is whiten:
/* Source color is the diffuse color only: */
// and this is glowmode,whiten:
// Source color is the diffuse color only:
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT );
glTexEnvi( GL_TEXTURE_ENV, GLenum(GL_COMBINE_RGB_EXT), GL_REPLACE );
glTexEnvi( GL_TEXTURE_ENV, GLenum(GL_SOURCE0_RGB_EXT), GL_PRIMARY_COLOR_EXT );
/* Source alpha is texture alpha * diffuse alpha: */
// Source alpha is texture alpha * diffuse alpha:
glTexEnvi( GL_TEXTURE_ENV, GLenum(GL_COMBINE_ALPHA_EXT), GL_MODULATE );
glTexEnvi( GL_TEXTURE_ENV, GLenum(GL_OPERAND0_ALPHA_EXT), GL_SRC_ALPHA );
glTexEnvi( GL_TEXTURE_ENV, GLenum(GL_SOURCE0_ALPHA_EXT), GL_PRIMARY_COLOR_EXT );
-8
View File
@@ -155,14 +155,6 @@ static const char *ZTestModeNames[] =
XToString( ZTestMode );
LuaXType( ZTestMode );
static const char *GlowModeNames[] =
{
"Brighten",
"Whiten",
};
XToString( GlowMode );
LuaXType( GlowMode );
static const char *TextGlowModeNames[] =
{
"Inner",
+4 -13
View File
@@ -25,14 +25,14 @@ LuaDeclareType( BlendMode );
enum TextureMode
{
/* Affects one texture stage. Texture is modulated with the diffuse color. */
// Affects one texture stage. Texture is modulated with the diffuse color.
TextureMode_Modulate,
/* Affects one texture stage. Color is replaced with white, leaving alpha. Used
* with BLEND_ADD to add glow. */
/* Affects one texture stage. Color is replaced with white, leaving alpha.
* Used with BLEND_ADD to add glow. */
TextureMode_Glow,
/* Affects one texture stage. Color is added to the previous texture stage. */
// Affects one texture stage. Color is added to the previous texture stage.
TextureMode_Add,
NUM_TextureMode,
@@ -85,15 +85,6 @@ enum PolygonMode
};
LuaDeclareType( PolygonMode );
enum GlowMode
{
GlowMode_Brighten,
GlowMode_Whiten,
NUM_GlowMode,
GlowMode_Invalid
};
LuaDeclareType( GlowMode );
enum TextGlowMode
{
TextGlowMode_Inner,