From d0bf1e327ce65679a26901e1f55310eb90af129d Mon Sep 17 00:00:00 2001 From: TimeServ Date: Sat, 4 Jun 2005 13:12:44 +0000 Subject: [PATCH] r_netgraph fix (rid#1214753) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1074 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_screen.c | 2 +- engine/sw/r_misc.c | 58 +++++++++++++++++++++++++++------------ engine/sw/sw_model.c | 4 ++- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index 0c73d7281..be452f698 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -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 diff --git a/engine/sw/r_misc.c b/engine/sw/r_misc.c index 06dd20f36..a0b509712 100644 --- a/engine/sw/r_misc.c +++ b/engine/sw/r_misc.c @@ -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 ; ipixbytes = 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