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
March 2019
----- 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
2 participants
1097 discussions
Start a n
N
ew thread
Michael Stefaniuc : d3dx9: Move objects out of struct d3dx9_base_effect.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: f0d7dd0761fc0b6a45b3d3ae136339d3c3bf8075 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f0d7dd0761fc0b6a45b3d3ae…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Mar 5 22:34:24 2019 +0100 d3dx9: Move objects out of struct d3dx9_base_effect. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/effect.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 2a20144..8147dc1 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -156,7 +156,6 @@ struct d3dx9_base_effect struct d3dx_top_level_parameter *parameters; struct d3dx_technique *techniques; - struct d3dx_object *objects; struct d3dx_effect_pool *pool; DWORD flags; @@ -176,6 +175,7 @@ struct d3dx_effect struct d3dx9_base_effect base_effect; unsigned int parameter_count; unsigned int object_count; + struct d3dx_object *objects; struct ID3DXEffectStateManager *manager; struct IDirect3DDevice9 *device; @@ -705,14 +705,14 @@ static void d3dx9_base_effect_cleanup(struct d3dx9_base_effect *base) base->techniques = NULL; } - if (base->objects) + if (base->effect->objects) { for (i = 0; i < base->effect->object_count; ++i) { - free_object(&base->objects[i]); + free_object(&base->effect->objects[i]); } - HeapFree(GetProcessHeap(), 0, base->objects); - base->objects = NULL; + HeapFree(GetProcessHeap(), 0, base->effect->objects); + base->effect->objects = NULL; } } @@ -3171,7 +3171,7 @@ static HRESULT WINAPI d3dx_effect_GetPassDesc(ID3DXEffect *iface, D3DXHANDLE pas FALSE, ¶m_dirty))) return hr; - data = param->object_id ? effect->base_effect.objects[param->object_id].data : NULL; + data = param->object_id ? effect->objects[param->object_id].data : NULL; if (state_table[state->operation].class == SC_VERTEXSHADER) desc->pVertexShaderFunction = data; else @@ -3884,7 +3884,6 @@ static D3DXHANDLE WINAPI d3dx_effect_GetCurrentTechnique(ID3DXEffect *iface) static HRESULT WINAPI d3dx_effect_ValidateTechnique(ID3DXEffect *iface, D3DXHANDLE technique) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx9_base_effect *base = &effect->base_effect; struct d3dx_technique *tech = get_valid_technique(effect, technique); HRESULT ret = D3D_OK; unsigned int i, j; @@ -3916,7 +3915,7 @@ static HRESULT WINAPI d3dx_effect_ValidateTechnique(ID3DXEffect *iface, D3DXHAND FALSE, ¶m_dirty))) return hr; - if (param->object_id && base->objects[param->object_id].creation_failed) + if (param->object_id && effect->objects[param->object_id].creation_failed) { ret = E_FAIL; goto done; @@ -5310,7 +5309,7 @@ static HRESULT d3dx9_parse_name(char **name, const char *ptr) static HRESULT d3dx9_copy_data(struct d3dx_effect *effect, unsigned int object_id, const char **ptr) { - struct d3dx_object *object = &effect->base_effect.objects[object_id]; + struct d3dx_object *object = &effect->objects[object_id]; if (object->size || object->data) { @@ -6007,7 +6006,7 @@ static HRESULT d3dx_parse_array_selector(struct d3dx_effect *effect, struct d3dx struct d3dx9_base_effect *base = &effect->base_effect; DWORD string_size; struct d3dx_parameter *param = &state->parameter; - struct d3dx_object *object = &base->objects[param->object_id]; + struct d3dx_object *object = &effect->objects[param->object_id]; char *ptr = object->data; HRESULT ret; @@ -6048,7 +6047,7 @@ static HRESULT d3dx_parse_array_selector(struct d3dx_effect *effect, struct d3dx if (!param->members[i].param_eval) { TRACE("Creating preshader for object %u.\n", param->members[i].object_id); - object = &base->objects[param->members[i].object_id]; + object = &effect->objects[param->members[i].object_id]; if (FAILED(ret = d3dx_create_param_eval(base, object->data, object->size, param->type, ¶m->members[i].param_eval, get_version_counter_ptr(base), skip_constants, skip_constants_count))) @@ -6149,7 +6148,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, TRACE("State operation %#x (%s).\n", state->operation, state_table[state->operation].name); param = &state->parameter; TRACE("Using object id %u.\n", param->object_id); - object = &base->objects[param->object_id]; + object = &effect->objects[param->object_id]; TRACE("Usage %u: class %s, type %s.\n", usage, debug_d3dxparameter_class(param->class), debug_d3dxparameter_type(param->type)); @@ -6207,7 +6206,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, TRACE("Mapping to parameter %p, having object id %u.\n", refpar, refpar->object_id); if (refpar->type == D3DXPT_VERTEXSHADER || refpar->type == D3DXPT_PIXELSHADER) { - struct d3dx_object *refobj = &base->objects[refpar->object_id]; + struct d3dx_object *refobj = &effect->objects[refpar->object_id]; if (!refpar->param_eval) { @@ -6266,8 +6265,9 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U read_dword(&ptr, &effect->object_count); TRACE("Object count: %u.\n", effect->object_count); - base->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*base->objects) * effect->object_count); - if (!base->objects) + effect->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(*effect->objects) * effect->object_count); + if (!effect->objects) { ERR("Out of memory.\n"); hr = E_OUTOFMEMORY; @@ -6289,7 +6289,7 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U for (i = 0; i < effect->parameter_count; ++i) { param_set_magic_number(&base->parameters[i].param); - hr = d3dx_parse_effect_parameter(effect, &base->parameters[i], data, &ptr, base->objects); + hr = d3dx_parse_effect_parameter(effect, &base->parameters[i], data, &ptr, effect->objects); if (hr != D3D_OK) { WARN("Failed to parse parameter %u.\n", i); @@ -6315,7 +6315,7 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U for (i = 0; i < base->technique_count; ++i) { TRACE("Parsing technique %u.\n", i); - hr = d3dx_parse_effect_technique(effect, &base->techniques[i], data, &ptr, base->objects); + hr = d3dx_parse_effect_technique(effect, &base->techniques[i], data, &ptr, effect->objects); if (hr != D3D_OK) { WARN("Failed to parse technique %u.\n", i); @@ -6340,9 +6340,9 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U if (FAILED(hr = d3dx9_copy_data(effect, id, &ptr))) goto err_out; - if (base->objects[id].data) + if (effect->objects[id].data) { - if (FAILED(hr = d3dx9_create_object(base, &base->objects[id]))) + if (FAILED(hr = d3dx9_create_object(base, &effect->objects[id]))) goto err_out; } } @@ -6390,14 +6390,14 @@ err_out: base->parameters = NULL; } - if (base->objects) + if (effect->objects) { for (i = 0; i < effect->object_count; ++i) { - free_object(&base->objects[i]); + free_object(&effect->objects[i]); } - HeapFree(GetProcessHeap(), 0, base->objects); - base->objects = NULL; + HeapFree(GetProcessHeap(), 0, effect->objects); + effect->objects = NULL; } return hr;
1
0
0
0
Michael Stefaniuc : d3dx9: Merge the d3dx_effect_GetPassDesc() helper.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 52c2092fa92cd06ea2c1074072be4cadd872f083 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52c2092fa92cd06ea2c10740…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Mar 5 22:34:23 2019 +0100 d3dx9: Merge the d3dx_effect_GetPassDesc() helper. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/effect.c | 95 +++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index acc0eb7..2a20144 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -1110,55 +1110,6 @@ static HRESULT d3dx9_get_param_value_ptr(struct d3dx_pass *pass, struct d3dx_sta return E_NOTIMPL; } -static HRESULT d3dx9_base_effect_get_pass_desc(struct d3dx9_base_effect *base, - D3DXHANDLE pass_handle, D3DXPASS_DESC *desc) -{ - struct d3dx_pass *pass = get_valid_pass(base, pass_handle); - unsigned int i; - - if (!desc || !pass) - { - WARN("Invalid argument specified.\n"); - return D3DERR_INVALIDCALL; - } - - desc->Name = pass->name; - desc->Annotations = pass->annotation_count; - - desc->pVertexShaderFunction = NULL; - desc->pPixelShaderFunction = NULL; - - if (base->flags & D3DXFX_NOT_CLONEABLE) - return D3D_OK; - - for (i = 0; i < pass->state_count; ++i) - { - struct d3dx_state *state = &pass->states[i]; - - if (state_table[state->operation].class == SC_VERTEXSHADER - || state_table[state->operation].class == SC_PIXELSHADER) - { - struct d3dx_parameter *param; - void *param_value; - BOOL param_dirty; - HRESULT hr; - void *data; - - if (FAILED(hr = d3dx9_get_param_value_ptr(pass, &pass->states[i], ¶m_value, ¶m, - FALSE, ¶m_dirty))) - return hr; - - data = param->object_id ? base->objects[param->object_id].data : NULL; - if (state_table[state->operation].class == SC_VERTEXSHADER) - desc->pVertexShaderFunction = data; - else - desc->pPixelShaderFunction = data; - } - } - - return D3D_OK; -} - static unsigned int get_annotation_from_object(struct d3dx_effect *effect, D3DXHANDLE object, struct d3dx_parameter **annotations) { @@ -3180,13 +3131,55 @@ static HRESULT WINAPI d3dx_effect_GetTechniqueDesc(ID3DXEffect *iface, D3DXHANDL return D3D_OK; } -static HRESULT WINAPI d3dx_effect_GetPassDesc(ID3DXEffect *iface, D3DXHANDLE pass, D3DXPASS_DESC *desc) +static HRESULT WINAPI d3dx_effect_GetPassDesc(ID3DXEffect *iface, D3DXHANDLE pass_handle, D3DXPASS_DESC *desc) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); + struct d3dx_pass *pass = get_valid_pass(&effect->base_effect, pass_handle); + unsigned int i; TRACE("iface %p, pass %p, desc %p.\n", iface, pass, desc); - return d3dx9_base_effect_get_pass_desc(&effect->base_effect, pass, desc); + if (!desc || !pass) + { + WARN("Invalid argument specified.\n"); + return D3DERR_INVALIDCALL; + } + + desc->Name = pass->name; + desc->Annotations = pass->annotation_count; + + desc->pVertexShaderFunction = NULL; + desc->pPixelShaderFunction = NULL; + + if (effect->base_effect.flags & D3DXFX_NOT_CLONEABLE) + return D3D_OK; + + for (i = 0; i < pass->state_count; ++i) + { + struct d3dx_state *state = &pass->states[i]; + + if (state_table[state->operation].class == SC_VERTEXSHADER + || state_table[state->operation].class == SC_PIXELSHADER) + { + struct d3dx_parameter *param; + void *param_value; + BOOL param_dirty; + HRESULT hr; + void *data; + + if (FAILED(hr = d3dx9_get_param_value_ptr(pass, &pass->states[i], ¶m_value, ¶m, + FALSE, ¶m_dirty))) + return hr; + + data = param->object_id ? effect->base_effect.objects[param->object_id].data : NULL; + if (state_table[state->operation].class == SC_VERTEXSHADER) + desc->pVertexShaderFunction = data; + else + desc->pPixelShaderFunction = data; + } + } + + return D3D_OK; } static HRESULT WINAPI d3dx_effect_GetFunctionDesc(ID3DXEffect *iface, D3DXHANDLE shader,
1
0
0
0
Michael Stefaniuc : d3dx9: Pass a struct d3dx_effect to d3dx9_copy_data().
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 26b9b04e7f40c7a2011684f01ff07be91047b492 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=26b9b04e7f40c7a2011684f0…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Mar 5 22:34:22 2019 +0100 d3dx9: Pass a struct d3dx_effect to d3dx9_copy_data(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/effect.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 992d7b4..acc0eb7 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -5315,9 +5315,9 @@ static HRESULT d3dx9_parse_name(char **name, const char *ptr) return D3D_OK; } -static HRESULT d3dx9_copy_data(struct d3dx9_base_effect *base, unsigned int object_id, const char **ptr) +static HRESULT d3dx9_copy_data(struct d3dx_effect *effect, unsigned int object_id, const char **ptr) { - struct d3dx_object *object = &base->objects[object_id]; + struct d3dx_object *object = &effect->base_effect.objects[object_id]; if (object->size || object->data) { @@ -6168,7 +6168,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, case D3DXPT_VERTEXSHADER: case D3DXPT_PIXELSHADER: state->type = ST_CONSTANT; - if (FAILED(hr = d3dx9_copy_data(base, param->object_id, ptr))) + if (FAILED(hr = d3dx9_copy_data(effect, param->object_id, ptr))) return hr; if (object->data) @@ -6187,7 +6187,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, case D3DXPT_FLOAT: case D3DXPT_STRING: state->type = ST_FXLC; - if (FAILED(hr = d3dx9_copy_data(base, param->object_id, ptr))) + if (FAILED(hr = d3dx9_copy_data(effect, param->object_id, ptr))) return hr; if (FAILED(hr = d3dx_create_param_eval(base, object->data, object->size, param->type, ¶m->param_eval, get_version_counter_ptr(base), NULL, 0))) @@ -6202,7 +6202,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, case 1: state->type = ST_PARAMETER; - if (FAILED(hr = d3dx9_copy_data(base, param->object_id, ptr))) + if (FAILED(hr = d3dx9_copy_data(effect, param->object_id, ptr))) return hr; TRACE("Looking for parameter %s.\n", debugstr_a(object->data)); @@ -6234,7 +6234,7 @@ static HRESULT d3dx_parse_resource(struct d3dx_effect *effect, const char *data, case 2: state->type = ST_ARRAY_SELECTOR; - if (FAILED(hr = d3dx9_copy_data(base, param->object_id, ptr))) + if (FAILED(hr = d3dx9_copy_data(effect, param->object_id, ptr))) return hr; hr = d3dx_parse_array_selector(effect, state, skip_constants, skip_constants_count); break; @@ -6344,7 +6344,7 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U read_dword(&ptr, &id); TRACE("id: %u.\n", id); - if (FAILED(hr = d3dx9_copy_data(base, id, &ptr))) + if (FAILED(hr = d3dx9_copy_data(effect, id, &ptr))) goto err_out; if (base->objects[id].data)
1
0
0
0
Michael Stefaniuc : d3dx9: Move object_count out of struct d3dx9_base_effect.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 54bdc66acf4abe1f1fa38238ed824c2372e1ff91 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=54bdc66acf4abe1f1fa38238…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Mar 5 22:34:21 2019 +0100 d3dx9: Move object_count out of struct d3dx9_base_effect. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/effect.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index bbbfb45..992d7b4 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -153,7 +153,6 @@ struct d3dx9_base_effect struct d3dx_effect *effect; UINT technique_count; - UINT object_count; struct d3dx_top_level_parameter *parameters; struct d3dx_technique *techniques; @@ -176,6 +175,7 @@ struct d3dx_effect struct d3dx9_base_effect base_effect; unsigned int parameter_count; + unsigned int object_count; struct ID3DXEffectStateManager *manager; struct IDirect3DDevice9 *device; @@ -707,7 +707,7 @@ static void d3dx9_base_effect_cleanup(struct d3dx9_base_effect *base) if (base->objects) { - for (i = 0; i < base->object_count; ++i) + for (i = 0; i < base->effect->object_count; ++i) { free_object(&base->objects[i]); } @@ -6270,10 +6270,10 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U skip_dword_unknown(&ptr, 1); - read_dword(&ptr, &base->object_count); - TRACE("Object count: %u.\n", base->object_count); + read_dword(&ptr, &effect->object_count); + TRACE("Object count: %u.\n", effect->object_count); - base->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*base->objects) * base->object_count); + base->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*base->objects) * effect->object_count); if (!base->objects) { ERR("Out of memory.\n"); @@ -6399,7 +6399,7 @@ err_out: if (base->objects) { - for (i = 0; i < base->object_count; ++i) + for (i = 0; i < effect->object_count; ++i) { free_object(&base->objects[i]); }
1
0
0
0
Michael Stefaniuc : d3dx9: Pass a struct d3dx_effect to the get technique helpers.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 42839d15e3ec829f939fe1f99ac6b025f64b18de URL:
https://source.winehq.org/git/wine.git/?a=commit;h=42839d15e3ec829f939fe1f9…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Mar 5 22:34:20 2019 +0100 d3dx9: Pass a struct d3dx_effect to the get technique helpers. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/effect.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 6a0b262..bbbfb45 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -453,9 +453,10 @@ static inline D3DXHANDLE get_pass_handle(struct d3dx_pass *pass) return (D3DXHANDLE)pass; } -static struct d3dx_technique *get_technique_by_name(struct d3dx9_base_effect *base, const char *name) +static struct d3dx_technique *get_technique_by_name(struct d3dx_effect *effect, const char *name) { - UINT i; + struct d3dx9_base_effect *base = &effect->base_effect; + unsigned int i; if (!name) return NULL; @@ -468,8 +469,9 @@ static struct d3dx_technique *get_technique_by_name(struct d3dx9_base_effect *ba return NULL; } -static struct d3dx_technique *get_valid_technique(struct d3dx9_base_effect *base, D3DXHANDLE technique) +static struct d3dx_technique *get_valid_technique(struct d3dx_effect *effect, D3DXHANDLE technique) { + struct d3dx9_base_effect *base = &effect->base_effect; unsigned int i; for (i = 0; i < base->technique_count; ++i) @@ -478,7 +480,7 @@ static struct d3dx_technique *get_valid_technique(struct d3dx9_base_effect *base return &base->techniques[i]; } - return get_technique_by_name(base, technique); + return get_technique_by_name(effect, technique); } static struct d3dx_pass *get_valid_pass(struct d3dx9_base_effect *base, D3DXHANDLE pass) @@ -1163,7 +1165,7 @@ static unsigned int get_annotation_from_object(struct d3dx_effect *effect, D3DXH struct d3dx9_base_effect *base = &effect->base_effect; struct d3dx_parameter *param = get_valid_parameter(base, object); struct d3dx_pass *pass = get_valid_pass(base, object); - struct d3dx_technique *technique = get_valid_technique(base, object); + struct d3dx_technique *technique = get_valid_technique(effect, object); if (pass) { @@ -3161,7 +3163,7 @@ static HRESULT WINAPI d3dx_effect_GetTechniqueDesc(ID3DXEffect *iface, D3DXHANDL D3DXTECHNIQUE_DESC *desc) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx_technique *tech = technique ? get_valid_technique(&effect->base_effect, technique) : &effect->base_effect.techniques[0]; + struct d3dx_technique *tech = technique ? get_valid_technique(effect, technique) : &effect->base_effect.techniques[0]; TRACE("iface %p, technique %p, desc %p.\n", iface, technique, desc); @@ -3357,7 +3359,7 @@ static D3DXHANDLE WINAPI d3dx_effect_GetTechnique(ID3DXEffect *iface, UINT index static D3DXHANDLE WINAPI d3dx_effect_GetTechniqueByName(ID3DXEffect *iface, const char *name) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx_technique *tech = get_technique_by_name(&effect->base_effect, name); + struct d3dx_technique *tech = get_technique_by_name(effect, name); TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); @@ -3376,7 +3378,7 @@ static D3DXHANDLE WINAPI d3dx_effect_GetTechniqueByName(ID3DXEffect *iface, cons static D3DXHANDLE WINAPI d3dx_effect_GetPass(ID3DXEffect *iface, D3DXHANDLE technique, UINT index) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx_technique *tech = get_valid_technique(&effect->base_effect, technique); + struct d3dx_technique *tech = get_valid_technique(effect, technique); TRACE("iface %p, technique %p, index %u.\n", iface, technique, index); @@ -3394,7 +3396,7 @@ static D3DXHANDLE WINAPI d3dx_effect_GetPass(ID3DXEffect *iface, D3DXHANDLE tech static D3DXHANDLE WINAPI d3dx_effect_GetPassByName(ID3DXEffect *iface, D3DXHANDLE technique, const char *name) { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); - struct d3dx_technique *tech = get_valid_technique(&effect->base_effect, technique); + struct d3dx_technique *tech = get_valid_technique(effect, technique); TRACE("iface %p, technique %p, name %s.\n", iface, technique, debugstr_a(name)); @@ -3860,15 +3862,14 @@ static HRESULT WINAPI d3dx_effect_GetPool(ID3DXEffect *iface, ID3DXEffectPool ** static HRESULT WINAPI d3dx_effect_SetTechnique(ID3DXEffect *iface, D3DXHANDLE technique) { - struct d3dx_effect *This = impl_from_ID3DXEffect(iface); - struct d3dx9_base_effect *base = &This->base_effect; - struct d3dx_technique *tech = get_valid_technique(base, technique); + struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); + struct d3dx_technique *tech = get_valid_technique(effect, technique); - TRACE("iface %p, technique %p\n", This, technique); + TRACE("iface %p, technique %p\n", iface, technique); if (tech) { - This->active_technique = tech; + effect->active_technique = tech; TRACE("Technique %p\n", tech); return D3D_OK; } @@ -3891,7 +3892,7 @@ static HRESULT WINAPI d3dx_effect_ValidateTechnique(ID3DXEffect *iface, D3DXHAND { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); struct d3dx9_base_effect *base = &effect->base_effect; - struct d3dx_technique *tech = get_valid_technique(base, technique); + struct d3dx_technique *tech = get_valid_technique(effect, technique); HRESULT ret = D3D_OK; unsigned int i, j; @@ -3947,7 +3948,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D if (technique) { - if (!(prev_tech = get_valid_technique(base, technique))) + if (!(prev_tech = get_valid_technique(effect, technique))) return D3DERR_INVALIDCALL; for (i = 0; i < base->technique_count; ++i) @@ -4090,7 +4091,7 @@ static BOOL WINAPI d3dx_effect_IsParameterUsed(ID3DXEffect *iface, D3DXHANDLE pa { struct d3dx_effect *effect = impl_from_ID3DXEffect(iface); struct d3dx_parameter *param = get_valid_parameter(&effect->base_effect, parameter); - struct d3dx_technique *tech = get_valid_technique(&effect->base_effect, technique); + struct d3dx_technique *tech = get_valid_technique(effect, technique); BOOL ret; TRACE("iface %p, parameter %p, technique %p.\n", iface, parameter, technique);
1
0
0
0
Alistair Leslie-Hughes : setupapi: Add SetupDiRegisterCoDeviceInstallers stub.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 96ab88e1393718e1855f883c52d79a8d9a933181 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=96ab88e1393718e1855f883c…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Mar 6 21:25:19 2019 +0100 setupapi: Add SetupDiRegisterCoDeviceInstallers stub. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 11 +++++++++++ dlls/setupapi/setupapi.spec | 1 + 2 files changed, 12 insertions(+) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 582da37..2c95b5c 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -3866,3 +3866,14 @@ BOOL WINAPI SetupDiInstallDeviceInterfaces(HDEVINFO dev, PSP_DEVINFO_DATA info_d SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/*********************************************************************** + * SetupDiRegisterCoDeviceInstallers (SETUPAPI.@) + */ +BOOL WINAPI SetupDiRegisterCoDeviceInstallers(HDEVINFO dev, PSP_DEVINFO_DATA info_data) +{ + FIXME("%p, %p stub\n", dev, info_data); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 1be2b62..1d18870 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -380,6 +380,7 @@ @ stdcall SetupDiOpenDeviceInterfaceA(ptr str long ptr) @ stub SetupDiOpenDeviceInterfaceRegKey @ stdcall SetupDiOpenDeviceInterfaceW(ptr wstr long ptr) +@ stdcall SetupDiRegisterCoDeviceInstallers(ptr ptr) @ stdcall SetupDiRegisterDeviceInfo(ptr ptr long ptr ptr ptr) @ stdcall SetupDiRemoveDevice(ptr ptr) @ stdcall SetupDiRemoveDeviceInterface(ptr ptr)
1
0
0
0
Alistair Leslie-Hughes : setupapi: Add SetupDiInstallDeviceInterfaces.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 4d81d41899f85dc48d13a86e0045483aed9c7ad0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4d81d41899f85dc48d13a86e…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Mar 6 21:25:17 2019 +0100 setupapi: Add SetupDiInstallDeviceInterfaces. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45963
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 11 +++++++++++ dlls/setupapi/setupapi.spec | 1 + 2 files changed, 12 insertions(+) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 537b335..582da37 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -3855,3 +3855,14 @@ BOOL WINAPI SetupDiGetDevicePropertyW(HDEVINFO devinfo, PSP_DEVINFO_DATA device_ SetLastError(ls); return !ls; } + +/*********************************************************************** + * SetupDiInstallDeviceInterfaces (SETUPAPI.@) + */ +BOOL WINAPI SetupDiInstallDeviceInterfaces(HDEVINFO dev, PSP_DEVINFO_DATA info_data) +{ + FIXME("%p, %p stub\n", dev, info_data); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index d633211..1be2b62 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -367,6 +367,7 @@ @ stub SetupDiInstallClassExW @ stdcall SetupDiInstallClassW(long wstr long ptr) @ stub SetupDiInstallDevice +@ stdcall SetupDiInstallDeviceInterfaces(ptr ptr) @ stub SetupDiInstallDriverFiles @ stdcall SetupDiLoadClassIcon(ptr ptr ptr) @ stub SetupDiMoveDuplicateDevice
1
0
0
0
Alistair Leslie-Hughes : setupapi: Added CM_Request_Device_EjectA/W stub.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: 343e486e83fc9667bfeac22519f1b0c31e29c1f5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=343e486e83fc9667bfeac225…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Mar 6 21:25:16 2019 +0100 setupapi: Added CM_Request_Device_EjectA/W stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45879
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/setupapi.spec | 4 ++-- dlls/setupapi/stubs.c | 18 ++++++++++++++++++ include/cfgmgr32.h | 20 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index cea6dac..d633211 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -168,8 +168,8 @@ @ stub CM_Remove_SubTree_Ex @ stub CM_Remove_Unmarked_Children @ stub CM_Remove_Unmarked_Children_Ex -@ stub CM_Request_Device_EjectA -@ stub CM_Request_Device_EjectW +@ stdcall CM_Request_Device_EjectA(ptr ptr ptr long long) +@ stdcall CM_Request_Device_EjectW(ptr ptr ptr long long) @ stub CM_Request_Eject_PC @ stub CM_Reset_Children_Marks @ stub CM_Reset_Children_Marks_Ex diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index 4994ca4..4db32dd 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -696,3 +696,21 @@ BOOL WINAPI SetupDiEnumDriverInfoW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA Devi SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/*********************************************************************** + * CM_Request_Device_EjectA (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Request_Device_EjectA(DEVINST dev, PPNP_VETO_TYPE type, LPSTR name, ULONG length, ULONG flags) +{ + FIXME("(0x%08x, %p, %p, %u, 0x%08x) stub\n", dev, type, name, length, flags); + return CR_SUCCESS; +} + +/*********************************************************************** + * CM_Request_Device_EjectW (SETUPAPI.@) + */ +CONFIGRET WINAPI CM_Request_Device_EjectW(DEVINST dev, PPNP_VETO_TYPE type, LPWSTR name, ULONG length, ULONG flags) +{ + FIXME("(0x%08x, %p, %p, %u, 0x%08x) stub\n", dev, type, name, length, flags); + return CR_SUCCESS; +} diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h index da09115..15340a6 100644 --- a/include/cfgmgr32.h +++ b/include/cfgmgr32.h @@ -175,6 +175,23 @@ typedef CHAR *DEVNODEID_A, *DEVINSTID_A; typedef WCHAR *DEVNODEID_W, *DEVINSTID_W; typedef ULONG REGDISPOSITION; +typedef enum _PNP_VETO_TYPE +{ + PNP_VetoTypeUnknown, + PNP_VetoLegacyDevice, + PNP_VetoPendingClose, + PNP_VetoWindowsApp, + PNP_VetoWindowsService, + PNP_VetoOutstandingOpen, + PNP_VetoDevice, + PNP_VetoDriver, + PNP_VetoIllegalDeviceRequest, + PNP_VetoInsufficientPower, + PNP_VetoNonDisableable, + PNP_VetoLegacyDriver, + PNP_VetoInsufficientRights +} PNP_VETO_TYPE, *PPNP_VETO_TYPE; + DECL_WINELIB_CFGMGR32_TYPE_AW(DEVNODEID) DECL_WINELIB_CFGMGR32_TYPE_AW(DEVINSTID) @@ -213,6 +230,9 @@ CMAPI CONFIGRET WINAPI CM_Locate_DevNodeW(PDEVINST,DEVINSTID_W,ULONG); #define CM_Locate_DevNode WINELIB_NAME_AW(CM_Locate_DevNode) CMAPI CONFIGRET WINAPI CM_Open_DevNode_Key(DEVINST dnDevInst, REGSAM access, ULONG ulHardwareProfile, REGDISPOSITION disposition, PHKEY phkDevice, ULONG ulFlags); +CMAPI CONFIGRET WINAPI CM_Request_Device_EjectA(DEVINST dev, PPNP_VETO_TYPE type, LPSTR name, ULONG length, ULONG flags); +CMAPI CONFIGRET WINAPI CM_Request_Device_EjectW(DEVINST dev, PPNP_VETO_TYPE type, LPWSTR name, ULONG length, ULONG flags); +#define CM_Request_Device_Eject WINELIB_NAME_AW(CM_Get_Device_ID_List_Ex) #ifdef __cplusplus }
1
0
0
0
Michael Müller : msvidc32: Fix calculation of stride and size.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: fb7f937305f9242c675d4ff9a7976cf121710159 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fb7f937305f9242c675d4ff9…
Author: Michael Müller <michael(a)fds-team.de> Date: Wed Mar 6 08:57:40 2019 +0100 msvidc32: Fix calculation of stride and size. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=23175
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=25180
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvfw32/tests/msvfw.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/msvidc32/msvideo1.c | 34 +++++++++++++++++++++++++--------- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c index 2468f6f..2d85e26 100644 --- a/dlls/msvfw32/tests/msvfw.c +++ b/dlls/msvfw32/tests/msvfw.c @@ -252,6 +252,45 @@ static void test_Locate(void) ok(err == ICERR_OK, "Query MSVC 16->24: %d\n", err); bo.biBitCount = 16; + bi.biWidth = 553; + + bi.biBitCount = 8; + err = ICDecompressGetFormat(h, &bi, &tmp); + ok(err == ICERR_OK, "Query MSVC output format: %d\n", err); + ok(tmp.biBitCount == 8, "Expected 8 bit, got %d bit\n", tmp.biBitCount); + ok(tmp.biWidth == 552, "Expected width 552, got %d\n", tmp.biWidth); + ok(tmp.biSizeImage == get_stride(552, 8) * 8, "Expected size %d, got %d\n", + get_stride(552, 8) * 8, tmp.biSizeImage); + + bi.biBitCount = 15; + err = ICDecompressGetFormat(h, &bi, &tmp); + ok(err == ICERR_BADFORMAT, "Query MSVC output format: %d\n", err); + + bi.biBitCount = 16; + err = ICDecompressGetFormat(h, &bi, &tmp); + ok(err == ICERR_OK, "Query MSVC output format: %d\n", err); + ok(tmp.biBitCount == 16, "Expected 16 bit, got %d bit\n", tmp.biBitCount); + ok(tmp.biWidth == 552, "Expected width 552, got %d\n", tmp.biWidth); + ok(tmp.biSizeImage == get_stride(552, 16) * 8, "Expected size %d, got %d\n", + get_stride(552, 16) * 8, tmp.biSizeImage); + + bi.biBitCount = 24; + err = ICDecompressGetFormat(h, &bi, &tmp); + ok(err == ICERR_BADFORMAT, "Query MSVC output format: %d\n", err); + + bi.biBitCount = 32; + err = ICDecompressGetFormat(h, &bi, &tmp); + ok(err == ICERR_BADFORMAT, "Query MSVC output format: %d\n", err); + + bi.biHeight = 17; + bi.biBitCount = 8; + err = ICDecompressGetFormat(h, &bi, &tmp); + ok(err == ICERR_OK, "Query MSVC output format: %d\n", err); + ok(tmp.biHeight == 16, "Expected height 16, got %d\n", tmp.biHeight); + bi.biHeight = 8; + + bi.biWidth = 32; + bi.biCompression = mmioFOURCC('m','s','v','c'); err = ICDecompressQuery(h, &bi, &bo); ok(err == ICERR_BADFORMAT, "Query msvc->RGB16: %d\n", err); diff --git a/dlls/msvidc32/msvideo1.c b/dlls/msvidc32/msvideo1.c index 9c1323b..7b866d0 100644 --- a/dlls/msvidc32/msvideo1.c +++ b/dlls/msvidc32/msvideo1.c @@ -70,6 +70,11 @@ typedef struct Msvideo1Context { int depth; } Msvideo1Context; +static inline int get_stride(int width, int depth) +{ + return ((depth * width + 31) >> 3) & ~3; +} + static void msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_size, unsigned char *pixels, int stride) @@ -362,12 +367,17 @@ CRAM_DecompressGetFormat( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO o if (in->bmiHeader.biBitCount <= 8) size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD); + if (in->bmiHeader.biBitCount != 8 && in->bmiHeader.biBitCount != 16) + return ICERR_BADFORMAT; + if( out ) { memcpy( out, in, size ); + out->bmiHeader.biWidth = in->bmiHeader.biWidth & ~1; + out->bmiHeader.biHeight = in->bmiHeader.biHeight & ~1; out->bmiHeader.biCompression = BI_RGB; - out->bmiHeader.biSizeImage = in->bmiHeader.biHeight - * in->bmiHeader.biWidth *4; + out->bmiHeader.biSizeImage = in->bmiHeader.biHeight * + get_stride(out->bmiHeader.biWidth, out->bmiHeader.biBitCount); return ICERR_OK; } @@ -398,6 +408,8 @@ static LRESULT CRAM_DecompressBegin( Msvideo1Context *info, LPBITMAPINFO in, LPB static void convert_depth(char *input, int depth_in, char *output, BITMAPINFOHEADER *out_hdr) { int x, y; + int stride_in = get_stride(out_hdr->biWidth, depth_in); + int stride_out = get_stride(out_hdr->biWidth, out_hdr->biBitCount); if (depth_in == 16 && out_hdr->biBitCount == 24) { @@ -409,15 +421,17 @@ static void convert_depth(char *input, int depth_in, char *output, BITMAPINFOHEA 0xc5, 0xce, 0xd6, 0xde, 0xe6, 0xef, 0xf7, 0xff, }; - WORD *src = (WORD *)input; for (y = 0; y < out_hdr->biHeight; y++) { + WORD *src_row = (WORD *)(input + y * stride_in); + char *out_row = output + y * stride_out; + for (x = 0; x < out_hdr->biWidth; x++) { - WORD pixel = *src++; - *output++ = convert_5to8[(pixel & 0x7c00u) >> 10]; - *output++ = convert_5to8[(pixel & 0x03e0u) >> 5]; - *output++ = convert_5to8[(pixel & 0x001fu)]; + WORD pixel = *src_row++; + *out_row++ = convert_5to8[(pixel & 0x7c00u) >> 10]; + *out_row++ = convert_5to8[(pixel & 0x03e0u) >> 5]; + *out_row++ = convert_5to8[(pixel & 0x001fu)]; } } } @@ -439,7 +453,6 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD width = icd->lpbiInput->biWidth; height = icd->lpbiInput->biHeight; - stride = width; /* in bytes or 16bit words */ sz = icd->lpbiInput->biSizeImage; output = icd->lpOutput; @@ -452,11 +465,13 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD if (info->depth == 8) { + stride = get_stride(width, 8); msvideo1_decode_8bit( width, height, icd->lpInput, sz, output, stride ); } else { + stride = get_stride(width, 16) / 2; msvideo1_decode_16bit( width, height, icd->lpInput, sz, output, stride ); } @@ -484,7 +499,6 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DW width = icd->lpbiSrc->biWidth; height = icd->lpbiSrc->biHeight; - stride = width; sz = icd->lpbiSrc->biSizeImage; output = icd->lpDst; @@ -497,11 +511,13 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DW if (info->depth == 8) { + stride = get_stride(width, 8); msvideo1_decode_8bit( width, height, icd->lpSrc, sz, output, stride ); } else { + stride = get_stride(width, 16) / 2; msvideo1_decode_16bit( width, height, icd->lpSrc, sz, output, stride ); }
1
0
0
0
Michael Müller : msvidc32: Add support for converting 16 bit depth to 24 bit.
by Alexandre Julliard
07 Mar '19
07 Mar '19
Module: wine Branch: master Commit: e287917a3aefbf0f3d882a9096de8f12a2598164 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e287917a3aefbf0f3d882a90…
Author: Michael Müller <michael(a)fds-team.de> Date: Wed Mar 6 08:57:39 2019 +0100 msvidc32: Add support for converting 16 bit depth to 24 bit. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=14695
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvfw32/tests/msvfw.c | 5 +++ dlls/msvidc32/msvideo1.c | 91 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 84 insertions(+), 12 deletions(-) diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c index 6c5584a..2468f6f 100644 --- a/dlls/msvfw32/tests/msvfw.c +++ b/dlls/msvfw32/tests/msvfw.c @@ -247,6 +247,11 @@ static void test_Locate(void) todo_wine ok(err == ICERR_OK, "Query MSVC->RGB16 height<0: %d\n", err); bo.biHeight = -bo.biHeight; + bo.biBitCount = 24; + err = ICDecompressQuery(h, &bi, &bo); + ok(err == ICERR_OK, "Query MSVC 16->24: %d\n", err); + bo.biBitCount = 16; + bi.biCompression = mmioFOURCC('m','s','v','c'); err = ICDecompressQuery(h, &bi, &bo); ok(err == ICERR_BADFORMAT, "Query msvc->RGB16: %d\n", err); diff --git a/dlls/msvidc32/msvideo1.c b/dlls/msvidc32/msvideo1.c index 5a750d1..9c1323b 100644 --- a/dlls/msvidc32/msvideo1.c +++ b/dlls/msvidc32/msvideo1.c @@ -67,7 +67,7 @@ typedef BYTE uint8_t; typedef struct Msvideo1Context { DWORD dwMagic; - BOOL mode_8bit; /* if it's not 8-bit, it's 16-bit */ + int depth; } Msvideo1Context; static void @@ -327,8 +327,15 @@ CRAM_DecompressQuery( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out ) TRACE("out->bpp = %d\n", out->bmiHeader.biBitCount ); TRACE("out->height = %d\n", out->bmiHeader.biHeight ); TRACE("out->width = %d\n", out->bmiHeader.biWidth ); - if(( in->bmiHeader.biBitCount != out->bmiHeader.biBitCount ) || - ( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) || + + if ((in->bmiHeader.biBitCount != out->bmiHeader.biBitCount) && + (in->bmiHeader.biBitCount != 16 || out->bmiHeader.biBitCount != 24)) + { + TRACE("incompatible depth requested\n"); + return ICERR_BADFORMAT; + } + + if(( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) || ( in->bmiHeader.biHeight != out->bmiHeader.biHeight ) || ( in->bmiHeader.biWidth != out->bmiHeader.biWidth )) { @@ -376,21 +383,52 @@ static LRESULT CRAM_DecompressBegin( Msvideo1Context *info, LPBITMAPINFO in, LPB TRACE("bitmap is %d bpp\n", in->bmiHeader.biBitCount); if( in->bmiHeader.biBitCount == 8 ) - info->mode_8bit = TRUE; + info->depth = 8; else if( in->bmiHeader.biBitCount == 16 ) - info->mode_8bit = FALSE; + info->depth = 16; else { - info->mode_8bit = FALSE; + info->depth = 0; FIXME("Unsupported output format %i\n", in->bmiHeader.biBitCount); } return ICERR_OK; } +static void convert_depth(char *input, int depth_in, char *output, BITMAPINFOHEADER *out_hdr) +{ + int x, y; + + if (depth_in == 16 && out_hdr->biBitCount == 24) + { + static const unsigned char convert_5to8[] = + { + 0x00, 0x08, 0x10, 0x19, 0x21, 0x29, 0x31, 0x3a, + 0x42, 0x4a, 0x52, 0x5a, 0x63, 0x6b, 0x73, 0x7b, + 0x84, 0x8c, 0x94, 0x9c, 0xa5, 0xad, 0xb5, 0xbd, + 0xc5, 0xce, 0xd6, 0xde, 0xe6, 0xef, 0xf7, 0xff, + }; + + WORD *src = (WORD *)input; + for (y = 0; y < out_hdr->biHeight; y++) + { + for (x = 0; x < out_hdr->biWidth; x++) + { + WORD pixel = *src++; + *output++ = convert_5to8[(pixel & 0x7c00u) >> 10]; + *output++ = convert_5to8[(pixel & 0x03e0u) >> 5]; + *output++ = convert_5to8[(pixel & 0x001fu)]; + } + } + } + else + FIXME("Conversion from %d to %d bit unimplemented\n", depth_in, out_hdr->biBitCount); +} + static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD size ) { LONG width, height, stride, sz; + void *output; TRACE("ICM_DECOMPRESS %p %p %d\n", info, icd, size); @@ -404,15 +442,29 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD stride = width; /* in bytes or 16bit words */ sz = icd->lpbiInput->biSizeImage; - if (info->mode_8bit) + output = icd->lpOutput; + + if (icd->lpbiOutput->biBitCount != info->depth) + { + output = HeapAlloc(GetProcessHeap(), 0, icd->lpbiOutput->biWidth * icd->lpbiOutput->biHeight * info->depth / 8); + if (!output) return ICERR_MEMORY; + } + + if (info->depth == 8) { msvideo1_decode_8bit( width, height, icd->lpInput, sz, - icd->lpOutput, stride); + output, stride ); } else { msvideo1_decode_16bit( width, height, icd->lpInput, sz, - icd->lpOutput, stride); + output, stride ); + } + + if (icd->lpbiOutput->biBitCount != info->depth) + { + convert_depth(output, info->depth, icd->lpOutput, icd->lpbiOutput); + HeapFree(GetProcessHeap(), 0, output); } return ICERR_OK; @@ -421,6 +473,7 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DWORD size ) { LONG width, height, stride, sz; + void *output; TRACE("ICM_DECOMPRESSEX %p %p %d\n", info, icd, size); @@ -434,15 +487,29 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DW stride = width; sz = icd->lpbiSrc->biSizeImage; - if (info->mode_8bit) + output = icd->lpDst; + + if (icd->lpbiDst->biBitCount != info->depth) + { + output = HeapAlloc(GetProcessHeap(), 0, icd->lpbiDst->biWidth * icd->lpbiDst->biHeight * info->depth / 8); + if (!output) return ICERR_MEMORY; + } + + if (info->depth == 8) { msvideo1_decode_8bit( width, height, icd->lpSrc, sz, - icd->lpDst, stride); + output, stride ); } else { msvideo1_decode_16bit( width, height, icd->lpSrc, sz, - icd->lpDst, stride); + output, stride ); + } + + if (icd->lpbiDst->biBitCount != info->depth) + { + convert_depth(output, info->depth, icd->lpDst, icd->lpbiDst); + HeapFree(GetProcessHeap(), 0, output); } return ICERR_OK;
1
0
0
0
← Newer
1
...
70
71
72
73
74
75
76
...
110
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
Results per page:
10
25
50
100
200