diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-08-29 16:19:07 (GMT) |
|---|---|---|
| committer | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-08-29 16:19:07 (GMT) |
| commit | bebe9bd8fd0e4b73fdeb9ea0218bda704e0a6fad (patch) | |
| tree | 1761908c99d6848aede291df5de67fff5b32a425 /src/simulation/Simulation.cpp | |
| parent | c59b6d04660b1ac41d8f83f7b84218d13d9d29b8 (diff) | |
| download | powder-bebe9bd8fd0e4b73fdeb9ea0218bda704e0a6fad.zip powder-bebe9bd8fd0e4b73fdeb9ea0218bda704e0a6fad.tar.gz | |
Add a way for photons to set the colour of FILT (major version bump required)
Also add some new FILT modes, and make FILT modes affect BIZR and
BRAY colour in the same way as they affect photon colour. Photons
passing next to DTEC will set the colour of all FILT in a straight
line starting from any FILT adjacent to the DTEC (a bit like an
ARAY beam), and the exact colour of the photon will be used for
FILT interactions instead of the colour based on temperature.
FILT tmp=4: red shift, tmp=5: blue shift. Size of shift determined
by FILT temperature. tmp=6: FILT has no effect on photon colour
(possible before by using invalid tmp modes, but here's a supported
method of doing it. Invalid tmp modes should be automatically replaced
in existing saves).
Also, FILT mode is now described in the HUD.
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index c1cf22e..64371ac 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2200,18 +2200,7 @@ int Simulation::try_move(int i, int x, int y, int nx, int ny) } if (parts[i].type == PT_PHOT && (r&0xFF)==PT_FILT) { - int temp_bin = (int)((parts[r>>8].temp-273.0f)*0.025f); - if (temp_bin < 0) temp_bin = 0; - if (temp_bin > 25) temp_bin = 25; - if(!parts[r>>8].tmp){ - parts[i].ctype = 0x1F << temp_bin; //Assign Colour - } else if(parts[r>>8].tmp==1){ - parts[i].ctype &= 0x1F << temp_bin; //Filter Colour - } else if(parts[r>>8].tmp==2){ - parts[i].ctype |= 0x1F << temp_bin; //Add Colour - } else if(parts[r>>8].tmp==3){ - parts[i].ctype &= ~(0x1F << temp_bin); //Subtract Colour - } + parts[i].ctype = Element_FILT::interactWavelengths(&parts[r>>8], parts[i].ctype); } if (parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { if (rand() < RAND_MAX/10) @@ -2223,10 +2212,7 @@ int Simulation::try_move(int i, int x, int y, int nx, int ny) } if ((parts[i].type==PT_BIZR||parts[i].type==PT_BIZRG) && (r&0xFF)==PT_FILT) { - int temp_bin = (int)((parts[r>>8].temp-273.0f)*0.025f); - if (temp_bin < 0) temp_bin = 0; - if (temp_bin > 25) temp_bin = 25; - parts[i].ctype = 0x1F << temp_bin; + parts[i].ctype = Element_FILT::interactWavelengths(&parts[r>>8], parts[i].ctype); } if (((r&0xFF)==PT_BIZR || (r&0xFF)==PT_BIZRG || (r&0xFF)==PT_BIZRS) && parts[i].type==PT_PHOT) { |
