Skip to content

Commit

Permalink
Make BlendMode::alpha the fallback for unknown future blend modes
Browse files Browse the repository at this point in the history
  • Loading branch information
x2048 committed Jul 13, 2022
1 parent 20bd6bd commit 6df69f9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/client/particles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ Particle::Particle(
: ParticleParamTypes::BlendMode::alpha;

switch (blendmode) {
case ParticleParamTypes::BlendMode::alpha:
bfsrc = video::EBF_SRC_ALPHA;
bfdst = video::EBF_ONE_MINUS_SRC_ALPHA;
blendop = video::EBO_ADD;
break;

case ParticleParamTypes::BlendMode::add:
bfsrc = video::EBF_SRC_ALPHA;
bfdst = video::EBF_DST_ALPHA;
Expand All @@ -87,7 +81,11 @@ Particle::Particle(
blendop = video::EBO_ADD;
break;

default: assert(false);
default: // includes ParticleParamTypes::BlendMode::alpha
bfsrc = video::EBF_SRC_ALPHA;
bfdst = video::EBF_ONE_MINUS_SRC_ALPHA;
blendop = video::EBO_ADD;
break;
}

// Texture
Expand Down

0 comments on commit 6df69f9

Please sign in to comment.