minor error messages / whitespace tidy-up & small stuff.

This commit is contained in:
Ozkan Sezer 2022-04-22 17:50:02 +03:00
parent ddd1caebf5
commit f86f1595f3
21 changed files with 98 additions and 108 deletions

View file

@ -164,7 +164,7 @@ void CL_EstablishConnection (const char *host)
cls.netcon = NET_Connect (host); cls.netcon = NET_Connect (host);
if (!cls.netcon) if (!cls.netcon)
Host_Error ("CL_Connect: connect failed\n"); Host_Error ("CL_Connect: connect failed");
Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host); Con_DPrintf ("CL_EstablishConnection: connected to %s\n", host);
cls.demonum = -1; // not in the demo loop now cls.demonum = -1; // not in the demo loop now

View file

@ -808,7 +808,6 @@ void Cmd_ExecuteString (const char *text, cmd_source_t src)
// check cvars // check cvars
if (!Cvar_Command ()) if (!Cvar_Command ())
Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0)); Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0));
} }
@ -857,10 +856,10 @@ int Cmd_CheckParm (const char *parm)
int i; int i;
if (!parm) if (!parm)
Sys_Error ("Cmd_CheckParm: NULL"); Sys_Error ("Cmd_CheckParm: null input\n");
for (i = 1; i < Cmd_Argc (); i++) for (i = 1; i < Cmd_Argc (); i++)
if (! q_strcasecmp (parm, Cmd_Argv (i))) if ( !q_strcasecmp (parm, Cmd_Argv (i)) )
return i; return i;
return 0; return 0;

View file

@ -969,7 +969,7 @@ void *SZ_GetSpace (sizebuf_t *buf, int length)
Sys_Error ("SZ_GetSpace: %i is > full buffer size", length); Sys_Error ("SZ_GetSpace: %i is > full buffer size", length);
buf->overflowed = true; buf->overflowed = true;
Con_Printf ("SZ_GetSpace: overflow"); Con_Printf ("SZ_GetSpace: overflow\n");
SZ_Clear (buf); SZ_Clear (buf);
} }

View file

@ -1538,7 +1538,7 @@ void Mod_ProcessLeafs_S (dsleaf_t *in, int filelen)
//johnfitz //johnfitz
if (count > 32767) if (count > 32767)
Host_Error ("Mod_LoadLeafs: %i leafs exceeds limit of 32767.\n", count); Host_Error ("Mod_LoadLeafs: %i leafs exceeds limit of 32767.", count);
//johnfitz //johnfitz
loadmodel->leafs = out; loadmodel->leafs = out;
@ -2385,7 +2385,6 @@ void *Mod_LoadAliasGroup (void * pin, maliasframedesc_t *frame)
frame->bboxmax.v[i] = pingroup->bboxmax.v[i]; frame->bboxmax.v[i] = pingroup->bboxmax.v[i];
} }
pin_intervals = (daliasinterval_t *)(pingroup + 1); pin_intervals = (daliasinterval_t *)(pingroup + 1);
frame->interval = LittleFloat (pin_intervals->interval); frame->interval = LittleFloat (pin_intervals->interval);
@ -2503,7 +2502,7 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
skin = (byte *)(pskintype + 1); skin = (byte *)(pskintype + 1);
if (numskins < 1 || numskins > MAX_SKINS) if (numskins < 1 || numskins > MAX_SKINS)
Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d\n", numskins); Sys_Error ("Mod_LoadAliasModel: Invalid # of skins: %d", numskins);
size = pheader->skinwidth * pheader->skinheight; size = pheader->skinwidth * pheader->skinheight;
@ -2777,7 +2776,7 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
pheader->numframes = LittleLong (pinmodel->numframes); pheader->numframes = LittleLong (pinmodel->numframes);
numframes = pheader->numframes; numframes = pheader->numframes;
if (numframes < 1) if (numframes < 1)
Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d\n", numframes); Sys_Error ("Mod_LoadAliasModel: Invalid # of frames: %d", numframes);
pheader->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO; pheader->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO;
mod->synctype = (synctype_t) LittleLong (pinmodel->synctype); mod->synctype = (synctype_t) LittleLong (pinmodel->synctype);
@ -2790,7 +2789,6 @@ void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
pheader->eyeposition[i] = LittleFloat (pinmodel->eyeposition[i]); pheader->eyeposition[i] = LittleFloat (pinmodel->eyeposition[i]);
} }
// //
// load the skins // load the skins
// //
@ -3017,7 +3015,7 @@ void Mod_LoadSpriteModel (qmodel_t *mod, void *buffer)
// load the frames // load the frames
// //
if (numframes < 1) if (numframes < 1)
Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d\n", numframes); Sys_Error ("Mod_LoadSpriteModel: Invalid # of frames: %d", numframes);
mod->numframes = numframes; mod->numframes = numframes;

