From 8d376b57de94bafd3bae224088b469649c853028 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 4 Feb 2008 11:47:04 +0000 Subject: [PATCH] huge audit of dprints throughout engine, all notices of successfully loading models/sounds/skins/etc are now tied to the cvar developer_loading added developer_loadfile cvar (prints every successful FS_LoadFile) many improvements to consistency of loading notices, and some cleanups to q3 shader handling fixed annoying 'Bad dynamic texture name' spam at load git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8072 d7cf8633-e32d-0410-b094-e92efae38249 --- cd_shared.c | 4 +- cl_demo.c | 2 +- cl_dyntexture.c | 11 +- cl_gecko.c | 37 +++--- cl_parse.c | 5 +- cl_screen.c | 12 +- clvm_cmds.c | 4 +- cmd.c | 2 +- console.c | 4 +- draw.h | 11 +- fs.c | 21 ++-- gl_backend.c | 13 +-- gl_draw.c | 28 +++-- gl_rmain.c | 12 +- host.c | 10 +- host_cmd.c | 2 +- image.c | 5 +- image_png.c | 9 +- jpeg.c | 9 +- libcurl.c | 9 +- menu.c | 56 ++++----- model_alias.c | 67 ++--------- model_brush.c | 19 ++- model_shared.c | 99 ++++++++++------ model_shared.h | 3 +- prvm_cmds.c | 8 +- quakedef.h | 2 + r_shadow.c | 37 ++++-- r_sky.c | 9 ++ sbar.c | 298 ++++++++++++++++++++++++------------------------ snd_alsa.c | 4 +- snd_coreaudio.c | 18 +-- snd_main.c | 13 +-- snd_mem.c | 23 ++-- snd_modplug.c | 16 +-- snd_ogg.c | 23 ++-- snd_sdl.c | 8 +- snd_wav.c | 3 +- snd_win.c | 2 +- vid_agl.c | 6 + vid_glx.c | 6 + vid_sdl.c | 6 + vid_shared.c | 21 ++-- vid_wgl.c | 6 + wad.c | 5 - 45 files changed, 486 insertions(+), 482 deletions(-) diff --git a/cd_shared.c b/cd_shared.c index 5e3934ec..5eeadaed 100644 --- a/cd_shared.c +++ b/cd_shared.c @@ -157,9 +157,9 @@ void CDAudio_Play_byName (const char *trackname, qboolean looping) S_SetChannelFlag (faketrack, CHANNELFLAG_FORCELOOP, true); S_SetChannelFlag (faketrack, CHANNELFLAG_FULLVOLUME, true); if(track >= 1) - Con_DPrintf ("Fake CD track %u playing...\n", track); + Con_Printf ("Fake CD track %u playing...\n", track); else - Con_DPrintf ("BGM track %s playing...\n", trackname); + Con_Printf ("BGM track %s playing...\n", trackname); } } diff --git a/cl_demo.c b/cl_demo.c index 6d5087f4..c72b3b8a 100644 --- a/cl_demo.c +++ b/cl_demo.c @@ -353,7 +353,7 @@ void CL_PlayDemo_f (void) FS_DefaultExtension (name, ".dem", sizeof (name)); cls.protocol = PROTOCOL_QUAKE; - Con_Printf("Playing demo from %s.\n", name); + Con_Printf("Playing demo %s.\n", name); cls.demofile = FS_Open (name, "rb", false, false); if (!cls.demofile) { diff --git a/cl_dyntexture.c b/cl_dyntexture.c index 722c7227..cd310aab 100644 --- a/cl_dyntexture.c +++ b/cl_dyntexture.c @@ -15,16 +15,15 @@ static unsigned dyntexturecount; #define DEFAULT_DYNTEXTURE r_texture_grey128 -static dyntexture_t * cl_finddyntexture( const char *name ) { +static dyntexture_t * cl_finddyntexture( const char *name, qboolean warnonfailure ) { unsigned i; dyntexture_t *dyntexture = NULL; // sanity checks - make sure its actually a dynamic texture path if( !name || !*name || strncmp( name, CLDYNTEXTUREPREFIX, sizeof( CLDYNTEXTUREPREFIX ) - 1 ) != 0 ) { // TODO: print a warning or something - if( developer.integer > 0 ) { + if (warnonfailure) Con_Printf( "cl_finddyntexture: Bad dynamic texture name '%s'\n", name ); - } return NULL; } @@ -46,7 +45,7 @@ static dyntexture_t * cl_finddyntexture( const char *name ) { } rtexture_t * CL_GetDynTexture( const char *name ) { - dyntexture_t *dyntexture = cl_finddyntexture( name ); + dyntexture_t *dyntexture = cl_finddyntexture( name, false ); if( dyntexture ) { return dyntexture->texture; } else { @@ -59,7 +58,7 @@ void CL_LinkDynTexture( const char *name, rtexture_t *texture ) { cachepic_t *cachepic; skinframe_t *skinframe; - dyntexture = cl_finddyntexture( name ); + dyntexture = cl_finddyntexture( name, true ); if( !dyntexture ) { Con_Printf( "CL_LinkDynTexture: internal error in cl_finddyntexture!\n" ); return; @@ -68,7 +67,7 @@ void CL_LinkDynTexture( const char *name, rtexture_t *texture ) { if( dyntexture->texture != texture ) { dyntexture->texture = texture; - cachepic = Draw_CachePic( name, false ); + cachepic = Draw_CachePic_Flags( name, CACHEPICFLAG_NOTPERSISTENT ); // TODO: assert cachepic and skinframe should be valid pointers... // TODO: assert cachepic->tex = dyntexture->texture cachepic->tex = texture; diff --git a/cl_gecko.c b/cl_gecko.c index aca0cbfb..653ee2e2 100644 --- a/cl_gecko.c +++ b/cl_gecko.c @@ -849,29 +849,36 @@ static const dllfunction_t osgkFuncs[] = {NULL, NULL} }; -void CL_Gecko_Init( void ) +qboolean CL_Gecko_OpenLibrary (void) { - const char* dllnames [] = + const char* dllnames_gecko [] = { - #if defined(WIN64) +#if defined(WIN64) "OffscreenGecko64.dll", - #elif defined(WIN32) +#elif defined(WIN32) "OffscreenGecko.dll", - #elif defined(MACOSX) +#elif defined(MACOSX) "OffscreenGecko.dylib", - #else +#else "libOffscreenGecko.so", - #endif +#endif NULL }; - - if (!osgk_dll) - { - if (! Sys_LoadLibrary (dllnames, &osgk_dll, osgkFuncs)) - { - Con_Printf ("Could not load OffscreenGecko, Gecko support unavailable\n"); - } - } + + // Already loaded? + if (osgk_dll) + return true; + +// COMMANDLINEOPTION: Sound: -nogecko disables gecko support (web browser support for menu and computer terminals) + if (COM_CheckParm("-nogecko")) + return false; + + return Sys_LoadLibrary (dllnames_gecko, &osgk_dll, osgkFuncs); +} + +void CL_Gecko_Init( void ) +{ + CL_Gecko_OpenLibrary(); Cmd_AddCommand( "gecko_create", cl_gecko_create_f, "Create a gecko browser instance" ); Cmd_AddCommand( "gecko_destroy", cl_gecko_destroy_f, "Destroy a gecko browser instance" ); diff --git a/cl_parse.c b/cl_parse.c index 14de82c8..7fd83d30 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1151,7 +1151,7 @@ void CL_BeginDownloads_f(void) // prevent cl_begindownloads from being issued multiple times in one match // to prevent accidentally cancelled downloads if(cl.loadbegun) - Con_DPrintf("cl_begindownloads is only valid once per match\n"); + Con_Printf("cl_begindownloads is only valid once per match\n"); else CL_BeginDownloads(false); } @@ -1334,7 +1334,8 @@ An svc_signonnum has been received, perform a client side setup */ static void CL_SignonReply (void) { - Con_DPrintf("CL_SignonReply: %i\n", cls.signon); + if (developer.integer >= 100) + Con_Printf("CL_SignonReply: %i\n", cls.signon); switch (cls.signon) { diff --git a/cl_screen.c b/cl_screen.c index cdda9cd6..25080f0b 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -337,7 +337,7 @@ void SCR_DrawTurtle (void) if (count < 3) return; - DrawQ_Pic (0, 0, Draw_CachePic("gfx/turtle", true), 0, 0, 1, 1, 1, 1, 0); + DrawQ_Pic (0, 0, Draw_CachePic ("gfx/turtle"), 0, 0, 1, 1, 1, 1, 0); } /* @@ -354,7 +354,7 @@ void SCR_DrawNet (void) if (cls.demoplayback) return; - DrawQ_Pic (64, 0, Draw_CachePic("gfx/net", true), 0, 0, 1, 1, 1, 1, 0); + DrawQ_Pic (64, 0, Draw_CachePic ("gfx/net"), 0, 0, 1, 1, 1, 1, 0); } /* @@ -375,7 +375,7 @@ void SCR_DrawPause (void) if (!cl.paused) return; - pic = Draw_CachePic ("gfx/pause", true); + pic = Draw_CachePic ("gfx/pause"); DrawQ_Pic ((vid_conwidth.integer - pic->width)/2, (vid_conheight.integer - pic->height)/2, pic, 0, 0, 1, 1, 1, 1, 0); } @@ -392,7 +392,7 @@ void SCR_DrawBrand (void) if (!scr_showbrand.value) return; - pic = Draw_CachePic ("gfx/brand", true); + pic = Draw_CachePic ("gfx/brand"); switch ((int)scr_showbrand.value) { @@ -1811,7 +1811,7 @@ void SHOWLMP_drawall(void) int i; for (i = 0;i < cl.num_showlmps;i++) if (cl.showlmps[i].isactive) - DrawQ_Pic(cl.showlmps[i].x, cl.showlmps[i].y, Draw_CachePic(cl.showlmps[i].pic, true), 0, 0, 1, 1, 1, 1, 0); + DrawQ_Pic(cl.showlmps[i].x, cl.showlmps[i].y, Draw_CachePic (cl.showlmps[i].pic), 0, 0, 1, 1, 1, 1, 0); } /* @@ -2054,7 +2054,7 @@ void SCR_UpdateLoadingScreen (qboolean clear) R_Mesh_Start(); R_Mesh_Matrix(&identitymatrix); // draw the loading plaque - pic = Draw_CachePic("gfx/loading", true); + pic = Draw_CachePic ("gfx/loading"); x = (vid_conwidth.integer - pic->width)/2; y = (vid_conheight.integer - pic->height)/2; GL_Color(1,1,1,1); diff --git a/clvm_cmds.c b/clvm_cmds.c index 4f962739..3fc8703b 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -2464,7 +2464,7 @@ void VM_CL_R_PolygonBegin (void) return; } picname = PRVM_G_STRING(OFS_PARM0); - polys->begin_texture = picname[0] ? Draw_CachePic(picname, true)->tex : r_texture_white; + polys->begin_texture = picname[0] ? Draw_CachePic (picname)->tex : r_texture_white; polys->begin_drawflag = (int)PRVM_G_FLOAT(OFS_PARM1); polys->begin_vertices = 0; polys->begin_active = true; @@ -2530,7 +2530,7 @@ void Debug_PolygonBegin(const char *picname, int drawflag) Con_Printf("Debug_PolygonBegin: called twice without Debug_PolygonEnd after first\n"); return; } - debugPolys.begin_texture = picname[0] ? Draw_CachePic(picname, true)->tex : r_texture_white; + debugPolys.begin_texture = picname[0] ? Draw_CachePic (picname)->tex : r_texture_white; debugPolys.begin_drawflag = drawflag; debugPolys.begin_vertices = 0; debugPolys.begin_active = true; diff --git a/cmd.c b/cmd.c index 2e800754..c085aa88 100644 --- a/cmd.c +++ b/cmd.c @@ -306,7 +306,7 @@ static void Cmd_Exec_f (void) Con_Printf("couldn't exec %s\n",Cmd_Argv(1)); return; } - Con_DPrintf("execing %s\n",Cmd_Argv(1)); + Con_Printf("execing %s\n",Cmd_Argv(1)); // if executing default.cfg for the first time, lock the cvar defaults // it may seem backwards to insert this text BEFORE the default.cfg diff --git a/console.c b/console.c index 2c0e8a5a..e153b5ed 100644 --- a/console.c +++ b/console.c @@ -553,7 +553,7 @@ void Con_Init (void) Cmd_AddCommand ("condump", Con_ConDump_f, "output console history to a file (see also log_file)"); con_initialized = true; - Con_Print("Console initialized.\n"); + Con_DPrint("Console initialized.\n"); } @@ -1509,7 +1509,7 @@ void Con_DrawConsole (int lines) con_vislines = lines; // draw the background - DrawQ_Pic(0, lines - vid_conheight.integer, scr_conbrightness.value >= 0.01f ? Draw_CachePic("gfx/conback", true) : NULL, vid_conwidth.integer, vid_conheight.integer, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, cls.signon == SIGNONS ? scr_conalpha.value : 1.0, 0); // always full alpha when not in game + DrawQ_Pic(0, lines - vid_conheight.integer, scr_conbrightness.value >= 0.01f ? Draw_CachePic ("gfx/conback") : NULL, vid_conwidth.integer, vid_conheight.integer, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, cls.signon == SIGNONS ? scr_conalpha.value : 1.0, 0); // always full alpha when not in game DrawQ_String_Font(vid_conwidth.integer - DrawQ_TextWidth_Font(engineversion, 0, false, FONT_CONSOLE) * con_textsize.value, lines - con_textsize.value, engineversion, 0, con_textsize.value, con_textsize.value, 1, 0, 0, 1, 0, NULL, true, FONT_CONSOLE); // draw the text diff --git a/draw.h b/draw.h index 1e6be908..992fc3d7 100644 --- a/draw.h +++ b/draw.h @@ -38,8 +38,17 @@ typedef struct cachepic_s } cachepic_t; +typedef enum cachepicflags_e +{ + CACHEPICFLAG_NOTPERSISTENT = 1, + CACHEPICFLAG_QUIET = 2, + CACHEPICFLAG_NOCOMPRESSION = 4, +} +cachepicflags_t; + void Draw_Init (void); -cachepic_t *Draw_CachePic (const char *path, qboolean persistent); +cachepic_t *Draw_CachePic_Flags (const char *path, unsigned int cachepicflags); +cachepic_t *Draw_CachePic (const char *path); // standard function with no options, used throughout engine // create or update a pic's image cachepic_t *Draw_NewPic(const char *picname, int width, int height, int alpha, unsigned char *pixels); // free the texture memory used by a pic diff --git a/fs.c b/fs.c index d824e07f..eee8a47d 100644 --- a/fs.c +++ b/fs.c @@ -366,14 +366,7 @@ qboolean PK3_OpenLibrary (void) return true; // Load the DLL - if (! Sys_LoadLibrary (dllnames, &zlib_dll, zlibfuncs)) - { - Con_Printf ("Compressed files support disabled\n"); - return false; - } - - Con_Printf ("Compressed files support enabled\n"); - return true; + return Sys_LoadLibrary (dllnames, &zlib_dll, zlibfuncs); } @@ -2340,6 +2333,8 @@ unsigned char *FS_LoadFile (const char *path, mempool_t *pool, qboolean quiet, f buf[filesize] = '\0'; FS_Read (file, buf, filesize); FS_Close (file); + if (developer_loadfile.integer) + Con_Printf("loaded file \"%s\" (%u bytes)\n", path, (unsigned int)filesize); } if (filesizepointer) @@ -2366,7 +2361,7 @@ qboolean FS_WriteFile (const char *filename, void *data, fs_offset_t len) return false; } - Con_DPrintf("FS_WriteFile: %s\n", filename); + Con_DPrintf("FS_WriteFile: %s (%u bytes)\n", filename, (unsigned int)len); FS_Write (file, data, len); FS_Close (file); return true; @@ -2582,8 +2577,8 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet) if (resultlistindex == resultlist.numstrings) { stringlistappend(&resultlist, temp); - if (!quiet) - Con_DPrintf("SearchPackFile: %s : %s\n", pak->filename, temp); + if (!quiet && developer_loading.integer) + Con_Printf("SearchPackFile: %s : %s\n", pak->filename, temp); } } // strip off one path element at a time until empty @@ -2619,8 +2614,8 @@ fssearch_t *FS_Search(const char *pattern, int caseinsensitive, int quiet) if (resultlistindex == resultlist.numstrings) { stringlistappend(&resultlist, temp); - if (!quiet) - Con_DPrintf("SearchDirFile: %s\n", temp); + if (!quiet && developer_loading.integer) + Con_Printf("SearchDirFile: %s\n", temp); } } } diff --git a/gl_backend.c b/gl_backend.c index 9d4ff325..fefdf7f3 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -165,7 +165,6 @@ memexpandablearray_t gl_bufferobjectinfoarray; static void gl_backend_start(void) { - Con_Print("OpenGL Backend starting...\n"); CHECKGLERROR if (qglDrawRangeElements != NULL) @@ -175,7 +174,7 @@ static void gl_backend_start(void) CHECKGLERROR qglGetIntegerv(GL_MAX_ELEMENTS_INDICES, &gl_maxdrawrangeelementsindices); CHECKGLERROR - Con_Printf("glDrawRangeElements detected (max vertices %i, max indices %i)\n", gl_maxdrawrangeelementsvertices, gl_maxdrawrangeelementsindices); + Con_DPrintf("GL_MAX_ELEMENTS_VERTICES = %i\nGL_MAX_ELEMENTS_INDICES = %i\n", gl_maxdrawrangeelementsvertices, gl_maxdrawrangeelementsindices); } backendunits = bound(1, gl_textureunits, MAX_TEXTUREUNITS); @@ -188,20 +187,18 @@ static void gl_backend_start(void) CHECKGLERROR qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, (int *)&backendarrayunits); CHECKGLERROR - Con_Printf("GLSL shader support detected: texture units = %i texenv, %i image, %i array\n", backendunits, backendimageunits, backendarrayunits); + Con_DPrintf("GLSL shader support detected: texture units = %i texenv, %i image, %i array\n", backendunits, backendimageunits, backendarrayunits); backendimageunits = bound(1, backendimageunits, MAX_TEXTUREUNITS); backendarrayunits = bound(1, backendarrayunits, MAX_TEXTUREUNITS); } - else if (backendunits > 1) - Con_Printf("multitexture detected: texture units = %i\n", backendunits); else - Con_Printf("singletexture\n"); + Con_DPrintf("GL_MAX_TEXTUREUNITS = %i\n", backendunits); GL_Backend_AllocArrays(); Mem_ExpandableArray_NewArray(&gl_bufferobjectinfoarray, r_main_mempool, sizeof(gl_bufferobjectinfo_t), 128); - Con_Printf("OpenGL backend started.\n"); + Con_DPrintf("OpenGL backend started.\n"); CHECKGLERROR @@ -215,7 +212,7 @@ static void gl_backend_shutdown(void) backendarrayunits = 0; backendactive = false; - Con_Print("OpenGL Backend shutting down\n"); + Con_DPrint("OpenGL Backend shutting down\n"); Mem_ExpandableArray_FreeArray(&gl_bufferobjectinfoarray); diff --git a/gl_draw.c b/gl_draw.c index fdd0d7c3..1d4c5077 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -389,7 +389,7 @@ static const embeddedpic_t embeddedpics[] = {NULL, 0, 0, NULL} }; -static rtexture_t *draw_generatepic(const char *name) +static rtexture_t *draw_generatepic(const char *name, qboolean quiet) { const embeddedpic_t *p; for (p = embeddedpics;p->name;p++) @@ -399,7 +399,8 @@ static rtexture_t *draw_generatepic(const char *name) return draw_generateconchars(); if (!strcmp(name, "gfx/colorcontrol/ditherpattern")) return draw_generateditherpattern(); - Con_Printf("Draw_CachePic: failed to load %s\n", name); + if (!quiet) + Con_Printf("Draw_CachePic: failed to load %s\n", name); return r_texture_notexture; } @@ -410,7 +411,7 @@ Draw_CachePic ================ */ // FIXME: move this to client somehow -static cachepic_t *Draw_CachePic_Compression (const char *path, qboolean persistent, qboolean allow_compression) +cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags) { int crc, hashkey; cachepic_t *pic; @@ -449,11 +450,11 @@ static cachepic_t *Draw_CachePic_Compression (const char *path, qboolean persist } flags = TEXF_ALPHA; - if (persistent) + if (!(cachepicflags & CACHEPICFLAG_NOTPERSISTENT)) flags |= TEXF_PRECACHE; if (strcmp(path, "gfx/colorcontrol/ditherpattern")) flags |= TEXF_CLAMP; - if(allow_compression && gl_texturecompression_2d.integer) + if (!(cachepicflags & CACHEPICFLAG_NOCOMPRESSION) && gl_texturecompression_2d.integer) flags |= TEXF_COMPRESS; // load a high quality image from disk if possible @@ -478,6 +479,9 @@ static cachepic_t *Draw_CachePic_Compression (const char *path, qboolean persist dpsnprintf(lmpname, sizeof(lmpname), "%s.lmp", path); if (!strncmp(path, "gfx/", 4) && (lmpdata = FS_LoadFile(lmpname, tempmempool, false, &lmpsize))) { + if (developer_loading.integer) + Con_Printf("loading lump \"%s\"\n", path); + if (lmpsize >= 9) { pic->width = lmpdata[0] + lmpdata[1] * 256 + lmpdata[2] * 65536 + lmpdata[3] * 16777216; @@ -490,6 +494,9 @@ static cachepic_t *Draw_CachePic_Compression (const char *path, qboolean persist } else if ((lmpdata = W_GetLumpName (path + 4))) { + if (developer_loading.integer) + Con_Printf("loading gfx.wad lump \"%s\"\n", path + 4); + if (!strcmp(path, "gfx/conchars")) { // conchars is a raw image and with color 0 as transparent instead of 255 @@ -512,16 +519,17 @@ static cachepic_t *Draw_CachePic_Compression (const char *path, qboolean persist // if it's not found on disk, generate an image if (pic->tex == NULL) { - pic->tex = draw_generatepic(path); + pic->tex = draw_generatepic(path, (cachepicflags & CACHEPICFLAG_QUIET) != 0); pic->width = R_TextureWidth(pic->tex); pic->height = R_TextureHeight(pic->tex); } return pic; } -cachepic_t *Draw_CachePic (const char *path, qboolean persistent) + +cachepic_t *Draw_CachePic (const char *path) { - return Draw_CachePic_Compression(path, persistent, true); + return Draw_CachePic_Flags (path, 0); } cachepic_t *Draw_NewPic(const char *picname, int width, int height, int alpha, unsigned char *pixels_bgra) @@ -604,10 +612,10 @@ static void LoadFont(qboolean override, const char *name, dp_font_t *fnt) if(drawtexturepool == NULL) return; // before gl_draw_start, so will be loaded later - fnt->tex = Draw_CachePic_Compression(fnt->texpath, true, false)->tex; + fnt->tex = Draw_CachePic_Flags(fnt->texpath, CACHEPICFLAG_QUIET | CACHEPICFLAG_NOCOMPRESSION)->tex; if(fnt->tex == r_texture_notexture) { - fnt->tex = Draw_CachePic_Compression("gfx/conchars", true, false)->tex; + fnt->tex = Draw_CachePic_Flags("gfx/conchars", CACHEPICFLAG_NOCOMPRESSION)->tex; strlcpy(widthfile, "gfx/conchars.width", sizeof(widthfile)); } else diff --git a/gl_rmain.c b/gl_rmain.c index 7310943f..ec66a384 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -1891,6 +1891,9 @@ skinframe_t *R_SkinFrame_LoadExternal(const char *name, int textureflags, qboole if (basepixels == NULL) return NULL; + if (developer_loading.integer) + Con_Printf("loading skin \"%s\"\n", name); + // we've got some pixels to store, so really allocate this new texture now if (!skinframe) skinframe = R_SkinFrame_Find(name, textureflags, 0, 0, 0, true); @@ -2011,6 +2014,9 @@ skinframe_t *R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, co if (!skindata) return NULL; + if (developer_loading.integer) + Con_Printf("loading 32bit skin \"%s\"\n", name); + if (r_shadow_bumpscale_basetexture.value > 0) { temp1 = (unsigned char *)Mem_Alloc(tempmempool, width * height * 8); @@ -2067,6 +2073,9 @@ skinframe_t *R_SkinFrame_LoadInternalQuake(const char *name, int textureflags, i if (!skindata) return NULL; + if (developer_loading.integer) + Con_Printf("loading quake skin \"%s\"\n", name); + if (r_shadow_bumpscale_basetexture.value > 0) { temp1 = (unsigned char *)Mem_Alloc(tempmempool, width * height * 8); @@ -4411,7 +4420,8 @@ void R_UpdateTextureInfo(const entity_render_t *ent, texture_t *t) if (strcmp(r_qwskincache[i], cl.scores[i].qw_skin)) { strlcpy(r_qwskincache[i], cl.scores[i].qw_skin, sizeof(r_qwskincache[i])); - Con_DPrintf("loading skins/%s\n", r_qwskincache[i]); + if (developer_loading.integer) + Con_Printf("loading skins/%s\n", r_qwskincache[i]); r_qwskincache_skinframe[i] = R_SkinFrame_LoadExternal(va("skins/%s", r_qwskincache[i]), TEXF_PRECACHE | (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_PICMIP | TEXF_COMPRESS, developer.integer > 0); } t->currentskinframe = r_qwskincache_skinframe[i]; diff --git a/host.c b/host.c index 5c8cb67e..45452709 100644 --- a/host.c +++ b/host.c @@ -69,6 +69,8 @@ cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000000", "maximum fps cap, if game cvar_t cl_maxidlefps = {CVAR_SAVE, "cl_maxidlefps", "20", "maximum fps cap when the game is not the active window (makes cpu time available to other programs"}; cvar_t developer = {0, "developer","0", "prints additional debugging messages and information (recommended for modders and level designers)"}; +cvar_t developer_loadfile = {0, "developer_loadfile","0", "prints name and size of every file loaded via the FS_LoadFile function (which is almost everything)"}; +cvar_t developer_loading = {0, "developer_loading","0", "prints information about files as they are loaded or unloaded successfully"}; cvar_t developer_entityparsing = {0, "developer_entityparsing", "0", "prints detailed network entities information each time a packet is received"}; cvar_t timestamps = {CVAR_SAVE, "timestamps", "0", "prints timestamps on console messages"}; @@ -217,6 +219,8 @@ static void Host_InitLocal (void) Cvar_RegisterVariable (&cl_maxidlefps); Cvar_RegisterVariable (&developer); + Cvar_RegisterVariable (&developer_loadfile); + Cvar_RegisterVariable (&developer_loading); Cvar_RegisterVariable (&developer_entityparsing); Cvar_RegisterVariable (×tamps); @@ -966,8 +970,8 @@ static void Host_Init (void) // COMMANDLINEOPTION: Console: -developer enables warnings and other notices (RECOMMENDED for mod developers) if (COM_CheckParm("-developer")) { - developer.value = developer.integer = 100; - developer.string = "100"; + developer.value = developer.integer = 1; + developer.string = "1"; } if (COM_CheckParm("-developer2")) @@ -1034,7 +1038,7 @@ static void Host_Init (void) if (cls.state != ca_dedicated) { - Con_Printf("Initializing client\n"); + Con_DPrintf("Initializing client\n"); R_Modules_Init(); Palette_Init(); diff --git a/host_cmd.c b/host_cmd.c index 011cea07..5e4b1476 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -1953,7 +1953,7 @@ void Host_Startdemos_f (void) Con_Printf("Max %i demos in demoloop\n", MAX_DEMOS); c = MAX_DEMOS; } - Con_Printf("%i demo(s) in loop\n", c); + Con_DPrintf("%i demo(s) in loop\n", c); for (i=1 ; i= 1) - Con_DPrintf("Error loading image %s (file loaded but decode failed)\n", name); - } + Con_DPrintf("Error loading image %s (file loaded but decode failed)\n", name); } } if (complain) diff --git a/image_png.c b/image_png.c index d7ee8595..2dac76fa 100644 --- a/image_png.c +++ b/image_png.c @@ -121,14 +121,7 @@ qboolean PNG_OpenLibrary (void) return true; // Load the DLL - if (! Sys_LoadLibrary (dllnames, &png_dll, pngfuncs)) - { - Con_Printf ("PNG support disabled\n"); - return false; - } - - Con_Printf ("PNG support enabled\n"); - return true; + return Sys_LoadLibrary (dllnames, &png_dll, pngfuncs); } diff --git a/jpeg.c b/jpeg.c index b803c8d0..2124caa3 100644 --- a/jpeg.c +++ b/jpeg.c @@ -415,14 +415,7 @@ qboolean JPEG_OpenLibrary (void) return true; // Load the DLL - if (! Sys_LoadLibrary (dllnames, &jpeg_dll, jpegfuncs)) - { - Con_Printf ("JPEG support disabled\n"); - return false; - } - - Con_Printf ("JPEG support enabled\n"); - return true; + return Sys_LoadLibrary (dllnames, &jpeg_dll, jpegfuncs); } diff --git a/libcurl.c b/libcurl.c index 843fb74a..9aa74850 100644 --- a/libcurl.c +++ b/libcurl.c @@ -330,14 +330,7 @@ static qboolean CURL_OpenLibrary (void) return true; // Load the DLL - if (! Sys_LoadLibrary (dllnames, &curl_dll, curlfuncs)) - { - Con_Printf ("cURL support disabled\n"); - return false; - } - - Con_Printf ("cURL support enabled\n"); - return true; + return Sys_LoadLibrary (dllnames, &curl_dll, curlfuncs); } diff --git a/menu.c b/menu.c index 7751e588..c7845ca6 100644 --- a/menu.c +++ b/menu.c @@ -215,7 +215,7 @@ static void M_ItemPrint(float cx, float cy, const char *str, int unghosted) static void M_DrawPic(float cx, float cy, const char *picname) { - DrawQ_Pic(menu_x + cx, menu_y + cy, Draw_CachePic(picname, true), 0, 0, 1, 1, 1, 1, 0); + DrawQ_Pic(menu_x + cx, menu_y + cy, Draw_CachePic (picname), 0, 0, 1, 1, 1, 1, 0); } static void M_DrawTextBox(float x, float y, float width, float height) @@ -383,7 +383,7 @@ void M_Menu_Main_f (void) MAIN_ITEMS = 5; // check if the game data is missing and use a different main menu if so - m_missingdata = !forceqmenu.integer && Draw_CachePic (s, true)->tex == r_texture_notexture; + m_missingdata = !forceqmenu.integer && Draw_CachePic (s)->tex == r_texture_notexture; if (m_missingdata) MAIN_ITEMS = 2; @@ -425,7 +425,7 @@ static void M_Main_Draw (void) if (gamemode == GAME_TRANSFUSION) { int y1, y2, y3; M_Background(640, 480); - p = Draw_CachePic ("gfx/menu/tb-transfusion", true); + p = Draw_CachePic ("gfx/menu/tb-transfusion"); M_DrawPic (640/2 - p->width/2, 40, "gfx/menu/tb-transfusion"); y2 = 120; // 8 rather than MAIN_ITEMS to skip a number and not miss the last option @@ -446,7 +446,7 @@ static void M_Main_Draw (void) M_Background(320, 200); M_DrawPic (16, 4, "gfx/qplaque"); - p = Draw_CachePic ("gfx/ttl_main", true); + p = Draw_CachePic ("gfx/ttl_main"); M_DrawPic ( (320-p->width)/2, 4, "gfx/ttl_main"); // Nehahra if (gamemode == GAME_NEHAHRA) @@ -720,7 +720,7 @@ static void M_SinglePlayer_Draw (void) M_Background(320, 200); M_DrawPic (16, 4, "gfx/qplaque"); - p = Draw_CachePic ("gfx/ttl_sgl", true); + p = Draw_CachePic ("gfx/ttl_sgl"); // Some mods don't have a single player mode if (gamemode == GAME_GOODVSBAD2 || gamemode == GAME_BATTLEMECH) @@ -884,7 +884,7 @@ static void M_Load_Draw (void) M_Background(320, 200); - p = Draw_CachePic ("gfx/p_load", true); + p = Draw_CachePic ("gfx/p_load"); M_DrawPic ( (320-p->width)/2, 4, "gfx/p_load" ); for (i=0 ; i< MAX_SAVEGAMES; i++) @@ -902,7 +902,7 @@ static void M_Save_Draw (void) M_Background(320, 200); - p = Draw_CachePic ("gfx/p_save", true); + p = Draw_CachePic ("gfx/p_save"); M_DrawPic ( (320-p->width)/2, 4, "gfx/p_save"); for (i=0 ; iwidth/2, 40, "gfx/menu/tb-episodes"); for (y = 0; y < EPISODE_ITEMS; y++){ M_DrawPic (0, 160 + y * 40, va("gfx/menu/episode%i", y+1)); @@ -1065,7 +1065,7 @@ static void M_Transfusion_Skill_Draw (void) cachepic_t *p; M_Background(640, 480); - p = Draw_CachePic ("gfx/menu/tb-difficulty", true); + p = Draw_CachePic ("gfx/menu/tb-difficulty"); M_DrawPic(640/2 - p->width/2, 40, "gfx/menu/tb-difficulty"); for (y = 0; y < SKILL_ITEMS; y++) @@ -1169,7 +1169,7 @@ static void M_MultiPlayer_Draw (void) if (gamemode == GAME_TRANSFUSION) { M_Background(640, 480); - p = Draw_CachePic ("gfx/menu/tb-online", true); + p = Draw_CachePic ("gfx/menu/tb-online"); M_DrawPic (640/2 - p->width/2, 140, "gfx/menu/tb-online"); for (f = 1; f <= MULTIPLAYER_ITEMS; f++) M_DrawPic (0, 180 + f*40, va("gfx/menu/online%i", f)); @@ -1179,7 +1179,7 @@ static void M_MultiPlayer_Draw (void) M_Background(320, 200); M_DrawPic (16, 4, "gfx/qplaque"); - p = Draw_CachePic ("gfx/p_multi", true); + p = Draw_CachePic ("gfx/p_multi"); M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi"); M_DrawPic (72, 32, "gfx/mp_menu"); @@ -1297,7 +1297,7 @@ static void M_Setup_Draw (void) M_Background(320, 200); M_DrawPic (16, 4, "gfx/qplaque"); - p = Draw_CachePic ("gfx/p_multi", true); + p = Draw_CachePic ("gfx/p_multi"); M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi"); M_Print(64, 40, "Your name"); @@ -1630,7 +1630,7 @@ static void M_Options_Draw (void) M_Background(320, bound(200, 32 + OPTIONS_ITEMS * 8, vid_conheight.integer)); M_DrawPic(16, 4, "gfx/qplaque"); - p = Draw_CachePic("gfx/p_option", true); + p = Draw_CachePic ("gfx/p_option"); M_DrawPic((320-p->width)/2, 4, "gfx/p_option"); optnum = 0; @@ -1837,7 +1837,7 @@ static void M_Options_Effects_Draw (void) M_Background(320, bound(200, 32 + OPTIONS_EFFECTS_ITEMS * 8, vid_conheight.integer)); M_DrawPic(16, 4, "gfx/qplaque"); - p = Draw_CachePic("gfx/p_option", true); + p = Draw_CachePic ("gfx/p_option"); M_DrawPic((320-p->width)/2, 4, "gfx/p_option"); optcursor = options_effects_cursor; @@ -1988,7 +1988,7 @@ static void M_Options_Graphics_Draw (void) M_Background(320, bound(200, 32 + OPTIONS_GRAPHICS_ITEMS * 8, vid_conheight.integer)); M_DrawPic(16, 4, "gfx/qplaque"); - p = Draw_CachePic("gfx/p_option", true); + p = Draw_CachePic ("gfx/p_option"); M_DrawPic((320-p->width)/2, 4, "gfx/p_option"); optcursor = options_graphics_cursor; @@ -2176,12 +2176,12 @@ static void M_Options_ColorControl_Draw (void) float x, c, s, t, u, v; cachepic_t *p, *dither; - dither = Draw_CachePic("gfx/colorcontrol/ditherpattern", true); + dither = Draw_CachePic ("gfx/colorcontrol/ditherpattern"); M_Background(320, 256); M_DrawPic(16, 4, "gfx/qplaque"); - p = Draw_CachePic("gfx/p_option", true); + p = Draw_CachePic ("gfx/p_option"); M_DrawPic((320-p->width)/2, 4, "gfx/p_option"); optcursor = options_colorcontrol_cursor; @@ -2569,7 +2569,7 @@ static void M_Keys_Draw (void) M_Background(320, 48 + 8 * numcommands); - p = Draw_CachePic ("gfx/ttl_cstm", true); + p = Draw_CachePic ("gfx/ttl_cstm"); M_DrawPic ( (320-p->width)/2, 4, "gfx/ttl_cstm"); if (bind_grab) @@ -2847,7 +2847,7 @@ static void M_Video_Draw (void) M_Background(320, 200); M_DrawPic(16, 4, "gfx/qplaque"); - p = Draw_CachePic("gfx/vidmodes", true); + p = Draw_CachePic ("gfx/vidmodes"); M_DrawPic((320-p->width)/2, 4, "gfx/vidmodes"); // Current Resolution @@ -3281,7 +3281,7 @@ static void M_LanConfig_Draw (void) M_Background(320, 200); M_DrawPic (16, 4, "gfx/qplaque"); - p = Draw_CachePic ("gfx/p_multi", true); + p = Draw_CachePic ("gfx/p_multi"); basex = (320-p->width)/2; M_DrawPic (basex, 4, "gfx/p_multi"); @@ -3914,7 +3914,7 @@ void M_GameOptions_Draw (void) M_Background(320, 200); M_DrawPic (16, 4, "gfx/qplaque"); - p = Draw_CachePic ("gfx/p_multi", true); + p = Draw_CachePic ("gfx/p_multi"); M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi"); M_DrawTextBox (152, 32, 10, 1); @@ -4360,7 +4360,7 @@ static void M_ServerList_Draw (void) start = bound(0, slist_cursor - (visible >> 1), serverlist_viewcount - visible); end = min(start + visible, serverlist_viewcount); - p = Draw_CachePic("gfx/p_multi", true); + p = Draw_CachePic ("gfx/p_multi"); M_DrawPic((640 - p->width) / 2, 4, "gfx/p_multi"); if (end > start) { @@ -4593,7 +4593,7 @@ static void M_ModList_Draw (void) start = bound(0, modlist_cursor - (visible >> 1), modlist_count - visible); end = min(start + visible, modlist_count); - p = Draw_CachePic("gfx/p_option", true); + p = Draw_CachePic ("gfx/p_option"); M_DrawPic((640 - p->width) / 2, 4, "gfx/p_option"); if (end > start) { @@ -4865,10 +4865,10 @@ void M_Draw (void) g = (int)(realtime * 64)%96; scale_y_rate = (float)(g+1) / 96; top_offset = (g+12)/12; - p = Draw_CachePic (va("gfx/menu/blooddrip%i", top_offset), true); - drop1 = Draw_CachePic("gfx/menu/blooddrop1", true); - drop2 = Draw_CachePic("gfx/menu/blooddrop2", true); - drop3 = Draw_CachePic("gfx/menu/blooddrop3", true); + p = Draw_CachePic (va("gfx/menu/blooddrip%i", top_offset)); + drop1 = Draw_CachePic ("gfx/menu/blooddrop1"); + drop2 = Draw_CachePic ("gfx/menu/blooddrop2"); + drop3 = Draw_CachePic ("gfx/menu/blooddrop3"); for (scale_x = 0; scale_x <= vid_conwidth.integer; scale_x += p->width) { for (scale_y = -scale_y_repeat; scale_y <= vid_conheight.integer; scale_y += scale_y_repeat) { DrawQ_Pic (scale_x + 21, scale_y_repeat * .5 + scale_y + scale_y_rate * scale_y_repeat, drop3, 0, 0, 1, 1, 1, 1, 0); @@ -4883,7 +4883,7 @@ void M_Draw (void) DrawQ_Pic (scale_x + 557, scale_y_repeat * .9425 + scale_y + scale_y_rate * scale_y_repeat, drop1, 0, 0, 1, 1, 1, 1, 0); DrawQ_Pic (scale_x + 606, scale_y_repeat * .5 + scale_y + scale_y_rate * scale_y_repeat, drop2, 0, 0, 1, 1, 1, 1, 0); } - DrawQ_Pic (scale_x, -1, Draw_CachePic(va("gfx/menu/blooddrip%i", top_offset), true), 0, 0, 1, 1, 1, 1, 0); + DrawQ_Pic (scale_x, -1, Draw_CachePic (va("gfx/menu/blooddrip%i", top_offset)), 0, 0, 1, 1, 1, 1, 0); } } } diff --git a/model_alias.c b/model_alias.c index 7fdf1873..4cbc06f9 100644 --- a/model_alias.c +++ b/model_alias.c @@ -757,7 +757,6 @@ static void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfi { int i; skinfileitem_t *skinfileitem; - skinframe_t *tempskinframe; if (skinfile) { // the skin += loadmodel->num_surfaces part of this is because data_textures on alias models is arranged as [numskins][numsurfaces] @@ -768,16 +767,9 @@ static void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfi for (skinfileitem = skinfile->items;skinfileitem;skinfileitem = skinfileitem->next) { // leave the skin unitialized (nodraw) if the replacement is "common/nodraw" or "textures/common/nodraw" - if (!strcmp(skinfileitem->name, meshname) && strcmp(skinfileitem->replacement, "common/nodraw") && strcmp(skinfileitem->replacement, "textures/common/nodraw")) + if (!strcmp(skinfileitem->name, meshname)) { - if (!Mod_LoadTextureFromQ3Shader(skin, skinfileitem->replacement, false, false, true)) - { - tempskinframe = R_SkinFrame_LoadExternal(skinfileitem->replacement, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP | TEXF_COMPRESS, false); - if (!tempskinframe) - if (cls.state != ca_dedicated) - Con_Printf("mesh \"%s\": failed to load skin #%i \"%s\"\n", meshname, i, skinfileitem->replacement); - Mod_BuildAliasSkinFromSkinFrame(skin, tempskinframe); - } + Mod_LoadTextureFromQ3Shader(skin, skinfileitem->replacement, true, true, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP | TEXF_COMPRESS); break; } } @@ -790,16 +782,7 @@ static void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfi } } else - { - if (!Mod_LoadTextureFromQ3Shader(skin, shadername, false, false, true)) - { - tempskinframe = R_SkinFrame_LoadExternal(shadername, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP | TEXF_COMPRESS, false); - if (!tempskinframe) - if (cls.state != ca_dedicated) - Con_Printf("Can't find texture \"%s\" for mesh \"%s\", using grey checkerboard\n", shadername, meshname); - Mod_BuildAliasSkinFromSkinFrame(skin, tempskinframe); - } - } + Mod_LoadTextureFromQ3Shader(skin, shadername, true, true, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP | TEXF_COMPRESS); } #define BOUNDI(VALUE,MIN,MAX) if (VALUE < MIN || VALUE >= MAX) Host_Error("model %s has an invalid ##VALUE (%d exceeds %d - %d)", loadmodel->name, VALUE, MIN, MAX); @@ -1072,13 +1055,8 @@ void Mod_IDP0_Load(model_t *mod, void *buffer, void *bufferend) sprintf (name, "%s_%i_%i", loadmodel->name, i, j); else sprintf (name, "%s_%i", loadmodel->name, i); - if (!Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + totalskins * loadmodel->num_surfaces, name, false, false, true)) - { - tempskinframe = R_SkinFrame_LoadExternal(name, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PICMIP | TEXF_COMPRESS, false); - if (!tempskinframe) - tempskinframe = R_SkinFrame_LoadInternalQuake(name, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_PICMIP, true, r_fullbrights.integer, (unsigned char *)datapointer, skinwidth, skinheight); - Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + totalskins * loadmodel->num_surfaces, tempskinframe); - } + if (!Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + totalskins * loadmodel->num_surfaces, name, false, true, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PICMIP | TEXF_COMPRESS)) + Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + totalskins * loadmodel->num_surfaces, R_SkinFrame_LoadInternalQuake(name, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_PICMIP, true, r_fullbrights.integer, (unsigned char *)datapointer, skinwidth, skinheight)); datapointer += skinwidth * skinheight; totalskins++; } @@ -1147,7 +1125,6 @@ void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend) unsigned short st; } *hash, **md2verthash, *md2verthashdata; - skinframe_t *tempskinframe; skinfile_t *skinfiles; pinmodel = (md2_t *)buffer; @@ -1235,15 +1212,7 @@ void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend) loadmodel->num_texturesperskin = loadmodel->num_surfaces; loadmodel->data_textures = (texture_t *)Mem_Alloc(loadmodel->mempool, loadmodel->num_surfaces * loadmodel->numskins * sizeof(texture_t)); for (i = 0;i < loadmodel->numskins;i++, inskin += MD2_SKINNAME) - { - if (!Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i * loadmodel->num_surfaces, inskin, false, false, true)) - { - tempskinframe = R_SkinFrame_LoadExternal(inskin, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP | TEXF_COMPRESS, false); - if (!tempskinframe) - Con_Printf("%s is missing skin \"%s\"\n", loadmodel->name, inskin); - Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + i * loadmodel->num_surfaces, tempskinframe); - } - } + Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i * loadmodel->num_surfaces, inskin, true, true, (r_mipskins.integer ? TEXF_MIPMAP : 0) | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP | TEXF_COMPRESS); } else { @@ -1518,11 +1487,7 @@ void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend) } } - if (LittleLong(pinmesh->num_shaders) >= 1) - Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + i, skinfiles, pinmesh->name, ((md3shader_t *)((unsigned char *) pinmesh + LittleLong(pinmesh->lump_shaders)))->name); - else - for (j = 0;j < loadmodel->numskins;j++) - Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + i + j * loadmodel->num_surfaces, NULL); + Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + i, skinfiles, pinmesh->name, LittleLong(pinmesh->num_shaders) >= 1 ? ((md3shader_t *)((unsigned char *) pinmesh + LittleLong(pinmesh->lump_shaders)))->name : ""); Mod_ValidateElements(loadmodel->surfmesh.data_element3i + surface->num_firsttriangle * 3, surface->num_triangles, surface->num_firstvertex, surface->num_vertices, __FILE__, __LINE__); } @@ -1832,11 +1797,7 @@ void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend) // since zym models do not have named sections, reuse their shader // name as the section name shadername = (char *) (pheader->lump_shaders.start + pbase) + i * 32; - if (shadername[0]) - Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + i, skinfiles, shadername, shadername); - else - for (j = 0;j < loadmodel->numskins;j++) - Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + i + j * loadmodel->num_surfaces, NULL); + Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + i, skinfiles, shadername, shadername); } Mod_FreeSkinFiles(skinfiles); Mem_Free(vertbonecounts); @@ -2131,11 +2092,7 @@ void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend) } // since dpm models do not have named sections, reuse their shader name as the section name - if (dpmmesh->shadername[0]) - Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + i, skinfiles, dpmmesh->shadername, dpmmesh->shadername); - else - for (j = 0;j < loadmodel->numskins;j++) - Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + i + j * loadmodel->num_surfaces, NULL); + Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + i, skinfiles, dpmmesh->shadername, dpmmesh->shadername); Mod_ValidateElements(loadmodel->surfmesh.data_element3i + surface->num_firsttriangle * 3, surface->num_triangles, surface->num_firstvertex, surface->num_vertices, __FILE__, __LINE__); } @@ -2570,11 +2527,7 @@ void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend) for (index = 0, i = 0;index < nummatts;index++) { // since psk models do not have named sections, reuse their shader name as the section name - if (matts[index].name[0]) - Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + index, skinfiles, matts[index].name, matts[index].name); - else - for (j = 0;j < loadmodel->numskins;j++) - Mod_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + index + j * loadmodel->num_surfaces, NULL); + Mod_BuildAliasSkinsFromSkinFiles(loadmodel->data_textures + index, skinfiles, matts[index].name, matts[index].name); loadmodel->surfacelist[index] = index; loadmodel->data_surfaces[index].texture = loadmodel->data_textures + index; loadmodel->data_surfaces[index].num_firstvertex = 0; diff --git a/model_brush.c b/model_brush.c index 1b0cc330..dd4353a1 100644 --- a/model_brush.c +++ b/model_brush.c @@ -1444,7 +1444,7 @@ static void Mod_Q1BSP_LoadTextures(lump_t *l) if (name[j] >= 'A' && name[j] <= 'Z') name[j] += 'a' - 'A'; - if (dmiptex->name[0] && Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i, name, true, false, false)) + if (dmiptex->name[0] && Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i, name, false, false, 0)) continue; tx = loadmodel->data_textures + i; @@ -1702,7 +1702,8 @@ static void Mod_Q1BSP_LoadLighting(lump_t *l) i = LittleLong(((int *)data)[1]); if (i == 1) { - Con_DPrintf("loaded %s\n", litfilename); + if (developer_loading.integer) + Con_Printf("loaded %s\n", litfilename); loadmodel->brushq1.lightdata = (unsigned char *)Mem_Alloc(loadmodel->mempool, filesize - 8); memcpy(loadmodel->brushq1.lightdata, data + 8, filesize - 8); Mem_Free(data); @@ -1714,7 +1715,8 @@ static void Mod_Q1BSP_LoadLighting(lump_t *l) i = LittleLong(((int *)data)[1]); if (i == 1) { - Con_DPrintf("loaded %s\n", dlitfilename); + if (developer_loading.integer) + Con_Printf("loaded %s\n", dlitfilename); loadmodel->brushq1.nmaplightdata = (unsigned char *)Mem_Alloc(loadmodel->mempool, filesize - 8); memcpy(loadmodel->brushq1.nmaplightdata, data + 8, filesize - 8); loadmodel->brushq3.deluxemapping_modelspace = false; @@ -4165,7 +4167,7 @@ static void Mod_Q3BSP_LoadTextures(lump_t *l) { q3dtexture_t *in; texture_t *out; - int i, count, c; + int i, count; in = (q3dtexture_t *)(mod_base + l->fileofs); if (l->filelen % sizeof(*in)) @@ -4187,12 +4189,8 @@ static void Mod_Q3BSP_LoadTextures(lump_t *l) if (cls.state == ca_dedicated) return; - c = 0; for (i = 0;i < count;i++, in++, out++) - if (!Mod_LoadTextureFromQ3Shader(out, out->name, false, true, false)) - c++; - if (c) - Con_DPrintf("%s: %i textures missing shaders\n", loadmodel->name, c); + Mod_LoadTextureFromQ3Shader(out, out->name, true, true, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | (r_picmipworld.integer ? TEXF_PICMIP : 0) | TEXF_COMPRESS); } static void Mod_Q3BSP_LoadPlanes(lump_t *l) @@ -4507,7 +4505,8 @@ static void Mod_Q3BSP_LoadLightmaps(lump_t *l, lump_t *faceslump) ; for (mergeheight = 1;mergewidth*mergeheight < j && mergeheight < (1 << power);mergeheight *= 2) ; - Con_DPrintf("lightmap merge texture #%i is %ix%i (%i of %i used)\n", lightmapindex, mergewidth*128, mergeheight*128, min(j, mergewidth*mergeheight), mergewidth*mergeheight); + if (developer_loading.integer) + Con_Printf("lightmap merge texture #%i is %ix%i (%i of %i used)\n", lightmapindex, mergewidth*128, mergeheight*128, min(j, mergewidth*mergeheight), mergewidth*mergeheight); loadmodel->brushq3.data_lightmaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%04i", lightmapindex), mergewidth * 128, mergeheight * 128, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_PRECACHE | (gl_texturecompression_q3bsplightmaps.integer ? TEXF_COMPRESS : 0), NULL); if (loadmodel->brushq3.data_deluxemaps) loadmodel->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%04i", lightmapindex), mergewidth * 128, mergeheight * 128, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_PRECACHE | (gl_texturecompression_q3bspdeluxemaps.integer ? TEXF_COMPRESS : 0), NULL); diff --git a/model_shared.c b/model_shared.c index 9899adcf..c81622a8 100644 --- a/model_shared.c +++ b/model_shared.c @@ -152,6 +152,10 @@ void Mod_UnloadModel (model_t *mod) char name[MAX_QPATH]; qboolean isworldmodel; qboolean used; + + if (developer_loading.integer) + Con_Printf("unloading model %s\n", mod->name); + strlcpy(name, mod->name, sizeof(name)); isworldmodel = mod->isworldmodel; used = mod->used; @@ -224,7 +228,9 @@ model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolea return mod; } - Con_DPrintf("loading model %s\n", mod->name); + if (developer_loading.integer) + Con_Printf("loading model %s\n", mod->name); + // LordHavoc: unload the existing model in this slot (if there is one) if (mod->loaded || mod->mempool) Mod_UnloadModel(mod); @@ -1176,6 +1182,7 @@ static void Q3Shader_AddToHash (q3shaderinfo_t* shader) memcpy (&entry->shader, shader, sizeof (q3shaderinfo_t)); } +extern cvar_t r_picmipworld; void Mod_LoadQ3Shaders(void) { int j; @@ -1452,6 +1459,13 @@ void Mod_LoadQ3Shaders(void) shader.textureblendalpha = true; } } + layer->texflags = TEXF_ALPHA | TEXF_PRECACHE; + if (!(shader.surfaceparms & Q3SURFACEPARM_NOMIPMAPS)) + layer->texflags |= TEXF_MIPMAP; + if (!(shader.textureflags & Q3TEXTUREFLAG_NOPICMIP) && (r_picmipworld.integer || strncmp(layer->texturename[0], "textures/", 9))) + layer->texflags |= TEXF_PICMIP | TEXF_COMPRESS; + if (layer->clampmap) + layer->texflags |= TEXF_CLAMP; continue; } numparameters = 0; @@ -1634,26 +1648,29 @@ void Mod_LoadQ3Shaders(void) } } } - // identify if this is a blended terrain shader or similar + // pick the primary layer to render with if (shader.numlayers) { shader.backgroundlayer = -1; shader.primarylayer = 0; - if ((shader.layers[0].blendfunc[0] == GL_ONE && shader.layers[0].blendfunc[1] == GL_ZERO && !shader.layers[0].alphatest) - && ((shader.layers[1].blendfunc[0] == GL_SRC_ALPHA && shader.layers[1].blendfunc[1] == GL_ONE_MINUS_SRC_ALPHA && !shader.layers[0].alphatest) - || (shader.layers[1].blendfunc[0] == GL_ONE && shader.layers[1].blendfunc[1] == GL_ZERO && shader.layers[1].alphatest))) - { - // terrain blending or other effects - shader.backgroundlayer = 0; - shader.primarylayer = 1; - } - // now see if the lightmap came first, and if so choose the second texture instead + // if lightmap comes first this is definitely an ordinary texture + // if the first two layers have the correct blendfuncs and use vertex alpha, it is a blended terrain shader if ((shader.layers[shader.primarylayer].texturename != NULL) && !strcasecmp(shader.layers[shader.primarylayer].texturename[0], "$lightmap")) { shader.backgroundlayer = -1; shader.primarylayer = 1; } + else if (shader.numlayers >= 2 + && shader.layers[1].alphagen.alphagen == Q3ALPHAGEN_VERTEX + && (shader.layers[0].blendfunc[0] == GL_ONE && shader.layers[0].blendfunc[1] == GL_ZERO && !shader.layers[0].alphatest) + && ((shader.layers[1].blendfunc[0] == GL_SRC_ALPHA && shader.layers[1].blendfunc[1] == GL_ONE_MINUS_SRC_ALPHA) + || (shader.layers[1].blendfunc[0] == GL_ONE && shader.layers[1].blendfunc[1] == GL_ZERO && shader.layers[1].alphatest))) + { + // terrain blending or other effects + shader.backgroundlayer = 0; + shader.primarylayer = 1; + } } // fix up multiple reflection types if(shader.textureflags & Q3TEXTUREFLAG_WATERSHADER) @@ -1678,19 +1695,19 @@ q3shaderinfo_t *Mod_LookupQ3Shader(const char *name) return NULL; } -extern cvar_t r_picmipworld; -qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean q1bsp, qboolean q3bsp, qboolean md3) +qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags) { int j; - int texflags; qboolean success = true; q3shaderinfo_t *shader; + if (!name) + name = ""; strlcpy(texture->name, name, sizeof(texture->name)); shader = name[0] ? Mod_LookupQ3Shader(name) : NULL; if (shader) { - if (developer.integer >= 100) - Con_DPrintf("%s: loaded shader for %s\n", loadmodel->name, name); + if (developer_loading.integer) + Con_Printf("%s: loaded shader for %s\n", loadmodel->name, name); texture->surfaceparms = shader->surfaceparms; texture->textureflags = shader->textureflags; texture->basematerialflags = 0; @@ -1773,14 +1790,7 @@ nothing GL_ZERO GL_ONE texture->skinframerate = primarylayer->framerate; for (j = 0;j < primarylayer->numframes;j++) { - texflags = TEXF_ALPHA | TEXF_PRECACHE; - if (!(shader->surfaceparms & Q3SURFACEPARM_NOMIPMAPS)) - texflags |= TEXF_MIPMAP; - if (!(shader->textureflags & Q3TEXTUREFLAG_NOPICMIP) && ((!q1bsp && !q3bsp) || r_picmipworld.integer)) - texflags |= TEXF_PICMIP | TEXF_COMPRESS; - if (primarylayer->clampmap) - texflags |= TEXF_CLAMP; - if (!(texture->skinframes[j] = R_SkinFrame_LoadExternal(primarylayer->texturename[j], texflags, false))) + if (!(texture->skinframes[j] = R_SkinFrame_LoadExternal(primarylayer->texturename[j], primarylayer->texflags, false))) { Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (frame %i) for shader ^2\"%s\"\n", loadmodel->name, primarylayer->texturename[j], j, texture->name); texture->skinframes[j] = R_SkinFrame_LoadMissing(); @@ -1794,9 +1804,9 @@ nothing GL_ZERO GL_ONE texture->backgroundskinframerate = backgroundlayer->framerate; for (j = 0;j < backgroundlayer->numframes;j++) { - if (!(texture->backgroundskinframes[j] = R_SkinFrame_LoadExternal(backgroundlayer->texturename[j], ((shader->surfaceparms & Q3SURFACEPARM_NOMIPMAPS) ? 0 : TEXF_MIPMAP) | TEXF_ALPHA | TEXF_PRECACHE | ((!r_picmipworld.integer || (shader->textureflags & Q3TEXTUREFLAG_NOPICMIP)) ? 0 : (TEXF_PICMIP | TEXF_COMPRESS)) | (backgroundlayer->clampmap ? TEXF_CLAMP : 0), false))) + if (!(texture->backgroundskinframes[j] = R_SkinFrame_LoadExternal(backgroundlayer->texturename[j], backgroundlayer->texflags, false))) { - Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (frame %i) for shader ^2\"%s\"\n", loadmodel->name, backgroundlayer->texturename[j], j, texture->name); + Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (background frame %i) for shader ^2\"%s\"\n", loadmodel->name, backgroundlayer->texturename[j], j, texture->name); texture->backgroundskinframes[j] = R_SkinFrame_LoadMissing(); } } @@ -1810,17 +1820,23 @@ nothing GL_ZERO GL_ONE Vector4Copy(shader->reflectcolor4f, texture->reflectcolor4f); texture->r_water_wateralpha = shader->r_water_wateralpha; } - else if (!strcmp(texture->name, "noshader")) + else if (!strcmp(texture->name, "noshader") || !texture->name[0]) { if (developer.integer >= 100) - Con_DPrintf("%s: using default handler for %s\n", loadmodel->name, name); + Con_Printf("^1%s:^7 using fallback noshader material for ^3\"%s\"\n", loadmodel->name, name); texture->surfaceparms = 0; } + else if (!strcmp(texture->name, "common/nodraw") || !strcmp(texture->name, "textures/common/nodraw")) + { + if (developer.integer >= 100) + Con_Printf("^1%s:^7 using fallback nodraw material for ^3\"%s\"\n", loadmodel->name, name); + texture->surfaceparms = 0; + texture->basematerialflags = MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW; + } else { - success = false; - if (developer.integer >= 100 || loadmodel->type == mod_brushq3) - Con_DPrintf("%s: No shader found for texture \"%s\"\n", loadmodel->name, texture->name); + if (developer.integer >= 100) + Con_Printf("^1%s:^7 No shader found for texture ^3\"%s\"\n", loadmodel->name, texture->name); texture->surfaceparms = 0; if (texture->surfaceflags & Q3SURFACEFLAG_NODRAW) texture->basematerialflags |= MATERIALFLAG_NODRAW | MATERIALFLAG_NOSHADOW; @@ -1829,9 +1845,15 @@ nothing GL_ZERO GL_ONE else texture->basematerialflags |= MATERIALFLAG_WALL; texture->numskinframes = 1; - if (!(texture->skinframes[0] = R_SkinFrame_LoadExternal(texture->name, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | (r_picmipworld.integer ? TEXF_PICMIP : 0) | TEXF_COMPRESS, false))) - if(developer.integer || q3bsp) // only the Q3BSP path provides no alternative (like loading image directly, or internal texture) - Con_Printf("^1%s:^7 could not load texture for missing shader ^3\"%s\"\n", loadmodel->name, texture->name); + if (fallback) + { + if (!(texture->skinframes[0] = R_SkinFrame_LoadExternal(texture->name, defaulttexflags, false))) + success = false; + } + else + success = false; + if (!success && warnmissing) + Con_Printf("^1%s:^7 could not load texture ^3\"%s\"\n", loadmodel->name, texture->name); } // init the animation variables texture->currentframe = texture; @@ -1916,7 +1938,8 @@ tag_torso, { if (words == 3) { - Con_DPrintf("Mod_LoadSkinFiles: parsed mesh \"%s\" shader replacement \"%s\"\n", word[1], word[2]); + if (developer_loading.integer) + Con_Printf("Mod_LoadSkinFiles: parsed mesh \"%s\" shader replacement \"%s\"\n", word[1], word[2]); skinfileitem = (skinfileitem_t *)Mem_Alloc(loadmodel->mempool, sizeof(skinfileitem_t)); skinfileitem->next = skinfile->items; skinfile->items = skinfileitem; @@ -1929,7 +1952,8 @@ tag_torso, else if (words == 2 && !strcmp(word[1], ",")) { // tag name, like "tag_weapon," - Con_DPrintf("Mod_LoadSkinFiles: parsed tag #%i \"%s\"\n", numtags, word[0]); + if (developer_loading.integer) + Con_Printf("Mod_LoadSkinFiles: parsed tag #%i \"%s\"\n", numtags, word[0]); memset(tags + numtags, 0, sizeof(tags[numtags])); strlcpy (tags[numtags].name, word[0], sizeof (tags[numtags].name)); numtags++; @@ -1937,7 +1961,8 @@ tag_torso, else if (words == 3 && !strcmp(word[1], ",")) { // mesh shader name, like "U_RArm,models/players/Legoman/BikerA1.tga" - Con_DPrintf("Mod_LoadSkinFiles: parsed mesh \"%s\" shader replacement \"%s\"\n", word[0], word[2]); + if (developer_loading.integer) + Con_Printf("Mod_LoadSkinFiles: parsed mesh \"%s\" shader replacement \"%s\"\n", word[0], word[2]); skinfileitem = (skinfileitem_t *)Mem_Alloc(loadmodel->mempool, sizeof(skinfileitem_t)); skinfileitem->next = skinfile->items; skinfile->items = skinfileitem; diff --git a/model_shared.h b/model_shared.h index 5bd0585f..7bcf180f 100644 --- a/model_shared.h +++ b/model_shared.h @@ -341,6 +341,7 @@ typedef struct q3shaderinfo_layer_s int clampmap; float framerate; int numframes; + int texflags; char** texturename; int blendfunc[2]; q3shaderinfo_layer_rgbgen_t rgbgen; @@ -931,7 +932,7 @@ void Mod_ShadowMesh_Free(shadowmesh_t *mesh); void Mod_LoadQ3Shaders(void); q3shaderinfo_t *Mod_LookupQ3Shader(const char *name); -qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean q1bsp, qboolean q3bsp, qboolean md3); +qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags); extern cvar_t r_mipskins; diff --git a/prvm_cmds.c b/prvm_cmds.c index 236ffc46..a50711bd 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -2555,7 +2555,7 @@ void VM_precache_pic(void) VM_CheckEmptyString (s); // AK Draw_CachePic is supposed to always return a valid pointer - if( Draw_CachePic(s, false)->tex == r_texture_notexture ) + if( Draw_CachePic_Flags(s, CACHEPICFLAG_NOTPERSISTENT)->tex == r_texture_notexture ) PRVM_G_INT(OFS_RETURN) = OFS_NULL; } @@ -2779,7 +2779,7 @@ void VM_drawpic(void) if(pos[2] || size[2]) Con_Printf("VM_drawpic: z value%s from %s discarded\n",(pos[2] && size[2]) ? "s" : " ",((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size"))); - DrawQ_Pic(pos[0], pos[1], Draw_CachePic(picname, true), size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag); + DrawQ_Pic(pos[0], pos[1], Draw_CachePic (picname), size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag); PRVM_G_FLOAT(OFS_RETURN) = 1; } /* @@ -2827,7 +2827,7 @@ void VM_drawsubpic(void) if(pos[2] || size[2]) Con_Printf("VM_drawsubpic: z value%s from %s discarded\n",(pos[2] && size[2]) ? "s" : " ",((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size"))); - DrawQ_SuperPic(pos[0], pos[1], Draw_CachePic(picname, true), + DrawQ_SuperPic(pos[0], pos[1], Draw_CachePic (picname), size[0], size[1], srcPos[0], srcPos[1], rgb[0], rgb[1], rgb[2], alpha, srcPos[0] + srcSize[0], srcPos[1], rgb[0], rgb[1], rgb[2], alpha, @@ -2922,7 +2922,7 @@ void VM_getimagesize(void) p = PRVM_G_STRING(OFS_PARM0); VM_CheckEmptyString (p); - pic = Draw_CachePic (p, false); + pic = Draw_CachePic_Flags (p, CACHEPICFLAG_NOTPERSISTENT); PRVM_G_VECTOR(OFS_RETURN)[0] = pic->width; PRVM_G_VECTOR(OFS_RETURN)[1] = pic->height; diff --git a/quakedef.h b/quakedef.h index efc228a0..2645945b 100644 --- a/quakedef.h +++ b/quakedef.h @@ -260,6 +260,8 @@ extern char engineversion[128]; extern qboolean noclip_anglehack; extern cvar_t developer; +extern cvar_t developer_loadfile; +extern cvar_t developer_loading; /* Preprocessor macros to identify platform DP_OS_NAME - "friendly" name of the OS, for humans to read diff --git a/r_shadow.c b/r_shadow.c index 365e2757..d9da45c1 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -995,12 +995,12 @@ static void R_Shadow_MakeTextures(void) R_Shadow_MakeTextures_MakeCorona(); // Editor light sprites - r_editlights_sprcursor = Draw_CachePic("gfx/editlights/cursor", true); - r_editlights_sprlight = Draw_CachePic("gfx/editlights/light", true); - r_editlights_sprnoshadowlight = Draw_CachePic("gfx/editlights/noshadow", true); - r_editlights_sprcubemaplight = Draw_CachePic("gfx/editlights/cubemaplight", true); - r_editlights_sprcubemapnoshadowlight = Draw_CachePic("gfx/editlights/cubemapnoshadowlight", true); - r_editlights_sprselection = Draw_CachePic("gfx/editlights/selection", true); + r_editlights_sprcursor = Draw_CachePic ("gfx/editlights/cursor"); + r_editlights_sprlight = Draw_CachePic ("gfx/editlights/light"); + r_editlights_sprnoshadowlight = Draw_CachePic ("gfx/editlights/noshadow"); + r_editlights_sprcubemaplight = Draw_CachePic ("gfx/editlights/cubemaplight"); + r_editlights_sprcubemapnoshadowlight = Draw_CachePic ("gfx/editlights/cubemapnoshadowlight"); + r_editlights_sprselection = Draw_CachePic ("gfx/editlights/selection"); } void R_Shadow_ValidateCvars(void) @@ -3389,6 +3389,9 @@ rtexture_t *R_Shadow_LoadCubemap(const char *basename) // if a cubemap loaded, upload it if (cubemappixels) { + if (developer_loading.integer) + Con_Printf("loading cubemap \"%s\"\n", basename); + if (!r_shadow_filters_texturepool) r_shadow_filters_texturepool = R_AllocTexturePool(); cubemaptexture = R_LoadTextureCubeMap(r_shadow_filters_texturepool, basename, cubemapsize, cubemappixels, TEXTYPE_BGRA, TEXF_PRECACHE | (gl_texturecompression_lightcubemaps.integer ? TEXF_COMPRESS : 0), NULL); @@ -3396,11 +3399,15 @@ rtexture_t *R_Shadow_LoadCubemap(const char *basename) } else { - Con_Printf("Failed to load Cubemap \"%s\", tried ", basename); - for (j = 0;j < 3;j++) - for (i = 0;i < 6;i++) - Con_Printf("%s\"%s%s.tga\"", j + i > 0 ? ", " : "", basename, suffix[j][i].suffix); - Con_Print(" and was unable to find any of them.\n"); + Con_DPrintf("failed to load cubemap \"%s\"\n", basename); + if (developer_loading.integer) + { + Con_Printf("(tried tried images "); + for (j = 0;j < 3;j++) + for (i = 0;i < 6;i++) + Con_Printf("%s\"%s%s.tga\"", j + i > 0 ? ", " : "", basename, suffix[j][i].suffix); + Con_Print(" and was unable to find any of them).\n"); + } } return cubemaptexture; } @@ -3423,6 +3430,14 @@ rtexture_t *R_Shadow_Cubemap(const char *basename) void R_Shadow_FreeCubemaps(void) { + int i; + for (i = 0;i < numcubemaps;i++) + { + if (developer_loading.integer) + Con_Printf("unloading cubemap \"%s\"\n", cubemaps[i].basename); + R_FreeTexture(cubemaps[i].texture); + } + numcubemaps = 0; R_FreeTexturePool(&r_shadow_filters_texturepool); } diff --git a/r_sky.c b/r_sky.c index 63df9efb..092fd8b1 100644 --- a/r_sky.c +++ b/r_sky.c @@ -76,12 +76,18 @@ R_SetSkyBox void R_UnloadSkyBox(void) { int i; + int c = 0; for (i = 0;i < 6;i++) { if (skyboxside[i]) + { R_FreeTexture(skyboxside[i]); + c++; + } skyboxside[i] = NULL; } + if (c && developer_loading.integer) + Con_Printf("unloading skybox\n"); } int R_LoadSkyBox(void) @@ -128,6 +134,9 @@ int R_LoadSkyBox(void) if (j == 3) return false; + if (developer_loading.integer) + Con_Printf("loading skybox \"%s\"\n", name); + return true; } diff --git a/sbar.c b/sbar.c index 01ee3e96..ef7a0bcb 100644 --- a/sbar.c +++ b/sbar.c @@ -153,209 +153,209 @@ void sbar_start(void) } else if (gamemode == GAME_SOM) { - sb_disc = Draw_CachePic("gfx/disc", true); + sb_disc = Draw_CachePic ("gfx/disc"); for (i = 0;i < 10;i++) - sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), true); - - somsb_health = Draw_CachePic("gfx/hud_health", true); - somsb_ammo[0] = Draw_CachePic("gfx/sb_shells", true); - somsb_ammo[1] = Draw_CachePic("gfx/sb_nails", true); - somsb_ammo[2] = Draw_CachePic("gfx/sb_rocket", true); - somsb_ammo[3] = Draw_CachePic("gfx/sb_cells", true); - somsb_armor[0] = Draw_CachePic("gfx/sb_armor1", true); - somsb_armor[1] = Draw_CachePic("gfx/sb_armor2", true); - somsb_armor[2] = Draw_CachePic("gfx/sb_armor3", true); + sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i)); + + somsb_health = Draw_CachePic ("gfx/hud_health"); + somsb_ammo[0] = Draw_CachePic ("gfx/sb_shells"); + somsb_ammo[1] = Draw_CachePic ("gfx/sb_nails"); + somsb_ammo[2] = Draw_CachePic ("gfx/sb_rocket"); + somsb_ammo[3] = Draw_CachePic ("gfx/sb_cells"); + somsb_armor[0] = Draw_CachePic ("gfx/sb_armor1"); + somsb_armor[1] = Draw_CachePic ("gfx/sb_armor2"); + somsb_armor[2] = Draw_CachePic ("gfx/sb_armor3"); } else if (gamemode == GAME_NEXUIZ) { for (i = 0;i < 10;i++) - sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), true); - sb_nums[0][10] = Draw_CachePic ("gfx/num_minus", true); - sb_colon = Draw_CachePic ("gfx/num_colon", true); + sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i)); + sb_nums[0][10] = Draw_CachePic ("gfx/num_minus"); + sb_colon = Draw_CachePic ("gfx/num_colon"); - sb_ammo[0] = Draw_CachePic ("gfx/sb_shells", true); - sb_ammo[1] = Draw_CachePic ("gfx/sb_bullets", true); - sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket", true); - sb_ammo[3] = Draw_CachePic ("gfx/sb_cells", true); + sb_ammo[0] = Draw_CachePic ("gfx/sb_shells"); + sb_ammo[1] = Draw_CachePic ("gfx/sb_bullets"); + sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket"); + sb_ammo[3] = Draw_CachePic ("gfx/sb_cells"); - sb_armor[0] = Draw_CachePic ("gfx/sb_armor", true); + sb_armor[0] = Draw_CachePic ("gfx/sb_armor"); sb_armor[1] = NULL; sb_armor[2] = NULL; - sb_health = Draw_CachePic ("gfx/sb_health", true); + sb_health = Draw_CachePic ("gfx/sb_health"); - sb_items[2] = Draw_CachePic ("gfx/sb_slowmo", true); - sb_items[3] = Draw_CachePic ("gfx/sb_invinc", true); - sb_items[4] = Draw_CachePic ("gfx/sb_energy", true); - sb_items[5] = Draw_CachePic ("gfx/sb_str", true); + sb_items[2] = Draw_CachePic ("gfx/sb_slowmo"); + sb_items[3] = Draw_CachePic ("gfx/sb_invinc"); + sb_items[4] = Draw_CachePic ("gfx/sb_energy"); + sb_items[5] = Draw_CachePic ("gfx/sb_str"); - sb_items[11] = Draw_CachePic ("gfx/sb_flag_red_taken", true); - sb_items[12] = Draw_CachePic ("gfx/sb_flag_red_lost", true); - sb_items[13] = Draw_CachePic ("gfx/sb_flag_red_carrying", true); - sb_items[14] = Draw_CachePic ("gfx/sb_key_carrying", true); - sb_items[15] = Draw_CachePic ("gfx/sb_flag_blue_taken", true); - sb_items[16] = Draw_CachePic ("gfx/sb_flag_blue_lost", true); - sb_items[17] = Draw_CachePic ("gfx/sb_flag_blue_carrying", true); + sb_items[11] = Draw_CachePic ("gfx/sb_flag_red_taken"); + sb_items[12] = Draw_CachePic ("gfx/sb_flag_red_lost"); + sb_items[13] = Draw_CachePic ("gfx/sb_flag_red_carrying"); + sb_items[14] = Draw_CachePic ("gfx/sb_key_carrying"); + sb_items[15] = Draw_CachePic ("gfx/sb_flag_blue_taken"); + sb_items[16] = Draw_CachePic ("gfx/sb_flag_blue_lost"); + sb_items[17] = Draw_CachePic ("gfx/sb_flag_blue_carrying"); - sb_sbar = Draw_CachePic("gfx/sbar", true); - sb_sbar_minimal = Draw_CachePic("gfx/sbar_minimal", true); - sb_sbar_overlay = Draw_CachePic("gfx/sbar_overlay", true); + sb_sbar = Draw_CachePic ("gfx/sbar"); + sb_sbar_minimal = Draw_CachePic ("gfx/sbar_minimal"); + sb_sbar_overlay = Draw_CachePic ("gfx/sbar_overlay"); for(i = 0; i < 9;i++) - sb_weapons[0][i] = Draw_CachePic(va("gfx/inv_weapon%i",i), true); + sb_weapons[0][i] = Draw_CachePic (va("gfx/inv_weapon%i",i)); } else if (gamemode == GAME_ZYMOTIC) { - zymsb_crosshair_center = Draw_CachePic ("gfx/hud/crosshair_center", true); - zymsb_crosshair_line = Draw_CachePic ("gfx/hud/crosshair_line", true); - zymsb_crosshair_health = Draw_CachePic ("gfx/hud/crosshair_health", true); - zymsb_crosshair_clip = Draw_CachePic ("gfx/hud/crosshair_clip", true); - zymsb_crosshair_ammo = Draw_CachePic ("gfx/hud/crosshair_ammo", true); - zymsb_crosshair_background = Draw_CachePic ("gfx/hud/crosshair_background", true); - zymsb_crosshair_left1 = Draw_CachePic ("gfx/hud/crosshair_left1", true); - zymsb_crosshair_left2 = Draw_CachePic ("gfx/hud/crosshair_left2", true); - zymsb_crosshair_right = Draw_CachePic ("gfx/hud/crosshair_right", true); + zymsb_crosshair_center = Draw_CachePic ("gfx/hud/crosshair_center"); + zymsb_crosshair_line = Draw_CachePic ("gfx/hud/crosshair_line"); + zymsb_crosshair_health = Draw_CachePic ("gfx/hud/crosshair_health"); + zymsb_crosshair_clip = Draw_CachePic ("gfx/hud/crosshair_clip"); + zymsb_crosshair_ammo = Draw_CachePic ("gfx/hud/crosshair_ammo"); + zymsb_crosshair_background = Draw_CachePic ("gfx/hud/crosshair_background"); + zymsb_crosshair_left1 = Draw_CachePic ("gfx/hud/crosshair_left1"); + zymsb_crosshair_left2 = Draw_CachePic ("gfx/hud/crosshair_left2"); + zymsb_crosshair_right = Draw_CachePic ("gfx/hud/crosshair_right"); } else { - sb_disc = Draw_CachePic("gfx/disc", true); + sb_disc = Draw_CachePic ("gfx/disc"); for (i = 0;i < 10;i++) { - sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i), true); - sb_nums[1][i] = Draw_CachePic (va("gfx/anum_%i",i), true); + sb_nums[0][i] = Draw_CachePic (va("gfx/num_%i",i)); + sb_nums[1][i] = Draw_CachePic (va("gfx/anum_%i",i)); } - sb_nums[0][10] = Draw_CachePic ("gfx/num_minus", true); - sb_nums[1][10] = Draw_CachePic ("gfx/anum_minus", true); + sb_nums[0][10] = Draw_CachePic ("gfx/num_minus"); + sb_nums[1][10] = Draw_CachePic ("gfx/anum_minus"); - sb_colon = Draw_CachePic ("gfx/num_colon", true); - sb_slash = Draw_CachePic ("gfx/num_slash", true); + sb_colon = Draw_CachePic ("gfx/num_colon"); + sb_slash = Draw_CachePic ("gfx/num_slash"); - sb_weapons[0][0] = Draw_CachePic ("gfx/inv_shotgun", true); - sb_weapons[0][1] = Draw_CachePic ("gfx/inv_sshotgun", true); - sb_weapons[0][2] = Draw_CachePic ("gfx/inv_nailgun", true); - sb_weapons[0][3] = Draw_CachePic ("gfx/inv_snailgun", true); - sb_weapons[0][4] = Draw_CachePic ("gfx/inv_rlaunch", true); - sb_weapons[0][5] = Draw_CachePic ("gfx/inv_srlaunch", true); - sb_weapons[0][6] = Draw_CachePic ("gfx/inv_lightng", true); + sb_weapons[0][0] = Draw_CachePic ("gfx/inv_shotgun"); + sb_weapons[0][1] = Draw_CachePic ("gfx/inv_sshotgun"); + sb_weapons[0][2] = Draw_CachePic ("gfx/inv_nailgun"); + sb_weapons[0][3] = Draw_CachePic ("gfx/inv_snailgun"); + sb_weapons[0][4] = Draw_CachePic ("gfx/inv_rlaunch"); + sb_weapons[0][5] = Draw_CachePic ("gfx/inv_srlaunch"); + sb_weapons[0][6] = Draw_CachePic ("gfx/inv_lightng"); - sb_weapons[1][0] = Draw_CachePic ("gfx/inv2_shotgun", true); - sb_weapons[1][1] = Draw_CachePic ("gfx/inv2_sshotgun", true); - sb_weapons[1][2] = Draw_CachePic ("gfx/inv2_nailgun", true); - sb_weapons[1][3] = Draw_CachePic ("gfx/inv2_snailgun", true); - sb_weapons[1][4] = Draw_CachePic ("gfx/inv2_rlaunch", true); - sb_weapons[1][5] = Draw_CachePic ("gfx/inv2_srlaunch", true); - sb_weapons[1][6] = Draw_CachePic ("gfx/inv2_lightng", true); + sb_weapons[1][0] = Draw_CachePic ("gfx/inv2_shotgun"); + sb_weapons[1][1] = Draw_CachePic ("gfx/inv2_sshotgun"); + sb_weapons[1][2] = Draw_CachePic ("gfx/inv2_nailgun"); + sb_weapons[1][3] = Draw_CachePic ("gfx/inv2_snailgun"); + sb_weapons[1][4] = Draw_CachePic ("gfx/inv2_rlaunch"); + sb_weapons[1][5] = Draw_CachePic ("gfx/inv2_srlaunch"); + sb_weapons[1][6] = Draw_CachePic ("gfx/inv2_lightng"); for (i = 0;i < 5;i++) { - sb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_shotgun",i+1), true); - sb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_sshotgun",i+1), true); - sb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_nailgun",i+1), true); - sb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_snailgun",i+1), true); - sb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_rlaunch",i+1), true); - sb_weapons[2+i][5] = Draw_CachePic (va("gfx/inva%i_srlaunch",i+1), true); - sb_weapons[2+i][6] = Draw_CachePic (va("gfx/inva%i_lightng",i+1), true); + sb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_shotgun",i+1)); + sb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_sshotgun",i+1)); + sb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_nailgun",i+1)); + sb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_snailgun",i+1)); + sb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_rlaunch",i+1)); + sb_weapons[2+i][5] = Draw_CachePic (va("gfx/inva%i_srlaunch",i+1)); + sb_weapons[2+i][6] = Draw_CachePic (va("gfx/inva%i_lightng",i+1)); } - sb_ammo[0] = Draw_CachePic ("gfx/sb_shells", true); - sb_ammo[1] = Draw_CachePic ("gfx/sb_nails", true); - sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket", true); - sb_ammo[3] = Draw_CachePic ("gfx/sb_cells", true); - - sb_armor[0] = Draw_CachePic ("gfx/sb_armor1", true); - sb_armor[1] = Draw_CachePic ("gfx/sb_armor2", true); - sb_armor[2] = Draw_CachePic ("gfx/sb_armor3", true); - - sb_items[0] = Draw_CachePic ("gfx/sb_key1", true); - sb_items[1] = Draw_CachePic ("gfx/sb_key2", true); - sb_items[2] = Draw_CachePic ("gfx/sb_invis", true); - sb_items[3] = Draw_CachePic ("gfx/sb_invuln", true); - sb_items[4] = Draw_CachePic ("gfx/sb_suit", true); - sb_items[5] = Draw_CachePic ("gfx/sb_quad", true); - - sb_sigil[0] = Draw_CachePic ("gfx/sb_sigil1", true); - sb_sigil[1] = Draw_CachePic ("gfx/sb_sigil2", true); - sb_sigil[2] = Draw_CachePic ("gfx/sb_sigil3", true); - sb_sigil[3] = Draw_CachePic ("gfx/sb_sigil4", true); - - sb_faces[4][0] = Draw_CachePic ("gfx/face1", true); - sb_faces[4][1] = Draw_CachePic ("gfx/face_p1", true); - sb_faces[3][0] = Draw_CachePic ("gfx/face2", true); - sb_faces[3][1] = Draw_CachePic ("gfx/face_p2", true); - sb_faces[2][0] = Draw_CachePic ("gfx/face3", true); - sb_faces[2][1] = Draw_CachePic ("gfx/face_p3", true); - sb_faces[1][0] = Draw_CachePic ("gfx/face4", true); - sb_faces[1][1] = Draw_CachePic ("gfx/face_p4", true); - sb_faces[0][0] = Draw_CachePic ("gfx/face5", true); - sb_faces[0][1] = Draw_CachePic ("gfx/face_p5", true); - - sb_face_invis = Draw_CachePic ("gfx/face_invis", true); - sb_face_invuln = Draw_CachePic ("gfx/face_invul2", true); - sb_face_invis_invuln = Draw_CachePic ("gfx/face_inv2", true); - sb_face_quad = Draw_CachePic ("gfx/face_quad", true); - - sb_sbar = Draw_CachePic ("gfx/sbar", true); - sb_ibar = Draw_CachePic ("gfx/ibar", true); - sb_scorebar = Draw_CachePic ("gfx/scorebar", true); + sb_ammo[0] = Draw_CachePic ("gfx/sb_shells"); + sb_ammo[1] = Draw_CachePic ("gfx/sb_nails"); + sb_ammo[2] = Draw_CachePic ("gfx/sb_rocket"); + sb_ammo[3] = Draw_CachePic ("gfx/sb_cells"); + + sb_armor[0] = Draw_CachePic ("gfx/sb_armor1"); + sb_armor[1] = Draw_CachePic ("gfx/sb_armor2"); + sb_armor[2] = Draw_CachePic ("gfx/sb_armor3"); + + sb_items[0] = Draw_CachePic ("gfx/sb_key1"); + sb_items[1] = Draw_CachePic ("gfx/sb_key2"); + sb_items[2] = Draw_CachePic ("gfx/sb_invis"); + sb_items[3] = Draw_CachePic ("gfx/sb_invuln"); + sb_items[4] = Draw_CachePic ("gfx/sb_suit"); + sb_items[5] = Draw_CachePic ("gfx/sb_quad"); + + sb_sigil[0] = Draw_CachePic ("gfx/sb_sigil1"); + sb_sigil[1] = Draw_CachePic ("gfx/sb_sigil2"); + sb_sigil[2] = Draw_CachePic ("gfx/sb_sigil3"); + sb_sigil[3] = Draw_CachePic ("gfx/sb_sigil4"); + + sb_faces[4][0] = Draw_CachePic ("gfx/face1"); + sb_faces[4][1] = Draw_CachePic ("gfx/face_p1"); + sb_faces[3][0] = Draw_CachePic ("gfx/face2"); + sb_faces[3][1] = Draw_CachePic ("gfx/face_p2"); + sb_faces[2][0] = Draw_CachePic ("gfx/face3"); + sb_faces[2][1] = Draw_CachePic ("gfx/face_p3"); + sb_faces[1][0] = Draw_CachePic ("gfx/face4"); + sb_faces[1][1] = Draw_CachePic ("gfx/face_p4"); + sb_faces[0][0] = Draw_CachePic ("gfx/face5"); + sb_faces[0][1] = Draw_CachePic ("gfx/face_p5"); + + sb_face_invis = Draw_CachePic ("gfx/face_invis"); + sb_face_invuln = Draw_CachePic ("gfx/face_invul2"); + sb_face_invis_invuln = Draw_CachePic ("gfx/face_inv2"); + sb_face_quad = Draw_CachePic ("gfx/face_quad"); + + sb_sbar = Draw_CachePic ("gfx/sbar"); + sb_ibar = Draw_CachePic ("gfx/ibar"); + sb_scorebar = Draw_CachePic ("gfx/scorebar"); //MED 01/04/97 added new hipnotic weapons if (gamemode == GAME_HIPNOTIC) { - hsb_weapons[0][0] = Draw_CachePic ("gfx/inv_laser", true); - hsb_weapons[0][1] = Draw_CachePic ("gfx/inv_mjolnir", true); - hsb_weapons[0][2] = Draw_CachePic ("gfx/inv_gren_prox", true); - hsb_weapons[0][3] = Draw_CachePic ("gfx/inv_prox_gren", true); - hsb_weapons[0][4] = Draw_CachePic ("gfx/inv_prox", true); - - hsb_weapons[1][0] = Draw_CachePic ("gfx/inv2_laser", true); - hsb_weapons[1][1] = Draw_CachePic ("gfx/inv2_mjolnir", true); - hsb_weapons[1][2] = Draw_CachePic ("gfx/inv2_gren_prox", true); - hsb_weapons[1][3] = Draw_CachePic ("gfx/inv2_prox_gren", true); - hsb_weapons[1][4] = Draw_CachePic ("gfx/inv2_prox", true); + hsb_weapons[0][0] = Draw_CachePic ("gfx/inv_laser"); + hsb_weapons[0][1] = Draw_CachePic ("gfx/inv_mjolnir"); + hsb_weapons[0][2] = Draw_CachePic ("gfx/inv_gren_prox"); + hsb_weapons[0][3] = Draw_CachePic ("gfx/inv_prox_gren"); + hsb_weapons[0][4] = Draw_CachePic ("gfx/inv_prox"); + + hsb_weapons[1][0] = Draw_CachePic ("gfx/inv2_laser"); + hsb_weapons[1][1] = Draw_CachePic ("gfx/inv2_mjolnir"); + hsb_weapons[1][2] = Draw_CachePic ("gfx/inv2_gren_prox"); + hsb_weapons[1][3] = Draw_CachePic ("gfx/inv2_prox_gren"); + hsb_weapons[1][4] = Draw_CachePic ("gfx/inv2_prox"); for (i = 0;i < 5;i++) { - hsb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_laser",i+1), true); - hsb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_mjolnir",i+1), true); - hsb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_gren_prox",i+1), true); - hsb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_prox_gren",i+1), true); - hsb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_prox",i+1), true); + hsb_weapons[2+i][0] = Draw_CachePic (va("gfx/inva%i_laser",i+1)); + hsb_weapons[2+i][1] = Draw_CachePic (va("gfx/inva%i_mjolnir",i+1)); + hsb_weapons[2+i][2] = Draw_CachePic (va("gfx/inva%i_gren_prox",i+1)); + hsb_weapons[2+i][3] = Draw_CachePic (va("gfx/inva%i_prox_gren",i+1)); + hsb_weapons[2+i][4] = Draw_CachePic (va("gfx/inva%i_prox",i+1)); } - hsb_items[0] = Draw_CachePic ("gfx/sb_wsuit", true); - hsb_items[1] = Draw_CachePic ("gfx/sb_eshld", true); + hsb_items[0] = Draw_CachePic ("gfx/sb_wsuit"); + hsb_items[1] = Draw_CachePic ("gfx/sb_eshld"); } else if (gamemode == GAME_ROGUE) { - rsb_invbar[0] = Draw_CachePic ("gfx/r_invbar1", true); - rsb_invbar[1] = Draw_CachePic ("gfx/r_invbar2", true); + rsb_invbar[0] = Draw_CachePic ("gfx/r_invbar1"); + rsb_invbar[1] = Draw_CachePic ("gfx/r_invbar2"); - rsb_weapons[0] = Draw_CachePic ("gfx/r_lava", true); - rsb_weapons[1] = Draw_CachePic ("gfx/r_superlava", true); - rsb_weapons[2] = Draw_CachePic ("gfx/r_gren", true); - rsb_weapons[3] = Draw_CachePic ("gfx/r_multirock", true); - rsb_weapons[4] = Draw_CachePic ("gfx/r_plasma", true); + rsb_weapons[0] = Draw_CachePic ("gfx/r_lava"); + rsb_weapons[1] = Draw_CachePic ("gfx/r_superlava"); + rsb_weapons[2] = Draw_CachePic ("gfx/r_gren"); + rsb_weapons[3] = Draw_CachePic ("gfx/r_multirock"); + rsb_weapons[4] = Draw_CachePic ("gfx/r_plasma"); - rsb_items[0] = Draw_CachePic ("gfx/r_shield1", true); - rsb_items[1] = Draw_CachePic ("gfx/r_agrav1", true); + rsb_items[0] = Draw_CachePic ("gfx/r_shield1"); + rsb_items[1] = Draw_CachePic ("gfx/r_agrav1"); // PGM 01/19/97 - team color border - rsb_teambord = Draw_CachePic ("gfx/r_teambord", true); + rsb_teambord = Draw_CachePic ("gfx/r_teambord"); // PGM 01/19/97 - team color border - rsb_ammo[0] = Draw_CachePic ("gfx/r_ammolava", true); - rsb_ammo[1] = Draw_CachePic ("gfx/r_ammomulti", true); - rsb_ammo[2] = Draw_CachePic ("gfx/r_ammoplasma", true); + rsb_ammo[0] = Draw_CachePic ("gfx/r_ammolava"); + rsb_ammo[1] = Draw_CachePic ("gfx/r_ammomulti"); + rsb_ammo[2] = Draw_CachePic ("gfx/r_ammoplasma"); } } - sb_ranking = Draw_CachePic ("gfx/ranking", true); - sb_complete = Draw_CachePic ("gfx/complete", true); - sb_inter = Draw_CachePic ("gfx/inter", true); - sb_finale = Draw_CachePic ("gfx/finale", true); + sb_ranking = Draw_CachePic ("gfx/ranking"); + sb_complete = Draw_CachePic ("gfx/complete"); + sb_inter = Draw_CachePic ("gfx/inter"); + sb_finale = Draw_CachePic ("gfx/finale"); } void sbar_shutdown(void) @@ -1637,12 +1637,12 @@ void Sbar_Draw (void) if (cl.csqc_vidvars.drawcrosshair && crosshair.integer >= 1 && !cl.intermission && !r_letterbox.value) { - pic = Draw_CachePic(va("gfx/crosshair%i", crosshair.integer), true); + pic = Draw_CachePic (va("gfx/crosshair%i", crosshair.integer)); DrawQ_Pic((vid_conwidth.integer - pic->width * crosshair_size.value) * 0.5f, (vid_conheight.integer - pic->height * crosshair_size.value) * 0.5f, pic, pic->width * crosshair_size.value, pic->height * crosshair_size.value, crosshair_color_red.value, crosshair_color_green.value, crosshair_color_blue.value, crosshair_color_alpha.value, 0); } if (cl_prydoncursor.integer) - DrawQ_Pic((cl.cmd.cursor_screen[0] + 1) * 0.5 * vid_conwidth.integer, (cl.cmd.cursor_screen[1] + 1) * 0.5 * vid_conheight.integer, Draw_CachePic(va("gfx/prydoncursor%03i", cl_prydoncursor.integer), true), 0, 0, 1, 1, 1, 1, 0); + DrawQ_Pic((cl.cmd.cursor_screen[0] + 1) * 0.5 * vid_conwidth.integer, (cl.cmd.cursor_screen[1] + 1) * 0.5 * vid_conheight.integer, Draw_CachePic (va("gfx/prydoncursor%03i", cl_prydoncursor.integer)), 0, 0, 1, 1, 1, 1, 0); } //============================================================================= diff --git a/snd_alsa.c b/snd_alsa.c index 96c8b2d1..7f15da37 100644 --- a/snd_alsa.c +++ b/snd_alsa.c @@ -105,7 +105,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) pcm_name = com_argv[i + 1]; // Open the audio device - Con_DPrintf ("SndSys_Init: PCM device is \"%s\"\n", pcm_name); + Con_Printf ("SndSys_Init: PCM device is \"%s\"\n", pcm_name); err = snd_pcm_open (&pcm_handle, pcm_name, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); if (err != 0) { @@ -259,7 +259,7 @@ static qboolean SndSys_Recover (int err_num) err = snd_pcm_prepare (pcm_handle); if (err != 0) { - Con_DPrintf ("SndSys_Recover: unable to recover (%s)\n", + Con_Printf ("SndSys_Recover: unable to recover (%s)\n", snd_strerror (err)); // TOCHECK: should we stop the playback ? diff --git a/snd_coreaudio.c b/snd_coreaudio.c index c9f6c1e7..e3a934c3 100644 --- a/snd_coreaudio.c +++ b/snd_coreaudio.c @@ -189,7 +189,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) return false; } submissionChunk /= requested->channels; - Con_DPrintf(" Chunk size = %d sample frames\n", submissionChunk); + Con_Printf(" Chunk size = %d sample frames\n", submissionChunk); // Print out the device status propertySize = sizeof(streamDesc); @@ -200,18 +200,18 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) return false; } - Con_DPrint (" Hardware format:\n"); - Con_DPrintf(" %5d mSampleRate\n", (unsigned int)streamDesc.mSampleRate); - Con_DPrintf(" %c%c%c%c mFormatID\n", + Con_Print (" Hardware format:\n"); + Con_Printf(" %5d mSampleRate\n", (unsigned int)streamDesc.mSampleRate); + Con_Printf(" %c%c%c%c mFormatID\n", (char)(streamDesc.mFormatID >> 24), (char)(streamDesc.mFormatID >> 16), (char)(streamDesc.mFormatID >> 8), (char)(streamDesc.mFormatID >> 0)); - Con_DPrintf(" %5u mBytesPerPacket\n", (unsigned int)streamDesc.mBytesPerPacket); - Con_DPrintf(" %5u mFramesPerPacket\n", (unsigned int)streamDesc.mFramesPerPacket); - Con_DPrintf(" %5u mBytesPerFrame\n", (unsigned int)streamDesc.mBytesPerFrame); - Con_DPrintf(" %5u mChannelsPerFrame\n", (unsigned int)streamDesc.mChannelsPerFrame); - Con_DPrintf(" %5u mBitsPerChannel\n", (unsigned int)streamDesc.mBitsPerChannel); + Con_Printf(" %5u mBytesPerPacket\n", (unsigned int)streamDesc.mBytesPerPacket); + Con_Printf(" %5u mFramesPerPacket\n", (unsigned int)streamDesc.mFramesPerPacket); + Con_Printf(" %5u mBytesPerFrame\n", (unsigned int)streamDesc.mBytesPerFrame); + Con_Printf(" %5u mChannelsPerFrame\n", (unsigned int)streamDesc.mChannelsPerFrame); + Con_Printf(" %5u mBitsPerChannel\n", (unsigned int)streamDesc.mBitsPerChannel); // Suggest proper settings if they differ if (requested->channels != streamDesc.mChannelsPerFrame || requested->speed != streamDesc.mSampleRate) diff --git a/snd_main.c b/snd_main.c index 03b1358d..35be85ed 100644 --- a/snd_main.c +++ b/snd_main.c @@ -593,7 +593,7 @@ void S_Startup (void) accepted = false; do { - Con_DPrintf("S_Startup: initializing sound output format: %dHz, %d bit, %d channels...\n", + Con_Printf("S_Startup: initializing sound output format: %dHz, %d bit, %d channels...\n", chosen_fmt.speed, chosen_fmt.width * 8, chosen_fmt.channels); @@ -602,7 +602,7 @@ void S_Startup (void) if (!accepted) { - Con_DPrintf("S_Startup: sound output initialization FAILED\n"); + Con_Printf("S_Startup: sound output initialization FAILED\n"); // If the module is suggesting another one if (suggest_fmt.speed != 0) @@ -658,7 +658,7 @@ void S_Startup (void) // some modules write directly to a shared (DMA) buffer extrasoundtime = oldpaintedtime + snd_renderbuffer->maxframes - 1; extrasoundtime -= extrasoundtime % snd_renderbuffer->maxframes; - Con_DPrintf("S_Startup: extra sound time = %u\n", extrasoundtime); + Con_Printf("S_Startup: extra sound time = %u\n", extrasoundtime); soundtime = extrasoundtime; } @@ -709,8 +709,6 @@ S_Init */ void S_Init(void) { - Con_DPrint("\nSound Initialization\n"); - Cvar_RegisterVariable(&volume); Cvar_RegisterVariable(&bgmvolume); Cvar_RegisterVariable(&snd_staticvolume); @@ -870,7 +868,8 @@ void S_FreeSfx (sfx_t *sfx, qboolean force) if (!force && (sfx->locks > 0 || (sfx->flags & SFXFLAG_PERMANENTLOCK))) return; - Con_DPrintf ("S_FreeSfx: freeing %s\n", sfx->name); + if (developer_loading.integer) + Con_Printf ("unloading sound %s\n", sfx->name); // Remove it from the list of known sfx if (sfx == known_sfx) @@ -1393,7 +1392,7 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float fvol, float attenuation) return; if (!sfx->fetcher) { - Con_DPrintf ("S_StaticSound: \"%s\" hasn't been precached\n", sfx->name); + Con_Printf ("S_StaticSound: \"%s\" hasn't been precached\n", sfx->name); return; } diff --git a/snd_mem.c b/snd_mem.c index a6cb234e..2678da63 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -323,16 +323,14 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) // Initialize volume peak to 0; if ReplayGain is supported, the loader will change this away sfx->volume_peak = 0.0; + if (developer_loading.integer) + Con_Printf("loading sound %s\n", sfx->name); + // LordHavoc: if the sound filename does not begin with sound/, try adding it if (strncasecmp(sfx->name, "sound/", 6)) { - len = dpsnprintf (namebuffer, sizeof(namebuffer), "sound/%s", sfx->name); - if (len < 0) - { - // name too long - Con_DPrintf("S_LoadSound: name \"%s\" is too long\n", sfx->name); - return false; - } + dpsnprintf (namebuffer, sizeof(namebuffer), "sound/%s", sfx->name); + len = strlen(namebuffer); if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav")) { if (S_LoadWavFile (namebuffer, sfx)) @@ -352,13 +350,8 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) } // LordHavoc: then try without the added sound/ as wav and ogg - len = dpsnprintf (namebuffer, sizeof(namebuffer), "%s", sfx->name); - if (len < 0) - { - // name too long - Con_DPrintf("S_LoadSound: name \"%s\" is too long\n", sfx->name); - return false; - } + dpsnprintf (namebuffer, sizeof(namebuffer), "%s", sfx->name); + len = strlen(namebuffer); // request foo.wav: tries foo.wav, then foo.ogg // request foo.ogg: tries foo.ogg only // request foo.mod: tries foo.mod only @@ -382,6 +375,6 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) // Can't load the sound! sfx->flags |= SFXFLAG_FILEMISSING; if (complain) - Con_DPrintf("S_LoadSound: Couldn't load \"%s\"\n", sfx->name); + Con_DPrintf("failed to load sound \"%s\"\n", sfx->name); return false; } diff --git a/snd_modplug.c b/snd_modplug.c index 5b9d7f7b..a3179868 100644 --- a/snd_modplug.c +++ b/snd_modplug.c @@ -155,15 +155,7 @@ qboolean ModPlug_OpenLibrary (void) // Load the DLLs // We need to load both by hand because some OSes seem to not load // the modplug DLL automatically when loading the modplugFile DLL - if (! Sys_LoadLibrary (dllnames_modplug, &modplug_dll, modplugfuncs)) - { - Sys_UnloadLibrary (&modplug_dll); - Con_Printf ("ModPlug support disabled\n"); - return false; - } - - Con_Printf ("ModPlug support enabled\n"); - return true; + return Sys_LoadLibrary (dllnames_modplug, &modplug_dll, modplugfuncs); } @@ -440,7 +432,8 @@ qboolean ModPlug_LoadModPlugFile (const char *filename, sfx_t *sfx) if (data == NULL) return false; - Con_DPrintf ("Loading ModPlug file \"%s\"\n", filename); + if (developer_loading.integer >= 2) + Con_Printf ("Loading ModPlug file \"%s\"\n", filename); ModPlug_GetSettings(&s); s.mFlags = MODPLUG_ENABLE_OVERSAMPLING | MODPLUG_ENABLE_NOISE_REDUCTION | MODPLUG_ENABLE_REVERB; @@ -459,7 +452,8 @@ qboolean ModPlug_LoadModPlugFile (const char *filename, sfx_t *sfx) return false; } - Con_DPrintf ("\"%s\" will be streamed\n", filename); + if (developer_loading.integer >= 2) + Con_Printf ("\"%s\" will be streamed\n", filename); per_sfx = (modplug_stream_persfx_t *)Mem_Alloc (snd_mempool, sizeof (*per_sfx)); strlcpy(per_sfx->name, sfx->name, sizeof(per_sfx->name)); sfx->memsize += sizeof (*per_sfx); diff --git a/snd_ogg.c b/snd_ogg.c index 75b12d1b..316e838f 100644 --- a/snd_ogg.c +++ b/snd_ogg.c @@ -353,16 +353,7 @@ qboolean OGG_OpenLibrary (void) // Load the DLLs // We need to load both by hand because some OSes seem to not load // the vorbis DLL automatically when loading the VorbisFile DLL - if (! Sys_LoadLibrary (dllnames_vo, &vo_dll, vorbisfuncs) || - ! Sys_LoadLibrary (dllnames_vf, &vf_dll, vorbisfilefuncs)) - { - Sys_UnloadLibrary (&vo_dll); - Con_Printf ("Ogg Vorbis support disabled\n"); - return false; - } - - Con_Printf ("Ogg Vorbis support enabled\n"); - return true; + return Sys_LoadLibrary (dllnames_vo, &vo_dll, vorbisfuncs) && Sys_LoadLibrary (dllnames_vf, &vf_dll, vorbisfilefuncs); } @@ -644,7 +635,8 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *sfx) if (data == NULL) return false; - Con_DPrintf ("Loading Ogg Vorbis file \"%s\"\n", filename); + if (developer_loading.integer >= 2) + Con_Printf ("Loading Ogg Vorbis file \"%s\"\n", filename); // Open it with the VorbisFile API ov_decode.buffer = data; @@ -676,7 +668,8 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *sfx) { ogg_stream_persfx_t* per_sfx; - Con_DPrintf ("\"%s\" will be streamed\n", filename); + if (developer_loading.integer >= 2) + Con_Printf ("Ogg sound file \"%s\" will be streamed\n", filename); per_sfx = (ogg_stream_persfx_t *)Mem_Alloc (snd_mempool, sizeof (*per_sfx)); strlcpy(per_sfx->name, sfx->name, sizeof(per_sfx->name)); sfx->memsize += sizeof (*per_sfx); @@ -716,7 +709,8 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *sfx) snd_buffer_t *sb; snd_format_t ogg_format; - Con_DPrintf ("\"%s\" will be cached\n", filename); + if (developer_loading.integer >= 2) + Con_Printf ("Ogg sound file \"%s\" will be cached\n", filename); // Decode it buff = (char *)Mem_Alloc (snd_mempool, (int)len); @@ -774,7 +768,8 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *sfx) { sfx->volume_mult = min(1 / peak, exp(gaindb * 0.05 * log(10))); sfx->volume_peak = peak; - Con_DPrintf ("\"%s\" uses ReplayGain (gain %f, peak %f)\n", filename, sfx->volume_mult, sfx->volume_peak); + if (developer_loading.integer >= 2) + Con_Printf ("Ogg sound file \"%s\" uses ReplayGain (gain %f, peak %f)\n", filename, sfx->volume_mult, sfx->volume_peak); } return true; diff --git a/snd_sdl.c b/snd_sdl.c index 64f0dde6..83538534 100644 --- a/snd_sdl.c +++ b/snd_sdl.c @@ -63,7 +63,7 @@ static void Buffer_Callback (void *userdata, Uint8 *stream, int len) snd_renderbuffer->startframe += FrameCount; if (FrameCount < RequestedFrames && developer.integer >= 1000 && vid_activewindow) - Con_DPrintf("SDL sound: %u sample frames missing\n", RequestedFrames - FrameCount); + Con_Printf("SDL sound: %u sample frames missing\n", RequestedFrames - FrameCount); sdlaudiotime += RequestedFrames; } @@ -83,7 +83,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) SDL_AudioSpec wantspec; SDL_AudioSpec obtainspec; - Con_Print ("SndSys_Init: using the SDL module\n"); + Con_DSPrint ("SndSys_Init: using the SDL module\n"); // Init the SDL Audio subsystem if( SDL_InitSubSystem( SDL_INIT_AUDIO ) ) { @@ -101,7 +101,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) wantspec.channels = requested->channels; wantspec.samples = CeilPowerOf2(buffersize); // needs to be a power of 2 on some platforms. - Con_DPrintf("Wanted audio Specification:\n" + Con_Printf("Wanted audio Specification:\n" "\tChannels : %i\n" "\tFormat : 0x%X\n" "\tFrequency : %i\n" @@ -114,7 +114,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) return false; } - Con_DPrintf("Obtained audio specification:\n" + Con_Printf("Obtained audio specification:\n" "\tChannels : %i\n" "\tFormat : 0x%X\n" "\tFrequency : %i\n" diff --git a/snd_wav.c b/snd_wav.c index 7ce6b274..01c7993f 100644 --- a/snd_wav.c +++ b/snd_wav.c @@ -284,7 +284,8 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *sfx) return false; } - Con_DPrintf ("Loading WAV file \"%s\"\n", filename); + if (developer_loading.integer >= 2) + Con_Printf ("Loading WAV file \"%s\"\n", filename); info = GetWavinfo (sfx->name, data, (int)filesize); if (info.channels < 1 || info.channels > 2) // Stereo sounds are allowed (intended for music) diff --git a/snd_win.c b/snd_win.c index 06aed2bb..7f8a4621 100644 --- a/snd_win.c +++ b/snd_win.c @@ -362,7 +362,7 @@ static sndinitstat SndSys_InitDirectSound (const snd_format_t* requested) // Make sure mixer is active IDirectSoundBuffer_Play(pDSBuf, 0, 0, DSBPLAY_LOOPING); - Con_DPrintf(" %d channel(s)\n" + Con_Printf(" %d channel(s)\n" " %d bits/sample\n" " %d samples/sec\n", requested->channels, requested->width * 8, requested->speed); diff --git a/vid_agl.c b/vid_agl.c index d7a4b7c7..1bf5995b 100644 --- a/vid_agl.c +++ b/vid_agl.c @@ -698,6 +698,12 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate gl_platform = "AGL"; gl_videosyncavailable = true; + Con_DPrintf("GL_VENDOR: %s\n", gl_vendor); + Con_DPrintf("GL_RENDERER: %s\n", gl_renderer); + Con_DPrintf("GL_VERSION: %s\n", gl_version); + Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions); + Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions); + multithreadedgl = false; vid_isfullscreen = fullscreen; vid_usingmouse = false; diff --git a/vid_glx.c b/vid_glx.c index 50fb0858..ad52b4a0 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -848,6 +848,12 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate gl_platform = "GLX"; gl_platformextensions = qglXQueryExtensionsString(vidx11_display, vidx11_screen); + Con_DPrintf("GL_VENDOR: %s\n", gl_vendor); + Con_DPrintf("GL_RENDERER: %s\n", gl_renderer); + Con_DPrintf("GL_VERSION: %s\n", gl_version); + Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions); + Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions); + gl_videosyncavailable = false; // COMMANDLINEOPTION: Linux GLX: -nogetprocaddress disables GLX_ARB_get_proc_address (not required, more formal method of getting extension functions) diff --git a/vid_sdl.c b/vid_sdl.c index 959105fb..8b41854a 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -727,6 +727,12 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate gl_platformextensions = ""; gl_videosyncavailable = false; + Con_DPrintf("GL_VENDOR: %s\n", gl_vendor); + Con_DPrintf("GL_RENDERER: %s\n", gl_renderer); + Con_DPrintf("GL_VERSION: %s\n", gl_version); + Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions); + Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions); + GL_Init(); vid_numjoysticks = SDL_NumJoysticks(); diff --git a/vid_shared.c b/vid_shared.c index da1a2e14..c864fb99 100644 --- a/vid_shared.c +++ b/vid_shared.c @@ -385,14 +385,14 @@ int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char * int failed = false; const dllfunction_t *func; - Con_Printf("checking for %s... ", name); + Con_DPrintf("checking for %s... ", name); for (func = funcs;func && func->name;func++) *func->funcvariable = NULL; if (disableparm && (COM_CheckParm(disableparm) || COM_CheckParm("-safe"))) { - Con_Print("disabled by commandline\n"); + Con_DPrint("disabled by commandline\n"); return false; } @@ -404,19 +404,19 @@ int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char * if (!(*func->funcvariable = (void *) GL_GetProcAddress(func->name))) { if (!silent) - Con_Printf("OpenGL extension \"%s\" is missing function \"%s\" - broken driver!\n", name, func->name); + Con_DPrintf("OpenGL extension \"%s\" is missing function \"%s\" - broken driver!\n", name, func->name); failed = true; } } // delay the return so it prints all missing functions if (failed) return false; - Con_Print("enabled\n"); + Con_DPrint("enabled\n"); return true; } else { - Con_Print("not detected\n"); + Con_DPrint("not detected\n"); return false; } } @@ -738,16 +738,10 @@ void VID_CheckExtensions(void) if (!GL_CheckExtension("OpenGL 1.1.0", opengl110funcs, NULL, false)) Sys_Error("OpenGL 1.1.0 functions not found"); - Con_Printf("GL_VENDOR: %s\n", gl_vendor); - Con_Printf("GL_RENDERER: %s\n", gl_renderer); - Con_Printf("GL_VERSION: %s\n", gl_version); - Con_Printf("GL_EXTENSIONS: %s\n", gl_extensions); - Con_Printf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions); - CHECKGLERROR qglGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max_texture_size); - Con_Print("Checking OpenGL extensions...\n"); + Con_DPrint("Checking OpenGL extensions...\n"); // COMMANDLINEOPTION: GL: -nodrawrangeelements disables GL_EXT_draw_range_elements (renders faster) if (!GL_CheckExtension("glDrawRangeElements", drawrangeelementsfuncs, "-nodrawrangeelements", true)) @@ -1072,7 +1066,7 @@ void VID_Shared_Init(void) int VID_Mode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer) { cl_ignoremousemoves = 2; - Con_Printf("Video: %s %dx%dx%dx%dhz%s\n", fullscreen ? "fullscreen" : "window", width, height, bpp, refreshrate, stereobuffer ? " stereo" : ""); + Con_Printf("Initialized Video Mode: %s %dx%dx%dx%dhz%s\n", fullscreen ? "fullscreen" : "window", width, height, bpp, refreshrate, stereobuffer ? " stereo" : ""); if (VID_InitMode(fullscreen, width, height, bpp, vid_userefreshrate.integer ? max(1, refreshrate) : 0, stereobuffer)) { vid.fullscreen = fullscreen; @@ -1164,7 +1158,6 @@ void VID_Start(void) Cvar_SetQuick(&vid_bitsperpixel, com_argv[i+1]); } - Con_Print("Starting video system\n"); success = VID_Mode(vid_fullscreen.integer, vid_width.integer, vid_height.integer, vid_bitsperpixel.integer, vid_refreshrate.integer, vid_stereobuffer.integer); if (!success) { diff --git a/vid_wgl.c b/vid_wgl.c index 638c8348..cdb2107b 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -1025,6 +1025,12 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp, int refreshrat gl_platform = "WGL"; gl_platformextensions = ""; + Con_DPrintf("GL_VENDOR: %s\n", gl_vendor); + Con_DPrintf("GL_RENDERER: %s\n", gl_renderer); + Con_DPrintf("GL_VERSION: %s\n", gl_version); + Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions); + Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions); + gl_videosyncavailable = false; if (qwglGetExtensionsStringARB) diff --git a/wad.c b/wad.c index 8e4c767b..23c0b6e6 100644 --- a/wad.c +++ b/wad.c @@ -148,11 +148,6 @@ unsigned char *W_GetLumpName(const char *name) for (lump = wad.gfx.lumps, i = 0;i < wad.gfx.numlumps;i++, lump++) if (!strcmp(clean, lump->name)) return (wad.gfx_base + lump->filepos); - - if (wad.gfx_base) - Con_DPrintf("W_GetLumpByName(\"%s\"): couldn't find file in gfx.wad\n", name); - else - Con_DPrintf("W_GetLumpByName(\"%s\"): couldn't load gfx.wad\n", name); return NULL; } -- 2.39.2