Core Native GBA 0.0.17
create your own game-engine with just lua for nitendo game boy advance console.
Loading...
Searching...
No Matches
draw_rect.c
Go to the documentation of this file.
1#include "zeebo.h"
2
3void draw_cmd_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h)
4{
5 if (draw_mode) {
6 for (int i = 0; i < w; i++) {
7 *(uint16_t *)(0x06000000 + ((y) * 240 + (x + i)) * 2) = draw_color.pixel;
8 }
9 for (int i = 0; i <= w; i++) {
10 *(uint16_t *)(0x06000000 + ((y + h) * 240 + (x + i)) * 2) = draw_color.pixel;
11 }
12 for (int i = 0; i < h; i++) {
13 *(uint16_t *)(0x06000000 + ((y + i) * 240 + (x)) * 2) = draw_color.pixel;
14 }
15 for (int i = 0; i < h; i++) {
16 *(uint16_t *)(0x06000000 + ((y + i) * 240 + (x + w)) * 2) = draw_color.pixel;
17 }
18 return;
19 }
20
21 for (int i = 0; i < h; i++) {
22 for (int j = 0; j < w; j++) {
23 *(uint16_t *)(0x06000000 + ((y + i) * 240 + (x + j)) * 2) = draw_color.pixel;
24 }
25 }
26}
uint8_t draw_mode
Definition draw_color.c:8
color_t draw_color
Definition draw_color.c:7
void draw_cmd_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h)
Definition draw_rect.c:3
uint16_t pixel
Definition zeebo.h:11