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.
This commit is contained in:
kichikuou
2025-05-24 09:10:25 +09:00
parent b0c7aad6c3
commit 7e584c5fd2
+5
View File
@@ -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)