Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/13 move objects #44

Merged
merged 16 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rt_init
  • Loading branch information
davfront committed Jun 30, 2023
commit def6c8eaf9f79ddd6ced922630120cdf1848dd7c
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# By: dapereir <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/14 16:34:41 by dapereir #+# #+# #
# Updated: 2023/06/30 14:59:47 by dapereir ### ########.fr #
# Updated: 2023/06/30 22:36:06 by dapereir ### ########.fr #
# #
# **************************************************************************** #

Expand Down Expand Up @@ -69,6 +69,7 @@ SRCS_FILES = \
vec3/mat4_multiply_vec3.c\
vec3/mat4_multiply_axis.c\
\
utils/rt_init.c\
utils/rt_delete.c\
utils/rt_error.c\
utils/rt_exit.c\
Expand Down
5 changes: 3 additions & 2 deletions include/minirt.h
davfront marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: dapereir <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/14 16:35:14 by dapereir #+# #+# */
/* Updated: 2023/06/30 15:22:25 by dapereir ### ########.fr */
/* Updated: 2023/06/30 22:42:22 by dapereir ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -37,7 +37,7 @@
# define PHONG_SPECULAR_WEIGHT (0.4)
# define PHONG_SPECULAR_EXPONENT (50)

# define ENABLE_THREAD 1
# define ENABLE_THREAD 0
# define THREAD_NB 4

# define LOW_RES_ENABLED 1
Expand Down Expand Up @@ -126,6 +126,7 @@ typedef struct s_data {
} t_data;

// utils
void rt_init(t_data *data);
void rt_delete(t_data *data);
void rt_error(char *msg);
void rt_exit(t_data *data);
Expand Down
5 changes: 2 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: dapereir <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/06/06 14:56:16 by dapereir #+# #+# */
/* Updated: 2023/06/13 23:15:36 by dapereir ### ########.fr */
/* Updated: 2023/06/30 22:37:24 by dapereir ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -16,8 +16,7 @@ int main(int argc, char **argv)
{
t_data data;

ft_bzero(&data, sizeof(data));
data.fd = -1;
rt_init(&data);
rt_parse(&data, argc, argv);
rt_viewer_start(&data);
rt_delete(&data);
Expand Down
21 changes: 21 additions & 0 deletions src/utils/rt_init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* rt_init.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dapereir <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/14 16:35:43 by dapereir #+# #+# */
/* Updated: 2023/06/30 22:40:26 by dapereir ### ########.fr */
/* */
/* ************************************************************************** */

#include "minirt.h"

void rt_init(t_data *data)
{
if (!data)
return ;
ft_bzero(data, sizeof(t_data));
data->fd = -1;
}