diff options
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/world.cpp b/src/world.cpp index 698db7c..11bd671 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -712,13 +712,13 @@ void World::draw(Player *p) glEnableVertexAttribArray(worldShader_attribute_coord); glEnableVertexAttribArray(worldShader_attribute_tex); - uint ps = 0;particles.size(); + uint ps = particles.size(); uint pss = ps * 6 * 5; - //uint pc = 0; + uint pc = 0; std::vector<GLfloat> partVec(pss); - /*GLfloat *pIndex = &partVec[0]; - + GLfloat *pIndex = &partVec[0]; + for (const auto &p : particles) { pc += 30; if (pc > pss) { @@ -727,7 +727,7 @@ void World::draw(Player *p) break; } p.draw(pIndex); - }*/ + } glVertexAttribPointer(worldShader_attribute_coord, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), &partVec[0]); glVertexAttribPointer(worldShader_attribute_tex, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), &partVec[3]); @@ -1487,14 +1487,14 @@ addObject(std::string in, std::string p, float x, float y) void World:: addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int d) { - particles.emplace_back(x, y, w, h, vx, vy, color, d); + particles.push_back(Particles(x, y, w, h, vx, vy, color, d)); particles.back().canMove = true; } void World:: addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int d, unsigned char flags) { - particles.emplace_back(x, y, w, h, vx, vy, color, d); + particles.push_back(Particles(x, y, w, h, vx, vy, color, d)); particles.back().canMove = true; particles.back().gravity = flags & (1 << 0); particles.back().bounce = flags & (1 << 1); |