Debian Codegraph @

sndlib/ddsndgeometry.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Source: $
21 * $Revision: 5 $
22 * $Author: Samir $
23 * $Date: 8/13/99 2:00p $
24 *
25 * Hardware occlusion and reflection sound support.
26 *
27 * $Log: /DescentIII/Main/Lib/ddsndgeometry.h $
28 *
29 * 5 8/13/99 2:00p Samir
30 * more aureal and geometry fixes.
31 *
32 * 4 8/11/99 3:12p Samir
33 * fixes for aureal support.
34 *
35 * 3 4/06/99 8:30p Samir
36 * added reflection support.
37 *
38 * 2 3/29/99 10:52a Samir
39 * occlusion support almost complete.
40 *
41 */
42
43 #ifndef DDSNDGEOMETRY_H
44 #define DDSNDGEOMETRY_H
45
46 #include "vecmat.h"
47
48 // constants
49 typedef int tSoundMaterial; // value returned by geometry system.
50
51 // a list of predefined sound materials.
52 const int SNDGEO_MATERIAL_COUNT = 8;
53 const tSoundMaterial SNDGEO_MATERIAL_NONE = -1, SNDGEO_MATERIAL_ROCK = 0, SNDGEO_MATERIAL_WATER = 1,
54 SNDGEO_MATERIAL_METAL = 2;
55
56 //////////////////////////////////////////////////////////////////////////////
57
58 class llsSystem;
59
60 class llsGeometry {
61 public:
62 llsGeometry();
63
64 bool Init(llsSystem *snd_sys); // specify a sound library to associate geometry with
65 void Shutdown(); // closes low level geometry system.
66
67 void StartFrame();
68 void EndFrame();
69
70 // polygon lists
71 void IsGroupValid(int group); // is a group cached?, check before rendering it.
72 void StartPolygonGroup(int group); // marks beginning of a list of polygons to render, (-1 group for non cache)
73 void EndPolygonGroup(int group); // ends a list of polygons to render.
74 void RenderGroup(int group); // renders a group.
75
76 // clears out geometry info
77 void Clear();
78
79 // primitives, nv = number of verts, and verts is an array of pointers to vertices.
80 // you can pass a sound material value if you want special reflective properties on this polygon.
81 void AddPoly(int nv, vector **verts, unsigned tag, tSoundMaterial material = SNDGEO_MATERIAL_NONE);
82
83 private:
84 void AddQuad(unsigned tag, vector **verts); // 4 verts here.
85 void AddTriangle(unsigned tag, vector **verts); // 3 verts here.
86
87 private:
88 llsSystem *m_snd_system; // sound library attached.
89 int n_primatives_used; // number of primatives rendered this frame.
90 int n_reflections_used;
91 int n_materials_used;
92 char m_snd_mixer; // current sound mixer attached.
93 bool m_in_group; // a group of polys is being defined.
94 bool m_lib_init;
95
96 private:
97 void CreateMaterial(tSoundMaterial material, float transmit_gain, float transmit_highfreq, float reflect_gain,
98 float reflect_highfreq);
99 void DestroyMaterial(tSoundMaterial material);
100
101 private: // sound material list.
102 void *m_snd_materials[SNDGEO_MATERIAL_COUNT];
103 };
104
105 #endif