Started from buttom go to the sky
This commit is contained in:
parent
96215449bd
commit
f811e55dea
4781 changed files with 10121 additions and 1743 deletions
36
stdme/src/blx/sprite/sprite_draw_onto_sprite.c
Normal file
36
stdme/src/blx/sprite/sprite_draw_onto_sprite.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* sprite_draw_onto_sprite.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/12/26 19:33:22 by maiboyer #+# #+# */
|
||||
/* Updated: 2023/12/31 15:26:41 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "me/blx/blx.h"
|
||||
#include "me/blx/colors.h"
|
||||
#include "me/blx/sprite.h"
|
||||
#include "me/types.h"
|
||||
#include "me/vec2/vec2.h"
|
||||
|
||||
void sprite_draw_onto(t_sprite *dest, t_vi2d pos, t_sprite *source)
|
||||
{
|
||||
t_vi2d p;
|
||||
t_color col;
|
||||
|
||||
p.y = 0;
|
||||
while (p.y < source->height)
|
||||
{
|
||||
p.x = 0;
|
||||
while (p.x < source->width)
|
||||
{
|
||||
sprite_get_pixel(source, p, &col);
|
||||
sprite_draw(dest, vi2d_add(pos, p), col);
|
||||
p.x++;
|
||||
}
|
||||
p.y++;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue