Skip to content
Snippets Groups Projects
Commit cb3416a3 authored by phamthit's avatar phamthit
Browse files

Change the colour of objects

parent 598b9e33
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,7 @@ int16_t draw_plane(struct frame_buffer* self, const int x, const int y) {
uint32_t col = i % pic_size;
uint32_t row = i / pic_size;
int fb_index = ((y + row) * self->width) + (x + col);
self->buffer[fb_index] = picture[i] != 0 ? FB_BLUE : (FBUF_DTYPE)self->background_color;
self->buffer[fb_index] = picture[i] != 0 ? FB_GREEN : (FBUF_DTYPE)self->background_color;
}
return ret;
......@@ -214,7 +214,7 @@ int16_t draw_enemy(struct frame_buffer* self, const int x, const int y){
uint32_t col = i % pic_size;
uint32_t row = i / pic_size;
int fb_index = ((y + row) * self->width) + (x + col);
self->buffer[fb_index] = picture[i] != 0 ? FB_BLUE : (FBUF_DTYPE)self->background_color;
self->buffer[fb_index] = picture[i] != 0 ? FB_RED : (FBUF_DTYPE)self->background_color;
}
return ret;
......
......@@ -54,6 +54,7 @@ enum {ERROR_BUF_INIT = 201,ERROR_INVALID_VALUES};
#define FB_GREEN (RGB(0, FB_GREEN_MAX, 0))
#define FB_RED (RGB(FB_RED_MAX, 0, 0))
#define FB_BLACK (RGB(0,0,0))
#define FB_WHITE (RGB(FB_RED_MAX, FB_GREEN_MAX, FB_BLUE_MAX)
#define DEFAULT_PICTURE_SIZE 16
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment