From 2d86e86603db31c96ae128283cca569a10481922 Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Sun, 10 Oct 2010 05:10:25 +0000 Subject: [PATCH] Follow up on this comment from Xawotihs: "It's currently unclear for me why several instances of the same hgeparticlesystem with the same .psi file are created..." The GameApp::Create() call was initializing an array of particles, but it wasn't actually stashing them in the psi cache. The MenuItems also create the particles, but these are stashed correctly in the cache at that point. So, I simply removed the unused particle array loading code since it wasn't actually caching anything correctly & therefore simply adding redundant reading of the same particle files. --- projects/mtg/src/GameApp.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/projects/mtg/src/GameApp.cpp b/projects/mtg/src/GameApp.cpp index 64750044d..83847bd0d 100644 --- a/projects/mtg/src/GameApp.cpp +++ b/projects/mtg/src/GameApp.cpp @@ -25,7 +25,6 @@ #define DEFAULT_DURATION .25 -hgeParticleSystem* GameApp::Particles[] = {NULL,NULL,NULL,NULL,NULL,NULL}; MTGAllCards * GameApp::collection = NULL; int GameApp::players[] = {0,0}; int GameApp::HasMusic = 1; @@ -67,9 +66,6 @@ GameApp::GameApp(): JApp() mNextState = NULL; collection = NULL; - for(int i=0;i<6;i++) - Particles[i] = NULL; - music = NULL; } @@ -184,14 +180,6 @@ void GameApp::Create() LOG("Init Collection"); collection = NEW MTGAllCards(); - LOG("Loading Particles"); - Particles[0] = NEW hgeParticleSystem("graphics/particle1.psi", resources.GetQuad("particles")); - Particles[1] = NEW hgeParticleSystem("graphics/particle2.psi", resources.GetQuad("particles")); - Particles[2] = NEW hgeParticleSystem("graphics/particle3.psi", resources.GetQuad("particles")); - Particles[3] = NEW hgeParticleSystem("graphics/particle4.psi", resources.GetQuad("particles")); - Particles[4] = NEW hgeParticleSystem("graphics/particle5.psi", resources.GetQuad("particles")); - Particles[5] = NEW hgeParticleSystem("graphics/particle7.psi", resources.GetQuad("particles")); - LOG("Creating Game States"); mGameStates[GAME_STATE_DECK_VIEWER] = NEW GameStateDeckViewer(this); mGameStates[GAME_STATE_DECK_VIEWER]->Create(); @@ -250,10 +238,6 @@ void GameApp::Destroy() } } - for (int i= 0; i < 6; i++){ - SAFE_DELETE(Particles[i]); - } - if (collection){ collection->destroyAllCards(); SAFE_DELETE(collection);