Skip to content

Commit

Permalink
Updading some dll
Browse files Browse the repository at this point in the history
  • Loading branch information
Skulltrail192 committed Feb 13, 2021
1 parent e0e3da6 commit d357eb5
Show file tree
Hide file tree
Showing 48 changed files with 104,554 additions and 221 deletions.
4 changes: 2 additions & 2 deletions dll/directx/d3d9/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ BOOL GetAdapterInfo(LPCSTR lpszDeviceName, D3DADAPTER_IDENTIFIER9* pIdentifier)

AdapterIndex = 0;
FoundDisplayDevice = FALSE;
while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) == TRUE)
while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) != FALSE)
{
if (_stricmp(lpszDeviceName, DisplayDevice.DeviceName) == 0)
{
Expand All @@ -176,7 +176,7 @@ BOOL GetAdapterInfo(LPCSTR lpszDeviceName, D3DADAPTER_IDENTIFIER9* pIdentifier)
lstrcpynA(pIdentifier->Description, DisplayDevice.DeviceString, MAX_DEVICE_IDENTIFIER_STRING);
lstrcpynA(pIdentifier->DeviceName, DisplayDevice.DeviceName, CCHDEVICENAME);

if (GetDriverName(&DisplayDevice, pIdentifier) == TRUE)
if (GetDriverName(&DisplayDevice, pIdentifier) != FALSE)
GetDriverVersion(&DisplayDevice, pIdentifier);

GetDeviceId(DisplayDevice.DeviceID, pIdentifier);
Expand Down
4 changes: 2 additions & 2 deletions dll/directx/d3d9/d3d9_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static BOOL GetDisplayDeviceInfo(IN OUT LPDIRECT3D9_INT pDirect3D9)
D3D9_PrimaryDeviceName[0] = '\0';

AdapterIndex = 0;
while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) == TRUE &&
while ((EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) != FALSE) &&
pDirect3D9->NumDisplayAdapters < D3D9_INT_MAX_NUM_ADAPTERS)
{
if ((DisplayDevice.StateFlags & (DISPLAY_DEVICE_DISCONNECT | DISPLAY_DEVICE_MIRRORING_DRIVER)) == 0 &&
Expand All @@ -209,7 +209,7 @@ static BOOL GetDisplayDeviceInfo(IN OUT LPDIRECT3D9_INT pDirect3D9)
}

AdapterIndex = 0;
while (EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) == TRUE &&
while ((EnumDisplayDevicesA(NULL, AdapterIndex, &DisplayDevice, 0) != FALSE) &&
pDirect3D9->NumDisplayAdapters < D3D9_INT_MAX_NUM_ADAPTERS)
{
if ((DisplayDevice.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) != 0 &&
Expand Down
6 changes: 3 additions & 3 deletions dll/directx/d3d9/d3d9_haldevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/* IDirect3DDevice9 public interface */
HRESULT WINAPI IDirect3DDevice9HAL_GetTransform(LPDIRECT3DDEVICE9 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix)
{
UNIMPLEMENTED;
UNIMPLEMENTED

return D3D_OK;
}
Expand All @@ -37,14 +37,14 @@ HRESULT WINAPI IDirect3DDevice9HAL_GetMaterial(LPDIRECT3DDEVICE9 iface, D3DMATER

HRESULT WINAPI IDirect3DDevice9HAL_GetLight(LPDIRECT3DDEVICE9 iface, DWORD Index, D3DLIGHT9* pLight)
{
UNIMPLEMENTED;
UNIMPLEMENTED

return D3D_OK;
}

HRESULT WINAPI IDirect3DDevice9HAL_GetLightEnable(LPDIRECT3DDEVICE9 iface, DWORD Index, BOOL* pEnable)
{
UNIMPLEMENTED;
UNIMPLEMENTED

return D3D_OK;
}
Expand Down
1 change: 1 addition & 0 deletions dll/directx/d3d9/d3d9_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ HRESULT SafeFormatString(OUT LPSTR Buffer, IN DWORD BufferSize, IN LPCSTR Format

va_start(vargs, FormatString);
BytesWritten = _vsnprintf(Buffer, BufferSize-1, FormatString, vargs);
va_end(vargs);

if (BytesWritten < BufferSize)
return DDERR_GENERIC;
Expand Down
6 changes: 3 additions & 3 deletions dll/directx/d3d9/d3d9_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface, UINT Ada
return D3DERR_INVALIDCALL;
}

if (BackBufferFormat == D3DFMT_UNKNOWN &&
Windowed == TRUE)
if ((BackBufferFormat == D3DFMT_UNKNOWN) &&
(Windowed != FALSE))
{
BackBufferFormat = DisplayFormat;
}
Expand Down Expand Up @@ -595,7 +595,7 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9 iface, UINT A
}

pDriverCaps = &This->DisplayAdapters[Adapter].DriverCaps;
if ((Usage & D3DUSAGE_DYNAMIC) != 0 && bIsTextureRType == TRUE)
if (((Usage & D3DUSAGE_DYNAMIC) != 0) && (bIsTextureRType != FALSE))
{
if ((pDriverCaps->DriverCaps9.Caps2 & D3DCAPS2_DYNAMICTEXTURES) == 0)
{
Expand Down
211 changes: 0 additions & 211 deletions dll/directx/d3d9/d3d9_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,216 +11,12 @@
#include "d3d9_common.h"
#include <ddraw.h>
#include "d3d9_callbacks.h"
// #include "d3d9types.h"

#define D3D9_INT_MAX_NUM_ADAPTERS 12

#define D3D9_INT_D3DCAPS8_VALID 1
#define D3D9_INT_D3DCAPS9_VALID 2

typedef enum D3DQUERYTYPE {
D3DQUERYTYPE_VCACHE = 4,
D3DQUERYTYPE_ResourceManager = 5,
D3DQUERYTYPE_VERTEXSTATS = 6,
D3DQUERYTYPE_EVENT = 8,
D3DQUERYTYPE_OCCLUSION = 9,
D3DQUERYTYPE_TIMESTAMP = 10,
D3DQUERYTYPE_TIMESTAMPDISJOINT = 11,
D3DQUERYTYPE_TIMESTAMPFREQ = 12,
D3DQUERYTYPE_PIPELINETIMINGS = 13,
D3DQUERYTYPE_INTERFACETIMINGS = 14,
D3DQUERYTYPE_VERTEXTIMINGS = 15,
D3DQUERYTYPE_PIXELTIMINGS = 16,
D3DQUERYTYPE_BANDWIDTHTIMINGS = 17,
D3DQUERYTYPE_CACHEUTILIZATION = 18,
D3DQUERYTYPE_MEMORYPRESSURE = 19
} D3DQUERYTYPE, *LPD3DQUERYTYPE;

typedef enum _D3DFORMAT {
D3DFMT_UNKNOWN = 0,

D3DFMT_R8G8B8 = 20,
D3DFMT_A8R8G8B8 = 21,
D3DFMT_X8R8G8B8 = 22,
D3DFMT_R5G6B5 = 23,
D3DFMT_X1R5G5B5 = 24,
D3DFMT_A1R5G5B5 = 25,
D3DFMT_A4R4G4B4 = 26,
D3DFMT_R3G3B2 = 27,
D3DFMT_A8 = 28,
D3DFMT_A8R3G3B2 = 29,
D3DFMT_X4R4G4B4 = 30,
D3DFMT_A2B10G10R10 = 31,
D3DFMT_A8B8G8R8 = 32,
D3DFMT_X8B8G8R8 = 33,
D3DFMT_G16R16 = 34,
D3DFMT_A2R10G10B10 = 35,
D3DFMT_A16B16G16R16 = 36,

D3DFMT_A8P8 = 40,
D3DFMT_P8 = 41,

D3DFMT_L8 = 50,
D3DFMT_A8L8 = 51,
D3DFMT_A4L4 = 52,

D3DFMT_V8U8 = 60,
D3DFMT_L6V5U5 = 61,
D3DFMT_X8L8V8U8 = 62,
D3DFMT_Q8W8V8U8 = 63,
D3DFMT_V16U16 = 64,
D3DFMT_A2W10V10U10 = 67,

D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
D3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'),
D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
D3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'),
D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),

D3DFMT_D16_LOCKABLE = 70,
D3DFMT_D32 = 71,
D3DFMT_D15S1 = 73,
D3DFMT_D24S8 = 75,
D3DFMT_D24X8 = 77,
D3DFMT_D24X4S4 = 79,
D3DFMT_D16 = 80,

D3DFMT_D32F_LOCKABLE = 82,
D3DFMT_D24FS8 = 83,

#if !defined(D3D_DISABLE_9EX)
D3DFMT_D32_LOCKABLE = 84,
D3DFMT_S8_LOCKABLE = 85,
#endif // !D3D_DISABLE_9EX

D3DFMT_L16 = 81,

D3DFMT_VERTEXDATA =100,
D3DFMT_INDEX16 =101,
D3DFMT_INDEX32 =102,

D3DFMT_Q16W16V16U16 =110,

D3DFMT_MULTI2_ARGB8 = MAKEFOURCC('M','E','T','1'),

D3DFMT_R16F = 111,
D3DFMT_G16R16F = 112,
D3DFMT_A16B16G16R16F = 113,

D3DFMT_R32F = 114,
D3DFMT_G32R32F = 115,
D3DFMT_A32B32G32R32F = 116,

D3DFMT_CxV8U8 = 117,

#if !defined(D3D_DISABLE_9EX)
D3DFMT_A1 = 118,
D3DFMT_A2B10G10R10_XR_BIAS = 119,
D3DFMT_BINARYBUFFER = 199,
#endif // !D3D_DISABLE_9EX

D3DFMT_FORCE_DWORD =0x7fffffff
} D3DFORMAT;

typedef enum D3DDEVTYPE {
D3DDEVTYPE_HAL = 1,
D3DDEVTYPE_NULLREF = 4,
D3DDEVTYPE_REF = 2,
D3DDEVTYPE_SW = 3,
D3DDEVTYPE_FORCE_DWORD = 0xffffffff
} D3DDEVTYPE, *LPD3DDEVTYPE;

typedef struct _D3DPSHADERCAPS2_0 {
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
INT NumInstructionSlots;
} D3DPSHADERCAPS2_0;

typedef struct _D3DVSHADERCAPS2_0 {
DWORD Caps;
INT DynamicFlowControlDepth;
INT NumTemps;
INT StaticFlowControlDepth;
} D3DVSHADERCAPS2_0;

typedef struct _D3DCAPS9 {
D3DDEVTYPE DeviceType;
UINT AdapterOrdinal;
DWORD Caps;
DWORD Caps2;
DWORD Caps3;
DWORD PresentationIntervals;
DWORD CursorCaps;
DWORD DevCaps;
DWORD PrimitiveMiscCaps;
DWORD RasterCaps;
DWORD ZCmpCaps;
DWORD SrcBlendCaps;
DWORD DestBlendCaps;
DWORD AlphaCmpCaps;
DWORD ShadeCaps;
DWORD TextureCaps;
DWORD TextureFilterCaps;
DWORD CubeTextureFilterCaps;
DWORD VolumeTextureFilterCaps;
DWORD TextureAddressCaps;
DWORD VolumeTextureAddressCaps;
DWORD LineCaps;
DWORD MaxTextureWidth;
DWORD MaxTextureHeight;
DWORD MaxVolumeExtent;
DWORD MaxTextureRepeat;
DWORD MaxTextureAspectRatio;
DWORD MaxAnisotropy;
float MaxVertexW;
float GuardBandLeft;
float GuardBandTop;
float GuardBandRight;
float GuardBandBottom;
float ExtentsAdjust;
DWORD StencilCaps;
DWORD FVFCaps;
DWORD TextureOpCaps;
DWORD MaxTextureBlendStages;
DWORD MaxSimultaneousTextures;
DWORD VertexProcessingCaps;
DWORD MaxActiveLights;
DWORD MaxUserClipPlanes;
DWORD MaxVertexBlendMatrices;
DWORD MaxVertexBlendMatrixIndex;
float MaxPointSize;
DWORD MaxPrimitiveCount;
DWORD MaxVertexIndex;
DWORD MaxStreams;
DWORD MaxStreamStride;
DWORD VertexShaderVersion;
DWORD MaxVertexShaderConst;
DWORD PixelShaderVersion;
float PixelShader1xMaxValue;
DWORD DevCaps2;
float MaxNpatchTessellationLevel;
DWORD Reserved5;
UINT MasterAdapterOrdinal;
UINT AdapterOrdinalInGroup;
UINT NumberOfAdaptersInGroup;
DWORD DeclTypes;
DWORD NumSimultaneousRTs;
DWORD StretchRectFilterCaps;
D3DVSHADERCAPS2_0 VS20Caps;
D3DPSHADERCAPS2_0 PS20Caps;
DWORD VertexTextureFilterCaps;
DWORD MaxVShaderInstructionsExecuted;
DWORD MaxPShaderInstructionsExecuted;
DWORD MaxVertexShader30InstructionSlots;
DWORD MaxPixelShader30InstructionSlots;
} D3DCAPS9;

typedef struct _D3D9_Unknown6BC
{
/* 0x0000 */ HANDLE hDirectDrawLocal;
Expand Down Expand Up @@ -267,13 +63,6 @@ typedef struct _D3D9_Unknown6BC
/* 0x00BC */ DDGAMMARAMP GammaRamp;
} D3D9_Unknown6BC;

typedef struct D3DDISPLAYMODE {
UINT Width;
UINT Height;
UINT RefreshRate;
D3DFORMAT Format;
} D3DDISPLAYMODE, *LPD3DDISPLAYMODE;

typedef struct _D3D9_DRIVERCAPS
{
/* 0x0000 */ D3DCAPS9 DriverCaps9;
Expand Down
56 changes: 56 additions & 0 deletions wrappers/directx/d3dwine_wrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

add_definitions(
-D__WINESRC__
-D_USE_MATH_DEFINES
-DUSE_WIN32_OPENGL
-DSTAGING_CSMT
-Dcopysignf=_copysignf)

include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)

# We name this d3dwine.dll, because the Virtualbox additions ship with a custom wined3d.dll
# and it breaks everything if it is installed.
spec2def(d3dwine.dll wined3d.spec ADD_IMPORTLIB)

list(APPEND SOURCE
adapter_gl.c
adapter_vk.c
arb_program_shader.c
ati_fragment_shader.c
buffer.c
context.c
cs.c
device.c
directx.c
dxtn.c
gl_compat.c
glsl_shader.c
nvidia_texture_shader.c
palette.c
query.c
resource.c
sampler.c
shader.c
shader_sm1.c
shader_sm4.c
state.c
stateblock.c
surface.c
swapchain.c
texture.c
utils.c
vertexdeclaration.c
view.c
wined3d_main.c
precomp.h)

add_library(d3dwine SHARED
${SOURCE}
version.rc
${CMAKE_CURRENT_BINARY_DIR}/d3dwine.def)

set_module_type(d3dwine win32dll)
target_link_libraries(d3dwine wine)
add_importlibs(d3dwine user32 opengl32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_pch(d3dwine precomp.h SOURCE)
add_cd_file(TARGET d3dwine DESTINATION reactos/system32 FOR all)
Loading

0 comments on commit d357eb5

Please sign in to comment.