Optimizations
This commit is contained in:
@@ -20,6 +20,10 @@ void Systems::CollisionSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
// Clear old collisions
|
||||
collisionComponent->CollidingEntities.clear();
|
||||
|
||||
// Quit out if we're not interested in collision events
|
||||
if (!collisionComponent->Interested)
|
||||
return;
|
||||
|
||||
auto entities = m_World->GetEntities();
|
||||
|
||||
for (auto pair : *entities) {
|
||||
@@ -43,7 +47,8 @@ void Systems::CollisionSystem::UpdateEntity(double dt, EntityID entity, EntityID
|
||||
|
||||
//pair.first, pair.second;
|
||||
if(entity == entity2)
|
||||
break;
|
||||
continue;
|
||||
|
||||
Intersects(entity, entity2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,6 @@ Systems::LevelGenerationSystem::LevelGenerationSystem( World* world )
|
||||
|
||||
void Systems::LevelGenerationSystem::SpawnObstacle()
|
||||
{
|
||||
|
||||
|
||||
|
||||
typeRandom = 0 + (rand() % 3);
|
||||
|
||||
|
||||
@@ -75,7 +72,7 @@ void Systems::LevelGenerationSystem::Update( double dt )
|
||||
elapsedtime = 0;
|
||||
}
|
||||
|
||||
std::vector<EntityID> removethis;
|
||||
std::list<EntityID> removethis;
|
||||
|
||||
for(auto ent : obstacles)
|
||||
{
|
||||
@@ -85,7 +82,6 @@ void Systems::LevelGenerationSystem::Update( double dt )
|
||||
if(transformComponent->Position.z > 100)
|
||||
{
|
||||
removethis.push_back(ent);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ void Systems::SoundSystem::UpdateEntity(double dt, EntityID entity, EntityID par
|
||||
auto soundEmitter = m_World->GetComponent<Components::SoundEmitter>(entity, "SoundEmitter");
|
||||
if(soundEmitter != nullptr)
|
||||
{
|
||||
ALuint source = m_Source[soundEmitter.get()];
|
||||
ALuint source = m_Source[soundEmitter];
|
||||
alSourcei(source, AL_GAIN, soundEmitter->Gain);
|
||||
alSourcei(source, AL_MAX_DISTANCE, soundEmitter->MaxDistance);
|
||||
alSourcei(source, AL_REFERENCE_DISTANCE, soundEmitter->ReferenceDistance);
|
||||
|
||||
Reference in New Issue
Block a user