From 268158f1ddbdfe6067542bae0bd3fbd425a2c8f6 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Thu, 29 Aug 2013 18:24:44 +0100 Subject: [PATCH] More FILT modes: XOR and NOT --- src/gui/game/GameView.cpp | 4 ++-- src/simulation/elements/FILT.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 01ba39c04..9d4295cb2 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -2071,8 +2071,8 @@ void GameView::OnDraw() else if (sample.particle.type == PT_FILT) { sampleInfo << c->ElementResolve(sample.particle.type, sample.particle.ctype); - const char* filtModes[] = {"set colour", "AND", "OR", "subtract colour", "red shift", "blue shift", "no effect"}; - if (sample.particle.tmp>=0 && sample.particle.tmp<=6) + const char* filtModes[] = {"set colour", "AND", "OR", "subtract colour", "red shift", "blue shift", "no effect", "XOR", "NOT"}; + if (sample.particle.tmp>=0 && sample.particle.tmp<=8) sampleInfo << " (" << filtModes[sample.particle.tmp] << ")"; else sampleInfo << " (unknown mode)"; diff --git a/src/simulation/elements/FILT.cpp b/src/simulation/elements/FILT.cpp index 62c3afcfc..9c7615f8a 100644 --- a/src/simulation/elements/FILT.cpp +++ b/src/simulation/elements/FILT.cpp @@ -100,6 +100,10 @@ int Element_FILT::interactWavelengths(Particle* cpart, int origWl) } case 6: return origWl; // No change + case 7: + return origWl ^ filtWl; // XOR colours + case 8: + return (~origWl) & mask; // Invert colours default: return filtWl; }