From f697fcc2f577e2eabf6a5e33e15415d0f9a5c549 Mon Sep 17 00:00:00 2001 From: zcaliptium Date: Sun, 3 Apr 2016 23:45:57 +0300 Subject: [PATCH] Engine: Return dynamic vorbisfile library loading. --- Sources/All.sln | 72 ------------------- Sources/Engine/Engine.vcxproj | 11 +-- Sources/Engine/Engine.vcxproj.filters | 3 + Sources/Engine/Sound/SoundDecoder.cpp | 71 +++++++++++++++--- Sources/Engine/Sound/ov_functions.h | 24 +++++++ Sources/libogg/libogg_dynamic.vcxproj | 8 +-- Sources/libvorbis/libvorbis_dynamic.vcxproj | 12 ++-- .../libvorbis/libvorbisfile_dynamic.vcxproj | 12 ++-- 8 files changed, 109 insertions(+), 104 deletions(-) create mode 100644 Sources/Engine/Sound/ov_functions.h diff --git a/Sources/All.sln b/Sources/All.sln index 21f66ef..d897d3e 100644 --- a/Sources/All.sln +++ b/Sources/All.sln @@ -102,202 +102,130 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 - Release|x64 = Release|x64 Template|Win32 = Template|Win32 - Template|x64 = Template|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Debug|Win32.ActiveCfg = Debug|Win32 {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Debug|Win32.Build.0 = Debug|Win32 - {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Debug|x64.ActiveCfg = Debug|Win32 {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Release|Win32.ActiveCfg = Release|Win32 {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Release|Win32.Build.0 = Release|Win32 - {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Release|x64.ActiveCfg = Release|Win32 {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Template|Win32.ActiveCfg = Template|Win32 {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Template|Win32.Build.0 = Template|Win32 - {FF6F3C9B-689C-D26F-0563-9D12D6F6565B}.Template|x64.ActiveCfg = Template|Win32 {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Debug|Win32.ActiveCfg = Debug|Win32 {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Debug|Win32.Build.0 = Debug|Win32 - {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Debug|x64.ActiveCfg = Debug|Win32 {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Release|Win32.ActiveCfg = Release|Win32 {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Release|Win32.Build.0 = Release|Win32 - {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Release|x64.ActiveCfg = Release|Win32 {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Template|Win32.ActiveCfg = Template|Win32 {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Template|Win32.Build.0 = Template|Win32 - {072EF3A9-482A-79A5-D364-2ECDD95B8029}.Template|x64.ActiveCfg = Template|Win32 {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Debug|Win32.ActiveCfg = Debug|Win32 {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Debug|Win32.Build.0 = Debug|Win32 - {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Debug|x64.ActiveCfg = Debug|Win32 {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Release|Win32.ActiveCfg = Release|Win32 {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Release|Win32.Build.0 = Release|Win32 - {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Release|x64.ActiveCfg = Release|Win32 {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Template|Win32.ActiveCfg = Template|Win32 {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Template|Win32.Build.0 = Template|Win32 - {8AE1F6E0-5806-D5E5-31B6-466EFE0290B3}.Template|x64.ActiveCfg = Template|Win32 {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Debug|Win32.ActiveCfg = Debug|Win32 {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Debug|Win32.Build.0 = Debug|Win32 - {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Debug|x64.ActiveCfg = Debug|Win32 {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Release|Win32.ActiveCfg = Release|Win32 {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Release|Win32.Build.0 = Release|Win32 - {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Release|x64.ActiveCfg = Release|Win32 {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Template|Win32.ActiveCfg = Template|Win32 {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Template|Win32.Build.0 = Template|Win32 - {1F46FD81-1A15-7E2C-7C68-84AB43BC0B05}.Template|x64.ActiveCfg = Template|Win32 {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Debug|Win32.ActiveCfg = Debug|Win32 {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Debug|Win32.Build.0 = Debug|Win32 - {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Debug|x64.ActiveCfg = Debug|Win32 {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Release|Win32.ActiveCfg = Release|Win32 {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Release|Win32.Build.0 = Release|Win32 - {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Release|x64.ActiveCfg = Release|Win32 {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Template|Win32.ActiveCfg = Template|Win32 {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Template|Win32.Build.0 = Template|Win32 - {4B6F587C-7C59-4481-FBB9-CA44380D0CBF}.Template|x64.ActiveCfg = Template|Win32 {870758F3-5C2F-D196-2A89-CC336EBE7779}.Debug|Win32.ActiveCfg = Debug|Win32 {870758F3-5C2F-D196-2A89-CC336EBE7779}.Debug|Win32.Build.0 = Debug|Win32 - {870758F3-5C2F-D196-2A89-CC336EBE7779}.Debug|x64.ActiveCfg = Debug|Win32 {870758F3-5C2F-D196-2A89-CC336EBE7779}.Release|Win32.ActiveCfg = Release|Win32 {870758F3-5C2F-D196-2A89-CC336EBE7779}.Release|Win32.Build.0 = Release|Win32 - {870758F3-5C2F-D196-2A89-CC336EBE7779}.Release|x64.ActiveCfg = Release|Win32 {870758F3-5C2F-D196-2A89-CC336EBE7779}.Template|Win32.ActiveCfg = Template|Win32 {870758F3-5C2F-D196-2A89-CC336EBE7779}.Template|Win32.Build.0 = Template|Win32 - {870758F3-5C2F-D196-2A89-CC336EBE7779}.Template|x64.ActiveCfg = Template|Win32 {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Debug|Win32.ActiveCfg = Debug|Win32 {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Debug|Win32.Build.0 = Debug|Win32 - {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Debug|x64.ActiveCfg = Debug|Win32 {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Release|Win32.ActiveCfg = Release|Win32 {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Release|Win32.Build.0 = Release|Win32 - {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Release|x64.ActiveCfg = Release|Win32 {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Template|Win32.ActiveCfg = Template|Win32 {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Template|Win32.Build.0 = Template|Win32 - {D9F67AA1-970A-BFDD-6BE9-BD0CDCE98A10}.Template|x64.ActiveCfg = Template|Win32 {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Debug|Win32.ActiveCfg = Debug|Win32 {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Debug|Win32.Build.0 = Debug|Win32 - {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Debug|x64.ActiveCfg = Debug|Win32 {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Release|Win32.ActiveCfg = Release|Win32 {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Release|Win32.Build.0 = Release|Win32 - {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Release|x64.ActiveCfg = Release|Win32 {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Template|Win32.ActiveCfg = Template|Win32 {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Template|Win32.Build.0 = Template|Win32 - {3EC2357F-FA36-9DF7-FFC4-AF9C03777DBE}.Template|x64.ActiveCfg = Template|Win32 {4410EEB1-AFAD-A936-2168-716C245D36D5}.Debug|Win32.ActiveCfg = Debug|Win32 {4410EEB1-AFAD-A936-2168-716C245D36D5}.Debug|Win32.Build.0 = Debug|Win32 - {4410EEB1-AFAD-A936-2168-716C245D36D5}.Debug|x64.ActiveCfg = Debug|Win32 {4410EEB1-AFAD-A936-2168-716C245D36D5}.Release|Win32.ActiveCfg = Release|Win32 {4410EEB1-AFAD-A936-2168-716C245D36D5}.Release|Win32.Build.0 = Release|Win32 - {4410EEB1-AFAD-A936-2168-716C245D36D5}.Release|x64.ActiveCfg = Release|Win32 {4410EEB1-AFAD-A936-2168-716C245D36D5}.Template|Win32.ActiveCfg = Template|Win32 {4410EEB1-AFAD-A936-2168-716C245D36D5}.Template|Win32.Build.0 = Template|Win32 - {4410EEB1-AFAD-A936-2168-716C245D36D5}.Template|x64.ActiveCfg = Template|Win32 {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Debug|Win32.ActiveCfg = Debug|Win32 {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Debug|Win32.Build.0 = Debug|Win32 - {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Debug|x64.ActiveCfg = Debug|Win32 {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Release|Win32.ActiveCfg = Release|Win32 {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Release|Win32.Build.0 = Release|Win32 - {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Release|x64.ActiveCfg = Release|Win32 {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Template|Win32.ActiveCfg = Template|Win32 {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Template|Win32.Build.0 = Template|Win32 - {ACF94A1E-A365-0A7E-A849-CBA468D5EFCF}.Template|x64.ActiveCfg = Template|Win32 {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Debug|Win32.ActiveCfg = Debug|Win32 {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Debug|Win32.Build.0 = Debug|Win32 - {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Debug|x64.ActiveCfg = Debug|Win32 {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Release|Win32.ActiveCfg = Release|Win32 {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Release|Win32.Build.0 = Release|Win32 - {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Release|x64.ActiveCfg = Release|Win32 {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Template|Win32.ActiveCfg = Template|Win32 {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Template|Win32.Build.0 = Template|Win32 - {ABD12F55-02CD-418D-3393-CF6F09A415F2}.Template|x64.ActiveCfg = Template|Win32 {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Debug|Win32.ActiveCfg = Debug|Win32 {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Debug|Win32.Build.0 = Debug|Win32 - {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Debug|x64.ActiveCfg = Debug|Win32 {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Release|Win32.ActiveCfg = Release|Win32 {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Release|Win32.Build.0 = Release|Win32 - {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Release|x64.ActiveCfg = Release|Win32 {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Template|Win32.ActiveCfg = Template|Win32 {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Template|Win32.Build.0 = Template|Win32 - {9E0BA4A5-61AD-9CF5-AC0D-50DAB6639605}.Template|x64.ActiveCfg = Template|Win32 {BD59BFB2-B39D-6348-273D-48385E685C3D}.Debug|Win32.ActiveCfg = Debug|Win32 {BD59BFB2-B39D-6348-273D-48385E685C3D}.Debug|Win32.Build.0 = Debug|Win32 - {BD59BFB2-B39D-6348-273D-48385E685C3D}.Debug|x64.ActiveCfg = Debug|Win32 {BD59BFB2-B39D-6348-273D-48385E685C3D}.Release|Win32.ActiveCfg = Release|Win32 {BD59BFB2-B39D-6348-273D-48385E685C3D}.Release|Win32.Build.0 = Release|Win32 - {BD59BFB2-B39D-6348-273D-48385E685C3D}.Release|x64.ActiveCfg = Release|Win32 {BD59BFB2-B39D-6348-273D-48385E685C3D}.Template|Win32.ActiveCfg = Template|Win32 {BD59BFB2-B39D-6348-273D-48385E685C3D}.Template|Win32.Build.0 = Template|Win32 - {BD59BFB2-B39D-6348-273D-48385E685C3D}.Template|x64.ActiveCfg = Template|Win32 {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Debug|Win32.ActiveCfg = Debug|Win32 {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Debug|Win32.Build.0 = Debug|Win32 - {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Debug|x64.ActiveCfg = Debug|Win32 {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Release|Win32.ActiveCfg = Release|Win32 {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Release|Win32.Build.0 = Release|Win32 - {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Release|x64.ActiveCfg = Release|Win32 {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Template|Win32.ActiveCfg = Template|Win32 {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Template|Win32.Build.0 = Template|Win32 - {F0E01B8A-1C93-85CB-693E-B9CA24A27168}.Template|x64.ActiveCfg = Template|Win32 {CC94A769-3B63-008D-0B03-525791C804D1}.Debug|Win32.ActiveCfg = Debug|Win32 {CC94A769-3B63-008D-0B03-525791C804D1}.Debug|Win32.Build.0 = Debug|Win32 - {CC94A769-3B63-008D-0B03-525791C804D1}.Debug|x64.ActiveCfg = Debug|Win32 {CC94A769-3B63-008D-0B03-525791C804D1}.Release|Win32.ActiveCfg = Release|Win32 {CC94A769-3B63-008D-0B03-525791C804D1}.Release|Win32.Build.0 = Release|Win32 - {CC94A769-3B63-008D-0B03-525791C804D1}.Release|x64.ActiveCfg = Release|Win32 {CC94A769-3B63-008D-0B03-525791C804D1}.Template|Win32.ActiveCfg = Template|Win32 {CC94A769-3B63-008D-0B03-525791C804D1}.Template|Win32.Build.0 = Template|Win32 - {CC94A769-3B63-008D-0B03-525791C804D1}.Template|x64.ActiveCfg = Template|Win32 {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Debug|Win32.ActiveCfg = Debug|Win32 {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Debug|Win32.Build.0 = Debug|Win32 - {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Debug|x64.ActiveCfg = Debug|Win32 {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Release|Win32.ActiveCfg = Release|Win32 {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Release|Win32.Build.0 = Release|Win32 - {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Release|x64.ActiveCfg = Release|Win32 {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Template|Win32.ActiveCfg = Template|Win32 {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Template|Win32.Build.0 = Template|Win32 - {AC040397-6FEA-E9B2-2B28-5BB08E1607A1}.Template|x64.ActiveCfg = Template|Win32 {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Debug|Win32.ActiveCfg = Debug|Win32 {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Debug|Win32.Build.0 = Debug|Win32 - {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Debug|x64.ActiveCfg = Debug|Win32 {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Release|Win32.ActiveCfg = Release|Win32 {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Release|Win32.Build.0 = Release|Win32 - {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Release|x64.ActiveCfg = Release|Win32 {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Template|Win32.ActiveCfg = Template|Win32 {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Template|Win32.Build.0 = Template|Win32 - {DC47DA88-14E2-0634-61C5-7CEEC46A45C2}.Template|x64.ActiveCfg = Template|Win32 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|Win32.ActiveCfg = Debug|Win32 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|Win32.Build.0 = Debug|Win32 - {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|x64.ActiveCfg = Debug|x64 - {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Debug|x64.Build.0 = Debug|x64 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|Win32.ActiveCfg = Release|Win32 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|Win32.Build.0 = Release|Win32 - {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|x64.ActiveCfg = Release|x64 - {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Release|x64.Build.0 = Release|x64 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Template|Win32.ActiveCfg = Release|Win32 {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Template|Win32.Build.0 = Release|Win32 - {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Template|x64.ActiveCfg = Release|x64 - {15CBFEFF-7965-41F5-B4E2-21E8795C9159}.Template|x64.Build.0 = Release|x64 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|Win32.ActiveCfg = Debug|Win32 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|Win32.Build.0 = Debug|Win32 - {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|x64.ActiveCfg = Debug|x64 - {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Debug|x64.Build.0 = Debug|x64 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|Win32.ActiveCfg = Release|Win32 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|Win32.Build.0 = Release|Win32 - {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|x64.ActiveCfg = Release|x64 - {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Release|x64.Build.0 = Release|x64 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Template|Win32.ActiveCfg = Release|Win32 {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Template|Win32.Build.0 = Release|Win32 - {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Template|x64.ActiveCfg = Release|x64 - {CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}.Template|x64.Build.0 = Release|x64 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|Win32.ActiveCfg = Debug|Win32 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|Win32.Build.0 = Debug|Win32 - {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|x64.ActiveCfg = Debug|x64 - {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Debug|x64.Build.0 = Debug|x64 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|Win32.ActiveCfg = Release|Win32 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|Win32.Build.0 = Release|Win32 - {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|x64.ActiveCfg = Release|x64 - {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Release|x64.Build.0 = Release|x64 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Template|Win32.ActiveCfg = Release|Win32 {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Template|Win32.Build.0 = Release|Win32 - {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Template|x64.ActiveCfg = Release|x64 - {3A214E06-B95E-4D61-A291-1F8DF2EC10FD}.Template|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Sources/Engine/Engine.vcxproj b/Sources/Engine/Engine.vcxproj index 3e69e75..32ab746 100644 --- a/Sources/Engine/Engine.vcxproj +++ b/Sources/Engine/Engine.vcxproj @@ -121,11 +121,12 @@ Console Debug/EngineD.dll .\Debug\EngineD.lib - libvorbisfile.lib;gdi32.lib;DbgHelp.lib;%(AdditionalDependencies) + gdi32.lib;DbgHelp.lib;%(AdditionalDependencies) true libci.lib;%(IgnoreSpecificDefaultLibraries) false - $(SolutionDir)..\Bin\Debug + + copy Debug\$(TargetName).dll $(SolutionDir)..\Bin\Debug\ >nul @@ -181,11 +182,12 @@ copy Debug\$(TargetName).lib $(SolutionDir)..\Bin\Debug\ >nul Console .\Release\Engine.dll .\Release\Engine.lib - libvorbisfile.lib;odbc32.lib;odbccp32.lib;DbgHelp.lib;%(AdditionalDependencies) + odbc32.lib;odbccp32.lib;DbgHelp.lib;%(AdditionalDependencies) true libci.lib;%(IgnoreSpecificDefaultLibraries) false - $(SolutionDir)..\Bin + + copy Release\$(TargetName).dll $(SolutionDir)..\Bin\ >nul @@ -782,6 +784,7 @@ copy Release\$(TargetName).lib $(SolutionDir)..\Bin\ >nul + diff --git a/Sources/Engine/Engine.vcxproj.filters b/Sources/Engine/Engine.vcxproj.filters index 79c6acb..737ce41 100644 --- a/Sources/Engine/Engine.vcxproj.filters +++ b/Sources/Engine/Engine.vcxproj.filters @@ -1365,6 +1365,9 @@ Header Files\GameAgent Headers + + Header Files\Sound Headers + diff --git a/Sources/Engine/Sound/SoundDecoder.cpp b/Sources/Engine/Sound/SoundDecoder.cpp index c3ceba2..d9d963a 100644 --- a/Sources/Engine/Sound/SoundDecoder.cpp +++ b/Sources/Engine/Sound/SoundDecoder.cpp @@ -88,6 +88,7 @@ public: #include // we define needed stuff ourselves, and ignore the rest // vorbis vars +extern BOOL _bOVEnabled = FALSE; static HINSTANCE _hOV = NULL; class CDecodeData_OGG { @@ -99,6 +100,29 @@ public: WAVEFORMATEX ogg_wfeFormat; // format of sound }; +// define vorbis function pointers +#define DLLFUNCTION(dll, output, name, inputs, params, required) \ + output (__cdecl *p##name) inputs = NULL; +#include "ov_functions.h" +#undef DLLFUNCTION + +static void OV_SetFunctionPointers_t(void) { + const char *strName; + // get vo function pointers + #define DLLFUNCTION(dll, output, name, inputs, params, required) \ + strName = #name ; \ + p##name = (output (__cdecl *) inputs) GetProcAddress( _hOV, strName); \ + if(p##name == NULL) FailFunction_t(strName); + #include "ov_functions.h" + #undef DLLFUNCTION +} +static void OV_ClearFunctionPointers(void) { + // clear vo function pointers + #define DLLFUNCTION(dll, output, name, inputs, params, required) p##name = NULL; + #include "ov_functions.h" + #undef DLLFUNCTION +} + // ogg file reading callbacks // @@ -166,6 +190,30 @@ static ov_callbacks ovcCallbacks = { // initialize/end the decoding support engine(s) void CSoundDecoder::InitPlugins(void) { + try { + // load vorbis + if (_hOV==NULL) { +#ifndef NDEBUG + #define VORBISLIB "libvorbisfile.dll" +#else + #define VORBISLIB "libvorbisfile.dll" +#endif + _hOV = ::LoadLibraryA(VORBISLIB); + } + if( _hOV == NULL) { + ThrowF_t(TRANS("Cannot load libvorbisfile.dll.")); + } + // prepare function pointers + OV_SetFunctionPointers_t(); + + // if all successful, enable mpx playing + _bOVEnabled = TRUE; + CPrintF(TRANS(" libvorbisfile.dll loaded, ogg playing enabled\n")); + + } catch (char *strError) { + CPrintF(TRANS("OGG playing disabled: %s\n"), strError); + } + try { // load amp11lib if (_hAmp11lib==NULL) { @@ -199,6 +247,14 @@ void CSoundDecoder::EndPlugins(void) _hAmp11lib = NULL; _bAMP11Enabled = FALSE; } + + // cleanup vorbis when not needed anymore + if (_bOVEnabled) { + OV_ClearFunctionPointers(); + FreeLibrary(_hOV); + _hOV = NULL; + _bOVEnabled = FALSE; + } } // decoder that streams from file @@ -212,11 +268,10 @@ CSoundDecoder::CSoundDecoder(const CTFileName &fnm) // if ogg if (fnmExpanded.FileExt()==".ogg") { - /* if (!_bOVEnabled) { return; } - */ + sdc_pogg = new CDecodeData_OGG; sdc_pogg->ogg_fFile = NULL; sdc_pogg->ogg_vfVorbisFile = NULL; @@ -273,7 +328,7 @@ CSoundDecoder::CSoundDecoder(const CTFileName &fnm) // initialize decoder sdc_pogg->ogg_vfVorbisFile = new OggVorbis_File; - int iRes = ov_open_callbacks(sdc_pogg, sdc_pogg->ogg_vfVorbisFile, NULL, 0, ovcCallbacks); + int iRes = pov_open_callbacks(sdc_pogg, sdc_pogg->ogg_vfVorbisFile, NULL, 0, ovcCallbacks); // if error if (iRes!=0) { @@ -281,7 +336,7 @@ CSoundDecoder::CSoundDecoder(const CTFileName &fnm) } // get info on the file - vorbis_info *pvi = ov_info(sdc_pogg->ogg_vfVorbisFile, -1); + vorbis_info *pvi = pov_info(sdc_pogg->ogg_vfVorbisFile, -1); // remember it's format WAVEFORMATEX form; @@ -443,7 +498,7 @@ void CSoundDecoder::Clear(void) } else if (sdc_pogg!=NULL) { if (sdc_pogg->ogg_vfVorbisFile!=NULL) { - ov_clear(sdc_pogg->ogg_vfVorbisFile); + pov_clear(sdc_pogg->ogg_vfVorbisFile); delete sdc_pogg->ogg_vfVorbisFile; sdc_pogg->ogg_vfVorbisFile = NULL; } @@ -463,9 +518,9 @@ void CSoundDecoder::Reset(void) palDecSeekAbs(sdc_pmpeg->mpeg_hDecoder, 0.0f); } else if (sdc_pogg!=NULL) { // so instead, we reinit - ov_clear(sdc_pogg->ogg_vfVorbisFile); + pov_clear(sdc_pogg->ogg_vfVorbisFile); fseek(sdc_pogg->ogg_fFile, sdc_pogg->ogg_slOffset, SEEK_SET); - ov_open_callbacks(sdc_pogg, sdc_pogg->ogg_vfVorbisFile, NULL, 0, ovcCallbacks); + pov_open_callbacks(sdc_pogg, sdc_pogg->ogg_vfVorbisFile, NULL, 0, ovcCallbacks); } } @@ -503,7 +558,7 @@ INDEX CSoundDecoder::Decode(void *pvDestBuffer, INDEX ctBytesToDecode) char *pch = (char *)pvDestBuffer; INDEX ctDecoded = 0; while (ctDecodedogg_vfVorbisFile, pch, ctBytesToDecode-ctDecoded, + long iRes = pov_read(sdc_pogg->ogg_vfVorbisFile, pch, ctBytesToDecode-ctDecoded, 0, 2, 1, &iCurrrentSection); if (iRes<=0) { return ctDecoded; diff --git a/Sources/Engine/Sound/ov_functions.h b/Sources/Engine/Sound/ov_functions.h new file mode 100644 index 0000000..0188a83 --- /dev/null +++ b/Sources/Engine/Sound/ov_functions.h @@ -0,0 +1,24 @@ +/* Copyright (c) 2002-2012 Croteam Ltd. +This program is free software; you can redistribute it and/or modify +it under the terms of version 2 of the GNU General Public License as published by +the Free Software Foundation + + +This program 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 General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + + +// DLLFUNCTION(dll, output, name, inputs, params, required) + +DLLFUNCTION( OVF, int, ov_clear, (OggVorbis_File *vf), 4, 0) +DLLFUNCTION( OVF, int, ov_open, (FILE *f, OggVorbis_File *vf, char *initial, long ibytes), 16,0); +DLLFUNCTION( OVF, int, ov_open_callbacks, (void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks), 32,0); +DLLFUNCTION( OVF, long, ov_read, (OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream), 28,0); +DLLFUNCTION( OVF, vorbis_info *, ov_info, (OggVorbis_File *vf,int link), 8,0); +DLLFUNCTION( OVF, int, ov_time_seek, (OggVorbis_File *vf, double pos), 12,0); \ No newline at end of file diff --git a/Sources/libogg/libogg_dynamic.vcxproj b/Sources/libogg/libogg_dynamic.vcxproj index 63e498f..c775ff8 100644 --- a/Sources/libogg/libogg_dynamic.vcxproj +++ b/Sources/libogg/libogg_dynamic.vcxproj @@ -105,7 +105,7 @@ copy Debug\$(TargetName).lib $(SolutionDir)..\Bin\Debug\ >nul Disabled - ..\..\include;%(AdditionalIncludeDirectories) + include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks @@ -118,7 +118,7 @@ copy Debug\$(TargetName).lib $(SolutionDir)..\Bin\Debug\ >nul Cdecl - ..\ogg.def + ogg.def @@ -162,7 +162,7 @@ copy Release\$(TargetName).lib $(SolutionDir)..\Bin\ >nul AnySuitable true Speed - ..\..\include;%(AdditionalIncludeDirectories) + include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;%(PreprocessorDefinitions) true @@ -179,7 +179,7 @@ copy Release\$(TargetName).lib $(SolutionDir)..\Bin\ >nul Cdecl - ..\ogg.def + ogg.def diff --git a/Sources/libvorbis/libvorbis_dynamic.vcxproj b/Sources/libvorbis/libvorbis_dynamic.vcxproj index a5393fe..217472f 100644 --- a/Sources/libvorbis/libvorbis_dynamic.vcxproj +++ b/Sources/libvorbis/libvorbis_dynamic.vcxproj @@ -53,22 +53,18 @@ - - - - @@ -125,7 +121,7 @@ copy Debug\$(TargetName).lib $(SolutionDir)..\Bin\Debug\ >nul Disabled - ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + include;..\libogg\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks @@ -141,7 +137,7 @@ copy Debug\$(TargetName).lib $(SolutionDir)..\Bin\Debug\ >nul libogg.lib;%(AdditionalDependencies) $(OutDir)libvorbis.dll ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) - ..\..\vorbis.def + vorbis.def true $(OutDir)libvorbis.pdb Windows @@ -198,7 +194,7 @@ copy Release\$(TargetName).lib $(SolutionDir)..\Bin\ >nul AnySuitable true Speed - ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + include;..\libogg\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBVORBIS_EXPORTS;%(PreprocessorDefinitions) true @@ -217,7 +213,7 @@ copy Release\$(TargetName).lib $(SolutionDir)..\Bin\ >nul libogg.lib;%(AdditionalDependencies) $(OutDir)libvorbis.dll ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) - ..\..\vorbis.def + vorbis.def false Windows true diff --git a/Sources/libvorbis/libvorbisfile_dynamic.vcxproj b/Sources/libvorbis/libvorbisfile_dynamic.vcxproj index a49f052..dd0275e 100644 --- a/Sources/libvorbis/libvorbisfile_dynamic.vcxproj +++ b/Sources/libvorbis/libvorbisfile_dynamic.vcxproj @@ -51,22 +51,18 @@ - - - - @@ -122,7 +118,7 @@ copy Debug\$(TargetName).lib $(SolutionDir)..\Bin\Debug\ >nul Disabled - ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + include;..\libogg\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks @@ -137,7 +133,7 @@ copy Debug\$(TargetName).lib $(SolutionDir)..\Bin\Debug\ >nul libogg.lib;libvorbis.lib;%(AdditionalDependencies) $(OutDir)libvorbisfile.dll ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) - ..\..\vorbisfile.def + vorbisfile.def true $(OutDir)libvorbisfile.pdb Windows @@ -180,7 +176,7 @@ copy Release\$(TargetName).lib $(SolutionDir)..\Bin\ >nul X64 - ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + include;..\libogg\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBVORBISFILE_EXPORTS;%(PreprocessorDefinitions) MultiThreadedDLL @@ -193,7 +189,7 @@ copy Release\$(TargetName).lib $(SolutionDir)..\Bin\ >nul libogg.lib;libvorbis.lib;%(AdditionalDependencies) $(OutDir)libvorbisfile.dll ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) - ..\..\vorbisfile.def + vorbisfile.def false Windows true