From 7e584c5fd26e2bee7912d4eea6847e23b3a2e813 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Tue, 20 May 2025 13:36:29 +0900 Subject: [PATCH] Fix overlapping text issue in MangaGamer Sengoku Rance This fixes https://github.com/kichikuou/xsystem4-android/issues/12. This game uses DrawGraph.FillAMap() to erase text drawn on the sprite, but our SengokuRanceFont implementation draws text on sp->text.texture. For a detailed analysis of this issue and other possible solutions, see https://github.com/nunuhara/xsystem4/issues/237. --- src/hll/DrawGraph.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hll/DrawGraph.c b/src/hll/DrawGraph.c index 77e9947..6a3625e 100644 --- a/src/hll/DrawGraph.c +++ b/src/hll/DrawGraph.c @@ -18,6 +18,7 @@ #include "sact.h" #include "gfx/gfx.h" #include "gfx/font.h" +#include "xsystem4.h" #include "system4/string.h" // Get texture for source sprite @@ -165,6 +166,10 @@ static void DrawGraph_FillAlphaColor(int dst, int x, int y, int w, int h, int r, static void DrawGraph_FillAMap(int dst, int x, int y, int w, int h, int alpha) { gfx_fill_amap(DTEX(dst), x, y, w, h, alpha); + if (game_rance7_mg) { + // Short-term fix for https://github.com/nunuhara/xsystem4/issues/237 + sprite_text_clear(sact_get_sprite(dst)); + } } static void DrawGraph_FillAMapOverBorder(int dst, int x, int y, int w, int h, int alpha, int border)