// -------------------------------------------------------------------------- // ========================================================================== // File: TDx9_3DXEffectCompiler.CPP // Authors: BCB_Code_Generator v2.00, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons) // Description: This file contains the code for the TDx9_3DXEffectCompiler // Component // // "TDx9_3DXEffect_Library v1.00" // (c) 2005 BCB-Tools.com Pty. Ltd., Sydney, Australia. // All Rights Reserved. // // Refer to the 'Licence.Txt' file for licencing & copyright information. // ========================================================================== // -------------------------------------------------------------------------- // #includes ... // -------------------------------------------------------------------------- #include #pragma hdrstop // -------------------------------------------------------------------------- #include "TDx9_3DXEffectCompiler.H" // -------------------------------------------------------------------------- // external classes used by TDx9_3DXEffectCompiler methods. #include "TD3DXMatrix.H" #include "TDx9_3DPixelShader.H" #include "TDx9_3DBaseTexture.H" #include "TDx9_3DVertexShader.H" // -------------------------------------------------------------------------- #pragma link "TDx_Library_Defns" #pragma link "TDx_Library_Functions" #pragma link "TDx9_3DXEffect_Library_Defns" #pragma link "TDx9_3DXEffect_Library_Functions" // -------------------------------------------------------------------------- // Object Registration... // -------------------------------------------------------------------------- #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ #pragma package(smart_init) #endif // -------------------------------------------------------------------------- static inline void ValidCtrCheck(TDx9_3DXEffectCompiler*) { new TDx9_3DXEffectCompiler(NULL); } // -------------------------------------------------------------------------- namespace Tdx9_3dxeffectcompiler { #if (__BORLANDC__ >= 0x0530) // BCB Version 3+ void __fastcall PACKAGE Register() #else void __fastcall Register() #endif { TComponentClass classes[1] = {__classid(TDx9_3DXEffectCompiler)}; RegisterComponents("", classes, 0); } } // -------------------------------------------------------------------------- // Constructor: TDx9_3DXEffectCompiler::TDx9_3DXEffectCompiler() // Description: The default constructor for the TDx9_3DXEffectCompiler object. // -------------------------------------------------------------------------- __fastcall TDx9_3DXEffectCompiler::TDx9_3DXEffectCompiler(TComponent* Owner) : TDx9_3DXBaseEffect(Owner) { fErrorValue = D3D_OK; fCreated = false; } // -------------------------------------------------------------------------- // Destructor: TDx9_3DXEffectCompiler::~TDx9_3DXEffectCompiler() // Description: The destructor for the TDx9_3DXEffectCompiler object. // -------------------------------------------------------------------------- __fastcall TDx9_3DXEffectCompiler::~TDx9_3DXEffectCompiler() { // destroy internals if (Created) Destroy(); } // -------------------------------------------------------------------------- // Property: Created // Description: The Created property is true if the internal // LPID3DXEFFECTCOMPILER used in this component has been // successfully created, otherwise Created is false. // // To create the internal LPID3DXEFFECTCOMPILER, call the // TDx9_3DXEffectCompiler::Create() method. // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::FGetCreated() { return fCreated; } // -------------------------------------------------------------------------- void __fastcall TDx9_3DXEffectCompiler::FSetCreated( bool pCreated ) { fCreated = (pCreated && (fLPID3DXEFFECTCOMPILER==NULL)); } // -------------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDx9_3DXEffectCompiler method or // fget/fset. eg. D3D_OK or DDERR_SURFACELOST or TDX_ERROR // -------------------------------------------------------------------------- HRESULT __fastcall TDx9_3DXEffectCompiler::FGetErrorValue() { return fErrorValue; } // -------------------------------------------------------------------------- void __fastcall TDx9_3DXEffectCompiler::FSetErrorValue( HRESULT pErrorValue ) { fErrorValue = pErrorValue; } // -------------------------------------------------------------------------- // Method: CompileEffect() // Description: The CompileEffect method is used to ... // Params: pFlags - // The Flags parameter ... // pEffect - // The Effect parameter ... // pErrorMsgs - // The ErrorMsgs parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::CompileEffect( dword pFlags, LPD3DXBUFFER* pEffect, LPD3DXBUFFER* pErrorMsgs ) { // Original Function Definition // HRESULT CompileEffect( // DWORD Flags, // LPD3DXBUFFER *ppEffect, // LPD3DXBUFFER *ppErrorMsgs // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::CompileEffect()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->CompileEffect( (DWORD) pFlags, pEffect, pErrorMsgs ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::CompileEffect()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: CompileShader() // Description: The CompileShader method is used to ... // Params: pFunction - // The Function parameter ... // pTarget - // The Target parameter ... // pFlags - // The Flags parameter ... // pShader - // The Shader parameter ... // pErrorMsgs - // The ErrorMsgs parameter ... // pConstantTable - // The ConstantTable parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::CompileShader( AnsiString* pFunction, dword pTarget, dword pFlags, LPD3DXBUFFER* pShader, LPD3DXBUFFER* pErrorMsgs, LPD3DXSHADER_CONSTANTTABLE* pConstantTable ) { // Original Function Definition // HRESULT CompileShader( // D3DXHANDLE hFunction, // DWORD Target, // DWORD Flags, // LPD3DXBUFFER *ppShader, // LPD3DXBUFFER *ppErrorMsgs, // LPD3DXSHADER_CONSTANTTABLE *ppConstantTable // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::CompileShader()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->CompileShader( (D3DXHANDLE) pFunction, (DWORD) pTarget, (DWORD) pFlags, pShader, pErrorMsgs, pConstantTable ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::CompileShader()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: Create() // Description: The Create() method is used to automatically create the // internal LPID3DXEFFECTCOMPILER interface used in the // TDx9_3DXEffectCompiler component and must be called before // any methods of the TDx9_3DXEffectCompiler component will // function. // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::Create() { fCreated = true; if (fCreated && FOnCreate) FOnCreate(this); return fCreated; } // -------------------------------------------------------------------------- // Method: Destroy() // Description: The Destroy() method is used to automatically destroy the // internal LPID3DXEFFECTCOMPILER interface used in the // TDx9_3DXEffectCompiler component and should be called when // the internal interface is no longer required. // // Note: This method is called by the component's destructor. // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::Destroy() { fCreated = false; if (FOnDestroy) FOnDestroy(this); return !fCreated; } // -------------------------------------------------------------------------- // Method: GetAnnotation() // Description: The GetAnnotation method is used to ... // Params: pObject - // The Object parameter ... // pIndex - // The Index parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetAnnotation( AnsiString* pObject, uint pIndex ) { // Original Function Definition // D3DXHANDLE GetAnnotation( // D3DXHANDLE hObject, // UINT Index // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetAnnotation()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetAnnotation( (D3DXHANDLE) pObject, (UINT) pIndex ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetAnnotation()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetAnnotationByName() // Description: The GetAnnotationByName method is used to ... // Params: pObject - // The Object parameter ... // pName - // The Name parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetAnnotationByName( AnsiString* pObject, AnsiString* pName ) { // Original Function Definition // D3DXHANDLE GetAnnotationByName( // D3DXHANDLE hObject, // LPCSTR pName // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetAnnotationByName()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetAnnotationByName( (D3DXHANDLE) pObject, (LPCSTR) pName ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetAnnotationByName()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetBool() // Description: The GetBool method is used to ... // Params: pParameter - // The Parameter parameter ... // ppb - // The pb parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetBool( AnsiString* pParameter, bool* ppb ) { // Original Function Definition // HRESULT GetBool( // D3DXHANDLE hParameter, // BOOL* pb // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetBool()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetBool( (D3DXHANDLE) pParameter, (BOOL*) ppb ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetBool()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetBoolArray() // Description: The GetBoolArray method is used to ... // Params: pParameter - // The Parameter parameter ... // ppB - // The pB parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetBoolArray( AnsiString* pParameter, bool* ppB, uint pCount ) { // Original Function Definition // HRESULT GetBoolArray( // D3DXHANDLE hParameter, // BOOL* pB, // UINT Count // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetBoolArray()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetBoolArray( (D3DXHANDLE) pParameter, (BOOL*) ppB, (UINT) pCount ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetBoolArray()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetDesc() // Description: The GetDesc method is used to ... // Params: pDesc - // The Desc parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetDesc( D3DXEFFECT_DESC* pDesc ) { // Original Function Definition // HRESULT GetDesc( // D3DXEFFECT_DESC* pDesc // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetDesc()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetDesc( pDesc ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetDesc()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetFloat() // Description: The GetFloat method is used to ... // Params: pParameter - // The Parameter parameter ... // ppf - // The pf parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetFloat( AnsiString* pParameter, float* ppf ) { // Original Function Definition // HRESULT GetFloat( // D3DXHANDLE hParameter, // FLOAT* pf // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetFloat()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetFloat( (D3DXHANDLE) pParameter, (FLOAT*) ppf ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetFloat()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetFloatArray() // Description: The GetFloatArray method is used to ... // Params: pParameter - // The Parameter parameter ... // ppf - // The pf parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetFloatArray( AnsiString* pParameter, float* ppf, uint pCount ) { // Original Function Definition // HRESULT GetFloatArray( // D3DXHANDLE hParameter, // FLOAT* pf, // UINT Count // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetFloatArray()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetFloatArray( (D3DXHANDLE) pParameter, (FLOAT*) ppf, (UINT) pCount ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetFloatArray()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetFunction() // Description: The GetFunction method is used to ... // Params: pIndex - // The Index parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetFunction( uint pIndex ) { // Original Function Definition // D3DXHANDLE GetFunction( // UINT Index // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetFunction()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetFunction( (UINT) pIndex ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetFunction()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetFunctionByName() // Description: The GetFunctionByName method is used to ... // Params: pName - // The Name parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetFunctionByName( AnsiString* pName ) { // Original Function Definition // D3DXHANDLE GetFunctionByName( // LPCSTR pName // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetFunctionByName()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetFunctionByName( (LPCSTR) pName ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetFunctionByName()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetFunctionDesc() // Description: The GetFunctionDesc method is used to ... // Params: pFunction - // The Function parameter ... // pDesc - // The Desc parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetFunctionDesc( AnsiString* pFunction, D3DXFUNCTION_DESC* pDesc ) { // Original Function Definition // HRESULT GetFunctionDesc( // D3DXHANDLE hFunction, // D3DXFUNCTION_DESC* pDesc // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetFunctionDesc()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetFunctionDesc( (D3DXHANDLE) pFunction, pDesc ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetFunctionDesc()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetInt() // Description: The GetInt method is used to ... // Params: pParameter - // The Parameter parameter ... // ppn - // The pn parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetInt( AnsiString* pParameter, int* ppn ) { // Original Function Definition // HRESULT GetInt( // D3DXHANDLE hParameter, // INT* pn // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetInt()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetInt( (D3DXHANDLE) pParameter, (INT*) ppn ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetInt()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetIntArray() // Description: The GetIntArray method is used to ... // Params: pParameter - // The Parameter parameter ... // ppn - // The pn parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetIntArray( AnsiString* pParameter, int* ppn, uint pCount ) { // Original Function Definition // HRESULT GetIntArray( // D3DXHANDLE hParameter, // INT* pn, // UINT Count // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetIntArray()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetIntArray( (D3DXHANDLE) pParameter, (INT*) ppn, (UINT) pCount ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetIntArray()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetLiteral() // Description: The GetLiteral method is used to ... // Params: pParameter - // The Parameter parameter ... // pLiteral - // The Literal parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetLiteral( AnsiString* pParameter, bool* pLiteral ) { // Original Function Definition // HRESULT GetLiteral( // D3DXHANDLE hParameter, // BOOL* pLiteral // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetLiteral()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetLiteral( (D3DXHANDLE) pParameter, (BOOL*) pLiteral ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetLiteral()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetMatrix() // Description: The GetMatrix method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetMatrix( AnsiString* pParameter, D3DXMATRIX* pMatrix ) { // Original Function Definition // HRESULT GetMatrix( // D3DXHANDLE hParameter, // D3DXMATRIX* pMatrix // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetMatrix()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetMatrix( (D3DXHANDLE) pParameter, pMatrix ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetMatrix()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetMatrixArray() // Description: The GetMatrixArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetMatrixArray( AnsiString* pParameter, D3DXMATRIX* pMatrix, uint pCount ) { // Original Function Definition // HRESULT GetMatrixArray( // D3DXHANDLE hParameter, // D3DXMATRIX* pMatrix, // UINT Count // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetMatrixArray()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetMatrixArray( (D3DXHANDLE) pParameter, pMatrix, (UINT) pCount ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetMatrixArray()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetMatrixPointerArray() // Description: The GetMatrixPointerArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: GetMatrixTranspose() // Description: The GetMatrixTranspose method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetMatrixTranspose( AnsiString* pParameter, TD3DXMatrix* pMatrix ) { // Original Function Definition // HRESULT GetMatrixTranspose( // D3DXHANDLE hParameter, // D3DXMATRIX pMatrix // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetMatrixTranspose()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetMatrixTranspose( (D3DXHANDLE) pParameter, (pMatrix==NULL) ? NULL : pMatrix->Internal_D3DXMATRIX ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetMatrixTranspose()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetMatrixTransposeArray() // Description: The GetMatrixTransposeArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetMatrixTransposeArray( AnsiString* pParameter, D3DXMATRIX* pMatrix, uint pCount ) { // Original Function Definition // HRESULT GetMatrixTransposeArray( // D3DXHANDLE hParameter, // D3DXMATRIX* pMatrix, // UINT Count // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetMatrixTransposeArray()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetMatrixTransposeArray( (D3DXHANDLE) pParameter, pMatrix, (UINT) pCount ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetMatrixTransposeArray()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetMatrixTransposePointerArray() // Description: The GetMatrixTransposePointerArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: GetParameter() // Description: The GetParameter method is used to ... // Params: pParent - // The Parent parameter ... // pIndex - // The Index parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetParameter( AnsiString* pParent, uint pIndex ) { // Original Function Definition // D3DXHANDLE GetParameter( // D3DXHANDLE hParent, // UINT Index // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetParameter()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetParameter( (D3DXHANDLE) pParent, (UINT) pIndex ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetParameter()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetParameterByName() // Description: The GetParameterByName method is used to ... // Params: pParent - // The Parent parameter ... // pName - // The Name parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetParameterByName( AnsiString* pParent, AnsiString* pName ) { // Original Function Definition // D3DXHANDLE GetParameterByName( // D3DXHANDLE hParent, // LPCSTR pName // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetParameterByName()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetParameterByName( (D3DXHANDLE) pParent, (LPCSTR) pName ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetParameterByName()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetParameterBySemantic() // Description: The GetParameterBySemantic method is used to ... // Params: pParent - // The Parent parameter ... // pSemantic - // The Semantic parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetParameterBySemantic( AnsiString* pParent, AnsiString* pSemantic ) { // Original Function Definition // D3DXHANDLE GetParameterBySemantic( // D3DXHANDLE hParent, // LPCSTR pSemantic // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetParameterBySemantic()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetParameterBySemantic( (D3DXHANDLE) pParent, (LPCSTR) pSemantic ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetParameterBySemantic()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetParameterDesc() // Description: The GetParameterDesc method is used to ... // Params: pParameter - // The Parameter parameter ... // pDesc - // The Desc parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetParameterDesc( AnsiString* pParameter, D3DXPARAMETER_DESC* pDesc ) { // Original Function Definition // HRESULT GetParameterDesc( // D3DXHANDLE hParameter, // D3DXPARAMETER_DESC* pDesc // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetParameterDesc()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetParameterDesc( (D3DXHANDLE) pParameter, pDesc ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetParameterDesc()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetParameterElement() // Description: The GetParameterElement method is used to ... // Params: pParent - // The Parent parameter ... // pElementIndex - // The ElementIndex parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetParameterElement( AnsiString* pParent, uint pElementIndex ) { // Original Function Definition // D3DXHANDLE GetParameterElement( // D3DXHANDLE hParent, // UINT ElementIndex // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetParameterElement()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetParameterElement( (D3DXHANDLE) pParent, (UINT) pElementIndex ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetParameterElement()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetPass() // Description: The GetPass method is used to ... // Params: pTechnique - // The Technique parameter ... // pIndex - // The Index parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetPass( AnsiString* pTechnique, uint pIndex ) { // Original Function Definition // D3DXHANDLE GetPass( // D3DXHANDLE hTechnique, // UINT Index // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetPass()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetPass( (D3DXHANDLE) pTechnique, (UINT) pIndex ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetPass()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetPassByName() // Description: The GetPassByName method is used to ... // Params: pTechnique - // The Technique parameter ... // pName - // The Name parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetPassByName( AnsiString* pTechnique, AnsiString* pName ) { // Original Function Definition // D3DXHANDLE GetPassByName( // D3DXHANDLE hTechnique, // LPCSTR pName // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetPassByName()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetPassByName( (D3DXHANDLE) pTechnique, (LPCSTR) pName ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetPassByName()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetPassDesc() // Description: The GetPassDesc method is used to ... // Params: pPass - // The Pass parameter ... // pDesc - // The Desc parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetPassDesc( AnsiString* pPass, D3DXPASS_DESC* pDesc ) { // Original Function Definition // HRESULT GetPassDesc( // D3DXHANDLE hPass, // D3DXPASS_DESC* pDesc // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetPassDesc()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetPassDesc( (D3DXHANDLE) pPass, pDesc ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetPassDesc()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetPixelShader() // Description: The GetPixelShader method is used to ... // Params: pParameter - // The Parameter parameter ... // pPShader - // The PShader parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetPixelShader( AnsiString* pParameter, TDx9_3DPixelShader* pPShader ) { // Original Function Definition // HRESULT GetPixelShader( // D3DXHANDLE hParameter, // LPDIRECT3DPIXELSHADER9* ppPShader // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetPixelShader()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetPixelShader( (D3DXHANDLE) pParameter, (pPShader==NULL) ? NULL : pPShader->Internal_LPDIRECT3DPIXELSHADER9_Ptr ); // Translate Data returned from Function if (pPShader!=NULL) pPShader->Internal_LPDIRECT3DPIXELSHADER9_Update(); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetPixelShader()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetString() // Description: The GetString method is used to ... // Params: pParameter - // The Parameter parameter ... // pString - // The String parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetString( AnsiString* pParameter, AnsiString** pString ) { // Original Function Definition // HRESULT GetString( // D3DXHANDLE hParameter, // LPCSTR* ppString // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetString()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetString( (D3DXHANDLE) pParameter, (LPCSTR*) pString ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetString()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetTechnique() // Description: The GetTechnique method is used to ... // Params: pIndex - // The Index parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetTechnique( uint pIndex ) { // Original Function Definition // D3DXHANDLE GetTechnique( // UINT Index // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetTechnique()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetTechnique( (UINT) pIndex ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetTechnique()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetTechniqueByName() // Description: The GetTechniqueByName method is used to ... // Params: pName - // The Name parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetTechniqueByName( AnsiString* pName ) { // Original Function Definition // D3DXHANDLE GetTechniqueByName( // LPCSTR pName // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetTechniqueByName()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetTechniqueByName( (LPCSTR) pName ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetTechniqueByName()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetTechniqueDesc() // Description: The GetTechniqueDesc method is used to ... // Params: pTechnique - // The Technique parameter ... // pDesc - // The Desc parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetTechniqueDesc( AnsiString* pTechnique, D3DXTECHNIQUE_DESC* pDesc ) { // Original Function Definition // HRESULT GetTechniqueDesc( // D3DXHANDLE hTechnique, // D3DXTECHNIQUE_DESC* pDesc // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetTechniqueDesc()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetTechniqueDesc( (D3DXHANDLE) pTechnique, pDesc ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetTechniqueDesc()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetTexture() // Description: The GetTexture method is used to ... // Params: pParameter - // The Parameter parameter ... // pTexture - // The Texture parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetTexture( AnsiString* pParameter, TDx9_3DBaseTexture* pTexture ) { // Original Function Definition // HRESULT GetTexture( // D3DXHANDLE hParameter, // LPDIRECT3DBASETEXTURE9* ppTexture // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetTexture()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetTexture( (D3DXHANDLE) pParameter, (pTexture==NULL) ? NULL : pTexture->Internal_LPDIRECT3DBASETEXTURE9_Ptr ); // Translate Data returned from Function if (pTexture!=NULL) pTexture->Internal_LPDIRECT3DBASETEXTURE9_Update(); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetTexture()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetValue() // Description: The GetValue method is used to ... // Params: pParameter - // The Parameter parameter ... // pData - // The Data parameter ... // pBytes - // The Bytes parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetValue( AnsiString* pParameter, void* pData, uint pBytes ) { // Original Function Definition // HRESULT GetValue( // D3DXHANDLE hParameter, // LPVOID pData, // UINT Bytes // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetValue()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetValue( (D3DXHANDLE) pParameter, (LPVOID) pData, (UINT) pBytes ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetValue()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetVector() // Description: The GetVector method is used to ... // Params: pParameter - // The Parameter parameter ... // pVector - // The Vector parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetVector( AnsiString* pParameter, D3DXVECTOR4* pVector ) { // Original Function Definition // HRESULT GetVector( // D3DXHANDLE hParameter, // D3DXVECTOR4* pVector // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetVector()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetVector( (D3DXHANDLE) pParameter, pVector ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetVector()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetVectorArray() // Description: The GetVectorArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pVector - // The Vector parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetVectorArray( AnsiString* pParameter, D3DXVECTOR4* pVector, uint pCount ) { // Original Function Definition // HRESULT GetVectorArray( // D3DXHANDLE hParameter, // D3DXVECTOR4* pVector, // UINT Count // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetVectorArray()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetVectorArray( (D3DXHANDLE) pParameter, pVector, (UINT) pCount ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetVectorArray()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: GetVertexShader() // Description: The GetVertexShader method is used to ... // Params: pParameter - // The Parameter parameter ... // pVShader - // The VShader parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::GetVertexShader( AnsiString* pParameter, TDx9_3DVertexShader* pVShader ) { // Original Function Definition // HRESULT GetVertexShader( // D3DXHANDLE hParameter, // LPDIRECT3DVERTEXSHADER9* ppVShader // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::GetVertexShader()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->GetVertexShader( (D3DXHANDLE) pParameter, (pVShader==NULL) ? NULL : pVShader->Internal_LPDIRECT3DVERTEXSHADER9_Ptr ); // Translate Data returned from Function if (pVShader!=NULL) pVShader->Internal_LPDIRECT3DVERTEXSHADER9_Update(); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::GetVertexShader()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetBool() // Description: The SetBool method is used to ... // Params: pParameter - // The Parameter parameter ... // pb - // The b parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetBool( AnsiString* pParameter, bool pb ) { // Original Function Definition // HRESULT SetBool( // D3DXHANDLE hParameter, // BOOL b // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetBool()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetBool( (D3DXHANDLE) pParameter, (BOOL) pb ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetBool()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetBoolArray() // Description: The SetBoolArray method is used to ... // Params: pParameter - // The Parameter parameter ... // ppB - // The pB parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetFloat() // Description: The SetFloat method is used to ... // Params: pParameter - // The Parameter parameter ... // pf - // The f parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetFloat( AnsiString* pParameter, float pf ) { // Original Function Definition // HRESULT SetFloat( // D3DXHANDLE hParameter, // FLOAT f // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetFloat()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetFloat( (D3DXHANDLE) pParameter, (FLOAT) pf ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetFloat()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetFloatArray() // Description: The SetFloatArray method is used to ... // Params: pParameter - // The Parameter parameter ... // ppf - // The pf parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetInt() // Description: The SetInt method is used to ... // Params: pParameter - // The Parameter parameter ... // pn - // The n parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetInt( AnsiString* pParameter, int pn ) { // Original Function Definition // HRESULT SetInt( // D3DXHANDLE hParameter, // INT n // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetInt()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetInt( (D3DXHANDLE) pParameter, (INT) pn ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetInt()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetIntArray() // Description: The SetIntArray method is used to ... // Params: pParameter - // The Parameter parameter ... // ppn - // The pn parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetLiteral() // Description: The SetLiteral method is used to ... // Params: pParameter - // The Parameter parameter ... // pLiteral - // The Literal parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetLiteral( AnsiString* pParameter, bool pLiteral ) { // Original Function Definition // HRESULT SetLiteral( // D3DXHANDLE hParameter, // BOOL Literal // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetLiteral()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetLiteral( (D3DXHANDLE) pParameter, (BOOL) pLiteral ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetLiteral()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetMatrix() // Description: The SetMatrix method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetMatrixArray() // Description: The SetMatrixArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetMatrixPointerArray() // Description: The SetMatrixPointerArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pD3DXMATRIX* - // The D3DXMATRIX* parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetMatrixTranspose() // Description: The SetMatrixTranspose method is used to ... // Params: pParameter - // The Parameter parameter ... // pD3DXMATRIX - // The D3DXMATRIX parameter ... // pMatrix - // The Matrix parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetMatrixTransposeArray() // Description: The SetMatrixTransposeArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pD3DXMATRIX* - // The D3DXMATRIX* parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetMatrixTransposePointerArray() // Description: The SetMatrixTransposePointerArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pD3DXMATRIX** - // The D3DXMATRIX** parameter ... // pMatrix - // The Matrix parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetPixelShader() // Description: The SetPixelShader method is used to ... // Params: pParameter - // The Parameter parameter ... // pPShader - // The PShader parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetPixelShader( AnsiString* pParameter, TDx9_3DPixelShader* pPShader ) { // Original Function Definition // HRESULT SetPixelShader( // D3DXHANDLE hParameter, // LPDIRECT3DPIXELSHADER9 pPShader // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetPixelShader()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetPixelShader( (D3DXHANDLE) pParameter, (pPShader==NULL) ? NULL : pPShader->Internal_LPDIRECT3DPIXELSHADER9 ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetPixelShader()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetString() // Description: The SetString method is used to ... // Params: pParameter - // The Parameter parameter ... // pLPCSTR - // The LPCSTR parameter ... // pString - // The String parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetTexture() // Description: The SetTexture method is used to ... // Params: pParameter - // The Parameter parameter ... // pTexture - // The Texture parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetTexture( AnsiString* pParameter, TDx9_3DBaseTexture* pTexture ) { // Original Function Definition // HRESULT SetTexture( // D3DXHANDLE hParameter, // LPDIRECT3DBASETEXTURE9 pTexture // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetTexture()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetTexture( (D3DXHANDLE) pParameter, (pTexture==NULL) ? NULL : pTexture->Internal_LPDIRECT3DBASETEXTURE9 ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetTexture()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetValue() // Description: The SetValue method is used to ... // Params: pParameter - // The Parameter parameter ... // pData - // The Data parameter ... // pBytes - // The Bytes parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetValue( AnsiString* pParameter, const void* pData, uint pBytes ) { // Original Function Definition // HRESULT SetValue( // D3DXHANDLE hParameter, // LPCVOID pData, // UINT Bytes // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetValue()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetValue( (D3DXHANDLE) pParameter, (LPCVOID) pData, (UINT) pBytes ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetValue()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Method: SetVector() // Description: The SetVector method is used to ... // Params: pParameter - // The Parameter parameter ... // pD3DXVECTOR4* - // The D3DXVECTOR4* parameter ... // pVector - // The Vector parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetVectorArray() // Description: The SetVectorArray method is used to ... // Params: pParameter - // The Parameter parameter ... // pD3DXVECTOR4* - // The D3DXVECTOR4* parameter ... // pVector - // The Vector parameter ... // pCount - // The Count parameter ... // -------------------------------------------------------------------------- // -------------------------------------------------------------------------- // Method: SetVertexShader() // Description: The SetVertexShader method is used to ... // Params: pParameter - // The Parameter parameter ... // pVertexShader - // The VertexShader parameter ... // -------------------------------------------------------------------------- bool __fastcall TDx9_3DXEffectCompiler::SetVertexShader( AnsiString* pParameter, TDx9_3DVertexShader* pVertexShader ) { // Original Function Definition // HRESULT SetVertexShader( // D3DXHANDLE hParameter, // LPDIRECT3DVERTEXSHADER9 pVertexShader // ); // if the component internals are not already created, exit if (!fCreated) { fErrorValue = TDX_NOTCREATED; if (FOnError) FOnError( this, Name+"::SetVertexShader()", "TDX_NOTCREATED", "The "+Name+" component has not been created successfully." ); return false; } // Call Original Function fErrorValue = (uint) fLPID3DXEFFECTCOMPILER->SetVertexShader( (D3DXHANDLE) pParameter, (pVertexShader==NULL) ? NULL : pVertexShader->Internal_LPDIRECT3DVERTEXSHADER9 ); // Handle any Known Results if (fErrorValue!=D3D_OK) { // Failure. if (FOnError) FOnError( this, Name+"::SetVertexShader()", TDx9_3DXEffect_Library_ErrorString(fErrorValue), TDx9_3DXEffect_Library_ErrorMessage(fErrorValue) ); return false; } // Success! return true; } // -------------------------------------------------------------------------- // Internal Interface Access // -------------------------------------------------------------------------- LPID3DXEFFECTCOMPILER __fastcall TDx9_3DXEffectCompiler::FGetInternal_LPID3DXEFFECTCOMPILER() { return fLPID3DXEFFECTCOMPILER; } // -------------------------------------------------------------------------- LPID3DXEFFECTCOMPILER* __fastcall TDx9_3DXEffectCompiler::FGetInternal_LPID3DXEFFECTCOMPILER_Ptr() { return &fLPID3DXEFFECTCOMPILER; } // -------------------------------------------------------------------------- void __fastcall TDx9_3DXEffectCompiler::FSetInternal_LPID3DXEFFECTCOMPILER( LPID3DXEFFECTCOMPILER pLPID3DXEFFECTCOMPILER ) { if (!fCreated) { fLPID3DXEFFECTCOMPILER = pLPID3DXEFFECTCOMPILER; fCreated = (fLPID3DXEFFECTCOMPILER!=NULL); } } // -------------------------------------------------------------------------- void __fastcall TDx9_3DXEffectCompiler::Internal_LPID3DXEFFECTCOMPILER_Update() { fCreated = (fLPID3DXEFFECTCOMPILER!=NULL); } // --------------------------------------------------------------------------