Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c6106428
Commit
c6106428
authored
Jun 23, 2013
by
Christian Costa
Committed by
Alexandre Julliard
Jun 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Add support for case sensitive legacy type indexColor.
parent
cf2c506b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
12 deletions
+34
-12
xfile.c
dlls/d3dx9_36/tests/xfile.c
+1
-1
d3dxof.c
dlls/d3dxof/d3dxof.c
+16
-2
parsing.c
dlls/d3dxof/parsing.c
+16
-8
d3dxof.c
dlls/d3dxof/tests/d3dxof.c
+1
-1
No files found.
dlls/d3dx9_36/tests/xfile.c
View file @
c6106428
...
@@ -237,7 +237,7 @@ static void test_type_index_color(void)
...
@@ -237,7 +237,7 @@ static void test_type_index_color(void)
/* Test that 'indexColor' can be used (same as IndexedColor in standard templates) and is case sensitive */
/* Test that 'indexColor' can be used (same as IndexedColor in standard templates) and is case sensitive */
ret
=
d3dxfile
->
lpVtbl
->
RegisterTemplates
(
d3dxfile
,
template_using_index_color_lower
,
sizeof
(
template_using_index_color_lower
)
-
1
);
ret
=
d3dxfile
->
lpVtbl
->
RegisterTemplates
(
d3dxfile
,
template_using_index_color_lower
,
sizeof
(
template_using_index_color_lower
)
-
1
);
todo_wine
ok
(
ret
==
S_OK
,
"RegisterTemplates failed with %#x
\n
"
,
ret
);
ok
(
ret
==
S_OK
,
"RegisterTemplates failed with %#x
\n
"
,
ret
);
ret
=
d3dxfile
->
lpVtbl
->
RegisterTemplates
(
d3dxfile
,
template_using_index_color_upper
,
sizeof
(
template_using_index_color_upper
)
-
1
);
ret
=
d3dxfile
->
lpVtbl
->
RegisterTemplates
(
d3dxfile
,
template_using_index_color_upper
,
sizeof
(
template_using_index_color_upper
)
-
1
);
ok
(
ret
==
D3DXFERR_PARSEERROR
,
"RegisterTemplates returned %#x instead of %#x
\n
"
,
ret
,
D3DXFERR_PARSEERROR
);
ok
(
ret
==
D3DXFERR_PARSEERROR
,
"RegisterTemplates returned %#x instead of %#x
\n
"
,
ret
,
D3DXFERR_PARSEERROR
);
...
...
dlls/d3dxof/d3dxof.c
View file @
c6106428
...
@@ -46,6 +46,9 @@ static HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImp
...
@@ -46,6 +46,9 @@ static HRESULT IDirectXFileDataReferenceImpl_Create(IDirectXFileDataReferenceImp
static
HRESULT
IDirectXFileEnumObjectImpl_Create
(
IDirectXFileEnumObjectImpl
**
ppObj
);
static
HRESULT
IDirectXFileEnumObjectImpl_Create
(
IDirectXFileEnumObjectImpl
**
ppObj
);
static
HRESULT
IDirectXFileSaveObjectImpl_Create
(
IDirectXFileSaveObjectImpl
**
ppObj
);
static
HRESULT
IDirectXFileSaveObjectImpl_Create
(
IDirectXFileSaveObjectImpl
**
ppObj
);
#define TOKEN_DWORD 41
#define TOKEN_FLOAT 42
HRESULT
IDirectXFileImpl_Create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
HRESULT
IDirectXFileImpl_Create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
{
{
IDirectXFileImpl
*
object
;
IDirectXFileImpl
*
object
;
...
@@ -62,6 +65,17 @@ HRESULT IDirectXFileImpl_Create(IUnknown* pUnkOuter, LPVOID* ppObj)
...
@@ -62,6 +65,17 @@ HRESULT IDirectXFileImpl_Create(IUnknown* pUnkOuter, LPVOID* ppObj)
object
->
IDirectXFile_iface
.
lpVtbl
=
&
IDirectXFile_Vtbl
;
object
->
IDirectXFile_iface
.
lpVtbl
=
&
IDirectXFile_Vtbl
;
object
->
ref
=
1
;
object
->
ref
=
1
;
/* Reserve first template to handle the case sensitive legacy type indexColor */
object
->
nb_xtemplates
=
1
;
strcpy
(
object
->
xtemplates
[
0
].
name
,
"indexColor"
);
object
->
xtemplates
[
0
].
nb_members
=
2
;
object
->
xtemplates
[
0
].
members
[
0
].
type
=
TOKEN_DWORD
;
object
->
xtemplates
[
0
].
members
[
0
].
nb_dims
=
0
;
object
->
xtemplates
[
0
].
members
[
1
].
type
=
TOKEN_FLOAT
;
object
->
xtemplates
[
0
].
members
[
1
].
nb_dims
=
1
;
object
->
xtemplates
[
0
].
members
[
1
].
dim_fixed
[
0
]
=
TRUE
;
object
->
xtemplates
[
0
].
members
[
1
].
dim_value
[
0
]
=
4
;
*
ppObj
=
&
object
->
IDirectXFile_iface
;
*
ppObj
=
&
object
->
IDirectXFile_iface
;
return
S_OK
;
return
S_OK
;
...
@@ -252,7 +266,7 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
...
@@ -252,7 +266,7 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV
{
{
ULONG
i
;
ULONG
i
;
TRACE
(
"Registered templates (%d):
\n
"
,
This
->
nb_xtemplates
);
TRACE
(
"Registered templates (%d):
\n
"
,
This
->
nb_xtemplates
);
for
(
i
=
0
;
i
<
This
->
nb_xtemplates
;
i
++
)
for
(
i
=
1
;
i
<
This
->
nb_xtemplates
;
i
++
)
DPRINTF
(
"%s - %s
\n
"
,
This
->
xtemplates
[
i
].
name
,
debugstr_guid
(
&
This
->
xtemplates
[
i
].
class_id
));
DPRINTF
(
"%s - %s
\n
"
,
This
->
xtemplates
[
i
].
name
,
debugstr_guid
(
&
This
->
xtemplates
[
i
].
class_id
));
}
}
...
@@ -330,7 +344,7 @@ static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile* iface, LP
...
@@ -330,7 +344,7 @@ static HRESULT WINAPI IDirectXFileImpl_RegisterTemplates(IDirectXFile* iface, LP
{
{
ULONG
i
;
ULONG
i
;
TRACE
(
"Registered templates (%d):
\n
"
,
This
->
nb_xtemplates
);
TRACE
(
"Registered templates (%d):
\n
"
,
This
->
nb_xtemplates
);
for
(
i
=
0
;
i
<
This
->
nb_xtemplates
;
i
++
)
for
(
i
=
1
;
i
<
This
->
nb_xtemplates
;
i
++
)
DPRINTF
(
"%s - %s
\n
"
,
This
->
xtemplates
[
i
].
name
,
debugstr_guid
(
&
This
->
xtemplates
[
i
].
class_id
));
DPRINTF
(
"%s - %s
\n
"
,
This
->
xtemplates
[
i
].
name
,
debugstr_guid
(
&
This
->
xtemplates
[
i
].
class_id
));
}
}
...
...
dlls/d3dxof/parsing.c
View file @
c6106428
...
@@ -961,17 +961,25 @@ static BOOL parse_template_members_list(parse_buffer * buf)
...
@@ -961,17 +961,25 @@ static BOOL parse_template_members_list(parse_buffer * buf)
if
(
check_TOKEN
(
buf
)
==
TOKEN_NAME
)
if
(
check_TOKEN
(
buf
)
==
TOKEN_NAME
)
{
{
cur_member
->
type
=
get_TOKEN
(
buf
);
cur_member
->
type
=
get_TOKEN
(
buf
);
cur_member
->
idx_template
=
0
;
if
(
!
strcmp
((
char
*
)
buf
->
value
,
"indexColor"
))
while
(
cur_member
->
idx_template
<
buf
->
pdxf
->
nb_xtemplates
)
{
{
if
(
!
strcasecmp
((
char
*
)
buf
->
value
,
buf
->
pdxf
->
xtemplates
[
cur_member
->
idx_template
].
name
))
/* Case sensitive legacy type indexColor is described in the first template */
break
;
cur_member
->
idx_template
=
0
;
cur_member
->
idx_template
++
;
}
}
if
(
cur_member
->
idx_template
==
buf
->
pdxf
->
nb_xtemplates
)
else
{
{
ERR
(
"Reference to a nonexistent template '%s'
\n
"
,
(
char
*
)
buf
->
value
);
cur_member
->
idx_template
=
1
;
return
FALSE
;
while
(
cur_member
->
idx_template
<
buf
->
pdxf
->
nb_xtemplates
)
{
if
(
!
strcasecmp
((
char
*
)
buf
->
value
,
buf
->
pdxf
->
xtemplates
[
cur_member
->
idx_template
].
name
))
break
;
cur_member
->
idx_template
++
;
}
if
(
cur_member
->
idx_template
==
buf
->
pdxf
->
nb_xtemplates
)
{
WARN
(
"Reference to a nonexistent template '%s'
\n
"
,
(
char
*
)
buf
->
value
);
return
FALSE
;
}
}
}
}
}
else
if
(
is_primitive_type
(
check_TOKEN
(
buf
)))
else
if
(
is_primitive_type
(
check_TOKEN
(
buf
)))
...
...
dlls/d3dxof/tests/d3dxof.c
View file @
c6106428
...
@@ -1103,7 +1103,7 @@ static void test_type_index_color(void)
...
@@ -1103,7 +1103,7 @@ static void test_type_index_color(void)
/* Test that 'indexColor' can be used (same as IndexedColor in standard templates) and is case sensitive */
/* Test that 'indexColor' can be used (same as IndexedColor in standard templates) and is case sensitive */
ret
=
IDirectXFile_RegisterTemplates
(
dxfile
,
template_using_index_color_lower
,
sizeof
(
template_using_index_color_lower
)
-
1
);
ret
=
IDirectXFile_RegisterTemplates
(
dxfile
,
template_using_index_color_lower
,
sizeof
(
template_using_index_color_lower
)
-
1
);
todo_wine
ok
(
ret
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates failed with %#x
\n
"
,
ret
);
ok
(
ret
==
DXFILE_OK
,
"IDirectXFileImpl_RegisterTemplates failed with %#x
\n
"
,
ret
);
ret
=
IDirectXFile_RegisterTemplates
(
dxfile
,
template_using_index_color_upper
,
sizeof
(
template_using_index_color_upper
)
-
1
);
ret
=
IDirectXFile_RegisterTemplates
(
dxfile
,
template_using_index_color_upper
,
sizeof
(
template_using_index_color_upper
)
-
1
);
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"IDirectXFileImpl_RegisterTemplates returned %#x instead of %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
ok
(
ret
==
DXFILEERR_PARSEERROR
,
"IDirectXFileImpl_RegisterTemplates returned %#x instead of %#x
\n
"
,
ret
,
DXFILEERR_PARSEERROR
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment