SACT: Honor message skip state

The following SACT functions now return immediately while message
skipping is active:

- DrawEffect
- DrawEffectAlphaMap
- MessageOutput
- MessageOutputEx
- QuakeSprite
- TimerWait
- Wait
- SoundWaitKey
- WaitKeyMessage
This commit is contained in:
kichikuou
2026-09-11 11:27:44 +09:00
parent a2618319d9
commit cc96c85381
4 changed files with 34 additions and 22 deletions
+15 -8
View File
@@ -287,8 +287,11 @@ static void DrawEffect() {
if (sact.version >= 110) {
wEffectkey = getCaliValue();
}
sp_eupdate(wType, wEffectTime, wEffectkey);
if (sact.waitskiplv > 1 || msgskip_isSkipping())
sp_update_all(true);
else
sp_eupdate(wType, wEffectTime, wEffectkey);
TRACE("SACT.DrawEffect %d,%d,%d:", wType, wEffectTime, wEffectkey);
}
@@ -305,7 +308,10 @@ static void DrawEffectAlphaMap() {
int wEffectTime = getCaliValue();
int wEffectKey = getCaliValue();
sp_eupdate_amap(nIndexAlphaMap, wEffectTime, wEffectKey);
if (sact.waitskiplv > 1 || msgskip_isSkipping())
sp_update_all(true);
else
sp_eupdate_amap(nIndexAlphaMap, wEffectTime, wEffectKey);
TRACE("SACT.DrawEffectAlphaMap %d,%d,%d:", nIndexAlphaMap, wEffectTime, wEffectKey);
}
@@ -623,9 +629,10 @@ static void QuakeSprite() {
if (sact.version >= 110) {
nfKeyEnable = getCaliValue();
}
sp_quake_sprite(wType, wAmplitudeX, wAmplitudeY, wCount, nfKeyEnable);
if (!msgskip_isSkipping())
sp_quake_sprite(wType, wAmplitudeX, wAmplitudeY, wCount, nfKeyEnable);
TRACE("SACT.QuakeSprite %d,%d,%d,%d:", wType, wAmplitudeX, wAmplitudeY, wCount);
}
@@ -1616,7 +1623,7 @@ static void TimerWait() {
int msec = (wCount - stimer_get(wTimerID)) * 10;
if (msec > 0)
sys_keywait(msec, KEYWAIT_CTRL_CANCELABLE);
sys_keywait(msec, KEYWAIT_CTRL_CANCELABLE | KEYWAIT_SKIPPABLE);
TRACE("SACT.TimerWait %d,%d:", wTimerID, wCount);
}
@@ -1629,7 +1636,7 @@ static void TimerWait() {
static void Wait() {
int wCount = getCaliValue();
sys_keywait(wCount * 10, KEYWAIT_CTRL_CANCELABLE);
sys_keywait(wCount * 10, KEYWAIT_CTRL_CANCELABLE | KEYWAIT_SKIPPABLE);
TRACE("SACT.Wait %d:", wCount);
}
+2 -1
View File
@@ -30,6 +30,7 @@
#include "system.h"
#include "nact.h"
#include "input.h"
#include "msgskip.h"
#include "sactsound.h"
#include "music.h"
#include "sact.h"
@@ -120,7 +121,7 @@ void ssnd_waitkey(int no, vmvar_t *res) {
return;
}
if (sact.waitskiplv > 1) {
if (sact.waitskiplv > 1 || msgskip_isSkipping()) {
*res = SYS35KEY_RET;
return;
}
-5
View File
@@ -39,11 +39,6 @@
@param cancel: キー抜け(0:なし, 1:あり)
*/
void sp_eupdate(int type, int time, int cancel) {
if (sact.waitskiplv > 1) {
sp_update_all(true);
return;
}
sp_update_all(false);
enum effect_type effect = from_sact_effect(type);
+17 -8
View File
@@ -30,9 +30,11 @@
#include "portab.h"
#include "system.h"
#include "ags.h"
#include "gfx.h"
#include "nact.h"
#include "variable.h"
#include "input.h"
#include "msgskip.h"
#include "sact.h"
#include "sprite.h"
#include "drawtext.h"
@@ -240,7 +242,8 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
char *msg;
sprite_t *sp;
int len = 0; // 処理した文字数?
bool needupdate = false;
bool has_batched_output = false;
bool flush_batched_output = wSpeed > 0;
SDL_Rect uparea = {0,0,0,0};
// wRSize == 0 -> ルビ無し(SACT.MessageOutputからの呼出)
@@ -250,7 +253,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
if (!is_messagesprite(wNum)) return;
// MessageSkip中は文字送り速度を最大に
if (sact.waitskiplv > 1) wSpeed = 0;
if (sact.waitskiplv > 1 || msgskip_isSkipping()) wSpeed = 0;
// shortcut
sp = sact.sp[wNum];
@@ -302,7 +305,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
mbuf,
wColorR, wColorG, wColorB);
needupdate = true;
has_batched_output = true;
append_to_log(mbuf);
@@ -313,7 +316,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
cw,
wSize + wRSize + wRLineSpace);
sp_update_clipped();
needupdate = false;
has_batched_output = false;
// keywait
delta = sys_get_ticks() - wcnt;
@@ -333,11 +336,17 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
// バッファリング中の文字のクリア
sact.msgbuf[0] = '\0';
// Waitなしの出力は最後にupdate
if (needupdate) {
// Register the update area after rendering without waits.
if (has_batched_output) {
uparea.w = sp->width;
uparea.h = min(sp->height, uparea.y - sp->u.msg.dspcur.y + wLineSpace + wLineSpace + wRSize);
uparea.h = min(sp->height - uparea.y,
sp->u.msg.dspcur.y - uparea.y + wSize + wRSize + wRLineSpace);
sp_updateme_part(sp, uparea.x, uparea.y, uparea.w, uparea.h);
// Present now if waiting was skipped.
if (flush_batched_output) {
sp_update_clipped();
gfx_updateScreen();
}
}
// ????
@@ -408,7 +417,7 @@ int smsg_keywait(int wNum1, int wNum2, int msglen) {
struct markinfo minfo[6];
int i = 0, j, maxstep;
if (sact.waitskiplv > 0) {
if (sact.waitskiplv > 0 || msgskip_isSkipping()) {
sys_getInputInfo();
return 0;
}