mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
strip the \n from all(?) of the Sys_Error calls (Sys_Error itself will be
adding \n).
This commit is contained in:
parent
6240c62cec
commit
44dcf74627
95 changed files with 258 additions and 259 deletions
|
@ -299,7 +299,7 @@ SND_FindName (const char *name)
|
||||||
sfx_t *sfx;
|
sfx_t *sfx;
|
||||||
|
|
||||||
if (!name)
|
if (!name)
|
||||||
Sys_Error ("S_FindName: NULL\n");
|
Sys_Error ("S_FindName: NULL");
|
||||||
|
|
||||||
if (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);
|
||||||
|
|
|
@ -369,7 +369,7 @@ SNDDMA_Submit (void)
|
||||||
case SND_PCM_STATUS_PREPARED:
|
case SND_PCM_STATUS_PREPARED:
|
||||||
if ((rc = snd_pcm_channel_go (pcm_handle,
|
if ((rc = snd_pcm_channel_go (pcm_handle,
|
||||||
SND_PCM_CHANNEL_PLAYBACK)) < 0) {
|
SND_PCM_CHANNEL_PLAYBACK)) < 0) {
|
||||||
Sys_Error ("unable to start playback. %s\n",
|
Sys_Error ("unable to start playback. %s",
|
||||||
snd_strerror (rc));
|
snd_strerror (rc));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -378,7 +378,7 @@ SNDDMA_Submit (void)
|
||||||
case SND_PCM_STATUS_UNDERRUN:
|
case SND_PCM_STATUS_UNDERRUN:
|
||||||
if ((rc = snd_pcm_plugin_prepare (pcm_handle,
|
if ((rc = snd_pcm_plugin_prepare (pcm_handle,
|
||||||
SND_PCM_CHANNEL_PLAYBACK)) < 0) {
|
SND_PCM_CHANNEL_PLAYBACK)) < 0) {
|
||||||
Sys_Error ("underrun: playback channel prepare error. %s\n",
|
Sys_Error ("underrun: playback channel prepare error. %s",
|
||||||
snd_strerror (rc));
|
snd_strerror (rc));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -174,7 +174,7 @@ SNDDMA_Init (void)
|
||||||
shm->buffer = calloc(shm->samples * (shm->samplebits / 8), 1);
|
shm->buffer = calloc(shm->samples * (shm->samplebits / 8), 1);
|
||||||
if (!shm->buffer)
|
if (!shm->buffer)
|
||||||
{
|
{
|
||||||
Sys_Error ("Failed to allocate buffer for sound!\n");
|
Sys_Error ("Failed to allocate buffer for sound!");
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_inited = 1;
|
snd_inited = 1;
|
||||||
|
|
|
@ -81,7 +81,7 @@ bi_cmd_f (void *pr)
|
||||||
bi_cmd_t *cmd = Hash_Find (bi_cmds, Cmd_Argv (0));
|
bi_cmd_t *cmd = Hash_Find (bi_cmds, Cmd_Argv (0));
|
||||||
|
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
Sys_Error ("bi_cmd_f: unexpected call %s\n", Cmd_Argv (0));
|
Sys_Error ("bi_cmd_f: unexpected call %s", Cmd_Argv (0));
|
||||||
PR_ExecuteProgram (cmd->pr, cmd->func);
|
PR_ExecuteProgram (cmd->pr, cmd->func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ Mod_LoadSkin (byte * skin, int skinsize, int snum, int gnum, qboolean group,
|
||||||
// save 8 bit texels for the player model to remap
|
// save 8 bit texels for the player model to remap
|
||||||
if (strequal (loadmodel->name, "progs/player.mdl")) {
|
if (strequal (loadmodel->name, "progs/player.mdl")) {
|
||||||
if (skinsize > sizeof (player_8bit_texels))
|
if (skinsize > sizeof (player_8bit_texels))
|
||||||
Sys_Error ("Player skin too large\n");
|
Sys_Error ("Player skin too large");
|
||||||
memcpy (player_8bit_texels, pskin, skinsize);
|
memcpy (player_8bit_texels, pskin, skinsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype, int *pskinindex)
|
||||||
float *poutskinintervals;
|
float *poutskinintervals;
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
skinsize = pheader->mdl.skinwidth * pheader->mdl.skinheight;
|
skinsize = pheader->mdl.skinwidth * pheader->mdl.skinheight;
|
||||||
pskindesc = Hunk_AllocName (numskins * sizeof (maliasskindesc_t),
|
pskindesc = Hunk_AllocName (numskins * sizeof (maliasskindesc_t),
|
||||||
|
@ -223,7 +223,7 @@ Mod_LoadAliasModel (model_t *mod, void *buffer, cache_allocator_t allocator)
|
||||||
pmodel->numframes = LittleLong (pinmodel->numframes);
|
pmodel->numframes = LittleLong (pinmodel->numframes);
|
||||||
numframes = pmodel->numframes;
|
numframes = pmodel->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);
|
||||||
|
|
||||||
pmodel->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO;
|
pmodel->size = LittleFloat (pinmodel->size) * ALIAS_BASE_SIZE_RATIO;
|
||||||
mod->synctype = LittleLong (pinmodel->synctype);
|
mod->synctype = LittleLong (pinmodel->synctype);
|
||||||
|
|
|
@ -73,7 +73,7 @@ Mod_Fullbright (byte * skin, int width, int height, char *name)
|
||||||
// ptexels = Hunk_Alloc(s);
|
// ptexels = Hunk_Alloc(s);
|
||||||
ptexels = malloc (pixels);
|
ptexels = malloc (pixels);
|
||||||
if (!ptexels)
|
if (!ptexels)
|
||||||
Sys_Error ("Mod_Fullbright: Memory Allocation Failure\n");
|
Sys_Error ("Mod_Fullbright: Memory Allocation Failure");
|
||||||
if (Mod_CalcFullbright (skin, ptexels, pixels)) {
|
if (Mod_CalcFullbright (skin, ptexels, pixels)) {
|
||||||
Sys_DPrintf ("FB Model ID: '%s'\n", name);
|
Sys_DPrintf ("FB Model ID: '%s'\n", name);
|
||||||
texnum = GL_LoadTexture (name, width, height, ptexels, true, true, 1);
|
texnum = GL_LoadTexture (name, width, height, ptexels, true, true, 1);
|
||||||
|
|
|
@ -242,7 +242,7 @@ void
|
||||||
Mod_CallbackLoad (void *object, cache_allocator_t allocator)
|
Mod_CallbackLoad (void *object, cache_allocator_t allocator)
|
||||||
{
|
{
|
||||||
if (((model_t *)object)->type != mod_alias)
|
if (((model_t *)object)->type != mod_alias)
|
||||||
Sys_Error ("Mod_CallbackLoad for non-alias model? FIXME!\n");
|
Sys_Error ("Mod_CallbackLoad for non-alias model? FIXME!");
|
||||||
// FIXME: do we want crash set to true?
|
// FIXME: do we want crash set to true?
|
||||||
Mod_RealLoadModel (object, true, allocator);
|
Mod_RealLoadModel (object, true, allocator);
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ Mod_LoadSpriteModel (model_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;
|
||||||
|
|
||||||
|
|
|
@ -659,7 +659,7 @@ Cmd_StuffCmds_f (void)
|
||||||
// pull out the commands
|
// pull out the commands
|
||||||
build = malloc (s + 1);
|
build = malloc (s + 1);
|
||||||
if (!build)
|
if (!build)
|
||||||
Sys_Error ("Cmd_StuffCmds_f: Memory Allocation Failure\n");
|
Sys_Error ("Cmd_StuffCmds_f: Memory Allocation Failure");
|
||||||
build[0] = 0;
|
build[0] = 0;
|
||||||
|
|
||||||
for (i = 0; i < s - 1; i++) {
|
for (i = 0; i < s - 1; i++) {
|
||||||
|
@ -1558,7 +1558,7 @@ Cmd_AddCommand (const char *cmd_name, xcommand_t function,
|
||||||
|
|
||||||
cmd = calloc (1, sizeof (cmd_function_t));
|
cmd = calloc (1, sizeof (cmd_function_t));
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
Sys_Error ("Cmd_AddCommand: Memory Allocation Failure\n");
|
Sys_Error ("Cmd_AddCommand: Memory Allocation Failure");
|
||||||
cmd->name = cmd_name;
|
cmd->name = cmd_name;
|
||||||
cmd->function = function;
|
cmd->function = function;
|
||||||
cmd->description = description;
|
cmd->description = description;
|
||||||
|
@ -1700,7 +1700,7 @@ Cmd_CompleteBuildList (const char *partial)
|
||||||
buf = malloc (sizeofbuf + sizeof (char *));
|
buf = malloc (sizeofbuf + sizeof (char *));
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
Sys_Error ("Cmd_CompleteBuildList: Memory Allocation Failure\n");
|
Sys_Error ("Cmd_CompleteBuildList: Memory Allocation Failure");
|
||||||
// Loop through the alias list and print all matches
|
// Loop through the alias list and print all matches
|
||||||
for (cmd = cmd_functions; cmd; cmd = cmd->next)
|
for (cmd = cmd_functions; cmd; cmd = cmd->next)
|
||||||
if (!strncasecmp (partial, cmd->name, len))
|
if (!strncasecmp (partial, cmd->name, len))
|
||||||
|
@ -1789,7 +1789,7 @@ Cmd_CompleteAliasBuildList (const char *partial)
|
||||||
buf = malloc (sizeofbuf + sizeof (char *));
|
buf = malloc (sizeofbuf + sizeof (char *));
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
Sys_Error ("Cmd_CompleteAliasBuildList: Memory Allocation Failure\n");
|
Sys_Error ("Cmd_CompleteAliasBuildList: Memory Allocation Failure");
|
||||||
// Loop through the alias list and print all matches
|
// Loop through the alias list and print all matches
|
||||||
for (alias = cmd_alias; alias; alias = alias->next)
|
for (alias = cmd_alias; alias; alias = alias->next)
|
||||||
if (!strncasecmp (partial, alias->name, len))
|
if (!strncasecmp (partial, alias->name, len))
|
||||||
|
@ -1928,7 +1928,7 @@ Cmd_Alias_f (void)
|
||||||
|
|
||||||
alias = calloc (1, sizeof (cmdalias_t));
|
alias = calloc (1, sizeof (cmdalias_t));
|
||||||
if (!alias)
|
if (!alias)
|
||||||
Sys_Error ("Cmd_Alias_f: Memory Allocation Failure\n");
|
Sys_Error ("Cmd_Alias_f: Memory Allocation Failure");
|
||||||
alias->name = strdup (s);
|
alias->name = strdup (s);
|
||||||
Hash_Add (cmd_alias_hash, alias);
|
Hash_Add (cmd_alias_hash, alias);
|
||||||
for (a = &cmd_alias; *a; a = &(*a)->next)
|
for (a = &cmd_alias; *a; a = &(*a)->next)
|
||||||
|
@ -1940,7 +1940,7 @@ Cmd_Alias_f (void)
|
||||||
// copy the rest of the command line
|
// copy the rest of the command line
|
||||||
cmd = malloc (strlen (Cmd_Args (1)) + 2); // can never be longer
|
cmd = malloc (strlen (Cmd_Args (1)) + 2); // can never be longer
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
Sys_Error ("Cmd_Alias_f: Memory Allocation Failure\n");
|
Sys_Error ("Cmd_Alias_f: Memory Allocation Failure");
|
||||||
cmd[0] = 0; // start out with a null string
|
cmd[0] = 0; // start out with a null string
|
||||||
c = Cmd_Argc ();
|
c = Cmd_Argc ();
|
||||||
for (i = 2; i < c; i++) {
|
for (i = 2; i < c; i++) {
|
||||||
|
|
|
@ -217,7 +217,7 @@ Cvar_CompleteBuildList (const char *partial)
|
||||||
len = strlen(partial);
|
len = strlen(partial);
|
||||||
buf = malloc(sizeofbuf + sizeof (char *));
|
buf = malloc(sizeofbuf + sizeof (char *));
|
||||||
if (!buf)
|
if (!buf)
|
||||||
Sys_Error ("Cvar_CompleteBuildList: Memory Allocation Failure\n");
|
Sys_Error ("Cvar_CompleteBuildList: Memory Allocation Failure");
|
||||||
// Loop through the alias list and print all matches
|
// Loop through the alias list and print all matches
|
||||||
for (cvar = cvar_vars; cvar; cvar = cvar->next)
|
for (cvar = cvar_vars; cvar; cvar = cvar->next)
|
||||||
if (!strncasecmp(partial, cvar->name, len))
|
if (!strncasecmp(partial, cvar->name, len))
|
||||||
|
|
|
@ -43,7 +43,7 @@ dstring_new (void)
|
||||||
new = calloc (1, sizeof (dstring_t));
|
new = calloc (1, sizeof (dstring_t));
|
||||||
|
|
||||||
if (!new)
|
if (!new)
|
||||||
Sys_Error ("dstring_new: Failed to allocate memory.\n");
|
Sys_Error ("dstring_new: Failed to allocate memory.");
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ dstring_adjust (dstring_t *dstr)
|
||||||
if (dstr->size > dstr->truesize) {
|
if (dstr->size > dstr->truesize) {
|
||||||
dstr->str = realloc (dstr->str, dstr->size);
|
dstr->str = realloc (dstr->str, dstr->size);
|
||||||
if (!dstr->str)
|
if (!dstr->str)
|
||||||
Sys_Error ("dstring_adjust: Failed to reallocate memory.\n");
|
Sys_Error ("dstring_adjust: Failed to reallocate memory.");
|
||||||
dstr->truesize = dstr->size;
|
dstr->truesize = dstr->size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ dstring_newstr (void)
|
||||||
new = calloc (1, sizeof (dstring_t));
|
new = calloc (1, sizeof (dstring_t));
|
||||||
|
|
||||||
if (!new)
|
if (!new)
|
||||||
Sys_Error ("dstring_newstr: Failed to allocate memory.\n");
|
Sys_Error ("dstring_newstr: Failed to allocate memory.");
|
||||||
new->size = 1;
|
new->size = 1;
|
||||||
dstring_adjust (new);
|
dstring_adjust (new);
|
||||||
new->str[0] = 0;
|
new->str[0] = 0;
|
||||||
|
|
|
@ -132,14 +132,14 @@ Info_SetValueForStarKey (info_t *info, const char *key, const char *value, int f
|
||||||
free ((char*)k->value);
|
free ((char*)k->value);
|
||||||
} else {
|
} else {
|
||||||
if (!(k = malloc (sizeof (info_key_t))))
|
if (!(k = malloc (sizeof (info_key_t))))
|
||||||
Sys_Error ("Info_SetValueForStarKey: out of memory\n");
|
Sys_Error ("Info_SetValueForStarKey: out of memory");
|
||||||
if (!(k->key = strdup (key)))
|
if (!(k->key = strdup (key)))
|
||||||
Sys_Error ("Info_SetValueForStarKey: out of memory\n");
|
Sys_Error ("Info_SetValueForStarKey: out of memory");
|
||||||
info->cursize += strlen (key) + 1;
|
info->cursize += strlen (key) + 1;
|
||||||
Hash_Add (info->tab, k);
|
Hash_Add (info->tab, k);
|
||||||
}
|
}
|
||||||
if (!(str = strdup (value)))
|
if (!(str = strdup (value)))
|
||||||
Sys_Error ("Info_SetValueForStarKey: out of memory\n");
|
Sys_Error ("Info_SetValueForStarKey: out of memory");
|
||||||
if (flags & 1) {
|
if (flags & 1) {
|
||||||
byte *s, *d;
|
byte *s, *d;
|
||||||
for (d = s = str; *s; s++)
|
for (d = s = str; *s; s++)
|
||||||
|
|
|
@ -518,10 +518,10 @@ FloorDivMod (double numer, double denom, int *quotient, int *rem)
|
||||||
|
|
||||||
#ifndef PARANOID
|
#ifndef PARANOID
|
||||||
if (denom <= 0.0)
|
if (denom <= 0.0)
|
||||||
Sys_Error ("FloorDivMod: bad denominator %f\n", denom);
|
Sys_Error ("FloorDivMod: bad denominator %f", denom);
|
||||||
|
|
||||||
// if ((floor(numer) != numer) || (floor(denom) != denom))
|
// if ((floor(numer) != numer) || (floor(denom) != denom))
|
||||||
// Sys_Error ("FloorDivMod: non-integer numer or denom %f %f\n",
|
// Sys_Error ("FloorDivMod: non-integer numer or denom %f %f",
|
||||||
// numer, denom);
|
// numer, denom);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -283,7 +283,7 @@ MSG_ReadString (msg_t *msg)
|
||||||
msg->badread_string_size = len + 1;
|
msg->badread_string_size = len + 1;
|
||||||
}
|
}
|
||||||
if (!msg->badread_string)
|
if (!msg->badread_string)
|
||||||
Sys_Error ("MSG_ReadString: out of memory\n");
|
Sys_Error ("MSG_ReadString: out of memory");
|
||||||
strncpy (msg->badread_string, string, len);
|
strncpy (msg->badread_string, string, len);
|
||||||
msg->badread_string[len] = 0;
|
msg->badread_string[len] = 0;
|
||||||
return msg->badread_string;
|
return msg->badread_string;
|
||||||
|
|
|
@ -488,7 +488,7 @@ PL_GetPropertyList (const char *string)
|
||||||
return newpl;
|
return newpl;
|
||||||
} else {
|
} else {
|
||||||
if (pl && pl->error && pl->error[0])
|
if (pl && pl->error && pl->error[0])
|
||||||
Sys_Error ("%d,%d: %s\n", pl->line, pl->pos, pl->error);
|
Sys_Error ("%d,%d: %s", pl->line, pl->pos, pl->error);
|
||||||
free (pl);
|
free (pl);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -727,7 +727,7 @@ COM_LoadGameDirectory (const char *dir)
|
||||||
|
|
||||||
pakfiles[count] = malloc (FNAME_SIZE);
|
pakfiles[count] = malloc (FNAME_SIZE);
|
||||||
if (!pakfiles[count])
|
if (!pakfiles[count])
|
||||||
Sys_Error ("COM_LoadGameDirectory: MemoryAllocationFailure\n");
|
Sys_Error ("COM_LoadGameDirectory: MemoryAllocationFailure");
|
||||||
snprintf (pakfiles[count], FNAME_SIZE - 1, "%s/%s", dir,
|
snprintf (pakfiles[count], FNAME_SIZE - 1, "%s/%s", dir,
|
||||||
dirent->d_name);
|
dirent->d_name);
|
||||||
pakfiles[count][FNAME_SIZE - 1] = '\0';
|
pakfiles[count][FNAME_SIZE - 1] = '\0';
|
||||||
|
|
|
@ -135,12 +135,12 @@ LoadTGA (VFile *fin)
|
||||||
targa->height = LittleShort (targa->height);
|
targa->height = LittleShort (targa->height);
|
||||||
|
|
||||||
if (targa->image_type != 2 && targa->image_type != 10)
|
if (targa->image_type != 2 && targa->image_type != 10)
|
||||||
Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported\n");
|
Sys_Error ("LoadTGA: Only type 2 and 10 targa RGB images supported");
|
||||||
|
|
||||||
if (targa->colormap_type != 0
|
if (targa->colormap_type != 0
|
||||||
|| (targa->pixel_size != 32 && targa->pixel_size != 24))
|
|| (targa->pixel_size != 32 && targa->pixel_size != 24))
|
||||||
Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported "
|
Sys_Error ("Texture_LoadTGA: Only 32 or 24 bit images supported "
|
||||||
"(no colormaps)\n");
|
"(no colormaps)");
|
||||||
|
|
||||||
columns = targa->width;
|
columns = targa->width;
|
||||||
rows = targa->height;
|
rows = targa->height;
|
||||||
|
@ -150,14 +150,14 @@ LoadTGA (VFile *fin)
|
||||||
case 24:
|
case 24:
|
||||||
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 3]));
|
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 3]));
|
||||||
if (!tex)
|
if (!tex)
|
||||||
Sys_Error ("LoadTGA: Memory Allocation Failure\n");
|
Sys_Error ("LoadTGA: Memory Allocation Failure");
|
||||||
tex->format = tex_rgb;
|
tex->format = tex_rgb;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case 32:
|
case 32:
|
||||||
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
|
tex = Hunk_TempAlloc (field_offset (tex_t, data[numPixels * 4]));
|
||||||
if (!tex)
|
if (!tex)
|
||||||
Sys_Error ("LoadTGA: Memory Allocation Failure\n");
|
Sys_Error ("LoadTGA: Memory Allocation Failure");
|
||||||
tex->format = tex_rgba;
|
tex->format = tex_rgba;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ W_LoadWadFile (const char *filename)
|
||||||
fs_basegame->string);
|
fs_basegame->string);
|
||||||
Sys_Printf (" fs_sharepath is %s\n", fs_sharepath->string);
|
Sys_Printf (" fs_sharepath is %s\n", fs_sharepath->string);
|
||||||
Sys_Printf (" fs_userpath is %s\n\n", fs_userpath->string);
|
Sys_Printf (" fs_userpath is %s\n\n", fs_userpath->string);
|
||||||
Sys_Error ("W_LoadWadFile: unable to load %s\n\n", filename);
|
Sys_Error ("W_LoadWadFile: unable to load %s", filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
header = (wadinfo_t *) wad_base;
|
header = (wadinfo_t *) wad_base;
|
||||||
|
@ -107,7 +107,7 @@ W_LoadWadFile (const char *filename)
|
||||||
|| header->identification[1] != 'A'
|
|| header->identification[1] != 'A'
|
||||||
|| header->identification[2] != 'D'
|
|| header->identification[2] != 'D'
|
||||||
|| header->identification[3] != '2')
|
|| header->identification[3] != '2')
|
||||||
Sys_Error ("Wad file %s doesn't have WAD2 id\n", filename);
|
Sys_Error ("Wad file %s doesn't have WAD2 id", filename);
|
||||||
|
|
||||||
wad_numlumps = LittleLong (header->numlumps);
|
wad_numlumps = LittleLong (header->numlumps);
|
||||||
infotableofs = LittleLong (header->infotableofs);
|
infotableofs = LittleLong (header->infotableofs);
|
||||||
|
|
|
@ -853,7 +853,7 @@ Cache_RealFree (cache_user_t *c)
|
||||||
|
|
||||||
#ifdef MMAPPED_CACHE
|
#ifdef MMAPPED_CACHE
|
||||||
if (munmap (cs, cs->size))
|
if (munmap (cs, cs->size))
|
||||||
Sys_Error ("Cache_Free: munmap failed!\n");
|
Sys_Error ("Cache_Free: munmap failed!");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -968,7 +968,7 @@ Cache_Add (cache_user_t *c, void *object, cache_loader_t loader)
|
||||||
CACHE_WRITE_LOCK;
|
CACHE_WRITE_LOCK;
|
||||||
|
|
||||||
if (c->data || c->object || c->loader)
|
if (c->data || c->object || c->loader)
|
||||||
Sys_Error ("Cache_Add: cache item already exists!\n");
|
Sys_Error ("Cache_Add: cache item already exists!");
|
||||||
|
|
||||||
c->object = object;
|
c->object = object;
|
||||||
c->loader = loader;
|
c->loader = loader;
|
||||||
|
@ -984,7 +984,7 @@ Cache_Remove (cache_user_t *c)
|
||||||
CACHE_WRITE_LOCK;
|
CACHE_WRITE_LOCK;
|
||||||
|
|
||||||
if (!c->object || !c->loader)
|
if (!c->object || !c->loader)
|
||||||
Sys_Error ("Cache_Remove: already removed!\n");
|
Sys_Error ("Cache_Remove: already removed!");
|
||||||
|
|
||||||
if (Cache_RealCheck (c))
|
if (Cache_RealCheck (c))
|
||||||
Cache_RealFree (c);
|
Cache_RealFree (c);
|
||||||
|
@ -1018,7 +1018,7 @@ Cache_Get (cache_user_t *c)
|
||||||
{
|
{
|
||||||
void *mem = Cache_TryGet (c);
|
void *mem = Cache_TryGet (c);
|
||||||
if (!mem)
|
if (!mem)
|
||||||
Sys_Error ("Cache_Get: couldn't get cache!\n");
|
Sys_Error ("Cache_Get: couldn't get cache!");
|
||||||
return mem;
|
return mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1030,7 +1030,7 @@ Cache_Release (cache_user_t *c)
|
||||||
readlock = &(((cache_system_t *)c->data) - 1)->readlock;
|
readlock = &(((cache_system_t *)c->data) - 1)->readlock;
|
||||||
|
|
||||||
if (!*readlock)
|
if (!*readlock)
|
||||||
Sys_Error ("Cache_Release: already released!\n");
|
Sys_Error ("Cache_Release: already released!");
|
||||||
|
|
||||||
(*readlock)--;
|
(*readlock)--;
|
||||||
|
|
||||||
|
@ -1057,7 +1057,7 @@ QA_alloc (unsigned flags, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
if (flags & ~(QA_FAILURE | QA_PREVIOUS | QA_SIZE | QA_ZEROED))
|
if (flags & ~(QA_FAILURE | QA_PREVIOUS | QA_SIZE | QA_ZEROED))
|
||||||
Sys_Error ("QA_alloc: bad flags: %u\n", flags);
|
Sys_Error ("QA_alloc: bad flags: %u", flags);
|
||||||
|
|
||||||
va_start (ap, flags);
|
va_start (ap, flags);
|
||||||
if (flags & QA_PREVIOUS)
|
if (flags & QA_PREVIOUS)
|
||||||
|
@ -1071,13 +1071,13 @@ QA_alloc (unsigned flags, ...)
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
|
|
||||||
if (failure != QA_NOFAIL && failure != QA_LATEFAIL && failure != QA_EARLYFAIL)
|
if (failure != QA_NOFAIL && failure != QA_LATEFAIL && failure != QA_EARLYFAIL)
|
||||||
Sys_Error ("QA_alloc: invalid failure type: %u\n", failure);
|
Sys_Error ("QA_alloc: invalid failure type: %u", failure);
|
||||||
|
|
||||||
if (size) {
|
if (size) {
|
||||||
do {
|
do {
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
if (zeroed)
|
if (zeroed)
|
||||||
Sys_Error ("QA_alloc: Zeroing reallocated memory not yet supported\n");
|
Sys_Error ("QA_alloc: Zeroing reallocated memory not yet supported");
|
||||||
else
|
else
|
||||||
mem = realloc (ptr, size);
|
mem = realloc (ptr, size);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1090,12 +1090,12 @@ QA_alloc (unsigned flags, ...)
|
||||||
&& QA_alloc_callback && QA_alloc_callback (size));
|
&& QA_alloc_callback && QA_alloc_callback (size));
|
||||||
|
|
||||||
if (!mem && failure == QA_NOFAIL)
|
if (!mem && failure == QA_NOFAIL)
|
||||||
Sys_Error ("QA_alloc: could not allocate %d bytes!\n", (int)size);
|
Sys_Error ("QA_alloc: could not allocate %d bytes!", (int)size);
|
||||||
|
|
||||||
return mem;
|
return mem;
|
||||||
} else {
|
} else {
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
Sys_Error ("QA_alloc: can't free a NULL pointers!\n");
|
Sys_Error ("QA_alloc: can't free a NULL pointers!");
|
||||||
free (ptr);
|
free (ptr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ particle_new (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (numparticles >= r_maxparticles) {
|
if (numparticles >= r_maxparticles) {
|
||||||
Sys_Error ("FAILED PARTICLE ALLOC!\n");
|
Sys_Error ("FAILED PARTICLE ALLOC!");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -73,7 +73,7 @@ QFGL_LoadLibrary (void)
|
||||||
void *handle;
|
void *handle;
|
||||||
|
|
||||||
if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
||||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_driver->string,
|
Sys_Error ("Couldn't load OpenGL library %s: %s", gl_driver->string,
|
||||||
dlerror ());
|
dlerror ());
|
||||||
}
|
}
|
||||||
getProcAddress = dlsym;
|
getProcAddress = dlsym;
|
||||||
|
@ -92,7 +92,7 @@ QFGL_LoadLibrary (void)
|
||||||
void *handle;
|
void *handle;
|
||||||
|
|
||||||
if (!(handle = LoadLibrary (gl_driver->string))) {
|
if (!(handle = LoadLibrary (gl_driver->string))) {
|
||||||
Sys_Error ("Couldn't load OpenGL library %s!\n", gl_driver->string);
|
Sys_Error ("Couldn't load OpenGL library %s!", gl_driver->string);
|
||||||
}
|
}
|
||||||
getProcAddress = GetProcAddress;
|
getProcAddress = GetProcAddress;
|
||||||
(FARPROC)glGetProcAddress = GetProcAddress (handle, "wglGetProcAddress");
|
(FARPROC)glGetProcAddress = GetProcAddress (handle, "wglGetProcAddress");
|
||||||
|
@ -148,7 +148,7 @@ QFGL_ProcAddress (void *handle, const char *name, qboolean crit)
|
||||||
Con_DPrintf ("not found\n");
|
Con_DPrintf ("not found\n");
|
||||||
|
|
||||||
if (crit)
|
if (crit)
|
||||||
Sys_Error ("Couldn't load critical OpenGL function %s, exiting...\n",
|
Sys_Error ("Couldn't load critical OpenGL function %s, exiting...",
|
||||||
name);
|
name);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -88,7 +88,7 @@ R_LineGraph (int x, int y, int *h_vals, int count)
|
||||||
graph_width[graph_index] = count;
|
graph_width[graph_index] = count;
|
||||||
|
|
||||||
if (!graph_texels[graph_index])
|
if (!graph_texels[graph_index])
|
||||||
Sys_Error ("R_LineGraph: failed to allocate texture buffer\n");
|
Sys_Error ("R_LineGraph: failed to allocate texture buffer");
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (count--) {
|
while (count--) {
|
||||||
|
|
|
@ -604,7 +604,7 @@ SCR_ScreenShot_f (void)
|
||||||
}
|
}
|
||||||
buffer = malloc (glwidth * glheight * 3);
|
buffer = malloc (glwidth * glheight * 3);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
Sys_Error ("SCR_ScreenShot_f: Memory Allocation Failure\n");
|
Sys_Error ("SCR_ScreenShot_f: Memory Allocation Failure");
|
||||||
qfglReadPixels (glx, gly, glwidth, glheight, GL_BGR_EXT, GL_UNSIGNED_BYTE,
|
qfglReadPixels (glx, gly, glwidth, glheight, GL_BGR_EXT, GL_UNSIGNED_BYTE,
|
||||||
buffer);
|
buffer);
|
||||||
WriteTGAfile (pcxname, buffer, glwidth, glheight);
|
WriteTGAfile (pcxname, buffer, glwidth, glheight);
|
||||||
|
|
|
@ -144,7 +144,7 @@ determine_face (vec3_t v)
|
||||||
i = 2;
|
i = 2;
|
||||||
}
|
}
|
||||||
if (!m) {
|
if (!m) {
|
||||||
Sys_Error ("You are speared by a sky poly edge\n");
|
Sys_Error ("You are speared by a sky poly edge");
|
||||||
}
|
}
|
||||||
if (v[i] < 0)
|
if (v[i] < 0)
|
||||||
i += 3;
|
i += 3;
|
||||||
|
|
|
@ -509,7 +509,7 @@ GL_Upload8 (byte * data, int width, int height, qboolean mipmap, qboolean alpha)
|
||||||
s = width * height;
|
s = width * height;
|
||||||
trans = malloc (s * sizeof (unsigned int));
|
trans = malloc (s * sizeof (unsigned int));
|
||||||
if (!trans)
|
if (!trans)
|
||||||
Sys_Error ("GL_Upload8: Memory Allocation Failure\n");
|
Sys_Error ("GL_Upload8: Memory Allocation Failure");
|
||||||
|
|
||||||
// if there are no transparent pixels, make it a 3 component
|
// if there are no transparent pixels, make it a 3 component
|
||||||
// texture even if it was specified as otherwise
|
// texture even if it was specified as otherwise
|
||||||
|
|
|
@ -62,11 +62,11 @@ noise_diamondsquare (unsigned char *noise, unsigned int size,
|
||||||
|
|
||||||
for (sizepower = 0; (1 << sizepower) < size; sizepower++);
|
for (sizepower = 0; (1 << sizepower) < size; sizepower++);
|
||||||
if (size != (1 << sizepower))
|
if (size != (1 << sizepower))
|
||||||
Sys_Error("fractalnoise: size must be power of 2\n");
|
Sys_Error("fractalnoise: size must be power of 2");
|
||||||
|
|
||||||
for (gridpower = 0; (1 << gridpower) < startgrid; gridpower++);
|
for (gridpower = 0; (1 << gridpower) < startgrid; gridpower++);
|
||||||
if (startgrid != (1 << gridpower))
|
if (startgrid != (1 << gridpower))
|
||||||
Sys_Error("fractalnoise: grid must be power of 2\n");
|
Sys_Error("fractalnoise: grid must be power of 2");
|
||||||
|
|
||||||
startgrid = bound(0, startgrid, size);
|
startgrid = bound(0, startgrid, size);
|
||||||
amplitude = 0xFFFF; // this gets halved before use
|
amplitude = 0xFFFF; // this gets halved before use
|
||||||
|
|
|
@ -254,7 +254,7 @@ R_StoreEfrags (efrag_t **ppefrag)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Sys_Error ("R_StoreEfrags: Bad entity type %d\n",
|
Sys_Error ("R_StoreEfrags: Bad entity type %d",
|
||||||
model->type);
|
model->type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,10 +149,10 @@ D_SCAlloc (int width, int size)
|
||||||
qboolean wrapped_this_time;
|
qboolean wrapped_this_time;
|
||||||
|
|
||||||
if ((width < 0) || (width > 256))
|
if ((width < 0) || (width > 256))
|
||||||
Sys_Error ("D_SCAlloc: bad cache width %d\n", width);
|
Sys_Error ("D_SCAlloc: bad cache width %d", width);
|
||||||
|
|
||||||
if ((size <= 0) || (size > 0x10000))
|
if ((size <= 0) || (size > 0x10000))
|
||||||
Sys_Error ("D_SCAlloc: bad cache size %d\n", size);
|
Sys_Error ("D_SCAlloc: bad cache size %d", size);
|
||||||
|
|
||||||
/* This adds the offset of data[0] in the surfcache_t struct. */
|
/* This adds the offset of data[0] in the surfcache_t struct. */
|
||||||
size += field_offset (surfcache_t, data);
|
size += field_offset (surfcache_t, data);
|
||||||
|
|
|
@ -130,7 +130,7 @@ D_DrawSolidSurface (surf_t *surf, int color)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_DrawSolidSurface: unsupported r_pixbytes %i\n",
|
Sys_Error("D_DrawSolidSurface: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,6 @@ D_FillRect (vrect_t *rect, int color)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_FillRect: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("D_FillRect: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -379,6 +379,6 @@ D_DrawParticle (particle_t *pparticle)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_DrawParticles: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("D_DrawParticles: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -583,7 +583,7 @@ done32: ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_PolysetDrawSpans: unsupported r_pixbytes %i\n",
|
Sys_Error("D_PolysetDrawSpans: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ D_WarpScreen (void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_WarpScreen: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("D_WarpScreen: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ D_DrawTurbulentSpan (void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_DrawTurbulentSpan: unsupported r_pixbytes %i\n",
|
Sys_Error("D_DrawTurbulentSpan: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -817,7 +817,7 @@ D_DrawSpans (espan_t *pspan)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_DrawSpans: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("D_DrawSpans: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -272,6 +272,6 @@ D_DrawSkyScans (espan_t *pspan)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_DrawSkyScans: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("D_DrawSkyScans: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -501,7 +501,7 @@ NextSpan4:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_SpriteDrawSpans: unsupported r_pixbytes %i\n",
|
Sys_Error("D_SpriteDrawSpans: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,10 +150,10 @@ D_SCAlloc (int width, int size)
|
||||||
qboolean wrapped_this_time;
|
qboolean wrapped_this_time;
|
||||||
|
|
||||||
if ((width < 0) || (width > 256))
|
if ((width < 0) || (width > 256))
|
||||||
Sys_Error ("D_SCAlloc: bad cache width %d\n", width);
|
Sys_Error ("D_SCAlloc: bad cache width %d", width);
|
||||||
|
|
||||||
if ((size <= 0) || (size > (0x10000 * r_pixbytes)))
|
if ((size <= 0) || (size > (0x10000 * r_pixbytes)))
|
||||||
Sys_Error ("D_SCAlloc: bad cache size %d\n", size);
|
Sys_Error ("D_SCAlloc: bad cache size %d", size);
|
||||||
|
|
||||||
/* This adds the offset of data[0] in the surfcache_t struct. */
|
/* This adds the offset of data[0] in the surfcache_t struct. */
|
||||||
size += field_offset (surfcache_t, data);
|
size += field_offset (surfcache_t, data);
|
||||||
|
|
|
@ -64,7 +64,7 @@ D_DrawZPoint (void)
|
||||||
d_8to24table[r_zpointdesc.color];
|
d_8to24table[r_zpointdesc.color];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("D_DrawZPoint: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("D_DrawZPoint: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,7 +311,7 @@ Draw_Character (int x, int y, unsigned int num)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_Character: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("Draw_Character: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ Draw_Pixel (int x, int y, byte color)
|
||||||
d_8to24table[color];
|
d_8to24table[color];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_Pixel: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("Draw_Pixel: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ Draw_Pic (int x, int y, qpic_t *pic)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_Pic: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("Draw_Pic: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_SubPic: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("Draw_SubPic: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,7 +618,7 @@ Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i\n",
|
Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -705,7 +705,7 @@ Draw_ConsoleBackground (int lines)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i\n",
|
Sys_Error("Draw_TransPicTranslate: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -990,7 +990,7 @@ R_DrawRect (vrect_t *prect, int rowbytes, byte * psrc, int transparent)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("R_DrawRect: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("R_DrawRect: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1103,7 +1103,7 @@ Draw_Fill (int x, int y, int w, int h, int c)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_Fill: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("Draw_Fill: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1154,7 +1154,7 @@ Draw_FadeScreen (void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Draw_FadeScreen: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("Draw_FadeScreen: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
VID_UnlockBuffer ();
|
VID_UnlockBuffer ();
|
||||||
|
|
|
@ -434,7 +434,7 @@ SCR_ApplyBlend (void) // Used to be V_UpdatePalette
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("V_UpdatePalette: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("V_UpdatePalette: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -677,7 +677,7 @@ SCR_ScreenShot_f (void)
|
||||||
Con_Printf("SCR_ScreenShot_f: FIXME - add 32bit support\n");
|
Con_Printf("SCR_ScreenShot_f: FIXME - add 32bit support\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("SCR_ScreenShot_f: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("SCR_ScreenShot_f: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for adapters that can't stay mapped in for linear writes all the time
|
// for adapters that can't stay mapped in for linear writes all the time
|
||||||
|
|
|
@ -94,7 +94,7 @@ R_LineGraph (int x, int y, int *h_vals, int count)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("R_LineGraph: unsupported r_pixbytes %i\n",
|
Sys_Error("R_LineGraph: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -727,7 +727,7 @@ R_AliasDrawModel (alight_t *plighting)
|
||||||
else if (r_pixbytes == 4)
|
else if (r_pixbytes == 4)
|
||||||
acolormap = vid.colormap32;
|
acolormap = vid.colormap32;
|
||||||
else
|
else
|
||||||
Sys_Error("R_AliasDrawmodel: unsupported r_pixbytes %i\n",
|
Sys_Error("R_AliasDrawmodel: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ R_MakeSky (void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("R_MakeSky: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("R_MakeSky: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
}
|
}
|
||||||
r_skymade = 1;
|
r_skymade = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ R_DrawSurface (void)
|
||||||
pblockdrawer = surfmiptable32[r_drawsurf.surfmip];
|
pblockdrawer = surfmiptable32[r_drawsurf.surfmip];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("R_DrawSurface: unsupported r_pixbytes %i\n", r_pixbytes);
|
Sys_Error("R_DrawSurface: unsupported r_pixbytes %i", r_pixbytes);
|
||||||
pblockdrawer = NULL;
|
pblockdrawer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ Skin_Set_Translate (int top, int bottom, void *_dest)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error("Skin_Set_Translate: unsupported r_pixbytes %i\n",
|
Sys_Error("Skin_Set_Translate: unsupported r_pixbytes %i",
|
||||||
r_pixbytes);
|
r_pixbytes);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -243,7 +243,7 @@ X11_OpenDisplay (void)
|
||||||
if (!x_disp) {
|
if (!x_disp) {
|
||||||
x_disp = XOpenDisplay (NULL);
|
x_disp = XOpenDisplay (NULL);
|
||||||
if (!x_disp) {
|
if (!x_disp) {
|
||||||
Sys_Error ("X11_OpenDisplay: Could not open display [%s]\n",
|
Sys_Error ("X11_OpenDisplay: Could not open display [%s]",
|
||||||
XDisplayName (NULL));
|
XDisplayName (NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,7 @@ AddVideoMode (const struct VideoMode *vmode)
|
||||||
vmode->name);
|
vmode->name);
|
||||||
vmode2 = malloc(sizeof(struct VideoMode));
|
vmode2 = malloc(sizeof(struct VideoMode));
|
||||||
if (!vmode2)
|
if (!vmode2)
|
||||||
Sys_Error ("AddVideoMode: Memory Allocation Failure\n");
|
Sys_Error ("AddVideoMode: Memory Allocation Failure");
|
||||||
*vmode2 = *vmode;
|
*vmode2 = *vmode;
|
||||||
if (!FillScanRates(vmode2))
|
if (!FillScanRates(vmode2))
|
||||||
Die("%s:%d: Bad video mode `%s'\n", Opt_modedb, line, vmode2->name);
|
Die("%s:%d: Bad video mode `%s'\n", Opt_modedb, line, vmode2->name);
|
||||||
|
|
|
@ -26,33 +26,33 @@
|
||||||
#define YY_NO_UNPUT
|
#define YY_NO_UNPUT
|
||||||
|
|
||||||
struct keyword {
|
struct keyword {
|
||||||
const char *name;
|
const char *name;
|
||||||
int token;
|
int token;
|
||||||
int value;
|
int value;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct keyword keywords[] = {
|
static struct keyword keywords[] = {
|
||||||
{ "mode", MODE, 0 },
|
{ "mode", MODE, 0 },
|
||||||
{ "geometry", GEOMETRY, 0 },
|
{ "geometry", GEOMETRY, 0 },
|
||||||
{ "timings", TIMINGS, 0 },
|
{ "timings", TIMINGS, 0 },
|
||||||
{ "hsync", HSYNC, 0 },
|
{ "hsync", HSYNC, 0 },
|
||||||
{ "vsync", VSYNC, 0 },
|
{ "vsync", VSYNC, 0 },
|
||||||
{ "csync", CSYNC, 0 },
|
{ "csync", CSYNC, 0 },
|
||||||
{ "gsync", GSYNC, 0 },
|
{ "gsync", GSYNC, 0 },
|
||||||
{ "extsync", EXTSYNC, 0 },
|
{ "extsync", EXTSYNC, 0 },
|
||||||
{ "bcast", BCAST, 0 },
|
{ "bcast", BCAST, 0 },
|
||||||
{ "laced", LACED, 0 },
|
{ "laced", LACED, 0 },
|
||||||
{ "double", DOUBLE, 0 },
|
{ "double", DOUBLE, 0 },
|
||||||
{ "rgba", RGBA, 0 },
|
{ "rgba", RGBA, 0 },
|
||||||
{ "nonstd", NONSTD, 0 },
|
{ "nonstd", NONSTD, 0 },
|
||||||
{ "accel", ACCEL, 0 },
|
{ "accel", ACCEL, 0 },
|
||||||
{ "grayscale", GRAYSCALE, 0 },
|
{ "grayscale", GRAYSCALE, 0 },
|
||||||
{ "endmode", ENDMODE, 0 },
|
{ "endmode", ENDMODE, 0 },
|
||||||
{ "low", POLARITY, LOW },
|
{ "low", POLARITY, LOW },
|
||||||
{ "high", POLARITY, HIGH },
|
{ "high", POLARITY, HIGH },
|
||||||
{ "false", BOOLEAN, FALSE },
|
{ "false", BOOLEAN, FALSE },
|
||||||
{ "true", BOOLEAN, TRUE },
|
{ "true", BOOLEAN, TRUE },
|
||||||
{ "", -1, 0 }
|
{ "", -1, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
int line = 1;
|
int line = 1;
|
||||||
|
@ -60,40 +60,40 @@ int line = 1;
|
||||||
|
|
||||||
void yyerror(const char *s)
|
void yyerror(const char *s)
|
||||||
{
|
{
|
||||||
Die("%s:%d: %s\n", Opt_modedb, line, s);
|
Die("%s:%d: %s", Opt_modedb, line, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int yywrap(void)
|
int yywrap(void)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int FindToken(const char *s)
|
static int FindToken(const char *s)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; keywords[i].token > 0; i++)
|
for (i = 0; keywords[i].token > 0; i++)
|
||||||
if (!strcasecmp(s, keywords[i].name)) {
|
if (!strcasecmp(s, keywords[i].name)) {
|
||||||
yylval.int_val = keywords[i].value;
|
yylval.int_val = keywords[i].value;
|
||||||
return keywords[i].token;
|
return keywords[i].token;
|
||||||
}
|
}
|
||||||
Die("%s:%d: Unknown keyword `%s'\n", Opt_modedb, line, s);
|
Die("%s:%d: Unknown keyword `%s'", Opt_modedb, line, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const char *CopyString(const char *s)
|
static const char *CopyString(const char *s)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
char *s2;
|
char *s2;
|
||||||
|
|
||||||
len = strlen(s)-2;
|
len = strlen(s)-2;
|
||||||
if (!(s2 = malloc(len+1)))
|
if (!(s2 = malloc(len+1)))
|
||||||
Die("No memory\n");
|
Die("No memory");
|
||||||
strncpy(s2, s+1, len);
|
strncpy(s2, s+1, len);
|
||||||
s2[len] = '\0';
|
s2[len] = '\0';
|
||||||
return s2;
|
return s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,17 +110,17 @@ junk .
|
||||||
|
|
||||||
{keyword} {
|
{keyword} {
|
||||||
return FindToken(yytext);
|
return FindToken(yytext);
|
||||||
}
|
}
|
||||||
|
|
||||||
{number} {
|
{number} {
|
||||||
yylval.int_val = strtoul(yytext, NULL, 0);
|
yylval.int_val = strtoul(yytext, NULL, 0);
|
||||||
return NUMBER;
|
return NUMBER;
|
||||||
}
|
}
|
||||||
|
|
||||||
{string} {
|
{string} {
|
||||||
yylval.string = CopyString(yytext);
|
yylval.string = CopyString(yytext);
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
{comment}$ break;
|
{comment}$ break;
|
||||||
|
|
||||||
|
@ -129,10 +129,10 @@ junk .
|
||||||
\n {
|
\n {
|
||||||
line++;
|
line++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
{junk} {
|
{junk} {
|
||||||
Die("%s:%d: Invalid token `%s'\n", Opt_modedb, line, yytext);
|
Die("%s:%d: Invalid token `%s'", Opt_modedb, line, yytext);
|
||||||
}
|
}
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
|
@ -757,8 +757,8 @@ AppActivate (BOOL fActive, BOOL minimize)
|
||||||
if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN) !=
|
if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN) !=
|
||||||
DISP_CHANGE_SUCCESSFUL) {
|
DISP_CHANGE_SUCCESSFUL) {
|
||||||
IN_ShowMouse ();
|
IN_ShowMouse ();
|
||||||
Sys_Error ("Couldn't set fullscreen DIB mode\n(try "
|
Sys_Error ("Couldn't set fullscreen DIB mode\n"
|
||||||
"upgrading your video drivers)\r\n (%lx)",
|
"(try upgrading your video drivers)\n (%lx)",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
ShowWindow (mainwindow, SW_SHOWNORMAL);
|
ShowWindow (mainwindow, SW_SHOWNORMAL);
|
||||||
|
|
|
@ -584,9 +584,9 @@ IN_LL_Init (void)
|
||||||
{
|
{
|
||||||
// open the display
|
// open the display
|
||||||
if (!x_disp)
|
if (!x_disp)
|
||||||
Sys_Error ("IN: No display!!\n");
|
Sys_Error ("IN: No display!!");
|
||||||
if (!x_win)
|
if (!x_win)
|
||||||
Sys_Error ("IN: No window!!\n");
|
Sys_Error ("IN: No window!!");
|
||||||
|
|
||||||
X11_OpenDisplay (); // call to increment the reference counter
|
X11_OpenDisplay (); // call to increment the reference counter
|
||||||
|
|
||||||
|
|
|
@ -116,13 +116,13 @@ QFGL_ExtensionAddress (const char *name)
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
#if defined(HAVE_DLOPEN)
|
#if defined(HAVE_DLOPEN)
|
||||||
if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
if (!(handle = dlopen (gl_driver->string, RTLD_NOW))) {
|
||||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n",
|
Sys_Error ("Couldn't load OpenGL library %s: %s",
|
||||||
gl_driver->string, dlerror ());
|
gl_driver->string, dlerror ());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
if (!(handle = LoadLibrary (gl_driver->string))) {
|
if (!(handle = LoadLibrary (gl_driver->string))) {
|
||||||
Sys_Error ("Couldn't load OpenGL library %s!\n",
|
Sys_Error ("Couldn't load OpenGL library %s!",
|
||||||
gl_driver->string);
|
gl_driver->string);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,33 +69,33 @@ VID_GetWindowSize (int def_w, int def_h)
|
||||||
|
|
||||||
if ((pnum = COM_CheckParm ("-width"))) {
|
if ((pnum = COM_CheckParm ("-width"))) {
|
||||||
if (pnum >= com_argc - 1)
|
if (pnum >= com_argc - 1)
|
||||||
Sys_Error ("VID: -width <width>\n");
|
Sys_Error ("VID: -width <width>");
|
||||||
|
|
||||||
Cvar_Set (vid_width, com_argv[pnum + 1]);
|
Cvar_Set (vid_width, com_argv[pnum + 1]);
|
||||||
|
|
||||||
if (!vid_width->int_val)
|
if (!vid_width->int_val)
|
||||||
Sys_Error ("VID: Bad window width\n");
|
Sys_Error ("VID: Bad window width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pnum = COM_CheckParm ("-height"))) {
|
if ((pnum = COM_CheckParm ("-height"))) {
|
||||||
if (pnum >= com_argc - 1)
|
if (pnum >= com_argc - 1)
|
||||||
Sys_Error ("VID: -height <height>\n");
|
Sys_Error ("VID: -height <height>");
|
||||||
|
|
||||||
Cvar_Set (vid_height, com_argv[pnum + 1]);
|
Cvar_Set (vid_height, com_argv[pnum + 1]);
|
||||||
|
|
||||||
if (!vid_height->int_val)
|
if (!vid_height->int_val)
|
||||||
Sys_Error ("VID: Bad window height\n");
|
Sys_Error ("VID: Bad window height");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pnum = COM_CheckParm ("-winsize"))) {
|
if ((pnum = COM_CheckParm ("-winsize"))) {
|
||||||
if (pnum >= com_argc - 2)
|
if (pnum >= com_argc - 2)
|
||||||
Sys_Error ("VID: -winsize <width> <height>\n");
|
Sys_Error ("VID: -winsize <width> <height>");
|
||||||
|
|
||||||
Cvar_Set (vid_width, com_argv[pnum + 1]);
|
Cvar_Set (vid_width, com_argv[pnum + 1]);
|
||||||
Cvar_Set (vid_height, com_argv[pnum + 2]);
|
Cvar_Set (vid_height, com_argv[pnum + 2]);
|
||||||
|
|
||||||
if (!vid_width->int_val || !vid_height->int_val)
|
if (!vid_width->int_val || !vid_height->int_val)
|
||||||
Sys_Error ("VID: Bad window width/height\n");
|
Sys_Error ("VID: Bad window width/height");
|
||||||
}
|
}
|
||||||
|
|
||||||
Cvar_SetFlags (vid_width, vid_width->flags | CVAR_ROM);
|
Cvar_SetFlags (vid_width, vid_width->flags | CVAR_ROM);
|
||||||
|
|
|
@ -320,7 +320,7 @@ VID_Init (unsigned char *palette)
|
||||||
fc = qf_fxMesaCreateContext (0, findres (&scr_width, &scr_height),
|
fc = qf_fxMesaCreateContext (0, findres (&scr_width, &scr_height),
|
||||||
GR_REFRESH_75Hz, attribs);
|
GR_REFRESH_75Hz, attribs);
|
||||||
if (!fc)
|
if (!fc)
|
||||||
Sys_Error ("Unable to create 3DFX context.\n");
|
Sys_Error ("Unable to create 3DFX context.");
|
||||||
|
|
||||||
qf_fxMesaMakeCurrent (fc);
|
qf_fxMesaMakeCurrent (fc);
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ void
|
||||||
GL_Pre_Init (void)
|
GL_Pre_Init (void)
|
||||||
{
|
{
|
||||||
if (!GLF_Init()) {
|
if (!GLF_Init()) {
|
||||||
Sys_Error("Can't init video.\n");
|
Sys_Error("Can't init video.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ VID_InitBuffers (void)
|
||||||
// Allocate the new screen buffer
|
// Allocate the new screen buffer
|
||||||
vid.conbuffer = vid.buffer = calloc (buffersize, 1);
|
vid.conbuffer = vid.buffer = calloc (buffersize, 1);
|
||||||
if (!vid.conbuffer) {
|
if (!vid.conbuffer) {
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Allocate the new z-buffer
|
// Allocate the new z-buffer
|
||||||
|
@ -81,7 +81,7 @@ VID_InitBuffers (void)
|
||||||
if (!vid.zbuffer) {
|
if (!vid.zbuffer) {
|
||||||
free (vid.buffer);
|
free (vid.buffer);
|
||||||
vid.conbuffer = vid.buffer = NULL;
|
vid.conbuffer = vid.buffer = NULL;
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
}
|
}
|
||||||
// Allocate the new surface cache; free the z-buffer if we fail
|
// Allocate the new surface cache; free the z-buffer if we fail
|
||||||
vid.surfcache = calloc (cachesize, 1);
|
vid.surfcache = calloc (cachesize, 1);
|
||||||
|
@ -90,7 +90,7 @@ VID_InitBuffers (void)
|
||||||
free (vid.zbuffer);
|
free (vid.zbuffer);
|
||||||
vid.conbuffer = vid.buffer = NULL;
|
vid.conbuffer = vid.buffer = NULL;
|
||||||
vid.zbuffer = NULL;
|
vid.zbuffer = NULL;
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vid.init_caches)
|
if (vid.init_caches)
|
||||||
|
|
|
@ -198,7 +198,7 @@ VID_MakeColormaps (int fullbrights, byte *pal)
|
||||||
vid.colormap16 = malloc (256*VID_GRADES * sizeof (short));
|
vid.colormap16 = malloc (256*VID_GRADES * sizeof (short));
|
||||||
vid.colormap32 = malloc (256*VID_GRADES * sizeof (int));
|
vid.colormap32 = malloc (256*VID_GRADES * sizeof (int));
|
||||||
if (!vid.colormap8 || !vid.colormap16 || !vid.colormap32)
|
if (!vid.colormap8 || !vid.colormap16 || !vid.colormap32)
|
||||||
Sys_Error ("VID_MakeColormaps: Memory Allocation Failure\n");
|
Sys_Error ("VID_MakeColormaps: Memory Allocation Failure");
|
||||||
VID_MakeColormap8(vid.colormap8, pal);
|
VID_MakeColormap8(vid.colormap8, pal);
|
||||||
VID_MakeColormap16(vid.colormap16, pal);
|
VID_MakeColormap16(vid.colormap16, pal);
|
||||||
VID_MakeColormap32(vid.colormap32, pal);
|
VID_MakeColormap32(vid.colormap32, pal);
|
||||||
|
@ -238,7 +238,7 @@ VID_InitBuffers (void)
|
||||||
// Allocate the new screen buffer
|
// Allocate the new screen buffer
|
||||||
vid.conbuffer = vid.buffer = calloc (buffersize, 1);
|
vid.conbuffer = vid.buffer = calloc (buffersize, 1);
|
||||||
if (!vid.conbuffer) {
|
if (!vid.conbuffer) {
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Allocate the new z-buffer
|
// Allocate the new z-buffer
|
||||||
|
@ -246,7 +246,7 @@ VID_InitBuffers (void)
|
||||||
if (!vid.zbuffer) {
|
if (!vid.zbuffer) {
|
||||||
free (vid.buffer);
|
free (vid.buffer);
|
||||||
vid.conbuffer = vid.buffer = NULL;
|
vid.conbuffer = vid.buffer = NULL;
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
}
|
}
|
||||||
// Allocate the new surface cache; free the z-buffer if we fail
|
// Allocate the new surface cache; free the z-buffer if we fail
|
||||||
vid.surfcache = calloc (cachesize, 1);
|
vid.surfcache = calloc (cachesize, 1);
|
||||||
|
@ -254,7 +254,7 @@ VID_InitBuffers (void)
|
||||||
free (vid.buffer);
|
free (vid.buffer);
|
||||||
free (vid.zbuffer);
|
free (vid.zbuffer);
|
||||||
vid.zbuffer = NULL;
|
vid.zbuffer = NULL;
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vid.init_caches)
|
if (vid.init_caches)
|
||||||
|
|
|
@ -228,7 +228,7 @@ VID_SetVESAPalette (viddef_t *lvid, vmode_t * pcurrentmode, unsigned char *pal)
|
||||||
dos_int86 (0x10);
|
dos_int86 (0x10);
|
||||||
|
|
||||||
if (regs.x.ax != 0x4f)
|
if (regs.x.ax != 0x4f)
|
||||||
Sys_Error ("Unable to load VESA palette\n");
|
Sys_Error ("Unable to load VESA palette");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ loadpalette (unsigned short *red, unsigned short *green, unsigned short *blue)
|
||||||
cmap.transp = NULL;
|
cmap.transp = NULL;
|
||||||
cmap.start = 0;
|
cmap.start = 0;
|
||||||
if (-1 == ioctl(fb_fd, FBIOPUTCMAP, (void *)&cmap))
|
if (-1 == ioctl(fb_fd, FBIOPUTCMAP, (void *)&cmap))
|
||||||
Sys_Error("ioctl FBIOPUTCMAP %s\n", strerror(errno));
|
Sys_Error("ioctl FBIOPUTCMAP %s", strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -377,21 +377,21 @@ VID_SetMode (const char *name, unsigned char *palette)
|
||||||
ConvertFromVideoMode(¤t_mode, &var);
|
ConvertFromVideoMode(¤t_mode, &var);
|
||||||
err = ioctl(fb_fd, FBIOPUT_VSCREENINFO, &var);
|
err = ioctl(fb_fd, FBIOPUT_VSCREENINFO, &var);
|
||||||
if (err)
|
if (err)
|
||||||
Sys_Error ("Video mode failed: %s\n", name);
|
Sys_Error ("Video mode failed: %s", name);
|
||||||
ConvertToVideoMode(&var, ¤t_mode);
|
ConvertToVideoMode(&var, ¤t_mode);
|
||||||
current_mode.name = current_name;
|
current_mode.name = current_name;
|
||||||
VID_SetPalette (palette);
|
VID_SetPalette (palette);
|
||||||
|
|
||||||
err = ioctl(fb_fd, FBIOGET_FSCREENINFO, &fix);
|
err = ioctl(fb_fd, FBIOGET_FSCREENINFO, &fix);
|
||||||
if (err)
|
if (err)
|
||||||
Sys_Error ("Video mode failed: %s\n", name);
|
Sys_Error ("Video mode failed: %s", name);
|
||||||
smem_start = (unsigned long)fix.smem_start & PAGE_MASK;
|
smem_start = (unsigned long)fix.smem_start & PAGE_MASK;
|
||||||
smem_offset = (unsigned long)fix.smem_start & ~PAGE_MASK;
|
smem_offset = (unsigned long)fix.smem_start & ~PAGE_MASK;
|
||||||
fb_map_length = (smem_offset+fix.smem_len+~PAGE_MASK) & PAGE_MASK;
|
fb_map_length = (smem_offset+fix.smem_len+~PAGE_MASK) & PAGE_MASK;
|
||||||
fb_map_addr = (char *)mmap(0, fb_map_length, PROT_WRITE, MAP_SHARED,
|
fb_map_addr = (char *)mmap(0, fb_map_length, PROT_WRITE, MAP_SHARED,
|
||||||
fb_fd, 0);
|
fb_fd, 0);
|
||||||
if (!fb_map_addr)
|
if (!fb_map_addr)
|
||||||
Sys_Error ("This mode isn't hapnin'\n");
|
Sys_Error ("This mode isn't hapnin'");
|
||||||
vid.direct = framebuffer_ptr = fb_map_addr;
|
vid.direct = framebuffer_ptr = fb_map_addr;
|
||||||
|
|
||||||
// alloc screen buffer, z-buffer, and surface cache
|
// alloc screen buffer, z-buffer, and surface cache
|
||||||
|
@ -442,14 +442,14 @@ fb_switch_init (void)
|
||||||
sigaction(SIGUSR2, &act, 0);
|
sigaction(SIGUSR2, &act, 0);
|
||||||
|
|
||||||
if (ioctl(tty_fd, VT_GETMODE, &vtmode)) {
|
if (ioctl(tty_fd, VT_GETMODE, &vtmode)) {
|
||||||
Sys_Error("ioctl VT_GETMODE: %s\n", strerror(errno));
|
Sys_Error("ioctl VT_GETMODE: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
vtmode.mode = VT_PROCESS;
|
vtmode.mode = VT_PROCESS;
|
||||||
vtmode.waitv = 0;
|
vtmode.waitv = 0;
|
||||||
vtmode.relsig = SIGUSR1;
|
vtmode.relsig = SIGUSR1;
|
||||||
vtmode.acqsig = SIGUSR2;
|
vtmode.acqsig = SIGUSR2;
|
||||||
if (ioctl(tty_fd, VT_SETMODE, &vtmode)) {
|
if (ioctl(tty_fd, VT_SETMODE, &vtmode)) {
|
||||||
Sys_Error("ioctl VT_SETMODE: %s\n", strerror(errno));
|
Sys_Error("ioctl VT_SETMODE: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,10 +473,10 @@ VID_Init (unsigned char *palette)
|
||||||
|
|
||||||
fb_fd = open(fbname, O_RDWR);
|
fb_fd = open(fbname, O_RDWR);
|
||||||
if (fb_fd < 0)
|
if (fb_fd < 0)
|
||||||
Sys_Error ("failed to open fb device\n");
|
Sys_Error ("failed to open fb device");
|
||||||
|
|
||||||
if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &orig_var))
|
if (ioctl(fb_fd, FBIOGET_VSCREENINFO, &orig_var))
|
||||||
Sys_Error ("failed to get var screen info\n");
|
Sys_Error ("failed to get var screen info");
|
||||||
|
|
||||||
fb_switch_init();
|
fb_switch_init();
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ VID_Init (unsigned char *palette)
|
||||||
/* Set vid parameters */
|
/* Set vid parameters */
|
||||||
vmode = FindVideoMode(modestr);
|
vmode = FindVideoMode(modestr);
|
||||||
if (!vmode)
|
if (!vmode)
|
||||||
Sys_Error("no video mode %s\n", modestr);
|
Sys_Error("no video mode %s", modestr);
|
||||||
current_mode = *vmode;
|
current_mode = *vmode;
|
||||||
ioctl(tty_fd, KDSETMODE, KD_GRAPHICS);
|
ioctl(tty_fd, KDSETMODE, KD_GRAPHICS);
|
||||||
VID_SetMode (current_mode.name, palette);
|
VID_SetMode (current_mode.name, palette);
|
||||||
|
|
|
@ -180,8 +180,7 @@ VID_Init (unsigned char *palette)
|
||||||
|
|
||||||
x_visinfo = qfglXChooseVisual (x_disp, x_screen, attrib);
|
x_visinfo = qfglXChooseVisual (x_disp, x_screen, attrib);
|
||||||
if (!x_visinfo) {
|
if (!x_visinfo) {
|
||||||
Sys_Error ("Error couldn't get an RGB, Double-buffered, Depth "
|
Sys_Error ("Error couldn't get an RGB, Double-buffered, Depth visual");
|
||||||
"visual\n");
|
|
||||||
}
|
}
|
||||||
x_vis = x_visinfo->visual;
|
x_vis = x_visinfo->visual;
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@ VID_AllocBuffers (int width, int height)
|
||||||
// Allocate the new z-buffer
|
// Allocate the new z-buffer
|
||||||
d_pzbuffer = calloc (zbuffersize, 1);
|
d_pzbuffer = calloc (zbuffersize, 1);
|
||||||
if (!d_pzbuffer) {
|
if (!d_pzbuffer) {
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Allocate the new surface cache; free the z-buffer if we fail
|
// Allocate the new surface cache; free the z-buffer if we fail
|
||||||
|
@ -258,7 +258,7 @@ VID_AllocBuffers (int width, int height)
|
||||||
if (!vid_surfcache) {
|
if (!vid_surfcache) {
|
||||||
free (d_pzbuffer);
|
free (d_pzbuffer);
|
||||||
d_pzbuffer = NULL;
|
d_pzbuffer = NULL;
|
||||||
Sys_Error ("Not enough memory for video mode\n");
|
Sys_Error ("Not enough memory for video mode");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
vid_surfcachesize = cachesize;
|
vid_surfcachesize = cachesize;
|
||||||
|
|
|
@ -109,7 +109,7 @@ VID_Init (unsigned char *palette)
|
||||||
|
|
||||||
// Initialize display
|
// Initialize display
|
||||||
if (!(screen = SDL_SetVideoMode (vid.width, vid.height, 8, flags)))
|
if (!(screen = SDL_SetVideoMode (vid.width, vid.height, 8, flags)))
|
||||||
Sys_Error ("VID: Couldn't set video mode: %s\n", SDL_GetError ());
|
Sys_Error ("VID: Couldn't set video mode: %s", SDL_GetError ());
|
||||||
VID_InitGamma (palette);
|
VID_InitGamma (palette);
|
||||||
VID_SetPalette (palette);
|
VID_SetPalette (palette);
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ VID_Init (unsigned char *palette)
|
||||||
// Initialize display
|
// Initialize display
|
||||||
if (!(screen = SDL_SetVideoMode (vid.width, vid.height,
|
if (!(screen = SDL_SetVideoMode (vid.width, vid.height,
|
||||||
vid_bitdepth->int_val, flags)))
|
vid_bitdepth->int_val, flags)))
|
||||||
Sys_Error ("VID: Couldn't set video mode: %s\n", SDL_GetError ());
|
Sys_Error ("VID: Couldn't set video mode: %s", SDL_GetError ());
|
||||||
VID_InitGamma (palette);
|
VID_InitGamma (palette);
|
||||||
VID_SetPalette (palette);
|
VID_SetPalette (palette);
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ VID_Init (unsigned char *palette)
|
||||||
0x0000FF00, 0x00FF0000, 0x00000000);
|
0x0000FF00, 0x00FF0000, 0x00000000);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Sys_Error ("VID_Init: unsupported bit depth\n");
|
Sys_Error ("VID_Init: unsupported bit depth");
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we know everything we need to know about the buffer
|
// now we know everything we need to know about the buffer
|
||||||
|
|
|
@ -165,7 +165,7 @@ VID_Init (unsigned char *palette)
|
||||||
|
|
||||||
// Initialize the SDL library
|
// Initialize the SDL library
|
||||||
if (SDL_Init (SDL_INIT_VIDEO) < 0)
|
if (SDL_Init (SDL_INIT_VIDEO) < 0)
|
||||||
Sys_Error ("Couldn't initialize SDL: %s\n", SDL_GetError ());
|
Sys_Error ("Couldn't initialize SDL: %s", SDL_GetError ());
|
||||||
|
|
||||||
// Check if we want fullscreen
|
// Check if we want fullscreen
|
||||||
if (vid_fullscreen->value) {
|
if (vid_fullscreen->value) {
|
||||||
|
@ -190,7 +190,7 @@ VID_Init (unsigned char *palette)
|
||||||
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 1);
|
SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 1);
|
||||||
|
|
||||||
if (!(screen = SDL_SetVideoMode (scr_width, scr_height, 8, flags))) {
|
if (!(screen = SDL_SetVideoMode (scr_width, scr_height, 8, flags))) {
|
||||||
Sys_Error ("Couldn't set video mode: %s\n", SDL_GetError ());
|
Sys_Error ("Couldn't set video mode: %s", SDL_GetError ());
|
||||||
SDL_Quit ();
|
SDL_Quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -267,7 +267,7 @@ VID_InitModes (void)
|
||||||
num_modes = vga_lastmodenumber () + 1;
|
num_modes = vga_lastmodenumber () + 1;
|
||||||
modes = malloc (num_modes * sizeof (vga_modeinfo));
|
modes = malloc (num_modes * sizeof (vga_modeinfo));
|
||||||
if (!modes)
|
if (!modes)
|
||||||
Sys_Error ("VID_InitModes: Memory Allocation Failure\n");
|
Sys_Error ("VID_InitModes: Memory Allocation Failure");
|
||||||
for (i = 0; i < num_modes; i++) {
|
for (i = 0; i < num_modes; i++) {
|
||||||
if (vga_hasmode (i)) {
|
if (vga_hasmode (i)) {
|
||||||
memcpy (&modes[i], vga_getmodeinfo (i), sizeof (vga_modeinfo));
|
memcpy (&modes[i], vga_getmodeinfo (i), sizeof (vga_modeinfo));
|
||||||
|
@ -399,7 +399,7 @@ VID_SetMode (int modenum, unsigned char *palette)
|
||||||
/* get goin' */
|
/* get goin' */
|
||||||
err = vga_setmode (current_mode);
|
err = vga_setmode (current_mode);
|
||||||
if (err) {
|
if (err) {
|
||||||
Sys_Error ("Video mode failed: %d\n", modenum);
|
Sys_Error ("Video mode failed: %d", modenum);
|
||||||
}
|
}
|
||||||
VID_SetPalette (palette);
|
VID_SetPalette (palette);
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ VID_SetMode (int modenum, unsigned char *palette)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!framebuffer_ptr) {
|
if (!framebuffer_ptr) {
|
||||||
Sys_Error ("This mode isn't hapnin'\n");
|
Sys_Error ("This mode isn't hapnin'");
|
||||||
}
|
}
|
||||||
|
|
||||||
vga_setpage (0);
|
vga_setpage (0);
|
||||||
|
@ -449,7 +449,7 @@ VID_Init (unsigned char *palette)
|
||||||
if (UseDisplay) {
|
if (UseDisplay) {
|
||||||
err = vga_init ();
|
err = vga_init ();
|
||||||
if (err)
|
if (err)
|
||||||
Sys_Error ("SVGALib failed to allocate a new VC\n");
|
Sys_Error ("SVGALib failed to allocate a new VC");
|
||||||
|
|
||||||
if (vga_runinbackground_version () == 1) {
|
if (vga_runinbackground_version () == 1) {
|
||||||
Con_Printf ("SVGALIB background support detected\n");
|
Con_Printf ("SVGALIB background support detected\n");
|
||||||
|
|
|
@ -210,7 +210,7 @@ VID_SetWindowedMode (int modenum)
|
||||||
NULL, NULL, global_hInstance, NULL);
|
NULL, NULL, global_hInstance, NULL);
|
||||||
|
|
||||||
if (!mainwindow)
|
if (!mainwindow)
|
||||||
Sys_Error ("Couldn't create DIB window (%lx)\r\n",GetLastError());
|
Sys_Error ("Couldn't create DIB window (%lx)",GetLastError());
|
||||||
|
|
||||||
// Center and show the window
|
// Center and show the window
|
||||||
CenterWindow (mainwindow, WindowRect.right - WindowRect.left,
|
CenterWindow (mainwindow, WindowRect.right - WindowRect.left,
|
||||||
|
@ -265,7 +265,7 @@ VID_SetFullDIBMode (int modenum)
|
||||||
|
|
||||||
if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN) !=
|
if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN) !=
|
||||||
DISP_CHANGE_SUCCESSFUL)
|
DISP_CHANGE_SUCCESSFUL)
|
||||||
Sys_Error ("Couldn't set fullscreen DIB mode (%lx)\r\n",
|
Sys_Error ("Couldn't set fullscreen DIB mode (%lx)",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ VID_SetFullDIBMode (int modenum)
|
||||||
global_hInstance, NULL);
|
global_hInstance, NULL);
|
||||||
|
|
||||||
if (!mainwindow)
|
if (!mainwindow)
|
||||||
Sys_Error ("Couldn't create DIB window (%lx)\r\n",GetLastError());
|
Sys_Error ("Couldn't create DIB window (%lx)",GetLastError());
|
||||||
|
|
||||||
ShowWindow (mainwindow, SW_SHOWDEFAULT);
|
ShowWindow (mainwindow, SW_SHOWDEFAULT);
|
||||||
UpdateWindow (mainwindow);
|
UpdateWindow (mainwindow);
|
||||||
|
@ -343,7 +343,7 @@ VID_SetMode (int modenum, unsigned char *palette)
|
||||||
|
|
||||||
if ((windowed && (modenum != 0)) ||
|
if ((windowed && (modenum != 0)) ||
|
||||||
(!windowed && (modenum < 1)) || (!windowed && (modenum >= nummodes))) {
|
(!windowed && (modenum < 1)) || (!windowed && (modenum >= nummodes))) {
|
||||||
Sys_Error ("Bad video mode\n");
|
Sys_Error ("Bad video mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
// so Con_Printfs don't mess us up by forcing vid and snd updates
|
// so Con_Printfs don't mess us up by forcing vid and snd updates
|
||||||
|
@ -690,7 +690,7 @@ VID_InitDIB (HINSTANCE hInstance)
|
||||||
wc.lpszClassName = "QuakeForge";
|
wc.lpszClassName = "QuakeForge";
|
||||||
|
|
||||||
if (!RegisterClass (&wc))
|
if (!RegisterClass (&wc))
|
||||||
Sys_Error ("Couldn't register window class (%lx)\r\n", GetLastError());
|
Sys_Error ("Couldn't register window class (%lx)", GetLastError());
|
||||||
|
|
||||||
modelist[0].type = MS_WINDOWED;
|
modelist[0].type = MS_WINDOWED;
|
||||||
|
|
||||||
|
@ -1069,7 +1069,7 @@ VID_Init (unsigned char *palette)
|
||||||
ReleaseDC (mainwindow, maindc);
|
ReleaseDC (mainwindow, maindc);
|
||||||
Sys_Error("Could not initialize GL (wglCreateContext failed).\n\nMake "
|
Sys_Error("Could not initialize GL (wglCreateContext failed).\n\nMake "
|
||||||
"sure you in are 65535 color mode, and try running -window. "
|
"sure you in are 65535 color mode, and try running -window. "
|
||||||
"\nError code: (%lx)\r\n", lasterror);
|
"\nError code: (%lx)", lasterror);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qf_wglMakeCurrent (maindc, baseRC)) {
|
if (!qf_wglMakeCurrent (maindc, baseRC)) {
|
||||||
|
@ -1078,7 +1078,7 @@ VID_Init (unsigned char *palette)
|
||||||
qf_wglDeleteContext (baseRC);
|
qf_wglDeleteContext (baseRC);
|
||||||
if (maindc && mainwindow)
|
if (maindc && mainwindow)
|
||||||
ReleaseDC (mainwindow, maindc);
|
ReleaseDC (mainwindow, maindc);
|
||||||
Sys_Error ("wglMakeCurrent failed (%lx)\r\n", lasterror);
|
Sys_Error ("wglMakeCurrent failed (%lx)", lasterror);
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_Init ();
|
GL_Init ();
|
||||||
|
|
|
@ -302,7 +302,7 @@ ResetFrameBuffer (void)
|
||||||
mem = ((vid.width * pwidth + 7) & ~7) * vid.height;
|
mem = ((vid.width * pwidth + 7) & ~7) * vid.height;
|
||||||
buf = malloc (mem);
|
buf = malloc (mem);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
Sys_Error ("ResetFrameBuffer: Memory Allocation Failure\n");
|
Sys_Error ("ResetFrameBuffer: Memory Allocation Failure");
|
||||||
|
|
||||||
// allocate new screen buffer
|
// allocate new screen buffer
|
||||||
x_framebuffer[0] = XCreateImage (x_disp, x_vis, x_visinfo->depth,
|
x_framebuffer[0] = XCreateImage (x_disp, x_vis, x_visinfo->depth,
|
||||||
|
@ -310,7 +310,7 @@ ResetFrameBuffer (void)
|
||||||
vid.height, 32, 0);
|
vid.height, 32, 0);
|
||||||
|
|
||||||
if (!x_framebuffer[0]) {
|
if (!x_framebuffer[0]) {
|
||||||
Sys_Error ("VID: XCreateImage failed\n");
|
Sys_Error ("VID: XCreateImage failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,12 +339,12 @@ ResetSharedFrameBuffers (void)
|
||||||
size = x_framebuffer[frm]->bytes_per_line * x_framebuffer[frm]->height;
|
size = x_framebuffer[frm]->bytes_per_line * x_framebuffer[frm]->height;
|
||||||
|
|
||||||
if (size < minsize)
|
if (size < minsize)
|
||||||
Sys_Error ("VID: Window must use at least %d bytes\n", minsize);
|
Sys_Error ("VID: Window must use at least %d bytes", minsize);
|
||||||
|
|
||||||
key = random ();
|
key = random ();
|
||||||
x_shminfo[frm].shmid = shmget ((key_t) key, size, IPC_CREAT | 0777);
|
x_shminfo[frm].shmid = shmget ((key_t) key, size, IPC_CREAT | 0777);
|
||||||
if (x_shminfo[frm].shmid == -1)
|
if (x_shminfo[frm].shmid == -1)
|
||||||
Sys_Error ("VID: Could not get any shared memory (%s)\n",
|
Sys_Error ("VID: Could not get any shared memory (%s)",
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
|
|
||||||
// attach to the shared memory segment
|
// attach to the shared memory segment
|
||||||
|
@ -357,7 +357,7 @@ ResetSharedFrameBuffers (void)
|
||||||
|
|
||||||
// get the X server to attach to it
|
// get the X server to attach to it
|
||||||
if (!XShmAttach (x_disp, &x_shminfo[frm]))
|
if (!XShmAttach (x_disp, &x_shminfo[frm]))
|
||||||
Sys_Error ("VID: XShmAttach() failed\n");
|
Sys_Error ("VID: XShmAttach() failed");
|
||||||
XSync (x_disp, 0);
|
XSync (x_disp, 0);
|
||||||
shmctl (x_shminfo[frm].shmid, IPC_RMID, 0);
|
shmctl (x_shminfo[frm].shmid, IPC_RMID, 0);
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ VID_Init (unsigned char *palette)
|
||||||
// specify a visual id
|
// specify a visual id
|
||||||
if ((pnum = COM_CheckParm ("-visualid"))) {
|
if ((pnum = COM_CheckParm ("-visualid"))) {
|
||||||
if (pnum >= com_argc - 1)
|
if (pnum >= com_argc - 1)
|
||||||
Sys_Error ("VID: -visualid <id#>\n");
|
Sys_Error ("VID: -visualid <id#>");
|
||||||
template.visualid = atoi (com_argv[pnum + 1]);
|
template.visualid = atoi (com_argv[pnum + 1]);
|
||||||
template_mask = VisualIDMask;
|
template_mask = VisualIDMask;
|
||||||
} else { // If not specified, use default
|
} else { // If not specified, use default
|
||||||
|
@ -458,9 +458,9 @@ VID_Init (unsigned char *palette)
|
||||||
} else {
|
} else {
|
||||||
if (num_visuals == 0) {
|
if (num_visuals == 0) {
|
||||||
if (template_mask == VisualIDMask) {
|
if (template_mask == VisualIDMask) {
|
||||||
Sys_Error ("VID: Bad visual ID %ld\n", template.visualid);
|
Sys_Error ("VID: Bad visual ID %ld", template.visualid);
|
||||||
} else {
|
} else {
|
||||||
Sys_Error ("VID: No visuals at depth %d\n", template.depth);
|
Sys_Error ("VID: No visuals at depth %d", template.depth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -639,7 +639,7 @@ VID_Update (vrect_t *rects)
|
||||||
x_framebuffer[current_framebuffer],
|
x_framebuffer[current_framebuffer],
|
||||||
rects->x, rects->y, rects->x, rects->y,
|
rects->x, rects->y, rects->x, rects->y,
|
||||||
rects->width, rects->height, True)) {
|
rects->width, rects->height, True)) {
|
||||||
Sys_Error ("VID_Update: XShmPutImage failed\n");
|
Sys_Error ("VID_Update: XShmPutImage failed");
|
||||||
}
|
}
|
||||||
oktodraw = false;
|
oktodraw = false;
|
||||||
while (!oktodraw)
|
while (!oktodraw)
|
||||||
|
@ -653,7 +653,7 @@ VID_Update (vrect_t *rects)
|
||||||
if (XPutImage (x_disp, x_win, x_gc, x_framebuffer[0],
|
if (XPutImage (x_disp, x_win, x_gc, x_framebuffer[0],
|
||||||
rects->x, rects->y, rects->x, rects->y,
|
rects->x, rects->y, rects->x, rects->y,
|
||||||
rects->width, rects->height)) {
|
rects->width, rects->height)) {
|
||||||
Sys_Error ("VID_Update: XPutImage failed\n");
|
Sys_Error ("VID_Update: XPutImage failed");
|
||||||
}
|
}
|
||||||
rects = rects->pnext;
|
rects = rects->pnext;
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ Host_EndGame (const char *message, ...)
|
||||||
Host_ShutdownServer (false);
|
Host_ShutdownServer (false);
|
||||||
|
|
||||||
if (cls.state == ca_dedicated)
|
if (cls.state == ca_dedicated)
|
||||||
Sys_Error ("Host_EndGame: %s\n", string); // dedicated servers exit
|
Sys_Error ("Host_EndGame: %s", string); // dedicated servers exit
|
||||||
|
|
||||||
if (cls.demonum != -1)
|
if (cls.demonum != -1)
|
||||||
CL_NextDemo ();
|
CL_NextDemo ();
|
||||||
|
@ -175,7 +175,7 @@ Host_Error (const char *error, ...)
|
||||||
Host_ShutdownServer (false);
|
Host_ShutdownServer (false);
|
||||||
|
|
||||||
if (cls.state == ca_dedicated)
|
if (cls.state == ca_dedicated)
|
||||||
Sys_Error ("Host_Error: %s\n", string); // dedicated servers exit
|
Sys_Error ("Host_Error: %s", string); // dedicated servers exit
|
||||||
|
|
||||||
Con_Printf ("Host_Error: %s\n", string);
|
Con_Printf ("Host_Error: %s\n", string);
|
||||||
|
|
||||||
|
@ -730,21 +730,21 @@ Host_InitVCR (quakeparms_t *parms)
|
||||||
|
|
||||||
if (COM_CheckParm ("-playback")) {
|
if (COM_CheckParm ("-playback")) {
|
||||||
if (com_argc != 2)
|
if (com_argc != 2)
|
||||||
Sys_Error ("No other parameters allowed with -playback\n");
|
Sys_Error ("No other parameters allowed with -playback");
|
||||||
|
|
||||||
vcrFile = Qopen ("quake.vcr", "rbz");
|
vcrFile = Qopen ("quake.vcr", "rbz");
|
||||||
if (!vcrFile)
|
if (!vcrFile)
|
||||||
Sys_Error ("playback file not found\n");
|
Sys_Error ("playback file not found");
|
||||||
|
|
||||||
Qread (vcrFile, &i, sizeof (int));
|
Qread (vcrFile, &i, sizeof (int));
|
||||||
|
|
||||||
if (i != VCR_SIGNATURE)
|
if (i != VCR_SIGNATURE)
|
||||||
Sys_Error ("Invalid signature in vcr file\n");
|
Sys_Error ("Invalid signature in vcr file");
|
||||||
|
|
||||||
Qread (vcrFile, &com_argc, sizeof (int));
|
Qread (vcrFile, &com_argc, sizeof (int));
|
||||||
com_argv = malloc (com_argc * sizeof (char *));
|
com_argv = malloc (com_argc * sizeof (char *));
|
||||||
if (!com_argv)
|
if (!com_argv)
|
||||||
Sys_Error ("Host_InitVCR: Memory Allocation Failure\n");
|
Sys_Error ("Host_InitVCR: Memory Allocation Failure");
|
||||||
|
|
||||||
com_argv[0] = parms->argv[0];
|
com_argv[0] = parms->argv[0];
|
||||||
for (i = 0; i < com_argc; i++) {
|
for (i = 0; i < com_argc; i++) {
|
||||||
|
@ -752,7 +752,7 @@ Host_InitVCR (quakeparms_t *parms)
|
||||||
|
|
||||||
p = malloc (len);
|
p = malloc (len);
|
||||||
if (!p)
|
if (!p)
|
||||||
Sys_Error ("Host_InitVCR: Memory Allocation Failure\n");
|
Sys_Error ("Host_InitVCR: Memory Allocation Failure");
|
||||||
Qread (vcrFile, p, len);
|
Qread (vcrFile, p, len);
|
||||||
com_argv[i + 1] = p;
|
com_argv[i + 1] = p;
|
||||||
}
|
}
|
||||||
|
@ -841,7 +841,7 @@ CL_Init_Memory (void)
|
||||||
mem_base = malloc (mem_size);
|
mem_base = malloc (mem_size);
|
||||||
|
|
||||||
if (!mem_base)
|
if (!mem_base)
|
||||||
Sys_Error ("Can't allocate %d\n", mem_size);
|
Sys_Error ("Can't allocate %d", mem_size);
|
||||||
|
|
||||||
Sys_PageIn (mem_base, mem_size);
|
Sys_PageIn (mem_base, mem_size);
|
||||||
Memory_Init (mem_base, mem_size);
|
Memory_Init (mem_base, mem_size);
|
||||||
|
|
|
@ -98,7 +98,7 @@ locs_add (const vec3_t location, const char *name)
|
||||||
|
|
||||||
locations[num] = malloc (sizeof (location_t));
|
locations[num] = malloc (sizeof (location_t));
|
||||||
if (!locations[num])
|
if (!locations[num])
|
||||||
Sys_Error ("locs_add: Memory Allocation Failure\n");
|
Sys_Error ("locs_add: Memory Allocation Failure");
|
||||||
|
|
||||||
locations[num]->loc[0] = location[0];
|
locations[num]->loc[0] = location[0];
|
||||||
locations[num]->loc[1] = location[1];
|
locations[num]->loc[1] = location[1];
|
||||||
|
|
|
@ -347,7 +347,7 @@ BW_Init (void)
|
||||||
|
|
||||||
lowmem_buffer = dos_getmemory (LOWMEM_SIZE);
|
lowmem_buffer = dos_getmemory (LOWMEM_SIZE);
|
||||||
if (!lowmem_buffer)
|
if (!lowmem_buffer)
|
||||||
Sys_Error ("not enough low memory\n");
|
Sys_Error ("not enough low memory");
|
||||||
lowmem_bufoff = ptr2real (lowmem_buffer) & 0xf;
|
lowmem_bufoff = ptr2real (lowmem_buffer) & 0xf;
|
||||||
lowmem_bufseg = ptr2real (lowmem_buffer) >> 4;
|
lowmem_bufseg = ptr2real (lowmem_buffer) >> 4;
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ BW_Listen (qboolean state)
|
||||||
if (net_acceptsocket != -1)
|
if (net_acceptsocket != -1)
|
||||||
return;
|
return;
|
||||||
if ((net_acceptsocket = BW_OpenSocket (net_hostport)) == -1)
|
if ((net_acceptsocket = BW_OpenSocket (net_hostport)) == -1)
|
||||||
Sys_Error ("BW_Listen: Unable to open accept socket\n");
|
Sys_Error ("BW_Listen: Unable to open accept socket");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// disable listening
|
// disable listening
|
||||||
|
@ -583,7 +583,7 @@ BW_Broadcast (int s, byte * msg, int len)
|
||||||
writeInfo->remotePort = net_hostport;
|
writeInfo->remotePort = net_hostport;
|
||||||
writeInfo->dataLen = len;
|
writeInfo->dataLen = len;
|
||||||
if (len > NET_DATAGRAMSIZE)
|
if (len > NET_DATAGRAMSIZE)
|
||||||
Sys_Error ("BW UDP write packet too large: %u\n", len);
|
Sys_Error ("BW UDP write packet too large: %u", len);
|
||||||
Q_memcpy (writeInfo->data, msg, len);
|
Q_memcpy (writeInfo->data, msg, len);
|
||||||
writeInfo->data[len] = 0;
|
writeInfo->data[len] = 0;
|
||||||
regs.h.ah = 0x40;
|
regs.h.ah = 0x40;
|
||||||
|
@ -619,7 +619,7 @@ BW_Write (int s, byte * msg, int len, struct qsockaddr *to)
|
||||||
writeInfo->remotePort = ntohs (((struct sockaddr_in *) to)->sin_port);
|
writeInfo->remotePort = ntohs (((struct sockaddr_in *) to)->sin_port);
|
||||||
writeInfo->dataLen = len;
|
writeInfo->dataLen = len;
|
||||||
if (len > NET_DATAGRAMSIZE)
|
if (len > NET_DATAGRAMSIZE)
|
||||||
Sys_Error ("BW UDP write packet too large: %u\n", len);
|
Sys_Error ("BW UDP write packet too large: %u", len);
|
||||||
Q_memcpy (writeInfo->data, msg, len);
|
Q_memcpy (writeInfo->data, msg, len);
|
||||||
writeInfo->data[len] = 0;
|
writeInfo->data[len] = 0;
|
||||||
regs.h.ah = 0x40;
|
regs.h.ah = 0x40;
|
||||||
|
|
|
@ -198,13 +198,13 @@ 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
|
||||||
|
|
||||||
memcpy (sock->sendMessage, data->data, data->cursize);
|
memcpy (sock->sendMessage, data->data, data->cursize);
|
||||||
|
@ -323,10 +323,10 @@ 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",
|
Sys_Error ("Datagram_SendUnreliableMessage: message too big %u",
|
||||||
data->cursize);
|
data->cursize);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ Test_Poll (void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (MSG_ReadByte (net_message) != CCREP_PLAYER_INFO)
|
if (MSG_ReadByte (net_message) != CCREP_PLAYER_INFO)
|
||||||
Sys_Error ("Unexpected repsonse to Player Info request\n");
|
Sys_Error ("Unexpected repsonse to Player Info request");
|
||||||
|
|
||||||
playerNumber = MSG_ReadByte (net_message);
|
playerNumber = MSG_ReadByte (net_message);
|
||||||
strcpy (name, MSG_ReadString (net_message));
|
strcpy (name, MSG_ReadString (net_message));
|
||||||
|
|
|
@ -330,7 +330,7 @@ IPX_Listen (qboolean state)
|
||||||
if (net_acceptsocket != -1)
|
if (net_acceptsocket != -1)
|
||||||
return;
|
return;
|
||||||
if ((net_acceptsocket = IPX_OpenSocket (net_hostport)) == -1)
|
if ((net_acceptsocket = IPX_OpenSocket (net_hostport)) == -1)
|
||||||
Sys_Error ("IPX_Listen: Unable to open accept socket\n");
|
Sys_Error ("IPX_Listen: Unable to open accept socket");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// disable listening
|
// disable listening
|
||||||
|
@ -391,7 +391,7 @@ IPX_OpenSocket (int port)
|
||||||
}
|
}
|
||||||
|
|
||||||
// "this will NEVER happen"
|
// "this will NEVER happen"
|
||||||
Sys_Error ("IPX_OpenSocket: handle allocation failed\n");
|
Sys_Error ("IPX_OpenSocket: handle allocation failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ IPX_Read (int handle, byte * buf, int len, struct qsockaddr *addr)
|
||||||
|
|
||||||
ntohs (rcvbuf->header.length) - (sizeof (int) + sizeof (IPXheader));
|
ntohs (rcvbuf->header.length) - (sizeof (int) + sizeof (IPXheader));
|
||||||
if (len < copylen)
|
if (len < copylen)
|
||||||
Sys_Error ("IPX_Read: buffer too small (%d vs %d)\n", len, copylen);
|
Sys_Error ("IPX_Read: buffer too small (%d vs %d)", len, copylen);
|
||||||
Q_memcpy (buf, rcvbuf->data, copylen);
|
Q_memcpy (buf, rcvbuf->data, copylen);
|
||||||
|
|
||||||
// fill in the addr if they want it
|
// fill in the addr if they want it
|
||||||
|
|
|
@ -187,7 +187,7 @@ Loop_SendMessage (qsocket_t * sock, sizebuf_t *data)
|
||||||
bufferLength = &((qsocket_t *) sock->driverdata)->receiveMessageLength;
|
bufferLength = &((qsocket_t *) sock->driverdata)->receiveMessageLength;
|
||||||
|
|
||||||
if ((*bufferLength + data->cursize + 4) > NET_MAXMESSAGE)
|
if ((*bufferLength + data->cursize + 4) > NET_MAXMESSAGE)
|
||||||
Sys_Error ("Loop_SendMessage: overflow\n");
|
Sys_Error ("Loop_SendMessage: overflow");
|
||||||
|
|
||||||
buffer = ((qsocket_t *) sock->driverdata)->receiveMessage + *bufferLength;
|
buffer = ((qsocket_t *) sock->driverdata)->receiveMessage + *bufferLength;
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ NET_FreeQSocket (qsocket_t * sock)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!s)
|
if (!s)
|
||||||
Sys_Error ("NET_FreeQSocket: not active\n");
|
Sys_Error ("NET_FreeQSocket: not active");
|
||||||
}
|
}
|
||||||
|
|
||||||
// add it to free list
|
// add it to free list
|
||||||
|
|
|
@ -108,7 +108,7 @@ MPATH_Init (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((net_controlsocket = MPATH_OpenSocket (0)) == -1)
|
if ((net_controlsocket = MPATH_OpenSocket (0)) == -1)
|
||||||
Sys_Error ("MPATH_Init: Unable to open control socket\n");
|
Sys_Error ("MPATH_Init: Unable to open control socket");
|
||||||
|
|
||||||
((struct sockaddr_in *) &broadcastaddr)->sin_family = AF_INET;
|
((struct sockaddr_in *) &broadcastaddr)->sin_family = AF_INET;
|
||||||
((struct sockaddr_in *) &broadcastaddr)->sin_addr.s_addr = INADDR_BROADCAST;
|
((struct sockaddr_in *) &broadcastaddr)->sin_addr.s_addr = INADDR_BROADCAST;
|
||||||
|
@ -145,7 +145,7 @@ MPATH_Listen (qboolean state)
|
||||||
if (net_acceptsocket != -1)
|
if (net_acceptsocket != -1)
|
||||||
return;
|
return;
|
||||||
if ((net_acceptsocket = MPATH_OpenSocket (net_hostport)) == -1)
|
if ((net_acceptsocket = MPATH_OpenSocket (net_hostport)) == -1)
|
||||||
Sys_Error ("MPATH_Listen: Unable to open accept socket\n");
|
Sys_Error ("MPATH_Listen: Unable to open accept socket");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// disable listening
|
// disable listening
|
||||||
|
@ -318,7 +318,7 @@ MPATH_Broadcast (int socket, byte * buf, int len)
|
||||||
|
|
||||||
if (socket != net_broadcastsocket) {
|
if (socket != net_broadcastsocket) {
|
||||||
if (net_broadcastsocket != 0)
|
if (net_broadcastsocket != 0)
|
||||||
Sys_Error ("Attempted to use multiple broadcasts sockets\n");
|
Sys_Error ("Attempted to use multiple broadcasts sockets");
|
||||||
ret = MPATH_MakeSocketBroadcastCapable (socket);
|
ret = MPATH_MakeSocketBroadcastCapable (socket);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
Con_Printf ("Unable to make socket broadcast capable\n");
|
Con_Printf ("Unable to make socket broadcast capable\n");
|
||||||
|
|
|
@ -146,7 +146,7 @@ UDP_Init (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((net_controlsocket = UDP_OpenSocket (0)) == -1)
|
if ((net_controlsocket = UDP_OpenSocket (0)) == -1)
|
||||||
Sys_Error ("UDP_Init: Unable to open control socket\n");
|
Sys_Error ("UDP_Init: Unable to open control socket");
|
||||||
|
|
||||||
((struct sockaddr_in *) &broadcastaddr)->sin_family = AF_INET;
|
((struct sockaddr_in *) &broadcastaddr)->sin_family = AF_INET;
|
||||||
((struct sockaddr_in *) &broadcastaddr)->sin_addr.s_addr =
|
((struct sockaddr_in *) &broadcastaddr)->sin_addr.s_addr =
|
||||||
|
@ -181,7 +181,7 @@ UDP_Listen (qboolean state)
|
||||||
if (net_acceptsocket != -1)
|
if (net_acceptsocket != -1)
|
||||||
return;
|
return;
|
||||||
if ((net_acceptsocket = UDP_OpenSocket (net_hostport)) == -1)
|
if ((net_acceptsocket = UDP_OpenSocket (net_hostport)) == -1)
|
||||||
Sys_Error ("UDP_Listen: Unable to open accept socket\n");
|
Sys_Error ("UDP_Listen: Unable to open accept socket");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// disable listening
|
// disable listening
|
||||||
|
@ -306,7 +306,7 @@ UDP_CheckNewConnections (void)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (ioctl (net_acceptsocket, FIONREAD, &available) == -1)
|
if (ioctl (net_acceptsocket, FIONREAD, &available) == -1)
|
||||||
Sys_Error ("UDP: ioctlsocket (FIONREAD) failed\n");
|
Sys_Error ("UDP: ioctlsocket (FIONREAD) failed");
|
||||||
if (available)
|
if (available)
|
||||||
return net_acceptsocket;
|
return net_acceptsocket;
|
||||||
recvfrom (net_acceptsocket, buff, 0, 0, (struct sockaddr *) &from,
|
recvfrom (net_acceptsocket, buff, 0, 0, (struct sockaddr *) &from,
|
||||||
|
@ -347,7 +347,7 @@ UDP_Broadcast (int socket, byte * buf, int len)
|
||||||
|
|
||||||
if (socket != net_broadcastsocket) {
|
if (socket != net_broadcastsocket) {
|
||||||
if (net_broadcastsocket != 0)
|
if (net_broadcastsocket != 0)
|
||||||
Sys_Error ("Attempted to use multiple broadcasts sockets\n");
|
Sys_Error ("Attempted to use multiple broadcasts sockets");
|
||||||
ret = UDP_MakeSocketBroadcastCapable (socket);
|
ret = UDP_MakeSocketBroadcastCapable (socket);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
Con_Printf ("Unable to make socket broadcast capable\n");
|
Con_Printf ("Unable to make socket broadcast capable\n");
|
||||||
|
|
|
@ -73,7 +73,7 @@ VCR_ReadNext (void)
|
||||||
{
|
{
|
||||||
if (Qread (vcrFile, &next, sizeof (next)) == 0) {
|
if (Qread (vcrFile, &next, sizeof (next)) == 0) {
|
||||||
next.op = 255;
|
next.op = 255;
|
||||||
Sys_Error ("=== END OF PLAYBACK===\n");
|
Sys_Error ("=== END OF PLAYBACK===");
|
||||||
}
|
}
|
||||||
if (next.op < 1 || next.op > VCR_MAX_MESSAGE)
|
if (next.op < 1 || next.op > VCR_MAX_MESSAGE)
|
||||||
Sys_Error ("VCR_ReadNext: bad op");
|
Sys_Error ("VCR_ReadNext: bad op");
|
||||||
|
|
|
@ -279,7 +279,7 @@ WINS_Listen (qboolean state)
|
||||||
return;
|
return;
|
||||||
WINS_GetLocalAddress ();
|
WINS_GetLocalAddress ();
|
||||||
if ((net_acceptsocket = WINS_OpenSocket (net_hostport)) == -1)
|
if ((net_acceptsocket = WINS_OpenSocket (net_hostport)) == -1)
|
||||||
Sys_Error ("WINS_Listen: Unable to open accept socket\n");
|
Sys_Error ("WINS_Listen: Unable to open accept socket");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// disable listening
|
// disable listening
|
||||||
|
@ -455,7 +455,7 @@ WINS_Broadcast (int socket, byte * buf, int len)
|
||||||
|
|
||||||
if (socket != net_broadcastsocket) {
|
if (socket != net_broadcastsocket) {
|
||||||
if (net_broadcastsocket != 0)
|
if (net_broadcastsocket != 0)
|
||||||
Sys_Error ("Attempted to use multiple broadcasts sockets\n");
|
Sys_Error ("Attempted to use multiple broadcasts sockets");
|
||||||
WINS_GetLocalAddress ();
|
WINS_GetLocalAddress ();
|
||||||
ret = WINS_MakeSocketBroadcastCapable (socket);
|
ret = WINS_MakeSocketBroadcastCapable (socket);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
|
|
@ -156,7 +156,7 @@ WIPX_Listen (qboolean state)
|
||||||
if (net_acceptsocket != -1)
|
if (net_acceptsocket != -1)
|
||||||
return;
|
return;
|
||||||
if ((net_acceptsocket = WIPX_OpenSocket (net_hostport)) == -1)
|
if ((net_acceptsocket = WIPX_OpenSocket (net_hostport)) == -1)
|
||||||
Sys_Error ("WIPX_Listen: Unable to open accept socket\n");
|
Sys_Error ("WIPX_Listen: Unable to open accept socket");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// disable listening
|
// disable listening
|
||||||
|
@ -202,7 +202,7 @@ WIPX_OpenSocket (int port)
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sys_Error ("Winsock IPX bind failed\n");
|
Sys_Error ("Winsock IPX bind failed");
|
||||||
ErrorReturn:
|
ErrorReturn:
|
||||||
pclosesocket (newsocket);
|
pclosesocket (newsocket);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -241,7 +241,7 @@ WIPX_CheckNewConnections (void)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (pioctlsocket (ipxsocket[net_acceptsocket], FIONREAD, &available) == -1)
|
if (pioctlsocket (ipxsocket[net_acceptsocket], FIONREAD, &available) == -1)
|
||||||
Sys_Error ("WIPX: ioctlsocket (FIONREAD) failed\n");
|
Sys_Error ("WIPX: ioctlsocket (FIONREAD) failed");
|
||||||
if (available)
|
if (available)
|
||||||
return net_acceptsocket;
|
return net_acceptsocket;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -947,7 +947,7 @@ CL_TimeFrames_AddTimestamp (void)
|
||||||
((cl_timeframes_index / CL_TIMEFRAMES_ARRAYBLOCK) + 1) *
|
((cl_timeframes_index / CL_TIMEFRAMES_ARRAYBLOCK) + 1) *
|
||||||
CL_TIMEFRAMES_ARRAYBLOCK);
|
CL_TIMEFRAMES_ARRAYBLOCK);
|
||||||
if (cl_timeframes_array == NULL)
|
if (cl_timeframes_array == NULL)
|
||||||
Sys_Error ("Unable to allocate timeframes buffer\n");
|
Sys_Error ("Unable to allocate timeframes buffer");
|
||||||
cl_timeframes_array[cl_timeframes_index] = Sys_DoubleTime ();
|
cl_timeframes_array[cl_timeframes_index] = Sys_DoubleTime ();
|
||||||
cl_timeframes_index++;
|
cl_timeframes_index++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1412,7 +1412,7 @@ Host_Error (const char *error, ...)
|
||||||
if (host_initialized) {
|
if (host_initialized) {
|
||||||
longjmp (host_abort, 1);
|
longjmp (host_abort, 1);
|
||||||
} else {
|
} else {
|
||||||
Sys_Error ("Host_Error: %s\n", string);
|
Sys_Error ("Host_Error: %s", string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1638,7 +1638,7 @@ CL_Init_Memory (void)
|
||||||
mem_base = malloc (mem_size);
|
mem_base = malloc (mem_size);
|
||||||
|
|
||||||
if (!mem_base)
|
if (!mem_base)
|
||||||
Sys_Error ("Can't allocate %d\n", mem_size);
|
Sys_Error ("Can't allocate %d", mem_size);
|
||||||
|
|
||||||
Sys_PageIn (mem_base, mem_size);
|
Sys_PageIn (mem_base, mem_size);
|
||||||
Memory_Init (mem_base, mem_size);
|
Memory_Init (mem_base, mem_size);
|
||||||
|
|
|
@ -129,7 +129,7 @@ SL_Add (server_entry_t *start, char *ip, char *desc)
|
||||||
start->server = malloc (strlen (ip) + 1);
|
start->server = malloc (strlen (ip) + 1);
|
||||||
start->desc = malloc (strlen (desc ? desc : ip) + 1);
|
start->desc = malloc (strlen (desc ? desc : ip) + 1);
|
||||||
if (!start->server || !start->desc)
|
if (!start->server || !start->desc)
|
||||||
Sys_Error ("SL_Add: Memory Allocation Failure\n");
|
Sys_Error ("SL_Add: Memory Allocation Failure");
|
||||||
strcpy (start->server, ip);
|
strcpy (start->server, ip);
|
||||||
strcpy (start->desc, desc ? desc : ip);
|
strcpy (start->desc, desc ? desc : ip);
|
||||||
start->status = NULL;
|
start->status = NULL;
|
||||||
|
@ -146,7 +146,7 @@ SL_Add (server_entry_t *start, char *ip, char *desc)
|
||||||
p->next->server = malloc (strlen (ip) + 1);
|
p->next->server = malloc (strlen (ip) + 1);
|
||||||
p->next->desc = malloc (strlen (desc ? desc : ip) + 1);
|
p->next->desc = malloc (strlen (desc ? desc : ip) + 1);
|
||||||
if (!p->next->server || !p->next->desc)
|
if (!p->next->server || !p->next->desc)
|
||||||
Sys_Error ("SL_Add: Memory Allocation Failure\n");
|
Sys_Error ("SL_Add: Memory Allocation Failure");
|
||||||
|
|
||||||
strcpy (p->next->server, ip);
|
strcpy (p->next->server, ip);
|
||||||
strcpy (p->next->desc, desc ? desc : ip);
|
strcpy (p->next->desc, desc ? desc : ip);
|
||||||
|
@ -191,7 +191,7 @@ SL_InsB (server_entry_t *start, server_entry_t *place, char *ip, char *desc)
|
||||||
new->server = malloc (strlen (ip) + 1);
|
new->server = malloc (strlen (ip) + 1);
|
||||||
new->desc = malloc (strlen (desc) + 1);
|
new->desc = malloc (strlen (desc) + 1);
|
||||||
if (!new->server || !new->desc)
|
if (!new->server || !new->desc)
|
||||||
Sys_Error ("SL_InsB: Memory Allocation Failure\n");
|
Sys_Error ("SL_InsB: Memory Allocation Failure");
|
||||||
strcpy (new->server, ip);
|
strcpy (new->server, ip);
|
||||||
strcpy (new->desc, desc);
|
strcpy (new->desc, desc);
|
||||||
other = place->prev;
|
other = place->prev;
|
||||||
|
@ -637,7 +637,7 @@ SL_LoadF (VFile *f, server_entry_t *start)
|
||||||
len = gettoklen (line, 1, ' ');
|
len = gettoklen (line, 1, ' ');
|
||||||
addr = malloc (len + 1);
|
addr = malloc (len + 1);
|
||||||
if (!addr)
|
if (!addr)
|
||||||
Sys_Error ("SL_LoadF: Memory Allocation Failure\n");
|
Sys_Error ("SL_LoadF: Memory Allocation Failure");
|
||||||
strncpy (addr, &line[0], len);
|
strncpy (addr, &line[0], len);
|
||||||
addr[len] = '\0';
|
addr[len] = '\0';
|
||||||
if ((st = gettokstart (line, 2, ' '))) {
|
if ((st = gettokstart (line, 2, ' '))) {
|
||||||
|
|
|
@ -99,7 +99,7 @@ locs_add (const vec3_t location, const char *name)
|
||||||
|
|
||||||
locations[num] = malloc (sizeof (location_t));
|
locations[num] = malloc (sizeof (location_t));
|
||||||
if (!locations[num])
|
if (!locations[num])
|
||||||
Sys_Error ("locs_add: Memory Allocation Failure\n");
|
Sys_Error ("locs_add: Memory Allocation Failure");
|
||||||
|
|
||||||
locations[num]->loc[0] = location[0];
|
locations[num]->loc[0] = location[0];
|
||||||
locations[num]->loc[1] = location[1];
|
locations[num]->loc[1] = location[1];
|
||||||
|
|
|
@ -394,7 +394,7 @@ SV_Map_f (void)
|
||||||
SV_Printf ("Can't find %s\n", expanded);
|
SV_Printf ("Can't find %s\n", expanded);
|
||||||
// If curlevel == level, something is SCREWED! --KB
|
// If curlevel == level, something is SCREWED! --KB
|
||||||
if (strcaseequal (level, curlevel))
|
if (strcaseequal (level, curlevel))
|
||||||
Sys_Error ("map: cannot restart level\n");
|
Sys_Error ("map: cannot restart level");
|
||||||
else
|
else
|
||||||
Cbuf_AddText (va ("map %s", curlevel));
|
Cbuf_AddText (va ("map %s", curlevel));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1155,7 +1155,7 @@ SV_PrintIP (byte *ip)
|
||||||
if (!inet_ntop (AF_INET, ip, buf, INET_ADDRSTRLEN))
|
if (!inet_ntop (AF_INET, ip, buf, INET_ADDRSTRLEN))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
Sys_Error ("SV_CleanIPList: inet_ntop_failed. wtf?\n");
|
Sys_Error ("SV_CleanIPList: inet_ntop_failed. wtf?");
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1244,7 +1244,7 @@ SV_StringToFilter (const char *address, ipfilter_t *f)
|
||||||
|
|
||||||
s = strdup (address);
|
s = strdup (address);
|
||||||
if (!s)
|
if (!s)
|
||||||
Sys_Error ("SV_StringToFilter: memory allocation failure\n");
|
Sys_Error ("SV_StringToFilter: memory allocation failure");
|
||||||
|
|
||||||
// Parse out the mask (the /8 part)
|
// Parse out the mask (the /8 part)
|
||||||
if ((slash = strchr (s, '/'))) {
|
if ((slash = strchr (s, '/'))) {
|
||||||
|
@ -2384,7 +2384,7 @@ SV_Init_Memory (void)
|
||||||
mem_base = malloc (mem_size);
|
mem_base = malloc (mem_size);
|
||||||
|
|
||||||
if (!mem_base)
|
if (!mem_base)
|
||||||
Sys_Error ("Can't allocate %d\n", mem_size);
|
Sys_Error ("Can't allocate %d", mem_size);
|
||||||
|
|
||||||
Memory_Init (mem_base, mem_size);
|
Memory_Init (mem_base, mem_size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,7 +179,7 @@ SV_LoadProgs (void)
|
||||||
|
|
||||||
PR_LoadProgs (&sv_pr_state, sv_progs->string, MAX_EDICTS, 0);
|
PR_LoadProgs (&sv_pr_state, sv_progs->string, MAX_EDICTS, 0);
|
||||||
if (!sv_pr_state.progs)
|
if (!sv_pr_state.progs)
|
||||||
Sys_Error ("SV_LoadProgs: couldn't load %s\n", sv_progs->string);
|
Sys_Error ("SV_LoadProgs: couldn't load %s", sv_progs->string);
|
||||||
// progs engine needs these globals anyway
|
// progs engine needs these globals anyway
|
||||||
sv_globals.self = sv_pr_state.globals.self;
|
sv_globals.self = sv_pr_state.globals.self;
|
||||||
sv_globals.time = sv_pr_state.globals.time;
|
sv_globals.time = sv_pr_state.globals.time;
|
||||||
|
|
|
@ -228,7 +228,7 @@ SV_PrintToClient (client_t *cl, int level, const char *string)
|
||||||
free (buffer);
|
free (buffer);
|
||||||
buffer = malloc (buffer_size);
|
buffer = malloc (buffer_size);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
Sys_Error ("SV_PrintToClient: could not allocate %d bytes\n",
|
Sys_Error ("SV_PrintToClient: could not allocate %d bytes",
|
||||||
buffer_size);
|
buffer_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ LoadFile (char *filename, void **bufferptr)
|
||||||
length = FileLength (f);
|
length = FileLength (f);
|
||||||
buffer = malloc (length + 1);
|
buffer = malloc (length + 1);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
Sys_Error ("LoadFile: Memory Allocation Failure\n");
|
Sys_Error ("LoadFile: Memory Allocation Failure");
|
||||||
((char *) buffer)[length] = 0;
|
((char *) buffer)[length] = 0;
|
||||||
SafeRead (f, buffer, length);
|
SafeRead (f, buffer, length);
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
|
@ -349,7 +349,7 @@ new_label_name (void)
|
||||||
char *lname = malloc (len);
|
char *lname = malloc (len);
|
||||||
|
|
||||||
if (!lname)
|
if (!lname)
|
||||||
Sys_Error ("new_label_expr: Memory Allocation Failure\n");
|
Sys_Error ("new_label_expr: Memory Allocation Failure");
|
||||||
snprintf (lname, len, "$%s_%d", fname, lnum);
|
snprintf (lname, len, "$%s_%d", fname, lnum);
|
||||||
return lname;
|
return lname;
|
||||||
}
|
}
|
||||||
|
@ -602,7 +602,7 @@ do_op_string (int op, expr_t *e1, expr_t *e2)
|
||||||
len = strlen (s1) + strlen (s2) + 1;
|
len = strlen (s1) + strlen (s2) + 1;
|
||||||
buf = malloc (len);
|
buf = malloc (len);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
Sys_Error ("do_op_string: Memory Allocation Failure\n");
|
Sys_Error ("do_op_string: Memory Allocation Failure");
|
||||||
strcpy (buf, s1);
|
strcpy (buf, s1);
|
||||||
strcat (buf, s2);
|
strcat (buf, s2);
|
||||||
e1->e.string_val = buf;
|
e1->e.string_val = buf;
|
||||||
|
@ -1571,7 +1571,7 @@ function_expr (expr_t *e1, expr_t *e2)
|
||||||
ret->e.def = memcpy (malloc (sizeof (def_t)), &def_ret, sizeof (def_t));
|
ret->e.def = memcpy (malloc (sizeof (def_t)), &def_ret, sizeof (def_t));
|
||||||
|
|
||||||
if (!ret->e.def)
|
if (!ret->e.def)
|
||||||
Sys_Error ("function_expr: Memory Allocation Failure\n");
|
Sys_Error ("function_expr: Memory Allocation Failure");
|
||||||
ret->e.def->type = ftype->aux_type;
|
ret->e.def->type = ftype->aux_type;
|
||||||
call->e.block.result = ret;
|
call->e.block.result = ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,7 +269,7 @@ PR_FreeLocation (def_t *def)
|
||||||
free_free_locs = malloc (256 * sizeof (locref_t));
|
free_free_locs = malloc (256 * sizeof (locref_t));
|
||||||
|
|
||||||
if (!free_free_locs)
|
if (!free_free_locs)
|
||||||
Sys_Error ("PR_FreeLocation: Memory Allocation Failure\n");
|
Sys_Error ("PR_FreeLocation: Memory Allocation Failure");
|
||||||
for (loc = free_free_locs; loc - free_free_locs < 255; loc++)
|
for (loc = free_free_locs; loc - free_free_locs < 255; loc++)
|
||||||
loc->next = loc + 1;
|
loc->next = loc + 1;
|
||||||
loc->next = 0;
|
loc->next = 0;
|
||||||
|
|
|
@ -377,7 +377,7 @@ add_frame_macro (char *token)
|
||||||
{
|
{
|
||||||
frame_t *frame = malloc (sizeof (frame_t));
|
frame_t *frame = malloc (sizeof (frame_t));
|
||||||
if (!frame)
|
if (!frame)
|
||||||
Sys_Error ("add_frame_macro: Memory Allocation Failure\n");
|
Sys_Error ("add_frame_macro: Memory Allocation Failure");
|
||||||
|
|
||||||
frame->name = strdup (token);
|
frame->name = strdup (token);
|
||||||
frame->num = frame_number++;
|
frame->num = frame_number++;
|
||||||
|
@ -404,7 +404,7 @@ make_string (char *token)
|
||||||
|
|
||||||
s = str = malloc (strlen (token) + 1);
|
s = str = malloc (strlen (token) + 1);
|
||||||
if (!str)
|
if (!str)
|
||||||
Sys_Error ("make_string: Memory Allocation Failure\n");
|
Sys_Error ("make_string: Memory Allocation Failure");
|
||||||
|
|
||||||
mask = 0x00;
|
mask = 0x00;
|
||||||
boldnext = 0;
|
boldnext = 0;
|
||||||
|
|
|
@ -1275,7 +1275,7 @@ scan_scope (hashtab_t *tab, def_t *scope)
|
||||||
if (def->name && !def->removed) {
|
if (def->name && !def->removed) {
|
||||||
def_state_t *ds = malloc (sizeof (def_state_t));
|
def_state_t *ds = malloc (sizeof (def_state_t));
|
||||||
if (!ds)
|
if (!ds)
|
||||||
Sys_Error ("scan_scope: Memory Allocation Failure\n");
|
Sys_Error ("scan_scope: Memory Allocation Failure");
|
||||||
ds->def = def;
|
ds->def = def;
|
||||||
ds->state = def->initialized;
|
ds->state = def->initialized;
|
||||||
Hash_Add (tab, ds);
|
Hash_Add (tab, ds);
|
||||||
|
@ -1306,7 +1306,7 @@ merge_local_inits (hashtab_t *dl_1, hashtab_t *dl_2)
|
||||||
|
|
||||||
nds = malloc (sizeof (def_state_t));
|
nds = malloc (sizeof (def_state_t));
|
||||||
if (!nds)
|
if (!nds)
|
||||||
Sys_Error ("merge_local_inits: Memory Allocation Failure\n");
|
Sys_Error ("merge_local_inits: Memory Allocation Failure");
|
||||||
nds->def = (*ds)->def;
|
nds->def = (*ds)->def;
|
||||||
nds->state = (*ds)->state && d->state;
|
nds->state = (*ds)->state && d->state;
|
||||||
Hash_Add (tab, nds);
|
Hash_Add (tab, nds);
|
||||||
|
|
|
@ -75,7 +75,7 @@ case_label_expr (switch_block_t *switch_block, expr_t *value)
|
||||||
case_label_t *cl = malloc (sizeof (case_label_t));
|
case_label_t *cl = malloc (sizeof (case_label_t));
|
||||||
|
|
||||||
if (!cl)
|
if (!cl)
|
||||||
Sys_Error ("case_label_expr: Memory Allocation Failure\n");
|
Sys_Error ("case_label_expr: Memory Allocation Failure");
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
convert_name (value);
|
convert_name (value);
|
||||||
|
@ -106,7 +106,7 @@ new_switch_block (void)
|
||||||
switch_block_t *switch_block = malloc (sizeof (switch_block_t));
|
switch_block_t *switch_block = malloc (sizeof (switch_block_t));
|
||||||
|
|
||||||
if (!switch_block)
|
if (!switch_block)
|
||||||
Sys_Error ("new_switch_block: Memory Allocation Failure\n");
|
Sys_Error ("new_switch_block: Memory Allocation Failure");
|
||||||
switch_block->labels = Hash_NewTable (127, 0, 0, 0);
|
switch_block->labels = Hash_NewTable (127, 0, 0, 0);
|
||||||
Hash_SetHashCompare (switch_block->labels, get_hash, compare);
|
Hash_SetHashCompare (switch_block->labels, get_hash, compare);
|
||||||
switch_block->test = 0;
|
switch_block->test = 0;
|
||||||
|
|
|
@ -122,7 +122,7 @@ find_type (type_t *type)
|
||||||
// allocate a new one
|
// allocate a new one
|
||||||
check = malloc (sizeof (*check));
|
check = malloc (sizeof (*check));
|
||||||
if (!check)
|
if (!check)
|
||||||
Sys_Error ("find_type: Memory Allocation Failure\n");
|
Sys_Error ("find_type: Memory Allocation Failure");
|
||||||
*check = *type;
|
*check = *type;
|
||||||
|
|
||||||
chain_type (check);
|
chain_type (check);
|
||||||
|
|
|
@ -106,7 +106,7 @@ fix_missing_globals (progs_t *pr, def_t *globals)
|
||||||
|
|
||||||
progs = malloc (pr->progs_size + strings_size);
|
progs = malloc (pr->progs_size + strings_size);
|
||||||
if (!progs)
|
if (!progs)
|
||||||
Sys_Error ("fix_missing_globals: Memory Allocation Failure\n");
|
Sys_Error ("fix_missing_globals: Memory Allocation Failure");
|
||||||
memcpy (progs, pr->progs, pr->progs_size);
|
memcpy (progs, pr->progs, pr->progs_size);
|
||||||
|
|
||||||
offs = progs->ofs_strings + progs->numstrings;
|
offs = progs->ofs_strings + progs->numstrings;
|
||||||
|
|
|
@ -65,7 +65,7 @@ main ()
|
||||||
Cmd_Init_Hash ();
|
Cmd_Init_Hash ();
|
||||||
membase = malloc (memsize);
|
membase = malloc (memsize);
|
||||||
if (!membase)
|
if (!membase)
|
||||||
Sys_Error ("Memory Allocation Failure\n");
|
Sys_Error ("Memory Allocation Failure");
|
||||||
Memory_Init (membase, memsize);
|
Memory_Init (membase, memsize);
|
||||||
Cvar_Init ();
|
Cvar_Init ();
|
||||||
Cbuf_Init ();
|
Cbuf_Init ();
|
||||||
|
@ -100,7 +100,7 @@ main ()
|
||||||
Qclose (f);
|
Qclose (f);
|
||||||
}
|
}
|
||||||
if (!progs.progs)
|
if (!progs.progs)
|
||||||
Sys_Error ("couldn't load %s\n", "qwaq.dat");
|
Sys_Error ("couldn't load %s", "qwaq.dat");
|
||||||
|
|
||||||
if (!PR_ResolveGlobals (&progs))
|
if (!PR_ResolveGlobals (&progs))
|
||||||
PR_Error (&progs, "unable to load %s", progs.progs_name);
|
PR_Error (&progs, "unable to load %s", progs.progs_name);
|
||||||
|
|
Loading…
Reference in a new issue