From 883f538709b6021dcd091b339095dd1e2f5120d5 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Wed, 8 Jan 2025 09:34:37 +0900 Subject: [PATCH] Fix SACT.QueryTextPos It should return screen coordinates, not sprite-local coordinates. --- modules/SACT/sprite.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/SACT/sprite.c b/modules/SACT/sprite.c index dbf1168..4e55ea5 100644 --- a/modules/SACT/sprite.c +++ b/modules/SACT/sprite.c @@ -586,10 +586,11 @@ int sp_query_size(int wNum, int *vw, int *vh) { // テキストスプライトの現在の文字表示位置の取得 int sp_query_textpos(int wNum, int *vx, int *vy) { if (wNum >= SPRITEMAX) goto errexit; - if (sact.sp[wNum]->type != SPRITE_MSG) goto errexit; - - *vx = sact.sp[wNum]->u.msg.dspcur.x; - *vy = sact.sp[wNum]->u.msg.dspcur.y; + sprite_t *sp = sact.sp[wNum]; + if (sp->type != SPRITE_MSG) goto errexit; + + *vx = sp->u.msg.dspcur.x + sp->loc.x; + *vy = sp->u.msg.dspcur.y + sp->loc.y; return OK; errexit: