33 lines
758 B
C
33 lines
758 B
C
/*
|
|
** EPITECH PROJECT, 2018
|
|
** task01
|
|
** File description:
|
|
** I do task
|
|
*/
|
|
#include "lib/my_graphics.h"
|
|
#include "game/kinematic.h"
|
|
#include "game/core.h"
|
|
#include "game/draw.h"
|
|
|
|
static const uint8_t grass[] = {255, 221, 187, 255, 255, 255, 255, 255};
|
|
void set_background(sfml_t *sfml)
|
|
{
|
|
int offset_x = (sfml->scene->camera->x >> 1) & 0x3f;
|
|
int offset_y = (sfml->scene->camera->y >> 1) & 0x3f;
|
|
int rectangle[4];
|
|
int i;
|
|
int j;
|
|
|
|
i = -1;
|
|
while (++i < BLOCK_LOAD_Y + 1){
|
|
j = -1;
|
|
while (++j < BLOCK_LOAD_X + 1){
|
|
rectangle[0] = -offset_x + (j << 6) + 4;
|
|
rectangle[1] = -offset_y + (i << 6) + 4;
|
|
rectangle[2] = -offset_x + (j << 6) + 60;
|
|
rectangle[3] = -offset_y + (i << 6) + 60;
|
|
my_filled_rectangle(sfml, rectangle, 0xaaaaaaff);
|
|
}
|
|
}
|
|
}
|