From: <hik...@us...> - 2010-01-10 12:41:04
|
Revision: 4421 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4421&view=rev Author: hikerstk Date: 2010-01-10 12:12:07 +0000 (Sun, 10 Jan 2010) Log Message: ----------- Disabled new AI so that we know at least to which AI bug reports apply to. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-01-10 12:10:39 UTC (rev 4420) +++ main/trunk/src/modes/world.cpp 2010-01-10 12:12:07 UTC (rev 4421) @@ -191,8 +191,11 @@ // For now: instead of random switching, use each // robot in turns: switch(m_random.get(NUM_ROBOTS)) - static int turn=1; - turn=1-turn; + // static int turn=1; + // turn=1-turn; + + // For now disable the new AI. + int turn=0; switch(turn) { case 0: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-01-11 23:52:05
|
Revision: 4437 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4437&view=rev Author: hikerstk Date: 2010-01-11 23:51:59 +0000 (Mon, 11 Jan 2010) Log Message: ----------- Removed compiler warning. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-01-11 23:51:27 UTC (rev 4436) +++ main/trunk/src/modes/world.cpp 2010-01-11 23:51:59 UTC (rev 4437) @@ -187,8 +187,8 @@ { Kart* currentRobot; - const int NUM_ROBOTS = 1; + // const int NUM_ROBOTS = 1; // For now: instead of random switching, use each // robot in turns: switch(m_random.get(NUM_ROBOTS)) // static int turn=1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-24 01:24:55
|
Revision: 4816 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4816&view=rev Author: auria Date: 2010-02-24 01:24:48 +0000 (Wed, 24 Feb 2010) Log Message: ----------- Committed my code to quickly 'profile' FPS, in case someone ever needs that again Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-02-23 23:47:31 UTC (rev 4815) +++ main/trunk/src/modes/world.cpp 2010-02-24 01:24:48 UTC (rev 4816) @@ -388,9 +388,21 @@ } // updateWorld +#define MEASURE_FPS 0 + //----------------------------------------------------------------------------- void World::update(float dt) { +#if MEASURE_FPS + static float time = 0.0f; + time += dt; + if (time > 5.0f) + { + time -= 5.0f; + printf("%i\n",irr_driver->getVideoDriver()->getFPS()); + } +#endif + if(history->replayHistory()) dt=history->getNextDelta(); WorldStatus::update(dt); // Clear race state so that new information can be stored This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-25 02:53:51
|
Revision: 4842 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4842&view=rev Author: auria Date: 2010-02-25 02:53:38 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Removed debug prints that should not have been committed Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-02-25 02:52:07 UTC (rev 4841) +++ main/trunk/src/modes/world.cpp 2010-02-25 02:53:38 UTC (rev 4842) @@ -565,8 +565,6 @@ void World::removeKart(int kart_number, bool notifyOfElimination) { Kart *kart = m_karts[kart_number]; - - std::cout << "==== World::removeKart ====\n"; // Display a message about the eliminated kart in the race gui if (notifyOfElimination) @@ -576,12 +574,10 @@ if(!(*i)->getCamera()) continue; if(*i==kart) { - std::cout << "You have been eliminated (i = " << (*i)->getIdent() << ")\n"; m_race_gui->addMessage(_("You have been\neliminated!"), *i, 2.0f, 60); } else { - std::cout << kart->getIdent().c_str() << " has been eliminated (i = " << (*i)->getIdent() << ")\n"; m_race_gui->addMessage(StringUtils::insertValues(_("'%s' has\nbeen eliminated."), kart->getName().c_str()), *i, 2.0f, 60); @@ -589,8 +585,6 @@ } // for i in kart } - std::cout << "=========================\n"; - if(kart->getController()->isPlayerController()) { // Change the camera so that it will be attached to the leader This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-03-24 23:55:10
|
Revision: 5064 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5064&view=rev Author: hikerstk Date: 2010-03-24 23:55:04 +0000 (Wed, 24 Mar 2010) Log Message: ----------- Removed unnecessary debug print. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-03-24 23:52:41 UTC (rev 5063) +++ main/trunk/src/modes/world.cpp 2010-03-24 23:55:04 UTC (rev 5064) @@ -175,7 +175,6 @@ switch(race_manager->getKartType(index)) { case RaceManager::KT_PLAYER: - std::cout << "===== World : creating player controller for kart #" << index << " which has local_player_id " << local_player_id << " ===========\n"; controller = new PlayerController(new_kart, StateManager::get()->getActivePlayer(local_player_id), local_player_id); @@ -188,8 +187,6 @@ //m_num_players++; //break; case RaceManager::KT_AI: - std::cout << "===== World : creating AI controller for #" << index << "===========\n"; - controller = loadAIController(new_kart); break; case RaceManager::KT_GHOST: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-01 00:16:55
|
Revision: 5601 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5601&view=rev Author: hikerstk Date: 2010-07-01 00:16:09 +0000 (Thu, 01 Jul 2010) Log Message: ----------- Fixed memory overwrite that happens when the in-game menu is displayed during the end animations. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-07-01 00:14:56 UTC (rev 5600) +++ main/trunk/src/modes/world.cpp 2010-07-01 00:16:09 UTC (rev 5601) @@ -671,8 +671,14 @@ sfx_manager->resumeAll(); WorldStatus::unpause(); for(unsigned int i=0; i<m_karts.size(); i++) - if(m_karts[i]->getController()->isPlayerController()) - ((PlayerController*)(m_karts[i]->getController()))->resetInputState(); + { + // Note that we can not test for isPlayerController here, since + // an EndController will also return 'isPlayerController' if the + // kart belonged to a player. + PlayerController *pc = dynamic_cast<PlayerController*>(m_karts[i]->getController()); + if(pc) + pc->resetInputState(); + } } // pause /* EOF */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-11 13:11:11
|
Revision: 5676 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5676&view=rev Author: hikerstk Date: 2010-07-11 13:11:05 +0000 (Sun, 11 Jul 2010) Log Message: ----------- Fixed incorrect assignment to unsigned variable. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-07-09 00:41:46 UTC (rev 5675) +++ main/trunk/src/modes/world.cpp 2010-07-11 13:11:05 UTC (rev 5676) @@ -565,7 +565,7 @@ */ Kart *World::getLocalPlayerKart(unsigned int n) const { - unsigned int count=-1; + int count=-1; for(unsigned int i=0; i<m_karts.size(); i++) { if(m_karts[i]->getCamera() && m_karts[i]->getController()->isPlayerController()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-18 13:56:03
|
Revision: 5692 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5692&view=rev Author: hikerstk Date: 2010-07-18 13:55:55 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Added FIXME to indicate why restarting a race is currently broken. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-07-18 10:58:35 UTC (rev 5691) +++ main/trunk/src/modes/world.cpp 2010-07-18 13:55:55 UTC (rev 5692) @@ -296,6 +296,10 @@ unlock_manager->raceFinished(); if (m_race_gui) m_race_gui->clearAllMessages(); + //FIXME: we can't delete the race gui here, since it is needed in case of + // a restart (the constructor creates some textures which assume that no + // scene nodes exist. In case of a restart there are scene nodes, so we + // can't create the race gui again :( delete m_race_gui; m_race_gui = new RaceResultGUI(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-07-18 15:47:53
|
Revision: 5693 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5693&view=rev Author: auria Date: 2010-07-18 15:47:47 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Fixed warning Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-07-18 13:55:55 UTC (rev 5692) +++ main/trunk/src/modes/world.cpp 2010-07-18 15:47:47 UTC (rev 5693) @@ -573,12 +573,13 @@ Kart *World::getLocalPlayerKart(unsigned int n) const { int count=-1; - for(unsigned int i=0; i<m_karts.size(); i++) + const int kart_count = m_karts.size(); + for(int i=0; i<kart_count; i++) { if(m_karts[i]->getCamera() && m_karts[i]->getController()->isPlayerController()) { count++; - if(count==n) return m_karts[i]; + if(count == (int)n) return m_karts[i]; } } return NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-19 00:14:12
|
Revision: 5696 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5696&view=rev Author: hikerstk Date: 2010-07-19 00:14:06 +0000 (Mon, 19 Jul 2010) Log Message: ----------- Missing file from previous 'fix race restarting' patch. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-07-19 00:11:03 UTC (rev 5695) +++ main/trunk/src/modes/world.cpp 2010-07-19 00:14:06 UTC (rev 5696) @@ -79,6 +79,7 @@ { m_physics = NULL; m_race_gui = NULL; + m_saved_race_gui = NULL; m_use_highscores = true; m_track = NULL; m_clear_back_buffer = false; @@ -296,12 +297,14 @@ unlock_manager->raceFinished(); if (m_race_gui) m_race_gui->clearAllMessages(); - //FIXME: we can't delete the race gui here, since it is needed in case of - // a restart (the constructor creates some textures which assume that no - // scene nodes exist. In case of a restart there are scene nodes, so we - // can't create the race gui again :( - delete m_race_gui; - m_race_gui = new RaceResultGUI(); + // we can't delete the race gui here, since it is needed in case of + // a restart: the constructor of it creates some textures which assume + // that no scene nodes exist. In case of a restart there are scene nodes, + // so we can't create the race gui again, so we keep it around + // and save the pointer. + assert(m_saved_race_gui==NULL); + m_saved_race_gui = m_race_gui; + m_race_gui = new RaceResultGUI(); WorldStatus::terminateRace(); } // terminateRace @@ -638,6 +641,15 @@ //----------------------------------------------------------------------------- void World::restartRace() { + // If m_saved_race_gui is set, it means that the restart was done + // when the race result gui was being shown. In this case delete + // the race result gui and restore the race gui. + if(m_saved_race_gui) + { + delete m_race_gui; + m_race_gui = m_saved_race_gui; + m_saved_race_gui = NULL; + } WorldStatus::reset(); m_faster_music_active = false; m_eliminated_karts = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-02 02:59:59
|
Revision: 5859 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5859&view=rev Author: hikerstk Date: 2010-09-02 02:59:52 +0000 (Thu, 02 Sep 2010) Log Message: ----------- Applied jmimu's patch to remove 'new laps' etc. messages when a race is restarted. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-09-02 01:31:27 UTC (rev 5858) +++ main/trunk/src/modes/world.cpp 2010-09-02 02:59:52 UTC (rev 5859) @@ -663,6 +663,9 @@ m_race_gui = m_saved_race_gui; m_saved_race_gui = NULL; } + + m_race_gui->clearAllMessages(); + WorldStatus::reset(); m_faster_music_active = false; m_eliminated_karts = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-10-26 06:14:52
|
Revision: 6338 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6338&view=rev Author: hikerstk Date: 2010-10-26 06:14:46 +0000 (Tue, 26 Oct 2010) Log Message: ----------- Handle tracks that are not found better (track manager does not throw an exception anymore, it instead returns NULL). Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-10-25 23:25:33 UTC (rev 6337) +++ main/trunk/src/modes/world.cpp 2010-10-26 06:14:46 UTC (rev 6338) @@ -110,14 +110,12 @@ m_race_gui = new RaceGUI(); // Grab the track file - try + m_track = track_manager->getTrack(race_manager->getTrackName()); + if(!m_track) { - m_track = track_manager->getTrack(race_manager->getTrackName()); - } - catch(std::runtime_error) - { std::ostringstream msg; - msg << "Track '" << race_manager->getTrackName() << "' not found.\n"; + msg << "Track '" << race_manager->getTrackName() + << "' not found.\n"; throw std::runtime_error(msg.str()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-11-15 12:08:14
|
Revision: 6566 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6566&view=rev Author: hikerstk Date: 2010-11-15 09:47:44 +0000 (Mon, 15 Nov 2010) Log Message: ----------- If no valid start position is found, automatically enter flying mode (in debug compilations). Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-11-15 02:08:28 UTC (rev 6565) +++ main/trunk/src/modes/world.cpp 2010-11-15 09:47:44 UTC (rev 6566) @@ -348,7 +348,13 @@ { fprintf(stderr, "ERROR: no valid starting position for kart %d on track %s.\n", (int)(i-m_karts.begin()), m_track->getIdent().c_str()); +#ifdef DEBUG + fprintf(stderr, "Activating fly mode.\n"); + (*i)->flyUp(); + continue; +#else exit(-1); +#endif } } @@ -385,8 +391,14 @@ if(!material) { fprintf(stderr, "ERROR: no valid starting position for kart %d on track %s.\n", - (int)(i-m_karts.begin()), m_track->getIdent().c_str()); + (int)(i-m_karts.begin()), m_track->getIdent().c_str()); +#ifdef DEBUG + fprintf(stderr, "Activating fly mode.\n"); + (*i)->flyUp(); + continue; +#else exit(-1); +#endif } all_finished=false; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-12-15 23:04:51
|
Revision: 7029 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=7029&view=rev Author: hikerstk Date: 2010-12-15 22:50:17 +0000 (Wed, 15 Dec 2010) Log Message: ----------- The --track-debug flag now also tests all reset positions for all karts and prints a warning if the rescue position would result in an immediate rescue again (which usually indicates that the driveline is too low, and the kart is rescued 'under' the track). Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-12-15 22:46:06 UTC (rev 7028) +++ main/trunk/src/modes/world.cpp 2010-12-15 22:50:17 UTC (rev 7029) @@ -331,6 +331,70 @@ */ void World::resetAllKarts() { + // If track checking is requested, check all rescue positions if + // they are heigh enough. + if(race_manager->getMinorMode()!=RaceManager::MINOR_MODE_3_STRIKES && + UserConfigParams::m_track_debug) + { + const QuadGraph &qg=m_track->getQuadGraph(); + Vec3 eps = Vec3(0,1.5f*m_karts[0]->getKartHeight(),0); + for(unsigned int quad=0; quad<qg.getNumNodes(); quad++) + { + const Quad &q = qg.getQuad(quad); + const Vec3 center = q.getCenter(); + // We have to test for all karts, since the karts have different + // heights and so things might change from kart to kart. + for(unsigned int kart_id=0; kart_id<m_karts.size(); kart_id++) + { + Kart *kart = m_karts[kart_id]; + kart->setXYZ(center); + + btQuaternion heading(btVector3(0.0f, 1.0f, 0.0f), + m_track->getAngle(quad) ); + kart->setRotation(heading); + + // A certain epsilon is added here to the Z coordinate, in case + // that the drivelines are somewhat under the track. Otherwise, + // the kart might be placed a little bit under the track, + // triggering a rescue, ... (experimentally found value) + float epsilon = 0.5f * kart->getKartHeight(); + + btTransform pos; + pos.setOrigin(center+eps); + pos.setRotation(btQuaternion(btVector3(0.0f, 1.0f, 0.0f), + m_track->getAngle(quad)) ); + kart->getBody()->setCenterOfMassTransform(pos); + bool kart_over_ground = m_physics->projectKartDownwards(kart); + if(kart_over_ground) + { + const Vec3 &xyz = kart->getTrans().getOrigin()+Vec3(0,0.3f,0); + ((TerrainInfo*)kart)->update(xyz); + const Material *material = kart->getMaterial(); + if(!material || material->isReset()) + kart_over_ground = false; + } + if(!kart_over_ground) + { + printf("Kart '%s' not over quad '%d'\n", + kart->getIdent().c_str(), quad); + printf("Center point: %f %f %f\n", + center.getX(), center.getY(), center.getZ()); + + } + } // for kart_id<m_karts.size() + } // for quad < quad_graph.getNumNodes + + for(unsigned int kart_id=0; kart_id<m_karts.size(); kart_id++) + { + // Reset the karts back to the original start position. + // This call is a bit of an overkill, but setting the correct + // transforms, positions, motion state is a bit of a hassle. + m_karts[kart_id]->reset(); + } + + } // if m_track_debug + + m_schedule_pause = false; m_schedule_unpause = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2012-07-11 22:07:41
|
Revision: 11385 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11385&view=rev Author: hikerstk Date: 2012-07-11 22:07:35 +0000 (Wed, 11 Jul 2012) Log Message: ----------- Bugfix: 'turn' could become >3. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2012-07-11 22:02:56 UTC (rev 11384) +++ main/trunk/src/modes/world.cpp 2012-07-11 22:07:35 UTC (rev 11385) @@ -255,7 +255,7 @@ int turn = 1; #elif defined(USE_ALL_AIS) static int turn=3; - turn=(turn++) % 3; + turn=(turn+1) % 3; #else int turn=0; // use default AU #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2013-12-17 21:00:59
|
Revision: 14728 http://sourceforge.net/p/supertuxkart/code/14728 Author: deveee Date: 2013-12-17 21:00:56 +0000 (Tue, 17 Dec 2013) Log Message: ----------- Hopefully fixed problem with tutorial which sometimes was starting in a loop Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2013-12-17 01:06:27 UTC (rev 14727) +++ main/trunk/src/modes/world.cpp 2013-12-17 21:00:56 UTC (rev 14728) @@ -729,6 +729,7 @@ { if (m_schedule_exit_race) { + m_schedule_exit_race = false; race_manager->exitRace(); race_manager->setAIKartOverride(""); @@ -736,6 +737,7 @@ if (m_schedule_tutorial) { + m_schedule_tutorial = false; race_manager->setNumLocalPlayers(1); race_manager->setMajorMode (RaceManager::MAJOR_MODE_SINGLE); race_manager->setMinorMode (RaceManager::MINOR_MODE_TUTORIAL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-12-20 01:01:59
|
Revision: 7097 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=7097&view=rev Author: hikerstk Date: 2010-12-20 01:01:53 +0000 (Mon, 20 Dec 2010) Log Message: ----------- Removed compiler warning. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2010-12-20 00:59:53 UTC (rev 7096) +++ main/trunk/src/modes/world.cpp 2010-12-20 01:01:53 UTC (rev 7097) @@ -353,12 +353,6 @@ m_track->getAngle(quad) ); kart->setRotation(heading); - // A certain epsilon is added here to the Z coordinate, in case - // that the drivelines are somewhat under the track. Otherwise, - // the kart might be placed a little bit under the track, - // triggering a rescue, ... (experimentally found value) - float epsilon = 0.5f * kart->getKartHeight(); - btTransform pos; pos.setOrigin(center+eps); pos.setRotation(btQuaternion(btVector3(0.0f, 1.0f, 0.0f), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-01-16 01:28:32
|
Revision: 7434 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=7434&view=rev Author: auria Date: 2011-01-16 01:28:25 +0000 (Sun, 16 Jan 2011) Log Message: ----------- Restored line that was accidentally removed Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2011-01-16 00:25:21 UTC (rev 7433) +++ main/trunk/src/modes/world.cpp 2011-01-16 01:28:25 UTC (rev 7434) @@ -199,6 +199,8 @@ break; } + new_kart->setController(controller); + return new_kart; } // createKart This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-05-03 07:14:10
|
Revision: 8507 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8507&view=rev Author: hikerstk Date: 2011-05-03 07:14:04 +0000 (Tue, 03 May 2011) Log Message: ----------- Changed order in which race gui and track are released to avoid memory debugging having inconsistent texture information at startup and cleanup time. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2011-05-02 21:57:39 UTC (rev 8506) +++ main/trunk/src/modes/world.cpp 2011-05-03 07:14:04 UTC (rev 8507) @@ -245,6 +245,10 @@ //----------------------------------------------------------------------------- World::~World() { + // In case that a race is aborted (e.g. track not found) m_track is 0. + if(m_track) + m_track->cleanup(); + // Delete the in-race-gui: if(m_saved_race_gui) { @@ -261,9 +265,6 @@ delete m_race_gui; } delete race_state; - // In case that a race is aborted (e.g. track not found) m_track is 0. - if(m_track) - m_track->cleanup(); for ( unsigned int i = 0 ; i < m_karts.size() ; i++ ) delete m_karts[i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-09-21 00:43:50
|
Revision: 9873 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9873&view=rev Author: hikerstk Date: 2011-09-21 00:43:43 +0000 (Wed, 21 Sep 2011) Log Message: ----------- Cosmetic changes only (to follow our style guide). Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2011-09-20 22:15:28 UTC (rev 9872) +++ main/trunk/src/modes/world.cpp 2011-09-21 00:43:43 UTC (rev 9873) @@ -183,14 +183,15 @@ { int position = index+1; btTransform init_pos = m_track->getStartTransform(index); - Kart *new_kart = new Kart(kart_ident, m_track, position, (local_player_id == 0), init_pos, + Kart *new_kart = new Kart(kart_ident, m_track, position, + (local_player_id == 0), init_pos, race_manager->getKartType(index)); Controller *controller = NULL; switch(race_manager->getKartType(index)) { case RaceManager::KT_PLAYER: controller = new PlayerController(new_kart, - StateManager::get()->getActivePlayer(local_player_id), + StateManager::get()->getActivePlayer(local_player_id), local_player_id); m_num_players ++; break; @@ -321,12 +322,14 @@ } } // i<kart_amount - // Update highscores, and retrieve the best highscore if relevant to show it in the GUI + // Update highscores, and retrieve the best highscore if relevant + // to show it in the GUI int best_highscore_rank = -1; int best_finish_time = -1; std::string highscore_who = ""; StateManager::ActivePlayer* best_player = NULL; - updateHighscores(&best_highscore_rank, &best_finish_time, &highscore_who, &best_player); + updateHighscores(&best_highscore_rank, &best_finish_time, &highscore_who, + &best_player); unlock_manager->raceFinished(); @@ -344,7 +347,8 @@ if (best_highscore_rank > 0) { - results->setHighscore(highscore_who, best_player, best_highscore_rank, best_finish_time); + results->setHighscore(highscore_who, best_player, best_highscore_rank, + best_finish_time); } else { @@ -392,7 +396,8 @@ bool kart_over_ground = m_physics->projectKartDownwards(kart); if(kart_over_ground) { - const Vec3 &xyz = kart->getTrans().getOrigin()+Vec3(0,0.3f,0); + const Vec3 &xyz = kart->getTrans().getOrigin() + + Vec3(0,0.3f,0); ((TerrainInfo*)kart)->update(xyz); const Material *material = kart->getMaterial(); if(!material || material->isDriveReset()) @@ -435,7 +440,9 @@ if (!kart_over_ground) { - fprintf(stderr, "ERROR: no valid starting position for kart %d on track %s.\n", + fprintf(stderr, + "ERROR: no valid starting position for kart %d " + "on track %s.\n", (int)(i-m_karts.begin()), m_track->getIdent().c_str()); if (UserConfigParams::m_artist_debug_mode) { @@ -485,8 +492,11 @@ &normal); if(!material) { - fprintf(stderr, "ERROR: no valid starting position for kart %d on track %s.\n", - (int)(i-m_karts.begin()), m_track->getIdent().c_str()); + fprintf(stderr, + "ERROR: no valid starting position for " + "kart %d on track %s.\n", + (int)(i-m_karts.begin()), + m_track->getIdent().c_str()); if (UserConfigParams::m_artist_debug_mode) { fprintf(stderr, "Activating fly mode.\n"); @@ -663,7 +673,8 @@ * score, if so it notifies the HighscoreManager so the new score is added * and saved. */ -void World::updateHighscores(int* best_highscore_rank, int* best_finish_time, std::string* highscore_who, +void World::updateHighscores(int* best_highscore_rank, int* best_finish_time, + std::string* highscore_who, StateManager::ActivePlayer** best_player) { *best_highscore_rank = -1; @@ -701,14 +712,17 @@ fprintf(stderr, "Error, incorrect kart positions:\n"); for (unsigned int i=0; i<m_karts.size(); i++ ) { - fprintf(stderr, "i=%d position %d\n",i, m_karts[i]->getPosition()); + fprintf(stderr, "i=%d position %d\n",i, + m_karts[i]->getPosition()); } #endif continue; } - // Only record times for player karts and only if they finished the race - if(!m_karts[index[pos]]->getController()->isPlayerController()) continue; + // Only record times for player karts and only if + // they finished the race + if(!m_karts[index[pos]]->getController()->isPlayerController()) + continue; if (!m_karts[index[pos]]->hasFinishedRace()) continue; assert(index[pos] >= 0); @@ -720,12 +734,13 @@ PlayerController *controller = (PlayerController*)(k->getController()); int highscore_rank = highscores->addData(k->getIdent(), - controller->getPlayer()->getProfile()->getName(), + controller->getPlayer()->getProfile()->getName(), k->getFinishTime()); if (highscore_rank > 0) { - if (*best_highscore_rank == -1 || highscore_rank < *best_highscore_rank) + if (*best_highscore_rank == -1 || + highscore_rank < *best_highscore_rank) { *best_highscore_rank = highscore_rank; *best_finish_time = (int)(k->getFinishTime()); @@ -768,7 +783,8 @@ const int kart_count = m_karts.size(); for(int i=0; i<kart_count; i++) { - if(m_karts[i]->getCamera() && m_karts[i]->getController()->isPlayerController()) + if(m_karts[i]->getCamera() && + m_karts[i]->getController()->isPlayerController()) { count++; if(count == (int)n) return m_karts[i]; @@ -779,24 +795,27 @@ //----------------------------------------------------------------------------- /** Remove (eliminate) a kart from the race */ -void World::eliminateKart(int kart_number, bool notifyOfElimination, bool remove) +void World::eliminateKart(int kart_number, bool notify_of_elimination, + bool remove) { Kart *kart = m_karts[kart_number]; // Display a message about the eliminated kart in the race gui - if (notifyOfElimination) + if (notify_of_elimination) { - for (KartList::iterator i = m_karts.begin(); i != m_karts.end(); i++ ) + for (KartList::iterator i = m_karts.begin(); i != m_karts.end(); i++ ) { if(!(*i)->getCamera()) continue; if(*i==kart) { - m_race_gui->addMessage(_("You have been eliminated!"), *i, 2.0f); + m_race_gui->addMessage(_("You have been eliminated!"), *i, + 2.0f); } else { m_race_gui->addMessage(_("'%s' has been eliminated.", - core::stringw(kart->getName())), *i, 2.0f); + core::stringw(kart->getName())), *i, + 2.0f); } } // for i in kart } @@ -898,7 +917,8 @@ // Note that we can not test for isPlayerController here, since // an EndController will also return 'isPlayerController' if the // kart belonged to a player. - PlayerController *pc = dynamic_cast<PlayerController*>(m_karts[i]->getController()); + PlayerController *pc = + dynamic_cast<PlayerController*>(m_karts[i]->getController()); if(pc) pc->resetInputState(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-09-26 22:11:36
|
Revision: 9897 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9897&view=rev Author: hikerstk Date: 2011-09-26 22:11:30 +0000 (Mon, 26 Sep 2011) Log Message: ----------- Update the kart translation after it was reset at the start of the race. This way getXYZ() and getTrans() now report the correct position after the kart were reset, before the first frame (i.e. before Moveable::update() is called the first time). This caused the referee position to be inconsistent between tracks (and this will for now cause the referee position to be bad ... but at least the same bad in all tracks ;) ). Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2011-09-26 22:08:10 UTC (rev 9896) +++ main/trunk/src/modes/world.cpp 2011-09-26 22:11:30 UTC (rev 9897) @@ -514,16 +514,22 @@ } } // while - // Now store the current (i.e. in rest) suspension length for each kart, - // so that the karts can visualise the suspension. for ( KartList::iterator i=m_karts.begin(); i!=m_karts.end(); i++) + { + // Now store the current (i.e. in rest) suspension length for each + // kart, so that the karts can visualise the suspension. (*i)->setSuspensionLength(); - for(unsigned int i=0; i<m_karts.size(); i++) - if(m_karts[i]->getCamera()) - m_karts[i]->getCamera()->setInitialTransform(); + // Initialise the camera (if available), now that the correct + // kart position is set + if((*i)->getCamera()) + (*i)->getCamera()->setInitialTransform(); + // Update the kart transforms with the newly computed position + // after all karts are reset + (*i)->setTrans((*i)->getBody()->getWorldTransform()); + } } // resetAllKarts - +// ---------------------------------------------------------------------------- void World::schedulePause(Phase phase) { if (m_schedule_unpause) @@ -535,8 +541,9 @@ m_schedule_pause = true; m_scheduled_pause_phase = phase; } -} +} // schedulePause +// ---------------------------------------------------------------------------- void World::scheduleUnpause() { if (m_schedule_pause) @@ -547,7 +554,7 @@ { m_schedule_unpause = true; } -} +} // scheduleUnpause //----------------------------------------------------------------------------- /** This is the main interface to update the world. This function calls This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-10-07 09:11:40
|
Revision: 9954 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9954&view=rev Author: hikerstk Date: 2011-10-07 09:11:34 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Enabled the debug keys F? in profile mode as well, allowing people to give the AI certain items (it also avoids a crash if one of the F? keys is pressed in profile mode). Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2011-10-06 23:25:25 UTC (rev 9953) +++ main/trunk/src/modes/world.cpp 2011-10-07 09:11:34 UTC (rev 9954) @@ -39,6 +39,7 @@ #include "karts/controller/player_controller.hpp" #include "karts/controller/end_controller.hpp" #include "karts/kart_properties_manager.hpp" +#include "modes/profile_world.hpp" #include "network/network_manager.hpp" #include "network/race_state.hpp" #include "physics/btKart.hpp" @@ -781,7 +782,9 @@ } // getPlayerKart //----------------------------------------------------------------------------- -/** Returns the nth local player kart, i.e. a player kart that has a camera. +/** Returns the nth local player kart, i.e. a kart that has a camera. + * Note that in profile mode this means a non player kart could be returned + * (since an AI kart will have the camera). * \param n Index of player kart to return. */ Kart *World::getLocalPlayerKart(unsigned int n) const @@ -791,7 +794,8 @@ for(int i=0; i<kart_count; i++) { if(m_karts[i]->getCamera() && - m_karts[i]->getController()->isPlayerController()) + (m_karts[i]->getController()->isPlayerController() || + ProfileWorld::isProfileMode() ) ) { count++; if(count == (int)n) return m_karts[i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-02-06 02:55:48
|
Revision: 10811 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10811&view=rev Author: auria Date: 2012-02-06 02:55:41 +0000 (Mon, 06 Feb 2012) Log Message: ----------- Revert change I did that introduced bug Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2012-02-05 22:33:17 UTC (rev 10810) +++ main/trunk/src/modes/world.cpp 2012-02-06 02:55:41 UTC (rev 10811) @@ -594,14 +594,11 @@ m_phase == IN_GAME_MENU_PHASE ) return; + update(dt); if( (!isFinishPhase()) && isRaceOver()) { enterRaceOverState(); } - else - { - update(dt); - } } // updateWorld #define MEASURE_FPS 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2012-05-20 00:29:09
|
Revision: 11252 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11252&view=rev Author: hikerstk Date: 2012-05-20 00:29:03 +0000 (Sun, 20 May 2012) Log Message: ----------- Fixed #634 - crash when exiting a game with ghost (ghost karts were not removed, causing problems when drawing all later). Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2012-05-20 00:19:19 UTC (rev 11251) +++ main/trunk/src/modes/world.cpp 2012-05-20 00:29:03 UTC (rev 11252) @@ -265,6 +265,16 @@ //----------------------------------------------------------------------------- World::~World() { + if(ReplayPlay::get()) + { + // Destroy the old replay object, which also stored the ghost + // karts, and create a new one (which means that in further + // races the usage of ghosts will still be enabled). + ReplayPlay::destroy(); + ReplayPlay::create(); + } + + // In case that a race is aborted (e.g. track not found) m_track is 0. if(m_track) m_track->cleanup(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2012-08-13 01:09:31
|
Revision: 11504 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11504&view=rev Author: hikerstk Date: 2012-08-13 01:09:25 +0000 (Mon, 13 Aug 2012) Log Message: ----------- Disable new skidding AI, which was committed accidentally. Modified Paths: -------------- main/trunk/src/modes/world.cpp Modified: main/trunk/src/modes/world.cpp =================================================================== --- main/trunk/src/modes/world.cpp 2012-08-13 00:25:30 UTC (rev 11503) +++ main/trunk/src/modes/world.cpp 2012-08-13 01:09:25 UTC (rev 11504) @@ -245,9 +245,9 @@ // const int NUM_ROBOTS = 1; // For now: instead of random switching, use each // robot in turns: switch(m_random.get(NUM_ROBOTS)) -#undef USE_PRESENT_AI -#define USE_SKIDDING_AI -#undef USE_ALL_AIS +#define USE_PRESENT_AI +#undef USE_SKIDDING_AI +#undef USE_ALL_AIS #ifdef USE_PRESENT_AI int turn = 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |