mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
very cool of vscode to not save when I told it to
This commit is contained in:
parent
7e2dee8796
commit
741b1f415d
1 changed files with 69 additions and 69 deletions
138
src/d_clisrv.c
138
src/d_clisrv.c
|
@ -1128,91 +1128,91 @@ static inline void CL_DrawConnectionStatus(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
// if (cl_mode == CL_LOADFILES)
|
||||
// {
|
||||
// INT32 totalfileslength;
|
||||
// INT32 loadcompletednum = 0;
|
||||
// INT32 i;
|
||||
if (cl_mode == CL_LOADFILES)
|
||||
{
|
||||
INT32 totalfileslength;
|
||||
INT32 loadcompletednum = 0;
|
||||
INT32 i;
|
||||
|
||||
// V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16-16, V_YELLOWMAP, "Press ESC to abort");
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16-16, V_YELLOWMAP, "Press ESC to abort");
|
||||
|
||||
// //ima just count files here
|
||||
// if (fileneeded)
|
||||
// {
|
||||
// for (i = 0; i < fileneedednum; i++)
|
||||
// if (fileneeded[i].status == FS_OPEN)
|
||||
// loadcompletednum++;
|
||||
// }
|
||||
//ima just count files here
|
||||
if (fileneeded)
|
||||
{
|
||||
for (i = 0; i < fileneedednum; i++)
|
||||
if (fileneeded[i].status == FS_OPEN)
|
||||
loadcompletednum++;
|
||||
}
|
||||
|
||||
// // Loading progress
|
||||
// V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16-24, V_YELLOWMAP, "Loading server addons...");
|
||||
// totalfileslength = (INT32)((loadcompletednum/(double)(fileneedednum)) * 256);
|
||||
// M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-16-8, 32, 1);
|
||||
// V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, 256, 8, 111);
|
||||
// V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, totalfileslength, 8, 96);
|
||||
// V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16, V_20TRANS|V_MONOSPACE,
|
||||
// va(" %2u/%2u Files",loadcompletednum,fileneedednum));
|
||||
// }
|
||||
// else if (lastfilenum != -1)
|
||||
// {
|
||||
// INT32 dldlength;
|
||||
// static char tempname[28];
|
||||
// fileneeded_t *file;
|
||||
// char *filename;
|
||||
// Loading progress
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16-24, V_YELLOWMAP, "Loading server addons...");
|
||||
totalfileslength = (INT32)((loadcompletednum/(double)(fileneedednum)) * 256);
|
||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-16-8, 32, 1);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, 256, 8, 111);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, totalfileslength, 8, 96);
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16, V_20TRANS|V_MONOSPACE,
|
||||
va(" %2u/%2u Files",loadcompletednum,fileneedednum));
|
||||
}
|
||||
else if (lastfilenum != -1)
|
||||
{
|
||||
INT32 dldlength;
|
||||
static char tempname[28];
|
||||
fileneeded_t *file;
|
||||
char *filename;
|
||||
|
||||
// if (snake)
|
||||
// Snake_Draw();
|
||||
if (snake)
|
||||
Snake_Draw();
|
||||
|
||||
// // Draw the bottom box.
|
||||
// CL_DrawConnectionStatusBox();
|
||||
// Draw the bottom box.
|
||||
CL_DrawConnectionStatusBox();
|
||||
|
||||
// if (fileneeded)
|
||||
// {
|
||||
// file = &fileneeded[lastfilenum];
|
||||
// filename = file->filename;
|
||||
// }
|
||||
// else
|
||||
// return;
|
||||
if (fileneeded)
|
||||
{
|
||||
file = &fileneeded[lastfilenum];
|
||||
filename = file->filename;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
// Net_GetNetStat();
|
||||
// dldlength = (INT32)((file->currentsize/(double)file->totalsize) * 256);
|
||||
// if (dldlength > 256)
|
||||
// dldlength = 256;
|
||||
// V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, 256, 8, 111);
|
||||
// V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, dldlength, 8, 96);
|
||||
Net_GetNetStat();
|
||||
dldlength = (INT32)((file->currentsize/(double)file->totalsize) * 256);
|
||||
if (dldlength > 256)
|
||||
dldlength = 256;
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, 256, 8, 111);
|
||||
V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, dldlength, 8, 96);
|
||||
|
||||
// memset(tempname, 0, sizeof(tempname));
|
||||
// // offset filename to just the name only part
|
||||
// filename += strlen(filename) - nameonlylength(filename);
|
||||
memset(tempname, 0, sizeof(tempname));
|
||||
// offset filename to just the name only part
|
||||
filename += strlen(filename) - nameonlylength(filename);
|
||||
|
||||
// if (strlen(filename) > sizeof(tempname)-1) // too long to display fully
|
||||
// {
|
||||
// size_t endhalfpos = strlen(filename)-10;
|
||||
// // display as first 14 chars + ... + last 10 chars
|
||||
// // which should add up to 27 if our math(s) is correct
|
||||
// snprintf(tempname, sizeof(tempname), "%.14s...%.10s", filename, filename+endhalfpos);
|
||||
// }
|
||||
// else // we can copy the whole thing in safely
|
||||
// {
|
||||
// strncpy(tempname, filename, sizeof(tempname)-1);
|
||||
// }
|
||||
if (strlen(filename) > sizeof(tempname)-1) // too long to display fully
|
||||
{
|
||||
size_t endhalfpos = strlen(filename)-10;
|
||||
// display as first 14 chars + ... + last 10 chars
|
||||
// which should add up to 27 if our math(s) is correct
|
||||
snprintf(tempname, sizeof(tempname), "%.14s...%.10s", filename, filename+endhalfpos);
|
||||
}
|
||||
else // we can copy the whole thing in safely
|
||||
{
|
||||
strncpy(tempname, filename, sizeof(tempname)-1);
|
||||
}
|
||||
|
||||
// V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16-24, V_YELLOWMAP,
|
||||
// va(M_GetText("Downloading \"%s\""), tempname));
|
||||
// V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, V_20TRANS|V_MONOSPACE,
|
||||
// va(" %4uK/%4uK",fileneeded[lastfilenum].currentsize>>10,file->totalsize>>10));
|
||||
// V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-16, V_20TRANS|V_MONOSPACE,
|
||||
// va("%3.1fK/s ", ((double)getbps)/1024));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16-24, V_YELLOWMAP,
|
||||
va(M_GetText("Downloading \"%s\""), tempname));
|
||||
V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-16, V_20TRANS|V_MONOSPACE,
|
||||
va(" %4uK/%4uK",fileneeded[lastfilenum].currentsize>>10,file->totalsize>>10));
|
||||
V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-16, V_20TRANS|V_MONOSPACE,
|
||||
va("%3.1fK/s ", ((double)getbps)/1024));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (snake)
|
||||
Snake_Draw();
|
||||
|
||||
CL_DrawConnectionStatusBox();
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-16-24, V_YELLOWMAP,
|
||||
M_GetText("Waiting to download files..."));
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue