diff --git a/includes/fdf.h b/includes/fdf.h index a0afd75..639790e 100644 --- a/includes/fdf.h +++ b/includes/fdf.h @@ -77,12 +77,12 @@ int **parse_map(t_fdf *fdf, int fd); // steps size for the height transform with p and o // must be > 0 // 100 is small, 1 is the biggest -# define Z_HEIGHT 100 +# define Z_HEIGHT 10 // then define the speed for height transform // must be > 0 -// 1 is small, 100 is the big -# define Z_HEIGHT_UP 10 -# define Z_HEIGHT_DOWN 10 +// 1 is small, 100 is big +# define Z_HEIGHT_UP 20 +# define Z_HEIGHT_DOWN 20 /* - 50 : pink - blue @@ -94,10 +94,10 @@ int **parse_map(t_fdf *fdf, int fd); - test : white - pink */ // color for altitude -# define COLOR_START 0xf263a6 // pink -/* -# define COLOR_START 0xa263f6 // purple # define COLOR_START 0xffffff // white +/* +# define COLOR_START 0xf263a6 // pink +# define COLOR_START 0xa263f6 // purple # define COLOR_START 0x1423e6 // blue # define COLOR_START 0x877264 // brown # define COLOR_START 0x00d700 // green @@ -111,17 +111,23 @@ int **parse_map(t_fdf *fdf, int fd); */ # define COLOR_END 0xa263f6 // purple +// zoom change for each keypress +# define ZOOM 1 + +// degree rotation for each keypress +# define ROT 3 + // pixels deplacement for each keypress # define MOVE 10 // minimum time in milliseconds between two keypress # define DEBOUNCE_TIME 50 -# define ESCAPE 65307 +# define ESCAPE 65307 # define UP 65362 # define DOWN 65364 # define LEFT 65361 -# define RIGHT 65363 +# define RIGHT 65363 # define A 97 # define B 98 # define C 99 diff --git a/srcs/fdf.c b/srcs/fdf.c index 97ab7c0..fd80196 100644 --- a/srcs/fdf.c +++ b/srcs/fdf.c @@ -55,8 +55,8 @@ void init_fdf(t_fdf *fdf) { struct timeval current_time; - fdf->win_size_x = 700; - fdf->win_size_y = 700; + fdf->win_size_x = 902; + fdf->win_size_y = 913; fdf->img_size_x = fdf->win_size_x; fdf->img_size_y = fdf->win_size_y; init_offset(fdf); diff --git a/srcs/keypress_bonus.c b/srcs/keypress_bonus.c index 3b495da..884e108 100644 --- a/srcs/keypress_bonus.c +++ b/srcs/keypress_bonus.c @@ -11,9 +11,9 @@ void keypress_more(int keycode, t_fdf *fdf) { if (keycode == A) - fdf->zoom += 1; + fdf->zoom += ZOOM; else if (keycode == W) - fdf->zoom -= 1; + fdf->zoom -= ZOOM; else if (keycode == U) { fdf->rot_x = 0; @@ -66,13 +66,13 @@ int keypress(int keycode, t_fdf *fdf) if (keycode == ESCAPE) shut_down(fdf); else if (keycode == LEFT) - fdf->rot_x += 1; + fdf->rot_x += ROT; else if (keycode == RIGHT) - fdf->rot_x -= 1; + fdf->rot_x -= ROT; else if (keycode == UP) - fdf->rot_y += 1; + fdf->rot_y += ROT; else if (keycode == DOWN) - fdf->rot_y -= 1; + fdf->rot_y -= ROT; else if (keycode == Q) fdf->mov_x -= MOVE; else if (keycode == D)