wip several test to avoid buble effects, one wihtout doubles

This commit is contained in:
hugogogo
2022-04-28 20:27:46 +02:00
parent 285f6f3c55
commit 6640c9e6d3
6 changed files with 44 additions and 53 deletions

View File

@@ -68,13 +68,10 @@ static void init_raycast(t_rcast *rcast)
dist = (SCREEN_FOCAL / 2) * M_PI / 180;
dist = cos(dist) * ((SCREEN_WIDTH / 2) / sin(dist));
rcast->screen_dist = dist;
rcast->screen_width = SCREEN_WIDTH;
rcast->screen_height = SCREEN_HEIGHT;
// screen dist
rcast->screen_dist.start.x = 0;
rcast->screen_dist.start.y = 0;
rcast->screen_dist.end.x = 0;
rcast->screen_dist.end.y = -dist;
rcast->hor = HORIZON;
// screen size
rcast->screen_size.start.x = -SCREEN_WIDTH / 2;
rcast->screen_size.start.y = -dist;
@@ -132,6 +129,5 @@ t_game *init_game(void)
// raycasting
init_raycast(&(game->rcast));
game->rcast.cell = game->map.cell;
game->wall.height = WALL_HEIGHT;
return (game);
}