From 62f798645969ceab930fda656a09cf2c865e0cbb Mon Sep 17 00:00:00 2001 From: Allanis Date: Thu, 3 Oct 2013 01:01:39 +0100 Subject: [PATCH] [Change] Make the start of beam not be so abrupt. --- src/weapon.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/weapon.c b/src/weapon.c index cfa45e6..73382a3 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -379,6 +379,8 @@ static void weapon_render(const Weapon* w) { case OUTFIT_TYPE_BEAM: case OUTFIT_TYPE_TURRET_BEAM: gfx = outfit_gfx(w->outfit); + + /* Position. */ x = w->solid->pos.x - VX(*gl_camera) + gui_xoff; y = w->solid->pos.y - VY(*gl_camera) + gui_yoff; @@ -395,15 +397,25 @@ static void weapon_render(const Weapon* w) { /* Actual rendering. */ glBegin(GL_QUAD_STRIP); - COLOUR(cWhite); - /* Full strength. */ + /* Start fading. */ + ACOLOUR(cWhite, 0.); + glTexCoord2d(0., 0.); glVertex2d(-gfx->sh/2., 0.); glTexCoord2d(0., 1.); glVertex2d(+gfx->sh/2., 0.); + /* Full Strength. */ + COLOUR(cWhite); + + glTexCoord2d(10. / gfx->sw, 0.); + glVertex2d(-gfx->sh/2., 10.); + + glTexCoord2d(10. / gfx->sw, 1.); + glVertex2d(+gfx->sh/2., 10.); + glTexCoord2d(0.8*w->outfit->u.bem.range / gfx->sw, 0.); glVertex2d(+gfx->sh/2., 0.8*w->outfit->u.bem.range);