2024-04-20 15:57:49 +00:00
|
|
|
/*
|
|
|
|
* Descent 3
|
|
|
|
* Copyright (C) 2024 Parallax Software
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2024-05-06 15:12:44 +00:00
|
|
|
--- HISTORICAL COMMENTS FOLLOW ---
|
|
|
|
|
2024-04-16 03:43:29 +00:00
|
|
|
* $Source: $
|
|
|
|
* $Revision: 3 $
|
|
|
|
* $Author: Samir $
|
|
|
|
* $Date: 8/11/99 3:12p $
|
|
|
|
*
|
|
|
|
* Sound renderer system
|
|
|
|
*
|
|
|
|
* $Log: /DescentIII/Main/sndlib/sndrender.h $
|
2024-04-16 18:56:40 +00:00
|
|
|
*
|
2024-04-16 03:43:29 +00:00
|
|
|
* 3 8/11/99 3:12p Samir
|
|
|
|
* fixes for aureal support.
|
2024-04-16 18:56:40 +00:00
|
|
|
*
|
2024-04-16 03:43:29 +00:00
|
|
|
* 2 4/01/99 4:28p Samir
|
|
|
|
* hardware geometry integration if it's available.
|
2024-04-16 18:56:40 +00:00
|
|
|
*
|
2024-04-16 03:43:29 +00:00
|
|
|
* 1 3/28/99 3:25p Samir
|
2024-04-16 18:56:40 +00:00
|
|
|
*
|
2024-04-16 03:43:29 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SNDRENDER_H
|
|
|
|
#define SNDRENDER_H
|
|
|
|
|
2024-04-16 18:56:40 +00:00
|
|
|
#define SOUND_RENDER_RADIUS 120.0f
|
|
|
|
#define SOUND_RENDER_ROOM_LIMIT 16
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
// resets sound geometry system (called beginning of each level)
|
|
|
|
void SoundRenderReset();
|
|
|
|
|
|
|
|
// if this fails, renderer won't work, do emulation.
|
|
|
|
bool sound_render_start_frame();
|
|
|
|
|
|
|
|
// ends sound rendering
|
|
|
|
void sound_render_end_frame();
|
|
|
|
|
|
|
|
// render all rooms within a certain radius from player
|
|
|
|
// the radius is actually scaled according to orientation. radius is maximum radius, really, which is forward
|
|
|
|
// minimum radius will be rear view.
|
|
|
|
// returns list of rooms rendered (-1 = end of list!)
|
2024-05-24 03:27:12 +00:00
|
|
|
int16_t *sound_render_audible_rooms(pos_state *listener_pos, float max_radius = SOUND_RENDER_RADIUS);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
// render one room's geometry
|
|
|
|
void sound_render_room_geometry(int roomnum, int slot);
|
|
|
|
|
|
|
|
// check if a room exists in room list.
|
2024-05-24 03:27:12 +00:00
|
|
|
inline bool sound_render_room_in_list(int16_t room, int16_t *list) {
|
2024-05-24 03:05:05 +00:00
|
|
|
int8_t idx = 0;
|
2024-04-16 18:56:40 +00:00
|
|
|
while (list[idx] != -1) {
|
|
|
|
if (room == list[idx]) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
idx++;
|
|
|
|
}
|
|
|
|
return false;
|
2024-04-16 03:43:29 +00:00
|
|
|
}
|
|
|
|
|
2024-04-26 22:22:03 +00:00
|
|
|
#endif
|