OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / direct3d10 / EffectPassDescription.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 "EffectPassDescription.h"\r
27 #include "../d3dcompiler/ShaderSignatureDC.h"\r
28 \r
29 using namespace System;\r
30 \r
31 namespace SlimDX\r
32 {\r
33 namespace Direct3D10\r
34\r
35         EffectPassDescription::EffectPassDescription( const D3D10_PASS_DESC& native )\r
36         {\r
37                 m_Name = gcnew String( native.Name );\r
38                 m_Annotations = native.Annotations;\r
39                 m_Signature = gcnew D3DCompiler::ShaderSignature( gcnew DataStream( native.pIAInputSignature, native.IAInputSignatureSize, true, false ) );\r
40                 m_StencilRef = native.StencilRef;\r
41                 m_SampleMask = native.SampleMask;\r
42                 m_BlendFactor = Color4( native.BlendFactor[ 3 ], native.BlendFactor[ 0 ], native.BlendFactor[ 1 ], native.BlendFactor[ 2 ] );\r
43         }\r
44         \r
45         String^ EffectPassDescription::Name::get()\r
46         {\r
47                 return m_Name;\r
48         }\r
49         \r
50         int EffectPassDescription::AnnotationCount::get()\r
51         {\r
52                 return m_Annotations;\r
53         }\r
54         \r
55         D3DCompiler::ShaderSignature^ EffectPassDescription::Signature::get()\r
56         {\r
57                 return m_Signature;\r
58         }\r
59         \r
60         int EffectPassDescription::StencilReference::get()\r
61         {\r
62                 return m_StencilRef;\r
63         }\r
64         \r
65         int EffectPassDescription::SampleMask::get()\r
66         {\r
67                 return m_SampleMask;\r
68         }\r
69         \r
70         Color4 EffectPassDescription::BlendFactor::get()\r
71         {\r
72                 return m_BlendFactor;\r
73         }\r
74 \r
75         bool EffectPassDescription::operator == ( EffectPassDescription left, EffectPassDescription right )\r
76         {\r
77                 return EffectPassDescription::Equals( left, right );\r
78         }\r
79 \r
80         bool EffectPassDescription::operator != ( EffectPassDescription left, EffectPassDescription right )\r
81         {\r
82                 return !EffectPassDescription::Equals( left, right );\r
83         }\r
84 \r
85         int EffectPassDescription::GetHashCode()\r
86         {\r
87                 return m_Name->GetHashCode() + m_Annotations.GetHashCode() + m_Signature->GetHashCode() + m_StencilRef.GetHashCode() + m_SampleMask.GetHashCode() + m_BlendFactor.GetHashCode();\r
88         }\r
89 \r
90         bool EffectPassDescription::Equals( Object^ value )\r
91         {\r
92                 if( value == nullptr )\r
93                         return false;\r
94 \r
95                 if( value->GetType() != GetType() )\r
96                         return false;\r
97 \r
98                 return Equals( safe_cast<EffectPassDescription>( value ) );\r
99         }\r
100 \r
101         bool EffectPassDescription::Equals( EffectPassDescription value )\r
102         {\r
103                 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
104         }\r
105 \r
106         bool EffectPassDescription::Equals( EffectPassDescription% value1, EffectPassDescription% value2 )\r
107         {\r
108                 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
109         }\r
110 }\r
111 }\r