mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- consolidated console clear functions.
This commit is contained in:
parent
63a733b934
commit
471f720d95
3 changed files with 17 additions and 60 deletions
|
@ -246,7 +246,7 @@ int32_t FindDistance3D(int32_t x, int32_t y, int32_t z)
|
|||
|
||||
|
||||
// Clear OSD background
|
||||
void COMMON_clearbackground(int numcols, int numrows)
|
||||
void COMMON_doclearbackground(int numcols, int height)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(numcols);
|
||||
|
||||
|
@ -260,9 +260,9 @@ void COMMON_clearbackground(int numcols, int numrows)
|
|||
polymostSet2dView();
|
||||
glColor4f(0.f, 0.f, 0.f, 0.67f);
|
||||
glEnable(GL_BLEND);
|
||||
glRecti(0, 0, xdim, 8*numrows+8);
|
||||
glRecti(0, 0, xdim, height);
|
||||
glColor4f(0.f, 0.f, 0.f, 1.f);
|
||||
glRecti(0, 8*numrows+4, xdim, 8*numrows+8);
|
||||
glRecti(0, height-4, xdim, height);
|
||||
|
||||
// glPopAttrib();
|
||||
polymost_useColorOnly(false);
|
||||
|
@ -274,3 +274,8 @@ void COMMON_clearbackground(int numcols, int numrows)
|
|||
|
||||
CLEARLINES2D(0, min(ydim, numrows*8+8), editorcolors[16]);
|
||||
}
|
||||
|
||||
void COMMON_clearbackground(int numcols, int numrows)
|
||||
{
|
||||
COMMON_doclearbackground(numcols, 8 * numrows + 8);
|
||||
}
|
||||
|
|
|
@ -140,37 +140,12 @@ void GAME_onshowosd(int shown)
|
|||
// KB_KeyDown[sc_Pause] = 1;
|
||||
}
|
||||
|
||||
void COMMON_doclearbackground(int numcols, int numrows);
|
||||
|
||||
void GAME_clearbackground(int numcols, int numrows)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(numcols);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (videoGetRenderMode() >= REND_POLYMOST && in3dmode())
|
||||
{
|
||||
int const i8n8 = OSD_SCALE(OSDCHAR_HEIGHT*numrows);
|
||||
|
||||
polymost_setFogEnabled(false);
|
||||
polymost_useColorOnly(true);
|
||||
|
||||
polymostSet2dView();
|
||||
glColor4f(0.f, 0.f, 0.f, 0.67f);
|
||||
glEnable(GL_BLEND);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glRecti(0, 0, xdim, i8n8+OSDCHAR_HEIGHT);
|
||||
glColor4f(0.f, 0.f, 0.f, 1.f);
|
||||
glRecti(0, i8n8+4, xdim, i8n8+OSDCHAR_HEIGHT);
|
||||
|
||||
polymost_useColorOnly(false);
|
||||
|
||||
if (!nofog)
|
||||
polymost_setFogEnabled(true);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
CLEARLINES2D(0, min(ydim, OSD_SCALE(numrows * OSDCHAR_HEIGHT + OSDCHAR_HEIGHT)), editorcolors[16]);
|
||||
int const i8n8 = OSD_SCALE(OSDCHAR_HEIGHT * numrows);
|
||||
COMMON_doclearbackground(numcols, i8n8 + OSDCHAR_HEIGHT);
|
||||
}
|
||||
|
||||
#undef OSD_SCALE
|
||||
|
|
|
@ -151,35 +151,12 @@ void GAME_onshowosd(int32_t shown)
|
|||
// KB_KeyDown[sc_Pause] = 1;
|
||||
}
|
||||
|
||||
void GAME_clearbackground(int32_t numcols, int32_t numrows)
|
||||
void COMMON_doclearbackground(int numcols, int numrows);
|
||||
|
||||
void GAME_clearbackground(int numcols, int numrows)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(numcols);
|
||||
|
||||
# ifdef USE_OPENGL
|
||||
if (videoGetRenderMode() >= REND_POLYMOST && in3dmode())
|
||||
{
|
||||
const int32_t i8n8 = OSD_SCALE(OSDCHAR_HEIGHT*numrows);
|
||||
// glPushAttrib(GL_FOG_BIT);
|
||||
polymost_setFogEnabled(false);
|
||||
polymost_useColorOnly(true);
|
||||
|
||||
polymostSet2dView();
|
||||
glColor4f(0.f, 0.f, 0.f, 0.67f);
|
||||
glEnable(GL_BLEND);
|
||||
glRecti(0, 0, xdim, i8n8+OSDCHAR_HEIGHT);
|
||||
glColor4f(0.f, 0.f, 0.f, 1.f);
|
||||
glRecti(0, i8n8+4, xdim, i8n8+OSDCHAR_HEIGHT);
|
||||
|
||||
polymost_useColorOnly(false);
|
||||
if (!nofog)
|
||||
polymost_setFogEnabled(true);
|
||||
// glPopAttrib();
|
||||
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
|
||||
CLEARLINES2D(0, min(ydim, OSD_SCALE(numrows*OSDCHAR_HEIGHT+OSDCHAR_HEIGHT)), editorcolors[16]);
|
||||
int const i8n8 = OSD_SCALE(OSDCHAR_HEIGHT * numrows);
|
||||
COMMON_doclearbackground(numcols, i8n8 + OSDCHAR_HEIGHT);
|
||||
}
|
||||
|
||||
#undef OSD_SCALE
|
||||
|
|
Loading…
Reference in a new issue