mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-26 22:40:25 +00:00
API CleanUp part 3
This commit is contained in:
parent
03d8804209
commit
aab4d2bd34
8 changed files with 20 additions and 2910 deletions
2
applications/external/doom/display.h
vendored
2
applications/external/doom/display.h
vendored
|
@ -90,7 +90,7 @@ void drawVLine(uint8_t x, int8_t start_y, int8_t end_y, uint8_t intensity, Canva
|
|||
|
||||
void setupDisplay(Canvas* canvas) {
|
||||
memset(zbuffer, 0xff, 128);
|
||||
display_buf = (uint8_t*)canvas_get_buffer(canvas);
|
||||
display_buf = (uint8_t*)canvas->fb.tile_buf_ptr;
|
||||
//display_buf = u8g2_GetBufferPtr(&canvas->fb);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
//#include <notification/notification_messages.h>
|
||||
//#include <stdlib.h>
|
||||
|
||||
#include <u8g2.h>
|
||||
|
||||
#include "FlipperZeroWiFiDeauthModuleDefines.h"
|
||||
|
||||
#define DEAUTH_APP_DEBUG 0
|
||||
|
@ -192,8 +190,8 @@ static void esp8266_deauth_module_render_callback(Canvas* const canvas, void* ct
|
|||
#endif // ENABLE_MODULE_POWER
|
||||
break;
|
||||
case ModuleActive: {
|
||||
uint8_t* buffer = canvas_get_buffer(canvas);
|
||||
app->m_canvasSize = canvas_get_buffer_size(canvas);
|
||||
uint8_t* buffer = canvas->fb.tile_buf_ptr;
|
||||
app->m_canvasSize = gui_get_framebuffer_size(app->m_gui);
|
||||
memcpy(buffer, app->m_backBuffer, app->m_canvasSize);
|
||||
} break;
|
||||
default:
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include <notification/notification_messages.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <u8g2.h>
|
||||
|
||||
#include "FlipperZeroWiFiModuleDefines.h"
|
||||
|
||||
#define WIFI_APP_DEBUG 0
|
||||
|
@ -531,7 +529,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) {
|
|||
//canvas_set_custom_u8g2_font(canvas, u8g2_font_inb27_mr);
|
||||
canvas_set_custom_u8g2_font(canvas, u8g2_font_inb27_mr);
|
||||
uint8_t fontHeight = canvas_current_font_height(canvas);
|
||||
uint8_t fontWidth = u8g2_GetMaxCharWidth(&canvas->fb);
|
||||
uint8_t fontWidth = canvas_current_font_width(canvas);
|
||||
|
||||
if(app->m_currentAccesspointDescription.m_rssi == NA) {
|
||||
offsetX += floor(128 / 2) - fontWidth - 10;
|
||||
|
@ -550,7 +548,7 @@ static void wifi_module_render_callback(Canvas* const canvas, void* ctx) {
|
|||
//canvas_set_font(canvas, FontPrimary);
|
||||
canvas_set_custom_u8g2_font(canvas, u8g2_font_7x13B_tr);
|
||||
fontHeight = canvas_current_font_height(canvas);
|
||||
fontWidth = u8g2_GetMaxCharWidth(&canvas->fb);
|
||||
fontWidth = canvas_current_font_width(canvas);
|
||||
|
||||
offsetX = 5;
|
||||
offsetY = 64 - 7 - fontHeight;
|
||||
|
|
|
@ -14,7 +14,6 @@ App(
|
|||
"gui.h",
|
||||
"icon_i.h",
|
||||
"elements.h",
|
||||
"canvas_i.h",
|
||||
"view_dispatcher.h",
|
||||
"view_stack.h",
|
||||
"modules/button_menu.h",
|
||||
|
|
|
@ -100,6 +100,11 @@ uint8_t canvas_current_font_height(const Canvas* canvas) {
|
|||
return font_height;
|
||||
}
|
||||
|
||||
uint8_t canvas_current_font_width(const Canvas* canvas) {
|
||||
furi_assert(canvas);
|
||||
return (uint8_t)u8g2_GetMaxCharWidth(&canvas->fb);
|
||||
}
|
||||
|
||||
const CanvasFontParameters* canvas_get_font_params(const Canvas* canvas, Font font) {
|
||||
furi_assert(canvas);
|
||||
furi_assert(font < FontTotalNumber);
|
||||
|
|
|
@ -120,6 +120,14 @@ uint8_t canvas_height(const Canvas* canvas);
|
|||
*/
|
||||
uint8_t canvas_current_font_height(const Canvas* canvas);
|
||||
|
||||
/** Get current font width
|
||||
*
|
||||
* @param canvas Canvas instance
|
||||
*
|
||||
* @return width in pixels.
|
||||
*/
|
||||
uint8_t canvas_current_font_width(const Canvas* canvas);
|
||||
|
||||
/** Get font parameters
|
||||
*
|
||||
* @param canvas Canvas instance
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -44,7 +44,6 @@ env.Append(
|
|||
"variant",
|
||||
)
|
||||
),
|
||||
File("u8g2/u8g2.h"),
|
||||
],
|
||||
CPPDEFINES=[
|
||||
'"M_MEMORY_FULL(x)=abort()"',
|
||||
|
|
Loading…
Reference in a new issue