Update of /cvsroot/opentnl/tnl/zap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2429/zap
Modified Files:
CTFGame.cpp UIGame.cpp UIMenus.cpp UIMenus.h game.h
gameType.cpp gameType.h sfx.cpp sfx.h soccerGame.cpp
Log Message:
Added rendering of currently talking players' names
Updated version # to 1.2 rc 1
Added an enable voice echo option to the options menu
Index: gameType.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** gameType.cpp 7 May 2004 22:59:11 -0000 1.20
--- gameType.cpp 8 May 2004 00:03:51 -0000 1.21
***************
*** 168,171 ****
--- 168,177 ----
}
}
+ renderTimeLeft();
+ renderTalkingClients();
+ }
+
+ void GameType::renderTimeLeft()
+ {
glColor3f(1,1,1);
U32 timeLeft = mGameTimer.getCurrent();
***************
*** 176,179 ****
--- 182,200 ----
}
+ void GameType::renderTalkingClients()
+ {
+ S32 y = 150;
+ for(S32 i = 0; i < mClientList.size(); i++)
+ {
+ if(mClientList[i].voiceSFX->isPlaying())
+ {
+ Color teamColor = mTeams[mClientList[i].teamId].color;
+ glColor3f(teamColor.r, teamColor.g, teamColor.b);
+ UserInterface::drawString(10, y, 20, mClientList[i].name.getString());
+ y += 25;
+ }
+ }
+ }
+
void GameType::gameOverManGameOver()
{
***************
*** 580,584 ****
}
! TNL_IMPLEMENT_NETOBJECT_RPC(GameType, c2sVoiceChat, (ByteBufferRef voiceBuffer),
NetClassGroupGameMask, RPCUnguaranteed, RPCToGhostParent, 0)
{
--- 601,605 ----
}
! TNL_IMPLEMENT_NETOBJECT_RPC(GameType, c2sVoiceChat, (bool echo, ByteBufferRef voiceBuffer),
NetClassGroupGameMask, RPCUnguaranteed, RPCToGhostParent, 0)
{
***************
*** 589,593 ****
S32 clientIndex = findClientIndexByConnection(source);
if(clientIndex != -1)
! s2cVoiceChat(mClientList[clientIndex].name, voiceBuffer);
}
--- 610,621 ----
S32 clientIndex = findClientIndexByConnection(source);
if(clientIndex != -1)
! {
! RefPtr<NetEvent> event = TNL_RPC_CONSTRUCT_NETEVENT(this, s2cVoiceChat, (mClientList[clientIndex].name, voiceBuffer));
! for(S32 i = 0; i < mClientList.size(); i++)
! {
! if((i != clientIndex || echo) && mClientList[i].clientConnection)
! mClientList[i].clientConnection->postNetEvent(event);
! }
! }
}
***************
*** 611,615 ****
}
! logprintf("Decoded buffer size %d", playBuffer->getBufferSize());
mClientList[clientIndex].voiceSFX->queueBuffer(playBuffer);
}
--- 639,643 ----
}
! //logprintf("Decoded buffer size %d", playBuffer->getBufferSize());
mClientList[clientIndex].voiceSFX->queueBuffer(playBuffer);
}
Index: soccerGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/soccerGame.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** soccerGame.cpp 6 May 2004 00:33:39 -0000 1.4
--- soccerGame.cpp 8 May 2004 00:03:51 -0000 1.5
***************
*** 125,134 ****
}
}
! glColor3f(1,1,1);
! U32 timeLeft = mGameTimer.getCurrent();
!
! U32 minsRemaining = timeLeft / (60000);
! U32 secsRemaining = (timeLeft - (minsRemaining * 60000)) / 1000;
! UserInterface::drawStringf(720, 577, 20, "%02d:%02d", minsRemaining, secsRemaining);
}
--- 125,130 ----
}
}
! renderTimeLeft();
! renderTalkingClients();
}
Index: UIMenus.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** UIMenus.h 27 Apr 2004 21:43:04 -0000 1.6
--- UIMenus.h 8 May 2004 00:03:51 -0000 1.7
***************
*** 81,84 ****
--- 81,85 ----
static bool fullscreen;
static bool joystickEnabled;
+ static bool echoVoice;
OptionsMenuUserInterface();
Index: gameType.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** gameType.h 7 May 2004 22:21:13 -0000 1.10
--- gameType.h 8 May 2004 00:03:51 -0000 1.11
***************
*** 124,127 ****
--- 124,129 ----
virtual void renderInterfaceOverlay(bool scoreboardVisible);
+ void renderTimeLeft();
+ void renderTalkingClients();
virtual void updateClientScoreboard(S32 clientIndex);
***************
*** 146,150 ****
TNL_DECLARE_RPC(c2sRequestScoreboardUpdates, (bool updates));
! TNL_DECLARE_RPC(c2sVoiceChat, (ByteBufferRef compressedVoice));
TNL_DECLARE_RPC(s2cVoiceChat, (StringTableEntryRef client, ByteBufferRef compressedVoice));
--- 148,152 ----
TNL_DECLARE_RPC(c2sRequestScoreboardUpdates, (bool updates));
! TNL_DECLARE_RPC(c2sVoiceChat, (bool echo, ByteBufferRef compressedVoice));
TNL_DECLARE_RPC(s2cVoiceChat, (StringTableEntryRef client, ByteBufferRef compressedVoice));
Index: sfx.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** sfx.cpp 7 May 2004 22:21:13 -0000 1.14
--- sfx.cpp 8 May 2004 00:03:51 -0000 1.15
***************
*** 111,115 ****
DWORD count2;
! printf("Capturing samples... %d ... %d\n", lastReadOffset, readPosition);
if(!byteCount)
--- 111,115 ----
DWORD count2;
! //printf("Capturing samples... %d ... %d\n", lastReadOffset, readPosition);
if(!byteCount)
***************
*** 319,323 ****
ALuint buffer;
alSourceUnqueueBuffers(gSources[sourceIndex], 1, &buffer);
! logprintf("unqueued buffer %d\n", buffer);
processed--;
--- 319,323 ----
ALuint buffer;
alSourceUnqueueBuffers(gSources[sourceIndex], 1, &buffer);
! //logprintf("unqueued buffer %d\n", buffer);
processed--;
***************
*** 355,359 ****
}
! logprintf("queued buffer %d - %d max %d len\n", buffer, max, mInitialBuffer->getBufferSize());
alBufferData(buffer, AL_FORMAT_MONO16, mInitialBuffer->getBuffer(),
mInitialBuffer->getBufferSize(), 8000);
--- 355,359 ----
}
! //logprintf("queued buffer %d - %d max %d len\n", buffer, max, mInitialBuffer->getBufferSize());
alBufferData(buffer, AL_FORMAT_MONO16, mInitialBuffer->getBuffer(),
mInitialBuffer->getBufferSize(), 8000);
Index: UIMenus.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** UIMenus.cpp 30 Apr 2004 06:57:39 -0000 1.9
--- UIMenus.cpp 8 May 2004 00:03:51 -0000 1.10
***************
*** 175,178 ****
--- 175,179 ----
bool OptionsMenuUserInterface::fullscreen = false;
bool OptionsMenuUserInterface::joystickEnabled = false;
+ bool OptionsMenuUserInterface::echoVoice = false;
OptionsMenuUserInterface::OptionsMenuUserInterface()
***************
*** 206,209 ****
--- 207,215 ----
menuItems.push_back("ENABLE JOYSTICK/CONTROLLER");
+ if(echoVoice)
+ menuItems.push_back("DISABLE VOICE ECHO");
+ else
+ menuItems.push_back("ENABLE VOICE ECHO");
+
if(gClientGame->getConnectionToServer())
menuItems.push_back("RETURN TO GAME");
***************
*** 253,256 ****
--- 259,265 ----
break;
case 3:
+ echoVoice = !echoVoice;
+ break;
+ case 4:
if(gClientGame->getConnectionToServer())
gGameUserInterface.activate();
Index: game.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/game.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** game.h 4 May 2004 18:24:51 -0000 1.14
--- game.h 8 May 2004 00:03:51 -0000 1.15
***************
*** 213,217 ****
extern void endGame();
! #define ZAP_GAME_STRING "ZAP 1.1.4"
};
--- 213,217 ----
extern void endGame();
! #define ZAP_GAME_STRING "ZAP 1.2.0 rc 1"
};
Index: UIGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** UIGame.cpp 7 May 2004 22:21:13 -0000 1.19
--- UIGame.cpp 8 May 2004 00:03:51 -0000 1.20
***************
*** 243,253 ****
if(mRecordingAudio)
{
glColor3f(1, 1 ,1);
! glBegin(GL_POLYGON);
! glVertex2f(10, 600);
! glVertex2f(30, 600);
! F32 y = 600 - F32(mMaxAudioSample) * 600 / F32(0x7FFF);
! glVertex2f(30, y);
! glVertex2f(10, y);
glEnd();
}
--- 243,262 ----
if(mRecordingAudio)
{
+ F32 amt = mMaxAudioSample / F32(0x7FFF);
+ U32 totalLineCount = 50;
+
glColor3f(1, 1 ,1);
! glBegin(GL_LINES);
! glVertex2f(10, 130);
! glVertex2f(10, 145);
! glVertex2f(10 + totalLineCount * 2, 130);
! glVertex2f(10 + totalLineCount * 2, 145);
! glColor3f(0.8, 0.8, 0.8);
!
! for(U32 i = 1; i < amt * totalLineCount; i++)
! {
! glVertex2f(10 + i * 2, 130);
! glVertex2f(10 + i * 2, 145);
! }
glEnd();
}
***************
*** 575,583 ****
ByteBuffer sendBuffer(codingBuffer, len);
! logprintf("Encoded %d samples in %d bytes", useCount, len);
GameType *gt = gClientGame->getGameType();
if(gt)
! gt->c2sVoiceChat(sendBuffer);
}
}
--- 584,592 ----
ByteBuffer sendBuffer(codingBuffer, len);
! //logprintf("Encoded %d samples in %d bytes", useCount, len);
GameType *gt = gClientGame->getGameType();
if(gt)
! gt->c2sVoiceChat(OptionsMenuUserInterface::echoVoice, sendBuffer);
}
}
Index: sfx.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/sfx.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** sfx.h 7 May 2004 22:21:13 -0000 1.9
--- sfx.h 8 May 2004 00:03:51 -0000 1.10
***************
*** 97,100 ****
--- 97,101 ----
void setMovementParams(Point position, Point velocity);
void queueBuffer(ByteBufferPtr b);
+ bool isPlaying() { return mSourceIndex != -1; }
static bool startRecording();
Index: CTFGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** CTFGame.cpp 6 May 2004 00:33:39 -0000 1.21
--- CTFGame.cpp 8 May 2004 00:03:50 -0000 1.22
***************
*** 147,156 ****
}
}
! glColor3f(1,1,1);
! U32 timeLeft = mGameTimer.getCurrent();
!
! U32 minsRemaining = timeLeft / (60000);
! U32 secsRemaining = (timeLeft - (minsRemaining * 60000)) / 1000;
! UserInterface::drawStringf(720, 577, 20, "%02d:%02d", minsRemaining, secsRemaining);
}
--- 147,152 ----
}
}
! renderTimeLeft();
! renderTalkingClients();
}
|