fix some bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5185 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-12-14 21:12:11 +00:00
parent 3f391a719a
commit 0b3a11335a
4 changed files with 33 additions and 43 deletions

View file

@ -942,6 +942,13 @@ void CL_CheckForResend (void)
SVC_DirectConnect(); SVC_DirectConnect();
} }
else if (1)
{
net_from = connectinfo.adr;
Q_snprintfz(net_message.data, net_message.maxsize, "xxxxconnect\\protocol\\darkplaces 3\\protocols\\DP7 DP6 DP5 RMQ FITZ NEHAHRABJP2 NEHAHRABJP NEHAHRABJP3 QUAKE\\challenge\\0x%x\\name\\%s", SV_NewChallenge(), name.string);
Cmd_TokenizeString (net_message.data+4, false, false);
SVC_DirectConnect();
}
else else
CL_ConnectToDarkPlaces("", &connectinfo.adr); CL_ConnectToDarkPlaces("", &connectinfo.adr);
// connectinfo.trying = false; // connectinfo.trying = false;

View file

@ -2973,14 +2973,17 @@ static const char *If_Token_Term(const char *func, const char **end)
{ {
level--; level--;
if (!level) if (!level)
{
s2++;
break; break;
} }
}
else if (*s2 == '(') else if (*s2 == '(')
level++; level++;
s2++; s2++;
} }
func = If_Token(s, end, IF_PRI_MAX); func = If_Token(s, end, IF_PRI_MAX);
*end = s2+1; *end = s2;
s = *end; s = *end;
s2 = func; s2 = func;
} }

View file

@ -2054,6 +2054,8 @@ static void Q1BSP_ClustersInSphere_Union(mleaf_t *firstleaf, vec3_t center, floa
if (node->contents < 0) if (node->contents < 0)
{ //leaf! mark/merge it. { //leaf! mark/merge it.
size_t c = (mleaf_t *)node - firstleaf; size_t c = (mleaf_t *)node - firstleaf;
if (c == -1)
return;
if (unionwith) if (unionwith)
out[c>>3] |= (1<<(c&7)) & unionwith[c>>3]; out[c>>3] |= (1<<(c&7)) & unionwith[c>>3];
else else
@ -2097,7 +2099,7 @@ static qbyte *Q1BSP_ClustersInSphere(model_t *mod, vec3_t center, float radius,
if (pvsbuffer->buffersize < mod->pvsbytes) if (pvsbuffer->buffersize < mod->pvsbytes)
pvsbuffer->buffer = BZ_Realloc(pvsbuffer->buffer, pvsbuffer->buffersize=mod->pvsbytes); pvsbuffer->buffer = BZ_Realloc(pvsbuffer->buffer, pvsbuffer->buffersize=mod->pvsbytes);
Q_memset (pvsbuffer->buffer, 0, mod->pvsbytes); Q_memset (pvsbuffer->buffer, 0, mod->pvsbytes);
Q1BSP_ClustersInSphere_Union(mod->leafs-1, center, radius, mod->nodes, pvsbuffer->buffer, NULL);//unionwith); Q1BSP_ClustersInSphere_Union(mod->leafs+1, center, radius, mod->nodes, pvsbuffer->buffer, NULL);//unionwith);
return pvsbuffer->buffer; return pvsbuffer->buffer;
} }

View file

@ -1998,47 +1998,6 @@ struct font_s *Font_LoadFont(float vheight, const char *fontfilename)
if (f->singletexture->status == TEX_LOADING) if (f->singletexture->status == TEX_LOADING)
COM_WorkerPartialSync(f->singletexture, &f->singletexture->status, TEX_LOADING); COM_WorkerPartialSync(f->singletexture, &f->singletexture->status, TEX_LOADING);
} }
//halflife fonts are awkward. 256 chars are placed horizontally, and are 2 chars narrower than the height.
//FIXME: we ought to reprocess the image, for old gpus to avoid downscaling...
/*if (f->singletexture && f->singletexture->status == TEX_LOADED && f->singletexture->width == (f->singletexture->height-2) * 256)
{
f->txwidth = f->singletexture->width;
f->txheight = f->singletexture->height;
for ( ; i < 256; i++)
{
c = Font_GetCharStore(f, i);
c->advance = f->charheight;
c->bmh = f->singletexture->height;
c->bmw = f->singletexture->height-2;
c->bmx = i*(f->singletexture->height-2);
c->bmy = 0;
c->left = 0;
c->top = 0;
c->nextchar = 0; //these chars are not linked in
c->texplane = BITMAPPLANE;
}
return f; //fixme: no 0xe0XX range
}
else*/
{
/*force it to load, even if there's nothing there*/
for (i = ((fmt==FMT_QUAKE)?32:0); i < ((fmt==FMT_QUAKE)?128:256); i++)
{
c = Font_GetCharStore(f, i);
c->advance = f->charheight;
c->bmh = PLANEWIDTH/16;
c->bmw = PLANEWIDTH/16;
c->bmx = (i&15)*(PLANEWIDTH/16);
c->bmy = (i/16)*(PLANEWIDTH/16);
c->left = 0;
c->top = 0;
c->nextchar = 0; //these chars are not linked in
c->texplane = BITMAPPLANE;
}
}
} }
defaultplane = INVALIDPLANE;/*assume the bitmap plane - don't use the fallback as people don't think to use com_parseutf8*/ defaultplane = INVALIDPLANE;/*assume the bitmap plane - don't use the fallback as people don't think to use com_parseutf8*/
@ -2072,6 +2031,25 @@ struct font_s *Font_LoadFont(float vheight, const char *fontfilename)
if (defaultplane != INVALIDPLANE) if (defaultplane != INVALIDPLANE)
{ {
if (!f->faces)
{
/*force it to load, even if there's nothing there*/
for (i = ((fmt==FMT_QUAKE)?32:0); i < ((fmt==FMT_QUAKE)?128:256); i++)
{
c = Font_GetCharStore(f, i);
c->advance = f->charheight;
c->bmh = PLANEWIDTH/16;
c->bmw = PLANEWIDTH/16;
c->bmx = (i&15)*(PLANEWIDTH/16);
c->bmy = (i/16)*(PLANEWIDTH/16);
c->left = 0;
c->top = 0;
c->nextchar = 0; //these chars are not linked in
c->texplane = defaultplane;
}
}
/*pack the default chars into it*/ /*pack the default chars into it*/
for (i = 0xe000; i <= 0xe0ff; i++) for (i = 0xe000; i <= 0xe0ff; i++)
{ {