mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 20:11:44 +00:00
fix to sw character drawing (should speed SW up)
gl_blend2d (hackish cvar to get 2d blending, should work?) fixes to pluginless compile few other small changes git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1202 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
a3c6317802
commit
c30d79eb31
10 changed files with 49 additions and 70 deletions
|
@ -1676,8 +1676,10 @@ void CL_ConnectionlessPacket (void)
|
|||
else
|
||||
net_message.data[net_message.cursize] = '\0';
|
||||
|
||||
#ifdef PLUGINS
|
||||
if (Plug_ConnectionlessClientPacket(net_message.data+4, net_message.cursize-4))
|
||||
return;
|
||||
#endif
|
||||
|
||||
c = MSG_ReadByte ();
|
||||
|
||||
|
|
|
@ -3712,7 +3712,7 @@ void CLQ2_ParseServerMessage (void)
|
|||
if (i == PRINT_CHAT)
|
||||
{
|
||||
S_LocalSound ("misc/talk.wav");
|
||||
con_ormask = 0x8000;
|
||||
con_ormask = CON_2NDCHARSETTEXT;
|
||||
if (CL_ParseChat(s))
|
||||
{
|
||||
CL_ParsePrint(s, i);
|
||||
|
|
|
@ -1849,9 +1849,11 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
|
|||
|
||||
if (scr_drawdialog)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
if (!nohud)
|
||||
#ifdef PLUGINS
|
||||
Plug_SBar ();
|
||||
#else
|
||||
Sbar_Draw ();
|
||||
#endif
|
||||
SCR_ShowPics_Draw();
|
||||
Draw_FadeScreen ();
|
||||
|
@ -1861,8 +1863,12 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
|
|||
else if (scr_drawloading)
|
||||
{
|
||||
SCR_DrawLoading ();
|
||||
|
||||
if (!nohud)
|
||||
#ifdef PLUGINS
|
||||
Plug_SBar ();
|
||||
Plug_SBar ();
|
||||
#else
|
||||
Sbar_Draw ();
|
||||
#endif
|
||||
SCR_ShowPics_Draw();
|
||||
}
|
||||
|
@ -1894,6 +1900,8 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
|
|||
SCR_DrawPause ();
|
||||
#ifdef PLUGINS
|
||||
Plug_SBar ();
|
||||
#else
|
||||
Sbar_Draw ();
|
||||
#endif
|
||||
SCR_ShowPics_Draw();
|
||||
|
||||
|
|
|
@ -24,14 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
//this is the same order as q3, except that white and black are swapped...
|
||||
consolecolours_t consolecolours[] = {
|
||||
#define CON_WHITEMASK 7*256 //must be constant. things assume this
|
||||
{0, 0, 0},
|
||||
{1, 0, 0},
|
||||
{0, 1, 0},
|
||||
{1, 1, 0},
|
||||
{0.1, 0.1, 1}, //brighten dark blue a little
|
||||
{1, 0, 1},
|
||||
{0, 1, 1},
|
||||
{1, 1, 1}
|
||||
{0, 0, 0, 0x0000},
|
||||
{1, 0, 0, 0x001F},
|
||||
{0, 1, 0, 0x03E0},
|
||||
{1, 1, 0, 0x03FF},
|
||||
{0.1, 0.1, 1, 0x7C00}, //brighten dark blue a little
|
||||
{1, 0, 1, 0x7C1F},
|
||||
{0, 1, 1, 0x7FE0},
|
||||
{1, 1, 1, 0x7FFF}
|
||||
};
|
||||
|
||||
int con_ormask;
|
||||
|
|
|
@ -932,7 +932,12 @@ static void PF_R_RenderScene(progfuncs_t *prinst, struct globalvars_s *pr_global
|
|||
vid.recalc_refdef = 1;
|
||||
|
||||
if (csqc_drawsbar)
|
||||
#ifdef PLUGINS
|
||||
Plug_SBar();
|
||||
#else
|
||||
Sbar_Draw();
|
||||
#endif
|
||||
|
||||
if (csqc_addcrosshair)
|
||||
Draw_Crosshair();
|
||||
}
|
||||
|
|
|
@ -163,6 +163,8 @@ cvar_t gl_shadeq3 = {"gl_shadeq3", "1"}; //use if you want.
|
|||
extern cvar_t r_vertexlight;
|
||||
cvar_t gl_shadeq1 = {"gl_shadeq1", "0", NULL, CVAR_CHEAT}; //FIXME: :(
|
||||
cvar_t gl_shadeq1_name = {"gl_shadeq1_name", "*"};
|
||||
|
||||
cvar_t gl_blend2d = {"gl_blend2d", "0"};
|
||||
#endif
|
||||
|
||||
cvar_t r_bloodstains = {"r_bloodstains", "1"};
|
||||
|
@ -333,6 +335,8 @@ void GLRenderer_Init(void)
|
|||
Cvar_Register (&gl_shadeq1, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&gl_shadeq1_name, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&gl_shadeq3, GLRENDEREROPTIONS);
|
||||
|
||||
Cvar_Register (&gl_blend2d, GLRENDEREROPTIONS);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define MAXCONCOLOURS 8
|
||||
typedef struct {
|
||||
float r, g, b;
|
||||
int pal;
|
||||
int rgbmask;
|
||||
} consolecolours_t;
|
||||
extern consolecolours_t consolecolours[MAXCONCOLOURS];
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ extern cvar_t gl_savecompressedtex;
|
|||
|
||||
extern cvar_t gl_load24bit;
|
||||
|
||||
extern cvar_t gl_blend2d;
|
||||
extern cvar_t con_ocranaleds;
|
||||
|
||||
qbyte *draw_chars; // 8*8 graphic characters
|
||||
|
@ -1928,8 +1929,16 @@ void GL_Set2D (void)
|
|||
|
||||
qglDisable (GL_DEPTH_TEST);
|
||||
qglDisable (GL_CULL_FACE);
|
||||
qglDisable (GL_BLEND);
|
||||
qglEnable (GL_ALPHA_TEST);
|
||||
if (gl_blend2d.value)
|
||||
{
|
||||
qglEnable (GL_BLEND);
|
||||
qglDisable (GL_ALPHA_TEST);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglDisable (GL_BLEND);
|
||||
qglEnable (GL_ALPHA_TEST);
|
||||
}
|
||||
// qglDisable (GL_ALPHA_TEST);
|
||||
|
||||
qglColor4f (1,1,1,1);
|
||||
|
|
|
@ -652,9 +652,15 @@ void SWDraw_Character (int x, int y, unsigned int num)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#define FindPalette(r,g,b) pal555to8[((r&0xF8)>>3)|((g&0xF8)<<2)|((b&0xF8)<<7)]
|
||||
#define colourmask(p,r,g,b) FindPalette(host_basepal[p*3]*r, host_basepal[p*3+1]*g, host_basepal[p*3+2]*b)
|
||||
#define draw(p) colourmask(p, (int)consolecolours[colour].r, (int)consolecolours[colour].g, (int)consolecolours[colour].b)
|
||||
*/
|
||||
|
||||
#define drawpal(r,g,b) pal555to8[(r|(g<<5)|(b<<10)) & consolecolours[colour].rgbmask]
|
||||
#define draw(p) drawpal(host_basepal[p*3]>>3,host_basepal[p*3+1]>>3,host_basepal[p*3+2]>>3)
|
||||
|
||||
void SWDraw_ColouredCharacter (int x, int y, unsigned int num)
|
||||
{
|
||||
qbyte *source;
|
||||
|
@ -677,7 +683,7 @@ int colour;
|
|||
return;
|
||||
}
|
||||
|
||||
if (colour == 0) //0 is white anyway (speedup)
|
||||
if (colour == COLOR_WHITE)
|
||||
{
|
||||
Draw_Character(x, y, num);
|
||||
return;
|
||||
|
@ -697,7 +703,6 @@ int colour;
|
|||
else
|
||||
drawline = 8;
|
||||
|
||||
|
||||
if (r_pixbytes == 1)
|
||||
{
|
||||
qbyte *dest;
|
||||
|
|
|
@ -164,61 +164,7 @@ void SWSCR_UpdateScreen (void)
|
|||
|
||||
D_EnableBackBufferAccess (); // of all overlay stuff if drawing directly
|
||||
|
||||
#if 1
|
||||
SCR_DrawTwoDimensional(uimenu, nohud);
|
||||
#else
|
||||
if (scr_drawloading)
|
||||
{
|
||||
SCR_DrawLoading ();
|
||||
#ifdef PLUGINS
|
||||
Plug_SBar ();
|
||||
#endif
|
||||
SCR_ShowPics_Draw();
|
||||
}
|
||||
else if (scr_drawdialog)
|
||||
{
|
||||
#ifdef PLUGINS
|
||||
Plug_SBar ();
|
||||
#endif
|
||||
SCR_ShowPics_Draw();
|
||||
Draw_FadeScreen ();
|
||||
SCR_DrawNotifyString ();
|
||||
scr_copyeverything = true;
|
||||
}
|
||||
else if (cl.intermission == 1 && key_dest == key_game)
|
||||
{
|
||||
Sbar_IntermissionOverlay ();
|
||||
}
|
||||
else if (cl.intermission == 2 && key_dest == key_game)
|
||||
{
|
||||
Sbar_FinaleOverlay ();
|
||||
SCR_CheckDrawCenterString ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Draw_Crosshair();
|
||||
|
||||
SCR_DrawRam ();
|
||||
SCR_DrawNet ();
|
||||
SCR_DrawTurtle ();
|
||||
SCR_DrawPause ();
|
||||
SCR_DrawFPS ();
|
||||
SCR_DrawUPS ();
|
||||
SCR_DrawClock();
|
||||
#ifdef PLUGINS
|
||||
Plug_SBar ();
|
||||
#endif
|
||||
SCR_ShowPics_Draw();
|
||||
SCR_CheckDrawCenterString ();
|
||||
#ifdef TEXTEDITOR
|
||||
if (editoractive)
|
||||
Editor_Draw();
|
||||
#endif
|
||||
SCR_DrawConsole (false);
|
||||
M_Draw (uimenu);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
D_DisableBackBufferAccess (); // for adapters that can't stay mapped in
|
||||
// for linear writes all the time
|
||||
|
|
Loading…
Reference in a new issue