diff --git a/src/explosion.cpp b/src/explosion.cpp index 3df8ad8cd..b19528e0f 100644 --- a/src/explosion.cpp +++ b/src/explosion.cpp @@ -39,6 +39,9 @@ Explosion::Explosion(const Vec3& coord, const int explosion_sound) : ssgTransfor //----------------------------------------------------------------------------- Explosion::~Explosion() { + // FIXME LEAK: Explosion that are still playing when a race ends might + // not get freed correctly (ssgCutout is removed when removing this + // from the scene node). sfx_manager->deleteSFX(m_explode_sound); // cut will be cleaned up when the explosion is rerefed by plib } diff --git a/src/graphics/particle_system.cpp b/src/graphics/particle_system.cpp index 0bed692d7..9eeee8a56 100644 --- a/src/graphics/particle_system.cpp +++ b/src/graphics/particle_system.cpp @@ -33,6 +33,7 @@ ParticleSystem::ParticleSystem ( int num, float create_rate, int ttf, float sz) new ssgTexCoordArray(num*4, new sgVec2[num*4] ), new ssgColourArray (num*4, new sgVec4[num*4] ) ) + //FIXME LEAK: these arrays are never freed! { #ifdef DEBUG setName("particle-system"); diff --git a/src/gui/race_gui.cpp b/src/gui/race_gui.cpp index cc60490bc..4e3f9ccf6 100644 --- a/src/gui/race_gui.cpp +++ b/src/gui/race_gui.cpp @@ -852,6 +852,14 @@ void RaceGUI::drawStatusText(const float dt) 20, 20, 200 -i*20, COLORS ); } } + + float split_screen_ratio_x, split_screen_ratio_y; + split_screen_ratio_x = split_screen_ratio_y = 1.0; + if(race_manager->getNumLocalPlayers() >= 2) + split_screen_ratio_y = 0.5; + if(race_manager->getNumLocalPlayers() >= 3) + split_screen_ratio_x = 0.5; + // The penalty message needs to be displayed for up to one second // after the start of the race, otherwise it disappears if // "Go" is displayed and the race starts @@ -862,6 +870,7 @@ void RaceGUI::drawStatusText(const float dt) if(RaceManager::getWorld()->getLocalPlayerKart(i)->earlyStartPenalty()) { GLfloat const COLORS[] = { 0.78f, 0.025f, 0.025f, 1.0f }; + font_race->PrintShadow( _("Penalty time!!"), 80, Font::CENTER_OF_SCREEN, 200, COLORS ); @@ -869,12 +878,6 @@ void RaceGUI::drawStatusText(const float dt) } // for i < getNumPlayers } // if not RACE_PHASE - float split_screen_ratio_x, split_screen_ratio_y; - split_screen_ratio_x = split_screen_ratio_y = 1.0; - if(race_manager->getNumLocalPlayers() >= 2) - split_screen_ratio_y = 0.5; - if(race_manager->getNumLocalPlayers() >= 3) - split_screen_ratio_x = 0.5; if ( RaceManager::getWorld()->isRacePhase() ) { diff --git a/src/items/attachment_manager.cpp b/src/items/attachment_manager.cpp index 453942195..261449a09 100644 --- a/src/items/attachment_manager.cpp +++ b/src/items/attachment_manager.cpp @@ -66,6 +66,8 @@ void AttachmentManager::loadModels() { for(int i=0; iat[i].attachment!=ATTACH_MAX; i++) { + // FIXME LEAK: these models are not removed (unimportant, since they + // have to be in memory till the end of the game. m_attachments[iat[i].attachment]=loader->load(iat[i].file, CB_ATTACHMENT); m_attachments[iat[i].attachment]->ref(); } // for diff --git a/src/items/item_manager.cpp b/src/items/item_manager.cpp index 5e0d25877..8a31eed26 100644 --- a/src/items/item_manager.cpp +++ b/src/items/item_manager.cpp @@ -146,6 +146,7 @@ void ItemManager::loadDefaultItems() } // for i + // FIXME LEAK: these can be deleted // Load the old, internal only models // ---------------------------------- sgVec3 yellow = { 1.0f, 1.0f, 0.4f }; createDefaultItem(yellow, "OLD_GOLD" ); diff --git a/src/items/powerup_manager.cpp b/src/items/powerup_manager.cpp index 1897aed64..075647b2a 100644 --- a/src/items/powerup_manager.cpp +++ b/src/items/powerup_manager.cpp @@ -125,6 +125,8 @@ void PowerupManager::LoadNode(const lisp::Lisp* lisp, int collectType ) if(sModel!="") { + // FIXME LEAK: not freed (uniportant, since the models have to exist + // for the whole game anyway). ssgEntity* e = loader->load(sModel, CB_COLLECTABLE); m_all_models[collectType] = e; e->ref(); diff --git a/src/karts/moveable.cpp b/src/karts/moveable.cpp index 55f478d30..e69fb7e3e 100644 --- a/src/karts/moveable.cpp +++ b/src/karts/moveable.cpp @@ -42,7 +42,7 @@ Moveable::~Moveable() // The body is being removed from the world in kart/projectile if(m_body) delete m_body; if(m_motion_state) delete m_motion_state; - // FIXME what about model? + // FIXME LEAK: what about model? ssgDeRefDelete(m_model_transform) } // ~Moveable //----------------------------------------------------------------------------- diff --git a/src/main.cpp b/src/main.cpp index 48a4633e5..582584cc4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -504,6 +504,7 @@ void CleanTuxKart() if(loader) delete loader; if(translations) delete translations; if(file_manager) delete file_manager; + if(scene) delete scene; } //============================================================================= diff --git a/src/scene.cpp b/src/scene.cpp index 46929a85f..482108d66 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -38,8 +38,7 @@ Scene *scene = 0; -Scene::Scene() : -m_scenegraph(new ssgRoot) +Scene::Scene() : m_scenegraph(new ssgRoot) { } diff --git a/src/sdldrv.cpp b/src/sdldrv.cpp index 379ea60da..c9ec714a7 100755 --- a/src/sdldrv.cpp +++ b/src/sdldrv.cpp @@ -352,6 +352,7 @@ SDLDriver::~SDLDriver() delete [] m_stick_infos; + // FIXME LEAK: delete m_action_map if defined SDL_FreeSurface(m_main_surface); SDL_Quit(); diff --git a/src/shadow.cpp b/src/shadow.cpp index 7cd8a209f..8023ab2cd 100644 --- a/src/shadow.cpp +++ b/src/shadow.cpp @@ -49,7 +49,8 @@ ssgTransform* createShadow( const std::string& name, result -> setName ( "Shadow" ) ; ssgVtxTable *gs = new ssgVtxTable ( GL_TRIANGLE_STRIP, va, na, ta, ca ) ; - + // FIXME LEAK: va, na, ta, and ca are most likely leaked, since plib + // will mark them as 'not owned' and therefore not free them! gs -> clrTraversalMaskBits ( SSGTRAV_ISECT|SSGTRAV_HOT ) ; gs -> setState ( material_manager->getMaterial ( name.c_str() ) -> getState () ) ;