Skip to content

Commit 446f809

Browse files
severely cripple memorycardman
1 parent f87046d commit 446f809

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+27
-4148
lines changed

src/GameConstantsAndTypes.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,6 @@ static const char *ProfileSlotNames[] = {
328328
XToString( ProfileSlot );
329329
LuaXType( ProfileSlot );
330330

331-
static const char *MemoryCardStateNames[] = {
332-
"ready",
333-
"checking",
334-
"late",
335-
"error",
336-
"removed",
337-
"none",
338-
};
339-
XToString( MemoryCardState );
340-
LuaXType( MemoryCardState );
341-
342331
static const char *StageAwardNames[] = {
343332
"FullComboW3",
344333
"SingleDigitW3",

src/GameConstantsAndTypes.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -339,22 +339,6 @@ enum ProfileSlot
339339
const RString& ProfileSlotToString( ProfileSlot ps );
340340
LuaDeclareType( ProfileSlot );
341341

342-
/** @brief The states of the memory card during play. */
343-
enum MemoryCardState
344-
{
345-
MemoryCardState_Ready,
346-
MemoryCardState_Checking,
347-
MemoryCardState_TooLate,
348-
MemoryCardState_Error,
349-
MemoryCardState_Removed,
350-
MemoryCardState_NoCard,
351-
NUM_MemoryCardState,
352-
MemoryCardState_Invalid,
353-
};
354-
355-
const RString& MemoryCardStateToString( MemoryCardState mcs );
356-
LuaDeclareType( MemoryCardState );
357-
358342
/** @brief The different ranking categories based on difficulty meter average. */
359343
enum RankingCategory
360344
{

src/GameLoop.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "ThemeManager.h"
1313
#include "SongManager.h"
1414
#include "GameState.h"
15-
#include "MemoryCardManager.h"
1615
#include "ScreenManager.h"
1716
#include "InputFilter.h"
1817
#include "InputMapper.h"
@@ -293,7 +292,6 @@ void GameLoop::RunGameLoop()
293292
TEXTUREMAN->Update( fDeltaTime );
294293
GAMESTATE->Update( fDeltaTime );
295294
SCREENMAN->Update( fDeltaTime );
296-
MEMCARDMAN->Update();
297295
NSMAN->Update( fDeltaTime );
298296

299297
/* Important: Process input AFTER updating game logic, or input will be

src/GameState.cpp

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "HighScore.h"
1818
#include "LuaReference.h"
1919
#include "MessageManager.h"
20-
#include "MemoryCardManager.h"
2120
#include "NoteData.h"
2221
#include "NoteSkinManager.h"
2322
#include "PlayerState.h"
@@ -283,8 +282,7 @@ void GameState::Reset()
283282
SetCurrentStyle( NULL, PLAYER_INVALID );
284283
FOREACH_MultiPlayer( p )
285284
m_MultiPlayerStatus[p] = MultiPlayerStatus_NotJoined;
286-
FOREACH_PlayerNumber( pn )
287-
MEMCARDMAN->UnlockCard( pn );
285+
288286
//m_iCoins = 0; // don't reset coin count!
289287
m_bMultiplayer = false;
290288
m_iNumMultiplayerNoteFields = 1;
@@ -554,36 +552,21 @@ void GameState::BeginGame()
554552
// Play attract on the ending screen, then on the ranking screen
555553
// even if attract sounds are set to off.
556554
m_iNumTimesThroughAttract = -1;
557-
558-
FOREACH_PlayerNumber( pn )
559-
MEMCARDMAN->UnlockCard( pn );
560555
}
561556

562557
void GameState::LoadProfiles( bool bLoadEdits )
563558
{
564-
// Unlock any cards that we might want to load.
565-
FOREACH_HumanPlayer( pn )
566-
if( !PROFILEMAN->IsPersistentProfile(pn) )
567-
MEMCARDMAN->UnlockCard( pn );
568-
569-
MEMCARDMAN->WaitForCheckingToComplete();
570-
571559
FOREACH_HumanPlayer( pn )
572560
{
573561
// If a profile is already loaded, this was already called.
574562
if( PROFILEMAN->IsPersistentProfile(pn) )
575563
continue;
576564

577-
MEMCARDMAN->MountCard( pn );
578565
bool bSuccess = PROFILEMAN->LoadFirstAvailableProfile( pn, bLoadEdits ); // load full profile
579-
MEMCARDMAN->UnmountCard( pn );
580566

581567
if( !bSuccess )
582568
continue;
583569

584-
// Lock the card on successful load, so we won't allow it to be changed.
585-
MEMCARDMAN->LockCard( pn );
586-
587570
LoadCurrentSettingsFromProfile( pn );
588571

589572
Profile* pPlayerProfile = PROFILEMAN->GetProfile( pn );
@@ -609,12 +592,7 @@ void GameState::SavePlayerProfile( PlayerNumber pn )
609592
if( m_pPlayerState[pn]->m_PlayerController != PC_HUMAN )
610593
return;
611594

612-
bool bWasMemoryCard = PROFILEMAN->ProfileWasLoadedFromMemoryCard(pn);
613-
if( bWasMemoryCard )
614-
MEMCARDMAN->MountCard( pn );
615595
PROFILEMAN->SaveProfile( pn );
616-
if( bWasMemoryCard )
617-
MEMCARDMAN->UnmountCard( pn );
618596
}
619597

620598
bool GameState::HaveProfileToLoad()
@@ -625,9 +603,6 @@ bool GameState::HaveProfileToLoad()
625603
if( PROFILEMAN->IsPersistentProfile(pn) )
626604
continue;
627605

628-
// If a memory card is inserted, we'l try to load it.
629-
if( MEMCARDMAN->CardInserted(pn) )
630-
return true;
631606
if( !PROFILEMAN->m_sDefaultLocalProfileID[pn].Get().empty() )
632607
return true;
633608
}
@@ -2482,17 +2457,6 @@ class LunaGameState: public Luna<GameState>
24822457
LuaHelpers::Push( L, pStyle );
24832458
return 1;
24842459
}
2485-
static int IsAnyHumanPlayerUsingMemoryCard( T* , lua_State *L )
2486-
{
2487-
bool bUsingMemoryCard = false;
2488-
FOREACH_HumanPlayer( pn )
2489-
{
2490-
if( MEMCARDMAN->GetCardState(pn) == MemoryCardState_Ready )
2491-
bUsingMemoryCard = true;
2492-
}
2493-
lua_pushboolean(L, bUsingMemoryCard );
2494-
return 1;
2495-
}
24962460
static int GetNumStagesForCurrentSongAndStepsOrCourse( T* , lua_State *L )
24972461
{
24982462
lua_pushnumber(L, GAMESTATE->GetNumStagesForCurrentSongAndStepsOrCourse() );
@@ -2813,7 +2777,6 @@ class LunaGameState: public Luna<GameState>
28132777
ADD_METHOD( GetHumanPlayers );
28142778
ADD_METHOD( GetEnabledPlayers );
28152779
ADD_METHOD( GetCurrentStyle );
2816-
ADD_METHOD( IsAnyHumanPlayerUsingMemoryCard );
28172780
ADD_METHOD( GetNumStagesForCurrentSongAndStepsOrCourse );
28182781
ADD_METHOD( GetNumStagesLeft );
28192782
ADD_METHOD( GetGameSeed );

src/MemoryCardDisplay.cpp

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +0,0 @@
1-
#include "global.h"
2-
#include "MemoryCardDisplay.h"
3-
#include "ThemeManager.h"
4-
#include "MemoryCardManager.h"
5-
#include "RageUtil.h"
6-
#include "XmlFile.h"
7-
#include "ActorUtil.h"
8-
9-
REGISTER_ACTOR_CLASS( MemoryCardDisplay );
10-
11-
MemoryCardDisplay::MemoryCardDisplay()
12-
{
13-
m_PlayerNumber = PLAYER_INVALID;
14-
m_LastSeenState = MemoryCardState_Invalid;
15-
}
16-
17-
void MemoryCardDisplay::Load( PlayerNumber pn )
18-
{
19-
m_PlayerNumber = pn;
20-
21-
for( int i=0; i<NUM_MemoryCardState; i++ )
22-
{
23-
MemoryCardState mcs = (MemoryCardState)i;
24-
RString sState = MemoryCardStateToString(mcs);
25-
m_spr[i].Load( THEME->GetPathG("MemoryCardDisplay",ssprintf("%s p%d",sState.c_str(),pn+1)) );
26-
m_spr[i].SetVisible( false );
27-
this->AddChild( &m_spr[i] );
28-
}
29-
}
30-
31-
void MemoryCardDisplay::LoadFromNode( const XNode* pNode )
32-
{
33-
Lua *L = LUA->Get();
34-
pNode->PushAttrValue( L, "PlayerNumber" );
35-
PlayerNumber pn;
36-
LuaHelpers::Pop( L, pn );
37-
LUA->Release(L);
38-
39-
Load( pn );
40-
41-
ActorFrame::LoadFromNode( pNode );
42-
}
43-
44-
void MemoryCardDisplay::Update( float fDelta )
45-
{
46-
MemoryCardState newMcs = MEMCARDMAN->GetCardState(m_PlayerNumber);
47-
if( m_LastSeenState != newMcs )
48-
{
49-
if( m_LastSeenState != MemoryCardState_Invalid )
50-
m_spr[m_LastSeenState].SetVisible( false );
51-
m_LastSeenState = newMcs;
52-
m_spr[m_LastSeenState].SetVisible( true );
53-
}
54-
55-
ActorFrame::Update( fDelta );
56-
}
57-
58-
/*
59-
* (c) 2003 Chris Danford
60-
* All rights reserved.
61-
*
62-
* Permission is hereby granted, free of charge, to any person obtaining a
63-
* copy of this software and associated documentation files (the
64-
* "Software"), to deal in the Software without restriction, including
65-
* without limitation the rights to use, copy, modify, merge, publish,
66-
* distribute, and/or sell copies of the Software, and to permit persons to
67-
* whom the Software is furnished to do so, provided that the above
68-
* copyright notice(s) and this permission notice appear in all copies of
69-
* the Software and that both the above copyright notice(s) and this
70-
* permission notice appear in supporting documentation.
71-
*
72-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
73-
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
74-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
75-
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
76-
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
77-
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
78-
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
79-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
80-
* PERFORMANCE OF THIS SOFTWARE.
81-
*/

src/MemoryCardDisplay.h

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +0,0 @@
1-
#ifndef MEMORY_CARD_DISPLAY_H
2-
#define MEMORY_CARD_DISPLAY_H
3-
4-
#include "GameConstantsAndTypes.h"
5-
#include "PlayerNumber.h"
6-
#include "Sprite.h"
7-
#include "ActorFrame.h"
8-
/** @brief A graphic displaying the state of memory cards. */
9-
class MemoryCardDisplay : public ActorFrame
10-
{
11-
public:
12-
MemoryCardDisplay();
13-
void Load( PlayerNumber pn );
14-
void LoadFromNode( const XNode* pNode );
15-
virtual MemoryCardDisplay *Copy() const;
16-
void Update( float fDelta );
17-
18-
protected:
19-
PlayerNumber m_PlayerNumber;
20-
MemoryCardState m_LastSeenState;
21-
// todo: make this an AutoActor eventually -aj
22-
Sprite m_spr[NUM_MemoryCardState];
23-
};
24-
25-
#endif
26-
27-
/*
28-
* (c) 2003 Chris Danford
29-
* All rights reserved.
30-
*
31-
* Permission is hereby granted, free of charge, to any person obtaining a
32-
* copy of this software and associated documentation files (the
33-
* "Software"), to deal in the Software without restriction, including
34-
* without limitation the rights to use, copy, modify, merge, publish,
35-
* distribute, and/or sell copies of the Software, and to permit persons to
36-
* whom the Software is furnished to do so, provided that the above
37-
* copyright notice(s) and this permission notice appear in all copies of
38-
* the Software and that both the above copyright notice(s) and this
39-
* permission notice appear in supporting documentation.
40-
*
41-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
42-
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
44-
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
45-
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
46-
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
47-
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
48-
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
49-
* PERFORMANCE OF THIS SOFTWARE.
50-
*/

0 commit comments

Comments
 (0)