View file

@ -449,7 +449,7 @@ static qboolean GL_CheckShader (GLuint shader)
memset(infolog, 0, sizeof(infolog)); memset(infolog, 0, sizeof(infolog));
GL_GetShaderInfoLogFunc (shader, sizeof(infolog), NULL, infolog); GL_GetShaderInfoLogFunc (shader, sizeof(infolog), NULL, infolog);
Con_Warning ("GLSL program failed to compile: %s", infolog); Con_Warning ("GLSL program failed to compile: %s", infolog);
return false; return false;
@ -536,12 +536,12 @@ GLuint GL_CreateProgram (const GLchar *vertSource, const GLchar *fragSource, int
GL_DeleteShaderFunc (vertShader); GL_DeleteShaderFunc (vertShader);
GL_AttachShaderFunc (program, fragShader); GL_AttachShaderFunc (program, fragShader);
GL_DeleteShaderFunc (fragShader); GL_DeleteShaderFunc (fragShader);
for (i = 0; i < numbindings; i++) for (i = 0; i < numbindings; i++)
{ {
GL_BindAttribLocationFunc (program, bindings[i].attrib, bindings[i].name); GL_BindAttribLocationFunc (program, bindings[i].attrib, bindings[i].name);
} }
GL_LinkProgramFunc (program); GL_LinkProgramFunc (program);
if (!GL_CheckProgram (program)) if (!GL_CheckProgram (program))

View file

@ -359,7 +359,7 @@ void TexMgr_FreeTexture (gltexture_t *kill)
if (in_reload_images) if (in_reload_images)
return; return;
if (kill == NULL) if (kill == NULL)
{ {
Con_Printf ("TexMgr_FreeTexture: NULL texture\n"); Con_Printf ("TexMgr_FreeTexture: NULL texture\n");
@ -1412,7 +1412,7 @@ void TexMgr_ReloadImages (void)
glGenTextures(1, &glt->texnum); glGenTextures(1, &glt->texnum);
TexMgr_ReloadImage (glt, -1, -1); TexMgr_ReloadImage (glt, -1, -1);
} }
in_reload_images = false; in_reload_images = false;
} }
@ -1451,7 +1451,7 @@ void GL_SelectTexture (GLenum target)
{ {
if (target == currenttarget) if (target == currenttarget)
return; return;
GL_SelectTextureFunc(target); GL_SelectTextureFunc(target);
currenttarget = target; currenttarget = target;
} }
@ -1526,7 +1526,7 @@ static void GL_DeleteTexture (gltexture_t *texture)
/* /*
================ ================
GL_ClearBindings -- ericw GL_ClearBindings -- ericw
Invalidates cached bindings, so the next GL_Bind calls for each TMU will Invalidates cached bindings, so the next GL_Bind calls for each TMU will
make real glBindTexture calls. make real glBindTexture calls.
Call this after changing the binding outside of GL_Bind. Call this after changing the binding outside of GL_Bind.

View file

@ -365,12 +365,12 @@ static int VID_GetCurrentRefreshRate (void)
#if defined(USE_SDL2) #if defined(USE_SDL2)
SDL_DisplayMode mode; SDL_DisplayMode mode;
int current_display; int current_display;
current_display = SDL_GetWindowDisplayIndex(draw_context); current_display = SDL_GetWindowDisplayIndex(draw_context);
if (0 != SDL_GetCurrentDisplayMode(current_display, &mode)) if (0 != SDL_GetCurrentDisplayMode(current_display, &mode))
return DEFAULT_REFRESHRATE; return DEFAULT_REFRESHRATE;
return mode.refresh_rate; return mode.refresh_rate;
#else #else
// SDL1.2 doesn't support refresh rates // SDL1.2 doesn't support refresh rates
@ -511,7 +511,7 @@ static SDL_DisplayMode *VID_SDL2_GetDisplayMode(int width, int height, int refre
{ {
if (SDL_GetDisplayMode(0, i, &mode) != 0) if (SDL_GetDisplayMode(0, i, &mode) != 0)
continue; continue;
if (mode.w == width && mode.h == height if (mode.w == width && mode.h == height
&& SDL_BITSPERPIXEL(mode.format) == bpp && SDL_BITSPERPIXEL(mode.format) == bpp
&& mode.refresh_rate == refreshrate) && mode.refresh_rate == refreshrate)
@ -617,7 +617,7 @@ static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qb
if (vid_borderless.value) if (vid_borderless.value)
flags |= SDL_WINDOW_BORDERLESS; flags |= SDL_WINDOW_BORDERLESS;
draw_context = SDL_CreateWindow (caption, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags); draw_context = SDL_CreateWindow (caption, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags);
if (!draw_context) { // scale back fsaa if (!draw_context) { // scale back fsaa
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0);
@ -688,7 +688,7 @@ static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qb
flags |= SDL_FULLSCREEN; flags |= SDL_FULLSCREEN;
if (vid_borderless.value) if (vid_borderless.value)
flags |= SDL_NOFRAME; flags |= SDL_NOFRAME;
gl_swap_control = true; gl_swap_control = true;
if (SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vid_vsync.value) ? 1 : 0) == -1) if (SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vid_vsync.value) ? 1 : 0) == -1)
gl_swap_control = false; gl_swap_control = false;
@ -796,7 +796,7 @@ static void VID_Restart (void)
width, height, bpp, refreshrate, fullscreen? "fullscreen" : "windowed"); width, height, bpp, refreshrate, fullscreen? "fullscreen" : "windowed");
return; return;
} }
// ericw -- OS X, SDL1: textures, VBO's invalid after mode change // ericw -- OS X, SDL1: textures, VBO's invalid after mode change
// OS X, SDL2: still valid after mode change // OS X, SDL2: still valid after mode change
// To handle both cases, delete all GL objects (textures, VBO, GLSL) now. // To handle both cases, delete all GL objects (textures, VBO, GLSL) now.
@ -1346,7 +1346,7 @@ static void GL_Init (void)
GLAlias_CreateShaders (); GLAlias_CreateShaders ();
GLWorld_CreateShaders (); GLWorld_CreateShaders ();
GL_ClearBufferBindings (); GL_ClearBufferBindings ();
} }
/* /*
@ -1605,7 +1605,7 @@ void VID_Init (void)
Cvar_SetCallback (&vid_fsaa, VID_FSAA_f); Cvar_SetCallback (&vid_fsaa, VID_FSAA_f);
Cvar_SetCallback (&vid_desktopfullscreen, VID_Changed_f); Cvar_SetCallback (&vid_desktopfullscreen, VID_Changed_f);
Cvar_SetCallback (&vid_borderless, VID_Changed_f); Cvar_SetCallback (&vid_borderless, VID_Changed_f);
Cmd_AddCommand ("vid_unlock", VID_Unlock); //johnfitz Cmd_AddCommand ("vid_unlock", VID_Unlock); //johnfitz
Cmd_AddCommand ("vid_restart", VID_Restart); //johnfitz Cmd_AddCommand ("vid_restart", VID_Restart); //johnfitz
Cmd_AddCommand ("vid_test", VID_Test); //johnfitz Cmd_AddCommand ("vid_test", VID_Test); //johnfitz
@ -1687,7 +1687,7 @@ void VID_Init (void)
p = COM_CheckParm("-refreshrate"); p = COM_CheckParm("-refreshrate");
if (p && p < com_argc-1) if (p && p < com_argc-1)
refreshrate = Q_atoi(com_argv[p+1]); refreshrate = Q_atoi(com_argv[p+1]);
p = COM_CheckParm("-bpp"); p = COM_CheckParm("-bpp");
if (p && p < com_argc-1) if (p && p < com_argc-1)
bpp = Q_atoi(com_argv[p+1]); bpp = Q_atoi(com_argv[p+1]);
@ -1976,46 +1976,46 @@ regenerates rate list based on current vid_width, vid_height and vid_bpp
*/ */
static void VID_Menu_RebuildRateList (void) static void VID_Menu_RebuildRateList (void)
{ {
int i,j,r; int i, j, r;
vid_menu_numrates=0; vid_menu_numrates = 0;
for (i=0;i<nummodes;i++) for (i = 0; i < nummodes; i++)
{ {
//rate list is limited to rates available with current width/height/bpp //rate list is limited to rates available with current width/height/bpp
if (modelist[i].width != vid_width.value || if (modelist[i].width != vid_width.value ||
modelist[i].height != vid_height.value || modelist[i].height != vid_height.value ||
modelist[i].bpp != vid_bpp.value) modelist[i].bpp != vid_bpp.value)
continue; continue;
r = modelist[i].refreshrate; r = modelist[i].refreshrate;
for (j=0;j<vid_menu_numrates;j++) for (j = 0; j < vid_menu_numrates; j++)
{ {
if (vid_menu_rates[j] == r) if (vid_menu_rates[j] == r)
break; break;
} }
if (j==vid_menu_numrates) if (j == vid_menu_numrates)
{ {
vid_menu_rates[j] = r; vid_menu_rates[j] = r;
vid_menu_numrates++; vid_menu_numrates++;
} }
} }
//if there are no valid fullscreen refreshrates for this width/height, just pick one //if there are no valid fullscreen refreshrates for this width/height, just pick one
if (vid_menu_numrates == 0) if (vid_menu_numrates == 0)
{ {
Cvar_SetValue ("vid_refreshrate",(float)modelist[0].refreshrate); Cvar_SetValue ("vid_refreshrate",(float)modelist[0].refreshrate);
return; return;
} }
//if vid_refreshrate is not in the new list, change vid_refreshrate //if vid_refreshrate is not in the new list, change vid_refreshrate
for (i=0;i<vid_menu_numrates;i++) for (i = 0; i < vid_menu_numrates; i++)
if (vid_menu_rates[i] == (int)(vid_refreshrate.value)) if (vid_menu_rates[i] == (int)(vid_refreshrate.value))
break; break;
if (i==vid_menu_numrates) if (i == vid_menu_numrates)
Cvar_SetValue ("vid_refreshrate",(float)vid_menu_rates[0]); Cvar_SetValue ("vid_refreshrate",(float)vid_menu_rates[0]);
} }
@ -2106,26 +2106,26 @@ chooses next refresh rate in order, then updates vid_refreshrate cvar
static void VID_Menu_ChooseNextRate (int dir) static void VID_Menu_ChooseNextRate (int dir)
{ {
int i; int i;
for (i=0;i<vid_menu_numrates;i++) for (i = 0; i < vid_menu_numrates; i++)
{ {
if (vid_menu_rates[i] == vid_refreshrate.value) if (vid_menu_rates[i] == vid_refreshrate.value)
break; break;
} }
if (i==vid_menu_numrates) //can't find it in list if (i == vid_menu_numrates) //can't find it in list
{ {
i = 0; i = 0;
} }
else else
{ {
i+=dir; i += dir;
if (i>=vid_menu_numrates) if (i >= vid_menu_numrates)
i = 0; i = 0;
else if (i<0) else if (i < 0)
i = vid_menu_numrates-1; i = vid_menu_numrates-1;
} }
Cvar_SetValue ("vid_refreshrate",(float)vid_menu_rates[i]); Cvar_SetValue ("vid_refreshrate",(float)vid_menu_rates[i]);
} }

View file

@ -213,10 +213,10 @@ byte *Image_LoadTGA (FILE *fin, int *width, int *height)
targa_header.attributes = fgetc(fin); targa_header.attributes = fgetc(fin);
if (targa_header.image_type!=2 && targa_header.image_type!=10) if (targa_header.image_type!=2 && targa_header.image_type!=10)
Sys_Error ("Image_LoadTGA: %s is not a type 2 or type 10 targa\n", loadfilename); Sys_Error ("Image_LoadTGA: %s is not a type 2 or type 10 targa", loadfilename);
if (targa_header.colormap_type !=0 || (targa_header.pixel_size!=32 && targa_header.pixel_size!=24)) if (targa_header.colormap_type !=0 || (targa_header.pixel_size!=32 && targa_header.pixel_size!=24))
Sys_Error ("Image_LoadTGA: %s is not a 24bit or 32bit targa\n", loadfilename); Sys_Error ("Image_LoadTGA: %s is not a 24bit or 32bit targa", loadfilename);
columns = targa_header.width; columns = targa_header.width;
rows = targa_header.height; rows = targa_header.height;

View file

@ -137,13 +137,13 @@ int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data)
#ifdef DEBUG #ifdef DEBUG
if (data->cursize == 0) if (data->cursize == 0)
Sys_Error("Datagram_SendMessage: zero length message\n"); Sys_Error("Datagram_SendMessage: zero length message");
if (data->cursize > NET_MAXMESSAGE) if (data->cursize > NET_MAXMESSAGE)
Sys_Error("Datagram_SendMessage: message too big %u\n", data->cursize); Sys_Error("Datagram_SendMessage: message too big: %u", data->cursize);
if (sock->canSend == false) if (sock->canSend == false)
Sys_Error("SendMessage: called with canSend == false\n"); Sys_Error("SendMessage: called with canSend == false");
#endif #endif
Q_memcpy(sock->sendMessage, data->data, data->cursize); Q_memcpy(sock->sendMessage, data->data, data->cursize);
@ -263,10 +263,10 @@ int Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
#ifdef DEBUG #ifdef DEBUG
if (data->cursize == 0) if (data->cursize == 0)
Sys_Error("Datagram_SendUnreliableMessage: zero length message\n"); Sys_Error("Datagram_SendUnreliableMessage: zero length message");
if (data->cursize > MAX_DATAGRAM) if (data->cursize > MAX_DATAGRAM)
Sys_Error("Datagram_SendUnreliableMessage: message too big %u\n", data->cursize); Sys_Error("Datagram_SendUnreliableMessage: message too big: %u", data->cursize);
#endif #endif
packetLen = NET_HEADERSIZE + data->cursize; packetLen = NET_HEADERSIZE + data->cursize;
@ -604,6 +604,7 @@ static void Test_f (void)
break; break;
} }
} }
if (n < hostCacheCount) if (n < hostCacheCount)
goto JustDoIt; goto JustDoIt;
} }
@ -1049,9 +1050,8 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
// allocate a QSocket // allocate a QSocket
sock = NET_NewQSocket (); sock = NET_NewQSocket ();
if (sock == NULL) if (sock == NULL) // no room; try to let him know
{ {
// no room; try to let him know
SZ_Clear(&net_message); SZ_Clear(&net_message);
// save space for the header, filled in later // save space for the header, filled in later
MSG_WriteLong(&net_message, 0); MSG_WriteLong(&net_message, 0);

View file

@ -53,8 +53,8 @@ sys_socket_t UDP_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0) if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{ {
err = SOCKETERRNO; err = SOCKETERRNO;
Con_SafePrintf("UDP_Init: gethostname failed (%s)\n", Con_SafePrintf("UDP_Init: WARNING: gethostname failed (%s)\n",
socketerror(err)); socketerror(err));
} }
else else
{ {
@ -72,8 +72,8 @@ sys_socket_t UDP_Init (void)
#endif #endif
if (!(local = gethostbyname(buff))) if (!(local = gethostbyname(buff)))
{ {
Con_SafePrintf("UDP_Init: gethostbyname failed (%s)\n", Con_SafePrintf("UDP_Init: WARNING: gethostbyname failed (%s)\n",
hstrerror(h_errno)); hstrerror(h_errno));
} }
else if (local->h_addrtype != AF_INET) else if (local->h_addrtype != AF_INET)
{ {
@ -349,8 +349,8 @@ const char *UDP_AddrToString (struct qsockaddr *addr)
haddr = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr); haddr = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr);
q_snprintf (buffer, sizeof(buffer), "%d.%d.%d.%d:%d", (haddr >> 24) & 0xff, q_snprintf (buffer, sizeof(buffer), "%d.%d.%d.%d:%d", (haddr >> 24) & 0xff,
(haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff, (haddr >> 16) & 0xff, (haddr >> 8) & 0xff, haddr & 0xff,
ntohs(((struct sockaddr_in *)addr)->sin_port)); ntohs(((struct sockaddr_in *)addr)->sin_port));
return buffer; return buffer;
} }

View file

@ -83,8 +83,8 @@ static void WINS_GetLocalAddress (void)
if (gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR) if (gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR)
{ {
err = SOCKETERRNO; err = SOCKETERRNO;
Con_SafePrintf("WINS_GetLocalAddress: gethostname failed (%s)\n", Con_SafePrintf("WINS_GetLocalAddress: WARNING: gethostname failed (%s)\n",
socketerror(err)); socketerror(err));
return; return;
} }
@ -136,8 +136,8 @@ sys_socket_t WINS_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0) if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{ {
err = SOCKETERRNO; err = SOCKETERRNO;
Con_SafePrintf("WINS_Init: gethostname failed (%s)\n", Con_SafePrintf("WINS_Init: WARNING: gethostname failed (%s)\n",
socketerror(err)); socketerror(err));
} }
else else
{ {
@ -148,10 +148,10 @@ sys_socket_t WINS_Init (void)
{ {
if (i < com_argc-1) if (i < com_argc-1)
{ {
myAddr = inet_addr(com_argv[i+1]); myAddr = inet_addr(com_argv[i + 1]);
if (myAddr == INADDR_NONE) if (myAddr == INADDR_NONE)
Sys_Error ("%s is not a valid IP address", com_argv[i+1]); Sys_Error ("%s is not a valid IP address", com_argv[i + 1]);
strcpy(my_tcpip_address, com_argv[i+1]); strcpy(my_tcpip_address, com_argv[i + 1]);
} }
else else
{ {

View file

@ -75,8 +75,8 @@ sys_socket_t WIPX_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0) if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{ {
err = SOCKETERRNO; err = SOCKETERRNO;
Con_SafePrintf("WIPX_Init: gethostname failed (%s)\n", Con_SafePrintf("WIPX_Init: WARNING: gethostname failed (%s)\n",
socketerror(err)); socketerror(err));
} }
else else
{ {

View file

@ -91,7 +91,8 @@ static char *PF_VarString (int first)
{ {
if (!dev_overflows.varstring || dev_overflows.varstring + CONSOLE_RESPAM_TIME < realtime) if (!dev_overflows.varstring || dev_overflows.varstring + CONSOLE_RESPAM_TIME < realtime)
{ {
Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n", (int) s, (int)(sizeof(out) - 1)); Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n",
(int) s, (int)(sizeof(out) - 1));
dev_overflows.varstring = realtime; dev_overflows.varstring = realtime;
} }
} }
@ -1689,7 +1690,7 @@ static void PF_changelevel (void)
/* /*
============== ==============
for 2021 re-release: 2021 re-release
============== ==============
*/ */
static void PF_finalefinished (void) static void PF_finalefinished (void)

View file

@ -293,7 +293,7 @@ static int PR_EnterFunction (dfunction_t *f)
// save off any locals that the new function steps on // save off any locals that the new function steps on
c = f->locals; c = f->locals;
if (localstack_used + c > LOCALSTACK_SIZE) if (localstack_used + c > LOCALSTACK_SIZE)
PR_RunError("PR_ExecuteProgram: locals stack overflow\n"); PR_RunError("PR_ExecuteProgram: locals stack overflow");
for (i = 0; i < c ; i++) for (i = 0; i < c ; i++)
localstack[localstack_used + i] = ((int *)pr_globals)[f->parm_start + i]; localstack[localstack_used + i] = ((int *)pr_globals)[f->parm_start + i];

View file

@ -62,7 +62,7 @@ mspriteframe_t *R_GetSpriteFrame (entity_t *currentent)
// are positive, so we don't have to worry about division by 0 // are positive, so we don't have to worry about division by 0
targettime = time - ((int)(time / fullinterval)) * fullinterval; targettime = time - ((int)(time / fullinterval)) * fullinterval;
for (i=0 ; i<(numframes-1) ; i++) for (i = 0; i < (numframes-1); i++)
{ {
if (pintervals[i] > targettime) if (pintervals[i] > targettime)
break; break;
@ -87,8 +87,6 @@ void R_DrawSpriteModel (entity_t *e)
float *s_up, *s_right; float *s_up, *s_right;
float angle, sr, cr; float angle, sr, cr;
//TODO: frustum cull it?
frame = R_GetSpriteFrame (e); frame = R_GetSpriteFrame (e);
psprite = (msprite_t *) currententity->model->cache.data; psprite = (msprite_t *) currententity->model->cache.data;

View file

@ -146,10 +146,8 @@ void S_Startup (void)
} }
else else
{ {
Con_Printf("Audio: %d bit, %s, %d Hz\n", Con_Printf("Audio: %d bit, %s, %d Hz\n", shm->samplebits,
shm->samplebits, (shm->channels == 2) ? "stereo" : "mono", shm->speed);
(shm->channels == 2) ? "stereo" : "mono",
shm->speed);
} }
} }
@ -197,13 +195,13 @@ void S_Init (void)
i = COM_CheckParm("-sndspeed"); i = COM_CheckParm("-sndspeed");
if (i && i < com_argc-1) if (i && i < com_argc-1)
{ {
Cvar_SetQuick (&sndspeed, com_argv[i+1]); Cvar_SetQuick (&sndspeed, com_argv[i + 1]);
} }
i = COM_CheckParm("-mixspeed"); i = COM_CheckParm("-mixspeed");
if (i && i < com_argc-1) if (i && i < com_argc-1)
{ {
Cvar_SetQuick (&snd_mixspeed, com_argv[i+1]); Cvar_SetQuick (&snd_mixspeed, com_argv[i + 1]);
} }
if (host_parms->memsize < 0x800000) if (host_parms->memsize < 0x800000)
@ -275,13 +273,13 @@ static sfx_t *S_FindName (const char *name)
if (!name) if (!name)
Sys_Error ("S_FindName: NULL"); Sys_Error ("S_FindName: NULL");
if (Q_strlen(name) >= MAX_QPATH) if (strlen(name) >= MAX_QPATH)
Sys_Error ("Sound name too long: %s", name); Sys_Error ("Sound name too long: %s", name);
// see if already loaded // see if already loaded
for (i = 0; i < num_sfx; i++) for (i = 0; i < num_sfx; i++)
{ {
if (!Q_strcmp(known_sfx[i].name, name)) if (!strcmp(known_sfx[i].name, name))
{ {
return &known_sfx[i]; return &known_sfx[i];
} }
@ -977,7 +975,7 @@ static void S_Play (void)
while (i < Cmd_Argc()) while (i < Cmd_Argc())
{ {
q_strlcpy(name, Cmd_Argv(i), sizeof(name)); q_strlcpy(name, Cmd_Argv(i), sizeof(name));
if (!Q_strrchr(Cmd_Argv(i), '.')) if (!strrchr(Cmd_Argv(i), '.'))
{ {
q_strlcat(name, ".wav", sizeof(name)); q_strlcat(name, ".wav", sizeof(name));
} }
@ -999,12 +997,12 @@ static void S_PlayVol (void)
while (i < Cmd_Argc()) while (i < Cmd_Argc())
{ {
q_strlcpy(name, Cmd_Argv(i), sizeof(name)); q_strlcpy(name, Cmd_Argv(i), sizeof(name));
if (!Q_strrchr(Cmd_Argv(i), '.')) if (!strrchr(Cmd_Argv(i), '.'))
{ {
q_strlcat(name, ".wav", sizeof(name)); q_strlcat(name, ".wav", sizeof(name));
} }
sfx = S_PrecacheSound(name); sfx = S_PrecacheSound(name);
vol = Q_atof(Cmd_Argv(i + 1)); vol = atof(Cmd_Argv(i + 1));
S_StartSound(hash++, 0, sfx, listener_origin, vol, 1.0); S_StartSound(hash++, 0, sfx, listener_origin, vol, 1.0);
i += 2; i += 2;
} }

View file

@ -229,15 +229,13 @@ void SV_StartSound (edict_t *entity, int channel, const char *sample, int volume
{ {
if (sv.protocol == PROTOCOL_NETQUAKE) if (sv.protocol == PROTOCOL_NETQUAKE)
return; //don't send any info protocol can't support return; //don't send any info protocol can't support
else field_mask |= SND_LARGEENTITY;
field_mask |= SND_LARGEENTITY;
} }
if (sound_num >= 256 || channel >= 8) if (sound_num >= 256 || channel >= 8)
{ {
if (sv.protocol == PROTOCOL_NETQUAKE) if (sv.protocol == PROTOCOL_NETQUAKE)
return; //don't send any info protocol can't support return; //don't send any info protocol can't support
else field_mask |= SND_LARGESOUND;
field_mask |= SND_LARGESOUND;
} }
//johnfitz //johnfitz

View file

@ -183,7 +183,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
if (relink) if (relink)
SV_LinkEdict (ent, true); SV_LinkEdict (ent, true);
ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND; ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
// Con_Printf ("fall down\n"); // Con_Printf ("fall down\n");
return true; return true;
} }
@ -208,7 +208,7 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
if ( (int)ent->v.flags & FL_PARTIALGROUND ) if ( (int)ent->v.flags & FL_PARTIALGROUND )
{ {
// Con_Printf ("back on ground\n"); // Con_Printf ("back on ground\n");
ent->v.flags = (int)ent->v.flags & ~FL_PARTIALGROUND; ent->v.flags = (int)ent->v.flags & ~FL_PARTIALGROUND;
} }
ent->v.groundentity = EDICT_TO_PROG(trace.ent); ent->v.groundentity = EDICT_TO_PROG(trace.ent);
@ -270,12 +270,10 @@ SV_FixCheckBottom
void SV_FixCheckBottom (edict_t *ent) void SV_FixCheckBottom (edict_t *ent)
{ {
// Con_Printf ("SV_FixCheckBottom\n"); // Con_Printf ("SV_FixCheckBottom\n");
ent->v.flags = (int)ent->v.flags | FL_PARTIALGROUND; ent->v.flags = (int)ent->v.flags | FL_PARTIALGROUND;
} }
/* /*
================ ================
SV_NewChaseDir SV_NewChaseDir

View file

@ -779,9 +779,9 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
clip = SV_FlyMove (ent, 0.1, &steptrace); clip = SV_FlyMove (ent, 0.1, &steptrace);
if ( fabs(oldorg[1] - ent->v.origin[1]) > 4 if ( fabs(oldorg[1] - ent->v.origin[1]) > 4
|| fabs(oldorg[0] - ent->v.origin[0]) > 4 ) || fabs(oldorg[0] - ent->v.origin[0]) > 4 )
{ {
//Con_DPrintf ("unstuck!\n"); // Con_DPrintf ("unstuck!\n");
return clip; return clip;
} }
@ -1193,7 +1193,7 @@ void SV_Physics (void)
if (sv_freezenonclients.value) if (sv_freezenonclients.value)
entity_cap = svs.maxclients + 1; // Only run physics on clients and the world entity_cap = svs.maxclients + 1; // Only run physics on clients and the world
else else
entity_cap = sv.num_edicts; entity_cap = sv.num_edicts;
//for (i=0 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(ent)) //for (i=0 ; i<sv.num_edicts ; i++, ent = NEXT_EDICT(ent))
for (i=0 ; i<entity_cap ; i++, ent = NEXT_EDICT(ent)) for (i=0 ; i<entity_cap ; i++, ent = NEXT_EDICT(ent))

View file

@ -576,7 +576,7 @@ nextmsg:
break; break;
case clc_disconnect: case clc_disconnect:
// Sys_Printf ("SV_ReadClientMessage: client disconnected\n"); // Sys_Printf ("SV_ReadClientMessage: client disconnected\n");
return false; return false;
case clc_move: case clc_move:

View file

@ -181,11 +181,11 @@ static void Z_CheckHeap (void)
if (block->next == &mainzone->blocklist) if (block->next == &mainzone->blocklist)
break; // all blocks have been hit break; // all blocks have been hit
if ( (byte *)block + block->size != (byte *)block->next) if ( (byte *)block + block->size != (byte *)block->next)
Sys_Error ("Z_CheckHeap: block size does not touch the next block\n"); Sys_Error ("Z_CheckHeap: block size does not touch the next block");
if ( block->next->prev != block) if ( block->next->prev != block)
Sys_Error ("Z_CheckHeap: next block doesn't have proper back link\n"); Sys_Error ("Z_CheckHeap: next block doesn't have proper back link");
if (!block->tag && !block->next->tag) if (!block->tag && !block->next->tag)
Sys_Error ("Z_CheckHeap: two consecutive free blocks\n"); Sys_Error ("Z_CheckHeap: two consecutive free blocks");
} }
} }