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
caa371a6
Commit
caa371a6
authored
Dec 10, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move point scale render states to the state table.
parent
9a0e4b54
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
54 deletions
+55
-54
device.c
dlls/wined3d/device.c
+0
-50
state.c
dlls/wined3d/state.c
+55
-4
No files found.
dlls/wined3d/device.c
View file @
caa371a6
...
...
@@ -3402,56 +3402,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
StateTable
[
STATE_RENDER
(
State
)].
apply
(
STATE_RENDER
(
State
),
This
->
stateBlock
);
break
;
{
/*
* POINTSCALEENABLE controls how point size value is treated. If set to
* true, the point size is scaled with respect to height of viewport.
* When set to false point size is in pixels.
*
* http://msdn.microsoft.com/library/en-us/directx9_c/point_sprites.asp
*/
/* Default values */
GLfloat
att
[
3
]
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
};
/*
* Minimum valid point size for OpenGL is 1.0f. For Direct3D it is 0.0f.
* This means that OpenGL will clamp really small point sizes to 1.0f.
* To correct for this we need to multiply by the scale factor when sizes
* are less than 1.0f. scale_factor = 1.0f / point_size.
*/
GLfloat
pointSize
=
*
((
float
*
)
&
This
->
stateBlock
->
renderState
[
WINED3DRS_POINTSIZE
]);
if
(
pointSize
>
0
.
0
f
)
{
GLfloat
scaleFactor
;
if
(
pointSize
<
1
.
0
f
)
{
scaleFactor
=
pointSize
*
pointSize
;
}
else
{
scaleFactor
=
1
.
0
f
;
}
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_POINTSCALEENABLE
])
{
att
[
0
]
=
*
((
float
*
)
&
This
->
stateBlock
->
renderState
[
WINED3DRS_POINTSCALE_A
])
/
(
This
->
stateBlock
->
viewport
.
Height
*
This
->
stateBlock
->
viewport
.
Height
*
scaleFactor
);
att
[
1
]
=
*
((
float
*
)
&
This
->
stateBlock
->
renderState
[
WINED3DRS_POINTSCALE_B
])
/
(
This
->
stateBlock
->
viewport
.
Height
*
This
->
stateBlock
->
viewport
.
Height
*
scaleFactor
);
att
[
2
]
=
*
((
float
*
)
&
This
->
stateBlock
->
renderState
[
WINED3DRS_POINTSCALE_C
])
/
(
This
->
stateBlock
->
viewport
.
Height
*
This
->
stateBlock
->
viewport
.
Height
*
scaleFactor
);
}
}
if
(
GL_SUPPORT
(
ARB_POINT_PARAMETERS
))
{
GL_EXTCALL
(
glPointParameterfvARB
)(
GL_POINT_DISTANCE_ATTENUATION_ARB
,
att
);
checkGLcall
(
"glPointParameterfvARB(GL_DISTANCE_ATTENUATION_ARB, ..."
);
}
else
if
(
GL_SUPPORT
(
EXT_POINT_PARAMETERS
))
{
GL_EXTCALL
(
glPointParameterfvEXT
)(
GL_DISTANCE_ATTENUATION_EXT
,
att
);
checkGLcall
(
"glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ..."
);
}
else
{
TRACE
(
"POINT_PARAMETERS not supported in this version of opengl
\n
"
);
}
break
;
}
case
WINED3DRS_COLORWRITEENABLE
:
{
TRACE
(
"Color mask: r(%d) g(%d) b(%d) a(%d)
\n
"
,
...
...
dlls/wined3d/state.c
View file @
caa371a6
...
...
@@ -950,6 +950,57 @@ static void state_psizemax(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
static
void
state_pscale
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
/* TODO: Group this with the viewport */
/*
* POINTSCALEENABLE controls how point size value is treated. If set to
* true, the point size is scaled with respect to height of viewport.
* When set to false point size is in pixels.
*
* http://msdn.microsoft.com/library/en-us/directx9_c/point_sprites.asp
*/
/* Default values */
GLfloat
att
[
3
]
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
};
/*
* Minimum valid point size for OpenGL is 1.0f. For Direct3D it is 0.0f.
* This means that OpenGL will clamp really small point sizes to 1.0f.
* To correct for this we need to multiply by the scale factor when sizes
* are less than 1.0f. scale_factor = 1.0f / point_size.
*/
GLfloat
pointSize
=
*
((
float
*
)
&
stateblock
->
renderState
[
WINED3DRS_POINTSIZE
]);
if
(
pointSize
>
0
.
0
f
)
{
GLfloat
scaleFactor
;
if
(
pointSize
<
1
.
0
f
)
{
scaleFactor
=
pointSize
*
pointSize
;
}
else
{
scaleFactor
=
1
.
0
f
;
}
if
(
stateblock
->
renderState
[
WINED3DRS_POINTSCALEENABLE
])
{
att
[
0
]
=
*
((
float
*
)
&
stateblock
->
renderState
[
WINED3DRS_POINTSCALE_A
])
/
(
stateblock
->
viewport
.
Height
*
stateblock
->
viewport
.
Height
*
scaleFactor
);
att
[
1
]
=
*
((
float
*
)
&
stateblock
->
renderState
[
WINED3DRS_POINTSCALE_B
])
/
(
stateblock
->
viewport
.
Height
*
stateblock
->
viewport
.
Height
*
scaleFactor
);
att
[
2
]
=
*
((
float
*
)
&
stateblock
->
renderState
[
WINED3DRS_POINTSCALE_C
])
/
(
stateblock
->
viewport
.
Height
*
stateblock
->
viewport
.
Height
*
scaleFactor
);
}
}
if
(
GL_SUPPORT
(
ARB_POINT_PARAMETERS
))
{
GL_EXTCALL
(
glPointParameterfvARB
)(
GL_POINT_DISTANCE_ATTENUATION_ARB
,
att
);
checkGLcall
(
"glPointParameterfvARB(GL_DISTANCE_ATTENUATION_ARB, ..."
);
}
else
if
(
GL_SUPPORT
(
EXT_POINT_PARAMETERS
))
{
GL_EXTCALL
(
glPointParameterfvEXT
)(
GL_DISTANCE_ATTENUATION_EXT
,
att
);
checkGLcall
(
"glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ..."
);
}
else
{
TRACE
(
"POINT_PARAMETERS not supported in this version of opengl
\n
"
);
}
}
const
struct
StateEntry
StateTable
[]
=
{
/* State name representative, apply function */
...
...
@@ -1112,10 +1163,10 @@ const struct StateEntry StateTable[] =
{
/*154, WINED3DRS_POINTSIZE */
STATE_RENDER
(
WINED3DRS_POINTSIZE
),
state_psize
},
{
/*155, WINED3DRS_POINTSIZE_MIN */
STATE_RENDER
(
WINED3DRS_POINTSIZE_MIN
),
state_psizemin
},
{
/*156, WINED3DRS_POINTSPRITEENABLE */
STATE_RENDER
(
WINED3DRS_POINTSPRITEENABLE
),
state_unknown
},
{
/*157, WINED3DRS_POINTSCALEENABLE */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
unknown
},
{
/*158, WINED3DRS_POINTSCALE_A */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
unknown
},
{
/*159, WINED3DRS_POINTSCALE_B */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
unknown
},
{
/*160, WINED3DRS_POINTSCALE_C */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
unknown
},
{
/*157, WINED3DRS_POINTSCALEENABLE */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
pscale
},
{
/*158, WINED3DRS_POINTSCALE_A */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
pscale
},
{
/*159, WINED3DRS_POINTSCALE_B */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
pscale
},
{
/*160, WINED3DRS_POINTSCALE_C */
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
state_
pscale
},
{
/*161, WINED3DRS_MULTISAMPLEANTIALIAS */
STATE_RENDER
(
WINED3DRS_MULTISAMPLEANTIALIAS
),
state_unknown
},
{
/*162, WINED3DRS_MULTISAMPLEMASK */
STATE_RENDER
(
WINED3DRS_MULTISAMPLEMASK
),
state_unknown
},
{
/*163, WINED3DRS_PATCHEDGESTYLE */
STATE_RENDER
(
WINED3DRS_PATCHEDGESTYLE
),
state_unknown
},
...
...
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