Added trace_networkentity global to csqc. Try to fix some misc bugs.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5319 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
b68a6218e8
commit
39e1f24511
9 changed files with 54 additions and 38 deletions
|
@ -2205,7 +2205,7 @@ libs-$(ARCH)/libspeexdsp.a:
|
||||||
|
|
||||||
libs-$(ARCH)/libfreetype.a:
|
libs-$(ARCH)/libfreetype.a:
|
||||||
test -f freetype-$(FREETYPEVER).tar.gz || wget https://download.savannah.gnu.org/releases/freetype/freetype-$(FREETYPEVER).tar.gz
|
test -f freetype-$(FREETYPEVER).tar.gz || wget https://download.savannah.gnu.org/releases/freetype/freetype-$(FREETYPEVER).tar.gz
|
||||||
-test -f libs-$(ARCH)/libfreetype.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../freetype-$(FREETYPEVER).tar.gz && cd freetype-$(FREETYPEVER) && CFLAGS="$(CFLAGS) -Os" $(TOOLOVERRIDES) ./configure $(CONFIGARGS) --with-harfbuzz=no && $(TOOLOVERRIDES) $(MAKE) && cp objs/.libs/libfreetype.a ../ && cp -r include/ ../)
|
-test -f libs-$(ARCH)/libfreetype.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../freetype-$(FREETYPEVER).tar.gz && cd freetype-$(FREETYPEVER) && CFLAGS="$(CFLAGS) -Os" $(TOOLOVERRIDES) ./configure $(CONFIGARGS) --with-bzip2=no --with-harfbuzz=no && $(TOOLOVERRIDES) $(MAKE) && cp objs/.libs/libfreetype.a ../ && cp -r include/ ../)
|
||||||
|
|
||||||
libs-$(ARCH)/libBulletDynamics.a:
|
libs-$(ARCH)/libBulletDynamics.a:
|
||||||
test -f bullet3-$(BULLETVER).tar.gz || wget https://github.com/bulletphysics/bullet3/archive/$(BULLETVER).tar.gz -O bullet3-$(BULLETVER).tar.gz
|
test -f bullet3-$(BULLETVER).tar.gz || wget https://github.com/bulletphysics/bullet3/archive/$(BULLETVER).tar.gz -O bullet3-$(BULLETVER).tar.gz
|
||||||
|
|
|
@ -2259,7 +2259,7 @@ void SCR_SetUpToDrawConsole (void)
|
||||||
Key_Dest_Add(kdm_console);
|
Key_Dest_Add(kdm_console);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!con_stayhidden.ival && !startuppending && Key_Dest_Has(kdm_console) && !scr_drawloading && !scr_disabled_for_loading && cls.state < ca_connected)
|
if (Key_Dest_Has(kdm_console) || (!con_stayhidden.ival && !startuppending && !scr_drawloading && !scr_disabled_for_loading && cls.state < ca_connected))
|
||||||
scr_con_current = scr_conlines = vid.height * fullscreenpercent;
|
scr_con_current = scr_conlines = vid.height * fullscreenpercent;
|
||||||
else
|
else
|
||||||
scr_conlines = 0;
|
scr_conlines = 0;
|
||||||
|
|
|
@ -184,6 +184,7 @@ extern sfx_t *cl_sfx_r_exp3;
|
||||||
globalint(trace_surface_id, "trace_surface_id"); /*int written by traceline*/ \
|
globalint(trace_surface_id, "trace_surface_id"); /*int written by traceline*/ \
|
||||||
globalint(trace_bone_id, "trace_bone_id"); /*int written by traceline*/ \
|
globalint(trace_bone_id, "trace_bone_id"); /*int written by traceline*/ \
|
||||||
globalint(trace_triangle_id, "trace_triangle_id"); /*int written by traceline*/ \
|
globalint(trace_triangle_id, "trace_triangle_id"); /*int written by traceline*/ \
|
||||||
|
globalfloat(trace_networkentity, "trace_networkentity"); /*float written by traceline*/ \
|
||||||
legacycsqcglobals \
|
legacycsqcglobals \
|
||||||
\
|
\
|
||||||
globalfloat(clientcommandframe, "clientcommandframe"); /*float the next frame that will be sent*/ \
|
globalfloat(clientcommandframe, "clientcommandframe"); /*float the next frame that will be sent*/ \
|
||||||
|
@ -415,6 +416,7 @@ static void CSQC_FindGlobals(qboolean nofuncs)
|
||||||
ensureint(trace_surface_id);
|
ensureint(trace_surface_id);
|
||||||
ensureint(trace_bone_id);
|
ensureint(trace_bone_id);
|
||||||
ensureint(trace_triangle_id);
|
ensureint(trace_triangle_id);
|
||||||
|
ensurefloat(trace_networkentity);
|
||||||
ensureentity(trace_ent);
|
ensureentity(trace_ent);
|
||||||
|
|
||||||
|
|
||||||
|
@ -2600,6 +2602,7 @@ static void cs_settracevars(pubprogfuncs_t *prinst, trace_t *tr)
|
||||||
*csqcg.trace_ent = EDICT_TO_PROG(csqcprogs, (void*)tr->ent);
|
*csqcg.trace_ent = EDICT_TO_PROG(csqcprogs, (void*)tr->ent);
|
||||||
else
|
else
|
||||||
*csqcg.trace_ent = EDICT_TO_PROG(csqcprogs, (void*)csqc_world.edicts);
|
*csqcg.trace_ent = EDICT_TO_PROG(csqcprogs, (void*)csqc_world.edicts);
|
||||||
|
*csqcg.trace_networkentity = tr->entnum;
|
||||||
|
|
||||||
#ifndef NOLEGACY
|
#ifndef NOLEGACY
|
||||||
*csqcg.trace_endcontentsf = tr->contents;
|
*csqcg.trace_endcontentsf = tr->contents;
|
||||||
|
@ -7326,6 +7329,8 @@ qboolean CSQC_Init (qboolean anycsqc, const char *csprogsname, unsigned int chec
|
||||||
csdatenabled = false;
|
csdatenabled = false;
|
||||||
csprogsname = "csprogs.dat";
|
csprogsname = "csprogs.dat";
|
||||||
}
|
}
|
||||||
|
if (!*csprogsname)
|
||||||
|
csprogsname = "csprogs.dat";
|
||||||
if (csprogs_promiscuous != anycsqc || csprogs_checksum != checksum || csprogs_checksize != progssize || strcmp(csprogs_checkname,csprogsname))
|
if (csprogs_promiscuous != anycsqc || csprogs_checksum != checksum || csprogs_checksize != progssize || strcmp(csprogs_checkname,csprogsname))
|
||||||
CSQC_Shutdown();
|
CSQC_Shutdown();
|
||||||
csprogs_promiscuous = anycsqc;
|
csprogs_promiscuous = anycsqc;
|
||||||
|
|
|
@ -1741,11 +1741,12 @@ qboolean FS_NativePath(const char *fname, enum fs_relative relativeto, char *out
|
||||||
else
|
else
|
||||||
snprintf(out, outlen, "%s%s", com_gamepath, fname);
|
snprintf(out, outlen, "%s%s", com_gamepath, fname);
|
||||||
break;
|
break;
|
||||||
case FS_BASEGAMEONLY:
|
|
||||||
|
case FS_BASEGAMEONLY: // fte/
|
||||||
last = NULL;
|
last = NULL;
|
||||||
for (i = 0; i < sizeof(fs_manifest->gamepath)/sizeof(fs_manifest->gamepath[0]); i++)
|
for (i = 0; i < countof(fs_manifest->gamepath); i++)
|
||||||
{
|
{
|
||||||
if (fs_manifest->gamepath[i].base && fs_manifest->gamepath[i].path)
|
if (fs_manifest && fs_manifest->gamepath[i].base && fs_manifest->gamepath[i].path)
|
||||||
{
|
{
|
||||||
if (!strcmp(fs_manifest->gamepath[i].path, "*"))
|
if (!strcmp(fs_manifest->gamepath[i].path, "*"))
|
||||||
continue;
|
continue;
|
||||||
|
@ -1762,16 +1763,15 @@ qboolean FS_NativePath(const char *fname, enum fs_relative relativeto, char *out
|
||||||
else
|
else
|
||||||
snprintf(out, outlen, "%s%s/%s", com_gamepath, last, fname);
|
snprintf(out, outlen, "%s%s/%s", com_gamepath, last, fname);
|
||||||
break;
|
break;
|
||||||
case FS_PUBGAMEONLY:
|
case FS_PUBGAMEONLY: // $gamedir/ or qw/ but not fte/
|
||||||
last = NULL;
|
last = NULL;
|
||||||
for (i = 0; i < sizeof(fs_manifest->gamepath)/sizeof(fs_manifest->gamepath[0]); i++)
|
for (i = 0; i < countof(fs_manifest->gamepath); i++)
|
||||||
{
|
{
|
||||||
if (fs_manifest->gamepath[i].path)
|
if (fs_manifest && fs_manifest->gamepath[i].path)
|
||||||
{
|
{
|
||||||
if (*fs_manifest->gamepath[i].path == '*')
|
if (*fs_manifest->gamepath[i].path == '*')
|
||||||
continue;
|
continue;
|
||||||
last = fs_manifest->gamepath[i].path;
|
last = fs_manifest->gamepath[i].path;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!last)
|
if (!last)
|
||||||
|
@ -1781,16 +1781,15 @@ qboolean FS_NativePath(const char *fname, enum fs_relative relativeto, char *out
|
||||||
else
|
else
|
||||||
snprintf(out, outlen, "%s%s/%s", com_gamepath, last, fname);
|
snprintf(out, outlen, "%s%s/%s", com_gamepath, last, fname);
|
||||||
break;
|
break;
|
||||||
case FS_PUBBASEGAMEONLY:
|
case FS_PUBBASEGAMEONLY: // qw/ (fixme: should be the last non-private basedir)
|
||||||
last = NULL;
|
last = NULL;
|
||||||
for (i = 0; i < sizeof(fs_manifest->gamepath)/sizeof(fs_manifest->gamepath[0]); i++)
|
for (i = 0; i < countof(fs_manifest->gamepath); i++)
|
||||||
{
|
{
|
||||||
if (fs_manifest && fs_manifest->gamepath[i].base && fs_manifest->gamepath[i].path)
|
if (fs_manifest && fs_manifest->gamepath[i].base && fs_manifest->gamepath[i].path)
|
||||||
{
|
{
|
||||||
if (*fs_manifest->gamepath[i].path == '*')
|
if (*fs_manifest->gamepath[i].path == '*')
|
||||||
continue;
|
continue;
|
||||||
last = fs_manifest->gamepath[i].path;
|
last = fs_manifest->gamepath[i].path;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!last)
|
if (!last)
|
||||||
|
@ -3610,9 +3609,9 @@ int FS_PureOkay(void)
|
||||||
continue;
|
continue;
|
||||||
else //if (!sp)
|
else //if (!sp)
|
||||||
{
|
{
|
||||||
if (!CL_CheckDLFile(va("package/%s", pname)))
|
// if (!CL_CheckDLFile(va("package/%s", pname)))
|
||||||
if (CL_CheckOrEnqueDownloadFile(va("package/%s", pname), va("%s.%i", pname, crc), DLLF_NONGAME))
|
// if (CL_CheckOrEnqueDownloadFile(pname, va("%s.%i", pname, crc), DLLF_NONGAME))
|
||||||
return -1;
|
// return -1;
|
||||||
Con_Printf(CON_ERROR"Pure package %s:%08x missing.\n", pname, crc);
|
Con_Printf(CON_ERROR"Pure package %s:%08x missing.\n", pname, crc);
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
|
@ -3915,12 +3914,14 @@ static void FS_ReloadPackFilesFlags(unsigned int reloadflags)
|
||||||
if (handle)
|
if (handle)
|
||||||
{
|
{
|
||||||
sp = FS_AddPathHandle(&oldpaths, pname, local, handle, "", SPF_COPYPROTECTED|SPF_UNTRUSTED|SPF_TEMPORARY|keptflags, (unsigned int)-1);
|
sp = FS_AddPathHandle(&oldpaths, pname, local, handle, "", SPF_COPYPROTECTED|SPF_UNTRUSTED|SPF_TEMPORARY|keptflags, (unsigned int)-1);
|
||||||
|
if (!sp)
|
||||||
|
continue; //some kind of error...
|
||||||
if (sp->handle->GeneratePureCRC)
|
if (sp->handle->GeneratePureCRC)
|
||||||
{
|
{
|
||||||
sp->crc_check = sp->handle->GeneratePureCRC(sp->handle, fs_pureseed, 0);
|
sp->crc_check = sp->handle->GeneratePureCRC(sp->handle, fs_pureseed, 0);
|
||||||
sp->crc_reply = sp->handle->GeneratePureCRC(sp->handle, fs_pureseed, 1);
|
sp->crc_reply = sp->handle->GeneratePureCRC(sp->handle, fs_pureseed, 1);
|
||||||
}
|
}
|
||||||
if (sp->crc_check == crc || !*crctok)
|
if ((*crctok && sp->crc_check == crc) || !*crctok)
|
||||||
{
|
{
|
||||||
if (fs_puremode)
|
if (fs_puremode)
|
||||||
{
|
{
|
||||||
|
@ -3932,6 +3933,7 @@ static void FS_ReloadPackFilesFlags(unsigned int reloadflags)
|
||||||
lastpure = sp;
|
lastpure = sp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//else crc mismatched...
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
vfs = FS_OpenVFS(local, "rb", FS_ROOT);
|
vfs = FS_OpenVFS(local, "rb", FS_ROOT);
|
||||||
|
@ -3956,7 +3958,7 @@ static void FS_ReloadPackFilesFlags(unsigned int reloadflags)
|
||||||
sp->crc_reply = sp->handle->GeneratePureCRC(sp->handle, fs_pureseed, 1);
|
sp->crc_reply = sp->handle->GeneratePureCRC(sp->handle, fs_pureseed, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*crctok)
|
if ((*crctok && sp->crc_check == crc) || !*crctok)
|
||||||
{
|
{
|
||||||
if (fs_puremode)
|
if (fs_puremode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -340,7 +340,13 @@ static qboolean Shader_EvaluateCondition(shader_t *shader, char **ptr)
|
||||||
else if (!Q_stricmp(token, "d3d11"))
|
else if (!Q_stricmp(token, "d3d11"))
|
||||||
lhs = (qrenderer == QR_DIRECT3D11);
|
lhs = (qrenderer == QR_DIRECT3D11);
|
||||||
else if (!Q_stricmp(token, "gles"))
|
else if (!Q_stricmp(token, "gles"))
|
||||||
lhs = ((qrenderer == QR_OPENGL) && sh_config.minver == 100);
|
{
|
||||||
|
#ifdef GLQUAKE
|
||||||
|
lhs = ((qrenderer == QR_OPENGL) && gl_config.gles);
|
||||||
|
#else
|
||||||
|
lhs = false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else if (!Q_stricmp(token, "nofixed"))
|
else if (!Q_stricmp(token, "nofixed"))
|
||||||
lhs = sh_config.progs_required;
|
lhs = sh_config.progs_required;
|
||||||
else if (!Q_stricmp(token, "glsl"))
|
else if (!Q_stricmp(token, "glsl"))
|
||||||
|
|
|
@ -736,6 +736,8 @@ static qboolean XRandR_Init(void)
|
||||||
)
|
)
|
||||||
xrandr.canmodechange12 = true;
|
xrandr.canmodechange12 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//FIXME: query monitor sizes and calculate dpi for vid.dpy_[x|y]
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11849,6 +11849,7 @@ void PR_DumpPlatform_f(void)
|
||||||
{"trace_surface_id", "int", QW|NQ|CS, D("1-based. 0 if not known.")},
|
{"trace_surface_id", "int", QW|NQ|CS, D("1-based. 0 if not known.")},
|
||||||
{"trace_bone_id", "int", QW|NQ|CS, D("1-based. 0 if not known. typically needs MOVE_HITMODEL.")},
|
{"trace_bone_id", "int", QW|NQ|CS, D("1-based. 0 if not known. typically needs MOVE_HITMODEL.")},
|
||||||
{"trace_triangle_id", "int", QW|NQ|CS, D("1-based. 0 if not known.")},
|
{"trace_triangle_id", "int", QW|NQ|CS, D("1-based. 0 if not known.")},
|
||||||
|
{"trace_networkentity", "int", CS, D("Repots which ssqc entnum was hit when a csqc traceline impacts an ssqc-based brush entity.")},
|
||||||
|
|
||||||
{"global_gravitydir", "vector", QW|NQ|CS, D("The direction gravity should act in if not otherwise specified per entity."), 0,"'0 0 -1'"},
|
{"global_gravitydir", "vector", QW|NQ|CS, D("The direction gravity should act in if not otherwise specified per entity."), 0,"'0 0 -1'"},
|
||||||
{"serverid", "int", QW|NQ|CS, D("The unique id of this server within the server cluster.")},
|
{"serverid", "int", QW|NQ|CS, D("The unique id of this server within the server cluster.")},
|
||||||
|
|
|
@ -1009,6 +1009,22 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
||||||
while (client->netchan.message.cursize < maxsize)
|
while (client->netchan.message.cursize < maxsize)
|
||||||
{
|
{
|
||||||
if (client->prespawn_idx == 0)
|
if (client->prespawn_idx == 0)
|
||||||
|
{
|
||||||
|
FS_GetPackNames(buffer, sizeof(buffer), 2, true); /*retain extensions, or we'd have to assume pk3*/
|
||||||
|
ClientReliableWrite_Begin(client, svc_stufftext, 1+11+strlen(buffer)+1+1);
|
||||||
|
ClientReliableWrite_SZ(client, "//paknames ", 11);
|
||||||
|
ClientReliableWrite_SZ(client, buffer, strlen(buffer));
|
||||||
|
ClientReliableWrite_String(client, "\n");
|
||||||
|
}
|
||||||
|
else if (client->prespawn_idx == 1)
|
||||||
|
{
|
||||||
|
FS_GetPackHashes(buffer, sizeof(buffer), false);
|
||||||
|
ClientReliableWrite_Begin(client, svc_stufftext, 1+7+strlen(buffer)+1+1);
|
||||||
|
ClientReliableWrite_SZ(client, "//paks ", 7);
|
||||||
|
ClientReliableWrite_SZ(client, buffer, strlen(buffer));
|
||||||
|
ClientReliableWrite_String(client, "\n");
|
||||||
|
}
|
||||||
|
else if (client->prespawn_idx == 2)
|
||||||
{
|
{
|
||||||
if (!ISNQCLIENT(client) || (client->fteprotocolextensions2 & PEXT2_PREDINFO))
|
if (!ISNQCLIENT(client) || (client->fteprotocolextensions2 & PEXT2_PREDINFO))
|
||||||
{ //nq does not normally get serverinfo sent to it.
|
{ //nq does not normally get serverinfo sent to it.
|
||||||
|
@ -1023,22 +1039,6 @@ void SV_SendClientPrespawnInfo(client_t *client)
|
||||||
ClientReliableWrite_String (client, va("//fullserverinfo \"%s\"\n", buffer) );
|
ClientReliableWrite_String (client, va("//fullserverinfo \"%s\"\n", buffer) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (client->prespawn_idx == 1)
|
|
||||||
{
|
|
||||||
FS_GetPackNames(buffer, sizeof(buffer), 2, true); /*retain extensions, or we'd have to assume pk3*/
|
|
||||||
ClientReliableWrite_Begin(client, svc_stufftext, 1+11+strlen(buffer)+1+1);
|
|
||||||
ClientReliableWrite_SZ(client, "//paknames ", 11);
|
|
||||||
ClientReliableWrite_SZ(client, buffer, strlen(buffer));
|
|
||||||
ClientReliableWrite_String(client, "\n");
|
|
||||||
}
|
|
||||||
else if (client->prespawn_idx == 2)
|
|
||||||
{
|
|
||||||
FS_GetPackHashes(buffer, sizeof(buffer), false);
|
|
||||||
ClientReliableWrite_Begin(client, svc_stufftext, 1+7+strlen(buffer)+1+1);
|
|
||||||
ClientReliableWrite_SZ(client, "//paks ", 7);
|
|
||||||
ClientReliableWrite_SZ(client, buffer, strlen(buffer));
|
|
||||||
ClientReliableWrite_String(client, "\n");
|
|
||||||
}
|
|
||||||
else if (client->prespawn_idx == 3)
|
else if (client->prespawn_idx == 3)
|
||||||
{
|
{
|
||||||
if (ISNQCLIENT(client) && (client->fteprotocolextensions2 & PEXT2_PREDINFO))
|
if (ISNQCLIENT(client) && (client->fteprotocolextensions2 & PEXT2_PREDINFO))
|
||||||
|
|
|
@ -2331,8 +2331,8 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
|
||||||
trace.ent = clip->trace.ent; //something else hit earlier, that one gets the trace entity, but not the fraction. yeah, combining traces like this was always going to be weird.
|
trace.ent = clip->trace.ent; //something else hit earlier, that one gets the trace entity, but not the fraction. yeah, combining traces like this was always going to be weird.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trace.ent = NULL;
|
trace.ent = w->edicts; //misreport world
|
||||||
clip->trace.entnum = touch->number;
|
clip->trace.entnum = touch->number; //with an ssqc ent number
|
||||||
}
|
}
|
||||||
clip->trace = trace;
|
clip->trace = trace;
|
||||||
}
|
}
|
||||||
|
@ -2344,8 +2344,8 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
|
||||||
if (!clip->trace.ent || trace.fraction == clip->trace.fraction) //xonotic requires that second test (DP has no check at all, which would end up reporting mismatched fraction/ent results, so yuck).
|
if (!clip->trace.ent || trace.fraction == clip->trace.fraction) //xonotic requires that second test (DP has no check at all, which would end up reporting mismatched fraction/ent results, so yuck).
|
||||||
{
|
{
|
||||||
clip->trace.contents = trace.contents;
|
clip->trace.contents = trace.contents;
|
||||||
clip->trace.ent = NULL;
|
clip->trace.ent = w->edicts; //misreport world
|
||||||
clip->trace.entnum = touch->number;
|
clip->trace.entnum = touch->number; //with an ssqc ent number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue