Added changing of DifficultyIcons

This commit is contained in:
Charles Lohr
2004-09-01 17:16:01 +00:00
parent 3769a40848
commit 9957b840b4
3 changed files with 19 additions and 1 deletions
+15 -1
View File
@@ -347,6 +347,18 @@ void NetworkSyncManager::StartRequest(short position)
ctr = uint8_t(ctr+tSteps->GetMeter());
m_packet.Write1(ctr);
ctr=0;
tSteps = GAMESTATE->m_pCurSteps[PLAYER_1];
if ((tSteps!=NULL) && (GAMESTATE->IsPlayerEnabled(PLAYER_1)))
ctr = uint8_t(ctr + (int) tSteps->GetDifficulty()*16);
tSteps = GAMESTATE->m_pCurSteps[PLAYER_2];
if ((tSteps!=NULL) && (GAMESTATE->IsPlayerEnabled(PLAYER_2)))
ctr = uint8_t(ctr + (int) tSteps->GetDifficulty());
m_packet.Write1(ctr);
//Notify server if this is for sync or not.
ctr = char(position*16);
@@ -384,11 +396,11 @@ void NetworkSyncManager::StartRequest(short position)
{
m_EvalPlayerData[i].grade=0;
m_EvalPlayerData[i].score=0;
m_EvalPlayerData[i].difficulty=(Difficulty)0;
for (int j=0;j<NETNUMTAPSCORES;j++)
m_EvalPlayerData[i].tapScores[j] = 0;
}
//Block until go is recieved.
//Switch to blocking mode (this is the only
//way I know how to get precievably instantanious results
@@ -507,6 +519,8 @@ void NetworkSyncManager::ProcessInput()
m_EvalPlayerData[i].score = m_packet.Read4();
for (int i=0;i<PlayersInPack;i++)
m_EvalPlayerData[i].grade = m_packet.Read1();
for (int i=0;i<PlayersInPack;i++)
m_EvalPlayerData[i].difficulty = (Difficulty) m_packet.Read1();
for (int j=0;j<NETNUMTAPSCORES;j++)
for (int i=0;i<PlayersInPack;i++)
m_EvalPlayerData[i].tapScores[j] = m_packet.Read2();
+2
View File
@@ -4,6 +4,7 @@
#define NetworkSyncManager_H
#include "PlayerNumber.h"
#include "Difficulty.h"
class LoadingWindow;
@@ -16,6 +17,7 @@ struct EndOfGame_PlayerData
{
int score;
int grade;
Difficulty difficulty;
int tapScores[NETNUMTAPSCORES]; //This will be a const soon enough
};
+2
View File
@@ -98,6 +98,8 @@ void ScreenNetEvaluation::UpdateStats()
m_textScore[m_pActivePlayer].SetText( ssprintf("%*.0i", NUM_SCORE_DIGITS, NSMAN->m_EvalPlayerData[m_iCurrentPlayer].score) );
m_DifficultyIcon[m_pActivePlayer].SetFromDifficulty( m_pActivePlayer, NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty );
for (int j=0;j<NETNUMTAPSCORES;j++)
m_textJudgeNumbers[j][m_pActivePlayer].SetText( ssprintf( "%d", NSMAN->m_EvalPlayerData[m_iCurrentPlayer].tapScores[j] ) );
}