Skip to content

Commit

Permalink
Add partial MipMap support
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed May 6, 2024
1 parent c383c82 commit 62b98cf
Show file tree
Hide file tree
Showing 21 changed files with 410 additions and 143 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 7005
#define BUILD_NUMBER 7006
2 changes: 1 addition & 1 deletion Dllmain/Dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ HMODULE LoadHookedDll(char *dllname, LoadProc Load, DWORD HookSystem32)
HMODULE hModule_dll = nullptr;

// Dll main function
bool APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpReserved)
BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpReserved)
{
UNREFERENCED_PARAMETER(lpReserved);

Expand Down
4 changes: 2 additions & 2 deletions IClassFactory/IClassFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "Settings\Settings.h"
#include "Logging\Logging.h"

DEFINE_GUID(IID_GetRealInterface, 0x254e1ffd, 0x10f9, 0x10c0, 0xc1, 0xb8, 0x21, 0x7d, 0x59, 0xd1, 0xe5, 0xb2);
DEFINE_GUID(IID_GetInterfaceX, 0x254e1ffd, 0x10f9, 0x10c0, 0xc1, 0xb8, 0x21, 0x7d, 0x59, 0xd1, 0xe5, 0xb4);
DEFINE_GUID(IID_GetRealInterface, 0x00000000, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0xff, 0xff);
DEFINE_GUID(IID_GetInterfaceX, 0x11111111, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0xff, 0xff);

typedef void(WINAPI *IQueryInterfaceProc)(REFIID, LPVOID *);
typedef HRESULT(WINAPI *CoCreateInstanceHandleProc)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID *ppv);
Expand Down
2 changes: 0 additions & 2 deletions ddraw/IDirect3DDeviceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,6 @@ HRESULT m_IDirect3DDeviceX::SetTexture(DWORD dwStage, LPDIRECTDRAWSURFACE7 lpSur
}
else
{
lpDDSrcSurfaceX = nullptr;

if (!CheckSurfaceExists(lpSurface))
{
LOG_LIMIT(100, __FUNCTION__ << " Error: could not find source surface! " << lpSurface);
Expand Down
10 changes: 10 additions & 0 deletions ddraw/IDirect3DTextureX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,23 @@ HRESULT m_IDirect3DTextureX::Load(LPDIRECT3DTEXTURE2 lpD3DTexture2)
return DDERR_GENERIC;
}

if (pSrcTextureX == this)
{
return D3D_OK;
}

m_IDirectDrawSurfaceX* pSrcSurfaceX = pSrcTextureX->GetSurface();
if (!pSrcSurfaceX)
{
LOG_LIMIT(100, __FUNCTION__ << " Error: could not get surface!");
return DDERR_GENERIC;
}

if (pSrcSurfaceX == DDrawSurface)
{
return D3D_OK;
}

IDirectDrawSurface7* pSrcSurface7 = (IDirectDrawSurface7*)pSrcSurfaceX->GetWrapperInterfaceX(7);
IDirectDrawSurface7* pDestSurface7 = (IDirectDrawSurface7*)DDrawSurface->GetWrapperInterfaceX(7);

Expand Down

0 comments on commit 62b98cf

Please sign in to comment.