forked from xiaozhi/xiaozhi-esp32
fix emote display errors (#1240)
This commit is contained in:
@@ -129,10 +129,10 @@ private:
|
|||||||
esp_lcd_panel_disp_on_off(panel, true);
|
esp_lcd_panel_disp_on_off(panel, true);
|
||||||
|
|
||||||
#if CONFIG_USE_EMOTE_MESSAGE_STYLE
|
#if CONFIG_USE_EMOTE_MESSAGE_STYLE
|
||||||
display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT);
|
display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT);
|
||||||
#else
|
#else
|
||||||
display_ = new SpiLcdDisplay(panel_io, panel,
|
display_ = new SpiLcdDisplay(panel_io, panel,
|
||||||
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
|
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ static void SetupUI(const gfx_handle_t engine_handle, EmoteDisplay* const displa
|
|||||||
g_obj_anim_eye = gfx_anim_create(engine_handle);
|
g_obj_anim_eye = gfx_anim_create(engine_handle);
|
||||||
gfx_obj_align(g_obj_anim_eye, GFX_ALIGN_LEFT_MID, 10, 30);
|
gfx_obj_align(g_obj_anim_eye, GFX_ALIGN_LEFT_MID, 10, 30);
|
||||||
gfx_anim_set_auto_mirror(g_obj_anim_eye, true);
|
gfx_anim_set_auto_mirror(g_obj_anim_eye, true);
|
||||||
|
gfx_obj_set_visible(g_obj_anim_eye, false);
|
||||||
|
|
||||||
g_obj_label_toast = gfx_label_create(engine_handle);
|
g_obj_label_toast = gfx_label_create(engine_handle);
|
||||||
gfx_obj_align(g_obj_label_toast, GFX_ALIGN_TOP_MID, 0, 20);
|
gfx_obj_align(g_obj_label_toast, GFX_ALIGN_TOP_MID, 0, 20);
|
||||||
@@ -290,8 +291,9 @@ EmoteEngine::EmoteEngine(const esp_lcd_panel_handle_t panel, const esp_lcd_panel
|
|||||||
InitializeGraphics(panel, &engine_handle_, width, height);
|
InitializeGraphics(panel, &engine_handle_, width, height);
|
||||||
|
|
||||||
if (display) {
|
if (display) {
|
||||||
DisplayLockGuard lock(display);
|
gfx_emote_lock(engine_handle_);
|
||||||
SetupUI(engine_handle_, display);
|
SetupUI(engine_handle_, display);
|
||||||
|
gfx_emote_unlock(engine_handle_);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterCallbacks(panel_io, engine_handle_);
|
RegisterCallbacks(panel_io, engine_handle_);
|
||||||
@@ -322,6 +324,7 @@ void EmoteEngine::SetEyes(const std::string &emoji_name, const bool repeat, cons
|
|||||||
DisplayLockGuard lock(display);
|
DisplayLockGuard lock(display);
|
||||||
gfx_anim_set_src(g_obj_anim_eye, emoji_data.data, emoji_data.size);
|
gfx_anim_set_src(g_obj_anim_eye, emoji_data.data, emoji_data.size);
|
||||||
gfx_anim_set_segment(g_obj_anim_eye, 0, 0xFFFF, fps, repeat);
|
gfx_anim_set_segment(g_obj_anim_eye, 0, 0xFFFF, fps, repeat);
|
||||||
|
gfx_obj_set_visible(g_obj_anim_eye, true);
|
||||||
gfx_anim_start(g_obj_anim_eye);
|
gfx_anim_start(g_obj_anim_eye);
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGW(TAG, "SetEyes: No emoji data found for %s", emoji_name.c_str());
|
ESP_LOGW(TAG, "SetEyes: No emoji data found for %s", emoji_name.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user