mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 20:50:58 +00:00
* Fix a bug with sounds overlapping.
* Make sounds with identical names (as opposed to just identical sfx's) stack together. * Corrected a few names.
This commit is contained in:
parent
3e29ee3f01
commit
db282caefe
2 changed files with 25 additions and 4 deletions
|
@ -36,6 +36,7 @@ extern INT32 msg_id;
|
||||||
#include "d_main.h"
|
#include "d_main.h"
|
||||||
#include "r_sky.h" // skyflatnum
|
#include "r_sky.h" // skyflatnum
|
||||||
#include "p_local.h" // camera info
|
#include "p_local.h" // camera info
|
||||||
|
#include "fastcmp.h"
|
||||||
|
|
||||||
#ifdef HW3SOUND
|
#ifdef HW3SOUND
|
||||||
// 3D Sound Interface
|
// 3D Sound Interface
|
||||||
|
@ -592,17 +593,21 @@ dontplay:
|
||||||
// Handle closed caption input.
|
// Handle closed caption input.
|
||||||
if (cv_closedcaptioning.value && sfx->caption[0] != '/')
|
if (cv_closedcaptioning.value && sfx->caption[0] != '/')
|
||||||
{
|
{
|
||||||
UINT8 i, set = 7;
|
UINT8 i, set = 7, moveup = 255;
|
||||||
|
|
||||||
for (i = 0; i < set; i++)
|
for (i = 0; i < set; i++)
|
||||||
{
|
{
|
||||||
if ((sfx == closedcaptions[i].s)
|
boolean same = ((sfx == closedcaptions[i].s) || (closedcaptions[i].s && fastcmp(sfx->caption, closedcaptions[i].s->caption)));
|
||||||
|
if (same
|
||||||
|| !(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority))
|
|| !(closedcaptions[i].c || closedcaptions[i].s) || (sfx->priority >= closedcaptions[i].s->priority))
|
||||||
{
|
{
|
||||||
set = i;
|
set = i;
|
||||||
|
if (closedcaptions[i].s && !same && (sfx->priority >= closedcaptions[i].s->priority))
|
||||||
|
moveup = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sfx != closedcaptions[set].s)
|
if (sfx != closedcaptions[set].s)
|
||||||
{
|
{
|
||||||
for (i = 7; i > set; i--)
|
for (i = 7; i > set; i--)
|
||||||
|
@ -615,6 +620,22 @@ dontplay:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (moveup != 255)
|
||||||
|
{
|
||||||
|
for (i = moveup; i < 7; i++)
|
||||||
|
{
|
||||||
|
if (!(closedcaptions[i].c || closedcaptions[i].s))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (; i > set; i--)
|
||||||
|
{
|
||||||
|
closedcaptions[i].c = closedcaptions[i-1].c;
|
||||||
|
closedcaptions[i].s = closedcaptions[i-1].s;
|
||||||
|
closedcaptions[i].t = closedcaptions[i-1].t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
closedcaptions[set].c = &channels[cnum];
|
closedcaptions[set].c = &channels[cnum];
|
||||||
closedcaptions[set].s = sfx;
|
closedcaptions[set].s = sfx;
|
||||||
closedcaptions[set].t = TICRATE+2;
|
closedcaptions[set].t = TICRATE+2;
|
||||||
|
|
|
@ -377,10 +377,10 @@ sfxinfo_t S_sfx[NUMSFX] =
|
||||||
{"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wind"},
|
{"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wind"},
|
||||||
{"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling spike"},
|
{"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Falling spike"},
|
||||||
{"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"},
|
{"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bounce"},
|
||||||
{"s3k9a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
{"s3k9a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Click"},
|
||||||
{"s3k9b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"},
|
{"s3k9b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"},
|
||||||
{"s3k9c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Super Emerald"},
|
{"s3k9c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Got Super Emerald"},
|
||||||
{"s3k9d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Targetting"},
|
{"s3k9d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Targeting"},
|
||||||
{"s3k9e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"},
|
{"s3k9e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Metallic clink"},
|
||||||
{"s3k9f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"},
|
{"s3k9f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Super transformation"},
|
||||||
{"s3ka0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"},
|
{"s3ka0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"},
|
||||||
|
|
Loading…
Reference in a new issue