diff --git a/source/cl_hud.c b/source/cl_hud.c index 48fe826..dceda39 100644 --- a/source/cl_hud.c +++ b/source/cl_hud.c @@ -479,11 +479,7 @@ void HUD_Blood (void) return; float color = 255.0 + modifier; - Draw_ColorPic(0,0,fx_blood_lu,color,color,color,alpha); - //Draw_ColorPic (0, 0, fx_blood_lu, 82, 6, 6, alpha); - /*Draw_ColorPic (0, vid.height - fx_blood_ru->height, fx_blood_ld, 82, 6, 6, alpha); - Draw_ColorPic (vid.width - fx_blood_ru->width, 0, fx_blood_ru, 82, 6, 6, alpha); - Draw_ColorPic (vid.width - fx_blood_ru->width, vid.height - fx_blood_ru->height, fx_blood_rd, 82, 6, 6, alpha);*/ + Draw_ColoredStretchPic(0, 0, fx_blood_lu, 400, 240, color,color,color,alpha); } /* diff --git a/source/draw.h b/source/draw.h index 7be2555..ee77d96 100644 --- a/source/draw.h +++ b/source/draw.h @@ -28,6 +28,7 @@ void Draw_Character (int x, int y, int num); void Draw_DebugChar (char num); void Draw_Pic (int x, int y, qpic_t *pic); void Draw_StretchPic (int x, int y, qpic_t *pic, int x_value, int y_value); +void Draw_ColoredStretchPic (int x, int y, qpic_t *pic, int x_value, int y_value, float r, float g , float b, float a); void Draw_ColorPic (int x, int y, qpic_t *pic, float r, float g , float b, float a); void Draw_TransPic (int x, int y, qpic_t *pic); void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation); diff --git a/source/gl_draw.c b/source/gl_draw.c index 759ae9c..9f74553 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -567,6 +567,40 @@ void Draw_Pic (int x, int y, qpic_t *pic) Draw_ColorPic(x, y, pic, 255, 255, 255, 255); } +/* +============= +Draw_ColoredStretchPic +============= +*/ +void Draw_ColoredStretchPic (int x, int y, qpic_t *pic, int x_value, int y_value, float r, float g , float b, float a) +{ + glpic_t *gl; + + if (scrap_dirty) + Scrap_Upload (); + gl = (glpic_t *)pic->data; + + + glEnable(GL_BLEND); + glColor4f(r/255.0,g/255.0,b/255.0,a/255.0); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + GL_Bind (gl->texnum); + glBegin (GL_QUADS); + glTexCoord2f (0, 0); + glVertex2f (x, y); + glTexCoord2f (1, 0); + glVertex2f (x+x_value, y); + glTexCoord2f (1, 1); + glVertex2f (x+x_value, y+y_value); + glTexCoord2f (0, 1); + glVertex2f (x, y+y_value); + glEnd (); + + glColor4f(1,1,1,1); +} + /* ============= Draw_StretchPic