void gere_texture_grass(t_img *img) { int x; int y; srand(clock()); x = rand(); y = rand(); put_pixel_image(img, x % 1500, 100 + (y % 120), 0, 102, 0); put_pixel_image(img, x % 1500 - 1, 99 + (y % 105), 203, 132, 97); }
void draw(void *mlx, void *win, t_rgb *rgb, t_env *env) { double x; double y; double x_temp; unsigned int max_iteration; unsigned int iteration; unsigned int xz; unsigned int yz; int color; x = 0.0; y = 0.0; x_temp = 0.0; iteration = 0; max_iteration = 1000; while (x * x + y * y < 2 * 2 && iteration < max_iteration) { x_temp = x * x - y * y + xz; y = 2 * x * y + yz; x = x_temp; iteration = iteration + 1; color = ft_color(x); put_pixel_image(env, x, y, color); } }
void gere_texture(t_img *img) { int x; int y; srand(clock()); x = rand(); y = rand(); put_pixel_image(img, x % 1500, 120 + (y % 1000), 3, 3, 53); }
void sky(t_img *img) { int x; int y; x = 0; y = 0; while (y <= 100) { while (x <= 1500) { put_pixel_image(img, x, y, 203, 132, 97); x++; } x = 0; y++; } }
void ground(t_img *img) { int x; int y; x = 0; y = 120; while (y <= 1000) { while (x <= 1500) { gere_texture(img); put_pixel_image(img, x, y, 51, 102, 153); x++; } x = 0; y++; } }
void grass(t_img *img) { int x; int y; x = 0; y = 100; while (y <= 120) { while (x <= 1500) { gere_texture_grass(img); put_pixel_image(img, x, y, 51, 255, 51); x++; } x = 0; y++; } }