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
eb55412f
Commit
eb55412f
authored
May 18, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
May 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Correctly check if a texture is dynamic in D3DXCreateTextureFromFileInMemoryEx.
parent
1a4f1edf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
texture.c
dlls/d3dx9_36/tests/texture.c
+11
-0
texture.c
dlls/d3dx9_36/texture.c
+3
-1
No files found.
dlls/d3dx9_36/tests/texture.c
View file @
eb55412f
...
...
@@ -1238,6 +1238,17 @@ static void test_D3DXCreateTextureFromFileInMemoryEx(IDirect3DDevice9 *device)
D3DUSAGE_DYNAMIC
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
IDirect3DTexture9_Release
(
texture
);
if
(
!
is_autogenmipmap_supported
(
device
,
D3DRTYPE_TEXTURE
))
{
skip
(
"No D3DUSAGE_AUTOGENMIPMAP support for textures
\n
"
);
return
;
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DUSAGE_DYNAMIC
|
D3DUSAGE_AUTOGENMIPMAP
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
IDirect3DTexture9_Release
(
texture
);
}
static
void
test_D3DXCreateCubeTextureFromFileInMemory
(
IDirect3DDevice9
*
device
)
...
...
dlls/d3dx9_36/texture.c
View file @
eb55412f
...
...
@@ -513,6 +513,7 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device,
IDirect3DSurface9
*
surface
;
BOOL
file_width
=
FALSE
,
file_height
=
FALSE
;
BOOL
file_format
=
FALSE
,
file_miplevels
=
FALSE
;
BOOL
dynamic_texture
;
D3DXIMAGE_INFO
imginfo
;
UINT
loaded_miplevels
;
D3DCAPS9
caps
;
...
...
@@ -600,7 +601,8 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device,
return
D3DERR_INVALIDCALL
;
/* Create the to-be-filled texture */
if
(
pool
==
D3DPOOL_DEFAULT
&&
!
((
caps
.
Caps2
&
D3DCAPS2_DYNAMICTEXTURES
)
&&
usage
==
D3DUSAGE_DYNAMIC
))
dynamic_texture
=
(
caps
.
Caps2
&
D3DCAPS2_DYNAMICTEXTURES
)
&&
(
usage
&
D3DUSAGE_DYNAMIC
);
if
(
pool
==
D3DPOOL_DEFAULT
&&
!
dynamic_texture
)
{
hr
=
D3DXCreateTexture
(
device
,
width
,
height
,
miplevels
,
usage
,
format
,
D3DPOOL_SYSTEMMEM
,
&
buftex
);
texptr
=
&
buftex
;
...
...
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