Initial OpenAL code.

This commit is contained in:
Justin Marshall
2020-06-02 12:39:34 -07:00
parent a529937ee5
commit c09d3cf3cd
17 changed files with 2889 additions and 158 deletions
-130
View File
@@ -409,136 +409,6 @@ void Display_Briefing_Text_GlyphX()
DLLExportClass::On_Display_Briefing_Text();
}
void On_Sound_Effect(int sound_index, int variation, COORDINATE coord, int house)
{
// MBL 06.17.2019
int voc = sound_index;
if (voc == VOC_NONE)
{
return;
}
// MBL 06.17.2019 - Borrowed from RedAlert\AUDIO.CPP Sound_Effect()
//
#if 1
/*
** Fetch a pointer to the sound effect data. Modify the sound as appropriate and desired.
*/
char const * ext = ""; // ".AUD";
if (SoundEffectName[voc].Where == IN_VAR) {
/*
** If there is no forced house, then use the current player
** act like house.
*/
if (house == HOUSE_NONE) {
house = PlayerPtr->ActLike;
}
/*
** Change the extension based on the variation and house accent requested.
*/
if (((1 << house) & HOUSEF_ALLIES) != 0) {
/*
** For infantry, use a variation on the response. For vehicles, always
** use the vehicle response table.
*/
if (variation < 0) {
if (ABS(variation) % 2) {
ext = ".V00";
} else {
ext = ".V02";
}
} else {
if (variation % 2) {
ext = ".V01";
} else {
ext = ".V03";
}
}
} else {
if (variation < 0) {
if (ABS(variation) % 2) {
ext = ".R00";
} else {
ext = ".R02";
}
} else {
if (variation % 2) {
ext = ".R01";
} else {
ext = ".R03";
}
}
}
}
#endif
// END MBL
DLLExportClass::On_Sound_Effect(PlayerPtr, sound_index, ext, variation, coord);
#if 0
// MBL 02.26.2019
int voc = sound_index;
if (voc == VOC_NONE)
{
return;
}
// MBL 02.26.2019 - Borrowed from AUDIO.CPP Sound_Effect()
//
char const * ext = ""; // ".AUD";
#ifdef TIBERIAN_DAWN
if (Special.IsJuvenile && SoundEffectName[voc].Where == IN_JUV) {
ext = ".JUV";
} else {
#endif
if (SoundEffectName[voc].Where == IN_VAR) {
/*
** For infantry, use a variation on the response. For vehicles, always
** use the vehicle response table.
*/
if (variation < 0) {
if (ABS(variation) % 2) {
ext = ".V00";
} else {
ext = ".V02";
}
} else {
if (variation % 2) {
ext = ".V01";
} else {
ext = ".V03";
}
}
}
#ifdef TIBERIAN_DAWN
}
#endif
// END MBL
DLLExportClass::On_Sound_Effect(PlayerPtr, sound_index, ext, variation, coord);
#endif
}
// void On_Speech(int speech_index) // MBL 02.06.2020
void On_Speech(int speech_index, HouseClass *house)
{
// DLLExportClass::On_Speech(PlayerPtr, speech_index); // MBL 02.06.2020
if (house == NULL) {
DLLExportClass::On_Speech(PlayerPtr, speech_index);
}
else
{
DLLExportClass::On_Speech(house, speech_index);
}
}
void On_Message(const char* message, float timeout_seconds, int64 id)
{
DLLExportClass::On_Message(PlayerPtr, message, timeout_seconds, MESSAGE_TYPE_DIRECT, id);