moved PlayerNumber into a separate header to reduce dependences on GameConstantsAndTypes.h
default mappings for menu buttons items in battle now have a duration fix VC6 compile errors
This commit is contained in:
@@ -376,7 +376,17 @@ DifficultyP2X=580
|
|||||||
DifficultyP2Y=410
|
DifficultyP2Y=410
|
||||||
DifficultyP2ReverseY=58
|
DifficultyP2ReverseY=58
|
||||||
DifficultyP2ExtraY=420
|
DifficultyP2ExtraY=420
|
||||||
DifficultyP2ExtraReverseY=420
|
DifficultyP2ExtraReverseY=70
|
||||||
|
ActiveItemsP1X=280
|
||||||
|
ActiveItemsP1Y=370
|
||||||
|
ActiveItemsP1ReverseY=98
|
||||||
|
ActiveItemsP1ExtraY=380
|
||||||
|
ActiveItemsP1ExtraReverseY=110
|
||||||
|
ActiveItemsP2X=340
|
||||||
|
ActiveItemsP2Y=370
|
||||||
|
ActiveItemsP2ReverseY=98
|
||||||
|
ActiveItemsP2ExtraY=380
|
||||||
|
ActiveItemsP2ExtraReverseY=110
|
||||||
SurviveTimeX=320
|
SurviveTimeX=320
|
||||||
SurviveTimeY=340
|
SurviveTimeY=340
|
||||||
DebugX=320
|
DebugX=320
|
||||||
@@ -721,7 +731,7 @@ ExtraColor=0.6,0.0,0.0,1 // dark red
|
|||||||
|
|
||||||
[GrayArrow]
|
[GrayArrow]
|
||||||
StepZoom=0.75
|
StepZoom=0.75
|
||||||
StepSeconds=0.13
|
StepSeconds=0.10
|
||||||
|
|
||||||
[CodeDetector]
|
[CodeDetector]
|
||||||
Easier1=Up,Up
|
Easier1=Up,Up
|
||||||
@@ -1007,9 +1017,15 @@ ModifiersHorizAlign=2
|
|||||||
[Inventory]
|
[Inventory]
|
||||||
NumItemTypes=3
|
NumItemTypes=3
|
||||||
ItemDurationSeconds=10
|
ItemDurationSeconds=10
|
||||||
Item1Combo=50
|
Item1Combo=25
|
||||||
Item1Effect=dizzy
|
Item1Effect=dizzy
|
||||||
Item2Combo=100
|
Item2Combo=50
|
||||||
Item2Effect=sudden
|
Item2Effect=sudden
|
||||||
Item3Combo=150
|
Item3Combo=75
|
||||||
Item3Effect=expand
|
Item3Effect=expand
|
||||||
|
|
||||||
|
[ActiveItemList]
|
||||||
|
TextHorizAlignP1=2
|
||||||
|
TextHorizAlignP2=0
|
||||||
|
TextZoom=0.8
|
||||||
|
SpacingY=24
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
#include "global.h"
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
File: ActiveItemList.h
|
||||||
|
|
||||||
|
Desc: A graphic displayed in the ActiveItemList during Dancing.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ActiveItemList.h"
|
||||||
|
#include "RageUtil.h"
|
||||||
|
#include "GameState.h"
|
||||||
|
#include "ThemeManager.h"
|
||||||
|
#include "Inventory.h"
|
||||||
|
#include "RageTimer.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define TEXT_HORIZ_ALIGN( p ) THEME->GetMetricI("ActiveItemList",ssprintf("TextHorizAlignP%d",p+1))
|
||||||
|
#define TEXT_ZOOM THEME->GetMetricF("ActiveItemList","TextZoom")
|
||||||
|
#define SPACING_Y THEME->GetMetricF("ActiveItemList","SpacingY")
|
||||||
|
|
||||||
|
|
||||||
|
ActiveItemList::ActiveItemList()
|
||||||
|
{
|
||||||
|
m_pInventory = NULL;
|
||||||
|
|
||||||
|
for( int i=0; i<MAX_ACTIVE_ITEMS_LINES; i++ )
|
||||||
|
{
|
||||||
|
m_text[i].LoadFromFont( THEME->GetPathTo("Fonts","normal") );
|
||||||
|
m_text[i].SetZoom( TEXT_ZOOM );
|
||||||
|
// m_text[i].SetText( "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW" );
|
||||||
|
this->AddChild( &m_text[i] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActiveItemList::Init( PlayerNumber pn, Inventory* pInventory )
|
||||||
|
{
|
||||||
|
m_PlayerNumber = pn;
|
||||||
|
m_pInventory = pInventory;
|
||||||
|
|
||||||
|
for( int i=0; i<MAX_ACTIVE_ITEMS_LINES; i++ )
|
||||||
|
{
|
||||||
|
m_text[i].SetHorizAlign( (Actor::HorizAlign)TEXT_HORIZ_ALIGN(pn) );
|
||||||
|
bool bReverse = GAMESTATE->m_PlayerOptions[pn].m_bReverseScroll;
|
||||||
|
float fHeight = SPACING_Y*MAX_ACTIVE_ITEMS_LINES * (bReverse ? 1 : -1 );
|
||||||
|
float fY = SCALE(i,0.f,MAX_ACTIVE_ITEMS_LINES,0.f,fHeight);
|
||||||
|
m_text[i].SetY( fY );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ActiveItemList::Update( float fDelta )
|
||||||
|
{
|
||||||
|
ActorFrame::Update( fDelta );
|
||||||
|
|
||||||
|
|
||||||
|
if( m_pInventory )
|
||||||
|
{
|
||||||
|
// refresh text only once every second
|
||||||
|
float fNowSeconds = RageTimer::GetTimeSinceStart();
|
||||||
|
float fLastSeconds = RageTimer::GetTimeSinceStart() - fDelta;
|
||||||
|
|
||||||
|
if( (int)fNowSeconds != (int)fLastSeconds )
|
||||||
|
{
|
||||||
|
int iNumActiveItems = m_pInventory->m_ActiveItems[m_PlayerNumber].size();
|
||||||
|
for( int i=0; i<MAX_ACTIVE_ITEMS_LINES; i++ )
|
||||||
|
{
|
||||||
|
if( i<iNumActiveItems )
|
||||||
|
{
|
||||||
|
const Inventory::ActiveItem& active_item = m_pInventory->m_ActiveItems[m_PlayerNumber][i];
|
||||||
|
const Inventory::ItemDef& item_def = m_pInventory->m_ItemDefs[ active_item.iItemDefIndex ];
|
||||||
|
|
||||||
|
int iDisplaySecondsLeft = (int)(active_item.fSecondsLeft+1);
|
||||||
|
m_text[i].SetText( ssprintf("%s %02d:%02d", item_def.effect.GetString(), iDisplaySecondsLeft/60, iDisplaySecondsLeft%60) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_text[i].SetText( "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#ifndef _ActiveItemList_H_
|
||||||
|
#define _ActiveItemList_H_
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
File: ActiveItemList.h
|
||||||
|
|
||||||
|
Desc: A graphic displayed in the ActiveItemList during Dancing.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Sprite.h"
|
||||||
|
#include "ActorFrame.h"
|
||||||
|
#include "BitmapText.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
|
class Inventory;
|
||||||
|
|
||||||
|
|
||||||
|
const int MAX_ACTIVE_ITEMS_LINES = 10;
|
||||||
|
|
||||||
|
|
||||||
|
class ActiveItemList : public ActorFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ActiveItemList();
|
||||||
|
|
||||||
|
void Init( PlayerNumber pn, Inventory* pInventory );
|
||||||
|
|
||||||
|
virtual void Update( float fDelta );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
BitmapText m_text[MAX_ACTIVE_ITEMS_LINES];
|
||||||
|
|
||||||
|
PlayerNumber m_PlayerNumber;
|
||||||
|
Inventory* m_pInventory;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -159,13 +159,16 @@ void Combo::SetScore( TapNoteScore score, int iNumNotesInThisRow, Inventory* pIn
|
|||||||
case TNS_BOO:
|
case TNS_BOO:
|
||||||
case TNS_MISS:
|
case TNS_MISS:
|
||||||
{
|
{
|
||||||
// end combo
|
// don't play "combo stopped" in battle
|
||||||
bool bItemAcquired = false;
|
switch( GAMESTATE->m_PlayMode )
|
||||||
|
{
|
||||||
|
case PLAY_MODE_BATTLE:
|
||||||
if( pInventory )
|
if( pInventory )
|
||||||
bItemAcquired = pInventory->OnComboBroken( m_PlayerNumber, m_iCurCombo );
|
pInventory->OnComboBroken( m_PlayerNumber, m_iCurCombo );
|
||||||
|
default:
|
||||||
if( !bItemAcquired && m_iCurCombo>50 ) // don't play "combo stopped" if we got an item
|
if( m_iCurCombo>50 )
|
||||||
SCREENMAN->SendMessageToTopScreen( SM_ComboStopped, 0 );
|
SCREENMAN->SendMessageToTopScreen( SM_ComboStopped, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
m_iCurCombo = 0;
|
m_iCurCombo = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
#include "GameConstantsAndTypes.h" // for TapNoteScore
|
#include "GameConstantsAndTypes.h" // for TapNoteScore
|
||||||
class Inventory;
|
class Inventory;
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "PlayerNumber.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
struct PlayerOptions;
|
struct PlayerOptions;
|
||||||
|
|||||||
@@ -12,9 +12,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
struct Notes;
|
struct Notes;
|
||||||
|
|
||||||
|
|
||||||
class DifficultyIcon : public Sprite
|
class DifficultyIcon : public Sprite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -11,10 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "ThemeManager.h"
|
|
||||||
|
|
||||||
#define COLOR_P1 THEME->GetMetricC("Common","ColorP1")
|
|
||||||
#define COLOR_P2 THEME->GetMetricC("Common","ColorP2")
|
|
||||||
|
|
||||||
|
|
||||||
CString DifficultyToString( Difficulty dc )
|
CString DifficultyToString( Difficulty dc )
|
||||||
@@ -75,21 +72,6 @@ PlayMode StringToPlayMode( CString s )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RageColor PlayerToColor( PlayerNumber pn )
|
|
||||||
{
|
|
||||||
switch( pn )
|
|
||||||
{
|
|
||||||
case PLAYER_1: return COLOR_P1;
|
|
||||||
case PLAYER_2: return COLOR_P2;
|
|
||||||
default: ASSERT(0); return RageColor(0.5f,0.5f,0.5f,1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
RageColor PlayerToColor( int p )
|
|
||||||
{
|
|
||||||
return PlayerToColor( (PlayerNumber)p );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
RankingCategory AverageMeterToRankingCategory( float fAverageMeter )
|
RankingCategory AverageMeterToRankingCategory( float fAverageMeter )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "RageTypes.h" // for RageColor
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Screen Dimensions
|
// Screen Dimensions
|
||||||
@@ -99,18 +97,6 @@ CString PlayModeToString( PlayMode pm );
|
|||||||
PlayMode StringToPlayMode( CString s );
|
PlayMode StringToPlayMode( CString s );
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Player number stuff
|
|
||||||
//
|
|
||||||
enum PlayerNumber {
|
|
||||||
PLAYER_1 = 0,
|
|
||||||
PLAYER_2,
|
|
||||||
NUM_PLAYERS, // leave this at the end
|
|
||||||
PLAYER_INVALID
|
|
||||||
};
|
|
||||||
|
|
||||||
RageColor PlayerToColor( PlayerNumber pn );
|
|
||||||
RageColor PlayerToColor( int p );
|
|
||||||
|
|
||||||
|
|
||||||
enum SongSortOrder {
|
enum SongSortOrder {
|
||||||
|
|||||||
@@ -128,10 +128,10 @@ GameDef g_GameDefs[NUM_GAMES] =
|
|||||||
-1, //no default key // DANCE_BUTTON_UPRIGHT,
|
-1, //no default key // DANCE_BUTTON_UPRIGHT,
|
||||||
SDLK_RETURN, // DANCE_BUTTON_START,
|
SDLK_RETURN, // DANCE_BUTTON_START,
|
||||||
SDLK_ESCAPE, // DANCE_BUTTON_BACK
|
SDLK_ESCAPE, // DANCE_BUTTON_BACK
|
||||||
-1, //no default key // DANCE_BUTTON_MENULEFT
|
SDLK_DELETE, // DANCE_BUTTON_MENULEFT
|
||||||
-1, //no default key // DANCE_BUTTON_MENURIGHT
|
SDLK_PAGEDOWN, // DANCE_BUTTON_MENURIGHT
|
||||||
SDLK_UP, // DANCE_BUTTON_MENUUP
|
SDLK_HOME, // DANCE_BUTTON_MENUUP
|
||||||
SDLK_DOWN, // DANCE_BUTTON_MENUDOWN
|
SDLK_END, // DANCE_BUTTON_MENUDOWN
|
||||||
SDLK_F1, // DANCE_BUTTON_COIN
|
SDLK_F1, // DANCE_BUTTON_COIN
|
||||||
SDLK_SCROLLOCK // DANCE_BUTTON_OPERATOR
|
SDLK_SCROLLOCK // DANCE_BUTTON_OPERATOR
|
||||||
},
|
},
|
||||||
@@ -144,10 +144,10 @@ GameDef g_GameDefs[NUM_GAMES] =
|
|||||||
SDLK_KP9, // DANCE_BUTTON_UPRIGHT,
|
SDLK_KP9, // DANCE_BUTTON_UPRIGHT,
|
||||||
SDLK_KP_ENTER, // DANCE_BUTTON_START,
|
SDLK_KP_ENTER, // DANCE_BUTTON_START,
|
||||||
SDLK_KP0, // DANCE_BUTTON_BACK
|
SDLK_KP0, // DANCE_BUTTON_BACK
|
||||||
-1, //no default key // DANCE_BUTTON_MENULEFT
|
SDLK_KP_DIVIDE, // DANCE_BUTTON_MENULEFT
|
||||||
-1, //no default key // DANCE_BUTTON_MENURIGHT
|
SDLK_KP_MULTIPLY, // DANCE_BUTTON_MENURIGHT
|
||||||
-1, //no default key // DANCE_BUTTON_MENUUP
|
SDLK_KP_MINUS, // DANCE_BUTTON_MENUUP
|
||||||
-1, //no default key // DANCE_BUTTON_MENUDOWN
|
SDLK_KP_PLUS, // DANCE_BUTTON_MENUDOWN
|
||||||
SDLK_F2, // DANCE_BUTTON_COIN
|
SDLK_F2, // DANCE_BUTTON_COIN
|
||||||
-1 // DANCE_BUTTON_OPERATOR
|
-1 // DANCE_BUTTON_OPERATOR
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
|
|
||||||
class GradeDisplay : public Sprite
|
class GradeDisplay : public Sprite
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define NUM_ITEM_TYPES THEME->GetMetricF("Inventory","NumItemTypes")
|
#define NUM_ITEM_TYPES THEME->GetMetricF("Inventory","NumItemTypes")
|
||||||
#define ITEM_DURATION_SECONDS THEME->GetMetricF("Inventory","ItemDuration")
|
#define ITEM_DURATION_SECONDS THEME->GetMetricF("Inventory","ItemDurationSeconds")
|
||||||
#define ITEM_COMBO( i ) THEME->GetMetricI("Inventory",ssprintf("Item%dCombo",i+1))
|
#define ITEM_COMBO( i ) THEME->GetMetricI("Inventory",ssprintf("Item%dCombo",i+1))
|
||||||
#define ITEM_EFFECT( i ) THEME->GetMetric ("Inventory",ssprintf("Item%dEffect",i+1))
|
#define ITEM_EFFECT( i ) THEME->GetMetric ("Inventory",ssprintf("Item%dEffect",i+1))
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@ Inventory::Inventory()
|
|||||||
|
|
||||||
m_soundAcquireItem.Load( THEME->GetPathTo("Sounds","gameplay battle aquire item") );
|
m_soundAcquireItem.Load( THEME->GetPathTo("Sounds","gameplay battle aquire item") );
|
||||||
m_soundUseItem.Load( THEME->GetPathTo("Sounds","gameplay battle use item") );
|
m_soundUseItem.Load( THEME->GetPathTo("Sounds","gameplay battle use item") );
|
||||||
|
m_soundItemEnding.Load( THEME->GetPathTo("Sounds","gameplay battle item ending") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inventory::RefreshPossibleItems()
|
void Inventory::RefreshPossibleItems()
|
||||||
@@ -43,6 +44,32 @@ void Inventory::RefreshPossibleItems()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Inventory::Update( float fDelta )
|
||||||
|
{
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
{
|
||||||
|
bool bActiveItemsChanged = false;
|
||||||
|
for( int i=m_ActiveItems[p].size()-1; i>=0; i-- )
|
||||||
|
{
|
||||||
|
ActiveItem& active_item = m_ActiveItems[p][i];
|
||||||
|
active_item.fSecondsLeft -= fDelta;
|
||||||
|
if( active_item.fSecondsLeft < 0 )
|
||||||
|
{
|
||||||
|
m_ActiveItems[p].erase( m_ActiveItems[p].begin()+i );
|
||||||
|
bActiveItemsChanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( bActiveItemsChanged )
|
||||||
|
{
|
||||||
|
RebuildPlayerOptions( (PlayerNumber)p );
|
||||||
|
m_soundItemEnding.Play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Inventory::OnComboBroken( PlayerNumber pn, int iCombo )
|
bool Inventory::OnComboBroken( PlayerNumber pn, int iCombo )
|
||||||
{
|
{
|
||||||
int* iItems = GAMESTATE->m_iItems[pn];
|
int* iItems = GAMESTATE->m_iItems[pn];
|
||||||
@@ -95,17 +122,18 @@ void Inventory::UseItem( PlayerNumber pn, int iSlot )
|
|||||||
|
|
||||||
int iItemIndex = iItems[iSlot];
|
int iItemIndex = iItems[iSlot];
|
||||||
|
|
||||||
const ItemDef& def = m_ItemDefs[iItemIndex];
|
|
||||||
|
|
||||||
PlayerNumber pnToAttack;
|
PlayerNumber pnToAttack;
|
||||||
switch( pn )
|
switch( pn )
|
||||||
{
|
{
|
||||||
case PLAYER_1: pnToAttack = PLAYER_2; break;
|
case PLAYER_1: pnToAttack = PLAYER_2; break;
|
||||||
case PLAYER_2: pnToAttack = PLAYER_1; break;
|
case PLAYER_2: pnToAttack = PLAYER_1; break;
|
||||||
default: ASSERT(0); pnToAttack = PLAYER_INVALID; break;
|
default: ASSERT(0); pnToAttack = PLAYER_1; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
GAMESTATE->m_PlayerOptions[pnToAttack].FromString( def.effect );
|
ActiveItem ai = { ITEM_DURATION_SECONDS, iItemIndex };
|
||||||
|
m_ActiveItems[pnToAttack].push_back( ai );
|
||||||
|
|
||||||
|
RebuildPlayerOptions( pnToAttack );
|
||||||
|
|
||||||
// remove the item
|
// remove the item
|
||||||
iItems[iSlot] = ITEM_NONE;
|
iItems[iSlot] = ITEM_NONE;
|
||||||
@@ -113,3 +141,21 @@ void Inventory::UseItem( PlayerNumber pn, int iSlot )
|
|||||||
m_soundUseItem.Play();
|
m_soundUseItem.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Inventory::RebuildPlayerOptions( PlayerNumber pn )
|
||||||
|
{
|
||||||
|
// rebuild player options
|
||||||
|
PlayerOptions po = GAMESTATE->m_SelectedOptions[pn];
|
||||||
|
for( int i=0; i<(int)m_ActiveItems[pn].size(); i++ )
|
||||||
|
{
|
||||||
|
int iItemDefIndex = m_ActiveItems[pn][i].iItemDefIndex;
|
||||||
|
po.FromString( m_ItemDefs[iItemDefIndex].effect );
|
||||||
|
}
|
||||||
|
GAMESTATE->m_PlayerOptions[pn] = po;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Inventory::RemoveAllActiveItems()
|
||||||
|
{
|
||||||
|
for( int p=0; p<NUM_PLAYERS; p++ )
|
||||||
|
m_ActiveItems[p].clear();
|
||||||
|
}
|
||||||
@@ -11,21 +11,24 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "Actor.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
#include "RageSound.h"
|
#include "RageSound.h"
|
||||||
|
|
||||||
const int MAX_ITEM_TYPES = 20;
|
|
||||||
|
|
||||||
|
class Inventory : public Actor
|
||||||
class Inventory
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Inventory();
|
Inventory();
|
||||||
void Reset();
|
void Reset();
|
||||||
void RefreshPossibleItems();
|
void RefreshPossibleItems();
|
||||||
|
|
||||||
|
virtual void Update( float fDelta );
|
||||||
|
virtual void DrawPrimitives() {};
|
||||||
|
|
||||||
bool OnComboBroken( PlayerNumber pn, int iCombo );
|
bool OnComboBroken( PlayerNumber pn, int iCombo );
|
||||||
void UseItem( PlayerNumber pn, int iSlot );
|
void UseItem( PlayerNumber pn, int iSlot );
|
||||||
|
void RemoveAllActiveItems(); // called on end of song
|
||||||
|
|
||||||
struct ItemDef
|
struct ItemDef
|
||||||
{
|
{
|
||||||
@@ -37,8 +40,19 @@ public:
|
|||||||
};
|
};
|
||||||
vector<ItemDef> m_ItemDefs;
|
vector<ItemDef> m_ItemDefs;
|
||||||
|
|
||||||
|
struct ActiveItem
|
||||||
|
{
|
||||||
|
float fSecondsLeft;
|
||||||
|
int iItemDefIndex;
|
||||||
|
};
|
||||||
|
vector<ActiveItem> m_ActiveItems[NUM_PLAYERS];
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void RebuildPlayerOptions( PlayerNumber pn );
|
||||||
|
|
||||||
RageSound m_soundAcquireItem;
|
RageSound m_soundAcquireItem;
|
||||||
RageSound m_soundUseItem;
|
RageSound m_soundUseItem;
|
||||||
|
RageSound m_soundItemEnding;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "PlayerNumber.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
enum MenuButton
|
enum MenuButton
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1002,13 +1002,15 @@ void NoteDataUtil::SwapSides( NoteData &in )
|
|||||||
|
|
||||||
void NoteDataUtil::Little(NoteData &in)
|
void NoteDataUtil::Little(NoteData &in)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
// filter out all non-quarter notes
|
// filter out all non-quarter notes
|
||||||
int max_row = in.GetLastRow();
|
int max_row = in.GetLastRow();
|
||||||
for( int i=0; i<=max_row; i+=ROWS_PER_BEAT )
|
for( i=0; i<=max_row; i+=ROWS_PER_BEAT )
|
||||||
for( int c=0; c<in.GetNumTracks(); c++ )
|
for( int c=0; c<in.GetNumTracks(); c++ )
|
||||||
in.SetTapNote(c, i, TAP_EMPTY);
|
in.SetTapNote(c, i, TAP_EMPTY);
|
||||||
|
|
||||||
for( int i=in.GetNumHoldNotes()-1; i>=0; i-- )
|
for( i=in.GetNumHoldNotes()-1; i>=0; i-- )
|
||||||
if( fmodf(in.GetHoldNote(i).fStartBeat,1) != 0 ) // doesn't start on a beat
|
if( fmodf(in.GetHoldNote(i).fStartBeat,1) != 0 ) // doesn't start on a beat
|
||||||
in.RemoveHoldNote( i );
|
in.RemoveHoldNote( i );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "NoteTypes.h"
|
#include "NoteTypes.h"
|
||||||
|
|
||||||
// '1' = tap note
|
// '1' = tap note
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "NoteTypes.h"
|
#include "NoteTypes.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
|
|
||||||
struct NoteMetricCache_t;
|
struct NoteMetricCache_t;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "RageTypes.h"
|
#include "RageTypes.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
class IniFile;
|
class IniFile;
|
||||||
|
|
||||||
|
|||||||
@@ -12,22 +12,6 @@
|
|||||||
#include "NoteTypes.h"
|
#include "NoteTypes.h"
|
||||||
|
|
||||||
|
|
||||||
RageColor NoteTypeToColor( NoteType nt )
|
|
||||||
{
|
|
||||||
switch( nt )
|
|
||||||
{
|
|
||||||
case NOTE_TYPE_4TH: return RageColor(1,0,0,1); // red
|
|
||||||
case NOTE_TYPE_8TH: return RageColor(0,0,1,1); // blue
|
|
||||||
case NOTE_TYPE_12TH: return RageColor(1,0,1,1); // purple
|
|
||||||
case NOTE_TYPE_16TH: return RageColor(1,1,0,1); // yellow
|
|
||||||
case NOTE_TYPE_24TH: return RageColor(0,1,1,1); // light blue
|
|
||||||
default:
|
|
||||||
ASSERT(0);
|
|
||||||
case NOTE_TYPE_32ND: // fall through
|
|
||||||
return RageColor(0.5f,0.5f,0.5f,1); // gray
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
float NoteTypeToBeat( NoteType nt )
|
float NoteTypeToBeat( NoteType nt )
|
||||||
{
|
{
|
||||||
switch( nt )
|
switch( nt )
|
||||||
@@ -77,13 +61,3 @@ bool IsNoteOfType( int iNoteIndex, NoteType t )
|
|||||||
return GetNoteType(iNoteIndex) == t;
|
return GetNoteType(iNoteIndex) == t;
|
||||||
}
|
}
|
||||||
|
|
||||||
RageColor GetNoteColorFromIndex( int iIndex )
|
|
||||||
{
|
|
||||||
return NoteTypeToColor( GetNoteType(iIndex) );
|
|
||||||
}
|
|
||||||
|
|
||||||
RageColor GetNoteColorFromBeat( float fBeat )
|
|
||||||
{
|
|
||||||
return GetNoteColorFromIndex( BeatToNoteRow(fBeat) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GameConstantsAndTypes.h"
|
|
||||||
#include "PlayerOptions.h"
|
#include "PlayerOptions.h"
|
||||||
|
|
||||||
// '1' = tap note
|
// '1' = tap note
|
||||||
@@ -68,13 +67,10 @@ enum NoteType
|
|||||||
NOTE_TYPE_INVALID
|
NOTE_TYPE_INVALID
|
||||||
};
|
};
|
||||||
|
|
||||||
RageColor NoteTypeToColor( NoteType nt );
|
|
||||||
float NoteTypeToBeat( NoteType nt );
|
float NoteTypeToBeat( NoteType nt );
|
||||||
NoteType GetNoteType( int iNoteIndex );
|
NoteType GetNoteType( int iNoteIndex );
|
||||||
NoteType BeatToNoteType( float fBeat );
|
NoteType BeatToNoteType( float fBeat );
|
||||||
bool IsNoteOfType( int iNoteIndex, NoteType t );
|
bool IsNoteOfType( int iNoteIndex, NoteType t );
|
||||||
RageColor GetNoteColorFromIndex( int iNoteIndex );
|
|
||||||
RageColor GetNoteColorFromBeat( float fBeat );
|
|
||||||
CString NoteTypeToString( NoteType nt );
|
CString NoteTypeToString( NoteType nt );
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
class NoteData;
|
class NoteData;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
|
|
||||||
class OptionIcon : public ActorFrame
|
class OptionIcon : public ActorFrame
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
|
|
||||||
class OptionsCursor : public ActorFrame
|
class OptionsCursor : public ActorFrame
|
||||||
|
|||||||
@@ -573,7 +573,7 @@ void Player::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
|
|||||||
#endif //DEBUG
|
#endif //DEBUG
|
||||||
|
|
||||||
if(m_pScoreKeeper)
|
if(m_pScoreKeeper)
|
||||||
m_pScoreKeeper->HandleNoteScore(score, iNumTapsInRow);
|
m_pScoreKeeper->HandleTapScore(score, iNumTapsInRow);
|
||||||
|
|
||||||
if (m_pScore)
|
if (m_pScore)
|
||||||
m_pScore->SetScore(GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber]);
|
m_pScore->SetScore(GAMESTATE->m_CurStageStats.fScore[m_PlayerNumber]);
|
||||||
@@ -594,7 +594,7 @@ void Player::HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore
|
|||||||
#endif //DEBUG
|
#endif //DEBUG
|
||||||
|
|
||||||
if(m_pScoreKeeper) {
|
if(m_pScoreKeeper) {
|
||||||
m_pScoreKeeper->HandleHoldNoteScore(score, TapNoteScore);
|
m_pScoreKeeper->HandleHoldScore(score, TapNoteScore);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pScore)
|
if (m_pScore)
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#include "global.h"
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
File: PlayerNumber.cpp
|
||||||
|
|
||||||
|
Desc: See header.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PlayerNumber.h"
|
||||||
|
#include "ThemeManager.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define COLOR_P1 THEME->GetMetricC("Common","ColorP1")
|
||||||
|
#define COLOR_P2 THEME->GetMetricC("Common","ColorP2")
|
||||||
|
|
||||||
|
|
||||||
|
RageColor PlayerToColor( PlayerNumber pn )
|
||||||
|
{
|
||||||
|
switch( pn )
|
||||||
|
{
|
||||||
|
case PLAYER_1: return COLOR_P1;
|
||||||
|
case PLAYER_2: return COLOR_P2;
|
||||||
|
default: ASSERT(0); return RageColor(0.5f,0.5f,0.5f,1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
RageColor PlayerToColor( int p )
|
||||||
|
{
|
||||||
|
return PlayerToColor( (PlayerNumber)p );
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef PlayerNumber_H
|
||||||
|
#define PlayerNumber_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
File: PlayerNumber.h
|
||||||
|
|
||||||
|
Desc: Things that are used in many places and don't change often.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
Chris Gomez
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "RageTypes.h" // for RageColor
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Player number stuff
|
||||||
|
//
|
||||||
|
enum PlayerNumber {
|
||||||
|
PLAYER_1 = 0,
|
||||||
|
PLAYER_2,
|
||||||
|
NUM_PLAYERS, // leave this at the end
|
||||||
|
PLAYER_INVALID
|
||||||
|
};
|
||||||
|
|
||||||
|
RageColor PlayerToColor( PlayerNumber pn );
|
||||||
|
RageColor PlayerToColor( int p );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
#include "ActorFrame.h"
|
#include "ActorFrame.h"
|
||||||
|
|
||||||
class ScoreDisplay : public ActorFrame
|
class ScoreDisplay : public ActorFrame
|
||||||
|
|||||||
@@ -37,7 +37,10 @@ ScoreDisplayBattle::ScoreDisplayBattle()
|
|||||||
m_sprItems[i].SetX( fX );
|
m_sprItems[i].SetX( fX );
|
||||||
m_sprItems[i].Load( THEME->GetPathTo("Graphics","gameplay battle item icons") );
|
m_sprItems[i].Load( THEME->GetPathTo("Graphics","gameplay battle item icons") );
|
||||||
m_sprItems[i].StopAnimating();
|
m_sprItems[i].StopAnimating();
|
||||||
|
m_sprItems[i].SetZoom( 0 );
|
||||||
this->AddChild( &m_sprItems[i] );
|
this->AddChild( &m_sprItems[i] );
|
||||||
|
|
||||||
|
m_iLastSeenItems[i] = ITEM_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,12 +60,14 @@ void ScoreDisplayBattle::Update( float fDelta )
|
|||||||
if( iNewItem == ITEM_NONE )
|
if( iNewItem == ITEM_NONE )
|
||||||
{
|
{
|
||||||
m_sprItems[s].StopTweening();
|
m_sprItems[s].StopTweening();
|
||||||
m_sprItems[s].SetDiffuse( RageColor(1,1,1,0) );
|
m_sprItems[s].BeginTweening( 0.25f, Actor::TWEEN_BOUNCE_BEGIN );
|
||||||
|
m_sprItems[s].SetTweenZoom( 0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_sprItems[s].SetDiffuse( RageColor(1,1,1,1) );
|
m_sprItems[s].SetDiffuse( RageColor(1,1,1,1) );
|
||||||
m_sprItems[s].SetState( iNewItem );
|
m_sprItems[s].SetState( iNewItem );
|
||||||
|
m_sprItems[s].SetZoom( 1 );
|
||||||
|
|
||||||
// blink
|
// blink
|
||||||
m_sprItems[s].StopTweening();
|
m_sprItems[s].StopTweening();
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "ScoreDisplay.h"
|
#include "ScoreDisplay.h"
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "Inventory.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Actor.h"
|
#include "Actor.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
class ScoreKeeper: public Actor {
|
class ScoreKeeper: public Actor
|
||||||
|
{
|
||||||
protected:
|
protected:
|
||||||
PlayerNumber m_PlayerNumber;
|
PlayerNumber m_PlayerNumber;
|
||||||
|
|
||||||
@@ -35,8 +37,8 @@ public:
|
|||||||
ScoreKeeper(PlayerNumber pn) { m_PlayerNumber=pn; }
|
ScoreKeeper(PlayerNumber pn) { m_PlayerNumber=pn; }
|
||||||
virtual void DrawPrimitives() { }
|
virtual void DrawPrimitives() { }
|
||||||
|
|
||||||
virtual void HandleNoteScore( TapNoteScore score, int iNumTapsInRow ) { }
|
virtual void HandleTapScore( TapNoteScore score, int iNumTapsInRow ) { }
|
||||||
virtual void HandleHoldNoteScore( HoldNoteScore score, TapNoteScore TapNoteScore ) { }
|
virtual void HandleHoldScore( HoldNoteScore score, TapNoteScore TapNoteScore ) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ void ScoreKeeperMAX2::AddScore( TapNoteScore score )
|
|||||||
|
|
||||||
void ScoreKeeperMAX2::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
|
void ScoreKeeperMAX2::HandleNoteScore( TapNoteScore score, int iNumTapsInRow )
|
||||||
{
|
{
|
||||||
ScoreKeeper::HandleNoteScore(score, iNumTapsInRow);
|
ScoreKeeper::HandleTapScore(score, iNumTapsInRow);
|
||||||
|
|
||||||
ASSERT( iNumTapsInRow >= 1 );
|
ASSERT( iNumTapsInRow >= 1 );
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,8 @@
|
|||||||
#define SONG_OPTIONS_Y( e ) THEME->GetMetricF("ScreenGameplay",ssprintf("SongOptions%sY",e?"Extra":""))
|
#define SONG_OPTIONS_Y( e ) THEME->GetMetricF("ScreenGameplay",ssprintf("SongOptions%sY",e?"Extra":""))
|
||||||
#define DIFFICULTY_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("DifficultyP%dX",p+1))
|
#define DIFFICULTY_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("DifficultyP%dX",p+1))
|
||||||
#define DIFFICULTY_Y( p, e, r ) THEME->GetMetricF("ScreenGameplay",ssprintf("DifficultyP%d%s%sY",p+1,e?"Extra":"",r?"Reverse":""))
|
#define DIFFICULTY_Y( p, e, r ) THEME->GetMetricF("ScreenGameplay",ssprintf("DifficultyP%d%s%sY",p+1,e?"Extra":"",r?"Reverse":""))
|
||||||
|
#define ACTIVE_ITEMS_X( p ) THEME->GetMetricF("ScreenGameplay",ssprintf("ActiveItemsP%dX",p+1))
|
||||||
|
#define ACTIVE_ITEMS_Y( p, e, r ) THEME->GetMetricF("ScreenGameplay",ssprintf("ActiveItemsP%d%s%sY",p+1,e?"Extra":"",r?"Reverse":""))
|
||||||
#define DEBUG_X THEME->GetMetricF("ScreenGameplay","DebugX")
|
#define DEBUG_X THEME->GetMetricF("ScreenGameplay","DebugX")
|
||||||
#define DEBUG_Y THEME->GetMetricF("ScreenGameplay","DebugY")
|
#define DEBUG_Y THEME->GetMetricF("ScreenGameplay","DebugY")
|
||||||
#define STATUS_ICONS_X THEME->GetMetricF("ScreenGameplay","StatusIconsX")
|
#define STATUS_ICONS_X THEME->GetMetricF("ScreenGameplay","StatusIconsX")
|
||||||
@@ -201,6 +203,10 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
|||||||
m_Player[p].SetX( fPlayerX );
|
m_Player[p].SetX( fPlayerX );
|
||||||
this->AddChild( &m_Player[p] );
|
this->AddChild( &m_Player[p] );
|
||||||
|
|
||||||
|
m_ActiveItemList[p].SetXY( ACTIVE_ITEMS_X(p), ACTIVE_ITEMS_Y(p,bExtra,bReverse[p]) );
|
||||||
|
m_ActiveItemList[p].Init( (PlayerNumber)p, &m_Inventory );
|
||||||
|
this->AddChild( &m_ActiveItemList[p] );
|
||||||
|
|
||||||
m_sprOniGameOver[p].Load( THEME->GetPathTo("Graphics","gameplay oni gameover") );
|
m_sprOniGameOver[p].Load( THEME->GetPathTo("Graphics","gameplay oni gameover") );
|
||||||
m_sprOniGameOver[p].SetX( fPlayerX );
|
m_sprOniGameOver[p].SetX( fPlayerX );
|
||||||
m_sprOniGameOver[p].SetY( SCREEN_TOP - m_sprOniGameOver[p].GetZoomedHeight()/2 );
|
m_sprOniGameOver[p].SetY( SCREEN_TOP - m_sprOniGameOver[p].GetZoomedHeight()/2 );
|
||||||
@@ -474,6 +480,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_Inventory.RefreshPossibleItems();
|
m_Inventory.RefreshPossibleItems();
|
||||||
|
this->AddChild( &m_Inventory );
|
||||||
|
|
||||||
|
|
||||||
m_iRowLastCrossed = -1;
|
m_iRowLastCrossed = -1;
|
||||||
@@ -1259,6 +1266,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_Inventory.RemoveAllActiveItems();
|
||||||
|
|
||||||
for( p=0; p<NUM_PLAYERS; p++ )
|
for( p=0; p<NUM_PLAYERS; p++ )
|
||||||
{
|
{
|
||||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "BPMDisplay.h"
|
#include "BPMDisplay.h"
|
||||||
#include "FocusingSprite.h"
|
#include "FocusingSprite.h"
|
||||||
#include "Inventory.h"
|
#include "Inventory.h"
|
||||||
|
#include "ActiveItemList.h"
|
||||||
|
|
||||||
|
|
||||||
// messages sent by Combo
|
// messages sent by Combo
|
||||||
@@ -129,6 +130,7 @@ protected:
|
|||||||
Player m_Player[NUM_PLAYERS];
|
Player m_Player[NUM_PLAYERS];
|
||||||
|
|
||||||
Inventory m_Inventory;
|
Inventory m_Inventory;
|
||||||
|
ActiveItemList m_ActiveItemList[NUM_PLAYERS];
|
||||||
|
|
||||||
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
|
DifficultyIcon m_DifficultyIcon[NUM_PLAYERS];
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "global.h"
|
|
||||||
#include "ScreenSandbox.h"
|
#include "ScreenSandbox.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
|
||||||
ScreenSandbox::ScreenSandbox()
|
ScreenSandbox::ScreenSandbox()
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include "FontManager.h"
|
#include "FontManager.h"
|
||||||
#include "RageTextureManager.h"
|
#include "RageTextureManager.h"
|
||||||
#include "ScreenManager.h"
|
#include "ScreenManager.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
|
||||||
static const float LineWidth = 400;
|
static const float LineWidth = 400;
|
||||||
static const float LineHeight = 50;
|
static const float LineHeight = 50;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,11 @@ SnapDisplay::SnapDisplay()
|
|||||||
for( i=0; i<2; i++ )
|
for( i=0; i<2; i++ )
|
||||||
{
|
{
|
||||||
m_sprIndicators[i].Load( THEME->GetPathTo("Graphics","edit snap indicator") );
|
m_sprIndicators[i].Load( THEME->GetPathTo("Graphics","edit snap indicator") );
|
||||||
|
ASSERT( m_sprIndicators[i].GetNumStates() == NUM_NOTE_TYPES );
|
||||||
this->AddChild( &m_sprIndicators[i] );
|
this->AddChild( &m_sprIndicators[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_NoteType = NOTE_TYPE_4TH;
|
m_NoteType = NOTE_TYPE_4TH;
|
||||||
RageColor color = NoteTypeToColor( m_NoteType );
|
|
||||||
|
|
||||||
for( i=0; i<2; i++ )
|
|
||||||
m_sprIndicators[i].SetDiffuse( color );
|
|
||||||
|
|
||||||
m_iNumCols = 0;
|
m_iNumCols = 0;
|
||||||
}
|
}
|
||||||
@@ -71,12 +68,6 @@ bool SnapDisplay::NextSnapMode()
|
|||||||
|
|
||||||
void SnapDisplay::SnapModeChanged()
|
void SnapDisplay::SnapModeChanged()
|
||||||
{
|
{
|
||||||
RageColor color = NoteTypeToColor( m_NoteType );
|
|
||||||
|
|
||||||
for( int i=0; i<2; i++ )
|
for( int i=0; i<2; i++ )
|
||||||
{
|
m_sprIndicators[i].SetState( m_NoteType );
|
||||||
m_sprIndicators[i].StopTweening();
|
|
||||||
m_sprIndicators[i].BeginTweening( 0.3f );
|
|
||||||
m_sprIndicators[i].SetTweenDiffuse( color );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "GameConstantsAndTypes.h" // for NUM_PLAYERS
|
#include "PlayerNumber.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
|
|
||||||
class Song;
|
class Song;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /pdb:none
|
# SUBTRACT LINK32 /verbose /pdb:none
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Release6
|
IntDir=.\../Release6
|
||||||
TargetDir=\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=StepMania
|
TargetName=StepMania
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -92,7 +92,7 @@ LINK32=link.exe
|
|||||||
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
|
||||||
# Begin Special Build Tool
|
# Begin Special Build Tool
|
||||||
IntDir=.\../Debug6
|
IntDir=.\../Debug6
|
||||||
TargetDir=\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=StepMania-debug
|
TargetName=StepMania-debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
@@ -363,6 +363,14 @@ SOURCE=.\Grade.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Inventory.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Inventory.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\NoteData.cpp
|
SOURCE=.\NoteData.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -451,11 +459,11 @@ SOURCE=.\NoteTypes.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\Player.cpp
|
SOURCE=.\PlayerNumber.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\Player.h
|
SOURCE=.\PlayerNumber.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
@@ -1228,6 +1236,14 @@ SOURCE=.\TipDisplay.h
|
|||||||
# PROP Default_Filter ""
|
# PROP Default_Filter ""
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ActiveItemList.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ActiveItemList.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\ArrowEffects.cpp
|
SOURCE=.\ArrowEffects.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -1388,6 +1404,14 @@ SOURCE=.\NoteField.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Player.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\Player.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\ScoreDisplay.cpp
|
SOURCE=.\ScoreDisplay.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -1396,6 +1420,14 @@ SOURCE=.\ScoreDisplay.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ScoreDisplayBattle.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ScoreDisplayBattle.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\ScoreDisplayNormal.cpp
|
SOURCE=.\ScoreDisplayNormal.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -631,6 +631,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
|||||||
<File
|
<File
|
||||||
RelativePath="NotesWriterSM.h">
|
RelativePath="NotesWriterSM.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="PlayerNumber.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="PlayerNumber.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="PlayerOptions.cpp">
|
RelativePath="PlayerOptions.cpp">
|
||||||
</File>
|
</File>
|
||||||
@@ -1194,6 +1200,12 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
|||||||
<Filter
|
<Filter
|
||||||
Name="Actors used in Gameplay"
|
Name="Actors used in Gameplay"
|
||||||
Filter="">
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath="ActiveItemList.cpp">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="ActiveItemList.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\ArrowEffects.cpp">
|
RelativePath=".\ArrowEffects.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
#include "GameInput.h"
|
#include "GameInput.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "NoteTypes.h"
|
#include "NoteTypes.h"
|
||||||
|
#include "PlayerNumber.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
|
||||||
const int MAX_COLS_PER_PLAYER = MAX_NOTE_TRACKS;
|
const int MAX_COLS_PER_PLAYER = MAX_NOTE_TRACKS;
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
Chris Danford
|
Chris Danford
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#include "GameConstantsAndTypes.h"
|
|
||||||
|
#include "PlayerNumber.h"
|
||||||
|
|
||||||
|
|
||||||
struct StyleInput
|
struct StyleInput
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "ThemeManager.h"
|
#include "ThemeManager.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
|
||||||
#define RECTANGLE_WIDTH 20
|
#define RECTANGLE_WIDTH 20
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
|
|
||||||
#include "TransitionRectWipe.h"
|
#include "TransitionRectWipe.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
|
||||||
|
|
||||||
#define RECTANGLE_WIDTH 20
|
#define RECTANGLE_WIDTH 20
|
||||||
|
|||||||
@@ -11,15 +11,17 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "PlayerNumber.h"
|
||||||
#include "GameConstantsAndTypes.h"
|
#include "GameConstantsAndTypes.h"
|
||||||
#include "Grade.h"
|
#include "Grade.h"
|
||||||
|
|
||||||
struct Notes;
|
struct Notes;
|
||||||
class StyleDef;
|
class StyleDef;
|
||||||
class NotesLoader;
|
class NotesLoader;
|
||||||
|
|
||||||
|
|
||||||
extern const int FILE_CACHE_VERSION;
|
extern const int FILE_CACHE_VERSION;
|
||||||
|
|
||||||
|
|
||||||
struct BPMSegment
|
struct BPMSegment
|
||||||
{
|
{
|
||||||
BPMSegment() { m_fStartBeat = m_fBPM = -1; };
|
BPMSegment() { m_fStartBeat = m_fBPM = -1; };
|
||||||
|
|||||||
Reference in New Issue
Block a user