OSDN Git Service

Merge branch 'feature/#36529_SlimDXからSharpDXへの移行' into develop
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / direct3d9 / EffectInstance.cpp
diff --git a/SlimDXc_Jun2010(VC++2008)/source/direct3d9/EffectInstance.cpp b/SlimDXc_Jun2010(VC++2008)/source/direct3d9/EffectInstance.cpp
deleted file mode 100644 (file)
index f0785c3..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-#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 <d3d9.h>\r
-#include <d3dx9.h>\r
-\r
-#include "../Utilities.h"\r
-#include "../DataStream.h"\r
-\r
-#include "EffectInstance.h"\r
-\r
-using namespace System;\r
-\r
-namespace SlimDX\r
-{\r
-namespace Direct3D9\r
-{\r
-       EffectInstance EffectInstance::FromUnmanaged( const D3DXEFFECTINSTANCE &effect )\r
-       {\r
-               EffectInstance result;\r
-\r
-               result.EffectFileName = gcnew String( effect.pEffectFilename );\r
-               result.Defaults = gcnew array<EffectDefault>( effect.NumDefaults );\r
-\r
-               for( unsigned int i = 0; i < effect.NumDefaults; i++ )\r
-               {\r
-                       result.Defaults[i].ParameterName = gcnew String( effect.pDefaults[i].pParamName );\r
-                       result.Defaults[i].Type = static_cast<EffectDefaultType>( effect.pDefaults[i].Type );\r
-                       result.Defaults[i].Value = gcnew DataStream( effect.pDefaults[i].pValue, effect.pDefaults[i].NumBytes, true, false, true );\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       D3DXEFFECTINSTANCE EffectInstance::ToUnmanaged( EffectInstance effect )\r
-       {\r
-               D3DXEFFECTINSTANCE result;\r
-               int count = effect.Defaults->Length;\r
-               result.NumDefaults = count;\r
-\r
-               // Manual Allocation: Handled properly\r
-               // this is pretty damn ugly, but I don't think I can see a way around it\r
-               // each method that calls this one must make sure to clean up this array\r
-               // right now, all of them do\r
-               result.pDefaults = new D3DXEFFECTDEFAULT[count];\r
-               result.pEffectFilename = Utilities::AllocateNativeString( effect.EffectFileName );\r
-\r
-               for( int i = 0; i < effect.Defaults->Length; i++ )\r
-               {\r
-                       result.pDefaults[i].pParamName = Utilities::AllocateNativeString( effect.Defaults[i].ParameterName );\r
-                       result.pDefaults[i].Type = static_cast<D3DXEFFECTDEFAULTTYPE>( effect.Defaults[i].Type );\r
-                       result.pDefaults[i].NumBytes = static_cast<DWORD>( effect.Defaults[i].Value->Length );\r
-                       result.pDefaults[i].pValue = effect.Defaults[i].Value->PositionPointer;\r
-               }\r
-\r
-               return result;\r
-       }\r
-\r
-       array<EffectInstance>^ EffectInstance::FromBuffer( ID3DXBuffer* buffer, unsigned int count )\r
-       {\r
-               const D3DXEFFECTINSTANCE* source  = reinterpret_cast<const D3DXEFFECTINSTANCE*>( buffer->GetBufferPointer() );\r
-\r
-               array<EffectInstance>^ destination = gcnew array<EffectInstance>( count );\r
-               for( unsigned int i = 0; i < count; ++i )\r
-               {\r
-                       destination[i].EffectFileName = gcnew String( source[i].pEffectFilename );\r
-                       destination[i].Defaults = gcnew array<EffectDefault>( source[i].NumDefaults );\r
-                       for( unsigned int x = 0; x < source[i].NumDefaults; ++x )\r
-                       {\r
-                               destination[i].Defaults[x].ParameterName = gcnew String( source[i].pDefaults[x].pParamName );\r
-                               destination[i].Defaults[x].Type = static_cast<EffectDefaultType>( source[i].pDefaults[x].Type );\r
-                               destination[i].Defaults[x].Value = gcnew DataStream( source[i].pDefaults[x].pValue, source[i].pDefaults[x].NumBytes, true, false, true );\r
-                       }\r
-               }\r
-\r
-               return destination;\r
-       }\r
-\r
-       bool EffectInstance::operator == ( EffectInstance left, EffectInstance right )\r
-       {\r
-               return EffectInstance::Equals( left, right );\r
-       }\r
-\r
-       bool EffectInstance::operator != ( EffectInstance left, EffectInstance right )\r
-       {\r
-               return !EffectInstance::Equals( left, right );\r
-       }\r
-\r
-       int EffectInstance::GetHashCode()\r
-       {\r
-               return EffectFileName->GetHashCode() + Defaults->GetHashCode();\r
-       }\r
-\r
-       bool EffectInstance::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<EffectInstance>( value ) );\r
-       }\r
-\r
-       bool EffectInstance::Equals( EffectInstance value )\r
-       {\r
-               return ( EffectFileName == value.EffectFileName && Defaults == value.Defaults );\r
-       }\r
-\r
-       bool EffectInstance::Equals( EffectInstance% value1, EffectInstance% value2 )\r
-       {\r
-               return ( value1.EffectFileName == value2.EffectFileName && value1.Defaults == value2.Defaults );\r
-       }\r
-}\r
-}
\ No newline at end of file