diff --git a/assets/Textures/GUI/Numbers/Background.png b/assets/Textures/GUI/Numbers/Background.png new file mode 100755 index 0000000..d3ab8a4 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Background.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N0.png b/assets/Textures/GUI/Numbers/Blocky/N0.png new file mode 100644 index 0000000..82a7e0f Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N0.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N1.png b/assets/Textures/GUI/Numbers/Blocky/N1.png new file mode 100644 index 0000000..b8c3606 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N1.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N2.png b/assets/Textures/GUI/Numbers/Blocky/N2.png new file mode 100644 index 0000000..6dfe614 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N2.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N3.png b/assets/Textures/GUI/Numbers/Blocky/N3.png new file mode 100644 index 0000000..102112a Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N3.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N4.png b/assets/Textures/GUI/Numbers/Blocky/N4.png new file mode 100644 index 0000000..c162544 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N4.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N5.png b/assets/Textures/GUI/Numbers/Blocky/N5.png new file mode 100644 index 0000000..f4e3fb8 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N5.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N6.png b/assets/Textures/GUI/Numbers/Blocky/N6.png new file mode 100644 index 0000000..67c9b0d Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N6.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N7.png b/assets/Textures/GUI/Numbers/Blocky/N7.png new file mode 100644 index 0000000..1b348e3 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N7.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N8.png b/assets/Textures/GUI/Numbers/Blocky/N8.png new file mode 100644 index 0000000..a7ec67a Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N8.png differ diff --git a/assets/Textures/GUI/Numbers/Blocky/N9.png b/assets/Textures/GUI/Numbers/Blocky/N9.png new file mode 100644 index 0000000..5d2b67a Binary files /dev/null and b/assets/Textures/GUI/Numbers/Blocky/N9.png differ diff --git a/assets/Textures/GUI/Numbers/N0.png b/assets/Textures/GUI/Numbers/N0.png old mode 100644 new mode 100755 index 82a7e0f..53344a7 Binary files a/assets/Textures/GUI/Numbers/N0.png and b/assets/Textures/GUI/Numbers/N0.png differ diff --git a/assets/Textures/GUI/Numbers/N1.png b/assets/Textures/GUI/Numbers/N1.png old mode 100644 new mode 100755 index b8c3606..60d5e59 Binary files a/assets/Textures/GUI/Numbers/N1.png and b/assets/Textures/GUI/Numbers/N1.png differ diff --git a/assets/Textures/GUI/Numbers/N2.png b/assets/Textures/GUI/Numbers/N2.png old mode 100644 new mode 100755 index 6dfe614..d567c06 Binary files a/assets/Textures/GUI/Numbers/N2.png and b/assets/Textures/GUI/Numbers/N2.png differ diff --git a/assets/Textures/GUI/Numbers/N3.png b/assets/Textures/GUI/Numbers/N3.png old mode 100644 new mode 100755 index 102112a..3d662bc Binary files a/assets/Textures/GUI/Numbers/N3.png and b/assets/Textures/GUI/Numbers/N3.png differ diff --git a/assets/Textures/GUI/Numbers/N4.png b/assets/Textures/GUI/Numbers/N4.png old mode 100644 new mode 100755 index c162544..1e304c4 Binary files a/assets/Textures/GUI/Numbers/N4.png and b/assets/Textures/GUI/Numbers/N4.png differ diff --git a/assets/Textures/GUI/Numbers/N5.png b/assets/Textures/GUI/Numbers/N5.png old mode 100644 new mode 100755 index f4e3fb8..9d7a417 Binary files a/assets/Textures/GUI/Numbers/N5.png and b/assets/Textures/GUI/Numbers/N5.png differ diff --git a/assets/Textures/GUI/Numbers/N6.png b/assets/Textures/GUI/Numbers/N6.png old mode 100644 new mode 100755 index 67c9b0d..d81b48b Binary files a/assets/Textures/GUI/Numbers/N6.png and b/assets/Textures/GUI/Numbers/N6.png differ diff --git a/assets/Textures/GUI/Numbers/N7.png b/assets/Textures/GUI/Numbers/N7.png old mode 100644 new mode 100755 index 1b348e3..a82054b Binary files a/assets/Textures/GUI/Numbers/N7.png and b/assets/Textures/GUI/Numbers/N7.png differ diff --git a/assets/Textures/GUI/Numbers/N8.png b/assets/Textures/GUI/Numbers/N8.png old mode 100644 new mode 100755 index a7ec67a..dd18cf8 Binary files a/assets/Textures/GUI/Numbers/N8.png and b/assets/Textures/GUI/Numbers/N8.png differ diff --git a/assets/Textures/GUI/Numbers/N9.png b/assets/Textures/GUI/Numbers/N9.png old mode 100644 new mode 100755 index 5d2b67a..fd303d2 Binary files a/assets/Textures/GUI/Numbers/N9.png and b/assets/Textures/GUI/Numbers/N9.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N0.png b/assets/Textures/GUI/Numbers/Squid/N0.png new file mode 100755 index 0000000..c02e365 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N0.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N1.png b/assets/Textures/GUI/Numbers/Squid/N1.png new file mode 100755 index 0000000..986a2c1 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N1.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N2.png b/assets/Textures/GUI/Numbers/Squid/N2.png new file mode 100755 index 0000000..b484a15 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N2.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N3.png b/assets/Textures/GUI/Numbers/Squid/N3.png new file mode 100755 index 0000000..7b06407 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N3.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N4.png b/assets/Textures/GUI/Numbers/Squid/N4.png new file mode 100755 index 0000000..b6f42fd Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N4.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N5.png b/assets/Textures/GUI/Numbers/Squid/N5.png new file mode 100755 index 0000000..b20fe44 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N5.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N6.png b/assets/Textures/GUI/Numbers/Squid/N6.png new file mode 100755 index 0000000..64ad7e0 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N6.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N7.png b/assets/Textures/GUI/Numbers/Squid/N7.png new file mode 100755 index 0000000..e964f34 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N7.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N8.png b/assets/Textures/GUI/Numbers/Squid/N8.png new file mode 100755 index 0000000..cd133bc Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N8.png differ diff --git a/assets/Textures/GUI/Numbers/Squid/N9.png b/assets/Textures/GUI/Numbers/Squid/N9.png new file mode 100755 index 0000000..3c41272 Binary files /dev/null and b/assets/Textures/GUI/Numbers/Squid/N9.png differ diff --git a/include/GUI/Button.h b/include/GUI/Button.h index d46d929..dcfdae6 100644 --- a/include/GUI/Button.h +++ b/include/GUI/Button.h @@ -93,7 +93,7 @@ protected: virtual bool OnMousePress(const Events::MousePress& event) { if (Hidden()) { - LOG_DEBUG("Pressed hidden button"); + //LOG_DEBUG("Pressed hidden button"); return false; } @@ -117,7 +117,7 @@ protected: virtual bool OnMouseRelease(const Events::MouseRelease& event) { if (Hidden()) { - LOG_DEBUG("Released hidden button"); + //LOG_DEBUG("Released hidden button"); return false; } diff --git a/include/GUI/NumberFrame.h b/include/GUI/NumberFrame.h index 7241b82..003b921 100644 --- a/include/GUI/NumberFrame.h +++ b/include/GUI/NumberFrame.h @@ -10,11 +10,11 @@ namespace dd namespace GUI { -class NumberFrame : public Frame +class NumberFrame : public TextureFrame { public: NumberFrame(Frame* parent, std::string name) - : Frame(parent, name) + : TextureFrame(parent, name) { m_CharacterTextures['0'] = "Textures/GUI/Numbers/N0.png"; m_CharacterTextures['1'] = "Textures/GUI/Numbers/N1.png"; diff --git a/include/Game/GUI/HUD.h b/include/Game/GUI/HUD.h index d374af6..74529ab 100644 --- a/include/Game/GUI/HUD.h +++ b/include/Game/GUI/HUD.h @@ -41,6 +41,7 @@ public: //m_ScoreIndicator = new GUI::TextureFrame(this, "HUDScoreIndicator"); //m_ScoreIndicator->SetTexture("Textures/GUI/HUD/ScoreIndicatorBG.png"); m_ScoreNumberFrame = new GUI::NumberFrame(this, "HUDScoreNumberFrame"); + m_ScoreNumberFrame->SetTexture("Textures/GUI/Numbers/Background.png"); //m_ScoreNumberFrame->X = 15; m_ScoreNumberFrame->Y = 18; diff --git a/include/Physics/PhysicsSystem.h b/include/Physics/PhysicsSystem.h index 7dc27f6..91cfad0 100755 --- a/include/Physics/PhysicsSystem.h +++ b/include/Physics/PhysicsSystem.h @@ -100,6 +100,8 @@ namespace dd std::unordered_map m_BodiesToEntities; + int t_counter = 0; + void CreateBody(EntityID entity); void SyncEntitiesWithBodies(); @@ -130,7 +132,7 @@ namespace dd std::vector ParticleEmitter; std::vector ParticleTemplate; }; - EmitterHandler m_ParticleEmitters; + EmitterHandler m_ParticleEmitters; std::list m_Impulses; diff --git a/src/game/Physics/PhysicsSystem.cpp b/src/game/Physics/PhysicsSystem.cpp index 0cc4a3c..c0f87db 100755 --- a/src/game/Physics/PhysicsSystem.cpp +++ b/src/game/Physics/PhysicsSystem.cpp @@ -615,9 +615,8 @@ void dd::Systems::PhysicsSystem::UpdateParticleEmitters(double dt) // for (int i = 0; i < m_EntitiesToParticleHandle.size(); i++) // entHandles += m_EntitiesToParticleHandle[i].size(); // 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]; 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) { + // 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(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_PhysicsWorld->DestroyParticleSystem(m_ParticleEmitters.ParticleSystem[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_EntitiesToParticleHandle.erase(m_EntitiesToParticleHandle.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(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 ^^^^^ } + } }