+++ /dev/null
-#include "stdafx.h"\r
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#include <dsound.h>\r
-\r
-#include "Buffer3DSettings.h"\r
-\r
-namespace SlimDX\r
-{\r
-namespace DirectSound\r
-{\r
- Buffer3DSettings::Buffer3DSettings( const DS3DBUFFER& value )\r
- {\r
- ConeOrientation = Vector3( value.vConeOrientation.x, value.vConeOrientation.y, value.vConeOrientation.z );\r
- ConeOutsideVolume = value.lConeOutsideVolume;\r
- InsideConeAngle = value.dwInsideConeAngle;\r
- OutsideConeAngle = value.dwOutsideConeAngle;\r
- MaxDistance = value.flMaxDistance;\r
- MinDistance = value.flMinDistance;\r
- Position = Vector3( value.vPosition.x, value.vPosition.y, value.vPosition.z );\r
- Velocity = Vector3( value.vVelocity.x, value.vVelocity.y, value.vVelocity.z );\r
- Mode = static_cast<Mode3D>( value.dwMode );\r
- }\r
-\r
- DS3DBUFFER Buffer3DSettings::ToUnmanaged()\r
- {\r
- DS3DBUFFER result;\r
- ZeroMemory( &result, sizeof( DS3DBUFFER ) );\r
- result.dwSize = sizeof( DS3DBUFFER );\r
- result.vConeOrientation.x = ConeOrientation.X;\r
- result.vConeOrientation.y = ConeOrientation.Y;\r
- result.vConeOrientation.z = ConeOrientation.Z;\r
- result.lConeOutsideVolume = ConeOutsideVolume;\r
- result.dwInsideConeAngle = InsideConeAngle;\r
- result.dwOutsideConeAngle = OutsideConeAngle;\r
- result.flMaxDistance = MaxDistance;\r
- result.flMinDistance = MinDistance;\r
- result.vPosition.x = Position.X;\r
- result.vPosition.y = Position.Y;\r
- result.vPosition.z = Position.Z;\r
- result.vVelocity.x = Velocity.X;\r
- result.vVelocity.y = Velocity.Y;\r
- result.vVelocity.z = Velocity.Z;\r
- result.dwMode = static_cast<DWORD>( Mode );\r
-\r
- return result;\r
- }\r
-\r
- bool Buffer3DSettings::operator == ( Buffer3DSettings left, Buffer3DSettings right )\r
- {\r
- return Buffer3DSettings::Equals( left, right );\r
- }\r
-\r
- bool Buffer3DSettings::operator != ( Buffer3DSettings left, Buffer3DSettings right )\r
- {\r
- return !Buffer3DSettings::Equals( left, right );\r
- }\r
-\r
- int Buffer3DSettings::GetHashCode()\r
- {\r
- return Velocity.GetHashCode() + Position.GetHashCode() + OutsideConeAngle.GetHashCode() + Mode.GetHashCode() + MinDistance.GetHashCode() + \r
- MaxDistance.GetHashCode() + InsideConeAngle.GetHashCode() + ConeOutsideVolume.GetHashCode() + ConeOrientation.GetHashCode();\r
- }\r
-\r
- bool Buffer3DSettings::Equals( Object^ value )\r
- {\r
- if( value == nullptr )\r
- return false;\r
-\r
- if( value->GetType() != GetType() )\r
- return false;\r
-\r
- return Equals( safe_cast<Buffer3DSettings>( value ) );\r
- }\r
-\r
- bool Buffer3DSettings::Equals( Buffer3DSettings value )\r
- {\r
- return ( Velocity == value.Velocity && Position == value.Position && OutsideConeAngle == value.OutsideConeAngle && Mode == value.Mode && \r
- MinDistance == value.MinDistance && MaxDistance == value.MaxDistance && InsideConeAngle == value.InsideConeAngle && \r
- ConeOutsideVolume == value.ConeOutsideVolume && ConeOrientation == value.ConeOrientation );\r
- }\r
-\r
- bool Buffer3DSettings::Equals( Buffer3DSettings% value1, Buffer3DSettings% value2 )\r
- {\r
- return value1.Equals( value2 );\r
- }\r
-}\r
-}
\ No newline at end of file