Skip to content

Commit

Permalink
Change some function types
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Dec 10, 2024
1 parent 49eb9f3 commit bb25e7f
Show file tree
Hide file tree
Showing 16 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7372
#define BUILD_NUMBER 7373
6 changes: 3 additions & 3 deletions ddraw/IDirect3DDeviceX.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ class m_IDirect3DDeviceX : public IUnknown, public AddressLookupTableDdrawObject
void *GetWrapperInterfaceX(DWORD DirectXVersion);
ULONG AddRef(DWORD DirectXVersion);
ULONG Release(DWORD DirectXVersion);
bool IsDeviceInScene() { return IsInScene; }
bool IsDeviceInScene() const { return IsInScene; }

// Viewport functions
inline void GetDefaultViewport(D3DVIEWPORT9& Viewport) { Viewport = DefaultViewport; }
inline void GetDefaultViewport(D3DVIEWPORT9& Viewport) const { Viewport = DefaultViewport; }
inline bool CheckIfViewportSet(m_IDirect3DViewportX* pViewport) { return (pViewport == lpCurrentViewportX); }

// Texture handle function
Expand All @@ -303,7 +303,7 @@ class m_IDirect3DDeviceX : public IUnknown, public AddressLookupTableDdrawObject
// Material handle function
void ReleaseMaterialHandle(m_IDirect3DMaterialX* lpMaterial);
HRESULT SetMaterialHandle(D3DMATERIALHANDLE mHandle, m_IDirect3DMaterialX* lpMaterial);
inline bool CheckIfMaterialSet(D3DMATERIALHANDLE mHandle) { return (mHandle == lsMaterialHandle); }
inline bool CheckIfMaterialSet(D3DMATERIALHANDLE mHandle) const { return (mHandle == lsMaterialHandle); }

// Light index function
void ReleaseLightInterface(m_IDirect3DLight* lpLight);
Expand Down
2 changes: 1 addition & 1 deletion ddraw/IDirect3DExecuteBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {
m_IDirect3DExecuteBuffer* WrapperInterfaceBackup = nullptr;
}

