Skip to content

Commit

Permalink
improved in torch rendering current put pixel range validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Iipal committed Jun 13, 2019
1 parent bc7f43c commit c01fb63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions srcs/rendering/wolf_torch.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: tmaluh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/16 22:08:27 by tmaluh #+# #+# */
/* Updated: 2019/06/13 09:44:46 by tmaluh ### ########.fr */
/* Updated: 2019/06/13 09:46:30 by tmaluh ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -32,7 +32,8 @@ void wolf_rendering_torch(t_torch *torch, Uint32 *win_pxls, uint8_t fog_freq)
curr_tex_pxl = torch->tex[torch_frame]
.pixels[p.y * torch->tex[torch_frame].surf->w + p.x];
if (curr_tex_pxl != 0xff000000 || curr_tex_pxl != 0x00)
win_pxls[(p.y + torch_shift.y) * WIN_X + (p.x + torch_shift.x)]
= curr_tex_pxl;
if (WIN_Y > p.y + torch_shift.y && WIN_X > p.x + torch_shift.x)
win_pxls[(p.y + torch_shift.y)
* WIN_X + (p.x + torch_shift.x)] = curr_tex_pxl;
}
}

0 comments on commit c01fb63

Please sign in to comment.