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
f1938898
Commit
f1938898
authored
Jun 01, 2009
by
Tony Wasserka
Committed by
Alexandre Julliard
Jun 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Redirect D3DXGetImageInfo functions to the FromFileInMemory variant.
parent
32d2be57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
10 deletions
+104
-10
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+2
-0
surface.c
dlls/d3dx9_36/surface.c
+102
-10
No files found.
dlls/d3dx9_36/d3dx9_36_private.h
View file @
f1938898
...
...
@@ -23,7 +23,9 @@
#include <stdarg.h>
#define COBJMACROS
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "d3dx9.h"
/* for internal use */
...
...
dlls/d3dx9_36/surface.c
View file @
f1938898
...
...
@@ -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
;
}
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