Zandronum Chat on our Discord Server Get the latest version: 3.1
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002642Zandronum[All Projects] Suggestionpublic2016-02-16 09:162016-10-10 22:41
Reportercapodecima 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusnewResolutionopen 
PlatformMicrosoftOSWindowsOS VersionXP/Vista/7
Product Version 
Target VersionFixed in Version 
Summary0002642: Transparent gun, variable r_drawplayersprites
DescriptionThis feature is best known from Quakelive. For competitive gaming can be this feature very useful. Chowww already made patch for it, this could looks something like this'http://image.noelshack.com/fichiers/2014/37/1410570961-odamex-coop-20140913-031518-copy.png. [^]' The command r_playersprites can be variable from 1 (enabled sprites) to 0 (fully transparent). This feature is already on odamex btw.

The code:
1) Change the r_drawplayersprites cvar in cl_cvarlist.cpp :

CVAR_RANGE (r_drawplayersprites, "1", "Draws Weapon opacity", CVARTYPE_FLOAT, CVAR_ARCHIVE | CVAR_NOENABLEDISABLE, 0.0f, 1.0f)

2) in r_things.cpp, in void R_DrawPSprite (pspdef_t* psp, unsigned flags):
find this:
    vis->translucency = FRACUNIT;

And replace by:
    vis->translucency = r_drawplayersprites * FRACUNIT; // Ch0wW: Weapon opacity

Should do the trick.

Can be prob slightly diff on zandronum
Attached Files

- Relationships

-  Notes
User avatar (0014506)
Ch0wW (reporter)
2016-02-27 12:55
edited on: 2016-02-27 12:58

That's not that easy to put it that way, capo ;)

There's much more elements to check, especially with the software AND OpenGL renderer.

The way I've done was not the best, but well, it works:

1) In gl_model.cpp, in void FGLRenderer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)

2) I added a fixed_t variable called alphawp;

3)
// Ch0wW: Add alphaweapons START
    
    if (PLAYER_IsTrueSpectator(playermo->player))
        playermo->RenderStyle = STYLE_None;
    else
        playermo->RenderStyle = STYLE_Translucent;
        alphawp = FRACUNIT*r_drawplayersprites;

    vis.RenderStyle=playermo->RenderStyle;
    vis.alpha=alphawp;
    // Ch0wW: Add alphaweapons STOP


That way, the local character is rendered with opacity, which affects the weapon too.

But I'm not against this o/ .


Issue Community Support
Only registered users can voice their support. Click here to register, or here to log in.
Supporters: FascistCat Catastrophe Ch0wW
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2016-02-16 09:16 capodecima New Issue
2016-02-27 12:55 Ch0wW Note Added: 0014506
2016-02-27 12:58 Ch0wW Note Edited: 0014506 View Revisions
2016-10-10 22:41 capodecima Note Added: 0015890
2016-10-11 05:29 Dusk Note Deleted: 0015890






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker