Skip to content

Commit 70f1a54

Browse files
committed
fix minimap
1 parent 59a9da2 commit 70f1a54

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

maps/valid/abbandoned_lab.cub

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ WE assets/texture/lab3.xpm
77
EA assets/texture/lab4.xpm
88

99

10-
111111111111111 11111
11-
1000S0000001111 1100011
12-
111000011111001 100000001
13-
1000000000000011111 100000000011
10+
111111111111111 11111
11+
1000S0000001111 1100011
12+
111000011111001 100000001
13+
1000000000000011111 100000000011
1414
11111111111000001111100111111000000000001
1515
10000000011000001110000000101000000000011111
1616
1111D111111111011100000100D0D000000000000001
1717
11110111111111011101000111111111111111111D11
1818
110000001101010111000001 101
19-
100000000000000011000N01111 101
19+
100000000000000011000001111 101
2020
100000000000000011010000001 101
2121
110000011100010111110111111 101
2222
1111D111111D1011111001 101

srcs/engine/minimap/minimap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* minimap.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: hluiz-ma <hluiz-ma@student.42porto.com> +#+ +:+ +#+ */
6+
/* By: marsoare <marsoare@student.42porto.com> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2025/01/16 14:20:40 by marsoare #+# #+# */
9-
/* Updated: 2025/03/22 20:10:09 by hluiz-ma ### ########.fr */
9+
/* Updated: 2025/01/29 20:19:25 by marsoare ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -28,9 +28,9 @@ static void draw_map_cell(t_game *game, int screen_x, int screen_y,
2828
int map_x;
2929
int map_y;
3030

31-
map_x = data->player_map_x + (screen_x - data->view_radius);
32-
map_y = data->player_map_y + (screen_y - data->view_radius);
33-
if (!is_valid_map_position(game, map_y, map_x))
31+
map_x = data->player_map_x + (screen_y - data->view_radius);
32+
map_y = data->player_map_y + (screen_x - data->view_radius);
33+
if (!is_valid_map_position(game, map_x, map_y))
3434
return ;
3535
if (game->map.grid[map_x][map_y] == '1')
3636
draw_minimap_cell(game, screen_x, screen_y, 0xFFFFFF);

srcs/engine/minimap/minimap_draw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* minimap_draw.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: hluiz-ma <hluiz-ma@student.42porto.com> +#+ +:+ +#+ */
6+
/* By: marsoare <marsoare@student.42porto.com> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2025/01/16 14:20:40 by marsoare #+# #+# */
9-
/* Updated: 2025/03/22 20:08:54 by hluiz-ma ### ########.fr */
9+
/* Updated: 2025/01/16 20:27:54 by marsoare ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -51,8 +51,8 @@ void draw_direction_line(t_game *game, t_vector center, t_vector dir,
5151
int steps;
5252
int i;
5353

54-
end.x = center.x + dir.x * length;
55-
end.y = center.y + dir.y * length;
54+
end.x = center.x + dir.y * length;
55+
end.y = center.y + dir.x * length;
5656
steps = get_line_steps(center, end);
5757
inc.x = (end.x - center.x) / (float)steps;
5858
inc.y = (end.y - center.y) / (float)steps;

0 commit comments

Comments
 (0)