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
577f8db7
Commit
577f8db7
authored
Jan 06, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix np2 textures.
parent
9f2e0fa2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
state.c
dlls/wined3d/state.c
+21
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/state.c
View file @
577f8db7
...
...
@@ -1752,13 +1752,28 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
if
(
stateblock
->
textures
[
sampler
])
{
BOOL
texIsPow2
=
FALSE
;
/* NP2 textures need the texture matrix set properly for the stage */
if
(
wined3d_settings
.
nonpower2_mode
==
NP2_NATIVE
&&
sampler
<
MAX_TEXTURES
-
1
&&
stateblock
->
textureDimensions
[
sampler
]
==
GL_TEXTURE_2D
&&
(((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorX
!=
1
.
0
||
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorY
!=
1
.
0
)
)
{
transform_texture
(
STATE_TRANSFORM
(
WINED3DTS_TEXTURE0
+
stateblock
->
wineD3DDevice
->
texUnitMap
[
sampler
]),
stateblock
);
/* The fixed function np2 texture emulation uses the texture matrix to fix up the coordinates
* IWineD3DBaseTexture::ApplyStateChanges multiplies the set matrix with a fixup matrix. Before the
* scaling is reapplied or removed, the texture matrix has to be reapplied
*/
if
(
wined3d_settings
.
nonpower2_mode
!=
NP2_NATIVE
&&
sampler
<
MAX_TEXTURES
)
{
if
(
stateblock
->
textureDimensions
[
sampler
]
==
GL_TEXTURE_2D
)
{
if
(((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorX
!=
1
.
0
||
((
IWineD3DTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactorY
!=
1
.
0
)
{
texIsPow2
=
TRUE
;
}
}
else
if
(
stateblock
->
textureDimensions
[
sampler
]
==
GL_TEXTURE_CUBE_MAP_ARB
)
{
if
(((
IWineD3DCubeTextureImpl
*
)
stateblock
->
textures
[
sampler
])
->
pow2scalingFactor
!=
1
.
0
)
{
texIsPow2
=
TRUE
;
}
}
if
(
texIsPow2
||
stateblock
->
wineD3DDevice
->
lastWasPow2Texture
[
sampler
])
{
transform_texture
(
STATE_TRANSFORM
(
WINED3DTS_TEXTURE0
+
stateblock
->
wineD3DDevice
->
texUnitMap
[
sampler
]),
stateblock
);
stateblock
->
wineD3DDevice
->
lastWasPow2Texture
[
sampler
]
=
texIsPow2
;
}
}
IWineD3DBaseTexture_PreLoad
((
IWineD3DBaseTexture
*
)
stateblock
->
textures
[
sampler
]);
...
...
dlls/wined3d/wined3d_private.h
View file @
577f8db7
...
...
@@ -583,6 +583,7 @@ typedef struct IWineD3DDeviceImpl
BOOL
last_was_vshader
;
BOOL
last_was_foggy_shader
;
BOOL
namedArraysLoaded
,
numberedArraysLoaded
;
BOOL
lastWasPow2Texture
[
MAX_TEXTURES
];
/* State block related */
BOOL
isRecordingState
;
...
...
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