added different height speed change for up and down

This commit is contained in:
asus
2024-01-13 15:58:16 +01:00
parent cebfe75798
commit 1553685882
8 changed files with 10 additions and 6 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
fdf

Binary file not shown.

View File

@@ -77,14 +77,19 @@ int **parse_map(t_fdf *fdf, int fd);
// steps size for the hight transform with p and o
// must be > 0
// 100 is small, 1 is the biggest
# define Z_HEIGHT 50
# define Z_HEIGHT 100
// 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 2
// color for altitude
# define COLOR_START 0xffffff
/*
# define COLOR_END 0x00d700 // green
*/
# define COLOR_END 0x1423e6 // blue
*/
# define COLOR_END 0x00d700 // green
// minimum time in milliseconds between two keypress
# define DEBOUNCE_TIME 40

View File

@@ -28,10 +28,9 @@ void keypress_more(int keycode, t_fdf *fdf)
fdf->zoom = 0;
}
else if (keycode == O)
fdf->altitude++;
fdf->altitude += Z_HEIGHT_UP;
else if (keycode == P)
//if (fdf->altitude > 0)
fdf->altitude--;
fdf->altitude -= Z_HEIGHT_DOWN;
}
int should_ignore_keypress(const struct timeval *current_time, t_fdf *fdf)