Commit 06ecb8a8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit 11.0.3 upon wine-1.4

parent d125a281
......@@ -1971,8 +1971,8 @@ static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
{
IDirectDrawImpl *This = impl_from_IDirectDraw7(iface);
struct wined3d_display_mode mode;
static DWORD cur_scanline;
static BOOL hide = FALSE;
DWORD time, frame_progress, lines;
TRACE("iface %p, line %p.\n", iface, Scanline);
......@@ -1989,11 +1989,20 @@ static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
/* Fake the line sweeping of the monitor */
/* FIXME: We should synchronize with a source to keep the refresh rate */
*Scanline = cur_scanline++;
/* Assume 20 scan lines in the vertical blank */
if (cur_scanline >= mode.height + 20)
cur_scanline = 0;
/* Simulate a 60Hz display */
time = GetTickCount();
frame_progress = time & 15; /* time % (1000 / 60) */
if (!frame_progress)
{
*Scanline = 0;
return DDERR_VERTICALBLANKINPROGRESS;
}
/* Convert frame_progress to estimated scan line. Return any line from
* block determined by time. Some lines may be never returned */
lines = mode.height / 15;
*Scanline = (frame_progress - 1) * lines + time % lines;
return DD_OK;
}
......
......@@ -1490,6 +1490,14 @@ UINT MSI_GetComponentStateW(MSIPACKAGE *package, LPCWSTR szComponent,
if (!comp)
return ERROR_UNKNOWN_COMPONENT;
if (1) /* hack for office 2010 sp1 */
{
static const WCHAR sppW[] =
{'s','p','p','_','p','l','u','g','i','n','s','.','x','8','6',0};
if (!strcmpW( szComponent, sppW ) && comp->Installed == INSTALLSTATE_LOCAL &&
comp->Action == INSTALLSTATE_LOCAL) comp->Action = INSTALLSTATE_UNKNOWN;
}
if (piInstalled)
{
if (comp->Enabled)
......
......@@ -1638,6 +1638,26 @@ static void set_blit_dimension(UINT width, UINT height)
checkGLcall("glViewport");
}
static void context_get_rt_size(const struct wined3d_context *context, SIZE *size)
{
const struct wined3d_surface *rt = context->current_rt;
if (rt->container.type == WINED3D_CONTAINER_SWAPCHAIN
&& rt->container.u.swapchain->front_buffer == rt)
{
RECT window_size;
GetClientRect(context->win_handle, &window_size);
size->cx = window_size.right - window_size.left;
size->cy = window_size.bottom - window_size.top;
return;
}
size->cx = rt->resource.width;
size->cy = rt->resource.height;
}
/*****************************************************************************
* SetupForBlit
*
......@@ -1659,21 +1679,24 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
{
int i;
const struct wined3d_gl_info *gl_info = context->gl_info;
UINT width = context->current_rt->resource.width;
UINT height = context->current_rt->resource.height;
DWORD sampler;
SIZE rt_size;
TRACE("Setting up context %p for blitting\n", context);
if(context->last_was_blit) {
if(context->blit_w != width || context->blit_h != height) {
context_get_rt_size(context, &rt_size);
if (context->last_was_blit)
{
if (context->blit_w != rt_size.cx || context->blit_h != rt_size.cy)
{
ENTER_GL();
set_blit_dimension(width, height);
set_blit_dimension(rt_size.cx, rt_size.cy);
LEAVE_GL();
context->blit_w = width; context->blit_h = height;
/* No need to dirtify here, the states are still dirtified because they weren't
* applied since the last SetupForBlit call. Otherwise last_was_blit would not
* be set
*/
context->blit_w = rt_size.cx;
context->blit_h = rt_size.cy;
/* No need to dirtify here, the states are still dirtified because
* they weren't applied since the last SetupForBlit() call. */
}
TRACE("Context is already set up for blitting, nothing to do\n");
return;
......@@ -1839,12 +1862,13 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
glDisable(GL_CLIP_PLANE5); checkGLcall("glDisable(clip plane 5)");
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_CLIPPING));
set_blit_dimension(width, height);
set_blit_dimension(rt_size.cx, rt_size.cy);
device->frag_pipe->enable_extension(FALSE);
LEAVE_GL();
context->blit_w = width; context->blit_h = height;
context->blit_w = rt_size.cx;
context->blit_h = rt_size.cy;
context_invalidate_state(context, STATE_VIEWPORT);
context_invalidate_state(context, STATE_TRANSFORM(WINED3D_TS_PROJECTION));
}
......
......@@ -729,6 +729,10 @@ static const struct wined3d_format_texture_info format_texture_info[] =
GL_RGB, GL_UNSIGNED_SHORT, 6,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING,
WINED3D_GL_EXT_NONE, convert_r16g16},
{WINED3DFMT_R16G16_UNORM, GL_RG16, GL_RG16, 0,
GL_RG, GL_UNSIGNED_SHORT, 0,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET,
ARB_TEXTURE_RG, NULL},
{WINED3DFMT_B10G10R10A2_UNORM, GL_RGB10_A2, GL_RGB10_A2, 0,
GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, 0,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET,
......
......@@ -1446,11 +1446,13 @@ BOOL X11DRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
}
for (x = 0, pos = min( pt[0].x, pt[1].x ); x < dx; x++, pos++)
{
COLORREF color = RGB( (v[0].Red * (dx - x) + v[1].Red * x) / dx / 256,
int color = X11DRV_PALETTE_ToPhysical( physdev,
RGB( (v[0].Red * (dx - x) + v[1].Red * x) / dx / 256,
(v[0].Green * (dx - x) + v[1].Green * x) / dx / 256,
(v[0].Blue * (dx - x) + v[1].Blue * x) / dx / 256);
(v[0].Blue * (dx - x) + v[1].Blue * x) / dx / 256) );
wine_tsx11_lock();
XSetForeground( gdi_display, physdev->gc, X11DRV_PALETTE_ToPhysical( physdev, color ));
XSetForeground( gdi_display, physdev->gc, color );
XDrawLine( gdi_display, physdev->drawable, physdev->gc,
physdev->dc_rect.left + pos, physdev->dc_rect.top + pt[0].y,
physdev->dc_rect.left + pos, physdev->dc_rect.top + pt[1].y );
......@@ -1491,11 +1493,13 @@ BOOL X11DRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
}
for (y = 0, pos = min( pt[0].y, pt[1].y ); y < dy; y++, pos++)
{
COLORREF color = RGB( (v[0].Red * (dy - y) + v[1].Red * y) / dy / 256,
int color = X11DRV_PALETTE_ToPhysical( physdev,
RGB( (v[0].Red * (dy - y) + v[1].Red * y) / dy / 256,
(v[0].Green * (dy - y) + v[1].Green * y) / dy / 256,
(v[0].Blue * (dy - y) + v[1].Blue * y) / dy / 256);
(v[0].Blue * (dy - y) + v[1].Blue * y) / dy / 256) );
wine_tsx11_lock();
XSetForeground( gdi_display, physdev->gc, X11DRV_PALETTE_ToPhysical( physdev, color ));
XSetForeground( gdi_display, physdev->gc, color );
XDrawLine( gdi_display, physdev->drawable, physdev->gc,
physdev->dc_rect.left + pt[0].x, physdev->dc_rect.top + pos,
physdev->dc_rect.left + pt[1].x, physdev->dc_rect.top + pos );
......
......@@ -13277,7 +13277,7 @@ msgid ""
"application."
msgstr ""
"Cela peut être causé par une erreur dans le programme ou un défaut dans "
"Wine. Vous pouvez consulter la <a href=\"http://www.codeweavers.com/"
"Wine. Vous pouvez consulter <a href=\"http://www.codeweavers.com/"
"compatibility/\">http://www.codeweavers.com/compatibility/</a> pour obtenir "
"des conseils sur la façon d'exécuter cette application."
......
......@@ -959,6 +959,42 @@ static HANDLE start_rundll32( const char *inf_path, BOOL wow64 )
return pi.hProcess;
}
/* ---------------------------------------------------------------
** This function is a CrossOver HACK for 9411 / 8979.
** --------------------------------------------------------------- */
static char* setup_dll_overrides(void)
{
/* See CXBT.pm for reference */
static char overrides[] = "shdocvw=b;*iexplore.exe=b;advpack=b;atl=b;oleaut32=b;rpcrt4=b";
char* old_dlloverrides;
HANDLE hFile;
/* Save the original dll overrides so we can restore them after running
* rundll32.
*/
old_dlloverrides = getenv("WINEDLLOVERRIDES");
if (old_dlloverrides)
old_dlloverrides = strdup(old_dlloverrides);
/* Check whether shdocvw is usable */
hFile = CreateFileA("c:/windows/system32/shdocvw.dll", FILE_READ_DATA,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
char buf[0x40+20];
if (ReadFile(hFile, buf, sizeof(buf), NULL, NULL))
{
if (strncmp(buf+0x40, "Wine placeholder DLL", 20) != 0)
overrides[8] = 'd';
}
CloseHandle(hFile);
}
WINE_TRACE("for rundll32: WINEDLLOVERRIDES=%s\n", overrides);
setenv("WINEDLLOVERRIDES", overrides, 1);
return old_dlloverrides;
}
/* execute rundll32 on the wine.inf file if necessary */
static void update_wineprefix( int force )
{
......@@ -985,6 +1021,7 @@ static void update_wineprefix( int force )
{
HANDLE process;
DWORD count = 0;
char* old_dlloverrides = setup_dll_overrides();
if ((process = start_rundll32( inf_path, FALSE )))
{
......@@ -1003,6 +1040,13 @@ static void update_wineprefix( int force )
DestroyWindow( hwnd );
}
WINE_TRACE( "wine: configuration in '%s' has been updated.\n", config_dir );
if (old_dlloverrides)
{
setenv("WINEDLLOVERRIDES", old_dlloverrides, 1);
free(old_dlloverrides);
}
else
unsetenv("WINEDLLOVERRIDES");
}
done:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment