fix(sdk+launcher): 图标不渲染真根因(agent-219) — meow_ui_img.c scale_buf cover 采样把乘写成除(÷缩放比→采到源图左上角透明区,全丢); 改乘+居中裁剪偏移修正; 宿主旧测试用纯色图掩盖了该bug。+ main_menu App退出/结构变化重绘时 fb_pan_buf0_force 无条件pan回buffer0(防App翻页留buffer1致菜单残帧)

meow_ui.a→3e0ee8f7 launcher→9d0efc2f hello→9609ea6e files→90f5cf07 ncm→be8be221(均已上卡); 真机截图证据 .tmp/meowbug/fix1.png+fix_b2_after.png
This commit is contained in:
MeowOS committed 2026-08-31 15:42:24 +08:00
1 parent 05a19a9ea3
commit ab4da09e75
45 files changed
+1926 -147

No files matched your search

+20 -5
View File
@@ -231,7 +231,12 @@ static void plr_draw_dyn(void *ctx)
int line_h = (g_landscape) ? 24 : 26;
int center_y = g_lyr.y + g_lyr.h / 2;
int lcx = g_lyr.x + g_lyr.w / 2;
if (n == 0) { meow_ui_text_center(lcx, center_y - 10, "no lyric", 20, th->onSurfaceVariant); }
if (n == 0) {
/* 二期:歌词后台加载,状态区分「加载中 / 真的无词」 */
meow_ui_text_center(lcx, center_y - 10,
lyric_state() == 2 ? "no lyric" : "loading lyric...",
20, th->onSurfaceVariant);
}
else {
int64_t ps = player_manager_pos_ms();
int cur2 = lyric_line_at(ps);
@@ -249,9 +254,10 @@ static void plr_draw_dyn(void *ctx)
}
}
/* 页脚提示 */
/* 页脚提示(用「・」U+30FB 而非 U+00B7「·」:common 字库按 GB2312 解码 A1A4 得 U+30FB,
* 不含 U+00B7 → 后者在设备上是豆腐块。REPORT §11 二期。) */
char foot[64];
snprintf(foot, sizeof foot, "左右滑切歌 · 点顶部切横屏");
snprintf(foot, sizeof foot, "左右滑切歌 ・ 点顶部切横屏");
meow_ui_text_center(r_cont.x + r_cont.w / 2, r_cont.y + r_cont.h - APP_FOOTER_H,
foot, 20, th->onSurfaceVariant);
}
@@ -297,9 +303,13 @@ void player_on_tap(int x, int y)
void player_play_song(int idx)
{
if (idx < 0 || idx >= g_st.song_count) return;
/* 二期:黑胶封面用真实专辑图(song_detail 的 al.picUrl,经 ncm_cache 缓存/限幅),
* 无 al.picUrl(如无版权占位)时回落歌单封面。 */
const ncm_song_t *s = &g_st.songs[idx];
const char *cover = (s && s->al_pic[0]) ? s->al_pic : g_st.cover_url;
player_manager_play(idx);
appstate_set_playing_song(idx, g_st.cover_url);
cover_request(g_st.cover_url);
appstate_set_playing_song(idx, cover);
cover_request(cover);
meow_view_page_push(ACT_PLAYER);
}
@@ -328,6 +338,11 @@ void player_tick(uint64_t now)
if (sc != g_last_song) {
g_last_song = sc;
/* 切歌(next/prev/自动顺延)→ 请求新曲专辑封面(黑胶盘换图) */
if (sc >= 0) {
const ncm_song_t *s2 = &g_st.songs[sc];
cover_request(s2->al_pic[0] ? s2->al_pic : g_st.cover_url);
}
meow_ui_invalidate(g_dyn_r.x, g_dyn_r.y, g_dyn_r.w, g_dyn_r.h); /* 歌名/歌手变 */
}
if (cover_changed()) {
+49 -14
View File
@@ -33,6 +33,8 @@ static volatile int g_plgen;
static int g_placked;
static volatile int g_plloading;
static volatile int g_plloaded_idx;
static volatile int g_ploffset; /* 本页起始下标(0=首屏重头;>0=触底追加) */
static volatile int g_pl_more; /* 1=尚有下一页可加载(页满且未到 NCM_SONG_MAX) */
static void pl_drag_reset(void)
{
@@ -171,12 +173,12 @@ static void pl_draw_footer(void *ctx)
ncm_draw_footer(r_cont, foot);
}
static void pl_apply(void)
/* apply:reset_scroll=1 时列表回顶并清选中(首屏/刷新);0=保持当前滚动(触底追加,防跳顶)。 */
static void pl_apply(int reset_scroll)
{
if (g_list) {
meow_listview_set_count(g_list, g_st.song_count);
meow_listview_set_scroll(g_list, 0);
meow_listview_set_sel(g_list, -1);
if (reset_scroll) { meow_listview_set_scroll(g_list, 0); meow_listview_set_sel(g_list, -1); }
}
if (g_tb && g_st.active_playlist >= 0 && g_st.active_playlist < g_st.playlist_count) {
snprintf(g_title, sizeof g_title, "%s", g_st.playlists[g_st.active_playlist].name);
@@ -191,12 +193,17 @@ static void *playlist_worker(void *arg)
{
(void)arg;
int my_idx = g_st.active_playlist;
int off = g_ploffset;
int rc;
if (g_host_mock) rc = 0;
else if (my_idx < 0) rc = NCM_ERR_ARG;
else rc = appstate_load_playlist_songs(my_idx);
else rc = appstate_load_playlist_songs_page(my_idx, off, NCM_PLAYLIST_PAGE);
pthread_mutex_lock(&g_plmu);
g_load_err = rc;
/* 页满(==NCM_PLAYLIST_PAGE)且未到记忆上限 → 还有下一页;否则到屏尾 */
int loaded = (rc == NCM_OK) ? (g_st.song_count - off) : 0;
g_pl_more = (rc == NCM_OK) && (loaded >= NCM_PLAYLIST_PAGE) &&
(g_st.song_count < NCM_SONG_MAX);
g_plloading = 0;
g_plloaded_idx = my_idx;
g_plgen++;
@@ -204,18 +211,39 @@ static void *playlist_worker(void *arg)
return NULL;
}
void playlist_refresh(void)
/* 触底加载下一页:仅当仍有下一页、未在载、且未到 NCM_SONG_MAX 时发。 */
static void pl_maybe_load_more(void)
{
if (g_host_mock) { g_load_err = 0; pl_apply(); return; }
if (g_plthr_on) return;
g_load_err = 0;
g_st.song_count = 0;
if (g_plthr_on || g_load_err != 0 || g_host_mock) return;
if (!g_pl_more) return;
if (g_st.song_count >= NCM_SONG_MAX) return;
/* 视口底接近列表底(最后一行即将可见即预取) */
int list_px = g_st.song_count * APP_ROW_H;
int max_scroll = list_px - r_list.h;
if (max_scroll < 0) max_scroll = 0;
if (meow_listview_scroll(g_list) < max_scroll - APP_ROW_H * 2) return;
g_ploffset = g_st.song_count;
g_plloading = 1;
g_plthr_on = 1;
if (pthread_create(&g_plthr, NULL, playlist_worker, NULL) != 0) {
g_plthr_on = 0; g_plloading = 0; g_load_err = NCM_ERR_IO;
}
pl_apply();
}
void playlist_refresh(void)
{
if (g_host_mock) { g_load_err = 0; g_pl_more = 0; pl_apply(1); return; }
if (g_plthr_on) return;
g_load_err = 0;
g_st.song_count = 0;
g_ploffset = 0;
g_pl_more = 0;
g_plloading = 1;
g_plthr_on = 1;
if (pthread_create(&g_plthr, NULL, playlist_worker, NULL) != 0) {
g_plthr_on = 0; g_plloading = 0; g_load_err = NCM_ERR_IO;
}
pl_apply(1);
}
void playlist_tick(uint64_t now)
@@ -227,8 +255,11 @@ void playlist_tick(uint64_t now)
g_plthr_on = 0;
g_plloading = 0;
if (g_plloaded_idx != g_st.active_playlist) { playlist_refresh(); return; }
if (g_load_err != 0) g_st.song_count = 0;
pl_apply();
if (g_load_err != 0) {
if (g_ploffset == 0) g_st.song_count = 0; /* 首屏失败 → 整页空态 */
else { ncm_snack("加载失败"); g_load_err = 0; } /* 追加失败 → 保留已载歌曲 */
}
pl_apply(g_ploffset == 0); /* 首屏回顶;触底追加保持滚动 */
}
void playlist_open(int idx)
@@ -294,8 +325,10 @@ void playlist_touch_move(int x, int y)
if (dy == 0) return;
int before = meow_listview_scroll(g_list);
meow_listview_scroll_by(g_list, -dy);
if (meow_listview_scroll(g_list) != before)
if (meow_listview_scroll(g_list) != before) {
meow_ui_invalidate(r_list.x, r_list.y, r_list.w, r_list.h);
pl_maybe_load_more();
}
}
void playlist_swipe(int dir, int dist)
@@ -305,8 +338,10 @@ void playlist_swipe(int dir, int dist)
int del = (dir == MEOW_SWIPE_UP) ? dist : -dist;
int before = meow_listview_scroll(g_list);
meow_listview_scroll_by(g_list, del);
if (meow_listview_scroll(g_list) != before)
if (meow_listview_scroll(g_list) != before) {
meow_ui_invalidate(r_list.x, r_list.y, r_list.w, r_list.h);
pl_maybe_load_more();
}
}
static void pl_page_create(meow_view *v, void *ctx)