cvar_t scr_viewsize = {CVAR_SAVE, "viewsize","100", "how large the view should be, 110 disables inventory bar, 120 disables status bar"};
cvar_t scr_fov = {CVAR_SAVE, "fov","90", "field of vision, 1-170 degrees, default 90, some players use 110-130"};
-cvar_t scr_conalpha = {CVAR_SAVE, "scr_conalpha", "1", "opacity of console background"};
+cvar_t scr_conalpha = {CVAR_SAVE, "scr_conalpha", "1", "opacity of console background gfx/conback"};
+cvar_t scr_conalpha2factor = {CVAR_SAVE, "scr_conalpha2factor", "0", "opacity of console background gfx/conback2 relative to gfx/conback; when 0, gfx/conback2 is not drawn"};
cvar_t scr_conbrightness = {CVAR_SAVE, "scr_conbrightness", "1", "brightness of console background (0 = black, 1 = image)"};
cvar_t scr_conforcewhiledisconnected = {0, "scr_conforcewhiledisconnected", "1", "forces fullscreen console while disconnected"};
+cvar_t scr_conscroll_x = {CVAR_SAVE, "scr_conscroll_x", "0", "scroll speed of gfx/conback in x direction"};
+cvar_t scr_conscroll_y = {CVAR_SAVE, "scr_conscroll_y", "0", "scroll speed of gfx/conback in y direction"};
+cvar_t scr_conscroll2_x = {CVAR_SAVE, "scr_conscroll_x", "0", "scroll speed of gfx/conback2 in x direction"};
+cvar_t scr_conscroll2_y = {CVAR_SAVE, "scr_conscroll_y", "0", "scroll speed of gfx/conback2 in y direction"};
cvar_t scr_menuforcewhiledisconnected = {0, "scr_menuforcewhiledisconnected", "0", "forces menu while disconnected"};
cvar_t scr_centertime = {0, "scr_centertime","2", "how long centerprint messages show"};
cvar_t scr_showram = {CVAR_SAVE, "showram","1", "show ram icon if low on surface cache memory (not used)"};
Cvar_RegisterVariable (&scr_fov);
Cvar_RegisterVariable (&scr_viewsize);
Cvar_RegisterVariable (&scr_conalpha);
+ Cvar_RegisterVariable (&scr_conalpha2factor);
+ Cvar_RegisterVariable (&scr_conscroll_x);
+ Cvar_RegisterVariable (&scr_conscroll_y);
+ Cvar_RegisterVariable (&scr_conscroll2_x);
+ Cvar_RegisterVariable (&scr_conscroll2_y);
Cvar_RegisterVariable (&scr_conbrightness);
Cvar_RegisterVariable (&scr_conforcewhiledisconnected);
Cvar_RegisterVariable (&scr_menuforcewhiledisconnected);
*/
void Con_DrawConsole (int lines)
{
+ float alpha;
+ double sx, sy;
int mask_must = 0;
int mask_mustnot = (developer.integer>0) ? 0 : CON_MASK_DEVELOPER;
cachepic_t *conbackpic;
con_vislines = lines;
// draw the background
- conbackpic = scr_conbrightness.value >= 0.01f ? Draw_CachePic("gfx/conback") : NULL;
- if (conbackpic && conbackpic->tex != r_texture_notexture)
- DrawQ_Pic(0, lines - vid_conheight.integer, conbackpic, vid_conwidth.integer, vid_conheight.integer, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, cls.signon == SIGNONS ? scr_conalpha.value : 1.0f, 0); // always full alpha when not in game
- else
- DrawQ_Fill(0, lines - vid_conheight.integer, vid_conwidth.integer, vid_conheight.integer, 0.0f, 0.0f, 0.0f, cls.signon == SIGNONS ? scr_conalpha.value : 1.0f, 0); // always full alpha when not in game
+ alpha = cls.signon == SIGNONS ? scr_conalpha.value : 1.0f; // always full alpha when not in game
+ if(alpha > 0)
+ {
+ sx = scr_conscroll_x.value;
+ sy = scr_conscroll_y.value;
+ conbackpic = scr_conbrightness.value >= 0.01f ? Draw_CachePic_Flags("gfx/conback", (sx != 0 || sy != 0) ? CACHEPICFLAG_NOCLAMP : 0) : NULL;
+ sx *= realtime; sy *= realtime;
+ sx -= floor(sx); sy -= floor(sy);
+ if (conbackpic && conbackpic->tex != r_texture_notexture)
+ DrawQ_SuperPic(0, lines - vid_conheight.integer, conbackpic, vid_conwidth.integer, vid_conheight.integer,
+ 0 + sx, 0 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 1 + sx, 0 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 0 + sx, 1 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 1 + sx, 1 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 0);
+ else
+ DrawQ_Fill(0, lines - vid_conheight.integer, vid_conwidth.integer, vid_conheight.integer, 0.0f, 0.0f, 0.0f, alpha, 0);
+ alpha *= scr_conalpha2factor.value;
+ }
+ if(alpha > 0)
+ {
+ sx = scr_conscroll2_x.value;
+ sy = scr_conscroll2_y.value;
+ conbackpic = Draw_CachePic_Flags("gfx/conback2", (sx != 0 || sy != 0) ? CACHEPICFLAG_NOCLAMP : 0);
+ sx *= realtime; sy *= realtime;
+ sx -= floor(sx); sy -= floor(sy);
+ if(conbackpic && conbackpic->tex != r_texture_notexture)
+ DrawQ_SuperPic(0, lines - vid_conheight.integer, conbackpic, vid_conwidth.integer, vid_conheight.integer,
+ 0 + sx, 0 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 1 + sx, 0 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 0 + sx, 1 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 1 + sx, 1 + sy, scr_conbrightness.value, scr_conbrightness.value, scr_conbrightness.value, alpha,
+ 0);
+ }
DrawQ_String(vid_conwidth.integer - DrawQ_TextWidth(engineversion, 0, con_textsize.value, con_textsize.value, false, FONT_CONSOLE), lines - con_textsize.value, engineversion, 0, con_textsize.value, con_textsize.value, 1, 0, 0, 1, 0, NULL, true, FONT_CONSOLE);
// draw the text
fs_offset_t lmpsize;
unsigned char *lmpdata;
char lmpname[MAX_QPATH];
+ int texflags;
+
+ texflags = TEXF_ALPHA;
+ if (!(cachepicflags & CACHEPICFLAG_NOCLAMP))
+ texflags |= TEXF_CLAMP;
+ if (!(cachepicflags & CACHEPICFLAG_NOCOMPRESSION) && gl_texturecompression_2d.integer)
+ texflags |= TEXF_COMPRESS;
// check whether the picture has already been cached
crc = CRC_Block((unsigned char *)path, strlen(path));
hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
for (pic = cachepichash[hashkey];pic;pic = pic->chain)
if (!strcmp (path, pic->name))
- return pic;
+ if(pic->texflags == texflags)
+ return pic;
if (numcachepics == MAX_CACHED_PICS)
{
return pic;
}
- pic->texflags = TEXF_ALPHA;
- if (!(cachepicflags & CACHEPICFLAG_NOCLAMP))
- pic->texflags |= TEXF_CLAMP;
- if (!(cachepicflags & CACHEPICFLAG_NOCOMPRESSION) && gl_texturecompression_2d.integer)
- pic->texflags |= TEXF_COMPRESS;
-
+ pic->texflags = texflags;
pic->autoload = (cachepicflags & CACHEPICFLAG_NOTPERSISTENT);
// load a high quality image from disk if possible