Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9406 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Jul 24, 2006, 11:09:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

Location:
trunk/src/util
Files:
18 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/util/Makefile.am

    r8068 r9406  
    1414                        singleplayer_shootemup.cc \
    1515                        \
     16                        \
     17                        \
    1618                        mission_goal.cc\
    1719                        kill_target.cc\
     
    2426                        animation/animation_player.cc \
    2527                        \
    26                         track/pilot_node.cc
     28                        track/pilot_node.cc \
     29                        \
     30                        network_stats_widget.cc
    2731
    2832#                       track/track_manager.cc \
     
    5054                        animation/t_animation.h \
    5155                        \
    52                         track/pilot_node.h
     56                        track/pilot_node.h \
     57                        \
     58                        network_stats_widget.h
     59
    5360
    5461#                       track/track_manager.h \
  • trunk/src/util/animation/animation3d.cc

    r5115 r9406  
    2525#include "p_node.h"
    2626
    27 using namespace std;
     27
    2828
    2929/**
  • trunk/src/util/animation/animation_player.cc

    r5777 r9406  
    2020#include "compiler.h"
    2121
    22 using namespace std;
     22
    2323
    2424
     
    100100  {
    101101      // iterate through all the animations and tick them.
    102     list<Animation*>::iterator anim;
     102    std::list<Animation*>::iterator anim;
    103103    for (anim = this->animationList.begin(); anim != this->animationList.end(); anim++)
    104104    {
     
    135135Animation* AnimationPlayer::getAnimationFromBaseObject(const BaseObject* baseObject) const
    136136{
    137   list<Animation*>::const_iterator anim;
     137  std::list<Animation*>::const_iterator anim;
    138138  for (anim = this->animationList.begin(); anim != this->animationList.end(); anim++)
    139139    if((*anim)->getBaseObject() == baseObject)
     
    156156  PRINT(0)("-Animation Information---------------+\n");
    157157  // Per ANIMATION DEBUG
    158   list<Animation*>::iterator anim;
     158  std::list<Animation*>::iterator anim;
    159159  for (anim = this->animationList.begin(); anim != this->animationList.end(); anim++)
    160160    {
  • trunk/src/util/fast_factory.cc

    r8350 r9406  
    2121#include <string.h>
    2222
    23 using namespace std;
     23
    2424
    2525/**
     
    7979void FastFactory::registerFastFactory(FastFactory* fastFactory)
    8080{
    81   PRINTF(4)("Registered FastFactory for '%s'\n", fastFactory->getName());
     81  PRINTF(4)("Registered FastFactory for '%s'\n", fastFactory->getCName());
    8282
    8383  if( FastFactory::first == NULL)
     
    128128    while (tmpFac != NULL)
    129129    {
    130       if (fastFactoryName == tmpFac->getName())
     130      if (fastFactoryName == tmpFac->getCName())
    131131        return tmpFac;
    132132      tmpFac = tmpFac->next;
     
    145145  while (tmpFac != NULL)
    146146  {
    147     PRINTF(4)("DELETEING ALL OF %s\n",tmpFac->getName());
     147    PRINTF(4)("DELETEING ALL OF %s\n",tmpFac->getCName());
    148148    tmpFac->flush(hardFLUSH);
    149149    tmpFac = tmpFac->next;
     
    188188/*  if (this->storedDeadObjects + this->storedLivingObjects >= count)
    189189  {
    190   PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClassName());
     190  PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClassCName());
    191191}*/
    192192  for (unsigned int i = this->storedDeadObjects; i < count; i++)
     
    202202BaseObject* FastFactory::resurrect()
    203203{
    204   PRINTF(4)("Resurecting Object of type %s\n", this->getName());
     204  PRINTF(4)("Resurecting Object of type %s\n", this->getCName());
    205205  if (unlikely(this->deadList == NULL))
    206206  {
    207207    PRINTF(3)("The deadList of Class %s is empty, this may be either because it has not been filled yet, or the cache is to small.\n" \
    208208        "  Developer: try increasing the count with FastFactory::prepare(contHigher than actual)\n" \
    209         "    Fabricating a new %s\n", this->getName(), this->getName());
     209        "    Fabricating a new %s\n", this->getCName(), this->getCName());
    210210    this->fabricate();
    211211    return this->resurrect();
  • trunk/src/util/game_rules.cc

    r9008 r9406  
    2727
    2828
    29 using namespace std;
     29
    3030
    3131
     
    5050  BaseObject::loadParams(root);
    5151
    52   PRINTF(0)("GameRules::loadParams(...) hit me\n");
    5352  LoadParamXML(root, "MissionGoal", this, GameRules, loadMissionGoal)
    5453      .describe("an XML-Element to load the missions from");
     
    5958void GameRules::loadMissionGoal(const TiXmlElement* root)
    6059{
    61   PRINTF(0)("Trying to load MissionGoals\n");
     60  PRINTF(4)("Trying to load MissionGoals\n");
    6261  const TiXmlElement* element = root->FirstChildElement();
    6362  while( element != NULL)
     
    8887void GameRules::registerKill(const Kill& kill)
    8988{
    90   if ( !SharedNetworkData::getInstance()->isGameServer() )
     89  if ( SharedNetworkData::getInstance()->isClient() )
    9190    return;
    9291
    93   PRINTF(0)("Received Event: Kill\n");
     92  PRINTF(4)("Received Event: Kill\n");
    9493
    9594  this->killList.push_back( kill );
  • trunk/src/util/hud.cc

    r9235 r9406  
    155155      if (weapon != NULL)
    156156      {
    157         //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassName(), weapon->getName());
     157        //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassCName(), weapon->getName());
    158158        weapon->getEnergyWidget()->show();
    159159        weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1));
     
    215215    (*weaponWidget)->setWidgetSize(.02*this->resX, .1 *this->resY);
    216216    (*weaponWidget)->show();
    217     //printf("update thing %s::%s\n", (*weaponWidget)->getClassName(), (*weaponWidget)->getName());
     217    //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName());
    218218  }
    219219}
  • trunk/src/util/kill.cc

    r7486 r9406  
    1919#include "world_entity.h"
    2020
    21 using namespace std;
    2221
    2322
     23
  • trunk/src/util/kill_target.cc

    r8495 r9406  
    2121#include "util/loading/load_param.h"
    2222
    23 using namespace std;
     23
    2424
    2525CREATE_FACTORY(KillTarget, CL_KILL_TARGET);
     
    5656
    5757
    58 MissionState KillTarget::checkMissionGoal(float dt) {}
     58MissionState KillTarget::checkMissionGoal(float dt)
     59{
    5960
     61}
     62
  • trunk/src/util/mission_goal.cc

    r7464 r9406  
    2222#include "util/loading/load_param.h"
    2323
    24 using namespace std;
     24
    2525
    2626
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r9235 r9406  
    4949
    5050
    51 using namespace std;
     51
    5252
    5353
     
    8787  this->input = new OrxGui::GLGuiInputLine();
    8888  this->input->setAbsCoor2D(180, 5);
    89   this->input->connect(SIGNAL(input, enterPushed), this, SLOT(MultiplayerTeamDeathmatch, onInputEnter));
     89  this->input->enterPushed.connect(this, &MultiplayerTeamDeathmatch::onInputEnter);
    9090}
    9191
     
    154154      OrxGui::GLGuiPushButton * buttonSpectator = new OrxGui::GLGuiPushButton("Spectator");
    155155      box->pack( buttonSpectator );
    156       buttonSpectator->connect(SIGNAL(buttonSpectator, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonSpectator));
     156      buttonSpectator->released.connect(this, &MultiplayerTeamDeathmatch::onButtonSpectator);
    157157
    158158      OrxGui::GLGuiPushButton * buttonRandom = new OrxGui::GLGuiPushButton("Random");
    159159      box->pack( buttonRandom );
    160       buttonRandom->connect(SIGNAL(buttonRandom, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonRandom));
     160      buttonRandom->released.connect(this, &MultiplayerTeamDeathmatch::onButtonRandom);
    161161
    162162      OrxGui::GLGuiPushButton * buttonTeam0 = new OrxGui::GLGuiPushButton("Blue Team");
    163163      box->pack( buttonTeam0 );
    164       buttonTeam0->connect(SIGNAL(buttonTeam0, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonTeam0));
     164      buttonTeam0->released.connect(this, &MultiplayerTeamDeathmatch::onButtonTeam0);
    165165
    166166      OrxGui::GLGuiPushButton * buttonTeam1 = new OrxGui::GLGuiPushButton("Red Team");
    167167      box->pack( buttonTeam1 );
    168       buttonTeam1->connect(SIGNAL(buttonTeam1, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonTeam1));
     168      buttonTeam1->released.connect(this, &MultiplayerTeamDeathmatch::onButtonTeam1);
    169169
    170170      if ( bShowTeamChange )
     
    172172        OrxGui::GLGuiPushButton * buttonCancel = new OrxGui::GLGuiPushButton("Cancel");
    173173        box->pack( buttonCancel );
    174         buttonCancel->connect(SIGNAL(buttonCancel, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonCancel));
     174        buttonCancel->released.connect(this, &MultiplayerTeamDeathmatch::onButtonCancel);
    175175      }
    176176
    177177      OrxGui::GLGuiPushButton * buttonExit = new OrxGui::GLGuiPushButton("Exit");
    178178      box->pack( buttonExit );
    179       buttonExit->connect(SIGNAL(buttonExit, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonExit));
     179      buttonExit->released.connect(this, &MultiplayerTeamDeathmatch::onButtonExit);
    180180
    181181      box->showAll();
     
    204204  assignPlayable();
    205205
    206   if ( !SharedNetworkData::getInstance()->isGameServer() )
     206  if ( SharedNetworkData::getInstance()->isClient() )
    207207    return;
    208208
     
    214214    this->killList.erase( this->killList.begin() );
    215215  }
    216  
     216
    217217
    218218
     
    268268void MultiplayerTeamDeathmatch::checkGameRules()
    269269{
    270   if ( !SharedNetworkData::getInstance()->isGameServer() )
     270  if ( SharedNetworkData::getInstance()->isClient() )
    271271    return;
    272272
     
    320320      return "maps/male_fiend.pcx";
    321321  }
    322  
     322
    323323  return "";
    324324}
     
    330330    return 10.0f;
    331331  }
    332  
     332
    333333  return 1.0f;
    334334}
     
    680680  char st[10];
    681681  int i = 0;
    682  
     682
    683683  i = 2;
    684684  for ( TeamScoreList::const_iterator it = scoreList[0].begin(); it != scoreList[0].end(); it++ )
     
    719719    return;
    720720  }
    721  
     721
    722722  int killerUserId = killer->getOwner();
    723723  int victimUserId = victim->getOwner();
    724  
    725   PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassName(), victim->getClassName());
     724
     725  PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassCName(), victim->getClassCName());
    726726
    727727  PlayerStats & victimStats = *PlayerStats::getStats( victimUserId );
    728728  PlayerStats & killerStats = *PlayerStats::getStats( killerUserId );
    729  
     729
    730730  if ( killerStats.getPlayable() != killer || victimStats.getPlayable() != victim )
    731731  {
  • trunk/src/util/network_game_rules.cc

    r9235 r9406  
    2020#include "network_game_manager.h"
    2121
    22 using namespace std;
     22
    2323
    2424
  • trunk/src/util/object_manager.cc

    r9008 r9406  
    2626#include "debug.h"
    2727
    28 using namespace std;
     28
    2929SHELL_COMMAND(debug, ObjectManager, debug)
    3030    ->defaultValues("", 0);
     
    117117  {
    118118
    119     list<BaseObject*>::const_iterator node;
     119    std::list<BaseObject*>::const_iterator node;
    120120    for (node = objectList->begin(); node != objectList->end(); node++)
    121121      if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius)
     
    140140      for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)
    141141      {
    142         PRINT(0)(" | %s::%s\n",(*entity)->getClassName(), (*entity)->getName());
     142        PRINT(0)(" | %s::%s\n",(*entity)->getClassCName(), (*entity)->getCName());
    143143      }
    144144    }
  • trunk/src/util/signal_handler.cc

    r9240 r9406  
    2727}
    2828
    29 void SignalHandler::doCatch( std::string appName )
     29/**
     30 * register signal handlers for SIGSEGV and SIGABRT
     31 * @param appName path to executable eg argv[0]
     32 * @param fileName filename to append backtrace to
     33 */
     34void SignalHandler::doCatch( const std::string & appName, const std::string & fileName )
    3035{
    3136  this->appName = appName;
     37  this->fileName = fileName;
     38 
     39  // make sure doCatch is only called once without calling dontCatch
     40  assert( sigRecList.size() == 0 );
    3241
    3342  catchSignal( SIGSEGV );
     
    3544}
    3645
     46/**
     47 * restore previous signal handlers
     48 */
    3749void SignalHandler::dontCatch()
    3850{
     
    4557}
    4658
     59/**
     60 * catch signal sig
     61 * @param sig signal to catch
     62 */
    4763void SignalHandler::catchSignal( int sig )
    4864{
     
    5874}
    5975
     76/**
     77 * sigHandler is called when receiving signals
     78 * @param sig
     79 */
    6080void SignalHandler::sigHandler( int sig )
    6181{
     
    167187        )
    168188          charsFound++;
     189    else
     190      charsFound = 0;
    169191
    170192    if ( charsFound == 6 )
     
    183205  write( sigPipe[1], &someData, sizeof(someData) );
    184206
    185   write( gdbIn[1], "bt\nq\n", 5 );
     207  write( gdbIn[1], "bt\nk\nq\n", 7 );
    186208
    187209 
     
    202224        )
    203225          charsFound++;
     226    else
     227      charsFound = 0;
    204228
    205229    if ( charsFound == 6 )
     
    210234    }
    211235
    212     if ( promptFound == 2 )
     236    if ( promptFound == 3 )
    213237    {
    214238      break;
     
    240264  bt.insert(0, timeString);
    241265 
    242   FILE * f = fopen( GDB_BT_FILE, "a" );
     266  FILE * f = fopen( getInstance()->fileName.c_str(), "a" );
    243267
    244268  if ( !f )
    245269  {
    246     perror("could not append to " GDB_BT_FILE);
     270    perror( ( std::string( "could not append to " ) + getInstance()->fileName ).c_str() );
    247271    exit(EXIT_FAILURE);
    248272  }
     
    250274  if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() )
    251275  {
    252     printf("could not write %d byte to " GDB_BT_FILE, bt.length());
     276    printf( ( std::string("could not write %d byte to ") + getInstance()->fileName ).c_str(), bt.length());
    253277    exit(EXIT_FAILURE);
    254278  }
  • trunk/src/util/signal_handler.h

    r9240 r9406  
    99#include <list>
    1010#include <string>
    11 
    12 
    13 #define GDB_BT_FILE "orxonox.backtrace"
    1411
    1512typedef int (*SignalCallback)( void * someData );
     
    4441    void registerCallback( SignalCallback cb, void * someData );
    4542
    46     void doCatch( std::string appName );
     43    void doCatch( const std::string & appName, const std::string & fileName );
    4744    void dontCatch();
    4845
     
    5855
    5956    std::string appName;
     57    std::string fileName;
    6058};
    6159
  • trunk/src/util/singleplayer_shootemup.cc

    r7488 r9406  
    2323
    2424
    25 using namespace std;
     25
    2626
    2727
  • trunk/src/util/state.cc

    r8271 r9406  
    2525#endif
    2626
    27 using namespace std;
     27
    2828
    2929
  • trunk/src/util/track/track_manager.cc

    r7221 r9406  
    3232#include <stdarg.h>
    3333
    34 using namespace std;
     34
    3535
    3636/**
  • trunk/src/util/track/track_node.cc

    r6074 r9406  
    2121#include "track_manager.h"
    2222
    23 using namespace std;
     23
    2424
    2525/**
Note: See TracChangeset for help on using the changeset viewer.