- x += 8;
- }
- glEnd ();
-
- // LordHavoc: revert to LINEAR mode
-// if (glwidth < (int) vid.width)
-// {
-// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-// }
-}
-
-void Draw_GenericPic (rtexture_t *tex, float red, float green, float blue, float alpha, int x, int y, int width, int height)
-{
- if (!r_render.value)
- return;
- glColor4f(red,green,blue,alpha);
- glBindTexture(GL_TEXTURE_2D, R_GetTexture(tex));
- glBegin (GL_QUADS);
- glTexCoord2f (0, 0);glVertex2f (x, y);
- glTexCoord2f (1, 0);glVertex2f (x+width, y);
- glTexCoord2f (1, 1);glVertex2f (x+width, y+height);
- glTexCoord2f (0, 1);glVertex2f (x, y+height);
- glEnd ();
-}
-
-/*
-=============
-Draw_AlphaPic
-=============
-*/
-void Draw_AlphaPic (int x, int y, qpic_t *pic, float alpha)
-{
- Draw_GenericPic(((glpic_t *)pic->data)->tex, 1,1,1,alpha, x,y,pic->width, pic->height);
-}
-
-
-/*
-=============
-Draw_Pic
-=============
-*/
-void Draw_Pic (int x, int y, qpic_t *pic)
-{
- Draw_GenericPic(((glpic_t *)pic->data)->tex, 1,1,1,1, x,y,pic->width, pic->height);
-}
-
-
-/*
-=============
-Draw_PicTranslate
-
-Only used for the player color selection menu
-=============
-*/
-void Draw_PicTranslate (int x, int y, qpic_t *pic, byte *translation)
-{
- int i, c;
- byte *trans, *src, *dest;
- rtexture_t *rt;
-
- c = pic->width * pic->height;
- src = menuplyr_pixels;
- dest = trans = qmalloc(c);
- for (i = 0;i < c;i++)
- *dest++ = translation[*src++];
-
- rt = R_LoadTexture ("translatedplayerpic", pic->width, pic->height, trans, TEXF_ALPHA | TEXF_PRECACHE);
- qfree(trans);
-
- if (!r_render.value)
- return;
- Draw_GenericPic (rt, 1,1,1,1, x, y, pic->width, pic->height);
-}
-
-
-/*
-================
-Draw_ConsoleBackground
-
-================
-*/
-void Draw_ConsoleBackground (int lines)
-{
- Draw_GenericPic (conbacktex, 1,1,1,scr_conalpha.value*lines/vid.height, 0, lines - vid.height, vid.width, vid.height);
- // LordHavoc: draw version
- Draw_String(engineversionx, lines - vid.height + engineversiony, engineversion, 9999);
-}
-
-/*
-=============
-Draw_Fill
-
-Fills a box of pixels with a single color
-=============
-*/
-void Draw_Fill (int x, int y, int w, int h, int c)
-{
- if (!r_render.value)
- return;
- glDisable (GL_TEXTURE_2D);
- glColor3f (host_basepal[c*3]/255.0, host_basepal[c*3+1]/255.0, host_basepal[c*3+2]/255.0);
-
- glBegin (GL_QUADS);
-
- glVertex2f (x,y);
- glVertex2f (x+w, y);
- glVertex2f (x+w, y+h);
- glVertex2f (x, y+h);
-
- glEnd ();
- glColor3f(1,1,1);
- glEnable (GL_TEXTURE_2D);
-}
-//=============================================================================
-
-//=============================================================================
-
-/*
-================
-GL_Set2D
-
-Setup as if the screen was 320*200
-================
-*/
-void GL_Set2D (void)
-{
- if (!r_render.value)
- return;
- glViewport (glx, gly, glwidth, glheight);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity ();
- glOrtho (0, vid.width, vid.height, 0, -99999, 99999);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity ();
-
- glDisable (GL_DEPTH_TEST);
- glDisable (GL_CULL_FACE);
- glEnable (GL_BLEND);
- glDisable (GL_ALPHA_TEST);
- glEnable(GL_TEXTURE_2D);
-
- // LordHavoc: added this
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- glColor3f(1,1,1);
-}
-
-// LordHavoc: SHOWLMP stuff
-#define SHOWLMP_MAXLABELS 256
-typedef struct showlmp_s
-{
- qboolean isactive;
- float x;
- float y;
- char label[32];
- char pic[128];
-} showlmp_t;
-
-showlmp_t showlmp[SHOWLMP_MAXLABELS];
-
-void SHOWLMP_decodehide()
-{
- int i;
- byte *lmplabel;
- lmplabel = MSG_ReadString();
- for (i = 0;i < SHOWLMP_MAXLABELS;i++)
- if (showlmp[i].isactive && strcmp(showlmp[i].label, lmplabel) == 0)