Fix build errors caused by 'CreateTextureResource'

Moved declarations to source file; this is currently only used by the engine.
This commit is contained in:
Kawe Mazidjatari 2023-05-13 19:40:41 +02:00
parent 81182f078b
commit e468fa1065
2 changed files with 4 additions and 6 deletions

View File

@ -156,8 +156,10 @@ HRESULT __stdcall ResizeBuffers(IDXGISwapChain* pSwapChain, UINT nBufferCount, U
// Disable stack warning, tells us to move more data to the heap instead. Not really possible with 'initialData' here. Since its parallel processed.
// Also disable 6378, complains that there is no control path where it would use 'nullptr', if that happens 'Error' will be called though.
#pragma warning( disable : 6262 6387)
inline CMemory p_CreateTextureResource;
inline auto v_CreateTextureResource = p_CreateTextureResource.RCast<void(*)(TextureHeader_t*, INT_PTR)>();
constexpr uint32_t ALIGNMENT_SIZE = 15; // Creates 2D texture and shader resource from textureHeader and imageData.
void CreateTextureResource(TextureHeader_t* textureHeader, int64_t imageData)
void CreateTextureResource(TextureHeader_t* textureHeader, INT_PTR imageData)
{
if (textureHeader->m_nDepth && !textureHeader->m_nHeight) // Return never gets hit. Maybe its some debug check?
return;

View File

@ -10,7 +10,6 @@ void DirectX_Shutdown();
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
extern HRESULT __stdcall Present(IDXGISwapChain* pSwapChain, UINT nSyncInterval, UINT nFlags);
extern void CreateTextureResource(TextureHeader_t* textureHeader, int64_t imageData);
extern bool LoadTextureBuffer(unsigned char* buffer, int len, ID3D11ShaderResourceView** out_srv, int* out_width, int* out_height);
extern void ResetInput();
@ -21,9 +20,6 @@ extern bool PanelsVisible();
typedef HRESULT(__stdcall* IDXGISwapChainPresent)(IDXGISwapChain* pSwapChain, UINT nSyncInterval, UINT nFlags);
typedef HRESULT(__stdcall* IDXGIResizeBuffers) (IDXGISwapChain* pSwapChain, UINT nBufferCount, UINT nWidth, UINT nHeight, DXGI_FORMAT dxFormat, UINT nSwapChainFlags);
inline CMemory p_CreateTextureResource;
inline auto v_CreateTextureResource = p_CreateTextureResource.RCast<void(*)(TextureHeader_t*, int64_t)>();
/////////////////////////////////////////////////////////////////////////////
// Globals
inline UINT g_nWindowRect[2];
@ -117,7 +113,7 @@ inline IDXGISwapChain** g_ppSwapChain = nullptr;
class VDXGI : public IDetour
{
virtual void GetAdr(void) const;
virtual void GetFun(void) const { }
virtual void GetFun(void) const;
virtual void GetVar(void) const;
virtual void GetCon(void) const { }
virtual void Attach(void) const;