C#上の定義は以下になっており、
[DllImport("DxLib.dll", EntryPoint="dx_LoadSoundMem", CallingConvention=CallingConvention.StdCall)]
extern static int dx_LoadSoundMem_x86( string FileName, int BufferNum, int UnionHandle);
[DllImport("DxLib_x64.dll", EntryPoint="dx_LoadSoundMem", CallingConvention=CallingConvention.StdCall)]
extern static int dx_LoadSoundMem_x64( string FileName, int BufferNum, int UnionHandle);
public static int LoadSoundMem( string FileName)
{
if( System.IntPtr.Size == 4 )
{
return dx_LoadSoundMem_x86( FileName , 3 , -1 );
}
else
{
return dx_LoadSoundMem_x64( FileName , 3 , -1 );
}
}
public static int LoadSoundMem( string FileName, int BufferNum)
{
if( System.IntPtr.Size == 4 )
{
return dx_LoadSoundMem_x86( FileName , BufferNum , -1 );
}
else
{
return dx_LoadSoundMem_x64( FileName , BufferNum , -1 );
}
}
public static int LoadSoundMem( string FileName, int BufferNum, int UnionHandle)
{
if( System.IntPtr.Size == 4 )
{
return dx_LoadSoundMem_x86( FileName , BufferNum , UnionHandle );
}
else
{
return dx_LoadSoundMem_x64( FileName , BufferNum , UnionHandle );
}
}
HSPから使用するには、
sndHnd = LoadSoundMem( "ファイルパス", 3, -1 )
と記述するのが正しいのかと思われます。
BufferNumとUnionHandleがなんやねん…って感じですが。