OSDN Git Service

#36897 [DTXC] MIDIインポート機能の呼び出し口を、ファイルメニュー内にも配置。
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / direct3d11 / EffectPassDescription11.cpp
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
5 * of this software and associated documentation files (the "Software"), to deal\r
6 * in the Software without restriction, including without limitation the rights\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
8 * copies of the Software, and to permit persons to whom the Software is\r
9 * furnished to do so, subject to the following conditions:\r
10\r
11 * The above copyright notice and this permission notice shall be included in\r
12 * all copies or substantial portions of the Software.\r
13\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
20 * THE SOFTWARE.\r
21 */\r
22 #include "stdafx.h"\r
23 \r
24 #include "../DataStream.h"\r
25 \r
26 #include "EffectPassDescription11.h"\r
27 \r
28 using namespace System;\r
29 \r
30 namespace SlimDX\r
31 {\r
32 namespace Direct3D11\r
33\r
34         EffectPassDescription::EffectPassDescription( const D3DX11_PASS_DESC& native )\r
35         {\r
36                 m_Name = gcnew String( native.Name );\r
37                 m_Annotations = native.Annotations;\r
38                 m_Signature = gcnew SlimDX::D3DCompiler::ShaderSignature( gcnew DataStream( native.pIAInputSignature, native.IAInputSignatureSize, true, false, false ) );\r
39                 m_StencilRef = native.StencilRef;\r
40                 m_SampleMask = native.SampleMask;\r
41                 m_BlendFactor = Color4( native.BlendFactor[ 3 ], native.BlendFactor[ 0 ], native.BlendFactor[ 1 ], native.BlendFactor[ 2 ] );\r
42         }\r
43         \r
44         String^ EffectPassDescription::Name::get()\r
45         {\r
46                 return m_Name;\r
47         }\r
48         \r
49         int EffectPassDescription::AnnotationCount::get()\r
50         {\r
51                 return m_Annotations;\r
52         }\r
53         \r
54         SlimDX::D3DCompiler::ShaderSignature^ EffectPassDescription::Signature::get()\r
55         {\r
56                 return m_Signature;\r
57         }\r
58         \r
59         int EffectPassDescription::StencilReference::get()\r
60         {\r
61                 return m_StencilRef;\r
62         }\r
63         \r
64         int EffectPassDescription::SampleMask::get()\r
65         {\r
66                 return m_SampleMask;\r
67         }\r
68         \r
69         Color4 EffectPassDescription::BlendFactor::get()\r
70         {\r
71                 return m_BlendFactor;\r
72         }\r
73 \r
74         bool EffectPassDescription::operator == ( EffectPassDescription left, EffectPassDescription right )\r
75         {\r
76                 return EffectPassDescription::Equals( left, right );\r
77         }\r
78 \r
79         bool EffectPassDescription::operator != ( EffectPassDescription left, EffectPassDescription right )\r
80         {\r
81                 return !EffectPassDescription::Equals( left, right );\r
82         }\r
83 \r
84         int EffectPassDescription::GetHashCode()\r
85         {\r
86                 return m_Name->GetHashCode() + m_Annotations.GetHashCode() + m_Signature->GetHashCode() + m_StencilRef.GetHashCode() + m_SampleMask.GetHashCode() + m_BlendFactor.GetHashCode();\r
87         }\r
88 \r
89         bool EffectPassDescription::Equals( Object^ value )\r
90         {\r
91                 if( value == nullptr )\r
92                         return false;\r
93 \r
94                 if( value->GetType() != GetType() )\r
95                         return false;\r
96 \r
97                 return Equals( safe_cast<EffectPassDescription>( value ) );\r
98         }\r
99 \r
100         bool EffectPassDescription::Equals( EffectPassDescription value )\r
101         {\r
102                 return ( m_Name == value.m_Name && m_Annotations == value.m_Annotations && m_Signature == value.m_Signature && m_StencilRef == value.m_StencilRef && m_SampleMask == value.m_SampleMask && m_BlendFactor == value.m_BlendFactor );\r
103         }\r
104 \r
105         bool EffectPassDescription::Equals( EffectPassDescription% value1, EffectPassDescription% value2 )\r
106         {\r
107                 return ( value1.m_Name == value2.m_Name && value1.m_Annotations == value2.m_Annotations && value1.m_Signature == value2.m_Signature && value1.m_StencilRef == value2.m_StencilRef && value1.m_SampleMask == value2.m_SampleMask && value1.m_BlendFactor == value2.m_BlendFactor );\r
108         }\r
109 }\r
110 }\r