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
|
// draw any areas not covered by the refresh
|
||||||
//
|
//
|
||||||
#ifdef RGLQUAKE
|
#ifdef RGLQUAKE
|
||||||
if (r_netgraph.value)
|
if (r_netgraph.value && qrenderer == QR_OPENGL)
|
||||||
GLR_NetGraph ();
|
GLR_NetGraph ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -103,18 +103,20 @@ void R_LineGraph (int x, int y, int h)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
qbyte *dest;
|
qbyte *dest;
|
||||||
|
unsigned short *dest16;
|
||||||
|
unsigned int *dest32;
|
||||||
int s;
|
int s;
|
||||||
int color;
|
unsigned int color;
|
||||||
|
|
||||||
// FIXME: should be disabled on no-buffer adapters, or should be in the driver
|
// FIXME: should be disabled on no-buffer adapters, or should be in the driver
|
||||||
|
|
||||||
// x += r_refdef.vrect.x;
|
// x += r_refdef.vrect.x;
|
||||||
// y += r_refdef.vrect.y;
|
// y += r_refdef.vrect.y;
|
||||||
|
|
||||||
dest = vid.buffer + vid.rowbytes*y + x;
|
|
||||||
|
|
||||||
s = r_graphheight.value;
|
s = r_graphheight.value;
|
||||||
|
|
||||||
|
if (h>s)
|
||||||
|
h = s;
|
||||||
|
|
||||||
if (h == 10000)
|
if (h == 10000)
|
||||||
color = 0x6f; // yellow
|
color = 0x6f; // yellow
|
||||||
else if (h == 9999)
|
else if (h == 9999)
|
||||||
|
@ -123,22 +125,42 @@ void R_LineGraph (int x, int y, int h)
|
||||||
color = 0xd0; // blue
|
color = 0xd0; // blue
|
||||||
else
|
else
|
||||||
color = 0xff; // pink
|
color = 0xff; // pink
|
||||||
|
|
||||||
|
switch (r_pixbytes)
|
||||||
|
{
|
||||||
|
case 2: // 16 bpp
|
||||||
|
dest16 = (unsigned short*)vid.buffer + vid.rowbytes*y + x;
|
||||||
|
|
||||||
if (h>s)
|
// use constant colors instead?
|
||||||
h = s;
|
color = d_8to16table[color];
|
||||||
|
|
||||||
for (i=0 ; i<h ; i++, dest -= vid.rowbytes*2)
|
for (i=0 ; i<h ; i++, dest16 -= vid.rowbytes*2)
|
||||||
{
|
{
|
||||||
dest[0] = color;
|
dest16[0] = color;
|
||||||
// *(dest-vid.rowbytes) = 0x30;
|
// *(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;
|
tx->pixbytes = 1;
|
||||||
loadmodel->textures[i] = tx;
|
loadmodel->textures[i] = tx;
|
||||||
|
|
||||||
|
tx->parttype = P_ParticleTypeForName(va("tex_%s", tx->name));
|
||||||
|
|
||||||
memcpy (tx->name, mt->name, sizeof(tx->name));
|
memcpy (tx->name, mt->name, sizeof(tx->name));
|
||||||
tx->width = mt->width;
|
tx->width = mt->width;
|
||||||
tx->height = mt->height;
|
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);
|
tx->offsets[j] = mt->offsets[j] + sizeof(texture_t) - sizeof(miptex_t);
|
||||||
// the pixels immediately follow the structures
|
// the pixels immediately follow the structures
|
||||||
memcpy ( tx+1, mt+1, pixels);
|
memcpy ( tx+1, mt+1, pixels);
|
||||||
|
|
||||||
if (!Q_strncmp(mt->name,"sky",3))
|
if (!Q_strncmp(mt->name,"sky",3))
|
||||||
R_InitSky (tx);
|
R_InitSky (tx);
|
||||||
#ifdef PEXT_BULLETENS
|
#ifdef PEXT_BULLETENS
|
||||||
|
|
Loading…
Reference in a new issue