fix text rendering with msaa off in some situations [build]

This commit is contained in:
Isaac0-dev 2025-03-28 09:54:50 +10:00
parent d81512680b
commit 71f8ba51af
2 changed files with 3 additions and 4 deletions

View file

@ -131,12 +131,11 @@ void djui_gfx_render_texture_tile(const u8* texture, u32 w, u32 h, u32 bitSize,
}
f32 aspect = tileH ? ((f32)tileW / (f32)tileH) : 1;
bool msaa = configWindow.msaa > 0;
// I don't know why adding 1 to all of the UVs seems to fix rendering, but it does...
// this should be tested carefully. it definitely fixes some stuff, but what does it break?
f32 offsetX = (font && msaa ? -1024.0f / (f32)w : 0) + 1;
f32 offsetY = (font && msaa ? -1024.0f / (f32)h : 0) + 1;
f32 offsetX = (font ? -1024.0f / (f32)w : 0) + 1;
f32 offsetY = (font ? -1024.0f / (f32)h : 0) + 1;
vtx[0] = (Vtx) {{{ 0, -1, 0 }, 0, { ( tileX * 2048.0f) / (f32)w + offsetX, ((tileY + tileH) * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
vtx[2] = (Vtx) {{{ 1 * aspect, 0, 0 }, 0, { ((tileX + tileW) * 2048.0f) / (f32)w + offsetX, ( tileY * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};
vtx[1] = (Vtx) {{{ 1 * aspect, -1, 0 }, 0, { ((tileX + tileW) * 2048.0f) / (f32)w + offsetX, ((tileY + tileH) * 2048.0f) / (f32)h + offsetY }, { 0xff, 0xff, 0xff, 0xff }}};

View file

@ -171,7 +171,7 @@ u16 gfx_get_vtx_count(Gfx* cmd) {
if (op != G_VTX) { return 0; }
if (cmd->words.w1 == 0) { return 0; }
return C0(12, 8);
return C0(cmd, 12, 8);
}
void gfx_set_combine_lerp(Gfx* gfx, u32 a0, u32 b0, u32 c0, u32 d0, u32 Aa0, u32 Ab0, u32 Ac0, u32 Ad0, u32 a1, u32 b1, u32 c1, u32 d1, u32 Aa1, u32 Ab1, u32 Ac1, u32 Ad1) {