int key_pressed(int kc, t_eve *e) { if (kc == 53) exit(1); if (kc == 69) e->zfact *= 1.5; if (kc == 78) e->zfact /= e->zfact > 0.005 ? 1.5 : 1; if (kc == 125 || kc == 126) e->y0 += kc == 125 ? 20 : -20; if (kc == 123 || kc == 124) e->x0 += kc == 123 ? -20 : 20; if (kc >= 82 && kc <= 92) rotates(kc, e); if (kc == 35 || kc == 34 || kc == 8) change_proj(kc, e); if (!e->persp) recalc_coords(e); else recalc_persp_coords(e); clear_image(&e->img_address); draw_in_im(e); mlx_clear_window(e->mlx, e->win); mlx_put_image_to_window(e->mlx, e->win, e->img, 0, 0); if (kc == 71) mlx_clear_window(e->mlx, e->win); return (1); }
//-------------------------------------------------------------------------- void keep_newer_files (uword keep_count) { assert (rotates()); while (m_name_strings.size() > keep_count) { erase_file ((const char*) m_name_strings.head()); m_name_strings.pop_head(); } }