Changeset 9406 in orxonox.OLD for trunk/src/util
- Timestamp:
- Jul 24, 2006, 11:09:47 AM (18 years ago)
- Location:
- trunk/src/util
- Files:
-
- 18 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/Makefile.am
r8068 r9406 14 14 singleplayer_shootemup.cc \ 15 15 \ 16 \ 17 \ 16 18 mission_goal.cc\ 17 19 kill_target.cc\ … … 24 26 animation/animation_player.cc \ 25 27 \ 26 track/pilot_node.cc 28 track/pilot_node.cc \ 29 \ 30 network_stats_widget.cc 27 31 28 32 # track/track_manager.cc \ … … 50 54 animation/t_animation.h \ 51 55 \ 52 track/pilot_node.h 56 track/pilot_node.h \ 57 \ 58 network_stats_widget.h 59 53 60 54 61 # track/track_manager.h \ -
trunk/src/util/animation/animation3d.cc
r5115 r9406 25 25 #include "p_node.h" 26 26 27 using namespace std; 27 28 28 29 29 /** -
trunk/src/util/animation/animation_player.cc
r5777 r9406 20 20 #include "compiler.h" 21 21 22 using namespace std; 22 23 23 24 24 … … 100 100 { 101 101 // iterate through all the animations and tick them. 102 list<Animation*>::iterator anim;102 std::list<Animation*>::iterator anim; 103 103 for (anim = this->animationList.begin(); anim != this->animationList.end(); anim++) 104 104 { … … 135 135 Animation* AnimationPlayer::getAnimationFromBaseObject(const BaseObject* baseObject) const 136 136 { 137 list<Animation*>::const_iterator anim;137 std::list<Animation*>::const_iterator anim; 138 138 for (anim = this->animationList.begin(); anim != this->animationList.end(); anim++) 139 139 if((*anim)->getBaseObject() == baseObject) … … 156 156 PRINT(0)("-Animation Information---------------+\n"); 157 157 // Per ANIMATION DEBUG 158 list<Animation*>::iterator anim;158 std::list<Animation*>::iterator anim; 159 159 for (anim = this->animationList.begin(); anim != this->animationList.end(); anim++) 160 160 { -
trunk/src/util/fast_factory.cc
r8350 r9406 21 21 #include <string.h> 22 22 23 using namespace std; 23 24 24 25 25 /** … … 79 79 void FastFactory::registerFastFactory(FastFactory* fastFactory) 80 80 { 81 PRINTF(4)("Registered FastFactory for '%s'\n", fastFactory->get Name());81 PRINTF(4)("Registered FastFactory for '%s'\n", fastFactory->getCName()); 82 82 83 83 if( FastFactory::first == NULL) … … 128 128 while (tmpFac != NULL) 129 129 { 130 if (fastFactoryName == tmpFac->get Name())130 if (fastFactoryName == tmpFac->getCName()) 131 131 return tmpFac; 132 132 tmpFac = tmpFac->next; … … 145 145 while (tmpFac != NULL) 146 146 { 147 PRINTF(4)("DELETEING ALL OF %s\n",tmpFac->get Name());147 PRINTF(4)("DELETEING ALL OF %s\n",tmpFac->getCName()); 148 148 tmpFac->flush(hardFLUSH); 149 149 tmpFac = tmpFac->next; … … 188 188 /* if (this->storedDeadObjects + this->storedLivingObjects >= count) 189 189 { 190 PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClass Name());190 PRINTF(3)("not creating new Objects for class %s, because the requested count already exists\n", this->getClassCName()); 191 191 }*/ 192 192 for (unsigned int i = this->storedDeadObjects; i < count; i++) … … 202 202 BaseObject* FastFactory::resurrect() 203 203 { 204 PRINTF(4)("Resurecting Object of type %s\n", this->get Name());204 PRINTF(4)("Resurecting Object of type %s\n", this->getCName()); 205 205 if (unlikely(this->deadList == NULL)) 206 206 { 207 207 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" \ 208 208 " Developer: try increasing the count with FastFactory::prepare(contHigher than actual)\n" \ 209 " Fabricating a new %s\n", this->get Name(), this->getName());209 " Fabricating a new %s\n", this->getCName(), this->getCName()); 210 210 this->fabricate(); 211 211 return this->resurrect(); -
trunk/src/util/game_rules.cc
r9008 r9406 27 27 28 28 29 using namespace std; 29 30 30 31 31 … … 50 50 BaseObject::loadParams(root); 51 51 52 PRINTF(0)("GameRules::loadParams(...) hit me\n");53 52 LoadParamXML(root, "MissionGoal", this, GameRules, loadMissionGoal) 54 53 .describe("an XML-Element to load the missions from"); … … 59 58 void GameRules::loadMissionGoal(const TiXmlElement* root) 60 59 { 61 PRINTF( 0)("Trying to load MissionGoals\n");60 PRINTF(4)("Trying to load MissionGoals\n"); 62 61 const TiXmlElement* element = root->FirstChildElement(); 63 62 while( element != NULL) … … 88 87 void GameRules::registerKill(const Kill& kill) 89 88 { 90 if ( !SharedNetworkData::getInstance()->isGameServer() )89 if ( SharedNetworkData::getInstance()->isClient() ) 91 90 return; 92 91 93 PRINTF( 0)("Received Event: Kill\n");92 PRINTF(4)("Received Event: Kill\n"); 94 93 95 94 this->killList.push_back( kill ); -
trunk/src/util/hud.cc
r9235 r9406 155 155 if (weapon != NULL) 156 156 { 157 //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClass Name(), weapon->getName());157 //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassCName(), weapon->getName()); 158 158 weapon->getEnergyWidget()->show(); 159 159 weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1)); … … 215 215 (*weaponWidget)->setWidgetSize(.02*this->resX, .1 *this->resY); 216 216 (*weaponWidget)->show(); 217 //printf("update thing %s::%s\n", (*weaponWidget)->getClass Name(), (*weaponWidget)->getName());217 //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName()); 218 218 } 219 219 } -
trunk/src/util/kill.cc
r7486 r9406 19 19 #include "world_entity.h" 20 20 21 using namespace std;22 21 23 22 23 -
trunk/src/util/kill_target.cc
r8495 r9406 21 21 #include "util/loading/load_param.h" 22 22 23 using namespace std; 23 24 24 25 25 CREATE_FACTORY(KillTarget, CL_KILL_TARGET); … … 56 56 57 57 58 MissionState KillTarget::checkMissionGoal(float dt) {} 58 MissionState KillTarget::checkMissionGoal(float dt) 59 { 59 60 61 } 62 -
trunk/src/util/mission_goal.cc
r7464 r9406 22 22 #include "util/loading/load_param.h" 23 23 24 using namespace std; 24 25 25 26 26 -
trunk/src/util/multiplayer_team_deathmatch.cc
r9235 r9406 49 49 50 50 51 using namespace std; 51 52 52 53 53 … … 87 87 this->input = new OrxGui::GLGuiInputLine(); 88 88 this->input->setAbsCoor2D(180, 5); 89 this->input-> connect(SIGNAL(input, enterPushed), this, SLOT(MultiplayerTeamDeathmatch, onInputEnter));89 this->input->enterPushed.connect(this, &MultiplayerTeamDeathmatch::onInputEnter); 90 90 } 91 91 … … 154 154 OrxGui::GLGuiPushButton * buttonSpectator = new OrxGui::GLGuiPushButton("Spectator"); 155 155 box->pack( buttonSpectator ); 156 buttonSpectator-> connect(SIGNAL(buttonSpectator, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonSpectator));156 buttonSpectator->released.connect(this, &MultiplayerTeamDeathmatch::onButtonSpectator); 157 157 158 158 OrxGui::GLGuiPushButton * buttonRandom = new OrxGui::GLGuiPushButton("Random"); 159 159 box->pack( buttonRandom ); 160 buttonRandom-> connect(SIGNAL(buttonRandom, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonRandom));160 buttonRandom->released.connect(this, &MultiplayerTeamDeathmatch::onButtonRandom); 161 161 162 162 OrxGui::GLGuiPushButton * buttonTeam0 = new OrxGui::GLGuiPushButton("Blue Team"); 163 163 box->pack( buttonTeam0 ); 164 buttonTeam0-> connect(SIGNAL(buttonTeam0, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonTeam0));164 buttonTeam0->released.connect(this, &MultiplayerTeamDeathmatch::onButtonTeam0); 165 165 166 166 OrxGui::GLGuiPushButton * buttonTeam1 = new OrxGui::GLGuiPushButton("Red Team"); 167 167 box->pack( buttonTeam1 ); 168 buttonTeam1-> connect(SIGNAL(buttonTeam1, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonTeam1));168 buttonTeam1->released.connect(this, &MultiplayerTeamDeathmatch::onButtonTeam1); 169 169 170 170 if ( bShowTeamChange ) … … 172 172 OrxGui::GLGuiPushButton * buttonCancel = new OrxGui::GLGuiPushButton("Cancel"); 173 173 box->pack( buttonCancel ); 174 buttonCancel-> connect(SIGNAL(buttonCancel, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonCancel));174 buttonCancel->released.connect(this, &MultiplayerTeamDeathmatch::onButtonCancel); 175 175 } 176 176 177 177 OrxGui::GLGuiPushButton * buttonExit = new OrxGui::GLGuiPushButton("Exit"); 178 178 box->pack( buttonExit ); 179 buttonExit-> connect(SIGNAL(buttonExit, released), this, SLOT(MultiplayerTeamDeathmatch, onButtonExit));179 buttonExit->released.connect(this, &MultiplayerTeamDeathmatch::onButtonExit); 180 180 181 181 box->showAll(); … … 204 204 assignPlayable(); 205 205 206 if ( !SharedNetworkData::getInstance()->isGameServer() )206 if ( SharedNetworkData::getInstance()->isClient() ) 207 207 return; 208 208 … … 214 214 this->killList.erase( this->killList.begin() ); 215 215 } 216 216 217 217 218 218 … … 268 268 void MultiplayerTeamDeathmatch::checkGameRules() 269 269 { 270 if ( !SharedNetworkData::getInstance()->isGameServer() )270 if ( SharedNetworkData::getInstance()->isClient() ) 271 271 return; 272 272 … … 320 320 return "maps/male_fiend.pcx"; 321 321 } 322 322 323 323 return ""; 324 324 } … … 330 330 return 10.0f; 331 331 } 332 332 333 333 return 1.0f; 334 334 } … … 680 680 char st[10]; 681 681 int i = 0; 682 682 683 683 i = 2; 684 684 for ( TeamScoreList::const_iterator it = scoreList[0].begin(); it != scoreList[0].end(); it++ ) … … 719 719 return; 720 720 } 721 721 722 722 int killerUserId = killer->getOwner(); 723 723 int victimUserId = victim->getOwner(); 724 725 PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClass Name(), victim->getClassName());724 725 PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassCName(), victim->getClassCName()); 726 726 727 727 PlayerStats & victimStats = *PlayerStats::getStats( victimUserId ); 728 728 PlayerStats & killerStats = *PlayerStats::getStats( killerUserId ); 729 729 730 730 if ( killerStats.getPlayable() != killer || victimStats.getPlayable() != victim ) 731 731 { -
trunk/src/util/network_game_rules.cc
r9235 r9406 20 20 #include "network_game_manager.h" 21 21 22 using namespace std; 22 23 23 24 24 -
trunk/src/util/object_manager.cc
r9008 r9406 26 26 #include "debug.h" 27 27 28 using namespace std; 28 29 29 SHELL_COMMAND(debug, ObjectManager, debug) 30 30 ->defaultValues("", 0); … … 117 117 { 118 118 119 list<BaseObject*>::const_iterator node;119 std::list<BaseObject*>::const_iterator node; 120 120 for (node = objectList->begin(); node != objectList->end(); node++) 121 121 if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius) … … 140 140 for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++) 141 141 { 142 PRINT(0)(" | %s::%s\n",(*entity)->getClass Name(), (*entity)->getName());142 PRINT(0)(" | %s::%s\n",(*entity)->getClassCName(), (*entity)->getCName()); 143 143 } 144 144 } -
trunk/src/util/signal_handler.cc
r9240 r9406 27 27 } 28 28 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 */ 34 void SignalHandler::doCatch( const std::string & appName, const std::string & fileName ) 30 35 { 31 36 this->appName = appName; 37 this->fileName = fileName; 38 39 // make sure doCatch is only called once without calling dontCatch 40 assert( sigRecList.size() == 0 ); 32 41 33 42 catchSignal( SIGSEGV ); … … 35 44 } 36 45 46 /** 47 * restore previous signal handlers 48 */ 37 49 void SignalHandler::dontCatch() 38 50 { … … 45 57 } 46 58 59 /** 60 * catch signal sig 61 * @param sig signal to catch 62 */ 47 63 void SignalHandler::catchSignal( int sig ) 48 64 { … … 58 74 } 59 75 76 /** 77 * sigHandler is called when receiving signals 78 * @param sig 79 */ 60 80 void SignalHandler::sigHandler( int sig ) 61 81 { … … 167 187 ) 168 188 charsFound++; 189 else 190 charsFound = 0; 169 191 170 192 if ( charsFound == 6 ) … … 183 205 write( sigPipe[1], &someData, sizeof(someData) ); 184 206 185 write( gdbIn[1], "bt\n q\n", 5);207 write( gdbIn[1], "bt\nk\nq\n", 7 ); 186 208 187 209 … … 202 224 ) 203 225 charsFound++; 226 else 227 charsFound = 0; 204 228 205 229 if ( charsFound == 6 ) … … 210 234 } 211 235 212 if ( promptFound == 2)236 if ( promptFound == 3 ) 213 237 { 214 238 break; … … 240 264 bt.insert(0, timeString); 241 265 242 FILE * f = fopen( GDB_BT_FILE, "a" );266 FILE * f = fopen( getInstance()->fileName.c_str(), "a" ); 243 267 244 268 if ( !f ) 245 269 { 246 perror( "could not append to " GDB_BT_FILE);270 perror( ( std::string( "could not append to " ) + getInstance()->fileName ).c_str() ); 247 271 exit(EXIT_FAILURE); 248 272 } … … 250 274 if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() ) 251 275 { 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()); 253 277 exit(EXIT_FAILURE); 254 278 } -
trunk/src/util/signal_handler.h
r9240 r9406 9 9 #include <list> 10 10 #include <string> 11 12 13 #define GDB_BT_FILE "orxonox.backtrace"14 11 15 12 typedef int (*SignalCallback)( void * someData ); … … 44 41 void registerCallback( SignalCallback cb, void * someData ); 45 42 46 void doCatch( std::string appName );43 void doCatch( const std::string & appName, const std::string & fileName ); 47 44 void dontCatch(); 48 45 … … 58 55 59 56 std::string appName; 57 std::string fileName; 60 58 }; 61 59 -
trunk/src/util/singleplayer_shootemup.cc
r7488 r9406 23 23 24 24 25 using namespace std; 25 26 26 27 27 -
trunk/src/util/state.cc
r8271 r9406 25 25 #endif 26 26 27 using namespace std; 27 28 28 29 29 -
trunk/src/util/track/track_manager.cc
r7221 r9406 32 32 #include <stdarg.h> 33 33 34 using namespace std; 34 35 35 36 36 /** -
trunk/src/util/track/track_node.cc
r6074 r9406 21 21 #include "track_manager.h" 22 22 23 using namespace std; 23 24 24 25 25 /**
Note: See TracChangeset
for help on using the changeset viewer.