Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
176d27e8
Commit
176d27e8
authored
Jun 01, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Use wine_dbgstr_rect() in some more places.
parent
34c9586b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
128 deletions
+116
-128
font.c
dlls/d3dx9_36/font.c
+12
-11
sprite.c
dlls/d3dx9_36/sprite.c
+4
-3
surface.c
dlls/d3dx9_36/surface.c
+100
-114
No files found.
dlls/d3dx9_36/font.c
View file @
176d27e8
...
...
@@ -145,10 +145,11 @@ static HDC WINAPI ID3DXFontImpl_GetDC(ID3DXFont *iface)
}
static
HRESULT
WINAPI
ID3DXFontImpl_GetGlyphData
(
ID3DXFont
*
iface
,
UINT
glyph
,
LPDIRECT3DTEXTURE9
*
texture
,
RECT
*
blackbox
,
POINT
*
cellinc
)
IDirect3DTexture9
*
*
texture
,
RECT
*
blackbox
,
POINT
*
cellinc
)
{
ID3DXFontImpl
*
This
=
impl_from_ID3DXFont
(
iface
);
FIXME
(
"(%p)->(%u, %p, %p, %p): stub
\n
"
,
This
,
glyph
,
texture
,
blackbox
,
cellinc
);
FIXME
(
"iface %p, glyph %#x, texture %p, baclbox %s, cellinc %s stub!
\n
"
,
iface
,
glyph
,
texture
,
wine_dbgstr_rect
(
blackbox
),
wine_dbgstr_point
(
cellinc
));
return
D3D_OK
;
}
...
...
@@ -180,19 +181,19 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, LPCWSTR strin
return
D3D_OK
;
}
static
INT
WINAPI
ID3DXFontImpl_DrawTextA
(
ID3DXFont
*
iface
,
LPD3DXSPRITE
sprite
,
LPCSTR
string
,
INT
count
,
LPRECT
rect
,
DWORD
format
,
D3DCOLOR
color
)
static
INT
WINAPI
ID3DXFontImpl_DrawTextA
(
ID3DXFont
*
iface
,
ID3DXSprite
*
sprite
,
const
char
*
string
,
INT
count
,
RECT
*
rect
,
DWORD
format
,
D3DCOLOR
color
)
{
ID3DXFontImpl
*
This
=
impl_from_ID3DXFont
(
iface
);
FIXME
(
"(%p)->(%p, %s, %d, %p, %d, %#x): stub
\n
"
,
This
,
sprite
,
string
,
count
,
rect
,
format
,
color
);
FIXME
(
"iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!
\n
"
,
iface
,
sprite
,
debugstr_a
(
string
),
count
,
wine_dbgstr_rect
(
rect
),
format
,
color
);
return
1
;
}
static
INT
WINAPI
ID3DXFontImpl_DrawTextW
(
ID3DXFont
*
iface
,
LPD3DXSPRITE
sprite
,
LPCWSTR
string
,
INT
count
,
LPRECT
rect
,
DWORD
format
,
D3DCOLOR
color
)
static
INT
WINAPI
ID3DXFontImpl_DrawTextW
(
ID3DXFont
*
iface
,
ID3DXSprite
*
sprite
,
const
WCHAR
*
string
,
INT
count
,
RECT
*
rect
,
DWORD
format
,
D3DCOLOR
color
)
{
ID3DXFontImpl
*
This
=
impl_from_ID3DXFont
(
iface
);
FIXME
(
"(%p)->(%p, %s, %d, %p, %d, %#x): stub
\n
"
,
This
,
sprite
,
debugstr_w
(
string
),
count
,
rect
,
format
,
color
);
FIXME
(
"iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!
\n
"
,
iface
,
sprite
,
debugstr_w
(
string
),
count
,
wine_dbgstr_rect
(
rect
),
format
,
color
);
return
1
;
}
...
...
dlls/d3dx9_36/sprite.c
View file @
176d27e8
...
...
@@ -317,13 +317,14 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often)
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXSpriteImpl_Draw
(
ID3DXSprite
*
iface
,
LPDIRECT3DTEXTURE9
texture
,
CONST
RECT
*
rect
,
CONST
D3DXVECTOR3
*
center
,
CONST
D3DXVECTOR3
*
position
,
D3DCOLOR
color
)
static
HRESULT
WINAPI
ID3DXSpriteImpl_Draw
(
ID3DXSprite
*
iface
,
IDirect3DTexture9
*
texture
,
const
RECT
*
rect
,
const
D3DXVECTOR3
*
center
,
const
D3DXVECTOR3
*
position
,
D3DCOLOR
color
)
{
ID3DXSpriteImpl
*
This
=
impl_from_ID3DXSprite
(
iface
);
D3DSURFACE_DESC
texdesc
;
TRACE
(
"(%p)->(%p, %p, %p, %p, %#x): relay
\n
"
,
This
,
texture
,
rect
,
center
,
position
,
color
);
TRACE
(
"iface %p, texture %p, rect %s, center %p, position %p, color 0x%08x.
\n
"
,
iface
,
texture
,
wine_dbgstr_rect
(
rect
),
center
,
position
,
color
);
if
(
texture
==
NULL
)
return
D3DERR_INVALIDCALL
;
if
(
!
This
->
ready
)
return
D3DERR_INVALIDCALL
;
...
...
dlls/d3dx9_36/surface.c
View file @
176d27e8
...
...
@@ -767,15 +767,9 @@ HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, LPCWSTR resource, D
* D3DXERR_INVALIDDATA, if pSrcData is no valid image file
*
*/
HRESULT
WINAPI
D3DXLoadSurfaceFromFileInMemory
(
LPDIRECT3DSURFACE9
pDestSurface
,
CONST
PALETTEENTRY
*
pDestPalette
,
CONST
RECT
*
pDestRect
,
LPCVOID
pSrcData
,
UINT
SrcDataSize
,
CONST
RECT
*
pSrcRect
,
DWORD
dwFilter
,
D3DCOLOR
Colorkey
,
D3DXIMAGE_INFO
*
pSrcInfo
)
HRESULT
WINAPI
D3DXLoadSurfaceFromFileInMemory
(
IDirect3DSurface9
*
pDestSurface
,
const
PALETTEENTRY
*
pDestPalette
,
const
RECT
*
pDestRect
,
const
void
*
pSrcData
,
UINT
SrcDataSize
,
const
RECT
*
pSrcRect
,
DWORD
dwFilter
,
D3DCOLOR
Colorkey
,
D3DXIMAGE_INFO
*
pSrcInfo
)
{
D3DXIMAGE_INFO
imginfo
;
HRESULT
hr
;
...
...
@@ -789,8 +783,10 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 pDestSurface,
WICRect
wicrect
;
RECT
rect
;
TRACE
(
"(%p, %p, %p, %p, %d, %p, %d, %x, %p)
\n
"
,
pDestSurface
,
pDestPalette
,
pDestRect
,
pSrcData
,
SrcDataSize
,
pSrcRect
,
dwFilter
,
Colorkey
,
pSrcInfo
);
TRACE
(
"dst_surface %p, dst_palette %p, dst_rect %s, src_data %p, src_data_size %u, "
"src_rect %s, filter %#x, color_key 0x%08x, src_info %p.
\n
"
,
pDestSurface
,
pDestPalette
,
wine_dbgstr_rect
(
pDestRect
),
pSrcData
,
SrcDataSize
,
wine_dbgstr_rect
(
pSrcRect
),
dwFilter
,
Colorkey
,
pSrcInfo
);
if
(
!
pDestSurface
||
!
pSrcData
||
!
SrcDataSize
)
return
D3DERR_INVALIDCALL
;
...
...
@@ -897,136 +893,126 @@ cleanup_err:
return
D3D_OK
;
}
/************************************************************
* D3DXLoadSurfaceFromFile
*/
HRESULT
WINAPI
D3DXLoadSurfaceFromFileA
(
LPDIRECT3DSURFACE9
pDestSurface
,
CONST
PALETTEENTRY
*
pDestPalette
,
CONST
RECT
*
pDestRect
,
LPCSTR
pSrcFile
,
CONST
RECT
*
pSrcRect
,
DWORD
dwFilter
,
D3DCOLOR
Colorkey
,
D3DXIMAGE_INFO
*
pSrcInfo
)
HRESULT
WINAPI
D3DXLoadSurfaceFromFileA
(
IDirect3DSurface9
*
dst_surface
,
const
PALETTEENTRY
*
dst_palette
,
const
RECT
*
dst_rect
,
const
char
*
src_file
,
const
RECT
*
src_rect
,
DWORD
filter
,
D3DCOLOR
color_key
,
D3DXIMAGE_INFO
*
src_info
)
{
LPWSTR
pWidename
;
HRESULT
hr
;
int
strlength
;
TRACE
(
"(%p, %p, %p, %s, %p, %u, %#x, %p): relay
\n
"
,
pDestSurface
,
pDestPalette
,
pDestRect
,
debugstr_a
(
pSrcFile
),
pSrcRect
,
dwFilter
,
Colorkey
,
pSrcInfo
);
TRACE
(
"dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
"src_rect %s, filter %#x, color_key 0x%08x, src_info %p.
\n
"
,
dst_surface
,
dst_palette
,
wine_dbgstr_rect
(
dst_rect
),
debugstr_a
(
src_file
),
wine_dbgstr_rect
(
src_rect
),
filter
,
color_key
,
src_info
);
if
(
!
pSrcFile
||
!
pDestSurface
)
return
D3DERR_INVALIDCALL
;
if
(
!
src_file
||
!
dst_surface
)
return
D3DERR_INVALIDCALL
;
strlength
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pSrcF
ile
,
-
1
,
NULL
,
0
);
strlength
=
MultiByteToWideChar
(
CP_ACP
,
0
,
src_f
ile
,
-
1
,
NULL
,
0
);
pWidename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlength
*
sizeof
(
*
pWidename
));
MultiByteToWideChar
(
CP_ACP
,
0
,
pSrcF
ile
,
-
1
,
pWidename
,
strlength
);
MultiByteToWideChar
(
CP_ACP
,
0
,
src_f
ile
,
-
1
,
pWidename
,
strlength
);
hr
=
D3DXLoadSurfaceFromFileW
(
pDestSurface
,
pDestPalette
,
pDestRect
,
pWidename
,
pSrcRect
,
dwFilter
,
Colorkey
,
pSrcInfo
);
hr
=
D3DXLoadSurfaceFromFileW
(
dst_surface
,
dst_palette
,
dst_rect
,
pWidename
,
src_rect
,
filter
,
color_key
,
src_info
);
HeapFree
(
GetProcessHeap
(),
0
,
pWidename
);
return
hr
;
}
HRESULT
WINAPI
D3DXLoadSurfaceFromFileW
(
LPDIRECT3DSURFACE9
pDestSurface
,
CONST
PALETTEENTRY
*
pDestPalette
,
CONST
RECT
*
pDestRect
,
LPCWSTR
pSrcFile
,
CONST
RECT
*
pSrcRect
,
DWORD
Filter
,
D3DCOLOR
Colorkey
,
D3DXIMAGE_INFO
*
pSrcInfo
)
HRESULT
WINAPI
D3DXLoadSurfaceFromFileW
(
IDirect3DSurface9
*
dst_surface
,
const
PALETTEENTRY
*
dst_palette
,
const
RECT
*
dst_rect
,
const
WCHAR
*
src_file
,
const
RECT
*
src_rect
,
DWORD
filter
,
D3DCOLOR
color_key
,
D3DXIMAGE_INFO
*
src_info
)
{
UINT
data_size
;
void
*
data
;
HRESULT
hr
;
DWORD
dwSize
;
LPVOID
pBuffer
;
TRACE
(
"(%p, %p, %p, %s, %p, %u, %#x, %p): relay
\n
"
,
pDestSurface
,
pDestPalette
,
pDestRect
,
debugstr_w
(
pSrcFile
),
pSrcRect
,
Filter
,
Colorkey
,
pSrcInfo
);
TRACE
(
"dst_surface %p, dst_palette %p, dst_rect %s, src_file %s, "
"src_rect %s, filter %#x, color_key 0x%08x, src_info %p.
\n
"
,
dst_surface
,
dst_palette
,
wine_dbgstr_rect
(
dst_rect
),
debugstr_w
(
src_file
),
wine_dbgstr_rect
(
src_rect
),
filter
,
color_key
,
src_info
);
if
(
!
pSrcFile
||
!
pDestSurface
)
return
D3DERR_INVALIDCALL
;
if
(
!
src_file
||
!
dst_surface
)
return
D3DERR_INVALIDCALL
;
hr
=
map_view_of_file
(
pSrcFile
,
&
pBuffer
,
&
dwSize
);
if
(
FAILED
(
hr
))
return
D3DXERR_INVALIDDATA
;
if
(
FAILED
(
map_view_of_file
(
src_file
,
&
data
,
&
data_size
)))
return
D3DXERR_INVALIDDATA
;
hr
=
D3DXLoadSurfaceFromFileInMemory
(
pDestSurface
,
pDestPalette
,
pDestRect
,
pBuffer
,
dwSize
,
pSrcRect
,
Filter
,
Colorkey
,
pSrcInfo
);
UnmapViewOfFile
(
pBuffer
);
hr
=
D3DXLoadSurfaceFromFileInMemory
(
dst_surface
,
dst_palette
,
dst_rect
,
data
,
data_size
,
src_rect
,
filter
,
color_key
,
src_info
);
UnmapViewOfFile
(
data
);
return
hr
;
}
/************************************************************
* D3DXLoadSurfaceFromResource
*/
HRESULT
WINAPI
D3DXLoadSurfaceFromResourceA
(
LPDIRECT3DSURFACE9
pDestSurface
,
CONST
PALETTEENTRY
*
pDestPalette
,
CONST
RECT
*
pDestRect
,
HMODULE
hSrcModule
,
LPCSTR
pResource
,
CONST
RECT
*
pSrcRect
,
DWORD
dwFilter
,
D3DCOLOR
Colorkey
,
D3DXIMAGE_INFO
*
pSrcInfo
)
HRESULT
WINAPI
D3DXLoadSurfaceFromResourceA
(
IDirect3DSurface9
*
dst_surface
,
const
PALETTEENTRY
*
dst_palette
,
const
RECT
*
dst_rect
,
HMODULE
src_module
,
const
char
*
resource
,
const
RECT
*
src_rect
,
DWORD
filter
,
D3DCOLOR
color_key
,
D3DXIMAGE_INFO
*
src_info
)
{
HRSRC
hResInfo
;
TRACE
(
"(%p, %p, %p, %p, %s, %p, %u, %#x, %p): relay
\n
"
,
pDestSurface
,
pDestPalette
,
pDestRect
,
hSrcModule
,
debugstr_a
(
pResource
),
pSrcRect
,
dwFilter
,
Colorkey
,
pSrcInfo
);
TRACE
(
"dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
"src_rect %s, filter %#x, color_key 0x%08x, src_info %p.
\n
"
,
dst_surface
,
dst_palette
,
wine_dbgstr_rect
(
dst_rect
),
src_module
,
debugstr_a
(
resource
),
wine_dbgstr_rect
(
src_rect
),
filter
,
color_key
,
src_info
);
if
(
!
pDestSurface
)
return
D3DERR_INVALIDCALL
;
if
(
!
dst_surface
)
return
D3DERR_INVALIDCALL
;
hResInfo
=
FindResourceA
(
hSrcModule
,
pResource
,
(
LPCSTR
)
RT_RCDATA
);
if
(
hResInfo
)
{
LPVOID
pBuffer
;
HRESULT
hr
;
DWORD
dwSize
;
if
((
hResInfo
=
FindResourceA
(
src_module
,
resource
,
(
const
char
*
)
RT_RCDATA
)))
{
UINT
data_size
;
void
*
data
;
hr
=
load_resource_into_memory
(
hSrcModule
,
hResInfo
,
&
pBuffer
,
&
dwSize
);
if
(
FAILED
(
hr
))
return
D3DXERR_INVALIDDATA
;
return
D3DXLoadSurfaceFromFileInMemory
(
pDestSurface
,
pDestPalette
,
pDestRect
,
pBuffer
,
dwSize
,
pSrcRect
,
dwFilter
,
Colorkey
,
pSrcInfo
);
if
(
FAILED
(
load_resource_into_memory
(
src_module
,
hResInfo
,
&
data
,
&
data_size
)))
return
D3DXERR_INVALIDDATA
;
return
D3DXLoadSurfaceFromFileInMemory
(
dst_surface
,
dst_palette
,
dst_rect
,
data
,
data_size
,
src_rect
,
filter
,
color_key
,
src_info
);
}
hResInfo
=
FindResourceA
(
hSrcModule
,
pResource
,
(
LPCSTR
)
RT_BITMAP
);
if
(
hResInfo
)
{
FIXME
(
"Implement loading bitmaps from resource type RT_BITMAP
\n
"
);
if
((
hResInfo
=
FindResourceA
(
src_module
,
resource
,
(
const
char
*
)
RT_BITMAP
)))
{
FIXME
(
"Implement loading bitmaps from resource type RT_BITMAP
.
\n
"
);
return
E_NOTIMPL
;
}
return
D3DXERR_INVALIDDATA
;
}
HRESULT
WINAPI
D3DXLoadSurfaceFromResourceW
(
LPDIRECT3DSURFACE9
pDestSurface
,
CONST
PALETTEENTRY
*
pDestPalette
,
CONST
RECT
*
pDestRect
,
HMODULE
hSrcModule
,
LPCWSTR
pResource
,
CONST
RECT
*
pSrcRect
,
DWORD
dwFilter
,
D3DCOLOR
Colorkey
,
D3DXIMAGE_INFO
*
pSrcInfo
)
HRESULT
WINAPI
D3DXLoadSurfaceFromResourceW
(
IDirect3DSurface9
*
dst_surface
,
const
PALETTEENTRY
*
dst_palette
,
const
RECT
*
dst_rect
,
HMODULE
src_module
,
const
WCHAR
*
resource
,
const
RECT
*
src_rect
,
DWORD
filter
,
D3DCOLOR
color_key
,
D3DXIMAGE_INFO
*
src_info
)
{
HRSRC
hResInfo
;
TRACE
(
"(%p, %p, %p, %p, %s, %p, %u, %#x, %p): relay
\n
"
,
pDestSurface
,
pDestPalette
,
pDestRect
,
hSrcModule
,
debugstr_w
(
pResource
),
pSrcRect
,
dwFilter
,
Colorkey
,
pSrcInfo
);
TRACE
(
"dst_surface %p, dst_palette %p, dst_rect %s, src_module %p, resource %s, "
"src_rect %s, filter %#x, color_key 0x%08x, src_info %p.
\n
"
,
dst_surface
,
dst_palette
,
wine_dbgstr_rect
(
dst_rect
),
src_module
,
debugstr_w
(
resource
),
wine_dbgstr_rect
(
src_rect
),
filter
,
color_key
,
src_info
);
if
(
!
pDestSurface
)
return
D3DERR_INVALIDCALL
;
if
(
!
dst_surface
)
return
D3DERR_INVALIDCALL
;
hResInfo
=
FindResourceW
(
hSrcModule
,
pResource
,
(
LPCWSTR
)
RT_RCDATA
);
if
(
hResInfo
)
{
LPVOID
pBuffer
;
HRESULT
hr
;
DWORD
dwSize
;
if
((
hResInfo
=
FindResourceW
(
src_module
,
resource
,
(
const
WCHAR
*
)
RT_RCDATA
)))
{
UINT
data_size
;
void
*
data
;
hr
=
load_resource_into_memory
(
hSrcModule
,
hResInfo
,
&
pBuffer
,
&
dwSize
);
if
(
FAILED
(
hr
))
return
D3DXERR_INVALIDDATA
;
return
D3DXLoadSurfaceFromFileInMemory
(
pDestSurface
,
pDestPalette
,
pDestRect
,
pBuffer
,
dwSize
,
pSrcRect
,
dwFilter
,
Colorkey
,
pSrcInfo
);
if
(
FAILED
(
load_resource_into_memory
(
src_module
,
hResInfo
,
&
data
,
&
data_size
)))
return
D3DXERR_INVALIDDATA
;
return
D3DXLoadSurfaceFromFileInMemory
(
dst_surface
,
dst_palette
,
dst_rect
,
data
,
data_size
,
src_rect
,
filter
,
color_key
,
src_info
);
}
hResInfo
=
FindResourceW
(
hSrcModule
,
pResource
,
(
LPCWSTR
)
RT_BITMAP
);
if
(
hResInfo
)
{
FIXME
(
"Implement loading bitmaps from resource type RT_BITMAP
\n
"
);
if
((
hResInfo
=
FindResourceW
(
src_module
,
resource
,
(
const
WCHAR
*
)
RT_BITMAP
)))
{
FIXME
(
"Implement loading bitmaps from resource type RT_BITMAP
.
\n
"
);
return
E_NOTIMPL
;
}
return
D3DXERR_INVALIDDATA
;
}
...
...
@@ -1543,38 +1529,38 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
* D3DXERR_INVALIDDATA, if one of the surfaces is not lockable
*
*/
HRESULT
WINAPI
D3DXLoadSurfaceFromSurface
(
LPDIRECT3DSURFACE9
pDestSurface
,
CONST
PALETTEENTRY
*
pDestPalette
,
CONST
RECT
*
pDestRect
,
LPDIRECT3DSURFACE9
pSrcSurface
,
CONST
PALETTEENTRY
*
pSrcPalette
,
CONST
RECT
*
pSrcRect
,
DWORD
dwFilter
,
D3DCOLOR
Colorkey
)
HRESULT
WINAPI
D3DXLoadSurfaceFromSurface
(
IDirect3DSurface9
*
dst_surface
,
const
PALETTEENTRY
*
dst_palette
,
const
RECT
*
dst_rect
,
IDirect3DSurface9
*
src_surface
,
const
PALETTEENTRY
*
src_palette
,
const
RECT
*
src_rect
,
DWORD
filter
,
D3DCOLOR
color_key
)
{
RECT
rect
;
D3DLOCKED_RECT
lock
;
D3DSURFACE_DESC
SrcDesc
;
HRESULT
hr
;
TRACE
(
"(%p, %p, %p, %p, %p, %p, %u, %#x): relay
\n
"
,
pDestSurface
,
pDestPalette
,
pDestRect
,
pSrcSurface
,
pSrcPalette
,
pSrcRect
,
dwFilter
,
Colorkey
);
TRACE
(
"dst_surface %p, dst_palette %p, dst_rect %s, src_surface %p, "
"src_palette %p, src_rect %s, filter %#x, color_key 0x%08x.
\n
"
,
dst_surface
,
dst_palette
,
wine_dbgstr_rect
(
dst_rect
),
src_surface
,
src_palette
,
wine_dbgstr_rect
(
src_rect
),
filter
,
color_key
);
if
(
!
pDestSurface
||
!
pSrcSurface
)
return
D3DERR_INVALIDCALL
;
if
(
!
dst_surface
||
!
src_surface
)
return
D3DERR_INVALIDCALL
;
IDirect3DSurface9_GetDesc
(
pSrcS
urface
,
&
SrcDesc
);
IDirect3DSurface9_GetDesc
(
src_s
urface
,
&
SrcDesc
);
if
(
!
pSrcRect
)
SetRect
(
&
rect
,
0
,
0
,
SrcDesc
.
Width
,
SrcDesc
.
Height
);
else
rect
=
*
pSrcRect
;
if
(
!
src_rect
)
SetRect
(
&
rect
,
0
,
0
,
SrcDesc
.
Width
,
SrcDesc
.
Height
);
else
rect
=
*
src_rect
;
hr
=
IDirect3DSurface9_LockRect
(
pSrcSurface
,
&
lock
,
NULL
,
D3DLOCK_READONLY
);
if
(
FAILED
(
hr
))
return
D3DXERR_INVALIDDATA
;
if
(
FAILED
(
IDirect3DSurface9_LockRect
(
src_surface
,
&
lock
,
NULL
,
D3DLOCK_READONLY
)))
return
D3DXERR_INVALIDDATA
;
hr
=
D3DXLoadSurfaceFromMemory
(
dst_surface
,
dst_palette
,
dst_rect
,
lock
.
pBits
,
SrcDesc
.
Format
,
lock
.
Pitch
,
src_palette
,
&
rect
,
filter
,
color_key
);
hr
=
D3DXLoadSurfaceFromMemory
(
pDestSurface
,
pDestPalette
,
pDestRect
,
lock
.
pBits
,
SrcDesc
.
Format
,
lock
.
Pitch
,
pSrcPalette
,
&
rect
,
dwFilter
,
Colorkey
);
IDirect3DSurface9_UnlockRect
(
src_surface
);
IDirect3DSurface9_UnlockRect
(
pSrcSurface
);
return
hr
;
}
...
...
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