winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
5 participants
1115 discussions
Start a n
N
ew thread
Stefan Dösinger : wined3d: Use condition code for sRGB write correction if available.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: dfc91414588ea546d7c6757db7810f3767bcb9d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfc91414588ea546d7c6757db…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue May 26 19:50:27 2009 +0200 wined3d: Use condition code for sRGB write correction if available. This gives a small performance improvement. Don't enable NVfp for it though, because the NVfp penalty is bigger than the gain from this patch. But if NVfp is enabled anyway, make use of it. --- dlls/wined3d/arb_program_shader.c | 63 +++++++++++++++++++++++------------- 1 files changed, 40 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index ac68683..b27d4bf 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -2047,29 +2047,45 @@ static GLuint create_arb_blt_fragment_program(const WineD3D_GL_Info *gl_info, en } static void arbfp_add_sRGB_correction(SHADER_BUFFER *buffer, const char *fragcolor, const char *tmp1, - const char *tmp2, const char *tmp3, const char *tmp4) { + const char *tmp2, const char *tmp3, const char *tmp4, BOOL condcode) { /* Perform sRGB write correction. See GLX_EXT_framebuffer_sRGB */ - /* Calculate the > 0.0031308 case */ - shader_addline(buffer, "POW %s.x, %s.x, srgb_consts1.z;\n", tmp1, fragcolor); - shader_addline(buffer, "POW %s.y, %s.y, srgb_consts1.z;\n", tmp1, fragcolor); - shader_addline(buffer, "POW %s.z, %s.z, srgb_consts1.z;\n", tmp1, fragcolor); - shader_addline(buffer, "MUL %s, %s, srgb_consts1.w;\n", tmp1, tmp1); - shader_addline(buffer, "SUB %s, %s, srgb_consts2.x;\n", tmp1, tmp1); - /* Calculate the < case */ - shader_addline(buffer, "MUL %s, srgb_consts1.x, %s;\n", tmp2, fragcolor); - /* Get 1.0 / 0.0 masks for > 0.0031308 and < 0.0031308 */ - shader_addline(buffer, "SLT %s, srgb_consts1.y, %s;\n", tmp3, fragcolor); - shader_addline(buffer, "SGE %s, srgb_consts1.y, %s;\n", tmp4, fragcolor); - /* Store the components > 0.0031308 in the destination */ - shader_addline(buffer, "MUL %s.xyz, %s, %s;\n", fragcolor, tmp1, tmp3); - /* Add the components that are < 0.0031308 */ - shader_addline(buffer, "MAD %s.xyz, %s, %s, %s;\n", fragcolor, tmp2, tmp4, fragcolor); - /* Move everything into result.color at once. Nvidia hardware cannot handle partial - * result.color writes(.rgb first, then .a), or handle overwriting already written - * components. The assembler uses a temporary register in this case, which is usually - * not allocated from one of our registers that were used earlier. - */ + if(condcode) + { + /* Sigh. MOVC CC doesn't work, so use one of the temps as dummy dest */ + shader_addline(buffer, "SUBC %s, %s.x, srgb_consts1.y;\n", tmp1, fragcolor); + /* Calculate the > 0.0031308 case */ + shader_addline(buffer, "POW %s.x (GE), %s.x, srgb_consts1.z;\n", fragcolor, fragcolor); + shader_addline(buffer, "POW %s.y (GE), %s.y, srgb_consts1.z;\n", fragcolor, fragcolor); + shader_addline(buffer, "POW %s.z (GE), %s.z, srgb_consts1.z;\n", fragcolor, fragcolor); + shader_addline(buffer, "MUL %s.xyz (GE), %s, srgb_consts1.w;\n", fragcolor, fragcolor); + shader_addline(buffer, "SUB %s.xyz (GE), %s, srgb_consts2.x;\n", fragcolor, fragcolor); + /* Calculate the < case */ + shader_addline(buffer, "MUL %s.xyz (LT), srgb_consts1.x, %s;\n", fragcolor, fragcolor); + } + else + { + /* Calculate the > 0.0031308 case */ + shader_addline(buffer, "POW %s.x, %s.x, srgb_consts1.z;\n", tmp1, fragcolor); + shader_addline(buffer, "POW %s.y, %s.y, srgb_consts1.z;\n", tmp1, fragcolor); + shader_addline(buffer, "POW %s.z, %s.z, srgb_consts1.z;\n", tmp1, fragcolor); + shader_addline(buffer, "MUL %s, %s, srgb_consts1.w;\n", tmp1, tmp1); + shader_addline(buffer, "SUB %s, %s, srgb_consts2.x;\n", tmp1, tmp1); + /* Calculate the < case */ + shader_addline(buffer, "MUL %s, srgb_consts1.x, %s;\n", tmp2, fragcolor); + /* Get 1.0 / 0.0 masks for > 0.0031308 and < 0.0031308 */ + shader_addline(buffer, "SLT %s, srgb_consts1.y, %s;\n", tmp3, fragcolor); + shader_addline(buffer, "SGE %s, srgb_consts1.y, %s;\n", tmp4, fragcolor); + /* Store the components > 0.0031308 in the destination */ + shader_addline(buffer, "MUL %s.xyz, %s, %s;\n", fragcolor, tmp1, tmp3); + /* Add the components that are < 0.0031308 */ + shader_addline(buffer, "MAD %s.xyz, %s, %s, %s;\n", fragcolor, tmp2, tmp4, fragcolor); + /* Move everything into result.color at once. Nvidia hardware cannot handle partial + * result.color writes(.rgb first, then .a), or handle overwriting already written + * components. The assembler uses a temporary register in this case, which is usually + * not allocated from one of our registers that were used earlier. + */ + } shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); /* [0.0;1.0] clamping. Not needed, this is done implicitly */ } @@ -2227,7 +2243,8 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, shader_generate_main((IWineD3DBaseShader *)This, buffer, reg_maps, function, &priv_ctx); if(args->super.srgb_correction) { - arbfp_add_sRGB_correction(buffer, fragcolor, srgbtmp[0], srgbtmp[1], srgbtmp[2], srgbtmp[3]); + arbfp_add_sRGB_correction(buffer, fragcolor, srgbtmp[0], srgbtmp[1], srgbtmp[2], srgbtmp[3], + priv_ctx.target_version >= NV2); } else if(reg_maps->shader_version.major < 2) { shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); } @@ -3688,7 +3705,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi if(settings->sRGB_write) { shader_addline(&buffer, "MAD ret, fragment.color.secondary, specular_enable, %s;\n", final_combiner_src); - arbfp_add_sRGB_correction(&buffer, "ret", "arg0", "arg1", "arg2", "tempreg"); + arbfp_add_sRGB_correction(&buffer, "ret", "arg0", "arg1", "arg2", "tempreg", FALSE); } else { shader_addline(&buffer, "MAD result.color, fragment.color.secondary, specular_enable, %s;\n", final_combiner_src); }
1
0
0
0
Stefan Dösinger : wined3d: Handle LRP in vertex shaders.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: 7e1100d0e41611724b6838ac5b297cc8c098c059 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7e1100d0e41611724b6838ac5…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue May 26 16:34:44 2009 +0200 wined3d: Handle LRP in vertex shaders. The ARB "LRP" instruction is a fragment program only instruction. It is however valid in vs_2_0+ vertex shaders, so we have to emulate it. --- dlls/wined3d/arb_program_shader.c | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index f59ef54..ac68683 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -1819,6 +1819,28 @@ static void shader_hw_nrm(const struct wined3d_shader_instruction *ins) } } +static void shader_hw_lrp(const struct wined3d_shader_instruction *ins) +{ + SHADER_BUFFER *buffer = ins->ctx->buffer; + char dst_name[50]; + char src_name[3][50]; + + /* ARB_fragment_program has a convenient LRP instruction */ + if(shader_is_pshader_version(ins->ctx->reg_maps->shader_version.type)) { + shader_hw_map2gl(ins); + return; + } + + shader_arb_get_dst_param(ins, &ins->dst[0], dst_name); + shader_arb_get_src_param(ins, &ins->src[0], 0, src_name[0]); + shader_arb_get_src_param(ins, &ins->src[1], 1, src_name[1]); + shader_arb_get_src_param(ins, &ins->src[2], 2, src_name[2]); + + shader_addline(buffer, "SUB TA, %s, %s;\n", src_name[1], src_name[2]); + shader_addline(buffer, "MAD%s %s, %s, TA, %s;\n", shader_arb_get_modifier(ins), + dst_name, src_name[0], src_name[2]); +} + static void shader_hw_sincos(const struct wined3d_shader_instruction *ins) { /* This instruction exists in ARB, but the d3d instruction takes two extra parameters which @@ -2820,7 +2842,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_LOG */ shader_hw_map2gl, /* WINED3DSIH_LOGP */ shader_hw_map2gl, /* WINED3DSIH_LOOP */ NULL, - /* WINED3DSIH_LRP */ shader_hw_map2gl, + /* WINED3DSIH_LRP */ shader_hw_lrp, /* WINED3DSIH_M3x2 */ shader_hw_mnxn, /* WINED3DSIH_M3x3 */ shader_hw_mnxn, /* WINED3DSIH_M3x4 */ shader_hw_mnxn,
1
0
0
0
Austin Lund : riched20: If DataObjectImpl_EnumFormatEtc returns E_NOTIMPL then ensure that returned pointers are nulled .
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: 33534916a3439e1df8910bc8ebbf096f19de854e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=33534916a3439e1df8910bc8e…
Author: Austin Lund <austin.lund(a)gmail.com> Date: Tue Jun 2 15:57:37 2009 +1000 riched20: If DataObjectImpl_EnumFormatEtc returns E_NOTIMPL then ensure that returned pointers are nulled. --- dlls/riched20/clipboard.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/riched20/clipboard.c b/dlls/riched20/clipboard.c index 648f0c5..cf4fe4b 100644 --- a/dlls/riched20/clipboard.c +++ b/dlls/riched20/clipboard.c @@ -282,6 +282,7 @@ static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD dwD if(dwDirection != DATADIR_GET) { FIXME("Unsupported direction: %d\n", dwDirection); /* WinXP riched20 also returns E_NOTIMPL in this case */ + *ppenumFormatEtc = NULL; return E_NOTIMPL; } return EnumFormatImpl_Create(This->fmtetc, This->fmtetc_cnt, ppenumFormatEtc);
1
0
0
0
Andrew Eikum : gdiplus: Stubs for GdipCreateMetafileFromFile, GdipCreateMetafileFromStream.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: c02e75cf782488e7d24a1dcb5246c3fa180593e9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c02e75cf782488e7d24a1dcb5…
Author: Andrew Eikum <andrew(a)brightnightgames.com> Date: Mon Jun 1 20:02:11 2009 -0500 gdiplus: Stubs for GdipCreateMetafileFromFile, GdipCreateMetafileFromStream. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/graphics.c | 14 ++++++++++++++ include/gdiplusflat.h | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index beff7a4..abb20a3 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -109,8 +109,8 @@ @ stdcall GdipCreateMatrix3I(ptr ptr ptr) @ stdcall GdipCreateMatrix(ptr) @ stdcall GdipCreateMetafileFromEmf(ptr long ptr) -@ stub GdipCreateMetafileFromFile -@ stub GdipCreateMetafileFromStream +@ stdcall GdipCreateMetafileFromFile(ptr ptr) +@ stdcall GdipCreateMetafileFromStream(ptr ptr) @ stdcall GdipCreateMetafileFromWmf(ptr long ptr ptr) @ stdcall GdipCreateMetafileFromWmfFile(wstr ptr ptr) @ stdcall GdipCreatePath2(ptr ptr long long ptr) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 8d3d09e..21ccea6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1116,6 +1116,20 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR *file, return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile); } +GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file, + GpMetafile **metafile) +{ + FIXME("(%p, %p): stub\n", file, metafile); + return NotImplemented; +} + +GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream, + GpMetafile **metafile) +{ + FIXME("(%p, %p): stub\n", stream, metafile); + return NotImplemented; +} + GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR * filename, UINT access, IStream **stream) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index bade9e5..3cf1020 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -432,6 +432,8 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE,BOOL, GDIPCONST WmfPlaceableFileHeader*,GpMetafile**); GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR*, GDIPCONST WmfPlaceableFileHeader*, GpMetafile**); +GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR*,GpMetafile**); +GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream*,GpMetafile**); GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile*,UINT); /* MetafileHeader */
1
0
0
0
Tony Wasserka : d3dx9: Redirect D3DXGetImageInfo functions to the FromFileInMemory variant.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: f1938898153380107cb7ec9e797d98e1b39cecee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f1938898153380107cb7ec9e7…
Author: Tony Wasserka <tony.wasserka(a)freenet.de> Date: Mon Jun 1 18:30:15 2009 +0200 d3dx9: Redirect D3DXGetImageInfo functions to the FromFileInMemory variant. --- dlls/d3dx9_36/d3dx9_36_private.h | 2 + dlls/d3dx9_36/surface.c | 112 ++++++++++++++++++++++++++++++++++---- 2 files changed, 104 insertions(+), 10 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index 4460f67..a2b0698 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -23,7 +23,9 @@ #include <stdarg.h> #define COBJMACROS +#include "winbase.h" #include "wingdi.h" +#include "winuser.h" #include "d3dx9.h" /* for internal use */ diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 968e3ef..1614e44 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -18,6 +18,7 @@ */ #include "wine/debug.h" +#include "wine/unicode.h" #include "d3dx9_36_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3dx); @@ -34,36 +35,127 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx); * info [O] pointer to the destination structure * * RETURNS - * Success: D3D_OK - * Failure: D3DERR_INVALIDCALL + * Success: D3D_OK, if info is not NULL and data and datasize make up a valid image file or + * if info is NULL and data and datasize are not NULL + * Failure: D3DXERR_INVALIDDATA, if data is no valid image file and datasize and info are not NULL + * D3DERR_INVALIDCALL, if data is NULL or + * if datasize is 0 + * + * NOTES + * datasize may be bigger than the actual file size * */ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3DXIMAGE_INFO *info) { FIXME("stub\n"); + + if(data && datasize && !info) return D3D_OK; + if( !data || !datasize ) return D3DERR_INVALIDCALL; + return E_NOTIMPL; } +/************************************************************ + * D3DXGetImageInfoFromFile + * + * RETURNS + * Success: D3D_OK, if we successfully load a valid image file or + * if we successfully load a file which is no valid image and info is NULL + * Failure: D3DXERR_INVALIDDATA, if we fail to load file or + * if file is not a valid image file and info is not NULL + * D3DERR_INVALIDCALL, if file is NULL + * + */ HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info) { - FIXME("stub\n"); - return E_NOTIMPL; + LPWSTR widename; + HRESULT hr; + int strlength; + TRACE("(void): relay\n"); + + if( !file ) return D3DERR_INVALIDCALL; + + strlength = MultiByteToWideChar(CP_ACP, 0, file, -1, NULL, 0); + widename = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlength * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, file, -1, widename, strlength); + + hr = D3DXGetImageInfoFromFileW(widename, info); + HeapFree(GetProcessHeap(), 0, widename); + + return hr; } HRESULT WINAPI D3DXGetImageInfoFromFileW(LPCWSTR file, D3DXIMAGE_INFO *info) { - FIXME("stub\n"); - return E_NOTIMPL; + HRESULT hr; + DWORD size; + LPVOID buffer; + TRACE("(void): relay\n"); + + if( !file ) return D3DERR_INVALIDCALL; + + hr = map_view_of_file(file, &buffer, &size); + if(FAILED(hr)) return D3DXERR_INVALIDDATA; + + hr = D3DXGetImageInfoFromFileInMemory(buffer, size, info); + UnmapViewOfFile(buffer); + + return hr; } +/************************************************************ + * D3DXGetImageInfoFromResource + * + * RETURNS + * Success: D3D_OK, if resource is a valid image file + * Failure: D3DXERR_INVALIDDATA, if resource is no valid image file or NULL or + * if we fail to load resource + * + */ HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, LPCSTR resource, D3DXIMAGE_INFO *info) { - FIXME("stub\n"); - return E_NOTIMPL; + HRSRC resinfo; + TRACE("(void)\n"); + + resinfo = FindResourceA(module, resource, (LPCSTR)RT_RCDATA); + if(resinfo) { + LPVOID buffer; + HRESULT hr; + DWORD size; + + hr = load_resource_into_memory(module, resinfo, &buffer, &size); + if(FAILED(hr)) return D3DXERR_INVALIDDATA; + return D3DXGetImageInfoFromFileInMemory(buffer, size, info); + } + + resinfo = FindResourceA(module, resource, (LPCSTR)RT_BITMAP); + if(resinfo) { + FIXME("Implement loading bitmaps from resource type RT_BITMAP\n"); + return E_NOTIMPL; + } + return D3DXERR_INVALIDDATA; } HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, LPCWSTR resource, D3DXIMAGE_INFO *info) { - FIXME("stub\n"); - return E_NOTIMPL; + HRSRC resinfo; + TRACE("(void)\n"); + + resinfo = FindResourceW(module, resource, (LPCWSTR)RT_RCDATA); + if(resinfo) { + LPVOID buffer; + HRESULT hr; + DWORD size; + + hr = load_resource_into_memory(module, resinfo, &buffer, &size); + if(FAILED(hr)) return D3DXERR_INVALIDDATA; + return D3DXGetImageInfoFromFileInMemory(buffer, size, info); + } + + resinfo = FindResourceW(module, resource, (LPCWSTR)RT_BITMAP); + if(resinfo) { + FIXME("Implement loading bitmaps from resource type RT_BITMAP\n"); + return E_NOTIMPL; + } + return D3DXERR_INVALIDDATA; }
1
0
0
0
Tony Wasserka : d3dx9: Add utility functions for loading files and resources into memory.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: 32d2be575e015e4ea17788104c9f58c4a6c65363 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=32d2be575e015e4ea17788104…
Author: Tony Wasserka <tony.wasserka(a)freenet.de> Date: Mon Jun 1 18:25:32 2009 +0200 d3dx9: Add utility functions for loading files and resources into memory. --- dlls/d3dx9_36/Makefile.in | 3 +- dlls/d3dx9_36/d3dx9_36_private.h | 4 ++ dlls/d3dx9_36/util.c | 104 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index 16fd41c..c094071 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -13,7 +13,8 @@ C_SRCS = \ mesh.c \ shader.c \ sprite.c \ - surface.c + surface.c \ + util.c RC_SRCS = version.rc diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index cd4122d..4460f67 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -26,6 +26,10 @@ #include "wingdi.h" #include "d3dx9.h" +/* for internal use */ +HRESULT map_view_of_file(LPCWSTR filename, LPVOID *buffer, DWORD *length); +HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer, DWORD *length); + /* ID3DXFont */ typedef struct ID3DXFontImpl diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c new file mode 100644 index 0000000..ff41ee7 --- /dev/null +++ b/dlls/d3dx9_36/util.c @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2009 Tony Wasserka + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "wine/debug.h" +#include "d3dx9_36_private.h" + +/************************************************************ + * map_view_of_file + * + * Loads a file into buffer and stores the number of read bytes in length. + * + * PARAMS + * filename [I] name of the file to be loaded + * buffer [O] pointer to destination buffer + * length [O] size of the obtained data + * + * RETURNS + * Success: D3D_OK + * Failure: + * see error codes for CreateFileW, GetFileSize, CreateFileMapping and MapViewOfFile + * + * NOTES + * The caller must UnmapViewOfFile when it doesn't need the data anymore + * + */ +HRESULT map_view_of_file(LPCWSTR filename, LPVOID *buffer, DWORD *length) +{ + HANDLE hfile, hmapping = NULL; + + hfile = CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + if(hfile == INVALID_HANDLE_VALUE) goto error; + + *length = GetFileSize(hfile, NULL); + if(*length == INVALID_FILE_SIZE) goto error; + + hmapping = CreateFileMappingW(hfile, NULL, PAGE_READONLY, 0, 0, NULL); + if(!hmapping) goto error; + + *buffer = MapViewOfFile(hmapping, FILE_MAP_READ, 0, 0, 0); + if(*buffer == NULL) goto error; + + CloseHandle(hmapping); + CloseHandle(hfile); + + return S_OK; + +error: + CloseHandle(hmapping); + CloseHandle(hfile); + return HRESULT_FROM_WIN32(GetLastError()); +} + +/************************************************************ + * load_resource_into_memory + * + * Loads a resource into buffer and stores the number of + * read bytes in length. + * + * PARAMS + * module [I] handle to the module + * resinfo [I] handle to the resource's information block + * buffer [O] pointer to destination buffer + * length [O] size of the obtained data + * + * RETURNS + * Success: D3D_OK + * Failure: + * See error codes for SizeofResource, LoadResource and LockResource + * + * NOTES + * The memory doesn't need to be freed by the caller manually + * + */ +HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer, DWORD *length) +{ + HGLOBAL resource; + + *length = SizeofResource(module, resinfo); + if(*length == 0) return HRESULT_FROM_WIN32(GetLastError()); + + resource = LoadResource(module, resinfo); + if( !resource ) return HRESULT_FROM_WIN32(GetLastError()); + + *buffer = LockResource(resource); + if(*buffer == NULL) return HRESULT_FROM_WIN32(GetLastError()); + + return S_OK; +}
1
0
0
0
Alexandre Julliard : user32/tests: Only check the foreground window when it belongs to the current thread.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: f922283335ba93fea0df4e685f2298e2077328ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f922283335ba93fea0df4e685…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 2 11:56:58 2009 +0200 user32/tests: Only check the foreground window when it belongs to the current thread. --- dlls/user32/tests/win.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 13e5d67..43988b5 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -2322,7 +2322,10 @@ static void check_wnd_state_(const char *file, int line, HWND active, HWND foreground, HWND focus, HWND capture) { ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow()); - if (foreground && GetForegroundWindow()) + /* only check foreground if it belongs to the current thread */ + /* foreground can be moved to a different app pretty much at any time */ + if (foreground && GetForegroundWindow() && + GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId()) ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture());
1
0
0
0
Alexandre Julliard : user32/tests: Fix the listbox delete test on NT4.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: 788cdbe6fd2c6d0461d8489d92dc103670676ca8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=788cdbe6fd2c6d0461d8489d9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 2 11:56:42 2009 +0200 user32/tests: Fix the listbox delete test on NT4. --- dlls/user32/tests/msg.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 1db5146..45ef814 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -11072,7 +11072,9 @@ static void check_lb_state_dbg(HWND listbox, int count, int cur_sel, ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCURSEL, 0, 0); ok_(__FILE__, line)(ret == cur_sel, "expected cur sel %d, got %ld\n", cur_sel, ret); ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCARETINDEX, 0, 0); - ok_(__FILE__, line)(ret == caret_index, "expected caret index %d, got %ld\n", caret_index, ret); + ok_(__FILE__, line)(ret == caret_index || + broken(cur_sel == -1 && caret_index == 0 && ret == -1), /* nt4 */ + "expected caret index %d, got %ld\n", caret_index, ret); ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETTOPINDEX, 0, 0); ok_(__FILE__, line)(ret == top_index, "expected top index %d, got %ld\n", top_index, ret); }
1
0
0
0
Alexandre Julliard : riched32: Fix the extra window bytes count for 64-bit.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: bf751298106edcaca61b60170c96a9b0556c9bbf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf751298106edcaca61b60170…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Jun 2 11:53:19 2009 +0200 riched32: Fix the extra window bytes count for 64-bit. --- dlls/riched32/richedit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/riched32/richedit.c b/dlls/riched32/richedit.c index 2640f8d..7513273 100644 --- a/dlls/riched32/richedit.c +++ b/dlls/riched32/richedit.c @@ -59,7 +59,7 @@ static BOOL RICHED32_Register(void) wndClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS; wndClass.lpfnWndProc = RichEdit10ANSIWndProc; wndClass.cbClsExtra = 0; - wndClass.cbWndExtra = 4; + wndClass.cbWndExtra = sizeof(void *); wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndClass.lpszClassName = RICHEDIT_CLASS10A; /* WC_RICHED32A; */
1
0
0
0
Michael Stefaniuc : gdi32: Avoid using long when not needed.
by Alexandre Julliard
02 Jun '09
02 Jun '09
Module: wine Branch: master Commit: 0737fc2c72c904bd7d055f56168499f5916a97af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0737fc2c72c904bd7d055f561…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jun 2 10:16:38 2009 +0200 gdi32: Avoid using long when not needed. --- dlls/gdi32/freetype.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 60c5f21..ef93402 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -846,7 +846,7 @@ static inline FT_Fixed FT_FixedFromFloat(double f) */ static inline FT_Fixed FT_FixedFromFIXED(FIXED f) { - return (FT_Fixed)((long)f.value << 16 | (unsigned long)f.fract); + return (FT_Fixed)((int)f.value << 16 | (unsigned int)f.fract); }
1
0
0
0
← Newer
1
...
100
101
102
103
104
105
106
...
112
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Results per page:
10
25
50
100
200