fix a few unrelated bugs

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5507 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2019-08-11 05:32:53 +00:00
parent 3d55513a48
commit 93a9fe379a
3 changed files with 43 additions and 4 deletions

View File

@ -982,7 +982,6 @@ int main (int c, const char **v)
if (readlink("/proc/self/exe", bindir, sizeof(bindir)-1) > 0)
{
*COM_SkipPath(bindir) = 0;
Sys_Printf("Binary is located at \"%s\"\n", bindir);
parms.binarydir = bindir;
}
/*#elif defined(__bsd__)
@ -990,7 +989,6 @@ int main (int c, const char **v)
if (readlink("/proc/self/file", bindir, sizeof(bindir)-1) > 0)
{
*COM_SkipPath(bindir) = 0;
Sys_Printf("Binary is located at "%s"\n", bindir);
parms.binarydir = bindir;
}
*/
@ -1018,6 +1016,29 @@ int main (int c, const char **v)
if (COM_CheckParm("-nostdout"))
nostdout = 1;
if (parms.binarydir)
Sys_Printf("Binary is located at \"%s\"\n", bindir);
#ifndef CLIENTONLY
if (isDedicated) //compleate denial to switch to anything else - many of the client structures are not initialized.
{
float delay;
SV_Init (&parms);
delay = SV_Frame();
while (1)
{
if (!isDedicated)
Sys_Error("Dedicated was cleared");
NET_Sleep(delay, false);
delay = SV_Frame();
}
}
#endif
Host_Init(&parms);
for (i = 1; i < parms.argc; i++)
@ -1149,4 +1170,5 @@ qboolean Sys_RunInstaller(void)
{
return false;
}
#endif
#endif

View File

@ -5456,9 +5456,11 @@ static qboolean QDECL Mod_LoadQ3Model(model_t *mod, void *buffer, size_t fsize)
size_t s;
char *f;
char basename[MAX_QPATH];
char lodname[MAX_QPATH];
memcpy(basename, mod->name, ext-mod->name);
basename[ext-mod->name] = 0;
f = FS_LoadMallocFile(va("%s_%i.%s", basename, lod, ext), &s);
Q_snprintfz(lodname, sizeof(lodname), "%s_%i.%s", basename, lod, ext);
f = FS_LoadMallocFile(lodname, &s);
if (!f)
break;
root = sublod;

View File

@ -3230,6 +3230,21 @@ qboolean VK_SCR_GrabBackBuffer(void)
while (vk.aquirenext == vk.aquirelast)
{ //we're still waiting for the render thread to increment acquirelast.
//shouldn't really happen, but can if the gpu is slow.
if (vk.neednewswapchain)
{ //the render thread is is likely to have died... don't loop until infinity.
if (vk.submitthread)
{
//signal its condition, in case its sleeping, so we don't wait for infinity
Sys_LockConditional(vk.submitcondition);
Sys_ConditionSignal(vk.submitcondition);
Sys_UnlockConditional(vk.submitcondition);
//now wait+clean up the thread
Sys_WaitOnThread(vk.submitthread);
vk.submitthread = NULL;
}
return false;
}
Sys_Sleep(0); //o.O
#ifdef _WIN32
Sys_SendKeyEvents();