Skip to content

Commit

Permalink
[SDK][WINED3D] Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFire01 committed Sep 18, 2023
1 parent c29517b commit 5dd8024
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 6 deletions.
5 changes: 5 additions & 0 deletions dll/directx/wine/ddraw/ddraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DW

/* TODO: The possible return values from msdn suggest that the screen mode
* can't be changed if a surface is locked or some drawing is in progress. */

if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &mode)))
{
if (ddraw->primary)
Expand All @@ -1162,6 +1163,10 @@ static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DW
ddrawformat_from_wined3dformat(&ddraw->primary->surface_desc.u4.ddpfPixelFormat, mode.format_id);
}
ddraw->flags |= DDRAW_RESTORE_MODE;

if (ddraw->cooperative_level & DDSCL_EXCLUSIVE)
SetWindowPos(ddraw->dest_window, HWND_TOP, 0, 0, width, height, SWP_SHOWWINDOW | SWP_NOACTIVATE);
TRACE("DirectDraw window has been resized\n");
}

InterlockedCompareExchange(&ddraw->device_state, DDRAW_DEVICE_STATE_NOT_RESTORED, DDRAW_DEVICE_STATE_OK);
Expand Down
9 changes: 8 additions & 1 deletion dll/directx/wine/wined3d/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -5657,11 +5657,18 @@ void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl,
wined3d_context_gl_unload_vertex_data(context_gl);
wined3d_context_gl_unload_numbered_arrays(context_gl);

#ifdef __REACTOS__
GL_EXTCALL(glBufferData(GL_ARRAY_BUFFER, sizeof(quad), quad, GL_STREAM_DRAW));
GL_EXTCALL(glVertexAttribPointer(0, 2, GL_FLOAT, FALSE, sizeof(*quad), NULL));
GL_EXTCALL(glVertexAttribPointer(1, 3, GL_FLOAT, FALSE, sizeof(*quad),
(void *)FIELD_OFFSET(struct blit_vertex, texcoord)));
(void *)(ULONG_PTR)FIELD_OFFSET(struct blit_vertex, texcoord)));

#else
GL_EXTCALL(glBufferData(GL_ARRAY_BUFFER, sizeof(quad), quad, GL_STREAM_DRAW));
GL_EXTCALL(glVertexAttribPointer(0, 2, GL_FLOAT, FALSE, sizeof(*quad), NULL));
GL_EXTCALL(glVertexAttribPointer(1, 3, GL_FLOAT, FALSE, sizeof(*quad),
(void *)FIELD_OFFSET(struct blit_vertex, texcoord)));
#endif
GL_EXTCALL(glEnableVertexAttribArray(0));
GL_EXTCALL(glEnableVertexAttribArray(1));

Expand Down
2 changes: 1 addition & 1 deletion dll/directx/wine/wined3d/glsl_shader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ static void shader_glsl_load_np2fixup_constants(const struct glsl_ps_program *ps
GL_EXTCALL(glUniform4fv(ps->np2_fixup_location, ps->np2_fixup_info->num_consts, &np2fixup_constants[0].sx));
}

static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m)
void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m)
{
struct wined3d_matrix temp;
unsigned int i, j;
Expand Down
3 changes: 3 additions & 0 deletions dll/directx/wine/wined3d/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,8 @@ static const struct wined3d_query_ops statistics_query_ops =
wined3d_statistics_query_ops_destroy,
};

#ifdef __REACTOS__
#else
static HRESULT wined3d_statistics_query_create(struct wined3d_device *device,
enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_query **query)
Expand All @@ -1380,6 +1382,7 @@ static HRESULT wined3d_statistics_query_create(struct wined3d_device *device,

return WINED3D_OK;
}
#endif

static void wined3d_overflow_query_ops_destroy(struct wined3d_query *query)
{
Expand Down
4 changes: 2 additions & 2 deletions dll/directx/wine/wined3d/shader_sm4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ static HRESULT parse_dxbc(const char *data, SIZE_T data_size,
return hr;
}

static const char *shader_get_string(const char *data, size_t data_size, DWORD offset)
const char *shader_get_string(const char *data, size_t data_size, DWORD offset)
{
size_t len, max_len;

Expand All @@ -1908,7 +1908,7 @@ static const char *shader_get_string(const char *data, size_t data_size, DWORD o

#ifdef __REACTOS__
len = strlen(data + offset);
#else`
#else
len = strnlen(data + offset, max_len);
#endif

Expand Down
3 changes: 3 additions & 0 deletions dll/directx/wine/wined3d/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,8 @@ static void state_colorwrite_i(struct wined3d_context *context, const struct win
set_color_mask(gl_info, index, state->render_states[state_id]);
}

#ifdef __REACTOS__
#else
static void state_colorwrite1(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
set_color_mask(wined3d_context_gl(context)->gl_info, 1, state->render_states[WINED3D_RS_COLORWRITEENABLE1]);
Expand All @@ -1608,6 +1610,7 @@ static void state_colorwrite3(struct wined3d_context *context, const struct wine
{
set_color_mask(wined3d_context_gl(context)->gl_info, 3, state->render_states[WINED3D_RS_COLORWRITEENABLE3]);
}
#endif

static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
Expand Down
4 changes: 3 additions & 1 deletion dll/directx/wine/wined3d/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,8 @@ static void convert_x8r8g8b8_dxt5(const BYTE *src, BYTE *dst,
{
wined3d_dxt5_encode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8X8_UNORM, w, h);
}

#ifdef __REACTOS__
#else
static void convert_x8r8g8b8_l8(const BYTE *src, BYTE *dst,
DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h)
{
Expand All @@ -700,6 +701,7 @@ static void convert_x8r8g8b8_l8(const BYTE *src, BYTE *dst,
}
}
}
#endif

struct d3dfmt_converter_desc
{
Expand Down
3 changes: 3 additions & 0 deletions dll/directx/wine/wined3d/swapchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain,
const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override,
unsigned int swap_interval, DWORD flags)
{
#ifdef __REACTOS__
#else
static DWORD notified_flags = 0;
#endif
RECT s, d;

TRACE("swapchain %p, src_rect %s, dst_rect %s, dst_window_override %p, swap_interval %u, flags %#x.\n",
Expand Down
2 changes: 1 addition & 1 deletion dll/directx/wine/wined3d/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -6962,7 +6962,7 @@ BOOL invert_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m)
}

/* Taken and adapted from Mesa. */
static BOOL invert_matrix_3d(struct wined3d_matrix *out, const struct wined3d_matrix *in)
BOOL invert_matrix_3d(struct wined3d_matrix *out, const struct wined3d_matrix *in)
{
float pos, neg, t, det;
struct wined3d_matrix temp;
Expand Down
2 changes: 2 additions & 0 deletions sdk/include/psdk/winuser.h
Original file line number Diff line number Diff line change
Expand Up @@ -2112,6 +2112,8 @@ extern "C" {
#define DCX_INTERSECTRGN 128
#define DCX_VALIDATE 0x200000
#define DCX_EXCLUDEUPDATE 0x100
#define DCX_USESTYLE 0x00010000
#define DCX_NORECOMPUTE 0x00100000
#define GMDI_GOINTOPOPUPS 2
#define GMDI_USEDISABLED 1
#define FKF_AVAILABLE 2
Expand Down

0 comments on commit 5dd8024

Please sign in to comment.