kopia lustrzana https://github.com/OpenRTX/OpenRTX
GFX: Add gfx_clearRows() implementation
rodzic
5f669d1c18
commit
42ccc3ac28
|
@ -147,7 +147,18 @@ void gfx_render();
|
|||
bool gfx_renderingInProgress();
|
||||
|
||||
/**
|
||||
* Makes the screen black.
|
||||
* Clears a portion of the screen content
|
||||
* This results in a black screen on color displays
|
||||
* And a white screen on B/W displays
|
||||
* @param startRow: first row of the framebuffer section to be cleared
|
||||
* @param endRow: last row of the framebuffer section to be cleared
|
||||
*/
|
||||
void gfx_clearRows(uint8_t startRow, uint8_t endRow);
|
||||
|
||||
/**
|
||||
* Clears the content of the screen
|
||||
* This results in a black screen on color displays
|
||||
* And a white screen on B/W displays
|
||||
*/
|
||||
void gfx_clearScreen();
|
||||
|
||||
|
|
|
@ -85,6 +85,16 @@ rgb565_t _true2highColor(color_t true_color)
|
|||
return high_color;
|
||||
}
|
||||
|
||||
void gfx_clearRows(uint8_t startRow, uint8_t endRow)
|
||||
{
|
||||
if(!initialized) return;
|
||||
if(endRow < startRow) return;
|
||||
uint16_t start = startRow * SCREEN_WIDTH * sizeof(rgb565_t);
|
||||
uint16_t height = endRow - startRow * SCREEN_WIDTH * sizeof(rgb565_t);
|
||||
// Set the specified rows to 0x00 = make the screen black
|
||||
memset(buf + start, 0x00, height);
|
||||
}
|
||||
|
||||
void gfx_clearScreen()
|
||||
{
|
||||
if(!initialized) return;
|
||||
|
|
Ładowanie…
Reference in New Issue