Fix some build targets, fix csqc's setpause builtin.

This commit is contained in:
Shpoike 2023-01-20 02:04:26 +00:00
parent 540de79103
commit 2d9ec83c20
6 changed files with 48 additions and 5 deletions

View file

@ -615,7 +615,8 @@ void CL_CalcClientTime(void)
{
if (!cls.state)
{
cl.servertime += host_frametime;
if (!cl.implicitpause)
cl.servertime += host_frametime;
cl.time = cl.servertime;
return;
}

View file

@ -1399,7 +1399,7 @@ const char *SCR_ShowPics_ClickCommand(float cx, float cy, qboolean istouch)
float x, y, w, h;
showpic_t *sp;
mpic_t *p;
qboolean tryload = !showpics_touchtime;
qboolean tryload = istouch && !showpics_touchtime;
float bestdist = istouch?16:1;
const char *best = NULL;
showpics_touchtime = realtime;

View file

@ -745,8 +745,10 @@ void IN_MoveMouse(struct mouse_s *mouse, float *movements, int pnum, float frame
mx *= 1.75;
my *= 1.75;
#ifdef QUAKESTATS
if (IN_WeaponWheelAccumulate(pnum, mx, my, 0))
mx = my = 0;
mx = my = 0;
#endif
}
}
else
@ -1017,10 +1019,12 @@ void IN_MoveJoystick(struct joy_s *joy, float *movements, int pnum, float framet
}
}
#ifdef QUAKESTATS
if (IN_WeaponWheelAccumulate(joy->qdeviceid, jstrafe[1]*50, -jstrafe[0]*50, 20))
jstrafe[0] = jstrafe[1] = 0;
if (IN_WeaponWheelAccumulate(joy->qdeviceid, jlook[1]*50, jlook[0]*50, 20))
jlook[0] = jlook[1] = 0;
#endif
if (Key_Dest_Has(~kdm_game))
{

View file

@ -12201,7 +12201,9 @@ static BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
// {"delayedparticle", PF_Fixme, 0, 0, 0, 528, D("float(vector org, vector vel, float delay, float collisiondelay, optional float theme)","Basically just extra args for 'particle'.")},
{"loadfromdata", PF_loadfromdata, 0, 0, 0, 529, D("void(string s)", "Reads a set of entities from the given string. This string should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead.")},
{"loadfromfile", PF_loadfromfile, 0, 0, 0, 530, D("void(string s)", "Reads a set of entities from the named file. This file should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead.")},
{"setpause", PF_setpause, 0, 0, 0, 531, D("void(float pause)", "Sets whether the server should or should not be paused. This does not affect auto-paused things like when the console is down.")},
{"setpause", PF_setpause, 0, 0, 0, 531, D("void(float pause)", "SSQC: Sets whether the server should or should not be paused.\n"
"CSQC: Only works in singleplayer, suitable for menu auto-pause. To pause in multiplayer use eg localcmd(\"cmd pause\n\") to ask the server side to pause.\n"
"Pause state between modules will be ORed, along with engine reasons for auto pausing.")},
//end dp extras
//begin mvdsv extras
#ifdef HAVE_LEGACY

View file

@ -5380,7 +5380,11 @@ float SV_Frame (void)
#endif
#ifdef HAVE_CLIENT
isidle = !isDedicated && sv.allocated_client_slots == 1 && (Key_Dest_Has(~kdm_game) || IN_WeaponWheelIsShown()) && cls.state == ca_active && !cl.implicitpause;
isidle = !isDedicated && sv.allocated_client_slots == 1 && (Key_Dest_Has(~kdm_game)
#ifdef QUAKESTATS
|| IN_WeaponWheelIsShown()
#endif
|| cl.implicitpause) && cls.state == ca_active;
/*server is effectively paused in SP/coop if there are no clients/spectators*/
if (sv.spawned_client_slots == 0 && sv.spawned_observer_slots == 0 && !deathmatch.ival)
isidle = true;

View file

@ -753,6 +753,38 @@ int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(
return Sys_EnumerateFiles2(fullmatch, start, start, func, parm, spath);
}
//wide only. we let the windows api sort out the mess of file urls. system-wide consistancy.
qboolean Sys_ResolveFileURL(const char *inurl, int inlen, char *out, int outlen)
{
char *cp;
wchar_t wurl[MAX_PATH];
wchar_t local[MAX_PATH];
DWORD grr;
static HRESULT (WINAPI *pPathCreateFromUrlW)(PCWSTR pszUrl, PWSTR pszPath, DWORD *pcchPath, DWORD dwFlags);
if (!pPathCreateFromUrlW)
pPathCreateFromUrlW = Sys_GetAddressForName(Sys_LoadLibrary("Shlwapi.dll", NULL), "PathCreateFromUrlW");
if (!pPathCreateFromUrlW)
return false;
//need to make a copy, because we can't terminate the inurl easily.
cp = malloc(inlen+1);
memcpy(cp, inurl, inlen);
cp[inlen] = 0;
widen(wurl, sizeof(wurl), cp);
free(cp);
grr = sizeof(local)/sizeof(wchar_t);
if (FAILED(pPathCreateFromUrlW(wurl, local, &grr, 0)))
return false;
narrowen(out, outlen, local);
while(*out)
{
if (*out == '\\')
*out = '/';
out++;
}
return true;
}
/*
================
Sys_Error