Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Richard Gobeille
EDuke32
Commits
89a22666
Commit
89a22666
authored
Jun 24, 2022
by
Richard Gobeille
Browse files
engine: reset less polymost/GL state between model and voxel draws
parent
8405e59b
Changes
4
Hide whitespace changes
Inline
Side-by-side
source/build/include/polymost.h
View file @
89a22666
...
...
@@ -50,6 +50,7 @@ int32_t polymost_spriteIsModelOrVoxel(tspritetype const * const tspr);
void
polymost_disableProgram
(
void
);
char
polymost_getClamp
(
void
);
void
polymost_resetState
(
void
);
void
polymost_resetProgram
(
void
);
void
polymost_resetVertexPointers
(
void
);
void
polymost_setClamp
(
char
clamp
);
...
...
source/build/src/polymost.cpp
View file @
89a22666
...
...
@@ -553,27 +553,31 @@ static void Polymost_DetermineTextureFormatSupport(void);
// reset vertex pointers to polymost default
void
polymost_resetVertexPointers
()
{
buildgl_outputDebugMessage
(
3
,
"polymost_resetVertexPointers()"
);
buildgl_resetStateAccounting
();
buildgl_bindBuffer
(
GL_ARRAY_BUFFER
,
drawpolyVertsID
);
glVertexPointer
(
3
,
GL_FLOAT
,
5
*
sizeof
(
float
),
0
);
glTexCoordPointer
(
2
,
GL_FLOAT
,
5
*
sizeof
(
float
),
(
GLvoid
*
)
(
3
*
sizeof
(
float
)));
glVertexPointer
(
3
,
GL_FLOAT
,
5
*
sizeof
(
float
),
0
);
glTexCoordPointer
(
2
,
GL_FLOAT
,
5
*
sizeof
(
float
),
(
GLvoid
*
)(
3
*
sizeof
(
float
)));
#ifdef USE_GLEXT
if
(
r_detailmapping
)
{
glClientActiveTexture
(
GL_TEXTURE3
);
glTexCoordPointer
(
2
,
GL_FLOAT
,
5
*
sizeof
(
float
),
(
GLvoid
*
)
(
3
*
sizeof
(
float
)));
glTexCoordPointer
(
2
,
GL_FLOAT
,
5
*
sizeof
(
float
),
(
GLvoid
*
)(
3
*
sizeof
(
float
)));
}
if
(
r_glowmapping
)
{
glClientActiveTexture
(
GL_TEXTURE4
);
glTexCoordPointer
(
2
,
GL_FLOAT
,
5
*
sizeof
(
float
),
(
GLvoid
*
)
(
3
*
sizeof
(
float
)));
glTexCoordPointer
(
2
,
GL_FLOAT
,
5
*
sizeof
(
float
),
(
GLvoid
*
)(
3
*
sizeof
(
float
)));
}
glClientActiveTexture
(
GL_TEXTURE0
);
#endif
}
void
polymost_resetState
()
{
buildgl_outputDebugMessage
(
3
,
"polymost_resetState()"
);
buildgl_resetStateAccounting
();
polymost_resetVertexPointers
();
polymost_resetProgram
();
}
...
...
@@ -1170,7 +1174,7 @@ void polymost_glinit()
glEnableClientState
(
GL_VERTEX_ARRAY
);
glEnableClientState
(
GL_TEXTURE_COORD_ARRAY
);
polymost_reset
VertexPointers
();
polymost_reset
State
();
texcache_init
();
texcache_openfiles
();
...
...
@@ -1189,7 +1193,7 @@ void polymost_glinit()
void
polymost_init
()
{
lastbasepal
=
-
1
;
polymost_reset
VertexPointers
();
polymost_reset
State
();
}
////////// VISIBILITY FOG ROUTINES //////////
...
...
source/build/src/sdlayer.cpp
View file @
89a22666
...
...
@@ -2096,7 +2096,7 @@ void videoShowFrame(int32_t w)
if
(
w
!=
-
1
)
{
if
(
bpp
>
8
)
polymost_reset
VertexPointers
();
polymost_reset
State
();
else
glsurface_refresh
();
}
...
...
source/build/src/winlayer.cpp
View file @
89a22666
...
...
@@ -1767,7 +1767,7 @@ void videoShowFrame(int32_t w)
SwapBuffers
(
hDC
);
#ifdef USE_OPENGL
polymost_reset
VertexPointers
();
polymost_reset
State
();
#endif
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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