Revision: 9713
http://armagetronad.svn.sourceforge.net/armagetronad/?rev=9713&view=rev
Author: z-man
Date: 2011-08-22 11:12:25 +0000 (Mon, 22 Aug 2011)
Log Message:
-----------
Merging gcc 4.x fixes, mostly just warnings about unread variables, plus
- custom camera using wrong turn speed (affected everyone)
- string read operator leaving stream in an error state if EOF is encountered (only affected gcc 4.x)
Modified Paths:
--------------
armagetronad/branches/0.2.8/armagetronad/src/engine/eCamera.cpp
armagetronad/branches/0.2.8/armagetronad/src/network/nNetwork.cpp
armagetronad/branches/0.2.8/armagetronad/src/network/nServerInfo.cpp
armagetronad/branches/0.2.8/armagetronad/src/tools/tConfiguration.cpp
armagetronad/branches/0.2.8/armagetronad/src/tools/tString.cpp
armagetronad/branches/0.2.8/armagetronad/src/tools/tSysTime.cpp
armagetronad/branches/0.2.8/armagetronad/src/tron/gAIBase.cpp
armagetronad/branches/0.2.8/armagetronad/src/tron/gCamera.cpp
armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp
armagetronad/branches/0.2.8/armagetronad/src/tron/gCycleMovement.cpp
armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp
armagetronad/branches/0.2.8/armagetronad/src/tron/gHud.cpp
armagetronad/branches/0.2.8/armagetronad/src/tron/gParser.cpp
Property Changed:
----------------
armagetronad/branches/0.2.8/
armagetronad/branches/0.2.8/armagetronad/
Property changes on: armagetronad/branches/0.2.8
___________________________________________________________________
Added: svn:mergeinfo
+ /armagetronad/branches/0.2.8.3:9309-9712
Property changes on: armagetronad/branches/0.2.8/armagetronad
___________________________________________________________________
Modified: svn:mergeinfo
- /armagetronad/branches/0.2.8.3/armagetronad:9309-9696
/armagetronad/tags/0.2.8.3/armagetronad:9309-9313
+ /armagetronad/branches/0.2.8.3/armagetronad:9309-9712
/armagetronad/tags/0.2.8.3/armagetronad:9309-9313
Modified: armagetronad/branches/0.2.8/armagetronad/src/engine/eCamera.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/engine/eCamera.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/engine/eCamera.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -1769,7 +1769,7 @@
if ( Center() && wrongDirection > 0 )
{
// if so, turn to the side using the last driving direction
- newdir = newdir + Center()->LastDirection()*(wrongDirection*ts*turnSpeed*s_customTurnSpeed180);
+ newdir = newdir + Center()->LastDirection()*(wrongDirection*ts*turnSpeed*customTurnSpeed180);
}
}
else
Modified: armagetronad/branches/0.2.8/armagetronad/src/network/nNetwork.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/network/nNetwork.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/network/nNetwork.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -820,19 +820,21 @@
}
void nWaitForAck::Ackt(unsigned short id,unsigned short peer){
+#ifdef DEBUG_X
int success=0;
+#endif
for(int i=sn_pendingAcks.Len()-1;i>=0;i--){
nWaitForAck * ack = sn_pendingAcks(i);
if (ack->message->MessageID()==id &&
ack->receiver==peer){
- success=1;
-
#ifdef DEBUG
// if (sn_pendingAcks(i)->message == sn_WatchMessage)
// st_Breakpoint();
#endif
#ifdef DEBUG_X
+ success=1;
+
if (ack->message->descriptor>1)
con << "AT " << ack->message->descriptor << '\n';
#endif
Modified: armagetronad/branches/0.2.8/armagetronad/src/network/nServerInfo.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/network/nServerInfo.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/network/nServerInfo.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -1791,15 +1791,15 @@
// don't reinitialize the network system
nSocketResetInhibitor inhibitor;
- static unsigned int lastPort = 0;
+ // static unsigned int lastPort = 0;
// enter server state so we know our true port number
sn_SetNetState(nSERVER);
- unsigned int port = sn_GetServerPort();
+ // unsigned int port = sn_GetServerPort();
//if (port == lastPort)
// return; // the master already knows about us
- lastPort = port;
+ // lastPort = port;
// sn_SetNetState(nSTANDALONE);
Modified: armagetronad/branches/0.2.8/armagetronad/src/tools/tConfiguration.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tools/tConfiguration.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tools/tConfiguration.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -450,7 +450,10 @@
!s.eof())
c=s.get();
- s.putback(c);
+ if( s.good() )
+ {
+ s.putback(c);
+ }
return c;
}
Modified: armagetronad/branches/0.2.8/armagetronad/src/tools/tString.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tools/tString.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tools/tString.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -109,8 +109,10 @@
{
char c2 = '\0';
bool ret = st_ReadEscapeSequence( c, c2, s );
- if ( c2 )
+ if ( c2 && s.good() )
+ {
s.putback( c2 );
+ }
return ret;
}
@@ -123,7 +125,10 @@
while(c!='\n' && c!='\r' && isblank(c) && s.good() && !s.eof()){
c=s.get();
}
- s.putback(c);
+ if(s.good())
+ {
+ s.putback(c);
+ }
c='x';
@@ -269,7 +274,10 @@
// lastEscape = thisEscape;
}
- s.putback(c);
+ if(s.good())
+ {
+ s.putback(c);
+ }
x[i]='\0';
return s;
}
Modified: armagetronad/branches/0.2.8/armagetronad/src/tools/tSysTime.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tools/tSysTime.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tools/tSysTime.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -276,12 +276,13 @@
relative = newRelative;
}
-
+#ifdef DEBUG
if ( relative.seconds > 20 )
{
int x;
x = 0;
}
+#endif
}
static bool s_delayedInPlayback = false;
Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gAIBase.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tron/gAIBase.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tron/gAIBase.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -2301,7 +2301,7 @@
if (character->properties[AI_ENEMY] > 7)
{
// would he be able to trap us if we drive straight on?
- bool trap[2] = {false, false};
+ // bool trap[2] = {false, false};
if (!isTrapped)
for (i = 1; i>=0; i--)
@@ -2324,7 +2324,7 @@
if (loop)
if (winding * (i+i-1) < 0)
{
- trap[i] = true;
+ // trap[i] = true;
REAL x = enemypos.x * (i+i-1);
REAL y = enemypos.y;
Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gCamera.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tron/gCamera.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tron/gCamera.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -47,8 +47,10 @@
gCamera::~gCamera(){
+#ifdef DEBUG
int x;
x =0;
+#endif
}
eCoord gCamera::CenterCycleDir(){
Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -2823,11 +2823,13 @@
// lets a value decay smoothly
static void DecaySmooth( REAL& smooth, REAL relSpeed, REAL minSpeed, REAL clamp )
{
+#ifdef DEBUG
if ( fabs(smooth) > .01 )
{
int x;
x = 1;
}
+#endif
// increase correction speed if the value is out of bounds
if ( clamp > 0 )
@@ -2880,7 +2882,7 @@
if (!finite(skewDot))
skewDot=0;
- eCoord oldpos=pos;
+ // eCoord oldpos=pos;
REAL ts=(currentTime-lastTime);
@@ -4965,11 +4967,13 @@
if ( sg_verletIntegration.Supported() )
speed = Speed();
+#ifdef DEBUG
if ( speed > 15 )
{
int x;
x = 0;
}
+#endif
m << speed;
m << short( Alive() ? 1 : 0 );
@@ -5094,7 +5098,9 @@
{
tASSERT( extrapolator_ );
+#ifdef DEBUG
eCoord posBefore = extrapolator_->Position();
+#endif
// calculate target time
REAL newTime = extrapolator_->LastTime() + dt;
@@ -5145,7 +5151,7 @@
void se_SanifyDisplacement( eGameObject* base, eCoord& displacement )
{
eCoord base_pos = base->Position();
- eCoord reachable_pos = base->Position() + displacement;
+ // eCoord reachable_pos = base->Position() + displacement;
int timeout = 5;
while( timeout > 0 )
@@ -5295,7 +5301,7 @@
short sync_alive; // is this cycle alive?
unsigned short sync_wall=0; // ID of wall
- eCoord new_pos = pos; // the extrapolated position
+ // eCoord new_pos = pos; // the extrapolated position
// warning: depends on the implementation of eNetGameObject::WriteSync
// since we don't call eNetGameObject::ReadSync.
Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gCycleMovement.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tron/gCycleMovement.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tron/gCycleMovement.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -2216,7 +2216,7 @@
dist_to_dest = distToWall;
}
- static bool breakp = false;
+ // static bool breakp = false;
// the time left until the turn happened on the client
// REAL timeLeft = currentDestination->GetGameTime() - lastTime;
@@ -2503,7 +2503,7 @@
while (currentDestination && currentDestination->hasBeenUsed)
{
- breakp = false;
+ // breakp = false;
currentDestination = currentDestination->next;
}
}
@@ -2785,10 +2785,10 @@
void gCycleMovement::CopyFrom( const gCycleMovement & other )
{
+#ifdef DEBUG_X
// calculate position update
eCoord posUpdate = other.Position() - this->Position();
-#ifdef DEBUG_X
// only update direction if the positions are out of sync
REAL lag = 1;
if ( player )
@@ -3611,7 +3611,7 @@
bool gCycleMovement::TimestepCore( REAL currentTime, bool calculateAcceleration )
{
- eCoord oldpos=pos;
+ // eCoord oldpos=pos;
REAL lastSpeed=verletSpeed_;
REAL ts=(currentTime-lastTime);
Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -3659,9 +3659,9 @@
int ai_alive=0;
int human_teams=0;
int teams_alive=0;
- int last_alive=-1;
+ // int last_alive=-1;
int last_team_alive=-1;
- int last_alive_and_not_disconnected=-1;
+ // int last_alive_and_not_disconnected=-1;
int humans = 0;
int active_humans = 0;
int ais = 0;
@@ -3703,14 +3703,14 @@
alive++;
if (p->IsActive())
{
- last_alive_and_not_disconnected=i;
+ // last_alive_and_not_disconnected=i;
alive_and_not_disconnected++;
}
}
else
ai_alive++;
- last_alive=i;
+ // last_alive=i;
}
else
{
@@ -3748,9 +3748,10 @@
goon = false;
#endif
-
+ /*
if (last_alive_and_not_disconnected >= 0)
last_alive = last_alive_and_not_disconnected;
+ */
// kill all disconnected players if they are the only reason the round goes on:
if ( alive_and_not_disconnected <= 1 && alive > alive_and_not_disconnected )
Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gHud.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tron/gHud.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tron/gHud.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -309,7 +309,7 @@
if(subby_ShowHUD){
// static int max=0,lastmax=0;
// static int imax=-1,lastimax=0;
- static REAL imax=-1;
+ // static REAL imax=-1;
char fasteststring[50];
// REAL distance;
static float maxmeterspeed= 50;
@@ -317,11 +317,11 @@
static REAL max=max_player_speed;
static tString name;
static tString ultiname;
- static bool wrotefastest = false;
- static bool wrote10 =false;
+ // static bool wrotefastest = false;
+ // static bool wrote10 =false;
static bool belowzero=false;
static REAL ultimax=0;
- static REAL timelast;
+ // static REAL timelast;
static REAL myscore, topscore;
// tString realname = ePlayer::PlayerConfig(0)->Name();
@@ -346,10 +346,10 @@
// con << "testcon";
// sn_CenterMessage(message);
}else{
- timelast = se_GameTime();
+ // timelast = se_GameTime();
max=0;
- wrotefastest = false;
- wrote10 =false;
+ // wrotefastest = false;
+ // wrote10 =false;
}
}else if(se_GameTime()>0&&belowzero){
belowzero=false;
@@ -372,7 +372,7 @@
if (h->Speed()>max){
max = (float) h->Speed(); // changed to float for more accuracy in reporting top speed
name = p->GetName();
- imax = i;
+ // imax = i;
}
if( h->Speed()>ultimax){
Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gParser.cpp
===================================================================
--- armagetronad/branches/0.2.8/armagetronad/src/tron/gParser.cpp 2011-08-22 10:52:23 UTC (rev 9712)
+++ armagetronad/branches/0.2.8/armagetronad/src/tron/gParser.cpp 2011-08-22 11:12:25 UTC (rev 9713)
@@ -570,7 +570,10 @@
gParser::parseWall(eGrid *grid, xmlNodePtr cur, const xmlChar * keyword)
{
ePoint *R = NULL, *sR = NULL;
- REAL ox, oy, x, y;
+#ifdef DEBUG
+ REAL ox, oy;
+#endif
+ REAL x, y;
REAL height = myxmlGetPropFloat(cur, "height");
if ( height <= 0 )
@@ -614,7 +617,10 @@
parseAlternativeContent(grid, cur);
}
}
- cur = cur->next; ox = x; oy = y;
+ cur = cur->next;
+#ifdef DEBUG
+ ox = x; oy = y;
+#endif
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|