Merge remote-tracking branch 'origin/master' into water

Conflicts:
	src/game/Physics/PhysicsSystem.cpp
This commit is contained in:
Stiffly
2015-10-13 17:44:05 +02:00
36 changed files with 71 additions and 9 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+2 -2
View File
@@ -93,7 +93,7 @@ protected:
virtual bool OnMousePress(const Events::MousePress& event) virtual bool OnMousePress(const Events::MousePress& event)
{ {
if (Hidden()) { if (Hidden()) {
LOG_DEBUG("Pressed hidden button"); //LOG_DEBUG("Pressed hidden button");
return false; return false;
} }
@@ -117,7 +117,7 @@ protected:
virtual bool OnMouseRelease(const Events::MouseRelease& event) virtual bool OnMouseRelease(const Events::MouseRelease& event)
{ {
if (Hidden()) { if (Hidden()) {
LOG_DEBUG("Released hidden button"); //LOG_DEBUG("Released hidden button");
return false; return false;
} }
+2 -2
View File
@@ -10,11 +10,11 @@ namespace dd
namespace GUI namespace GUI
{ {
class NumberFrame : public Frame class NumberFrame : public TextureFrame
{ {
public: public:
NumberFrame(Frame* parent, std::string name) NumberFrame(Frame* parent, std::string name)
: Frame(parent, name) : TextureFrame(parent, name)
{ {
m_CharacterTextures['0'] = "Textures/GUI/Numbers/N0.png"; m_CharacterTextures['0'] = "Textures/GUI/Numbers/N0.png";
m_CharacterTextures['1'] = "Textures/GUI/Numbers/N1.png"; m_CharacterTextures['1'] = "Textures/GUI/Numbers/N1.png";
+1
View File
@@ -41,6 +41,7 @@ public:
//m_ScoreIndicator = new GUI::TextureFrame(this, "HUDScoreIndicator"); //m_ScoreIndicator = new GUI::TextureFrame(this, "HUDScoreIndicator");
//m_ScoreIndicator->SetTexture("Textures/GUI/HUD/ScoreIndicatorBG.png"); //m_ScoreIndicator->SetTexture("Textures/GUI/HUD/ScoreIndicatorBG.png");
m_ScoreNumberFrame = new GUI::NumberFrame(this, "HUDScoreNumberFrame"); m_ScoreNumberFrame = new GUI::NumberFrame(this, "HUDScoreNumberFrame");
m_ScoreNumberFrame->SetTexture("Textures/GUI/Numbers/Background.png");
//m_ScoreNumberFrame->X = 15; //m_ScoreNumberFrame->X = 15;
m_ScoreNumberFrame->Y = 18; m_ScoreNumberFrame->Y = 18;
+3 -1
View File
@@ -100,6 +100,8 @@ namespace dd
std::unordered_map<b2Body*, EntityID> m_BodiesToEntities; std::unordered_map<b2Body*, EntityID> m_BodiesToEntities;
int t_counter = 0;
void CreateBody(EntityID entity); void CreateBody(EntityID entity);
void SyncEntitiesWithBodies(); void SyncEntitiesWithBodies();
@@ -130,7 +132,7 @@ namespace dd
std::vector<EntityID> ParticleEmitter; std::vector<EntityID> ParticleEmitter;
std::vector<EntityID> ParticleTemplate; std::vector<EntityID> ParticleTemplate;
}; };
EmitterHandler m_ParticleEmitters; EmitterHandler m_ParticleEmitters;
std::list<Impulse> m_Impulses; std::list<Impulse> m_Impulses;
+63 -4
View File
@@ -615,9 +615,8 @@ void dd::Systems::PhysicsSystem::UpdateParticleEmitters(double dt)
// for (int i = 0; i < m_EntitiesToParticleHandle.size(); i++) // for (int i = 0; i < m_EntitiesToParticleHandle.size(); i++)
// entHandles += m_EntitiesToParticleHandle[i].size(); // entHandles += m_EntitiesToParticleHandle[i].size();
// LOG_INFO("Entities and handles: %i", entHandles); // LOG_INFO("Entities and handles: %i", entHandles);
for (int i = 0; i < emittersToDelete.size(); i++)
for (int i = 0; i < emittersToDelete.size(); i++)
{ {
EntityID ent = emittersToDelete[i]; EntityID ent = emittersToDelete[i];
int key; int key;
@@ -628,6 +627,36 @@ void dd::Systems::PhysicsSystem::UpdateParticleEmitters(double dt)
} }
if (m_ParticleEmitters.ParticleSystem[key]->GetParticleCount() == 0 && key <= m_ParticleEmitters.ParticleSystem.size() - 1) { if (m_ParticleEmitters.ParticleSystem[key]->GetParticleCount() == 0 && key <= m_ParticleEmitters.ParticleSystem.size() - 1) {
// DEBUG vvvvvv
// int t_Entities = m_World->GetEntities()->size();
// int t_Systems = m_ParticleEmitters.ParticleSystem.size();
// int t_Emitters = m_ParticleEmitters.ParticleEmitter.size();
// int t_Templates = m_ParticleEmitters.ParticleTemplate.size();
// int t_LFunParticles = 0;
// int t_EntParticles = 0;
// auto t_WorldEntities = m_World->GetEntities();
//
// for (auto &te : *t_WorldEntities)
// {
// if (m_World->GetComponent<Components::Particle>(te.first))
// {
// t_EntParticles++;
// }
// }
//
// for (int i = 0; i < t_Systems; i++)
// {
// t_LFunParticles = m_ParticleEmitters.ParticleSystem[i]->GetParticleCount();
// }
//
// LOG_INFO("----------------------------");
// LOG_INFO("Deleting emitter and other");
// LOG_INFO("Total before:");
// LOG_INFO("Entities: %i, Systems: %i, Emitters: %i, Templates: %i, LfunParticles: %i, EntParticles: %i, EtH: %i, HtE: %i",
// t_Entities, t_Systems, t_Emitters, t_Templates, t_LFunParticles, t_EntParticles, m_EntitiesToParticleHandle.size(), m_ParticleHandleToEntities.size());
//
// DEBUG ^^^^^
m_World->RemoveEntity(ent); m_World->RemoveEntity(ent);
m_PhysicsWorld->DestroyParticleSystem(m_ParticleEmitters.ParticleSystem[key]); m_PhysicsWorld->DestroyParticleSystem(m_ParticleEmitters.ParticleSystem[key]);
m_ParticleEmitters.ParticleSystem.erase(m_ParticleEmitters.ParticleSystem.begin() + key); m_ParticleEmitters.ParticleSystem.erase(m_ParticleEmitters.ParticleSystem.begin() + key);
@@ -635,8 +664,38 @@ void dd::Systems::PhysicsSystem::UpdateParticleEmitters(double dt)
m_ParticleEmitters.ParticleTemplate.erase(m_ParticleEmitters.ParticleTemplate.begin() + key); m_ParticleEmitters.ParticleTemplate.erase(m_ParticleEmitters.ParticleTemplate.begin() + key);
m_EntitiesToParticleHandle.erase(m_EntitiesToParticleHandle.begin() + key); m_EntitiesToParticleHandle.erase(m_EntitiesToParticleHandle.begin() + key);
m_ParticleHandleToEntities.erase(m_ParticleHandleToEntities.begin() + key); m_ParticleHandleToEntities.erase(m_ParticleHandleToEntities.begin() + key);
emittersToDelete.clear(); emittersToDelete.clear();
// DEBUG vvvvv
// t_Entities = m_World->GetEntities()->size();
// t_Systems = m_ParticleEmitters.ParticleSystem.size();
// t_Emitters = m_ParticleEmitters.ParticleEmitter.size();
// t_Templates = m_ParticleEmitters.ParticleTemplate.size();
// t_LFunParticles = 0;
// t_EntParticles = 0;
// t_WorldEntities = m_World->GetEntities();
//
// for (auto &te : *t_WorldEntities)
// {
// if (m_World->GetComponent<Components::Particle>(te.first))
// {
// t_EntParticles++;
// }
// }
//
// for (int i = 0; i < t_Systems; i++)
// {
// t_LFunParticles = m_ParticleEmitters.ParticleSystem[i]->GetParticleCount();
// }
//
// LOG_INFO("Total after:");
// LOG_INFO("Entities: %i, Systems: %i, Emitters: %i, Templates: %i, LfunParticles: %i, EntParticles: %i, EtH: %i, HtE: %i",
// t_Entities, t_Systems, t_Emitters, t_Templates, t_LFunParticles, t_EntParticles, m_EntitiesToParticleHandle.size(), m_ParticleHandleToEntities.size());
// LOG_INFO("-----------------------------");
// t_counter = 0;
// DEBUG ^^^^^
} }
} }
} }