edit in fillit.h and print.c for color map feature

This commit is contained in:
Manzovince
2019-05-04 19:10:33 +02:00
parent c1850f3fd6
commit 7872fac59e
2 changed files with 24 additions and 9 deletions

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */ /* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/01 13:34:46 by vmanzoni #+# #+# */ /* Created: 2019/03/01 13:34:46 by vmanzoni #+# #+# */
/* Updated: 2019/05/03 19:01:49 by vmanzoni ### ########.fr */ /* Updated: 2019/05/04 19:01:21 by vmanzoni ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -19,8 +19,21 @@
#include <stdio.h> // for printf (DELETE BEFORE EVAL) #include <stdio.h> // for printf (DELETE BEFORE EVAL)
#include "libft/includes/libft.h" #include "libft/includes/libft.h"
/*
** DEFINE
*/
# define BUFF_SIZE 1024 # define BUFF_SIZE 1024
#define RED "\x1B[31m"
#define GRN "\x1B[32m"
#define YEL "\x1B[33m"
#define BLU "\x1B[34m"
#define MAG "\x1B[35m"
#define CYN "\x1B[36m"
#define RESET "\x1B[0m"
/* /*
** STRUCTURE ** STRUCTURE
*/ */
@@ -53,5 +66,6 @@ void print_tetri(unsigned int bits, int size); //TO DELETE BEFORE EVAL
void search_map(t_fillist *list); void search_map(t_fillist *list);
void print_map(unsigned int *tab, int width, int height, char letter); void print_map(unsigned int *tab, int width, int height, char letter);
void print_final_map(t_fillist *list, int size); void print_final_map(t_fillist *list, int size);
void ft_put_tetri_color(char c);
#endif #endif

View File

@@ -6,7 +6,7 @@
/* By: hulamy <hulamy@student.42.fr> +#+ +:+ +#+ */ /* By: hulamy <hulamy@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/30 13:24:28 by hulamy #+# #+# */ /* Created: 2019/04/30 13:24:28 by hulamy #+# #+# */
/* Updated: 2019/05/03 16:07:51 by hulamy ### ########.fr */ /* Updated: 2019/05/04 19:05:59 by vmanzoni ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -121,7 +121,8 @@ void print_final_map(t_fillist *list, int size)
{ {
if (i && i % size == 0) if (i && i % size == 0)
ft_putchar('\n'); ft_putchar('\n');
ft_putchar(map[i]); //ft_putchar(map[i]);
ft_put_tetri_color(map[i]);
ft_putchar(' '); ft_putchar(' ');
} }
ft_putchar('\n'); ft_putchar('\n');