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
271fb005
Commit
271fb005
authored
Sep 01, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add support for showing a logo.
parent
72483540
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
1 deletion
+78
-1
device.c
dlls/wined3d/device.c
+63
-0
swapchain.c
dlls/wined3d/swapchain.c
+4
-0
wined3d_main.c
dlls/wined3d/wined3d_main.c
+7
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-0
No files found.
dlls/wined3d/device.c
View file @
271fb005
...
...
@@ -1871,6 +1871,63 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW
return
WINED3D_OK
;
}
static
void
IWineD3DDeviceImpl_LoadLogo
(
IWineD3DDeviceImpl
*
This
,
const
char
*
filename
)
{
HBITMAP
hbm
;
BITMAP
bm
;
HRESULT
hr
;
HDC
dcb
=
NULL
,
dcs
=
NULL
;
WINEDDCOLORKEY
colorkey
;
hbm
=
(
HBITMAP
)
LoadImageA
(
NULL
,
filename
,
IMAGE_BITMAP
,
0
,
0
,
LR_LOADFROMFILE
|
LR_CREATEDIBSECTION
);
if
(
hbm
)
{
GetObjectA
(
hbm
,
sizeof
(
BITMAP
),
&
bm
);
dcb
=
CreateCompatibleDC
(
NULL
);
if
(
!
dcb
)
goto
out
;
SelectObject
(
dcb
,
hbm
);
}
else
{
/* Create a 32x32 white surface to indicate that wined3d is used, but the specified image
* couldn't be loaded
*/
memset
(
&
bm
,
0
,
sizeof
(
bm
));
bm
.
bmWidth
=
32
;
bm
.
bmHeight
=
32
;
}
hr
=
IWineD3DDevice_CreateSurface
((
IWineD3DDevice
*
)
This
,
bm
.
bmWidth
,
bm
.
bmHeight
,
WINED3DFMT_R5G6B5
,
TRUE
,
FALSE
,
0
,
&
This
->
logo_surface
,
WINED3DRTYPE_SURFACE
,
0
,
WINED3DPOOL_DEFAULT
,
WINED3DMULTISAMPLE_NONE
,
0
,
NULL
,
SURFACE_OPENGL
,
NULL
);
if
(
FAILED
(
hr
))
{
ERR
(
"Wine logo requested, but failed to create surface
\n
"
);
goto
out
;
}
if
(
dcb
)
{
hr
=
IWineD3DSurface_GetDC
(
This
->
logo_surface
,
&
dcs
);
if
(
FAILED
(
hr
))
goto
out
;
BitBlt
(
dcs
,
0
,
0
,
bm
.
bmWidth
,
bm
.
bmHeight
,
dcb
,
0
,
0
,
SRCCOPY
);
IWineD3DSurface_ReleaseDC
(
This
->
logo_surface
,
dcs
);
colorkey
.
dwColorSpaceLowValue
=
0
;
colorkey
.
dwColorSpaceHighValue
=
0
;
IWineD3DSurface_SetColorKey
(
This
->
logo_surface
,
WINEDDCKEY_SRCBLT
,
&
colorkey
);
}
else
{
/* Fill the surface with a white color to show that wined3d is there */
IWineD3DDevice_ColorFill
((
IWineD3DDevice
*
)
This
,
This
->
logo_surface
,
NULL
,
0xffffffff
);
}
out:
if
(
dcb
)
{
DeleteDC
(
dcb
);
}
if
(
hbm
)
{
DeleteObject
(
hbm
);
}
return
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_Init3D
(
IWineD3DDevice
*
iface
,
WINED3DPRESENT_PARAMETERS
*
pPresentationParameters
,
D3DCB_CREATEADDITIONALSWAPCHAIN
D3DCB_CreateAdditionalSwapChain
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DSwapChainImpl
*
swapchain
;
...
...
@@ -2007,6 +2064,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
0x00
,
1
.
0
,
0
);
This
->
d3d_initialized
=
TRUE
;
if
(
wined3d_settings
.
logo
)
{
IWineD3DDeviceImpl_LoadLogo
(
This
,
wined3d_settings
.
logo
);
}
return
WINED3D_OK
;
}
...
...
@@ -2023,6 +2084,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
*/
ActivateContext
(
This
,
This
->
lastActiveRenderTarget
,
CTXUSAGE_RESOURCELOAD
);
if
(
This
->
logo_surface
)
IWineD3DSurface_Release
(
This
->
logo_surface
);
TRACE
(
"Deleting high order patches
\n
"
);
for
(
i
=
0
;
i
<
PATCHMAP_SIZE
;
i
++
)
{
struct
list
*
e1
,
*
e2
;
...
...
dlls/wined3d/swapchain.c
View file @
271fb005
...
...
@@ -175,6 +175,10 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
}
IWineD3DSurface_Blt
(
This
->
backBuffer
[
0
],
&
destRect
,
(
IWineD3DSurface
*
)
&
cursor
,
NULL
,
WINEDDBLT_KEYSRC
,
NULL
,
WINED3DTEXF_NONE
);
}
if
(
This
->
wineD3DDevice
->
logo_surface
)
{
/* Blit the logo into the upper left corner of the drawable */
IWineD3DSurface_BltFast
(
This
->
backBuffer
[
0
],
0
,
0
,
This
->
wineD3DDevice
->
logo_surface
,
NULL
,
WINEDDBLTFAST_SRCCOLORKEY
);
}
if
(
pSourceRect
||
pDestRect
)
FIXME
(
"Unhandled present options %p/%p
\n
"
,
pSourceRect
,
pDestRect
);
/* TODO: If only source rect or dest rect are supplied then clip the window to match */
...
...
dlls/wined3d/wined3d_main.c
View file @
271fb005
...
...
@@ -42,7 +42,8 @@ wined3d_settings_t wined3d_settings =
FALSE
,
/* Use of GLSL disabled by default */
ORM_BACKBUFFER
,
/* Use the backbuffer to do offscreen rendering */
RTL_AUTO
,
/* Automatically determine best locking method */
64
*
1024
*
1024
/* 64MB texture memory by default */
64
*
1024
*
1024
,
/* 64MB texture memory by default */
NULL
/* No wine logo by default */
};
WineD3DGlobalStatistics
*
wineD3DGlobalStatistics
=
NULL
;
...
...
@@ -274,6 +275,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
else
ERR
(
"VideoMemorySize is %i but must be >0
\n
"
,
TmpVideoMemorySize
);
}
if
(
!
get_config_key
(
hkey
,
appkey
,
"WineLogo"
,
buffer
,
size
)
)
{
wined3d_settings
.
logo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
buffer
)
+
1
);
if
(
wined3d_settings
.
logo
)
strcpy
(
wined3d_settings
.
logo
,
buffer
);
}
}
if
(
wined3d_settings
.
vs_mode
==
VS_HW
)
TRACE
(
"Allow HW vertex shaders
\n
"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
271fb005
...
...
@@ -197,6 +197,7 @@ typedef struct wined3d_settings_s {
int
rendertargetlock_mode
;
/* Memory tracking and object counting */
unsigned
int
emulated_textureram
;
char
*
logo
;
}
wined3d_settings_t
;
extern
wined3d_settings_t
wined3d_settings
;
...
...
@@ -728,6 +729,9 @@ struct IWineD3DDeviceImpl
BOOL
haveHardwareCursor
;
HCURSOR
hardwareCursor
;
/* The Wine logo surface */
IWineD3DSurface
*
logo_surface
;
/* Textures for when no other textures are mapped */
UINT
dummyTextureName
[
MAX_TEXTURES
];
...
...
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