FS2_Open
Open source remastering of the Freespace 2 engine
objectsnd.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __OBJECTSND_H__
13 #define __OBJECTSND_H__
14 
15 #define OS_USED (1<<0)
16 #define OS_DS3D (1<<1)
17 #define OS_MAIN (1<<2) // "main" sound. attentuation does not apply until outside the radius of the object
18 #define OS_TURRET_BASE_ROTATION (1<<3)
19 #define OS_TURRET_GUN_ROTATION (1<<4)
20 #define OS_SUBSYS_ALIVE (1<<5)
21 #define OS_SUBSYS_DEAD (1<<6)
22 #define OS_SUBSYS_DAMAGED (1<<7)
23 #define OS_SUBSYS_ROTATION (1<<8)
24 
25 struct vec3d;
26 class ship_subsys;
27 
28 extern int Obj_snd_enabled;
29 
30 void obj_snd_level_init();
31 void obj_snd_level_close();
32 void obj_snd_do_frame();
33 
34 // pos is the position of the sound source in the object's frame of reference.
35 // so, if the objp->pos was at the origin, the pos passed here would be the exact
36 // model coords of the location of the engine
37 // by passing vmd_zero_vector here, you get a sound centered directly on the object
38 // NOTE : if main is true, the attentuation factors don't apply if you're within the radius of the object
39 int obj_snd_assign(int objnum, int sndnum, vec3d *pos, int main, int flags=0, ship_subsys *associated_sub=NULL);
40 
41 //Delete specific persistent sound on object
42 void obj_snd_delete(int objnum, int index);
43 
44 // if sndnum is not -1, deletes all instances of the given sound within the object
45 void obj_snd_delete_type(int objnum, int sndnum = -1, ship_subsys *ss = NULL);
46 
47 void obj_snd_delete_all();
48 void obj_snd_stop_all();
49 int obj_snd_is_playing(int objnum, int index);
50 int obj_snd_return_instance(int objnum, int index);
51 int obj_snd_update_offset(int objnum, int index, vec3d *new_offset);
52 
53 #endif
void obj_snd_level_init()
Definition: objectsnd.cpp:191
GLuint index
Definition: Glext.h:5608
Definition: pstypes.h:88
int obj_snd_is_playing(int objnum, int index)
Definition: objectsnd.cpp:878
void obj_snd_delete_type(int objnum, int sndnum=-1, ship_subsys *ss=NULL)
Definition: objectsnd.cpp:812
int obj_snd_assign(int objnum, int sndnum, vec3d *pos, int main, int flags=0, ship_subsys *associated_sub=NULL)
Definition: objectsnd.cpp:705
void obj_snd_level_close()
Definition: objectsnd.cpp:864
void obj_snd_stop_all()
Definition: objectsnd.cpp:299
GLbitfield flags
Definition: Glext.h:6722
int main(int argc, char *argv[])
int Obj_snd_enabled
Definition: objectsnd.cpp:66
void obj_snd_delete(int objnum, int index)
Definition: objectsnd.cpp:780
void obj_snd_do_frame()
Definition: objectsnd.cpp:457
void obj_snd_delete_all()
Definition: objectsnd.cpp:849
hull_check pos
Definition: lua.cpp:5050
int obj_snd_update_offset(int objnum, int index, vec3d *new_offset)
Definition: objectsnd.cpp:910
int obj_snd_return_instance(int objnum, int index)
Definition: objectsnd.cpp:891