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
ce436a76
Commit
ce436a76
authored
Jul 22, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of getActiveContext().
parent
377cda97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
23 deletions
+18
-23
context.c
dlls/wined3d/context.c
+0
-4
gl_compat.c
dlls/wined3d/gl_compat.c
+18
-18
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-1
No files found.
dlls/wined3d/context.c
View file @
ce436a76
...
...
@@ -1986,7 +1986,3 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
FIXME
(
"Unexpected context usage requested
\n
"
);
}
}
WineD3DContext
*
getActiveContext
(
void
)
{
return
last_device
->
activeContext
;
}
dlls/wined3d/gl_compat.c
View file @
ce436a76
...
...
@@ -147,7 +147,7 @@ static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble* params) {
static
void
(
WINE_GLAPI
*
old_fogcoord_glEnable
)
(
GLenum
cap
)
=
NULL
;
static
void
WINE_GLAPI
wine_glEnable
(
GLenum
cap
)
{
if
(
cap
==
GL_FOG
)
{
WineD3DContext
*
ctx
=
getActiveContex
t
();
struct
WineD3DContext
*
ctx
=
context_get_curren
t
();
ctx
->
fog_enabled
=
1
;
if
(
ctx
->
gl_fog_source
!=
GL_FRAGMENT_DEPTH_EXT
)
return
;
}
...
...
@@ -157,7 +157,7 @@ static void WINE_GLAPI wine_glEnable(GLenum cap) {
static
void
(
WINE_GLAPI
*
old_fogcoord_glDisable
)
(
GLenum
cap
)
=
NULL
;
static
void
WINE_GLAPI
wine_glDisable
(
GLenum
cap
)
{
if
(
cap
==
GL_FOG
)
{
WineD3DContext
*
ctx
=
getActiveContex
t
();
struct
WineD3DContext
*
ctx
=
context_get_curren
t
();
ctx
->
fog_enabled
=
0
;
if
(
ctx
->
gl_fog_source
!=
GL_FRAGMENT_DEPTH_EXT
)
return
;
}
...
...
@@ -166,8 +166,9 @@ static void WINE_GLAPI wine_glDisable(GLenum cap) {
static
void
(
WINE_GLAPI
*
old_fogcoord_glFogi
)
(
GLenum
pname
,
GLint
param
)
=
NULL
;
static
void
WINE_GLAPI
wine_glFogi
(
GLenum
pname
,
GLint
param
)
{
struct
WineD3DContext
*
ctx
=
context_get_current
();
if
(
pname
==
GL_FOG_COORDINATE_SOURCE_EXT
)
{
WineD3DContext
*
ctx
=
getActiveContext
();
ctx
->
gl_fog_source
=
param
;
if
(
param
==
GL_FRAGMENT_DEPTH_EXT
)
{
if
(
ctx
->
fog_enabled
)
old_fogcoord_glEnable
(
GL_FOG
);
...
...
@@ -177,9 +178,9 @@ static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
}
}
else
{
if
(
pname
==
GL_FOG_START
)
{
getActiveContext
()
->
fogstart
=
param
;
ctx
->
fogstart
=
param
;
}
else
if
(
pname
==
GL_FOG_END
)
{
getActiveContext
()
->
fogend
=
param
;
ctx
->
fogend
=
param
;
}
old_fogcoord_glFogi
(
pname
,
param
);
}
...
...
@@ -187,8 +188,8 @@ static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
static
void
(
WINE_GLAPI
*
old_fogcoord_glFogiv
)
(
GLenum
pname
,
const
GLint
*
param
)
=
NULL
;
static
void
WINE_GLAPI
wine_glFogiv
(
GLenum
pname
,
const
GLint
*
param
)
{
struct
WineD3DContext
*
ctx
=
context_get_current
();
if
(
pname
==
GL_FOG_COORDINATE_SOURCE_EXT
)
{
WineD3DContext
*
ctx
=
getActiveContext
();
ctx
->
gl_fog_source
=
*
param
;
if
(
*
param
==
GL_FRAGMENT_DEPTH_EXT
)
{
if
(
ctx
->
fog_enabled
)
old_fogcoord_glEnable
(
GL_FOG
);
...
...
@@ -198,9 +199,9 @@ static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
}
}
else
{
if
(
pname
==
GL_FOG_START
)
{
getActiveContext
()
->
fogstart
=
*
param
;
ctx
->
fogstart
=
*
param
;
}
else
if
(
pname
==
GL_FOG_END
)
{
getActiveContext
()
->
fogend
=
*
param
;
ctx
->
fogend
=
*
param
;
}
old_fogcoord_glFogiv
(
pname
,
param
);
}
...
...
@@ -208,8 +209,8 @@ static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
static
void
(
WINE_GLAPI
*
old_fogcoord_glFogf
)
(
GLenum
pname
,
GLfloat
param
)
=
NULL
;
static
void
WINE_GLAPI
wine_glFogf
(
GLenum
pname
,
GLfloat
param
)
{
struct
WineD3DContext
*
ctx
=
context_get_current
();
if
(
pname
==
GL_FOG_COORDINATE_SOURCE_EXT
)
{
WineD3DContext
*
ctx
=
getActiveContext
();
ctx
->
gl_fog_source
=
(
GLint
)
param
;
if
(
param
==
GL_FRAGMENT_DEPTH_EXT
)
{
if
(
ctx
->
fog_enabled
)
old_fogcoord_glEnable
(
GL_FOG
);
...
...
@@ -219,9 +220,9 @@ static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
}
}
else
{
if
(
pname
==
GL_FOG_START
)
{
getActiveContext
()
->
fogstart
=
param
;
ctx
->
fogstart
=
param
;
}
else
if
(
pname
==
GL_FOG_END
)
{
getActiveContext
()
->
fogend
=
param
;
ctx
->
fogend
=
param
;
}
old_fogcoord_glFogf
(
pname
,
param
);
}
...
...
@@ -229,8 +230,8 @@ static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
static
void
(
WINE_GLAPI
*
old_fogcoord_glFogfv
)
(
GLenum
pname
,
const
GLfloat
*
param
)
=
NULL
;
static
void
WINE_GLAPI
wine_glFogfv
(
GLenum
pname
,
const
GLfloat
*
param
)
{
struct
WineD3DContext
*
ctx
=
context_get_current
();
if
(
pname
==
GL_FOG_COORDINATE_SOURCE_EXT
)
{
WineD3DContext
*
ctx
=
getActiveContext
();
ctx
->
gl_fog_source
=
(
GLint
)
*
param
;
if
(
*
param
==
GL_FRAGMENT_DEPTH_EXT
)
{
if
(
ctx
->
fog_enabled
)
old_fogcoord_glEnable
(
GL_FOG
);
...
...
@@ -240,15 +241,14 @@ static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param) {
}
}
else
{
if
(
pname
==
GL_FOG_COLOR
)
{
WineD3DContext
*
ctx
=
getActiveContext
();
ctx
->
fogcolor
[
0
]
=
param
[
0
];
ctx
->
fogcolor
[
1
]
=
param
[
1
];
ctx
->
fogcolor
[
2
]
=
param
[
2
];
ctx
->
fogcolor
[
3
]
=
param
[
3
];
}
else
if
(
pname
==
GL_FOG_START
)
{
getActiveContext
()
->
fogstart
=
*
param
;
ctx
->
fogstart
=
*
param
;
}
else
if
(
pname
==
GL_FOG_END
)
{
getActiveContext
()
->
fogend
=
*
param
;
ctx
->
fogend
=
*
param
;
}
old_fogcoord_glFogfv
(
pname
,
param
);
}
...
...
@@ -269,7 +269,7 @@ static void (WINE_GLAPI *old_fogcoord_glFogCoordfvEXT) (const GLfloat *f) = NULL
static
void
(
WINE_GLAPI
*
old_fogcoord_glFogCoorddvEXT
)
(
const
GLdouble
*
f
)
=
NULL
;
static
void
WINE_GLAPI
wine_glVertex4f
(
GLfloat
x
,
GLfloat
y
,
GLfloat
z
,
GLfloat
w
)
{
WineD3DContext
*
ctx
=
getActiveContex
t
();
struct
WineD3DContext
*
ctx
=
context_get_curren
t
();
if
(
ctx
->
gl_fog_source
==
GL_FOG_COORDINATE_EXT
&&
ctx
->
fog_enabled
)
{
GLfloat
c
[
4
]
=
{
ctx
->
color
[
0
],
ctx
->
color
[
1
],
ctx
->
color
[
2
],
ctx
->
color
[
3
]};
GLfloat
i
;
...
...
@@ -299,7 +299,7 @@ static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos) {
}
static
void
wine_glColor4f
(
GLfloat
r
,
GLfloat
g
,
GLfloat
b
,
GLfloat
a
)
{
WineD3DContext
*
ctx
=
getActiveContex
t
();
struct
WineD3DContext
*
ctx
=
context_get_curren
t
();
ctx
->
color
[
0
]
=
r
;
ctx
->
color
[
1
]
=
g
;
ctx
->
color
[
2
]
=
b
;
...
...
@@ -327,7 +327,7 @@ static void wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a) {
* precision function
*/
static
void
wine_glFogCoordfEXT
(
GLfloat
f
)
{
WineD3DContext
*
ctx
=
getActiveContex
t
();
struct
WineD3DContext
*
ctx
=
context_get_curren
t
();
ctx
->
fog_coord_value
=
f
;
}
static
void
wine_glFogCoorddEXT
(
GLdouble
f
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
ce436a76
...
...
@@ -1263,7 +1263,6 @@ typedef enum ContextUsage {
}
ContextUsage
;
void
ActivateContext
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurface
*
target
,
ContextUsage
usage
);
WineD3DContext
*
getActiveContext
(
void
);
WineD3DContext
*
CreateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurfaceImpl
*
target
,
HWND
win
,
BOOL
create_pbuffer
,
const
WINED3DPRESENT_PARAMETERS
*
pPresentParms
);
void
DestroyContext
(
IWineD3DDeviceImpl
*
This
,
WineD3DContext
*
context
);
void
context_resource_released
(
IWineD3DDevice
*
iface
,
IWineD3DResource
*
resource
,
WINED3DRESOURCETYPE
type
);
...
...
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