Skip to content

Commit 6526361

Browse files
committed
Minor fixes for CProxyDirect3DVertexBuffer
1 parent aa64592 commit 6526361

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Client/core/DXHook/CProxyDirect3DVertexBuffer.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
*
33
* PROJECT: Multi Theft Auto v1.0
44
* LICENSE: See LICENSE in the top level directory
5-
* FILE:
6-
* PURPOSE:
5+
* FILE: core/CProxyDirect3DVertexBuffer.cpp
6+
* PURPOSE: Direct3D 9 vertex buffer function hooking proxy
77
*
88
* Multi Theft Auto is available from https://www.multitheftauto.com/
99
*
@@ -86,15 +86,10 @@ HRESULT CProxyDirect3DVertexBuffer::QueryInterface(REFIID riid, void** ppvObj)
8686
ULONG CProxyDirect3DVertexBuffer::Release()
8787
{
8888
// Call original function
89-
ULONG count = m_pOriginal->Release();
90-
91-
if (count == 0)
92-
{
93-
// now, the Original Object has deleted itself, so do we here
94-
delete this; // destructor will be called automatically
95-
}
96-
97-
return count;
89+
ULONG ulRefCount = m_pOriginal->Release();
90+
if (ulRefCount == 0)
91+
delete this;
92+
return ulRefCount;
9893
}
9994

10095
/////////////////////////////////////////////////////////////

Client/core/DXHook/CProxyDirect3DVertexBuffer.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
*
33
* PROJECT: Multi Theft Auto v1.0
44
* LICENSE: See LICENSE in the top level directory
5-
* FILE:
6-
* PURPOSE:
5+
* FILE: core/CProxyDirect3DVertexBuffer.h
6+
* PURPOSE: Direct3D 9 vertex buffer function hooking proxy
77
*
88
* Multi Theft Auto is available from https://www.multitheftauto.com/
99
*
1010
*****************************************************************************/
1111

12+
#pragma once
13+
14+
#include <d3d9.h>
15+
#include "CProxyDirect3DDevice9.h" // Include full definition for SResourceMemory
16+
1217
DEFINE_GUID(CProxyDirect3DVertexBuffer_GUID, 0x128A025E, 0x0100, 0x04F1, 0x40, 0x60, 0x53, 0x19, 0x44, 0x56, 0x59, 0x42);
1318

1419
class CProxyDirect3DVertexBuffer : public IDirect3DVertexBuffer9
@@ -29,7 +34,7 @@ class CProxyDirect3DVertexBuffer : public IDirect3DVertexBuffer9
2934
HRESULT __stdcall FreePrivateData(REFGUID refguid) { return m_pOriginal->FreePrivateData(refguid); }
3035
DWORD __stdcall SetPriority(DWORD PriorityNew) { return m_pOriginal->SetPriority(PriorityNew); }
3136
DWORD __stdcall GetPriority() { return m_pOriginal->GetPriority(); }
32-
void __stdcall PreLoad() { return m_pOriginal->PreLoad(); }
37+
void __stdcall PreLoad() { m_pOriginal->PreLoad(); }
3338
D3DRESOURCETYPE __stdcall GetType() { return m_pOriginal->GetType(); }
3439

3540
/*** IDirect3DVertexBuffer9 methods ***/

0 commit comments

Comments
 (0)