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
3aefc4e4
Commit
3aefc4e4
authored
Jul 14, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Jul 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug in Preload caused be a missing brace around a for loop,
slightly improved the way that errors are handled by passing back hr from some function calls.
parent
190e1597
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
21 deletions
+30
-21
cubetexture.c
dlls/wined3d/cubetexture.c
+30
-21
No files found.
dlls/wined3d/cubetexture.c
View file @
3aefc4e4
...
...
@@ -65,7 +65,6 @@ HRESULT WINAPI IWineD3DCubeTextureImpl_QueryInterface(IWineD3DCubeTexture *iface
ULONG
WINAPI
IWineD3DCubeTextureImpl_AddRef
(
IWineD3DCubeTexture
*
iface
)
{
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
TRACE
(
"(%p) : AddRef increasing from %ld
\n
"
,
This
,
This
->
resource
.
ref
);
IUnknown_AddRef
(
This
->
resource
.
parent
);
return
InterlockedIncrement
(
&
This
->
resource
.
ref
);
}
...
...
@@ -88,14 +87,12 @@ ULONG WINAPI IWineD3DCubeTextureImpl_Release(IWineD3DCubeTexture *iface) {
IWineD3DSurface_GetParent
(
This
->
surfaces
[
j
][
i
],
&
surfaceParent
);
IUnknown_Release
(
surfaceParent
);
IUnknown_Release
(
surfaceParent
);
}
}
}
IWineD3DBaseTextureImpl_CleanUp
((
IWineD3DBaseTexture
*
)
iface
);
/* finally delete the object */
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
else
{
IUnknown_Release
(
This
->
resource
.
parent
);
/* Released the reference to the d3dx object */
}
return
ref
;
}
...
...
@@ -143,10 +140,11 @@ void WINAPI IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture *iface) {
/* If were dirty then reload the surfaces */
if
(
This
->
baseTexture
.
dirty
!=
FALSE
)
{
for
(
i
=
0
;
i
<
This
->
baseTexture
.
levels
;
i
++
)
{
for
(
j
=
0
;
j
<
6
;
j
++
)
for
(
j
=
0
;
j
<
6
;
j
++
)
{
if
(
setGlTextureDesc
)
IWineD3DSurface_SetGlTextureDesc
(
This
->
surfaces
[
j
][
i
],
This
->
baseTexture
.
textureName
,
cube_targets
[
j
]);
IWineD3DSurface_LoadTexture
((
IWineD3DSurface
*
)
This
->
surfaces
[
j
][
i
]);
IWineD3DSurface_LoadTexture
(
This
->
surfaces
[
j
][
i
]);
}
}
/* No longer dirty */
This
->
baseTexture
.
dirty
=
FALSE
;
...
...
@@ -216,7 +214,7 @@ UINT WINAPI IWineD3DCubeTextureImpl_GetTextureDimensions(IWineD3DCubeTexture *if
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
TRACE
(
"(%p)
\n
"
,
This
);
return
GL
TEXTURECUBEMAP
;
return
GL
_TEXTURE_CUBE_MAP_ARB
;
}
/* *******************************************
...
...
@@ -227,7 +225,7 @@ HRESULT WINAPI IWineD3DCubeTextureImpl_GetLevelDesc(IWineD3DCubeTexture *iface,
if
(
Level
<
This
->
baseTexture
.
levels
)
{
TRACE
(
"(%p) level (%d)
\n
"
,
This
,
Level
);
return
IWineD3DSurface_GetDesc
(
(
IWineD3DSurface
*
)
This
->
surfaces
[
0
][
Level
],
pDesc
);
return
IWineD3DSurface_GetDesc
(
This
->
surfaces
[
0
][
Level
],
pDesc
);
}
FIXME
(
"(%p) level(%d) overflow Levels(%d)
\n
"
,
This
,
Level
,
This
->
baseTexture
.
levels
);
return
D3DERR_INVALIDCALL
;
...
...
@@ -235,41 +233,52 @@ HRESULT WINAPI IWineD3DCubeTextureImpl_GetLevelDesc(IWineD3DCubeTexture *iface,
HRESULT
WINAPI
IWineD3DCubeTextureImpl_GetCubeMapSurface
(
IWineD3DCubeTexture
*
iface
,
D3DCUBEMAP_FACES
FaceType
,
UINT
Level
,
IWineD3DSurface
**
ppCubeMapSurface
)
{
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
HRESULT
hr
=
D3DERR_INVALIDCALL
;
if
(
Level
<
This
->
baseTexture
.
levels
)
{
*
ppCubeMapSurface
=
(
IWineD3DSurface
*
)
This
->
surfaces
[
FaceType
][
Level
];
IWineD3DSurface_AddRef
((
IWineD3DSurface
*
)
*
ppCubeMapSurface
);
*
ppCubeMapSurface
=
This
->
surfaces
[
FaceType
][
Level
];
IWineD3DSurface_AddRef
(
*
ppCubeMapSurface
);
hr
=
D3D_OK
;
}
if
(
D3D_OK
==
hr
)
{
TRACE
(
"(%p) -> faceType(%d) level(%d) returning surface@%p
\n
"
,
This
,
FaceType
,
Level
,
This
->
surfaces
[
FaceType
][
Level
]);
}
else
{
FIXME
(
"(%p) level(%d) overflow Levels(%d)
\n
"
,
This
,
Level
,
This
->
baseTexture
.
levels
);
return
D3DERR_INVALIDCALL
;
WARN
(
"(%p) level(%d) overflow Levels(%d)
\n
"
,
This
,
Level
,
This
->
baseTexture
.
levels
);
}
return
D3D_OK
;
return
hr
;
}
HRESULT
WINAPI
IWineD3DCubeTextureImpl_LockRect
(
IWineD3DCubeTexture
*
iface
,
D3DCUBEMAP_FACES
FaceType
,
UINT
Level
,
D3DLOCKED_RECT
*
pLockedRect
,
CONST
RECT
*
pRect
,
DWORD
Flags
)
{
HRESULT
hr
;
HRESULT
hr
=
D3DERR_INVALIDCALL
;
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
if
(
Level
<
This
->
baseTexture
.
levels
)
{
hr
=
IWineD3DSurface_LockRect
((
IWineD3DSurface
*
)
This
->
surfaces
[
FaceType
][
Level
],
pLockedRect
,
pRect
,
Flags
);
hr
=
IWineD3DSurface_LockRect
(
This
->
surfaces
[
FaceType
][
Level
],
pLockedRect
,
pRect
,
Flags
);
}
if
(
D3D_OK
==
hr
)
{
TRACE
(
"(%p) -> faceType(%d) level(%d) returning memory@%p success(%lu)
\n
"
,
This
,
FaceType
,
Level
,
pLockedRect
->
pBits
,
hr
);
}
else
{
FIXME
(
"(%p) level(%d) overflow Levels(%d)
\n
"
,
This
,
Level
,
This
->
baseTexture
.
levels
);
return
D3DERR_INVALIDCALL
;
WARN
(
"(%p) level(%d) overflow Levels(%d)
\n
"
,
This
,
Level
,
This
->
baseTexture
.
levels
);
}
return
hr
;
}
HRESULT
WINAPI
IWineD3DCubeTextureImpl_UnlockRect
(
IWineD3DCubeTexture
*
iface
,
D3DCUBEMAP_FACES
FaceType
,
UINT
Level
)
{
HRESULT
hr
;
HRESULT
hr
=
D3DERR_INVALIDCALL
;
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
if
(
Level
<
This
->
baseTexture
.
levels
)
{
hr
=
IWineD3DSurface_UnlockRect
((
IWineD3DSurface
*
)
This
->
surfaces
[
FaceType
][
Level
]);
}
if
(
D3D_OK
==
hr
)
{
TRACE
(
"(%p) -> faceType(%d) level(%d) success(%lu)
\n
"
,
This
,
FaceType
,
Level
,
hr
);
}
else
{
FIXME
(
"(%p) level(%d) overflow Levels(%d)
\n
"
,
This
,
Level
,
This
->
baseTexture
.
levels
);
return
D3DERR_INVALIDCALL
;
WARN
(
"(%p) level(%d) overflow Levels(%d)
\n
"
,
This
,
Level
,
This
->
baseTexture
.
levels
);
}
return
hr
;
}
...
...
@@ -278,7 +287,7 @@ HRESULT WINAPI IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture *iface,
IWineD3DCubeTextureImpl
*
This
=
(
IWineD3DCubeTextureImpl
*
)
iface
;
This
->
baseTexture
.
dirty
=
TRUE
;
TRACE
(
"(%p) : dirtyfication of faceType(%d) Level (0)
\n
"
,
This
,
FaceType
);
return
IWineD3DSurface_AddDirtyRect
(
(
IWineD3DSurface
*
)
This
->
surfaces
[
FaceType
][
0
],
pDirtyRect
);
return
IWineD3DSurface_AddDirtyRect
(
This
->
surfaces
[
FaceType
][
0
],
pDirtyRect
);
}
...
...
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