Added memorybook to parsing and cleaned most of the files
This commit is contained in:
@@ -1,65 +1,16 @@
|
||||
#include "cube3d.h"
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* draw.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: pblagoje <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/05/04 13:55:29 by pblagoje #+# #+# */
|
||||
/* Updated: 2022/05/04 13:55:31 by pblagoje ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
// tmp draw map
|
||||
// static void draw_square(t_game *game, t_coord pos, int border, int fill, int size, int rotation)
|
||||
// {
|
||||
// int i;
|
||||
// int j;
|
||||
// t_coord new;
|
||||
//
|
||||
// i = 0;
|
||||
// while (i < size)
|
||||
// {
|
||||
// j = 0;
|
||||
// while (j < size)
|
||||
// {
|
||||
// new.x = pos.x + j;
|
||||
// new.y = pos.y + i;
|
||||
// if (rotation)
|
||||
// rotate(&(game->plr), &(new));
|
||||
// if (!i || i == size - 1)
|
||||
// draw_pixel(&game->map_img, new.x, new.y, border);
|
||||
// else if (!j || j == size - 1)
|
||||
// draw_pixel(&game->map_img, new.x, new.y, border);
|
||||
// else
|
||||
// draw_pixel(&game->map_img, new.x, new.y, fill);
|
||||
// j++;
|
||||
// }
|
||||
// i++;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// static void draw_map(t_game *game)
|
||||
// {
|
||||
// t_coord incr;
|
||||
// t_coord pos;
|
||||
// int cell;
|
||||
//
|
||||
// cell = game->map.cell;
|
||||
// incr.x = 0;
|
||||
// pos.x = 0;
|
||||
// pos.y = 0;
|
||||
// while ((game->map.content)[incr.x])
|
||||
// {
|
||||
// incr.y = 0;
|
||||
// while ((game->map.content)[incr.x][incr.y])
|
||||
// {
|
||||
// if ((game->map.content)[incr.x][incr.y] == '1' )
|
||||
// draw_square(game, pos, 0x00999999, 0x00000000, cell, 0);
|
||||
// else
|
||||
// draw_square(game, pos, 0x00555555, 0x00333333, cell, 0);
|
||||
// (incr.y)++;
|
||||
// pos.x += cell;
|
||||
// }
|
||||
// (incr.x)++;
|
||||
// pos.x = 0;
|
||||
// pos.y += cell;
|
||||
// }
|
||||
// pos.x = game->plr.pos.x - cell / 2;
|
||||
// pos.y = game->plr.pos.y - cell / 2;
|
||||
// draw_square(game, pos, 0x00999900, 0x00330033, cell, 1);
|
||||
// }
|
||||
// tmp end
|
||||
#include "cube3d.h"
|
||||
|
||||
static int pxl_out_limits(t_img *img, int x, int y)
|
||||
{
|
||||
@@ -80,7 +31,7 @@ void draw_pixel(t_img *img, int x, int y, int color)
|
||||
if (pxl_out_limits(img, x, y))
|
||||
return ;
|
||||
position = y * img->szl + x * (img->bpp / 8);
|
||||
*(unsigned int*)(img->data + position) = color;
|
||||
*(unsigned int *)(img->data + position) = color;
|
||||
}
|
||||
|
||||
void draw_line(t_img *img, t_vec *vec, int color)
|
||||
@@ -105,16 +56,6 @@ void draw_line(t_img *img, t_vec *vec, int color)
|
||||
|
||||
void draw(t_game *game)
|
||||
{
|
||||
// tmp draw map
|
||||
// draw_map(game);
|
||||
// tmp end
|
||||
|
||||
raycast(game, &(game->rcast));
|
||||
|
||||
// tmp draw map
|
||||
// draw_screen(game, &(game->rcast));
|
||||
// mlx_put_image_to_window(game->mlx_ptr, game->map_win.ptr, game->map_img.ptr, 0, SCREEN_HEIGHT);
|
||||
// tmp end
|
||||
|
||||
mlx_put_image_to_window(game->mlx_ptr, game->win.ptr, game->img.ptr, 0, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user