diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index b253d8a23..cdb51ac29 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -2290,8 +2290,8 @@ void GameView::OnDraw() else if (type == PT_FILT) { sampleInfo << c->ElementResolve(type, ctype); - const char* filtModes[] = {"set colour", "AND", "OR", "subtract colour", "red shift", "blue shift", "no effect", "XOR", "NOT", "old QRTZ scattering"}; - if (sample.particle.tmp>=0 && sample.particle.tmp<=9) + const char* filtModes[] = {"set colour", "AND", "OR", "subtract colour", "red shift", "blue shift", "no effect", "XOR", "NOT", "old QRTZ scattering", "variable red shift", "variable blue shift"}; + if (sample.particle.tmp>=0 && sample.particle.tmp<=11) sampleInfo << " (" << filtModes[sample.particle.tmp] << ")"; else sampleInfo << " (unknown mode)"; diff --git a/src/simulation/elements/FILT.cpp b/src/simulation/elements/FILT.cpp index 63ce3f068..802335adf 100644 --- a/src/simulation/elements/FILT.cpp +++ b/src/simulation/elements/FILT.cpp @@ -89,17 +89,17 @@ int Element_FILT::interactWavelengths(Particle* cpart, int origWl) case 3: return origWl & (~filtWl); //Subtract colour of filt from colour of photon case 4: - { - int shift = int((cpart->temp-273.0f)*0.025f); - if (shift<=0) shift = 1; - return (origWl << shift) & mask; // red shift - } + { + int shift = int((cpart->temp-273.0f)*0.025f); + if (shift<=0) shift = 1; + return (origWl << shift) & mask; // red shift + } case 5: - { - int shift = int((cpart->temp-273.0f)*0.025f); - if (shift<=0) shift = 1; - return (origWl >> shift) & mask; // blue shift - } + { + int shift = int((cpart->temp-273.0f)*0.025f); + if (shift<=0) shift = 1; + return (origWl >> shift) & mask; // blue shift + } case 6: return origWl; // No change case 7: @@ -113,6 +113,16 @@ int Element_FILT::interactWavelengths(Particle* cpart, int origWl) int t3 = ((origWl & 0xFF0000)>>16)+(rand()%5)-2; return (origWl & 0xFF000000) | (t3<<16) | (t2<<8) | t1; } + case 10: + { + long long int lsb = filtWl & (-filtWl); + return (origWl * lsb) & 0x3FFFFFFF; //red shift + } + case 11: + { + long long int lsb = filtWl & (-filtWl); + return (origWl / lsb) & 0x3FFFFFFF; // blue shift + } default: return filtWl; }