2003-04-02 21:55:54 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
#include "NoteFieldPositioning.h"
|
2003-04-10 08:49:25 +00:00
|
|
|
|
2003-04-02 21:55:54 +00:00
|
|
|
#include "RageDisplay.h"
|
|
|
|
|
#include "RageLog.h"
|
2003-04-10 08:49:25 +00:00
|
|
|
#include "GameState.h"
|
2005-01-15 02:01:26 +00:00
|
|
|
#include "Style.h"
|
2005-10-22 21:31:40 +00:00
|
|
|
#include "PlayerState.h"
|
2003-04-10 08:49:25 +00:00
|
|
|
|
2005-10-22 21:31:40 +00:00
|
|
|
void NoteFieldMode::BeginDrawTrack( const PlayerState* pPlayerState, int iTrack )
|
2003-04-02 21:55:54 +00:00
|
|
|
{
|
2003-09-21 02:36:28 +00:00
|
|
|
DISPLAY->CameraPushMatrix();
|
2003-04-15 02:52:58 +00:00
|
|
|
|
2005-01-15 02:01:26 +00:00
|
|
|
ASSERT( iTrack != -1 );
|
2003-04-15 02:52:58 +00:00
|
|
|
|
2005-01-15 02:01:26 +00:00
|
|
|
DISPLAY->PushMatrix();
|
2003-04-10 08:49:25 +00:00
|
|
|
|
2005-01-15 02:01:26 +00:00
|
|
|
const Style *s = GAMESTATE->GetCurrentStyle();
|
2005-10-22 21:31:40 +00:00
|
|
|
// TODO: Remove indexing by PlayerNumber.
|
|
|
|
|
float fPixelXOffsetFromCenter = s->m_ColumnInfo[pPlayerState->m_PlayerNumber][iTrack].fXOffset;
|
2005-10-22 21:54:08 +00:00
|
|
|
|
2005-10-22 23:31:12 +00:00
|
|
|
/* Allow Mini to pull tracks together, but not to push them apart. */
|
2005-10-22 21:54:08 +00:00
|
|
|
const float* fEffects = pPlayerState->m_CurrentPlayerOptions.m_fEffects;
|
2005-10-22 23:31:12 +00:00
|
|
|
float fMiniPercent = fEffects[PlayerOptions::EFFECT_MINI];
|
|
|
|
|
fMiniPercent = min( powf(0.5f, fMiniPercent), 1.0f );
|
|
|
|
|
fPixelXOffsetFromCenter *= fMiniPercent;
|
2005-10-22 21:54:08 +00:00
|
|
|
|
2005-01-15 02:01:26 +00:00
|
|
|
DISPLAY->Translate( fPixelXOffsetFromCenter, 0, 0 );
|
2003-04-10 08:49:25 +00:00
|
|
|
}
|
2003-04-03 00:01:04 +00:00
|
|
|
|
2005-01-15 02:01:26 +00:00
|
|
|
void NoteFieldMode::EndDrawTrack( int iTrack )
|
2003-04-15 02:52:58 +00:00
|
|
|
{
|
2005-01-15 02:01:26 +00:00
|
|
|
ASSERT( iTrack != -1 );
|
2003-04-15 02:52:58 +00:00
|
|
|
|
2005-01-15 02:01:26 +00:00
|
|
|
DISPLAY->PopMatrix();
|
|
|
|
|
DISPLAY->CameraPopMatrix();
|
2003-04-15 02:52:58 +00:00
|
|
|
}
|
|
|
|
|
|
2003-04-03 00:01:04 +00:00
|
|
|
|
2004-05-31 22:42:12 +00:00
|
|
|
/*
|
|
|
|
|
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|