aboutsummaryrefslogtreecommitdiff
path: root/src/physics.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/physics.c')
-rw-r--r--src/physics.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/physics.c b/src/physics.c
index 08295a9..7867fd1 100644
--- a/src/physics.c
+++ b/src/physics.c
@@ -358,7 +358,7 @@ static void physics_process(ModelInstance *obj, Uint32 dt, Game *game) {
obj->recharging = 1;
game->platform_rel_x = coll.obj->x - obj->x;
game->platform_rel_y = coll.obj->y - obj->y;
- game->time_of_landing_event = game->tlast + sttc;
+ game->time_of_landing_event = game->time + sttc;
} else {
@@ -404,15 +404,12 @@ static void physics_process(ModelInstance *obj, Uint32 dt, Game *game) {
}
-void physics_step(Game *game, Uint32 t) {
+void physics_step(Game *game, int dt) {
- Uint32 dt;
struct timeval tv;
suseconds_t us;
time_t sec;
- dt = t - game->tlast;
-
gettimeofday(&tv, NULL);
us = tv.tv_usec;
sec = tv.tv_sec;
@@ -425,7 +422,7 @@ void physics_step(Game *game, Uint32 t) {
game->lander->landed = 0;
game->radiation = 0.1;
if ( game->lander->recharging ) {
- game->time_of_landing_event = game->tlast + dt;
+ game->time_of_landing_event = game->time + dt;
game->lander->recharging = 0;
}
}
@@ -464,8 +461,6 @@ void physics_step(Game *game, Uint32 t) {
game_check_handoff(game);
- game->tlast = t;
-
gettimeofday(&tv, NULL);
us = tv.tv_usec - us;
sec = tv.tv_sec - sec;