From 7fee37baf2d02078d4770138fdd63f59140f8445 Mon Sep 17 00:00:00 2001 From: Mark Cannon Date: Thu, 7 Oct 2010 03:52:32 +0000 Subject: [PATCH] actually derive RFDCrypt off DirectReadOnly now, add Lua binding for GAMESTATE:IsDisqualified, make Dialog print debug messages instead of tracing git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg/branches/dev@856 83fadc84-e282-4d84-a09a-c4228d6ae7e5 --- src/GameState.cpp | 2 ++ src/Player.cpp | 14 ++++++++------ src/PlayerOptions.cpp | 2 +- src/RageFileDriverCrypt.h | 4 ++-- src/arch/Dialog/Dialog.cpp | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/GameState.cpp b/src/GameState.cpp index c74c8aca..bf6f34c7 100755 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -2017,6 +2017,7 @@ public: static int IsPlayerEnabled( T* p, lua_State *L ) { lua_pushboolean(L, p->IsPlayerEnabled((PlayerNumber)IArg(1)) ); return 1; } static int IsHumanPlayer( T* p, lua_State *L ) { lua_pushboolean(L, p->IsHumanPlayer((PlayerNumber)IArg(1)) ); return 1; } + static int IsDisqualified( T* p, lua_State *L ) { lua_pushboolean(L, p->IsDisqualified( (PlayerNumber)IArg(1)) ); return 1; } static int GetPlayerDisplayName( T* p, lua_State *L ) { lua_pushstring(L, p->GetPlayerDisplayName((PlayerNumber)IArg(1)) ); return 1; } static int GetMasterPlayerNumber( T* p, lua_State *L ) { lua_pushnumber(L, p->m_MasterPlayerNumber ); return 1; } static int ApplyGameCommand( T* p, lua_State *L ) @@ -2129,6 +2130,7 @@ public: { ADD_METHOD( IsPlayerEnabled ) ADD_METHOD( IsHumanPlayer ) + ADD_METHOD( IsDisqualified ) ADD_METHOD( GetPlayerDisplayName ) ADD_METHOD( GetMasterPlayerNumber ) ADD_METHOD( ApplyGameCommand ) diff --git a/src/Player.cpp b/src/Player.cpp index 4b0e9225..fa145aa0 100755 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -63,6 +63,7 @@ float AdjustedWindowTap( TapWindow tw, float fJudgeScale, bool bIsPlayingBeginne case TW_Attack: fSecs = PREFSMAN->m_fJudgeWindowSecondsAttack; break; default: ASSERT(0); } + fSecs *= PREFSMAN->m_fJudgeWindowScale; fSecs += PREFSMAN->m_fJudgeWindowAdd; @@ -79,15 +80,16 @@ float AdjustedWindowHold( HoldWindow hw, float fJudgeScale, bool bIsPlayingBegin float fSecs = 0; switch( hw ) { - case HW_OK: fSecs = PREFSMAN->m_fJudgeWindowSecondsOK; break; + case HW_OK: fSecs = PREFSMAN->m_fJudgeWindowSecondsOK; break; case HW_Roll: fSecs = PREFSMAN->m_fJudgeWindowSecondsRoll; break; default: ASSERT(0); } + fSecs *= PREFSMAN->m_fJudgeWindowScale; fSecs += PREFSMAN->m_fJudgeWindowAdd; - /* don't scale roll timing; that could get annoying pretty quickly. */ - if( hw == HW_OK ) + // don't scale roll timing + if( hw != HW_Roll ) fSecs *= fJudgeScale; return fSecs; @@ -203,7 +205,7 @@ void Player::Init( // calculate M-mod speed here, so we can adjust properly on a per-song basis. // XXX: can we find a better location for this? - if( GAMESTATE->m_pPlayerState[pn]->m_StoredPlayerOptions.m_fMaxScrollBPM != 0 ) + if( m_pPlayerState->m_StoredPlayerOptions.m_fMaxScrollBPM != 0 ) { DisplayBpms bpms; @@ -252,8 +254,8 @@ void Player::Init( ASSERT( fMaxBPM > 0 ); // set an X-mod equal to Mnum / fMaxBPM (e.g. M600 with 150 becomes 4x) - GAMESTATE->m_pPlayerState[pn]->m_StoredPlayerOptions.m_fScrollSpeed = - ( GAMESTATE->m_pPlayerState[pn]->m_StoredPlayerOptions.m_fMaxScrollBPM / fMaxBPM ); + m_pPlayerState->m_StoredPlayerOptions.m_fScrollSpeed = + ( m_pPlayerState->m_StoredPlayerOptions.m_fMaxScrollBPM / fMaxBPM ); } RageSoundParams p; diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp index 72a2657f..c09b6ea6 100755 --- a/src/PlayerOptions.cpp +++ b/src/PlayerOptions.cpp @@ -155,7 +155,7 @@ void PlayerOptions::GetMods( vector &AddTo ) const AddPart( AddTo, m_fCover, "Cover" ); AddPart( AddTo, m_fPassmark, "Passmark" ); - AddPart( AddTo, m_fTimingScale, "Timing" ); + AddPart( AddTo, m_fTimingScale, "JudgeScale" ); AddPart( AddTo, m_fRandomSpeed, "RandomSpeed" ); diff --git a/src/RageFileDriverCrypt.h b/src/RageFileDriverCrypt.h index 854ab987..1c2611e6 100755 --- a/src/RageFileDriverCrypt.h +++ b/src/RageFileDriverCrypt.h @@ -24,10 +24,10 @@ public: virtual int GetFileSize() const; }; -class RageFileDriverCrypt: public RageFileDriverDirect +class RageFileDriverCrypt: public RageFileDriverDirectReadOnly { public: - RageFileDriverCrypt( const CString &root ) : RageFileDriverDirect(root) { } + RageFileDriverCrypt( const CString &root ) : RageFileDriverDirectReadOnly(root) { } protected: // attempts to open and return a file of a derivative type diff --git a/src/arch/Dialog/Dialog.cpp b/src/arch/Dialog/Dialog.cpp index a41535b1..f3ca6a40 100755 --- a/src/arch/Dialog/Dialog.cpp +++ b/src/arch/Dialog/Dialog.cpp @@ -97,7 +97,7 @@ void Dialog::OK( CString sMessage, CString sID ) Dialog::Init(); if( LOG ) - LOG->Trace( "Dialog: \"%s\" [%s]", sMessage.c_str(), sID.c_str() ); + LOG->Debug( "Dialog: \"%s\" [%s]", sMessage.c_str(), sID.c_str() ); if( sID != "" && MessageIsIgnored(sID) ) return; -- 2.11.0