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);
}
}
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)
{
\r
#define DEFAULT_DYNTEXTURE r_texture_grey128\r
\r
-static dyntexture_t * cl_finddyntexture( const char *name ) {\r
+static dyntexture_t * cl_finddyntexture( const char *name, qboolean warnonfailure ) {\r
unsigned i;\r
dyntexture_t *dyntexture = NULL;\r
\r
// sanity checks - make sure its actually a dynamic texture path\r
if( !name || !*name || strncmp( name, CLDYNTEXTUREPREFIX, sizeof( CLDYNTEXTUREPREFIX ) - 1 ) != 0 ) {\r
// TODO: print a warning or something\r
- if( developer.integer > 0 ) {\r
+ if (warnonfailure)\r
Con_Printf( "cl_finddyntexture: Bad dynamic texture name '%s'\n", name );\r
- }\r
return NULL;\r
}\r
\r
}\r
\r
rtexture_t * CL_GetDynTexture( const char *name ) {\r
- dyntexture_t *dyntexture = cl_finddyntexture( name );\r
+ dyntexture_t *dyntexture = cl_finddyntexture( name, false );\r
if( dyntexture ) {\r
return dyntexture->texture;\r
} else {\r
cachepic_t *cachepic;\r
skinframe_t *skinframe;\r
\r
- dyntexture = cl_finddyntexture( name );\r
+ dyntexture = cl_finddyntexture( name, true );\r
if( !dyntexture ) {\r
Con_Printf( "CL_LinkDynTexture: internal error in cl_finddyntexture!\n" );\r
return;\r
if( dyntexture->texture != texture ) {\r
dyntexture->texture = texture;\r
\r
- cachepic = Draw_CachePic( name, false );\r
+ cachepic = Draw_CachePic_Flags( name, CACHEPICFLAG_NOTPERSISTENT );\r
// TODO: assert cachepic and skinframe should be valid pointers...\r
// TODO: assert cachepic->tex = dyntexture->texture\r
cachepic->tex = texture;\r
{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" );
// 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);
}
*/
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)
{
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);
}
/*
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);
}
/*
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);
}
if (!scr_showbrand.value)
return;
- pic = Draw_CachePic ("gfx/brand", true);
+ pic = Draw_CachePic ("gfx/brand");
switch ((int)scr_showbrand.value)
{
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);
}
/*
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);
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;
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;
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
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");
}
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
}
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
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);
}
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)
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;
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
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);
}
}
}
static void gl_backend_start(void)
{
- Con_Print("OpenGL Backend starting...\n");
CHECKGLERROR
if (qglDrawRangeElements != NULL)
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);
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
backendarrayunits = 0;
backendactive = false;
- Con_Print("OpenGL Backend shutting down\n");
+ Con_DPrint("OpenGL Backend shutting down\n");
Mem_ExpandableArray_FreeArray(&gl_bufferobjectinfoarray);
{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++)
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;
}
================
*/
// 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;
}
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
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;
}
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
// 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)
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
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);
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);
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);
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];
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"};
Cvar_RegisterVariable (&cl_maxidlefps);
Cvar_RegisterVariable (&developer);
+ Cvar_RegisterVariable (&developer_loadfile);
+ Cvar_RegisterVariable (&developer_loading);
Cvar_RegisterVariable (&developer_entityparsing);
Cvar_RegisterVariable (×tamps);
// 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"))
if (cls.state != ca_dedicated)
{
- Con_Printf("Initializing client\n");
+ Con_DPrintf("Initializing client\n");
R_Modules_Init();
Palette_Init();
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<c+1 ; i++)
strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof (cls.demos[i-1]));
return data;
}
else
- {
- if (developer.integer >= 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)
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);
}
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);
}
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);
}
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)
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;
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
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)
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)
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++)
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 ; i<MAX_SAVEGAMES ; i++)
cachepic_t *p;
M_Background(640, 480);
- p = Draw_CachePic ("gfx/menu/tb-episodes", true);
+ p = Draw_CachePic ("gfx/menu/tb-episodes");
M_DrawPic (640/2 - p->width/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));
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++)
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));
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");
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");
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;
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;
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;
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;
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)
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
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");
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);
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)
{
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)
{
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);
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);
}
}
}
{
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]
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;
}
}
}
}
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);
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++;
}
unsigned short st;
}
*hash, **md2verthash, *md2verthashdata;
- skinframe_t *tempskinframe;
skinfile_t *skinfiles;
pinmodel = (md2_t *)buffer;
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
{
}
}
- 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__);
}
// 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);
}
// 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__);
}
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;
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;
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);
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;
{
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))
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)
;
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);
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;
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);
memcpy (&entry->shader, shader, sizeof (q3shaderinfo_t));
}
+extern cvar_t r_picmipworld;
void Mod_LoadQ3Shaders(void)
{
int j;
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;
}
}
}
- // 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)
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;
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();
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();
}
}
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;
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;
{
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;
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++;
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;
int clampmap;
float framerate;
int numframes;
+ int texflags;
char** texturename;
int blendfunc[2];
q3shaderinfo_layer_rgbgen_t rgbgen;
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;
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;
}
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;
}
/*
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,
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;
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
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)
// 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);
}
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;
}
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);
}
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)
if (j == 3)
return false;
+ if (developer_loading.integer)
+ Con_Printf("loading skybox \"%s\"\n", name);
+
return true;
}
}
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)
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);
}
//=============================================================================
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)
{
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 ?
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);
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)
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);
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)
// 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;
}
*/
void S_Init(void)
{
- Con_DPrint("\nSound Initialization\n");
-
Cvar_RegisterVariable(&volume);
Cvar_RegisterVariable(&bgmvolume);
Cvar_RegisterVariable(&snd_staticvolume);
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)
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;
}
// 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))
}
// 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
// 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;
}
// 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);
}
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;
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);
// 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);
}
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;
{
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);
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);
{
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;
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;
}
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 ) ) {
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"
return false;
}
- Con_DPrintf("Obtained audio specification:\n"
+ Con_Printf("Obtained audio specification:\n"
"\tChannels : %i\n"
"\tFormat : 0x%X\n"
"\tFrequency : %i\n"
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)
// 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);
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;
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)
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();
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;
}
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;
}
}
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))
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;
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)
{
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)
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;
}