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
a3778259
Commit
a3778259
authored
Jan 13, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix cube texture creation error handling.
parent
d030cbda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
36 deletions
+26
-36
device.c
dlls/wined3d/device.c
+26
-36
No files found.
dlls/wined3d/device.c
View file @
a3778259
...
@@ -1174,6 +1174,29 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
...
@@ -1174,6 +1174,29 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
return
WINED3DERR_INVALIDCALL
;
return
WINED3DERR_INVALIDCALL
;
}
}
/* Calculate levels for mip mapping */
if
(
Usage
&
WINED3DUSAGE_AUTOGENMIPMAP
)
{
if
(
!
GL_SUPPORT
(
SGIS_GENERATE_MIPMAP
))
{
WARN
(
"No mipmap generation support, returning D3DERR_INVALIDCALL
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
Levels
>
1
)
{
WARN
(
"D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
Levels
=
1
;
}
else
if
(
!
Levels
)
{
Levels
=
wined3d_log2i
(
EdgeLength
)
+
1
;
TRACE
(
"Calculated levels = %d
\n
"
,
Levels
);
}
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
object
)
{
{
...
@@ -1226,28 +1249,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
...
@@ -1226,28 +1249,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
object
->
baseTexture
.
magLookup
=
magLookup_noFilter
;
object
->
baseTexture
.
magLookup
=
magLookup_noFilter
;
}
}
/* Calculate levels for mip mapping */
if
(
Usage
&
WINED3DUSAGE_AUTOGENMIPMAP
)
{
if
(
!
GL_SUPPORT
(
SGIS_GENERATE_MIPMAP
))
{
WARN
(
"No mipmap generation support, returning D3DERR_INVALIDCALL
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppCubeTexture
=
NULL
;
return
WINED3DERR_INVALIDCALL
;
}
if
(
Levels
>
1
)
{
WARN
(
"D3DUSAGE_AUTOGENMIPMAP is set, and level count > 1, returning D3DERR_INVALIDCALL
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppCubeTexture
=
NULL
;
return
WINED3DERR_INVALIDCALL
;
}
object
->
baseTexture
.
levels
=
1
;
}
else
if
(
Levels
==
0
)
{
object
->
baseTexture
.
levels
=
wined3d_log2i
(
EdgeLength
)
+
1
;
TRACE
(
"Calculated levels = %d
\n
"
,
object
->
baseTexture
.
levels
);
}
/* Generate all the surfaces */
/* Generate all the surfaces */
tmpW
=
EdgeLength
;
tmpW
=
EdgeLength
;
for
(
i
=
0
;
i
<
object
->
baseTexture
.
levels
;
i
++
)
{
for
(
i
=
0
;
i
<
object
->
baseTexture
.
levels
;
i
++
)
{
...
@@ -1266,21 +1267,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
...
@@ -1266,21 +1267,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
hr
=
D3DCB_CreateSurface
(
This
->
parent
,
parent
,
tmpW
,
tmpW
,
Format
,
Usage
,
Pool
,
hr
=
D3DCB_CreateSurface
(
This
->
parent
,
parent
,
tmpW
,
tmpW
,
Format
,
Usage
,
Pool
,
i
/* Level */
,
j
,
&
object
->
surfaces
[
j
][
i
],
pSharedHandle
);
i
/* Level */
,
j
,
&
object
->
surfaces
[
j
][
i
],
pSharedHandle
);
if
(
hr
!=
WINED3D_OK
)
{
if
(
FAILED
(
hr
))
/* clean up */
{
unsigned
int
k
;
unsigned
int
l
;
for
(
l
=
0
;
l
<
j
;
l
++
)
{
IWineD3DSurface_Release
(
object
->
surfaces
[
l
][
i
]);
}
for
(
k
=
0
;
k
<
i
;
k
++
)
{
for
(
l
=
0
;
l
<
6
;
l
++
)
{
IWineD3DSurface_Release
(
object
->
surfaces
[
l
][
k
]);
}
}
FIXME
(
"(%p) Failed to create surface
\n
"
,
object
);
FIXME
(
"(%p) Failed to create surface
\n
"
,
object
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
IWineD3DCubeTexture_Release
((
IWineD3DCubeTexture
*
)
object
);
*
ppCubeTexture
=
NULL
;
*
ppCubeTexture
=
NULL
;
return
hr
;
return
hr
;
}
}
...
...
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