aboutsummaryrefslogtreecommitdiffstats
path: root/src/components.cpp
diff options
context:
space:
mode:
authorAndy <drumsetmonkey@gmail.com>2016-10-24 07:55:41 -0400
committerAndy <drumsetmonkey@gmail.com>2016-10-24 07:55:41 -0400
commitd7884127950260dd0f1b24aee0bfe64d847f990c (patch)
tree067751efc3b0e3d7ec9111b4764170bd69bacec7 /src/components.cpp
parent2dd2f42ff1c683331e7192b4bfb832e41543d2df (diff)
Better sprites
Diffstat (limited to 'src/components.cpp')
-rw-r--r--src/components.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components.cpp b/src/components.cpp
index 32d0f79..45a9315 100644
--- a/src/components.cpp
+++ b/src/components.cpp
@@ -16,6 +16,16 @@ void MovementSystem::update(entityx::EntityManager &en, entityx::EventManager &e
});
}
+void PhysicsSystem::update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt)
+{
+ (void)ev;
+ en.each<Direction, Physics>([dt](entityx::Entity entity, Direction &direction, Physics &physics) {
+ (void)entity;
+ // TODO GET GRAVITY FROM WOLRD
+ direction.y += physics.g * dt;
+ });
+}
+
void RenderSystem::update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt)
{
(void)ev;
@@ -61,7 +71,7 @@ void RenderSystem::update(entityx::EntityManager &en, entityx::EventManager &ev,
float flashAmt = 1-(hitDuration/maxHitDuration);
glUniform4f(Render::worldShader.uniform[WU_tex_color], 1.0, flashAmt, flashAmt, 1.0);
}*/
- glBindTexture(GL_TEXTURE_2D, game::sprite_l.getSprite(S.first.sheetID));
+ glBindTexture(GL_TEXTURE_2D, S.first.pic);
glUniform1i(Render::worldShader.uniform[WU_texture], 0);
Render::worldShader.enable();