diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | src/audio/AudioLogic.cpp | 952 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 5 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 18 | ||||
-rw-r--r-- | src/vehicles/Bike.cpp | 2 | ||||
-rw-r--r-- | src/vehicles/Bike.h | 2 |
6 files changed, 634 insertions, 348 deletions
@@ -351,4 +351,5 @@ MigrationBackup/ vendor/glew-2.1.0/ vendor/glfw-3.3.2.bin.WIN32/ -vendor/glfw-3.3.2.bin.WIN64/
\ No newline at end of file +vendor/glfw-3.3.2.bin.WIN64/ +/vendor/glfw-3.3.2 diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index ac81523c..a0d67d03 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -37,6 +37,8 @@ #include "Weather.h" #include "ZoneCull.h" #include "sampman.h" +#include <vehicles\Bike.h> + const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples); const int policeChannel = channels + 1; @@ -562,116 +564,116 @@ struct tVehicleSampleData { uint8 m_bDoorType; }; -const tVehicleSampleData aVehicleSettings[110] = { {SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 11487, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_8, 8, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_HORN_JEEP, 10928, 1}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_HORN_JEEP, 9935, 2}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 12893, SFX_CAR_HORN_JEEP, 8941, 0}, - {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 10706, SFX_CAR_HORN_JEEP, 11922, 1}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_HORN_JEEP, 7948, 2}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_POLICE_SIREN_SLOW, 11556, 2}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 31478, SFX_CAR_HORN_JEEP, 8941, 2}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_BMW328, 9538, SFX_CAR_HORN_JEEP, 12220, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_3, 3, SFX_CAR_HORN_BMW328, 12017, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_2, 2, SFX_CAR_HORN_JEEP, 22295, SFX_CAR_HORN_JEEP, 12200, 1}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_HORN_JEEP, 13400, 1}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 18286, SFX_CAR_HORN_JEEP, 9935, 2}, - {SFX_CAR_REV_3, 3, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_HORN_JEEP, 13600, 1}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 22295, SFX_AMBULANCE_SIREN_SLOW, 8795, 2}, - {SFX_CAR_REV_5, 5, SFX_CAR_HORN_PORSCHE, 9271, SFX_POLICE_SIREN_SLOW, 16168, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 12170, SFX_CAR_HORN_JEEP, 8000, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_BUS2, 12345, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_2, 2, SFX_CAR_HORN_BMW328, 10796, SFX_CAR_HORN_JEEP, 8543, 1}, - {SFX_CAR_REV_5, 5, SFX_CAR_HORN_PORSCHE, 9271, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_2, 2, SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_PICKUP, 11025, SFX_ICE_CREAM_TUNE, 11025, 0}, - {SFX_CAR_REV_7, 7, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 10000, 0}, - {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 10706, SFX_POLICE_SIREN_SLOW, 13596, 1}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 17260, SFX_POLICE_SIREN_SLOW, 13000, 2}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_HORN_JEEP, 9935, 2}, - {SFX_CAR_REV_8, 8, SFX_CAR_HORN_PORSCHE, 10400, SFX_CAR_HORN_JEEP, 10123, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 26513, SFX_POLICE_SIREN_SLOW, 13596, 0}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_BUS2, 11652, SFX_CAR_HORN_JEEP, 10554, 3}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_HORN_JEEP, 8000, 2}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_HORN_JEEP, 9935, 2}, - {SFX_CAR_REV_1, 0, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_HORN_JEEP, 9935, 3}, - {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CESNA_IDLE, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_BUS, 16291, SFX_CAR_HORN_JEEP, 7500, 3}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10233, SFX_CAR_HORN_JEEP, 8935, 0}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_HORN_JEEP, 8935, 0}, - {SFX_CAR_REV_1, 0, SFX_CAR_HORN_PICKUP, 2000, SFX_CAR_HORN_JEEP, 17000, 0}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BMW328, 9003, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_2, 2, SFX_CAR_HORN_PORSCHE, 12375, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_5, 5, SFX_CAR_HORN_BUS2, 15554, SFX_CAR_HORN_JEEP, 9935, 1}, - {SFX_CAR_REV_7, 7, SFX_CAR_HORN_BUS2, 13857, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_7, 7, SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 2}, - {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 20143, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9000, 0}, - {SFX_CAR_REV_6, 6, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_HORN_JEEP, 9935, 2}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS, 18286, SFX_CAR_HORN_JEEP, 9935, 2}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_4, 4, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_HORN_JEEP, 13400, 1}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0}, - {SFX_CAR_REV_1, 1, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9935, 0} }; +const tVehicleSampleData aVehicleSettings[110] = { {SFX_CAR_REV_10, 13, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9935, 0}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_56CHEV, 11487, SFX_CAR_HORN_JEEP, 9900, 0}, + {SFX_CAR_REV_2, 5, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_HORN_JEEP, 9890, 1}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_HORN_JEEP, 9960, 2}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_56CHEV, 12893, SFX_CAR_HORN_JEEP, 9500, 0}, + {SFX_CAR_REV_4, 7, SFX_CAR_HORN_BMW328, 10706, SFX_CAR_HORN_JEEP, 9600, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_TRUCK, 29711, SFX_POLICE_SIREN_SLOW, 10588, 2}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_TRUCK, 31478, SFX_CAR_HORN_JEEP, 9800, 2}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_BMW328, 9538, SFX_CAR_HORN_JEEP, 9900, 1}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_HORN_JEEP, 10000, 0}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_BMW328, 12017, SFX_CAR_HORN_JEEP, 9900, 1}, + {SFX_CAR_REV_9, 12, SFX_CAR_HORN_JEEP, 22293, SFX_CAR_HORN_JEEP, 9800, 1}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_HORN_JEEP, 9700, 0}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_BUS, 18286, SFX_CAR_HORN_JEEP, 9600, 0}, + {SFX_CAR_REV_2, 5, SFX_CAR_HORN_PORSCHE, 11025, SFX_CAR_HORN_JEEP, 9500, 1}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_JEEP, 22295, SFX_AMBULANCE_SIREN_SLOW, 12688, 0}, + {SFX_CAR_REV_4, 7, SFX_CAR_HORN_PORSCHE, 9271, SFX_POLICE_SIREN_SLOW, 11471, 1}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_56CHEV, 12170, SFX_CAR_HORN_JEEP, 9400, 0}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_BMW328, 11000, SFX_CAR_HORN_JEEP, 9300, 0}, + {SFX_CAR_REV_10, 13, SFX_CAR_HORN_BMW328, 10796, SFX_CAR_HORN_JEEP, 9200, 1}, + {SFX_CAR_REV_4, 7, SFX_CAR_HORN_BMW328, 10500, SFX_CAR_HORN_JEEP, 9100, 1}, + {SFX_CAR_REV_10, 13, SFX_CAR_HORN_PICKUP, 10924, SFX_CAR_HORN_JEEP, 9000, 0}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_PICKUP, 11025, SFX_ICE_CREAM_TUNE, 11025, 0}, + {SFX_CAR_REV_6, 9, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9100, 0}, + {SFX_HELI_APACHE_1, 30, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9200, 1}, + {SFX_CAR_REV_4, 7, SFX_CAR_HORN_BMW328, 10706, SFX_POLICE_SIREN_SLOW, 10511, 1}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_BUS, 17260, SFX_POLICE_SIREN_SLOW, 11029, 0}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_HORN_JEEP, 9300, 0}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_PORSCHE, 10400, SFX_CAR_HORN_JEEP, 9400, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_POLICE_SIREN_SLOW, 11912, 1}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_BUS2, 11652, SFX_CAR_HORN_JEEP, 9500, 3}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_TRUCK, 29711, SFX_CAR_HORN_JEEP, 9600, 2}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_HORN_JEEP, 9700, 2}, + {SFX_CAR_REV_6, 9, SFX_CAR_HORN_JEEP, 25400, SFX_CAR_HORN_JEEP, 9800, 0}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9900, 1}, + {SFX_CAR_REV_17, 20, SFX_CAR_HORN_JEEP, 26313, SFX_CAR_HORN_JEEP, 10000, 1}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_BUS, 16291, SFX_CAR_HORN_JEEP, 10100, 3}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_HORN_JEEP, 9900, 0}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_56CHEV, 10233, SFX_CAR_HORN_JEEP, 9800, 1}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_PICKUP, 8670, SFX_CAR_HORN_JEEP, 9700, 0}, + {SFX_RC_REV, 17, SFX_CAR_HORN_PICKUP, 20000, SFX_CAR_HORN_JEEP, 9600, 1}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9500, 1}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_TRUCK, 29000, SFX_CAR_HORN_JEEP, 9400, 2}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_BMW328, 9003, SFX_CAR_HORN_JEEP, 9300, 1}, + {SFX_CAR_REV_4, 7, SFX_CAR_HORN_PORSCHE, 12375, SFX_CAR_HORN_JEEP, 9200, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_BUS2, 15554, SFX_CAR_HORN_JEEP, 9100, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_BUS2, 13857, SFX_CAR_HORN_JEEP, 9000, 2}, + {SFX_MOPED_REV, 21, SFX_CAR_HORN_JEEP, 30000, SFX_CAR_HORN_JEEP, 9100, 1}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_JEEP, 22043, SFX_CAR_HORN_JEEP, 9200, 0}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9300, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9400, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9500, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9600, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 21043, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_REV_5, 8, SFX_CAR_HORN_TRUCK, 28043, SFX_CAR_HORN_JEEP, 9800, 2}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_BUS, 18286, SFX_CAR_HORN_JEEP, 9900, 0}, + {SFX_CAR_REV_12, 15, SFX_CAR_HORN_JEEP, 28500, SFX_CAR_HORN_JEEP, 9800, 1}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_56CHEV, 10842, SFX_CAR_HORN_JEEP, 9700, 0}, + {SFX_CAR_REV_8, 11, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_HORN_JEEP, 9700, 0}, + {SFX_SEAPLANE_PRO1, 35, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_REV_20, 23, SFX_CAR_HORN_JEEP, 27000, SFX_CAR_HORN_JEEP, 9600, 1}, + {SFX_MOPED_REV, 21, SFX_CAR_HORN_JEEP, 31000, SFX_CAR_HORN_JEEP, 9500, 1}, + {SFX_CAR_REV_17, 20, SFX_CAR_HORN_PICKUP, 11000, SFX_CAR_HORN_JEEP, 9400, 1}, + {SFX_RC_REV, 17, SFX_CAR_HORN_JEEP, 30000, SFX_CAR_HORN_JEEP, 15000, 1}, + {SFX_CAR_RC_HELI, 18, SFX_CAR_HORN_JEEP, 30000, SFX_CAR_HORN_JEEP, 15000, 1}, + {SFX_CAR_REV_9, 12, SFX_CAR_HORN_56CHEV, 10300, SFX_CAR_HORN_JEEP, 9100, 0}, + {SFX_CAR_REV_9, 12, SFX_CAR_HORN_56CHEV, 10500, SFX_CAR_HORN_JEEP, 9000, 0}, + {SFX_CAR_REV_19, 22, SFX_CAR_HORN_JEEP, 30000, SFX_CAR_HORN_JEEP, 9000, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9100, 2}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_TRUCK, 28000, SFX_CAR_HORN_JEEP, 9200, 2}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_PICKUP, 11200, SFX_CAR_HORN_JEEP, 9300, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9400, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9500, 1}, + {SFX_CAR_REV_9, 12, SFX_CAR_HORN_56CHEV, 10700, SFX_CAR_HORN_JEEP, 9600, 0}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_BMW328, 9000, SFX_CAR_HORN_JEEP, 9700, 0}, + {SFX_CAR_REV_6, 9, SFX_CAR_HORN_BMW328, 9200, SFX_CAR_HORN_JEEP, 9800, 0}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9900, 1}, + {SFX_CAR_REV_11, 14, SFX_CAR_HORN_56CHEV, 10540, SFX_CAR_HORN_JEEP, 9935, 2}, + {SFX_CAR_REV_8, 11, SFX_CAR_HORN_PICKUP, 11000, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_REV_2, 5, SFX_CAR_HORN_BMW328, 9500, SFX_CAR_HORN_JEEP, 9800, 1}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_BMW328, 9700, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_REV_8, 11, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_HORN_JEEP, 9600, 0}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_BUS, 18000, SFX_CAR_HORN_JEEP, 9500, 2}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9400, 1}, + {SFX_CAR_REV_8, 11, SFX_CAR_HORN_JEEP, 27513, SFX_CAR_HORN_JEEP, 9300, 1}, + {SFX_CAR_REV_8, 11, SFX_CAR_HORN_56CHEV, 10700, SFX_CAR_HORN_JEEP, 9200, 0}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9100, 2}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9000, 2}, + {SFX_CAR_REV_10, 13, SFX_CAR_HORN_BUS2, 18000, SFX_CAR_HORN_JEEP, 9100, 2}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_BUS2, 17900, SFX_POLICE_SIREN_SLOW, 10511, 2}, + {SFX_CAR_REV_4, 7, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9200, 1}, + {SFX_CAR_REV_8, 11, SFX_CAR_HORN_BMW328, 9600, SFX_CAR_HORN_JEEP, 9300, 1}, + {SFX_CAR_REV_4, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9400, 1}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_PORSCHE, 10000, SFX_CAR_HORN_JEEP, 9500, 0}, + {SFX_CAR_REV_6, 9, SFX_CAR_HORN_PORSCHE, 10500, SFX_CAR_HORN_JEEP, 9600, 0}, + {SFX_CAR_REV_10, 13, SFX_CAR_HORN_JEEP, 25513, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_REV_1, 0, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9800, 1}, + {SFX_CAR_REV_3, 6, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9900, 1}, + {SFX_CAR_REV_10, 13, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9800, 1}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_RC_HELI, 18, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9600, 1}, + {SFX_CAR_REV_6, 9, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9700, 1}, + {SFX_CAR_REV_7, 10, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9600, 1}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9500, 1}, + {SFX_CAR_REV_9, 12, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9400, 1}, + {SFX_CAR_REV_2, 5, SFX_CAR_HORN_PORSCHE, 11025, SFX_POLICE_SIREN_SLOW, 11000, 1}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9200, 1}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9300, 1}, + {SFX_CAR_REV_1, 4, SFX_CAR_HORN_JEEP, 26513, SFX_CAR_HORN_JEEP, 9400, 1} }; bool bPlayerJustEnteredCar; @@ -695,97 +697,148 @@ const bool hornPatternsArray[8][44] = { false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false}, }; - -void -cAudioManager::ProcessVehicle(CVehicle *veh) +void cAudioManager::ProcessVehicle(CVehicle* veh) { - tHandlingData *handling = veh->pHandling; - float velChange; + CPlayerPed* player; + CVehicle* playerVeh; + CEntity* attachedTo; cVehicleParams params; - m_sQueueSample.m_vecPos = veh->GetPosition(); - - params.m_bDistanceCalculated = false; - params.m_fDistance = GetDistanceSquared(m_sQueueSample.m_vecPos); - params.m_pVehicle = veh; - params.m_pTransmission = nil; - params.m_nIndex = 0; - params.m_fVelocityChange = 0.0f; - - if (handling != nil) - params.m_pTransmission = &handling->Transmission; + CBike* bike; + CAutomobile* automobile; + float gasPedal; - params.m_nIndex = veh->GetModelIndex() - MI_FIRST_VEHICLE; - if (params.m_pVehicle->GetStatus() == STATUS_SIMPLE) - velChange = params.m_pVehicle->AutoPilot.m_fMaxTrafficSpeed * 0.02f; - else - velChange = DotProduct(params.m_pVehicle->m_vecMoveSpeed, params.m_pVehicle->GetForward()); - params.m_fVelocityChange = velChange; - switch (params.m_pVehicle->m_vehType) { - case VEHICLE_TYPE_CAR: - UpdateGasPedalAudio((CAutomobile *)veh); - if (params.m_nIndex == RCBANDIT) { - ProcessModelCarEngine(¶ms); + //44-58 + player = FindPlayerPed(); + playerVeh = FindPlayerVehicle(); + if (playerVeh == NULL && player != NULL) { + attachedTo = player->m_attachedTo; + if (attachedTo != NULL && attachedTo->GetType() == ENTITY_TYPE_VEHICLE) + playerVeh = (CVehicle*)attachedTo; + } + if (playerVeh == veh + || CGame::currArea == AREA_OVALRING + || CGame::currArea == AREA_BLOOD + || CGame::currArea == AREA_DIRT + || CGame::currArea == AREA_EVERYWHERE + || CGame::currArea == AREA_MALL + || CGame::currArea == AREA_MAIN_MAP) { + //62-84 + m_sQueueSample.m_vecPos = veh->GetPosition(); + params.m_bDistanceCalculated = false; + params.m_pVehicle = veh; + params.m_fDistance = GetDistanceSquared(m_sQueueSample.m_vecPos); + params.m_pTransmission = veh->pHandling != NULL ? &veh->pHandling->Transmission : NULL; + params.m_nIndex = veh->m_modelIndex - MI_FIRST_VEHICLE; + if (veh->GetStatus() == STATUS_SIMPLE) + params.m_fVelocityChange = veh->AutoPilot.m_fMaxTrafficSpeed * 0.02f; + else + params.m_fVelocityChange = DotProduct(veh->m_vecMoveSpeed, veh->GetForward()); + params.m_VehicleType = veh->m_vehType; + + if (CGame::currArea == AREA_MALL && playerVeh != veh) { ProcessVehicleOneShots(¶ms); - ((CAutomobile *)veh)->m_fVelocityChangeForAudio = params.m_fVelocityChange; - break; + ProcessVehicleSirenOrAlarm(¶ms); + ProcessEngineDamage(¶ms); + return; } - if (params.m_nIndex == DODO) { - if (!ProcessVehicleRoadNoise(¶ms)) { - ProcessVehicleOneShots(¶ms); - ((CAutomobile *)veh)->m_fVelocityChangeForAudio = params.m_fVelocityChange; - break; + //104- + switch (params.m_VehicleType) { + case VEHICLE_TYPE_CAR://done + automobile = (CAutomobile*)veh; + UpdateGasPedalAudio(&automobile->m_fGasPedalAudio, automobile->m_fGasPedal); + if (veh->m_modelIndex == MI_RCBANDIT || veh->m_modelIndex == MI_RCBARON) { + ProcessModelCarEngine(¶ms);//recheck + ProcessEngineDamage(¶ms); + } else if (veh->m_modelIndex == MI_RCRAIDER || veh->m_modelIndex == MI_RCGOBLIN) { + //ProcessModelHeliVehicle(this, ¶ms); + ProcessEngineDamage(¶ms); + } else { + switch (veh->GetVehicleAppearance()) { + case VEHICLE_APPEARANCE_HELI: + ProcessHelicopter(¶ms); + //ProcessVehicleFlatTyre(¶ms); + ProcessEngineDamage(¶ms); + break; + case VEHICLE_APPEARANCE_BOAT: + case VEHICLE_APPEARANCE_PLANE: + break; + default: + if (ProcessVehicleRoadNoise(¶ms)) { + ProcessReverseGear(¶ms); + if (CWeather::WetRoads > 0.0) + ProcessWetRoadNoise(¶ms); + ProcessVehicleSkidding(¶ms); + //ProcessVehicleFlatTyre(params); + ProcessVehicleHorn(¶ms); + ProcessVehicleSirenOrAlarm(¶ms); + if (UsesReverseWarning(params.m_nIndex)) + ProcessVehicleReverseWarning(¶ms); + if(HasAirBrakes(params.m_nIndex)) + ProcessAirBrakes(¶ms); + ProcessCarBombTick(¶ms); + ProcessVehicleEngine(¶ms); + ProcessEngineDamage(¶ms); + ProcessVehicleDoors(¶ms); + } + break; + } } - if (CWeather::WetRoads > 0.f) - ProcessWetRoadNoise(¶ms); - ProcessVehicleSkidding(¶ms); - } else { - if (!ProcessVehicleRoadNoise(¶ms)) { - ProcessVehicleOneShots(¶ms); - ((CAutomobile *)veh)->m_fVelocityChangeForAudio = params.m_fVelocityChange; + ProcessVehicleOneShots(¶ms); + automobile->m_fVelocityChangeForAudio = params.m_fVelocityChange; + break; + case VEHICLE_TYPE_BOAT://done + if (veh->m_modelIndex == MI_SKIMMER) + ProcessHelicopter(¶ms); + else + ProcessBoatEngine(¶ms); + ProcessBoatMovingOverWater(¶ms); + ProcessVehicleOneShots(¶ms); + break; + case VEHICLE_TYPE_HELI: //done + ProcessHelicopter(¶ms); //TODO recheck + ProcessVehicleOneShots(¶ms); + break; + case VEHICLE_TYPE_PLANE://done + switch (params.m_nIndex) { + case AIRTRAIN: + ProcessJumbo(¶ms);//recheck + break; + case DEADDODO: + ProcessCesna(¶ms);//recheck + break; + default: break; } - ProcessReverseGear(¶ms); - if (CWeather::WetRoads > 0.f) - ProcessWetRoadNoise(¶ms); - ProcessVehicleSkidding(¶ms); - ProcessVehicleHorn(¶ms); - ProcessVehicleSirenOrAlarm(¶ms); - if (UsesReverseWarning(params.m_nIndex)) - ProcessVehicleReverseWarning(¶ms); - if (HasAirBrakes(params.m_nIndex)) - ProcessAirBrakes(¶ms); + ProcessVehicleOneShots(¶ms); + //ProcessVehicleFlatType(¶ms); + break; + case VEHICLE_TYPE_BIKE: //done + bike = (CBike*)veh; + //gasPedal = fabs(veh->m_fGasPedal); + //if (gasPedal <= bike->m_fGasPedalAudio) + // bike->m_fGasPedalAudio = Max(bike->m_fGasPedalAudio - 0.07f, gasPedal); + //else + // bike->m_fGasPedalAudio = Min(bike->m_fGasPedalAudio + 0.09f, gasPedal); + UpdateGasPedalAudio(&bike->m_fGasPedalAudio, bike->m_fGasPedal); + if (ProcessVehicleRoadNoise(¶ms)) { + if (CWeather::WetRoads > 0.0f) + ProcessWetRoadNoise(¶ms); + ProcessVehicleSkidding(¶ms); + ProcessVehicleHorn(¶ms); + ProcessVehicleSirenOrAlarm(¶ms); + ProcessCarBombTick(¶ms); + ProcessEngineDamage(¶ms); + ProcessVehicleEngine(¶ms); + //ProcessVehicleFlatTyre(); + } + ProcessVehicleOneShots(¶ms); + bike->m_fVelocityChangeForAudio = params.m_fVelocityChange; + break; + default: + break; } - ProcessCarBombTick(¶ms); - ProcessVehicleEngine(¶ms); - ProcessEngineDamage(¶ms); - ProcessVehicleDoors(¶ms); - - ProcessVehicleOneShots(¶ms); - ((CAutomobile *)veh)->m_fVelocityChangeForAudio = params.m_fVelocityChange; - break; - case VEHICLE_TYPE_BOAT: - ProcessBoatEngine(¶ms); - ProcessBoatMovingOverWater(¶ms); - ProcessVehicleOneShots(¶ms); - break; -#ifdef GTA_TRAIN - case VEHICLE_TYPE_TRAIN: - ProcessTrainNoise(¶ms); - ProcessVehicleOneShots(¶ms); - break; -#endif - case VEHICLE_TYPE_HELI: - ProcessHelicopter(¶ms); - ProcessVehicleOneShots(¶ms); - break; - case VEHICLE_TYPE_PLANE: - ProcessPlane(¶ms); - ProcessVehicleOneShots(¶ms); - break; - default: - break; + ProcessRainOnVehicle(¶ms); } - ProcessRainOnVehicle(¶ms); } void @@ -1060,6 +1113,16 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) SampleManager.StopChannel(m_nActiveSamples); return; } + if (!params->m_bDistanceCalculated) { + if (params->m_fDistance <= 0.0) + m_sQueueSample.m_fDistance = 0.0; + else + m_sQueueSample.m_fDistance = sqrt(params->m_fDistance); + } + //if (playerVeh == veh /*&& veh->m_modelIndex != DODO(187)*/) { + // ProcessPlayersVehicleEngine(params, params->m_pVehicle); + // return; + //} if (veh->bEngineOn) { CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); automobile = (CAutomobile *)params->m_pVehicle; @@ -1068,7 +1131,7 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) return; } if (FindPlayerVehicle() == veh) { - ProcessPlayersVehicleEngine(params, automobile); + ProcessPlayersVehicleEngine(params, params->m_pVehicle); return; } transmission = params->m_pTransmission; @@ -1181,15 +1244,14 @@ cAudioManager::ProcessVehicleEngine(cVehicleParams *params) } void -cAudioManager::UpdateGasPedalAudio(CAutomobile *automobile) +cAudioManager::UpdateGasPedalAudio(float* gasPedalAudio, float vehGasPedal) { - float gasPedal = Abs(automobile->m_fGasPedal); - float gasPedalAudio = automobile->m_fGasPedalAudio; + float gasPedal = Abs(vehGasPedal); - if (gasPedalAudio < gasPedal) - automobile->m_fGasPedalAudio = Min(gasPedalAudio + 0.09f, gasPedal); + if (*gasPedalAudio < gasPedal) + *gasPedalAudio = Min(*gasPedalAudio + 0.09f, gasPedal); else - automobile->m_fGasPedalAudio = Max(gasPedalAudio - 0.07f, gasPedal); + *gasPedalAudio = Max(*gasPedalAudio - 0.07f, gasPedal); } void @@ -1305,91 +1367,164 @@ cAudioManager::ProcessCesna(cVehicleParams *params) } } -void -cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *automobile) +void cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams* params, CVehicle* veh) { - static int32 GearFreqAdj[] = {6000, 6000, 3400, 1200, 0, -1000}; - - cTransmission *transmission; - float velocityChange; - float relativeVelocityChange; - float accelerationMultipler; - uint8 wheelInUseCounter; - float time; - int baseFreq; - uint8 vol; - int gearNr; - int32 freq; - - int freqModifier; - int soundOffset; - uint8 engineSoundType; - int16 accelerateState; - bool channelUsed; - bool lostTraction; - bool processedAccelSampleStopped; - uint8 currentGear; + static int32 GearFreqAdj[] = { 6000, 6000, 3400, 1200, 0, -1000 }; + double gasPedal; // st6 + tWheelState* wheelState; + CAutomobile* automobile; // ebp + CBike* bike; // edx + float* gasPedalAudioPtr; // edi + uint8 wheelInUseCounter; // cl + int freqModifier; // [esp+Ch] [ebp-74h] + signed int accelerateState; // [esp+20h] [ebp-60h] + bool channelUsed; // [esp+2Ch] [ebp-54h] + bool lostTraction; // [esp+30h] [ebp-50h] + int engineSoundType; // [esp+1Ch] [ebp-64h] + signed int brakeState; // [esp+24h] [ebp-5Ch] + uint8 wheelsOnGround; // [esp+3Ch] [ebp-44h] float gasPedalAudio; - CVector pos; + double relativeVelocityChange; // st6 + float accelerationMultipler; // [esp+50h] [ebp-30h] + float velocityChangeForAudio; + int baseFreq; // ebp + uint8 vol; // bl + + double time; // st7 + double timeClip; // st4 + int tmp; // edx + int soundOffset; // ebx + char err; // al + + unsigned int freq_2; // edi + bool stuckInSand; // cl + + + unsigned int freq; // edi + + bool speedBool; // [esp+28h] [ebp-58h] + + unsigned __int8 currentGear; // [esp+34h] [ebp-4Ch] + char processedAccelSampleStopped; // [esp+38h] [ebp-48h] + char wheelsOnGroundPrev; // [esp+40h] [ebp-40h] + bool PizzaFaggBool; // [esp+44h] [ebp-3Ch] + + CVector pos; // [esp+64h] [ebp-1Ch] + + //67-105 static int16 LastAccel = 0; - static int16 LastBrake = 0; static uint8 CurrentPretendGear = 1; static bool bLostTractionLastFrame = false; static bool bHandbrakeOnLastFrame = false; static int32 nCruising = 0; static bool bAccelSampleStopped = true; + static uint32 curTime = CTimer::GetTimeInMilliseconds(); - lostTraction = false; - processedAccelSampleStopped = false; + lostTraction = 0; + PizzaFaggBool = 0; + processedAccelSampleStopped = 0; if (bPlayerJustEnteredCar) { - bAccelSampleStopped = true; - bPlayerJustEnteredCar = false; + bAccelSampleStopped = 1; + bPlayerJustEnteredCar = 0; nCruising = 0; LastAccel = 0; - bLostTractionLastFrame = false; - LastBrake = 0; - bHandbrakeOnLastFrame = false; + bLostTractionLastFrame = 0; CurrentPretendGear = 1; + bHandbrakeOnLastFrame = 0; } - if (CReplay::IsPlayingBack()) - accelerateState = 255.f * clamp(automobile->m_fGasPedal, 0.0f, 1.0f); - else + //106-157 + if (CReplay::IsPlayingBack()) { + accelerateState = (signed int)(255.0 * clamp(params->m_pVehicle->m_fGasPedal, 0.0, 1.0)); + brakeState = (signed int)(255.0 * clamp(params->m_pVehicle->m_fBrakePedal, 0.0, 1.0)); + } else { accelerateState = Pads[0].GetAccelerate(); - + brakeState = Pads[0].GetBrake(); + } + //158-162 + speedBool = params->m_fVelocityChange >= -0.001; channelUsed = SampleManager.GetChannelUsedFlag(m_nActiveSamples); - transmission = params->m_pTransmission; - velocityChange = params->m_fVelocityChange; - relativeVelocityChange = 2.0f * velocityChange / transmission->fMaxVelocity; - - accelerationMultipler = clamp(relativeVelocityChange, 0.0f, 1.0f); - gasPedalAudio = accelerationMultipler; - currentGear = params->m_pVehicle->m_nCurrentGear; - - switch (transmission->nDriveType) - { - case '4': - wheelInUseCounter = 0; - for (uint8 i = 0; i < ARRAY_SIZE(automobile->m_aWheelState); i++) { - if (automobile->m_aWheelState[i] != WHEEL_STATE_NORMAL) - ++wheelInUseCounter; + //163-184 + if (params->m_pVehicle->m_modelIndex != MI_PIZZABOY + && params->m_pVehicle->m_modelIndex != MI_FAGGIO) { + currentGear = params->m_pVehicle->m_nCurrentGear; + } else { + CurrentPretendGear = params->m_pTransmission->nNumberOfGears; + currentGear = CurrentPretendGear; + if (params->m_pVehicle->bIsHandbrakeOn) { + brakeState = 0; + nCruising = 0; + LastAccel = 0; + accelerateState = 0; + } else { + nCruising = 1; } - if (wheelInUseCounter > 2) - lostTraction = true; - break; - case 'F': - if ((automobile->m_aWheelState[CARWHEEL_FRONT_LEFT] != WHEEL_STATE_NORMAL || automobile->m_aWheelState[CARWHEEL_FRONT_RIGHT] != WHEEL_STATE_NORMAL) && - (automobile->m_aWheelState[CARWHEEL_REAR_LEFT] != WHEEL_STATE_NORMAL || automobile->m_aWheelState[CARWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL)) - lostTraction = true; + PizzaFaggBool = true; + } + + //185-205 + switch (params->m_VehicleType) { + case VEHICLE_TYPE_CAR: + automobile = (CAutomobile*)params->m_pVehicle; + wheelsOnGround = automobile->m_nDriveWheelsOnGround; + wheelsOnGroundPrev = automobile->m_nDriveWheelsOnGroundPrev; + gasPedalAudioPtr = (float*)&automobile->m_fGasPedalAudio; + wheelState = automobile->m_aWheelState; + velocityChangeForAudio = automobile->m_fVelocityChangeForAudio; break; - case 'R': - if ((automobile->m_aWheelState[CARWHEEL_REAR_LEFT] != WHEEL_STATE_NORMAL) || (automobile->m_aWheelState[CARWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL)) - lostTraction = true; + case VEHICLE_TYPE_BIKE: + bike = (CBike*)params->m_pVehicle; + wheelsOnGround = bike->m_nDriveWheelsOnGround; + wheelsOnGroundPrev = bike->m_nDriveWheelsOnGroundPrev; + gasPedalAudioPtr = &bike->m_fGasPedalAudio; + wheelState = bike->m_aWheelState; + velocityChangeForAudio = bike->m_fVelocityChangeForAudio; break; + //641-644 + default: + //dbgprint(" ** AUDIOLOG: Unrecognised vehicle type %d in ProcessVehicleEngine() * \n", vehType); + return; } - - if (velocityChange != 0.0f) { - time = params->m_pVehicle->m_vecMoveSpeed.z / velocityChange; + if (!PizzaFaggBool) { + //208-253 + switch (params->m_pTransmission->nDriveType) { + case '4': + if (params->m_VehicleType != VEHICLE_TYPE_BIKE) { + wheelInUseCounter = 0; + for (uint8 i = 0; i < ARRAY_SIZE(wheelState); i++) { + if (wheelState[i] != WHEEL_STATE_NORMAL) + ++wheelInUseCounter; + } + if (wheelInUseCounter > 2) + lostTraction = true; + } + break; + case 'F': + if (params->m_VehicleType == VEHICLE_TYPE_BIKE) { + if (wheelState[BIKEWHEEL_FRONT] != WHEEL_STATE_NORMAL) + lostTraction = true; + } else { + if ((wheelState[CARWHEEL_FRONT_LEFT] != WHEEL_STATE_NORMAL || wheelState[CARWHEEL_FRONT_RIGHT] != WHEEL_STATE_NORMAL) && + (wheelState[CARWHEEL_REAR_LEFT] != WHEEL_STATE_NORMAL || wheelState[CARWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL)) + lostTraction = true; + } + break; + case 'R': + if (params->m_VehicleType == VEHICLE_TYPE_BIKE) { + if (wheelState[BIKEWHEEL_REAR] != WHEEL_STATE_NORMAL) + lostTraction = true; + } else { + if (wheelState[CARWHEEL_REAR_LEFT] != WHEEL_STATE_NORMAL || wheelState[CARWHEEL_REAR_RIGHT] != WHEEL_STATE_NORMAL) + lostTraction = true; + } + break; + default: + break; + } + } + //254-281 + if (params->m_fVelocityChange != 0.0f) { + time = params->m_pVehicle->m_vecMoveSpeed.z / params->m_fVelocityChange; if (time > 0.0f) freqModifier = -(Min(0.2f, time) * 3000.0f * 5.0f); else @@ -1398,138 +1533,282 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * freqModifier = -freqModifier; } else freqModifier = 0; - + //282-283 + if (params->m_VehicleType == VEHICLE_TYPE_BIKE && bike->bExtraSpeed) + freqModifier += 1400; + //TODO rewtire this part + //284-349 + tmp = 0; engineSoundType = aVehicleSettings[params->m_nIndex].m_nBank; - soundOffset = 3 * (engineSoundType - CAR_SAMPLEBANKS_OFFSET); + soundOffset = 3 * (engineSoundType - 4); + err = 0; + switch (soundOffset) { + case 0: + tmp = 2526; + break; + case 3: + tmp = 3587; + break; + case 6: + tmp = 4898; + break; + case 9: + tmp = 4003; + break; + case 12: + tmp = 6289; + break; + case 15: + tmp = 2766; + break; + case 18: + tmp = 3523; + break; + case 21: + tmp = 2773; + break; + case 24: + tmp = 2560; + break; + case 27: + tmp = 4228; + break; + case 30: + tmp = 4648; + break; + case 48: + tmp = 3480; + break; + case 54: + tmp = 2380; + break; + case 57: + tmp = 2410; + break; + default: + err = 1; + break; + } + if (!channelUsed || nCruising || err) { + curTime = CTimer::GetTimeInMilliseconds(); + } else { + tmp -= 1000; + if (CTimer::GetTimeInMilliseconds() - curTime > tmp) { + channelUsed = 0; + curTime = CTimer::GetTimeInMilliseconds(); + } + } + //349-366 + relativeVelocityChange = 2.0 * params->m_fVelocityChange / params->m_pTransmission->fMaxVelocity; + accelerationMultipler = clamp(relativeVelocityChange, 0.0, 1.0); + gasPedalAudio = accelerationMultipler; + //367-380 + switch (engineSoundType) { + case 21: + ++soundOffset; + break; + case 22: + soundOffset += 2; + break; + case 23: + soundOffset += 3; + break; + default: + break; + } + //381-476 if (accelerateState <= 0) { if (params->m_fVelocityChange < -0.001f) { if (channelUsed) { SampleManager.StopChannel(m_nActiveSamples); bAccelSampleStopped = true; } - if (automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction) - gasPedalAudio = automobile->m_fGasPedalAudio; + if (wheelsOnGround == 0 || params->m_pVehicle->bIsHandbrakeOn || lostTraction) + gasPedalAudio = *gasPedalAudioPtr; + else if (params->m_VehicleType == VEHICLE_TYPE_BIKE) + gasPedalAudio = 0.0; else gasPedalAudio = Min(1.0f, params->m_fVelocityChange / params->m_pTransmission->fMaxReverseVelocity); - - gasPedalAudio = Max(0.0f, gasPedalAudio); - automobile->m_fGasPedalAudio = gasPedalAudio; + *gasPedalAudioPtr = Max(0.0f, gasPedalAudio); } else if (LastAccel > 0) { if (channelUsed) { SampleManager.StopChannel(m_nActiveSamples); bAccelSampleStopped = true; } nCruising = 0; - if (automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction || - params->m_fVelocityChange < 0.01f && automobile->m_fGasPedalAudio > 0.2f) { - automobile->m_fGasPedalAudio *= 0.6f; - gasPedalAudio = automobile->m_fGasPedalAudio; + if (wheelsOnGround == 0 + || params->m_pVehicle->bIsHandbrakeOn + || lostTraction + || params->m_fVelocityChange < 0.01f && *gasPedalAudioPtr > 0.2f) { + if (!PizzaFaggBool) { + *gasPedalAudioPtr *= 0.6f; + gasPedalAudio = *gasPedalAudioPtr; + } else + gasPedalAudio = 0.0f; } if (gasPedalAudio > 0.05f) { freq = (5000.f * (gasPedalAudio - 0.05f) * 20.f / 19) + 19000; - if (engineSoundType == SAMPLEBANK_CAR_MACKTRUCK) + vol = (25.0 * (gasPedalAudio - 0.05f) * 20.f / 19) + 40; + if (params->m_pVehicle->bIsDrowning) + vol /= 4; + if (engineSoundType == SAMPLEBANK_CAR_COBRA) freq /= 2; - AddPlayerCarSample((25.f * (gasPedalAudio - 0.05f) * 20.f / 19) + 40, freq, (soundOffset + SFX_CAR_FINGER_OFF_ACCEL_1), engineSoundType, 63, - false); + AddPlayerCarSample(vol, freq, soundOffset + SFX_CAR_FINGER_OFF_ACCEL_1, engineSoundType, 63, false); } } freq = (10000.f * gasPedalAudio) + 22050; - if (engineSoundType == SAMPLEBANK_CAR_MACKTRUCK) + vol = 110 - (40.0 * gasPedalAudio); + if (engineSoundType == SAMPLEBANK_CAR_COBRA) freq /= 2; - AddPlayerCarSample(110 - (40.f * gasPedalAudio), freq, (engineSoundType - CAR_SAMPLEBANKS_OFFSET + SFX_CAR_IDLE_1), SAMPLEBANK_MAIN, 52, true); + if (params->m_pVehicle->bIsDrowning) + vol /= 4; + AddPlayerCarSample(vol, freq, engineSoundType + SFX_CAR_IDLE_1 - 4, SAMPLEBANK_MAIN, 52, true); CurrentPretendGear = Max(1, currentGear); - } else { - while (nCruising == 0) { - if (accelerateState < 150 || automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction || - currentGear < 2 && velocityChange - automobile->m_fVelocityChangeForAudio < 0.01f) { // here could be used abs - if (automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction) { - if (automobile->m_nWheelsOnGround == 0 && automobile->m_nDriveWheelsOnGround != 0 || - (automobile->bIsHandbrakeOn && !bHandbrakeOnLastFrame || lostTraction && !bLostTractionLastFrame) && automobile->m_nWheelsOnGround != 0) { - automobile->m_fGasPedalAudio *= 0.6f; + } + //477-515 + else { + if (nCruising == 0){ + stuckInSand = params->m_VehicleType == VEHICLE_TYPE_CAR && ((CAutomobile*)params->m_pVehicle)->bStuckInSand; + if (accelerateState < 150 || wheelsOnGround == 0 || params->m_pVehicle->bIsHandbrakeOn || lostTraction + || currentGear < 2 && params->m_fVelocityChange - velocityChangeForAudio >= 0.01f || brakeState > 0) { + if ((wheelsOnGround && !params->m_pVehicle->bIsHandbrakeOn && !lostTraction || !stuckInSand) + && brakeState <= 0) { + baseFreq = (8000.0f * accelerationMultipler) + 16000; + vol = (25.0f * accelerationMultipler) + 60; + *gasPedalAudioPtr = accelerationMultipler; + } else { + if (wheelsOnGround == 0 && wheelsOnGroundPrev != 0 + || (params->m_pVehicle->bIsHandbrakeOn && !bHandbrakeOnLastFrame || lostTraction && !bLostTractionLastFrame) + && wheelsOnGround != 0) { + *gasPedalAudioPtr *= 0.6f; } freqModifier = 0; - baseFreq = (15000.f * automobile->m_fGasPedalAudio) + 14000; - vol = (25.0f * automobile->m_fGasPedalAudio) + 60; - } else { - baseFreq = (8000.f * accelerationMultipler) + 16000; - vol = (25.0f * accelerationMultipler) + 60; - automobile->m_fGasPedalAudio = accelerationMultipler; + if (engineSoundType != 15 && engineSoundType != 16) + baseFreq = (25000.0f * *gasPedalAudioPtr) + 14000; + else + baseFreq = (15000.0f * *gasPedalAudioPtr) + 14000; + vol = (25.0f * *gasPedalAudioPtr) + 60; } + //516-535 freq = freqModifier + baseFreq; - if (engineSoundType == SAMPLEBANK_CAR_MACKTRUCK) + if (engineSoundType == SAMPLEBANK_CAR_COBRA) freq /= 2; if (channelUsed) { SampleManager.StopChannel(m_nActiveSamples); bAccelSampleStopped = true; } - AddPlayerCarSample(vol, freq, (engineSoundType - CAR_SAMPLEBANKS_OFFSET + SFX_CAR_REV_1), SAMPLEBANK_MAIN, 2, true); + if (params->m_pVehicle->bIsDrowning) + vol /= 4; + AddPlayerCarSample(vol, freq, engineSoundType + SFX_CAR_REV_1 - 4, SAMPLEBANK_MAIN, 2, true); } else { - TranslateEntity(&m_sQueueSample.m_vecPos, &pos); + //536-548 + cAudioManager::TranslateEntity(&m_sQueueSample.m_vecPos, &pos); if (bAccelSampleStopped) { - if (CurrentPretendGear != 1 || currentGear != 2) { - gearNr = currentGear - 1; - if (gearNr < 1) - gearNr = 1; - CurrentPretendGear = gearNr; - } + if (CurrentPretendGear != 1 || currentGear != 2) + CurrentPretendGear = Max(1, currentGear - 1); processedAccelSampleStopped = true; bAccelSampleStopped = false; } - - if (!channelUsed) { - if (!processedAccelSampleStopped) { - if (CurrentPretendGear < params->m_pTransmission->nNumberOfGears - 1) - ++CurrentPretendGear; - else { - nCruising = 1; - break; // while was used just for this fucking place - } + //549- + if (channelUsed) { + SampleManager.SetChannelEmittingVolume(m_nActiveSamples, 120); + SampleManager.SetChannel3DPosition(m_nActiveSamples, pos.x, pos.y, pos.z); + SampleManager.SetChannel3DDistances(m_nActiveSamples, 50.0f, 12.5f); + freq = (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050) ; + if (engineSoundType == 8) + freq /= 2; + SampleManager.SetChannelFrequency(m_nActiveSamples, freq); + if (!channelUsed) { + SampleManager.SetChannelReverbFlag(m_nActiveSamples, m_bDynamicAcousticModelingStatus != false); + SampleManager.StartChannel(m_nActiveSamples); } + } else if (processedAccelSampleStopped) { + curTime = CTimer::GetTimeInMilliseconds(); + params->m_pVehicle->bAudioChangingGear = true; + if (!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + SFX_CAR_ACCEL_1, SAMPLEBANK_MAIN)) + return; + SampleManager.SetChannelLoopCount(m_nActiveSamples, 1); + SampleManager.SetChannelLoopPoints(m_nActiveSamples, 0, -1); + SampleManager.SetChannelEmittingVolume(m_nActiveSamples, 120); + SampleManager.SetChannel3DPosition(m_nActiveSamples, pos.x, pos.y, pos.z); + SampleManager.SetChannel3DDistances(m_nActiveSamples, 50.0f, 12.5f); + freq = (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050); + if (engineSoundType == 8) + freq /= 2; + SampleManager.SetChannelFrequency(m_nActiveSamples, freq); + if (!channelUsed) { + SampleManager.SetChannelReverbFlag(m_nActiveSamples, m_bDynamicAcousticModelingStatus != false); + SampleManager.StartChannel(m_nActiveSamples); + } + } else if (CurrentPretendGear < params->m_pTransmission->nNumberOfGears - 1) { + ++CurrentPretendGear; + curTime = CTimer::GetTimeInMilliseconds(); + params->m_pVehicle->bAudioChangingGear = true; if (!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + SFX_CAR_ACCEL_1, SAMPLEBANK_MAIN)) return; SampleManager.SetChannelLoopCount(m_nActiveSamples, 1); SampleManager.SetChannelLoopPoints(m_nActiveSamples, 0, -1); - } - SampleManager.SetChannelEmittingVolume(m_nActiveSamples, 85); - SampleManager.SetChannel3DPosition(m_nActiveSamples, pos.x, pos.y, pos.z); - SampleManager.SetChannel3DDistances(m_nActiveSamples, 50.f, 12.5f); - freq = GearFreqAdj[CurrentPretendGear] + freqModifier + 22050; - if (engineSoundType == SAMPLEBANK_CAR_MACKTRUCK) - freq /= 2; - SampleManager.SetChannelFrequency(m_nActiveSamples, freq); - if (!channelUsed) { - SampleManager.SetChannelReverbFlag(m_nActiveSamples, m_bDynamicAcousticModelingStatus != false); - SampleManager.StartChannel(m_nActiveSamples); + SampleManager.SetChannelEmittingVolume(m_nActiveSamples, 120); + SampleManager.SetChannel3DPosition(m_nActiveSamples, pos.x, pos.y, pos.z); + SampleManager.SetChannel3DDistances(m_nActiveSamples, 50.0f, 12.5f); + freq = (GearFreqAdj[CurrentPretendGear] + freqModifier + 22050); + if (engineSoundType == 8) + freq /= 2; + SampleManager.SetChannelFrequency(m_nActiveSamples, freq); + if (!channelUsed) { + SampleManager.SetChannelReverbFlag(m_nActiveSamples, m_bDynamicAcousticModelingStatus != false); + SampleManager.StartChannel(m_nActiveSamples); + } + } else { + nCruising = 1; + params->m_pVehicle->bAudioChangingGear = true; + bAccelSampleStopped = 1; + SampleManager.StopChannel(m_nActiveSamples); + if (PizzaFaggBool || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params->m_pVehicle->bIsHandbrakeOn + && !lostTraction && currentGear >= params->m_pTransmission->nNumberOfGears - 1) { + if (accelerateState >= 220 && params->m_fVelocityChange + 0.001 < velocityChangeForAudio) { + if (nCruising < 800) + ++nCruising; + } else if (nCruising > 3) { + --nCruising; + } + freq = 27 * nCruising + freqModifier + 22050; + if (engineSoundType == 8) + freq /= 2; + AudioManager.AddPlayerCarSample(120, freq, soundOffset + SFX_CAR_AFTER_ACCEL_1, engineSoundType, 64, true); + } else { + nCruising = 0; + } } } - break; - } - if (nCruising != 0) { - bAccelSampleStopped = true; - if (accelerateState < 150 || automobile->m_nWheelsOnGround == 0 || automobile->bIsHandbrakeOn || lostTraction || - currentGear < params->m_pTransmission->nNumberOfGears - 1) { - nCruising = 0; - } else { - if (accelerateState >= 220 && params->m_fVelocityChange + 0.001f < automobile->m_fVelocityChangeForAudio) { + } else { + params->m_pVehicle->bAudioChangingGear = true; + bAccelSampleStopped = 1; + SampleManager.StopChannel(m_nActiveSamples); + if (PizzaFaggBool || accelerateState >= 150 && wheelsOnGround && brakeState <= 0 && !params->m_pVehicle->bIsHandbrakeOn + && !lostTraction && currentGear >= params->m_pTransmission->nNumberOfGears - 1) { + if (accelerateState >= 220 && params->m_fVelocityChange + 0.001 < velocityChangeForAudio) { if (nCruising < 800) ++nCruising; } else if (nCruising > 3) { --nCruising; } freq = 27 * nCruising + freqModifier + 22050; - if (engineSoundType == SAMPLEBANK_CAR_MACKTRUCK) + if (engineSoundType == 8) freq /= 2; - AddPlayerCarSample(85, freq, (soundOffset + SFX_CAR_AFTER_ACCEL_1), engineSoundType, 64, true); + AudioManager.AddPlayerCarSample(120, freq, soundOffset + SFX_CAR_AFTER_ACCEL_1, engineSoundType, 64, true); + } else { + nCruising = 0; } } } LastAccel = accelerateState; - - bHandbrakeOnLastFrame = !!automobile->bIsHandbrakeOn; + bHandbrakeOnLastFrame = params->m_pVehicle->bIsHandbrakeOn; bLostTractionLastFrame = lostTraction; + return; } bool @@ -1809,7 +2088,7 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params) bool cAudioManager::UsesReverseWarning(int32 model) const { - return model == LINERUN || model == FIRETRUK || model == TRASH || model == BUS || model == COACH; + return model == LINERUN || model == FIRETRUK || model == BUS || model == COACH || model == PACKER || model == FLATBED; } bool @@ -1941,7 +2220,8 @@ cAudioManager::ProcessAirBrakes(cVehicleParams *params) bool cAudioManager::HasAirBrakes(int32 model) const { - return model == LINERUN || model == FIRETRUK || model == TRASH || model == BUS || model == COACH; + return model == LINERUN || model == FIRETRUK || model == TRASH || model == BUS || model == BARRACKS + || model == COACH || model == PACKER || model == FLATBED; } bool diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index f07a801e..945dee3c 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -143,6 +143,7 @@ public: class cVehicleParams { public: + int32 m_VehicleType; bool m_bDistanceCalculated; float m_fDistance; CVehicle *m_pVehicle; @@ -345,7 +346,7 @@ public: void ProcessPedOneShots(cPedParams *params); void ProcessPhysical(int32 id); void ProcessPlane(cVehicleParams *params); - void ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *automobile); + void ProcessPlayersVehicleEngine(cVehicleParams *params, CVehicle* veh); void ProcessProjectiles(); void ProcessRainOnVehicle(cVehicleParams *params); void ProcessReverb() const; @@ -358,6 +359,7 @@ public: void ProcessVehicle(CVehicle *vehicle); bool ProcessVehicleDoors(cVehicleParams *params); void ProcessVehicleEngine(cVehicleParams *params); + void UpdateGasPedalAudio(float* gasPedalAudio, float vehGasPedal); void ProcessVehicleHorn(cVehicleParams *params); void ProcessVehicleOneShots(cVehicleParams *params); bool ProcessVehicleReverseWarning(cVehicleParams *params); @@ -410,7 +412,6 @@ public: void Terminate(); void TranslateEntity(Const CVector *v1, CVector *v2) const; - void UpdateGasPedalAudio(CAutomobile *automobile); void UpdateReflections(); bool UsesReverseWarning(int32 model) const; bool UsesSiren(int32 model) const; diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index cdecb8b4..9c33d48a 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -1121,15 +1121,19 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen) rightText = TheText.Get("FEA_ADP"); else { char* provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex); - - if (!strcmp(strupr(provider), "DIRECTSOUND3D HARDWARE SUPPORT")) { - strcpy(provider, "DSOUND3D HARDWARE SUPPORT"); + if (provider != NULL) { + if (!strcmp(strupr(provider), "DIRECTSOUND3D HARDWARE SUPPORT")) { + strcpy(provider, "DSOUND3D HARDWARE SUPPORT"); + } + else if (!strcmp(strupr(provider), "DIRECTSOUND3D SOFTWARE EMULATION")) { + strcpy(provider, "DSOUND3D SOFTWARE EMULATION"); + } + AsciiToUnicode(provider, unicodeTemp); + rightText = unicodeTemp; } - else if (!strcmp(strupr(provider), "DIRECTSOUND3D SOFTWARE EMULATION")) { - strcpy(provider, "DSOUND3D SOFTWARE EMULATION"); + else { + rightText = TheText.Get("not defined"); } - AsciiToUnicode(provider, unicodeTemp); - rightText = unicodeTemp; } break; case MENUACTION_SPEAKERCONF: { diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp index 62aeface..b5bc9480 100644 --- a/src/vehicles/Bike.cpp +++ b/src/vehicles/Bike.cpp @@ -129,7 +129,7 @@ CBike::CBike(int32 id, uint8 CreatedBy) m_fTireTemperature = 1.0f; m_fBrakeDestabilization = 0.0f; - field_490 = 0; + m_fVelocityChangeForAudio = 0; for(i = 0; i < 2; i++){ m_aWheelRotation[i] = 0.0f; diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h index 669e236e..cee670a3 100644 --- a/src/vehicles/Bike.h +++ b/src/vehicles/Bike.h @@ -77,7 +77,7 @@ public: int16 m_doingBurnout; float m_fTireTemperature; float m_fBrakeDestabilization; - uint32 field_490; + float m_fVelocityChangeForAudio; float m_fFireBlowUpTimer; CPhysical *m_aGroundPhysical[4]; CVector m_aGroundOffset[4]; |