r5sdk/r5dev/codecs/bink/bink_impl.cpp

31 lines
918 B
C++

#include "core/stdafx.h"
#include "codecs/bink/bink_impl.h"
//-----------------------------------------------------------------------------
// Purpose: opens bik video by handle, and logs any error caused during loading
// Input : hBinkFile -
// nFlags -
// Output : pointer to bik video structure, null if failed
//-----------------------------------------------------------------------------
void* BinkOpen(HANDLE hBinkFile, UINT32 nFlags)
{
void* pHandle = v_BinkOpen(hBinkFile, nFlags);
if (!pHandle)
{
// Retrieve BinkOpen error using the DLL's exported function "BinkGetError()".
Error(eDLL_T::VIDEO, NO_ERROR, "%s: %s\n", __FUNCTION__, v_BinkGetError());
}
return pHandle;
}
///////////////////////////////////////////////////////////////////////////////
void BinkImpl_Attach()
{
DetourAttach(&v_BinkOpen, &BinkOpen);
}
void BinkImpl_Detach()
{
DetourDetach(&v_BinkOpen, &BinkOpen);
}