int32 left, right, li, ri, i;
/* silly warning about uninitialized s */
mix_t s = 0;
-
+#ifdef ENABLE_PAN_DELAY
+ Voice *vp = &voice[v];
+ int32 pan_delay_wpt = vp->pan_delay_wpt, *pan_delay_buf = vp->pan_delay_buf;
+#endif
+
left = voice[v].left_mix;
li = -(left / c);
if (! li)
#endif
if (! (play_mode->encoding & PE_MONO)) {
if (voice[v].panned == PANNED_MYSTERY) {
+#ifdef ENABLE_PAN_DELAY
+ right = voice[v].right_mix;
+ ri = -(right / c);
+ if(vp->pan_delay_rpt == 0) {
+ for (i = 0; i < c; i++) {
+ left += li;
+ if (left < 0)
+ left = 0;
+ right += ri;
+ if (right < 0)
+ right = 0;
+ s = *sp++;
+ MIXATION(left);
+ MIXATION(right);
+ }
+ } else if(vp->panning < 64) {
+ for (i = 0; i < c; i++) {
+ left += li;
+ if (left < 0)
+ left = 0;
+ right += ri;
+ if (right < 0)
+ right = 0;
+ s = *sp++;
+ MIXATION(left);
+ DELAYED_MIXATION(right);
+ }
+ } else {
+ for (i = 0; i < c; i++) {
+ left += li;
+ if (left < 0)
+ left = 0;
+ right += ri;
+ if (right < 0)
+ right = 0;
+ s = *sp++;
+ DELAYED_MIXATION(left);
+ MIXATION(right);
+ }
+ }
+ vp->pan_delay_wpt = pan_delay_wpt;
+#else
right = voice[v].right_mix;
ri = -(right / c);
for (i = 0; i < c; i++) {
MIXATION(left);
MIXATION(right);
}
+#endif /* ENABLE_PAN_DELAY */
} else if (voice[v].panned == PANNED_CENTER)
for (i = 0; i < c; i++) {
left += li;
}
voice[i].delay += pan_delay_diff * play_mode->rate / 1000;
}
- memset(voice[i].pan_delay_buf, 0, sizeof(voice[i].pan_delay_buf));
+ memset(voice[i].pan_delay_buf, 0, sizeof(int32) * PAN_DELAY_BUF_MAX);
if(voice[i].pan_delay_rpt < 2) {voice[i].pan_delay_rpt = 0;}
voice[i].pan_delay_wpt = 0;
#endif /* ENABLE_PAN_DELAY */