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
48275308
Commit
48275308
authored
Feb 18, 2008
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Feb 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a GL specific RealizePalette which also updates the drawable.
parent
61c82f80
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
surface.c
dlls/wined3d/surface.c
+46
-1
No files found.
dlls/wined3d/surface.c
View file @
48275308
...
...
@@ -3536,6 +3536,51 @@ HRESULT WINAPI IWineD3DSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, D
return
IWineD3DBaseSurfaceImpl_BltFast
(
iface
,
dstx
,
dsty
,
Source
,
rsrc
,
trans
);
}
HRESULT
WINAPI
IWineD3DSurfaceImpl_RealizePalette
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
RGBQUAD
col
[
256
];
IWineD3DPaletteImpl
*
pal
=
This
->
palette
;
unsigned
int
n
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
resource
.
format
==
WINED3DFMT_P8
||
This
->
resource
.
format
==
WINED3DFMT_A8P8
)
{
if
(
!
(
This
->
Flags
&
SFLAG_INSYSMEM
))
{
TRACE
(
"Palette changed with surface that does not have an up to date system memory copy
\n
"
);
IWineD3DSurface_LoadLocation
(
iface
,
SFLAG_INSYSMEM
,
NULL
);
}
TRACE
(
"Dirtifying surface
\n
"
);
IWineD3DSurface_ModifyLocation
(
iface
,
SFLAG_INSYSMEM
,
TRUE
);
}
if
(
This
->
Flags
&
SFLAG_DIBSECTION
)
{
TRACE
(
"(%p): Updating the hdc's palette
\n
"
,
This
);
for
(
n
=
0
;
n
<
256
;
n
++
)
{
if
(
pal
)
{
col
[
n
].
rgbRed
=
pal
->
palents
[
n
].
peRed
;
col
[
n
].
rgbGreen
=
pal
->
palents
[
n
].
peGreen
;
col
[
n
].
rgbBlue
=
pal
->
palents
[
n
].
peBlue
;
}
else
{
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
/* Use the default device palette */
col
[
n
].
rgbRed
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peRed
;
col
[
n
].
rgbGreen
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peGreen
;
col
[
n
].
rgbBlue
=
device
->
palettes
[
device
->
currentPalette
][
n
].
peBlue
;
}
col
[
n
].
rgbReserved
=
0
;
}
SetDIBColorTable
(
This
->
hDC
,
0
,
256
,
col
);
}
/* Propagate the changes to the drawable.
* TODO: in case of hardware p8 palettes we should only upload the palette. */
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_RENDERTARGET
)
IWineD3DSurface_LoadLocation
(
iface
,
SFLAG_INDRAWABLE
,
NULL
);
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DSurfaceImpl_PrivateSetup
(
IWineD3DSurface
*
iface
)
{
/** Check against the maximum texture sizes supported by the video card **/
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
...
...
@@ -4120,7 +4165,7 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DSurfaceImpl_BltFast
,
IWineD3DBaseSurfaceImpl_GetPalette
,
IWineD3DBaseSurfaceImpl_SetPalette
,
IWineD3D
Base
SurfaceImpl_RealizePalette
,
IWineD3DSurfaceImpl_RealizePalette
,
IWineD3DBaseSurfaceImpl_SetColorKey
,
IWineD3DBaseSurfaceImpl_GetPitch
,
IWineD3DSurfaceImpl_SetMem
,
...
...
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