Skip to content
Snippets Groups Projects
Commit 506196b8 authored by slevy's avatar slevy
Browse files

txbind(): only change blending modes if BLEND_OFF|BLEND_ON is different

from previous time.  Add TXF_OVER txflags bit.
parent 92094bdd
No related branches found
No related tags found
No related merge requests found
...@@ -181,7 +181,7 @@ int txbind( Texture *tx, int *enabled ) ...@@ -181,7 +181,7 @@ int txbind( Texture *tx, int *enabled )
} }
} }
if(wanted != *enabled) { if((wanted ^ *enabled) & (BLEND_ON|BLEND_OFF)) {
if(wanted & BLEND_ON) { if(wanted & BLEND_ON) {
glEnable( GL_BLEND ); glEnable( GL_BLEND );
if(tx->flags & TXF_ADD) { if(tx->flags & TXF_ADD) {
......
...@@ -55,6 +55,7 @@ extern Texture *AllLoadedTextures; /* List of em */ ...@@ -55,6 +55,7 @@ extern Texture *AllLoadedTextures; /* List of em */
#define TXF_ALPHA 0x20 /* "use alpha channel" (if 1-chan, it's 000A) */ #define TXF_ALPHA 0x20 /* "use alpha channel" (if 1-chan, it's 000A) */
#define TXF_INTENSITY 0x40 /* synthesize alpha = intensity */ #define TXF_INTENSITY 0x40 /* synthesize alpha = intensity */
#define TXF_ADD 0x80 /* synthesize alpha = 0 (so "over" == "add") */ #define TXF_ADD 0x80 /* synthesize alpha = 0 (so "over" == "add") */
#define TXF_OVER 0x100 /* always use "over" compositing */
#define TX_APPLY 451 /* Interpret texture values to... */ #define TX_APPLY 451 /* Interpret texture values to... */
#define TXF_MODULATE 0 #define TXF_MODULATE 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment