add hud_miniscores_show cvar to hide the mini deathmatch overlay

fix some issues with ezhud. ownfrags, text alphas, RGB player colours.
tweak gamecontroller input a little, to make axis slightly more usable.
fix issue with menuqc/csqc not being able to query binds reliably.
fix csqc gravitydir.
bump r_particle_tracelimit so that its no longer a limitation by default.
tweak fog to allow far-clip-plane culling on entities (but still not on world, due to issues with glClear).
fix performance issue with q1bspx BRUSHLIST lump.
fix mvd recording bug.
fix limitation that becomes apparent on maps with lots of ents visible at once. will now use more bandwidth in such cases, however.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4994 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2015-11-18 07:37:39 +00:00
parent e03a8d9d41
commit 71319a8852
60 changed files with 1342 additions and 407 deletions

View file

@ -112,10 +112,12 @@ void Draw_SAlphaSubPic2(float x, float y, mpic_t *pic, float s1, float t1, float
pDraw_Colour4f(1, 1, 1, 1);
}
void Draw_AlphaFill(float x, float y, float w, float h, qbyte pal, float alpha)
void Draw_AlphaFill(float x, float y, float w, float h, unsigned int pal, float alpha)
{
pDraw_Colour4f(1, 1, 1, alpha * alphamul);
pDraw_Colourp(pal);
if (pal >= 256)
pDraw_Colour4f(((pal>>16)&0xff)/255.0, ((pal>>8)&0xff)/255.0, ((pal>>0)&0xff)/255.0, alpha * alphamul);
else
pDraw_Colourpa(pal, alpha * alphamul);
pDraw_Fill(x, y, w, h);
pDraw_Colour4f(1, 1, 1, 1);
}

View file

@ -111,7 +111,7 @@ void SCR_DrawWadString(float x, float y, float scale, char *str);
void Draw_SAlphaSubPic2(float x, float y, mpic_t *pic, float s1, float t1, float s2, float t2, float w, float h, float alpha);
void Draw_AlphaFill(float x, float y, float w, float h, qbyte pal, float alpha);
void Draw_AlphaFill(float x, float y, float w, float h, unsigned int pal, float alpha);
void Draw_AlphaPic(float x, float y, mpic_t *pic, float alpha);
void Draw_AlphaSubPic(float x, float y, mpic_t *pic, float s1, float t1, float s2, float t2, float alpha);
void SCR_HUD_DrawBar(int direction, int value, float max_value, float *rgba, int x, int y, int width, int height);

View file

@ -785,6 +785,43 @@ void HUD_Recalculate_f(void)
HUD_Recalculate();
}
void HUD_Export_f(void)
{
char line[8192];
qhandle_t handle;
hud_t *hud;
cvar_t *var;
int i;
char *fname = "foo";
char *fdesc = "OMG ITS FOO";
snprintf(line, sizeof(line), "configs/hud_%s.cfg", fname);
if (pFS_Open(line, &handle, 0) < 0)
Com_Printf("Couldn't open %s\n", line);
else
{
//FIXME: should print the result of an flocate, but plugins are not really aware of that stuff.
Com_Printf("Writing %s\n", line);
snprintf(line, sizeof(line), "//desc:%s\n\n//hud cvar settings, for use with FTEQW's ezhud plugin.\n", fdesc);
pFS_Write(handle, line, strlen(line));
for (hud = hud_huds; hud; hud = hud->next)
{
for (i = 0; i < hud->num_params; i++)
{
var = hud->params[i];
//fixme: deal with " and \n
snprintf(line, sizeof(line), "set %s \"%s\"\n", var->name, var->string);
pFS_Write(handle, line, strlen(line));
}
}
pFS_Close(handle);
}
}
//
// Initialize HUD.
//
@ -794,18 +831,19 @@ void HUD_Init(void)
void HUD_Inputlag_hit_f(void);
// Commands.
Cmd_AddCommand ("show", HUD_Show_f);
Cmd_AddCommand ("hide", HUD_Hide_f);
Cmd_AddCommand ("move", HUD_Move_f);
Cmd_AddCommand ("place", HUD_Place_f);
Cmd_AddCommand ("show", HUD_Show_f);
Cmd_AddCommand ("hide", HUD_Hide_f);
Cmd_AddCommand ("move", HUD_Move_f);
Cmd_AddCommand ("place", HUD_Place_f);
Cmd_AddCommand ("reset", HUD_Reset_f);
Cmd_AddCommand ("order", HUD_Order_f);
Cmd_AddCommand ("togglehud", HUD_Toggle_f);
Cmd_AddCommand ("align", HUD_Align_f);
Cmd_AddCommand ("hud_recalculate", HUD_Recalculate_f);
Cmd_AddCommand ("togglehud", HUD_Toggle_f);
Cmd_AddCommand ("align", HUD_Align_f);
Cmd_AddCommand ("hud_recalculate", HUD_Recalculate_f);
Cmd_AddCommand ("hud_export", HUD_Export_f);
// Register the hud items.
CommonDraw_Init();
CommonDraw_Init();
// Sort the elements.
HUD_Sort();

View file

@ -6364,20 +6364,21 @@ void SCR_HUD_DrawOwnFrags(hud_t *hud)
width *= hud_ownfrags_scale->value;
height *= hud_ownfrags_scale->value;
alpha = 2 - hud_ownfrags_timeout->value / age * 2;
alpha = 2 - age / hud_ownfrags_timeout->value * 2;
alpha = bound(0, alpha, 1);
if (!HUD_PrepareDraw(hud, width , height, &x, &y))
if (!HUD_PrepareDraw(hud, width, height, &x, &y))
return;
if (!width)
return;
if (age > hud_ownfrags_timeout->value)
if (age >= hud_ownfrags_timeout->value)
return;
if (age < hud_ownfrags_timeout->value)
Draw_SString(x, y, ownfragtext, hud_ownfrags_scale->value);
pDraw_Colour4f(1, 1, 1, alpha);
Draw_SString(x, y, ownfragtext, hud_ownfrags_scale->value);
pDraw_Colour4f(1, 1, 1, 1);
}
static struct wstats_s *findweapon(struct wstats_s *w, size_t wc, char *wn)