From e468fa1065eb82470bef258ee8017360356a39e7 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 13 May 2023 19:40:41 +0200 Subject: [PATCH] Fix build errors caused by 'CreateTextureResource' Moved declarations to source file; this is currently only used by the engine. --- r5dev/windows/id3dx.cpp | 4 +++- r5dev/windows/id3dx.h | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/r5dev/windows/id3dx.cpp b/r5dev/windows/id3dx.cpp index b3771552..77624426 100644 --- a/r5dev/windows/id3dx.cpp +++ b/r5dev/windows/id3dx.cpp @@ -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(); 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; diff --git a/r5dev/windows/id3dx.h b/r5dev/windows/id3dx.h index bdb6a8c0..a151837f 100644 --- a/r5dev/windows/id3dx.h +++ b/r5dev/windows/id3dx.h @@ -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(); - ///////////////////////////////////////////////////////////////////////////// // 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;