VID_Error -> ri.Sys_Error; VID_Printf -> ri.Con_Printf

This commit is contained in:
Daniel Gibson 2016-10-02 02:51:33 +02:00
parent 2062b319e9
commit 0588d3f988
16 changed files with 137 additions and 137 deletions

View file

@ -43,7 +43,7 @@ LoadMD2(model_t *mod, void *buffer)
if (version != ALIAS_VERSION)
{
VID_Error(ERR_DROP, "%s has wrong version number (%i should be %i)",
ri.Sys_Error(ERR_DROP, "%s has wrong version number (%i should be %i)",
mod->name, version, ALIAS_VERSION);
}
@ -57,33 +57,33 @@ LoadMD2(model_t *mod, void *buffer)
if (pheader->skinheight > MAX_LBM_HEIGHT)
{
VID_Error(ERR_DROP, "model %s has a skin taller than %d", mod->name,
ri.Sys_Error(ERR_DROP, "model %s has a skin taller than %d", mod->name,
MAX_LBM_HEIGHT);
}
if (pheader->num_xyz <= 0)
{
VID_Error(ERR_DROP, "model %s has no vertices", mod->name);
ri.Sys_Error(ERR_DROP, "model %s has no vertices", mod->name);
}
if (pheader->num_xyz > MAX_VERTS)
{
VID_Error(ERR_DROP, "model %s has too many vertices", mod->name);
ri.Sys_Error(ERR_DROP, "model %s has too many vertices", mod->name);
}
if (pheader->num_st <= 0)
{
VID_Error(ERR_DROP, "model %s has no st vertices", mod->name);
ri.Sys_Error(ERR_DROP, "model %s has no st vertices", mod->name);
}
if (pheader->num_tris <= 0)
{
VID_Error(ERR_DROP, "model %s has no triangles", mod->name);
ri.Sys_Error(ERR_DROP, "model %s has no triangles", mod->name);
}
if (pheader->num_frames <= 0)
{
VID_Error(ERR_DROP, "model %s has no frames", mod->name);
ri.Sys_Error(ERR_DROP, "model %s has no frames", mod->name);
}
/* load base s and t vertices (not used in gl version) */

View file

@ -53,7 +53,7 @@ LoadPCX(char *origname, byte **pic, byte **palette, int *width, int *height)
if (!raw)
{
VID_Printf(PRINT_DEVELOPER, "Bad pcx file %s\n", filename);
ri.Con_Printf(PRINT_DEVELOPER, "Bad pcx file %s\n", filename);
return;
}
@ -75,7 +75,7 @@ LoadPCX(char *origname, byte **pic, byte **palette, int *width, int *height)
(pcx->encoding != 1) || (pcx->bits_per_pixel != 8) ||
(pcx->xmax >= 640) || (pcx->ymax >= 480))
{
VID_Printf(PRINT_ALL, "Bad pcx file %s\n", filename);
ri.Con_Printf(PRINT_ALL, "Bad pcx file %s\n", filename);
return;
}
@ -126,7 +126,7 @@ LoadPCX(char *origname, byte **pic, byte **palette, int *width, int *height)
if (raw - (byte *)pcx > len)
{
VID_Printf(PRINT_DEVELOPER, "PCX file %s was malformed", filename);
ri.Con_Printf(PRINT_DEVELOPER, "PCX file %s was malformed", filename);
free(*pic);
*pic = NULL;
}

View file

@ -43,13 +43,13 @@ LoadSP2(model_t *mod, void *buffer)
if (sprout->version != SPRITE_VERSION)
{
VID_Error(ERR_DROP, "%s has wrong version number (%i should be %i)",
ri.Sys_Error(ERR_DROP, "%s has wrong version number (%i should be %i)",
mod->name, sprout->version, SPRITE_VERSION);
}
if (sprout->numframes > MAX_MD2SKINS)
{
VID_Error(ERR_DROP, "%s has too many frames (%i > %i)",
ri.Sys_Error(ERR_DROP, "%s has too many frames (%i > %i)",
mod->name, sprout->numframes, MAX_MD2SKINS);
}

View file

@ -74,14 +74,14 @@ LoadSTB(const char *origname, const char* type, byte **pic, int *width, int *hei
data = stbi_load_from_memory(rawdata, rawsize, &w, &h, &bytesPerPixel, STBI_rgb_alpha);
if (data == NULL)
{
VID_Printf(PRINT_ALL, "stb_image couldn't load data from %s: %s!\n", filename, stbi_failure_reason());
ri.Con_Printf(PRINT_ALL, "stb_image couldn't load data from %s: %s!\n", filename, stbi_failure_reason());
FS_FreeFile(rawdata);
return false;
}
FS_FreeFile(rawdata);
VID_Printf(PRINT_DEVELOPER, "LoadSTB() loaded: %s\n", filename);
ri.Con_Printf(PRINT_DEVELOPER, "LoadSTB() loaded: %s\n", filename);
*pic = data;
*width = w;

View file

@ -46,7 +46,7 @@ LoadWal(char *origname)
if (!mt)
{
VID_Printf(PRINT_ALL, "LoadWall: can't load %s\n", name);
ri.Con_Printf(PRINT_ALL, "LoadWall: can't load %s\n", name);
return r_notexture;
}

View file

@ -149,7 +149,7 @@ RDraw_StretchPic(int x, int y, int w, int h, char *pic)
if (!gl)
{
VID_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
return;
}
@ -194,7 +194,7 @@ RDraw_PicScaled(int x, int y, char *pic, float factor)
if (!gl)
{
VID_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
return;
}
@ -244,7 +244,7 @@ RDraw_TileClear(int x, int y, int w, int h, char *pic)
if (!image)
{
VID_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
return;
}
@ -289,7 +289,7 @@ RDraw_Fill(int x, int y, int w, int h, int c)
if ((unsigned)c > 255)
{
VID_Error(ERR_FATAL, "Draw_Fill: bad color");
ri.Sys_Error(ERR_FATAL, "Draw_Fill: bad color");
}
glDisable(GL_TEXTURE_2D);
@ -530,7 +530,7 @@ Draw_GetPalette(void)
if (!pal)
{
VID_Error(ERR_FATAL, "Couldn't load pics/colormap.pcx");
ri.Sys_Error(ERR_FATAL, "Couldn't load pics/colormap.pcx");
}
for (i = 0; i < 256; i++)

View file

@ -192,7 +192,7 @@ R_TextureMode(char *string)
if (i == NUM_GL_MODES)
{
VID_Printf(PRINT_ALL, "bad filter name\n");
ri.Con_Printf(PRINT_ALL, "bad filter name\n");
return;
}
@ -252,7 +252,7 @@ R_TextureAlphaMode(char *string)
if (i == NUM_GL_ALPHA_MODES)
{
VID_Printf(PRINT_ALL, "bad alpha texture mode name\n");
ri.Con_Printf(PRINT_ALL, "bad alpha texture mode name\n");
return;
}
@ -274,7 +274,7 @@ R_TextureSolidMode(char *string)
if (i == NUM_GL_SOLID_MODES)
{
VID_Printf(PRINT_ALL, "bad solid texture mode name\n");
ri.Con_Printf(PRINT_ALL, "bad solid texture mode name\n");
return;
}
@ -292,7 +292,7 @@ R_ImageList_f(void)
"PAL"
};
VID_Printf(PRINT_ALL, "------------------\n");
ri.Con_Printf(PRINT_ALL, "------------------\n");
texels = 0;
for (i = 0, image = gltextures; i < numgltextures; i++, image++)
@ -307,28 +307,28 @@ R_ImageList_f(void)
switch (image->type)
{
case it_skin:
VID_Printf(PRINT_ALL, "M");
ri.Con_Printf(PRINT_ALL, "M");
break;
case it_sprite:
VID_Printf(PRINT_ALL, "S");
ri.Con_Printf(PRINT_ALL, "S");
break;
case it_wall:
VID_Printf(PRINT_ALL, "W");
ri.Con_Printf(PRINT_ALL, "W");
break;
case it_pic:
VID_Printf(PRINT_ALL, "P");
ri.Con_Printf(PRINT_ALL, "P");
break;
default:
VID_Printf(PRINT_ALL, " ");
ri.Con_Printf(PRINT_ALL, " ");
break;
}
VID_Printf(PRINT_ALL, " %3i %3i %s: %s\n",
ri.Con_Printf(PRINT_ALL, " %3i %3i %s: %s\n",
image->upload_width, image->upload_height,
palstrings[image->paletted], image->name);
}
VID_Printf(PRINT_ALL,
ri.Con_Printf(PRINT_ALL,
"Total texel count (not counting mipmaps): %i\n",
texels);
}
@ -646,7 +646,7 @@ R_Upload32Soft(unsigned *data, int width, int height, qboolean mipmap)
if (scaled_width * scaled_height > sizeof(scaled) / 4)
{
VID_Error(ERR_DROP, "R_Upload32: too big");
ri.Sys_Error(ERR_DROP, "R_Upload32: too big");
}
/* scan the texture for any non-255 alpha */
@ -811,7 +811,7 @@ R_Upload8(byte *data, int width, int height, qboolean mipmap, qboolean is_sky)
if (s > sizeof(trans) / 4)
{
VID_Error(ERR_DROP, "R_Upload8: too large");
ri.Sys_Error(ERR_DROP, "R_Upload8: too large");
}
if (gl_config.palettedtexture && is_sky)
@ -892,7 +892,7 @@ R_LoadPic(char *name, byte *pic, int width, int realwidth,
{
if (numgltextures == MAX_GLTEXTURES)
{
VID_Error(ERR_DROP, "MAX_GLTEXTURES");
ri.Sys_Error(ERR_DROP, "MAX_GLTEXTURES");
}
numgltextures++;
@ -902,7 +902,7 @@ R_LoadPic(char *name, byte *pic, int width, int realwidth,
if (strlen(name) >= sizeof(image->name))
{
VID_Error(ERR_DROP, "Draw_LoadPic: \"%s\" is too long", name);
ri.Sys_Error(ERR_DROP, "Draw_LoadPic: \"%s\" is too long", name);
}
strcpy(image->name, name);
@ -985,7 +985,7 @@ R_LoadPic(char *name, byte *pic, int width, int realwidth,
}
else
{
VID_Printf(PRINT_DEVELOPER,
ri.Con_Printf(PRINT_DEVELOPER,
"Warning, image '%s' has hi-res replacement smaller than the original! (%d x %d) < (%d x %d)\n",
name, image->width, image->height, realwidth, realheight);
}
@ -1271,7 +1271,7 @@ R_InitImages(void)
if (!gl_state.d_16to8table)
{
VID_Error(ERR_FATAL, "Couldn't load pics/16to8.pcx");
ri.Sys_Error(ERR_FATAL, "Couldn't load pics/16to8.pcx");
}
}

View file

@ -500,7 +500,7 @@ R_BuildLightMap(msurface_t *surf, byte *dest, int stride)
if (surf->texinfo->flags &
(SURF_SKY | SURF_TRANS33 | SURF_TRANS66 | SURF_WARP))
{
VID_Error(ERR_DROP, "R_BuildLightMap called for non-lit surface");
ri.Sys_Error(ERR_DROP, "R_BuildLightMap called for non-lit surface");
}
smax = (surf->extents[0] >> 4) + 1;
@ -509,7 +509,7 @@ R_BuildLightMap(msurface_t *surf, byte *dest, int stride)
if (size > (sizeof(s_blocklights) >> 4))
{
VID_Error(ERR_DROP, "Bad s_blocklights size");
ri.Sys_Error(ERR_DROP, "Bad s_blocklights size");
}
/* set to full bright if no light data */

View file

@ -81,7 +81,7 @@ LM_UploadBlock(qboolean dynamic)
if (++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS)
{
VID_Error(ERR_DROP,
ri.Sys_Error(ERR_DROP,
"LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n");
}
}
@ -227,7 +227,7 @@ LM_CreateSurfaceLightmap(msurface_t *surf)
if (!LM_AllocBlock(smax, tmax, &surf->light_s, &surf->light_t))
{
VID_Error(ERR_FATAL, "Consecutive calls to LM_AllocBlock(%d,%d) failed\n",
ri.Sys_Error(ERR_FATAL, "Consecutive calls to LM_AllocBlock(%d,%d) failed\n",
smax, tmax);
}
}

View file

@ -359,7 +359,7 @@ R_DrawEntitiesOnList(void)
R_DrawSpriteModel(currententity);
break;
default:
VID_Error(ERR_DROP, "Bad modeltype");
ri.Sys_Error(ERR_DROP, "Bad modeltype");
break;
}
}
@ -405,7 +405,7 @@ R_DrawEntitiesOnList(void)
R_DrawSpriteModel(currententity);
break;
default:
VID_Error(ERR_DROP, "Bad modeltype");
ri.Sys_Error(ERR_DROP, "Bad modeltype");
break;
}
}
@ -1068,7 +1068,7 @@ R_RenderView(refdef_t *fd)
if (!r_worldmodel && !(r_newrefdef.rdflags & RDF_NOWORLDMODEL))
{
VID_Error(ERR_DROP, "R_RenderView: NULL worldmodel");
ri.Sys_Error(ERR_DROP, "R_RenderView: NULL worldmodel");
}
if (gl_speeds->value)
@ -1106,7 +1106,7 @@ R_RenderView(refdef_t *fd)
if (gl_speeds->value)
{
VID_Printf(PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n",
ri.Con_Printf(PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n",
c_brush_polys, c_alias_polys, c_visible_textures,
c_visible_lightmaps);
}
@ -1272,17 +1272,17 @@ R_Register(void)
static int
SetMode_impl(int *pwidth, int *pheight, int mode, qboolean fullscreen)
{
VID_Printf(PRINT_ALL, "setting mode %d:", mode);
ri.Con_Printf(PRINT_ALL, "setting mode %d:", mode);
/* mode -1 is not in the vid mode table - so we keep the values in pwidth
and pheight and don't even try to look up the mode info */
if ((mode != -1) && !VID_GetModeInfo(pwidth, pheight, mode))
{
VID_Printf(PRINT_ALL, " invalid mode\n");
ri.Con_Printf(PRINT_ALL, " invalid mode\n");
return rserr_invalid_mode;
}
VID_Printf(PRINT_ALL, " %d %d\n", *pwidth, *pheight);
ri.Con_Printf(PRINT_ALL, " %d %d\n", *pwidth, *pheight);
if (!ri.GLimp_InitGraphics(fullscreen, pwidth, pheight))
{
@ -1326,7 +1326,7 @@ R_SetMode(void)
{
Cvar_SetValue("vid_fullscreen", 0);
vid_fullscreen->modified = false;
VID_Printf(PRINT_ALL, "ref_gl::R_SetMode() - fullscreen unavailable in this mode\n");
ri.Con_Printf(PRINT_ALL, "ref_gl::R_SetMode() - fullscreen unavailable in this mode\n");
if ((err = SetMode_impl(&vid.width, &vid.height, gl_mode->value, false)) == rserr_ok)
{
@ -1337,13 +1337,13 @@ R_SetMode(void)
{
Cvar_SetValue("gl_mode", gl_state.prev_mode);
gl_mode->modified = false;
VID_Printf(PRINT_ALL, "ref_gl::R_SetMode() - invalid mode\n");
ri.Con_Printf(PRINT_ALL, "ref_gl::R_SetMode() - invalid mode\n");
}
/* try setting it back to something safe */
if ((err = SetMode_impl(&vid.width, &vid.height, gl_state.prev_mode, false)) != rserr_ok)
{
VID_Printf(PRINT_ALL, "ref_gl::R_SetMode() - could not revert to safe mode\n");
ri.Con_Printf(PRINT_ALL, "ref_gl::R_SetMode() - could not revert to safe mode\n");
return false;
}
}
@ -1365,17 +1365,17 @@ RI_Init(void *hinstance, void *hWnd)
}
/* Options */
VID_Printf(PRINT_ALL, "Refresher build options:\n");
ri.Con_Printf(PRINT_ALL, "Refresher build options:\n");
VID_Printf(PRINT_ALL, " + Retexturing support\n");
ri.Con_Printf(PRINT_ALL, " + Retexturing support\n");
#ifdef X11GAMMA
VID_Printf(PRINT_ALL, " + Gamma via X11\n");
ri.Con_Printf(PRINT_ALL, " + Gamma via X11\n");
#else
VID_Printf(PRINT_ALL, " - Gamma via X11\n");
ri.Con_Printf(PRINT_ALL, " - Gamma via X11\n");
#endif
VID_Printf(PRINT_ALL, "Refresh: " REF_VERSION "\n");
ri.Con_Printf(PRINT_ALL, "Refresh: " REF_VERSION "\n");
Draw_GetPalette();
@ -1399,7 +1399,7 @@ RI_Init(void *hinstance, void *hWnd)
if (!R_SetMode())
{
QGL_Shutdown();
VID_Printf(PRINT_ALL, "ref_gl::R_Init() - could not R_SetMode()\n");
ri.Con_Printf(PRINT_ALL, "ref_gl::R_Init() - could not R_SetMode()\n");
return -1;
}
@ -1408,19 +1408,19 @@ RI_Init(void *hinstance, void *hWnd)
// --------
/* get our various GL strings */
VID_Printf(PRINT_ALL, "\nOpenGL setting:\n", gl_config.vendor_string);
ri.Con_Printf(PRINT_ALL, "\nOpenGL setting:\n", gl_config.vendor_string);
gl_config.vendor_string = (char *)glGetString(GL_VENDOR);
VID_Printf(PRINT_ALL, "GL_VENDOR: %s\n", gl_config.vendor_string);
ri.Con_Printf(PRINT_ALL, "GL_VENDOR: %s\n", gl_config.vendor_string);
gl_config.renderer_string = (char *)glGetString(GL_RENDERER);
VID_Printf(PRINT_ALL, "GL_RENDERER: %s\n", gl_config.renderer_string);
ri.Con_Printf(PRINT_ALL, "GL_RENDERER: %s\n", gl_config.renderer_string);
gl_config.version_string = (char *)glGetString(GL_VERSION);
VID_Printf(PRINT_ALL, "GL_VERSION: %s\n", gl_config.version_string);
ri.Con_Printf(PRINT_ALL, "GL_VERSION: %s\n", gl_config.version_string);
gl_config.extensions_string = (char *)glGetString(GL_EXTENSIONS);
VID_Printf(PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string);
ri.Con_Printf(PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string);
sscanf(gl_config.version_string, "%d.%d", &gl_config.major_version, &gl_config.minor_version);
@ -1429,18 +1429,18 @@ RI_Init(void *hinstance, void *hWnd)
if (gl_config.minor_version < 4)
{
QGL_Shutdown();
VID_Printf(PRINT_ALL, "Support for OpenGL 1.4 is not available\n");
ri.Con_Printf(PRINT_ALL, "Support for OpenGL 1.4 is not available\n");
return -1;
}
}
VID_Printf(PRINT_ALL, "\n\nProbing for OpenGL extensions:\n");
ri.Con_Printf(PRINT_ALL, "\n\nProbing for OpenGL extensions:\n");
// ----
/* Point parameters */
VID_Printf(PRINT_ALL, " - Point parameters: ");
ri.Con_Printf(PRINT_ALL, " - Point parameters: ");
if (strstr(gl_config.extensions_string, "GL_ARB_point_parameters"))
{
@ -1455,22 +1455,22 @@ RI_Init(void *hinstance, void *hWnd)
if (qglPointParameterfARB && qglPointParameterfvARB)
{
gl_config.pointparameters = true;
VID_Printf(PRINT_ALL, "Okay\n");
ri.Con_Printf(PRINT_ALL, "Okay\n");
}
else
{
VID_Printf(PRINT_ALL, "Failed\n");
ri.Con_Printf(PRINT_ALL, "Failed\n");
}
}
else
{
VID_Printf(PRINT_ALL, "Disabled\n");
ri.Con_Printf(PRINT_ALL, "Disabled\n");
}
// ----
/* Paletted texture */
VID_Printf(PRINT_ALL, " - Paletted texture: ");
ri.Con_Printf(PRINT_ALL, " - Paletted texture: ");
if (strstr(gl_config.extensions_string, "GL_EXT_paletted_texture") &&
strstr(gl_config.extensions_string, "GL_EXT_shared_texture_palette"))
@ -1486,52 +1486,52 @@ RI_Init(void *hinstance, void *hWnd)
if (qglColorTableEXT)
{
gl_config.palettedtexture = true;
VID_Printf(PRINT_ALL, "Okay\n");
ri.Con_Printf(PRINT_ALL, "Okay\n");
}
else
{
VID_Printf(PRINT_ALL, "Failed\n");
ri.Con_Printf(PRINT_ALL, "Failed\n");
}
}
else
{
VID_Printf(PRINT_ALL, "Disabled\n");
ri.Con_Printf(PRINT_ALL, "Disabled\n");
}
// --------
/* Anisotropic */
VID_Printf(PRINT_ALL, " - Anisotropic: ");
ri.Con_Printf(PRINT_ALL, " - Anisotropic: ");
if (strstr(gl_config.extensions_string, "GL_EXT_texture_filter_anisotropic"))
{
gl_config.anisotropic = true;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_config.max_anisotropy);
VID_Printf(PRINT_ALL, "%ux\n", (int)gl_config.max_anisotropy);
ri.Con_Printf(PRINT_ALL, "%ux\n", (int)gl_config.max_anisotropy);
}
else
{
gl_config.anisotropic = false;
gl_config.max_anisotropy = 0.0;
VID_Printf(PRINT_ALL, "Failed\n");
ri.Con_Printf(PRINT_ALL, "Failed\n");
}
// ----
/* Non power of two textures */
VID_Printf(PRINT_ALL, " - Non power of two textures: ");
ri.Con_Printf(PRINT_ALL, " - Non power of two textures: ");
if (strstr(gl_config.extensions_string, "GL_ARB_texture_non_power_of_two"))
{
gl_config.npottextures = true;
VID_Printf(PRINT_ALL, "Okay\n");
ri.Con_Printf(PRINT_ALL, "Okay\n");
}
else
{
gl_config.npottextures = false;
VID_Printf(PRINT_ALL, "Failed\n");
ri.Con_Printf(PRINT_ALL, "Failed\n");
}
// ----
@ -1586,7 +1586,7 @@ RI_BeginFrame(float camera_separation)
}
else
{
VID_Printf(PRINT_ALL, "stereo supermode changed, restarting video!\n");
ri.Con_Printf(PRINT_ALL, "stereo supermode changed, restarting video!\n");
cvar_t *ref;
ref = Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);
ref->modified = true;

View file

@ -345,14 +345,14 @@ R_CullAliasModel(vec3_t bbox[8], entity_t *e)
if ((e->frame >= paliashdr->num_frames) || (e->frame < 0))
{
VID_Printf(PRINT_DEVELOPER, "R_CullAliasModel %s: no such frame %d\n",
ri.Con_Printf(PRINT_DEVELOPER, "R_CullAliasModel %s: no such frame %d\n",
currentmodel->name, e->frame);
e->frame = 0;
}
if ((e->oldframe >= paliashdr->num_frames) || (e->oldframe < 0))
{
VID_Printf(PRINT_DEVELOPER, "R_CullAliasModel %s: no such oldframe %d\n",
ri.Con_Printf(PRINT_DEVELOPER, "R_CullAliasModel %s: no such oldframe %d\n",
currentmodel->name, e->oldframe);
e->oldframe = 0;
}
@ -727,7 +727,7 @@ R_DrawAliasModel(entity_t *e)
if ((currententity->frame >= paliashdr->num_frames) ||
(currententity->frame < 0))
{
VID_Printf(PRINT_DEVELOPER, "R_DrawAliasModel %s: no such frame %d\n",
ri.Con_Printf(PRINT_DEVELOPER, "R_DrawAliasModel %s: no such frame %d\n",
currentmodel->name, currententity->frame);
currententity->frame = 0;
currententity->oldframe = 0;
@ -736,7 +736,7 @@ R_DrawAliasModel(entity_t *e)
if ((currententity->oldframe >= paliashdr->num_frames) ||
(currententity->oldframe < 0))
{
VID_Printf(PRINT_DEVELOPER, "R_DrawAliasModel %s: no such oldframe %d\n",
ri.Con_Printf(PRINT_DEVELOPER, "R_DrawAliasModel %s: no such oldframe %d\n",
currentmodel->name, currententity->oldframe);
currententity->frame = 0;
currententity->oldframe = 0;

View file

@ -117,7 +117,7 @@ R_ScreenShot(void)
if (i == 100)
{
VID_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't create a file\n");
ri.Con_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't create a file\n");
return;
}
@ -128,7 +128,7 @@ R_ScreenShot(void)
buffer = malloc(c);
if (!buffer)
{
VID_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't malloc %d bytes\n", c);
ri.Con_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't malloc %d bytes\n", c);
return;
}
@ -163,11 +163,11 @@ R_ScreenShot(void)
{
fwrite(buffer, 1, c, f);
fclose(f);
VID_Printf(PRINT_ALL, "Wrote %s\n", picname);
ri.Con_Printf(PRINT_ALL, "Wrote %s\n", picname);
}
else
{
VID_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't write %s\n", picname);
ri.Con_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't write %s\n", picname);
}
free(buffer);
@ -176,10 +176,10 @@ R_ScreenShot(void)
void
R_Strings(void)
{
VID_Printf(PRINT_ALL, "GL_VENDOR: %s\n", gl_config.vendor_string);
VID_Printf(PRINT_ALL, "GL_RENDERER: %s\n", gl_config.renderer_string);
VID_Printf(PRINT_ALL, "GL_VERSION: %s\n", gl_config.version_string);
VID_Printf(PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string);
ri.Con_Printf(PRINT_ALL, "GL_VENDOR: %s\n", gl_config.vendor_string);
ri.Con_Printf(PRINT_ALL, "GL_RENDERER: %s\n", gl_config.renderer_string);
ri.Con_Printf(PRINT_ALL, "GL_VERSION: %s\n", gl_config.version_string);
ri.Con_Printf(PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string);
}
void

View file

@ -57,7 +57,7 @@ Mod_PointInLeaf(vec3_t p, model_t *model)
if (!model || !model->nodes)
{
VID_Error(ERR_DROP, "Mod_PointInLeaf: bad model");
ri.Sys_Error(ERR_DROP, "Mod_PointInLeaf: bad model");
}
node = model->nodes;
@ -151,7 +151,7 @@ Mod_Modellist_f(void)
int total;
total = 0;
VID_Printf(PRINT_ALL, "Loaded models:\n");
ri.Con_Printf(PRINT_ALL, "Loaded models:\n");
for (i = 0, mod = mod_known; i < mod_numknown; i++, mod++)
{
@ -160,11 +160,11 @@ Mod_Modellist_f(void)
continue;
}
VID_Printf(PRINT_ALL, "%8i : %s\n", mod->extradatasize, mod->name);
ri.Con_Printf(PRINT_ALL, "%8i : %s\n", mod->extradatasize, mod->name);
total += mod->extradatasize;
}
VID_Printf(PRINT_ALL, "Total resident: %i\n", total);
ri.Con_Printf(PRINT_ALL, "Total resident: %i\n", total);
}
void
@ -185,7 +185,7 @@ Mod_ForName(char *name, qboolean crash)
if (!name[0])
{
VID_Error(ERR_DROP, "Mod_ForName: NULL name");
ri.Sys_Error(ERR_DROP, "Mod_ForName: NULL name");
}
/* inline models are grabbed only from worldmodel */
@ -195,7 +195,7 @@ Mod_ForName(char *name, qboolean crash)
if ((i < 1) || !r_worldmodel || (i >= r_worldmodel->numsubmodels))
{
VID_Error(ERR_DROP, "bad inline model number");
ri.Sys_Error(ERR_DROP, "bad inline model number");
}
return &mod_inline[i];
@ -228,7 +228,7 @@ Mod_ForName(char *name, qboolean crash)
{
if (mod_numknown == MAX_MOD_KNOWN)
{
VID_Error(ERR_DROP, "mod_numknown == MAX_MOD_KNOWN");
ri.Sys_Error(ERR_DROP, "mod_numknown == MAX_MOD_KNOWN");
}
mod_numknown++;
@ -243,7 +243,7 @@ Mod_ForName(char *name, qboolean crash)
{
if (crash)
{
VID_Error(ERR_DROP, "Mod_NumForName: %s not found", mod->name);
ri.Sys_Error(ERR_DROP, "Mod_NumForName: %s not found", mod->name);
}
memset(mod->name, 0, sizeof(mod->name));
@ -271,7 +271,7 @@ Mod_ForName(char *name, qboolean crash)
break;
default:
VID_Error(ERR_DROP,
ri.Sys_Error(ERR_DROP,
"Mod_NumForName: unknown fileid for %s",
mod->name);
break;
@ -331,7 +331,7 @@ Mod_LoadVertexes(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -374,7 +374,7 @@ Mod_LoadSubmodels(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -412,7 +412,7 @@ Mod_LoadEdges(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -442,7 +442,7 @@ Mod_LoadTexinfo(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -478,7 +478,7 @@ Mod_LoadTexinfo(lump_t *l)
if (!out->image)
{
VID_Printf(PRINT_ALL, "Couldn't load %s\n", name);
ri.Con_Printf(PRINT_ALL, "Couldn't load %s\n", name);
out->image = r_notexture;
}
}
@ -568,7 +568,7 @@ Mod_LoadFaces(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -603,7 +603,7 @@ Mod_LoadFaces(lump_t *l)
if ((ti < 0) || (ti >= loadmodel->numtexinfo))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: bad texinfo number");
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad texinfo number");
}
out->texinfo = loadmodel->texinfo + ti;
@ -682,7 +682,7 @@ Mod_LoadNodes(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -736,7 +736,7 @@ Mod_LoadLeafs(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -777,7 +777,7 @@ Mod_LoadMarksurfaces(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -793,7 +793,7 @@ Mod_LoadMarksurfaces(lump_t *l)
if ((j < 0) || (j >= loadmodel->numsurfaces))
{
VID_Error(ERR_DROP, "Mod_ParseMarksurfaces: bad surface number");
ri.Sys_Error(ERR_DROP, "Mod_ParseMarksurfaces: bad surface number");
}
out[i] = loadmodel->surfaces + j;
@ -810,7 +810,7 @@ Mod_LoadSurfedges(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -818,7 +818,7 @@ Mod_LoadSurfedges(lump_t *l)
if ((count < 1) || (count >= MAX_MAP_SURFEDGES))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: bad surfedges count in %s: %i",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: bad surfedges count in %s: %i",
loadmodel->name, count);
}
@ -846,7 +846,7 @@ Mod_LoadPlanes(lump_t *l)
if (l->filelen % sizeof(*in))
{
VID_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
ri.Sys_Error(ERR_DROP, "MOD_LoadBmodel: funny lump size in %s",
loadmodel->name);
}
@ -887,7 +887,7 @@ Mod_LoadBrushModel(model_t *mod, void *buffer)
if (loadmodel != mod_known)
{
VID_Error(ERR_DROP, "Loaded a brush model after the world");
ri.Sys_Error(ERR_DROP, "Loaded a brush model after the world");
}
header = (dheader_t *)buffer;
@ -896,7 +896,7 @@ Mod_LoadBrushModel(model_t *mod, void *buffer)
if (i != BSPVERSION)
{
VID_Error(ERR_DROP, "Mod_LoadBrushModel: %s has wrong version number (%i should be %i)",
ri.Sys_Error(ERR_DROP, "Mod_LoadBrushModel: %s has wrong version number (%i should be %i)",
mod->name, i, BSPVERSION);
}
@ -939,7 +939,7 @@ Mod_LoadBrushModel(model_t *mod, void *buffer)
if (starmod->firstnode >= loadmodel->numnodes)
{
VID_Error(ERR_DROP, "Inline model %i has bad firstnode", i);
ri.Sys_Error(ERR_DROP, "Inline model %i has bad firstnode", i);
}
VectorCopy(bm->maxs, starmod->maxs);

View file

@ -110,7 +110,7 @@ UpdateHardwareGamma(void)
if(SDL_GetWMInfo(&info) != 1)
#endif
{
VID_Printf(PRINT_ALL, "Couldn't get Window info from SDL\n");
ri.Con_Printf(PRINT_ALL, "Couldn't get Window info from SDL\n");
return;
}
@ -119,7 +119,7 @@ UpdateHardwareGamma(void)
XRRScreenResources* res = XRRGetScreenResources(dpy, info.info.x11.window);
if(res == NULL)
{
VID_Printf(PRINT_ALL, "Unable to get xrandr screen resources.\n");
ri.Con_Printf(PRINT_ALL, "Unable to get xrandr screen resources.\n");
return;
}
@ -130,7 +130,7 @@ UpdateHardwareGamma(void)
Uint16* ramp = malloc(rampSize); // TODO: check for NULL
if(ramp == NULL)
{
VID_Printf(PRINT_ALL, "Couldn't allocate &zd byte of memory for gamma ramp - OOM?!\n", rampSize);
ri.Con_Printf(PRINT_ALL, "Couldn't allocate &zd byte of memory for gamma ramp - OOM?!\n", rampSize);
return;
}
@ -164,7 +164,7 @@ UpdateHardwareGamma(void)
#else
if(SDL_SetGammaRamp(ramp, ramp, ramp) < 0) {
#endif
VID_Printf(PRINT_ALL, "Setting gamma failed: %s\n", SDL_GetError());
ri.Con_Printf(PRINT_ALL, "Setting gamma failed: %s\n", SDL_GetError());
}
}
#endif // X11GAMMA
@ -186,7 +186,7 @@ static void InitGamma()
if(SDL_GetWMInfo(&info) != 1)
#endif
{
VID_Printf(PRINT_ALL, "Couldn't get Window info from SDL\n");
ri.Con_Printf(PRINT_ALL, "Couldn't get Window info from SDL\n");
return;
}
@ -195,14 +195,14 @@ static void InitGamma()
XRRScreenResources* res = XRRGetScreenResources(dpy, info.info.x11.window);
if(res == NULL)
{
VID_Printf(PRINT_ALL, "Unable to get xrandr screen resources.\n");
ri.Con_Printf(PRINT_ALL, "Unable to get xrandr screen resources.\n");
return;
}
noGammaRamps = res->ncrtc;
gammaRamps = calloc(noGammaRamps, sizeof(XRRCrtcGamma*));
if(gammaRamps == NULL) {
VID_Printf(PRINT_ALL, "Couldn't allocate memory for %d gamma ramps - OOM?!\n", noGammaRamps);
ri.Con_Printf(PRINT_ALL, "Couldn't allocate memory for %d gamma ramps - OOM?!\n", noGammaRamps);
return;
}
@ -224,13 +224,13 @@ static void InitGamma()
XRRFreeScreenResources(res);
VID_Printf(PRINT_ALL, "Using hardware gamma via X11/xRandR.\n");
ri.Con_Printf(PRINT_ALL, "Using hardware gamma via X11/xRandR.\n");
#elif __APPLE__
gl_state.hwgamma = false;
VID_Printf(PRINT_ALL, "Using software gamma (needs vid_restart after changes)\n");
ri.Con_Printf(PRINT_ALL, "Using software gamma (needs vid_restart after changes)\n");
return;
#else
VID_Printf(PRINT_ALL, "Using hardware gamma via SDL.\n");
ri.Con_Printf(PRINT_ALL, "Using hardware gamma via SDL.\n");
#endif
gl_state.hwgamma = true;
vid_gamma->modified = true;
@ -253,7 +253,7 @@ static void RestoreGamma()
if(SDL_GetWMInfo(&info) != 1)
#endif
{
VID_Printf(PRINT_ALL, "Couldn't get Window info from SDL\n");
ri.Con_Printf(PRINT_ALL, "Couldn't get Window info from SDL\n");
return;
}
@ -262,7 +262,7 @@ static void RestoreGamma()
XRRScreenResources* res = XRRGetScreenResources(dpy, info.info.x11.window);
if(res == NULL)
{
VID_Printf(PRINT_ALL, "Unable to get xrandr screen resources.\n");
ri.Con_Printf(PRINT_ALL, "Unable to get xrandr screen resources.\n");
return;
}
@ -273,7 +273,7 @@ static void RestoreGamma()
{
int len = XRRGetCrtcGammaSize(dpy, res->crtcs[i]);
if(len != gammaRamps[i]->size) {
VID_Printf(PRINT_ALL, "WTF, gamma ramp size for display %d has changed from %d to %d!\n",
ri.Con_Printf(PRINT_ALL, "WTF, gamma ramp size for display %d has changed from %d to %d!\n",
i, gammaRamps[i]->size, len);
continue;
@ -291,7 +291,7 @@ static void RestoreGamma()
free(gammaRamps);
gammaRamps = NULL;
VID_Printf(PRINT_ALL, "Restored original Gamma\n");
ri.Con_Printf(PRINT_ALL, "Restored original Gamma\n");
}
#endif // X11GAMMA
@ -351,7 +351,7 @@ int RI_InitContext(void* win)
if(win == NULL)
{
VID_Error(ERR_FATAL, "R_InitContext() must not be called with NULL argument!");
ri.Sys_Error(ERR_FATAL, "R_InitContext() must not be called with NULL argument!");
return false;
}
@ -359,7 +359,7 @@ int RI_InitContext(void* win)
context = SDL_GL_CreateContext(window);
if(context == NULL)
{
VID_Printf(PRINT_ALL, "R_InitContext(): Creating OpenGL Context failed: %s\n", SDL_GetError());
ri.Con_Printf(PRINT_ALL, "R_InitContext(): Creating OpenGL Context failed: %s\n", SDL_GetError());
window = NULL;
return false;
}
@ -381,7 +381,7 @@ int RI_InitContext(void* win)
/* Initialize the stencil buffer */
if (!SDL_GL_GetAttribute(SDL_GL_STENCIL_SIZE, &stencil_bits))
{
VID_Printf(PRINT_ALL, "Got %d bits of stencil.\n", stencil_bits);
ri.Con_Printf(PRINT_ALL, "Got %d bits of stencil.\n", stencil_bits);
if (stencil_bits >= 1)
{

View file

@ -382,7 +382,7 @@ R_BlendLightmaps(void)
/* try uploading the block now */
if (!LM_AllocBlock(smax, tmax, &surf->dlight_s, &surf->dlight_t))
{
VID_Error(ERR_FATAL,
ri.Sys_Error(ERR_FATAL,
"Consecutive calls to LM_AllocBlock(%d,%d) failed (dynamic)\n",
smax, tmax);
}

View file

@ -131,7 +131,7 @@ R_SubdividePolygon(int numverts, float *verts)
if (numverts > 60)
{
VID_Error(ERR_DROP, "numverts = %i", numverts);
ri.Sys_Error(ERR_DROP, "numverts = %i", numverts);
}
R_BoundPoly(numverts, verts, mins, maxs);
@ -467,7 +467,7 @@ R_ClipSkyPolygon(int nump, vec3_t vecs, int stage)
if (nump > MAX_CLIP_VERTS - 2)
{
VID_Error(ERR_DROP, "R_ClipSkyPolygon: MAX_CLIP_VERTS");
ri.Sys_Error(ERR_DROP, "R_ClipSkyPolygon: MAX_CLIP_VERTS");
}
if (stage == 6)