Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3DXFERR_BADTYPE: Bad type (-2005531770) #513

Open
yangguangpiaopiao opened this issue Apr 22, 2019 · 0 comments
Open

D3DXFERR_BADTYPE: Bad type (-2005531770) #513

yangguangpiaopiao opened this issue Apr 22, 2019 · 0 comments

Comments

@yangguangpiaopiao
Copy link

meshData = fileSaveObject.AddDataObject(XFileGuid.Mesh, singleMesh.Name, Guid.Empty, meshStream.GetBuffer());
XFileSaveData::AddDataObject(Guid dataTemplate, string name, Guid id, byte[] data);

XFileSaveData^ XFileSaveObject::AddDataObject_Internal( Guid dataTemplate, String^ name, Guid id, const void* data, SIZE_T size )
{
ID3DXFileSaveData *result;
GUID nativeId = Utilities::ConvertManagedGuid( id );
GUID *pointer = &nativeId;
if( id == Guid::Empty )
pointer = NULL;

	array<unsigned char>^ nameBytes = System::Text::ASCIIEncoding::ASCII->GetBytes( name );
	pin_ptr<unsigned char> pinnedName = &nameBytes[0];

	HRESULT hr = InternalPointer->AddDataObject( Utilities::ConvertManagedGuid( dataTemplate ),
		reinterpret_cast<LPCSTR>( pinnedName ), pointer, size, data, &result );
	
	if( RECORD_D3D9(hr).IsFailure )
		return nullptr;

	return XFileSaveData::FromPointer( result );
}

hr = -2005531770,Then the next step is unusual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant