SCR_EndLoadingPlaque();
else if (scr_loadingscreen_maxfps.value > 0)
{
- static float lastupdate;
- float now = Sys_DirtyTime();
- if (now - lastupdate < min(1.0f / scr_loadingscreen_maxfps.value, 0.1))
+ static double lastupdate;
+ if (host.realtime - lastupdate < min(1.0f / scr_loadingscreen_maxfps.value, 0.1))
return;
- lastupdate = now;
+ lastupdate = host.realtime;
}
}
or > 0 if a transfer is ready or the timeout was reached.
====================
*/
-int Curl_Select(int timeout_ms)
+bool Curl_Select(int timeout_ms)
{
CURLMcode err;
- int numfds;
if (List_Is_Empty(&downloads))
- return 0;
+ return false;
- err = qcurl_multi_wait(curlm, NULL, 0, timeout_ms, &numfds);
+ err = qcurl_multi_wait(curlm, NULL, 0, timeout_ms, NULL);
if (err == CURLM_OK)
- return numfds;
- Con_Printf("curl_multi_wait() failed, code %d\n", err);
- return 0;
+ return true;
+ Con_Printf(CON_ERROR "curl_multi_wait() failed with code %d\n", err);
+ return false;
}
/*
// code is one of the CURLCBSTATUS constants, or the HTTP error code (when > 0).
void Curl_Frame(void);
-int Curl_Select(int timeout_ms);
+bool Curl_Select(int timeout_ms);
qbool Curl_Running(void);
qbool Curl_Begin_ToFile(const char *URL, double maxspeed, const char *name, int loadtype, qbool forthismap);
}
if(sys_debugsleep.integer)
- Con_Printf("sys_debugsleep: requesting %u ", usec);
+ Con_Printf("sys_debugsleep: requested %u, ", usec);
dt = Sys_DirtyTime();
// less important on newer libcurl so no need to disturb dedicated servers
dt = Sys_DirtyTime() - dt;
if(sys_debugsleep.integer)
- Con_Printf(" got %u oversleep %d\n", (unsigned int)(dt * 1000000), (unsigned int)(dt * 1000000) - usec);
+ Con_Printf("got %u, oversleep %d\n", (uint32_t)(dt * 1000000), (uint32_t)(dt * 1000000) - usec);
return (dt < 0 || dt >= 1800) ? 0 : dt;
}