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
65a4775b
Commit
65a4775b
authored
Jan 03, 2005
by
Christian Costa
Committed by
Alexandre Julliard
Jan 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle correctly DDSD_LINEARSIZE flag for FOURCC textures.
parent
d6cf14d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
main.c
dlls/ddraw/ddraw/main.c
+16
-15
dib.c
dlls/ddraw/dsurface/dib.c
+6
-3
No files found.
dlls/ddraw/ddraw/main.c
View file @
65a4775b
...
...
@@ -408,21 +408,22 @@ create_texture(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
}
#endif
if
(
!
(
ddsd
.
dwFlags
&
DDSD_PITCH
))
if
(
(
ddsd
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_FOURCC
)
&&
!
(
ddsd
.
dwFlags
&
DDSD_LINEARSIZE
))
{
if
(
ddsd
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_FOURCC
)
{
int
size
=
0
;
int
width
=
ddsd
.
dwWidth
;
int
height
=
ddsd
.
dwHeight
;
switch
(
ddsd
.
u4
.
ddpfPixelFormat
.
dwFourCC
)
{
case
MAKE_FOURCC
(
'D'
,
'X'
,
'T'
,
'1'
):
size
=
((
width
+
3
)
&~
3
)
*
((
height
+
3
)
&~
3
)
/
16
*
8
;
break
;
case
MAKE_FOURCC
(
'D'
,
'X'
,
'T'
,
'3'
):
size
=
((
width
+
3
)
&~
3
)
*
((
height
+
3
)
&~
3
)
/
16
*
16
;
break
;
case
MAKE_FOURCC
(
'D'
,
'X'
,
'T'
,
'5'
):
size
=
((
width
+
3
)
&~
3
)
*
((
height
+
3
)
&~
3
)
/
16
*
16
;
break
;
default:
FIXME
(
"FOURCC not supported
\n
"
);
break
;
}
ddsd
.
u1
.
dwLinearSize
=
size
;
}
else
ddsd
.
u1
.
lPitch
=
DDRAW_width_bpp_to_pitch
(
ddsd
.
dwWidth
,
GET_BPP
(
ddsd
)
*
8
);
int
size
=
0
;
int
width
=
ddsd
.
dwWidth
;
int
height
=
ddsd
.
dwHeight
;
switch
(
ddsd
.
u4
.
ddpfPixelFormat
.
dwFourCC
)
{
case
MAKE_FOURCC
(
'D'
,
'X'
,
'T'
,
'1'
):
size
=
((
width
+
3
)
&~
3
)
*
((
height
+
3
)
&~
3
)
/
16
*
8
;
break
;
case
MAKE_FOURCC
(
'D'
,
'X'
,
'T'
,
'3'
):
size
=
((
width
+
3
)
&~
3
)
*
((
height
+
3
)
&~
3
)
/
16
*
16
;
break
;
case
MAKE_FOURCC
(
'D'
,
'X'
,
'T'
,
'5'
):
size
=
((
width
+
3
)
&~
3
)
*
((
height
+
3
)
&~
3
)
/
16
*
16
;
break
;
default:
FIXME
(
"FOURCC not supported
\n
"
);
break
;
}
ddsd
.
u1
.
dwLinearSize
=
size
;
ddsd
.
dwFlags
|=
DDSD_LINEARSIZE
;
}
else
if
(
!
(
ddsd
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_FOURCC
)
&&
!
(
ddsd
.
dwFlags
&
DDSD_PITCH
))
{
ddsd
.
u1
.
lPitch
=
DDRAW_width_bpp_to_pitch
(
ddsd
.
dwWidth
,
GET_BPP
(
ddsd
)
*
8
);
ddsd
.
dwFlags
|=
DDSD_PITCH
;
}
/* Check also for the MIPMAP / MIPMAPCOUNT flags.
...
...
@@ -433,7 +434,7 @@ create_texture(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
ddsd
.
u2
.
dwMipMapCount
=
1
;
}
ddsd
.
dwFlags
|=
DDSD_PI
TCH
|
DDSD_PI
XELFORMAT
;
ddsd
.
dwFlags
|=
DDSD_PIXELFORMAT
;
hr
=
This
->
create_texture
(
This
,
&
ddsd
,
ppSurf
,
pUnkOuter
,
mipmap_level
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
dlls/ddraw/dsurface/dib.c
View file @
65a4775b
...
...
@@ -253,17 +253,20 @@ HRESULT DIB_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl *This,
}
/* XXX else: how should lPitch be verified? */
This
->
surface_desc
.
dwFlags
|=
DDSD_
PITCH
|
DDSD_
LPSURFACE
;
This
->
surface_desc
.
dwFlags
|=
DDSD_LPSURFACE
;
if
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_FOURCC
)
if
(
This
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwFlags
&
DDPF_FOURCC
)
{
This
->
surface_desc
.
lpSurface
=
VirtualAlloc
(
NULL
,
This
->
surface_desc
.
u1
.
dwLinearSize
,
MEM_COMMIT
,
PAGE_READWRITE
);
else
This
->
surface_desc
.
dwFlags
|=
DDSD_LINEARSIZE
;
}
else
{
This
->
surface_desc
.
lpSurface
=
VirtualAlloc
(
NULL
,
This
->
surface_desc
.
u1
.
lPitch
*
This
->
surface_desc
.
dwHeight
+
4
,
/* The + 4 here is for dumb games reading after the end of the surface
when reading the last byte / half using word access */
MEM_COMMIT
,
PAGE_READWRITE
);
This
->
surface_desc
.
dwFlags
|=
DDSD_PITCH
;
}
if
(
This
->
surface_desc
.
lpSurface
==
NULL
)
{
...
...
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