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
e84b8b23
Commit
e84b8b23
authored
Mar 14, 2008
by
Tony Wasserka
Committed by
Alexandre Julliard
Mar 15, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Add stubs for the ID3DXFont functions.
parent
5e5c4a98
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
315 additions
and
5 deletions
+315
-5
Makefile.in
dlls/d3dx9_36/Makefile.in
+2
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+4
-4
d3dx9_36_main.c
dlls/d3dx9_36/d3dx9_36_main.c
+1
-0
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+40
-0
font.c
dlls/d3dx9_36/font.c
+268
-0
No files found.
dlls/d3dx9_36/Makefile.in
View file @
e84b8b23
...
...
@@ -7,7 +7,8 @@ IMPORTLIB = d3dx9
IMPORTS
=
d3d9 d3dx8 kernel32
C_SRCS
=
\
d3dx9_36_main.c
d3dx9_36_main.c
\
font.c
@MAKE_DLL_RULES@
...
...
dlls/d3dx9_36/d3dx9_36.spec
View file @
e84b8b23
...
...
@@ -62,10 +62,10 @@
@ stub D3DXCreateEffectFromResourceExW
@ stub D3DXCreateEffectFromResourceW
@ stub D3DXCreateEffectPool
@ st
ub D3DXCreateFontA
@ st
ub D3DXCreateFontIndirectA
@ st
ub D3DXCreateFontIndirectW
@ st
ub D3DXCreateFontW
@ st
dcall D3DXCreateFontA(ptr long long long long long long long long long str ptr)
@ st
dcall D3DXCreateFontIndirectA(ptr ptr ptr)
@ st
dcall D3DXCreateFontIndirectW(ptr ptr ptr)
@ st
dcall D3DXCreateFontW(ptr long long long long long long long long long wstr ptr)
@ stub D3DXCreateFragmentLinker
@ stub D3DXCreateFragmentLinkerEx
@ stub D3DXCreateKeyframedAnimationSet
...
...
dlls/d3dx9_36/d3dx9_36_main.c
View file @
e84b8b23
...
...
@@ -22,6 +22,7 @@
#include "config.h"
#include "wine/port.h"
#include "initguid.h"
#include <stdarg.h>
...
...
dlls/d3dx9_36/d3dx9_36_private.h
0 → 100644
View file @
e84b8b23
/*
* Copyright (C) 2008 Tony Wasserka
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#ifndef __WINE_D3DX9_36_PRIVATE_H
#define __WINE_D3DX9_36_PRIVATE_H
#include <stdarg.h>
#define COBJMACROS
#include "wingdi.h"
#include "d3dx9.h"
typedef
struct
ID3DXFontImpl
{
/* IUnknown fields */
const
ID3DXFontVtbl
*
lpVtbl
;
LONG
ref
;
/* ID3DXFont fields */
}
ID3DXFontImpl
;
#endif
/* __WINE_D3DX9_36_PRIVATE_H */
dlls/d3dx9_36/font.c
0 → 100644
View file @
e84b8b23
/*
* Copyright (C) 2008 Tony Wasserka
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include "config.h"
#include "wine/port.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "d3dx9_36_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
static
HRESULT
WINAPI
ID3DXFontImpl_QueryInterface
(
LPD3DXFONT
iface
,
REFIID
riid
,
LPVOID
*
object
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
TRACE
(
"(%p): QueryInterface from %s
\n
"
,
This
,
debugstr_guid
(
riid
));
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_ID3DXFont
))
{
IUnknown_AddRef
(
iface
);
*
object
=
This
;
return
S_OK
;
}
WARN
(
"(%p)->(%s, %p): not found
\n
"
,
iface
,
debugstr_guid
(
riid
),
*
object
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ID3DXFontImpl_AddRef
(
LPD3DXFONT
iface
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p): AddRef from %d
\n
"
,
This
,
ref
-
1
);
return
ref
;
}
static
ULONG
WINAPI
ID3DXFontImpl_Release
(
LPD3DXFONT
iface
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p): ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_GetDevice
(
LPD3DXFONT
iface
,
LPDIRECT3DDEVICE9
*
device
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_GetDescA
(
LPD3DXFONT
iface
,
D3DXFONT_DESCA
*
desc
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_GetDescW
(
LPD3DXFONT
iface
,
D3DXFONT_DESCW
*
desc
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
BOOL
WINAPI
ID3DXFontImpl_GetTextMetricsA
(
LPD3DXFONT
iface
,
TEXTMETRICA
*
metrics
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
FALSE
;
}
static
BOOL
WINAPI
ID3DXFontImpl_GetTextMetricsW
(
LPD3DXFONT
iface
,
TEXTMETRICW
*
metrics
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
FALSE
;
}
static
HDC
WINAPI
ID3DXFontImpl_GetDC
(
LPD3DXFONT
iface
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
NULL
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_GetGlyphData
(
LPD3DXFONT
iface
,
UINT
glyph
,
LPDIRECT3DTEXTURE9
*
texture
,
RECT
*
blackbox
,
POINT
*
cellinc
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_PreloadCharacters
(
LPD3DXFONT
iface
,
UINT
first
,
UINT
last
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_PreloadGlyphs
(
LPD3DXFONT
iface
,
UINT
first
,
UINT
last
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_PreloadTextA
(
LPD3DXFONT
iface
,
LPCSTR
string
,
INT
count
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_PreloadTextW
(
LPD3DXFONT
iface
,
LPCWSTR
string
,
INT
count
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
INT
WINAPI
ID3DXFontImpl_DrawTextA
(
LPD3DXFONT
iface
,
LPD3DXSPRITE
sprite
,
LPCSTR
string
,
INT
count
,
LPRECT
rect
,
DWORD
format
,
D3DCOLOR
color
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
1
;
}
static
INT
WINAPI
ID3DXFontImpl_DrawTextW
(
LPD3DXFONT
iface
,
LPD3DXSPRITE
sprite
,
LPCWSTR
string
,
INT
count
,
LPRECT
rect
,
DWORD
format
,
D3DCOLOR
color
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
1
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_OnLostDevice
(
LPD3DXFONT
iface
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXFontImpl_OnResetDevice
(
LPD3DXFONT
iface
)
{
ID3DXFontImpl
*
This
=
(
ID3DXFontImpl
*
)
iface
;
FIXME
(
"(%p): stub
\n
"
,
This
);
return
D3D_OK
;
}
static
const
ID3DXFontVtbl
D3DXFont_Vtbl
=
{
/*** IUnknown methods ***/
ID3DXFontImpl_QueryInterface
,
ID3DXFontImpl_AddRef
,
ID3DXFontImpl_Release
,
/*** ID3DXFont methods ***/
ID3DXFontImpl_GetDevice
,
ID3DXFontImpl_GetDescA
,
ID3DXFontImpl_GetDescW
,
ID3DXFontImpl_GetTextMetricsA
,
ID3DXFontImpl_GetTextMetricsW
,
ID3DXFontImpl_GetDC
,
ID3DXFontImpl_GetGlyphData
,
ID3DXFontImpl_PreloadCharacters
,
ID3DXFontImpl_PreloadGlyphs
,
ID3DXFontImpl_PreloadTextA
,
ID3DXFontImpl_PreloadTextW
,
ID3DXFontImpl_DrawTextA
,
ID3DXFontImpl_DrawTextW
,
ID3DXFontImpl_OnLostDevice
,
ID3DXFontImpl_OnResetDevice
};
HRESULT
WINAPI
D3DXCreateFontA
(
LPDIRECT3DDEVICE9
device
,
INT
height
,
UINT
width
,
UINT
weight
,
UINT
miplevels
,
BOOL
italic
,
DWORD
charset
,
DWORD
precision
,
DWORD
quality
,
DWORD
pitchandfamily
,
LPCSTR
facename
,
LPD3DXFONT
*
font
)
{
D3DXFONT_DESCA
desc
;
if
(
!
facename
)
return
D3DXERR_INVALIDDATA
;
desc
.
Height
=
height
;
desc
.
Width
=
width
;
desc
.
Weight
=
weight
;
desc
.
MipLevels
=
miplevels
;
desc
.
Italic
=
italic
;
desc
.
CharSet
=
charset
;
desc
.
OutputPrecision
=
precision
;
desc
.
Quality
=
quality
;
desc
.
PitchAndFamily
=
pitchandfamily
;
lstrcpyA
(
desc
.
FaceName
,
facename
);
return
D3DXCreateFontIndirectA
(
device
,
&
desc
,
font
);
}
HRESULT
WINAPI
D3DXCreateFontW
(
LPDIRECT3DDEVICE9
device
,
INT
height
,
UINT
width
,
UINT
weight
,
UINT
miplevels
,
BOOL
italic
,
DWORD
charset
,
DWORD
precision
,
DWORD
quality
,
DWORD
pitchandfamily
,
LPCWSTR
facename
,
LPD3DXFONT
*
font
)
{
D3DXFONT_DESCW
desc
;
if
(
!
facename
)
return
D3DXERR_INVALIDDATA
;
desc
.
Height
=
height
;
desc
.
Width
=
width
;
desc
.
Weight
=
weight
;
desc
.
MipLevels
=
miplevels
;
desc
.
Italic
=
italic
;
desc
.
CharSet
=
charset
;
desc
.
OutputPrecision
=
precision
;
desc
.
Quality
=
quality
;
desc
.
PitchAndFamily
=
pitchandfamily
;
strcpyW
(
desc
.
FaceName
,
facename
);
return
D3DXCreateFontIndirectW
(
device
,
&
desc
,
font
);
}
HRESULT
WINAPI
D3DXCreateFontIndirectA
(
LPDIRECT3DDEVICE9
device
,
CONST
D3DXFONT_DESCA
*
desc
,
LPD3DXFONT
*
font
)
{
D3DXFONT_DESCW
widedesc
;
if
(
!
desc
)
return
D3DERR_INVALIDCALL
;
if
(
!
desc
->
FaceName
)
return
D3DERR_INVALIDCALL
;
/* Copy everything but the last structure member. This requires the
two D3DXFONT_DESC structures to be equal until the FaceName member */
memcpy
(
&
widedesc
,
desc
,
FIELD_OFFSET
(
D3DXFONT_DESCA
,
FaceName
));
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
->
FaceName
,
-
1
,
widedesc
.
FaceName
,
sizeof
(
widedesc
.
FaceName
)
/
sizeof
(
WCHAR
));
return
D3DXCreateFontIndirectW
(
device
,
&
widedesc
,
font
);
}
HRESULT
WINAPI
D3DXCreateFontIndirectW
(
LPDIRECT3DDEVICE9
device
,
CONST
D3DXFONT_DESCW
*
desc
,
LPD3DXFONT
*
font
)
{
ID3DXFontImpl
*
object
;
FIXME
(
"stub
\n
"
);
if
(
!
desc
)
return
D3DERR_INVALIDCALL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
ID3DXFontImpl
));
if
(
object
==
NULL
)
{
*
font
=
NULL
;
return
E_OUTOFMEMORY
;
}
object
->
lpVtbl
=&
D3DXFont_Vtbl
;
object
->
ref
=
1
;
*
font
=
(
LPD3DXFONT
)
object
;
return
D3D_OK
;
}
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