Split out the rss code into its own file.

This commit is contained in:
Bill Currie 2012-06-03 09:28:10 +09:00
parent b2290d92c9
commit d37b85f73f
3 changed files with 96 additions and 49 deletions

View file

@ -136,49 +136,3 @@ CL_UpdateScreen (double realtime)
V_PrepBlend ();
r_funcs->SCR_UpdateScreen (realtime, V_RenderView, scr_funcs[index]);
}
void
CL_RSShot_f (void)
{
char st[128];
int pcx_len;
pcx_t *pcx = 0;
tex_t *tex = 0;
time_t now;
if (CL_IsUploading ())
return; // already one pending
if (cls.state < ca_onserver)
return; // must be connected
Sys_Printf ("Remote screen shot requested.\n");
tex = r_funcs->SCR_ScreenShot (RSSHOT_WIDTH, RSSHOT_HEIGHT);
if (tex) {
time (&now);
strcpy (st, ctime (&now));
st[strlen (st) - 1] = 0;
r_funcs->SCR_DrawStringToSnap (st, tex, tex->width - strlen (st) * 8,
tex->height - 1);
strncpy (st, cls.servername->str, sizeof (st));
st[sizeof (st) - 1] = 0;
r_funcs->SCR_DrawStringToSnap (st, tex, tex->width - strlen (st) * 8,
tex->height - 11);
strncpy (st, cl_name->string, sizeof (st));
st[sizeof (st) - 1] = 0;
r_funcs->SCR_DrawStringToSnap (st, tex, tex->width - strlen (st) * 8,
tex->height - 21);
pcx = EncodePCX (tex->data, tex->width, tex->height, tex->width,
r_data->vid->basepal, true, &pcx_len);
free (tex);
}
if (pcx) {
CL_StartUpload ((void *)pcx, pcx_len);
Sys_Printf ("Wrote %s\n", "rss.pcx");
Sys_Printf ("Sending shot to server...\n");
}
}