forked from fte/fteqw
1
0
Fork 0

r_netgraph fix (rid#1214753)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1074 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2005-06-04 13:12:44 +00:00
parent 1b9407b2c2
commit d0bf1e327c
3 changed files with 44 additions and 20 deletions

View File

@ -1842,7 +1842,7 @@ void SCR_DrawTwoDimensional(int uimenu, qboolean nohud)
// draw any areas not covered by the refresh
//
#ifdef RGLQUAKE
if (r_netgraph.value)
if (r_netgraph.value && qrenderer == QR_OPENGL)
GLR_NetGraph ();
#endif

View File

@ -103,18 +103,20 @@ void R_LineGraph (int x, int y, int h)
{
int i;
qbyte *dest;
unsigned short *dest16;
unsigned int *dest32;
int s;
int color;
unsigned int color;
// FIXME: should be disabled on no-buffer adapters, or should be in the driver
// x += r_refdef.vrect.x;
// y += r_refdef.vrect.y;
dest = vid.buffer + vid.rowbytes*y + x;
s = r_graphheight.value;
if (h>s)
h = s;
if (h == 10000)
color = 0x6f; // yellow
else if (h == 9999)
@ -123,22 +125,42 @@ void R_LineGraph (int x, int y, int h)
color = 0xd0; // blue
else
color = 0xff; // pink
switch (r_pixbytes)
{
case 2: // 16 bpp
dest16 = (unsigned short*)vid.buffer + vid.rowbytes*y + x;
if (h>s)
h = s;
for (i=0 ; i<h ; i++, dest -= vid.rowbytes*2)
{
dest[0] = color;
// *(dest-vid.rowbytes) = 0x30;
// use constant colors instead?
color = d_8to16table[color];
for (i=0 ; i<h ; i++, dest16 -= vid.rowbytes*2)
{
dest16[0] = color;
// *(dest-vid.rowbytes) = 0x30;
}
break;
case 4: // 32 bpp
dest32 = (unsigned int*)vid.buffer + vid.rowbytes*y + x;
// use constant colors instead?
color = d_8to32table[color];
for (i=0 ; i<h ; i++, dest32 -= vid.rowbytes*2)
{
dest32[0] = color;
// *(dest-vid.rowbytes) = 0x30;
}
break;
default: // 8 bpp
dest = vid.buffer + vid.rowbytes*y + x;
for (i=0 ; i<h ; i++, dest -= vid.rowbytes*2)
{
dest[0] = color;
// *(dest-vid.rowbytes) = 0x30;
}
}
#if 0
for ( ; i<s ; i++, dest -= vid.rowbytes*2)
{
dest[0] = 0x30;
*(dest-vid.rowbytes) = 0x30;
}
#endif
}
/*

View File

@ -593,6 +593,8 @@ void SWMod_LoadTextures (lump_t *l)
tx->pixbytes = 1;
loadmodel->textures[i] = tx;
tx->parttype = P_ParticleTypeForName(va("tex_%s", tx->name));
memcpy (tx->name, mt->name, sizeof(tx->name));
tx->width = mt->width;
tx->height = mt->height;
@ -600,7 +602,7 @@ void SWMod_LoadTextures (lump_t *l)
tx->offsets[j] = mt->offsets[j] + sizeof(texture_t) - sizeof(miptex_t);
// the pixels immediately follow the structures
memcpy ( tx+1, mt+1, pixels);
if (!Q_strncmp(mt->name,"sky",3))
R_InitSky (tx);
#ifdef PEXT_BULLETENS