2002-01-16 10:01:32 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-10-06 16:56:58 +00:00
|
|
|
Class: DifficultyIcon
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2002-10-06 16:56:58 +00:00
|
|
|
Desc: See header.
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-10-06 16:56:58 +00:00
|
|
|
Chris Danford
|
2002-01-16 10:01:32 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "DifficultyIcon.h"
|
2002-10-06 16:56:58 +00:00
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "Notes.h"
|
|
|
|
|
#include "GameState.h"
|
2002-01-16 10:01:32 +00:00
|
|
|
|
|
|
|
|
|
2002-10-06 16:56:58 +00:00
|
|
|
bool DifficultyIcon::Load( CString sPath )
|
|
|
|
|
{
|
|
|
|
|
Sprite::Load( sPath );
|
|
|
|
|
if( GetNumStates() != 6 && GetNumStates() != 12 )
|
|
|
|
|
throw RageException( "The difficulty icon graphic '%s' must have 6 or 12 states.", sPath );
|
|
|
|
|
StopAnimating();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2002-10-06 16:56:58 +00:00
|
|
|
void DifficultyIcon::SetFromNotes( PlayerNumber pn, Notes* pNotes )
|
|
|
|
|
{
|
|
|
|
|
if( pNotes == NULL )
|
|
|
|
|
{
|
2002-10-28 05:30:45 +00:00
|
|
|
SetDiffuse( RageColor(1,1,1,0) );
|
2002-10-06 16:56:58 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2002-10-28 05:30:45 +00:00
|
|
|
SetDiffuse( RageColor(1,1,1,1) );
|
2002-10-06 16:56:58 +00:00
|
|
|
|
|
|
|
|
int iStateNo = pNotes->GetNotesDisplayType();
|
|
|
|
|
|
|
|
|
|
switch( GetNumStates() )
|
|
|
|
|
{
|
|
|
|
|
case 6: SetState( iStateNo ); break;
|
|
|
|
|
case 12: SetState( iStateNo*2+pn ); break;
|
|
|
|
|
default: ASSERT(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|