aboutsummaryrefslogtreecommitdiff
path: root/src/userspace/graphics/framebuffer.c
diff options
context:
space:
mode:
authorMarvin Borner2020-03-18 17:32:50 +0100
committerMarvin Borner2020-03-18 17:32:50 +0100
commitf495cc1e93710c233292a503720ec235a61b685c (patch)
tree23b0b4b82b6d80001c1ffdb15f00b93cbdc65722 /src/userspace/graphics/framebuffer.c
parentc6657aac0c5d5ecf347bc082cb6df38e1174d297 (diff)
Applied official linux kernel code style guidelines
Due to my change to vim and the clang-format plugin this was needed!
Diffstat (limited to 'src/userspace/graphics/framebuffer.c')
-rw-r--r--src/userspace/graphics/framebuffer.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/userspace/graphics/framebuffer.c b/src/userspace/graphics/framebuffer.c
index 6fc1937..9994075 100644
--- a/src/userspace/graphics/framebuffer.c
+++ b/src/userspace/graphics/framebuffer.c
@@ -9,38 +9,38 @@ int vbe_width = 2560;
void vesa_draw_rectangle(int x1, int y1, int x2, int y2, const uint32_t color[3])
{
- int pos1 = x1 * vbe_bpl + y1 * vbe_pitch;
- char *draw = (char *) &fb[pos1];
- for (int i = 0; i <= y2 - y1; i++) {
- for (int j = 0; j <= x2 - x1; j++) {
- draw[vbe_bpl * j] = color[2];
- draw[vbe_bpl * j + 1] = color[1];
- draw[vbe_bpl * j + 2] = color[0];
- }
- draw += vbe_pitch;
- }
+ int pos1 = x1 * vbe_bpl + y1 * vbe_pitch;
+ char *draw = (char *)&fb[pos1];
+ for (int i = 0; i <= y2 - y1; i++) {
+ for (int j = 0; j <= x2 - x1; j++) {
+ draw[vbe_bpl * j] = color[2];
+ draw[vbe_bpl * j + 1] = color[1];
+ draw[vbe_bpl * j + 2] = color[0];
+ }
+ draw += vbe_pitch;
+ }
}
void vesa_set_pixel(uint16_t x, uint16_t y, const uint32_t color[3])
{
- unsigned pos = x * vbe_bpl + y * vbe_pitch;
- char *draw = (char *) &fb[pos];
- draw[pos] = color[2];
- draw[pos + 1] = color[1];
- draw[pos + 2] = color[0];
+ unsigned pos = x * vbe_bpl + y * vbe_pitch;
+ char *draw = (char *)&fb[pos];
+ draw[pos] = color[2];
+ draw[pos + 1] = color[1];
+ draw[pos + 2] = color[0];
}
void vesa_clear()
{
- uint32_t color[3] = {0, 0, 0};
- vesa_draw_rectangle(0, 0, vbe_width - 1, vbe_height - 1, color);
+ uint32_t color[3] = { 0, 0, 0 };
+ vesa_draw_rectangle(0, 0, vbe_width - 1, vbe_height - 1, color);
}
void init_framebuffer()
{
- struct userspace_pointers *pointers = (struct userspace_pointers *) syscall_get_pointers();
- fb = (unsigned char *) 0xfd000000;
+ struct userspace_pointers *pointers = (struct userspace_pointers *)syscall_get_pointers();
+ fb = (unsigned char *)0xfd000000;
- uint32_t color[3] = {0xff, 0x00, 0x00};
- vesa_set_pixel(0, 0, color);
+ uint32_t color[3] = { 0xff, 0x00, 0x00 };
+ vesa_set_pixel(0, 0, color);
} \ No newline at end of file