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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user