mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 07:37:52 +00:00
ref: add new special rendermode that specifically used for modulate mode in engine's ScreenFade
This commit is contained in:
parent
4684f174ee
commit
4bbd0cc404
@ -67,6 +67,10 @@ GNU General Public License for more details.
|
|||||||
#define FWORLD_WATERALPHA BIT( 2 )
|
#define FWORLD_WATERALPHA BIT( 2 )
|
||||||
#define FWORLD_HAS_DELUXEMAP BIT( 3 )
|
#define FWORLD_HAS_DELUXEMAP BIT( 3 )
|
||||||
|
|
||||||
|
// special rendermode for screenfade modulate
|
||||||
|
// (probably will be expanded at some point)
|
||||||
|
#define kRenderScreenFadeModulate 0x1000
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
DEMO_INACTIVE = 0,
|
DEMO_INACTIVE = 0,
|
||||||
|
@ -417,6 +417,10 @@ void GL_SetRenderMode( int mode )
|
|||||||
pglDisable( GL_ALPHA_TEST );
|
pglDisable( GL_ALPHA_TEST );
|
||||||
pglBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
pglBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
||||||
break;
|
break;
|
||||||
|
case kRenderScreenFadeModulate:
|
||||||
|
pglEnable( GL_BLEND );
|
||||||
|
pglDisable( GL_ALPHA_TEST );
|
||||||
|
pglBlendFunc( GL_ZERO, GL_SRC_COLOR );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,11 +165,15 @@ void R_DrawStretchPicImplementation( int x, int y, int w, int h, int s1, int t1,
|
|||||||
pixel_t screen = dest[u];
|
pixel_t screen = dest[u];
|
||||||
dest[u] = vid.addmap[(src & 0xff00)|(screen>>8)] << 8 | (screen & 0xff) | ((src & 0xff) >> 0);
|
dest[u] = vid.addmap[(src & 0xff00)|(screen>>8)] << 8 | (screen & 0xff) | ((src & 0xff) >> 0);
|
||||||
}
|
}
|
||||||
|
else if( vid.rendermode == kRenderScreenFadeModulate )
|
||||||
|
{
|
||||||
|
pixel_t screen = dest[u];
|
||||||
|
dest[u] = BLEND_COLOR( screen, vid.color );
|
||||||
|
}
|
||||||
else if( alpha < 7) // && (vid.rendermode == kRenderTransAlpha || vid.rendermode == kRenderTransTexture ) )
|
else if( alpha < 7) // && (vid.rendermode == kRenderTransAlpha || vid.rendermode == kRenderTransTexture ) )
|
||||||
{
|
{
|
||||||
pixel_t screen = dest[u]; // | 0xff & screen & src ;
|
pixel_t screen = dest[u]; // | 0xff & screen & src ;
|
||||||
dest[u] = BLEND_ALPHA( alpha, src, screen );//vid.alphamap[( alpha << 16)|(src & 0xff00)|(screen>>8)] << 8 | (screen & 0xff) >> 3 | ((src & 0xff) >> 3);
|
dest[u] = BLEND_ALPHA( alpha, src, screen );//vid.alphamap[( alpha << 16)|(src & 0xff00)|(screen>>8)] << 8 | (screen & 0xff) >> 3 | ((src & 0xff) >> 3);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dest[u] = src;
|
dest[u] = src;
|
||||||
|
Loading…
Reference in New Issue
Block a user