Skip to content
Snippets Groups Projects
Commit fcc6e569 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Since xp_play_sample() no longer takes a const buffer, we need to

cast all the const buffers before passing them in and rely on
runtime crashes to find bugs rather than compile-time errors.

Thanks Microsoft. :D
parent 862f4a2c
No related branches found
No related tags found
No related merge requests found
Pipeline #5747 passed
......@@ -2030,141 +2030,141 @@ incomingSoundVoc(unsigned char *codeStr)
codeStr++;
switch (*codeStr) {
case '1':
xp_play_sample(ooii_snd_welcome, sizeof(ooii_snd_welcome), true);
xp_play_sample((void*)ooii_snd_welcome, sizeof(ooii_snd_welcome), true);
break;
case '3':
xp_play_sample(ooii_snd_countdn, sizeof(ooii_snd_countdn), false);
xp_play_sample((void*)ooii_snd_countdn, sizeof(ooii_snd_countdn), false);
/* Fallthrough */
case '2':
xp_play_sample(ooii_snd_explode, sizeof(ooii_snd_explode), true);
xp_play_sample((void*)ooii_snd_explode, sizeof(ooii_snd_explode), true);
break;
case '4':
xp_play_sample(ooii_snd_clone, sizeof(ooii_snd_clone), true);
xp_play_sample((void*)ooii_snd_clone, sizeof(ooii_snd_clone), true);
break;
case '5':
if (xp_random(2))
xp_play_sample(ooii_snd_danger1, sizeof(ooii_snd_danger1), true);
xp_play_sample((void*)ooii_snd_danger1, sizeof(ooii_snd_danger1), true);
else
xp_play_sample(ooii_snd_danger2, sizeof(ooii_snd_danger2), true);
xp_play_sample((void*)ooii_snd_danger2, sizeof(ooii_snd_danger2), true);
break;
case '6':
xp_play_sample(ooii_snd_steam, sizeof(ooii_snd_steam), true);
xp_play_sample((void*)ooii_snd_steam, sizeof(ooii_snd_steam), true);
break;
case '7':
xp_play_sample(ooii_snd_scream1, sizeof(ooii_snd_scream1), true);
xp_play_sample((void*)ooii_snd_scream1, sizeof(ooii_snd_scream1), true);
break;
case '8':
xp_play_sample(ooii_snd_watch, sizeof(ooii_snd_watch), true);
xp_play_sample((void*)ooii_snd_watch, sizeof(ooii_snd_watch), true);
break;
case '9':
xp_play_sample(ooii_snd_levelup, sizeof(ooii_snd_levelup), true);
xp_play_sample((void*)ooii_snd_levelup, sizeof(ooii_snd_levelup), true);
break;
case 'A':
xp_play_sample(ooii_snd_inflame, sizeof(ooii_snd_inflame), true);
xp_play_sample((void*)ooii_snd_inflame, sizeof(ooii_snd_inflame), true);
break;
case 'B':
switch (xp_random(3)) {
case 0:
xp_play_sample(ooii_snd_hit1, sizeof(ooii_snd_hit1), true);
xp_play_sample((void*)ooii_snd_hit1, sizeof(ooii_snd_hit1), true);
break;
case 1:
xp_play_sample(ooii_snd_hit2, sizeof(ooii_snd_hit2), true);
xp_play_sample((void*)ooii_snd_hit2, sizeof(ooii_snd_hit2), true);
break;
case 2:
xp_play_sample(ooii_snd_hit3, sizeof(ooii_snd_hit3), true);
xp_play_sample((void*)ooii_snd_hit3, sizeof(ooii_snd_hit3), true);
break;
}
break;
case 'C':
xp_play_sample(ooii_snd_timeisup, sizeof(ooii_snd_timeisup), true);
xp_play_sample((void*)ooii_snd_timeisup, sizeof(ooii_snd_timeisup), true);
break;
case 'D':
xp_play_sample(ooii_snd_healing, sizeof(ooii_snd_healing), true);
xp_play_sample((void*)ooii_snd_healing, sizeof(ooii_snd_healing), true);
break;
case 'E':
xp_play_sample(ooii_snd_lrange2, sizeof(ooii_snd_lrange2), true);
xp_play_sample((void*)ooii_snd_lrange2, sizeof(ooii_snd_lrange2), true);
break;
case 'F':
xp_play_sample(ooii_snd_cackle, sizeof(ooii_snd_cackle), true);
xp_play_sample((void*)ooii_snd_cackle, sizeof(ooii_snd_cackle), true);
break;
case 'G':
xp_play_sample(ooii_snd_teleport, sizeof(ooii_snd_teleport), true);
xp_play_sample((void*)ooii_snd_teleport, sizeof(ooii_snd_teleport), true);
break;
case 'H':
xp_play_sample(ooii_snd_genetics, sizeof(ooii_snd_genetics), true);
xp_play_sample((void*)ooii_snd_genetics, sizeof(ooii_snd_genetics), true);
break;
case 'I':
xp_play_sample(ooii_snd_remote, sizeof(ooii_snd_remote), true);
xp_play_sample((void*)ooii_snd_remote, sizeof(ooii_snd_remote), true);
break;
case 'J':
xp_play_sample(ooii_snd_afbdoor, sizeof(ooii_snd_afbdoor), true);
xp_play_sample((void*)ooii_snd_afbdoor, sizeof(ooii_snd_afbdoor), true);
break;
case 'K':
xp_play_sample(ooii_snd_alarm, sizeof(ooii_snd_alarm), true);
xp_play_sample((void*)ooii_snd_alarm, sizeof(ooii_snd_alarm), true);
break;
case 'L':
xp_play_sample(ooii_snd_reverse, sizeof(ooii_snd_reverse), true);
xp_play_sample((void*)ooii_snd_reverse, sizeof(ooii_snd_reverse), true);
break;
case 'M':
xp_play_sample(ooii_snd_aerial, sizeof(ooii_snd_aerial), true);
xp_play_sample((void*)ooii_snd_aerial, sizeof(ooii_snd_aerial), true);
break;
case 'N':
xp_play_sample(ooii_snd_phaser, sizeof(ooii_snd_phaser), true);
xp_play_sample((void*)ooii_snd_phaser, sizeof(ooii_snd_phaser), true);
break;
case 'O':
switch (xp_random(3)) {
case 0:
xp_play_sample(ooii_snd_miss1, sizeof(ooii_snd_miss1), true);
xp_play_sample((void*)ooii_snd_miss1, sizeof(ooii_snd_miss1), true);
break;
case 1:
xp_play_sample(ooii_snd_miss2, sizeof(ooii_snd_miss2), true);
xp_play_sample((void*)ooii_snd_miss2, sizeof(ooii_snd_miss2), true);
break;
case 2:
xp_play_sample(ooii_snd_miss3, sizeof(ooii_snd_miss3), true);
xp_play_sample((void*)ooii_snd_miss3, sizeof(ooii_snd_miss3), true);
break;
}
break;
case 'P':
if (xp_random(2))
xp_play_sample(ooii_snd_music1, sizeof(ooii_snd_music1), true);
xp_play_sample((void*)ooii_snd_music1, sizeof(ooii_snd_music1), true);
else
xp_play_sample(ooii_snd_music2, sizeof(ooii_snd_music2), true);
xp_play_sample((void*)ooii_snd_music2, sizeof(ooii_snd_music2), true);
break;
case 'Q':
xp_play_sample(ooii_snd_device, sizeof(ooii_snd_device), true);
xp_play_sample((void*)ooii_snd_device, sizeof(ooii_snd_device), true);
break;
case 'R':
xp_play_sample(ooii_snd_death, sizeof(ooii_snd_death), true);
xp_play_sample((void*)ooii_snd_death, sizeof(ooii_snd_death), true);
break;
case 'S':
xp_play_sample(ooii_snd_good, sizeof(ooii_snd_good), true);
xp_play_sample((void*)ooii_snd_good, sizeof(ooii_snd_good), true);
break;
case 'T':
xp_play_sample(ooii_snd_yahoo, sizeof(ooii_snd_yahoo), true);
xp_play_sample((void*)ooii_snd_yahoo, sizeof(ooii_snd_yahoo), true);
break;
case 'U':
xp_play_sample(ooii_snd_scream2, sizeof(ooii_snd_scream2), true);
xp_play_sample((void*)ooii_snd_scream2, sizeof(ooii_snd_scream2), true);
break;
case 'V':
xp_play_sample(ooii_snd_wap, sizeof(ooii_snd_wap), true);
xp_play_sample((void*)ooii_snd_wap, sizeof(ooii_snd_wap), true);
break;
case 'W':
xp_play_sample(ooii_snd_zip, sizeof(ooii_snd_zip), true);
xp_play_sample((void*)ooii_snd_zip, sizeof(ooii_snd_zip), true);
break;
case 'X':
xp_play_sample(ooii_snd_lrange3, sizeof(ooii_snd_lrange3), true);
xp_play_sample((void*)ooii_snd_lrange3, sizeof(ooii_snd_lrange3), true);
break;
case 'Y':
xp_play_sample(ooii_snd_snip, sizeof(ooii_snd_snip), true);
xp_play_sample((void*)ooii_snd_snip, sizeof(ooii_snd_snip), true);
break;
case 'Z':
xp_play_sample(ooii_snd_pow, sizeof(ooii_snd_pow), true);
xp_play_sample((void*)ooii_snd_pow, sizeof(ooii_snd_pow), true);
break;
default:
/*
* LRANGE1 is unused
* xp_play_sample(ooii_snd_lrange1, sizeof(ooii_snd_lrange1), true);
* xp_play_sample((void*)ooii_snd_lrange1, sizeof(ooii_snd_lrange1), true);
*/
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment