From 0b3a11335af6e01a65d70a7b38b2fe9abf43fd4d Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 14 Dec 2017 21:12:11 +0000 Subject: [PATCH] fix some bugs. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5185 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_main.c | 7 +++++ engine/common/cmd.c | 5 +++- engine/common/q1bsp.c | 4 ++- engine/gl/gl_font.c | 60 +++++++++++++---------------------------- 4 files changed, 33 insertions(+), 43 deletions(-) diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index fe87ba925..817485940 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -942,6 +942,13 @@ void CL_CheckForResend (void) 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 CL_ConnectToDarkPlaces("", &connectinfo.adr); // connectinfo.trying = false; diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 77333b25e..c162b3402 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -2973,14 +2973,17 @@ static const char *If_Token_Term(const char *func, const char **end) { level--; if (!level) + { + s2++; break; + } } else if (*s2 == '(') level++; s2++; } func = If_Token(s, end, IF_PRI_MAX); - *end = s2+1; + *end = s2; s = *end; s2 = func; } diff --git a/engine/common/q1bsp.c b/engine/common/q1bsp.c index a91b2d503..e2d26a42c 100644 --- a/engine/common/q1bsp.c +++ b/engine/common/q1bsp.c @@ -2054,6 +2054,8 @@ static void Q1BSP_ClustersInSphere_Union(mleaf_t *firstleaf, vec3_t center, floa if (node->contents < 0) { //leaf! mark/merge it. size_t c = (mleaf_t *)node - firstleaf; + if (c == -1) + return; if (unionwith) out[c>>3] |= (1<<(c&7)) & unionwith[c>>3]; else @@ -2097,7 +2099,7 @@ static qbyte *Q1BSP_ClustersInSphere(model_t *mod, vec3_t center, float radius, if (pvsbuffer->buffersize < mod->pvsbytes) pvsbuffer->buffer = BZ_Realloc(pvsbuffer->buffer, pvsbuffer->buffersize=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; } diff --git a/engine/gl/gl_font.c b/engine/gl/gl_font.c index c690fdc96..2a6ca9134 100644 --- a/engine/gl/gl_font.c +++ b/engine/gl/gl_font.c @@ -1998,47 +1998,6 @@ struct font_s *Font_LoadFont(float vheight, const char *fontfilename) if (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*/ @@ -2072,6 +2031,25 @@ struct font_s *Font_LoadFont(float vheight, const char *fontfilename) 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*/ for (i = 0xe000; i <= 0xe0ff; i++) {