Example #1
0
File: main.c Project: ninja00/cor1
int		main(int argc, char **argv)
{
	t_vm	vm;


	vm_init(&vm);
	if (argc > 1)
	{
		ft_handle_args(argc, argv, &vm);
	}
	else
	{
		//ft_error("Not enough arguments");
		print_options();
		return(0);
	}
	ft_init_arena(&vm);
	ft_init_lst_proc(&vm);
	ft_print_header(&vm);
	cpu(&vm);

//system("clear");
//	print_t_proc(&vm);
	print_finish(&vm);

	return (0);
}
Example #2
0
void		ft_build_bmp(t_env *e)
{
	int offset;
	int pad;
	int fd;
	int x;
	int y;

	if ((fd = ft_generate_new_name()) <= 0)
		return ;
	ft_print_header(e, fd);
	y = e->screen->height - 1;
	pad = (4 - (e->width * 3) % 4) % 4;
	while (y >= 0)
	{
		x = 0;
		while (x < e->screen->width)
		{
			offset = (y * e->screen->width + x++) * e->screen->bypp;
			write(fd, e->screen->data + offset, 3);
		}
		write(fd, &g_pad, pad);
		--y;
	}
	close(fd);
	ft_printf("done.\n");
}