From: <xa...@us...> - 2010-05-10 15:41:17
|
Revision: 5419 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5419&view=rev Author: xapantu Date: 2010-05-10 15:41:10 +0000 (Mon, 10 May 2010) Log Message: ----------- (maybe it is a mistake) revert karts animations Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-05-10 03:20:42 UTC (rev 5418) +++ main/trunk/src/karts/kart_model.cpp 2010-05-10 15:41:10 UTC (rev 5419) @@ -312,10 +312,10 @@ static int last_end=-1; if(steer>0.0f) end = m_animation_frame[AF_STRAIGHT] - (int)( ( m_animation_frame[AF_STRAIGHT] - -m_animation_frame[AF_LEFT] )*steer); + -m_animation_frame[AF_RIGHT] )*steer); else if(steer<0.0f) end = m_animation_frame[AF_STRAIGHT] + (int) ( (m_animation_frame[AF_STRAIGHT] - -m_animation_frame[AF_RIGHT] )*steer); + -m_animation_frame[AF_LEFT] )*steer); else end = m_animation_frame[AF_STRAIGHT]; // No changes to current frame loop This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-06-29 22:58:27
|
Revision: 5593 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5593&view=rev Author: hikerstk Date: 2010-06-29 22:58:20 +0000 (Tue, 29 Jun 2010) Log Message: ----------- Switch win/lose animation off when restarting a race. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-06-29 17:13:46 UTC (rev 5592) +++ main/trunk/src/karts/kart_model.cpp 2010-06-29 22:58:20 UTC (rev 5593) @@ -253,7 +253,7 @@ if(!UserConfigParams::m_show_steering_animations) return; m_current_animation = type; - if(!m_current_animation==AF_DEFAULT) + if(m_current_animation==AF_DEFAULT) { m_animated_node->setLoopMode(false); m_animated_node->setFrameLoop(m_animation_frame[AF_STRAIGHT], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-07 23:06:27
|
Revision: 5916 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5916&view=rev Author: hikerstk Date: 2010-09-07 23:06:21 +0000 (Tue, 07 Sep 2010) Log Message: ----------- Added more debug output in case of an assert that was triggered. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-07 23:05:31 UTC (rev 5915) +++ main/trunk/src/karts/kart_model.cpp 2010-09-07 23:06:21 UTC (rev 5916) @@ -305,8 +305,14 @@ // It should be a non-default type of animation, and should have // a non negative frame (i.e. the animation is indeed defined). - assert(m_current_animation!=AF_DEFAULT); - assert(m_animation_frame[m_current_animation]>-1 ); + if(m_current_animation==AF_DEFAULT || + m_animation_frame[m_current_animation]<=-1) + { + printf("OnAnimationEnd for '%s': current %d frame %d\n", + m_model_filename.c_str(), + m_current_animation, m_animation_frame[m_current_animation]); + assert(false); + } // 'type' is the start frame of the animation, type + 1 the frame // to begin the loop with, type + 2 to end the frame with This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-09 12:19:12
|
Revision: 5948 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5948&view=rev Author: hikerstk Date: 2010-09-09 12:19:06 +0000 (Thu, 09 Sep 2010) Log Message: ----------- 1) Fixed crash when exiting STK. 2) Added grab and drop, since now the order in which the kart node and wheel nodes are released does not matter anymore. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-09 06:05:16 UTC (rev 5947) +++ main/trunk/src/karts/kart_model.cpp 2010-09-09 12:19:06 UTC (rev 5948) @@ -49,6 +49,7 @@ m_wheel_physics_position[i] = Vec3(UNDEFINED); m_wheel_graphics_radius[i] = 0.0f; // for kart without separate wheels m_wheel_model[i] = NULL; + m_wheel_node[i] = NULL; // default value for kart suspensions. move to config file later if we find each kart needs custom values m_min_suspension[i] = -1.3f; m_max_suspension[i] = 1.3f; @@ -106,8 +107,8 @@ { for(unsigned int i=0; i<4; i++) { - m_wheel_node[i]->remove(); - //m_wheel_node[i]->drop(); + if(m_wheel_node[i]) + m_wheel_node[i]->drop(); } } // ~KartModel @@ -143,6 +144,7 @@ { m_wheel_node[i] = irr_driver->addMesh(m_wheel_model[i], *node); + m_wheel_node[i]->grab(); #ifdef DEBUG std::string debug_name = m_wheel_filename[i]+" (wheel)"; m_wheel_node[i]->setName(debug_name.c_str()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-12 14:04:01
|
Revision: 5970 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5970&view=rev Author: hikerstk Date: 2010-09-12 14:03:55 +0000 (Sun, 12 Sep 2010) Log Message: ----------- Fixed missing animation, but this is still work-in-progress. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-12 13:52:47 UTC (rev 5969) +++ main/trunk/src/karts/kart_model.cpp 2010-09-12 14:03:55 UTC (rev 5970) @@ -139,6 +139,10 @@ KartModel* KartModel::makeCopy() { KartModel *km = new KartModel(/*is master*/ false); + memcpy(km, this, sizeof(KartModel)); + // We need to set this again, since memcpy will overwrite it. + km->m_is_master = false; +#ifdef XX km->m_kart_height = m_kart_height; km->m_kart_length = m_kart_length; km->m_kart_width = m_kart_width; @@ -155,6 +159,7 @@ km->m_wheel_physics_position[i] = m_wheel_physics_position[i]; km->m_z_offset = m_z_offset; } +#endif return km; } // makeCopy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-12 23:33:09
|
Revision: 5975 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5975&view=rev Author: hikerstk Date: 2010-09-12 23:33:03 +0000 (Sun, 12 Sep 2010) Log Message: ----------- Bugfix: memcpy would copy only pointers to some strings which I had missed, causing potentially memory corruption. Added more asserts to make sure 'master instances' are never used for karts shown on the screen. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-12 17:06:40 UTC (rev 5974) +++ main/trunk/src/karts/kart_model.cpp 2010-09-12 23:33:03 UTC (rev 5975) @@ -63,6 +63,7 @@ m_wheel_graphics_radius[i] = 0.0f; // for kart without separate wheels m_wheel_model[i] = NULL; m_wheel_node[i] = NULL; + // default value for kart suspensions. move to config file later if we find each kart needs custom values m_min_suspension[i] = -1.3f; m_max_suspension[i] = 1.3f; @@ -72,6 +73,7 @@ m_wheel_filename[1] = "wheel-front-left.3ds"; m_wheel_filename[2] = "wheel-rear-right.3ds"; m_wheel_filename[3] = "wheel-rear-left.3ds"; + m_animated_node = NULL; m_mesh = NULL; for(unsigned int i=AF_BEGIN; i<=AF_END; i++) m_animation_frame[i]=-1; @@ -138,28 +140,36 @@ */ KartModel* KartModel::makeCopy() { - KartModel *km = new KartModel(/*is master*/ false); - memcpy(km, this, sizeof(KartModel)); - // We need to set this again, since memcpy will overwrite it. - km->m_is_master = false; -#ifdef XX - km->m_kart_height = m_kart_height; - km->m_kart_length = m_kart_length; - km->m_kart_width = m_kart_width; - km->m_mesh = m_mesh; - km->m_model_filename = m_model_filename; + // Make sure that we are copying from a master objects, and + // that there is indeed no animated node defined here ... + // just in case. + assert(m_is_master); + assert(!m_animated_node); + KartModel *km = new KartModel(/*is master*/ false); + km->m_kart_width = m_kart_width; + km->m_kart_length = m_kart_length; + km->m_kart_height = m_kart_height; + km->m_z_offset = m_z_offset; + km->m_mesh = m_mesh; + km->m_model_filename = m_model_filename; + km->m_animation_speed = m_animation_speed; + km->m_current_animation = AF_DEFAULT; for(unsigned int i=0; i<4; i++) { - km->m_max_suspension[i] = m_max_suspension[i]; - km->m_min_suspension[i] = m_min_suspension[i]; - km->m_wheel_filename[i] = m_wheel_filename[i]; km->m_wheel_model[i] = m_wheel_model[i]; - km->m_wheel_graphics_position[i] = m_wheel_graphics_position[i]; - km->m_wheel_graphics_radius[i] = m_wheel_graphics_radius[i]; - km->m_wheel_physics_position[i] = m_wheel_physics_position[i]; - km->m_z_offset = m_z_offset; + // Master should not have any wheel nodes. + assert(!m_wheel_node[i]); + km->m_wheel_filename[i] = m_wheel_filename[i]; + km->m_wheel_graphics_position[i] = m_wheel_graphics_position[i]; + km->m_wheel_physics_position[i] = m_wheel_physics_position[i]; + km->m_wheel_graphics_radius[i] = m_wheel_graphics_radius[i]; + km->m_min_suspension[i] = m_min_suspension[i]; + km->m_max_suspension[i] = m_max_suspension[i]; + km->m_dampen_suspension_amplitude[i]= m_dampen_suspension_amplitude[i]; } -#endif + for(unsigned int i=AF_BEGIN; i<=AF_END; i++) + km->m_animation_frame[i] = m_animation_frame[i]; + return km; } // makeCopy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-17 05:23:40
|
Revision: 6036 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6036&view=rev Author: hikerstk Date: 2010-09-17 05:23:34 +0000 (Fri, 17 Sep 2010) Log Message: ----------- Removed compiler warning. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-17 01:38:31 UTC (rev 6035) +++ main/trunk/src/karts/kart_model.cpp 2010-09-17 05:23:34 UTC (rev 6036) @@ -461,7 +461,7 @@ else if(steer<0.0f) frame = m_animation_frame[AF_STRAIGHT] + ( (m_animation_frame[AF_STRAIGHT] -m_animation_frame[AF_LEFT] )*steer); - else frame = m_animation_frame[AF_STRAIGHT]; + else frame = (float)m_animation_frame[AF_STRAIGHT]; m_animated_node->setCurrentFrame(frame); } // update This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-17 12:18:11
|
Revision: 6038 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6038&view=rev Author: hikerstk Date: 2010-09-17 12:18:05 +0000 (Fri, 17 Sep 2010) Log Message: ----------- Removed warnings when loading a kart without wheels. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-17 05:24:39 UTC (rev 6037) +++ main/trunk/src/karts/kart_model.cpp 2010-09-17 12:18:05 UTC (rev 6038) @@ -70,10 +70,10 @@ m_max_suspension[i] = 1.3f; m_dampen_suspension_amplitude[i] = 2.5f; } - m_wheel_filename[0] = "wheel-front-right.3ds"; - m_wheel_filename[1] = "wheel-front-left.3ds"; - m_wheel_filename[2] = "wheel-rear-right.3ds"; - m_wheel_filename[3] = "wheel-rear-left.3ds"; + m_wheel_filename[0] = ""; + m_wheel_filename[1] = ""; + m_wheel_filename[2] = ""; + m_wheel_filename[3] = ""; m_animated_node = NULL; m_mesh = NULL; for(unsigned int i=AF_BEGIN; i<=AF_END; i++) @@ -257,6 +257,8 @@ // depend on the size of the model. for(unsigned int i=0; i<4; i++) { + // For kart models without wheels. + if(m_wheel_filename[i]=="") continue; std::string full_wheel = kart_properties.getKartDir()+"/"+m_wheel_filename[i]; m_wheel_model[i] = irr_driver->getMesh(full_wheel); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-19 10:55:40
|
Revision: 6056 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6056&view=rev Author: hikerstk Date: 2010-09-19 10:55:34 +0000 (Sun, 19 Sep 2010) Log Message: ----------- Fixed crash which happens if an end animation is playing in its non-looped part when the world is deleted (bug 3067944). Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-18 23:11:22 UTC (rev 6055) +++ main/trunk/src/karts/kart_model.cpp 2010-09-19 10:55:34 UTC (rev 6056) @@ -121,6 +121,7 @@ */ KartModel::~KartModel() { + m_animated_node->setAnimationEndCallback(NULL); for(unsigned int i=0; i<4; i++) { if(m_wheel_node[i]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-20 23:27:55
|
Revision: 6094 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6094&view=rev Author: hikerstk Date: 2010-09-20 23:27:49 +0000 (Mon, 20 Sep 2010) Log Message: ----------- Added grab/drop to avoid that the animated scene node of which a copy is used is not accidentally deleted. Also initialised m_animated_node with zero to handle incorrect usages of the kart model. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-09-20 23:13:27 UTC (rev 6093) +++ main/trunk/src/karts/kart_model.cpp 2010-09-20 23:27:49 UTC (rev 6094) @@ -121,7 +121,9 @@ */ KartModel::~KartModel() { - m_animated_node->setAnimationEndCallback(NULL); + if(m_animated_node) + m_animated_node->setAnimationEndCallback(NULL); + m_animated_node->drop(); for(unsigned int i=0; i<4; i++) { if(m_wheel_node[i]) @@ -155,6 +157,7 @@ km->m_model_filename = m_model_filename; km->m_animation_speed = m_animation_speed; km->m_current_animation = AF_DEFAULT; + km->m_animated_node = NULL; for(unsigned int i=0; i<4; i++) { km->m_wheel_model[i] = m_wheel_model[i]; @@ -186,6 +189,7 @@ *node = irr_driver->addAnimatedMesh(m_mesh); m_animated_node = static_cast<scene::IAnimatedMeshSceneNode*>(*node); m_animated_node->setLoopMode(false); + m_animated_node->grab(); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-10-12 10:01:58
|
Revision: 6275 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6275&view=rev Author: hikerstk Date: 2010-10-12 10:01:52 +0000 (Tue, 12 Oct 2010) Log Message: ----------- Fixed animation in GP end screen (where karts would always look to their right). Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-10-12 08:33:51 UTC (rev 6274) +++ main/trunk/src/karts/kart_model.cpp 2010-10-12 10:01:52 UTC (rev 6275) @@ -116,6 +116,7 @@ loadWheelInfo(*wheels_node, "rear-left", 3); } } // loadInfo + // ---------------------------------------------------------------------------- /** Destructor. */ @@ -356,6 +357,7 @@ m_animated_node->setFrameLoop(m_animation_frame[AF_RIGHT], m_animation_frame[AF_LEFT] ); m_animated_node->setAnimationEndCallback(NULL); + m_animated_node->setAnimationSpeed(0); } else if(m_animation_frame[type]>-1) { @@ -370,7 +372,7 @@ m_animated_node->setLoopMode(false); m_animated_node->setAnimationEndCallback(this); } -} // setEndAnimation +} // setAnimation // ---------------------------------------------------------------------------- /** Called from irrlicht when a non-looped animation ends. This is used to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-11-19 21:48:05
|
Revision: 6653 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6653&view=rev Author: auria Date: 2010-11-19 21:47:59 +0000 (Fri, 19 Nov 2010) Log Message: ----------- Fixed bug when kart animations are disabled + a kart.xml file points o a bad model - don't crash Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-11-19 21:44:20 UTC (rev 6652) +++ main/trunk/src/karts/kart_model.cpp 2010-11-19 21:47:59 UTC (rev 6653) @@ -230,15 +230,22 @@ { std::string full_path = kart_properties.getKartDir()+"/"+m_model_filename; m_mesh = irr_driver->getAnimatedMesh(full_path); - if(!UserConfigParams::m_show_steering_animations) - m_mesh->setHardwareMappingHint(scene::EHM_STATIC); - Vec3 min, max; + if(!m_mesh) { printf("Problems loading mesh '%s' - kart '%s' will not be available\n", full_path.c_str(), kart_properties.getIdent().c_str()); return false; } + else + { + if (!UserConfigParams::m_show_steering_animations) + { + m_mesh->setHardwareMappingHint(scene::EHM_STATIC); + } + } + + Vec3 min, max; MeshTools::minMax3D(m_mesh, &min, &max); Vec3 size = max-min; m_kart_width = size.getX(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-12-18 23:23:08
|
Revision: 7079 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=7079&view=rev Author: auria Date: 2010-12-18 23:05:27 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Removed dbeug print that shouldn't have been printed Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2010-12-18 23:04:22 UTC (rev 7078) +++ main/trunk/src/karts/kart_model.cpp 2010-12-18 23:05:27 UTC (rev 7079) @@ -252,8 +252,6 @@ m_kart_width = size.getX(); m_kart_height = size.getY(); m_kart_length = size.getZ(); - - printf("<%s> : %f, %f, %f\n", m_model_filename.c_str(), m_kart_width, m_kart_height, m_kart_length); // Now set default some default parameters (if not defined) that // depend on the size of the kart model (wheel position, center This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-04-19 22:58:58
|
Revision: 8386 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8386&view=rev Author: hikerstk Date: 2011-04-19 22:58:52 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Added assert (mainly to document when this function is being called). Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-04-19 22:57:52 UTC (rev 8385) +++ main/trunk/src/karts/kart_model.cpp 2011-04-19 22:58:52 UTC (rev 8386) @@ -247,6 +247,7 @@ */ bool KartModel::loadModels(const KartProperties &kart_properties) { + assert(m_is_master); std::string full_path = kart_properties.getKartDir()+"/"+m_model_filename; m_mesh = irr_driver->getAnimatedMesh(full_path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-04-22 23:10:15
|
Revision: 8417 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8417&view=rev Author: auria Date: 2011-04-22 23:10:08 +0000 (Fri, 22 Apr 2011) Log Message: ----------- Fix crash when skeleton debug mode is enabled Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-04-22 23:01:21 UTC (rev 8416) +++ main/trunk/src/karts/kart_model.cpp 2011-04-22 23:10:08 UTC (rev 8417) @@ -27,6 +27,8 @@ #include "karts/kart.hpp" #include "utils/constants.hpp" +#define SKELETON_DEBUG 1 + float KartModel::UNDEFINED = -99.9f; /** Default constructor which initialises all variables with defaults. @@ -140,6 +142,12 @@ } } +#ifdef DEBUG +#if SKELETON_DEBUG + irr_driver->debug_meshes.clear(); +#endif +#endif + } // ~KartModel // ---------------------------------------------------------------------------- @@ -185,8 +193,6 @@ // ---------------------------------------------------------------------------- -#define SKELETON_DEBUG 0 - /** Attach the kart model and wheels to the scene node. * \return the node with the model attached */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-24 23:00:02
|
Revision: 9046 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9046&view=rev Author: auria Date: 2011-06-24 22:59:55 +0000 (Fri, 24 Jun 2011) Log Message: ----------- Hopefully fixed swatter crash Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-06-24 22:57:06 UTC (rev 9045) +++ main/trunk/src/karts/kart_model.cpp 2011-06-24 22:59:55 UTC (rev 9046) @@ -546,5 +546,7 @@ /** Scales the kart model by a certain amount. */ void KartModel::scaleKart(const Vec3 &s) { - m_animated_node->setScale(s.toIrrVector()); -} // squashKart \ No newline at end of file + if (m_animated_node) + m_animated_node->setScale(s.toIrrVector()); +} // scaleKart + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-10-10 05:42:02
|
Revision: 9964 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9964&view=rev Author: hikerstk Date: 2011-10-10 05:41:55 +0000 (Mon, 10 Oct 2011) Log Message: ----------- Fixed #457: crash after battle mode. Texture ref counting was not done correctly, resulting in wheel textures to be freed even though the textures were still used (in the master kart models). Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-10-10 04:30:18 UTC (rev 9963) +++ main/trunk/src/karts/kart_model.cpp 2011-10-10 05:41:55 UTC (rev 9964) @@ -136,14 +136,17 @@ m_animated_node->drop(); } - for(unsigned int i=0; i<4; i++) + for(unsigned int i=0; i<4; i++) { if(m_wheel_node[i]) { // Master KartModels should never have a wheel attached. assert(!m_is_master); + m_wheel_node[i]->drop(); } + if(m_is_master && m_wheel_model[i]) + irr_driver->dropAllTextures(m_wheel_model[i]); } #ifdef DEBUG @@ -313,7 +316,10 @@ std::string full_wheel = kart_properties.getKartDir()+"/"+m_wheel_filename[i]; m_wheel_model[i] = irr_driver->getMesh(full_wheel); - // FIXME: wheel handling still missing. + // Grab all textures. This is done for the master only, so + // the destructor will only free the textures if a master + // copy is freed. + irr_driver->grabAllTextures(m_wheel_model[i]); } // for i<4 return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-10-14 05:35:43
|
Revision: 9982 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9982&view=rev Author: hikerstk Date: 2011-10-14 05:35:37 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Fix crash when installing a new kart (#459). Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-10-13 22:55:53 UTC (rev 9981) +++ main/trunk/src/karts/kart_model.cpp 2011-10-14 05:35:37 UTC (rev 9982) @@ -145,8 +145,19 @@ m_wheel_node[i]->drop(); } - if(m_is_master && m_wheel_model[i]) - irr_driver->dropAllTextures(m_wheel_model[i]); + // For now don't drop the textures: note that the mesh is not + // dropped either (which enables a reload of kart_properties + // without reading the full mesh again when a new addon is + // installed, see KartPropertiesManager::reLoadAllKarts). + // Therefore if the textures are dropped here, the mesh would + // reference a freed texture, causing a crash. + // While this potentially causes a memory leak, this is not + // important since all kart meshes and all textures they use + // are around till the very end of STK. The textures stay in + // irrlicht's texture cache, and will be freed on exit. + //if(m_is_master && m_wheel_model[i]) + // irr_driver->dropAllTextures(m_wheel_model[i]); + } #ifdef DEBUG This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-11-22 00:18:57
|
Revision: 10235 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10235&view=rev Author: hikerstk Date: 2011-11-22 00:18:51 +0000 (Tue, 22 Nov 2011) Log Message: ----------- Try to fix #504: the wheel model was not freed, resulting in using textures which were not reloaded (since the mesh was taken from the mesh cache). Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-11-21 22:24:40 UTC (rev 10234) +++ main/trunk/src/karts/kart_model.cpp 2011-11-22 00:18:51 UTC (rev 10235) @@ -147,7 +147,7 @@ } if(m_is_master && m_wheel_model[i]) irr_driver->dropAllTextures(m_wheel_model[i]); - + irr_driver->removeMeshFromCache(m_wheel_model[i]); } if(m_is_master) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-11-22 05:24:46
|
Revision: 10238 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10238&view=rev Author: hikerstk Date: 2011-11-22 05:24:39 +0000 (Tue, 22 Nov 2011) Log Message: ----------- Bugfix for the bugfix r10235 for #504 (stk would crash when the kart selection menu is shown next time after a race). Revision Links: -------------- http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10235&view=rev Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-11-22 04:33:23 UTC (rev 10237) +++ main/trunk/src/karts/kart_model.cpp 2011-11-22 05:24:39 UTC (rev 10238) @@ -146,8 +146,10 @@ m_wheel_node[i]->drop(); } if(m_is_master && m_wheel_model[i]) + { irr_driver->dropAllTextures(m_wheel_model[i]); - irr_driver->removeMeshFromCache(m_wheel_model[i]); + irr_driver->removeMeshFromCache(m_wheel_model[i]); + } } if(m_is_master) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-12-03 23:19:55
|
Revision: 10316 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10316&view=rev Author: auria Date: 2011-12-03 23:19:49 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Avoid referencing a null pointer when kart loading failed Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2011-12-03 22:12:06 UTC (rev 10315) +++ main/trunk/src/karts/kart_model.cpp 2011-12-03 23:19:49 UTC (rev 10316) @@ -153,7 +153,7 @@ } } - if(m_is_master) + if(m_is_master && m_mesh != NULL) { irr_driver->dropAllTextures(m_mesh); irr_driver->removeMeshFromCache(m_mesh); @@ -284,13 +284,13 @@ assert(m_is_master); std::string full_path = kart_properties.getKartDir()+"/"+m_model_filename; m_mesh = irr_driver->getAnimatedMesh(full_path); - irr_driver->grabAllTextures(m_mesh); if(!m_mesh) { printf("Problems loading mesh '%s' - kart '%s' will not be available\n", - full_path.c_str(), kart_properties.getIdent().c_str()); + full_path.c_str(), kart_properties.getIdent().c_str()); return false; } + irr_driver->grabAllTextures(m_mesh); Vec3 min, max; MeshTools::minMax3D(m_mesh->getMesh(m_animation_frame[AF_STRAIGHT]), &min, &max); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2012-11-12 06:25:42
|
Revision: 11924 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11924&view=rev Author: hikerstk Date: 2012-11-12 06:25:36 +0000 (Mon, 12 Nov 2012) Log Message: ----------- Physics-debug would crash when a GP is finished. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2012-11-11 21:56:54 UTC (rev 11923) +++ main/trunk/src/karts/kart_model.cpp 2012-11-12 06:25:36 UTC (rev 11924) @@ -531,7 +531,7 @@ { if(!m_wheel_node[i]) continue; #ifdef DEBUG - if(UserConfigParams::m_physics_debug) + if(UserConfigParams::m_physics_debug && m_kart) { // Make wheels that are not touching the ground invisible bool wheel_has_contact = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2012-11-23 11:39:07
|
Revision: 12054 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12054&view=rev Author: hikerstk Date: 2012-11-23 11:38:56 +0000 (Fri, 23 Nov 2012) Log Message: ----------- Changed minimum and maximum visual suspension, and fixed algorithm to compute visual suspension - this should fix #794 (wheels sometimes in kart). Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2012-11-23 00:34:40 UTC (rev 12053) +++ main/trunk/src/karts/kart_model.cpp 2012-11-23 11:38:56 UTC (rev 12054) @@ -76,8 +76,8 @@ // default value for kart suspensions. move to config file later // if we find each kart needs custom values - m_min_suspension[i] = -1.3f; - m_max_suspension[i] = 1.3f; + m_min_suspension[i] = -0.59f; + m_max_suspension[i] = 0.59f; m_dampen_suspension_amplitude[i] = 2.5f; } m_wheel_filename[0] = ""; @@ -514,15 +514,16 @@ // limit amplitude between set limits, first dividing it by a // somewhat arbitrary constant to reduce visible wheel movement - clamped_suspension[i] = std::min(std::max(suspension[i]/m_dampen_suspension_amplitude[i], - m_min_suspension[i]), - m_max_suspension[i]); + clamped_suspension[i] = suspension[i]/m_dampen_suspension_amplitude[i]; float ratio = clamped_suspension[i] / suspension_length; const int sign = ratio < 0 ? -1 : 1; // expanded form of 1 - (1 - x)^2, i.e. making suspension display // quadratic and not linear ratio = sign * fabsf(ratio*(2-ratio)); - clamped_suspension[i] = ratio*suspension_length; +// clamped_suspension[i] = ratio*suspension_length; + clamped_suspension[i] = std::min(std::max(ratio*suspension_length, + m_min_suspension[i]), + m_max_suspension[i]); } // for i<4 core::vector3df wheel_steer(0, steer*30.0f, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2013-01-24 06:13:24
|
Revision: 12411 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12411&view=rev Author: hikerstk Date: 2013-01-24 06:13:16 +0000 (Thu, 24 Jan 2013) Log Message: ----------- Removed more "//" in paths. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2013-01-23 23:45:43 UTC (rev 12410) +++ main/trunk/src/karts/kart_model.cpp 2013-01-24 06:13:16 UTC (rev 12411) @@ -342,7 +342,7 @@ bool KartModel::loadModels(const KartProperties &kart_properties) { assert(m_is_master); - std::string full_path = kart_properties.getKartDir()+"/"+m_model_filename; + std::string full_path = kart_properties.getKartDir()+m_model_filename; m_mesh = irr_driver->getAnimatedMesh(full_path); if(!m_mesh) { @@ -384,7 +384,7 @@ // For kart models without wheels. if(m_wheel_filename[i]=="") continue; std::string full_wheel = - kart_properties.getKartDir()+"/"+m_wheel_filename[i]; + kart_properties.getKartDir()+m_wheel_filename[i]; m_wheel_model[i] = irr_driver->getMesh(full_wheel); // Grab all textures. This is done for the master only, so // the destructor will only free the textures if a master This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2013-02-17 11:26:59
|
Revision: 12499 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12499&view=rev Author: hikerstk Date: 2013-02-17 11:26:52 +0000 (Sun, 17 Feb 2013) Log Message: ----------- Bugfix: STK would crash if the same kart mesh is used twice (e.g. when just copying a kart folder). Thanks to funto for reporting this. Modified Paths: -------------- main/trunk/src/karts/kart_model.cpp Modified: main/trunk/src/karts/kart_model.cpp =================================================================== --- main/trunk/src/karts/kart_model.cpp 2013-02-17 09:23:16 UTC (rev 12498) +++ main/trunk/src/karts/kart_model.cpp 2013-02-17 11:26:52 UTC (rev 12499) @@ -169,7 +169,11 @@ } } - if(m_is_master && m_mesh != NULL) + m_mesh->drop(); + + // If there is only one copy left, it's the copy in irrlicht's + // mesh cache, so it can be remove. + if(m_is_master && m_mesh != NULL && m_mesh->getReferenceCount()==1) { irr_driver->dropAllTextures(m_mesh); irr_driver->removeMeshFromCache(m_mesh); @@ -351,6 +355,7 @@ full_path.c_str(), kart_properties.getIdent().c_str()); return false; } + m_mesh->grab(); irr_driver->grabAllTextures(m_mesh); Vec3 min, max; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |