Updated xactengine3_7-callbacks patchset

This commit is contained in:
Alistair Leslie-Hughes 2022-01-31 07:39:00 +11:00
parent c437a01e2f
commit ec936167b3
3 changed files with 84 additions and 57 deletions

View File

@ -4078,7 +4078,7 @@ if test "$enable_xactengine3_7_callbacks" -eq 1; then
patch_apply xactengine3_7-callbacks/0001-Add-support-for-private-contexts.patch
patch_apply xactengine3_7-callbacks/0002-xactengine3_7-notifications.patch
patch_apply xactengine3_7-callbacks/0003-Send-NOTIFY_CUESTOP-when-Stop-is-called.patch
patch_apply xactengine3_7-callbacks/0004-xactengine3_7-Fix-for-older-compilers.patch
patch_apply xactengine3_7-callbacks/0004-xactengine3_7-Don-t-use-switch-with-constant-integer.patch
fi
if test "$enable_autoconf" -eq 1; then

View File

@ -0,0 +1,83 @@
From cb0480cc441f4f2c599f506fbac5d27552f55cdd Mon Sep 17 00:00:00 2001
From: "Olivier F. R. Dierick" <o.dierick@piezo-forte.be>
Date: Sat, 29 Jan 2022 22:46:07 +0100
Subject: xactengine3_7: Don't use switch with constant integers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52478
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index 62084f9234f..83b7b760118 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -857,40 +857,43 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
note.type = notification->type;
note.pvContext = engine->contexts[notification->type - 1];
- switch (notification->type)
+ if (notification->type == XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED)
{
- case XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED:
- note.soundBank.pSoundBank = FACTSoundBank_GetPrivateContext(notification->wave.pSoundBank);
- break;
+ note.soundBank.pSoundBank = FACTSoundBank_GetPrivateContext(notification->wave.pSoundBank);
+ }
+ else if (notification->type == XACTNOTIFICATIONTYPE_WAVESTOP
#if XACT3_VER >= 0x0205
- case XACTNOTIFICATIONTYPE_WAVEDESTROYED:
- case XACTNOTIFICATIONTYPE_WAVELOOPED:
- case XACTNOTIFICATIONTYPE_WAVEPLAY:
- case XACTNOTIFICATIONTYPE_WAVEPREPARED:
+ || notification->type == XACTNOTIFICATIONTYPE_WAVEDESTROYED
+ || notification->type == XACTNOTIFICATIONTYPE_WAVELOOPED
+ || notification->type == XACTNOTIFICATIONTYPE_WAVEPLAY
+ || notification->type == XACTNOTIFICATIONTYPE_WAVEPREPARED)
+#else
+ )
#endif
- case XACTNOTIFICATIONTYPE_WAVESTOP:
- note.wave.cueIndex = notification->wave.cueIndex;
- note.wave.pCue = FACTCue_GetPrivateContext(notification->wave.pCue);
- note.wave.pSoundBank = FACTSoundBank_GetPrivateContext(notification->wave.pSoundBank);
+ {
+ note.wave.cueIndex = notification->wave.cueIndex;
+ note.wave.pCue = FACTCue_GetPrivateContext(notification->wave.pCue);
+ note.wave.pSoundBank = FACTSoundBank_GetPrivateContext(notification->wave.pSoundBank);
#if XACT3_VER >= 0x0205
- note.wave.pWave = FACTWave_GetPrivateContext(notification->wave.pWave);
+ note.wave.pWave = FACTWave_GetPrivateContext(notification->wave.pWave);
#endif
- note.wave.pWaveBank = FACTWaveBank_GetPrivateContext(notification->wave.pWaveBank);
- break;
-
- case XACTNOTIFICATIONTYPE_CUEPLAY:
- case XACTNOTIFICATIONTYPE_CUEPREPARED:
- case XACTNOTIFICATIONTYPE_CUESTOP:
+ note.wave.pWaveBank = FACTWaveBank_GetPrivateContext(notification->wave.pWaveBank);
+ }
+ else if (notification->type == XACTNOTIFICATIONTYPE_CUEPLAY ||
+ notification->type == XACTNOTIFICATIONTYPE_CUEPREPARED ||
+ notification->type == XACTNOTIFICATIONTYPE_CUESTOP ||
+ notification->type == XACTNOTIFICATIONTYPE_CUEDESTROYED)
+ {
+ if (notification->type != XACTNOTIFICATIONTYPE_CUEDESTROYED)
note.cue.pCue = FACTCue_GetPrivateContext(notification->cue.pCue);
- /* Fall through */
- case XACTNOTIFICATIONTYPE_CUEDESTROYED:
- note.cue.cueIndex = notification->cue.cueIndex;
- note.cue.pSoundBank = FACTSoundBank_GetPrivateContext(notification->cue.pSoundBank);
- break;
- default:
- FIXME("Unsupported callback type %d\n", notification->type);
- return;
- }
+ note.cue.cueIndex = notification->cue.cueIndex;
+ note.cue.pSoundBank = FACTSoundBank_GetPrivateContext(notification->cue.pSoundBank);
+ }
+ else
+ {
+ FIXME("Unsupported callback type %d\n", notification->type);
+ return;
+ }
engine->notification_callback(&note);
}

View File

@ -1,56 +0,0 @@
From 99b908c02eccbaa226e0180d430efb6be1df5475 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Sun, 30 Jan 2022 10:52:20 +1100
Subject: [PATCH] xactengine3_7: Fix for older compilers
---
dlls/xactengine3_7/xact_dll.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index 62084f9234f..a0a7d9d6d32 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -859,16 +859,16 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
switch (notification->type)
{
- case XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED:
+ case (int)XACTNOTIFICATIONTYPE_SOUNDBANKDESTROYED:
note.soundBank.pSoundBank = FACTSoundBank_GetPrivateContext(notification->wave.pSoundBank);
break;
#if XACT3_VER >= 0x0205
- case XACTNOTIFICATIONTYPE_WAVEDESTROYED:
- case XACTNOTIFICATIONTYPE_WAVELOOPED:
- case XACTNOTIFICATIONTYPE_WAVEPLAY:
- case XACTNOTIFICATIONTYPE_WAVEPREPARED:
+ case (int)XACTNOTIFICATIONTYPE_WAVEDESTROYED:
+ case (int)XACTNOTIFICATIONTYPE_WAVELOOPED:
+ case (int)XACTNOTIFICATIONTYPE_WAVEPLAY:
+ case (int)XACTNOTIFICATIONTYPE_WAVEPREPARED:
#endif
- case XACTNOTIFICATIONTYPE_WAVESTOP:
+ case (int)XACTNOTIFICATIONTYPE_WAVESTOP:
note.wave.cueIndex = notification->wave.cueIndex;
note.wave.pCue = FACTCue_GetPrivateContext(notification->wave.pCue);
note.wave.pSoundBank = FACTSoundBank_GetPrivateContext(notification->wave.pSoundBank);
@@ -878,12 +878,12 @@ static void FACTCALL fact_notification_cb(const FACTNotification *notification)
note.wave.pWaveBank = FACTWaveBank_GetPrivateContext(notification->wave.pWaveBank);
break;
- case XACTNOTIFICATIONTYPE_CUEPLAY:
- case XACTNOTIFICATIONTYPE_CUEPREPARED:
- case XACTNOTIFICATIONTYPE_CUESTOP:
+ case (int)XACTNOTIFICATIONTYPE_CUEPLAY:
+ case (int)XACTNOTIFICATIONTYPE_CUEPREPARED:
+ case (int)XACTNOTIFICATIONTYPE_CUESTOP:
note.cue.pCue = FACTCue_GetPrivateContext(notification->cue.pCue);
/* Fall through */
- case XACTNOTIFICATIONTYPE_CUEDESTROYED:
+ case (int)XACTNOTIFICATIONTYPE_CUEDESTROYED:
note.cue.cueIndex = notification->cue.cueIndex;
note.cue.pSoundBank = FACTSoundBank_GetPrivateContext(notification->cue.pSoundBank);
break;
--
2.34.1