diff --git a/CMakeLists.txt b/CMakeLists.txt index b979cac..2c56989 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/assets/Models/Submarine.mtl b/assets/Models/Submarine.mtl new file mode 100644 index 0000000..211bb03 --- /dev/null +++ b/assets/Models/Submarine.mtl @@ -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 diff --git a/assets/Models/Submarine.obj b/assets/Models/Submarine.obj new file mode 100644 index 0000000..87dfe3c --- /dev/null +++ b/assets/Models/Submarine.obj @@ -0,0 +1,1883 @@ +# Blender v2.75 (sub 0) OBJ File: 'submarine.blend' +# www.blender.org +mtllib Submarine.mtl +o Cube +v 0.378953 0.002680 -0.065172 +v -0.212611 -0.044805 -0.044067 +v 0.378243 0.049219 -0.040454 +v -0.511655 -0.005655 -0.004951 +v -0.511655 -0.014323 -0.009928 +v 0.378953 -0.044805 -0.045251 +v -0.511655 -0.021628 -0.004951 +v -0.296392 -0.051346 -0.039065 +v -0.296392 0.051355 -0.038417 +v -0.212611 0.058696 -0.039270 +v -0.212611 0.002680 -0.063988 +v -0.296392 0.004712 -0.055556 +v 0.470020 -0.007247 -0.055901 +v 0.470020 0.033863 -0.039615 +v 0.470020 -0.046066 -0.039615 +v 0.504866 -0.007576 -0.027580 +v 0.504866 0.015092 -0.019565 +v 0.504866 -0.026681 -0.019565 +v -0.417794 -0.035928 -0.027732 +v -0.417862 -0.010074 -0.038703 +v -0.418042 0.020280 -0.027718 +v 0.103707 -0.044805 -0.044659 +v 0.095180 0.059866 -0.039862 +v 0.145284 -0.044805 -0.044778 +v 0.103707 0.002680 -0.064580 +v 0.220059 0.056313 -0.040098 +v 0.213663 -0.044805 -0.044896 +v 0.213663 0.002680 -0.064817 +v -0.016182 -0.044805 -0.044401 +v -0.016182 0.002680 -0.064322 +v -0.021156 0.057734 -0.039604 +v 0.103679 0.128289 -0.020932 +v 0.169800 0.124081 -0.021745 +v 0.145284 0.002680 -0.064699 +v 0.144573 0.059156 -0.039980 +v 0.145256 0.128299 -0.021050 +v 0.028130 0.059156 -0.039733 +v 0.025998 -0.044805 -0.044530 +v 0.025998 0.002680 -0.064451 +v 0.028811 0.126038 -0.021380 +v 0.101004 0.090373 -0.028531 +v -0.004471 0.088964 -0.032639 +v 0.179611 0.092300 -0.029335 +v 0.147840 0.092530 -0.029340 +v 0.011421 0.110450 -0.026194 +v -0.438535 0.016511 -0.025733 +v -0.439229 -0.012885 -0.036411 +v -0.438680 -0.033157 -0.025848 +v -0.488551 -0.025074 -0.012937 +v -0.497469 -0.013062 -0.015893 +v -0.493078 0.000808 -0.010559 +v -0.457621 0.052215 -0.000328 +v -0.486007 0.049835 -0.001062 +v -0.489135 0.011286 -0.003540 +v -0.449628 0.021564 -0.002397 +v -0.452490 -0.010420 -0.032017 +v -0.450888 -0.012577 -0.032017 +v -0.452490 -0.014448 -0.032017 +v -0.491993 -0.014448 -0.019989 +v -0.493187 -0.012577 -0.019989 +v -0.491993 -0.010420 -0.019989 +v -0.463244 -0.010420 -0.061607 +v -0.461409 -0.012577 -0.061607 +v -0.463244 -0.014448 -0.061607 +v -0.488480 -0.014448 -0.059057 +v -0.489673 -0.012577 -0.059057 +v -0.488480 -0.010420 -0.059057 +v -0.450386 -0.041229 -0.002309 +v -0.486995 -0.039392 -0.003342 +v -0.457584 -0.071526 -0.000278 +v -0.486002 -0.068886 -0.001063 +v -0.372582 -0.047066 -0.030989 +v -0.372582 -0.004185 -0.046120 +v -0.372582 0.034449 -0.032051 +v -0.511655 -0.005655 -0.004951 +v -0.511655 -0.014323 -0.009928 +v -0.511655 -0.021628 -0.004951 +v -0.525395 -0.008758 -0.002746 +v -0.515740 -0.008758 -0.002746 +v -0.515740 -0.011890 -0.004273 +v -0.515740 -0.014988 -0.002825 +v -0.525395 -0.011890 -0.004273 +v -0.525395 -0.014988 -0.002825 +v 0.050480 0.059392 -0.039776 +v 0.072830 0.059629 -0.039819 +v 0.051873 0.128594 -0.021423 +v 0.077776 0.128594 -0.021466 +v 0.077804 -0.044805 -0.044616 +v 0.051901 -0.044805 -0.044573 +v 0.077804 0.002680 -0.064537 +v 0.051901 0.002680 -0.064494 +v 0.041517 0.093350 -0.026237 +v 0.071378 0.088718 -0.026280 +v 0.120025 0.131743 -0.012698 +v 0.089441 0.131743 -0.012647 +v 0.104733 0.131743 -0.012672 +v 0.110237 0.131352 -0.005504 +v 0.104733 0.131352 -0.007784 +v 0.099229 0.131352 -0.005504 +v 0.110237 0.146402 -0.005504 +v 0.104733 0.146402 -0.007784 +v 0.099229 0.146402 -0.005504 +v 0.110237 0.309639 -0.005504 +v 0.104733 0.309639 -0.007784 +v 0.099229 0.309639 -0.005504 +v 0.145706 0.318985 -0.005504 +v 0.145706 0.324489 -0.007784 +v 0.145706 0.329993 -0.005504 +v 0.115907 0.329993 -0.005504 +v 0.115907 0.324489 -0.007784 +v 0.115907 0.318985 -0.005504 +v 0.103586 0.323872 -0.005504 +v 0.107478 0.319980 -0.007784 +v 0.111369 0.316088 -0.005504 +v 0.145706 0.319804 -0.004685 +v 0.145706 0.324489 -0.006626 +v 0.145706 0.329175 -0.004685 +v 0.120728 0.328489 -0.004000 +v 0.120728 0.324489 -0.005656 +v 0.120728 0.320490 -0.004000 +v 0.102383 0.109911 -0.026878 +v 0.146509 0.110962 -0.026891 +v 0.018918 0.119800 -0.023713 +v 0.176358 0.112152 -0.025424 +v 0.074675 0.109265 -0.023799 +v 0.046854 0.111511 -0.023756 +v 0.106319 0.101496 -0.028531 +v 0.141797 0.100168 -0.029340 +v 0.107087 0.103696 -0.026878 +v 0.140874 0.104992 -0.026891 +v 0.179464 0.101651 -0.027380 +v 0.101694 0.100142 -0.027239 +v 0.147175 0.101746 -0.028115 +v 0.015169 0.115125 -0.024953 +v 0.073027 0.098992 -0.025039 +v 0.044185 0.102430 -0.024996 +v 0.105455 0.102694 -0.027239 +v 0.143547 0.102580 -0.028115 +v 0.106319 0.101496 -0.062227 +v 0.125329 0.100168 -0.062227 +v 0.107087 0.103696 -0.062227 +v 0.124406 0.104992 -0.062227 +v 0.105455 0.102694 -0.062227 +v 0.127079 0.102580 -0.062227 +v 0.107364 0.101496 -0.065167 +v 0.121148 0.100168 -0.065167 +v 0.108133 0.103696 -0.065167 +v 0.120226 0.104992 -0.065167 +v 0.106501 0.102694 -0.065167 +v 0.122898 0.102580 -0.065167 +v -0.012813 0.073349 -0.036122 +v 0.196426 0.071466 -0.034717 +v 0.098092 0.075120 -0.034196 +v 0.146207 0.075843 -0.034660 +v 0.019775 0.084803 -0.032963 +v 0.072104 0.074173 -0.033049 +v 0.045999 0.076371 -0.033006 +v 0.424131 0.046842 -0.040035 +v 0.424487 -0.002283 -0.060537 +v 0.424487 -0.045435 -0.042433 +v 0.378953 0.002680 0.065173 +v -0.212611 -0.044805 0.044067 +v 0.378243 0.049219 0.040454 +v -0.511655 -0.005655 0.004951 +v -0.511655 -0.014323 0.009928 +v 0.378953 -0.044805 0.045251 +v -0.511655 -0.021628 0.004951 +v -0.296392 -0.051346 0.039065 +v -0.296392 0.051355 0.038417 +v -0.212611 0.058696 0.039270 +v -0.212611 0.002680 0.063988 +v -0.296392 0.004712 0.055556 +v 0.470020 -0.007247 0.055901 +v 0.470020 0.033863 0.039615 +v 0.470020 -0.046066 0.039615 +v 0.504866 -0.007576 0.027580 +v 0.504866 0.015092 0.019565 +v 0.504866 -0.026681 0.019565 +v -0.417794 -0.035928 0.027732 +v -0.417862 -0.010074 0.038703 +v -0.418042 0.020280 0.027718 +v 0.103707 -0.044805 0.044659 +v 0.095180 0.059866 0.039862 +v 0.145284 -0.044805 0.044778 +v 0.103707 0.002680 0.064580 +v 0.220059 0.056313 0.040098 +v 0.213663 -0.044805 0.044896 +v 0.213663 0.002680 0.064817 +v -0.016182 -0.044805 0.044401 +v -0.016182 0.002680 0.064322 +v -0.021156 0.057734 0.039604 +v 0.103679 0.128289 0.020933 +v 0.169800 0.124081 0.021745 +v 0.145284 0.002680 0.064699 +v 0.144573 0.059156 0.039980 +v 0.145256 0.128299 0.021050 +v 0.028130 0.059156 0.039733 +v 0.025998 -0.044805 0.044530 +v 0.025998 0.002680 0.064451 +v 0.028811 0.126038 0.021380 +v 0.101004 0.090373 0.028531 +v -0.004471 0.088964 0.032639 +v 0.179611 0.092300 0.029335 +v 0.147840 0.092530 0.029340 +v 0.011421 0.110450 0.026194 +v -0.438535 0.016511 0.025733 +v -0.439229 -0.012885 0.036411 +v -0.438680 -0.033157 0.025848 +v -0.488551 -0.025074 0.012937 +v -0.497469 -0.013062 0.015893 +v -0.493078 0.000808 0.010559 +v -0.457621 0.052215 0.000328 +v -0.486007 0.049835 0.001062 +v -0.489135 0.011286 0.003540 +v -0.449628 0.021564 0.002397 +v -0.452490 -0.010420 0.032017 +v -0.450888 -0.012577 0.032017 +v -0.452490 -0.014448 0.032017 +v -0.491993 -0.014448 0.019989 +v -0.493187 -0.012577 0.019989 +v -0.491993 -0.010420 0.019989 +v -0.463244 -0.010420 0.061607 +v -0.461409 -0.012577 0.061607 +v -0.463244 -0.014448 0.061607 +v -0.488480 -0.014448 0.059057 +v -0.489673 -0.012577 0.059057 +v -0.488480 -0.010420 0.059057 +v -0.450386 -0.041229 0.002309 +v -0.486995 -0.039392 0.003342 +v -0.457584 -0.071526 0.000278 +v -0.486002 -0.068886 0.001063 +v -0.372582 -0.047066 0.030989 +v -0.372582 -0.004185 0.046120 +v -0.372582 0.034449 0.032051 +v -0.511655 -0.005655 0.004951 +v -0.511655 -0.014323 0.009928 +v -0.511655 -0.021628 0.004951 +v -0.525395 -0.008758 0.002746 +v -0.515740 -0.008758 0.002746 +v -0.515740 -0.011890 0.004273 +v -0.515740 -0.014988 0.002825 +v -0.525395 -0.011890 0.004273 +v -0.525395 -0.014988 0.002825 +v 0.050480 0.059392 0.039776 +v 0.072830 0.059629 0.039819 +v 0.051873 0.128594 0.021423 +v 0.077776 0.128594 0.021466 +v 0.077804 -0.044805 0.044616 +v 0.051901 -0.044805 0.044573 +v 0.077804 0.002680 0.064537 +v 0.051901 0.002680 0.064494 +v 0.041517 0.093350 0.026237 +v 0.071378 0.088718 0.026280 +v -0.296392 -0.072896 -0.000000 +v -0.212611 -0.073334 -0.000000 +v 0.378243 0.071446 0.000000 +v -0.212611 0.072397 -0.000000 +v -0.296392 0.066926 -0.000000 +v 0.378953 -0.073334 0.000000 +v -0.510470 -0.002703 -0.000000 +v -0.510470 -0.026017 -0.000000 +v 0.470020 0.049546 0.000000 +v 0.470020 -0.069389 0.000000 +v 0.503090 0.022810 0.000000 +v 0.503090 -0.038159 0.000000 +v 0.513891 -0.007675 0.000000 +v -0.415462 0.032528 -0.000000 +v -0.414729 -0.050184 -0.000000 +v 0.103707 -0.073334 0.000000 +v 0.221664 0.076517 0.000000 +v 0.213663 -0.073334 0.000000 +v -0.016182 -0.073334 -0.000000 +v -0.024709 0.072856 -0.000000 +v 0.169800 0.129750 0.000000 +v -0.438241 -0.045372 -0.000000 +v 0.010750 0.113834 0.000000 +v 0.145284 -0.073334 0.000000 +v 0.145256 0.134263 0.000000 +v 0.025998 -0.073334 0.000000 +v 0.028811 0.131707 0.000000 +v -0.004471 0.093705 -0.000000 +v 0.192182 0.098774 0.000000 +v -0.438373 0.025623 -0.000000 +v -0.489175 -0.028118 -0.000000 +v -0.493179 0.005666 -0.000000 +v -0.457343 0.052215 -0.000000 +v -0.487158 0.049835 -0.000000 +v -0.447422 0.024231 -0.000000 +v -0.489644 0.010979 -0.000000 +v -0.446970 -0.041229 -0.000000 +v -0.488729 -0.039392 -0.000000 +v -0.457414 -0.071526 -0.000000 +v -0.487056 -0.068886 -0.000000 +v -0.372582 -0.058885 -0.000000 +v -0.372582 0.048949 -0.000000 +v -0.510470 -0.002703 -0.000000 +v -0.510470 -0.026017 -0.000000 +v -0.515740 -0.008758 -0.000000 +v -0.515225 -0.008032 -0.000000 +v -0.515740 -0.014988 -0.000000 +v -0.515225 -0.015781 -0.000000 +v -0.524880 -0.008032 -0.000000 +v -0.524880 -0.015781 -0.000000 +v -0.527347 -0.011810 -0.000000 +v 0.077804 -0.073334 0.000000 +v 0.051901 -0.073334 0.000000 +v 0.051873 0.134263 0.000000 +v 0.120025 0.131743 0.012698 +v 0.089441 0.131743 0.012647 +v 0.104733 0.131743 0.012672 +v 0.120025 0.134116 0.000000 +v 0.089441 0.134116 0.000000 +v 0.096949 0.133905 0.000000 +v 0.112517 0.133905 0.000000 +v 0.110237 0.131352 0.005504 +v 0.104733 0.131352 0.007784 +v 0.099229 0.131352 0.005504 +v 0.096949 0.146402 0.000000 +v 0.112517 0.146402 0.000000 +v 0.110237 0.146402 0.005504 +v 0.104733 0.146402 0.007784 +v 0.099229 0.146402 0.005504 +v 0.096949 0.309639 0.000000 +v 0.112517 0.309639 0.000000 +v 0.110237 0.309639 0.005504 +v 0.104733 0.309639 0.007784 +v 0.099229 0.309639 0.005504 +v 0.145706 0.318985 0.005504 +v 0.145706 0.324489 0.007784 +v 0.145706 0.329993 0.005504 +v 0.145706 0.332273 0.000000 +v 0.145706 0.316706 0.000000 +v 0.115907 0.316706 0.000000 +v 0.115907 0.332273 0.000000 +v 0.115907 0.329993 0.005504 +v 0.115907 0.324489 0.007784 +v 0.115907 0.318985 0.005504 +v 0.112981 0.314476 0.000000 +v 0.101974 0.325484 0.000000 +v 0.103586 0.323872 0.005504 +v 0.107478 0.319980 0.007784 +v 0.111369 0.316088 0.005504 +v 0.077776 0.133292 0.000000 +v 0.145706 0.319804 0.004685 +v 0.145706 0.324489 0.006626 +v 0.145706 0.329175 0.004685 +v 0.145706 0.331115 0.000000 +v 0.145706 0.317863 0.000000 +v 0.120728 0.330146 0.000000 +v 0.120728 0.328489 0.004000 +v 0.120728 0.324489 0.005656 +v 0.120728 0.320490 0.004000 +v 0.120728 0.318833 0.000000 +v 0.120728 0.324489 0.000000 +v 0.102383 0.109911 0.026878 +v 0.018593 0.124361 0.000000 +v 0.146509 0.110962 0.026891 +v 0.018918 0.119800 0.023713 +v 0.176358 0.112152 0.025424 +v 0.182451 0.118212 0.000000 +v 0.074675 0.109265 0.023799 +v 0.046854 0.111511 0.023756 +v 0.106319 0.101496 0.028531 +v 0.141797 0.100168 0.029340 +v 0.107087 0.103696 0.026878 +v 0.140874 0.104992 0.026891 +v 0.014671 0.119098 0.000000 +v 0.179464 0.101651 0.027380 +v 0.187317 0.109068 0.000000 +v 0.101694 0.100142 0.027239 +v 0.147175 0.101746 0.028116 +v 0.015169 0.115125 0.024953 +v 0.073027 0.098992 0.025039 +v 0.044185 0.102430 0.024996 +v 0.105455 0.102694 0.027239 +v 0.143547 0.102580 0.028116 +v 0.106319 0.101496 0.062227 +v 0.125329 0.100168 0.062227 +v 0.107087 0.103696 0.062227 +v 0.124406 0.104992 0.062227 +v 0.105455 0.102694 0.062227 +v 0.127079 0.102580 0.062227 +v 0.107364 0.101496 0.065167 +v 0.121148 0.100168 0.065167 +v 0.108133 0.103696 0.065167 +v 0.120226 0.104992 0.065167 +v 0.106501 0.102694 0.065167 +v 0.122898 0.102580 0.065167 +v -0.012813 0.073349 0.036122 +v 0.196426 0.071466 0.034717 +v 0.203515 0.084806 0.000000 +v 0.098092 0.075120 0.034196 +v -0.014590 0.083280 -0.000000 +v 0.146207 0.075843 0.034660 +v 0.019775 0.084803 0.032963 +v 0.072104 0.074173 0.033049 +v 0.045998 0.076371 0.033006 +v 0.424131 0.065797 0.000000 +v 0.424131 0.046842 0.040035 +v 0.424487 -0.002283 0.060537 +v 0.424487 -0.045435 0.042433 +v 0.424487 -0.071361 0.000000 +vt 0.956699 0.719683 +vt 0.973082 0.719310 +vt 0.974494 0.728254 +vt 0.949748 0.704509 +vt 0.974991 0.711418 +vt 0.958181 0.693076 +vt 0.977042 0.704159 +vt 0.907825 0.773992 +vt 0.887056 0.783358 +vt 0.880780 0.755188 +vt 0.286455 0.752799 +vt 0.137715 0.743003 +vt 0.138655 0.698133 +vt 0.694869 0.800055 +vt 0.769701 0.787194 +vt 0.776890 0.824753 +vt 0.277870 0.810293 +vt 0.267395 0.851549 +vt 0.123009 0.829069 +vt 0.688444 0.648397 +vt 0.767177 0.648892 +vt 0.765769 0.689809 +vt 0.288114 0.704141 +vt 0.135808 0.648392 +vt 0.689264 0.697552 +vt 0.766204 0.742566 +vt 0.131898 0.789275 +vt 0.690402 0.744884 +vt 0.097617 0.777222 +vt 0.084045 0.812811 +vt 0.045082 0.796553 +vt 0.103543 0.736881 +vt 0.063335 0.765169 +vt 0.101905 0.699179 +vt 0.069372 0.730760 +vt 0.093869 0.656193 +vt 0.065156 0.700224 +vt 0.037224 0.728794 +vt 0.032491 0.746804 +vt 0.033494 0.713118 +vt 0.021201 0.695908 +vt 0.017826 0.760292 +vt 0.010998 0.727527 +vt 0.977171 0.704193 +vt 0.975703 0.734427 +vt 0.974615 0.728233 +vt 0.838588 0.769634 +vt 0.835263 0.690651 +vt 0.839009 0.659916 +vt 0.879313 0.668961 +vt 0.835369 0.732184 +vt 0.877743 0.698691 +vt 0.877323 0.725104 +vt 0.415659 0.754567 +vt 0.419670 0.813267 +vt 0.398655 0.813246 +vt 0.415931 0.705907 +vt 0.391538 0.705777 +vt 0.391906 0.656135 +vt 0.391122 0.754382 +vt 0.351927 0.812827 +vt 0.352421 0.705403 +vt 0.289522 0.654422 +vt 0.468309 0.867106 +vt 0.471717 0.863299 +vt 0.483180 0.882615 +vt 0.351716 0.754025 +vt 0.505857 0.754851 +vt 0.504829 0.705273 +vt 0.699604 0.838311 +vt 0.522669 0.854806 +vt 0.503774 0.655536 +vt 0.511306 0.814964 +vt 0.352497 0.879550 +vt 0.351096 0.899092 +vt 0.324099 0.895900 +vt 0.308155 0.883658 +vt 0.323932 0.864809 +vt 0.329413 0.877829 +vt 0.493037 0.837225 +vt 0.500877 0.868485 +vt 0.353163 0.655720 +vt 0.351389 0.862551 +vt 0.442095 0.863398 +vt 0.464902 0.870842 +vt 0.458778 0.877530 +vt 0.897456 0.701066 +vt 0.896868 0.721761 +vt 0.465002 0.754877 +vt 0.464844 0.705847 +vt 0.464449 0.656145 +vt 0.462247 0.814277 +vt 0.466982 0.838788 +vt 0.447123 0.847503 +vt 0.350750 0.829156 +vt 0.349573 0.845485 +vt 0.317535 0.847624 +vt 0.502172 0.826094 +vt 0.280974 0.860490 +vt 0.297702 0.828959 +vt 0.511773 0.861646 +vt 0.395896 0.828442 +vt 0.393138 0.843639 +vt 0.922858 0.260577 +vt 0.925930 0.259385 +vt 0.935654 0.293772 +vt 0.901593 0.674617 +vt 0.899437 0.749902 +vt 0.960525 0.746115 +vt 0.954794 0.735768 +vt 0.912682 0.680414 +vt 0.950788 0.720117 +vt 0.949700 0.718292 +vt 0.909608 0.719599 +vt 0.918396 0.308253 +vt 0.918484 0.307670 +vt 0.934245 0.293888 +vt 0.890558 0.291134 +vt 0.890558 0.296112 +vt 0.917233 0.766853 +vt 0.953478 0.749118 +vt 0.956504 0.750947 +vt 0.708158 0.132508 +vt 0.704332 0.132234 +vt 0.716412 0.089060 +vt 0.773619 0.132508 +vt 0.746105 0.089377 +vt 0.748250 0.086560 +vt 0.909786 0.723528 +vt 0.908195 0.721502 +vt 0.949739 0.722183 +vt 0.782891 0.117603 +vt 0.808955 0.119545 +vt 0.810904 0.121963 +vt 0.719849 0.091084 +vt 0.835681 0.076855 +vt 0.838224 0.078280 +vt 0.771670 0.076855 +vt 0.779742 0.119304 +vt 0.947052 0.231319 +vt 0.942942 0.232366 +vt 0.937691 0.203709 +vt 0.910529 0.677094 +vt 0.948600 0.686253 +vt 0.915767 0.202873 +vt 0.938912 0.202873 +vt 0.902311 0.229152 +vt 0.916150 0.203292 +vt 0.898615 0.227897 +vt 0.847021 0.801607 +vt 0.973236 0.719313 +vt 0.980624 0.721996 +vt 0.975133 0.711453 +vt 0.981902 0.717750 +vt 0.983569 0.714759 +vt 0.992567 0.719520 +vt 0.980571 0.726412 +vt 0.989793 0.725888 +vt 0.990587 0.728388 +vt 0.981204 0.729516 +vt 0.993796 0.724584 +vt 0.989802 0.723612 +vt 0.990759 0.721624 +vt 0.420067 0.828054 +vt 0.420464 0.842841 +vt 0.443942 0.830522 +vt 0.391734 0.861782 +vt 0.417316 0.861560 +vt 0.414702 0.879465 +vt 0.438011 0.878742 +vt 0.463775 0.895049 +vt 0.439829 0.898990 +vt 0.440295 0.754740 +vt 0.440364 0.705938 +vt 0.440263 0.656268 +vt 0.416082 0.656257 +vt 0.440761 0.813541 +vt 0.403951 0.888257 +vt 0.415290 0.900009 +vt 0.390625 0.879851 +vt 0.374799 0.900133 +vt 0.375264 0.888040 +vt 0.384354 0.894908 +vt 0.389584 0.888211 +vt 0.389551 0.892816 +vt 0.394721 0.894985 +vt 0.404220 0.900399 +vt 0.397123 0.900623 +vt 0.201431 0.018740 +vt 0.204459 0.032820 +vt 0.198901 0.034006 +vt 0.185297 0.024764 +vt 0.190322 0.021174 +vt 0.193388 0.035191 +vt 0.207523 0.019904 +vt 0.210089 0.031604 +vt 0.195868 0.019959 +vt 0.242781 0.183629 +vt 0.237075 0.184535 +vt 0.231698 0.186019 +vt 0.226252 0.187508 +vt 0.220586 0.188371 +vt 0.227975 0.203945 +vt 0.232410 0.196081 +vt 0.237446 0.197744 +vt 0.231540 0.208340 +vt 0.242781 0.199409 +vt 0.213511 0.225097 +vt 0.210377 0.221512 +vt 0.235589 0.212241 +vt 0.215991 0.229265 +vt 0.219927 0.195976 +vt 0.221003 0.192874 +vt 0.226787 0.194301 +vt 0.206719 0.218153 +vt 0.224298 0.199339 +vt 0.202150 0.215354 +vt 0.206074 0.218974 +vt 0.209672 0.222170 +vt 0.215115 0.229392 +vt 0.212790 0.225598 +vt 0.140139 0.057135 +vt 0.157845 0.057141 +vt 0.152655 0.069659 +vt 0.198295 0.243393 +vt 0.195828 0.240517 +vt 0.152664 0.044619 +vt 0.193472 0.238001 +vt 0.190979 0.235622 +vt 0.201962 0.216530 +vt 0.874095 0.050219 +vt 0.875908 0.043938 +vt 0.878762 0.051906 +vt 0.418842 0.852187 +vt 0.444506 0.855530 +vt 0.392448 0.852757 +vt 0.350516 0.854102 +vt 0.301302 0.876545 +vt 0.320771 0.856514 +vt 0.473809 0.889187 +vt 0.920749 0.053099 +vt 0.907153 0.084830 +vt 0.895681 0.081984 +vt 0.922440 0.043939 +vt 0.958282 0.098639 +vt 0.954459 0.092451 +vt 0.956155 0.091536 +vt 0.913736 0.098639 +vt 0.918947 0.092696 +vt 0.923698 0.049927 +vt 0.922612 0.052967 +vt 0.915945 0.090531 +vt 0.933466 0.059802 +vt 0.294553 0.869430 +vt 0.912536 0.090359 +vt 0.478530 0.885930 +vt 0.936616 0.060625 +vt 0.937370 0.056797 +vt 0.908205 0.085437 +vt 0.906287 0.087309 +vt 0.949638 0.059539 +vt 0.893472 0.082637 +vt 0.896349 0.085428 +vt 0.898089 0.084370 +vt 0.905592 0.086379 +vt 0.948228 0.057363 +vt 0.939888 0.058329 +vt 0.949667 0.056538 +vt 0.051929 0.663994 +vt 0.975810 0.734403 +vt 0.916076 0.770760 +vt 0.951627 0.684121 +vt 0.381864 0.900481 +vt 0.187840 0.036396 +vt 0.188364 0.233395 +vt 0.875817 0.052307 +vt 0.951387 0.059099 +vt 0.776477 0.130857 +vt 0.768235 0.077013 +vt 0.140133 0.074841 +vt 0.140145 0.039428 +vt 0.960070 0.090264 +vn -0.551200 -0.039400 -0.833400 +vn -0.950700 -0.181400 0.251500 +vn -0.478000 0.752000 0.453900 +vn -0.367000 -0.671900 -0.643200 +vn -0.274600 -0.846900 0.455400 +vn -0.766600 -0.642000 0.000000 +vn -0.064600 -0.655500 0.752400 +vn -0.258500 0.966000 0.000000 +vn -0.318600 0.947900 0.000000 +vn -0.240900 0.665100 -0.706800 +vn 0.000700 0.014900 -0.999900 +vn 0.042200 0.043000 -0.998200 +vn 0.018500 -0.642400 -0.766100 +vn -0.030900 0.736000 -0.676200 +vn -0.141900 0.694100 -0.705700 +vn -0.154300 0.988000 0.000000 +vn 0.095700 0.641800 -0.760800 +vn 0.248600 0.968600 0.000000 +vn 0.080900 0.996700 0.000000 +vn 0.012600 -0.999900 0.000000 +vn -0.091000 -0.995800 0.000000 +vn -0.069900 -0.636500 -0.768100 +vn -0.001200 -0.645100 -0.764100 +vn 0.016700 -0.999800 0.000000 +vn -0.013600 -0.626200 -0.779500 +vn -0.102100 0.035900 -0.994100 +vn 0.044300 0.706400 -0.706400 +vn -0.043600 0.001400 -0.999000 +vn 0.145300 0.709100 -0.689900 +vn 0.206500 0.978400 0.000000 +vn 0.457000 0.889400 0.000000 +vn 0.098200 -0.004400 -0.995100 +vn 0.403100 0.630100 -0.663600 +vn 0.040000 -0.649700 -0.759100 +vn 0.355300 -0.025400 -0.934400 +vn 0.038500 -0.999200 0.000000 +vn 0.335300 -0.626100 -0.704000 +vn 0.793800 -0.020200 -0.607900 +vn 0.795500 0.449000 -0.406800 +vn 0.797000 -0.417400 -0.436500 +vn 0.788900 -0.614500 0.000000 +vn 0.771500 0.636200 0.000000 +vn 0.999900 -0.011200 0.000000 +vn -0.424100 -0.197000 0.883900 +vn -0.333300 0.680300 0.652700 +vn -0.619300 0.491800 0.612000 +vn -0.243400 0.662900 -0.708000 +vn -0.154900 -0.697800 -0.699300 +vn -0.161400 -0.986900 0.000000 +vn -0.225000 -0.974300 0.000000 +vn -0.154600 0.005400 -0.987900 +vn -0.166500 -0.672400 -0.721200 +vn -0.132100 -0.028700 -0.990800 +vn -0.001900 0.005700 -1.000000 +vn -0.005800 0.410100 -0.912000 +vn -0.010400 0.381400 -0.924300 +vn -0.001200 -0.643900 -0.765100 +vn -0.001500 -0.644200 -0.764800 +vn -0.000200 -1.000000 0.000000 +vn -0.001500 0.006100 -1.000000 +vn 0.004400 0.358000 -0.933700 +vn -0.001600 -0.644500 -0.764500 +vn -0.000300 -1.000000 0.000000 +vn -0.444900 0.536900 -0.716800 +vn -0.453900 0.563800 -0.690000 +vn -0.797300 0.603500 0.000000 +vn -0.002300 0.007600 -0.999900 +vn -0.003800 0.010800 -0.999900 +vn -0.001600 -0.643200 -0.765600 +vn -0.033600 0.999400 0.000000 +vn -0.435300 0.900300 0.000000 +vn -0.000400 -1.000000 0.000000 +vn -0.157500 0.582400 -0.797500 +vn 0.065100 0.732800 -0.677300 +vn 0.103200 0.994600 0.000000 +vn 0.423200 0.906000 0.000000 +vn 0.811000 0.585000 0.000000 +vn 0.528100 0.388400 -0.755100 +vn 0.377800 0.687000 -0.620700 +vn -0.508300 0.510500 -0.693500 +vn -0.759900 0.650000 0.000000 +vn 0.002900 0.215900 -0.976400 +vn 0.015900 0.138400 -0.990200 +vn -0.402800 0.612300 -0.680300 +vn -0.204100 0.722500 -0.660500 +vn -0.210700 -0.706700 -0.675400 +vn -0.192100 -0.068700 -0.978900 +vn -0.002300 0.007700 -0.999900 +vn -0.001700 -0.643500 -0.765400 +vn 0.011000 0.346500 -0.938000 +vn 0.076300 0.285500 -0.955300 +vn 0.081100 0.263600 -0.961200 +vn -0.001800 0.303300 -0.952900 +vn 0.013700 0.201500 -0.979400 +vn 0.394000 0.364600 -0.843700 +vn -0.501500 0.456800 -0.734700 +vn 0.604900 0.796200 0.000000 +vn 0.275900 0.577100 -0.768600 +vn -0.743800 0.668400 0.000000 +vn -0.037600 0.357100 -0.933300 +vn -0.070100 0.224100 -0.972000 +vn -0.640400 0.441500 -0.628400 +vn -0.940400 0.340000 0.000000 +vn -0.796300 0.604800 0.000000 +vn -0.301100 -0.953600 0.000000 +vn -0.261800 0.681400 -0.683400 +vn -0.721400 0.692500 0.000000 +vn -0.420600 0.637800 -0.645100 +vn 0.150900 -0.650100 -0.744700 +vn -0.873700 -0.014200 -0.486300 +vn -0.534800 -0.700100 -0.473000 +vn 0.033600 -0.716400 -0.696900 +vn 0.682100 0.731200 0.000000 +vn 0.233300 0.723400 -0.649700 +vn -0.286900 0.622500 -0.728100 +vn -0.078600 0.670900 -0.737400 +vn 0.427200 0.904100 0.000000 +vn 0.021400 0.660700 -0.750400 +vn 0.118800 -0.000200 -0.992900 +vn 0.682600 -0.029300 -0.730200 +vn -0.556800 0.672800 -0.487000 +vn -0.412400 0.699600 -0.583500 +vn -0.789700 -0.025000 -0.612900 +vn 0.189600 -0.676200 -0.711900 +vn -0.391100 -0.710400 -0.585100 +vn 0.212000 0.674900 -0.706800 +vn -0.998400 -0.056000 0.000000 +vn -0.591500 -0.244800 -0.768200 +vn -0.323400 -0.606300 -0.726400 +vn 0.134800 -0.990900 0.000000 +vn 0.682200 -0.731100 0.000000 +vn -0.818200 -0.574900 0.000000 +vn 0.295800 -0.710100 -0.638900 +vn -0.297300 0.954800 0.000000 +vn -0.668300 -0.047000 0.742400 +vn -0.479600 0.078300 -0.874000 +vn -0.697300 -0.326500 0.638100 +vn -0.544300 -0.656900 -0.521700 +vn -0.586300 -0.810100 0.000000 +vn -0.412900 -0.910700 0.000000 +vn -0.383600 0.731600 -0.563600 +vn -0.496300 0.690100 -0.526700 +vn -0.404600 0.914500 0.000000 +vn -0.429300 0.903100 0.000000 +vn -0.999900 0.010500 0.000000 +vn -0.482200 0.006100 -0.876000 +vn -0.501100 -0.679900 -0.535300 +vn -0.009900 0.410200 -0.911900 +vn -0.019500 0.276200 -0.960900 +vn 0.056800 0.368300 -0.927900 +vn -0.033000 0.154300 -0.987500 +vn -0.046800 0.123400 -0.991200 +vn -0.035700 0.676900 -0.735200 +vn -0.029300 0.675000 -0.737200 +vn -0.345600 0.938400 0.000000 +vn -0.036000 0.999300 0.000000 +vn -0.002200 0.006800 -1.000000 +vn -0.001200 -0.643800 -0.765200 +vn 0.000800 0.391100 -0.920300 +vn -0.000600 0.970800 -0.239800 +vn -0.035200 0.999400 0.000000 +vn 0.005800 0.680300 -0.732900 +vn -0.065700 0.997800 0.000000 +vn -0.022600 0.964400 -0.263300 +vn 0.310500 0.819400 -0.481800 +vn -0.000300 0.986300 -0.164700 +vn 0.000000 0.833700 -0.552200 +vn -0.310600 0.819400 -0.481800 +vn 0.027400 0.999600 0.000000 +vn -0.708400 0.705800 0.000000 +vn -0.707100 0.000000 -0.707100 +vn 0.000000 0.000000 -1.000000 +vn 0.708400 0.705800 0.000000 +vn 0.707100 0.000000 -0.707100 +vn -1.000000 0.000000 0.000000 +vn -0.989500 0.144100 0.000000 +vn -0.720100 0.106400 -0.685600 +vn -0.027600 0.011700 -0.999500 +vn 0.700800 -0.053300 -0.711400 +vn 0.998800 -0.048400 0.000000 +vn -0.026600 0.056900 -0.998000 +vn -0.077600 0.054200 -0.995500 +vn -0.573400 0.484400 -0.660700 +vn -0.169300 0.718400 -0.674700 +vn -0.754500 0.656200 0.000000 +vn 0.630200 0.549000 -0.549000 +vn 0.630200 0.000000 -0.776400 +vn -0.213600 0.976900 0.000000 +vn 0.630200 0.776400 0.000000 +vn 0.324100 -0.946000 0.000000 +vn 0.876400 -0.481600 0.000000 +vn 0.548000 -0.361400 -0.754300 +vn 0.630200 -0.549000 -0.549000 +vn 0.187000 -0.650000 -0.736600 +vn 0.630200 -0.776400 0.000000 +vn 0.814800 0.409900 0.409900 +vn 0.814800 0.000000 0.579700 +vn 0.814800 -0.579700 0.000000 +vn 0.814800 -0.409900 0.409900 +vn 1.000000 0.000000 0.000000 +vn 0.644800 0.000000 0.764400 +vn 0.644800 -0.540500 0.540500 +vn 0.644800 -0.764400 0.000000 +vn 0.644800 0.540500 0.540500 +vn 0.814800 0.579700 0.000000 +vn 0.068200 0.162600 -0.984300 +vn 0.362500 -0.291100 -0.885300 +vn -0.035400 0.126300 -0.991300 +vn 0.031500 0.127900 -0.991300 +vn -0.167000 0.134100 -0.976800 +vn 0.900300 0.435100 0.000000 +vn 0.570800 0.245100 -0.783600 +vn -0.681800 0.731600 0.000000 +vn -0.535100 -0.423900 -0.730800 +vn -0.519400 -0.849600 -0.091400 +vn 0.386500 -0.832800 -0.396300 +vn -0.124700 0.623100 -0.772100 +vn -0.388300 0.399500 -0.830400 +vn 0.098800 0.532300 -0.840800 +vn 0.283300 0.355800 -0.890500 +vn 0.796700 0.099400 -0.596100 +vn 0.861300 0.508000 0.000000 +vn -0.799100 0.601200 0.000000 +vn 0.322400 0.882300 -0.343000 +vn 0.413900 0.075400 -0.907200 +vn -0.970600 0.183300 -0.156000 +vn -0.698000 0.169200 -0.695800 +vn -0.334100 0.940700 -0.058700 +vn 0.097300 -0.732200 -0.674100 +vn -0.311500 -0.663800 -0.679900 +vn -0.200000 0.689000 -0.696600 +vn 0.062100 0.741600 -0.668000 +vn -0.223600 0.351800 0.908900 +vn -0.192200 -0.036700 0.980700 +vn -0.551200 -0.039400 0.833400 +vn -0.120200 -0.370700 0.920900 +vn -0.261800 0.681400 0.683400 +vn -0.240900 0.665100 0.706800 +vn 0.018500 -0.642400 0.766100 +vn 0.042200 0.043000 0.998200 +vn 0.000700 0.014900 0.999900 +vn -0.141900 0.694100 0.705700 +vn -0.030900 0.736000 0.676200 +vn 0.095700 0.641800 0.760800 +vn 0.044300 0.706400 0.706400 +vn -0.069900 -0.636500 0.768100 +vn -0.001200 -0.645100 0.764100 +vn -0.102100 0.035900 0.994100 +vn -0.013600 -0.626200 0.779500 +vn -0.043600 0.001400 0.999000 +vn 0.145300 0.709100 0.689900 +vn 0.403100 0.630100 0.663600 +vn 0.098200 -0.004400 0.995100 +vn 0.355300 -0.025400 0.934400 +vn 0.040000 -0.649700 0.759100 +vn 0.335300 -0.626100 0.704000 +vn 0.353900 -0.935300 0.000000 +vn 0.797000 -0.417400 0.436500 +vn 0.793800 -0.020200 0.607900 +vn 0.795500 0.449000 0.406800 +vn -0.538600 -0.252100 0.803900 +vn -0.404600 0.361000 0.840200 +vn -0.403300 0.320200 0.857200 +vn -0.243400 0.662900 0.708000 +vn -0.154900 -0.697800 0.699300 +vn -0.166500 -0.672400 0.721200 +vn -0.154600 0.005400 0.987900 +vn -0.132100 -0.028700 0.990800 +vn -0.001900 0.005700 1.000000 +vn -0.001500 0.006100 1.000000 +vn -0.010400 0.381400 0.924300 +vn -0.001500 -0.644200 0.764800 +vn -0.001200 -0.643900 0.765100 +vn 0.004400 0.358000 0.933700 +vn -0.001600 -0.644500 0.764500 +vn -0.453900 0.563800 0.690000 +vn -0.444900 0.536900 0.716800 +vn -0.002300 0.007600 0.999900 +vn -0.001600 -0.643200 0.765600 +vn -0.003800 0.010800 0.999900 +vn -0.157500 0.582400 0.797500 +vn 0.065100 0.732800 0.677300 +vn 0.377800 0.687000 0.620700 +vn -0.508300 0.510500 0.693500 +vn 0.002900 0.215900 0.976400 +vn 0.015900 0.138400 0.990200 +vn -0.029300 0.675000 0.737200 +vn -0.204100 0.722500 0.660500 +vn -0.192100 -0.068700 0.978900 +vn -0.210700 -0.706700 0.675400 +vn -0.001700 -0.643500 0.765400 +vn -0.002300 0.007700 0.999900 +vn 0.011000 0.346500 0.938000 +vn 0.081100 0.263600 0.961200 +vn 0.076300 0.285500 0.955300 +vn 0.394000 0.364600 0.843700 +vn 0.013700 0.201500 0.979400 +vn -0.001800 0.303300 0.952900 +vn -0.070100 0.224100 0.972000 +vn -0.640400 0.441500 0.628400 +vn -0.286900 0.622500 0.728100 +vn -0.420600 0.637800 0.645100 +vn -0.367000 -0.671900 0.643200 +vn -0.591500 -0.244800 0.768200 +vn 0.150900 -0.650100 0.744700 +vn -0.534800 -0.700100 0.473000 +vn -0.873700 -0.014200 0.486300 +vn 0.118800 -0.000200 0.992900 +vn 0.033600 -0.716400 0.696900 +vn 0.233300 0.723400 0.649700 +vn -0.078600 0.670900 0.737400 +vn 0.021400 0.660700 0.750400 +vn 0.212000 0.674900 0.706800 +vn 0.682600 -0.029300 0.730200 +vn -0.789700 -0.025000 0.612900 +vn -0.412400 0.699600 0.583500 +vn -0.556800 0.672800 0.487000 +vn -0.391100 -0.710400 0.585100 +vn 0.189600 -0.676200 0.711900 +vn -0.323400 -0.606300 0.726500 +vn 0.295800 -0.710100 0.638900 +vn -0.383600 0.731600 0.563600 +vn -0.479600 0.078300 0.874000 +vn -0.363600 -0.025600 0.931200 +vn -0.544300 -0.656900 0.521700 +vn -0.501100 -0.679900 0.535300 +vn -0.496300 0.690100 0.526700 +vn -0.482200 0.006100 0.876000 +vn -0.037600 0.357100 0.933300 +vn -0.019500 0.276200 0.960900 +vn 0.056800 0.368300 0.927900 +vn -0.033000 0.154300 0.987500 +vn 0.005800 0.680300 0.732900 +vn -0.035700 0.676900 0.735200 +vn -0.046800 0.123400 0.991200 +vn -0.001200 -0.643800 0.765200 +vn -0.002200 0.006800 1.000000 +vn 0.000800 0.391100 0.920300 +vn -0.005800 0.410100 0.912000 +vn -0.000600 0.970800 0.239800 +vn -0.000300 0.986300 0.164700 +vn 0.310500 0.819400 0.481800 +vn 0.000000 0.833700 0.552200 +vn -0.310600 0.819400 0.481800 +vn 0.000000 0.000000 1.000000 +vn -0.707100 0.000000 0.707100 +vn 0.707100 0.000000 0.707100 +vn -0.720100 0.106400 0.685600 +vn 0.700800 -0.053300 0.711400 +vn -0.027600 0.011700 0.999500 +vn -0.573400 0.484400 0.660700 +vn -0.077600 0.054200 0.995500 +vn -0.026600 0.056900 0.998000 +vn -0.169300 0.718400 0.674700 +vn 0.630200 0.000000 0.776400 +vn 0.630200 0.549000 0.549000 +vn 0.548000 -0.361400 0.754300 +vn 0.630200 -0.549000 0.549000 +vn 0.187000 -0.650000 0.736600 +vn -0.022600 0.964400 0.263300 +vn 0.814800 0.409900 -0.409900 +vn 0.814800 0.000000 -0.579700 +vn 0.814800 -0.409900 -0.409900 +vn 0.644800 -0.540500 -0.540500 +vn 0.644800 0.000000 -0.764400 +vn 0.644800 0.540500 -0.540500 +vn 0.644800 0.764400 0.000000 +vn 0.068200 0.162600 0.984300 +vn 0.283300 0.355800 0.890500 +vn 0.362500 -0.291100 0.885300 +vn -0.035400 0.126300 0.991300 +vn -0.167000 0.134100 0.976800 +vn 0.031500 0.127900 0.991300 +vn -0.402800 0.612300 0.680300 +vn 0.528100 0.388400 0.755100 +vn 0.386500 -0.832800 0.396300 +vn -0.519400 -0.849600 0.091400 +vn -0.535100 -0.423900 0.730800 +vn -0.388300 0.399500 0.830400 +vn -0.124700 0.623100 0.772100 +vn 0.098800 0.532300 0.840800 +vn 0.322400 0.882300 0.343000 +vn 0.796700 0.099400 0.596100 +vn 0.570800 0.245100 0.783600 +vn 0.062100 0.741600 0.668000 +vn 0.413900 0.075400 0.907200 +vn -0.311500 -0.663800 0.679900 +vn -0.698000 0.169200 0.695800 +vn -0.970600 0.183300 0.156000 +vn -0.334100 0.940700 0.058700 +vn 0.097300 -0.732200 0.674100 +vn -0.200000 0.689000 0.696600 +vn -0.009900 0.410200 0.911900 +vn -0.501500 0.456800 0.734700 +vn 0.275900 0.577100 0.768600 +usemtl Material +s 1 +f 50/1/1 5/2/2 4/3/3 +f 50/1/1 49/4/4 7/5/5 +f 284/6/6 261/7/7 7/5/5 +f 283/8/8 267/9/9 21/10/10 +f 28/11/11 1/12/12 6/13/13 +f 10/14/14 9/15/15 258/16/16 +f 26/17/17 270/18/18 256/19/19 +f 255/20/20 254/21/21 8/22/22 +f 27/23/23 6/13/13 259/24/24 +f 2/25/25 8/22/22 12/26/26 +f 26/17/17 3/27/27 1/12/12 +f 11/28/28 12/26/26 9/15/15 +f 158/29/29 398/30/30 262/31/31 +f 159/32/32 158/29/29 14/33/33 +f 160/34/34 159/32/32 13/35/35 +f 402/36/36 160/34/34 15/37/37 +f 15/37/37 13/35/35 16/38/38 +f 13/35/35 14/33/33 17/39/39 +f 15/37/37 18/40/40 265/41/41 +f 14/33/33 262/31/31 264/42/42 +f 18/40/40 16/38/38 266/43/43 +f 17/39/39 264/42/42 266/43/43 +f 7/5/5 261/7/7 297/44/44 +f 260/45/45 4/3/3 75/46/46 +f 74/47/47 21/10/10 267/9/9 +f 72/48/48 294/49/49 268/50/50 +f 73/51/51 72/48/48 19/52/52 +f 73/51/51 20/53/53 21/10/10 +f 90/54/54 85/55/55 23/56/56 +f 88/57/57 22/58/58 269/59/59 +f 90/54/54 25/60/60 22/58/58 +f 35/61/61 26/17/17 28/11/11 +f 24/62/62 27/23/23 271/63/63 +f 134/64/64 45/65/65 276/66/66 +f 34/67/67 28/11/11 27/23/23 +f 11/28/28 30/68/68 29/69/69 +f 10/14/14 257/70/70 273/71/71 +f 2/25/25 29/69/69 272/72/72 +f 11/28/28 10/14/14 31/73/73 +f 36/74/74 278/75/75 274/76/76 +f 360/77/77 124/78/78 33/79/79 +f 45/65/65 42/80/80 281/81/81 +f 25/60/60 34/67/67 24/62/62 +f 22/58/58 24/62/62 277/82/72 +f 25/60/60 23/56/56 35/61/61 +f 122/83/82 36/74/74 33/79/79 +f 126/84/83 123/85/84 40/86/85 +f 19/52/52 48/87/86 47/88/87 +f 30/68/68 39/89/88 38/90/89 +f 29/69/69 38/90/89 279/91/72 +f 30/68/68 31/73/73 37/92/90 +f 155/93/91 45/65/65 92/94/92 +f 154/95/93 44/96/94 43/97/95 +f 155/93/91 151/98/96 42/80/80 +f 391/99/97 152/100/98 43/97/95 +f 393/101/99 281/81/81 42/80/80 +f 154/95/93 153/102/100 41/103/101 +f 54/104/102 289/105/103 287/106/104 +f 19/52/52 268/50/50 275/107/105 +f 20/53/53 47/88/87 46/108/106 +f 260/45/45 285/109/107 51/110/108 +f 49/4/4 48/87/86 68/111/109 +f 50/1/1 60/112/110 59/113/111 +f 47/88/87 48/87/86 58/114/112 +f 286/115/113 52/116/114 53/117/115 +f 55/118/116 54/104/102 53/117/115 +f 288/119/117 55/118/116 52/116/114 +f 283/8/8 46/108/106 55/120/116 +f 51/110/108 54/121/102 55/120/116 +f 285/109/107 289/122/103 54/121/102 +f 56/123/118 57/124/119 63/125/120 +f 61/126/121 67/127/122 66/128/123 +f 51/110/108 46/108/106 56/129/118 +f 49/4/4 59/113/111 58/114/112 +f 47/88/87 57/130/119 56/129/118 +f 50/1/1 51/110/108 61/131/121 +f 64/132/124 65/133/125 66/134/123 +f 62/135/126 63/125/120 66/128/123 +f 56/123/118 62/135/126 67/127/122 +f 59/136/111 60/137/110 66/134/123 +f 58/138/112 59/136/111 65/133/125 +f 58/138/112 64/132/124 63/139/120 +f 291/140/127 69/141/128 71/142/129 +f 48/87/86 275/107/105 290/143/130 +f 284/6/6 49/4/4 69/144/128 +f 292/145/131 293/146/132 71/142/129 +f 69/141/128 68/147/109 70/148/133 +f 68/147/109 290/149/130 292/145/131 +f 9/15/15 74/47/47 295/150/134 +f 8/22/22 72/48/48 73/51/51 +f 12/26/26 73/51/51 74/47/47 +f 294/49/49 72/48/48 8/22/22 +f 75/46/46 76/151/135 80/152/136 +f 76/151/135 77/153/137 81/154/138 +f 5/2/2 7/5/5 77/153/137 +f 4/3/3 5/2/2 76/151/135 +f 81/154/138 301/155/139 303/156/140 +f 79/157/141 78/158/142 302/159/143 +f 75/46/46 79/157/141 299/160/144 +f 77/153/137 297/44/44 301/155/139 +f 304/161/145 302/159/143 78/158/142 +f 304/161/145 82/162/146 83/163/147 +f 81/154/138 83/163/147 82/162/146 +f 80/152/136 82/162/146 78/158/142 +f 153/102/100 156/164/148 93/165/149 +f 157/166/150 92/94/92 93/165/149 +f 121/167/151 125/168/152 87/169/153 +f 125/168/152 126/84/83 86/170/154 +f 280/171/155 307/172/156 86/170/154 +f 39/89/88 91/173/157 89/174/158 +f 91/173/157 90/54/54 88/57/57 +f 38/90/89 89/174/158 306/175/59 +f 89/174/158 88/57/57 305/176/59 +f 37/92/90 84/177/159 91/173/157 +f 91/173/157 84/177/159 85/55/55 +f 95/178/160 87/169/153 343/179/161 +f 32/180/162 87/169/153 95/178/160 +f 86/170/154 307/172/156 343/179/161 +f 311/181/163 94/182/164 97/183/165 +f 96/184/166 98/185/167 97/183/165 +f 96/184/166 95/178/160 99/186/168 +f 312/187/169 313/188/170 99/186/168 +f 99/189/168 102/190/171 101/191/172 +f 314/192/173 97/193/165 100/194/174 +f 313/195/170 318/196/175 102/190/171 +f 98/197/167 101/191/172 100/194/174 +f 318/196/175 323/198/176 105/199/177 +f 101/191/172 104/200/178 103/201/179 +f 102/190/171 105/199/177 104/200/178 +f 100/194/174 103/201/179 324/202/180 +f 110/203/181 113/204/182 112/205/183 +f 109/206/184 112/205/183 339/207/185 +f 109/206/184 108/208/186 107/209/187 +f 334/210/188 331/211/189 108/208/186 +f 333/212/190 338/213/191 114/214/192 +f 110/203/181 107/209/187 106/215/193 +f 111/216/194 106/215/193 332/217/195 +f 111/216/194 114/214/192 113/204/182 +f 103/201/179 114/214/192 338/213/191 +f 104/200/178 113/204/182 114/214/192 +f 105/199/177 112/205/183 113/204/182 +f 323/198/176 339/207/185 112/205/183 +f 94/182/164 311/181/163 278/75/75 +f 32/180/162 96/184/166 94/182/164 +f 332/217/195 106/215/193 115/218/196 +f 106/215/193 107/209/187 116/219/197 +f 331/211/189 347/220/198 117/221/199 +f 108/208/186 117/221/199 116/219/197 +f 354/222/200 119/223/201 118/224/202 +f 347/220/198 349/225/203 118/226/202 +f 120/227/204 119/223/201 354/222/200 +f 116/219/197 117/221/199 118/226/202 +f 116/219/197 119/228/201 120/229/204 +f 348/230/205 115/218/196 120/229/204 +f 133/231/206 44/232/94 128/233/207 +f 32/180/162 36/74/74 122/83/82 +f 135/234/208 136/235/209 126/84/83 +f 132/236/210 135/234/208 125/168/152 +f 136/235/209 134/64/64 123/85/84 +f 133/237/206 122/83/82 124/78/78 +f 369/238/211 131/239/212 124/78/78 +f 40/86/85 123/85/84 356/240/213 +f 127/241/214 139/242/215 140/243/216 +f 41/244/101 127/241/214 128/233/207 +f 121/245/151 129/246/217 137/247/218 +f 121/245/151 122/248/82 130/249/219 +f 132/250/210 137/251/218 127/241/214 +f 130/249/219 138/252/220 144/253/221 +f 282/254/222 43/97/95 131/239/212 +f 44/96/94 133/237/206 131/239/212 +f 92/94/92 45/65/65 134/64/64 +f 41/103/101 93/165/149 135/234/208 +f 93/165/149 92/94/92 136/235/209 +f 122/248/82 133/255/206 138/252/220 +f 123/85/84 134/64/64 367/256/223 +f 142/257/224 144/253/221 150/258/225 +f 139/242/215 143/259/226 149/260/227 +f 127/241/214 137/251/218 143/259/226 +f 129/246/217 130/249/219 142/257/224 +f 137/247/218 129/246/217 141/261/228 +f 128/233/207 140/243/216 144/262/221 +f 150/263/225 146/264/229 145/265/230 +f 147/266/231 148/267/232 150/258/225 +f 139/242/215 145/265/230 146/264/229 +f 140/243/216 146/264/229 150/263/225 +f 141/261/228 142/257/224 148/267/232 +f 141/261/228 147/266/231 149/268/227 +f 84/177/159 157/166/150 156/164/148 +f 23/56/56 85/55/55 156/164/148 +f 35/61/61 23/56/56 153/102/100 +f 273/71/71 393/101/99 151/98/96 +f 270/18/18 26/17/17 152/100/98 +f 37/92/90 31/73/73 151/98/96 +f 35/61/61 154/95/93 152/100/98 +f 37/92/90 155/93/91 157/166/150 +f 259/24/24 6/13/13 160/34/34 +f 6/13/13 1/12/12 159/32/32 +f 1/12/12 3/27/27 158/29/29 +f 3/27/27 256/19/19 398/30/30 +f 164/3/233 165/2/234 210/1/235 +f 210/1/235 165/2/234 167/5/236 +f 167/5/236 261/7/7 284/6/6 +f 283/8/8 206/108/237 181/10/238 +f 166/13/239 161/12/240 188/11/241 +f 258/16/16 169/15/242 170/14/243 +f 186/17/244 163/27/245 256/19/19 +f 168/22/246 254/21/21 255/20/20 +f 259/24/24 166/13/239 187/23/247 +f 172/26/248 168/22/246 162/25/249 +f 161/12/240 163/27/245 186/17/244 +f 169/15/242 172/26/248 171/28/250 +f 399/29/251 174/33/252 262/31/31 +f 400/32/253 173/35/254 174/33/252 +f 401/34/255 175/37/256 173/35/254 +f 402/36/36 263/269/257 175/37/256 +f 175/37/256 178/40/258 176/38/259 +f 173/35/254 176/38/259 177/39/260 +f 265/41/41 178/40/258 175/37/256 +f 174/33/252 177/39/260 264/42/42 +f 178/40/258 265/41/41 266/43/43 +f 266/43/43 264/42/42 177/39/260 +f 167/5/236 237/153/261 297/44/44 +f 260/45/45 296/270/262 235/46/263 +f 267/9/9 181/10/238 234/47/264 +f 232/48/265 179/52/266 268/50/50 +f 233/51/267 180/53/268 179/52/266 +f 181/10/238 180/53/268 233/51/267 +f 250/54/269 185/60/270 183/56/271 +f 269/59/59 182/58/272 248/57/273 +f 182/58/272 185/60/270 250/54/269 +f 188/11/241 186/17/244 195/61/274 +f 271/63/63 187/23/247 184/62/275 +f 276/66/66 205/65/276 372/64/277 +f 187/23/247 188/11/241 194/67/278 +f 189/69/279 190/68/280 171/28/250 +f 170/14/243 191/73/281 273/71/71 +f 272/72/72 189/69/279 162/25/249 +f 171/28/250 190/68/280 191/73/281 +f 196/74/282 193/79/283 274/76/76 +f 360/77/77 274/76/76 193/79/283 +f 281/81/81 202/80/284 205/65/276 +f 184/62/275 194/67/278 185/60/270 +f 277/82/72 184/62/275 182/58/272 +f 185/60/270 194/67/278 195/61/274 +f 193/79/283 196/74/282 357/83/285 +f 362/84/286 246/170/287 200/86/288 +f 207/88/289 208/87/290 179/52/266 +f 198/90/291 199/89/292 190/68/280 +f 279/91/72 198/90/291 189/69/279 +f 190/68/280 199/89/292 197/92/293 +f 252/94/294 205/65/276 395/93/295 +f 203/97/296 204/96/297 394/95/298 +f 395/93/295 205/65/276 202/80/284 +f 391/99/97 282/254/222 203/97/296 +f 202/80/284 281/81/81 393/101/99 +f 394/95/298 204/96/297 201/103/299 +f 214/104/300 213/117/301 287/106/104 +f 179/52/266 208/87/290 275/107/105 +f 206/108/237 207/88/289 180/53/268 +f 260/45/45 164/3/233 211/110/302 +f 209/4/303 229/144/304 228/111/305 +f 219/113/306 220/112/307 210/1/235 +f 207/88/289 217/130/308 218/114/309 +f 213/117/301 212/116/310 286/115/113 +f 215/118/311 212/116/310 213/117/301 +f 288/119/117 286/115/113 212/116/310 +f 283/8/8 288/271/117 215/120/311 +f 215/120/311 214/121/300 211/110/302 +f 214/121/300 289/122/103 285/109/107 +f 216/123/312 222/135/313 223/125/314 +f 226/128/315 227/127/316 221/126/317 +f 211/110/302 221/131/317 216/129/312 +f 218/114/309 219/113/306 209/4/303 +f 216/129/312 217/130/308 207/88/289 +f 210/1/235 220/112/307 221/131/317 +f 226/134/315 225/133/318 224/132/319 +f 222/135/313 227/127/316 226/128/315 +f 227/127/316 222/135/313 216/123/312 +f 219/136/306 225/133/318 226/134/315 +f 218/138/309 224/132/319 225/133/318 +f 223/139/314 224/132/319 218/138/309 +f 291/140/127 293/146/132 231/142/320 +f 208/87/290 228/111/305 290/143/130 +f 284/6/6 291/272/127 229/144/304 +f 231/142/320 293/146/132 292/145/131 +f 229/141/304 231/142/320 230/148/321 +f 228/147/305 230/148/321 292/145/131 +f 169/15/242 258/16/16 295/150/134 +f 168/22/246 172/26/248 233/51/267 +f 172/26/248 169/15/242 234/47/264 +f 168/22/246 232/48/265 294/49/49 +f 235/46/263 239/157/322 240/152/323 +f 236/151/324 240/152/323 241/154/325 +f 165/2/234 236/151/324 237/153/261 +f 164/3/233 235/46/263 236/151/324 +f 241/154/325 243/163/326 303/156/140 +f 302/159/143 238/158/327 239/157/322 +f 299/160/144 239/157/322 235/46/263 +f 237/153/261 241/154/325 301/155/139 +f 238/158/327 302/159/143 304/161/145 +f 243/163/326 242/162/328 304/161/145 +f 242/162/328 243/163/326 241/154/325 +f 238/158/327 242/162/328 240/152/323 +f 392/102/329 201/103/299 253/165/330 +f 253/165/330 252/94/294 397/166/331 +f 355/167/332 192/180/333 247/169/334 +f 361/168/335 247/169/334 246/170/287 +f 246/170/287 307/172/156 280/171/155 +f 249/174/336 251/173/337 199/89/292 +f 248/57/273 250/54/269 251/173/337 +f 306/175/59 249/174/336 198/90/291 +f 305/176/59 248/57/273 249/174/336 +f 251/173/337 244/177/338 197/92/293 +f 251/173/337 250/54/269 245/55/339 +f 343/179/161 247/169/334 309/178/340 +f 192/180/333 310/184/341 309/178/340 +f 343/179/161 307/172/156 246/170/287 +f 311/181/163 314/273/173 315/183/342 +f 315/183/342 316/185/343 310/184/341 +f 310/184/341 316/185/343 317/186/344 +f 317/186/344 313/188/170 312/187/169 +f 321/191/345 322/190/346 317/189/344 +f 314/192/173 319/274/200 320/194/347 +f 322/190/346 318/196/175 313/195/170 +f 320/194/347 321/191/345 316/197/343 +f 327/199/348 323/198/176 318/196/175 +f 325/201/349 326/200/350 321/191/345 +f 326/200/350 327/199/348 322/190/346 +f 324/202/180 325/201/349 320/194/347 +f 340/205/351 341/204/352 336/203/353 +f 339/207/185 340/205/351 335/206/354 +f 329/209/355 330/208/356 335/206/354 +f 330/208/356 331/211/189 334/210/188 +f 342/214/357 338/213/191 333/212/190 +f 328/215/358 329/209/355 336/203/353 +f 332/217/195 328/215/358 337/216/359 +f 341/204/352 342/214/357 337/216/359 +f 325/201/349 324/202/180 338/213/191 +f 326/200/350 325/201/349 342/214/357 +f 327/199/348 326/200/350 341/204/352 +f 323/198/176 327/199/348 340/205/351 +f 278/75/75 311/181/163 308/182/360 +f 308/182/360 310/184/341 192/180/333 +f 332/217/195 348/230/205 344/218/361 +f 328/215/358 344/218/361 345/219/362 +f 346/221/363 347/220/198 331/211/189 +f 345/219/362 346/221/363 330/208/356 +f 350/224/364 351/223/365 354/222/200 +f 350/226/364 349/225/203 347/220/198 +f 354/222/200 351/223/365 352/227/366 +f 351/228/365 350/226/364 346/221/363 +f 352/229/366 351/228/365 345/219/362 +f 353/275/367 352/229/366 344/218/361 +f 371/231/368 376/276/369 364/233/370 +f 192/180/333 355/167/332 357/83/285 +f 373/234/371 361/168/335 362/84/286 +f 370/236/372 355/167/332 361/168/335 +f 374/235/373 362/84/286 358/85/374 +f 359/78/375 357/83/285 371/237/368 +f 369/238/211 360/77/77 359/78/375 +f 356/240/213 358/85/374 200/86/288 +f 378/243/376 377/242/377 363/241/378 +f 364/233/370 363/241/378 201/244/299 +f 375/247/379 365/246/380 355/245/332 +f 355/245/332 365/246/380 366/249/381 +f 363/241/378 375/251/379 370/250/372 +f 366/249/381 380/257/382 382/253/383 +f 282/254/222 369/238/211 368/239/384 +f 368/239/384 371/237/368 204/96/297 +f 252/94/294 374/235/373 372/64/277 +f 201/103/299 370/236/372 373/234/371 +f 253/165/330 373/234/371 374/235/373 +f 357/248/285 366/249/381 376/252/369 +f 367/256/223 372/64/277 358/85/374 +f 380/257/382 386/267/385 388/258/386 +f 377/242/377 383/265/387 387/260/388 +f 363/241/378 377/242/377 381/259/389 +f 365/246/380 379/261/390 380/257/382 +f 375/247/379 381/277/389 379/261/390 +f 382/262/383 378/243/376 364/233/370 +f 383/265/387 384/264/391 388/263/386 +f 385/266/392 387/268/388 388/258/386 +f 384/264/391 383/265/387 377/242/377 +f 388/263/386 384/264/391 378/243/376 +f 379/261/390 385/266/392 386/267/385 +f 387/268/388 385/266/392 379/261/390 +f 396/164/393 397/166/331 244/177/338 +f 183/56/271 392/102/329 396/164/393 +f 195/61/274 394/95/298 392/102/329 +f 389/98/394 393/101/99 273/71/71 +f 270/18/18 391/99/97 390/100/395 +f 197/92/293 395/93/295 389/98/394 +f 390/100/395 394/95/298 195/61/274 +f 397/166/331 395/93/295 197/92/293 +f 259/24/24 402/36/36 401/34/255 +f 166/13/239 401/34/255 400/32/253 +f 161/12/240 400/32/253 399/29/251 +f 163/27/245 399/29/251 398/30/30 +f 51/110/108 50/1/1 4/3/3 +f 5/2/2 50/1/1 7/5/5 +f 49/4/4 284/6/6 7/5/5 +f 46/108/106 283/8/8 21/10/10 +f 27/23/23 28/11/11 6/13/13 +f 257/70/70 10/14/14 258/16/16 +f 3/27/27 26/17/17 256/19/19 +f 2/25/25 255/20/20 8/22/22 +f 271/63/63 27/23/23 259/24/24 +f 11/28/28 2/25/25 12/26/26 +f 28/11/11 26/17/17 1/12/12 +f 10/14/14 11/28/28 9/15/15 +f 14/33/33 158/29/29 262/31/31 +f 13/35/35 159/32/32 14/33/33 +f 15/37/37 160/34/34 13/35/35 +f 263/269/257 402/36/36 15/37/37 +f 18/40/40 15/37/37 16/38/38 +f 16/38/38 13/35/35 17/39/39 +f 263/269/257 15/37/37 265/41/41 +f 17/39/39 14/33/33 264/42/42 +f 265/41/41 18/40/40 266/43/43 +f 16/38/38 17/39/39 266/43/43 +f 77/153/137 7/5/5 297/44/44 +f 296/270/262 260/45/45 75/46/46 +f 295/150/134 74/47/47 267/9/9 +f 19/52/52 72/48/48 268/50/50 +f 20/53/53 73/51/51 19/52/52 +f 74/47/47 73/51/51 21/10/10 +f 25/60/60 90/54/54 23/56/56 +f 305/176/59 88/57/57 269/59/59 +f 88/57/57 90/54/54 22/58/58 +f 34/67/67 35/61/61 28/11/11 +f 277/82/72 24/62/62 271/63/63 +f 367/256/223 134/64/64 276/66/66 +f 24/62/62 34/67/67 27/23/23 +f 2/25/25 11/28/28 29/69/69 +f 31/73/73 10/14/14 273/71/71 +f 255/20/20 2/25/25 272/72/72 +f 30/68/68 11/28/28 31/73/73 +f 33/79/79 36/74/74 274/76/76 +f 274/76/76 360/77/77 33/79/79 +f 276/66/66 45/65/65 281/81/81 +f 22/58/58 25/60/60 24/62/62 +f 269/59/59 22/58/58 277/82/72 +f 34/67/67 25/60/60 35/61/61 +f 124/78/78 122/83/82 33/79/79 +f 86/170/154 126/84/83 40/86/85 +f 20/53/53 19/52/52 47/88/87 +f 29/69/69 30/68/68 38/90/89 +f 272/72/72 29/69/69 279/91/72 +f 39/89/88 30/68/68 37/92/90 +f 157/166/150 155/93/91 92/94/92 +f 152/100/98 154/95/93 43/97/95 +f 45/65/65 155/93/91 42/80/80 +f 282/254/222 391/99/97 43/97/95 +f 151/98/96 393/101/99 42/80/80 +f 44/96/94 154/95/93 41/103/101 +f 53/117/115 54/104/102 287/106/104 +f 48/87/86 19/52/52 275/107/105 +f 21/10/10 20/53/53 46/108/106 +f 4/3/3 260/45/45 51/110/108 +f 69/144/128 49/4/4 68/111/109 +f 49/4/4 50/1/1 59/113/111 +f 57/130/119 47/88/87 58/114/112 +f 287/106/104 286/115/113 53/117/115 +f 52/116/114 55/118/116 53/117/115 +f 286/115/113 288/119/117 52/116/114 +f 288/271/117 283/8/8 55/120/116 +f 46/108/106 51/110/108 55/120/116 +f 51/110/108 285/109/107 54/121/102 +f 62/135/126 56/123/118 63/125/120 +f 60/278/110 61/126/121 66/128/123 +f 61/131/121 51/110/108 56/129/118 +f 48/87/86 49/4/4 58/114/112 +f 46/108/106 47/88/87 56/129/118 +f 60/112/110 50/1/1 61/131/121 +f 63/139/120 64/132/124 66/134/123 +f 67/127/122 62/135/126 66/128/123 +f 61/126/121 56/123/118 67/127/122 +f 65/133/125 59/136/111 66/134/123 +f 64/132/124 58/138/112 65/133/125 +f 57/279/119 58/138/112 63/139/120 +f 293/146/132 291/140/127 71/142/129 +f 68/111/109 48/87/86 290/143/130 +f 291/272/127 284/6/6 69/144/128 +f 70/148/133 292/145/131 71/142/129 +f 71/142/129 69/141/128 70/148/133 +f 70/148/133 68/147/109 292/145/131 +f 258/16/16 9/15/15 295/150/134 +f 12/26/26 8/22/22 73/51/51 +f 9/15/15 12/26/26 74/47/47 +f 254/21/21 294/49/49 8/22/22 +f 79/157/141 75/46/46 80/152/136 +f 80/152/136 76/151/135 81/154/138 +f 76/151/135 5/2/2 77/153/137 +f 75/46/46 4/3/3 76/151/135 +f 83/163/147 81/154/138 303/156/140 +f 299/160/144 79/157/141 302/159/143 +f 296/270/262 75/46/46 299/160/144 +f 81/154/138 77/153/137 301/155/139 +f 82/162/146 304/161/145 78/158/142 +f 303/156/140 304/161/145 83/163/147 +f 80/152/136 81/154/138 82/162/146 +f 79/157/141 80/152/136 78/158/142 +f 41/103/101 153/102/100 93/165/149 +f 156/164/148 157/166/150 93/165/149 +f 32/180/162 121/167/151 87/169/153 +f 87/169/153 125/168/152 86/170/154 +f 40/86/85 280/171/155 86/170/154 +f 38/90/89 39/89/88 89/174/158 +f 89/174/158 91/173/157 88/57/57 +f 279/91/72 38/90/89 306/175/59 +f 306/175/59 89/174/158 305/176/59 +f 39/89/88 37/92/90 91/173/157 +f 90/54/54 91/173/157 85/55/55 +f 312/187/169 95/178/160 343/179/161 +f 96/184/166 32/180/162 95/178/160 +f 87/169/153 86/170/154 343/179/161 +f 314/273/173 311/181/163 97/183/165 +f 94/182/164 96/184/166 97/183/165 +f 98/185/167 96/184/166 99/186/168 +f 95/178/160 312/187/169 99/186/168 +f 98/197/167 99/189/168 101/191/172 +f 319/274/200 314/192/173 100/194/174 +f 99/189/168 313/195/170 102/190/171 +f 97/193/165 98/197/167 100/194/174 +f 102/190/171 318/196/175 105/199/177 +f 100/194/174 101/191/172 103/201/179 +f 101/191/172 102/190/171 104/200/178 +f 319/274/200 100/194/174 324/202/180 +f 109/206/184 110/203/181 112/205/183 +f 334/210/188 109/206/184 339/207/185 +f 110/203/181 109/206/184 107/209/187 +f 109/206/184 334/210/188 108/208/186 +f 111/216/194 333/212/190 114/214/192 +f 111/216/194 110/203/181 106/215/193 +f 333/212/190 111/216/194 332/217/195 +f 110/203/181 111/216/194 113/204/182 +f 324/202/180 103/201/179 338/213/191 +f 103/201/179 104/200/178 114/214/192 +f 104/200/178 105/199/177 113/204/182 +f 105/199/177 323/198/176 112/205/183 +f 36/74/74 94/182/164 278/75/75 +f 36/74/74 32/180/162 94/182/164 +f 348/230/205 332/217/195 115/218/196 +f 115/218/196 106/215/193 116/219/197 +f 108/208/186 331/211/189 117/221/199 +f 107/209/187 108/208/186 116/219/197 +f 349/280/203 354/222/200 118/224/202 +f 117/221/199 347/220/198 118/226/202 +f 353/281/367 120/227/204 354/222/200 +f 119/228/201 116/219/197 118/226/202 +f 115/218/196 116/219/197 120/229/204 +f 353/275/367 348/230/205 120/229/204 +f 138/276/220 133/231/206 128/233/207 +f 121/167/151 32/180/162 122/83/82 +f 125/168/152 135/234/208 126/84/83 +f 121/167/151 132/236/210 125/168/152 +f 126/84/83 136/235/209 123/85/84 +f 131/239/212 133/237/206 124/78/78 +f 360/77/77 369/238/211 124/78/78 +f 280/171/155 40/86/85 356/240/213 +f 128/233/207 127/241/214 140/243/216 +f 44/232/94 41/244/101 128/233/207 +f 132/282/210 121/245/151 137/247/218 +f 129/246/217 121/245/151 130/249/219 +f 41/244/101 132/250/210 127/241/214 +f 142/257/224 130/249/219 144/253/221 +f 369/238/211 282/254/222 131/239/212 +f 43/97/95 44/96/94 131/239/212 +f 136/235/209 92/94/92 134/64/64 +f 132/236/210 41/103/101 135/234/208 +f 135/234/208 93/165/149 136/235/209 +f 130/249/219 122/248/82 138/252/220 +f 356/240/213 123/85/84 367/256/223 +f 148/267/232 142/257/224 150/258/225 +f 145/265/230 139/242/215 149/260/227 +f 139/242/215 127/241/214 143/259/226 +f 141/261/228 129/246/217 142/257/224 +f 143/277/226 137/247/218 141/261/228 +f 138/276/220 128/233/207 144/262/221 +f 149/260/227 150/263/225 145/265/230 +f 149/268/227 147/266/231 150/258/225 +f 140/243/216 139/242/215 146/264/229 +f 144/262/221 140/243/216 150/263/225 +f 147/266/231 141/261/228 148/267/232 +f 143/277/226 141/261/228 149/268/227 +f 85/55/55 84/177/159 156/164/148 +f 153/102/100 23/56/56 156/164/148 +f 154/95/93 35/61/61 153/102/100 +f 31/73/73 273/71/71 151/98/96 +f 391/99/97 270/18/18 152/100/98 +f 155/93/91 37/92/90 151/98/96 +f 26/17/17 35/61/61 152/100/98 +f 84/177/159 37/92/90 157/166/150 +f 402/36/36 259/24/24 160/34/34 +f 160/34/34 6/13/13 159/32/32 +f 159/32/32 1/12/12 158/29/29 +f 158/29/29 3/27/27 398/30/30 +f 211/110/302 164/3/233 210/1/235 +f 209/4/303 210/1/235 167/5/236 +f 209/4/303 167/5/236 284/6/6 +f 267/9/9 283/8/8 181/10/238 +f 187/23/247 166/13/239 188/11/241 +f 257/70/70 258/16/16 170/14/243 +f 270/18/18 186/17/244 256/19/19 +f 162/25/249 168/22/246 255/20/20 +f 271/63/63 259/24/24 187/23/247 +f 171/28/250 172/26/248 162/25/249 +f 188/11/241 161/12/240 186/17/244 +f 170/14/243 169/15/242 171/28/250 +f 398/30/30 399/29/251 262/31/31 +f 399/29/251 400/32/253 174/33/252 +f 400/32/253 401/34/255 173/35/254 +f 401/34/255 402/36/36 175/37/256 +f 173/35/254 175/37/256 176/38/259 +f 174/33/252 173/35/254 177/39/260 +f 263/269/257 265/41/41 175/37/256 +f 262/31/31 174/33/252 264/42/42 +f 176/38/259 178/40/258 266/43/43 +f 176/38/259 266/43/43 177/39/260 +f 261/7/7 167/5/236 297/44/44 +f 164/3/233 260/45/45 235/46/263 +f 295/150/134 267/9/9 234/47/264 +f 294/49/49 232/48/265 268/50/50 +f 232/48/265 233/51/267 179/52/266 +f 234/47/264 181/10/238 233/51/267 +f 245/55/339 250/54/269 183/56/271 +f 305/176/59 269/59/59 248/57/273 +f 248/57/273 182/58/272 250/54/269 +f 194/67/278 188/11/241 195/61/274 +f 277/82/72 271/63/63 184/62/275 +f 367/256/223 276/66/66 372/64/277 +f 184/62/275 187/23/247 194/67/278 +f 162/25/249 189/69/279 171/28/250 +f 257/70/70 170/14/243 273/71/71 +f 255/20/20 272/72/72 162/25/249 +f 170/14/243 171/28/250 191/73/281 +f 278/75/75 196/74/282 274/76/76 +f 359/78/375 360/77/77 193/79/283 +f 276/66/66 281/81/81 205/65/276 +f 182/58/272 184/62/275 185/60/270 +f 269/59/59 277/82/72 182/58/272 +f 183/56/271 185/60/270 195/61/274 +f 359/78/375 193/79/283 357/83/285 +f 358/85/374 362/84/286 200/86/288 +f 180/53/268 207/88/289 179/52/266 +f 189/69/279 198/90/291 190/68/280 +f 272/72/72 279/91/72 189/69/279 +f 191/73/281 190/68/280 197/92/293 +f 397/166/331 252/94/294 395/93/295 +f 390/100/395 203/97/296 394/95/298 +f 389/98/394 395/93/295 202/80/284 +f 390/100/395 391/99/97 203/97/296 +f 389/98/394 202/80/284 393/101/99 +f 392/102/329 394/95/298 201/103/299 +f 289/105/103 214/104/300 287/106/104 +f 268/50/50 179/52/266 275/107/105 +f 181/10/238 206/108/237 180/53/268 +f 285/109/107 260/45/45 211/110/302 +f 208/87/290 209/4/303 228/111/305 +f 209/4/303 219/113/306 210/1/235 +f 208/87/290 207/88/289 218/114/309 +f 287/106/104 213/117/301 286/115/113 +f 214/104/300 215/118/311 213/117/301 +f 215/118/311 288/119/117 212/116/310 +f 206/108/237 283/8/8 215/120/311 +f 206/108/237 215/120/311 211/110/302 +f 211/110/302 214/121/300 285/109/107 +f 217/124/308 216/123/312 223/125/314 +f 220/278/307 226/128/315 221/126/317 +f 206/108/237 211/110/302 216/129/312 +f 208/87/290 218/114/309 209/4/303 +f 206/108/237 216/129/312 207/88/289 +f 211/110/302 210/1/235 221/131/317 +f 223/139/314 226/134/315 224/132/319 +f 223/125/314 222/135/313 226/128/315 +f 221/126/317 227/127/316 216/123/312 +f 220/137/307 219/136/306 226/134/315 +f 219/136/306 218/138/309 225/133/318 +f 217/279/308 223/139/314 218/138/309 +f 229/141/304 291/140/127 231/142/320 +f 275/107/105 208/87/290 290/143/130 +f 209/4/303 284/6/6 229/144/304 +f 230/148/321 231/142/320 292/145/131 +f 228/147/305 229/141/304 230/148/321 +f 290/149/130 228/147/305 292/145/131 +f 234/47/264 169/15/242 295/150/134 +f 232/48/265 168/22/246 233/51/267 +f 233/51/267 172/26/248 234/47/264 +f 254/21/21 168/22/246 294/49/49 +f 236/151/324 235/46/263 240/152/323 +f 237/153/261 236/151/324 241/154/325 +f 167/5/236 165/2/234 237/153/261 +f 165/2/234 164/3/233 236/151/324 +f 301/155/139 241/154/325 303/156/140 +f 299/160/144 302/159/143 239/157/322 +f 296/270/262 299/160/144 235/46/263 +f 297/44/44 237/153/261 301/155/139 +f 242/162/328 238/158/327 304/161/145 +f 303/156/140 243/163/326 304/161/145 +f 240/152/323 242/162/328 241/154/325 +f 239/157/322 238/158/327 240/152/323 +f 396/164/393 392/102/329 253/165/330 +f 396/164/393 253/165/330 397/166/331 +f 361/168/335 355/167/332 247/169/334 +f 362/84/286 361/168/335 246/170/287 +f 200/86/288 246/170/287 280/171/155 +f 198/90/291 249/174/336 199/89/292 +f 249/174/336 248/57/273 251/173/337 +f 279/91/72 306/175/59 198/90/291 +f 306/175/59 305/176/59 249/174/336 +f 199/89/292 251/173/337 197/92/293 +f 244/177/338 251/173/337 245/55/339 +f 312/187/169 343/179/161 309/178/340 +f 247/169/334 192/180/333 309/178/340 +f 247/169/334 343/179/161 246/170/287 +f 308/182/360 311/181/163 315/183/342 +f 308/182/360 315/183/342 310/184/341 +f 309/178/340 310/184/341 317/186/344 +f 309/178/340 317/186/344 312/187/169 +f 316/197/343 321/191/345 317/189/344 +f 315/193/342 314/192/173 320/194/347 +f 317/189/344 322/190/346 313/195/170 +f 315/193/342 320/194/347 316/197/343 +f 322/190/346 327/199/348 318/196/175 +f 320/194/347 325/201/349 321/191/345 +f 321/191/345 326/200/350 322/190/346 +f 319/274/200 324/202/180 320/194/347 +f 335/206/354 340/205/351 336/203/353 +f 334/210/188 339/207/185 335/206/354 +f 336/203/353 329/209/355 335/206/354 +f 335/206/354 330/208/356 334/210/188 +f 337/216/359 342/214/357 333/212/190 +f 337/216/359 328/215/358 336/203/353 +f 333/212/190 332/217/195 337/216/359 +f 336/203/353 341/204/352 337/216/359 +f 342/214/357 325/201/349 338/213/191 +f 341/204/352 326/200/350 342/214/357 +f 340/205/351 327/199/348 341/204/352 +f 339/207/185 323/198/176 340/205/351 +f 196/74/282 278/75/75 308/182/360 +f 196/74/282 308/182/360 192/180/333 +f 328/215/358 332/217/195 344/218/361 +f 329/209/355 328/215/358 345/219/362 +f 330/208/356 346/221/363 331/211/189 +f 329/209/355 345/219/362 330/208/356 +f 349/280/203 350/224/364 354/222/200 +f 346/221/363 350/226/364 347/220/198 +f 353/281/367 354/222/200 352/227/366 +f 345/219/362 351/228/365 346/221/363 +f 344/218/361 352/229/366 345/219/362 +f 348/230/205 353/275/367 344/218/361 +f 204/232/297 371/231/368 364/233/370 +f 196/74/282 192/180/333 357/83/285 +f 374/235/373 373/234/371 362/84/286 +f 373/234/371 370/236/372 361/168/335 +f 372/64/277 374/235/373 358/85/374 +f 368/239/384 359/78/375 371/237/368 +f 368/239/384 369/238/211 359/78/375 +f 280/171/155 356/240/213 200/86/288 +f 364/233/370 378/243/376 363/241/378 +f 204/232/297 364/233/370 201/244/299 +f 370/282/372 375/247/379 355/245/332 +f 357/248/285 355/245/332 366/249/381 +f 201/244/299 363/241/378 370/250/372 +f 376/252/369 366/249/381 382/253/383 +f 203/97/296 282/254/222 368/239/384 +f 203/97/296 368/239/384 204/96/297 +f 205/65/276 252/94/294 372/64/277 +f 253/165/330 201/103/299 373/234/371 +f 252/94/294 253/165/330 374/235/373 +f 371/255/368 357/248/285 376/252/369 +f 356/240/213 367/256/223 358/85/374 +f 382/253/383 380/257/382 388/258/386 +f 381/259/389 377/242/377 387/260/388 +f 375/251/379 363/241/378 381/259/389 +f 366/249/381 365/246/380 380/257/382 +f 365/246/380 375/247/379 379/261/390 +f 376/276/369 382/262/383 364/233/370 +f 387/260/388 383/265/387 388/263/386 +f 386/267/385 385/266/392 388/258/386 +f 378/243/376 384/264/391 377/242/377 +f 382/262/383 388/263/386 378/243/376 +f 380/257/382 379/261/390 386/267/385 +f 381/277/389 387/268/388 379/261/390 +f 245/55/339 396/164/393 244/177/338 +f 245/55/339 183/56/271 396/164/393 +f 183/56/271 195/61/274 392/102/329 +f 191/73/281 389/98/394 273/71/71 +f 186/17/244 270/18/18 390/100/395 +f 191/73/281 197/92/293 389/98/394 +f 186/17/244 390/100/395 195/61/274 +f 244/177/338 397/166/331 197/92/293 +f 166/13/239 259/24/24 401/34/255 +f 161/12/240 166/13/239 400/32/253 +f 163/27/245 161/12/240 399/29/251 +f 256/19/19 163/27/245 398/30/30 +l 300 301 +l 299 298 diff --git a/assets/Models/SubmarineTexture.png b/assets/Models/SubmarineTexture.png new file mode 100644 index 0000000..c64d62d Binary files /dev/null and b/assets/Models/SubmarineTexture.png differ diff --git a/assets/Sounds/BGM/soft-guitar.wav b/assets/Sounds/BGM/soft-guitar.wav new file mode 100644 index 0000000..a537397 Binary files /dev/null and b/assets/Sounds/BGM/soft-guitar.wav differ diff --git a/assets/Sounds/BGM/under-the-sea-instrumental.wav b/assets/Sounds/BGM/under-the-sea-instrumental.wav new file mode 100644 index 0000000..e8d2983 Binary files /dev/null and b/assets/Sounds/BGM/under-the-sea-instrumental.wav differ diff --git a/assets/Sounds/BGM/water-flowing.wav b/assets/Sounds/BGM/water-flowing.wav new file mode 100644 index 0000000..5c5d671 Binary files /dev/null and b/assets/Sounds/BGM/water-flowing.wav differ diff --git a/assets/Sounds/Brick/shortbrickbreak.wav b/assets/Sounds/Brick/shortbrickbreak.wav new file mode 100644 index 0000000..509a188 Binary files /dev/null and b/assets/Sounds/Brick/shortbrickbreak.wav differ diff --git a/assets/Sounds/Metal/impact.wav b/assets/Sounds/Metal/impact.wav new file mode 100644 index 0000000..5a08fc7 Binary files /dev/null and b/assets/Sounds/Metal/impact.wav differ diff --git a/assets/Sounds/screwed.wav b/assets/Sounds/screwed.wav new file mode 100644 index 0000000..581e755 Binary files /dev/null and b/assets/Sounds/screwed.wav differ diff --git a/deps/bin/mingw/x64/OpenAL32.dll b/deps/bin/mingw/x64/OpenAL32.dll new file mode 100644 index 0000000..02ecaf3 Binary files /dev/null and b/deps/bin/mingw/x64/OpenAL32.dll differ diff --git a/deps/include/AL/al.h b/deps/include/AL/al.h new file mode 100644 index 0000000..413b383 --- /dev/null +++ b/deps/include/AL/al.h @@ -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 */ diff --git a/deps/include/AL/alc.h b/deps/include/AL/alc.h new file mode 100644 index 0000000..294e8b3 --- /dev/null +++ b/deps/include/AL/alc.h @@ -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: Hz. */ +#define ALC_FREQUENCY 0x1007 + +/** Context attribute: Hz. */ +#define ALC_REFRESH 0x1008 + +/** Context attribute: AL_TRUE or AL_FALSE. */ +#define ALC_SYNC 0x1009 + +/** Context attribute: requested Mono (3D) Sources. */ +#define ALC_MONO_SOURCES 0x1010 + +/** Context attribute: 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 */ diff --git a/deps/include/AL/alext.h b/deps/include/AL/alext.h new file mode 100644 index 0000000..cb498b4 --- /dev/null +++ b/deps/include/AL/alext.h @@ -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 +/* Define int64_t and uint64_t types */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#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 diff --git a/deps/include/AL/efx-creative.h b/deps/include/AL/efx-creative.h new file mode 100644 index 0000000..0a04c98 --- /dev/null +++ b/deps/include/AL/efx-creative.h @@ -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. */ diff --git a/deps/include/AL/efx-presets.h b/deps/include/AL/efx-presets.h new file mode 100644 index 0000000..8539fd5 --- /dev/null +++ b/deps/include/AL/efx-presets.h @@ -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 */ diff --git a/deps/include/AL/efx.h b/deps/include/AL/efx.h new file mode 100644 index 0000000..5776698 --- /dev/null +++ b/deps/include/AL/efx.h @@ -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 */ diff --git a/deps/lib/mingw/x64/libOpenAL32.dll.a b/deps/lib/mingw/x64/libOpenAL32.dll.a new file mode 100644 index 0000000..389d38a Binary files /dev/null and b/deps/lib/mingw/x64/libOpenAL32.dll.a differ diff --git a/deps/lib/mingw/x64/libopenal32.a b/deps/lib/mingw/x64/libopenal32.a new file mode 100644 index 0000000..b4e6efa Binary files /dev/null and b/deps/lib/mingw/x64/libopenal32.a differ diff --git a/include/Core/Engine.h b/include/Core/Engine.h index fa8a7fb..1935a06 100755 --- a/include/Core/Engine.h +++ b/include/Core/Engine.h @@ -18,6 +18,7 @@ #include #include +#include #include "ResourceManager.h" #include "OBJ.h" @@ -36,12 +37,15 @@ #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" @@ -55,73 +59,89 @@ namespace dd class Engine { + public: Engine(int argc, char* argv[]) { - m_EventBroker = std::make_shared(); + m_EventBroker = std::make_shared(); - m_Renderer = std::make_shared(); - m_Renderer->SetFullscreen(false); - m_Renderer->SetResolution(Rectangle(0, 0, 1920, 1080)); - m_Renderer->Initialize(); + m_Renderer = std::make_shared(); + m_Renderer->SetFullscreen(false); + //m_Renderer->SetResolution(Rectangle(0, 0, 1920, 1080)); + m_Renderer->SetResolution(Rectangle(0, 0, 675, 1080)); + m_Renderer->Initialize(); - m_InputManager = std::make_shared(m_Renderer->Window(), m_EventBroker); + m_InputManager = std::make_shared(m_Renderer->Window(), m_EventBroker); - m_World = std::make_shared(m_EventBroker); + m_World = std::make_shared(m_EventBroker); - //TODO: Move this out of engine.h - m_World->ComponentFactory.Register(); - m_World->SystemFactory.Register( - [this]() { return new Systems::TransformSystem(m_World.get(), m_EventBroker); }); - m_World->AddSystem(); - m_World->ComponentFactory.Register(); - m_World->ComponentFactory.Register(); - m_World->ComponentFactory.Register(); + //TODO: Move this out of engine.h + m_World->ComponentFactory.Register(); + m_World->SystemFactory.Register( + [this]() { return new Systems::TransformSystem(m_World.get(), m_EventBroker); }); + m_World->AddSystem(); + m_World->ComponentFactory.Register(); + m_World->ComponentFactory.Register(); + + m_World->ComponentFactory.Register(); + m_World->SystemFactory.Register( + [this]() { return new Systems::SoundSystem(m_World.get(), m_EventBroker); }); + m_World->AddSystem(); + + m_World->ComponentFactory.Register(); + + m_World->ComponentFactory.Register(); + m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); - m_World->SystemFactory.Register( - [this]() { return new Systems::PhysicsSystem(m_World.get(), m_EventBroker); }); - m_World->AddSystem(); - m_World->SystemFactory.Register([this]() { return new Systems::LevelSystem(m_World.get(), m_EventBroker); }); + m_World->ComponentFactory.Register(); + m_World->ComponentFactory.Register(); + + m_World->SystemFactory.Register( + [this]() { return new Systems::PhysicsSystem(m_World.get(), m_EventBroker); }); + m_World->AddSystem(); + + m_World->SystemFactory.Register( + [this]() { return new Systems::LevelSystem(m_World.get(), m_EventBroker); }); m_World->AddSystem(); - m_World->SystemFactory.Register([this]() { return new Systems::PadSystem(m_World.get(), m_EventBroker); }); + m_World->SystemFactory.Register( + [this]() { return new Systems::PadSystem(m_World.get(), m_EventBroker); }); m_World->AddSystem(); - m_World->SystemFactory.Register([this]() { return new Systems::BallSystem(m_World.get(), m_EventBroker); }); + m_World->SystemFactory.Register( + [this]() { return new Systems::BallSystem(m_World.get(), m_EventBroker); }); m_World->AddSystem(); - m_World->ComponentFactory.Register(); - m_World->ComponentFactory.Register(); + m_World->ComponentFactory.Register(); + m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); - m_World->Initialize(); + m_World->Initialize(); //OctoBall -// { -// auto ent = m_World->CreateEntity(); -// std::shared_ptr transform = m_World->AddComponent(ent); -// transform->Position = glm::vec3(0.5f, 0.f, -9.9f); -// transform->Scale = glm::vec3(1.f, 1.f, 1.f); -// transform->Velocity = glm::vec3(1.0f, -5.f, 0.f); -// -// auto model = m_World->AddComponent(ent); -// model->ModelFile = "Models/Test/Ball/Ballopus.obj"; -// -// std::shared_ptr circleShape = m_World->AddComponent(ent); -// std::shared_ptr ball = m_World->AddComponent(ent); -// -// std::shared_ptr physics = m_World->AddComponent(ent); -// physics->Static = false; -// -// auto plight = m_World->AddComponent(ent); -// plight->Radius = 2.f; -// -// m_World->CommitEntity(ent); -// } + { + auto ent = m_World->CreateEntity(); + std::shared_ptr transform = m_World->AddComponent(ent); + transform->Position = glm::vec3(-0.f, 0.26f, -9.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(ent); + model->ModelFile = "Models/Test/Ball/Ballopus.obj"; + std::shared_ptr circleShape = m_World->AddComponent(ent); + std::shared_ptr ball = m_World->AddComponent(ent); + + std::shared_ptr physics = m_World->AddComponent(ent); + physics->Static = false; + ball->Speed = 10.f; + auto plight = m_World->AddComponent(ent); + plight->Radius = 2.f; + + m_World->CommitEntity(ent); + } //PointLightTest { @@ -134,23 +154,23 @@ public: } //Halfpipe background test model. -// { -// auto t_halfPipe = m_World->CreateEntity(); -// auto transform = m_World->AddComponent(t_halfPipe); -// transform->Position = glm::vec3(0.f, 0.f, -15.f); -// transform->Scale = glm::vec3(15.f); -// auto model = m_World->AddComponent(t_halfPipe); -// model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj"; -// model->Color = glm::vec4(1.f, 1.f, 1.f, 0.3f); -// m_World->CommitEntity(t_halfPipe); -// } + { + auto t_halfPipe = m_World->CreateEntity(); + auto transform = m_World->AddComponent(t_halfPipe); + transform->Position = glm::vec3(0.f, 0.f, -15.f); + transform->Scale = glm::vec3(15.f); + auto model = m_World->AddComponent(t_halfPipe); + model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj"; + model->Color = glm::vec4(1.f, 1.f, 1.f, 0.3f); + m_World->CommitEntity(t_halfPipe); + } //Background { auto background = m_World->CreateEntity(); auto transform = m_World->AddComponent(background); - transform->Position = glm::vec3(0.f, 0.f, -15.f); - transform->Scale = glm::vec3(2681.f/100.f, 1080.f/100.f, 1.f); + transform->Position = glm::vec3(0.f, 0.f, -20.f); + transform->Scale = glm::vec3(2681.f / 100.f, 1080.f / 100.f, 1.f); auto sprite = m_World->AddComponent(background); sprite->SpriteFile = "Textures/Background.png"; m_World->CommitEntity(background); @@ -166,16 +186,16 @@ public: auto body = m_World->AddComponent(t_waterBody); m_World->CommitEntity(t_waterBody); } - //BottomBox { auto topWall = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(topWall); + auto transform = m_World->AddComponent(topWall); transform->Position = glm::vec3(0.f, -3.f, -9.9f); transform->Scale = glm::vec3(3.f, 0.5f, 1.f); std::shared_ptr sprite = m_World->AddComponent(topWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; - std::shared_ptr boxShape = m_World->AddComponent(topWall); + std::shared_ptr boxShape = m_World->AddComponent( + topWall); std::shared_ptr physics = m_World->AddComponent(topWall); physics->Static = true; m_World->CommitEntity(topWall); @@ -188,7 +208,8 @@ public: transform->Scale = glm::vec3(0.5f, 3.f, 1.f); std::shared_ptr sprite = m_World->AddComponent(topWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; - std::shared_ptr boxShape = m_World->AddComponent(topWall); + std::shared_ptr boxShape = m_World->AddComponent( + topWall); std::shared_ptr physics = m_World->AddComponent(topWall); physics->Static = true; m_World->CommitEntity(topWall); @@ -201,7 +222,8 @@ public: transform->Scale = glm::vec3(0.5f, 3.0f, 1.f); std::shared_ptr sprite = m_World->AddComponent(topWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; - std::shared_ptr boxShape = m_World->AddComponent(topWall); + std::shared_ptr boxShape = m_World->AddComponent( + topWall); std::shared_ptr physics = m_World->AddComponent(topWall); physics->Static = true; m_World->CommitEntity(topWall); @@ -209,46 +231,54 @@ public: { auto topWall = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(topWall); + std::shared_ptr transform = m_World->AddComponent( + 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 sprite = m_World->AddComponent(topWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; - std::shared_ptr boxShape = m_World->AddComponent(topWall); + std::shared_ptr boxShape = m_World->AddComponent( + topWall); std::shared_ptr physics = m_World->AddComponent(topWall); physics->Static = true; m_World->CommitEntity(topWall); } + { auto leftWall = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(leftWall); - transform->Position = glm::vec3(-9.f, 1.f, -10.f); - transform->Scale = glm::vec3(0.5f, 10.f, 1.f); + std::shared_ptr transform = m_World->AddComponent( + leftWall); + transform->Position = glm::vec3(-4.f, 1.f, -10.f); + transform->Scale = glm::vec3(0.5f, 20.f, 1.f); std::shared_ptr sprite = m_World->AddComponent(leftWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; - std::shared_ptr boxShape = m_World->AddComponent(leftWall); + std::shared_ptr boxShape = m_World->AddComponent( + leftWall); std::shared_ptr physics = m_World->AddComponent(leftWall); physics->Static = true; m_World->CommitEntity(leftWall); } + { auto rightWall = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(rightWall); - transform->Position = glm::vec3(9.f, 1.f, -10.f); - transform->Scale = glm::vec3(0.5f, 10.f, 1.f); + std::shared_ptr transform = m_World->AddComponent( + rightWall); + transform->Position = glm::vec3(4.f, 1.f, -10.f); + transform->Scale = glm::vec3(0.5f, 20.f, 1.f); std::shared_ptr sprite = m_World->AddComponent(rightWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; - std::shared_ptr boxShape = m_World->AddComponent(rightWall); + std::shared_ptr boxShape = m_World->AddComponent( + rightWall); std::shared_ptr physics = m_World->AddComponent(rightWall); physics->Static = true; @@ -261,7 +291,7 @@ public: m_World->SetProperty(ent, "Name", "Pad"); auto ctransform = m_World->AddComponent(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(ent); auto physics = m_World->AddComponent(ent); physics->Static = false; @@ -271,7 +301,7 @@ public: m_World->CommitEntity(ent); } - m_LastTime = glfwGetTime(); + m_LastTime = glfwGetTime(); } bool Running() const { return !glfwWindowShouldClose(m_Renderer->Window()); } @@ -290,18 +320,6 @@ public: m_World->Update(dt); -// -// if (glfwGetKey(m_Renderer->Window(), GLFW_KEY_R)) { -// ResourceManager::Reload("Shaders/Deferred/3/Fragment.glsl"); -// } -// - //TODO Fill up the renderQueue with models (Temp fix) -// TEMPAddToRenderQueue(); - - // Render scene - //TODO send renderqueue to draw. -// m_Renderer->Draw(m_RendererQueue); - if (glfwGetKey(m_Renderer->Window(), GLFW_KEY_R)) { ResourceManager::Reload("Shaders/Deferred/3/Fragment.glsl"); } @@ -482,6 +500,7 @@ private: std::shared_ptr m_InputManager; std::shared_ptr m_World; + double m_LastTime; }; diff --git a/include/Core/Engine.h.orig b/include/Core/Engine.h.orig old mode 100755 new mode 100644 index 7bd2f2a..1a9d7d1 --- a/include/Core/Engine.h.orig +++ b/include/Core/Engine.h.orig @@ -18,6 +18,7 @@ #include #include +#include #include "ResourceManager.h" #include "OBJ.h" @@ -36,12 +37,15 @@ #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" @@ -61,18 +65,27 @@ public: m_Renderer = std::make_shared(); 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(m_Renderer->Window(), m_EventBroker); - m_World = std::make_shared(m_EventBroker); + m_World = std::make_shared(m_EventBroker); + + //TODO: Move this out of engine.h m_World->ComponentFactory.Register(); m_World->SystemFactory.Register( [this]() { return new Systems::TransformSystem(m_World.get(), m_EventBroker); }); m_World->AddSystem(); + m_World->ComponentFactory.Register(); + m_World->ComponentFactory.Register(); + + m_World->ComponentFactory.Register(); + m_World->SystemFactory.Register([this]() { return new Systems::SoundSystem(m_World.get(), m_EventBroker); }); + m_World->AddSystem(); m_World->ComponentFactory.Register(); @@ -82,6 +95,10 @@ public: m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); m_World->ComponentFactory.Register(); + + m_World->ComponentFactory.Register(); + m_World->ComponentFactory.Register(); + m_World->SystemFactory.Register( [this]() { return new Systems::PhysicsSystem(m_World.get(), m_EventBroker); }); m_World->AddSystem(); @@ -100,27 +117,43 @@ public: m_World->Initialize(); - //TODO: Remove tobias light-test code. - /*{ - }*/ - //OctoBall +<<<<<<< HEAD +// { +// auto ent = m_World->CreateEntity(); +// std::shared_ptr transform = m_World->AddComponent(ent); +// transform->Position = glm::vec3(0.5f, 0.f, -9.9f); +// transform->Scale = glm::vec3(1.f, 1.f, 1.f); +// transform->Velocity = glm::vec3(1.0f, -5.f, 0.f); +// +// auto model = m_World->AddComponent(ent); +// model->ModelFile = "Models/Test/Ball/Ballopus.obj"; +// +// std::shared_ptr circleShape = m_World->AddComponent(ent); +// std::shared_ptr ball = m_World->AddComponent(ent); +// +// std::shared_ptr physics = m_World->AddComponent(ent); +// physics->Static = false; +// +// auto plight = m_World->AddComponent(ent); +// plight->Radius = 2.f; +// +// m_World->CommitEntity(ent); +// } +======= { auto ent = m_World->CreateEntity(); std::shared_ptr transform = m_World->AddComponent(ent); - transform->Position = glm::vec3(0.5f, 0.f, -9.9f); - transform->Scale = glm::vec3(1.f, 1.f, 1.f); -<<<<<<< HEAD -======= - transform->Velocity = glm::vec3(1.0f, -5.f, 0.f); ->>>>>>> origin/physics + 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(ent); model->ModelFile = "Models/Test/Ball/Ballopus.obj"; std::shared_ptr circleShape = m_World->AddComponent(ent); std::shared_ptr ball = m_World->AddComponent(ent); - + ball->Speed = 10.f; std::shared_ptr physics = m_World->AddComponent(ent); physics->Static = false; @@ -131,6 +164,7 @@ public: } +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db //PointLightTest { @@ -139,34 +173,99 @@ public: transform->Position = glm::vec3(2.f, 1.5f, -9.f); auto pl = m_World->AddComponent(t_Light); pl->Radius = 8.f; + m_World->CommitEntity(t_Light); } //Halfpipe background test model. +// { +// auto t_halfPipe = m_World->CreateEntity(); +// auto transform = m_World->AddComponent(t_halfPipe); +// transform->Position = glm::vec3(0.f, 0.f, -15.f); +// transform->Scale = glm::vec3(15.f); +// auto model = m_World->AddComponent(t_halfPipe); +// model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj"; +// model->Color = glm::vec4(1.f, 1.f, 1.f, 0.3f); +// m_World->CommitEntity(t_halfPipe); +// } + + //Background { - auto t_halfPipe = m_World->CreateEntity(); - auto transform = m_World->AddComponent(t_halfPipe); +<<<<<<< HEAD + auto background = m_World->CreateEntity(); + auto transform = m_World->AddComponent(background); transform->Position = glm::vec3(0.f, 0.f, -15.f); - transform->Scale = glm::vec3(15.f); - auto model = m_World->AddComponent(t_halfPipe); - model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj"; + transform->Scale = glm::vec3(2681.f/100.f, 1080.f/100.f, 1.f); + auto sprite = m_World->AddComponent(background); + sprite->SpriteFile = "Textures/Background.png"; + m_World->CommitEntity(background); } //Water test { auto t_waterBody = m_World->CreateEntity(); auto transform = m_World->AddComponent(t_waterBody); - transform->Position = glm::vec3(0.f, 0.f, -10.f); + transform->Position = glm::vec3(0.f, -1.f, -10.f); + transform->Scale = glm::vec3(2.f, 3.f, 1.f); auto water = m_World->AddComponent(t_waterBody); - auto sprite = m_World->AddComponent(t_waterBody); - sprite->SpriteFile = "Textures/Test/Brick_Diffuse.png"; auto body = m_World->AddComponent(t_waterBody); + m_World->CommitEntity(t_waterBody); } + //BottomBox + { + auto topWall = m_World->CreateEntity(); + std::shared_ptr transform = m_World->AddComponent(topWall); + transform->Position = glm::vec3(0.f, -3.f, -9.9f); + transform->Scale = glm::vec3(3.f, 0.5f, 1.f); + std::shared_ptr sprite = m_World->AddComponent(topWall); + sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; + std::shared_ptr boxShape = m_World->AddComponent(topWall); + std::shared_ptr physics = m_World->AddComponent(topWall); + physics->Static = true; + m_World->CommitEntity(topWall); + } + //SideBox + { + auto topWall = m_World->CreateEntity(); + std::shared_ptr transform = m_World->AddComponent(topWall); + transform->Position = glm::vec3(1.5f, -1.5f, -9.9f); + transform->Scale = glm::vec3(0.5f, 3.f, 1.f); + std::shared_ptr sprite = m_World->AddComponent(topWall); + sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; + std::shared_ptr boxShape = m_World->AddComponent(topWall); + std::shared_ptr physics = m_World->AddComponent(topWall); + physics->Static = true; + m_World->CommitEntity(topWall); + } + //OtherSideBox + { + auto topWall = m_World->CreateEntity(); + std::shared_ptr transform = m_World->AddComponent(topWall); + transform->Position = glm::vec3(-1.5f, -1.5f, -9.9f); + transform->Scale = glm::vec3(0.5f, 3.0f, 1.f); + std::shared_ptr sprite = m_World->AddComponent(topWall); + sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; + std::shared_ptr boxShape = m_World->AddComponent(topWall); + std::shared_ptr physics = m_World->AddComponent(topWall); + physics->Static = true; + m_World->CommitEntity(topWall); + } + +======= + auto t_halfPipe = m_World->CreateEntity(); + auto transform = m_World->AddComponent(t_halfPipe); + transform->Position = glm::vec3(0.f, 0.f, -13.f); + transform->Scale = glm::vec3(5.f); + auto model = m_World->AddComponent(t_halfPipe); + model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj"; + } + +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db { auto topWall = m_World->CreateEntity(); std::shared_ptr transform = m_World->AddComponent(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 sprite = m_World->AddComponent(topWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; @@ -181,8 +280,8 @@ public: { auto leftWall = m_World->CreateEntity(); std::shared_ptr transform = m_World->AddComponent(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 sprite = m_World->AddComponent(leftWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; @@ -197,8 +296,8 @@ public: { auto rightWall = m_World->CreateEntity(); std::shared_ptr transform = m_World->AddComponent(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 sprite = m_World->AddComponent(rightWall); sprite->SpriteFile = "Textures/Core/ErrorTexture.png"; @@ -216,7 +315,7 @@ public: m_World->SetProperty(ent, "Name", "Pad"); auto ctransform = m_World->AddComponent(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(ent); auto physics = m_World->AddComponent(ent); physics->Static = false; @@ -314,8 +413,6 @@ public: } } - //TODO: Add LightLoadShit - auto pointLightComponent = m_World->GetComponent(entity); if (pointLightComponent) { @@ -326,6 +423,19 @@ public: pointLightComponent->Radius); } + auto parent = m_World->GetEntityParent(entity); + if(parent != 0) { + auto waterParticleComponent = m_World->GetComponent(parent); + if (waterParticleComponent) { + //TODO: Remove hardcoded color. + //TODO: Do i even need modelMatrix? + Components::Transform absoluteTransform = m_TransformSystem->AbsoluteTransform(entity); + glm::mat4 modelMatrix = glm::translate(absoluteTransform.Position) + * glm::scale(absoluteTransform.Scale); + EnqueueWaterParticles(absoluteTransform.Position, glm::vec4(1.f, 1.f, 1.f, 1.f), modelMatrix, absoluteTransform.Position.z); + } + } + auto spriteComponent = m_World->GetComponent(entity); if (spriteComponent) @@ -407,6 +517,17 @@ public: } + void EnqueueWaterParticles(glm::vec3 position, glm::vec4 color, glm::mat4 modelMatrix, float depth) + { + WaterParticleJob job; + job.Position = position; + job.Color = color; + job.ModelMatrix = modelMatrix; + job.Depth = depth; + + m_RendererQueue.Forward.Add(job); + } + private: std::shared_ptr m_ResourceManager; std::shared_ptr m_EventBroker; @@ -415,6 +536,7 @@ private: std::shared_ptr m_InputManager; std::shared_ptr m_World; + double m_LastTime; }; diff --git a/include/Core/World.h b/include/Core/World.h index f52637c..5c66d52 100644 --- a/include/Core/World.h +++ b/include/Core/World.h @@ -248,7 +248,6 @@ protected: EntityID GenerateEntityID(); void RecycleEntityID(EntityID id); - }; template diff --git a/include/Game/BallSystem.h b/include/Game/BallSystem.h index e146703..1069ede 100644 --- a/include/Game/BallSystem.h +++ b/include/Game/BallSystem.h @@ -3,10 +3,11 @@ #include "Core/System.h" #include "Core/World.h" +#include "Core/EventBroker.h" #include "Core/CTransform.h" #include "Physics/EContact.h" -#include "Core/EventBroker.h" #include "Game/CBall.h" +#include "Game/CPowerUp.h" namespace dd { diff --git a/include/Game/Bricks/CPowerUpBrick.h b/include/Game/Bricks/CPowerUpBrick.h new file mode 100644 index 0000000..b20a260 --- /dev/null +++ b/include/Game/Bricks/CPowerUpBrick.h @@ -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 diff --git a/include/Game/CBall.h b/include/Game/CBall.h index df53712..2990a3a 100644 --- a/include/Game/CBall.h +++ b/include/Game/CBall.h @@ -16,6 +16,7 @@ namespace Components struct Ball : Component { int Number = 0; + float Speed = 5.f; }; } diff --git a/include/Game/CBrick.h b/include/Game/CBrick.h index 34e20d0..d44ab02 100644 --- a/include/Game/CBrick.h +++ b/include/Game/CBrick.h @@ -18,6 +18,7 @@ struct Brick : Component int Points = 10; int Hits = 1; int Score = 50; + bool Removed = false; }; } diff --git a/include/Game/CPad.h b/include/Game/CPad.h index 827ebf6..f71c756 100644 --- a/include/Game/CPad.h +++ b/include/Game/CPad.h @@ -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; }; } diff --git a/include/Game/CPowerUp.h b/include/Game/CPowerUp.h new file mode 100644 index 0000000..ab90f10 --- /dev/null +++ b/include/Game/CPowerUp.h @@ -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 diff --git a/include/Game/ECreatePowerUp.h b/include/Game/ECreatePowerUp.h new file mode 100644 index 0000000..3b208c7 --- /dev/null +++ b/include/Game/ECreatePowerUp.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 diff --git a/include/Game/EGameOver.h b/include/Game/EGameOver.h new file mode 100644 index 0000000..c8696df --- /dev/null +++ b/include/Game/EGameOver.h @@ -0,0 +1,27 @@ +// +// 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 diff --git a/include/Game/EMultiBall.h b/include/Game/EMultiBall.h new file mode 100644 index 0000000..9556101 --- /dev/null +++ b/include/Game/EMultiBall.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 diff --git a/include/Game/EPowerUpTaken.h b/include/Game/EPowerUpTaken.h new file mode 100644 index 0000000..853ea9f --- /dev/null +++ b/include/Game/EPowerUpTaken.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 diff --git a/include/Game/LevelSystem.h b/include/Game/LevelSystem.h index 7d02de0..545d2fb 100755 --- a/include/Game/LevelSystem.h +++ b/include/Game/LevelSystem.h @@ -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 "Physics/CRectangleShape.h" +#include "Game/EMultiBall.h" +#include "Game/EGameOver.h" +#include "Game/ECreatePowerUp.h" +#include "Game/EPowerUpTaken.h" +#include "Game/Bricks/CPowerUpBrick.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 #include #include @@ -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 m_EContact; dd::EventRelay m_ELifeLost; dd::EventRelay m_EScoreEvent; + dd::EventRelay m_EMultiBall; + dd::EventRelay m_ECreatePowerUp; + dd::EventRelay m_EPowerUpTaken; + dd::EventRelay 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); }; } diff --git a/include/Game/LevelSystem.h.orig b/include/Game/LevelSystem.h.orig new file mode 100755 index 0000000..5e56ad3 --- /dev/null +++ b/include/Game/LevelSystem.h.orig @@ -0,0 +1,149 @@ +// +// Created by Adniklastrator on 2015-09-09. +// + +#ifndef DAYDREAM_LEVELSYSTEM_H +#define DAYDREAM_LEVELSYSTEM_H + +#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 "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" +<<<<<<< HEAD +#include "Physics/CRectangleShape.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" +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db +#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 +#include +#include + +namespace dd +{ + +namespace Systems +{ + + // Me trying things out. +class Level +{ +public: + int levelRows; + int levelLines; + int levelSpaceBetweenBricks; + int levelSpaceToEdge; + int bricks[]; +}; + +class LevelSystem : public System +{ +public: + LevelSystem(World* world, std::shared_ptr eventBroker) + : System(world, eventBroker) + { } + + void Initialize() override; + + 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, float, int); + void ProcessCollision(); + + void OnEntityRemoved(EntityID entity); + + void EndLevel(); + + 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; } + void SetNumberOfBricks(const int& numberOfBricks) { m_NumberOfBricks = numberOfBricks; } + int& Rows() { return m_Rows; } + void SetRows(const int& rows) { m_Rows = rows; } + int& Lines() { return m_Lines; } + void SetLines(const int& lines) { m_Lines = lines; } + 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 = 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 m_EContact; + dd::EventRelay m_ELifeLost; + dd::EventRelay m_EScoreEvent; + dd::EventRelay m_EMultiBall; + dd::EventRelay m_ECreatePowerUp; + dd::EventRelay m_EPowerUpTaken; + dd::EventRelay m_EStageCleared; + + bool OnContact(const dd::Events::Contact &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); +}; + +} + +} + +#endif //DAYDREAM_LEVELSYSTEM_H diff --git a/include/Game/PadSystem.h b/include/Game/PadSystem.h index cee9568..4a53907 100755 --- a/include/Game/PadSystem.h +++ b/include/Game/PadSystem.h @@ -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 m_EKeyDown; dd::EventRelay m_EKeyUp; dd::EventRelay m_EContact; + dd::EventRelay m_EContactPowerUp; dd::EventRelay m_EResetBall; + dd::EventRelay m_EMultiBall; + dd::EventRelay 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, 4> m_PadInputControllers; diff --git a/include/Physics/EContact.h b/include/Physics/EContact.h index c27e3b8..4a6f3a9 100644 --- a/include/Physics/EContact.h +++ b/include/Physics/EContact.h @@ -20,6 +20,7 @@ struct Contact : Event EntityID Entity1; EntityID Entity2; glm::vec2 Normal; + glm::vec2 SignificantNormal; }; } diff --git a/include/Physics/PhysicsSystem.h b/include/Physics/PhysicsSystem.h index 196c5bf..4a53bdb 100755 --- a/include/Physics/PhysicsSystem.h +++ b/include/Physics/PhysicsSystem.h @@ -76,6 +76,16 @@ private: void SyncWater(); //TODO: Probably remove this void CreateParticleGroup(EntityID entity); + struct Impulse + { + b2Body* Body; + b2Vec2 Impulse; + b2Vec2 Point; + }; + std::list m_Impulses; + + + class ContactListener : public b2ContactListener { public: @@ -91,11 +101,10 @@ private: Events::Contact e; e.Entity1 = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureA()->GetBody()]; e.Entity2 = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureB()->GetBody()]; - e.Normal = glm::normalize(glm::vec2(worldManifold.normal.x, worldManifold.normal.y)); + 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); - - LOG_INFO("Entity1 = %i, Entity2 = %i\n", e.Entity1, e.Entity2); } void EndContact(b2Contact* contact) { diff --git a/include/Physics/PhysicsSystem.h.orig b/include/Physics/PhysicsSystem.h.orig index eab88e9..045c063 100755 --- a/include/Physics/PhysicsSystem.h.orig +++ b/include/Physics/PhysicsSystem.h.orig @@ -14,11 +14,9 @@ #include "Physics/ESetImpulse.h" #include "Physics/CCircleShape.h" #include "Core/EventBroker.h" -<<<<<<< HEAD -#include "Physics/CWaterVolume.h" -======= #include "Game/CPad.h" ->>>>>>> origin/physics +#include "Physics/CWaterVolume.h" +#include "Rendering/CSprite.h" namespace dd @@ -68,14 +66,24 @@ private: void CreateBody(EntityID entity); - const b2ParticleSystemDef m_ParticleSystemDef; b2ParticleSystem *m_ParticleSystem; + b2ParticleGroup* t_watergroup; + std::unordered_map m_EntitiesToParticleHandle; + std::unordered_map m_ParticleHandleToEntities; void InitializeWater(); void SyncWater(); //TODO: Probably remove this void CreateParticleGroup(EntityID entity); + struct Impulse + { + b2Body* Body; + b2Vec2 Impulse; + b2Vec2 Point; + }; + std::list m_Impulses; + class ContactListener : public b2ContactListener @@ -93,12 +101,14 @@ private: Events::Contact e; e.Entity1 = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureA()->GetBody()]; e.Entity2 = m_PhysicsSystem->m_BodiesToEntities[contact->GetFixtureB()->GetBody()]; +<<<<<<< HEAD e.Normal = glm::normalize(glm::vec2(worldManifold.normal.x, worldManifold.normal.y)); - +======= + 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)); +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db m_PhysicsSystem->EventBroker->Publish(e); - - LOG_INFO("Entity1 = %i, Entity2 = %i\n", e.Entity1, e.Entity2); } void EndContact(b2Contact* contact) { diff --git a/include/Sound/CCollisionSound.h b/include/Sound/CCollisionSound.h new file mode 100644 index 0000000..4a631a3 --- /dev/null +++ b/include/Sound/CCollisionSound.h @@ -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 diff --git a/include/Sound/EPlaySound.h b/include/Sound/EPlaySound.h new file mode 100644 index 0000000..ee51df0 --- /dev/null +++ b/include/Sound/EPlaySound.h @@ -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 \ No newline at end of file diff --git a/include/Sound/EStopSound.h b/include/Sound/EStopSound.h new file mode 100644 index 0000000..81ff474 --- /dev/null +++ b/include/Sound/EStopSound.h @@ -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 diff --git a/include/Sound/Sound.h b/include/Sound/Sound.h new file mode 100644 index 0000000..7084e64 --- /dev/null +++ b/include/Sound/Sound.h @@ -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 m_BufferCache; + ALuint LoadFile(std::string path); + + ALuint m_Buffer; + std::string m_Path; +}; + + +} + +#endif diff --git a/include/Sound/SoundSystem.h b/include/Sound/SoundSystem.h new file mode 100644 index 0000000..af70ed6 --- /dev/null +++ b/include/Sound/SoundSystem.h @@ -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 eventBroker) + : System(world, eventBroker) { } + ~SoundSystem(); + void Initialize() override; + void Update(double dt) override; + + + + +private: + //Events + dd::EventRelay m_EPlaySFX; + dd::EventRelay m_EContact; + dd::EventRelay 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 m_SourcesToBuffers; + + ALCdevice* m_Device; + + //Temp + +}; +} +} + +#endif //DAYDREAM_SOUND_H diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 61c2d74..a63eb23 100755 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -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}) + ${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} ) diff --git a/src/game/Core/World.cpp b/src/game/Core/World.cpp index b35096b..2ff460a 100644 --- a/src/game/Core/World.cpp +++ b/src/game/Core/World.cpp @@ -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); diff --git a/src/game/Game/BallSystem.cpp b/src/game/Game/BallSystem.cpp index 29aa6ef..97958ca 100644 --- a/src/game/Game/BallSystem.cpp +++ b/src/game/Game/BallSystem.cpp @@ -23,7 +23,14 @@ void dd::Systems::BallSystem::Update(double dt) void dd::Systems::BallSystem::UpdateEntity(double dt, EntityID entity, EntityID parent) { - + auto ballComponent = m_World->GetComponent(entity); + if (ballComponent != nullptr) { + auto transform = m_World->GetComponent(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(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) @@ -38,35 +45,55 @@ void dd::Systems::BallSystem::OnEntityRemoved(EntityID entity) bool dd::Systems::BallSystem::Contact(const Events::Contact &event) { - auto ballComponent1 = m_World->GetComponent(event.Entity1); - auto ballComponent2 = m_World->GetComponent(event.Entity2); + Components::PowerUp* power1 = m_World->GetComponent(event.Entity1); + Components::PowerUp* power2 = m_World->GetComponent(event.Entity2); + + if (power1 != nullptr || power2 != nullptr) { + return false; + } + + Components::Ball* ballComponent1 = m_World->GetComponent(event.Entity1); + Components::Ball* ballComponent2 = m_World->GetComponent(event.Entity2); + Components::Ball* ballComponent; + + if (ballComponent1 != nullptr && ballComponent2 != nullptr) { + return false; + } //Which is the ball? EntityID ballEntity, otherEntitiy; - glm::vec2 normal; + if (ballComponent1 != nullptr) { ballEntity = event.Entity1; otherEntitiy = event.Entity2; - - //Make normal point from the other entity to the ball - normal = event.Normal * -1.f; + ballComponent = ballComponent1; } else if (ballComponent2 != nullptr) { ballEntity = event.Entity2; otherEntitiy = event.Entity1; - - //Make normal point from the other entity to the ball - normal = event.Normal * 1.f; + ballComponent = ballComponent2; + } + else { + return false; + //TODO: Add support for power-up collisions } auto ballTransform = m_World->GetComponent(ballEntity); - auto otherTransform = m_World->GetComponent(otherEntitiy); - glm::vec2 ballVelocity = glm::vec2(ballTransform->Velocity.x, ballTransform->Velocity.y); - glm::vec2 reflectedVelocity = ballVelocity - 2.f * glm::dot(ballVelocity, normal)*normal; - ballTransform->Velocity = glm::vec3(reflectedVelocity, 0.f); + if (m_World->GetProperty(otherEntitiy, "Name") == "Pad"){ + auto padTransform = m_World->GetComponent(otherEntitiy); + float x = ballTransform->Position.x - padTransform->Position.x; + float movementMultiplier = 5.0f; + float y = glm::cos((abs(x) / (1.6f)) * glm::pi() / 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; } diff --git a/src/game/Game/LevelSystem.cpp b/src/game/Game/LevelSystem.cpp index 816d839..b4f5d7d 100755 --- a/src/game/Game/LevelSystem.cpp +++ b/src/game/Game/LevelSystem.cpp @@ -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 transform = m_World->AddComponent(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 lifeNr = m_World->AddComponent(life); lifeNr->Number = number; @@ -33,8 +37,6 @@ void dd::Systems::LevelSystem::CreateLife(int number) auto model = m_World->AddComponent(life); model->ModelFile = "Models/Test/Ball/Ballopus.obj"; - /*std::shared_ptr sprite = m_World->AddComponent(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(entity); - if (ball != NULL) { + if (ball != nullptr) { auto transformBall = m_World->GetComponent(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(entity); + m_World->RemoveComponent(entity); + m_World->RemoveComponent(entity); + m_World->RemoveComponent(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(entity); - if (life != NULL) { + if (life != nullptr) { if (life->Number + 1 == PastLives()) { + m_World->RemoveComponent(entity); + m_World->RemoveComponent(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(entity); + m_World->RemoveComponent(entity); + m_World->RemoveComponent(entity); + m_World->RemoveComponent(entity); + m_World->RemoveEntity(entity); + auto transformBall = m_World->GetComponent(entity); + } else { + auto powerUp = m_World->GetComponent(entity); + if (powerUp != nullptr) { + SetPowerUps(PowerUps() - 1); + m_World->RemoveComponent(entity); + m_World->RemoveComponent(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 transform = m_World->AddComponent(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 cPow = m_World->AddComponent(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(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(entity); - if (brick != NULL) { - numberOfBricks--; - if (numberOfBricks < 1) { + auto brick = m_World->GetComponent(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(entityBrick); - if (brick == NULL) { + EntityID entityBrick; + EntityID entityBall; + auto ball = m_World->GetComponent(event.Entity2); + auto brick = m_World->GetComponent(event.Entity1); + if (brick != nullptr) { + entityBrick = event.Entity1; + } else { + brick = m_World->GetComponent(event.Entity2); + if (brick != nullptr) { + entityBrick = event.Entity2; + } else { + return false; + } + } + if (ball != nullptr) { + entityBall = event.Entity2; + } else { + ball = m_World->GetComponent(event.Entity1); + if (ball != nullptr) { + entityBall = event.Entity1; + } else { + return false; + } + } + + brick = m_World->GetComponent(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(entityBrick); + if (power != nullptr) { + Events::CreatePowerUp e; + auto transform = m_World->GetComponent(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(entityBall); + + m_World->RemoveComponent(entityBrick); + m_World->RemoveComponent(entityBrick); + m_World->RemoveComponent(entityBrick); + m_World->RemoveComponent(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 transform = m_World->AddComponent(powerUp); + auto model = m_World->AddComponent(powerUp); + std::shared_ptr cRec = m_World->AddComponent(powerUp); + std::shared_ptr cPhys = m_World->AddComponent(powerUp); + std::shared_ptr cPow = m_World->AddComponent(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; diff --git a/src/game/Game/PadSystem.cpp b/src/game/Game/PadSystem.cpp index ec75a3f..8dd7467 100755 --- a/src/game/Game/PadSystem.cpp +++ b/src/game/Game/PadSystem.cpp @@ -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(entity); - if (ball != NULL) { + if (ball != nullptr) { if (ReplaceBall() == true) { SetReplaceBall(false); - auto transformEntity = m_World->GetComponent(entity); - transformEntity->Position = glm::vec3(20, 20, -10); - - //Temporary. Create new ball. - /*auto ent = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(ent); - transform->Position = glm::vec3(0.5f, 0.f, -10.f); - transform->Scale = glm::vec3(1.f, 1.f, 1.f); - std::shared_ptr sprite = m_World->AddComponent(ent); - sprite->SpriteFile = "Textures/Ball.png"; - std::shared_ptr circleShape = m_World->AddComponent(ent); - std::shared_ptr cball = m_World->AddComponent(ent); - std::shared_ptr physics = m_World->AddComponent(ent); - physics->Static = false;*/ - - auto ent = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(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(ent); - model->ModelFile = "Models/Test/Ball/Ballopus.obj"; - //auto pointlight = m_World->AddComponent(ent); - std::shared_ptr circleShape = m_World->AddComponent(ent); - std::shared_ptr cball = m_World->AddComponent(ent); - std::shared_ptr physics = m_World->AddComponent(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(entity); + transform->Position = glm::vec3(0.0f, 0.26f, -10.f); + transform->Velocity = glm::vec3(0.0f, -ball->Speed, 0.f); } } } @@ -106,11 +75,9 @@ void dd::Systems::PadSystem::Update(double dt) if (Left()) { acceleration.x = -pad->AccelerationSpeed; - } - else if (Right()) { + } else if (Right()) { acceleration.x = pad->AccelerationSpeed; - } - else { + } else { acceleration.x = 0.f; } @@ -118,9 +85,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 transform = m_World->AddComponent(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(ent); + model->ModelFile = "Models/Test/Ball/Ballopus.obj"; + //auto pointlight = m_World->AddComponent(ent); + std::shared_ptr circleShape = m_World->AddComponent(ent); + std::shared_ptr cball = m_World->AddComponent(ent); + std::shared_ptr physics = m_World->AddComponent(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; @@ -138,6 +134,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; } @@ -173,7 +173,7 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event) auto transformBall = m_World->GetComponent(entityBall); auto transformPad = m_World->GetComponent(entityPad); - float movementMultiplier = 4.f; + float movementMultiplier = 0.5f; //float movementX = (event.ContactPoint.x - transformPad->Position.x) * movementMultiplier; //float movementY = glm::cos((abs(movementX) / (3.2f * movementMultiplier)) * 3.14159265359f / 2) * 2.f; @@ -188,13 +188,12 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event) // 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; - float len = glm::length(transformBall->Velocity); //auto pointlight = m_World->AddComponent(ent); + transformBall->Velocity += glm::vec3(transformPad->Velocity.x, 0, 0); transformBall->Velocity = glm::normalize(transformBall->Velocity) * len; @@ -203,12 +202,90 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event) */ } -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(event.Entity1); + auto pad = m_World->GetComponent(event.Entity2); + if (powerUp != nullptr) { + entityPower = event.Entity1; + } else { + powerUp = m_World->GetComponent(event.Entity2); + if (powerUp != nullptr) { + entityPower = event.Entity2; + } + } + if (pad != nullptr) { + entityPad = event.Entity2; + } else { + pad = m_World->GetComponent(event.Entity1); + if (pad != nullptr) { + entityPad = event.Entity1; + } + } + + if (entityPower == NULL || entityPad == NULL) { + return false; + } + + pad = m_World->GetComponent(entityPad); + if (pad == nullptr) { + return false; + } + + m_World->RemoveComponent(entityPower); + m_World->RemoveComponent(entityPower); + m_World->RemoveComponent(entityPower); + m_World->RemoveEntity(entityPower); + Events::PowerUpTaken ep; + ep.Name = "Something"; + EventBroker->Publish(ep); + + Events::MultiBall e; + auto transform = m_World->GetComponent(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(ent1); + auto transform2 = m_World->GetComponent(ent2); + auto ball1 = m_World->GetComponent(ent1); + auto ball2 = m_World->GetComponent(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; diff --git a/src/game/Game/PadSystem.cpp.orig b/src/game/Game/PadSystem.cpp.orig index 2a58277..7d21606 100755 --- a/src/game/Game/PadSystem.cpp.orig +++ b/src/game/Game/PadSystem.cpp.orig @@ -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(entity); - if (ball != NULL) { + if (ball != nullptr) { if (ReplaceBall() == true) { SetReplaceBall(false); - auto transformEntity = m_World->GetComponent(entity); - transformEntity->Position = glm::vec3(20, 20, -10); - - //Temporary. Create new ball. - /*auto ent = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(ent); - transform->Position = glm::vec3(0.5f, 0.f, -10.f); - transform->Scale = glm::vec3(1.f, 1.f, 1.f); - std::shared_ptr sprite = m_World->AddComponent(ent); - sprite->SpriteFile = "Textures/Ball.png"; - std::shared_ptr circleShape = m_World->AddComponent(ent); - std::shared_ptr cball = m_World->AddComponent(ent); - std::shared_ptr physics = m_World->AddComponent(ent); - physics->Static = false;*/ - - auto ent = m_World->CreateEntity(); - std::shared_ptr transform = m_World->AddComponent(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(ent); - model->ModelFile = "Models/Test/Ball/Ballopus.obj"; - //auto pointlight = m_World->AddComponent(ent); - std::shared_ptr circleShape = m_World->AddComponent(ent); - std::shared_ptr cball = m_World->AddComponent(ent); - std::shared_ptr physics = m_World->AddComponent(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(entity); + transform->Position = glm::vec3(0.0f, 0.26f, -10.f); + transform->Velocity = glm::vec3(0.0f, -ball->Speed, 0.f); } } } @@ -100,27 +69,20 @@ void dd::Systems::PadSystem::Update(double dt) transform->Velocity.x = pad->MaxSpeed; } transform->Position += transform->Velocity * (float)dt; -<<<<<<< HEAD - transform->Velocity += acceleration * (float)dt; + transform->Velocity += acceleration * (float)dt; transform->Velocity -= transform->Velocity * pad->SlowdownModifier * (float)dt; + if (Left()) { acceleration.x = -pad->AccelerationSpeed; -======= - transform->Velocity += acceleration * (float)dt; - transform->Velocity -= transform->Velocity * (0.9f * (float)dt); - - - - if (left) - { - acceleration.x = -20.f; ->>>>>>> origin/physics +<<<<<<< HEAD } else if (Right()) { +======= + } else if (Right()) { +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db acceleration.x = pad->AccelerationSpeed; - } - else { + } else { acceleration.x = 0.f; } @@ -128,9 +90,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 transform = m_World->AddComponent(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(ent); + model->ModelFile = "Models/Test/Ball/Ballopus.obj"; + //auto pointlight = m_World->AddComponent(ent); + std::shared_ptr circleShape = m_World->AddComponent(ent); + std::shared_ptr cball = m_World->AddComponent(ent); + std::shared_ptr physics = m_World->AddComponent(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; @@ -148,6 +139,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; } @@ -183,10 +178,10 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event) auto transformBall = m_World->GetComponent(entityBall); auto transformPad = m_World->GetComponent(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; @@ -195,41 +190,20 @@ 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; <<<<<<< HEAD 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; +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db //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 transform = m_World->AddComponent(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(ent); - model->ModelFile = "Models/Test/Ball/Ballopus.obj"; - //auto pointlight = m_World->AddComponent(ent); - std::shared_ptr circleShape = m_World->AddComponent(ent); - std::shared_ptr cball = m_World->AddComponent(ent); - std::shared_ptr physics = m_World->AddComponent(ent); - physics->Static = false; - - 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); -======= - //float movementY = glm::cos((abs(movementX) / (3.2f * movementMultiplier)) * 3.14159265359f / 2) * 2.f; - - // std::cout << movementX << " " << movementY << std::endl; - float len = glm::length(transformBall->Velocity); + //auto pointlight = m_World->AddComponent(ent); + transformBall->Velocity += glm::vec3(transformPad->Velocity.x, 0, 0); transformBall->Velocity = glm::normalize(transformBall->Velocity) * len; @@ -237,15 +211,92 @@ bool dd::Systems::PadSystem::OnContact(const dd::Events::Contact &event) //transform->Velocity = glm::vec3(movementX, movementY, 0.f); */ ->>>>>>> origin/physics } -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(event.Entity1); + auto pad = m_World->GetComponent(event.Entity2); + if (powerUp != nullptr) { + entityPower = event.Entity1; + } else { + powerUp = m_World->GetComponent(event.Entity2); + if (powerUp != nullptr) { + entityPower = event.Entity2; + } + } + if (pad != nullptr) { + entityPad = event.Entity2; + } else { + pad = m_World->GetComponent(event.Entity1); + if (pad != nullptr) { + entityPad = event.Entity1; + } + } + + if (entityPower == NULL || entityPad == NULL) { + return false; + } + + pad = m_World->GetComponent(entityPad); + if (pad == nullptr) { + return false; + } + + m_World->RemoveComponent(entityPower); + m_World->RemoveComponent(entityPower); + m_World->RemoveComponent(entityPower); + m_World->RemoveEntity(entityPower); + Events::PowerUpTaken ep; + ep.Name = "Something"; + EventBroker->Publish(ep); + + Events::MultiBall e; + auto transform = m_World->GetComponent(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(ent1); + auto transform2 = m_World->GetComponent(ent2); + auto ball1 = m_World->GetComponent(ent1); + auto ball2 = m_World->GetComponent(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; diff --git a/src/game/Physics/PhysicsSystem.cpp b/src/game/Physics/PhysicsSystem.cpp index 30c0e35..86448ef 100755 --- a/src/game/Physics/PhysicsSystem.cpp +++ b/src/game/Physics/PhysicsSystem.cpp @@ -47,7 +47,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; } @@ -67,7 +73,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; @@ -79,6 +85,10 @@ void dd::Systems::PhysicsSystem::Update(double dt) } } + for (auto i : m_Impulses) { + i.Body->ApplyLinearImpulse(i.Impulse, i.Point, true); + } + m_Impulses.clear(); m_Accumulator += dt; while(m_Accumulator >= m_TimeStep) { @@ -106,7 +116,7 @@ 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)); } diff --git a/src/game/Physics/PhysicsSystem.cpp.orig b/src/game/Physics/PhysicsSystem.cpp.orig index 7730cb0..a38e5aa 100755 --- a/src/game/Physics/PhysicsSystem.cpp.orig +++ b/src/game/Physics/PhysicsSystem.cpp.orig @@ -12,7 +12,7 @@ void dd::Systems::PhysicsSystem::Initialize() { m_ContactListener = new ContactListener(this); - m_Gravity = b2Vec2(0.f, 0.f); + m_Gravity = b2Vec2(0.f, -9.82f); m_PhysicsWorld = new b2World(m_Gravity); m_TimeStep = 1.f/60.f; @@ -22,11 +22,16 @@ void dd::Systems::PhysicsSystem::Initialize() m_PhysicsWorld->SetContactListener(m_ContactListener); + InitializeWater(); + EVENT_SUBSCRIBE_MEMBER(m_SetImpulse, PhysicsSystem::SetImpulse); } void dd::Systems::PhysicsSystem::InitializeWater() { + b2ParticleSystemDef m_ParticleSystemDef; + m_ParticleSystemDef.radius = 0.1f; + m_ParticleSystem = m_PhysicsWorld->CreateParticleSystem(&m_ParticleSystemDef); } @@ -42,7 +47,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; } @@ -62,7 +73,11 @@ void dd::Systems::PhysicsSystem::Update(double dt) continue; } +<<<<<<< HEAD if (m_World->GetEntityParent(entity) == 0) { +======= + if (m_World->GetEntityParent(entity) == 0) { //TODO: Make this work with childs too +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db b2Vec2 position; position.x = transformComponent->Position.x; position.y = transformComponent->Position.y; @@ -70,17 +85,25 @@ void dd::Systems::PhysicsSystem::Update(double dt) float angle = -glm::eulerAngles(transformComponent->Orientation).z; body->SetTransform(position, angle); + <<<<<<< HEAD -======= - - - body->SetLinearVelocity(b2Vec2(transformComponent->Velocity.x, transformComponent->Velocity.y)); - - ->>>>>>> origin/physics } } +======= + 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(); + + +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db m_Accumulator += dt; while(m_Accumulator >= m_TimeStep) { @@ -88,10 +111,6 @@ void dd::Systems::PhysicsSystem::Update(double dt) m_Accumulator -= dt; } -<<<<<<< HEAD -======= - ->>>>>>> origin/physics for (auto i : m_EntitiesToBodies) { EntityID entity = i.first; b2Body* body = i.second; @@ -101,21 +120,22 @@ void dd::Systems::PhysicsSystem::Update(double dt) continue; } -<<<<<<< HEAD auto transformComponent = m_World->GetComponent(entity); if (! transformComponent) continue; - +<<<<<<< HEAD + auto parent = m_World->GetEntityParent(entity); + if (parent == 0) { ======= ->>>>>>> origin/physics if (m_World->GetEntityParent(entity) == 0) { +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db b2Vec2 position = body->GetPosition(); transformComponent->Position.x = position.x; transformComponent->Position.y = position.y; float angle = body->GetAngle(); - //TODO: CHECK IF THIS IS CORRECT + transformComponent->Orientation = glm::quat(glm::vec3(0, 0, -angle)); <<<<<<< HEAD ======= @@ -123,10 +143,26 @@ void dd::Systems::PhysicsSystem::Update(double dt) b2Vec2 velocity = body->GetLinearVelocity(); transformComponent->Velocity.x = velocity.x; transformComponent->Velocity.y = velocity.y; +>>>>>>> 72413dc0a93bd3a2f6ab9fa7e19bbc3b846232db ->>>>>>> origin/physics } } + + b2Vec2* positionBuffer = m_ParticleSystem->GetPositionBuffer(); + for (auto i : m_EntitiesToParticleHandle) { + EntityID entity = i.first; + b2ParticleHandle* particleH = i.second; + + b2Vec2 positionB2 = positionBuffer[particleH->GetIndex()]; + glm::vec2 position = glm::vec2(positionB2.x, positionB2.y); + + + EntityID entityParent = m_World->GetEntityParent(entity); + auto transform = m_World->GetComponent(entity); + auto transformParent = m_World->GetComponent(entityParent); + + transform->Position = glm::vec3(position.x, position.y, -10) - transformParent->Position; + } } void dd::Systems::PhysicsSystem::UpdateEntity(double dt, EntityID entity, EntityID parent) @@ -139,10 +175,13 @@ void dd::Systems::PhysicsSystem::OnEntityCommit(EntityID entity) auto physicsComponent = m_World->GetComponent(entity); auto waterComponent = m_World->GetComponent(entity); + if (physicsComponent && waterComponent) { + LOG_ERROR("Entity has both water and physics component, this is illegal. The police has been alerted."); + return; + } if (physicsComponent) { CreateBody(entity); - } - if (waterComponent) { + } else if (waterComponent) { CreateParticleGroup(entity); } } @@ -200,7 +239,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity) auto boxComponent = m_World->GetComponent(entity); if (boxComponent) { b2PolygonShape* bShape = new b2PolygonShape(); - bShape->SetAsBox(absoluteTransform.Scale.x/2, absoluteTransform.Scale.y/2); //TODO: THIS SUCKS DUDE 4?!?!?!? + bShape->SetAsBox(absoluteTransform.Scale.x/2, absoluteTransform.Scale.y/2); pShape = bShape; } else { auto circleComponent = m_World->GetComponent(entity); @@ -212,7 +251,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity) if (absoluteTransform.Scale.x != absoluteTransform.Scale.y && absoluteTransform.Scale.y != absoluteTransform.Scale.z) { LOG_WARNING("Circles has to be of uniform scale."); } - pShape->m_radius = absoluteTransform.Scale.x/2; //TODO: THIS ALSO SUCKS 4 WTH + pShape->m_radius = absoluteTransform.Scale.x/2; } } @@ -245,15 +284,37 @@ void dd::Systems::PhysicsSystem::CreateParticleGroup(EntityID e) LOG_ERROR("No Transform component in CreateParticleGroup"); return; } - LOG_INFO("------ CREATING PARTICLE GROUP"); b2ParticleGroupDef pd; b2PolygonShape shape; - shape.SetAsBox(transform->Scale.x, transform->Scale.y); + + shape.SetAsBox(transform->Scale.x/2.f, transform->Scale.y/2.f); pd.shape = &shape; - pd.flags = b2_elasticParticle; - pd.angle = -0.5f; - pd.angularVelocity = 2.0f; + pd.flags = b2_tensileParticle; + pd.linearVelocity = b2Vec2(0, 5.f); + pd.position.Set(transform->Position.x, transform->Position.y); + //TODO: PUT IN LIST + t_watergroup = m_ParticleSystem->CreateParticleGroup(pd); + b2Vec2* t_ParticlePositions = m_ParticleSystem->GetPositionBuffer(); + for(int i = 0; i < m_ParticleSystem->GetParticleCount(); i++){ + { + auto t_waterparticle = m_World->CreateEntity(e); + auto transformChild = m_World->AddComponent(t_waterparticle); + //auto sprite = m_World->AddComponent(t_waterparticle); + + + + transformChild->Position = glm::vec3(t_ParticlePositions[i].x - transform->Position.x, t_ParticlePositions[i].y - transform->Position.y, -9.5f); + transformChild->Scale = glm::vec3(m_ParticleSystem->GetRadius())/transform->Scale; + //sprite->SpriteFile = "Textures/Ball.png"; + m_World->CommitEntity(t_waterparticle); + + m_EntitiesToParticleHandle.insert(std::make_pair(t_waterparticle, m_ParticleSystem->GetParticleHandleFromIndex(i))); + m_ParticleHandleToEntities.insert(std::make_pair( m_ParticleSystem->GetParticleHandleFromIndex(i), t_waterparticle)); + } + + } + LOG_INFO("ParticleCount: %i", m_ParticleSystem->GetParticleCount()); } dd::Systems::PhysicsSystem::~PhysicsSystem() diff --git a/src/game/Sound/Sound.cpp b/src/game/Sound/Sound.cpp new file mode 100644 index 0000000..972f71b --- /dev/null +++ b/src/game/Sound/Sound.cpp @@ -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; +} \ No newline at end of file diff --git a/src/game/Sound/SoundSystem.cpp b/src/game/Sound/SoundSystem.cpp new file mode 100644 index 0000000..aaca752 --- /dev/null +++ b/src/game/Sound/SoundSystem.cpp @@ -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 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(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(event.Entity1); + if (collisionSound == nullptr) { + collisionSound = m_World->GetComponent(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; +} + +