OSDN Git Service

作業部屋#50802 画面キャプチャができなくなっていた問題を暫定対応(F12キー固定で対応中)
[dtxmaniaxg-verk/dtxmaniaxg-verk-git.git] / SlimDXc_Jun2010(VC++2008) / source / direct3d10 / ResourceRegion.cpp
1 #include "stdafx.h"
2 /*
3 * Copyright (c) 2007-2010 SlimDX Group
4
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23
24 #include <d3d10.h>
25
26 #include "ResourceRegion.h"
27
28 namespace SlimDX
29 {
30 namespace Direct3D10
31 {       
32         ResourceRegion::ResourceRegion( const D3D10_BOX& native )
33         {
34                 m_Left = native.left;
35                 m_Top = native.top;
36                 m_Front = native.front;
37                 m_Right = native.right;
38                 m_Bottom = native.bottom;
39                 m_Back = native.back;
40         }
41         
42         D3D10_BOX ResourceRegion::CreateNativeVersion()
43         {
44                 D3D10_BOX native;
45                 native.left = m_Left;
46                 native.top = m_Top;
47                 native.front = m_Front;
48                 native.right = m_Right;
49                 native.bottom = m_Bottom;
50                 native.back = m_Back;
51                 
52                 return native;
53         }
54         
55         int ResourceRegion::Left::get()
56         {
57                 return m_Left;
58         }
59         
60         void ResourceRegion::Left::set( int value )
61         {
62                 m_Left = value;
63         }
64         
65         int ResourceRegion::Top::get()
66         {
67                 return m_Top;
68         }
69         
70         void ResourceRegion::Top::set( int value )
71         {
72                 m_Top = value;
73         }
74         
75         int ResourceRegion::Front::get()
76         {
77                 return m_Front;
78         }
79         
80         void ResourceRegion::Front::set( int value )
81         {
82                 m_Front = value;
83         }
84         
85         int ResourceRegion::Right::get()
86         {
87                 return m_Right;
88         }
89         
90         void ResourceRegion::Right::set( int value )
91         {
92                 m_Right = value;
93         }
94         
95         int ResourceRegion::Bottom::get()
96         {
97                 return m_Bottom;
98         }
99         
100         void ResourceRegion::Bottom::set( int value )
101         {
102                 m_Bottom = value;
103         }
104         
105         int ResourceRegion::Back::get()
106         {
107                 return m_Back;
108         }
109         
110         void ResourceRegion::Back::set( int value )
111         {
112                 m_Back = value;
113         }
114
115         bool ResourceRegion::operator == ( ResourceRegion left, ResourceRegion right )
116         {
117                 return ResourceRegion::Equals( left, right );
118         }
119
120         bool ResourceRegion::operator != ( ResourceRegion left, ResourceRegion right )
121         {
122                 return !ResourceRegion::Equals( left, right );
123         }
124
125         int ResourceRegion::GetHashCode()
126         {
127                 return m_Left.GetHashCode() + m_Top.GetHashCode() + m_Front.GetHashCode()
128                          + m_Right.GetHashCode() + m_Bottom.GetHashCode() + m_Back.GetHashCode();
129         }
130
131         bool ResourceRegion::Equals( Object^ value )
132         {
133                 if( value == nullptr )
134                         return false;
135
136                 if( value->GetType() != GetType() )
137                         return false;
138
139                 return Equals( safe_cast<ResourceRegion>( value ) );
140         }
141
142         bool ResourceRegion::Equals( ResourceRegion value )
143         {
144                 return ( m_Left == value.m_Left && m_Top == value.m_Top && m_Front == value.m_Front
145                          && m_Right == value.m_Right && m_Bottom == value.m_Bottom && m_Back == value.m_Back );
146         }
147
148         bool ResourceRegion::Equals( ResourceRegion% value1, ResourceRegion% value2 )
149         {
150                 return ( value1.m_Left == value2.m_Left && value1.m_Top == value2.m_Top && value1.m_Front == value2.m_Front
151                          && value1.m_Right == value2.m_Right && value1.m_Bottom == value2.m_Bottom && value1.m_Back == value2.m_Back );
152         }
153 }
154 }