kopia lustrzana https://github.com/OpenRTX/OpenRTX
graphics_rgb565.c: Replaced hardtabs with spaces
rodzic
05f15d0488
commit
dac60a7be5
|
@ -24,6 +24,7 @@
|
|||
#include "display.h"
|
||||
#include "graphics.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define COLOR_WHITE = {31, 63, 31}
|
||||
|
||||
|
@ -91,21 +92,21 @@ rgb565_t _true2highColor(color_t true_color)
|
|||
uint8_t high_g = true_color.g >> 2;
|
||||
uint8_t high_b = true_color.b >> 3;
|
||||
rgb565_t high_color = {high_r, high_g, high_b};
|
||||
/*printf("Converting color... True: R:%02XG:%02XB:%02X High:R:%02XG:%02XB:%02X\n", true_color.r,
|
||||
true_color.g, true_color.b, high_r, high_g, high_b);*/
|
||||
return high_color;
|
||||
}
|
||||
|
||||
void graphics_clearScreen()
|
||||
{
|
||||
if(!initialized)
|
||||
return;
|
||||
if(!initialized) return;
|
||||
// Set the whole framebuffer to 0x00 = make the screen black
|
||||
memset(buf, 0x00, sizeof(rgb565_t) * screen_width * screen_height);
|
||||
}
|
||||
|
||||
void graphics_fillScreen(color_t color)
|
||||
{
|
||||
if(!initialized)
|
||||
return;
|
||||
if(!initialized) return;
|
||||
rgb565_t color_565 = _true2highColor(color);
|
||||
for(int y=0; y < screen_height; y++)
|
||||
{
|
||||
|
@ -118,8 +119,7 @@ void graphics_fillScreen(color_t color)
|
|||
|
||||
void graphics_drawLine(point_t start, point_t end, color_t color)
|
||||
{
|
||||
if(!initialized)
|
||||
return;
|
||||
if(!initialized) return;
|
||||
rgb565_t color_565 = _true2highColor(color);
|
||||
for(int y=0; y < screen_height; y++)
|
||||
{
|
||||
|
@ -132,8 +132,7 @@ void graphics_drawLine(point_t start, point_t end, color_t color)
|
|||
|
||||
void graphics_drawRect(point_t start, uint16_t width, uint16_t height, color_t color, bool fill)
|
||||
{
|
||||
if(!initialized)
|
||||
return;
|
||||
if(!initialized) return;
|
||||
rgb565_t color_565 = _true2highColor(color);
|
||||
uint16_t x_max = start.x + width;
|
||||
uint16_t y_max = start.y + height;
|
||||
|
|
Ładowanie…
Reference in New Issue