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
7676462a
Commit
7676462a
authored
Feb 19, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix d3d8/9 style palettes.
parent
4a93eb84
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
surface.c
dlls/wined3d/surface.c
+25
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/surface.c
View file @
7676462a
...
...
@@ -297,6 +297,8 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) {
}
if
(
This
->
Flags
&
SFLAG_USERPTR
)
IWineD3DSurface_SetMem
(
iface
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
palette9
);
IWineD3DResourceImpl_CleanUp
((
IWineD3DResource
*
)
iface
);
if
(
iface
==
device
->
ddraw_primary
)
device
->
ddraw_primary
=
NULL
;
...
...
@@ -1649,6 +1651,27 @@ void d3dfmt_p8_upload_palette(IWineD3DSurface *iface, CONVERT_TYPES convert) {
GL_EXTCALL
(
glColorTableEXT
(
GL_TEXTURE_2D
,
GL_RGBA
,
256
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
table
));
}
static
BOOL
palette9_changed
(
IWineD3DSurfaceImpl
*
This
)
{
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
wineD3DDevice
;
if
(
This
->
palette
||
(
This
->
resource
.
format
!=
WINED3DFMT_P8
&&
This
->
resource
.
format
!=
WINED3DFMT_A8P8
))
{
/* If a ddraw-style palette is attached assume no d3d9 palette change.
* Also the palette isn't interesting if the surface format isn't P8 or A8P8
*/
return
FALSE
;
}
if
(
This
->
palette9
)
{
if
(
memcmp
(
This
->
palette9
,
&
device
->
palettes
[
device
->
currentPalette
],
sizeof
(
PALETTEENTRY
)
*
256
)
==
0
)
{
return
FALSE
;
}
}
else
{
This
->
palette9
=
(
PALETTEENTRY
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PALETTEENTRY
)
*
256
);
}
memcpy
(
This
->
palette9
,
&
device
->
palettes
[
device
->
currentPalette
],
sizeof
(
PALETTEENTRY
)
*
256
);
return
TRUE
;
}
static
HRESULT
WINAPI
IWineD3DSurfaceImpl_LoadTexture
(
IWineD3DSurface
*
iface
)
{
IWineD3DSurfaceImpl
*
This
=
(
IWineD3DSurfaceImpl
*
)
iface
;
GLenum
format
,
internal
,
type
;
...
...
@@ -1672,6 +1695,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
(
This
->
glCKey
.
dwColorSpaceLowValue
!=
This
->
SrcBltCKey
.
dwColorSpaceLowValue
)
||
(
This
->
glCKey
.
dwColorSpaceHighValue
!=
This
->
SrcBltCKey
.
dwColorSpaceHighValue
))))
{
TRACE
(
"Reloading because of color keying
\n
"
);
}
else
if
(
palette9_changed
(
This
))
{
TRACE
(
"Reloading surface because the d3d8/9 palette was changed
\n
"
);
}
else
{
TRACE
(
"surface isn't dirty
\n
"
);
return
WINED3D_OK
;
...
...
dlls/wined3d/wined3d_private.h
View file @
7676462a
...
...
@@ -973,7 +973,8 @@ struct IWineD3DSurfaceImpl
/* IWineD3DSurface fields */
IWineD3DBase
*
container
;
WINED3DSURFACET_DESC
currentDesc
;
IWineD3DPaletteImpl
*
palette
;
IWineD3DPaletteImpl
*
palette
;
/* D3D7 style palette handling */
PALETTEENTRY
*
palette9
;
/* D3D8/9 style palette handling */
UINT
bytesPerPixel
;
...
...
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