Fix up some misc issues.
This commit is contained in:
parent
778bbefc8f
commit
1ea029f789
13 changed files with 53 additions and 28 deletions
|
@ -1283,7 +1283,10 @@ void M_Menu_Quit_f (void)
|
|||
else if (!strcmp(arg, "forcesave") || cfg_save_auto.ival)
|
||||
{
|
||||
Cmd_ExecuteString("cfg_save", RESTRICT_LOCAL);
|
||||
mode = 0;
|
||||
if (!strcmp(arg, "prompt"))
|
||||
mode = 1;
|
||||
else
|
||||
mode = 0;
|
||||
}
|
||||
else if (!strcmp(arg, "save"))
|
||||
mode = 2;
|
||||
|
|
|
@ -7250,7 +7250,7 @@ void QCBUILTIN PF_sprintf_internal (pubprogfuncs_t *prinst, struct globalvars_s
|
|||
formatbuf[0] = '%';
|
||||
|
||||
#define GETARG_FLOAT(a) (((a)>=firstarg && (a)<prinst->callargc) ? (G_FLOAT(OFS_PARM0 + 3 * (a))) : 0)
|
||||
#define GETARG_DOUBLE(a) (((a)>=firstarg && (a)<prinst->callargc) ? (G_FLOAT(OFS_PARM0 + 3 * (a))) : 0)
|
||||
#define GETARG_DOUBLE(a) (((a)>=firstarg && (a)<prinst->callargc) ? (G_DOUBLE(OFS_PARM0 + 3 * (a))) : 0)
|
||||
#define GETARG_VECTOR(a) (((a)>=firstarg && (a)<prinst->callargc) ? (G_VECTOR(OFS_PARM0 + 3 * (a))) : dummyvec)
|
||||
#define GETARG_INT(a) (((a)>=firstarg && (a)<prinst->callargc) ? (G_INT(OFS_PARM0 + 3 * (a))) : 0)
|
||||
#define GETARG_INT64(a) (((a)>=firstarg && (a)<prinst->callargc) ? (G_INT64(OFS_PARM0 + 3 * (a))) : 0)
|
||||
|
|
|
@ -838,8 +838,9 @@ restart:
|
|||
*outbuf++ = 0; //make sure its null terminated.
|
||||
return ret;
|
||||
}
|
||||
void TL_FilterObsceneCCStringInplace(conchar_t *in, conchar_t *end)
|
||||
qboolean TL_FilterObsceneCCStringInplace(conchar_t *in, conchar_t *end)
|
||||
{ //FIXME: filters are meant to be utf-8, but our strings are not.
|
||||
qboolean obscene = false;
|
||||
// conchar_t *start = in;
|
||||
conchar_t *next;
|
||||
if (!filtermem)
|
||||
|
@ -885,8 +886,11 @@ restart:
|
|||
if (*in & CON_LONGCHAR && !(*in & CON_RICHFORECOLOUR))
|
||||
*in = CON_LONGCHAR; //no other flags here.
|
||||
else
|
||||
{
|
||||
//*in = "#@*$"[(in-start)&3] | CON_WHITEMASK;
|
||||
*in = 0x26a0 | CON_WHITEMASK | (*in&CON_HIDDEN);
|
||||
obscene = true;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
goto restart; //double breaks suck
|
||||
|
@ -904,4 +908,5 @@ restart:
|
|||
}
|
||||
in = next;
|
||||
}
|
||||
return obscene;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,6 @@ extern cvar_t language;
|
|||
#define localtext(t) PO_GetText(languages[com_language].po, t)
|
||||
int TL_FindLanguage(const char *lang);
|
||||
|
||||
void TL_FilterObsceneCCStringInplace(conchar_t *in, conchar_t *end);
|
||||
qboolean TL_FilterObsceneCCStringInplace(conchar_t *in, conchar_t *end);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1393,7 +1393,7 @@ qboolean R_CalcModelLighting(entity_t *e, model_t *clmodel)
|
|||
if ((clmodel->engineflags & MDLF_FLAME) || //stuff on fire should generally have enough light...
|
||||
r_fullbright.ival || //vanila cheat
|
||||
(e->flags & RF_FULLBRIGHT) || //DP feature
|
||||
(r_fb_models.ival == 1 && ruleset_allow_fbmodels.ival && (clmodel->engineflags & MDLF_EZQUAKEFBCHEAT) && cls.protocol == CP_QUAKEWORLD && cl.deathmatch)) //ezquake cheat
|
||||
(r_fb_models.ival == 1 && ruleset_allow_fbmodels.ival && (clmodel->engineflags & MDLF_EZQUAKEFBCHEAT) && cls.protocol == CP_QUAKEWORLD && cl.deathmatch && cls.allow_fbskins>0)) //ezquake cheat
|
||||
{
|
||||
e->light_avg[0] = e->light_avg[1] = e->light_avg[2] = 1;
|
||||
e->light_range[0] = e->light_range[1] = e->light_range[2] = 0;
|
||||
|
|
|
@ -5873,7 +5873,7 @@ void Terr_Brush_Draw(heightmap_t *hm, batch_t **batches, entity_t *e)
|
|||
{
|
||||
for (s = 0; s < br->faces[j].lmextents[0]; s++)
|
||||
{
|
||||
*(unsigned int*)out = (0x3<<30) | (in[2]<<22) | (in[1]<<12) | (in[0]<<2);
|
||||
*(unsigned int*)out = (0x3u<<30) | (in[2]<<22) | (in[1]<<12) | (in[0]<<2);
|
||||
out+=4;
|
||||
in+=3;
|
||||
}
|
||||
|
@ -6709,6 +6709,9 @@ static qboolean Brush_Deserialise(heightmap_t *hm, brushes_t *br, void *mem)
|
|||
br->faces[i].stdir[1][1] = MSG_ReadFloat();
|
||||
br->faces[i].stdir[1][2] = MSG_ReadFloat();
|
||||
br->faces[i].stdir[1][3] = MSG_ReadFloat();
|
||||
|
||||
br->faces[i].surfaceflags = 0; //used by q2
|
||||
br->faces[i].surfacevalue = 0; //used by q2 (generally light levels)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -465,6 +465,7 @@ static char *QuakeCharsToHTML(char *outhtml, size_t outsize, const char *quake,
|
|||
conchar_t chars[8192], *c=chars, *end;
|
||||
unsigned int codeflags, codepoint, oldflags=CON_WHITEMASK;
|
||||
unsigned int b;
|
||||
qboolean obscene;
|
||||
|
||||
const char *htmlnames[16] = {
|
||||
"#000000", //black
|
||||
|
@ -489,7 +490,14 @@ static char *QuakeCharsToHTML(char *outhtml, size_t outsize, const char *quake,
|
|||
return NULL; //no space for the null
|
||||
|
||||
end = COM_ParseFunString(oldflags, quake, chars, sizeof(chars), false);
|
||||
TL_FilterObsceneCCStringInplace(chars, end); //strip the swears without breaking cullers.
|
||||
obscene = TL_FilterObsceneCCStringInplace(chars, end); //strip the swears without breaking cullers.
|
||||
if (obscene)
|
||||
{
|
||||
Q_snprintfz(outhtml, outsize, "<span title='The original string contained obscenities, which have been filtered out.'>");
|
||||
b=strlen(outhtml);
|
||||
outhtml += b;
|
||||
outsize -= b;
|
||||
}
|
||||
while (c < end)
|
||||
{
|
||||
c = Font_Decode(c, &codeflags, &codepoint);
|
||||
|
@ -565,6 +573,13 @@ static char *QuakeCharsToHTML(char *outhtml, size_t outsize, const char *quake,
|
|||
outhtml += b;
|
||||
outsize -= b;
|
||||
}
|
||||
if (obscene)
|
||||
{
|
||||
Q_snprintfz(outhtml, outsize, "</span>");
|
||||
b=strlen(outhtml);
|
||||
outhtml += b;
|
||||
outsize -= b;
|
||||
}
|
||||
*outhtml = 0;
|
||||
return ret;
|
||||
}
|
||||
|
@ -654,21 +669,21 @@ vfsfile_t *SVM_Generate_Gamelist(const char **mimetype, const char *query)
|
|||
static void SVM_PrintServerPrefixes(vfsfile_t *stream, svm_server_t *server)
|
||||
{
|
||||
if (server->secure)
|
||||
VFS_PRINTF(stream, "%s", "🛡"); //'shield'
|
||||
VFS_PRINTF(stream, "%s", "<span title='Supports encryption'>🛡</span>"); //'shield'
|
||||
else
|
||||
VFS_PRINTF(stream, "%s", "⚠️"); //(yellow) 'Warning'
|
||||
VFS_PRINTF(stream, "%s", "<span title='Does not support encryption'>⚠️</span>"); //(yellow) 'Warning'
|
||||
if (server->needpass&1)
|
||||
VFS_PRINTF(stream, "%s", "🔒"); //'Lock'
|
||||
VFS_PRINTF(stream, "%s", "<span title='Needs Password'>🔒</span>"); //'Lock'
|
||||
|
||||
if (server->stype&STYPE_COOP)
|
||||
VFS_PRINTF(stream, "%s", "☮"); //'Peace'
|
||||
VFS_PRINTF(stream, "%s", "<span title='Coop'>☮</span>"); //'Peace'
|
||||
else if (server->stype&STYPE_QTV)
|
||||
VFS_PRINTF(stream, "%s", "📺"); //'Television'
|
||||
VFS_PRINTF(stream, "%s", "<span title='QuakeTV'>📺</span>"); //'Television'
|
||||
else if (server->stype&STYPE_QWFWD)
|
||||
VFS_PRINTF(stream, "%s", "🛰"); //'Satellite'
|
||||
VFS_PRINTF(stream, "%s", "<span title='QWFwd'>🛰</span>"); //'Satellite'
|
||||
|
||||
if (server->stype&STYPE_NOMOUSE)
|
||||
VFS_PRINTF(stream, "%s", "🎮"); //'Video Game'(Controller)
|
||||
VFS_PRINTF(stream, "%s", "<span title='Controllers only'>🎮</span>"); //'Video Game'(Controller)
|
||||
}
|
||||
struct rulelist_s
|
||||
{
|
||||
|
|
|
@ -921,6 +921,7 @@ qboolean QDECL Mod_LoadHL2Model (model_t *mod, void *buffer, size_t fsize)
|
|||
const char *vvdpostfixes[] = {
|
||||
".vvd"
|
||||
};
|
||||
galiasinfo_t *galias;
|
||||
|
||||
for (i = 0; !vtx && i < countof(vtxpostfixes); i++)
|
||||
{
|
||||
|
@ -1005,7 +1006,7 @@ qboolean QDECL Mod_LoadHL2Model (model_t *mod, void *buffer, size_t fsize)
|
|||
|
||||
VectorCopy(ctx.header->mins, mod->mins);
|
||||
VectorCopy(ctx.header->maxs, mod->maxs);
|
||||
galiasinfo_t *galias = (galiasinfo_t*)mod->meshinfo;
|
||||
galias = (galiasinfo_t*)mod->meshinfo;
|
||||
Mod_ParseModelEvents(mod, galias->ofsanimations, galias->numanimations);
|
||||
|
||||
mod->type = mod_alias;
|
||||
|
|
|
@ -3510,9 +3510,6 @@ static qbyte *VBSP_MarkLeaves (model_t *model, int clusters[2])
|
|||
qboolean HL2_CalcModelLighting(entity_t *e, model_t *clmodel, refdef_t *r_refdef, model_t *mod)
|
||||
{
|
||||
vec3_t lightdir;
|
||||
int i;
|
||||
vec3_t dist;
|
||||
float add, m;
|
||||
vec3_t shadelight, ambientlight;
|
||||
|
||||
e->light_dir[0] = 0; e->light_dir[1] = 1; e->light_dir[2] = 0;
|
||||
|
|
|
@ -23,8 +23,8 @@ void(patchvert_t *cp, patchinfo_t info, vector col, float alpha) DrawQCPatchText
|
|||
void(int mod, int id, float alpha) DrawEngineBrushFaded =
|
||||
{ //draw one of the engine's brushes, but faded.
|
||||
const vector col = '1 1 1';
|
||||
int contents;
|
||||
brushface_t faces[MAX_BRUSHFACES];
|
||||
static int contents;
|
||||
static brushface_t faces[MAX_BRUSHFACES];
|
||||
int numfaces = brush_get(mod, id, &faces[0], faces.length, &contents);
|
||||
if (!numfaces)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ void(int mod, int id, float alpha) DrawEngineBrushFaded =
|
|||
if (numfaces)
|
||||
{
|
||||
patchvert_t *v = memalloc(sizeof(*v)*numfaces);
|
||||
patchinfo_t patchinfo;
|
||||
static patchinfo_t patchinfo;
|
||||
patch_getmesh(mod, id, v, numfaces, &patchinfo); //now we can actually get it
|
||||
DrawQCPatchTextured(v, patchinfo, col, alpha);
|
||||
memfree(v);
|
||||
|
|
|
@ -386,9 +386,9 @@ void(vector org, vector ang) editor_brushes_simpleclone =
|
|||
|
||||
void() brushedit_subtract =
|
||||
{
|
||||
int discard;
|
||||
vector selnormals[tmp.faces.length];
|
||||
float seldists[tmp.faces.length];
|
||||
static int discard;
|
||||
static vector selnormals[tmp.faces.length];
|
||||
static float seldists[tmp.faces.length];
|
||||
|
||||
for (int sb = 0; sb < selectedbrushcount; sb++)
|
||||
{
|
||||
|
|
|
@ -193,7 +193,7 @@ static float(vertsoup_t *soup, int *idx, __out vector norm, __out float dist) pl
|
|||
|
||||
void(vertsoup_t *soup, int drawit) Rebrushify =
|
||||
{
|
||||
brushface_t faces[MAX_BRUSHFACES];
|
||||
static brushface_t faces[MAX_BRUSHFACES];
|
||||
int numfaces, f, point;
|
||||
string shader = 0;
|
||||
|
||||
|
@ -209,8 +209,9 @@ void(vertsoup_t *soup, int drawit) Rebrushify =
|
|||
if (drawit)
|
||||
{
|
||||
const int maxtessverts=64*64;
|
||||
patchinfo_t tessinfo = patchinfo;
|
||||
static patchinfo_t tessinfo;
|
||||
patchvert_t *tessverts = memalloc(sizeof(*tessverts)*maxtessverts);
|
||||
tessinfo = patchinfo;
|
||||
if (patch_evaluate(patchvert, tessverts, maxtessverts, &tessinfo) <= maxtessverts)
|
||||
{
|
||||
//draw textured preview (yay for fullbright lighting being overbright)
|
||||
|
|
|
@ -15,7 +15,7 @@ static void(vector sizes) drawwireframeview =
|
|||
{
|
||||
//figure out the planes that we care about.
|
||||
vector org = getviewprop(VF_ORIGIN);
|
||||
vector vaxis[6];
|
||||
static vector vaxis[6];
|
||||
vaxis[0] = v_right;
|
||||
vaxis[1] = v_up;
|
||||
vaxis[2] = v_forward;
|
||||
|
@ -95,7 +95,7 @@ void(vector mousepos) editor_brushes_addentities =
|
|||
int facenum;
|
||||
float intensity = (sin(gettime(5)*4)+1)*0.05;
|
||||
vector displace = 0;
|
||||
vector mid;
|
||||
static vector mid;
|
||||
|
||||
autocvar_ca_brush_view = fabs(autocvar_ca_brush_view) % 4f;
|
||||
if (autocvar_ca_brush_view)
|
||||
|
|
Loading…
Reference in a new issue