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:
parent
1b9407b2c2
commit
d0bf1e327c
3 changed files with 44 additions and 20 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
@ -124,21 +126,41 @@ void R_LineGraph (int x, int y, int h)
|
|||
else
|
||||
color = 0xff; // pink
|
||||
|
||||
if (h>s)
|
||||
h = s;
|
||||
switch (r_pixbytes)
|
||||
{
|
||||
case 2: // 16 bpp
|
||||
dest16 = (unsigned short*)vid.buffer + vid.rowbytes*y + x;
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue