orton_runner/src/draw/draw_compresed_bmp.c

67 lines
1.1 KiB
C

/*
** EPITECH PROJECT, 2018
** task01
** File description:
** I do task
*/
#include "game/endtext_bmp.h"
#include "lib/my_graphics.h"
#include "game/logo_bmp.h"
#include "game/draw.h"
#include "game/core.h"
static void set_8px_bmp(sfml_t *sfml, int type, int *x, int y)
{
int i;
i = -1;
if (type == 0xff){
*x += (8 << 3);
return;
}
while (++i < (8 << 3)){
if (!(type & (0x80 >> (i >> 3))))
my_pixel(sfml, *x, y, 0x000000ff);
else
my_pixel(sfml, *x, y, 0xffffffff);
(*x)++;
}
}
void draw_logo_bmp(sfml_t *sfml, int y)
{
int j;
int i;
int x;
j = -1;
while (++j < BMP_HEIGHT << 3){
i = -1;
x = (sfml->width >> 1) - (BMP_WIDTH << 6 >> 1);
while (++i < BMP_WIDTH)
set_8px_bmp(sfml, title_bmp[(j >> 3 << 4) + i],
&x, y);
y++;
}
}
void draw_endtext_bmp(sfml_t *sfml)
{
int j;
int i;
int x;
int y;
j = -1;
y = (SCREEN_HEIGHT >> 2) - (BMP_END_HEIGHT << 3 >> 1);
while (++j < BMP_END_HEIGHT << 3){
i = -1;
x = (sfml->width >> 1) - (BMP_END_WIDTH << 6 >> 1);
while (++i < BMP_END_WIDTH)
set_8px_bmp(sfml, ~endtext_bmp[(j >> 3 << 4) + i],
&x, y);
y++;
}
}