Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89555fa0aa | |||
| c98887fa68 | |||
| 72413dc0a9 | |||
| 4e4ba29666 | |||
| 14d133bd31 | |||
| 62b17e3dbf | |||
| 086bdbce70 | |||
| bbec676683 | |||
| edc25e59f0 | |||
| 4e429bc48c | |||
| 2cf54819ae | |||
| af22c84066 | |||
| 56549cdf0a | |||
| 683b4cc3cf | |||
| e8e74eb506 | |||
| 08d653b0b0 | |||
| 03e2078cfb | |||
| 1b0d87e862 | |||
| 346ee13dd5 | |||
| 4f341250d7 | |||
| f6b6f05c37 | |||
| a010a8be77 | |||
| 5b6556e9fb | |||
| 2797a0f6c3 | |||
| 3f4ede4b7d | |||
| 7e9e19039c | |||
| dbb04c83af | |||
| 460c7042bf | |||
| 761631c4a6 | |||
| 2a4c7c8b1a | |||
| 8ca01ae9c7 | |||
| c0155b7900 | |||
| 587b712f49 | |||
| 4dd8ac8445 | |||
| 442554812d | |||
| 6671136a08 | |||
| 250e70ff50 | |||
| 953be0cda9 | |||
| 13de4bd1cb | |||
| 450a73f498 | |||
| aec694359c | |||
| 5695a8c068 | |||
| 8963e94cd6 | |||
| ff00e2bf9c | |||
| 760574f454 | |||
| ed5881ec54 | |||
| 49a2100d4e | |||
| fbeb1fb9a6 | |||
| 80d98470e9 |
+2
-1
@@ -5,6 +5,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/deps/include")
|
||||
|
||||
|
||||
if(MINGW)
|
||||
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/deps/lib/mingw/x64")
|
||||
elseif(MSVC)
|
||||
@@ -21,7 +22,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(BUILD_SHARED_LIBS FALSE)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
#set(GLEW_INCLUDE_DIR ${daydream_SOURCE_DIR}/libs/glew-1.11.0/include)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Blender MTL File: 'Brick.blend'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Brick
|
||||
Ns 17.647059
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.154050 0.039202
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 1
|
||||
map_Kd Brick_d.jpg
|
||||
map_Bump Brick_n.jpg
|
||||
map_Ks Brick_s.jpg
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1010 KiB |
@@ -0,0 +1,14 @@
|
||||
# Blender MTL File: 'None'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material.001
|
||||
Ns 96.078431
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd Test/Brick_Diffuse.png
|
||||
map_Bump Test/Brick_Normal.png
|
||||
map_Ks Test/Brick_Specular.png
|
||||
@@ -0,0 +1,124 @@
|
||||
# Blender v2.75 (sub 0) OBJ File: ''
|
||||
# www.blender.org
|
||||
mtllib Halfpipe.mtl
|
||||
o Cylinder
|
||||
v 0.000000 -2.908792 -1.000000
|
||||
v 0.000000 2.908792 -1.000000
|
||||
v 0.195090 -2.908792 -0.980785
|
||||
v 0.195090 2.908792 -0.980785
|
||||
v 0.382683 -2.908792 -0.923880
|
||||
v 0.382683 2.908792 -0.923880
|
||||
v 0.555570 -2.908792 -0.831470
|
||||
v 0.555570 2.908792 -0.831470
|
||||
v 0.707107 -2.908792 -0.707107
|
||||
v 0.707107 2.908792 -0.707107
|
||||
v 0.831470 -2.908792 -0.555570
|
||||
v 0.831470 2.908792 -0.555570
|
||||
v 0.923880 -2.908792 -0.382683
|
||||
v 0.923880 2.908792 -0.382683
|
||||
v 0.980785 -2.908792 -0.195090
|
||||
v 0.980785 2.908792 -0.195090
|
||||
v 1.000000 -2.908792 -0.000000
|
||||
v 1.000000 2.908792 -0.000000
|
||||
v -1.000000 -2.908792 -0.000001
|
||||
v -1.000000 2.908792 -0.000001
|
||||
v -0.980785 -2.908792 -0.195091
|
||||
v -0.980785 2.908792 -0.195091
|
||||
v -0.923879 -2.908792 -0.382684
|
||||
v -0.923879 2.908792 -0.382684
|
||||
v -0.831469 -2.908792 -0.555571
|
||||
v -0.831469 2.908792 -0.555571
|
||||
v -0.707106 -2.908792 -0.707108
|
||||
v -0.707106 2.908792 -0.707108
|
||||
v -0.555569 -2.908792 -0.831470
|
||||
v -0.555569 2.908792 -0.831470
|
||||
v -0.382682 -2.908792 -0.923880
|
||||
v -0.382682 2.908792 -0.923880
|
||||
v -0.195089 -2.908792 -0.980786
|
||||
v -0.195089 2.908792 -0.980786
|
||||
vt -1.156714 -1.419990
|
||||
vt -1.158346 2.336063
|
||||
vt -1.031779 2.336118
|
||||
vt -1.283288 -1.420045
|
||||
vt -1.284913 2.336008
|
||||
vt -1.409862 -1.420100
|
||||
vt -1.411480 2.335954
|
||||
vt -1.536436 -1.420155
|
||||
vt -1.538048 2.335899
|
||||
vt 2.387354 -1.418355
|
||||
vt 2.385534 2.337692
|
||||
vt 2.512101 2.337753
|
||||
vt 2.260782 -1.418416
|
||||
vt 2.258967 2.337631
|
||||
vt 2.134208 -1.418478
|
||||
vt 2.132400 2.337570
|
||||
vt 2.007634 -1.418538
|
||||
vt 2.005832 2.337510
|
||||
vt -0.144122 -1.419541
|
||||
vt -0.145809 2.336510
|
||||
vt -0.019241 2.336567
|
||||
vt -0.270696 -1.419598
|
||||
vt -0.272376 2.336454
|
||||
vt -0.397270 -1.419654
|
||||
vt -0.398943 2.336397
|
||||
vt -0.523844 -1.419711
|
||||
vt -0.525511 2.336341
|
||||
vt -0.650418 -1.419767
|
||||
vt -0.652078 2.336285
|
||||
vt -0.776992 -1.419823
|
||||
vt -0.778645 2.336229
|
||||
vt -1.030140 -1.419935
|
||||
vt -0.905212 2.336174
|
||||
vt -0.903566 -1.419879
|
||||
vt 2.513929 -1.418293
|
||||
vt -0.017548 -1.419484
|
||||
vn -0.098000 0.000000 0.995200
|
||||
vn -0.290300 0.000000 0.956900
|
||||
vn -0.471400 0.000000 0.881900
|
||||
vn -0.634400 0.000000 0.773000
|
||||
vn -0.773000 0.000000 0.634400
|
||||
vn -0.881900 0.000000 0.471400
|
||||
vn -0.956900 0.000000 0.290300
|
||||
vn -0.995200 0.000000 0.098000
|
||||
vn 0.995200 0.000000 0.098000
|
||||
vn 0.956900 0.000000 0.290300
|
||||
vn 0.881900 0.000000 0.471400
|
||||
vn 0.773000 0.000000 0.634400
|
||||
vn 0.634400 0.000000 0.773000
|
||||
vn 0.471400 0.000000 0.881900
|
||||
vn 0.098000 0.000000 0.995200
|
||||
vn 0.290300 0.000000 0.956900
|
||||
usemtl Material.001
|
||||
s off
|
||||
f 3/1/1 4/2/1 2/3/1
|
||||
f 5/4/2 6/5/2 4/2/2
|
||||
f 7/6/3 8/7/3 6/5/3
|
||||
f 9/8/4 10/9/4 8/7/4
|
||||
f 11/10/5 12/11/5 10/12/5
|
||||
f 13/13/6 14/14/6 12/11/6
|
||||
f 15/15/7 16/16/7 14/14/7
|
||||
f 17/17/8 18/18/8 16/16/8
|
||||
f 21/19/9 22/20/9 20/21/9
|
||||
f 23/22/10 24/23/10 22/20/10
|
||||
f 25/24/11 26/25/11 24/23/11
|
||||
f 27/26/12 28/27/12 26/25/12
|
||||
f 29/28/13 30/29/13 28/27/13
|
||||
f 31/30/14 32/31/14 30/29/14
|
||||
f 1/32/15 2/3/15 34/33/15
|
||||
f 33/34/16 34/33/16 32/31/16
|
||||
f 1/32/1 3/1/1 2/3/1
|
||||
f 3/1/2 5/4/2 4/2/2
|
||||
f 5/4/3 7/6/3 6/5/3
|
||||
f 7/6/4 9/8/4 8/7/4
|
||||
f 9/35/5 11/10/5 10/12/5
|
||||
f 11/10/6 13/13/6 12/11/6
|
||||
f 13/13/7 15/15/7 14/14/7
|
||||
f 15/15/8 17/17/8 16/16/8
|
||||
f 19/36/9 21/19/9 20/21/9
|
||||
f 21/19/10 23/22/10 22/20/10
|
||||
f 23/22/11 25/24/11 24/23/11
|
||||
f 25/24/12 27/26/12 26/25/12
|
||||
f 27/26/13 29/28/13 28/27/13
|
||||
f 29/28/14 31/30/14 30/29/14
|
||||
f 33/34/15 1/32/15 34/33/15
|
||||
f 31/30/16 33/34/16 32/31/16
|
||||
@@ -0,0 +1,12 @@
|
||||
# Blender MTL File: 'submarine.blend'
|
||||
# Material Count: 1
|
||||
|
||||
newmtl Material
|
||||
Ns 96.078431
|
||||
Ka 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd SubmarineTexture.png
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 736 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 3.2 MiB |
Vendored
BIN
Binary file not shown.
Vendored
+656
@@ -0,0 +1,656 @@
|
||||
#ifndef AL_AL_H
|
||||
#define AL_AL_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef AL_API
|
||||
#if defined(AL_LIBTYPE_STATIC)
|
||||
#define AL_API
|
||||
#elif defined(_WIN32)
|
||||
#define AL_API __declspec(dllimport)
|
||||
#else
|
||||
#define AL_API extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define AL_APIENTRY __cdecl
|
||||
#else
|
||||
#define AL_APIENTRY
|
||||
#endif
|
||||
|
||||
|
||||
/** Deprecated macro. */
|
||||
#define OPENAL
|
||||
#define ALAPI AL_API
|
||||
#define ALAPIENTRY AL_APIENTRY
|
||||
#define AL_INVALID (-1)
|
||||
#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
|
||||
#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
|
||||
|
||||
/** Supported AL version. */
|
||||
#define AL_VERSION_1_0
|
||||
#define AL_VERSION_1_1
|
||||
|
||||
/** 8-bit boolean */
|
||||
typedef char ALboolean;
|
||||
|
||||
/** character */
|
||||
typedef char ALchar;
|
||||
|
||||
/** signed 8-bit 2's complement integer */
|
||||
typedef signed char ALbyte;
|
||||
|
||||
/** unsigned 8-bit integer */
|
||||
typedef unsigned char ALubyte;
|
||||
|
||||
/** signed 16-bit 2's complement integer */
|
||||
typedef short ALshort;
|
||||
|
||||
/** unsigned 16-bit integer */
|
||||
typedef unsigned short ALushort;
|
||||
|
||||
/** signed 32-bit 2's complement integer */
|
||||
typedef int ALint;
|
||||
|
||||
/** unsigned 32-bit integer */
|
||||
typedef unsigned int ALuint;
|
||||
|
||||
/** non-negative 32-bit binary integer size */
|
||||
typedef int ALsizei;
|
||||
|
||||
/** enumerated 32-bit value */
|
||||
typedef int ALenum;
|
||||
|
||||
/** 32-bit IEEE754 floating-point */
|
||||
typedef float ALfloat;
|
||||
|
||||
/** 64-bit IEEE754 floating-point */
|
||||
typedef double ALdouble;
|
||||
|
||||
/** void type (for opaque pointers only) */
|
||||
typedef void ALvoid;
|
||||
|
||||
|
||||
/* Enumerant values begin at column 50. No tabs. */
|
||||
|
||||
/** "no distance model" or "no buffer" */
|
||||
#define AL_NONE 0
|
||||
|
||||
/** Boolean False. */
|
||||
#define AL_FALSE 0
|
||||
|
||||
/** Boolean True. */
|
||||
#define AL_TRUE 1
|
||||
|
||||
|
||||
/**
|
||||
* Relative source.
|
||||
* Type: ALboolean
|
||||
* Range: [AL_TRUE, AL_FALSE]
|
||||
* Default: AL_FALSE
|
||||
*
|
||||
* Specifies if the Source has relative coordinates.
|
||||
*/
|
||||
#define AL_SOURCE_RELATIVE 0x202
|
||||
|
||||
|
||||
/**
|
||||
* Inner cone angle, in degrees.
|
||||
* Type: ALint, ALfloat
|
||||
* Range: [0 - 360]
|
||||
* Default: 360
|
||||
*
|
||||
* The angle covered by the inner cone, where the source will not attenuate.
|
||||
*/
|
||||
#define AL_CONE_INNER_ANGLE 0x1001
|
||||
|
||||
/**
|
||||
* Outer cone angle, in degrees.
|
||||
* Range: [0 - 360]
|
||||
* Default: 360
|
||||
*
|
||||
* The angle covered by the outer cone, where the source will be fully
|
||||
* attenuated.
|
||||
*/
|
||||
#define AL_CONE_OUTER_ANGLE 0x1002
|
||||
|
||||
/**
|
||||
* Source pitch.
|
||||
* Type: ALfloat
|
||||
* Range: [0.5 - 2.0]
|
||||
* Default: 1.0
|
||||
*
|
||||
* A multiplier for the frequency (sample rate) of the source's buffer.
|
||||
*/
|
||||
#define AL_PITCH 0x1003
|
||||
|
||||
/**
|
||||
* Source or listener position.
|
||||
* Type: ALfloat[3], ALint[3]
|
||||
* Default: {0, 0, 0}
|
||||
*
|
||||
* The source or listener location in three dimensional space.
|
||||
*
|
||||
* OpenAL, like OpenGL, uses a right handed coordinate system, where in a
|
||||
* frontal default view X (thumb) points right, Y points up (index finger), and
|
||||
* Z points towards the viewer/camera (middle finger).
|
||||
*
|
||||
* To switch from a left handed coordinate system, flip the sign on the Z
|
||||
* coordinate.
|
||||
*/
|
||||
#define AL_POSITION 0x1004
|
||||
|
||||
/**
|
||||
* Source direction.
|
||||
* Type: ALfloat[3], ALint[3]
|
||||
* Default: {0, 0, 0}
|
||||
*
|
||||
* Specifies the current direction in local space.
|
||||
* A zero-length vector specifies an omni-directional source (cone is ignored).
|
||||
*/
|
||||
#define AL_DIRECTION 0x1005
|
||||
|
||||
/**
|
||||
* Source or listener velocity.
|
||||
* Type: ALfloat[3], ALint[3]
|
||||
* Default: {0, 0, 0}
|
||||
*
|
||||
* Specifies the current velocity in local space.
|
||||
*/
|
||||
#define AL_VELOCITY 0x1006
|
||||
|
||||
/**
|
||||
* Source looping.
|
||||
* Type: ALboolean
|
||||
* Range: [AL_TRUE, AL_FALSE]
|
||||
* Default: AL_FALSE
|
||||
*
|
||||
* Specifies whether source is looping.
|
||||
*/
|
||||
#define AL_LOOPING 0x1007
|
||||
|
||||
/**
|
||||
* Source buffer.
|
||||
* Type: ALuint
|
||||
* Range: any valid Buffer.
|
||||
*
|
||||
* Specifies the buffer to provide sound samples.
|
||||
*/
|
||||
#define AL_BUFFER 0x1009
|
||||
|
||||
/**
|
||||
* Source or listener gain.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - ]
|
||||
*
|
||||
* A value of 1.0 means unattenuated. Each division by 2 equals an attenuation
|
||||
* of about -6dB. Each multiplicaton by 2 equals an amplification of about
|
||||
* +6dB.
|
||||
*
|
||||
* A value of 0.0 is meaningless with respect to a logarithmic scale; it is
|
||||
* silent.
|
||||
*/
|
||||
#define AL_GAIN 0x100A
|
||||
|
||||
/**
|
||||
* Minimum source gain.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* The minimum gain allowed for a source, after distance and cone attenation is
|
||||
* applied (if applicable).
|
||||
*/
|
||||
#define AL_MIN_GAIN 0x100D
|
||||
|
||||
/**
|
||||
* Maximum source gain.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* The maximum gain allowed for a source, after distance and cone attenation is
|
||||
* applied (if applicable).
|
||||
*/
|
||||
#define AL_MAX_GAIN 0x100E
|
||||
|
||||
/**
|
||||
* Listener orientation.
|
||||
* Type: ALfloat[6]
|
||||
* Default: {0.0, 0.0, -1.0, 0.0, 1.0, 0.0}
|
||||
*
|
||||
* Effectively two three dimensional vectors. The first vector is the front (or
|
||||
* "at") and the second is the top (or "up").
|
||||
*
|
||||
* Both vectors are in local space.
|
||||
*/
|
||||
#define AL_ORIENTATION 0x100F
|
||||
|
||||
/**
|
||||
* Source state (query only).
|
||||
* Type: ALint
|
||||
* Range: [AL_INITIAL, AL_PLAYING, AL_PAUSED, AL_STOPPED]
|
||||
*/
|
||||
#define AL_SOURCE_STATE 0x1010
|
||||
|
||||
/** Source state value. */
|
||||
#define AL_INITIAL 0x1011
|
||||
#define AL_PLAYING 0x1012
|
||||
#define AL_PAUSED 0x1013
|
||||
#define AL_STOPPED 0x1014
|
||||
|
||||
/**
|
||||
* Source Buffer Queue size (query only).
|
||||
* Type: ALint
|
||||
*
|
||||
* The number of buffers queued using alSourceQueueBuffers, minus the buffers
|
||||
* removed with alSourceUnqueueBuffers.
|
||||
*/
|
||||
#define AL_BUFFERS_QUEUED 0x1015
|
||||
|
||||
/**
|
||||
* Source Buffer Queue processed count (query only).
|
||||
* Type: ALint
|
||||
*
|
||||
* The number of queued buffers that have been fully processed, and can be
|
||||
* removed with alSourceUnqueueBuffers.
|
||||
*
|
||||
* Looping sources will never fully process buffers because they will be set to
|
||||
* play again for when the source loops.
|
||||
*/
|
||||
#define AL_BUFFERS_PROCESSED 0x1016
|
||||
|
||||
/**
|
||||
* Source reference distance.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - ]
|
||||
* Default: 1.0
|
||||
*
|
||||
* The distance in units that no attenuation occurs.
|
||||
*
|
||||
* At 0.0, no distance attenuation ever occurs on non-linear attenuation models.
|
||||
*/
|
||||
#define AL_REFERENCE_DISTANCE 0x1020
|
||||
|
||||
/**
|
||||
* Source rolloff factor.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - ]
|
||||
* Default: 1.0
|
||||
*
|
||||
* Multiplier to exaggerate or diminish distance attenuation.
|
||||
*
|
||||
* At 0.0, no distance attenuation ever occurs.
|
||||
*/
|
||||
#define AL_ROLLOFF_FACTOR 0x1021
|
||||
|
||||
/**
|
||||
* Outer cone gain.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
* Default: 0.0
|
||||
*
|
||||
* The gain attenuation applied when the listener is outside of the source's
|
||||
* outer cone.
|
||||
*/
|
||||
#define AL_CONE_OUTER_GAIN 0x1022
|
||||
|
||||
/**
|
||||
* Source maximum distance.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - ]
|
||||
* Default: +inf
|
||||
*
|
||||
* The distance above which the source is not attenuated any further with a
|
||||
* clamped distance model, or where attenuation reaches 0.0 gain for linear
|
||||
* distance models with a default rolloff factor.
|
||||
*/
|
||||
#define AL_MAX_DISTANCE 0x1023
|
||||
|
||||
/** Source buffer position, in seconds */
|
||||
#define AL_SEC_OFFSET 0x1024
|
||||
/** Source buffer position, in sample frames */
|
||||
#define AL_SAMPLE_OFFSET 0x1025
|
||||
/** Source buffer position, in bytes */
|
||||
#define AL_BYTE_OFFSET 0x1026
|
||||
|
||||
/**
|
||||
* Source type (query only).
|
||||
* Type: ALint
|
||||
* Range: [AL_STATIC, AL_STREAMING, AL_UNDETERMINED]
|
||||
*
|
||||
* A Source is Static if a Buffer has been attached using AL_BUFFER.
|
||||
*
|
||||
* A Source is Streaming if one or more Buffers have been attached using
|
||||
* alSourceQueueBuffers.
|
||||
*
|
||||
* A Source is Undetermined when it has the NULL buffer attached using
|
||||
* AL_BUFFER.
|
||||
*/
|
||||
#define AL_SOURCE_TYPE 0x1027
|
||||
|
||||
/** Source type value. */
|
||||
#define AL_STATIC 0x1028
|
||||
#define AL_STREAMING 0x1029
|
||||
#define AL_UNDETERMINED 0x1030
|
||||
|
||||
/** Buffer format specifier. */
|
||||
#define AL_FORMAT_MONO8 0x1100
|
||||
#define AL_FORMAT_MONO16 0x1101
|
||||
#define AL_FORMAT_STEREO8 0x1102
|
||||
#define AL_FORMAT_STEREO16 0x1103
|
||||
|
||||
/** Buffer frequency (query only). */
|
||||
#define AL_FREQUENCY 0x2001
|
||||
/** Buffer bits per sample (query only). */
|
||||
#define AL_BITS 0x2002
|
||||
/** Buffer channel count (query only). */
|
||||
#define AL_CHANNELS 0x2003
|
||||
/** Buffer data size (query only). */
|
||||
#define AL_SIZE 0x2004
|
||||
|
||||
/**
|
||||
* Buffer state.
|
||||
*
|
||||
* Not for public use.
|
||||
*/
|
||||
#define AL_UNUSED 0x2010
|
||||
#define AL_PENDING 0x2011
|
||||
#define AL_PROCESSED 0x2012
|
||||
|
||||
|
||||
/** No error. */
|
||||
#define AL_NO_ERROR 0
|
||||
|
||||
/** Invalid name paramater passed to AL call. */
|
||||
#define AL_INVALID_NAME 0xA001
|
||||
|
||||
/** Invalid enum parameter passed to AL call. */
|
||||
#define AL_INVALID_ENUM 0xA002
|
||||
|
||||
/** Invalid value parameter passed to AL call. */
|
||||
#define AL_INVALID_VALUE 0xA003
|
||||
|
||||
/** Illegal AL call. */
|
||||
#define AL_INVALID_OPERATION 0xA004
|
||||
|
||||
/** Not enough memory. */
|
||||
#define AL_OUT_OF_MEMORY 0xA005
|
||||
|
||||
|
||||
/** Context string: Vendor ID. */
|
||||
#define AL_VENDOR 0xB001
|
||||
/** Context string: Version. */
|
||||
#define AL_VERSION 0xB002
|
||||
/** Context string: Renderer ID. */
|
||||
#define AL_RENDERER 0xB003
|
||||
/** Context string: Space-separated extension list. */
|
||||
#define AL_EXTENSIONS 0xB004
|
||||
|
||||
|
||||
/**
|
||||
* Doppler scale.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - ]
|
||||
* Default: 1.0
|
||||
*
|
||||
* Scale for source and listener velocities.
|
||||
*/
|
||||
#define AL_DOPPLER_FACTOR 0xC000
|
||||
AL_API void AL_APIENTRY alDopplerFactor(ALfloat value);
|
||||
|
||||
/**
|
||||
* Doppler velocity (deprecated).
|
||||
*
|
||||
* A multiplier applied to the Speed of Sound.
|
||||
*/
|
||||
#define AL_DOPPLER_VELOCITY 0xC001
|
||||
AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value);
|
||||
|
||||
/**
|
||||
* Speed of Sound, in units per second.
|
||||
* Type: ALfloat
|
||||
* Range: [0.0001 - ]
|
||||
* Default: 343.3
|
||||
*
|
||||
* The speed at which sound waves are assumed to travel, when calculating the
|
||||
* doppler effect.
|
||||
*/
|
||||
#define AL_SPEED_OF_SOUND 0xC003
|
||||
AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value);
|
||||
|
||||
/**
|
||||
* Distance attenuation model.
|
||||
* Type: ALint
|
||||
* Range: [AL_NONE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED,
|
||||
* AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED,
|
||||
* AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED]
|
||||
* Default: AL_INVERSE_DISTANCE_CLAMPED
|
||||
*
|
||||
* The model by which sources attenuate with distance.
|
||||
*
|
||||
* None - No distance attenuation.
|
||||
* Inverse - Doubling the distance halves the source gain.
|
||||
* Linear - Linear gain scaling between the reference and max distances.
|
||||
* Exponent - Exponential gain dropoff.
|
||||
*
|
||||
* Clamped variations work like the non-clamped counterparts, except the
|
||||
* distance calculated is clamped between the reference and max distances.
|
||||
*/
|
||||
#define AL_DISTANCE_MODEL 0xD000
|
||||
AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel);
|
||||
|
||||
/** Distance model value. */
|
||||
#define AL_INVERSE_DISTANCE 0xD001
|
||||
#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
|
||||
#define AL_LINEAR_DISTANCE 0xD003
|
||||
#define AL_LINEAR_DISTANCE_CLAMPED 0xD004
|
||||
#define AL_EXPONENT_DISTANCE 0xD005
|
||||
#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
|
||||
|
||||
/** Renderer State management. */
|
||||
AL_API void AL_APIENTRY alEnable(ALenum capability);
|
||||
AL_API void AL_APIENTRY alDisable(ALenum capability);
|
||||
AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability);
|
||||
|
||||
/** State retrieval. */
|
||||
AL_API const ALchar* AL_APIENTRY alGetString(ALenum param);
|
||||
AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values);
|
||||
AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values);
|
||||
AL_API void AL_APIENTRY alGetFloatv(ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetDoublev(ALenum param, ALdouble *values);
|
||||
AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum param);
|
||||
AL_API ALint AL_APIENTRY alGetInteger(ALenum param);
|
||||
AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param);
|
||||
AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param);
|
||||
|
||||
/**
|
||||
* Error retrieval.
|
||||
*
|
||||
* Obtain the first error generated in the AL context since the last check.
|
||||
*/
|
||||
AL_API ALenum AL_APIENTRY alGetError(void);
|
||||
|
||||
/**
|
||||
* Extension support.
|
||||
*
|
||||
* Query for the presence of an extension, and obtain any appropriate function
|
||||
* pointers and enum values.
|
||||
*/
|
||||
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname);
|
||||
AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname);
|
||||
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename);
|
||||
|
||||
|
||||
/** Set Listener parameters */
|
||||
AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value);
|
||||
AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values);
|
||||
AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value);
|
||||
AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values);
|
||||
|
||||
/** Get Listener parameters */
|
||||
AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value);
|
||||
AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetListeneri(ALenum param, ALint *value);
|
||||
AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint *values);
|
||||
|
||||
|
||||
/** Create Source objects. */
|
||||
AL_API void AL_APIENTRY alGenSources(ALsizei n, ALuint *sources);
|
||||
/** Delete Source objects. */
|
||||
AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources);
|
||||
/** Verify a handle is a valid Source. */
|
||||
AL_API ALboolean AL_APIENTRY alIsSource(ALuint source);
|
||||
|
||||
/** Set Source parameters. */
|
||||
AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value);
|
||||
AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values);
|
||||
AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value);
|
||||
AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values);
|
||||
|
||||
/** Get Source parameters. */
|
||||
AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value);
|
||||
AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value);
|
||||
AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values);
|
||||
|
||||
|
||||
/** Play, replay, or resume (if paused) a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources);
|
||||
/** Stop a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources);
|
||||
/** Rewind a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources);
|
||||
/** Pause a list of Sources */
|
||||
AL_API void AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources);
|
||||
|
||||
/** Play, replay, or resume a Source */
|
||||
AL_API void AL_APIENTRY alSourcePlay(ALuint source);
|
||||
/** Stop a Source */
|
||||
AL_API void AL_APIENTRY alSourceStop(ALuint source);
|
||||
/** Rewind a Source (set playback postiton to beginning) */
|
||||
AL_API void AL_APIENTRY alSourceRewind(ALuint source);
|
||||
/** Pause a Source */
|
||||
AL_API void AL_APIENTRY alSourcePause(ALuint source);
|
||||
|
||||
/** Queue buffers onto a source */
|
||||
AL_API void AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei nb, const ALuint *buffers);
|
||||
/** Unqueue processed buffers from a source */
|
||||
AL_API void AL_APIENTRY alSourceUnqueueBuffers(ALuint source, ALsizei nb, ALuint *buffers);
|
||||
|
||||
|
||||
/** Create Buffer objects */
|
||||
AL_API void AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers);
|
||||
/** Delete Buffer objects */
|
||||
AL_API void AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers);
|
||||
/** Verify a handle is a valid Buffer */
|
||||
AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer);
|
||||
|
||||
/** Specifies the data to be copied into a buffer */
|
||||
AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
|
||||
|
||||
/** Set Buffer parameters, */
|
||||
AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value);
|
||||
AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values);
|
||||
AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value);
|
||||
AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values);
|
||||
|
||||
/** Get Buffer parameters. */
|
||||
AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value);
|
||||
AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values);
|
||||
AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value);
|
||||
AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values);
|
||||
|
||||
/** Pointer-to-function type, useful for dynamically getting AL entry points. */
|
||||
typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability);
|
||||
typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability);
|
||||
typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)(ALenum param);
|
||||
typedef void (AL_APIENTRY *LPALGETBOOLEANV)(ALenum param, ALboolean *values);
|
||||
typedef void (AL_APIENTRY *LPALGETINTEGERV)(ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETFLOATV)(ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETDOUBLEV)(ALenum param, ALdouble *values);
|
||||
typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)(ALenum param);
|
||||
typedef ALint (AL_APIENTRY *LPALGETINTEGER)(ALenum param);
|
||||
typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)(ALenum param);
|
||||
typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)(ALenum param);
|
||||
typedef ALenum (AL_APIENTRY *LPALGETERROR)(void);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar *extname);
|
||||
typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)(const ALchar *fname);
|
||||
typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)(const ALchar *ename);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERF)(ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3F)(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERFV)(ALenum param, const ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERI)(ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALLISTENER3I)(ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
typedef void (AL_APIENTRY *LPALLISTENERIV)(ALenum param, const ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERF)(ALenum param, ALfloat *value);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3F)(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERFV)(ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERI)(ALenum param, ALint *value);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENER3I)(ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETLISTENERIV)(ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGENSOURCES)(ALsizei n, ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALDELETESOURCES)(ALsizei n, const ALuint *sources);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISSOURCE)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEF)(ALuint source, ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3F)(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEFV)(ALuint source, ALenum param, const ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEI)(ALuint source, ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALSOURCE3I)(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEIV)(ALuint source, ALenum param, const ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEF)(ALuint source, ALenum param, ALfloat *value);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3F)(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEFV)(ALuint source, ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEI)(ALuint source, ALenum param, ALint *value);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCE3I)(ALuint source, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETSOURCEIV)(ALuint source, ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAYV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOPV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWINDV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)(ALsizei n, const ALuint *sources);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPLAY)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCESTOP)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEREWIND)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEPAUSE)(ALuint source);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint source, ALsizei nb, const ALuint *buffers);
|
||||
typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint source, ALsizei nb, ALuint *buffers);
|
||||
typedef void (AL_APIENTRY *LPALGENBUFFERS)(ALsizei n, ALuint *buffers);
|
||||
typedef void (AL_APIENTRY *LPALDELETEBUFFERS)(ALsizei n, const ALuint *buffers);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISBUFFER)(ALuint buffer);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERDATA)(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERF)(ALuint buffer, ALenum param, ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3F)(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERFV)(ALuint buffer, ALenum param, const ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERI)(ALuint buffer, ALenum param, ALint value);
|
||||
typedef void (AL_APIENTRY *LPALBUFFER3I)(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3);
|
||||
typedef void (AL_APIENTRY *LPALBUFFERIV)(ALuint buffer, ALenum param, const ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERF)(ALuint buffer, ALenum param, ALfloat *value);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3F)(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERFV)(ALuint buffer, ALenum param, ALfloat *values);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERI)(ALuint buffer, ALenum param, ALint *value);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFER3I)(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3);
|
||||
typedef void (AL_APIENTRY *LPALGETBUFFERIV)(ALuint buffer, ALenum param, ALint *values);
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)(ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)(ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)(ALfloat value);
|
||||
typedef void (AL_APIENTRY *LPALDISTANCEMODEL)(ALenum distanceModel);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* AL_AL_H */
|
||||
Vendored
+237
@@ -0,0 +1,237 @@
|
||||
#ifndef AL_ALC_H
|
||||
#define AL_ALC_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef ALC_API
|
||||
#if defined(AL_LIBTYPE_STATIC)
|
||||
#define ALC_API
|
||||
#elif defined(_WIN32)
|
||||
#define ALC_API __declspec(dllimport)
|
||||
#else
|
||||
#define ALC_API extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define ALC_APIENTRY __cdecl
|
||||
#else
|
||||
#define ALC_APIENTRY
|
||||
#endif
|
||||
|
||||
|
||||
/** Deprecated macro. */
|
||||
#define ALCAPI ALC_API
|
||||
#define ALCAPIENTRY ALC_APIENTRY
|
||||
#define ALC_INVALID 0
|
||||
|
||||
/** Supported ALC version? */
|
||||
#define ALC_VERSION_0_1 1
|
||||
|
||||
/** Opaque device handle */
|
||||
typedef struct ALCdevice_struct ALCdevice;
|
||||
/** Opaque context handle */
|
||||
typedef struct ALCcontext_struct ALCcontext;
|
||||
|
||||
/** 8-bit boolean */
|
||||
typedef char ALCboolean;
|
||||
|
||||
/** character */
|
||||
typedef char ALCchar;
|
||||
|
||||
/** signed 8-bit 2's complement integer */
|
||||
typedef signed char ALCbyte;
|
||||
|
||||
/** unsigned 8-bit integer */
|
||||
typedef unsigned char ALCubyte;
|
||||
|
||||
/** signed 16-bit 2's complement integer */
|
||||
typedef short ALCshort;
|
||||
|
||||
/** unsigned 16-bit integer */
|
||||
typedef unsigned short ALCushort;
|
||||
|
||||
/** signed 32-bit 2's complement integer */
|
||||
typedef int ALCint;
|
||||
|
||||
/** unsigned 32-bit integer */
|
||||
typedef unsigned int ALCuint;
|
||||
|
||||
/** non-negative 32-bit binary integer size */
|
||||
typedef int ALCsizei;
|
||||
|
||||
/** enumerated 32-bit value */
|
||||
typedef int ALCenum;
|
||||
|
||||
/** 32-bit IEEE754 floating-point */
|
||||
typedef float ALCfloat;
|
||||
|
||||
/** 64-bit IEEE754 floating-point */
|
||||
typedef double ALCdouble;
|
||||
|
||||
/** void type (for opaque pointers only) */
|
||||
typedef void ALCvoid;
|
||||
|
||||
|
||||
/* Enumerant values begin at column 50. No tabs. */
|
||||
|
||||
/** Boolean False. */
|
||||
#define ALC_FALSE 0
|
||||
|
||||
/** Boolean True. */
|
||||
#define ALC_TRUE 1
|
||||
|
||||
/** Context attribute: <int> Hz. */
|
||||
#define ALC_FREQUENCY 0x1007
|
||||
|
||||
/** Context attribute: <int> Hz. */
|
||||
#define ALC_REFRESH 0x1008
|
||||
|
||||
/** Context attribute: AL_TRUE or AL_FALSE. */
|
||||
#define ALC_SYNC 0x1009
|
||||
|
||||
/** Context attribute: <int> requested Mono (3D) Sources. */
|
||||
#define ALC_MONO_SOURCES 0x1010
|
||||
|
||||
/** Context attribute: <int> requested Stereo Sources. */
|
||||
#define ALC_STEREO_SOURCES 0x1011
|
||||
|
||||
/** No error. */
|
||||
#define ALC_NO_ERROR 0
|
||||
|
||||
/** Invalid device handle. */
|
||||
#define ALC_INVALID_DEVICE 0xA001
|
||||
|
||||
/** Invalid context handle. */
|
||||
#define ALC_INVALID_CONTEXT 0xA002
|
||||
|
||||
/** Invalid enum parameter passed to an ALC call. */
|
||||
#define ALC_INVALID_ENUM 0xA003
|
||||
|
||||
/** Invalid value parameter passed to an ALC call. */
|
||||
#define ALC_INVALID_VALUE 0xA004
|
||||
|
||||
/** Out of memory. */
|
||||
#define ALC_OUT_OF_MEMORY 0xA005
|
||||
|
||||
|
||||
/** Runtime ALC version. */
|
||||
#define ALC_MAJOR_VERSION 0x1000
|
||||
#define ALC_MINOR_VERSION 0x1001
|
||||
|
||||
/** Context attribute list properties. */
|
||||
#define ALC_ATTRIBUTES_SIZE 0x1002
|
||||
#define ALC_ALL_ATTRIBUTES 0x1003
|
||||
|
||||
/** String for the default device specifier. */
|
||||
#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
|
||||
/**
|
||||
* String for the given device's specifier.
|
||||
*
|
||||
* If device handle is NULL, it is instead a null-char separated list of
|
||||
* strings of known device specifiers (list ends with an empty string).
|
||||
*/
|
||||
#define ALC_DEVICE_SPECIFIER 0x1005
|
||||
/** String for space-separated list of ALC extensions. */
|
||||
#define ALC_EXTENSIONS 0x1006
|
||||
|
||||
|
||||
/** Capture extension */
|
||||
#define ALC_EXT_CAPTURE 1
|
||||
/**
|
||||
* String for the given capture device's specifier.
|
||||
*
|
||||
* If device handle is NULL, it is instead a null-char separated list of
|
||||
* strings of known capture device specifiers (list ends with an empty string).
|
||||
*/
|
||||
#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
|
||||
/** String for the default capture device specifier. */
|
||||
#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
|
||||
/** Number of sample frames available for capture. */
|
||||
#define ALC_CAPTURE_SAMPLES 0x312
|
||||
|
||||
|
||||
/** Enumerate All extension */
|
||||
#define ALC_ENUMERATE_ALL_EXT 1
|
||||
/** String for the default extended device specifier. */
|
||||
#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
|
||||
/**
|
||||
* String for the given extended device's specifier.
|
||||
*
|
||||
* If device handle is NULL, it is instead a null-char separated list of
|
||||
* strings of known extended device specifiers (list ends with an empty string).
|
||||
*/
|
||||
#define ALC_ALL_DEVICES_SPECIFIER 0x1013
|
||||
|
||||
|
||||
/** Context management. */
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
|
||||
ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
|
||||
ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
|
||||
ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
|
||||
|
||||
/** Device management. */
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
|
||||
|
||||
|
||||
/**
|
||||
* Error support.
|
||||
*
|
||||
* Obtain the most recent Device error.
|
||||
*/
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
|
||||
|
||||
/**
|
||||
* Extension support.
|
||||
*
|
||||
* Query for the presence of an extension, and obtain any appropriate
|
||||
* function pointers and enum values.
|
||||
*/
|
||||
ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
|
||||
ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
|
||||
ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
|
||||
|
||||
/** Query function. */
|
||||
ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
|
||||
ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
|
||||
|
||||
/** Capture function. */
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
|
||||
|
||||
/** Pointer-to-function type, useful for dynamically getting ALC entry points. */
|
||||
typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
|
||||
typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
|
||||
typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
|
||||
typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
|
||||
typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
|
||||
typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
|
||||
typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
|
||||
typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
|
||||
typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
|
||||
typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
|
||||
typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AL_ALC_H */
|
||||
Vendored
+416
@@ -0,0 +1,416 @@
|
||||
/**
|
||||
* OpenAL cross platform audio library
|
||||
* Copyright (C) 2008 by authors.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#ifndef AL_ALEXT_H
|
||||
#define AL_ALEXT_H
|
||||
|
||||
#include <stddef.h>
|
||||
/* Define int64_t and uint64_t types */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(_WIN32)
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
/* Fallback if nothing above works */
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#include "alc.h"
|
||||
#include "al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef AL_LOKI_IMA_ADPCM_format
|
||||
#define AL_LOKI_IMA_ADPCM_format 1
|
||||
#define AL_FORMAT_IMA_ADPCM_MONO16_EXT 0x10000
|
||||
#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT 0x10001
|
||||
#endif
|
||||
|
||||
#ifndef AL_LOKI_WAVE_format
|
||||
#define AL_LOKI_WAVE_format 1
|
||||
#define AL_FORMAT_WAVE_EXT 0x10002
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_vorbis
|
||||
#define AL_EXT_vorbis 1
|
||||
#define AL_FORMAT_VORBIS_EXT 0x10003
|
||||
#endif
|
||||
|
||||
#ifndef AL_LOKI_quadriphonic
|
||||
#define AL_LOKI_quadriphonic 1
|
||||
#define AL_FORMAT_QUAD8_LOKI 0x10004
|
||||
#define AL_FORMAT_QUAD16_LOKI 0x10005
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_float32
|
||||
#define AL_EXT_float32 1
|
||||
#define AL_FORMAT_MONO_FLOAT32 0x10010
|
||||
#define AL_FORMAT_STEREO_FLOAT32 0x10011
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_double
|
||||
#define AL_EXT_double 1
|
||||
#define AL_FORMAT_MONO_DOUBLE_EXT 0x10012
|
||||
#define AL_FORMAT_STEREO_DOUBLE_EXT 0x10013
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MULAW
|
||||
#define AL_EXT_MULAW 1
|
||||
#define AL_FORMAT_MONO_MULAW_EXT 0x10014
|
||||
#define AL_FORMAT_STEREO_MULAW_EXT 0x10015
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_ALAW
|
||||
#define AL_EXT_ALAW 1
|
||||
#define AL_FORMAT_MONO_ALAW_EXT 0x10016
|
||||
#define AL_FORMAT_STEREO_ALAW_EXT 0x10017
|
||||
#endif
|
||||
|
||||
#ifndef ALC_LOKI_audio_channel
|
||||
#define ALC_LOKI_audio_channel 1
|
||||
#define ALC_CHAN_MAIN_LOKI 0x500001
|
||||
#define ALC_CHAN_PCM_LOKI 0x500002
|
||||
#define ALC_CHAN_CD_LOKI 0x500003
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MCFORMATS
|
||||
#define AL_EXT_MCFORMATS 1
|
||||
#define AL_FORMAT_QUAD8 0x1204
|
||||
#define AL_FORMAT_QUAD16 0x1205
|
||||
#define AL_FORMAT_QUAD32 0x1206
|
||||
#define AL_FORMAT_REAR8 0x1207
|
||||
#define AL_FORMAT_REAR16 0x1208
|
||||
#define AL_FORMAT_REAR32 0x1209
|
||||
#define AL_FORMAT_51CHN8 0x120A
|
||||
#define AL_FORMAT_51CHN16 0x120B
|
||||
#define AL_FORMAT_51CHN32 0x120C
|
||||
#define AL_FORMAT_61CHN8 0x120D
|
||||
#define AL_FORMAT_61CHN16 0x120E
|
||||
#define AL_FORMAT_61CHN32 0x120F
|
||||
#define AL_FORMAT_71CHN8 0x1210
|
||||
#define AL_FORMAT_71CHN16 0x1211
|
||||
#define AL_FORMAT_71CHN32 0x1212
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MULAW_MCFORMATS
|
||||
#define AL_EXT_MULAW_MCFORMATS 1
|
||||
#define AL_FORMAT_MONO_MULAW 0x10014
|
||||
#define AL_FORMAT_STEREO_MULAW 0x10015
|
||||
#define AL_FORMAT_QUAD_MULAW 0x10021
|
||||
#define AL_FORMAT_REAR_MULAW 0x10022
|
||||
#define AL_FORMAT_51CHN_MULAW 0x10023
|
||||
#define AL_FORMAT_61CHN_MULAW 0x10024
|
||||
#define AL_FORMAT_71CHN_MULAW 0x10025
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_IMA4
|
||||
#define AL_EXT_IMA4 1
|
||||
#define AL_FORMAT_MONO_IMA4 0x1300
|
||||
#define AL_FORMAT_STEREO_IMA4 0x1301
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_STATIC_BUFFER
|
||||
#define AL_EXT_STATIC_BUFFER 1
|
||||
typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_EFX
|
||||
#define ALC_EXT_EFX 1
|
||||
#include "efx.h"
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_disconnect
|
||||
#define ALC_EXT_disconnect 1
|
||||
#define ALC_CONNECTED 0x313
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_thread_local_context
|
||||
#define ALC_EXT_thread_local_context 1
|
||||
typedef ALCboolean (ALC_APIENTRY*PFNALCSETTHREADCONTEXTPROC)(ALCcontext *context);
|
||||
typedef ALCcontext* (ALC_APIENTRY*PFNALCGETTHREADCONTEXTPROC)(void);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API ALCboolean ALC_APIENTRY alcSetThreadContext(ALCcontext *context);
|
||||
ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_source_distance_model
|
||||
#define AL_EXT_source_distance_model 1
|
||||
#define AL_SOURCE_DISTANCE_MODEL 0x200
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_buffer_sub_data
|
||||
#define AL_SOFT_buffer_sub_data 1
|
||||
#define AL_BYTE_RW_OFFSETS_SOFT 0x1031
|
||||
#define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032
|
||||
typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_loop_points
|
||||
#define AL_SOFT_loop_points 1
|
||||
#define AL_LOOP_POINTS_SOFT 0x2015
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_FOLDBACK
|
||||
#define AL_EXT_FOLDBACK 1
|
||||
#define AL_EXT_FOLDBACK_NAME "AL_EXT_FOLDBACK"
|
||||
#define AL_FOLDBACK_EVENT_BLOCK 0x4112
|
||||
#define AL_FOLDBACK_EVENT_START 0x4111
|
||||
#define AL_FOLDBACK_EVENT_STOP 0x4113
|
||||
#define AL_FOLDBACK_MODE_MONO 0x4101
|
||||
#define AL_FOLDBACK_MODE_STEREO 0x4102
|
||||
typedef void (AL_APIENTRY*LPALFOLDBACKCALLBACK)(ALenum,ALsizei);
|
||||
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTART)(ALenum,ALsizei,ALsizei,ALfloat*,LPALFOLDBACKCALLBACK);
|
||||
typedef void (AL_APIENTRY*LPALREQUESTFOLDBACKSTOP)(void);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alRequestFoldbackStart(ALenum mode,ALsizei count,ALsizei length,ALfloat *mem,LPALFOLDBACKCALLBACK callback);
|
||||
AL_API void AL_APIENTRY alRequestFoldbackStop(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_DEDICATED
|
||||
#define ALC_EXT_DEDICATED 1
|
||||
#define AL_DEDICATED_GAIN 0x0001
|
||||
#define AL_EFFECT_DEDICATED_DIALOGUE 0x9001
|
||||
#define AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT 0x9000
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_buffer_samples
|
||||
#define AL_SOFT_buffer_samples 1
|
||||
/* Channel configurations */
|
||||
#define AL_MONO_SOFT 0x1500
|
||||
#define AL_STEREO_SOFT 0x1501
|
||||
#define AL_REAR_SOFT 0x1502
|
||||
#define AL_QUAD_SOFT 0x1503
|
||||
#define AL_5POINT1_SOFT 0x1504
|
||||
#define AL_6POINT1_SOFT 0x1505
|
||||
#define AL_7POINT1_SOFT 0x1506
|
||||
|
||||
/* Sample types */
|
||||
#define AL_BYTE_SOFT 0x1400
|
||||
#define AL_UNSIGNED_BYTE_SOFT 0x1401
|
||||
#define AL_SHORT_SOFT 0x1402
|
||||
#define AL_UNSIGNED_SHORT_SOFT 0x1403
|
||||
#define AL_INT_SOFT 0x1404
|
||||
#define AL_UNSIGNED_INT_SOFT 0x1405
|
||||
#define AL_FLOAT_SOFT 0x1406
|
||||
#define AL_DOUBLE_SOFT 0x1407
|
||||
#define AL_BYTE3_SOFT 0x1408
|
||||
#define AL_UNSIGNED_BYTE3_SOFT 0x1409
|
||||
|
||||
/* Storage formats */
|
||||
#define AL_MONO8_SOFT 0x1100
|
||||
#define AL_MONO16_SOFT 0x1101
|
||||
#define AL_MONO32F_SOFT 0x10010
|
||||
#define AL_STEREO8_SOFT 0x1102
|
||||
#define AL_STEREO16_SOFT 0x1103
|
||||
#define AL_STEREO32F_SOFT 0x10011
|
||||
#define AL_QUAD8_SOFT 0x1204
|
||||
#define AL_QUAD16_SOFT 0x1205
|
||||
#define AL_QUAD32F_SOFT 0x1206
|
||||
#define AL_REAR8_SOFT 0x1207
|
||||
#define AL_REAR16_SOFT 0x1208
|
||||
#define AL_REAR32F_SOFT 0x1209
|
||||
#define AL_5POINT1_8_SOFT 0x120A
|
||||
#define AL_5POINT1_16_SOFT 0x120B
|
||||
#define AL_5POINT1_32F_SOFT 0x120C
|
||||
#define AL_6POINT1_8_SOFT 0x120D
|
||||
#define AL_6POINT1_16_SOFT 0x120E
|
||||
#define AL_6POINT1_32F_SOFT 0x120F
|
||||
#define AL_7POINT1_8_SOFT 0x1210
|
||||
#define AL_7POINT1_16_SOFT 0x1211
|
||||
#define AL_7POINT1_32F_SOFT 0x1212
|
||||
|
||||
/* Buffer attributes */
|
||||
#define AL_INTERNAL_FORMAT_SOFT 0x2008
|
||||
#define AL_BYTE_LENGTH_SOFT 0x2009
|
||||
#define AL_SAMPLE_LENGTH_SOFT 0x200A
|
||||
#define AL_SEC_LENGTH_SOFT 0x200B
|
||||
|
||||
typedef void (AL_APIENTRY*LPALBUFFERSAMPLESSOFT)(ALuint,ALuint,ALenum,ALsizei,ALenum,ALenum,const ALvoid*);
|
||||
typedef void (AL_APIENTRY*LPALBUFFERSUBSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,const ALvoid*);
|
||||
typedef void (AL_APIENTRY*LPALGETBUFFERSAMPLESSOFT)(ALuint,ALsizei,ALsizei,ALenum,ALenum,ALvoid*);
|
||||
typedef ALboolean (AL_APIENTRY*LPALISBUFFERFORMATSUPPORTEDSOFT)(ALenum);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
|
||||
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data);
|
||||
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data);
|
||||
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_direct_channels
|
||||
#define AL_SOFT_direct_channels 1
|
||||
#define AL_DIRECT_CHANNELS_SOFT 0x1033
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_loopback
|
||||
#define ALC_SOFT_loopback 1
|
||||
#define ALC_FORMAT_CHANNELS_SOFT 0x1990
|
||||
#define ALC_FORMAT_TYPE_SOFT 0x1991
|
||||
|
||||
/* Sample types */
|
||||
#define ALC_BYTE_SOFT 0x1400
|
||||
#define ALC_UNSIGNED_BYTE_SOFT 0x1401
|
||||
#define ALC_SHORT_SOFT 0x1402
|
||||
#define ALC_UNSIGNED_SHORT_SOFT 0x1403
|
||||
#define ALC_INT_SOFT 0x1404
|
||||
#define ALC_UNSIGNED_INT_SOFT 0x1405
|
||||
#define ALC_FLOAT_SOFT 0x1406
|
||||
|
||||
/* Channel configurations */
|
||||
#define ALC_MONO_SOFT 0x1500
|
||||
#define ALC_STEREO_SOFT 0x1501
|
||||
#define ALC_QUAD_SOFT 0x1503
|
||||
#define ALC_5POINT1_SOFT 0x1504
|
||||
#define ALC_6POINT1_SOFT 0x1505
|
||||
#define ALC_7POINT1_SOFT 0x1506
|
||||
|
||||
typedef ALCdevice* (ALC_APIENTRY*LPALCLOOPBACKOPENDEVICESOFT)(const ALCchar*);
|
||||
typedef ALCboolean (ALC_APIENTRY*LPALCISRENDERFORMATSUPPORTEDSOFT)(ALCdevice*,ALCsizei,ALCenum,ALCenum);
|
||||
typedef void (ALC_APIENTRY*LPALCRENDERSAMPLESSOFT)(ALCdevice*,ALCvoid*,ALCsizei);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceName);
|
||||
ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type);
|
||||
ALC_API void ALC_APIENTRY alcRenderSamplesSOFT(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_STEREO_ANGLES
|
||||
#define AL_EXT_STEREO_ANGLES 1
|
||||
#define AL_STEREO_ANGLES 0x1030
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_SOURCE_RADIUS
|
||||
#define AL_EXT_SOURCE_RADIUS 1
|
||||
#define AL_SOURCE_RADIUS 0x1031
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_latency
|
||||
#define AL_SOFT_source_latency 1
|
||||
#define AL_SAMPLE_OFFSET_LATENCY_SOFT 0x1200
|
||||
#define AL_SEC_OFFSET_LATENCY_SOFT 0x1201
|
||||
typedef int64_t ALint64SOFT;
|
||||
typedef uint64_t ALuint64SOFT;
|
||||
typedef void (AL_APIENTRY*LPALSOURCEDSOFT)(ALuint,ALenum,ALdouble);
|
||||
typedef void (AL_APIENTRY*LPALSOURCE3DSOFT)(ALuint,ALenum,ALdouble,ALdouble,ALdouble);
|
||||
typedef void (AL_APIENTRY*LPALSOURCEDVSOFT)(ALuint,ALenum,const ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEDSOFT)(ALuint,ALenum,ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCE3DSOFT)(ALuint,ALenum,ALdouble*,ALdouble*,ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEDVSOFT)(ALuint,ALenum,ALdouble*);
|
||||
typedef void (AL_APIENTRY*LPALSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT);
|
||||
typedef void (AL_APIENTRY*LPALSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT,ALint64SOFT,ALint64SOFT);
|
||||
typedef void (AL_APIENTRY*LPALSOURCEI64VSOFT)(ALuint,ALenum,const ALint64SOFT*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEI64SOFT)(ALuint,ALenum,ALint64SOFT*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCE3I64SOFT)(ALuint,ALenum,ALint64SOFT*,ALint64SOFT*,ALint64SOFT*);
|
||||
typedef void (AL_APIENTRY*LPALGETSOURCEI64VSOFT)(ALuint,ALenum,ALint64SOFT*);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API void AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble value);
|
||||
AL_API void AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble value1, ALdouble value2, ALdouble value3);
|
||||
AL_API void AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdouble *values);
|
||||
AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *value);
|
||||
AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble *value1, ALdouble *value2, ALdouble *value3);
|
||||
AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble *values);
|
||||
AL_API void AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT value);
|
||||
AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT value1, ALint64SOFT value2, ALint64SOFT value3);
|
||||
AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALint64SOFT *values);
|
||||
AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64SOFT *value);
|
||||
AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64SOFT *value1, ALint64SOFT *value2, ALint64SOFT *value3);
|
||||
AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64SOFT *values);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_DEFAULT_FILTER_ORDER
|
||||
#define ALC_EXT_DEFAULT_FILTER_ORDER 1
|
||||
#define ALC_DEFAULT_FILTER_ORDER 0x1100
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_deferred_updates
|
||||
#define AL_SOFT_deferred_updates 1
|
||||
#define AL_DEFERRED_UPDATES_SOFT 0xC002
|
||||
typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void);
|
||||
typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void);
|
||||
AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_block_alignment
|
||||
#define AL_SOFT_block_alignment 1
|
||||
#define AL_UNPACK_BLOCK_ALIGNMENT_SOFT 0x200C
|
||||
#define AL_PACK_BLOCK_ALIGNMENT_SOFT 0x200D
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_MSADPCM
|
||||
#define AL_SOFT_MSADPCM 1
|
||||
#define AL_FORMAT_MONO_MSADPCM_SOFT 0x1302
|
||||
#define AL_FORMAT_STEREO_MSADPCM_SOFT 0x1303
|
||||
#endif
|
||||
|
||||
#ifndef AL_SOFT_source_length
|
||||
#define AL_SOFT_source_length 1
|
||||
/*#define AL_BYTE_LENGTH_SOFT 0x2009*/
|
||||
/*#define AL_SAMPLE_LENGTH_SOFT 0x200A*/
|
||||
/*#define AL_SEC_LENGTH_SOFT 0x200B*/
|
||||
#endif
|
||||
|
||||
#ifndef ALC_SOFT_pause_device
|
||||
#define ALC_SOFT_pause_device 1
|
||||
typedef void (ALC_APIENTRY*LPALCDEVICEPAUSESOFT)(ALCdevice *device);
|
||||
typedef void (ALC_APIENTRY*LPALCDEVICERESUMESOFT)(ALCdevice *device);
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device);
|
||||
ALC_API void ALC_APIENTRY alcDeviceResumeSOFT(ALCdevice *device);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_BFORMAT
|
||||
#define AL_EXT_BFORMAT 1
|
||||
#define AL_FORMAT_BFORMAT2D_8 0x20021
|
||||
#define AL_FORMAT_BFORMAT2D_16 0x20022
|
||||
#define AL_FORMAT_BFORMAT2D_FLOAT32 0x20023
|
||||
#define AL_FORMAT_BFORMAT3D_8 0x20031
|
||||
#define AL_FORMAT_BFORMAT3D_16 0x20032
|
||||
#define AL_FORMAT_BFORMAT3D_FLOAT32 0x20033
|
||||
#endif
|
||||
|
||||
#ifndef AL_EXT_MULAW_BFORMAT
|
||||
#define AL_EXT_MULAW_BFORMAT 1
|
||||
#define AL_FORMAT_BFORMAT2D_MULAW 0x10031
|
||||
#define AL_FORMAT_BFORMAT3D_MULAW 0x10032
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
/* The tokens that would be defined here are already defined in efx.h. This
|
||||
* empty file is here to provide compatibility with Windows-based projects
|
||||
* that would include it. */
|
||||
Vendored
+402
@@ -0,0 +1,402 @@
|
||||
/* Reverb presets for EFX */
|
||||
|
||||
#ifndef EFX_PRESETS_H
|
||||
#define EFX_PRESETS_H
|
||||
|
||||
#ifndef EFXEAXREVERBPROPERTIES_DEFINED
|
||||
#define EFXEAXREVERBPROPERTIES_DEFINED
|
||||
typedef struct {
|
||||
float flDensity;
|
||||
float flDiffusion;
|
||||
float flGain;
|
||||
float flGainHF;
|
||||
float flGainLF;
|
||||
float flDecayTime;
|
||||
float flDecayHFRatio;
|
||||
float flDecayLFRatio;
|
||||
float flReflectionsGain;
|
||||
float flReflectionsDelay;
|
||||
float flReflectionsPan[3];
|
||||
float flLateReverbGain;
|
||||
float flLateReverbDelay;
|
||||
float flLateReverbPan[3];
|
||||
float flEchoTime;
|
||||
float flEchoDepth;
|
||||
float flModulationTime;
|
||||
float flModulationDepth;
|
||||
float flAirAbsorptionGainHF;
|
||||
float flHFReference;
|
||||
float flLFReference;
|
||||
float flRoomRolloffFactor;
|
||||
int iDecayHFLimit;
|
||||
} EFXEAXREVERBPROPERTIES, *LPEFXEAXREVERBPROPERTIES;
|
||||
#endif
|
||||
|
||||
/* Default Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_GENERIC \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.8913f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PADDEDCELL \
|
||||
{ 0.1715f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.1700f, 0.1000f, 1.0000f, 0.2500f, 0.0010f, { 0.0000f, 0.0000f, 0.0000f }, 1.2691f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ROOM \
|
||||
{ 0.4287f, 1.0000f, 0.3162f, 0.5929f, 1.0000f, 0.4000f, 0.8300f, 1.0000f, 0.1503f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.0629f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_BATHROOM \
|
||||
{ 0.1715f, 1.0000f, 0.3162f, 0.2512f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.6531f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 3.2734f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_LIVINGROOM \
|
||||
{ 0.9766f, 1.0000f, 0.3162f, 0.0010f, 1.0000f, 0.5000f, 0.1000f, 1.0000f, 0.2051f, 0.0030f, { 0.0000f, 0.0000f, 0.0000f }, 0.2805f, 0.0040f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_STONEROOM \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 2.3100f, 0.6400f, 1.0000f, 0.4411f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1003f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_AUDITORIUM \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.5781f, 1.0000f, 4.3200f, 0.5900f, 1.0000f, 0.4032f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7170f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CONCERTHALL \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.5623f, 1.0000f, 3.9200f, 0.7000f, 1.0000f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.9977f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CAVE \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 2.9100f, 1.3000f, 1.0000f, 0.5000f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.7063f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ARENA \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.4477f, 1.0000f, 7.2400f, 0.3300f, 1.0000f, 0.2612f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.0186f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_HANGAR \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 10.0500f, 0.2300f, 1.0000f, 0.5000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2560f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CARPETEDHALLWAY \
|
||||
{ 0.4287f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 0.3000f, 0.1000f, 1.0000f, 0.1215f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 0.1531f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_HALLWAY \
|
||||
{ 0.3645f, 1.0000f, 0.3162f, 0.7079f, 1.0000f, 1.4900f, 0.5900f, 1.0000f, 0.2458f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.6615f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_STONECORRIDOR \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.7612f, 1.0000f, 2.7000f, 0.7900f, 1.0000f, 0.2472f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 1.5758f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ALLEY \
|
||||
{ 1.0000f, 0.3000f, 0.3162f, 0.7328f, 1.0000f, 1.4900f, 0.8600f, 1.0000f, 0.2500f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.9954f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.9500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FOREST \
|
||||
{ 1.0000f, 0.3000f, 0.3162f, 0.0224f, 1.0000f, 1.4900f, 0.5400f, 1.0000f, 0.0525f, 0.1620f, { 0.0000f, 0.0000f, 0.0000f }, 0.7682f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CITY \
|
||||
{ 1.0000f, 0.5000f, 0.3162f, 0.3981f, 1.0000f, 1.4900f, 0.6700f, 1.0000f, 0.0730f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1427f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_MOUNTAINS \
|
||||
{ 1.0000f, 0.2700f, 0.3162f, 0.0562f, 1.0000f, 1.4900f, 0.2100f, 1.0000f, 0.0407f, 0.3000f, { 0.0000f, 0.0000f, 0.0000f }, 0.1919f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_QUARRY \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.3162f, 1.0000f, 1.4900f, 0.8300f, 1.0000f, 0.0000f, 0.0610f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.7000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PLAIN \
|
||||
{ 1.0000f, 0.2100f, 0.3162f, 0.1000f, 1.0000f, 1.4900f, 0.5000f, 1.0000f, 0.0585f, 0.1790f, { 0.0000f, 0.0000f, 0.0000f }, 0.1089f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PARKINGLOT \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 1.0000f, 1.0000f, 1.6500f, 1.5000f, 1.0000f, 0.2082f, 0.0080f, { 0.0000f, 0.0000f, 0.0000f }, 0.2652f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SEWERPIPE \
|
||||
{ 0.3071f, 0.8000f, 0.3162f, 0.3162f, 1.0000f, 2.8100f, 0.1400f, 1.0000f, 1.6387f, 0.0140f, { 0.0000f, 0.0000f, 0.0000f }, 3.2471f, 0.0210f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_UNDERWATER \
|
||||
{ 0.3645f, 1.0000f, 0.3162f, 0.0100f, 1.0000f, 1.4900f, 0.1000f, 1.0000f, 0.5963f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 7.0795f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 1.1800f, 0.3480f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRUGGED \
|
||||
{ 0.4287f, 0.5000f, 0.3162f, 1.0000f, 1.0000f, 8.3900f, 1.3900f, 1.0000f, 0.8760f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 3.1081f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DIZZY \
|
||||
{ 0.3645f, 0.6000f, 0.3162f, 0.6310f, 1.0000f, 17.2300f, 0.5600f, 1.0000f, 0.1392f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4937f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.8100f, 0.3100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PSYCHOTIC \
|
||||
{ 0.0625f, 0.5000f, 0.3162f, 0.8404f, 1.0000f, 7.5600f, 0.9100f, 1.0000f, 0.4864f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 2.4378f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 4.0000f, 1.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
/* Castle Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_SMALLROOM \
|
||||
{ 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 1.2200f, 0.8300f, 0.3100f, 0.8913f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_SHORTPASSAGE \
|
||||
{ 1.0000f, 0.8900f, 0.3162f, 0.3162f, 0.1000f, 2.3200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_MEDIUMROOM \
|
||||
{ 1.0000f, 0.9300f, 0.3162f, 0.2818f, 0.1000f, 2.0400f, 0.8300f, 0.4600f, 0.6310f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1550f, 0.0300f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_LARGEROOM \
|
||||
{ 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.1259f, 2.5300f, 0.8300f, 0.5000f, 0.4467f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1850f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_LONGPASSAGE \
|
||||
{ 1.0000f, 0.8900f, 0.3162f, 0.3981f, 0.1000f, 3.4200f, 0.8300f, 0.3100f, 0.8913f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_HALL \
|
||||
{ 1.0000f, 0.8100f, 0.3162f, 0.2818f, 0.1778f, 3.1400f, 0.7900f, 0.6200f, 0.1778f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_CUPBOARD \
|
||||
{ 1.0000f, 0.8900f, 0.3162f, 0.2818f, 0.1000f, 0.6700f, 0.8700f, 0.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 3.5481f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_COURTYARD \
|
||||
{ 1.0000f, 0.4200f, 0.3162f, 0.4467f, 0.1995f, 2.1300f, 0.6100f, 0.2300f, 0.2239f, 0.1600f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3700f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CASTLE_ALCOVE \
|
||||
{ 1.0000f, 0.8900f, 0.3162f, 0.5012f, 0.1000f, 1.6400f, 0.8700f, 0.3100f, 1.0000f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1380f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 5168.6001f, 139.5000f, 0.0000f, 0x1 }
|
||||
|
||||
/* Factory Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_SMALLROOM \
|
||||
{ 0.3645f, 0.8200f, 0.3162f, 0.7943f, 0.5012f, 1.7200f, 0.6500f, 1.3100f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.1190f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_SHORTPASSAGE \
|
||||
{ 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 2.5300f, 0.6500f, 1.3100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_MEDIUMROOM \
|
||||
{ 0.4287f, 0.8200f, 0.2512f, 0.7943f, 0.5012f, 2.7600f, 0.6500f, 1.3100f, 0.2818f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1740f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_LARGEROOM \
|
||||
{ 0.4287f, 0.7500f, 0.2512f, 0.7079f, 0.6310f, 4.2400f, 0.5100f, 1.3100f, 0.1778f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2310f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_LONGPASSAGE \
|
||||
{ 0.3645f, 0.6400f, 0.2512f, 0.7943f, 0.5012f, 4.0600f, 0.6500f, 1.3100f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.1350f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_HALL \
|
||||
{ 0.4287f, 0.7500f, 0.3162f, 0.7079f, 0.6310f, 7.4300f, 0.5100f, 1.3100f, 0.0631f, 0.0730f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_CUPBOARD \
|
||||
{ 0.3071f, 0.6300f, 0.2512f, 0.7943f, 0.5012f, 0.4900f, 0.6500f, 1.3100f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.1070f, 0.0700f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_COURTYARD \
|
||||
{ 0.3071f, 0.5700f, 0.3162f, 0.3162f, 0.6310f, 2.3200f, 0.2900f, 0.5600f, 0.2239f, 0.1400f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2900f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_FACTORY_ALCOVE \
|
||||
{ 0.3645f, 0.5900f, 0.2512f, 0.7943f, 0.5012f, 3.1400f, 0.6500f, 1.3100f, 1.4125f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.1140f, 0.1000f, 0.2500f, 0.0000f, 0.9943f, 3762.6001f, 362.5000f, 0.0000f, 0x1 }
|
||||
|
||||
/* Ice Palace Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_SMALLROOM \
|
||||
{ 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 1.5100f, 1.5300f, 0.2700f, 0.8913f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1640f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_SHORTPASSAGE \
|
||||
{ 1.0000f, 0.7500f, 0.3162f, 0.5623f, 0.2818f, 1.7900f, 1.4600f, 0.2800f, 0.5012f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_MEDIUMROOM \
|
||||
{ 1.0000f, 0.8700f, 0.3162f, 0.5623f, 0.4467f, 2.2200f, 1.5300f, 0.3200f, 0.3981f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_LARGEROOM \
|
||||
{ 1.0000f, 0.8100f, 0.3162f, 0.5623f, 0.4467f, 3.1400f, 1.5300f, 0.3200f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0270f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_LONGPASSAGE \
|
||||
{ 1.0000f, 0.7700f, 0.3162f, 0.5623f, 0.3981f, 3.0100f, 1.4600f, 0.2800f, 0.7943f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0250f, { 0.0000f, 0.0000f, 0.0000f }, 0.1860f, 0.0400f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_HALL \
|
||||
{ 1.0000f, 0.7600f, 0.3162f, 0.4467f, 0.5623f, 5.4900f, 1.5300f, 0.3800f, 0.1122f, 0.0540f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0520f, { 0.0000f, 0.0000f, 0.0000f }, 0.2260f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_CUPBOARD \
|
||||
{ 1.0000f, 0.8300f, 0.3162f, 0.5012f, 0.2239f, 0.7600f, 1.5300f, 0.2600f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1430f, 0.0800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_COURTYARD \
|
||||
{ 1.0000f, 0.5900f, 0.3162f, 0.2818f, 0.3162f, 2.0400f, 1.2000f, 0.3800f, 0.3162f, 0.1730f, { 0.0000f, 0.0000f, 0.0000f }, 0.3162f, 0.0430f, { 0.0000f, 0.0000f, 0.0000f }, 0.2350f, 0.4800f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_ICEPALACE_ALCOVE \
|
||||
{ 1.0000f, 0.8400f, 0.3162f, 0.5623f, 0.2818f, 2.7600f, 1.4600f, 0.2800f, 1.1220f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1610f, 0.0900f, 0.2500f, 0.0000f, 0.9943f, 12428.5000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
/* Space Station Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_SMALLROOM \
|
||||
{ 0.2109f, 0.7000f, 0.3162f, 0.7079f, 0.8913f, 1.7200f, 0.8200f, 0.5500f, 0.7943f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0130f, { 0.0000f, 0.0000f, 0.0000f }, 0.1880f, 0.2600f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_SHORTPASSAGE \
|
||||
{ 0.2109f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 3.5700f, 0.5000f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.1720f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_MEDIUMROOM \
|
||||
{ 0.2109f, 0.7500f, 0.3162f, 0.6310f, 0.8913f, 3.0100f, 0.5000f, 0.5500f, 0.3981f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2090f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_LARGEROOM \
|
||||
{ 0.3645f, 0.8100f, 0.3162f, 0.6310f, 0.8913f, 3.8900f, 0.3800f, 0.6100f, 0.3162f, 0.0560f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0350f, { 0.0000f, 0.0000f, 0.0000f }, 0.2330f, 0.2800f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_LONGPASSAGE \
|
||||
{ 0.4287f, 0.8200f, 0.3162f, 0.6310f, 0.8913f, 4.6200f, 0.6200f, 0.5500f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2300f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_HALL \
|
||||
{ 0.4287f, 0.8700f, 0.3162f, 0.6310f, 0.8913f, 7.1100f, 0.3800f, 0.6100f, 0.1778f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2500f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_CUPBOARD \
|
||||
{ 0.1715f, 0.5600f, 0.3162f, 0.7079f, 0.8913f, 0.7900f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.7783f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1810f, 0.3100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPACESTATION_ALCOVE \
|
||||
{ 0.2109f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.1600f, 0.8100f, 0.5500f, 1.4125f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0180f, { 0.0000f, 0.0000f, 0.0000f }, 0.1920f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 3316.1001f, 458.2000f, 0.0000f, 0x1 }
|
||||
|
||||
/* Wooden Galleon Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_SMALLROOM \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.1122f, 0.3162f, 0.7900f, 0.3200f, 0.8700f, 1.0000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_SHORTPASSAGE \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.7500f, 0.5000f, 0.8700f, 0.8913f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.6310f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_MEDIUMROOM \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.2818f, 1.4700f, 0.4200f, 0.8200f, 0.8913f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_LARGEROOM \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.2818f, 2.6500f, 0.3300f, 0.8200f, 0.8913f, 0.0660f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_LONGPASSAGE \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.1000f, 0.3162f, 1.9900f, 0.4000f, 0.7900f, 1.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.4467f, 0.0360f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_HALL \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.0794f, 0.2818f, 3.4500f, 0.3000f, 0.8200f, 0.8913f, 0.0880f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_CUPBOARD \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.1413f, 0.3162f, 0.5600f, 0.4600f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_COURTYARD \
|
||||
{ 1.0000f, 0.6500f, 0.3162f, 0.0794f, 0.3162f, 1.7900f, 0.3500f, 0.7900f, 0.5623f, 0.1230f, { 0.0000f, 0.0000f, 0.0000f }, 0.1000f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_WOODEN_ALCOVE \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.1259f, 0.3162f, 1.2200f, 0.6200f, 0.9100f, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 4705.0000f, 99.6000f, 0.0000f, 0x1 }
|
||||
|
||||
/* Sports Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_SPORT_EMPTYSTADIUM \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.4467f, 0.7943f, 6.2600f, 0.5100f, 1.1000f, 0.0631f, 0.1830f, { 0.0000f, 0.0000f, 0.0000f }, 0.3981f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPORT_SQUASHCOURT \
|
||||
{ 1.0000f, 0.7500f, 0.3162f, 0.3162f, 0.7943f, 2.2200f, 0.9100f, 1.1600f, 0.4467f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.1260f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPORT_SMALLSWIMMINGPOOL \
|
||||
{ 1.0000f, 0.7000f, 0.3162f, 0.7943f, 0.8913f, 2.7600f, 1.2500f, 1.1400f, 0.6310f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPORT_LARGESWIMMINGPOOL \
|
||||
{ 1.0000f, 0.8200f, 0.3162f, 0.7943f, 1.0000f, 5.4900f, 1.3100f, 1.1400f, 0.4467f, 0.0390f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2220f, 0.5500f, 1.1590f, 0.2100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPORT_GYMNASIUM \
|
||||
{ 1.0000f, 0.8100f, 0.3162f, 0.4467f, 0.8913f, 3.1400f, 1.0600f, 1.3500f, 0.3981f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0450f, { 0.0000f, 0.0000f, 0.0000f }, 0.1460f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPORT_FULLSTADIUM \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.0708f, 0.7943f, 5.2500f, 0.1700f, 0.8000f, 0.1000f, 0.1880f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0380f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SPORT_STADIUMTANNOY \
|
||||
{ 1.0000f, 0.7800f, 0.3162f, 0.5623f, 0.5012f, 2.5300f, 0.8800f, 0.6800f, 0.2818f, 0.2300f, { 0.0000f, 0.0000f, 0.0000f }, 0.5012f, 0.0630f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
/* Prefab Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_PREFAB_WORKSHOP \
|
||||
{ 0.4287f, 1.0000f, 0.3162f, 0.1413f, 0.3981f, 0.7600f, 1.0000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PREFAB_SCHOOLROOM \
|
||||
{ 0.4022f, 0.6900f, 0.3162f, 0.6310f, 0.5012f, 0.9800f, 0.4500f, 0.1800f, 1.4125f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PREFAB_PRACTISEROOM \
|
||||
{ 0.4022f, 0.8700f, 0.3162f, 0.3981f, 0.5012f, 1.1200f, 0.5600f, 0.1800f, 1.2589f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0110f, { 0.0000f, 0.0000f, 0.0000f }, 0.0950f, 0.1400f, 0.2500f, 0.0000f, 0.9943f, 7176.8999f, 211.2000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PREFAB_OUTHOUSE \
|
||||
{ 1.0000f, 0.8200f, 0.3162f, 0.1122f, 0.1585f, 1.3800f, 0.3800f, 0.3500f, 0.8913f, 0.0240f, { 0.0000f, 0.0000f, -0.0000f }, 0.6310f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.1210f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PREFAB_CARAVAN \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.0891f, 0.1259f, 0.4300f, 1.5000f, 1.0000f, 1.0000f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 1.9953f, 0.0120f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
/* Dome and Pipe Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_DOME_TOMB \
|
||||
{ 1.0000f, 0.7900f, 0.3162f, 0.3548f, 0.2239f, 4.1800f, 0.2100f, 0.1000f, 0.3868f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 1.6788f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.1770f, 0.1900f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PIPE_SMALL \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 5.0400f, 0.1000f, 0.1000f, 0.5012f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 2.5119f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DOME_SAINTPAULS \
|
||||
{ 1.0000f, 0.8700f, 0.3162f, 0.3548f, 0.2239f, 10.4800f, 0.1900f, 0.1000f, 0.1778f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0420f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1200f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PIPE_LONGTHIN \
|
||||
{ 0.2560f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 9.2100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PIPE_LARGE \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.3548f, 0.2239f, 8.4500f, 0.1000f, 0.1000f, 0.3981f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_PIPE_RESONANT \
|
||||
{ 0.1373f, 0.9100f, 0.3162f, 0.4467f, 0.2818f, 6.8100f, 0.1800f, 0.1000f, 0.7079f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.0000f, 0.0220f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 20.0000f, 0.0000f, 0x0 }
|
||||
|
||||
/* Outdoors Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_OUTDOORS_BACKYARD \
|
||||
{ 1.0000f, 0.4500f, 0.3162f, 0.2512f, 0.5012f, 1.1200f, 0.3400f, 0.4600f, 0.4467f, 0.0690f, { 0.0000f, 0.0000f, -0.0000f }, 0.7079f, 0.0230f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_OUTDOORS_ROLLINGPLAINS \
|
||||
{ 1.0000f, 0.0000f, 0.3162f, 0.0112f, 0.6310f, 2.1300f, 0.2100f, 0.4600f, 0.1778f, 0.3000f, { 0.0000f, 0.0000f, -0.0000f }, 0.4467f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_OUTDOORS_DEEPCANYON \
|
||||
{ 1.0000f, 0.7400f, 0.3162f, 0.1778f, 0.6310f, 3.8900f, 0.2100f, 0.4600f, 0.3162f, 0.2230f, { 0.0000f, 0.0000f, -0.0000f }, 0.3548f, 0.0190f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_OUTDOORS_CREEK \
|
||||
{ 1.0000f, 0.3500f, 0.3162f, 0.1778f, 0.5012f, 2.1300f, 0.2100f, 0.4600f, 0.3981f, 0.1150f, { 0.0000f, 0.0000f, -0.0000f }, 0.1995f, 0.0310f, { 0.0000f, 0.0000f, 0.0000f }, 0.2180f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 4399.1001f, 242.9000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_OUTDOORS_VALLEY \
|
||||
{ 1.0000f, 0.2800f, 0.3162f, 0.0282f, 0.1585f, 2.8800f, 0.2600f, 0.3500f, 0.1413f, 0.2630f, { 0.0000f, 0.0000f, -0.0000f }, 0.3981f, 0.1000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.3400f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
|
||||
|
||||
/* Mood Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_MOOD_HEAVEN \
|
||||
{ 1.0000f, 0.9400f, 0.3162f, 0.7943f, 0.4467f, 5.0400f, 1.1200f, 0.5600f, 0.2427f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0290f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0800f, 2.7420f, 0.0500f, 0.9977f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_MOOD_HELL \
|
||||
{ 1.0000f, 0.5700f, 0.3162f, 0.3548f, 0.4467f, 3.5700f, 0.4900f, 2.0000f, 0.0000f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1100f, 0.0400f, 2.1090f, 0.5200f, 0.9943f, 5000.0000f, 139.5000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_MOOD_MEMORY \
|
||||
{ 1.0000f, 0.8500f, 0.3162f, 0.6310f, 0.3548f, 4.0600f, 0.8200f, 0.5600f, 0.0398f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.1220f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.4740f, 0.4500f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
/* Driving Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_COMMENTATOR \
|
||||
{ 1.0000f, 0.0000f, 0.3162f, 0.5623f, 0.5012f, 2.4200f, 0.8800f, 0.6800f, 0.1995f, 0.0930f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0170f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 1.0000f, 0.2500f, 0.0000f, 0.9886f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_PITGARAGE \
|
||||
{ 0.4287f, 0.5900f, 0.3162f, 0.7079f, 0.5623f, 1.7200f, 0.9300f, 0.8700f, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0160f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_INCAR_RACER \
|
||||
{ 0.0832f, 0.8000f, 0.3162f, 1.0000f, 0.7943f, 0.1700f, 2.0000f, 0.4100f, 1.7783f, 0.0070f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0150f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_INCAR_SPORTS \
|
||||
{ 0.0832f, 0.8000f, 0.3162f, 0.6310f, 1.0000f, 0.1700f, 0.7500f, 0.4100f, 1.0000f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.5623f, 0.0000f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_INCAR_LUXURY \
|
||||
{ 0.2560f, 1.0000f, 0.3162f, 0.1000f, 0.5012f, 0.1300f, 0.4100f, 0.4600f, 0.7943f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 1.5849f, 0.0100f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10268.2002f, 251.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_FULLGRANDSTAND \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 0.2818f, 0.6310f, 3.0100f, 1.3700f, 1.2800f, 0.3548f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.1778f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_EMPTYGRANDSTAND \
|
||||
{ 1.0000f, 1.0000f, 0.3162f, 1.0000f, 0.7943f, 4.6200f, 1.7500f, 1.4000f, 0.2082f, 0.0900f, { 0.0000f, 0.0000f, 0.0000f }, 0.2512f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.0000f, 0.9943f, 10420.2002f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_DRIVING_TUNNEL \
|
||||
{ 1.0000f, 0.8100f, 0.3162f, 0.3981f, 0.8913f, 3.4200f, 0.9400f, 1.3100f, 0.7079f, 0.0510f, { 0.0000f, 0.0000f, 0.0000f }, 0.7079f, 0.0470f, { 0.0000f, 0.0000f, 0.0000f }, 0.2140f, 0.0500f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 155.3000f, 0.0000f, 0x1 }
|
||||
|
||||
/* City Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_CITY_STREETS \
|
||||
{ 1.0000f, 0.7800f, 0.3162f, 0.7079f, 0.8913f, 1.7900f, 1.1200f, 0.9100f, 0.2818f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 0.1995f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CITY_SUBWAY \
|
||||
{ 1.0000f, 0.7400f, 0.3162f, 0.7079f, 0.8913f, 3.0100f, 1.2300f, 0.9100f, 0.7079f, 0.0460f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0280f, { 0.0000f, 0.0000f, 0.0000f }, 0.1250f, 0.2100f, 0.2500f, 0.0000f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CITY_MUSEUM \
|
||||
{ 1.0000f, 0.8200f, 0.3162f, 0.1778f, 0.1778f, 3.2800f, 1.4000f, 0.5700f, 0.2512f, 0.0390f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0340f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CITY_LIBRARY \
|
||||
{ 1.0000f, 0.8200f, 0.3162f, 0.2818f, 0.0891f, 2.7600f, 0.8900f, 0.4100f, 0.3548f, 0.0290f, { 0.0000f, 0.0000f, -0.0000f }, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 0.1300f, 0.1700f, 0.2500f, 0.0000f, 0.9943f, 2854.3999f, 107.5000f, 0.0000f, 0x0 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CITY_UNDERPASS \
|
||||
{ 1.0000f, 0.8200f, 0.3162f, 0.4467f, 0.8913f, 3.5700f, 1.1200f, 0.9100f, 0.3981f, 0.0590f, { 0.0000f, 0.0000f, 0.0000f }, 0.8913f, 0.0370f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.1400f, 0.2500f, 0.0000f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CITY_ABANDONED \
|
||||
{ 1.0000f, 0.6900f, 0.3162f, 0.7943f, 0.8913f, 3.2800f, 1.1700f, 0.9100f, 0.4467f, 0.0440f, { 0.0000f, 0.0000f, 0.0000f }, 0.2818f, 0.0240f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.2000f, 0.2500f, 0.0000f, 0.9966f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
/* Misc. Presets */
|
||||
|
||||
#define EFX_REVERB_PRESET_DUSTYROOM \
|
||||
{ 0.3645f, 0.5600f, 0.3162f, 0.7943f, 0.7079f, 1.7900f, 0.3800f, 0.2100f, 0.5012f, 0.0020f, { 0.0000f, 0.0000f, 0.0000f }, 1.2589f, 0.0060f, { 0.0000f, 0.0000f, 0.0000f }, 0.2020f, 0.0500f, 0.2500f, 0.0000f, 0.9886f, 13046.0000f, 163.3000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_CHAPEL \
|
||||
{ 1.0000f, 0.8400f, 0.3162f, 0.5623f, 1.0000f, 4.6200f, 0.6400f, 1.2300f, 0.4467f, 0.0320f, { 0.0000f, 0.0000f, 0.0000f }, 0.7943f, 0.0490f, { 0.0000f, 0.0000f, 0.0000f }, 0.2500f, 0.0000f, 0.2500f, 0.1100f, 0.9943f, 5000.0000f, 250.0000f, 0.0000f, 0x1 }
|
||||
|
||||
#define EFX_REVERB_PRESET_SMALLWATERROOM \
|
||||
{ 1.0000f, 0.7000f, 0.3162f, 0.4477f, 1.0000f, 1.5100f, 1.2500f, 1.1400f, 0.8913f, 0.0200f, { 0.0000f, 0.0000f, 0.0000f }, 1.4125f, 0.0300f, { 0.0000f, 0.0000f, 0.0000f }, 0.1790f, 0.1500f, 0.8950f, 0.1900f, 0.9920f, 5000.0000f, 250.0000f, 0.0000f, 0x0 }
|
||||
|
||||
#endif /* EFX_PRESETS_H */
|
||||
Vendored
+761
@@ -0,0 +1,761 @@
|
||||
#ifndef AL_EFX_H
|
||||
#define AL_EFX_H
|
||||
|
||||
|
||||
#include "alc.h"
|
||||
#include "al.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ALC_EXT_EFX_NAME "ALC_EXT_EFX"
|
||||
|
||||
#define ALC_EFX_MAJOR_VERSION 0x20001
|
||||
#define ALC_EFX_MINOR_VERSION 0x20002
|
||||
#define ALC_MAX_AUXILIARY_SENDS 0x20003
|
||||
|
||||
|
||||
/* Listener properties. */
|
||||
#define AL_METERS_PER_UNIT 0x20004
|
||||
|
||||
/* Source properties. */
|
||||
#define AL_DIRECT_FILTER 0x20005
|
||||
#define AL_AUXILIARY_SEND_FILTER 0x20006
|
||||
#define AL_AIR_ABSORPTION_FACTOR 0x20007
|
||||
#define AL_ROOM_ROLLOFF_FACTOR 0x20008
|
||||
#define AL_CONE_OUTER_GAINHF 0x20009
|
||||
#define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A
|
||||
#define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B
|
||||
#define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C
|
||||
|
||||
|
||||
/* Effect properties. */
|
||||
|
||||
/* Reverb effect parameters */
|
||||
#define AL_REVERB_DENSITY 0x0001
|
||||
#define AL_REVERB_DIFFUSION 0x0002
|
||||
#define AL_REVERB_GAIN 0x0003
|
||||
#define AL_REVERB_GAINHF 0x0004
|
||||
#define AL_REVERB_DECAY_TIME 0x0005
|
||||
#define AL_REVERB_DECAY_HFRATIO 0x0006
|
||||
#define AL_REVERB_REFLECTIONS_GAIN 0x0007
|
||||
#define AL_REVERB_REFLECTIONS_DELAY 0x0008
|
||||
#define AL_REVERB_LATE_REVERB_GAIN 0x0009
|
||||
#define AL_REVERB_LATE_REVERB_DELAY 0x000A
|
||||
#define AL_REVERB_AIR_ABSORPTION_GAINHF 0x000B
|
||||
#define AL_REVERB_ROOM_ROLLOFF_FACTOR 0x000C
|
||||
#define AL_REVERB_DECAY_HFLIMIT 0x000D
|
||||
|
||||
/* EAX Reverb effect parameters */
|
||||
#define AL_EAXREVERB_DENSITY 0x0001
|
||||
#define AL_EAXREVERB_DIFFUSION 0x0002
|
||||
#define AL_EAXREVERB_GAIN 0x0003
|
||||
#define AL_EAXREVERB_GAINHF 0x0004
|
||||
#define AL_EAXREVERB_GAINLF 0x0005
|
||||
#define AL_EAXREVERB_DECAY_TIME 0x0006
|
||||
#define AL_EAXREVERB_DECAY_HFRATIO 0x0007
|
||||
#define AL_EAXREVERB_DECAY_LFRATIO 0x0008
|
||||
#define AL_EAXREVERB_REFLECTIONS_GAIN 0x0009
|
||||
#define AL_EAXREVERB_REFLECTIONS_DELAY 0x000A
|
||||
#define AL_EAXREVERB_REFLECTIONS_PAN 0x000B
|
||||
#define AL_EAXREVERB_LATE_REVERB_GAIN 0x000C
|
||||
#define AL_EAXREVERB_LATE_REVERB_DELAY 0x000D
|
||||
#define AL_EAXREVERB_LATE_REVERB_PAN 0x000E
|
||||
#define AL_EAXREVERB_ECHO_TIME 0x000F
|
||||
#define AL_EAXREVERB_ECHO_DEPTH 0x0010
|
||||
#define AL_EAXREVERB_MODULATION_TIME 0x0011
|
||||
#define AL_EAXREVERB_MODULATION_DEPTH 0x0012
|
||||
#define AL_EAXREVERB_AIR_ABSORPTION_GAINHF 0x0013
|
||||
#define AL_EAXREVERB_HFREFERENCE 0x0014
|
||||
#define AL_EAXREVERB_LFREFERENCE 0x0015
|
||||
#define AL_EAXREVERB_ROOM_ROLLOFF_FACTOR 0x0016
|
||||
#define AL_EAXREVERB_DECAY_HFLIMIT 0x0017
|
||||
|
||||
/* Chorus effect parameters */
|
||||
#define AL_CHORUS_WAVEFORM 0x0001
|
||||
#define AL_CHORUS_PHASE 0x0002
|
||||
#define AL_CHORUS_RATE 0x0003
|
||||
#define AL_CHORUS_DEPTH 0x0004
|
||||
#define AL_CHORUS_FEEDBACK 0x0005
|
||||
#define AL_CHORUS_DELAY 0x0006
|
||||
|
||||
/* Distortion effect parameters */
|
||||
#define AL_DISTORTION_EDGE 0x0001
|
||||
#define AL_DISTORTION_GAIN 0x0002
|
||||
#define AL_DISTORTION_LOWPASS_CUTOFF 0x0003
|
||||
#define AL_DISTORTION_EQCENTER 0x0004
|
||||
#define AL_DISTORTION_EQBANDWIDTH 0x0005
|
||||
|
||||
/* Echo effect parameters */
|
||||
#define AL_ECHO_DELAY 0x0001
|
||||
#define AL_ECHO_LRDELAY 0x0002
|
||||
#define AL_ECHO_DAMPING 0x0003
|
||||
#define AL_ECHO_FEEDBACK 0x0004
|
||||
#define AL_ECHO_SPREAD 0x0005
|
||||
|
||||
/* Flanger effect parameters */
|
||||
#define AL_FLANGER_WAVEFORM 0x0001
|
||||
#define AL_FLANGER_PHASE 0x0002
|
||||
#define AL_FLANGER_RATE 0x0003
|
||||
#define AL_FLANGER_DEPTH 0x0004
|
||||
#define AL_FLANGER_FEEDBACK 0x0005
|
||||
#define AL_FLANGER_DELAY 0x0006
|
||||
|
||||
/* Frequency shifter effect parameters */
|
||||
#define AL_FREQUENCY_SHIFTER_FREQUENCY 0x0001
|
||||
#define AL_FREQUENCY_SHIFTER_LEFT_DIRECTION 0x0002
|
||||
#define AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION 0x0003
|
||||
|
||||
/* Vocal morpher effect parameters */
|
||||
#define AL_VOCAL_MORPHER_PHONEMEA 0x0001
|
||||
#define AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING 0x0002
|
||||
#define AL_VOCAL_MORPHER_PHONEMEB 0x0003
|
||||
#define AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING 0x0004
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM 0x0005
|
||||
#define AL_VOCAL_MORPHER_RATE 0x0006
|
||||
|
||||
/* Pitchshifter effect parameters */
|
||||
#define AL_PITCH_SHIFTER_COARSE_TUNE 0x0001
|
||||
#define AL_PITCH_SHIFTER_FINE_TUNE 0x0002
|
||||
|
||||
/* Ringmodulator effect parameters */
|
||||
#define AL_RING_MODULATOR_FREQUENCY 0x0001
|
||||
#define AL_RING_MODULATOR_HIGHPASS_CUTOFF 0x0002
|
||||
#define AL_RING_MODULATOR_WAVEFORM 0x0003
|
||||
|
||||
/* Autowah effect parameters */
|
||||
#define AL_AUTOWAH_ATTACK_TIME 0x0001
|
||||
#define AL_AUTOWAH_RELEASE_TIME 0x0002
|
||||
#define AL_AUTOWAH_RESONANCE 0x0003
|
||||
#define AL_AUTOWAH_PEAK_GAIN 0x0004
|
||||
|
||||
/* Compressor effect parameters */
|
||||
#define AL_COMPRESSOR_ONOFF 0x0001
|
||||
|
||||
/* Equalizer effect parameters */
|
||||
#define AL_EQUALIZER_LOW_GAIN 0x0001
|
||||
#define AL_EQUALIZER_LOW_CUTOFF 0x0002
|
||||
#define AL_EQUALIZER_MID1_GAIN 0x0003
|
||||
#define AL_EQUALIZER_MID1_CENTER 0x0004
|
||||
#define AL_EQUALIZER_MID1_WIDTH 0x0005
|
||||
#define AL_EQUALIZER_MID2_GAIN 0x0006
|
||||
#define AL_EQUALIZER_MID2_CENTER 0x0007
|
||||
#define AL_EQUALIZER_MID2_WIDTH 0x0008
|
||||
#define AL_EQUALIZER_HIGH_GAIN 0x0009
|
||||
#define AL_EQUALIZER_HIGH_CUTOFF 0x000A
|
||||
|
||||
/* Effect type */
|
||||
#define AL_EFFECT_FIRST_PARAMETER 0x0000
|
||||
#define AL_EFFECT_LAST_PARAMETER 0x8000
|
||||
#define AL_EFFECT_TYPE 0x8001
|
||||
|
||||
/* Effect types, used with the AL_EFFECT_TYPE property */
|
||||
#define AL_EFFECT_NULL 0x0000
|
||||
#define AL_EFFECT_REVERB 0x0001
|
||||
#define AL_EFFECT_CHORUS 0x0002
|
||||
#define AL_EFFECT_DISTORTION 0x0003
|
||||
#define AL_EFFECT_ECHO 0x0004
|
||||
#define AL_EFFECT_FLANGER 0x0005
|
||||
#define AL_EFFECT_FREQUENCY_SHIFTER 0x0006
|
||||
#define AL_EFFECT_VOCAL_MORPHER 0x0007
|
||||
#define AL_EFFECT_PITCH_SHIFTER 0x0008
|
||||
#define AL_EFFECT_RING_MODULATOR 0x0009
|
||||
#define AL_EFFECT_AUTOWAH 0x000A
|
||||
#define AL_EFFECT_COMPRESSOR 0x000B
|
||||
#define AL_EFFECT_EQUALIZER 0x000C
|
||||
#define AL_EFFECT_EAXREVERB 0x8000
|
||||
|
||||
/* Auxiliary Effect Slot properties. */
|
||||
#define AL_EFFECTSLOT_EFFECT 0x0001
|
||||
#define AL_EFFECTSLOT_GAIN 0x0002
|
||||
#define AL_EFFECTSLOT_AUXILIARY_SEND_AUTO 0x0003
|
||||
|
||||
/* NULL Auxiliary Slot ID to disable a source send. */
|
||||
#define AL_EFFECTSLOT_NULL 0x0000
|
||||
|
||||
|
||||
/* Filter properties. */
|
||||
|
||||
/* Lowpass filter parameters */
|
||||
#define AL_LOWPASS_GAIN 0x0001
|
||||
#define AL_LOWPASS_GAINHF 0x0002
|
||||
|
||||
/* Highpass filter parameters */
|
||||
#define AL_HIGHPASS_GAIN 0x0001
|
||||
#define AL_HIGHPASS_GAINLF 0x0002
|
||||
|
||||
/* Bandpass filter parameters */
|
||||
#define AL_BANDPASS_GAIN 0x0001
|
||||
#define AL_BANDPASS_GAINLF 0x0002
|
||||
#define AL_BANDPASS_GAINHF 0x0003
|
||||
|
||||
/* Filter type */
|
||||
#define AL_FILTER_FIRST_PARAMETER 0x0000
|
||||
#define AL_FILTER_LAST_PARAMETER 0x8000
|
||||
#define AL_FILTER_TYPE 0x8001
|
||||
|
||||
/* Filter types, used with the AL_FILTER_TYPE property */
|
||||
#define AL_FILTER_NULL 0x0000
|
||||
#define AL_FILTER_LOWPASS 0x0001
|
||||
#define AL_FILTER_HIGHPASS 0x0002
|
||||
#define AL_FILTER_BANDPASS 0x0003
|
||||
|
||||
|
||||
/* Effect object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENEFFECTS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEEFFECTS)(ALsizei, const ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISEFFECT)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTIV)(ALuint, ALenum, const ALint*);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALEFFECTFV)(ALuint, ALenum, const ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETEFFECTFV)(ALuint, ALenum, ALfloat*);
|
||||
|
||||
/* Filter object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENFILTERS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEFILTERS)(ALsizei, const ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISFILTER)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALFILTERI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALFILTERIV)(ALuint, ALenum, const ALint*);
|
||||
typedef void (AL_APIENTRY *LPALFILTERF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALFILTERFV)(ALuint, ALenum, const ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETFILTERFV)(ALuint, ALenum, ALfloat*);
|
||||
|
||||
/* Auxiliary Effect Slot object function types. */
|
||||
typedef void (AL_APIENTRY *LPALGENAUXILIARYEFFECTSLOTS)(ALsizei, ALuint*);
|
||||
typedef void (AL_APIENTRY *LPALDELETEAUXILIARYEFFECTSLOTS)(ALsizei, const ALuint*);
|
||||
typedef ALboolean (AL_APIENTRY *LPALISAUXILIARYEFFECTSLOT)(ALuint);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, const ALint*);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat);
|
||||
typedef void (AL_APIENTRY *LPALAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, const ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTI)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTIV)(ALuint, ALenum, ALint*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat*);
|
||||
typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*);
|
||||
|
||||
#ifdef AL_ALEXT_PROTOTYPES
|
||||
AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects);
|
||||
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect);
|
||||
AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues);
|
||||
|
||||
AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters);
|
||||
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter);
|
||||
AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues);
|
||||
|
||||
AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots);
|
||||
AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots);
|
||||
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue);
|
||||
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue);
|
||||
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues);
|
||||
#endif
|
||||
|
||||
/* Filter ranges and defaults. */
|
||||
|
||||
/* Lowpass filter */
|
||||
#define AL_LOWPASS_MIN_GAIN (0.0f)
|
||||
#define AL_LOWPASS_MAX_GAIN (1.0f)
|
||||
#define AL_LOWPASS_DEFAULT_GAIN (1.0f)
|
||||
|
||||
#define AL_LOWPASS_MIN_GAINHF (0.0f)
|
||||
#define AL_LOWPASS_MAX_GAINHF (1.0f)
|
||||
#define AL_LOWPASS_DEFAULT_GAINHF (1.0f)
|
||||
|
||||
/* Highpass filter */
|
||||
#define AL_HIGHPASS_MIN_GAIN (0.0f)
|
||||
#define AL_HIGHPASS_MAX_GAIN (1.0f)
|
||||
#define AL_HIGHPASS_DEFAULT_GAIN (1.0f)
|
||||
|
||||
#define AL_HIGHPASS_MIN_GAINLF (0.0f)
|
||||
#define AL_HIGHPASS_MAX_GAINLF (1.0f)
|
||||
#define AL_HIGHPASS_DEFAULT_GAINLF (1.0f)
|
||||
|
||||
/* Bandpass filter */
|
||||
#define AL_BANDPASS_MIN_GAIN (0.0f)
|
||||
#define AL_BANDPASS_MAX_GAIN (1.0f)
|
||||
#define AL_BANDPASS_DEFAULT_GAIN (1.0f)
|
||||
|
||||
#define AL_BANDPASS_MIN_GAINHF (0.0f)
|
||||
#define AL_BANDPASS_MAX_GAINHF (1.0f)
|
||||
#define AL_BANDPASS_DEFAULT_GAINHF (1.0f)
|
||||
|
||||
#define AL_BANDPASS_MIN_GAINLF (0.0f)
|
||||
#define AL_BANDPASS_MAX_GAINLF (1.0f)
|
||||
#define AL_BANDPASS_DEFAULT_GAINLF (1.0f)
|
||||
|
||||
|
||||
/* Effect parameter ranges and defaults. */
|
||||
|
||||
/* Standard reverb effect */
|
||||
#define AL_REVERB_MIN_DENSITY (0.0f)
|
||||
#define AL_REVERB_MAX_DENSITY (1.0f)
|
||||
#define AL_REVERB_DEFAULT_DENSITY (1.0f)
|
||||
|
||||
#define AL_REVERB_MIN_DIFFUSION (0.0f)
|
||||
#define AL_REVERB_MAX_DIFFUSION (1.0f)
|
||||
#define AL_REVERB_DEFAULT_DIFFUSION (1.0f)
|
||||
|
||||
#define AL_REVERB_MIN_GAIN (0.0f)
|
||||
#define AL_REVERB_MAX_GAIN (1.0f)
|
||||
#define AL_REVERB_DEFAULT_GAIN (0.32f)
|
||||
|
||||
#define AL_REVERB_MIN_GAINHF (0.0f)
|
||||
#define AL_REVERB_MAX_GAINHF (1.0f)
|
||||
#define AL_REVERB_DEFAULT_GAINHF (0.89f)
|
||||
|
||||
#define AL_REVERB_MIN_DECAY_TIME (0.1f)
|
||||
#define AL_REVERB_MAX_DECAY_TIME (20.0f)
|
||||
#define AL_REVERB_DEFAULT_DECAY_TIME (1.49f)
|
||||
|
||||
#define AL_REVERB_MIN_DECAY_HFRATIO (0.1f)
|
||||
#define AL_REVERB_MAX_DECAY_HFRATIO (2.0f)
|
||||
#define AL_REVERB_DEFAULT_DECAY_HFRATIO (0.83f)
|
||||
|
||||
#define AL_REVERB_MIN_REFLECTIONS_GAIN (0.0f)
|
||||
#define AL_REVERB_MAX_REFLECTIONS_GAIN (3.16f)
|
||||
#define AL_REVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
|
||||
|
||||
#define AL_REVERB_MIN_REFLECTIONS_DELAY (0.0f)
|
||||
#define AL_REVERB_MAX_REFLECTIONS_DELAY (0.3f)
|
||||
#define AL_REVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
|
||||
|
||||
#define AL_REVERB_MIN_LATE_REVERB_GAIN (0.0f)
|
||||
#define AL_REVERB_MAX_LATE_REVERB_GAIN (10.0f)
|
||||
#define AL_REVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
|
||||
|
||||
#define AL_REVERB_MIN_LATE_REVERB_DELAY (0.0f)
|
||||
#define AL_REVERB_MAX_LATE_REVERB_DELAY (0.1f)
|
||||
#define AL_REVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
|
||||
|
||||
#define AL_REVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
|
||||
#define AL_REVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
|
||||
#define AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
|
||||
|
||||
#define AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
#define AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
|
||||
#define AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
|
||||
#define AL_REVERB_MIN_DECAY_HFLIMIT AL_FALSE
|
||||
#define AL_REVERB_MAX_DECAY_HFLIMIT AL_TRUE
|
||||
#define AL_REVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE
|
||||
|
||||
/* EAX reverb effect */
|
||||
#define AL_EAXREVERB_MIN_DENSITY (0.0f)
|
||||
#define AL_EAXREVERB_MAX_DENSITY (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DENSITY (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DIFFUSION (0.0f)
|
||||
#define AL_EAXREVERB_MAX_DIFFUSION (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DIFFUSION (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_GAIN (0.0f)
|
||||
#define AL_EAXREVERB_MAX_GAIN (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_GAIN (0.32f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_GAINHF (0.0f)
|
||||
#define AL_EAXREVERB_MAX_GAINHF (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_GAINHF (0.89f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_GAINLF (0.0f)
|
||||
#define AL_EAXREVERB_MAX_GAINLF (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_GAINLF (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_TIME (0.1f)
|
||||
#define AL_EAXREVERB_MAX_DECAY_TIME (20.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_TIME (1.49f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_HFRATIO (0.1f)
|
||||
#define AL_EAXREVERB_MAX_DECAY_HFRATIO (2.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_HFRATIO (0.83f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_LFRATIO (0.1f)
|
||||
#define AL_EAXREVERB_MAX_DECAY_LFRATIO (2.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_LFRATIO (1.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_REFLECTIONS_GAIN (0.0f)
|
||||
#define AL_EAXREVERB_MAX_REFLECTIONS_GAIN (3.16f)
|
||||
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN (0.05f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_REFLECTIONS_DELAY (0.0f)
|
||||
#define AL_EAXREVERB_MAX_REFLECTIONS_DELAY (0.3f)
|
||||
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY (0.007f)
|
||||
|
||||
#define AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_LATE_REVERB_GAIN (0.0f)
|
||||
#define AL_EAXREVERB_MAX_LATE_REVERB_GAIN (10.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN (1.26f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_LATE_REVERB_DELAY (0.0f)
|
||||
#define AL_EAXREVERB_MAX_LATE_REVERB_DELAY (0.1f)
|
||||
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY (0.011f)
|
||||
|
||||
#define AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_ECHO_TIME (0.075f)
|
||||
#define AL_EAXREVERB_MAX_ECHO_TIME (0.25f)
|
||||
#define AL_EAXREVERB_DEFAULT_ECHO_TIME (0.25f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_ECHO_DEPTH (0.0f)
|
||||
#define AL_EAXREVERB_MAX_ECHO_DEPTH (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_ECHO_DEPTH (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_MODULATION_TIME (0.04f)
|
||||
#define AL_EAXREVERB_MAX_MODULATION_TIME (4.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_MODULATION_TIME (0.25f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_MODULATION_DEPTH (0.0f)
|
||||
#define AL_EAXREVERB_MAX_MODULATION_DEPTH (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_MODULATION_DEPTH (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF (0.892f)
|
||||
#define AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF (1.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF (0.994f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_HFREFERENCE (1000.0f)
|
||||
#define AL_EAXREVERB_MAX_HFREFERENCE (20000.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_HFREFERENCE (5000.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_LFREFERENCE (20.0f)
|
||||
#define AL_EAXREVERB_MAX_LFREFERENCE (1000.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_LFREFERENCE (250.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
#define AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
|
||||
#define AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
|
||||
#define AL_EAXREVERB_MIN_DECAY_HFLIMIT AL_FALSE
|
||||
#define AL_EAXREVERB_MAX_DECAY_HFLIMIT AL_TRUE
|
||||
#define AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT AL_TRUE
|
||||
|
||||
/* Chorus effect */
|
||||
#define AL_CHORUS_WAVEFORM_SINUSOID (0)
|
||||
#define AL_CHORUS_WAVEFORM_TRIANGLE (1)
|
||||
|
||||
#define AL_CHORUS_MIN_WAVEFORM (0)
|
||||
#define AL_CHORUS_MAX_WAVEFORM (1)
|
||||
#define AL_CHORUS_DEFAULT_WAVEFORM (1)
|
||||
|
||||
#define AL_CHORUS_MIN_PHASE (-180)
|
||||
#define AL_CHORUS_MAX_PHASE (180)
|
||||
#define AL_CHORUS_DEFAULT_PHASE (90)
|
||||
|
||||
#define AL_CHORUS_MIN_RATE (0.0f)
|
||||
#define AL_CHORUS_MAX_RATE (10.0f)
|
||||
#define AL_CHORUS_DEFAULT_RATE (1.1f)
|
||||
|
||||
#define AL_CHORUS_MIN_DEPTH (0.0f)
|
||||
#define AL_CHORUS_MAX_DEPTH (1.0f)
|
||||
#define AL_CHORUS_DEFAULT_DEPTH (0.1f)
|
||||
|
||||
#define AL_CHORUS_MIN_FEEDBACK (-1.0f)
|
||||
#define AL_CHORUS_MAX_FEEDBACK (1.0f)
|
||||
#define AL_CHORUS_DEFAULT_FEEDBACK (0.25f)
|
||||
|
||||
#define AL_CHORUS_MIN_DELAY (0.0f)
|
||||
#define AL_CHORUS_MAX_DELAY (0.016f)
|
||||
#define AL_CHORUS_DEFAULT_DELAY (0.016f)
|
||||
|
||||
/* Distortion effect */
|
||||
#define AL_DISTORTION_MIN_EDGE (0.0f)
|
||||
#define AL_DISTORTION_MAX_EDGE (1.0f)
|
||||
#define AL_DISTORTION_DEFAULT_EDGE (0.2f)
|
||||
|
||||
#define AL_DISTORTION_MIN_GAIN (0.01f)
|
||||
#define AL_DISTORTION_MAX_GAIN (1.0f)
|
||||
#define AL_DISTORTION_DEFAULT_GAIN (0.05f)
|
||||
|
||||
#define AL_DISTORTION_MIN_LOWPASS_CUTOFF (80.0f)
|
||||
#define AL_DISTORTION_MAX_LOWPASS_CUTOFF (24000.0f)
|
||||
#define AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF (8000.0f)
|
||||
|
||||
#define AL_DISTORTION_MIN_EQCENTER (80.0f)
|
||||
#define AL_DISTORTION_MAX_EQCENTER (24000.0f)
|
||||
#define AL_DISTORTION_DEFAULT_EQCENTER (3600.0f)
|
||||
|
||||
#define AL_DISTORTION_MIN_EQBANDWIDTH (80.0f)
|
||||
#define AL_DISTORTION_MAX_EQBANDWIDTH (24000.0f)
|
||||
#define AL_DISTORTION_DEFAULT_EQBANDWIDTH (3600.0f)
|
||||
|
||||
/* Echo effect */
|
||||
#define AL_ECHO_MIN_DELAY (0.0f)
|
||||
#define AL_ECHO_MAX_DELAY (0.207f)
|
||||
#define AL_ECHO_DEFAULT_DELAY (0.1f)
|
||||
|
||||
#define AL_ECHO_MIN_LRDELAY (0.0f)
|
||||
#define AL_ECHO_MAX_LRDELAY (0.404f)
|
||||
#define AL_ECHO_DEFAULT_LRDELAY (0.1f)
|
||||
|
||||
#define AL_ECHO_MIN_DAMPING (0.0f)
|
||||
#define AL_ECHO_MAX_DAMPING (0.99f)
|
||||
#define AL_ECHO_DEFAULT_DAMPING (0.5f)
|
||||
|
||||
#define AL_ECHO_MIN_FEEDBACK (0.0f)
|
||||
#define AL_ECHO_MAX_FEEDBACK (1.0f)
|
||||
#define AL_ECHO_DEFAULT_FEEDBACK (0.5f)
|
||||
|
||||
#define AL_ECHO_MIN_SPREAD (-1.0f)
|
||||
#define AL_ECHO_MAX_SPREAD (1.0f)
|
||||
#define AL_ECHO_DEFAULT_SPREAD (-1.0f)
|
||||
|
||||
/* Flanger effect */
|
||||
#define AL_FLANGER_WAVEFORM_SINUSOID (0)
|
||||
#define AL_FLANGER_WAVEFORM_TRIANGLE (1)
|
||||
|
||||
#define AL_FLANGER_MIN_WAVEFORM (0)
|
||||
#define AL_FLANGER_MAX_WAVEFORM (1)
|
||||
#define AL_FLANGER_DEFAULT_WAVEFORM (1)
|
||||
|
||||
#define AL_FLANGER_MIN_PHASE (-180)
|
||||
#define AL_FLANGER_MAX_PHASE (180)
|
||||
#define AL_FLANGER_DEFAULT_PHASE (0)
|
||||
|
||||
#define AL_FLANGER_MIN_RATE (0.0f)
|
||||
#define AL_FLANGER_MAX_RATE (10.0f)
|
||||
#define AL_FLANGER_DEFAULT_RATE (0.27f)
|
||||
|
||||
#define AL_FLANGER_MIN_DEPTH (0.0f)
|
||||
#define AL_FLANGER_MAX_DEPTH (1.0f)
|
||||
#define AL_FLANGER_DEFAULT_DEPTH (1.0f)
|
||||
|
||||
#define AL_FLANGER_MIN_FEEDBACK (-1.0f)
|
||||
#define AL_FLANGER_MAX_FEEDBACK (1.0f)
|
||||
#define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f)
|
||||
|
||||
#define AL_FLANGER_MIN_DELAY (0.0f)
|
||||
#define AL_FLANGER_MAX_DELAY (0.004f)
|
||||
#define AL_FLANGER_DEFAULT_DELAY (0.002f)
|
||||
|
||||
/* Frequency shifter effect */
|
||||
#define AL_FREQUENCY_SHIFTER_MIN_FREQUENCY (0.0f)
|
||||
#define AL_FREQUENCY_SHIFTER_MAX_FREQUENCY (24000.0f)
|
||||
#define AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY (0.0f)
|
||||
|
||||
#define AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION (0)
|
||||
#define AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION (2)
|
||||
#define AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION (0)
|
||||
|
||||
#define AL_FREQUENCY_SHIFTER_DIRECTION_DOWN (0)
|
||||
#define AL_FREQUENCY_SHIFTER_DIRECTION_UP (1)
|
||||
#define AL_FREQUENCY_SHIFTER_DIRECTION_OFF (2)
|
||||
|
||||
#define AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION (0)
|
||||
#define AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION (2)
|
||||
#define AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION (0)
|
||||
|
||||
/* Vocal morpher effect */
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEA (0)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEA (29)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING (-24)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING (24)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEB (0)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEB (29)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB (10)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING (-24)
|
||||
#define AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING (24)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_PHONEME_A (0)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_E (1)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_I (2)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_O (3)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_U (4)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AA (5)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AE (6)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AH (7)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_AO (8)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_EH (9)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_ER (10)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_IH (11)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_IY (12)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_UH (13)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_UW (14)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_B (15)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_D (16)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_F (17)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_G (18)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_J (19)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_K (20)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_L (21)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_M (22)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_N (23)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_P (24)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_R (25)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_S (26)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_T (27)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_V (28)
|
||||
#define AL_VOCAL_MORPHER_PHONEME_Z (29)
|
||||
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM_SINUSOID (0)
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE (1)
|
||||
#define AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH (2)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_WAVEFORM (0)
|
||||
#define AL_VOCAL_MORPHER_MAX_WAVEFORM (2)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_WAVEFORM (0)
|
||||
|
||||
#define AL_VOCAL_MORPHER_MIN_RATE (0.0f)
|
||||
#define AL_VOCAL_MORPHER_MAX_RATE (10.0f)
|
||||
#define AL_VOCAL_MORPHER_DEFAULT_RATE (1.41f)
|
||||
|
||||
/* Pitch shifter effect */
|
||||
#define AL_PITCH_SHIFTER_MIN_COARSE_TUNE (-12)
|
||||
#define AL_PITCH_SHIFTER_MAX_COARSE_TUNE (12)
|
||||
#define AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE (12)
|
||||
|
||||
#define AL_PITCH_SHIFTER_MIN_FINE_TUNE (-50)
|
||||
#define AL_PITCH_SHIFTER_MAX_FINE_TUNE (50)
|
||||
#define AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE (0)
|
||||
|
||||
/* Ring modulator effect */
|
||||
#define AL_RING_MODULATOR_MIN_FREQUENCY (0.0f)
|
||||
#define AL_RING_MODULATOR_MAX_FREQUENCY (8000.0f)
|
||||
#define AL_RING_MODULATOR_DEFAULT_FREQUENCY (440.0f)
|
||||
|
||||
#define AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF (0.0f)
|
||||
#define AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF (24000.0f)
|
||||
#define AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF (800.0f)
|
||||
|
||||
#define AL_RING_MODULATOR_SINUSOID (0)
|
||||
#define AL_RING_MODULATOR_SAWTOOTH (1)
|
||||
#define AL_RING_MODULATOR_SQUARE (2)
|
||||
|
||||
#define AL_RING_MODULATOR_MIN_WAVEFORM (0)
|
||||
#define AL_RING_MODULATOR_MAX_WAVEFORM (2)
|
||||
#define AL_RING_MODULATOR_DEFAULT_WAVEFORM (0)
|
||||
|
||||
/* Autowah effect */
|
||||
#define AL_AUTOWAH_MIN_ATTACK_TIME (0.0001f)
|
||||
#define AL_AUTOWAH_MAX_ATTACK_TIME (1.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_ATTACK_TIME (0.06f)
|
||||
|
||||
#define AL_AUTOWAH_MIN_RELEASE_TIME (0.0001f)
|
||||
#define AL_AUTOWAH_MAX_RELEASE_TIME (1.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_RELEASE_TIME (0.06f)
|
||||
|
||||
#define AL_AUTOWAH_MIN_RESONANCE (2.0f)
|
||||
#define AL_AUTOWAH_MAX_RESONANCE (1000.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_RESONANCE (1000.0f)
|
||||
|
||||
#define AL_AUTOWAH_MIN_PEAK_GAIN (0.00003f)
|
||||
#define AL_AUTOWAH_MAX_PEAK_GAIN (31621.0f)
|
||||
#define AL_AUTOWAH_DEFAULT_PEAK_GAIN (11.22f)
|
||||
|
||||
/* Compressor effect */
|
||||
#define AL_COMPRESSOR_MIN_ONOFF (0)
|
||||
#define AL_COMPRESSOR_MAX_ONOFF (1)
|
||||
#define AL_COMPRESSOR_DEFAULT_ONOFF (1)
|
||||
|
||||
/* Equalizer effect */
|
||||
#define AL_EQUALIZER_MIN_LOW_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_LOW_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_LOW_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_LOW_CUTOFF (50.0f)
|
||||
#define AL_EQUALIZER_MAX_LOW_CUTOFF (800.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_LOW_CUTOFF (200.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID1_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_MID1_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID1_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID1_CENTER (200.0f)
|
||||
#define AL_EQUALIZER_MAX_MID1_CENTER (3000.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID1_CENTER (500.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID1_WIDTH (0.01f)
|
||||
#define AL_EQUALIZER_MAX_MID1_WIDTH (1.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID1_WIDTH (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID2_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_MID2_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID2_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID2_CENTER (1000.0f)
|
||||
#define AL_EQUALIZER_MAX_MID2_CENTER (8000.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID2_CENTER (3000.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_MID2_WIDTH (0.01f)
|
||||
#define AL_EQUALIZER_MAX_MID2_WIDTH (1.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_MID2_WIDTH (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_HIGH_GAIN (0.126f)
|
||||
#define AL_EQUALIZER_MAX_HIGH_GAIN (7.943f)
|
||||
#define AL_EQUALIZER_DEFAULT_HIGH_GAIN (1.0f)
|
||||
|
||||
#define AL_EQUALIZER_MIN_HIGH_CUTOFF (4000.0f)
|
||||
#define AL_EQUALIZER_MAX_HIGH_CUTOFF (16000.0f)
|
||||
#define AL_EQUALIZER_DEFAULT_HIGH_CUTOFF (6000.0f)
|
||||
|
||||
|
||||
/* Source parameter value ranges and defaults. */
|
||||
#define AL_MIN_AIR_ABSORPTION_FACTOR (0.0f)
|
||||
#define AL_MAX_AIR_ABSORPTION_FACTOR (10.0f)
|
||||
#define AL_DEFAULT_AIR_ABSORPTION_FACTOR (0.0f)
|
||||
|
||||
#define AL_MIN_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
#define AL_MAX_ROOM_ROLLOFF_FACTOR (10.0f)
|
||||
#define AL_DEFAULT_ROOM_ROLLOFF_FACTOR (0.0f)
|
||||
|
||||
#define AL_MIN_CONE_OUTER_GAINHF (0.0f)
|
||||
#define AL_MAX_CONE_OUTER_GAINHF (1.0f)
|
||||
#define AL_DEFAULT_CONE_OUTER_GAINHF (1.0f)
|
||||
|
||||
#define AL_MIN_DIRECT_FILTER_GAINHF_AUTO AL_FALSE
|
||||
#define AL_MAX_DIRECT_FILTER_GAINHF_AUTO AL_TRUE
|
||||
#define AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO AL_TRUE
|
||||
|
||||
#define AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_FALSE
|
||||
#define AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE
|
||||
#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO AL_TRUE
|
||||
|
||||
#define AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_FALSE
|
||||
#define AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE
|
||||
#define AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO AL_TRUE
|
||||
|
||||
|
||||
/* Listener parameter value ranges and defaults. */
|
||||
#define AL_MIN_METERS_PER_UNIT FLT_MIN
|
||||
#define AL_MAX_METERS_PER_UNIT FLT_MAX
|
||||
#define AL_DEFAULT_METERS_PER_UNIT (1.0f)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* AL_EFX_H */
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Executable → Regular
+117
-40
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <Sound/CCollisionSound.h>
|
||||
|
||||
#include "ResourceManager.h"
|
||||
#include "OBJ.h"
|
||||
@@ -36,17 +37,23 @@
|
||||
#include "CTemplate.h"
|
||||
#include "Rendering/CPointLight.h"
|
||||
#include "Transform/TransformSystem.h"
|
||||
#include "Sound/SoundSystem.h"
|
||||
#include "Sound/CCollisionSound.h"
|
||||
#include "Game/LevelSystem.h"
|
||||
#include "Game/PadSystem.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CBrick.h"
|
||||
#include "Game/CPad.h"
|
||||
#include "Game/CBrick.h"
|
||||
#include "Game/BallSystem.h"
|
||||
#include "Game/Bricks/CPowerUpBrick.h"
|
||||
|
||||
#include "Physics/PhysicsSystem.h"
|
||||
#include "Physics/CPhysics.h"
|
||||
#include "Physics/CBoxShape.h"
|
||||
#include "Physics/ESetImpulse.h"
|
||||
|
||||
#include "Core/EKeyDown.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
@@ -58,18 +65,27 @@ public:
|
||||
|
||||
m_Renderer = std::make_shared<Renderer>();
|
||||
m_Renderer->SetFullscreen(false);
|
||||
m_Renderer->SetResolution(Rectangle(0, 0, 1920, 1080));
|
||||
m_Renderer->Initialize();
|
||||
//m_Renderer->SetResolution(Rectangle(0, 0, 1920, 1080));
|
||||
m_Renderer->SetResolution(Rectangle(0, 0, 675, 1080));
|
||||
m_Renderer->Initialize();
|
||||
|
||||
m_InputManager = std::make_shared<InputManager>(m_Renderer->Window(), m_EventBroker);
|
||||
|
||||
m_World = std::make_shared<World>(m_EventBroker);
|
||||
m_World = std::make_shared<World>(m_EventBroker);
|
||||
|
||||
|
||||
|
||||
//TODO: Move this out of engine.h
|
||||
m_World->ComponentFactory.Register<Components::Transform>();
|
||||
m_World->SystemFactory.Register<Systems::TransformSystem>(
|
||||
[this]() { return new Systems::TransformSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::TransformSystem>();
|
||||
m_World->ComponentFactory.Register<Components::Model>();
|
||||
m_World->ComponentFactory.Register<Components::Template>();
|
||||
|
||||
m_World->ComponentFactory.Register<Components::CollisionSound>();
|
||||
m_World->SystemFactory.Register<Systems::SoundSystem>([this]() { return new Systems::SoundSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::SoundSystem>();
|
||||
|
||||
m_World->ComponentFactory.Register<Components::Sprite>();
|
||||
|
||||
@@ -79,6 +95,10 @@ public:
|
||||
m_World->ComponentFactory.Register<Components::Brick>();
|
||||
m_World->ComponentFactory.Register<Components::Pad>();
|
||||
m_World->ComponentFactory.Register<Components::Life>();
|
||||
|
||||
m_World->ComponentFactory.Register<Components::PowerUp>();
|
||||
m_World->ComponentFactory.Register<Components::PowerUpBrick>();
|
||||
|
||||
m_World->SystemFactory.Register<Systems::PhysicsSystem>(
|
||||
[this]() { return new Systems::PhysicsSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::PhysicsSystem>();
|
||||
@@ -87,6 +107,8 @@ public:
|
||||
m_World->AddSystem<Systems::LevelSystem>();
|
||||
m_World->SystemFactory.Register<Systems::PadSystem>([this]() { return new Systems::PadSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::PadSystem>();
|
||||
m_World->SystemFactory.Register<Systems::BallSystem>([this]() { return new Systems::BallSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::BallSystem>();
|
||||
|
||||
m_World->ComponentFactory.Register<Components::Model>();
|
||||
m_World->ComponentFactory.Register<Components::Template>();
|
||||
@@ -102,15 +124,16 @@ public:
|
||||
{
|
||||
auto ent = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(0.5f, 0.f, -9.9f);
|
||||
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
|
||||
transform->Position = glm::vec3(-0.f, 0.26f, -10.f);
|
||||
transform->Scale = glm::vec3(0.5f, 0.5f, 0.5f);
|
||||
transform->Velocity = glm::vec3(0.0f, -10.f, 0.f);
|
||||
|
||||
auto model = m_World->AddComponent<Components::Model>(ent);
|
||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||
|
||||
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
||||
std::shared_ptr<Components::Ball> ball = m_World->AddComponent<Components::Ball>(ent);
|
||||
|
||||
ball->Speed = 10.f;
|
||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = false;
|
||||
|
||||
@@ -119,11 +142,7 @@ public:
|
||||
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
Events::SetImpulse e;
|
||||
e.Entity = ent;
|
||||
e.Impulse = glm::vec2(0.f, -7.f);
|
||||
e.Point = glm::vec2(0.5f, 0.f);
|
||||
m_EventBroker->Publish(e);
|
||||
|
||||
}
|
||||
|
||||
//PointLightTest
|
||||
@@ -139,32 +158,20 @@ public:
|
||||
{
|
||||
auto t_halfPipe = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_halfPipe);
|
||||
transform->Position = glm::vec3(0.f, 0.f, -15.f);
|
||||
transform->Scale = glm::vec3(15.f);
|
||||
transform->Position = glm::vec3(0.f, 0.f, -13.f);
|
||||
transform->Scale = glm::vec3(5.f);
|
||||
auto model = m_World->AddComponent<Components::Model>(t_halfPipe);
|
||||
model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj";
|
||||
}
|
||||
|
||||
//Brick test model
|
||||
{
|
||||
auto t_Brick = m_World->CreateEntity();
|
||||
auto transform = m_World->AddComponent<Components::Transform>(t_Brick);
|
||||
transform->Position = glm::vec3(0.f, 0.f, -12.f);
|
||||
transform->Orientation = glm::rotate(glm::quat(), 0.5f, glm::vec3(0,-1,-1));
|
||||
auto model = m_World->AddComponent<Components::Model>(t_Brick);
|
||||
model->ModelFile = "Models/Test/Brick/Brick.obj";
|
||||
|
||||
}
|
||||
|
||||
// Top Wall
|
||||
{
|
||||
auto topWall = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(topWall);
|
||||
transform->Position = glm::vec3(0.f, 6.f, -10.f);
|
||||
transform->Scale = glm::vec3(18.f, 0.5f, 1.f);
|
||||
transform->Scale = glm::vec3(20.f, 0.5f, 1.f);
|
||||
|
||||
//std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(topWall);
|
||||
//sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(topWall);
|
||||
sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
|
||||
std::shared_ptr<Components::RectangleShape> boxShape = m_World->AddComponent<Components::RectangleShape>(topWall);
|
||||
|
||||
@@ -173,15 +180,14 @@ public:
|
||||
|
||||
m_World->CommitEntity(topWall);
|
||||
}
|
||||
// Left Wall
|
||||
{
|
||||
auto leftWall = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(leftWall);
|
||||
transform->Position = glm::vec3(-9.f, 1.f, -10.f);
|
||||
transform->Scale = glm::vec3(0.5f, 10.f, 1.f);
|
||||
transform->Position = glm::vec3(-4.f, 1.f, -10.f);
|
||||
transform->Scale = glm::vec3(0.5f, 20.f, 1.f);
|
||||
|
||||
//std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(leftWall);
|
||||
//sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(leftWall);
|
||||
sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
|
||||
std::shared_ptr<Components::RectangleShape> boxShape = m_World->AddComponent<Components::RectangleShape>(leftWall);
|
||||
|
||||
@@ -190,15 +196,14 @@ public:
|
||||
|
||||
m_World->CommitEntity(leftWall);
|
||||
}
|
||||
// Right Wall.
|
||||
{
|
||||
auto rightWall = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(rightWall);
|
||||
transform->Position = glm::vec3(9.f, 1.f, -10.f);
|
||||
transform->Scale = glm::vec3(0.5f, 10.f, 1.f);
|
||||
transform->Position = glm::vec3(4.f, 1.f, -10.f);
|
||||
transform->Scale = glm::vec3(0.5f, 20.f, 1.f);
|
||||
|
||||
//std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(rightWall);
|
||||
//sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(rightWall);
|
||||
sprite->SpriteFile = "Textures/Core/ErrorTexture.png";
|
||||
|
||||
std::shared_ptr<Components::RectangleShape> boxShape = m_World->AddComponent<Components::RectangleShape>(rightWall);
|
||||
|
||||
@@ -213,15 +218,19 @@ public:
|
||||
m_World->SetProperty(ent, "Name", "Pad");
|
||||
auto ctransform = m_World->AddComponent<Components::Transform>(ent);
|
||||
ctransform->Position = glm::vec3(0.f, -5.f, -10.f);
|
||||
ctransform->Scale = glm::vec3(3.2, 0.8, 0.);
|
||||
ctransform->Scale = glm::vec3(1.6, 0.4, 0.);
|
||||
auto rectangle = m_World->AddComponent<Components::RectangleShape>(ent);
|
||||
auto physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = false;
|
||||
auto csprite = m_World->AddComponent<Components::Sprite>(ent);
|
||||
auto pad = m_World->AddComponent<Components::Pad>(ent);
|
||||
csprite->SpriteFile = "Textures/Pad.png";
|
||||
m_World->CommitEntity(ent);
|
||||
}
|
||||
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EStopSound, &SoundSystem::OnStopSound);
|
||||
m_EKeyDown = decltype(m_EKeyDown)(std::bind(&Engine::OnKeyDown, this, std::placeholders::_1));
|
||||
m_EventBroker->Subscribe(m_EKeyDown);
|
||||
m_LastTime = glfwGetTime();
|
||||
}
|
||||
|
||||
@@ -233,12 +242,24 @@ public:
|
||||
double dt = currentTime - m_LastTime;
|
||||
m_LastTime = currentTime;
|
||||
|
||||
double start = glfwGetTime();
|
||||
ResourceManager::Update();
|
||||
double stop = glfwGetTime();
|
||||
double time = stop - start;
|
||||
tm.resourceManagerT += time;
|
||||
|
||||
// Update input
|
||||
start = glfwGetTime();
|
||||
m_InputManager->Update(dt);
|
||||
stop = glfwGetTime();
|
||||
time = stop - start;
|
||||
tm.inputManagerT += time;
|
||||
|
||||
start = glfwGetTime();
|
||||
m_World->Update(dt);
|
||||
stop = glfwGetTime();
|
||||
time = stop - start;
|
||||
tm.worldT += time;
|
||||
|
||||
|
||||
//
|
||||
@@ -258,11 +279,21 @@ public:
|
||||
}
|
||||
|
||||
//TODO Fill up the renderQueue with models (Temp fix)
|
||||
start = glfwGetTime();
|
||||
TEMPAddToRenderQueue();
|
||||
stop = glfwGetTime();
|
||||
time = stop - start;
|
||||
tm.addToRenderQueueT += time;
|
||||
|
||||
// Render scene
|
||||
//TODO send renderqueue to draw.
|
||||
start = glfwGetTime();
|
||||
m_Renderer->Draw(m_RendererQueue);
|
||||
stop = glfwGetTime();
|
||||
time = stop - start;
|
||||
tm.rendererT += time;
|
||||
|
||||
m_EventBroker->Process<Engine>();
|
||||
|
||||
// Swap event queues
|
||||
m_EventBroker->Clear();
|
||||
@@ -411,6 +442,52 @@ private:
|
||||
std::shared_ptr<InputManager> m_InputManager;
|
||||
std::shared_ptr<World> m_World;
|
||||
|
||||
struct TickMetric
|
||||
{
|
||||
double resourceManagerT = 0;
|
||||
double inputManagerT = 0;
|
||||
double worldT = 0;
|
||||
double addToRenderQueueT = 0;
|
||||
double rendererT = 0;
|
||||
double Total()
|
||||
{
|
||||
return resourceManagerT
|
||||
+ inputManagerT
|
||||
+ worldT
|
||||
+ addToRenderQueueT
|
||||
+ rendererT;
|
||||
};
|
||||
};
|
||||
TickMetric tm;
|
||||
|
||||
dd::EventRelay<Engine, dd::Events::KeyDown> m_EKeyDown;
|
||||
bool OnKeyDown(const dd::Events::KeyDown &event)
|
||||
{
|
||||
if (event.KeyCode == 78)
|
||||
{
|
||||
double total = tm.Total();
|
||||
|
||||
std::ofstream outFile;
|
||||
outFile.open("../tools/engine-metrics.txt");
|
||||
outFile.clear();
|
||||
outFile << "----------------------- Time measurements -----------------------\n";
|
||||
outFile << "Type: ResourceManager->Update()" << std::endl;
|
||||
outFile << "Total: " << tm.resourceManagerT / total * 100 << " %" << std::endl << std::endl;
|
||||
outFile << "Type: InputManager->Update()" << std::endl;
|
||||
outFile << "Total: " << tm.inputManagerT / total * 100 << " %" << std::endl << std::endl;
|
||||
outFile << "Type: World->Update()" << std::endl;
|
||||
outFile << "Total: " << tm.worldT / total * 100 << " %" << std::endl << std::endl;
|
||||
outFile << "Type: AddToRenderQueue()" << std::endl;
|
||||
outFile << "Total: " << tm.addToRenderQueueT / total * 100 << " %" << std::endl << std::endl;
|
||||
outFile << "Type: Renderer->Draw()" << std::endl;
|
||||
outFile << "Total: " << tm.rendererT / total * 100 << " %" << std::endl << std::endl;
|
||||
outFile << "-----------------------------------------------------------------";
|
||||
outFile.close();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
double m_LastTime;
|
||||
};
|
||||
|
||||
@@ -169,23 +169,6 @@ struct RenderQueueCollection
|
||||
}
|
||||
};
|
||||
|
||||
struct RenderQueuePair
|
||||
|
||||
{
|
||||
RenderQueue Deferred;
|
||||
RenderQueue Forward;
|
||||
|
||||
void Clear() {
|
||||
Deferred.Clear();
|
||||
Forward.Clear();
|
||||
}
|
||||
|
||||
void Sort() {
|
||||
Deferred.Sort();
|
||||
Forward.Sort();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // RenderQueue_h__
|
||||
@@ -39,8 +39,8 @@ public:
|
||||
void SetFullscreen(bool fullscreen) { m_Fullscreen = fullscreen; }
|
||||
bool VSYNC() const { return m_VSYNC; }
|
||||
void SetVSYNC(bool vsync) { m_VSYNC = vsync; }
|
||||
void SetViewport(const Rectangle& viewport) { m_Viewport = viewport; }
|
||||
void SetScissor(const Rectangle& scissor) { m_Scissor = scissor; }
|
||||
//void SetViewport(const Rectangle& viewport) { m_Viewport = viewport; }
|
||||
//void SetScissor(const Rectangle& scissor) { m_Scissor = scissor; }
|
||||
const dd::Camera* Camera() const { return m_Camera; }
|
||||
void SetCamera(const dd::Camera* camera)
|
||||
{
|
||||
@@ -53,16 +53,14 @@ public:
|
||||
|
||||
void Initialize();
|
||||
void Draw(RenderQueueCollection& rq);
|
||||
void DrawFrame(RenderQueuePair& rq);
|
||||
|
||||
private:
|
||||
Rectangle m_Resolution = Rectangle(1280, 720);
|
||||
bool m_Fullscreen = false;
|
||||
bool m_VSYNC = false;
|
||||
Rectangle m_Viewport;
|
||||
Rectangle m_Scissor;
|
||||
//Rectangle m_Viewport;
|
||||
//Rectangle m_Scissor;
|
||||
std::unique_ptr<dd::Camera> m_DefaultCamera = nullptr;
|
||||
|
||||
const dd::Camera* m_Camera = nullptr;
|
||||
|
||||
int m_GLVersion[2];
|
||||
|
||||
@@ -107,7 +107,6 @@ public:
|
||||
@tparam T Resource type.
|
||||
@param resourceName Fully qualified name of the resource to fetch.
|
||||
*/
|
||||
|
||||
template <typename T>
|
||||
static T* Fetch(std::string resourceName);
|
||||
|
||||
@@ -143,7 +142,6 @@ private:
|
||||
// Internal: Create a resource and cache it
|
||||
template <typename T>
|
||||
static T* CreateResource(std::string resourceName, Resource* parent);
|
||||
Resource* CreateResource(std::string resourceType, std::string resourceName);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include "EComponentCreated.h"
|
||||
#include "ResourceManager.h"
|
||||
|
||||
#include "EKeyDown.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
@@ -52,6 +54,10 @@ public:
|
||||
, m_LastEntityID(0) { }
|
||||
~World() { }
|
||||
|
||||
dd::EventRelay<World, dd::Events::KeyDown> m_EKeyDown;
|
||||
bool OnKeyDown(const dd::Events::KeyDown &event);
|
||||
|
||||
|
||||
/** Initialize the world.
|
||||
|
||||
|
||||
@@ -249,6 +255,14 @@ protected:
|
||||
|
||||
void RecycleEntityID(EntityID id);
|
||||
|
||||
private:
|
||||
//Benchmarking
|
||||
struct TimeMeasure {
|
||||
double EventTime;
|
||||
double SystemTime;
|
||||
double RSystemTime;
|
||||
};
|
||||
std::map<std::string, TimeMeasure> m_typeToTimeMap;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
||||
@@ -1,258 +0,0 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-17.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_FRAME_H
|
||||
#define DAYDREAM_FRAME_H
|
||||
|
||||
#include "Core/Util/Rectangle.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/EKeyDown.h"
|
||||
#include "Core/EKeyUp.h"
|
||||
#include "Core/ResourceManager.h"
|
||||
#include "Core/Renderer.h"
|
||||
#include "Core/RenderQueue.h"
|
||||
#include "Core/Texture.h"
|
||||
#include "Input/EInputCommand.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
class Frame : public Rectangle
|
||||
{
|
||||
public:
|
||||
enum class Anchor
|
||||
{
|
||||
Left,
|
||||
Right,
|
||||
Top,
|
||||
Bottom
|
||||
};
|
||||
|
||||
static const int BaseWidth = 1280;
|
||||
static const int BaseHeight = 720;
|
||||
|
||||
// Set up a base frame with an event broker
|
||||
Frame(std::shared_ptr<dd::EventBroker> eventBroker, std::shared_ptr<dd::ResourceManager> resourceManager)
|
||||
: EventBroker(eventBroker)
|
||||
, ResourceManager(resourceManager)
|
||||
, Rectangle()
|
||||
, m_Parent(nullptr)
|
||||
, m_Name("UIParent")
|
||||
, m_Layer(0)
|
||||
, m_Hidden(false)
|
||||
{ Initialize(); }
|
||||
|
||||
// Create a frame as a child
|
||||
Frame(Frame* parent, std::string name)
|
||||
: m_Name(name)
|
||||
, m_Layer(0)
|
||||
, m_Hidden(false)
|
||||
{ SetParent(parent); Initialize(); }
|
||||
|
||||
~Frame()
|
||||
{
|
||||
/*for (auto layer : m_Children)
|
||||
{
|
||||
for (auto child : layer.second)
|
||||
{
|
||||
delete child.second;
|
||||
}
|
||||
}
|
||||
if (m_Parent)
|
||||
{
|
||||
m_Parent->RemoveChild(this);
|
||||
}*/
|
||||
}
|
||||
|
||||
dd::RenderQueuePair RenderQueue;
|
||||
|
||||
Frame* Parent() const { return m_Parent; }
|
||||
void SetParent(Frame* parent)
|
||||
{
|
||||
if (parent == nullptr)
|
||||
{
|
||||
LOG_ERROR("Failed to create frame \"%s\": Invalid parent", m_Name.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Width = parent->Width;
|
||||
Height = parent->Height;
|
||||
m_Layer = parent->Layer() + 1;
|
||||
parent->AddChild(this);
|
||||
m_Parent = parent;
|
||||
EventBroker = parent->EventBroker;
|
||||
ResourceManager = parent->ResourceManager;
|
||||
}
|
||||
|
||||
void AddChild(Frame* child)
|
||||
{
|
||||
m_Children[child->m_Layer].insert(std::make_pair(child->Name(), child));
|
||||
if (m_Parent)
|
||||
{
|
||||
m_Parent->AddChild(child);
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveChild(Frame* child)
|
||||
{
|
||||
auto it = m_Children.find(child->m_Layer);
|
||||
if (it != m_Children.end())
|
||||
{
|
||||
m_Children.erase(it);
|
||||
}
|
||||
|
||||
if (m_Parent)
|
||||
{
|
||||
m_Parent->RemoveChild(child);
|
||||
}
|
||||
}
|
||||
|
||||
std::string Name() const { return m_Name; }
|
||||
void SetName(std::string val) { m_Name = val; }
|
||||
int Layer() const { return m_Layer; }
|
||||
bool Hidden() const
|
||||
{
|
||||
if (m_Parent)
|
||||
return m_Parent->Hidden() || m_Hidden;
|
||||
else
|
||||
return m_Hidden;
|
||||
}
|
||||
|
||||
bool Visible() const
|
||||
{
|
||||
return !Hidden();
|
||||
}
|
||||
|
||||
virtual void Hide() { m_Hidden = true; }
|
||||
virtual void Show() { m_Hidden = false; }
|
||||
|
||||
int Left() const override
|
||||
{
|
||||
if (m_Parent)
|
||||
return m_Parent->Left() + X;
|
||||
else
|
||||
return X;
|
||||
}
|
||||
int Right() const override
|
||||
{
|
||||
if (m_Parent)
|
||||
return std::min(m_Parent->Right(), Left() + Width);
|
||||
else
|
||||
return Left() + Width;
|
||||
}
|
||||
int Top() const override
|
||||
{
|
||||
if (m_Parent)
|
||||
return m_Parent->Top() + Y;
|
||||
else
|
||||
return Y;
|
||||
}
|
||||
int Bottom() const override
|
||||
{
|
||||
if (m_Parent)
|
||||
return std::min(m_Parent->Bottom(), Top() + Height);
|
||||
else
|
||||
return Top() + Height;
|
||||
}
|
||||
|
||||
glm::vec2 Scale()
|
||||
{
|
||||
if (m_Parent)
|
||||
return m_Parent->Scale();
|
||||
else
|
||||
return glm::vec2(Width, Height) / glm::vec2(BaseWidth, BaseHeight);
|
||||
}
|
||||
|
||||
Rectangle AbsoluteRectangle()
|
||||
{
|
||||
int left = Left();
|
||||
if (m_Parent)
|
||||
left = std::max(left, m_Parent->Left());
|
||||
int top = Top();
|
||||
if (m_Parent)
|
||||
top = std::max(top, m_Parent->Top());
|
||||
int width = Right() - left;
|
||||
int height = Bottom() - top;
|
||||
return Rectangle(left, top, width, height);
|
||||
}
|
||||
|
||||
void UpdateLayered(double dt)
|
||||
{
|
||||
// Update ourselves
|
||||
this->Update(dt);
|
||||
|
||||
// Update children
|
||||
for (auto &pairLayer : m_Children)
|
||||
{
|
||||
auto children = pairLayer.second;
|
||||
for (auto &pairChild : children)
|
||||
{
|
||||
auto child = pairChild.second;
|
||||
child->Update(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void Update(double dt) { }
|
||||
|
||||
void DrawLayered(std::shared_ptr<Renderer> renderer)
|
||||
{
|
||||
if (this->Hidden())
|
||||
return;
|
||||
|
||||
// Draw ourselves
|
||||
renderer->SetScissor(AbsoluteRectangle());
|
||||
this->Draw(renderer);
|
||||
|
||||
// Draw children
|
||||
for (auto &pairLayer : m_Children)
|
||||
{
|
||||
auto children = pairLayer.second;
|
||||
for (auto &pairChild : children)
|
||||
{
|
||||
auto child = pairChild.second;
|
||||
if (child->Hidden())
|
||||
continue;
|
||||
Rectangle rect = child->AbsoluteRectangle();
|
||||
renderer->SetScissor(rect);
|
||||
child->Draw(renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Draw(std::shared_ptr<Renderer> renderer) { }
|
||||
|
||||
protected:
|
||||
std::shared_ptr<dd::EventBroker> EventBroker;
|
||||
std::shared_ptr<dd::ResourceManager> ResourceManager;
|
||||
|
||||
std::string m_Name;
|
||||
int m_Layer;
|
||||
bool m_Hidden;
|
||||
|
||||
Frame* m_Parent;
|
||||
typedef std::multimap<std::string, Frame*> Children_t; // name -> frame
|
||||
std::map<int, Children_t> m_Children; // layer -> Children_t
|
||||
|
||||
virtual bool OnKeyDown(const dd::Events::KeyDown &event) { return false; }
|
||||
virtual bool OnKeyUp(const dd::Events::KeyUp &event) { return false; }
|
||||
//virtual bool OnMouseDown(const Events::KeyDown &event) { }
|
||||
//virtual bool OnMouseUp(const Events::KeyDown &event) { }
|
||||
virtual bool OnCommand(const dd::Events::InputCommand &event) { return false; }
|
||||
|
||||
private:
|
||||
EventRelay<Frame, dd::Events::KeyDown> m_EKeyDown;
|
||||
EventRelay<Frame, dd::Events::KeyUp> m_EKeyUp;
|
||||
EventRelay<Frame, dd::Events::InputCommand> m_EInputCommand;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &Frame::OnKeyDown);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &Frame::OnKeyUp);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Frame::OnCommand);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_FRAME_H
|
||||
@@ -1,105 +0,0 @@
|
||||
//
|
||||
// Created by Administrator on 2015-09-17.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_MAINMENUFRAME_H
|
||||
#define DAYDREAM_MAINMENUFRAME_H
|
||||
|
||||
#include "GUI/Frame.h"
|
||||
#include "GUI/TextureFrame.h"
|
||||
|
||||
#include "Game/EGameStart.h"
|
||||
//#include "Events/PlayBGM.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
class MainMenuFrame : public Frame {
|
||||
public:
|
||||
MainMenuFrame(Frame *parent, std::string name)
|
||||
: Frame(parent, name) {
|
||||
m_CurrentSelection = 0;
|
||||
|
||||
//Hide();
|
||||
m_Background = new TextureFrame(this, "Background");
|
||||
m_Background->SetTexture("Textures/GUI/MainMenu/BackGround.png");
|
||||
|
||||
m_Buttons = new TextureFrame(this, "Message");
|
||||
m_Buttons->SetTexture("Textures/GUI/MainMenu/Buttons.png");
|
||||
m_CurrentCoordinate = -m_SelectionCoordinates[0] * Scale();
|
||||
m_TargetCoordinate = m_CurrentCoordinate;
|
||||
m_Buttons->X = m_CurrentCoordinate.x;
|
||||
m_Buttons->Y = m_CurrentCoordinate.y;
|
||||
|
||||
/*Events::PlayBGM e;
|
||||
e.Resource = "Sounds/BGM/DiesIrae.mp3";
|
||||
EventBroker->Publish(e);*/
|
||||
}
|
||||
|
||||
void Update(double dt) override {
|
||||
if (Hidden())
|
||||
return;
|
||||
|
||||
glm::vec2 posDiff = m_TargetCoordinate - m_CurrentCoordinate;
|
||||
m_CurrentCoordinate += posDiff * 4.f * (float) dt;
|
||||
|
||||
m_Buttons->X = m_CurrentCoordinate.x;
|
||||
m_Buttons->Y = m_CurrentCoordinate.y;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_Victory;
|
||||
TextureFrame *m_Background;
|
||||
TextureFrame *m_Buttons;
|
||||
|
||||
int m_CurrentSelection;
|
||||
static glm::vec2 m_SelectionCoordinates[2];
|
||||
glm::vec2 m_CurrentCoordinate;
|
||||
glm::vec2 m_TargetCoordinate;
|
||||
|
||||
bool OnCommand(const Events::InputCommand &event) override {
|
||||
if (Hidden())
|
||||
return false;
|
||||
|
||||
const float deadzone = 0.5f;
|
||||
|
||||
if (event.Command == "interface_horizontal") {
|
||||
if (event.Value > deadzone)
|
||||
m_CurrentSelection++;
|
||||
else if (event.Value < -deadzone)
|
||||
m_CurrentSelection--;
|
||||
}
|
||||
m_CurrentSelection = (m_CurrentSelection < 0) ? 0 : ((m_CurrentSelection > 1) ? 1 : m_CurrentSelection);
|
||||
m_TargetCoordinate = -m_SelectionCoordinates[m_CurrentSelection] * Scale();
|
||||
|
||||
if (event.Command == "interface_confirm" && event.Value > 0) {
|
||||
// Play
|
||||
if (m_CurrentSelection == 0) {
|
||||
Hide();
|
||||
Events::GameStart e1;
|
||||
EventBroker->Publish(e1);
|
||||
/*Events::PlayBGM e2;
|
||||
e2.Resource = "Sounds/BGM/FlightOfTheBumblebee.mp3";
|
||||
EventBroker->Publish(e2);*/
|
||||
}
|
||||
// Quit
|
||||
else if (m_CurrentSelection == 1) {
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
glm::vec2 MainMenuFrame::m_SelectionCoordinates[2] =
|
||||
{
|
||||
glm::vec2(0, 0),
|
||||
glm::vec2(193, 0),
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_MAINMENUFRAME_H
|
||||
@@ -1,90 +0,0 @@
|
||||
//
|
||||
// Created by Administrator on 2015-09-17.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_TEXTUREFRAME_H
|
||||
#define DAYDREAM_TEXTUREFRAME_H
|
||||
|
||||
#include <glm/detail/type_vec.hpp>
|
||||
#include <glm/detail/type_vec4.hpp>
|
||||
#include "GUI/Frame.h"
|
||||
#include "Core/Texture.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
class TextureFrame : public Frame {
|
||||
public:
|
||||
TextureFrame(Frame *parent, std::string name)
|
||||
: Frame(parent, name), m_Texture(nullptr), m_FadeTexture(nullptr), m_Color(glm::vec4(1.f, 1.f, 1.f, 1.f)),
|
||||
m_FadeDuration(0.f), m_CurrentFade(1.f) { }
|
||||
|
||||
void Draw(std::shared_ptr<Renderer> renderer) override {
|
||||
if (m_Texture == nullptr)
|
||||
return;
|
||||
|
||||
RenderQueue.Clear();
|
||||
|
||||
// Main texture
|
||||
{
|
||||
SpriteJob job;
|
||||
job.TextureID = m_Texture->ResourceID;
|
||||
job.DiffuseTexture = *m_Texture;
|
||||
job.Color = glm::vec4(m_Color.r, m_Color.g, m_Color.b, m_Color.a * m_CurrentFade);
|
||||
RenderQueue.Forward.Add(job);
|
||||
}
|
||||
|
||||
// Texture while fading
|
||||
if (m_FadeTexture && m_CurrentFade < 1) {
|
||||
SpriteJob job;
|
||||
job.TextureID = m_FadeTexture->ResourceID;
|
||||
job.DiffuseTexture = *m_FadeTexture;
|
||||
job.Color = glm::vec4(m_Color.r, m_Color.g, m_Color.b, m_Color.a);
|
||||
RenderQueue.Forward.Add(job);
|
||||
}
|
||||
|
||||
renderer->SetCamera(nullptr);
|
||||
renderer->SetViewport(Rectangle(Left(), Top(), Width, Height));
|
||||
renderer->DrawFrame(RenderQueue);
|
||||
}
|
||||
|
||||
dd::Texture *Texture() const { return m_Texture; }
|
||||
|
||||
void SetTexture(std::string resourceName) {
|
||||
m_Texture = ResourceManager->Load<dd::Texture>("Texture", resourceName);
|
||||
}
|
||||
|
||||
void FadeToTexture(std::string resourceName, double duration) {
|
||||
m_FadeTexture = m_Texture;
|
||||
SetTexture(resourceName);
|
||||
m_FadeDuration = duration;
|
||||
m_CurrentFade = 0.f;
|
||||
}
|
||||
|
||||
void Update(double dt) override {
|
||||
if (m_CurrentFade < 1) {
|
||||
m_CurrentFade += dt / m_FadeDuration;
|
||||
if (m_CurrentFade > 1) {
|
||||
m_FadeTexture = nullptr;
|
||||
m_CurrentFade = 1;
|
||||
m_FadeDuration = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glm::vec4 Color() const { return m_Color; }
|
||||
|
||||
void SetColor(glm::vec4 val) { m_Color = val; }
|
||||
|
||||
protected:
|
||||
dd::Texture *m_Texture;
|
||||
dd::Texture *m_FadeTexture;
|
||||
glm::vec4 m_Color;
|
||||
float m_FadeDuration;
|
||||
float m_CurrentFade;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_TEXTUREFRAME_H
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef DAYDREAM_BALLSYSTEM_H
|
||||
#define DAYDREAM_BALLSYSTEM_H
|
||||
|
||||
#include "Core/System.h"
|
||||
#include "Core/World.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/CTransform.h"
|
||||
#include "Physics/EContact.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CPowerUp.h"
|
||||
|
||||
namespace dd {
|
||||
|
||||
namespace Systems {
|
||||
|
||||
class BallSystem : public System {
|
||||
public:
|
||||
BallSystem(World *world, std::shared_ptr<dd::EventBroker> eventBroker)
|
||||
: System(world, eventBroker) { }
|
||||
|
||||
~BallSystem();
|
||||
|
||||
EventRelay<BallSystem, Events::Contact> m_Contact;
|
||||
bool Contact(const Events::Contact &event);
|
||||
|
||||
void RegisterComponents(ComponentFactory *cf) override;
|
||||
|
||||
void Initialize() override;
|
||||
|
||||
// Called once per system every tick
|
||||
void Update(double dt) override;
|
||||
|
||||
// Called once for every entity in the world every tick
|
||||
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||
|
||||
// Called when components are committed to an entity
|
||||
void OnEntityCommit(EntityID entity) override;
|
||||
|
||||
// Called when an entity is removed
|
||||
void OnEntityRemoved(EntityID entity) override;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-22.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_CPOWERUPBRICK_H
|
||||
#define DAYDREAM_CPOWERUPBRICK_H
|
||||
|
||||
#include "Core/Component.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Components
|
||||
{
|
||||
|
||||
struct PowerUpBrick : Component
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_CPOWERUPBRICK_H
|
||||
@@ -16,6 +16,7 @@ namespace Components
|
||||
struct Ball : Component
|
||||
{
|
||||
int Number = 0;
|
||||
float Speed = 5.f;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ struct Brick : Component
|
||||
int Points = 10;
|
||||
int Hits = 1;
|
||||
int Score = 50;
|
||||
bool Removed = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ struct Pad : Component
|
||||
int Points;
|
||||
|
||||
float SlowdownModifier = 5.f;
|
||||
float AccelerationSpeed = 80.f;
|
||||
float MaxSpeed = 40.f;
|
||||
float AccelerationSpeed = 40.f;
|
||||
float MaxSpeed = 20.f;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-22.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_CPOWERUP_H
|
||||
#define DAYDREAM_CPOWERUP_H
|
||||
|
||||
#include "Core/Component.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Components
|
||||
{
|
||||
|
||||
struct PowerUp : Component
|
||||
{
|
||||
int Type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_CPOWERUP_H
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-22.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_ECREATEPOWERUP_H
|
||||
#define DAYDREAM_ECREATEPOWERUP_H
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct CreatePowerUp : Event
|
||||
{
|
||||
glm::vec3 Position;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_ECREATEPOWERUP_H
|
||||
@@ -1,21 +1,27 @@
|
||||
//
|
||||
// Created by Administrator on 2015-09-17.
|
||||
// Created by Adniklastrator on 2015-09-22.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_EGAMEOVER_H
|
||||
#define DAYDREAM_EGAMEOVER_H
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/Entity.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct GameOver : Event
|
||||
{
|
||||
EntityID Entity;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_EGAMEOVER_H
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// Created by Administrator on 2015-09-16.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_EGAMESTART_H
|
||||
#define DAYDREAM_EGAMESTART_H
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
namespace Events
|
||||
{
|
||||
struct GameStart : Event
|
||||
{
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_EGAMESTART_H
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-17.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_EMULTIBALL_H
|
||||
#define DAYDREAM_EMULTIBALL_H
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/Entity.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct MultiBall : Event
|
||||
{
|
||||
Components::Transform* padTransform;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_EMULTIBALL_H
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-23.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_EPOWERUPTAKEN_H
|
||||
#define DAYDREAM_EPOWERUPTAKEN_H
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct PowerUpTaken : Event
|
||||
{
|
||||
std::string Name = "Name";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_EPOWERUPTAKEN_H
|
||||
+43
-12
@@ -7,22 +7,30 @@
|
||||
|
||||
#include "Core/System.h"
|
||||
#include "Core/CTransform.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/World.h"
|
||||
#include "Rendering/CSprite.h"
|
||||
#include "Rendering/CModel.h"
|
||||
#include "Game/CBrick.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/World.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CLife.h"
|
||||
#include "Game/CPowerUp.h"
|
||||
#include "Game/EStageCleared.h"
|
||||
#include "Game/ELifeLost.h"
|
||||
#include "Game/EResetBall.h"
|
||||
#include "Game/EScoreEvent.h"
|
||||
#include "Game/EMultiBall.h"
|
||||
#include "Game/EGameOver.h"
|
||||
#include "Game/ECreatePowerUp.h"
|
||||
#include "Game/EPowerUpTaken.h"
|
||||
#include "Game/Bricks/CPowerUpBrick.h"
|
||||
#include "Physics/CBoxShape.h"
|
||||
#include "Physics/CPhysics.h"
|
||||
#include "Physics/CCircleShape.h"
|
||||
#include "Physics/ESetImpulse.h"
|
||||
#include "Physics/EContact.h"
|
||||
#include "Sound/CCollisionSound.h"
|
||||
#include "Game/PadSystem.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <intrin.h>
|
||||
@@ -53,11 +61,11 @@ public:
|
||||
|
||||
void Initialize() override;
|
||||
|
||||
void CreateBasicLevel(int, int, glm::vec2, int);
|
||||
void CreateBasicLevel(int, int, glm::vec2, float);
|
||||
void CreateLife(int);
|
||||
void SaveLevel(int, int, glm::vec2, int); // Shouldn't be here, but I'm experimenting.
|
||||
void LoadLevel(char[20]);
|
||||
void CreateBrick(int, int, glm::vec2, int, int);
|
||||
void CreateBrick(int, int, glm::vec2, float, int);
|
||||
void ProcessCollision();
|
||||
|
||||
void OnEntityRemoved(EntityID entity);
|
||||
@@ -67,12 +75,18 @@ public:
|
||||
void Update(double dt) override;
|
||||
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||
|
||||
bool Restarting() const { return m_Restarting; }
|
||||
void SetRestarting(const bool& restarting) { m_Restarting = restarting; }
|
||||
bool Initialized() const { return m_Initialized; }
|
||||
void SetInitialized(const bool& initialized) { m_Initialized = initialized; }
|
||||
int& Lives() { return m_Lives; }
|
||||
void SetLives(const int& lives) { m_Lives = lives; }
|
||||
int& PastLives() { return m_PastLives; }
|
||||
void SetPastLives(const int& pastLives) { m_PastLives = pastLives; }
|
||||
int& MultiBalls() { return m_MultiBalls; }
|
||||
void SetMultiBalls(const int& multiBalls) { m_MultiBalls = multiBalls; }
|
||||
int& PowerUps() { return m_PowerUps; }
|
||||
void SetPowerUps(const int& powerUps) { m_PowerUps = powerUps; }
|
||||
int& Score() { return m_Score; }
|
||||
void SetScore(const int& score) { m_Score = score; }
|
||||
int& NumberOfBricks() { return m_NumberOfBricks; }
|
||||
@@ -81,30 +95,47 @@ public:
|
||||
void SetRows(const int& rows) { m_Rows = rows; }
|
||||
int& Lines() { return m_Lines; }
|
||||
void SetLines(const int& lines) { m_Lines = lines; }
|
||||
int& SpaceToEdge() { return m_SpaceToEdge; }
|
||||
void SetSpaceToEdge(const int& spaceToEdge) { m_SpaceToEdge = spaceToEdge; }
|
||||
float& SpaceToEdge() { return m_SpaceToEdge; }
|
||||
void SetSpaceToEdge(const float& spaceToEdge) { m_SpaceToEdge = spaceToEdge; }
|
||||
|
||||
glm::vec2& SpaceBetweenBricks() { return m_SpaceBetweenBricks; }
|
||||
void SetSpaceBetweenBricks(const glm::vec2& spaceBetweenBricks) { m_SpaceBetweenBricks = spaceBetweenBricks; }
|
||||
float& EdgeX() { return m_EdgeX; }
|
||||
void SetEdgeX(const float& edgeX) { m_EdgeX = edgeX; }
|
||||
float& EdgeY() { return m_EdgeY; }
|
||||
void SetEdgeY(const float& edgeY) { m_EdgeY = edgeY; }
|
||||
|
||||
private:
|
||||
bool m_Restarting = false;
|
||||
bool m_Initialized = false;
|
||||
int m_Lives = 3;
|
||||
int m_PastLives = 3;
|
||||
int m_MultiBalls = 0;
|
||||
int m_PowerUps = 0;
|
||||
int m_Score = 0;
|
||||
int m_NumberOfBricks;
|
||||
int m_Rows = 7;
|
||||
int m_Lines = 8;
|
||||
int m_SpaceToEdge = 0;
|
||||
glm::vec2 m_SpaceBetweenBricks = glm::vec2(2, 0.5);
|
||||
int m_Rows = 6;
|
||||
int m_Lines = 7;
|
||||
float m_SpaceToEdge = 0.25f;
|
||||
glm::vec2 m_SpaceBetweenBricks = glm::vec2(1, 0.4);
|
||||
float m_EdgeX = 3.2f;
|
||||
float m_EdgeY = 5.2f;
|
||||
|
||||
dd::EventRelay<LevelSystem, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<LevelSystem, dd::Events::LifeLost> m_ELifeLost;
|
||||
dd::EventRelay<LevelSystem, dd::Events::ScoreEvent> m_EScoreEvent;
|
||||
dd::EventRelay<LevelSystem, dd::Events::MultiBall> m_EMultiBall;
|
||||
dd::EventRelay<LevelSystem, dd::Events::CreatePowerUp> m_ECreatePowerUp;
|
||||
dd::EventRelay<LevelSystem, dd::Events::PowerUpTaken> m_EPowerUpTaken;
|
||||
dd::EventRelay<LevelSystem, dd::Events::StageCleared> m_EStageCleared;
|
||||
|
||||
bool OnContact(const dd::Events::Contact &event);
|
||||
bool LifeLost(const dd::Events::LifeLost &event);
|
||||
bool ScoreEvent(const dd::Events::ScoreEvent &event);
|
||||
bool OnLifeLost(const dd::Events::LifeLost &event);
|
||||
bool OnScoreEvent(const dd::Events::ScoreEvent &event);
|
||||
bool OnMultiBall(const dd::Events::MultiBall &event);
|
||||
bool OnCreatePowerUp(const dd::Events::CreatePowerUp &event);
|
||||
bool OnPowerUpTaken(const dd::Events::PowerUpTaken &event);
|
||||
bool OnStageCleared(const dd::Events::StageCleared &event);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -21,8 +21,12 @@
|
||||
#include "Rendering/CSprite.h"
|
||||
#include "Rendering/CModel.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CPad.h"
|
||||
#include "Game/CPowerUp.h"
|
||||
#include "Game/EResetBall.h"
|
||||
#include "CPad.h"
|
||||
#include "Game/EMultiBall.h"
|
||||
#include "Game/EPowerUpTaken.h"
|
||||
#include "Game/EStageCleared.h"
|
||||
|
||||
|
||||
namespace dd
|
||||
@@ -41,6 +45,8 @@ public:
|
||||
void Update(double dt) override;
|
||||
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||
|
||||
EntityID CreateBall();
|
||||
|
||||
EntityID& Entity() { return m_Entity; }
|
||||
void SetEntity(const EntityID& ent) { m_Entity = ent; }
|
||||
glm::vec3 Acceleration() const { return m_Acceleration; }
|
||||
@@ -52,29 +58,37 @@ public:
|
||||
void SetRight(const bool& right) { m_Right = right; }
|
||||
bool ReplaceBall() const { return m_ReplaceBall; }
|
||||
void SetReplaceBall(const bool& replaceBall) { m_ReplaceBall = replaceBall; }
|
||||
bool MultiBall() const { return m_MultiBall; }
|
||||
void SetMultiBall(const bool& multiBall) { m_MultiBall = multiBall; }
|
||||
|
||||
Components::Transform* Transform() const { return m_Transform; }
|
||||
void SetTransform(const Components::Transform* transform) { m_Transform = transform; }
|
||||
void SetTransform(Components::Transform* transform) { m_Transform = transform; }
|
||||
Components::Pad* Pad() const { return m_Pad; }
|
||||
void SetPad(const Components::Pad* pad) { m_Pad = pad; }
|
||||
void SetPad(Components::Pad* pad) { m_Pad = pad; }
|
||||
|
||||
private:
|
||||
EntityID m_Entity = 0;
|
||||
glm::vec3 m_Acceleration = glm::vec3(0.f, 0.f, 0.f);
|
||||
bool m_Left = false, m_Right = false, m_ReplaceBall = false;
|
||||
bool m_Left = false, m_Right = false, m_ReplaceBall = false, m_MultiBall = false;
|
||||
Components::Transform* m_Transform;
|
||||
Components::Pad* m_Pad;
|
||||
|
||||
dd::EventRelay<PadSystem, dd::Events::KeyDown> m_EKeyDown;
|
||||
dd::EventRelay<PadSystem, dd::Events::KeyUp> m_EKeyUp;
|
||||
dd::EventRelay<PadSystem, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<PadSystem, dd::Events::Contact> m_EContactPowerUp;
|
||||
dd::EventRelay<PadSystem, dd::Events::ResetBall> m_EResetBall;
|
||||
dd::EventRelay<PadSystem, dd::Events::MultiBall> m_EMultiBall;
|
||||
dd::EventRelay<PadSystem, dd::Events::StageCleared> m_EStageCleared;
|
||||
|
||||
bool OnKeyDown(const dd::Events::KeyDown &event);
|
||||
bool OnKeyUp(const dd::Events::KeyUp &event);
|
||||
|
||||
bool OnContact(const dd::Events::Contact &event);
|
||||
bool ResetBall(const dd::Events::ResetBall &event);
|
||||
bool OnContactPowerUp(const dd::Events::Contact &event);
|
||||
bool OnResetBall(const dd::Events::ResetBall &event);
|
||||
bool OnMultiBall(const dd::Events::MultiBall &event);
|
||||
bool OnStageCleared(const dd::Events::StageCleared &event);
|
||||
|
||||
class PadSteeringInputController;
|
||||
std::array<std::shared_ptr<PadSteeringInputController>, 4> m_PadInputControllers;
|
||||
|
||||
@@ -19,7 +19,8 @@ struct Contact : Event
|
||||
{
|
||||
EntityID Entity1;
|
||||
EntityID Entity2;
|
||||
glm::vec2 ContactPoint;
|
||||
glm::vec2 Normal;
|
||||
glm::vec2 SignificantNormal;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "Physics/ESetImpulse.h"
|
||||
#include "Physics/CCircleShape.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Game/CPad.h"
|
||||
|
||||
|
||||
namespace dd
|
||||
@@ -22,7 +23,6 @@ namespace dd
|
||||
namespace Systems
|
||||
{
|
||||
|
||||
//KOLLA http://box2d.org/manual.pdf p52 Pre-Solve Event
|
||||
|
||||
class PhysicsSystem : public System
|
||||
{
|
||||
@@ -65,6 +65,16 @@ private:
|
||||
void CreateBody(EntityID entity);
|
||||
|
||||
|
||||
struct Impulse
|
||||
{
|
||||
b2Body* Body;
|
||||
b2Vec2 Impulse;
|
||||
b2Vec2 Point;
|
||||
};
|
||||
std::list<Impulse> m_Impulses;
|
||||
|
||||
|
||||
|
||||
class ContactListener : public b2ContactListener
|
||||
{
|
||||
public:
|
||||
@@ -73,22 +83,40 @@ private:
|
||||
|
||||
void BeginContact(b2Contact* contact)
|
||||
{
|
||||
b2Vec2 contactPoint = contact->GetManifold()->localPoint;
|
||||
b2WorldManifold worldManifold;
|
||||
|
||||
contact->GetWorldManifold(&worldManifold);
|
||||
|
||||
Events::Contact e;
|
||||
e.ContactPoint = glm::vec2(contactPoint.x, contactPoint.y);
|
||||
e.Entity1 = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureA()->GetBody()];
|
||||
e.Entity2 = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureB()->GetBody()];
|
||||
|
||||
e.Normal = glm::normalize(glm::vec2(contact->GetManifold()->localNormal.x, contact->GetManifold()->localNormal.y));
|
||||
e.SignificantNormal = glm::normalize((glm::abs(e.Normal.x) > glm::abs(e.Normal.y)) ? glm::vec2(e.Normal.x, 0) : glm::vec2(0, e.Normal.y));
|
||||
|
||||
m_PhysicsSystem->EventBroker->Publish(e);
|
||||
}
|
||||
void EndContact(b2Contact* contact)
|
||||
{ /* handle end event */ }
|
||||
{
|
||||
|
||||
}
|
||||
void PreSolve(b2Contact* contact, const b2Manifold* oldManifold)
|
||||
{ /* handle pre-solve event */ }
|
||||
{
|
||||
EntityID entityA = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureA()->GetBody()];
|
||||
EntityID entityB = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureA()->GetBody()];
|
||||
|
||||
auto physicsComponentA = m_PhysicsSystem->m_World->GetComponent<Components::Physics>(entityA);
|
||||
auto physicsComponentB = m_PhysicsSystem->m_World->GetComponent<Components::Physics>(entityB);
|
||||
|
||||
if (physicsComponentA != nullptr || physicsComponentB != nullptr) {
|
||||
// Turn of collisions
|
||||
contact->SetEnabled(false);
|
||||
}
|
||||
|
||||
}
|
||||
void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse)
|
||||
{ /* handle post-solve event */ }
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
PhysicsSystem* m_PhysicsSystem;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Adam on 2015-09-17.
|
||||
//
|
||||
|
||||
#ifndef COMPONENTS_CCOLLISIONSOUND_H__
|
||||
#define COMPONENTS_CCOLLISIONSOUND_H__
|
||||
|
||||
#include "Core/Component.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Components
|
||||
{
|
||||
|
||||
struct CollisionSound : public Component
|
||||
{
|
||||
std::string filePath;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef Events_PlaySFX_h__
|
||||
#define Events_PlaySFX_h__
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct PlaySound : Event
|
||||
{
|
||||
std::string path;
|
||||
float volume = 1.f;
|
||||
float pitch = 1.f;
|
||||
bool loop = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef EVENTS_ESTOPSOUND_H__
|
||||
#define EVENTS_ESTOPSOUND_H__
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct StopSound : public Event
|
||||
{
|
||||
std::string path;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef SOUND_H__
|
||||
#define SOUND_H__
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
|
||||
#include "Core/ResourceManager.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
class Sound : public Resource
|
||||
{
|
||||
friend class ResourceManager;
|
||||
public:
|
||||
ALuint Buffer() { return m_Buffer; };
|
||||
std::string Path() { return m_Path; };
|
||||
private:
|
||||
Sound(std::string path);
|
||||
|
||||
//File-info
|
||||
char m_Type[4];
|
||||
unsigned long m_Size, m_ChunkSize;
|
||||
short m_FormatType, m_Channels;
|
||||
unsigned long m_SampleRate, m_AvgBytesPerSec;
|
||||
short m_BytesPerSample, m_BitsPerSample;
|
||||
unsigned long m_DataSize;
|
||||
std::map<std::string, ALuint> m_BufferCache;
|
||||
ALuint LoadFile(std::string path);
|
||||
|
||||
ALuint m_Buffer;
|
||||
std::string m_Path;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef DAYDREAM_SOUND_H
|
||||
#define DAYDREAM_SOUND_H
|
||||
|
||||
|
||||
#include "AL/al.h"
|
||||
#include "AL/alc.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/World.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Sound.h"
|
||||
#include "Sound/EPlaySound.h"
|
||||
#include "Sound/EStopSound.h"
|
||||
#include "Physics/EContact.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CBrick.h"
|
||||
#include "Game/CPad.h"
|
||||
#include "Sound/CCollisionSound.h"
|
||||
#include "Core/ResourceManager.h"
|
||||
|
||||
|
||||
namespace dd
|
||||
{
|
||||
namespace Systems
|
||||
{
|
||||
class SoundSystem : public System {
|
||||
public:
|
||||
SoundSystem(World *world, std::shared_ptr<dd::EventBroker> eventBroker)
|
||||
: System(world, eventBroker) { }
|
||||
~SoundSystem();
|
||||
void Initialize() override;
|
||||
void Update(double dt) override;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
//Events
|
||||
dd::EventRelay<SoundSystem, dd::Events::PlaySound> m_EPlaySFX;
|
||||
dd::EventRelay<SoundSystem, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<SoundSystem, dd::Events::StopSound> m_EStopSound;
|
||||
bool OnPlaySound(const dd::Events::PlaySound &event);
|
||||
bool OnContact(const dd::Events::Contact &event);
|
||||
bool OnStopSound(const dd::Events::StopSound &event);
|
||||
|
||||
ALuint CreateSource();
|
||||
|
||||
std::map<ALuint, Sound*> m_SourcesToBuffers;
|
||||
|
||||
ALCdevice* m_Device;
|
||||
|
||||
//Temp
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_SOUND_H
|
||||
+16
-3
@@ -9,6 +9,10 @@ find_package(ZLIB REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(BGFX REQUIRED)
|
||||
find_package(liquidfun REQUIRED)
|
||||
# Because FindOpenAL is retarded
|
||||
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/deps/include/AL")
|
||||
find_package(OpenAL REQUIRED)
|
||||
|
||||
# GLM
|
||||
if(UNIX)
|
||||
find_package(X11 REQUIRED)
|
||||
@@ -25,6 +29,7 @@ include_directories(
|
||||
${PNG_INCLUDE_DIRS}
|
||||
${X11_INCLUDE_DIRS}
|
||||
${BGFX_INCLUDE_DIRS}
|
||||
${OPENAL_INCLUDE_DIR}
|
||||
${liquidfun_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
@@ -68,6 +73,12 @@ file(GLOB SOURCE_FILES_Game
|
||||
)
|
||||
source_group(Game FILES ${SOURCE_FILES_Game})
|
||||
|
||||
file(GLOB SOURCE_FILES_Sound
|
||||
"${INCLUDE_PATH}/Sound/*.h"
|
||||
"Sound/*.cpp"
|
||||
)
|
||||
source_group(Sound FILES ${SOURCE_FILES_Sound})
|
||||
|
||||
set(SOURCE_FILES
|
||||
${SOURCE_FILES_Core}
|
||||
${SOURCE_FILES_Core_Util}
|
||||
@@ -75,14 +86,14 @@ set(SOURCE_FILES
|
||||
${SOURCE_FILES_Rendering}
|
||||
${SOURCE_FILES_Transform}
|
||||
${SOURCE_FILES_Physics}
|
||||
${SOURCE_FILES_Game} ../../include/GUI/Frame.h ../../include/GUI/MainMenuFrame.h ../../include/GUI/TextureFrame.h)
|
||||
${SOURCE_FILES_Game}
|
||||
${SOURCE_FILES_Sound} ../../include/Game/EGameOver.h ../../include/Game/Bricks/CPowerUpBrick.h ../../include/Game/CPowerUp.h ../../include/Game/ECreatePowerUp.h ../../include/Game/EPowerUpTaken.h)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
set(STATIC_LIBRARY_FLAGS "${STATIC_LIBRARY_FLAGS}")
|
||||
endif()
|
||||
|
||||
add_definitions(-DBGFX_CONFIG_RENDERER_OPENGL=33)
|
||||
|
||||
add_library(game ${SOURCE_FILES})
|
||||
target_link_libraries(game
|
||||
${OPENGL_LIBRARIES}
|
||||
@@ -93,6 +104,7 @@ target_link_libraries(game
|
||||
${PNG_LIBRARIES}
|
||||
${X11_LIBRARIES}
|
||||
${BGFX_LIBRARIES}
|
||||
${OPENAL_LIBRARY}
|
||||
${liquidfun_LIBRARIES}
|
||||
)
|
||||
|
||||
@@ -109,6 +121,7 @@ target_link_libraries(breakout
|
||||
${PNG_LIBRARIES}
|
||||
${X11_LIBRARIES}
|
||||
${BGFX_LIBRARIES}
|
||||
${OPENAL_LIBRARY}
|
||||
${liquidfun_LIBRARIES}
|
||||
)
|
||||
|
||||
|
||||
@@ -473,9 +473,3 @@ void dd::Renderer::DebugKeys()
|
||||
m_CurrentScreenBuffer = m_tLighting;
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Renderer::DrawFrame(RenderQueuePair &rq)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -82,4 +82,4 @@ void dd::ResourceManager::fileWatcherCallback(std::string path, FileWatcher::Fil
|
||||
void dd::ResourceManager::Update()
|
||||
{
|
||||
m_FileWatcher.Check();
|
||||
}
|
||||
}
|
||||
+71
-4
@@ -19,6 +19,8 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "Core/World.h"
|
||||
|
||||
//TODO Delete this please
|
||||
|
||||
void dd::World::RecycleEntityID(EntityID id)
|
||||
{
|
||||
m_RecycledEntityIDs.push(id);
|
||||
@@ -56,11 +58,36 @@ void dd::World::Update(double dt)
|
||||
{
|
||||
const std::string &type = pair.first;
|
||||
auto system = pair.second;
|
||||
EventBroker->Process(type);
|
||||
system->Update(dt);
|
||||
RecursiveUpdate(system, dt, 0);
|
||||
}
|
||||
|
||||
std::map<std::string, TimeMeasure>::iterator it = m_typeToTimeMap.find(type.c_str());
|
||||
if (it == m_typeToTimeMap.end()) {
|
||||
//Does not contain item
|
||||
TimeMeasure t;
|
||||
t.EventTime = 0;
|
||||
t.SystemTime = 0;
|
||||
t.RSystemTime = 0;
|
||||
m_typeToTimeMap[type.c_str()] = t;
|
||||
}
|
||||
|
||||
double start = glfwGetTime();
|
||||
EventBroker->Process(type);
|
||||
double stop = glfwGetTime();
|
||||
double t1 = stop - start;
|
||||
m_typeToTimeMap[type.c_str()].EventTime += t1;
|
||||
|
||||
start = glfwGetTime();
|
||||
system->Update(dt);
|
||||
stop = glfwGetTime();
|
||||
double t2 = stop - start;
|
||||
m_typeToTimeMap[type.c_str()].SystemTime += t2;
|
||||
|
||||
start = glfwGetTime();
|
||||
RecursiveUpdate(system, dt, 0);
|
||||
stop = glfwGetTime();
|
||||
double t3 = stop - start;
|
||||
m_typeToTimeMap[type.c_str()].RSystemTime += t3;
|
||||
}
|
||||
EventBroker->Process<World>();
|
||||
ProcessEntityRemovals();
|
||||
}
|
||||
|
||||
@@ -159,6 +186,8 @@ void dd::World::Initialize()
|
||||
system->RegisterResourceTypes(ResourceManager);
|
||||
system->Initialize();
|
||||
}
|
||||
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &World::OnKeyDown);
|
||||
}
|
||||
|
||||
int dd::World::CommitEntity(EntityID entity)
|
||||
@@ -230,3 +259,41 @@ void dd::World::SetEntityParent(EntityID entity, EntityID newParent)
|
||||
m_EntityParents[entity] = newParent;
|
||||
m_EntityChildren[newParent].push_back(entity);
|
||||
}
|
||||
|
||||
bool dd::World::OnKeyDown(const dd::Events::KeyDown &event)
|
||||
{
|
||||
if (event.KeyCode == 78)
|
||||
{
|
||||
double eventTot = 0;
|
||||
double updateTot = 0;
|
||||
double rUpdateTot = 0;
|
||||
double total = 0;
|
||||
|
||||
for (auto item : m_typeToTimeMap)
|
||||
{
|
||||
eventTot += item.second.EventTime;
|
||||
updateTot += item.second.SystemTime;
|
||||
rUpdateTot += item.second.RSystemTime;
|
||||
}
|
||||
total = eventTot + updateTot + rUpdateTot;
|
||||
|
||||
std::ofstream outFile;
|
||||
outFile.open("../tools/system-metrics.txt");
|
||||
outFile.clear();
|
||||
outFile << "----------------------- Time measurements -----------------------\n";
|
||||
for (auto item : m_typeToTimeMap)
|
||||
{
|
||||
outFile << "Type: " << item.first.c_str() << std::endl;
|
||||
outFile << "Events: " << item.second.EventTime << " s. " << item.second.EventTime / eventTot * 100 << " % of total event time.\n";
|
||||
outFile << "Update: " << item.second.SystemTime << " s. " << item.second.SystemTime / updateTot * 100 << " % of total update time.\n";
|
||||
outFile << "Recursive Update: " << item.second.RSystemTime << " s. " << item.second.RSystemTime / rUpdateTot * 100 << " % of total recursive update time.\n";
|
||||
double totalComplexity = (item.second.EventTime + item.second.SystemTime + item.second.RSystemTime) / total * 100;
|
||||
outFile << "Total: " << totalComplexity << "% total system time." << std::endl << std::endl;
|
||||
}
|
||||
outFile << "-----------------------------------------------------------------";
|
||||
outFile.close();
|
||||
return true;
|
||||
|
||||
}
|
||||
//return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "Game/BallSystem.h"
|
||||
|
||||
dd::Systems::BallSystem::~BallSystem() {
|
||||
|
||||
}
|
||||
|
||||
void dd::Systems::BallSystem::RegisterComponents(ComponentFactory *cf)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void dd::Systems::BallSystem::Initialize()
|
||||
{
|
||||
|
||||
EVENT_SUBSCRIBE_MEMBER(m_Contact, BallSystem::Contact);
|
||||
}
|
||||
|
||||
void dd::Systems::BallSystem::Update(double dt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
{
|
||||
auto ballComponent = m_World->GetComponent<Components::Ball>(entity);
|
||||
if (ballComponent != nullptr) {
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
glm::vec2 dir = glm::normalize(glm::vec2(transform->Velocity.x, transform->Velocity.y));
|
||||
glm::vec2 up = glm::vec2(0.f, 1.f);
|
||||
float angle = glm::acos(glm::dot<float>(dir, up)) * glm::sign(dir.x);
|
||||
transform->Orientation = glm::rotate(glm::quat(), angle, glm::vec3(0.f, 0.f, -1.f));
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::BallSystem::OnEntityCommit(EntityID entity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void dd::Systems::BallSystem::OnEntityRemoved(EntityID entity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool dd::Systems::BallSystem::Contact(const Events::Contact &event)
|
||||
{
|
||||
Components::PowerUp* power1 = m_World->GetComponent<Components::PowerUp>(event.Entity1);
|
||||
Components::PowerUp* power2 = m_World->GetComponent<Components::PowerUp>(event.Entity2);
|
||||
|
||||
if (power1 != nullptr || power2 != nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Components::Ball* ballComponent1 = m_World->GetComponent<Components::Ball>(event.Entity1);
|
||||
Components::Ball* ballComponent2 = m_World->GetComponent<Components::Ball>(event.Entity2);
|
||||
Components::Ball* ballComponent;
|
||||
|
||||
if (ballComponent1 != nullptr && ballComponent2 != nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Which is the ball?
|
||||
EntityID ballEntity, otherEntitiy;
|
||||
|
||||
if (ballComponent1 != nullptr) {
|
||||
ballEntity = event.Entity1;
|
||||
otherEntitiy = event.Entity2;
|
||||
ballComponent = ballComponent1;
|
||||
}
|
||||
else if (ballComponent2 != nullptr) {
|
||||
ballEntity = event.Entity2;
|
||||
otherEntitiy = event.Entity1;
|
||||
ballComponent = ballComponent2;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
//TODO: Add support for power-up collisions
|
||||
}
|
||||
|
||||
auto ballTransform = m_World->GetComponent<Components::Transform>(ballEntity);
|
||||
glm::vec2 ballVelocity = glm::vec2(ballTransform->Velocity.x, ballTransform->Velocity.y);
|
||||
|
||||
if (m_World->GetProperty<std::string>(otherEntitiy, "Name") == "Pad"){
|
||||
auto padTransform = m_World->GetComponent<Components::Transform>(otherEntitiy);
|
||||
float x = ballTransform->Position.x - padTransform->Position.x;
|
||||
|
||||
float movementMultiplier = 5.0f;
|
||||
float y = glm::cos((abs(x) / (1.6f)) * glm::pi<float>() / 2.f) + 1.f;
|
||||
|
||||
ballTransform->Velocity = glm::normalize(glm::vec3(x, y ,0.f)) * ballComponent->Speed;
|
||||
}
|
||||
else {
|
||||
glm::vec2 reflectedVelocity = glm::reflect(ballVelocity, event.Normal);
|
||||
ballTransform->Velocity = glm::vec3(reflectedVelocity, 0.f);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
+202
-44
@@ -10,8 +10,12 @@
|
||||
void dd::Systems::LevelSystem::Initialize()
|
||||
{
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContact, LevelSystem::OnContact);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ELifeLost, LevelSystem::LifeLost);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EScoreEvent, LevelSystem::ScoreEvent);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ELifeLost, LevelSystem::OnLifeLost);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EScoreEvent, LevelSystem::OnScoreEvent);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EMultiBall, LevelSystem::OnMultiBall);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_ECreatePowerUp, LevelSystem::OnCreatePowerUp);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPowerUpTaken, LevelSystem::OnPowerUpTaken);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, LevelSystem::OnStageCleared);
|
||||
|
||||
for (int i = 0; i < Lives(); i++) {
|
||||
CreateLife(i);
|
||||
@@ -24,8 +28,8 @@ void dd::Systems::LevelSystem::CreateLife(int number)
|
||||
{
|
||||
auto life = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(life);
|
||||
transform->Position = glm::vec3(-4.f + number * 0.5f, -2.f, -5.f);
|
||||
transform->Scale = glm::vec3(0.25f, 0.25f, 0.25f);
|
||||
transform->Position = glm::vec3(-1.5f + number * 0.15f, -2.f, -5.f);
|
||||
transform->Scale = glm::vec3(0.1f, 0.1f, 0.1f);
|
||||
|
||||
std::shared_ptr<Components::Life> lifeNr = m_World->AddComponent<Components::Life>(life);
|
||||
lifeNr->Number = number;
|
||||
@@ -33,8 +37,6 @@ void dd::Systems::LevelSystem::CreateLife(int number)
|
||||
auto model = m_World->AddComponent<Components::Model>(life);
|
||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||
|
||||
/*std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(life);
|
||||
sprite->SpriteFile = "Textures/Ball.png";*/
|
||||
|
||||
m_World->CommitEntity(life);
|
||||
}
|
||||
@@ -45,41 +47,111 @@ void dd::Systems::LevelSystem::Update(double dt)
|
||||
CreateBasicLevel(Rows(), Lines(), SpaceBetweenBricks(), SpaceToEdge());
|
||||
m_Initialized = true;
|
||||
}
|
||||
|
||||
if (Lives() < 0)
|
||||
{
|
||||
SetLives(3);
|
||||
Events::GameOver e;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::LevelSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
{
|
||||
auto ball = m_World->GetComponent<Components::Ball>(entity);
|
||||
|
||||
if (ball != NULL) {
|
||||
if (ball != nullptr) {
|
||||
auto transformBall = m_World->GetComponent<Components::Transform>(entity);
|
||||
if (transformBall->Position.y < -10) {
|
||||
if (Lives() == PastLives()) {
|
||||
if (glm::abs(transformBall->Velocity.y) < 2) {
|
||||
if (transformBall->Velocity.y > 0) {
|
||||
transformBall->Velocity.y = 2;
|
||||
} else {
|
||||
transformBall->Velocity.y = -2;
|
||||
}
|
||||
}
|
||||
if (transformBall->Position.y < -EdgeY() - 4) {
|
||||
if (MultiBalls() != 0) {
|
||||
SetMultiBalls(MultiBalls() - 1);
|
||||
m_World->RemoveComponent<Components::Ball>(entity);
|
||||
m_World->RemoveComponent<Components::Transform>(entity);
|
||||
m_World->RemoveComponent<Components::CircleShape>(entity);
|
||||
m_World->RemoveComponent<Components::Physics>(entity);
|
||||
m_World->RemoveEntity(entity);
|
||||
} else if (Lives() == PastLives()) {
|
||||
Events::ResetBall be;
|
||||
EventBroker->Publish(be);
|
||||
Events::LifeLost e;
|
||||
e.Entity = entity;
|
||||
EventBroker->Publish(e);
|
||||
Events::ResetBall be;
|
||||
EventBroker->Publish(be);
|
||||
return;
|
||||
}
|
||||
} else if (transformBall->Position.x > EdgeX()) {
|
||||
if (transformBall->Velocity.x > 0) {
|
||||
glm::vec2 reflectedVelocity = glm::reflect(glm::vec2(transformBall->Velocity.x, transformBall->Velocity.y), glm::vec2(1, 0));
|
||||
transformBall->Velocity = glm::vec3(reflectedVelocity, 0.f);
|
||||
}
|
||||
} else if (transformBall->Position.x < -EdgeX()) {
|
||||
if (transformBall->Velocity.x < 0) {
|
||||
glm::vec2 reflectedVelocity = glm::reflect(glm::vec2(transformBall->Velocity.x, transformBall->Velocity.y), glm::vec2(-1, 0));
|
||||
transformBall->Velocity = glm::vec3(reflectedVelocity, 0.f);
|
||||
}
|
||||
} else if (transformBall->Position.y > EdgeY()) {
|
||||
if (transformBall->Velocity.y > 0) {
|
||||
glm::vec2 reflectedVelocity = glm::reflect(glm::vec2(transformBall->Velocity.x, transformBall->Velocity.y), glm::vec2(0, 1));
|
||||
transformBall->Velocity = glm::vec3(reflectedVelocity, 0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Lives() != PastLives()) {
|
||||
auto life = m_World->GetComponent<Components::Life>(entity);
|
||||
if (life != NULL) {
|
||||
if (life != nullptr) {
|
||||
if (life->Number + 1 == PastLives()) {
|
||||
m_World->RemoveComponent<Components::Life>(entity);
|
||||
m_World->RemoveComponent<Components::Transform>(entity);
|
||||
m_World->RemoveEntity(entity);
|
||||
SetPastLives(Lives());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (NumberOfBricks() <= 0) {
|
||||
/*SetRestarting(true);
|
||||
if (MultiBalls() <= 0 && PowerUps() <= 0) {
|
||||
Events::ResetBall e;
|
||||
EventBroker->Publish(e);
|
||||
Events::ScoreEvent es;
|
||||
es.Score = 500;
|
||||
EventBroker->Publish(es);
|
||||
Events::StageCleared ec;
|
||||
EventBroker->Publish(ec);
|
||||
CreateBasicLevel(Rows(), Lines(), SpaceBetweenBricks(), SpaceToEdge());
|
||||
} else {
|
||||
if (ball != nullptr && MultiBalls() > 0) {
|
||||
SetMultiBalls(MultiBalls() - 1);
|
||||
m_World->RemoveComponent<Components::Ball>(entity);
|
||||
m_World->RemoveComponent<Components::Transform>(entity);
|
||||
m_World->RemoveComponent<Components::CircleShape>(entity);
|
||||
m_World->RemoveComponent<Components::Physics>(entity);
|
||||
m_World->RemoveEntity(entity);
|
||||
auto transformBall = m_World->GetComponent<Components::Transform>(entity);
|
||||
} else {
|
||||
auto powerUp = m_World->GetComponent<Components::PowerUp>(entity);
|
||||
if (powerUp != nullptr) {
|
||||
SetPowerUps(PowerUps() - 1);
|
||||
m_World->RemoveComponent<Components::PowerUp>(entity);
|
||||
m_World->RemoveComponent<Components::Transform>(entity);
|
||||
m_World->RemoveEntity(entity);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::LevelSystem::CreateBasicLevel(int rows, int lines, glm::vec2 spacesBetweenBricks, int spaceToEdge)
|
||||
void dd::Systems::LevelSystem::CreateBasicLevel(int rows, int lines, glm::vec2 spacesBetweenBricks, float spaceToEdge)
|
||||
{
|
||||
int num = 0;
|
||||
SetNumberOfBricks(rows * lines);
|
||||
std::cout << "You're only doing this once, right?" << std::endl;
|
||||
int num = 0;
|
||||
for (int i = 0; i < rows; i++) {
|
||||
num++;
|
||||
for (int j = 0; j < Lines(); j++) {
|
||||
@@ -89,10 +161,12 @@ void dd::Systems::LevelSystem::CreateBasicLevel(int rows, int lines, glm::vec2 s
|
||||
num = 0;
|
||||
}
|
||||
|
||||
SetNumberOfBricks(rows * lines);
|
||||
SetRestarting(false);
|
||||
return;
|
||||
}
|
||||
|
||||
void dd::Systems::LevelSystem::CreateBrick(int row, int line, glm::vec2 spacesBetweenBricks, int spaceToEdge, int num)
|
||||
void dd::Systems::LevelSystem::CreateBrick(int row, int line, glm::vec2 spacesBetweenBricks, float spaceToEdge, int num)
|
||||
{
|
||||
auto brick = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(brick);
|
||||
@@ -106,11 +180,19 @@ void dd::Systems::LevelSystem::CreateBrick(int row, int line, glm::vec2 spacesBe
|
||||
fileName.append(".png");
|
||||
//sprite->SpriteFile = fileName;
|
||||
model->ModelFile = "Models/Test/Brick/Brick.obj";
|
||||
float x = spaceToEdge + line * spacesBetweenBricks.x;
|
||||
float y = spaceToEdge + row * spacesBetweenBricks.y;
|
||||
transform->Scale = glm::vec3(1.6, 0.35, 0.5);
|
||||
transform->Position = glm::vec3(x - 7, y + 1, -10.f);
|
||||
if ((line == 1 && row == 4) || (line == 3 && row == 2) || (line == 6 && row == 6)) {
|
||||
std::shared_ptr<Components::PowerUpBrick> cPow = m_World->AddComponent<Components::PowerUpBrick>(brick);
|
||||
}
|
||||
float x = line * spacesBetweenBricks.x;
|
||||
float y = row * spacesBetweenBricks.y;
|
||||
transform->Scale = glm::vec3(0.8, 0.2, 0.2);
|
||||
transform->Position = glm::vec3(x - 3, 5 - spaceToEdge - y , -10.f);
|
||||
cBrick->Score = 10 * num;
|
||||
|
||||
//sound
|
||||
auto collisionSound = m_World->AddComponent<Components::CollisionSound>(brick);
|
||||
collisionSound->filePath = "Sounds/Brick/shortbrickbreak.wav";
|
||||
|
||||
m_World->CommitEntity(brick);
|
||||
return;
|
||||
}
|
||||
@@ -123,59 +205,135 @@ void dd::Systems::LevelSystem::ProcessCollision()
|
||||
|
||||
void dd::Systems::LevelSystem::OnEntityRemoved(EntityID entity)
|
||||
{
|
||||
/*auto brick = m_World->GetComponent<Components::Brick>(entity);
|
||||
if (brick != NULL) {
|
||||
numberOfBricks--;
|
||||
if (numberOfBricks < 1) {
|
||||
auto brick = m_World->GetComponent<Components::Brick>(entity);
|
||||
if (brick != nullptr) {
|
||||
SetNumberOfBricks(NumberOfBricks() - 1);
|
||||
Events::ScoreEvent es;
|
||||
es.Score = brick->Score;
|
||||
EventBroker->Publish(es);
|
||||
/*if (numberOfBricks < 1) {
|
||||
EndLevel();
|
||||
}
|
||||
}*/
|
||||
}*/
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::OnContact(const dd::Events::Contact &event)
|
||||
{
|
||||
EntityID entityBrick = event.Entity1;
|
||||
auto brick = m_World->GetComponent<Components::Brick>(entityBrick);
|
||||
if (brick == NULL) {
|
||||
EntityID entityBrick;
|
||||
EntityID entityBall;
|
||||
auto ball = m_World->GetComponent<Components::Ball>(event.Entity2);
|
||||
auto brick = m_World->GetComponent<Components::Brick>(event.Entity1);
|
||||
if (brick != nullptr) {
|
||||
entityBrick = event.Entity1;
|
||||
} else {
|
||||
brick = m_World->GetComponent<Components::Brick>(event.Entity2);
|
||||
if (brick != nullptr) {
|
||||
entityBrick = event.Entity2;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (ball != nullptr) {
|
||||
entityBall = event.Entity2;
|
||||
} else {
|
||||
ball = m_World->GetComponent<Components::Ball>(event.Entity1);
|
||||
if (ball != nullptr) {
|
||||
entityBall = event.Entity1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
brick = m_World->GetComponent<Components::Brick>(entityBrick);
|
||||
if (brick == nullptr) {
|
||||
return false;
|
||||
}
|
||||
EntityID entityBall = event.Entity2;
|
||||
|
||||
m_World->RemoveEntity(entityBrick);
|
||||
|
||||
SetNumberOfBricks(NumberOfBricks() - 1);
|
||||
if (NumberOfBricks() == 0) {
|
||||
Events::ScoreEvent es;
|
||||
es.Score = 500;
|
||||
EventBroker->Publish(es);
|
||||
Events::ResetBall e;
|
||||
auto power = m_World->GetComponent<Components::PowerUpBrick>(entityBrick);
|
||||
if (power != nullptr) {
|
||||
Events::CreatePowerUp e;
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entityBrick);
|
||||
e.Position = transform->Position;
|
||||
EventBroker->Publish(e);
|
||||
CreateBasicLevel(Rows(), Lines(), SpaceBetweenBricks(), SpaceToEdge());
|
||||
}
|
||||
Events::ScoreEvent es;
|
||||
es.Score = brick->Score;
|
||||
EventBroker->Publish(es);
|
||||
|
||||
std::cout << "Score: " << Score() << std::endl;
|
||||
if (ball != nullptr && Restarting() == false) {
|
||||
auto ballTransform = m_World->GetComponent<Components::Transform>(entityBall);
|
||||
|
||||
m_World->RemoveComponent<Components::Brick>(entityBrick);
|
||||
m_World->RemoveComponent<Components::Transform>(entityBrick);
|
||||
m_World->RemoveComponent<Components::RectangleShape>(entityBrick);
|
||||
m_World->RemoveComponent<Components::Physics>(entityBrick);
|
||||
m_World->RemoveEntity(entityBrick);
|
||||
|
||||
SetNumberOfBricks(NumberOfBricks() - 1);
|
||||
if (NumberOfBricks() <= 0) {
|
||||
SetMultiBalls(MultiBalls() + 1);
|
||||
}
|
||||
Events::ScoreEvent es;
|
||||
es.Score = brick->Score;
|
||||
EventBroker->Publish(es);
|
||||
|
||||
//std::cout << NumberOfBricks() << std::endl;
|
||||
//std::cout << "Score: " << Score() << std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::LifeLost(const dd::Events::LifeLost &event)
|
||||
bool dd::Systems::LevelSystem::OnLifeLost(const dd::Events::LifeLost &event)
|
||||
{
|
||||
SetLives(Lives() - 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::ScoreEvent(const dd::Events::ScoreEvent &event)
|
||||
bool dd::Systems::LevelSystem::OnScoreEvent(const dd::Events::ScoreEvent &event)
|
||||
{
|
||||
SetScore(Score() += event.Score);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::OnMultiBall(const dd::Events::MultiBall &event)
|
||||
{
|
||||
SetMultiBalls(MultiBalls()+2);
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::OnCreatePowerUp(const dd::Events::CreatePowerUp &event)
|
||||
{
|
||||
SetPowerUps(PowerUps() + 1);
|
||||
auto powerUp = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(powerUp);
|
||||
auto model = m_World->AddComponent<Components::Model>(powerUp);
|
||||
std::shared_ptr<Components::CircleShape> cRec = m_World->AddComponent<Components::CircleShape>(powerUp);
|
||||
std::shared_ptr<Components::Physics> cPhys = m_World->AddComponent<Components::Physics>(powerUp);
|
||||
std::shared_ptr<Components::PowerUp> cPow = m_World->AddComponent<Components::PowerUp>(powerUp);
|
||||
cPhys->Static = false;
|
||||
|
||||
transform->Position = event.Position;
|
||||
transform->Scale = glm::vec3(0.2, 0.2, 0.2);
|
||||
transform->Velocity = glm::vec3(0, -4, 0);
|
||||
|
||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||
|
||||
m_World->CommitEntity(powerUp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::OnPowerUpTaken(const dd::Events::PowerUpTaken &event)
|
||||
{
|
||||
SetPowerUps(PowerUps() - 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::LevelSystem::OnStageCleared(const dd::Events::StageCleared &event)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void dd::Systems::LevelSystem::EndLevel()
|
||||
{
|
||||
Events::StageCleared e;
|
||||
|
||||
+139
-72
@@ -22,56 +22,25 @@ void dd::Systems::PadSystem::Initialize()
|
||||
l.Command = "left";
|
||||
EventBroker->Publish(l);
|
||||
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, PadSystem::OnKeyDown);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, PadSystem::OnKeyUp);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContact, PadSystem::OnContact);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResetBall, PadSystem::ResetBall);
|
||||
|
||||
return;
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &PadSystem::OnKeyDown);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &PadSystem::OnKeyUp);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContact, &PadSystem::OnContact);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContactPowerUp, &PadSystem::OnContactPowerUp);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EResetBall, &PadSystem::OnResetBall);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EMultiBall, &PadSystem::OnMultiBall);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &PadSystem::OnStageCleared);
|
||||
}
|
||||
|
||||
void dd::Systems::PadSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
|
||||
{
|
||||
auto ball = m_World->GetComponent<Components::Ball>(entity);
|
||||
if (ball != NULL) {
|
||||
if (ball != nullptr) {
|
||||
if (ReplaceBall() == true) {
|
||||
SetReplaceBall(false);
|
||||
|
||||
auto transformEntity = m_World->GetComponent<Components::Transform>(entity);
|
||||
transformEntity->Position = glm::vec3(20, 20, -10);
|
||||
|
||||
//Temporary. Create new ball.
|
||||
/*auto ent = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(0.5f, 0.f, -10.f);
|
||||
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
|
||||
std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(ent);
|
||||
sprite->SpriteFile = "Textures/Ball.png";
|
||||
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
||||
std::shared_ptr<Components::Ball> cball = m_World->AddComponent<Components::Ball>(ent);
|
||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = false;*/
|
||||
|
||||
auto ent = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(0.5f, 0.f, -10.f);
|
||||
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
|
||||
auto model = m_World->AddComponent<Components::Model>(ent);
|
||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||
//auto pointlight = m_World->AddComponent<Components::PointLight>(ent);
|
||||
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
||||
std::shared_ptr<Components::Ball> cball = m_World->AddComponent<Components::Ball>(ent);
|
||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = false;
|
||||
|
||||
m_World->RemoveEntity(entity);
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
Events::SetImpulse e;
|
||||
e.Entity = ent;
|
||||
e.Impulse = glm::vec2(0.f, -7.f);
|
||||
e.Point = glm::vec2(transform->Position.x, transform->Position.y);
|
||||
EventBroker->Publish(e);
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
transform->Position = glm::vec3(0.0f, 0.26f, -10.f);
|
||||
transform->Velocity = glm::vec3(0.0f, -ball->Speed, 0.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,16 +69,14 @@ void dd::Systems::PadSystem::Update(double dt)
|
||||
transform->Velocity.x = pad->MaxSpeed;
|
||||
}
|
||||
transform->Position += transform->Velocity * (float)dt;
|
||||
transform->Velocity += acceleration * (float)dt;
|
||||
transform->Velocity += acceleration * (float)dt;
|
||||
transform->Velocity -= transform->Velocity * pad->SlowdownModifier * (float)dt;
|
||||
|
||||
if (Left()) {
|
||||
acceleration.x = -pad->AccelerationSpeed;
|
||||
}
|
||||
else if (Right()) {
|
||||
} else if (Right()) {
|
||||
acceleration.x = pad->AccelerationSpeed;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
acceleration.x = 0.f;
|
||||
}
|
||||
|
||||
@@ -117,9 +84,38 @@ void dd::Systems::PadSystem::Update(double dt)
|
||||
SetPad(pad);
|
||||
SetAcceleration(acceleration);
|
||||
|
||||
if (MultiBall() == true) {
|
||||
SetMultiBall(false);
|
||||
|
||||
Events::MultiBall e;
|
||||
e.padTransform = transform;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
EntityID dd::Systems::PadSystem::CreateBall()
|
||||
{
|
||||
auto ent = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(0.5f, 0.26f, -10.f);
|
||||
transform->Scale = glm::vec3(0.5f, 0.5f, 0.5f);
|
||||
auto model = m_World->AddComponent<Components::Model>(ent);
|
||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||
//auto pointlight = m_World->AddComponent<Components::PointLight>(ent);
|
||||
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
||||
std::shared_ptr<Components::Ball> cball = m_World->AddComponent<Components::Ball>(ent);
|
||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = false;
|
||||
|
||||
cball->Speed = 10;
|
||||
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event)
|
||||
{
|
||||
int val = event.KeyCode;
|
||||
@@ -137,6 +133,10 @@ bool dd::Systems::PadSystem::OnKeyDown(const dd::Events::KeyDown &event)
|
||||
SetRight(true);
|
||||
} else if (val == GLFW_KEY_R) {
|
||||
SetReplaceBall(true);
|
||||
} else if (val == GLFW_KEY_M) {
|
||||
SetMultiBall(true);
|
||||
} else if (val == GLFW_KEY_D) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -158,6 +158,7 @@ bool dd::Systems::PadSystem::OnKeyUp(const dd::Events::KeyUp &event)
|
||||
|
||||
bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event)
|
||||
{
|
||||
/*
|
||||
EntityID entityBall = event.Entity2;
|
||||
auto ball = m_World->GetComponent<Components::Ball>(entityBall);
|
||||
if (ball == NULL) {
|
||||
@@ -171,10 +172,10 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event)
|
||||
auto transformBall = m_World->GetComponent<Components::Transform>(entityBall);
|
||||
auto transformPad = m_World->GetComponent<Components::Transform>(entityPad);
|
||||
|
||||
float movementMultiplier = 4.f;
|
||||
float movementMultiplier = 0.5f;
|
||||
|
||||
float whatX = transformBall->Position.x - transformPad->Position.x;
|
||||
float movementX;
|
||||
//float movementX = (event.ContactPoint.x - transformPad->Position.x) * movementMultiplier;
|
||||
//float movementY = glm::cos((abs(movementX) / (3.2f * movementMultiplier)) * 3.14159265359f / 2) * 2.f;
|
||||
if (whatX > 0) {
|
||||
movementX = movementMultiplier * whatX;
|
||||
//std::cout << "Right!" << std::endl;
|
||||
@@ -183,42 +184,108 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event)
|
||||
//std::cout << "Left!" << std::endl;
|
||||
}
|
||||
|
||||
//float movementY = 1;
|
||||
// std::cout << movementX << " " << movementY << std::endl;
|
||||
|
||||
//float movementX = (event.ContactPoint.x - transformPad->Position.x) * movementMultiplier;
|
||||
float movementY = glm::cos((abs(movementX) / ((1.6f) * movementMultiplier)) * 3.14159265359f / 2) + 1;
|
||||
float movementY = glm::cos((abs(movementX) / ((1.6f) * movementMultiplier)) * 3.14159265359f / 2)+ 0.2;
|
||||
|
||||
//std::cout << movementX << " " << movementY << std::endl;
|
||||
|
||||
//Temporary solution. Add a new ball and delete the old one.
|
||||
auto ent = m_World->CreateEntity();
|
||||
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
|
||||
transform->Position = glm::vec3(transformBall->Position.x, transformBall->Position.y + 0.01f, -10.f);
|
||||
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
|
||||
auto model = m_World->AddComponent<Components::Model>(ent);
|
||||
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
|
||||
//auto pointlight = m_World->AddComponent<Components::PointLight>(ent);
|
||||
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
|
||||
std::shared_ptr<Components::Ball> cball = m_World->AddComponent<Components::Ball>(ent);
|
||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = false;
|
||||
float len = glm::length<float>(transformBall->Velocity);
|
||||
|
||||
m_World->RemoveEntity(entityBall);
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
Events::SetImpulse e;
|
||||
e.Entity = ent;
|
||||
e.Impulse = glm::vec2(movementX, movementY);
|
||||
e.Point = glm::vec2(transform->Position.x, transform->Position.y);
|
||||
EventBroker->Publish(e);
|
||||
transformBall->Velocity += glm::vec3(transformPad->Velocity.x, 0, 0);
|
||||
transformBall->Velocity = glm::normalize(transformBall->Velocity) * len;
|
||||
|
||||
|
||||
//transform->Velocity = glm::vec3(movementX, movementY, 0.f);
|
||||
*/
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::ResetBall(const dd::Events::ResetBall &event)
|
||||
bool dd::Systems::PadSystem::OnContactPowerUp(const dd::Events::Contact &event)
|
||||
{
|
||||
EntityID entityPower;
|
||||
EntityID entityPad;
|
||||
auto powerUp = m_World->GetComponent<Components::PowerUp>(event.Entity1);
|
||||
auto pad = m_World->GetComponent<Components::Pad>(event.Entity2);
|
||||
if (powerUp != nullptr) {
|
||||
entityPower = event.Entity1;
|
||||
} else {
|
||||
powerUp = m_World->GetComponent<Components::PowerUp>(event.Entity2);
|
||||
if (powerUp != nullptr) {
|
||||
entityPower = event.Entity2;
|
||||
}
|
||||
}
|
||||
if (pad != nullptr) {
|
||||
entityPad = event.Entity2;
|
||||
} else {
|
||||
pad = m_World->GetComponent<Components::Pad>(event.Entity1);
|
||||
if (pad != nullptr) {
|
||||
entityPad = event.Entity1;
|
||||
}
|
||||
}
|
||||
|
||||
if (entityPower == NULL || entityPad == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pad = m_World->GetComponent<Components::Pad>(entityPad);
|
||||
if (pad == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_World->RemoveComponent<Components::PowerUp>(entityPower);
|
||||
m_World->RemoveComponent<Components::CircleShape>(entityPower);
|
||||
m_World->RemoveComponent<Components::Physics>(entityPower);
|
||||
m_World->RemoveEntity(entityPower);
|
||||
Events::PowerUpTaken ep;
|
||||
ep.Name = "Something";
|
||||
EventBroker->Publish(ep);
|
||||
|
||||
Events::MultiBall e;
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entityPad);
|
||||
e.padTransform = transform;
|
||||
EventBroker->Publish(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::OnResetBall(const dd::Events::ResetBall &event)
|
||||
{
|
||||
SetReplaceBall(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::OnMultiBall(const dd::Events::MultiBall &event)
|
||||
{
|
||||
auto ent1 = CreateBall();
|
||||
auto ent2 = CreateBall();
|
||||
auto transform1 = m_World->GetComponent<Components::Transform>(ent1);
|
||||
auto transform2 = m_World->GetComponent<Components::Transform>(ent2);
|
||||
auto ball1 = m_World->GetComponent<Components::Ball>(ent1);
|
||||
auto ball2 = m_World->GetComponent<Components::Ball>(ent2);
|
||||
auto padTransform = event.padTransform;
|
||||
float x1 = padTransform->Position.x - 2, x2 = padTransform->Position.x + 2;
|
||||
if (x1 < -3.1) {
|
||||
x1 = 3;
|
||||
}
|
||||
if (x2 > 3.1) {
|
||||
x2 = -3;
|
||||
}
|
||||
transform1->Position = glm::vec3(x1, -5.5, -10);
|
||||
transform2->Position = glm::vec3(x2, -5.5, -10);
|
||||
|
||||
transform1->Velocity = glm::normalize(glm::vec3(5, 5 ,0.f)) * ball1->Speed;
|
||||
transform2->Velocity = glm::normalize(glm::vec3(-5, 5 ,0.f)) * ball2->Speed;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::OnStageCleared(const dd::Events::StageCleared &event)
|
||||
{
|
||||
auto entity = CreateBall();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::PadSystem::PadSteeringInputController::OnCommand(const Events::InputCommand &event)
|
||||
{
|
||||
std::string command = event.Command;
|
||||
|
||||
@@ -37,7 +37,13 @@ bool dd::Systems::PhysicsSystem::SetImpulse(const Events::SetImpulse &event)
|
||||
point.x = event.Point.x;
|
||||
point.y = event.Point.y;
|
||||
|
||||
body->ApplyLinearImpulse(impulse, point, true);
|
||||
|
||||
Impulse i;
|
||||
i.Body = body;
|
||||
i.Impulse = impulse;
|
||||
i.Point = point;
|
||||
|
||||
m_Impulses.push_back(i);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -57,8 +63,7 @@ void dd::Systems::PhysicsSystem::Update(double dt)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (m_World->GetEntityParent(entity) == 0) {
|
||||
if (m_World->GetEntityParent(entity) == 0) { //TODO: Make this work with childs too
|
||||
b2Vec2 position;
|
||||
position.x = transformComponent->Position.x;
|
||||
position.y = transformComponent->Position.y;
|
||||
@@ -66,10 +71,17 @@ void dd::Systems::PhysicsSystem::Update(double dt)
|
||||
float angle = -glm::eulerAngles(transformComponent->Orientation).z;
|
||||
|
||||
body->SetTransform(position, angle);
|
||||
|
||||
body->SetLinearVelocity(b2Vec2(transformComponent->Velocity.x, transformComponent->Velocity.y));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (auto i : m_Impulses) {
|
||||
i.Body->ApplyLinearImpulse(i.Impulse, i.Point, true);
|
||||
}
|
||||
m_Impulses.clear();
|
||||
|
||||
|
||||
m_Accumulator += dt;
|
||||
@@ -80,13 +92,6 @@ void dd::Systems::PhysicsSystem::Update(double dt)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (auto i : m_EntitiesToBodies) {
|
||||
EntityID entity = i.first;
|
||||
b2Body* body = i.second;
|
||||
@@ -99,7 +104,6 @@ void dd::Systems::PhysicsSystem::Update(double dt)
|
||||
auto transformComponent = m_World->GetComponent<Components::Transform>(entity);
|
||||
if (! transformComponent)
|
||||
continue;
|
||||
|
||||
if (m_World->GetEntityParent(entity) == 0) {
|
||||
b2Vec2 position = body->GetPosition();
|
||||
transformComponent->Position.x = position.x;
|
||||
@@ -107,8 +111,13 @@ void dd::Systems::PhysicsSystem::Update(double dt)
|
||||
|
||||
float angle = body->GetAngle();
|
||||
|
||||
//TODO: CHECK IF THIS IS CORRECT
|
||||
|
||||
transformComponent->Orientation = glm::quat(glm::vec3(0, 0, -angle));
|
||||
|
||||
b2Vec2 velocity = body->GetLinearVelocity();
|
||||
transformComponent->Velocity.x = velocity.x;
|
||||
transformComponent->Velocity.y = velocity.y;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,6 +178,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity)
|
||||
bodyDef.type = b2_staticBody;
|
||||
} else {
|
||||
bodyDef.type = b2_dynamicBody;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +215,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity)
|
||||
fixtureDef.shape = pShape;
|
||||
fixtureDef.density = 1.f;
|
||||
fixtureDef.restitution = 1.0f;
|
||||
fixtureDef.friction = 0.3f;
|
||||
fixtureDef.friction = 0.0f;
|
||||
body->CreateFixture(&fixtureDef);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
#include "Sound/Sound.h"
|
||||
|
||||
dd::Sound::Sound(std::string path)
|
||||
{
|
||||
m_Buffer = LoadFile(path);
|
||||
m_Path = path;
|
||||
}
|
||||
|
||||
ALuint dd::Sound::LoadFile(std::string path)
|
||||
{
|
||||
if (m_BufferCache.find(path) != m_BufferCache.end()) {
|
||||
return m_BufferCache[path];
|
||||
}
|
||||
|
||||
//Open file
|
||||
FILE *fp = fopen(path.c_str(), "rb");
|
||||
if (!fp) {
|
||||
LOG_ERROR("Failed to open file %s, no such file exists", path.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
//CHECK FOR VALID WAVE-FILE
|
||||
fread(m_Type, sizeof(char), 4, fp);
|
||||
if(m_Type[0] != 'R' || m_Type[1] != 'I' || m_Type[2] != 'F' || m_Type[3] != 'F') {
|
||||
LOG_ERROR("ERROR: No RIFF in WAVE-file");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fread(&m_Size, sizeof(unsigned long), 1, fp);
|
||||
fread(m_Type, sizeof(char), 4, fp);
|
||||
if (m_Type[0] != 'W' || m_Type[1] != 'A' || m_Type[2] != 'V' || m_Type[3]!= 'E') {
|
||||
LOG_ERROR("ERROR: Not WAVE-file");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fread(m_Type, sizeof(char), 4, fp);
|
||||
if (m_Type[0] != 'f' || m_Type[1] != 'm' || m_Type[2] != 't' || m_Type[3] != ' ') {
|
||||
LOG_ERROR("ERROR: No fmt in WAVE-file");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//READ THE DATA FROM WAVE-FILE
|
||||
fread(&m_ChunkSize, sizeof(unsigned long), 1, fp);
|
||||
fread(&m_FormatType, sizeof(short), 1, fp);
|
||||
fread(&m_Channels, sizeof(short), 1, fp);
|
||||
fread(&m_SampleRate, sizeof(unsigned long), 1, fp);
|
||||
fread(&m_AvgBytesPerSec, sizeof(unsigned long), 1, fp);
|
||||
fread(&m_BytesPerSample, sizeof(short), 1, fp);
|
||||
fread(&m_BitsPerSample, sizeof(short), 1, fp);
|
||||
|
||||
fread(m_Type, sizeof(char), 4, fp);
|
||||
if (m_Type[0] !='d' || m_Type[1] != 'a' || m_Type[2] != 't' || m_Type[3] != 'a') {
|
||||
LOG_ERROR("ERROR: WAVE-file Missing data");
|
||||
return 0;
|
||||
}
|
||||
|
||||
fread(&m_DataSize, sizeof(unsigned long), 1, fp);
|
||||
|
||||
unsigned char* buf = new unsigned char[m_DataSize];
|
||||
fread(buf, sizeof(unsigned char), m_DataSize, fp);
|
||||
fclose(fp);
|
||||
|
||||
// Create buffer
|
||||
ALuint format = 0;
|
||||
if (m_BitsPerSample == 8) {
|
||||
if (m_Channels == 1) {
|
||||
format = AL_FORMAT_MONO8;
|
||||
}
|
||||
else if (m_Channels == 2) {
|
||||
format = AL_FORMAT_STEREO8;
|
||||
}
|
||||
}
|
||||
if (m_BitsPerSample == 16) {
|
||||
if (m_Channels == 1) {
|
||||
format = AL_FORMAT_MONO16;
|
||||
}
|
||||
else if (m_Channels == 2) {
|
||||
format = AL_FORMAT_STEREO16;
|
||||
}
|
||||
}
|
||||
|
||||
ALuint buffer;
|
||||
alGenBuffers(1, &buffer);
|
||||
alBufferData(buffer, format, buf, m_DataSize, m_SampleRate);
|
||||
delete[] buf;
|
||||
|
||||
m_BufferCache[path] = buffer;
|
||||
return buffer;
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
#include "Sound/SoundSystem.h"
|
||||
|
||||
dd::Systems::SoundSystem::~SoundSystem()
|
||||
{
|
||||
alcCloseDevice(m_Device);
|
||||
}
|
||||
|
||||
void dd::Systems::SoundSystem::Initialize()
|
||||
{
|
||||
//initialize OpenAL
|
||||
m_Device = alcOpenDevice(NULL);
|
||||
ALCcontext* context;
|
||||
|
||||
if (m_Device) {
|
||||
context = alcCreateContext(m_Device, NULL);
|
||||
alcMakeContextCurrent(context);
|
||||
}
|
||||
else {
|
||||
LOG_ERROR("OpenAL failed to initialize.");
|
||||
}
|
||||
|
||||
alGetError();
|
||||
|
||||
const ALfloat pos[3] = {0, 0, 0};
|
||||
alListenerfv(AL_POSITION, pos);
|
||||
|
||||
//Subscribe to events
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EContact, &SoundSystem::OnContact);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EPlaySFX, &SoundSystem::OnPlaySound);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EStopSound, &SoundSystem::OnStopSound);
|
||||
|
||||
//Todo: Move this
|
||||
{
|
||||
dd::Events::PlaySound e;
|
||||
e.path = "Sounds/BGM/soft-guitar.wav";
|
||||
e.loop = true;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
{
|
||||
dd::Events::PlaySound e;
|
||||
e.path = "Sounds/BGM/water-flowing.wav";
|
||||
e.volume = 0.3f;
|
||||
e.loop = true;
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
}
|
||||
|
||||
void dd::Systems::SoundSystem::Update(double dt)
|
||||
{
|
||||
//LOG_INFO("Sources : %i", m_SourcesToBuffers.size());
|
||||
|
||||
std::vector<ALuint> deleteList;
|
||||
for (auto item : m_SourcesToBuffers) {
|
||||
ALint sourceState;
|
||||
alGetSourcei(item.first, AL_SOURCE_STATE, &sourceState);
|
||||
if (sourceState == AL_STOPPED) {
|
||||
deleteList.push_back(item.first);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < deleteList.size(); i++) {
|
||||
alDeleteSources(1, &deleteList[i]);
|
||||
//alDeleteBuffers(1, &m_SourcesToBuffers[deleteList[i]]);
|
||||
m_SourcesToBuffers.erase(deleteList[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ALuint dd::Systems::SoundSystem::CreateSource()
|
||||
{
|
||||
ALuint source;
|
||||
alGenSources((ALuint)1, &source);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
bool dd::Systems::SoundSystem::OnPlaySound(const dd::Events::PlaySound &event)
|
||||
{
|
||||
//Loading and binding sound buffer to source
|
||||
Sound *sound = ResourceManager::Load<Sound>(event.path);
|
||||
if (sound == nullptr) {
|
||||
return false;
|
||||
}
|
||||
ALuint source = CreateSource();
|
||||
m_SourcesToBuffers[source] = sound;
|
||||
ALuint buffer = sound->Buffer();
|
||||
alSourcei(source, AL_BUFFER, buffer);
|
||||
|
||||
//Sound settings
|
||||
alSourcef(source, AL_GAIN, event.volume);
|
||||
alSourcef(source, AL_PITCH, event.pitch);
|
||||
if (event.loop) {
|
||||
alSourcei(source, AL_LOOPING, AL_TRUE);
|
||||
}
|
||||
else if (!event.loop)
|
||||
{
|
||||
alSourcei(source, AL_LOOPING, AL_FALSE);
|
||||
}
|
||||
|
||||
|
||||
//Play
|
||||
alSourcePlay(source);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dd::Systems::SoundSystem::OnStopSound(const dd::Events::StopSound &event)
|
||||
{
|
||||
for (auto item : m_SourcesToBuffers) {
|
||||
if (item.second->Path() == event.path) {
|
||||
alSourceStop(item.first);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool dd::Systems::SoundSystem::OnContact(const dd::Events::Contact &event)
|
||||
{
|
||||
//Check which entity has the collisionSound component.
|
||||
auto collisionSound = m_World->GetComponent<Components::CollisionSound>(event.Entity1);
|
||||
if (collisionSound == nullptr) {
|
||||
collisionSound = m_World->GetComponent<Components::CollisionSound>(event.Entity2);
|
||||
if (collisionSound == nullptr) {
|
||||
//None of the entities had a collisionSound component.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
dd::Events::StopSound e;
|
||||
e.path = "Sounds/BGM/soft-guitar.wav";
|
||||
EventBroker->Publish(e);
|
||||
}
|
||||
//Send play-sound event
|
||||
dd::Events::PlaySound e;
|
||||
e.path = collisionSound->filePath;
|
||||
EventBroker->Publish(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user