inline void SaveInterfaceAddress(m_IDirect3DExecuteBuffer* Interface, m_IDirect3DExecuteBuffer*& InterfaceBackup)
inline static void SaveInterfaceAddress(m_IDirect3DExecuteBuffer* Interface, m_IDirect3DExecuteBuffer*& InterfaceBackup)
{
if (Interface)
{
Expand Down
2 changes: 1 addition & 1 deletion ddraw/IDirect3DLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {
m_IDirect3DLight* WrapperInterfaceBackup = nullptr;
}

inline void SaveInterfaceAddress(m_IDirect3DLight* Interface, m_IDirect3DLight*& InterfaceBackup)
inline static void SaveInterfaceAddress(m_IDirect3DLight* Interface, m_IDirect3DLight*& InterfaceBackup)
{
if (Interface)
{
Expand Down
4 changes: 2 additions & 2 deletions ddraw/IDirect3DVertexBufferX.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class m_IDirect3DVertexBufferX : public IDirect3DVertexBuffer7, public AddressLo
void ClearDdraw() { ddrawParent = nullptr; d3d9Device = nullptr; }

// Direct3D9 interfaces
LPDIRECT3DVERTEXBUFFER9 GetCurrentD9VertexBuffer() { return d3d9VertexBuffer; };
const LPDIRECT3DVERTEXBUFFER9 GetCurrentD9VertexBuffer() const { return d3d9VertexBuffer; };
void ReleaseD9Buffer(bool BackupData, bool ResetBuffer);

DWORD GetFVF9() { return d3d9VBDesc.FVF; };
DWORD GetFVF9() const { return d3d9VBDesc.FVF; };
};
2 changes: 1 addition & 1 deletion ddraw/IDirectDrawClipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace {
m_IDirectDrawClipper* WrapperInterfaceBackup = nullptr;
}

inline void SaveInterfaceAddress(m_IDirectDrawClipper* Interface, m_IDirectDrawClipper*& InterfaceBackup)
inline static void SaveInterfaceAddress(m_IDirectDrawClipper* Interface, m_IDirectDrawClipper*& InterfaceBackup)
{
if (Interface)
{
Expand Down
2 changes: 1 addition & 1 deletion ddraw/IDirectDrawColorControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {
m_IDirectDrawColorControl* WrapperInterfaceBackup = nullptr;
}

inline void SaveInterfaceAddress(m_IDirectDrawColorControl* Interface, m_IDirectDrawColorControl*& InterfaceBackup)
inline static void SaveInterfaceAddress(m_IDirectDrawColorControl* Interface, m_IDirectDrawColorControl*& InterfaceBackup)
{
if (Interface)
{
Expand Down
2 changes: 1 addition & 1 deletion ddraw/IDirectDrawGammaControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {
m_IDirectDrawGammaControl* WrapperInterfaceBackup = nullptr;
}

inline void SaveInterfaceAddress(m_IDirectDrawGammaControl* Interface, m_IDirectDrawGammaControl*& InterfaceBackup)
inline static void SaveInterfaceAddress(m_IDirectDrawGammaControl* Interface, m_IDirectDrawGammaControl*& InterfaceBackup)
{
if (Interface)
{
Expand Down
2 changes: 1 addition & 1 deletion ddraw/IDirectDrawPalette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace {
m_IDirectDrawPalette* WrapperInterfaceBackup = nullptr;
}

inline void SaveInterfaceAddress(m_IDirectDrawPalette* Interface, m_IDirectDrawPalette*& InterfaceBackup)
inline static void SaveInterfaceAddress(m_IDirectDrawPalette* Interface, m_IDirectDrawPalette*& InterfaceBackup)
{
if (Interface)
{
Expand Down
8 changes: 4 additions & 4 deletions ddraw/IDirectDrawPalette.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ class m_IDirectDrawPalette : public IDirectDrawPalette, public AddressLookupTabl
inline void ClearDdraw() { ddrawParent = nullptr; }

// Helper functions
inline LPPALETTEENTRY GetPaletteEntries() { return rawPalette; }
inline RGBQUAD* GetRGBPalette() { return rgbPalette; }
inline DWORD GetPaletteUSN() { return PaletteUSN; }
inline DWORD GetEntryCount() { return entryCount; }
inline const PALETTEENTRY* GetPaletteEntries() const { return rawPalette; }
inline const RGBQUAD* GetRGBPalette() const { return rgbPalette; }
inline DWORD GetPaletteUSN() const { return PaletteUSN; }
inline DWORD GetEntryCount() const { return entryCount; }
inline void SetPrimary() { paletteCaps |= DDPCAPS_PRIMARYSURFACE; }
inline void RemovePrimary() { paletteCaps &= ~DDPCAPS_PRIMARYSURFACE; }
};
10 changes: 5 additions & 5 deletions ddraw/IDirectDrawSurfaceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5830,7 +5830,7 @@ void m_IDirectDrawSurfaceX::UnlockEmuLock()
}

// Restore removed scanlines before locking surface
void m_IDirectDrawSurfaceX::RestoreScanlines(LASTLOCK& LLock)
void m_IDirectDrawSurfaceX::RestoreScanlines(LASTLOCK& LLock) const
{
DWORD ByteCount = surface.BitCount / 8;
DWORD RectWidth = LLock.Rect.right - LLock.Rect.left;
Expand Down Expand Up @@ -5872,7 +5872,7 @@ void m_IDirectDrawSurfaceX::RestoreScanlines(LASTLOCK& LLock)
}

// Remove scanlines before unlocking surface
void m_IDirectDrawSurfaceX::RemoveScanlines(LASTLOCK& LLock)
void m_IDirectDrawSurfaceX::RemoveScanlines(LASTLOCK& LLock) const
{
DWORD ByteCount = surface.BitCount / 8;
DWORD RectWidth = LLock.Rect.right - LLock.Rect.left;
Expand Down Expand Up @@ -5972,7 +5972,7 @@ void m_IDirectDrawSurfaceX::RemoveScanlines(LASTLOCK& LLock)
}
}

inline HRESULT m_IDirectDrawSurfaceX::LockEmulatedSurface(D3DLOCKED_RECT* pLockedRect, LPRECT lpDestRect)
inline HRESULT m_IDirectDrawSurfaceX::LockEmulatedSurface(D3DLOCKED_RECT* pLockedRect, LPRECT lpDestRect) const
{
if (!pLockedRect)
{
Expand Down Expand Up @@ -7858,8 +7858,8 @@ void m_IDirectDrawSurfaceX::UpdatePaletteData()
}

DWORD NewPaletteUSN = 0;
LPPALETTEENTRY NewPaletteEntry = nullptr;
RGBQUAD* NewRGBPalette = nullptr;
const PALETTEENTRY* NewPaletteEntry = nullptr;
const RGBQUAD* NewRGBPalette = nullptr;

SetCriticalSection();

Expand Down
86 changes: 43 additions & 43 deletions ddraw/IDirectDrawSurfaceX.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class m_IDirectDrawSurfaceX : public IUnknown, public AddressLookupTableDdrawObj
D3DMULTISAMPLE_TYPE MultiSampleType = D3DMULTISAMPLE_NONE;
DWORD MultiSampleQuality = 0;
DWORD LastPaletteUSN = 0; // The USN that was used last time the palette was updated
LPPALETTEENTRY PaletteEntryArray = nullptr; // Used to store palette data address
const PALETTEENTRY* PaletteEntryArray = nullptr; // Used to store palette data address
EMUSURFACE* emu = nullptr; // Emulated surface using device context
LPDIRECT3DSURFACE9 Surface = nullptr; // Surface used for Direct3D
LPDIRECT3DSURFACE9 Shadow = nullptr; // Shadow surface for render target
Expand Down Expand Up @@ -287,28 +287,28 @@ class m_IDirectDrawSurfaceX : public IUnknown, public AddressLookupTableDdrawObj
return CheckCoordinates(Rect, lpInRect, &surfaceDesc2);
}
bool CheckCoordinates(RECT& OutRect, LPRECT lpInRect, LPDDSURFACEDESC2 lpDDSurfaceDesc2);
HRESULT LockEmulatedSurface(D3DLOCKED_RECT* pLockedRect, LPRECT lpDestRect);
HRESULT LockEmulatedSurface(D3DLOCKED_RECT* pLockedRect, LPRECT lpDestRect) const;
bool CheckRectforSkipScene(RECT& DestRect);
HRESULT PresentOverlay(LPRECT lpSrcRect);
void BeginWritePresent(bool IsSkipScene);
void EndWritePresent(LPRECT lpDestRect, bool WriteToWindow, bool FullPresent, bool IsSkipScene);
void EndWriteSyncSurfaces(LPRECT lpDestRect);

// Surface information functions
inline bool IsSurfaceLocked(bool CheckLocking = true) { return (IsLocked || (CheckLocking && IsLocking)); }
inline bool IsSurfaceBlitting() { return (IsInBlt || IsInBltBatch); }
inline bool IsSurfaceInDC(bool CheckGettingDC = true) { return (IsInDC || (CheckGettingDC && IsPreparingDC)); }
inline bool IsSurfaceBusy(bool CheckLocking = true, bool CheckGettingDC = true) { return (IsSurfaceBlitting() || IsSurfaceLocked(CheckLocking) || IsSurfaceInDC(CheckGettingDC)); }
inline bool IsD9UsingVideoMemory() { return ((surface.Surface || surface.Texture) ? surface.Pool == D3DPOOL_DEFAULT : false); }
inline bool IsUsingShadowSurface() { return (surface.UsingShadowSurface && surface.Shadow); }
inline bool IsLockedFromOtherThread() { return (IsSurfaceBlitting() || IsSurfaceLocked()) && LockedWithID && LockedWithID != GetCurrentThreadId(); }
inline bool IsSurfaceLocked(bool CheckLocking = true) const { return (IsLocked || (CheckLocking && IsLocking)); }
inline bool IsSurfaceBlitting() const { return (IsInBlt || IsInBltBatch); }
inline bool IsSurfaceInDC(bool CheckGettingDC = true) const { return (IsInDC || (CheckGettingDC && IsPreparingDC)); }
inline bool IsSurfaceBusy(bool CheckLocking = true, bool CheckGettingDC = true) const { return (IsSurfaceBlitting() || IsSurfaceLocked(CheckLocking) || IsSurfaceInDC(CheckGettingDC)); }
inline bool IsD9UsingVideoMemory() const { return ((surface.Surface || surface.Texture) ? surface.Pool == D3DPOOL_DEFAULT : false); }
inline bool IsUsingShadowSurface() const { return (surface.UsingShadowSurface && surface.Shadow); }
inline bool IsLockedFromOtherThread() const { return (IsSurfaceBlitting() || IsSurfaceLocked()) && LockedWithID && LockedWithID != GetCurrentThreadId(); }
inline bool IsDummyMipMap(DWORD MipMapLevel) { return (MipMapLevel > MaxMipMapLevel || ((MipMapLevel & ~DXW_IS_MIPMAP_DUMMY) - 1 < MipMaps.size() && MipMaps[(MipMapLevel & ~DXW_IS_MIPMAP_DUMMY) - 1].IsDummy)); }
inline DWORD GetD3d9MipMapLevel(DWORD MipMapLevel) { return min(MipMapLevel, MaxMipMapLevel); }
inline DWORD GetWidth() { return surfaceDesc2.dwWidth; }
inline DWORD GetHeight() { return surfaceDesc2.dwHeight; }
inline bool CanSurfaceBeDeleted() { return (ComplexRoot || (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_COMPLEX) == 0); }
inline DDSCAPS2 GetSurfaceCaps() { return surfaceDesc2.ddsCaps; }
inline D3DFORMAT GetSurfaceFormat() { return surface.Format; }
inline DWORD GetD3d9MipMapLevel(DWORD MipMapLevel) const { return min(MipMapLevel, MaxMipMapLevel); }
inline DWORD GetWidth() const { return surfaceDesc2.dwWidth; }
inline DWORD GetHeight() const { return surfaceDesc2.dwHeight; }
inline bool CanSurfaceBeDeleted() const { return (ComplexRoot || (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_COMPLEX) == 0); }
inline DDSCAPS2 GetSurfaceCaps() const { return surfaceDesc2.ddsCaps; }
inline D3DFORMAT GetSurfaceFormat() const { return surface.Format; }

void SetDirtyFlag(DWORD MipMapLevel);

Expand Down Expand Up @@ -460,8 +460,8 @@ class m_IDirectDrawSurfaceX : public IUnknown, public AddressLookupTableDdrawObj
void UnlockEmuLock();

// For removing scanlines
void RestoreScanlines(LASTLOCK &LLock);
void RemoveScanlines(LASTLOCK &LLock);
void RestoreScanlines(LASTLOCK &LLock) const;
void RemoveScanlines(LASTLOCK &LLock) const;

// Functions handling the ddraw parent interface
inline void SetDdrawParent(m_IDirectDrawX *ddraw) { ddrawParent = ddraw; }
Expand All @@ -475,31 +475,31 @@ class m_IDirectDrawSurfaceX : public IUnknown, public AddressLookupTableDdrawObj
void ResetSurfaceDisplay();

// Surface information functions
inline bool IsPrimarySurface() { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) != 0; }
inline bool IsBackBuffer() { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) != 0; }
inline bool IsPrimaryOrBackBuffer() { return (IsPrimarySurface() || IsBackBuffer()); }
inline bool IsRenderTarget() { return surface.CanBeRenderTarget; }
inline bool IsFlipSurface() { return ((surfaceDesc2.ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_FRONTBUFFER)) == (DDSCAPS_FLIP | DDSCAPS_FRONTBUFFER)); }
inline bool IsSurface3D() { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_3DDEVICE) != 0; }
inline bool IsSurfaceTexture() { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_TEXTURE) != 0; }
inline bool IsColorKeyTexture() { return (IsSurfaceTexture() && (surfaceDesc2.dwFlags & DDSD_CKSRCBLT)); }
inline bool IsPalette() { return (surface.Format == D3DFMT_P8); }
inline bool IsDepthStencil() { return (surfaceDesc2.ddpfPixelFormat.dwFlags & (DDPF_ZBUFFER | DDPF_STENCILBUFFER)) != 0; }
inline bool IsSurfaceManaged() { return (surfaceDesc2.ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE)) != 0; }
inline bool CanSurfaceUseEmulation()
inline bool IsPrimarySurface() const { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) != 0; }
inline bool IsBackBuffer() const { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_BACKBUFFER) != 0; }
inline bool IsPrimaryOrBackBuffer() const { return (IsPrimarySurface() || IsBackBuffer()); }
inline bool IsRenderTarget() const { return surface.CanBeRenderTarget; }
inline bool IsFlipSurface() const { return ((surfaceDesc2.ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_FRONTBUFFER)) == (DDSCAPS_FLIP | DDSCAPS_FRONTBUFFER)); }
inline bool IsSurface3D() const { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_3DDEVICE) != 0; }
inline bool IsSurfaceTexture() const { return (surfaceDesc2.ddsCaps.dwCaps & DDSCAPS_TEXTURE) != 0; }
inline bool IsColorKeyTexture() const { return (IsSurfaceTexture() && (surfaceDesc2.dwFlags & DDSD_CKSRCBLT)); }
inline bool IsPalette() const { return (surface.Format == D3DFMT_P8); }
inline bool IsDepthStencil() const { return (surfaceDesc2.ddpfPixelFormat.dwFlags & (DDPF_ZBUFFER | DDPF_STENCILBUFFER)) != 0; }
inline bool IsSurfaceManaged() const { return (surfaceDesc2.ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE)) != 0; }
inline bool CanSurfaceUseEmulation() const
{ return ((IsPixelFormatRGB(surfaceDesc2.ddpfPixelFormat) || IsPixelFormatPalette(surfaceDesc2.ddpfPixelFormat)) && (!IsSurface3D() || !Using3D) && !surface.UsingSurfaceMemory); }
inline bool IsUsingEmulation() { return (surface.emu && surface.emu->DC && surface.emu->GameDC && surface.emu->pBits); }
inline bool IsEmulationDCReady() { return (IsUsingEmulation() && !surface.emu->UsingGameDC); }
inline bool IsSurfaceDirty() { return surface.IsDirtyFlag; }
inline bool IsMipMapAutogen() { return surface.Texture && (surface.Usage & D3DUSAGE_AUTOGENMIPMAP); }
inline bool IsMipMapGenerated() { return IsMipMapReadyToUse || IsMipMapAutogen(); }
inline bool IsUsingEmulation() const { return (surface.emu && surface.emu->DC && surface.emu->GameDC && surface.emu->pBits); }
inline bool IsEmulationDCReady() const { return (IsUsingEmulation() && !surface.emu->UsingGameDC); }
inline bool IsSurfaceDirty() const { return surface.IsDirtyFlag; }
inline bool IsMipMapAutogen() const { return surface.Texture && (surface.Usage & D3DUSAGE_AUTOGENMIPMAP); }
inline bool IsMipMapGenerated() const { return IsMipMapReadyToUse || IsMipMapAutogen(); }
inline void FixTextureFlags(LPDDSURFACEDESC2 lpDDSurfaceDesc2);
void PrepareRenderTarget();
void ClearDirtyFlags();
bool GetColorKeyForShader(float(&lowColorKey)[4], float(&highColorKey)[4]);
bool GetColorKeyForPrimaryShader(float(&lowColorKey)[4], float(&highColorKey)[4]);
bool GetWasBitAlignLocked() { return WasBitAlignLocked; }
inline bool GetSurfaceSetSize(DWORD& Width, DWORD& Height)
bool GetWasBitAlignLocked() const { return WasBitAlignLocked; }
inline bool GetSurfaceSetSize(DWORD& Width, DWORD& Height) const
{
if ((surfaceDesc2.dwFlags & (DDSD_WIDTH | DDSD_HEIGHT)) == (DDSD_WIDTH | DDSD_HEIGHT) &&
(ResetDisplayFlags & (DDSD_WIDTH | DDSD_HEIGHT)) == 0 &&
Expand All @@ -516,19 +516,19 @@ class m_IDirectDrawSurfaceX : public IUnknown, public AddressLookupTableDdrawObj
LPDIRECT3DTEXTURE9 GetD3d9DrawTexture();
LPDIRECT3DTEXTURE9 GetD3d9Texture();
HRESULT GenerateMipMapLevels();
inline DWORD GetD3d9Width() { return surface.Width; }
inline DWORD GetD3d9Height() { return surface.Height; }
inline D3DFORMAT GetD3d9Format() { return surface.Format; }
inline LPDIRECT3DTEXTURE9 GetD3d9PaletteTexture() { return primary.PaletteTexture; }
inline DWORD GetD3d9Width() const { return surface.Width; }
inline DWORD GetD3d9Height() const { return surface.Height; }
inline D3DFORMAT GetD3d9Format() const { return surface.Format; }
inline LPDIRECT3DTEXTURE9 GetD3d9PaletteTexture() const { return primary.PaletteTexture; }
inline m_IDirect3DTextureX* GetAttachedTexture() { return attached3DTexture; }
inline void ClearAttachedTexture() { attached3DTexture = nullptr; }
void ClearUsing3DFlag();
HRESULT GetPresentWindowRect(LPRECT pRect, RECT& DestRect);

// For Present checking
inline bool ShouldReadFromGDI() { return (Config.DdrawReadFromGDI && IsPrimarySurface() && IsUsingEmulation() && !Using3D); }
inline bool ShouldWriteToGDI() { return (Config.DdrawWriteToGDI && IsPrimarySurface() && IsUsingEmulation() && !Using3D); }
inline bool ShouldPresentToWindow(bool IsPresenting)
inline bool ShouldReadFromGDI() const { return (Config.DdrawReadFromGDI && IsPrimarySurface() && IsUsingEmulation() && !Using3D); }
inline bool ShouldWriteToGDI() const { return (Config.DdrawWriteToGDI && IsPrimarySurface() && IsUsingEmulation() && !Using3D); }
inline bool ShouldPresentToWindow(bool IsPresenting) const
{
return (surface.IsUsingWindowedMode && (IsPresenting ? (IsPrimarySurface() && !IsRenderTarget()) : IsPrimaryOrBackBuffer()) && !Config.DdrawWriteToGDI);
}
Expand Down
2 changes: 1 addition & 1 deletion ddraw/IDirectDrawTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ DWORD GetSurfaceSize(D3DFORMAT Format, DWORD Width, DWORD Height, INT Pitch)
}

// Count leading zeros and total number of bits
inline void CountBits(DWORD value, DWORD& LeadingZeros, DWORD& TotalBits)
inline static void CountBits(DWORD value, DWORD& LeadingZeros, DWORD& TotalBits)
{
LeadingZeros = 0;
while (value && !(value & 1))
Expand Down
4 changes: 2 additions & 2 deletions ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ std::chrono::steady_clock::time_point presentTime;
// Preset from another thread
PRESENTTHREAD PresentThread;

inline void SetPTCriticalSection()
inline static void SetPTCriticalSection()
{
if (PresentThread.IsInitialized)
{
EnterCriticalSection(&PresentThread.ddpt);
}
}

inline void ReleasePTCriticalSection()
inline static void ReleasePTCriticalSection()
{
if (PresentThread.IsInitialized)
{
Expand Down
2 changes: 1 addition & 1 deletion ddraw/IDirectDrawX.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class m_IDirectDrawX : public IUnknown, public AddressLookupTableDdrawObject
inline m_IDirect3DDeviceX** GetCurrentD3DDevice() { return &D3DDeviceInterface; }
void ClearD3DDevice();
inline void Enable3D() { Using3D = true; }
inline bool IsUsing3D() { return Using3D; }
inline bool IsUsing3D() const { return Using3D; }
inline bool IsPrimaryRenderTarget() { return PrimarySurface ? PrimarySurface->IsRenderTarget() : false; }
bool IsInScene();

Expand Down
6 changes: 3 additions & 3 deletions ddraw/ddraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void ExitDDraw()

// Sets Application Compatibility Toolkit options for DXPrimaryEmulation using SetAppCompatData API
// http://web.archive.org/web/20170418171908/http://www.blitzbasic.com/Community/posts.php?topic=99477
void SetAllAppCompatData()
static void SetAllAppCompatData()
{
DEFINE_STATIC_PROC_ADDRESS(SetAppCompatDataProc, SetAppCompatData, SetAppCompatData_out);

Expand Down Expand Up @@ -461,7 +461,7 @@ HRESULT WINAPI dd_DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID ri
return hr;
}

BOOL CALLBACK DispayEnumeratorProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
static BOOL CALLBACK DispayEnumeratorProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
{
UNREFERENCED_PARAMETER(hdcMonitor);
UNREFERENCED_PARAMETER(lprcMonitor);
Expand Down Expand Up @@ -490,7 +490,7 @@ BOOL CALLBACK DispayEnumeratorProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lpr
return DDENUMRET_OK;
}

HRESULT DirectDrawEnumerateHandler(LPVOID lpCallback, LPVOID lpContext, DWORD dwFlags, DirectDrawEnumerateTypes DDETType)
static HRESULT DirectDrawEnumerateHandler(LPVOID lpCallback, LPVOID lpContext, DWORD dwFlags, DirectDrawEnumerateTypes DDETType)
{
UNREFERENCED_PARAMETER(dwFlags);

Expand Down

0 comments on commit bb25e7f

Please sign in to comment.