<commit_before>/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   parse.c                                            :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: bbeldame <<EMAIL>>          +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2017/04/06 19:20:10 by bbeldame          #+#    #+#             */
/*   Updated: 2017/04/09 20:57:39 by bbeldame         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "../includes/rtv1.h"

/*
** @todo : take a .rt file as parameter and parse the content into the t_env
*/

t_env	*parse(t_env *e)
{
	t_object	*tmp;

	e->obj = (t_object *)semalloc(sizeof(t_object));
	tmp = e->obj;

	tmp->type = SPHERE;
	tmp->origin = c_vector(0, 0, 300);
	tmp->radius = 20;
	tmp->color = c_color(250, 100, 20);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;

	/*tmp->type = PLANE;
	tmp->origin = c_vector(1, 1, 0);
	tmp->direction = c_vector(1, 0, 0);
	tmp->color = c_color(30, 210, 80);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;*/
	
	tmp->type = SPHERE;
	tmp->origin = c_vector(-10, -10, 120);
	tmp->radius = 10;
	tmp->color = c_color(10, 160, 20);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;

	tmp->type = SPHERE;
	tmp->origin = c_vector(26, -23, 100);
	tmp->radius = 20;
	tmp->color = c_color(255, 255, 51);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;

	tmp->type = SPHERE;<commit_msg>Example with a sphere in background<commit_after>/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   parse.c                                            :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: bbeldame <<EMAIL>>          +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2017/04/06 19:20:10 by bbeldame          #+#    #+#             */
/*   Updated: 2017/04/09 21:14:54 by bbeldame         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "../includes/rtv1.h"

/*
** @todo : take a .rt file as parameter and parse the content into the t_env
*/

t_env	*parse(t_env *e)
{
	t_object	*tmp;

	e->obj = (t_object *)semalloc(sizeof(t_object));
	tmp = e->obj;

	tmp->type = SPHERE;
	tmp->origin = c_vector(0, 0, 300);
	tmp->radius = 20;
	tmp->color = c_color(250, 100, 20);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;

	/*tmp->type = PLANE;
	tmp->origin = c_vector(1, 1, 0);
	tmp->direction = c_vector(1, 0, 0);
	tmp->color = c_color(30, 210, 80);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;*/
	
	tmp->type = SPHERE;
	tmp->origin = c_vector(-10, -10, 120);
	tmp->radius = 10;
	tmp->color = c_color(10, 160, 20);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;

	tmp->type = SPHERE;
	tmp->origin = c_vector(26, -23, 100);
	tmp->radius = 20;
	tmp->color = c_color(255, 255, 51);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;

	tmp->type = SPHERE;
	tmp->origin = c_vector(0, 0, 500);
	tmp->radius = 50;
	tmp->color = c_color(100, 50, 180);
	tmp->next = (t_object *)semalloc(sizeof(t_object));
	tmp = tmp->next;

	tmp->type = SPHERE;
{'fraction_non_alphanumeric': 0.2532870255519722, 'fraction_numerical': 0.048375093029025054, 'mean_word_length': 1.621586475942783, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6108137', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1278, 'n_words': 249}